diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4c05acb684b7..d5958853701ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -384,6 +384,7 @@ jobs: - build-windows-aarch64 - test-linux-x64 - test-macos-x64 + - test-macos-aarch64 - test-windows-x64 steps: diff --git a/doc/building.html b/doc/building.html index 707531553124b..c91d876246cde 100644 --- a/doc/building.html +++ b/doc/building.html @@ -614,10 +614,9 @@

clang

--with-toolchain-type=clang.

Apple Xcode

The oldest supported version of Xcode is 13.0.

-

You will need the Xcode command line developer tools to be able to -build the JDK. (Actually, only the command line tools are -needed, not the IDE.) The simplest way to install these is to run:

-
xcode-select --install
+

You will need to download Xcode either from the App Store or specific +versions can be easily located via the Xcode Releases website.

When updating Xcode, it is advisable to keep an older version for building the JDK. To use a specific version of Xcode you have multiple options:

diff --git a/doc/building.md b/doc/building.md index 51ac0cad7d98b..47ad9e7c72b4c 100644 --- a/doc/building.md +++ b/doc/building.md @@ -422,13 +422,9 @@ To use clang instead of gcc on Linux, use `--with-toolchain-type=clang`. The oldest supported version of Xcode is 13.0. -You will need the Xcode command line developer tools to be able to build the -JDK. (Actually, *only* the command line tools are needed, not the IDE.) The -simplest way to install these is to run: - -``` -xcode-select --install -``` +You will need to download Xcode either from the App Store or specific versions +can be easily located via the [Xcode Releases](https://xcodereleases.com) +website. When updating Xcode, it is advisable to keep an older version for building the JDK. To use a specific version of Xcode you have multiple options: diff --git a/make/Main.gmk b/make/Main.gmk index 46150839f8029..4b3efaf651ec9 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -568,6 +568,10 @@ $(eval $(call SetupTarget, update-build-docs, \ MAKEFILE := UpdateBuildDocs, \ )) +$(eval $(call SetupTarget, update-sleef-source, \ + MAKEFILE := UpdateSleefSource, \ +)) + $(eval $(call SetupTarget, update-x11wrappers, \ MAKEFILE := UpdateX11Wrappers, \ DEPS := java.base-copy buildtools-jdk, \ diff --git a/make/UpdateSleefSource.gmk b/make/UpdateSleefSource.gmk new file mode 100644 index 0000000000000..37a28abcb85c2 --- /dev/null +++ b/make/UpdateSleefSource.gmk @@ -0,0 +1,153 @@ +# +# Copyright (c) 2024, 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. +# + +################################################################################ + +default: all + +include $(SPEC) +include MakeBase.gmk + +include CopyFiles.gmk +include Execute.gmk + +################################################################################ +# This file is responsible for updating the generated sleef source code files +# that are checked in to the JDK repo, and that are actually used when building. +# This target needs to be re-run every time the source code of libsleef is +# updated from upstream. +################################################################################ + +ifneq ($(COMPILE_TYPE), cross) + $(error Only cross-compilation of libsleef is currently supported) +endif + +ifeq ($(CMAKE), ) + $(error CMake not found. Please install cmake and rerun configure) +endif + +ifneq ($(OPENJDK_BUILD_OS), linux) + $(error This target is only supported on linux) +endif + +SLEEF_SUPPORT_DIR := $(MAKESUPPORT_OUTPUTDIR)/sleef +SLEEF_SOURCE_BASE_DIR := $(TOPDIR)/src/jdk.incubator.vector/linux/native/libsleef +SLEEF_SOURCE_DIR := $(SLEEF_SOURCE_BASE_DIR)/upstream +SLEEF_TARGET_DIR := $(SLEEF_SOURCE_BASE_DIR)/generated +SLEEF_NATIVE_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/native +SLEEF_CROSS_BUILD_DIR := $(SLEEF_SUPPORT_DIR)/cross + +ifeq ($(OPENJDK_TARGET_CPU), aarch64) + CROSS_COMPILATION_FILENAMES := sleefinline_advsimd.h sleefinline_sve.h + EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_SVE=TRUE +else ifeq ($(OPENJDK_TARGET_CPU), riscv64) + CROSS_COMPILATION_FILENAMES := sleefinline_rvvm1.h + EXTRA_CROSS_OPTIONS := -DSLEEF_ENFORCE_RVVM1=TRUE +else + $(error Unsupported platform) +endif +CROSS_COMPILATION_SRC_FILES := $(addprefix $(SLEEF_CROSS_BUILD_DIR)/include/, \ + $(CROSS_COMPILATION_FILENAMES)) + +ifeq ($(TOOLCHAIN_TYPE), clang) + SLEEF_TOOLCHAIN_TYPE := llvm +else + SLEEF_TOOLCHAIN_TYPE := $(TOOLCHAIN_TYPE) +endif + +SLEEF_CMAKE_FILE := toolchains/$(OPENJDK_TARGET_CPU)-$(SLEEF_TOOLCHAIN_TYPE).cmake + +# We need to run CMake twice, first using it to configure the build, and then +# to actually build; and we need to do this twice, once for a native build +# and once for the cross-compilation build. + +$(eval $(call SetupExecute, sleef_native_config, \ + INFO := Configuring native sleef build, \ + OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \ + COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \ + $(SLEEF_NATIVE_BUILD_DIR), \ +)) + +TARGETS := $(sleef_native_config) + +$(eval $(call SetupExecute, sleef_native_build, \ + INFO := Building native sleef, \ + DEPS := $(sleef_native_config), \ + OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \ + COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \ + $(SLEEF_NATIVE_BUILD_DIR) -j, \ +)) + +TARGETS := $(sleef_native_build) + +$(eval $(call SetupExecute, sleef_cross_config, \ + INFO := Configuring cross-compiling sleef build, \ + DEPS := $(sleef_native_build), \ + OUTPUT_DIR := $(SLEEF_CROSS_BUILD_DIR), \ + COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \ + $(SLEEF_CROSS_BUILD_DIR) \ + -DCMAKE_C_COMPILER=$(CC) \ + -DCMAKE_TOOLCHAIN_FILE=$(SLEEF_CMAKE_FILE) \ + -DNATIVE_BUILD_DIR=$(SLEEF_NATIVE_BUILD_DIR) \ + -DSLEEF_BUILD_INLINE_HEADERS=TRUE \ + $(EXTRA_CROSS_OPTIONS), \ +)) + +TARGETS := $(sleef_cross_config) + +$(eval $(call SetupExecute, sleef_cross_build, \ + INFO := Building cross-compiling sleef, \ + DEPS := $(sleef_cross_config), \ + OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \ + COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \ + $(SLEEF_CROSS_BUILD_DIR) -j, \ +)) + +TARGETS := $(sleef_cross_build) + +$(CROSS_COMPILATION_SRC_FILES): $(sleef_cross_build) + +# Finally, copy the generated files (and one needed static file) into our +# target directory. + +$(eval $(call SetupCopyFiles, copy_static_sleef_source, \ + FILES := $(SLEEF_SOURCE_DIR)/src/common/misc.h, \ + DEST := $(SLEEF_TARGET_DIR), \ +)) + +TARGETS := $(copy_static_sleef_source) + +$(eval $(call SetupCopyFiles, copy_generated_sleef_source, \ + FILES := $(CROSS_COMPILATION_SRC_FILES), \ + DEST := $(SLEEF_TARGET_DIR), \ +)) + +TARGETS := $(copy_generated_sleef_source) + +################################################################################ + +all: $(TARGETS) + +.PHONY: all default diff --git a/make/autoconf/basic_tools.m4 b/make/autoconf/basic_tools.m4 index 6bfaecb2e6900..eceb0ae6cc44f 100644 --- a/make/autoconf/basic_tools.m4 +++ b/make/autoconf/basic_tools.m4 @@ -99,6 +99,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS], UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP]) # Optional tools, we can do without them + UTIL_LOOKUP_PROGS(CMAKE, cmake) UTIL_LOOKUP_PROGS(DF, df) UTIL_LOOKUP_PROGS(GIT, git) UTIL_LOOKUP_PROGS(NICE, nice) diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index d5e08cdb64050..20b1d00aa893f 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -719,6 +719,7 @@ CCACHE := @CCACHE@ # CD is going away, but remains to cater for legacy makefiles. CD := cd CHMOD := @CHMOD@ +CMAKE := @CMAKE@ CODESIGN := @CODESIGN@ CP := @CP@ CUT := @CUT@ diff --git a/make/common/modules/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk index ef65f9e431f00..7c2cef58835c2 100644 --- a/make/common/modules/LauncherCommon.gmk +++ b/make/common/modules/LauncherCommon.gmk @@ -74,7 +74,7 @@ define SetupBuildLauncherBody endif ifneq ($$($1_MAIN_CLASS), ) - $1_JAVA_ARGS += -ms8m + $1_JAVA_ARGS += -Xms8m $1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS) endif diff --git a/make/devkit/createAutoconfBundle.sh b/make/devkit/createAutoconfBundle.sh index 861a0a47242c0..7363b9cd8a71a 100644 --- a/make/devkit/createAutoconfBundle.sh +++ b/make/devkit/createAutoconfBundle.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, 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 @@ -25,50 +25,70 @@ # # Create a bundle in the current directory, containing what's needed to run -# the 'autoconf' program by the OpenJDK build. +# the 'autoconf' program by the OpenJDK build. To override TARGET_PLATFORM +# just set the variable before running this script. # Autoconf depends on m4, so download and build that first. AUTOCONF_VERSION=2.69 M4_VERSION=1.4.18 PACKAGE_VERSION=1.0.1 -TARGET_PLATFORM=linux_x86 +case `uname -s` in + Darwin) + os=macosx + ;; + Linux) + os=linux + ;; + CYGWIN*) + os=cygwin + ;; +esac +case `uname -m` in + arm64|aarch64) + arch=aarch64 + ;; + amd64|x86_64|x64) + arch=x64 + ;; +esac +TARGET_PLATFORM=${TARGET_PLATFORM:="${os}_${arch}"} + MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION BUNDLE_NAME=$MODULE_NAME.tar.gz -TMPDIR=`mktemp -d -t autoconfbundle-XXXX` -trap "rm -rf \"$TMPDIR\"" EXIT +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +OUTPUT_ROOT="${SCRIPT_DIR}/../../build/autoconf" -ORIG_DIR=`pwd` -cd $TMPDIR -OUTPUT_DIR=$TMPDIR/$MODULE_NAME -mkdir -p $OUTPUT_DIR/usr +cd $OUTPUT_ROOT +IMAGE_DIR=$OUTPUT_ROOT/$MODULE_NAME +mkdir -p $IMAGE_DIR/usr # Download and build m4 if test "x$TARGET_PLATFORM" = xcygwin_x64; then # On cygwin 64-bit, just copy the cygwin .exe file - mkdir -p $OUTPUT_DIR/usr/bin - cp /usr/bin/m4 $OUTPUT_DIR/usr/bin + mkdir -p $IMAGE_DIR/usr/bin + cp /usr/bin/m4 $IMAGE_DIR/usr/bin elif test "x$TARGET_PLATFORM" = xcygwin_x86; then # On cygwin 32-bit, just copy the cygwin .exe file - mkdir -p $OUTPUT_DIR/usr/bin - cp /usr/bin/m4 $OUTPUT_DIR/usr/bin + mkdir -p $IMAGE_DIR/usr/bin + cp /usr/bin/m4 $IMAGE_DIR/usr/bin elif test "x$TARGET_PLATFORM" = xlinux_x64; then M4_VERSION=1.4.13-5 wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm - cd $OUTPUT_DIR - rpm2cpio ../m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i + cd $IMAGE_DIR + 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 - cd $OUTPUT_DIR - rpm2cpio ../m4-$M4_VERSION.el6.i686.rpm | cpio -d -i + cd $IMAGE_DIR + rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i else wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz tar xzf m4-$M4_VERSION.tar.gz cd m4-$M4_VERSION - ./configure --prefix=$OUTPUT_DIR/usr + ./configure --prefix=$IMAGE_DIR/usr CFLAGS="-w -Wno-everything" make make install cd .. @@ -79,15 +99,14 @@ fi wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz tar xzf autoconf-$AUTOCONF_VERSION.tar.gz cd autoconf-$AUTOCONF_VERSION -./configure --prefix=$OUTPUT_DIR/usr M4=$OUTPUT_DIR/usr/bin/m4 +./configure --prefix=$IMAGE_DIR/usr M4=$IMAGE_DIR/usr/bin/m4 make make install cd .. -perl -pi -e "s!$OUTPUT_DIR/!./!" $OUTPUT_DIR/usr/bin/auto* $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg -cp $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg $OUTPUT_DIR/autom4te.cfg +perl -pi -e "s!$IMAGE_DIR/!./!" $IMAGE_DIR/usr/bin/auto* $IMAGE_DIR/usr/share/autoconf/autom4te.cfg -cat > $OUTPUT_DIR/autoconf << EOF +cat > $IMAGE_DIR/autoconf << EOF #!/bin/bash # Get an absolute path to this script this_script_dir=\`dirname \$0\` @@ -100,17 +119,10 @@ export AUTOHEADER="\$this_script_dir/usr/bin/autoheader" export AC_MACRODIR="\$this_script_dir/usr/share/autoconf" export autom4te_perllibdir="\$this_script_dir/usr/share/autoconf" -autom4te_cfg=\$this_script_dir/usr/share/autoconf/autom4te.cfg -cp \$this_script_dir/autom4te.cfg \$autom4te_cfg - -echo 'begin-language: "M4sugar"' >> \$autom4te_cfg -echo "args: --prepend-include '"\$this_script_dir/usr/share/autoconf"'" >> \$autom4te_cfg -echo 'end-language: "M4sugar"' >> \$autom4te_cfg +PREPEND_INCLUDE="--prepend-include \$this_script_dir/usr/share/autoconf" -exec \$this_script_dir/usr/bin/autoconf "\$@" +exec \$this_script_dir/usr/bin/autoconf \$PREPEND_INCLUDE "\$@" EOF -chmod +x $OUTPUT_DIR/autoconf -cd $OUTPUT_DIR -tar -cvzf ../$BUNDLE_NAME * -cd .. -cp $BUNDLE_NAME "$ORIG_DIR" +chmod +x $IMAGE_DIR/autoconf +cd $IMAGE_DIR +tar -cvzf $OUTPUT_ROOT/$BUNDLE_NAME * diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 15251358a01a1..8865e3908ae6b 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -786,7 +786,10 @@ private static Map extractZoneNames(Map map, Str String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid)) .orElse(tzid); // Follow link, if needed - var tzLink = tzdbLinks.get(tzKey); + String tzLink = null; + for (var k = tzKey; tzdbLinks.containsKey(k);) { + k = tzLink = tzdbLinks.get(k); + } if (tzLink == null && tzdbLinks.containsValue(tzKey)) { // reverse link search // this is needed as in tzdb, "America/Buenos_Aires" links to @@ -1214,7 +1217,7 @@ private static void generateZoneName() throws Exception { private static Set getAvailableZoneIds() { assert handlerMetaZones != null; if (AVAILABLE_TZIDS == null) { - AVAILABLE_TZIDS = new HashSet<>(ZoneId.getAvailableZoneIds()); + AVAILABLE_TZIDS = new HashSet<>(Arrays.asList(TimeZone.getAvailableIDs())); AVAILABLE_TZIDS.addAll(handlerMetaZones.keySet()); AVAILABLE_TZIDS.remove(MetaZonesParseHandler.NO_METAZONE_KEY); } @@ -1372,6 +1375,7 @@ private static Map coverageLevelsMap() throws Exception { private static void generateTZDBShortNamesMap() throws IOException { Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS) .filter(p -> p.toFile().isFile()) + .filter(p -> p.getFileName().toString().matches("africa|antarctica|asia|australasia|backward|etcetera|europe|northamerica|southamerica")) .forEach(p -> { try { String zone = null; @@ -1394,43 +1398,41 @@ private static void generateTZDBShortNamesMap() throws IOException { } // remove comments in-line line = line.replaceAll("[ \t]*#.*", ""); - + var tokens = line.split("[ \t]+", -1); + var token0len = tokens.length > 0 ? tokens[0].length() : 0; // Zone line - if (line.startsWith("Zone")) { + if (token0len > 0 && tokens[0].regionMatches(true, 0, "Zone", 0, token0len)) { if (zone != null) { tzdbShortNamesMap.put(zone, format + NBSP + rule); } - var zl = line.split("[ \t]+", -1); - zone = zl[1]; - rule = zl[3]; - format = flipIfNeeded(inVanguard, zl[4]); + zone = tokens[1]; + rule = tokens[3]; + format = flipIfNeeded(inVanguard, tokens[4]); } else { if (zone != null) { - if (line.startsWith("Rule") || - line.startsWith("Link")) { + if (token0len > 0 && + (tokens[0].regionMatches(true, 0, "Rule", 0, token0len) || + tokens[0].regionMatches(true, 0, "Link", 0, token0len))) { tzdbShortNamesMap.put(zone, format + NBSP + rule); zone = null; rule = null; format = null; } else { - var s = line.split("[ \t]+", -1); - rule = s[2]; - format = flipIfNeeded(inVanguard, s[3]); + rule = tokens[2]; + format = flipIfNeeded(inVanguard, tokens[3]); } } } // Rule line - if (line.startsWith("Rule")) { - var rl = line.split("[ \t]+", -1); - tzdbSubstLetters.put(rl[1] + NBSP + (rl[8].equals("0") ? STD : DST), - rl[9].replace(NO_SUBST, "")); + if (token0len > 0 && tokens[0].regionMatches(true, 0, "Rule", 0, token0len)) { + tzdbSubstLetters.put(tokens[1] + NBSP + (tokens[8].equals("0") ? STD : DST), + tokens[9].replace(NO_SUBST, "")); } // Link line - if (line.startsWith("Link")) { - var ll = line.split("[ \t]+", -1); - tzdbLinks.put(ll[2], ll[1]); + if (token0len > 0 && tokens[0].regionMatches(true, 0, "Link", 0, token0len)) { + tzdbLinks.put(tokens[2], tokens[1]); } } @@ -1491,13 +1493,14 @@ private static void fillTZDBShortNames(String tzid, String[] names) { /* * Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00". * If it cannot recognize the pattern, return the argument as is. + * Returning null results in generating the GMT format at runtime. */ private static String convertGMTName(String f) { try { - // Should pre-fill GMT format once COMPAT is gone. - // Till then, fall back to GMT format at runtime, after COMPAT short - // names are populated - ZoneOffset.of(f); + if (!f.equals("%z")) { + // Validate if the format is an offset + ZoneOffset.of(f); + } return null; } catch (DateTimeException dte) { // textual representation. return as is diff --git a/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java b/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java index 760397255b863..ecca3c69c065f 100644 --- a/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java +++ b/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java @@ -164,7 +164,8 @@ private void load(List files) throws IOException { } continue; } - if (line.startsWith("Zone")) { // parse Zone line + int token0len = tokens.length > 0 ? tokens[0].length() : line.length(); + if (line.regionMatches(true, 0, "Zone", 0, token0len)) { // parse Zone line String name = tokens[1]; if (excludedZones.contains(name)){ continue; @@ -182,13 +183,13 @@ private void load(List files) throws IOException { if (zLine.parse(tokens, 2)) { openZone = null; } - } else if (line.startsWith("Rule")) { // parse Rule line + } else if (line.regionMatches(true, 0, "Rule", 0, token0len)) { // parse Rule line String name = tokens[1]; if (!rules.containsKey(name)) { rules.put(name, new ArrayList(10)); } rules.get(name).add(new RuleLine().parse(tokens)); - } else if (line.startsWith("Link")) { // parse link line + } else if (line.regionMatches(true, 0, "Link", 0, token0len)) { // parse link line if (tokens.length >= 3) { String realId = tokens[1]; String aliasId = tokens[2]; @@ -304,7 +305,7 @@ private void parse(String[] tokens, int off) { month = parseMonth(tokens[off++]); if (off < tokens.length) { String dayRule = tokens[off++]; - if (dayRule.startsWith("last")) { + if (dayRule.regionMatches(true, 0, "last", 0, 4)) { dayOfMonth = -1; dayOfWeek = parseDayOfWeek(dayRule.substring(4)); adjustForwards = false; @@ -355,11 +356,12 @@ private void parse(String[] tokens, int off) { } int parseYear(String year, int defaultYear) { - switch (year.toLowerCase()) { - case "min": return 1900; - case "max": return Year.MAX_VALUE; - case "only": return defaultYear; - } + int len = year.length(); + + if (year.regionMatches(true, 0, "minimum", 0, len)) return 1900; + if (year.regionMatches(true, 0, "maximum", 0, len)) return Year.MAX_VALUE; + if (year.regionMatches(true, 0, "only", 0, len)) return defaultYear; + return Integer.parseInt(year); } diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index 8916eee90d7bc..97f2f12cb7639 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -885,7 +885,7 @@ BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exedaemonDestroy := java.base:libjvm ifeq ($(call isTargetOs, windows), true) BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT - BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c + BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c libTestUnloadedClass.cpp BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack := java.base:libjvm BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm else @@ -1526,6 +1526,7 @@ else BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread + BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libTestUnloadedClass += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -lpthread BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exeGetCreatedJavaVMs := java.base:libjvm diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index fced9cfc35e57..39eae43a287e7 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -1244,7 +1244,7 @@ source %{ // r27 is not allocatable when compressed oops is on and heapbase is not // zero, compressed klass pointers doesn't use r27 after JDK-8234794 - if (UseCompressedOops && (CompressedOops::ptrs_base() != nullptr)) { + if (UseCompressedOops && (CompressedOops::base() != nullptr)) { _NO_SPECIAL_REG32_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg())); _NO_SPECIAL_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg())); _NO_SPECIAL_PTR_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg())); diff --git a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp index ca175fe1c47b1..89a97a4984fc8 100644 --- a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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. * @@ -57,7 +57,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { __ mov_metadata(rscratch1, m); ce->store_parameter(rscratch1, 1); ce->store_parameter(_bci, 0); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); __ b(_continuation); @@ -66,7 +66,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ far_call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -79,13 +79,13 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { } else { __ mov(rscratch1, _index->as_jint()); } - Runtime1::StubID stub_id; + C1StubId stub_id; if (_throw_index_out_of_bounds_exception) { - stub_id = Runtime1::throw_index_exception_id; + stub_id = C1StubId::throw_index_exception_id; } else { assert(_array != LIR_Opr::nullOpr(), "sanity"); __ mov(rscratch2, _array->as_pointer_register()); - stub_id = Runtime1::throw_range_check_failed_id; + stub_id = C1StubId::throw_range_check_failed_id; } __ lea(lr, RuntimeAddress(Runtime1::entry_for(stub_id))); __ blr(lr); @@ -100,7 +100,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ far_call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -112,7 +112,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); #ifdef ASSERT @@ -124,14 +124,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { // Implementation of NewInstanceStub -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -167,7 +167,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == r19, "length must in r19,"); assert(_klass_reg->as_register() == r3, "klass_reg must in r3"); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == r0, "result must in r0"); @@ -190,7 +190,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == r19, "length must in r19,"); assert(_klass_reg->as_register() == r3, "klass_reg must in r3"); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == r0, "result must in r0"); @@ -202,11 +202,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_obj_reg->as_register(), 1); ce->store_parameter(_lock_reg->as_register(), 0); - Runtime1::StubID enter_id; + C1StubId enter_id; if (ce->compilation()->has_fpu_code()) { - enter_id = Runtime1::monitorenter_id; + enter_id = C1StubId::monitorenter_id; } else { - enter_id = Runtime1::monitorenter_nofpu_id; + enter_id = C1StubId::monitorenter_nofpu_id; } __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id))); ce->add_call_info_here(_info); @@ -223,11 +223,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { } ce->store_parameter(_lock_reg->as_register(), 0); // note: non-blocking leaf routine => no call info needed - Runtime1::StubID exit_id; + C1StubId exit_id; if (ce->compilation()->has_fpu_code()) { - exit_id = Runtime1::monitorexit_id; + exit_id = C1StubId::monitorexit_id; } else { - exit_id = Runtime1::monitorexit_nofpu_id; + exit_id = C1StubId::monitorexit_nofpu_id; } __ adr(lr, _continuation); __ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id))); @@ -255,7 +255,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_trap_request, 0); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id))); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); } @@ -265,9 +265,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { address a; if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is probably wrong to do it here. - a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); } ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 91430be5835b5..5e116d82761ac 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -321,19 +321,19 @@ void LIR_Assembler::deoptimize_trap(CodeEmitInfo *info) { switch (patching_id(info)) { case PatchingStub::access_field_id: - target = Runtime1::entry_for(Runtime1::access_field_patching_id); + target = Runtime1::entry_for(C1StubId::access_field_patching_id); reloc_type = relocInfo::section_word_type; break; case PatchingStub::load_klass_id: - target = Runtime1::entry_for(Runtime1::load_klass_patching_id); + target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; case PatchingStub::load_mirror_id: - target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); + target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; case PatchingStub::load_appendix_id: - target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); + target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); @@ -375,7 +375,7 @@ int LIR_Assembler::emit_exception_handler() { __ verify_not_null_oop(r0); // search an exception handler (r0: exception oop, r3: throwing pc) - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id))); __ should_not_reach_here(); guarantee(code_offset() - offset <= exception_handler_size(), "overflow"); __ end_a_stub(); @@ -432,7 +432,7 @@ int LIR_Assembler::emit_unwind_handler() { // remove the activation and dispatch to the unwind handler __ block_comment("remove_frame and dispatch to the unwind handler"); __ remove_frame(initial_frame_size_in_bytes()); - __ far_jump(RuntimeAddress(Runtime1::entry_for(Runtime1::unwind_exception_id))); + __ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id))); // Emit the slow path assembly if (stub != nullptr) { @@ -875,19 +875,19 @@ void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo* info) { switch (patching_id(info)) { case PatchingStub::access_field_id: - target = Runtime1::entry_for(Runtime1::access_field_patching_id); + target = Runtime1::entry_for(C1StubId::access_field_patching_id); reloc_type = relocInfo::section_word_type; break; case PatchingStub::load_klass_id: - target = Runtime1::entry_for(Runtime1::load_klass_patching_id); + target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; case PatchingStub::load_mirror_id: - target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); + target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; case PatchingStub::load_appendix_id: - target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); + target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); @@ -1356,7 +1356,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L __ br(Assembler::EQ, *success_target); __ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize))); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ ldr(klass_RInfo, Address(__ post(sp, 2 * wordSize))); // result is a boolean __ cbzw(klass_RInfo, *failure_target); @@ -1367,7 +1367,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr); // call out-of-line instance of __ check_klass_subtype_slow_path(...): __ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize))); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ ldp(k_RInfo, klass_RInfo, Address(__ post(sp, 2 * wordSize))); // result is a boolean __ cbz(k_RInfo, *failure_target); @@ -1446,7 +1446,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr); // call out-of-line instance of __ check_klass_subtype_slow_path(...): __ stp(klass_RInfo, k_RInfo, Address(__ pre(sp, -2 * wordSize))); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ ldp(k_RInfo, klass_RInfo, Address(__ post(sp, 2 * wordSize))); // result is a boolean __ cbzw(k_RInfo, *failure_target); @@ -2035,7 +2035,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit // exception object is not added to oop map by LinearScan // (LinearScan assumes that no oops are in fixed registers) info->add_register_oop(exceptionOop); - Runtime1::StubID unwind_id; + C1StubId unwind_id; // get current pc information // pc is only needed if the method has an exception handler, the unwind code does not need it. @@ -2054,9 +2054,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit __ verify_not_null_oop(r0); // search an exception handler (r0: exception oop, r3: throwing pc) if (compilation()->has_fpu_code()) { - unwind_id = Runtime1::handle_exception_id; + unwind_id = C1StubId::handle_exception_id; } else { - unwind_id = Runtime1::handle_exception_nofpu_id; + unwind_id = C1StubId::handle_exception_nofpu_id; } __ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id))); @@ -2337,7 +2337,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { __ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, nullptr); __ PUSH(src, dst); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ POP(src, dst); __ cbnz(src, cont); diff --git a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp index 8f1260feba3ea..4acac65ad5bab 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp @@ -1246,7 +1246,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); LIR_Opr reg = result_register_for(x->type()); - __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); @@ -1277,14 +1277,14 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception); } LIR_Opr reg = rlock_result(x); LIR_Opr tmp3 = LIR_OprFact::illegalOpr; diff --git a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp index d0d11d437e83e..8d1b3902ce42e 100644 --- a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp @@ -267,7 +267,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == r0, "must be"); - far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); @@ -308,7 +308,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == r0, "must be"); - far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp index cb9eb03c580d2..0b9acc0f3a885 100644 --- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp @@ -100,10 +100,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre if (frame_size() == no_frame_size) { leave(); far_jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - } else if (_stub_id == Runtime1::forward_exception_id) { + } else if (_stub_id == (int)C1StubId::forward_exception_id) { should_not_reach_here(); } else { - far_jump(RuntimeAddress(Runtime1::entry_for(Runtime1::forward_exception_id))); + far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id))); } bind(L); } @@ -358,7 +358,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) { __ block_comment("generate_handle_exception"); // incoming parameters @@ -370,7 +370,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { OopMapSet* oop_maps = new OopMapSet(); OopMap* oop_map = nullptr; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: // We're handling an exception in the context of a compiled frame. // The registers have been saved in the standard places. Perform // an exception lookup in the caller and dispatch to the handler @@ -390,12 +390,12 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ str(zr, Address(rthread, JavaThread::vm_result_offset())); __ str(zr, Address(rthread, JavaThread::vm_result_2_offset())); break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // At this point all registers MAY be live. - oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id); + oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { // At this point all registers except exception oop (r0) and // exception pc (lr) are dead. const int frame_size = 2 /*fp, return address*/; @@ -453,13 +453,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ str(r0, Address(rfp, 1*BytesPerWord)); switch (id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // Restore the registers that were saved at the beginning. - restore_live_registers(sasm, id != handle_exception_nofpu_id); + restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: break; default: ShouldNotReachHere(); } @@ -611,7 +611,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { const Register exception_oop = r0; const Register exception_pc = r3; @@ -628,7 +628,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { OopMap* oop_map = nullptr; switch (id) { { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); __ leave(); @@ -636,31 +636,31 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { Register klass = r3; // Incoming Register obj = r0; // Result - if (id == new_instance_id) { + if (id == C1StubId::new_instance_id) { __ set_info("new_instance", dont_gc_arguments); - } else if (id == fast_new_instance_id) { + } else if (id == C1StubId::fast_new_instance_id) { __ set_info("fast new_instance", dont_gc_arguments); } else { - assert(id == fast_new_instance_init_check_id, "bad StubID"); + assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId"); __ set_info("fast new_instance init check", dont_gc_arguments); } @@ -679,7 +679,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: { Register bci = r0, method = r1; __ enter(); @@ -697,14 +697,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { Register length = r19; // Incoming Register klass = r3; // Incoming Register obj = r0; // Result - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -717,7 +717,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Register t0 = obj; __ ldrw(t0, Address(klass, Klass::layout_helper_offset())); __ asrw(t0, t0, Klass::_lh_array_tag_shift); - int tag = ((id == new_type_array_id) + int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value); __ mov(rscratch1, tag); @@ -732,7 +732,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ enter(); OopMap* map = save_live_registers(sasm); int call_offset; - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length); } else { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length); @@ -750,7 +750,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { StubFrame f(sasm, "new_multi_array", dont_gc_arguments); // r0,: klass // r19,: rank @@ -770,7 +770,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); @@ -802,19 +802,19 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // Typical calling sequence: // __ push(klass_RInfo); // object klass or other subclass @@ -857,10 +857,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorenter_nofpu_id: + case C1StubId::monitorenter_nofpu_id: save_fpu_registers = false; // fall through - case monitorenter_id: + case C1StubId::monitorenter_id: { StubFrame f(sasm, "monitorenter", dont_gc_arguments); OopMap* map = save_live_registers(sasm, save_fpu_registers); @@ -878,10 +878,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: + case C1StubId::monitorexit_nofpu_id: save_fpu_registers = false; // fall through - case monitorexit_id: + case C1StubId::monitorexit_id: { StubFrame f(sasm, "monitorexit", dont_gc_arguments); OopMap* map = save_live_registers(sasm, save_fpu_registers); @@ -901,7 +901,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { StubFrame f(sasm, "deoptimize", dont_gc_arguments, does_not_return); OopMap* oop_map = save_live_registers(sasm); @@ -918,13 +918,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { StubFrame f(sasm, "range_check_failed", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { __ set_info("unwind_exception", dont_gc_arguments); // note: no stubframe since we are about to leave the current // activation and we are calling a leaf VM function only. @@ -932,54 +932,54 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { StubFrame f(sasm, "access_field_patching", dont_gc_arguments, does_not_return); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { StubFrame f(sasm, "load_klass_patching", dont_gc_arguments, does_not_return); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments, does_not_return); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments, does_not_return); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { StubFrame f(sasm, "handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments, does_not_return); // tos + 0: link // + 1: return address @@ -987,7 +987,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments, does_not_return); @@ -1005,7 +1005,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case dtrace_object_alloc_id: + case C1StubId::dtrace_object_alloc_id: { // c_rarg0: object StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); save_live_registers(sasm); diff --git a/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp b/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp index 54af69ffaba6c..fc78813c161fc 100644 --- a/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp @@ -129,5 +129,7 @@ void CompressedKlassPointers::initialize(address addr, size_t len) { address const end = addr + len; _base = (end <= (address)unscaled_max) ? nullptr : addr; - _range = end - _base; + // Remember the Klass range: + _klass_range_start = addr; + _klass_range_end = addr + len; } diff --git a/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp index cd834969e1a4f..fcec3ae64fde8 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp @@ -93,7 +93,7 @@ static size_t probe_valid_max_address_bit() { } size_t ZPlatformAddressOffsetBits() { - const static size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; + static const size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; const size_t max_address_offset_bits = valid_max_address_offset_bits - 3; const size_t min_address_offset_bits = max_address_offset_bits - 2; const size_t address_offset = round_up_power_of_2(MaxHeapSize * ZVirtualToPhysicalRatio); diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index d09ef26cef995..c5c02619d446e 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -2967,7 +2967,7 @@ void MacroAssembler::verify_heapbase(const char* msg) { if (CheckCompressedOops) { Label ok; push(1 << rscratch1->encoding(), sp); // cmpptr trashes rscratch1 - cmpptr(rheapbase, ExternalAddress(CompressedOops::ptrs_base_addr())); + cmpptr(rheapbase, ExternalAddress(CompressedOops::base_addr())); br(Assembler::EQ, ok); stop(msg); bind(ok); @@ -3133,9 +3133,9 @@ void MacroAssembler::reinit_heapbase() { if (UseCompressedOops) { if (Universe::is_fully_initialized()) { - mov(rheapbase, CompressedOops::ptrs_base()); + mov(rheapbase, CompressedOops::base()); } else { - lea(rheapbase, ExternalAddress(CompressedOops::ptrs_base_addr())); + lea(rheapbase, ExternalAddress(CompressedOops::base_addr())); ldr(rheapbase, Address(rheapbase)); } } @@ -5082,8 +5082,8 @@ MacroAssembler::KlassDecodeMode MacroAssembler::klass_decode_mode() { if (operand_valid_for_logical_immediate( /*is32*/false, (uint64_t)CompressedKlassPointers::base())) { - const uint64_t range_mask = - (1ULL << log2i(CompressedKlassPointers::range())) - 1; + const size_t range = CompressedKlassPointers::klass_range_end() - CompressedKlassPointers::base(); + const uint64_t range_mask = (1ULL << log2i(range)) - 1; if (((uint64_t)CompressedKlassPointers::base() & range_mask) == 0) { return (_klass_decode_mode = KlassDecodeXor); } diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index 3117c75149854..1b02108b00f94 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -49,6 +49,7 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/timerTrace.hpp" #include "runtime/vframeArray.hpp" #include "utilities/align.hpp" #include "utilities/formatBuffer.hpp" diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp index 38d48b86f23b0..3210789bbbdfa 100644 --- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp @@ -69,12 +69,6 @@ int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; #define __ _masm-> -//----------------------------------------------------------------------------- - -extern "C" void entry(CodeBuffer*); - -//----------------------------------------------------------------------------- - address TemplateInterpreterGenerator::generate_slow_signature_handler() { address entry = __ pc(); diff --git a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp index 3d8dbc38071ed..8e85fa88a8749 100644 --- a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp +++ b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -46,7 +46,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_bci, 0); ce->store_parameter(_method->as_constant_ptr()->as_metadata(), 1); - __ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::counter_overflow_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -57,7 +57,7 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - __ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::predicate_failed_trap_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); debug_only(__ should_not_reach_here()); @@ -73,10 +73,10 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { } if (_throw_index_out_of_bounds_exception) { - __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::throw_index_exception_id), relocInfo::runtime_call_type); } else { __ str(_array->as_pointer_register(), Address(SP, BytesPerWord)); // ??? Correct offset? Correct instruction? - __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::throw_range_check_failed_id), relocInfo::runtime_call_type); } ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -89,7 +89,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - __ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::predicate_failed_trap_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); debug_only(__ should_not_reach_here()); @@ -100,7 +100,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - __ call(Runtime1::entry_for(Runtime1::throw_div0_exception_id), + __ call(Runtime1::entry_for(C1StubId::throw_div0_exception_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); DEBUG_ONLY(STOP("DivByZero");) @@ -109,14 +109,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { // Implementation of NewInstanceStub -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -148,7 +148,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { assert(_klass_reg->as_register() == R1, "runtime call setup"); assert(_length->as_register() == R2, "runtime call setup"); __ bind(_entry); - __ call(Runtime1::entry_for(Runtime1::new_type_array_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::new_type_array_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); __ b(_continuation); @@ -170,7 +170,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { assert(_klass_reg->as_register() == R1, "runtime call setup"); assert(_length->as_register() == R2, "runtime call setup"); __ bind(_entry); - __ call(Runtime1::entry_for(Runtime1::new_object_array_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::new_object_array_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); __ b(_continuation); @@ -189,9 +189,9 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ str(lock_reg, Address(SP, BytesPerWord)); } - Runtime1::StubID enter_id = ce->compilation()->has_fpu_code() ? - Runtime1::monitorenter_id : - Runtime1::monitorenter_nofpu_id; + C1StubId enter_id = ce->compilation()->has_fpu_code() ? + C1StubId::monitorenter_id : + C1StubId::monitorenter_nofpu_id; __ call(Runtime1::entry_for(enter_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -210,9 +210,9 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { __ str(lock_reg, Address(SP)); // Non-blocking leaf routine - no call info needed - Runtime1::StubID exit_id = ce->compilation()->has_fpu_code() ? - Runtime1::monitorexit_id : - Runtime1::monitorexit_nofpu_id; + C1StubId exit_id = ce->compilation()->has_fpu_code() ? + C1StubId::monitorexit_id : + C1StubId::monitorexit_nofpu_id; __ call(Runtime1::entry_for(exit_id), relocInfo::runtime_call_type); __ b(_continuation); } @@ -322,10 +322,10 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { address target = nullptr; relocInfo::relocType reloc_type = relocInfo::none; switch (_id) { - case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; - case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; - case load_mirror_id: target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; - case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; + case access_field_id: target = Runtime1::entry_for(C1StubId::access_field_patching_id); break; + case load_klass_id: target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; + case load_mirror_id: target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; + case load_appendix_id: target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); } __ bind(call_patch); @@ -351,7 +351,7 @@ void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ mov_slow(Rtemp, _trap_request); ce->verify_reserved_argument_area_size(1); __ str(Rtemp, Address(SP)); - __ call(Runtime1::entry_for(Runtime1::deoptimize_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::deoptimize_id), relocInfo::runtime_call_type); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); } @@ -362,9 +362,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is // probably wrong to do it here. - a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); } ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); __ bind(_entry); diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp index 999f8fe590472..bb6a93e6f8da7 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp @@ -213,7 +213,7 @@ int LIR_Assembler::emit_exception_handler() { // check that there is really an exception __ verify_not_null_oop(Rexception_obj); - __ call(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id), relocInfo::runtime_call_type); __ should_not_reach_here(); assert(code_offset() - offset <= exception_handler_size(), "overflow"); @@ -253,7 +253,7 @@ int LIR_Assembler::emit_unwind_handler() { // remove the activation and dispatch to the unwind handler __ remove_frame(initial_frame_size_in_bytes()); // restores FP and LR - __ jump(Runtime1::entry_for(Runtime1::unwind_exception_id), relocInfo::runtime_call_type, Rtemp); + __ jump(Runtime1::entry_for(C1StubId::unwind_exception_id), relocInfo::runtime_call_type, Rtemp); // Emit the slow path assembly if (stub != nullptr) { @@ -1136,7 +1136,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ b(*failure_target, ne); // slow case assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup"); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); __ cbz(R0, *failure_target); if (op->should_profile()) { Register mdo = klass_RInfo, recv = k_RInfo, tmp1 = Rtemp; @@ -1210,7 +1210,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ cmp(Rtemp, k_RInfo, ne); __ b(*success_target, eq); assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup"); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); __ cbz(R0, *failure_target); } } else { @@ -1227,7 +1227,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ b(*failure_target, ne); // slow case assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup"); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); __ cbz(R0, *failure_target); } @@ -1303,7 +1303,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { } __ b(*success_target, eq); assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup"); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); if (!op->should_profile()) { move_regs(R0, res); } else { @@ -1334,7 +1334,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ b(*failure_target, ne); // slow case assert(klass_RInfo == R0 && k_RInfo == R1, "runtime call setup"); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); if (!op->should_profile()) { move_regs(R0, res); } @@ -1981,9 +1981,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit assert(exceptionPC->as_register() == Rexception_pc, "must match"); info->add_register_oop(exceptionOop); - Runtime1::StubID handle_id = compilation()->has_fpu_code() ? - Runtime1::handle_exception_id : - Runtime1::handle_exception_nofpu_id; + C1StubId handle_id = compilation()->has_fpu_code() ? + C1StubId::handle_exception_id : + C1StubId::handle_exception_nofpu_id; Label return_address; __ adr(Rexception_pc, return_address); __ call(Runtime1::entry_for(handle_id), relocInfo::runtime_call_type); @@ -2260,7 +2260,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { __ mov(altFP_7_11, R1); __ mov(R0, tmp); __ mov(R1, tmp2); - __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); // does not blow any registers except R0, LR and Rtemp + __ call(Runtime1::entry_for(C1StubId::slow_subtype_check_id), relocInfo::runtime_call_type); // does not blow any registers except R0, LR and Rtemp __ cmp_32(R0, 0); __ mov(R0, R6); __ mov(R1, altFP_7_11); diff --git a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp index f4e3812d77cff..adda0c1c290db 100644 --- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -1054,7 +1054,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); LIR_Opr reg = result_register_for(x->type()); - __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); LIR_Opr result = rlock_result(x); @@ -1083,7 +1083,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); @@ -1091,7 +1091,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, LIR_OprFact::illegalOpr, info_for_exception); } diff --git a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp index 335baf5f16638..b5117dedc424e 100644 --- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp +++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp @@ -65,7 +65,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre reset_last_Java_frame(Rtemp); assert(frame_size() != no_frame_size, "frame must be fixed"); - if (_stub_id != Runtime1::forward_exception_id) { + if (_stub_id != (int)C1StubId::forward_exception_id) { ldr(R3, Address(Rthread, Thread::pending_exception_offset())); } @@ -81,10 +81,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre // Check for pending exception // unpack_with_exception_in_tls path is taken through // Runtime1::exception_handler_for_pc - if (_stub_id != Runtime1::forward_exception_id) { + if (_stub_id != (int)C1StubId::forward_exception_id) { assert(frame_size() != no_frame_size, "cannot directly call forward_exception_id"); cmp(R3, 0); - jump(Runtime1::entry_for(Runtime1::forward_exception_id), relocInfo::runtime_call_type, Rtemp, ne); + jump(Runtime1::entry_for(C1StubId::forward_exception_id), relocInfo::runtime_call_type, Rtemp, ne); } else { #ifdef ASSERT // Should not have pending exception in forward_exception stub @@ -280,7 +280,7 @@ static void restore_sp_for_method_handle(StubAssembler* sasm) { } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm) { __ block_comment("generate_handle_exception"); bool save_fpu_registers = false; @@ -290,7 +290,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { OopMap* oop_map = nullptr; switch (id) { - case forward_exception_id: { + case C1StubId::forward_exception_id: { save_fpu_registers = HaveVFP; oop_map = generate_oop_map(sasm); __ ldr(Rexception_obj, Address(Rthread, Thread::pending_exception_offset())); @@ -299,14 +299,14 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { __ str(zero, Address(Rthread, Thread::pending_exception_offset())); break; } - case handle_exception_id: + case C1StubId::handle_exception_id: save_fpu_registers = HaveVFP; // fall-through - case handle_exception_nofpu_id: + case C1StubId::handle_exception_nofpu_id: // At this point all registers MAY be live. oop_map = save_live_registers(sasm, save_fpu_registers); break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: // At this point all registers except exception oop (R4/R19) and // exception pc (R5/R20) are dead. oop_map = save_live_registers(sasm); // TODO it's not required to save all registers @@ -328,13 +328,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { // Restore the registers that were saved at the beginning, remove // frame and jump to the exception handler. switch (id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: restore_live_registers(sasm, save_fpu_registers); // Note: the restore live registers includes the jump to LR (patched to R0) break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: restore_live_registers_without_return(sasm); // must not jump immediately to handler restore_sp_for_method_handle(sasm); __ ret(); @@ -403,7 +403,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { const bool must_gc_arguments = true; const bool dont_gc_arguments = false; @@ -411,16 +411,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { bool save_fpu_registers = HaveVFP; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); // does not return on ARM } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { const Register result = R0; const Register klass = R1; @@ -436,7 +436,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: { OopMap* oop_map = save_live_registers(sasm); __ ldr(R1, Address(SP, arg1_offset)); @@ -448,10 +448,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -463,7 +463,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { OopMap* map = save_live_registers(sasm); int call_offset; - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { call_offset = __ call_RT(result, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length); } else { call_offset = __ call_RT(result, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length); @@ -477,7 +477,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { __ set_info("new_multi_array", dont_gc_arguments); @@ -500,7 +500,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); @@ -521,78 +521,78 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { __ set_info("range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { __ set_info("index_range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { __ set_info("throw_div0_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { __ set_info("throw_null_pointer_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { __ set_info("handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { __ set_info("handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { __ set_info("unwind_exception", dont_gc_arguments); generate_unwind_exception(sasm); } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { __ set_info("throw_array_store_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true); } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { __ set_info("throw_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // (in) R0 - sub, destroyed, // (in) R1 - super, not changed @@ -625,10 +625,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorenter_nofpu_id: + case C1StubId::monitorenter_nofpu_id: save_fpu_registers = false; // fall through - case monitorenter_id: + case C1StubId::monitorenter_id: { __ set_info("monitorenter", dont_gc_arguments); const Register obj = R1; @@ -643,10 +643,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: + case C1StubId::monitorexit_nofpu_id: save_fpu_registers = false; // fall through - case monitorexit_id: + case C1StubId::monitorexit_id: { __ set_info("monitorexit", dont_gc_arguments); const Register lock = R1; @@ -659,7 +659,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { __ set_info("deoptimize", dont_gc_arguments); OopMap* oop_map = save_live_registers(sasm); @@ -675,35 +675,35 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { __ set_info("access_field_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { __ set_info("load_klass_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { __ set_info("load_appendix_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { __ set_info("load_mirror_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); } break; - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { __ set_info("predicate_failed_trap", dont_gc_arguments); diff --git a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp index 7648e5c5d9260..7c1f3aafe7d52 100644 --- a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp +++ b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp @@ -38,6 +38,7 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/safepointMechanism.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/timerTrace.hpp" #include "runtime/vframeArray.hpp" #include "utilities/align.hpp" #include "utilities/powerOfTwo.hpp" diff --git a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp index dc70c73d4b330..451f3b7e9cd6b 100644 --- a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2021 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -68,7 +68,7 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); //__ load_const_optimized(R0, a); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); __ mtctr(R0); @@ -79,8 +79,8 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { return; } - address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(Runtime1::throw_index_exception_id) - : Runtime1::entry_for(Runtime1::throw_range_check_failed_id); + address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(C1StubId::throw_index_exception_id) + : Runtime1::entry_for(C1StubId::throw_range_check_failed_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); __ mtctr(R0); @@ -109,7 +109,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); //__ load_const_optimized(R0, a); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); __ mtctr(R0); @@ -133,7 +133,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { __ load_const_optimized(R0, md.value()); __ std(R0, -8, R1_SP); - address a = Runtime1::entry_for(Runtime1::counter_overflow_id); + address a = Runtime1::entry_for(C1StubId::counter_overflow_id); //__ load_const_optimized(R0, a); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); __ mtctr(R0); @@ -150,7 +150,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - address stub = Runtime1::entry_for(Runtime1::throw_div0_exception_id); + address stub = Runtime1::entry_for(C1StubId::throw_div0_exception_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); __ mtctr(R0); @@ -165,9 +165,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { address a; if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is probably wrong to do it here. - a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); } if (ImplicitNullChecks || TrapBasedNullChecks) { @@ -199,14 +199,14 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) { // Implementation of NewInstanceStub -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -236,7 +236,7 @@ NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr re void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address entry = Runtime1::entry_for(Runtime1::new_type_array_id); + address entry = Runtime1::entry_for(C1StubId::new_type_array_id); //__ load_const_optimized(R0, entry); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry)); __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended @@ -259,7 +259,7 @@ NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Op void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address entry = Runtime1::entry_for(Runtime1::new_object_array_id); + address entry = Runtime1::entry_for(C1StubId::new_object_array_id); //__ load_const_optimized(R0, entry); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry)); __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended @@ -272,7 +272,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorenter_id : Runtime1::monitorenter_nofpu_id); + address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? C1StubId::monitorenter_id : C1StubId::monitorenter_nofpu_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); __ mr_if_needed(/*scratch_opr()->as_register()*/ R4_ARG2, _obj_reg->as_register()); @@ -289,7 +289,7 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { if (_compute_lock) { ce->monitor_address(_monitor_ix, _lock_reg); } - address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorexit_id : Runtime1::monitorexit_nofpu_id); + address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? C1StubId::monitorexit_id : C1StubId::monitorexit_nofpu_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); assert(_lock_reg->as_register() == R4_ARG2, ""); @@ -403,12 +403,12 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { address target = nullptr; relocInfo::relocType reloc_type = relocInfo::none; switch (_id) { - case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; - case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); + case access_field_id: target = Runtime1::entry_for(C1StubId::access_field_patching_id); break; + case load_klass_id: target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; - case load_mirror_id: target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); + case load_mirror_id: target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; - case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); + case load_appendix_id: target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); } @@ -434,7 +434,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address stub = Runtime1::entry_for(Runtime1::deoptimize_id); + address stub = Runtime1::entry_for(C1StubId::deoptimize_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); __ mtctr(R0); diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 2191b894f6e16..42934dc7c3179 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -176,7 +176,7 @@ int LIR_Assembler::emit_exception_handler() { } int offset = code_offset(); - address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::handle_exception_from_callee_id)); + address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::handle_exception_from_callee_id)); //__ load_const_optimized(R0, entry_point); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry_point)); __ mtctr(R0); @@ -222,7 +222,7 @@ int LIR_Assembler::emit_unwind_handler() { } // Dispatch to the unwind logic. - address unwind_stub = Runtime1::entry_for(Runtime1::unwind_exception_id); + address unwind_stub = Runtime1::entry_for(C1StubId::unwind_exception_id); //__ load_const_optimized(R0, unwind_stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(unwind_stub)); if (preserve_exception) { __ mr(Rexception, Rexception_save); } @@ -1800,8 +1800,8 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit __ calculate_address_from_global_toc(exceptionPC->as_register(), pc_for_athrow, true, true, /*add_relocation*/ true); add_call_info(pc_for_athrow_offset, info); // for exception handler - address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? Runtime1::handle_exception_id - : Runtime1::handle_exception_nofpu_id); + address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? C1StubId::handle_exception_id + : C1StubId::handle_exception_nofpu_id); //__ load_const_optimized(R0, stub); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); __ mtctr(R0); @@ -2001,7 +2001,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { __ check_klass_subtype_fast_path(sub_klass, super_klass, tmp, tmp2, &cont, copyfunc_addr != nullptr ? ©func : &slow, nullptr); - address slow_stc = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + address slow_stc = Runtime1::entry_for(C1StubId::slow_subtype_check_id); //__ load_const_optimized(tmp, slow_stc, tmp2); __ calculate_address_from_global_toc(tmp, slow_stc, true, true, false); __ mtctr(tmp); @@ -2452,7 +2452,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L __ b(*success); } else { // Call out-of-line instance of __ check_klass_subtype_slow_path(...): - address entry = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + address entry = Runtime1::entry_for(C1StubId::slow_subtype_check_id); // Stub needs fixed registers (tmp1-3). Register original_k_RInfo = op->tmp1()->as_register(); Register original_klass_RInfo = op->tmp2()->as_register(); @@ -2543,7 +2543,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, &done, &failure, nullptr); // Call out-of-line instance of __ check_klass_subtype_slow_path(...): - const address slow_path = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + const address slow_path = Runtime1::entry_for(C1StubId::slow_subtype_check_id); //__ load_const_optimized(R0, slow_path); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(slow_path)); __ mtctr(R0); @@ -2850,8 +2850,8 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) { void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) { // Stubs: Called via rt_call, but dest is a stub address (no function descriptor). - if (dest == Runtime1::entry_for(Runtime1::register_finalizer_id) || - dest == Runtime1::entry_for(Runtime1::new_multi_array_id )) { + if (dest == Runtime1::entry_for(C1StubId::register_finalizer_id) || + dest == Runtime1::entry_for(C1StubId::new_multi_array_id )) { //__ load_const_optimized(R0, dest); __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(dest)); __ mtctr(R0); diff --git a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp index 04762a22c6110..7973e9d05459e 100644 --- a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp @@ -1032,7 +1032,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); const LIR_Opr reg = result_register_for(x->type()); - __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); @@ -1067,7 +1067,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); @@ -1075,7 +1075,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception); } // Following registers are used by slow_subtype_check: LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass diff --git a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp index 059bb2eae0c3a..83fad376d292a 100644 --- a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp @@ -92,7 +92,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox } if (LockingMode == LM_LIGHTWEIGHT) { - lightweight_lock(Roop, Rmark, Rscratch, slow_int); + lightweight_lock(Rbox, Roop, Rmark, Rscratch, slow_int); } else if (LockingMode == LM_LEGACY) { // ... and mark it unlocked. ori(Rmark, Rmark, markWord::unlocked_value); @@ -293,7 +293,7 @@ void C1_MacroAssembler::initialize_object( if (CURRENT_ENV->dtrace_alloc_probes()) { Unimplemented(); // assert(obj == O0, "must be"); -// call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)), +// call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)), // relocInfo::runtime_call_type); } @@ -369,7 +369,7 @@ void C1_MacroAssembler::allocate_array( if (CURRENT_ENV->dtrace_alloc_probes()) { Unimplemented(); //assert(obj == O0, "must be"); - //call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)), + //call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::dtrace_object_alloc_id)), // relocInfo::runtime_call_type); } @@ -398,7 +398,7 @@ void C1_MacroAssembler::null_check(Register r, Label* Lnull) { if (TrapBasedNullChecks) { // SIGTRAP based trap_null_check(r); } else { // explicit - //const address exception_entry = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + //const address exception_entry = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); assert(Lnull != nullptr, "must have Label for explicit check"); cmpdi(CCR0, r, 0); bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::equal), *Lnull); diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp index adddfda4ee74f..654626d66d812 100644 --- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp @@ -97,12 +97,12 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, //load_const_optimized(R0, StubRoutines::forward_exception_entry()); //mtctr(R0); //bctr(); - } else if (_stub_id == Runtime1::forward_exception_id) { + } else if (_stub_id == (int)C1StubId::forward_exception_id) { should_not_reach_here(); } else { // keep stub frame for next call_RT - //load_const_optimized(R0, Runtime1::entry_for(Runtime1::forward_exception_id)); - add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(Runtime1::forward_exception_id))); + //load_const_optimized(R0, Runtime1::entry_for(C1StubId::forward_exception_id)); + add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(C1StubId::forward_exception_id))); mtctr(R0); bctr(); } @@ -388,7 +388,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { return oop_maps; } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { OopMapSet* oop_maps = nullptr; // For better readability. @@ -397,22 +397,22 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // Stub code & info for the different stubs. switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { - if (id == new_instance_id) { + if (id == C1StubId::new_instance_id) { __ set_info("new_instance", dont_gc_arguments); - } else if (id == fast_new_instance_id) { + } else if (id == C1StubId::fast_new_instance_id) { __ set_info("fast new_instance", dont_gc_arguments); } else { - assert(id == fast_new_instance_init_check_id, "bad StubID"); + assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId"); __ set_info("fast new_instance init check", dont_gc_arguments); } @@ -422,15 +422,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: // Bci and method are on stack. oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), 2); break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -439,7 +439,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { #ifdef ASSERT // Assert object type is really an array of the proper kind. { - int tag = (id == new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value; + int tag = (id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value; Label ok; __ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2); __ srawi(R0, R0, Klass::_lh_array_tag_shift); @@ -453,7 +453,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // We don't support eden allocation. - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_type_array), R4_ARG2, R5_ARG3); } else { oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_object_array), R4_ARG2, R5_ARG3); @@ -461,7 +461,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { // R4: klass // R5: rank @@ -471,7 +471,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); // This code is called via rt_call. Hence, caller-save registers have been saved. @@ -501,50 +501,50 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { __ set_info("range_check_failed", dont_gc_arguments); // Arguments will be discarded. oop_maps = generate_exception_throw_with_stack_parms(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), 2); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { __ set_info("index_range_check_failed", dont_gc_arguments); // Arguments will be discarded. oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { __ set_info("throw_div0_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { __ set_info("throw_null_pointer_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { __ set_info("handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { __ set_info("handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/, Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/, @@ -572,28 +572,28 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { __ set_info("throw_array_store_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true); } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { __ set_info("throw_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super ); const Register sub_klass = R5, super_klass = R4, @@ -605,12 +605,12 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorenter_nofpu_id: - case monitorenter_id: + case C1StubId::monitorenter_nofpu_id: + case C1StubId::monitorenter_id: { __ set_info("monitorenter", dont_gc_arguments); - int save_fpu_registers = (id == monitorenter_id); + int save_fpu_registers = (id == C1StubId::monitorenter_id); // Make a frame and preserve the caller's caller-save registers. OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); @@ -624,15 +624,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: - case monitorexit_id: + case C1StubId::monitorexit_nofpu_id: + case C1StubId::monitorexit_id: { // note: Really a leaf routine but must setup last java sp // => use call_RT for now (speed can be improved by // doing last java sp setup manually). __ set_info("monitorexit", dont_gc_arguments); - int save_fpu_registers = (id == monitorexit_id); + int save_fpu_registers = (id == C1StubId::monitorexit_id); // Make a frame and preserve the caller's caller-save registers. OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); @@ -646,7 +646,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { __ set_info("deoptimize", dont_gc_arguments); __ std(R0, -8, R1_SP); // Pass trap_request on stack. @@ -662,35 +662,35 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { __ set_info("access_field_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { __ set_info("load_klass_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { __ set_info("load_mirror_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { __ set_info("load_appendix_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); } break; - case dtrace_object_alloc_id: + case C1StubId::dtrace_object_alloc_id: { // O0: object __ unimplemented("stub dtrace_object_alloc_id"); __ set_info("dtrace_object_alloc", dont_gc_arguments); @@ -710,7 +710,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { __ set_info("predicate_failed_trap", dont_gc_arguments); OopMap* oop_map = save_live_registers(sasm); @@ -754,7 +754,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler* sasm) { __ block_comment("generate_handle_exception"); // Save registers, if required. @@ -764,7 +764,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: // We're handling an exception in the context of a compiled frame. // The registers have been saved in the standard places. Perform // an exception lookup in the caller and dispatch to the handler @@ -780,12 +780,12 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { __ ld(Rexception_pc, _abi0(lr), Rexception_pc); __ std(R0, in_bytes(JavaThread::pending_exception_offset()), R16_thread); break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // At this point all registers MAY be live. - oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id, Rexception_pc); + oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id, Rexception_pc); break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: // At this point all registers except exception oop and exception pc are dead. oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); @@ -824,13 +824,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { // Restore the registers that were saved at the beginning, remove // the frame and jump to the exception handler. switch (id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: - restore_live_registers(sasm, noreg, noreg, id != handle_exception_nofpu_id); + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: + restore_live_registers(sasm, noreg, noreg, id != C1StubId::handle_exception_nofpu_id); __ bctr(); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { __ pop_frame(); __ ld(Rexception_pc, _abi0(lr), R1_SP); __ mtlr(Rexception_pc); diff --git a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp index cc69c0abe361f..1147c3b42b25f 100644 --- a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp @@ -39,12 +39,12 @@ void C2_MacroAssembler::fast_lock_lightweight(ConditionRegister flag, Register obj, Register box, Register tmp1, Register tmp2, Register tmp3) { - compiler_fast_lock_lightweight_object(flag, obj, tmp1, tmp2, tmp3); + compiler_fast_lock_lightweight_object(flag, obj, box, tmp1, tmp2, tmp3); } void C2_MacroAssembler::fast_unlock_lightweight(ConditionRegister flag, Register obj, Register box, Register tmp1, Register tmp2, Register tmp3) { - compiler_fast_unlock_lightweight_object(flag, obj, tmp1, tmp2, tmp3); + compiler_fast_unlock_lightweight_object(flag, obj, box, tmp1, tmp2, tmp3); } // Intrinsics for CompactStrings diff --git a/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp b/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp index 136fd7a8ad1cd..ddeb9adf0a9ae 100644 --- a/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp @@ -90,7 +90,7 @@ static size_t probe_valid_max_address_bit() { } size_t ZPlatformAddressOffsetBits() { - const static size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; + static const size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; const size_t max_address_offset_bits = valid_max_address_offset_bits - 3; const size_t min_address_offset_bits = max_address_offset_bits - 2; const size_t address_offset = round_up_power_of_2(MaxHeapSize * ZVirtualToPhysicalRatio); diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index a29e0810d52ca..aa77f0169ea1a 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -968,7 +968,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { } if (LockingMode == LM_LIGHTWEIGHT) { - lightweight_lock(object, header, tmp, slow_case); + lightweight_lock(monitor, object, header, tmp, slow_case); b(count_locking); } else if (LockingMode == LM_LEGACY) { // Load markWord from object into header. diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 8449d74d8a861..a8635af9582d1 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -2730,9 +2730,9 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe bind(failure); } -void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister flag, Register obj, Register tmp1, - Register tmp2, Register tmp3) { - assert_different_registers(obj, tmp1, tmp2, tmp3); +void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister flag, Register obj, Register box, + Register tmp1, Register tmp2, Register tmp3) { + assert_different_registers(obj, box, tmp1, tmp2, tmp3); assert(flag == CCR0, "bad condition register"); // Handle inflated monitor. @@ -2742,11 +2742,17 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla // Finish fast lock unsuccessfully. MUST branch to with flag == EQ Label slow_path; + if (UseObjectMonitorTable) { + // Clear cache in case fast locking succeeds. + li(tmp1, 0); + std(tmp1, in_bytes(BasicObjectLock::lock_offset()) + BasicLock::object_monitor_cache_offset_in_bytes(), box); + } + if (DiagnoseSyncOnValueBasedClasses != 0) { load_klass(tmp1, obj); lbz(tmp1, in_bytes(Klass::misc_flags_offset()), tmp1); - testbitdi(flag, R0, tmp1, exact_log2(KlassFlags::_misc_is_value_based_class)); - bne(flag, slow_path); + testbitdi(CCR0, R0, tmp1, exact_log2(KlassFlags::_misc_is_value_based_class)); + bne(CCR0, slow_path); } const Register mark = tmp1; @@ -2761,8 +2767,8 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla // Check if lock-stack is full. lwz(top, in_bytes(JavaThread::lock_stack_top_offset()), R16_thread); - cmplwi(flag, top, LockStack::end_offset() - 1); - bgt(flag, slow_path); + cmplwi(CCR0, top, LockStack::end_offset() - 1); + bgt(CCR0, slow_path); // The underflow check is elided. The recursive check will always fail // when the lock stack is empty because of the _bad_oop_sentinel field. @@ -2770,19 +2776,19 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla // Check if recursive. subi(t, top, oopSize); ldx(t, R16_thread, t); - cmpd(flag, obj, t); - beq(flag, push); + cmpd(CCR0, obj, t); + beq(CCR0, push); // Check for monitor (0b10) or locked (0b00). ld(mark, oopDesc::mark_offset_in_bytes(), obj); andi_(t, mark, markWord::lock_mask_in_place); - cmpldi(flag, t, markWord::unlocked_value); - bgt(flag, inflated); - bne(flag, slow_path); + cmpldi(CCR0, t, markWord::unlocked_value); + bgt(CCR0, inflated); + bne(CCR0, slow_path); // Not inflated. - // Try to lock. Transition lock bits 0b00 => 0b01 + // Try to lock. Transition lock bits 0b01 => 0b00 assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid a lea"); atomically_flip_locked_state(/* is_unlock */ false, obj, mark, slow_path, MacroAssembler::MemBarAcq); @@ -2797,38 +2803,84 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla { // Handle inflated monitor. bind(inflated); + // mark contains the tagged ObjectMonitor*. + const uintptr_t monitor_tag = markWord::monitor_value; + const Register monitor = mark; + const Register owner_addr = tmp2; + Label monitor_locked; + if (!UseObjectMonitorTable) { - // mark contains the tagged ObjectMonitor*. - const Register tagged_monitor = mark; - const uintptr_t monitor_tag = markWord::monitor_value; - const Register owner_addr = tmp2; + // Compute owner address. + addi(owner_addr, mark, in_bytes(ObjectMonitor::owner_offset()) - monitor_tag); + } else { + Label monitor_found; + Register cache_addr = tmp2; + + // Load cache address + addi(cache_addr, R16_thread, in_bytes(JavaThread::om_cache_oops_offset())); + + const int num_unrolled = 2; + for (int i = 0; i < num_unrolled; i++) { + ld(tmp3, 0, cache_addr); + cmpd(CCR0, tmp3, obj); + beq(CCR0, monitor_found); + addi(cache_addr, cache_addr, in_bytes(OMCache::oop_to_oop_difference())); + } + + Label loop; + + // Search for obj in cache. + bind(loop); + + // Check for match. + ld(tmp3, 0, cache_addr); + cmpd(CCR0, tmp3, obj); + beq(CCR0, monitor_found); + + // Search until null encountered, guaranteed _null_sentinel at end. + addi(cache_addr, cache_addr, in_bytes(OMCache::oop_to_oop_difference())); + cmpdi(CCR1, tmp3, 0); + bne(CCR1, loop); + // Cache Miss, CCR0.NE set from cmp above + b(slow_path); + + bind(monitor_found); + ld(monitor, in_bytes(OMCache::oop_to_monitor_difference()), cache_addr); // Compute owner address. - addi(owner_addr, tagged_monitor, in_bytes(ObjectMonitor::owner_offset()) - monitor_tag); - - // CAS owner (null => current thread). - cmpxchgd(/*flag=*/flag, - /*current_value=*/t, - /*compare_value=*/(intptr_t)0, - /*exchange_value=*/R16_thread, - /*where=*/owner_addr, - MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, - MacroAssembler::cmpxchgx_hint_acquire_lock()); - beq(flag, locked); - - // Check if recursive. - cmpd(flag, t, R16_thread); - bne(flag, slow_path); - - // Recursive. + addi(owner_addr, monitor, in_bytes(ObjectMonitor::owner_offset())); + } + + // CAS owner (null => current thread). + cmpxchgd(/*flag=*/CCR0, + /*current_value=*/t, + /*compare_value=*/(intptr_t)0, + /*exchange_value=*/R16_thread, + /*where=*/owner_addr, + MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, + MacroAssembler::cmpxchgx_hint_acquire_lock()); + beq(CCR0, monitor_locked); + + // Check if recursive. + cmpd(CCR0, t, R16_thread); + bne(CCR0, slow_path); + + // Recursive. + if (!UseObjectMonitorTable) { + assert_different_registers(tmp1, owner_addr); ld(tmp1, in_bytes(ObjectMonitor::recursions_offset() - ObjectMonitor::owner_offset()), owner_addr); addi(tmp1, tmp1, 1); std(tmp1, in_bytes(ObjectMonitor::recursions_offset() - ObjectMonitor::owner_offset()), owner_addr); } else { - // OMCache lookup not supported yet. Take the slowpath. - // Set flag to NE - crxor(flag, Assembler::equal, flag, Assembler::equal); - b(slow_path); + assert_different_registers(tmp2, monitor); + ld(tmp2, in_bytes(ObjectMonitor::recursions_offset()), monitor); + addi(tmp2, tmp2, 1); + std(tmp2, in_bytes(ObjectMonitor::recursions_offset()), monitor); + } + + bind(monitor_locked); + if (UseObjectMonitorTable) { + std(monitor, BasicLock::object_monitor_cache_offset_in_bytes(), box); } } @@ -2838,21 +2890,21 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla #ifdef ASSERT // Check that locked label is reached with flag == EQ. Label flag_correct; - beq(flag, flag_correct); + beq(CCR0, flag_correct); stop("Fast Lock Flag != EQ"); #endif bind(slow_path); #ifdef ASSERT // Check that slow_path label is reached with flag == NE. - bne(flag, flag_correct); + bne(CCR0, flag_correct); stop("Fast Lock Flag != NE"); bind(flag_correct); #endif // C2 uses the value of flag (NE vs EQ) to determine the continuation. } -void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister flag, Register obj, Register tmp1, - Register tmp2, Register tmp3) { +void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister flag, Register obj, Register box, + Register tmp1, Register tmp2, Register tmp3) { assert_different_registers(obj, tmp1, tmp2, tmp3); assert(flag == CCR0, "bad condition register"); @@ -2874,9 +2926,9 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f lwz(top, in_bytes(JavaThread::lock_stack_top_offset()), R16_thread); subi(top, top, oopSize); ldx(t, R16_thread, top); - cmpd(flag, obj, t); + cmpd(CCR0, obj, t); // Top of lock stack was not obj. Must be monitor. - bne(flag, inflated_load_monitor); + bne(CCR0, inflated_load_monitor); // Pop lock-stack. DEBUG_ONLY(li(t, 0);) @@ -2889,8 +2941,8 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f // Check if recursive. subi(t, top, oopSize); ldx(t, R16_thread, t); - cmpd(flag, obj, t); - beq(flag, unlocked); + cmpd(CCR0, obj, t); + beq(CCR0, unlocked); // Not recursive. @@ -2941,62 +2993,62 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f cmplwi(CCR0, top, in_bytes(JavaThread::lock_stack_base_offset())); blt(CCR0, check_done); ldx(t, R16_thread, top); - cmpd(flag, obj, t); - bne(flag, inflated); + cmpd(CCR0, obj, t); + bne(CCR0, inflated); stop("Fast Unlock lock on stack"); bind(check_done); #endif - if (!UseObjectMonitorTable) { - // mark contains the tagged ObjectMonitor*. - const Register monitor = mark; - const uintptr_t monitor_tag = markWord::monitor_value; + // mark contains the tagged ObjectMonitor*. + const Register monitor = mark; + const uintptr_t monitor_tag = markWord::monitor_value; + if (!UseObjectMonitorTable) { // Untag the monitor. subi(monitor, mark, monitor_tag); + } else { + ld(monitor, BasicLock::object_monitor_cache_offset_in_bytes(), box); + // null check with Flags == NE, no valid pointer below alignof(ObjectMonitor*) + cmpldi(CCR0, monitor, checked_cast(alignof(ObjectMonitor*))); + blt(CCR0, slow_path); + } - const Register recursions = tmp2; - Label not_recursive; + const Register recursions = tmp2; + Label not_recursive; - // Check if recursive. - ld(recursions, in_bytes(ObjectMonitor::recursions_offset()), monitor); - addic_(recursions, recursions, -1); - blt(CCR0, not_recursive); + // Check if recursive. + ld(recursions, in_bytes(ObjectMonitor::recursions_offset()), monitor); + addic_(recursions, recursions, -1); + blt(CCR0, not_recursive); - // Recursive unlock. - std(recursions, in_bytes(ObjectMonitor::recursions_offset()), monitor); - crorc(CCR0, Assembler::equal, CCR0, Assembler::equal); - b(unlocked); + // Recursive unlock. + std(recursions, in_bytes(ObjectMonitor::recursions_offset()), monitor); + crorc(CCR0, Assembler::equal, CCR0, Assembler::equal); + b(unlocked); - bind(not_recursive); + bind(not_recursive); - Label release_; - const Register t2 = tmp2; + Label release_; + const Register t2 = tmp2; - // Check if the entry lists are empty. - ld(t, in_bytes(ObjectMonitor::EntryList_offset()), monitor); - ld(t2, in_bytes(ObjectMonitor::cxq_offset()), monitor); - orr(t, t, t2); - cmpdi(flag, t, 0); - beq(flag, release_); + // Check if the entry lists are empty. + ld(t, in_bytes(ObjectMonitor::EntryList_offset()), monitor); + ld(t2, in_bytes(ObjectMonitor::cxq_offset()), monitor); + orr(t, t, t2); + cmpdi(CCR0, t, 0); + beq(CCR0, release_); - // The owner may be anonymous and we removed the last obj entry in - // the lock-stack. This loses the information about the owner. - // Write the thread to the owner field so the runtime knows the owner. - std(R16_thread, in_bytes(ObjectMonitor::owner_offset()), monitor); - b(slow_path); + // The owner may be anonymous and we removed the last obj entry in + // the lock-stack. This loses the information about the owner. + // Write the thread to the owner field so the runtime knows the owner. + std(R16_thread, in_bytes(ObjectMonitor::owner_offset()), monitor); + b(slow_path); - bind(release_); - // Set owner to null. - release(); - // t contains 0 - std(t, in_bytes(ObjectMonitor::owner_offset()), monitor); - } else { - // OMCache lookup not supported yet. Take the slowpath. - // Set flag to NE - crxor(flag, Assembler::equal, flag, Assembler::equal); - b(slow_path); - } + bind(release_); + // Set owner to null. + release(); + // t contains 0 + std(t, in_bytes(ObjectMonitor::owner_offset()), monitor); } bind(unlocked); @@ -3005,13 +3057,13 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f #ifdef ASSERT // Check that unlocked label is reached with flag == EQ. Label flag_correct; - beq(flag, flag_correct); + beq(CCR0, flag_correct); stop("Fast Lock Flag != EQ"); #endif bind(slow_path); #ifdef ASSERT // Check that slow_path label is reached with flag == NE. - bne(flag, flag_correct); + bne(CCR0, flag_correct); stop("Fast Lock Flag != NE"); bind(flag_correct); #endif @@ -4640,15 +4692,21 @@ void MacroAssembler::atomically_flip_locked_state(bool is_unlock, Register obj, // // - obj: the object to be locked // - t1, t2: temporary register -void MacroAssembler::lightweight_lock(Register obj, Register t1, Register t2, Label& slow) { +void MacroAssembler::lightweight_lock(Register box, Register obj, Register t1, Register t2, Label& slow) { assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking"); - assert_different_registers(obj, t1, t2); + assert_different_registers(box, obj, t1, t2); Label push; const Register top = t1; const Register mark = t2; const Register t = R0; + if (UseObjectMonitorTable) { + // Clear cache in case fast locking succeeds. + li(t, 0); + std(t, in_bytes(BasicObjectLock::lock_offset()) + BasicLock::object_monitor_cache_offset_in_bytes(), box); + } + // Check if the lock-stack is full. lwz(top, in_bytes(JavaThread::lock_stack_top_offset()), R16_thread); cmplwi(CCR0, top, LockStack::end_offset()); @@ -4669,7 +4727,7 @@ void MacroAssembler::lightweight_lock(Register obj, Register t1, Register t2, La andi_(t, t, markWord::lock_mask_in_place); bne(CCR0, slow); - // Try to lock. Transition lock bits 0b00 => 0b01 + // Try to lock. Transition lock bits 0b01 => 0b00 atomically_flip_locked_state(/* is_unlock */ false, obj, mark, slow, MacroAssembler::MemBarAcq); bind(push); diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index 03ad37a4fb04a..224e7bff99541 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -654,7 +654,7 @@ class MacroAssembler: public Assembler { void inc_held_monitor_count(Register tmp); void dec_held_monitor_count(Register tmp); void atomically_flip_locked_state(bool is_unlock, Register obj, Register tmp, Label& failed, int semantics); - void lightweight_lock(Register obj, Register t1, Register t2, Label& slow); + void lightweight_lock(Register box, Register obj, Register t1, Register t2, Label& slow); void lightweight_unlock(Register obj, Register t1, Label& slow); // allocation (for C1) @@ -675,11 +675,11 @@ class MacroAssembler: public Assembler { void compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, Register tmp1, Register tmp2, Register tmp3); - void compiler_fast_lock_lightweight_object(ConditionRegister flag, Register oop, Register tmp1, - Register tmp2, Register tmp3); + void compiler_fast_lock_lightweight_object(ConditionRegister flag, Register oop, Register box, + Register tmp1, Register tmp2, Register tmp3); - void compiler_fast_unlock_lightweight_object(ConditionRegister flag, Register oop, Register tmp1, - Register tmp2, Register tmp3); + void compiler_fast_unlock_lightweight_object(ConditionRegister flag, Register oop, Register box, + Register tmp1, Register tmp2, Register tmp3); // Check if safepoint requested and if so branch void safepoint_poll(Label& slow_path, Register temp, bool at_return, bool in_nmethod); diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index e7e066ebcc6d3..612b7bf898c08 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -12106,10 +12106,10 @@ instruct cmpFastUnlock(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp ins_pipe(pipe_class_compare); %} -instruct cmpFastLockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{ +instruct cmpFastLockLightweight(flagsRegCR0 crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, flagsRegCR1 cr1) %{ predicate(LockingMode == LM_LIGHTWEIGHT); match(Set crx (FastLock oop box)); - effect(TEMP tmp1, TEMP tmp2); + effect(TEMP tmp1, TEMP tmp2, KILL cr1); format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2" %} ins_encode %{ diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp index 5cf5f7cf73e03..aa8ae6070b6a6 100644 --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp @@ -2399,7 +2399,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, // Try fastpath for locking. if (LockingMode == LM_LIGHTWEIGHT) { // fast_lock kills r_temp_1, r_temp_2, r_temp_3. - __ compiler_fast_lock_lightweight_object(CCR0, r_oop, r_temp_1, r_temp_2, r_temp_3); + __ compiler_fast_lock_lightweight_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3); } else { // fast_lock kills r_temp_1, r_temp_2, r_temp_3. __ compiler_fast_lock_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3); @@ -2605,7 +2605,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, // Try fastpath for unlocking. if (LockingMode == LM_LIGHTWEIGHT) { - __ compiler_fast_unlock_lightweight_object(CCR0, r_oop, r_temp_1, r_temp_2, r_temp_3); + __ compiler_fast_unlock_lightweight_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3); } else { __ compiler_fast_unlock_object(CCR0, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3); } diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp index cba3dd919dafb..98ab86bf72eb6 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp @@ -1267,6 +1267,7 @@ enum VectorMask { INSN(viota_m, 0b1010111, 0b010, 0b10000, 0b010100); // Vector Single-Width Floating-Point/Integer Type-Convert Instructions + INSN(vfcvt_x_f_v, 0b1010111, 0b001, 0b00001, 0b010010); INSN(vfcvt_f_x_v, 0b1010111, 0b001, 0b00011, 0b010010); INSN(vfcvt_rtz_x_f_v, 0b1010111, 0b001, 0b00111, 0b010010); diff --git a/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp b/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp index b7e1b7863efdb..fb81082072610 100644 --- a/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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. @@ -62,7 +62,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { __ mov_metadata(t0, m); ce->store_parameter(t0, 1); ce->store_parameter(_bci, 0); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); __ j(_continuation); @@ -71,7 +71,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ far_call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -84,13 +84,13 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { } else { __ mv(t0, _index->as_jint()); } - Runtime1::StubID stub_id; + C1StubId stub_id; if (_throw_index_out_of_bounds_exception) { - stub_id = Runtime1::throw_index_exception_id; + stub_id = C1StubId::throw_index_exception_id; } else { assert(_array != LIR_Opr::nullOpr(), "sanity"); __ mv(t1, _array->as_pointer_register()); - stub_id = Runtime1::throw_range_check_failed_id; + stub_id = C1StubId::throw_range_check_failed_id; } // t0 and t1 are used as args in generate_exception_throw, // so use ra as the tmp register for rt_call. @@ -106,7 +106,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ far_call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -118,7 +118,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); #ifdef ASSERT @@ -127,14 +127,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { } // Implementation of NewInstanceStub -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -163,7 +163,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == x9, "length must in x9"); assert(_klass_reg->as_register() == x13, "klass_reg must in x13"); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == x10, "result must in x10"); @@ -183,7 +183,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == x9, "length must in x9"); assert(_klass_reg->as_register() == x13, "klass_reg must in x13"); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == x10, "result must in x10"); @@ -195,11 +195,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_obj_reg->as_register(), 1); ce->store_parameter(_lock_reg->as_register(), 0); - Runtime1::StubID enter_id; + C1StubId enter_id; if (ce->compilation()->has_fpu_code()) { - enter_id = Runtime1::monitorenter_id; + enter_id = C1StubId::monitorenter_id; } else { - enter_id = Runtime1::monitorenter_nofpu_id; + enter_id = C1StubId::monitorenter_nofpu_id; } __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id))); ce->add_call_info_here(_info); @@ -215,11 +215,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { } ce->store_parameter(_lock_reg->as_register(), 0); // note: non-blocking leaf routine => no call info needed - Runtime1::StubID exit_id; + C1StubId exit_id; if (ce->compilation()->has_fpu_code()) { - exit_id = Runtime1::monitorexit_id; + exit_id = C1StubId::monitorexit_id; } else { - exit_id = Runtime1::monitorexit_nofpu_id; + exit_id = C1StubId::monitorexit_nofpu_id; } __ la(ra, _continuation); __ far_jump(RuntimeAddress(Runtime1::entry_for(exit_id))); @@ -244,7 +244,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_trap_request, 0); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id))); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); } @@ -253,9 +253,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { address a = nullptr; if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is probably wrong to do it here. - a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); } ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp index a8f260acae8ce..012932189382c 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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. * @@ -223,7 +223,7 @@ void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Registe __ check_klass_subtype_fast_path(src, dst, tmp, &cont, &slow, nullptr); PUSH(src, dst); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); POP(src, dst); __ bnez(dst, cont); diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp index 3d146b87707aa..940706b0a7376 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp @@ -305,7 +305,7 @@ int LIR_Assembler::emit_exception_handler() { __ verify_not_null_oop(x10); // search an exception handler (x10: exception oop, x13: throwing pc) - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id))); __ should_not_reach_here(); guarantee(code_offset() - offset <= exception_handler_size(), "overflow"); __ end_a_stub(); @@ -361,7 +361,7 @@ int LIR_Assembler::emit_unwind_handler() { // remove the activation and dispatch to the unwind handler __ block_comment("remove_frame and dispatch to the unwind handler"); __ remove_frame(initial_frame_size_in_bytes()); - __ far_jump(RuntimeAddress(Runtime1::entry_for(Runtime1::unwind_exception_id))); + __ far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id))); // Emit the slow path assembly if (stub != nullptr) { @@ -1088,7 +1088,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo __ sd(k_RInfo, Address(sp, 0)); // sub klass __ sd(klass_RInfo, Address(sp, wordSize)); // super klass - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); // load result to k_RInfo __ ld(k_RInfo, Address(sp, 0)); __ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo @@ -1103,7 +1103,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo __ sd(klass_RInfo, Address(sp, wordSize)); // sub klass __ sd(k_RInfo, Address(sp, 0)); // super klass - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); // load result to k_RInfo __ ld(k_RInfo, Address(sp, 0)); __ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo @@ -1391,7 +1391,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit // exception object is not added to oop map by LinearScan // (LinearScan assumes that no oops are in fixed registers) info->add_register_oop(exceptionOop); - Runtime1::StubID unwind_id; + C1StubId unwind_id; // get current pc information // pc is only needed if the method has an exception handler, the unwind code does not need it. @@ -1414,9 +1414,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit __ verify_not_null_oop(x10); // search an exception handler (x10: exception oop, x13: throwing pc) if (compilation()->has_fpu_code()) { - unwind_id = Runtime1::handle_exception_id; + unwind_id = C1StubId::handle_exception_id; } else { - unwind_id = Runtime1::handle_exception_nofpu_id; + unwind_id = C1StubId::handle_exception_nofpu_id; } __ far_call(RuntimeAddress(Runtime1::entry_for(unwind_id))); __ nop(); @@ -2054,16 +2054,16 @@ void LIR_Assembler::deoptimize_trap(CodeEmitInfo *info) { switch (patching_id(info)) { case PatchingStub::access_field_id: - target = Runtime1::entry_for(Runtime1::access_field_patching_id); + target = Runtime1::entry_for(C1StubId::access_field_patching_id); break; case PatchingStub::load_klass_id: - target = Runtime1::entry_for(Runtime1::load_klass_patching_id); + target = Runtime1::entry_for(C1StubId::load_klass_patching_id); break; case PatchingStub::load_mirror_id: - target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); + target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); break; case PatchingStub::load_appendix_id: - target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); + target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); break; default: ShouldNotReachHere(); } @@ -2152,7 +2152,7 @@ void LIR_Assembler::lir_store_slowcheck(Register k_RInfo, Register klass_RInfo, __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo __ sd(klass_RInfo, Address(sp, wordSize)); // sub klass __ sd(k_RInfo, Address(sp, 0)); // super klass - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); // load result to k_RInfo __ ld(k_RInfo, Address(sp, 0)); __ addi(sp, sp, 2 * wordSize); // 2: pop out k_RInfo and klass_RInfo diff --git a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp index 409e8dc0a0d95..b328d457192ba 100644 --- a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 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. @@ -1030,7 +1030,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); LIR_Opr reg = result_register_for(x->type()); - __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); @@ -1062,7 +1062,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { CodeStub* stub = nullptr; if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); @@ -1070,7 +1070,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception); } LIR_Opr reg = rlock_result(x); LIR_Opr tmp3 = LIR_OprFact::illegalOpr; diff --git a/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp index 1ae64b4f283ba..1e4b66069ee23 100644 --- a/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp @@ -276,7 +276,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == x10, "must be"); - far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); @@ -316,7 +316,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1 if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == x10, "must be"); - far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); diff --git a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp index 824d03640517e..5e4031727c827 100644 --- a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp @@ -98,10 +98,10 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres if (frame_size() == no_frame_size) { leave(); far_jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - } else if (_stub_id == Runtime1::forward_exception_id) { + } else if (_stub_id == (int)C1StubId::forward_exception_id) { should_not_reach_here(); } else { - far_jump(RuntimeAddress(Runtime1::entry_for(Runtime1::forward_exception_id))); + far_jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id))); } bind(L); } @@ -376,7 +376,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe return oop_maps; } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) { __ block_comment("generate_handle_exception"); // incoming parameters @@ -388,7 +388,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { OopMap* oop_map = nullptr; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: // We're handling an exception in the context of a compiled frame. // The registers have been saved in the standard places. Perform // an exception lookup in the caller and dispatch to the handler @@ -407,12 +407,12 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ sd(zr, Address(xthread, JavaThread::vm_result_offset())); __ sd(zr, Address(xthread, JavaThread::vm_result_2_offset())); break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // At this point all registers MAY be live. - oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id); + oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { // At this point all registers except exception oop (x10) and // exception pc (ra) are dead. const int frame_size = 2 /* fp, return address */; @@ -469,13 +469,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ sd(x10, Address(fp, frame::return_addr_offset * BytesPerWord)); switch (id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // Restore the registers that were saved at the beginning. - restore_live_registers(sasm, id != handle_exception_nofpu_id); + restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: break; default: ShouldNotReachHere(); } @@ -621,7 +621,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { return oop_maps; } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { // for better readability const bool dont_gc_arguments = false; @@ -632,7 +632,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { OopMapSet* oop_maps = nullptr; switch (id) { { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); __ leave(); @@ -640,32 +640,32 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { Register klass = x13; // Incoming Register obj = x10; // Result - if (id == new_instance_id) { + if (id == C1StubId::new_instance_id) { __ set_info("new_instance", dont_gc_arguments); - } else if (id == fast_new_instance_id) { + } else if (id == C1StubId::fast_new_instance_id) { __ set_info("fast new_instance", dont_gc_arguments); } else { - assert(id == fast_new_instance_init_check_id, "bad StubID"); + assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId"); __ set_info("fast new_instance init check", dont_gc_arguments); } @@ -686,7 +686,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: { Register bci = x10; Register method = x11; @@ -710,14 +710,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { Register length = x9; // Incoming Register klass = x13; // Incoming Register obj = x10; // Result - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -730,7 +730,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Register tmp = obj; __ lwu(tmp, Address(klass, Klass::layout_helper_offset())); __ sraiw(tmp, tmp, Klass::_lh_array_tag_shift); - int tag = ((id == new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value); + int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value); __ mv(t0, tag); __ beq(t0, tmp, ok); __ stop("assert(is an array klass)"); @@ -743,7 +743,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { OopMap* map = save_live_registers(sasm); assert_cond(map != nullptr); int call_offset = 0; - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length); } else { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length); @@ -762,7 +762,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { StubFrame f(sasm, "new_multi_array", dont_gc_arguments); // x10: klass @@ -785,7 +785,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); @@ -819,14 +819,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, @@ -834,7 +834,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // Typical calling sequence: // push klass_RInfo (object klass or other subclass) @@ -874,10 +874,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorenter_nofpu_id: + case C1StubId::monitorenter_nofpu_id: save_fpu_registers = false; // fall through - case monitorenter_id: + case C1StubId::monitorenter_id: { StubFrame f(sasm, "monitorenter", dont_gc_arguments); OopMap* map = save_live_registers(sasm, save_fpu_registers); @@ -896,10 +896,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: + case C1StubId::monitorexit_nofpu_id: save_fpu_registers = false; // fall through - case monitorexit_id: + case C1StubId::monitorexit_id: { StubFrame f(sasm, "monitorexit", dont_gc_arguments); OopMap* map = save_live_registers(sasm, save_fpu_registers); @@ -920,7 +920,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { StubFrame f(sasm, "deoptimize", dont_gc_arguments, does_not_return); OopMap* oop_map = save_live_registers(sasm); @@ -939,14 +939,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { StubFrame f(sasm, "range_check_failed", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { __ set_info("unwind_exception", dont_gc_arguments); // note: no stubframe since we are about to leave the current @@ -955,7 +955,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { StubFrame f(sasm, "access_field_patching", dont_gc_arguments, does_not_return); // we should set up register map @@ -963,7 +963,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { StubFrame f(sasm, "load_klass_patching", dont_gc_arguments, does_not_return); // we should set up register map @@ -971,7 +971,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments, does_not_return); // we should set up register map @@ -979,7 +979,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments, does_not_return); // we should set up register map @@ -987,29 +987,29 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { StubFrame f(sasm, "handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments, does_not_return); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments, does_not_return); // tos + 0: link @@ -1018,7 +1018,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments, does_not_return); @@ -1038,7 +1038,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case dtrace_object_alloc_id: + case C1StubId::dtrace_object_alloc_id: { // c_rarg0: object StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); save_live_registers(sasm); diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp index 1e3a8bde064b3..e2c9b9dd609e0 100644 --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp @@ -2385,6 +2385,74 @@ void C2_MacroAssembler::expand_bits_l_v(Register dst, Register src, Register mas expand_bits_v(dst, src, mask, /* is_long */ true); } +// j.l.Math.round(float) +// Returns the closest int to the argument, with ties rounding to positive infinity. +// We need to handle 3 special cases defined by java api spec: +// NaN, +// float >= Integer.MAX_VALUE, +// float <= Integer.MIN_VALUE. +void C2_MacroAssembler::java_round_float_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, + BasicType bt, uint vector_length) { + // In riscv, there is no straight corresponding rounding mode to satisfy the behaviour defined, + // in java api spec, i.e. any rounding mode can not handle some corner cases, e.g. + // RNE is the closest one, but it ties to "even", which means 1.5/2.5 both will be converted + // to 2, instead of 2 and 3 respectively. + // RUP does not work either, although java api requires "rounding to positive infinity", + // but both 1.3/1.8 will be converted to 2, instead of 1 and 2 respectively. + // + // The optimal solution for non-NaN cases is: + // src+0.5 => dst, with rdn rounding mode, + // convert dst from float to int, with rnd rounding mode. + // and, this solution works as expected for float >= Integer.MAX_VALUE and float <= Integer.MIN_VALUE. + // + // But, we still need to handle NaN explicilty with vector mask instructions. + // + // Check MacroAssembler::java_round_float and C2_MacroAssembler::vector_round_sve in aarch64 for more details. + + csrwi(CSR_FRM, C2_MacroAssembler::rdn); + vsetvli_helper(bt, vector_length); + + // don't rearrage the instructions sequence order without performance testing. + // check MacroAssembler::java_round_float in riscv64 for more details. + mv(t0, jint_cast(0.5f)); + fmv_w_x(ftmp, t0); + + // replacing vfclass with feq as performance optimization + vmfeq_vv(v0, src, src); + // set dst = 0 in cases of NaN + vmv_v_x(dst, zr); + + // dst = (src + 0.5) rounded down towards negative infinity + vfadd_vf(dst, src, ftmp, Assembler::v0_t); + vfcvt_x_f_v(dst, dst, Assembler::v0_t); // in RoundingMode::rdn + + csrwi(CSR_FRM, C2_MacroAssembler::rne); +} + +// java.lang.Math.round(double a) +// Returns the closest long to the argument, with ties rounding to positive infinity. +void C2_MacroAssembler::java_round_double_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, + BasicType bt, uint vector_length) { + // check C2_MacroAssembler::java_round_float_v above for more details. + + csrwi(CSR_FRM, C2_MacroAssembler::rdn); + vsetvli_helper(bt, vector_length); + + mv(t0, julong_cast(0.5)); + fmv_d_x(ftmp, t0); + + // replacing vfclass with feq as performance optimization + vmfeq_vv(v0, src, src); + // set dst = 0 in cases of NaN + vmv_v_x(dst, zr); + + // dst = (src + 0.5) rounded down towards negative infinity + vfadd_vf(dst, src, ftmp, Assembler::v0_t); + vfcvt_x_f_v(dst, dst, Assembler::v0_t); // in RoundingMode::rdn + + csrwi(CSR_FRM, C2_MacroAssembler::rne); +} + void C2_MacroAssembler::element_compare(Register a1, Register a2, Register result, Register cnt, Register tmp1, Register tmp2, VectorRegister vr1, VectorRegister vr2, VectorRegister vrs, bool islatin, Label &DONE, Assembler::LMUL lmul) { diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.hpp index 4d7f756923c24..38351565cc626 100644 --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.hpp @@ -187,6 +187,9 @@ void expand_bits_i_v(Register dst, Register src, Register mask); void expand_bits_l_v(Register dst, Register src, Register mask); + void java_round_float_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, BasicType bt, uint vector_length); + void java_round_double_v(VectorRegister dst, VectorRegister src, FloatRegister ftmp, BasicType bt, uint vector_length); + void float16_to_float_v(VectorRegister dst, VectorRegister src, uint vector_length); void float_to_float16_v(VectorRegister dst, VectorRegister src, VectorRegister vtmp, Register tmp, uint vector_length); diff --git a/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp index ef13676b02ed8..df111723d56b6 100644 --- a/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp @@ -92,7 +92,7 @@ static size_t probe_valid_max_address_bit() { } size_t ZPlatformAddressOffsetBits() { - const static size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; + static const size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1; const size_t max_address_offset_bits = valid_max_address_offset_bits - 3; const size_t min_address_offset_bits = max_address_offset_bits - 2; const size_t address_offset = round_up_power_of_2(MaxHeapSize * ZVirtualToPhysicalRatio); diff --git a/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp b/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp index 312e5cad9635a..a0ff429b87a70 100644 --- a/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp +++ b/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp @@ -74,6 +74,16 @@ InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( _stack_offset = 0; } +// The C ABI specifies: +// "integer scalars narrower than XLEN bits are widened according to the sign +// of their type up to 32 bits, then sign-extended to XLEN bits." +// Applies for both passed in register and stack. +// +// Java uses 32-bit stack slots; jint, jshort, jchar, jbyte uses one slot. +// Native uses 64-bit stack slots for all integer scalar types. +// +// lw loads the Java stack slot, sign-extends and +// sd store this widened integer into a 64 bit native stack slot. void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { const Address src(from(), Interpreter::local_offset_in_bytes(offset())); @@ -82,7 +92,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { __ lw(reg, src); } else { __ lw(x10, src); - __ sw(x10, Address(to(), next_stack_offset())); + __ sd(x10, Address(to(), next_stack_offset())); } } diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index a4eaab9b0285e..dc25172da259e 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -1454,6 +1454,103 @@ void MacroAssembler::update_word_crc32(Register crc, Register v, Register tmp1, xorr(crc, crc, tmp2); } + +// This improvement (vectorization) is based on java.base/share/native/libzip/zlib/zcrc32.c. +// To make it, following steps are taken: +// 1. in zcrc32.c, modify N to 16 and related code, +// 2. re-generate the tables needed, we use tables of (N == 16, W == 4) +// 3. finally vectorize the code (original implementation in zcrc32.c is just scalar code). +// New tables for vector version is after table3. +void MacroAssembler::vector_update_crc32(Register crc, Register buf, Register len, + Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, + Register table0, Register table3) { + assert_different_registers(t1, crc, buf, len, tmp1, tmp2, tmp3, tmp4, tmp5, table0, table3); + const int N = 16, W = 4; + const int64_t single_table_size = 256; + const Register blks = tmp2; + const Register tmpTable = tmp3, tableN16 = tmp4; + const VectorRegister vcrc = v4, vword = v8, vtmp = v12; + Label VectorLoop; + Label LastBlock; + + add(tableN16, table3, 1*single_table_size*sizeof(juint), tmp1); + mv(tmp5, 0xff); + + if (MaxVectorSize == 16) { + vsetivli(zr, N, Assembler::e32, Assembler::m4, Assembler::ma, Assembler::ta); + } else if (MaxVectorSize == 32) { + vsetivli(zr, N, Assembler::e32, Assembler::m2, Assembler::ma, Assembler::ta); + } else { + assert(MaxVectorSize > 32, "sanity"); + vsetivli(zr, N, Assembler::e32, Assembler::m1, Assembler::ma, Assembler::ta); + } + + vmv_v_x(vcrc, zr); + vmv_s_x(vcrc, crc); + + // multiple of 64 + srli(blks, len, 6); + slli(t1, blks, 6); + sub(len, len, t1); + sub(blks, blks, 1); + blez(blks, LastBlock); + + bind(VectorLoop); + { + mv(tmpTable, tableN16); + + vle32_v(vword, buf); + vxor_vv(vword, vword, vcrc); + + addi(buf, buf, N*4); + + vand_vx(vtmp, vword, tmp5); + vsll_vi(vtmp, vtmp, 2); + vluxei32_v(vcrc, tmpTable, vtmp); + + mv(tmp1, 1); + for (int k = 1; k < W; k++) { + addi(tmpTable, tmpTable, single_table_size*4); + + slli(t1, tmp1, 3); + vsrl_vx(vtmp, vword, t1); + + vand_vx(vtmp, vtmp, tmp5); + vsll_vi(vtmp, vtmp, 2); + vluxei32_v(vtmp, tmpTable, vtmp); + + vxor_vv(vcrc, vcrc, vtmp); + + addi(tmp1, tmp1, 1); + } + + sub(blks, blks, 1); + bgtz(blks, VectorLoop); + } + + bind(LastBlock); + { + vle32_v(vtmp, buf); + vxor_vv(vcrc, vcrc, vtmp); + mv(crc, zr); + for (int i = 0; i < N; i++) { + vmv_x_s(tmp2, vcrc); + // in vmv_x_s, the value is sign-extended to SEW bits, but we need zero-extended here. + zext_w(tmp2, tmp2); + vslidedown_vi(vcrc, vcrc, 1); + xorr(crc, crc, tmp2); + for (int j = 0; j < W; j++) { + andr(t1, crc, tmp5); + shadd(t1, t1, table0, tmp1, 2); + lwu(t1, Address(t1, 0)); + srli(tmp2, crc, 8); + xorr(crc, tmp2, t1); + } + } + addi(buf, buf, N*4); + } +} + /** * @param crc register containing existing CRC (32-bit) * @param buf register pointing to input byte buffer (byte*) @@ -1465,21 +1562,28 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, Register table0, Register table1, Register table2, Register table3, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, Register tmp6) { assert_different_registers(crc, buf, len, table0, table1, table2, table3, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); - Label L_by16_loop, L_unroll_loop, L_unroll_loop_entry, L_by4, L_by4_loop, L_by1, L_by1_loop, L_exit; + Label L_by16_loop, L_vector_entry, L_unroll_loop, L_unroll_loop_entry, L_by4, L_by4_loop, L_by1, L_by1_loop, L_exit; + const int64_t single_table_size = 256; const int64_t unroll = 16; const int64_t unroll_words = unroll*wordSize; mv(tmp5, right_32_bits); - subw(len, len, unroll_words); andn(crc, tmp5, crc); const ExternalAddress table_addr = StubRoutines::crc_table_addr(); la(table0, table_addr); - add(table1, table0, 1*256*sizeof(juint), tmp1); - add(table2, table0, 2*256*sizeof(juint), tmp1); - add(table3, table2, 1*256*sizeof(juint), tmp1); + add(table1, table0, 1*single_table_size*sizeof(juint), tmp1); + add(table2, table0, 2*single_table_size*sizeof(juint), tmp1); + add(table3, table2, 1*single_table_size*sizeof(juint), tmp1); + if (UseRVV) { + const int64_t tmp_limit = MaxVectorSize >= 32 ? unroll_words*3 : unroll_words*5; + mv(tmp1, tmp_limit); + bge(len, tmp1, L_vector_entry); + } + subw(len, len, unroll_words); bge(len, zr, L_unroll_loop_entry); + addiw(len, len, unroll_words-4); bge(len, zr, L_by4_loop); addiw(len, len, 4); @@ -1539,6 +1643,19 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, andi(tmp2, tmp2, right_8_bits); update_byte_crc32(crc, tmp2, table0); + // put vector code here, otherwise "offset is too large" error occurs. + if (UseRVV) { + j(L_exit); // only need to jump exit when UseRVV == true, it's a jump from end of block `L_by1_loop`. + + bind(L_vector_entry); + vector_update_crc32(crc, buf, len, tmp1, tmp2, tmp3, tmp4, tmp6, table0, table3); + + addiw(len, len, -4); + bge(len, zr, L_by4_loop); + addiw(len, len, 4); + bgt(len, zr, L_by1_loop); + } + bind(L_exit); andn(crc, tmp5, crc); } @@ -1853,9 +1970,9 @@ int MacroAssembler::patch_oop(address insn_addr, address o) { void MacroAssembler::reinit_heapbase() { if (UseCompressedOops) { if (Universe::is_fully_initialized()) { - mv(xheapbase, CompressedOops::ptrs_base()); + mv(xheapbase, CompressedOops::base()); } else { - ExternalAddress target(CompressedOops::ptrs_base_addr()); + ExternalAddress target(CompressedOops::base_addr()); relocate(target.rspec(), [&] { int32_t offset; la(xheapbase, target.target(), offset); @@ -5526,15 +5643,21 @@ static int reg2offset_out(VMReg r) { return (r->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size; } -// On 64 bit we will store integer like items to the stack as -// 64 bits items (riscv64 abi) even though java would only store -// 32bits for a parameter. On 32bit it will simply be 32 bits -// So this routine will do 32->32 on 32bit and 32->64 on 64bit +// The C ABI specifies: +// "integer scalars narrower than XLEN bits are widened according to the sign +// of their type up to 32 bits, then sign-extended to XLEN bits." +// Applies for both passed in register and stack. +// +// Java uses 32-bit stack slots; jint, jshort, jchar, jbyte uses one slot. +// Native uses 64-bit stack slots for all integer scalar types. +// +// lw loads the Java stack slot, sign-extends and +// sd store this widened integer into a 64 bit native stack slot. void MacroAssembler::move32_64(VMRegPair src, VMRegPair dst, Register tmp) { if (src.first()->is_stack()) { if (dst.first()->is_stack()) { // stack to stack - ld(tmp, Address(fp, reg2offset_in(src.first()))); + lw(tmp, Address(fp, reg2offset_in(src.first()))); sd(tmp, Address(sp, reg2offset_out(dst.first()))); } else { // stack to reg diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index c3161beea117d..43d9dc387ca20 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -1319,6 +1319,9 @@ class MacroAssembler: public Assembler { Register table0, Register table1, Register table2, Register table3, bool upper); void update_byte_crc32(Register crc, Register val, Register table); + void vector_update_crc32(Register crc, Register buf, Register len, + Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, + Register table0, Register table3); #ifdef COMPILER2 void mul_add(Register out, Register in, Register offset, diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index db010c9c6c82f..05f55fd0da7af 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -1920,6 +1920,18 @@ bool Matcher::match_rule_supported(int opcode) { case Op_EncodeISOArray: return UseRVV; + // Current test shows that, it brings performance gain when MaxVectorSize >= 32, but brings + // regression when MaxVectorSize == 16. So only enable the intrinsic when MaxVectorSize >= 32. + case Op_RoundVF: + return UseRVV && MaxVectorSize >= 32; + + // For double, current test shows that even with MaxVectorSize == 32, there is still some regression. + // Although there is no hardware to verify it for now, from the trend of performance data on hardwares + // (with vlenb == 16 and 32 respectively), it's promising to bring better performance rather than + // regression for double when MaxVectorSize == 64+. So only enable the intrinsic when MaxVectorSize >= 64. + case Op_RoundVD: + return UseRVV && MaxVectorSize >= 64; + case Op_PopCountI: case Op_PopCountL: return UsePopCountInstruction; diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad index 1a51d7583c9dd..510c0ff5d4646 100644 --- a/src/hotspot/cpu/riscv/riscv_v.ad +++ b/src/hotspot/cpu/riscv/riscv_v.ad @@ -4715,6 +4715,34 @@ instruct vsignum_reg(vReg dst, vReg zero, vReg one, vRegMask_V0 v0) %{ ins_pipe(pipe_slow); %} +// ---------------- Round float/double Vector Operations ---------------- + +instruct vround_f(vReg dst, vReg src, fRegF tmp, vRegMask_V0 v0) %{ + match(Set dst (RoundVF src)); + effect(TEMP_DEF dst, TEMP tmp, TEMP v0); + format %{ "java_round_float_v $dst, $src\t" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + uint vector_length = Matcher::vector_length(this); + __ java_round_float_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg), + as_FloatRegister($tmp$$reg), bt, vector_length); + %} + ins_pipe(pipe_slow); +%} + +instruct vround_d(vReg dst, vReg src, fRegD tmp, vRegMask_V0 v0) %{ + match(Set dst (RoundVD src)); + effect(TEMP_DEF dst, TEMP tmp, TEMP v0); + format %{ "java_round_double_v $dst, $src\t" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + uint vector_length = Matcher::vector_length(this); + __ java_round_double_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg), + as_FloatRegister($tmp$$reg), bt, vector_length); + %} + ins_pipe(pipe_slow); +%} + // -------------------------------- Reverse Bytes Vector Operations ------------------------ instruct vreverse_bytes_masked(vReg dst_src, vRegMask_V0 v0) %{ @@ -4867,11 +4895,10 @@ instruct gather_loadS(vReg dst, indirect mem, vReg idx) %{ effect(TEMP_DEF dst); format %{ "gather_loadS $dst, $mem, $idx" %} ins_encode %{ - __ vmv1r_v(as_VectorRegister($dst$$reg), as_VectorRegister($idx$$reg)); BasicType bt = Matcher::vector_element_basic_type(this); Assembler::SEW sew = Assembler::elemtype_to_sew(bt); __ vsetvli_helper(bt, Matcher::vector_length(this)); - __ vsll_vi(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg), (int)sew); + __ vsll_vi(as_VectorRegister($dst$$reg), as_VectorRegister($idx$$reg), (int)sew); __ vluxei32_v(as_VectorRegister($dst$$reg), as_Register($mem$$base), as_VectorRegister($dst$$reg)); %} @@ -4901,11 +4928,10 @@ instruct gather_loadS_masked(vReg dst, indirect mem, vReg idx, vRegMask_V0 v0, v effect(TEMP_DEF dst, TEMP tmp); format %{ "gather_loadS_masked $dst, $mem, $idx, $v0\t# KILL $tmp" %} ins_encode %{ - __ vmv1r_v(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg)); BasicType bt = Matcher::vector_element_basic_type(this); Assembler::SEW sew = Assembler::elemtype_to_sew(bt); __ vsetvli_helper(bt, Matcher::vector_length(this)); - __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($tmp$$reg), (int)sew); + __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg), (int)sew); __ vxor_vv(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg)); __ vluxei32_v(as_VectorRegister($dst$$reg), as_Register($mem$$base), @@ -4941,11 +4967,10 @@ instruct scatter_storeS(indirect mem, vReg src, vReg idx, vReg tmp) %{ effect(TEMP tmp); format %{ "scatter_storeS $mem, $idx, $src\t# KILL $tmp" %} ins_encode %{ - __ vmv1r_v(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg)); BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SEW sew = Assembler::elemtype_to_sew(bt); __ vsetvli_helper(bt, Matcher::vector_length(this, $src)); - __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($tmp$$reg), (int)sew); + __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg), (int)sew); __ vsuxei32_v(as_VectorRegister($src$$reg), as_Register($mem$$base), as_VectorRegister($tmp$$reg)); %} @@ -4975,11 +5000,10 @@ instruct scatter_storeS_masked(indirect mem, vReg src, vReg idx, vRegMask_V0 v0, effect(TEMP tmp); format %{ "scatter_storeS_masked $mem, $idx, $src, $v0\t# KILL $tmp" %} ins_encode %{ - __ vmv1r_v(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg)); BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SEW sew = Assembler::elemtype_to_sew(bt); __ vsetvli_helper(bt, Matcher::vector_length(this, $src)); - __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($tmp$$reg), (int)sew); + __ vsll_vi(as_VectorRegister($tmp$$reg), as_VectorRegister($idx$$reg), (int)sew); __ vsuxei32_v(as_VectorRegister($src$$reg), as_Register($mem$$base), as_VectorRegister($tmp$$reg), Assembler::v0_t); %} diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 8792dea7de5eb..ee14d045407a0 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -5331,7 +5331,7 @@ class StubGenerator: public StubCodeGenerator { * NOTE: each field will occupy a single vector register group */ void base64_vector_decode_round(Register src, Register dst, Register codec, - Register size, Register stepSrc, Register stepDst, Register failedIdx, Register minusOne, + Register size, Register stepSrc, Register stepDst, Register failedIdx, VectorRegister inputV1, VectorRegister inputV2, VectorRegister inputV3, VectorRegister inputV4, VectorRegister idxV1, VectorRegister idxV2, VectorRegister idxV3, VectorRegister idxV4, VectorRegister outputV1, VectorRegister outputV2, VectorRegister outputV3, @@ -5358,8 +5358,11 @@ class StubGenerator: public StubCodeGenerator { __ vor_vv(outputV1, outputV1, outputV2); __ vmseq_vi(v0, outputV1, -1); __ vfirst_m(failedIdx, v0); - Label NoFailure; - __ beq(failedIdx, minusOne, NoFailure); + Label NoFailure, FailureAtIdx0; + // valid value can only be -1 when < 0 + __ bltz(failedIdx, NoFailure); + // when the first data (at index 0) fails, no need to process data anymore + __ beqz(failedIdx, FailureAtIdx0); __ vsetvli(x0, failedIdx, Assembler::e8, lmul, Assembler::mu, Assembler::tu); __ slli(stepDst, failedIdx, 1); __ add(stepDst, failedIdx, stepDst); @@ -5382,6 +5385,7 @@ class StubGenerator: public StubCodeGenerator { // dst = dst + register_group_len_bytes * 3 __ add(dst, dst, stepDst); + __ BIND(FailureAtIdx0); } /** @@ -5487,9 +5491,7 @@ class StubGenerator: public StubCodeGenerator { Register stepSrcM2 = doff; Register stepDst = isURL; Register size = x29; // t4 - Register minusOne = x30; // t5 - __ mv(minusOne, -1); __ mv(size, MaxVectorSize * 2); __ mv(stepSrcM1, MaxVectorSize * 4); __ slli(stepSrcM2, stepSrcM1, 1); @@ -5501,7 +5503,7 @@ class StubGenerator: public StubCodeGenerator { // Assembler::m2 __ BIND(ProcessM2); base64_vector_decode_round(src, dst, codec, - size, stepSrcM2, stepDst, failedIdx, minusOne, + size, stepSrcM2, stepDst, failedIdx, v2, v4, v6, v8, // inputs v10, v12, v14, v16, // indexes v18, v20, v22, // outputs @@ -5509,7 +5511,8 @@ class StubGenerator: public StubCodeGenerator { __ sub(length, length, stepSrcM2); // error check - __ bne(failedIdx, minusOne, Exit); + // valid value of failedIdx can only be -1 when < 0 + __ bgez(failedIdx, Exit); __ bge(length, stepSrcM2, ProcessM2); @@ -5521,7 +5524,7 @@ class StubGenerator: public StubCodeGenerator { __ srli(size, size, 1); __ srli(stepDst, stepDst, 1); base64_vector_decode_round(src, dst, codec, - size, stepSrcM1, stepDst, failedIdx, minusOne, + size, stepSrcM1, stepDst, failedIdx, v1, v2, v3, v4, // inputs v5, v6, v7, v8, // indexes v9, v10, v11, // outputs @@ -5529,7 +5532,8 @@ class StubGenerator: public StubCodeGenerator { __ sub(length, length, stepSrcM1); // error check - __ bne(failedIdx, minusOne, Exit); + // valid value of failedIdx can only be -1 when < 0 + __ bgez(failedIdx, Exit); __ BIND(ProcessScalar); __ beqz(length, Exit); diff --git a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp index 05bdeaf757078..6d5492b86b3c3 100644 --- a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp @@ -276,4 +276,219 @@ ATTRIBUTE_ALIGNED(4096) juint StubRoutines::riscv::_crc_table[] = 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, 0xde0506f1UL, + + // Tables for vector version + // This improvement (vectorization) is based on java.base/share/native/libzip/zlib/zcrc32.c. + // To make it, following steps are taken: + // 1. in zcrc32.c, modify N to 16 and related code, + // 2. re-generate the tables needed, we use tables of (N == 16, W == 4) + // 3. finally vectorize the code (original implementation in zcrc32.c is just scalar code). + 0x00000000, 0x8f352d95, 0xc51b5d6b, 0x4a2e70fe, 0x5147bc97, + 0xde729102, 0x945ce1fc, 0x1b69cc69, 0xa28f792e, 0x2dba54bb, + 0x67942445, 0xe8a109d0, 0xf3c8c5b9, 0x7cfde82c, 0x36d398d2, + 0xb9e6b547, 0x9e6ff41d, 0x115ad988, 0x5b74a976, 0xd44184e3, + 0xcf28488a, 0x401d651f, 0x0a3315e1, 0x85063874, 0x3ce08d33, + 0xb3d5a0a6, 0xf9fbd058, 0x76cefdcd, 0x6da731a4, 0xe2921c31, + 0xa8bc6ccf, 0x2789415a, 0xe7aeee7b, 0x689bc3ee, 0x22b5b310, + 0xad809e85, 0xb6e952ec, 0x39dc7f79, 0x73f20f87, 0xfcc72212, + 0x45219755, 0xca14bac0, 0x803aca3e, 0x0f0fe7ab, 0x14662bc2, + 0x9b530657, 0xd17d76a9, 0x5e485b3c, 0x79c11a66, 0xf6f437f3, + 0xbcda470d, 0x33ef6a98, 0x2886a6f1, 0xa7b38b64, 0xed9dfb9a, + 0x62a8d60f, 0xdb4e6348, 0x547b4edd, 0x1e553e23, 0x916013b6, + 0x8a09dfdf, 0x053cf24a, 0x4f1282b4, 0xc027af21, 0x142cdab7, + 0x9b19f722, 0xd13787dc, 0x5e02aa49, 0x456b6620, 0xca5e4bb5, + 0x80703b4b, 0x0f4516de, 0xb6a3a399, 0x39968e0c, 0x73b8fef2, + 0xfc8dd367, 0xe7e41f0e, 0x68d1329b, 0x22ff4265, 0xadca6ff0, + 0x8a432eaa, 0x0576033f, 0x4f5873c1, 0xc06d5e54, 0xdb04923d, + 0x5431bfa8, 0x1e1fcf56, 0x912ae2c3, 0x28cc5784, 0xa7f97a11, + 0xedd70aef, 0x62e2277a, 0x798beb13, 0xf6bec686, 0xbc90b678, + 0x33a59bed, 0xf38234cc, 0x7cb71959, 0x369969a7, 0xb9ac4432, + 0xa2c5885b, 0x2df0a5ce, 0x67ded530, 0xe8ebf8a5, 0x510d4de2, + 0xde386077, 0x94161089, 0x1b233d1c, 0x004af175, 0x8f7fdce0, + 0xc551ac1e, 0x4a64818b, 0x6dedc0d1, 0xe2d8ed44, 0xa8f69dba, + 0x27c3b02f, 0x3caa7c46, 0xb39f51d3, 0xf9b1212d, 0x76840cb8, + 0xcf62b9ff, 0x4057946a, 0x0a79e494, 0x854cc901, 0x9e250568, + 0x111028fd, 0x5b3e5803, 0xd40b7596, 0x2859b56e, 0xa76c98fb, + 0xed42e805, 0x6277c590, 0x791e09f9, 0xf62b246c, 0xbc055492, + 0x33307907, 0x8ad6cc40, 0x05e3e1d5, 0x4fcd912b, 0xc0f8bcbe, + 0xdb9170d7, 0x54a45d42, 0x1e8a2dbc, 0x91bf0029, 0xb6364173, + 0x39036ce6, 0x732d1c18, 0xfc18318d, 0xe771fde4, 0x6844d071, + 0x226aa08f, 0xad5f8d1a, 0x14b9385d, 0x9b8c15c8, 0xd1a26536, + 0x5e9748a3, 0x45fe84ca, 0xcacba95f, 0x80e5d9a1, 0x0fd0f434, + 0xcff75b15, 0x40c27680, 0x0aec067e, 0x85d92beb, 0x9eb0e782, + 0x1185ca17, 0x5babbae9, 0xd49e977c, 0x6d78223b, 0xe24d0fae, + 0xa8637f50, 0x275652c5, 0x3c3f9eac, 0xb30ab339, 0xf924c3c7, + 0x7611ee52, 0x5198af08, 0xdead829d, 0x9483f263, 0x1bb6dff6, + 0x00df139f, 0x8fea3e0a, 0xc5c44ef4, 0x4af16361, 0xf317d626, + 0x7c22fbb3, 0x360c8b4d, 0xb939a6d8, 0xa2506ab1, 0x2d654724, + 0x674b37da, 0xe87e1a4f, 0x3c756fd9, 0xb340424c, 0xf96e32b2, + 0x765b1f27, 0x6d32d34e, 0xe207fedb, 0xa8298e25, 0x271ca3b0, + 0x9efa16f7, 0x11cf3b62, 0x5be14b9c, 0xd4d46609, 0xcfbdaa60, + 0x408887f5, 0x0aa6f70b, 0x8593da9e, 0xa21a9bc4, 0x2d2fb651, + 0x6701c6af, 0xe834eb3a, 0xf35d2753, 0x7c680ac6, 0x36467a38, + 0xb97357ad, 0x0095e2ea, 0x8fa0cf7f, 0xc58ebf81, 0x4abb9214, + 0x51d25e7d, 0xdee773e8, 0x94c90316, 0x1bfc2e83, 0xdbdb81a2, + 0x54eeac37, 0x1ec0dcc9, 0x91f5f15c, 0x8a9c3d35, 0x05a910a0, + 0x4f87605e, 0xc0b24dcb, 0x7954f88c, 0xf661d519, 0xbc4fa5e7, + 0x337a8872, 0x2813441b, 0xa726698e, 0xed081970, 0x623d34e5, + 0x45b475bf, 0xca81582a, 0x80af28d4, 0x0f9a0541, 0x14f3c928, + 0x9bc6e4bd, 0xd1e89443, 0x5eddb9d6, 0xe73b0c91, 0x680e2104, + 0x222051fa, 0xad157c6f, 0xb67cb006, 0x39499d93, 0x7367ed6d, + 0xfc52c0f8, + 0x00000000, 0x50b36adc, 0xa166d5b8, 0xf1d5bf64, 0x99bcad31, + 0xc90fc7ed, 0x38da7889, 0x68691255, 0xe8085c23, 0xb8bb36ff, + 0x496e899b, 0x19dde347, 0x71b4f112, 0x21079bce, 0xd0d224aa, + 0x80614e76, 0x0b61be07, 0x5bd2d4db, 0xaa076bbf, 0xfab40163, + 0x92dd1336, 0xc26e79ea, 0x33bbc68e, 0x6308ac52, 0xe369e224, + 0xb3da88f8, 0x420f379c, 0x12bc5d40, 0x7ad54f15, 0x2a6625c9, + 0xdbb39aad, 0x8b00f071, 0x16c37c0e, 0x467016d2, 0xb7a5a9b6, + 0xe716c36a, 0x8f7fd13f, 0xdfccbbe3, 0x2e190487, 0x7eaa6e5b, + 0xfecb202d, 0xae784af1, 0x5fadf595, 0x0f1e9f49, 0x67778d1c, + 0x37c4e7c0, 0xc61158a4, 0x96a23278, 0x1da2c209, 0x4d11a8d5, + 0xbcc417b1, 0xec777d6d, 0x841e6f38, 0xd4ad05e4, 0x2578ba80, + 0x75cbd05c, 0xf5aa9e2a, 0xa519f4f6, 0x54cc4b92, 0x047f214e, + 0x6c16331b, 0x3ca559c7, 0xcd70e6a3, 0x9dc38c7f, 0x2d86f81c, + 0x7d3592c0, 0x8ce02da4, 0xdc534778, 0xb43a552d, 0xe4893ff1, + 0x155c8095, 0x45efea49, 0xc58ea43f, 0x953dcee3, 0x64e87187, + 0x345b1b5b, 0x5c32090e, 0x0c8163d2, 0xfd54dcb6, 0xade7b66a, + 0x26e7461b, 0x76542cc7, 0x878193a3, 0xd732f97f, 0xbf5beb2a, + 0xefe881f6, 0x1e3d3e92, 0x4e8e544e, 0xceef1a38, 0x9e5c70e4, + 0x6f89cf80, 0x3f3aa55c, 0x5753b709, 0x07e0ddd5, 0xf63562b1, + 0xa686086d, 0x3b458412, 0x6bf6eece, 0x9a2351aa, 0xca903b76, + 0xa2f92923, 0xf24a43ff, 0x039ffc9b, 0x532c9647, 0xd34dd831, + 0x83feb2ed, 0x722b0d89, 0x22986755, 0x4af17500, 0x1a421fdc, + 0xeb97a0b8, 0xbb24ca64, 0x30243a15, 0x609750c9, 0x9142efad, + 0xc1f18571, 0xa9989724, 0xf92bfdf8, 0x08fe429c, 0x584d2840, + 0xd82c6636, 0x889f0cea, 0x794ab38e, 0x29f9d952, 0x4190cb07, + 0x1123a1db, 0xe0f61ebf, 0xb0457463, 0x5b0df038, 0x0bbe9ae4, + 0xfa6b2580, 0xaad84f5c, 0xc2b15d09, 0x920237d5, 0x63d788b1, + 0x3364e26d, 0xb305ac1b, 0xe3b6c6c7, 0x126379a3, 0x42d0137f, + 0x2ab9012a, 0x7a0a6bf6, 0x8bdfd492, 0xdb6cbe4e, 0x506c4e3f, + 0x00df24e3, 0xf10a9b87, 0xa1b9f15b, 0xc9d0e30e, 0x996389d2, + 0x68b636b6, 0x38055c6a, 0xb864121c, 0xe8d778c0, 0x1902c7a4, + 0x49b1ad78, 0x21d8bf2d, 0x716bd5f1, 0x80be6a95, 0xd00d0049, + 0x4dce8c36, 0x1d7de6ea, 0xeca8598e, 0xbc1b3352, 0xd4722107, + 0x84c14bdb, 0x7514f4bf, 0x25a79e63, 0xa5c6d015, 0xf575bac9, + 0x04a005ad, 0x54136f71, 0x3c7a7d24, 0x6cc917f8, 0x9d1ca89c, + 0xcdafc240, 0x46af3231, 0x161c58ed, 0xe7c9e789, 0xb77a8d55, + 0xdf139f00, 0x8fa0f5dc, 0x7e754ab8, 0x2ec62064, 0xaea76e12, + 0xfe1404ce, 0x0fc1bbaa, 0x5f72d176, 0x371bc323, 0x67a8a9ff, + 0x967d169b, 0xc6ce7c47, 0x768b0824, 0x263862f8, 0xd7eddd9c, + 0x875eb740, 0xef37a515, 0xbf84cfc9, 0x4e5170ad, 0x1ee21a71, + 0x9e835407, 0xce303edb, 0x3fe581bf, 0x6f56eb63, 0x073ff936, + 0x578c93ea, 0xa6592c8e, 0xf6ea4652, 0x7deab623, 0x2d59dcff, + 0xdc8c639b, 0x8c3f0947, 0xe4561b12, 0xb4e571ce, 0x4530ceaa, + 0x1583a476, 0x95e2ea00, 0xc55180dc, 0x34843fb8, 0x64375564, + 0x0c5e4731, 0x5ced2ded, 0xad389289, 0xfd8bf855, 0x6048742a, + 0x30fb1ef6, 0xc12ea192, 0x919dcb4e, 0xf9f4d91b, 0xa947b3c7, + 0x58920ca3, 0x0821667f, 0x88402809, 0xd8f342d5, 0x2926fdb1, + 0x7995976d, 0x11fc8538, 0x414fefe4, 0xb09a5080, 0xe0293a5c, + 0x6b29ca2d, 0x3b9aa0f1, 0xca4f1f95, 0x9afc7549, 0xf295671c, + 0xa2260dc0, 0x53f3b2a4, 0x0340d878, 0x8321960e, 0xd392fcd2, + 0x224743b6, 0x72f4296a, 0x1a9d3b3f, 0x4a2e51e3, 0xbbfbee87, + 0xeb48845b, + 0x00000000, 0xb61be070, 0xb746c6a1, 0x015d26d1, 0xb5fc8b03, + 0x03e76b73, 0x02ba4da2, 0xb4a1add2, 0xb0881047, 0x0693f037, + 0x07ced6e6, 0xb1d53696, 0x05749b44, 0xb36f7b34, 0xb2325de5, + 0x0429bd95, 0xba6126cf, 0x0c7ac6bf, 0x0d27e06e, 0xbb3c001e, + 0x0f9dadcc, 0xb9864dbc, 0xb8db6b6d, 0x0ec08b1d, 0x0ae93688, + 0xbcf2d6f8, 0xbdaff029, 0x0bb41059, 0xbf15bd8b, 0x090e5dfb, + 0x08537b2a, 0xbe489b5a, 0xafb34bdf, 0x19a8abaf, 0x18f58d7e, + 0xaeee6d0e, 0x1a4fc0dc, 0xac5420ac, 0xad09067d, 0x1b12e60d, + 0x1f3b5b98, 0xa920bbe8, 0xa87d9d39, 0x1e667d49, 0xaac7d09b, + 0x1cdc30eb, 0x1d81163a, 0xab9af64a, 0x15d26d10, 0xa3c98d60, + 0xa294abb1, 0x148f4bc1, 0xa02ee613, 0x16350663, 0x176820b2, + 0xa173c0c2, 0xa55a7d57, 0x13419d27, 0x121cbbf6, 0xa4075b86, + 0x10a6f654, 0xa6bd1624, 0xa7e030f5, 0x11fbd085, 0x841791ff, + 0x320c718f, 0x3351575e, 0x854ab72e, 0x31eb1afc, 0x87f0fa8c, + 0x86addc5d, 0x30b63c2d, 0x349f81b8, 0x828461c8, 0x83d94719, + 0x35c2a769, 0x81630abb, 0x3778eacb, 0x3625cc1a, 0x803e2c6a, + 0x3e76b730, 0x886d5740, 0x89307191, 0x3f2b91e1, 0x8b8a3c33, + 0x3d91dc43, 0x3cccfa92, 0x8ad71ae2, 0x8efea777, 0x38e54707, + 0x39b861d6, 0x8fa381a6, 0x3b022c74, 0x8d19cc04, 0x8c44ead5, + 0x3a5f0aa5, 0x2ba4da20, 0x9dbf3a50, 0x9ce21c81, 0x2af9fcf1, + 0x9e585123, 0x2843b153, 0x291e9782, 0x9f0577f2, 0x9b2cca67, + 0x2d372a17, 0x2c6a0cc6, 0x9a71ecb6, 0x2ed04164, 0x98cba114, + 0x999687c5, 0x2f8d67b5, 0x91c5fcef, 0x27de1c9f, 0x26833a4e, + 0x9098da3e, 0x243977ec, 0x9222979c, 0x937fb14d, 0x2564513d, + 0x214deca8, 0x97560cd8, 0x960b2a09, 0x2010ca79, 0x94b167ab, + 0x22aa87db, 0x23f7a10a, 0x95ec417a, 0xd35e25bf, 0x6545c5cf, + 0x6418e31e, 0xd203036e, 0x66a2aebc, 0xd0b94ecc, 0xd1e4681d, + 0x67ff886d, 0x63d635f8, 0xd5cdd588, 0xd490f359, 0x628b1329, + 0xd62abefb, 0x60315e8b, 0x616c785a, 0xd777982a, 0x693f0370, + 0xdf24e300, 0xde79c5d1, 0x686225a1, 0xdcc38873, 0x6ad86803, + 0x6b854ed2, 0xdd9eaea2, 0xd9b71337, 0x6facf347, 0x6ef1d596, + 0xd8ea35e6, 0x6c4b9834, 0xda507844, 0xdb0d5e95, 0x6d16bee5, + 0x7ced6e60, 0xcaf68e10, 0xcbaba8c1, 0x7db048b1, 0xc911e563, + 0x7f0a0513, 0x7e5723c2, 0xc84cc3b2, 0xcc657e27, 0x7a7e9e57, + 0x7b23b886, 0xcd3858f6, 0x7999f524, 0xcf821554, 0xcedf3385, + 0x78c4d3f5, 0xc68c48af, 0x7097a8df, 0x71ca8e0e, 0xc7d16e7e, + 0x7370c3ac, 0xc56b23dc, 0xc436050d, 0x722de57d, 0x760458e8, + 0xc01fb898, 0xc1429e49, 0x77597e39, 0xc3f8d3eb, 0x75e3339b, + 0x74be154a, 0xc2a5f53a, 0x5749b440, 0xe1525430, 0xe00f72e1, + 0x56149291, 0xe2b53f43, 0x54aedf33, 0x55f3f9e2, 0xe3e81992, + 0xe7c1a407, 0x51da4477, 0x508762a6, 0xe69c82d6, 0x523d2f04, + 0xe426cf74, 0xe57be9a5, 0x536009d5, 0xed28928f, 0x5b3372ff, + 0x5a6e542e, 0xec75b45e, 0x58d4198c, 0xeecff9fc, 0xef92df2d, + 0x59893f5d, 0x5da082c8, 0xebbb62b8, 0xeae64469, 0x5cfda419, + 0xe85c09cb, 0x5e47e9bb, 0x5f1acf6a, 0xe9012f1a, 0xf8faff9f, + 0x4ee11fef, 0x4fbc393e, 0xf9a7d94e, 0x4d06749c, 0xfb1d94ec, + 0xfa40b23d, 0x4c5b524d, 0x4872efd8, 0xfe690fa8, 0xff342979, + 0x492fc909, 0xfd8e64db, 0x4b9584ab, 0x4ac8a27a, 0xfcd3420a, + 0x429bd950, 0xf4803920, 0xf5dd1ff1, 0x43c6ff81, 0xf7675253, + 0x417cb223, 0x402194f2, 0xf63a7482, 0xf213c917, 0x44082967, + 0x45550fb6, 0xf34eefc6, 0x47ef4214, 0xf1f4a264, 0xf0a984b5, + 0x46b264c5, + 0x00000000, 0x7dcd4d3f, 0xfb9a9a7e, 0x8657d741, 0x2c4432bd, + 0x51897f82, 0xd7dea8c3, 0xaa13e5fc, 0x5888657a, 0x25452845, + 0xa312ff04, 0xdedfb23b, 0x74cc57c7, 0x09011af8, 0x8f56cdb9, + 0xf29b8086, 0xb110caf4, 0xccdd87cb, 0x4a8a508a, 0x37471db5, + 0x9d54f849, 0xe099b576, 0x66ce6237, 0x1b032f08, 0xe998af8e, + 0x9455e2b1, 0x120235f0, 0x6fcf78cf, 0xc5dc9d33, 0xb811d00c, + 0x3e46074d, 0x438b4a72, 0xb95093a9, 0xc49dde96, 0x42ca09d7, + 0x3f0744e8, 0x9514a114, 0xe8d9ec2b, 0x6e8e3b6a, 0x13437655, + 0xe1d8f6d3, 0x9c15bbec, 0x1a426cad, 0x678f2192, 0xcd9cc46e, + 0xb0518951, 0x36065e10, 0x4bcb132f, 0x0840595d, 0x758d1462, + 0xf3dac323, 0x8e178e1c, 0x24046be0, 0x59c926df, 0xdf9ef19e, + 0xa253bca1, 0x50c83c27, 0x2d057118, 0xab52a659, 0xd69feb66, + 0x7c8c0e9a, 0x014143a5, 0x871694e4, 0xfadbd9db, 0xa9d02113, + 0xd41d6c2c, 0x524abb6d, 0x2f87f652, 0x859413ae, 0xf8595e91, + 0x7e0e89d0, 0x03c3c4ef, 0xf1584469, 0x8c950956, 0x0ac2de17, + 0x770f9328, 0xdd1c76d4, 0xa0d13beb, 0x2686ecaa, 0x5b4ba195, + 0x18c0ebe7, 0x650da6d8, 0xe35a7199, 0x9e973ca6, 0x3484d95a, + 0x49499465, 0xcf1e4324, 0xb2d30e1b, 0x40488e9d, 0x3d85c3a2, + 0xbbd214e3, 0xc61f59dc, 0x6c0cbc20, 0x11c1f11f, 0x9796265e, + 0xea5b6b61, 0x1080b2ba, 0x6d4dff85, 0xeb1a28c4, 0x96d765fb, + 0x3cc48007, 0x4109cd38, 0xc75e1a79, 0xba935746, 0x4808d7c0, + 0x35c59aff, 0xb3924dbe, 0xce5f0081, 0x644ce57d, 0x1981a842, + 0x9fd67f03, 0xe21b323c, 0xa190784e, 0xdc5d3571, 0x5a0ae230, + 0x27c7af0f, 0x8dd44af3, 0xf01907cc, 0x764ed08d, 0x0b839db2, + 0xf9181d34, 0x84d5500b, 0x0282874a, 0x7f4fca75, 0xd55c2f89, + 0xa89162b6, 0x2ec6b5f7, 0x530bf8c8, 0x88d14467, 0xf51c0958, + 0x734bde19, 0x0e869326, 0xa49576da, 0xd9583be5, 0x5f0feca4, + 0x22c2a19b, 0xd059211d, 0xad946c22, 0x2bc3bb63, 0x560ef65c, + 0xfc1d13a0, 0x81d05e9f, 0x078789de, 0x7a4ac4e1, 0x39c18e93, + 0x440cc3ac, 0xc25b14ed, 0xbf9659d2, 0x1585bc2e, 0x6848f111, + 0xee1f2650, 0x93d26b6f, 0x6149ebe9, 0x1c84a6d6, 0x9ad37197, + 0xe71e3ca8, 0x4d0dd954, 0x30c0946b, 0xb697432a, 0xcb5a0e15, + 0x3181d7ce, 0x4c4c9af1, 0xca1b4db0, 0xb7d6008f, 0x1dc5e573, + 0x6008a84c, 0xe65f7f0d, 0x9b923232, 0x6909b2b4, 0x14c4ff8b, + 0x929328ca, 0xef5e65f5, 0x454d8009, 0x3880cd36, 0xbed71a77, + 0xc31a5748, 0x80911d3a, 0xfd5c5005, 0x7b0b8744, 0x06c6ca7b, + 0xacd52f87, 0xd11862b8, 0x574fb5f9, 0x2a82f8c6, 0xd8197840, + 0xa5d4357f, 0x2383e23e, 0x5e4eaf01, 0xf45d4afd, 0x899007c2, + 0x0fc7d083, 0x720a9dbc, 0x21016574, 0x5ccc284b, 0xda9bff0a, + 0xa756b235, 0x0d4557c9, 0x70881af6, 0xf6dfcdb7, 0x8b128088, + 0x7989000e, 0x04444d31, 0x82139a70, 0xffded74f, 0x55cd32b3, + 0x28007f8c, 0xae57a8cd, 0xd39ae5f2, 0x9011af80, 0xeddce2bf, + 0x6b8b35fe, 0x164678c1, 0xbc559d3d, 0xc198d002, 0x47cf0743, + 0x3a024a7c, 0xc899cafa, 0xb55487c5, 0x33035084, 0x4ece1dbb, + 0xe4ddf847, 0x9910b578, 0x1f476239, 0x628a2f06, 0x9851f6dd, + 0xe59cbbe2, 0x63cb6ca3, 0x1e06219c, 0xb415c460, 0xc9d8895f, + 0x4f8f5e1e, 0x32421321, 0xc0d993a7, 0xbd14de98, 0x3b4309d9, + 0x468e44e6, 0xec9da11a, 0x9150ec25, 0x17073b64, 0x6aca765b, + 0x29413c29, 0x548c7116, 0xd2dba657, 0xaf16eb68, 0x05050e94, + 0x78c843ab, 0xfe9f94ea, 0x8352d9d5, 0x71c95953, 0x0c04146c, + 0x8a53c32d, 0xf79e8e12, 0x5d8d6bee, 0x204026d1, 0xa617f190, + 0xdbdabcaf }; diff --git a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp index b7f1d3605681a..e01e4458e38d3 100644 --- a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp +++ b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp @@ -48,7 +48,7 @@ void C1SafepointPollStub::emit_code(LIR_Assembler* ce) { void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for (C1StubId::predicate_failed_trap_id); ce->emit_call_c(a); CHECK_BAILOUT(); ce->add_call_info_here(_info); @@ -64,11 +64,11 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ load_const_optimized(Z_R1_scratch, _index->as_jint()); } - Runtime1::StubID stub_id; + C1StubId stub_id; if (_throw_index_out_of_bounds_exception) { - stub_id = Runtime1::throw_index_exception_id; + stub_id = C1StubId::throw_index_exception_id; } else { - stub_id = Runtime1::throw_range_check_failed_id; + stub_id = C1StubId::throw_range_check_failed_id; __ lgr_if_needed(Z_R0_scratch, _array->as_pointer_register()); } ce->emit_call_c(Runtime1::entry_for (stub_id)); @@ -84,7 +84,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for (C1StubId::predicate_failed_trap_id); ce->emit_call_c(a); CHECK_BAILOUT(); ce->add_call_info_here(_info); @@ -102,7 +102,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { } ce->store_parameter(/*_method->as_register()*/ Z_R1_scratch, 1); ce->store_parameter(_bci, 0); - ce->emit_call_c(Runtime1::entry_for (Runtime1::counter_overflow_id)); + ce->emit_call_c(Runtime1::entry_for (C1StubId::counter_overflow_id)); CHECK_BAILOUT(); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -114,7 +114,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - ce->emit_call_c(Runtime1::entry_for (Runtime1::throw_div0_exception_id)); + ce->emit_call_c(Runtime1::entry_for (C1StubId::throw_div0_exception_id)); CHECK_BAILOUT(); ce->add_call_info_here(_info); debug_only(__ should_not_reach_here()); @@ -124,9 +124,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { address a; if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is probably wrong to do it here. - a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for (C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for (Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for (C1StubId::throw_null_pointer_exception_id); } ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); @@ -151,14 +151,14 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) { debug_only(__ should_not_reach_here()); } -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -186,7 +186,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11"); __ lgr_if_needed(Z_R13, _length->as_register()); - address a = Runtime1::entry_for (Runtime1::new_type_array_id); + address a = Runtime1::entry_for (C1StubId::new_type_array_id); ce->emit_call_c(a); CHECK_BAILOUT(); ce->add_call_info_here(_info); @@ -206,7 +206,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11"); __ lgr_if_needed(Z_R13, _length->as_register()); - address a = Runtime1::entry_for (Runtime1::new_object_array_id); + address a = Runtime1::entry_for (C1StubId::new_object_array_id); ce->emit_call_c(a); CHECK_BAILOUT(); ce->add_call_info_here(_info); @@ -217,11 +217,11 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - Runtime1::StubID enter_id; + C1StubId enter_id; if (ce->compilation()->has_fpu_code()) { - enter_id = Runtime1::monitorenter_id; + enter_id = C1StubId::monitorenter_id; } else { - enter_id = Runtime1::monitorenter_nofpu_id; + enter_id = C1StubId::monitorenter_nofpu_id; } __ lgr_if_needed(Z_R1_scratch, _obj_reg->as_register()); __ lgr_if_needed(Z_R13, _lock_reg->as_register()); // See LIRGenerator::syncTempOpr(). @@ -242,11 +242,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { __ lgr_if_needed(Z_R1_scratch, _lock_reg->as_register()); } // Note: non-blocking leaf routine => no call info needed. - Runtime1::StubID exit_id; + C1StubId exit_id; if (ce->compilation()->has_fpu_code()) { - exit_id = Runtime1::monitorexit_id; + exit_id = C1StubId::monitorexit_id; } else { - exit_id = Runtime1::monitorexit_nofpu_id; + exit_id = C1StubId::monitorexit_nofpu_id; } ce->emit_call_c(Runtime1::entry_for (exit_id)); CHECK_BAILOUT(); @@ -378,10 +378,10 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { address target = nullptr; relocInfo::relocType reloc_type = relocInfo::none; switch (_id) { - case access_field_id: target = Runtime1::entry_for (Runtime1::access_field_patching_id); break; - case load_klass_id: target = Runtime1::entry_for (Runtime1::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; - case load_mirror_id: target = Runtime1::entry_for (Runtime1::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; - case load_appendix_id: target = Runtime1::entry_for (Runtime1::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; + case access_field_id: target = Runtime1::entry_for (C1StubId::access_field_patching_id); break; + case load_klass_id: target = Runtime1::entry_for (C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; + case load_mirror_id: target = Runtime1::entry_for (C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; + case load_appendix_id: target = Runtime1::entry_for (C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); } __ bind(call_patch); @@ -406,7 +406,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); __ load_const_optimized(Z_R1_scratch, _trap_request); // Pass trap request in Z_R1_scratch. - ce->emit_call_c(Runtime1::entry_for (Runtime1::deoptimize_id)); + ce->emit_call_c(Runtime1::entry_for (C1StubId::deoptimize_id)); CHECK_BAILOUT(); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); diff --git a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp index a5e62169a9350..d288f4a893d0a 100644 --- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp @@ -172,7 +172,7 @@ int LIR_Assembler::emit_exception_handler() { int offset = code_offset(); - address a = Runtime1::entry_for (Runtime1::handle_exception_from_callee_id); + address a = Runtime1::entry_for (C1StubId::handle_exception_from_callee_id); address call_addr = emit_call_c(a); CHECK_BAILOUT_(-1); __ should_not_reach_here(); @@ -212,7 +212,7 @@ int LIR_Assembler::emit_unwind_handler() { // Perform needed unlocking. MonitorExitStub* stub = nullptr; if (method()->is_synchronized()) { - // Runtime1::monitorexit_id expects lock address in Z_R1_scratch. + // C1StubId::monitorexit_id expects lock address in Z_R1_scratch. LIR_Opr lock = FrameMap::as_opr(Z_R1_scratch); monitor_address(0, lock); stub = new MonitorExitStub(lock, true, 0); @@ -241,7 +241,7 @@ int LIR_Assembler::emit_unwind_handler() { // Z_EXC_PC: exception pc // Dispatch to the unwind logic. - __ load_const_optimized(Z_R5, Runtime1::entry_for (Runtime1::unwind_exception_id)); + __ load_const_optimized(Z_R5, Runtime1::entry_for (C1StubId::unwind_exception_id)); __ z_br(Z_R5); // Emit the slow path assembly. @@ -1910,8 +1910,8 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit // Reuse the debug info from the safepoint poll for the throw op itself. __ get_PC(Z_EXC_PC); add_call_info(__ offset(), info); // for exception handler - address stub = Runtime1::entry_for (compilation()->has_fpu_code() ? Runtime1::handle_exception_id - : Runtime1::handle_exception_nofpu_id); + address stub = Runtime1::entry_for (compilation()->has_fpu_code() ? C1StubId::handle_exception_id + : C1StubId::handle_exception_nofpu_id); emit_call_c(stub); } @@ -2116,7 +2116,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { store_parameter(src_klass, 0); // sub store_parameter(dst_klass, 1); // super - emit_call_c(Runtime1::entry_for (Runtime1::slow_subtype_check_id)); + emit_call_c(Runtime1::entry_for (C1StubId::slow_subtype_check_id)); CHECK_BAILOUT2(cont, slow); // Sets condition code 0 for match (2 otherwise). __ branch_optimized(Assembler::bcondEqual, cont); @@ -2539,7 +2539,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L RegisterOrConstant(super_check_offset)); if (need_slow_path) { // Call out-of-line instance of __ check_klass_subtype_slow_path(...): - address a = Runtime1::entry_for (Runtime1::slow_subtype_check_id); + address a = Runtime1::entry_for (C1StubId::slow_subtype_check_id); store_parameter(klass_RInfo, 0); // sub store_parameter(k_RInfo, 1); // super emit_call_c(a); // Sets condition code 0 for match (2 otherwise). @@ -2614,7 +2614,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { // Perform the fast part of the checking logic. __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr); // Call out-of-line instance of __ check_klass_subtype_slow_path(...): - address a = Runtime1::entry_for (Runtime1::slow_subtype_check_id); + address a = Runtime1::entry_for (C1StubId::slow_subtype_check_id); store_parameter(klass_RInfo, 0); // sub store_parameter(k_RInfo, 1); // super emit_call_c(a); // Sets condition code 0 for match (2 otherwise). diff --git a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp index 619f0f7174f01..f998e86256f56 100644 --- a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp @@ -885,7 +885,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); LIR_Opr reg = result_register_for (x->type()); - __ call_runtime(Runtime1::entry_for (Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for (C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); @@ -916,14 +916,14 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception); } LIR_Opr reg = rlock_result(x); LIR_Opr tmp1 = new_register(objectType); diff --git a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp index a9140a7925ebd..f6dd20db3d67f 100644 --- a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp @@ -79,7 +79,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox assert(LockingMode != LM_MONITOR, "LM_MONITOR is already handled, by emit_lock()"); if (LockingMode == LM_LIGHTWEIGHT) { - lightweight_lock(Roop, Rmark, tmp, slow_case); + lightweight_lock(Rbox, Roop, Rmark, tmp, slow_case); } else if (LockingMode == LM_LEGACY) { NearLabel done; @@ -254,7 +254,7 @@ void C1_MacroAssembler::initialize_object( // Dtrace support is unimplemented. // if (CURRENT_ENV->dtrace_alloc_probes()) { // assert(obj == rax, "must be"); - // call(RuntimeAddress(Runtime1::entry_for (Runtime1::dtrace_object_alloc_id))); + // call(RuntimeAddress(Runtime1::entry_for (C1StubId::dtrace_object_alloc_id))); // } verify_oop(obj, FILE_AND_LINE); @@ -315,7 +315,7 @@ void C1_MacroAssembler::allocate_array( // Dtrace support is unimplemented. // if (CURRENT_ENV->dtrace_alloc_probes()) { // assert(obj == rax, "must be"); - // call(RuntimeAddress(Runtime1::entry_for (Runtime1::dtrace_object_alloc_id))); + // call(RuntimeAddress(Runtime1::entry_for (C1StubId::dtrace_object_alloc_id))); // } verify_oop(obj, FILE_AND_LINE); diff --git a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp index 41c57043d8234..2f629c108c956 100644 --- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp +++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp @@ -98,10 +98,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre restore_return_pc(); load_const_optimized(Z_R1, StubRoutines::forward_exception_entry()); z_br(Z_R1); - } else if (_stub_id == Runtime1::forward_exception_id) { + } else if (_stub_id == (int)C1StubId::forward_exception_id) { should_not_reach_here(); } else { - load_const_optimized(Z_R1, Runtime1::entry_for (Runtime1::forward_exception_id)); + load_const_optimized(Z_R1, Runtime1::entry_for (C1StubId::forward_exception_id)); z_br(Z_R1); } @@ -305,7 +305,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { return oop_maps; } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { // for better readability const bool must_gc_arguments = true; @@ -318,26 +318,26 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // Stub code and info for the different stubs. OopMapSet* oop_maps = nullptr; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); // will not return } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { Register klass = Z_R11; // Incoming Register obj = Z_R2; // Result - if (id == new_instance_id) { + if (id == C1StubId::new_instance_id) { __ set_info("new_instance", dont_gc_arguments); - } else if (id == fast_new_instance_id) { + } else if (id == C1StubId::fast_new_instance_id) { __ set_info("fast new_instance", dont_gc_arguments); } else { - assert(id == fast_new_instance_init_check_id, "bad StubID"); + assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId"); __ set_info("fast new_instance init check", dont_gc_arguments); } @@ -352,7 +352,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: { // Arguments : // bci : stack param 0 @@ -371,14 +371,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ z_br(Z_R14); } break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { Register length = Z_R13; // Incoming Register klass = Z_R11; // Incoming Register obj = Z_R2; // Result - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -391,7 +391,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Register t0 = obj; __ mem2reg_opt(t0, Address(klass, Klass::layout_helper_offset()), false); __ z_sra(t0, Klass::_lh_array_tag_shift); - int tag = ((id == new_type_array_id) + int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value); __ compare32_and_branch(t0, tag, Assembler::bcondEqual, ok); @@ -403,7 +403,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { OopMap* map = save_live_registers_except_r2(sasm); int call_offset; - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length); } else { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length); @@ -418,7 +418,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { __ set_info("new_multi_array", dont_gc_arguments); // Z_R3,: klass // Z_R4,: rank @@ -436,7 +436,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); @@ -459,62 +459,62 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { __ set_info("range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { __ set_info("index_range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { __ set_info("throw_div0_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { __ set_info("throw_null_pointer_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { __ set_info("handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { __ set_info("handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { __ set_info("unwind_exception", dont_gc_arguments); // Note: no stubframe since we are about to leave the current // activation and we are calling a leaf VM function only. generate_unwind_exception(sasm); } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { __ set_info("throw_array_store_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true); } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { // Z_R1_scratch: object __ set_info("throw_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // Arguments : // sub : stack param 0 @@ -580,13 +580,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ z_br(Z_R14); } break; - case monitorenter_nofpu_id: - case monitorenter_id: + case C1StubId::monitorenter_nofpu_id: + case C1StubId::monitorenter_id: { // Z_R1_scratch : object // Z_R13 : lock address (see LIRGenerator::syncTempOpr()) __ set_info("monitorenter", dont_gc_arguments); - int save_fpu_registers = (id == monitorenter_id); + int save_fpu_registers = (id == C1StubId::monitorenter_id); // Make a frame and preserve the caller's caller-save registers. OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); @@ -600,15 +600,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: - case monitorexit_id: + case C1StubId::monitorexit_nofpu_id: + case C1StubId::monitorexit_id: { // Z_R1_scratch : lock address // Note: really a leaf routine but must setup last java sp // => Use call_RT for now (speed can be improved by // doing last java sp setup manually). __ set_info("monitorexit", dont_gc_arguments); - int save_fpu_registers = (id == monitorexit_id); + int save_fpu_registers = (id == C1StubId::monitorexit_id); // Make a frame and preserve the caller's caller-save registers. OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); @@ -622,7 +622,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { // Args: Z_R1_scratch: trap request __ set_info("deoptimize", dont_gc_arguments); Register trap_request = Z_R1_scratch; @@ -639,32 +639,32 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { __ set_info("access_field_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { __ set_info("load_klass_patching", dont_gc_arguments); // We should set up register map. oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { __ set_info("load_mirror_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { __ set_info("load_appendix_patching", dont_gc_arguments); oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); } break; #if 0 - case dtrace_object_alloc_id: + case C1StubId::dtrace_object_alloc_id: { // rax,: object StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); // We can't gc here so skip the oopmap but make sure that all @@ -679,7 +679,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case fpu2long_stub_id: + case C1StubId::fpu2long_stub_id: { // rax, and rdx are destroyed, but should be free since the result is returned there // preserve rsi,ecx @@ -754,7 +754,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { break; #endif // TODO - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { __ set_info("predicate_failed_trap", dont_gc_arguments); @@ -775,14 +775,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { default: { - __ should_not_reach_here(FILE_AND_LINE, id); + __ should_not_reach_here(FILE_AND_LINE, (int)id); } break; } return oop_maps; } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) { __ block_comment("generate_handle_exception"); // incoming parameters: Z_EXC_OOP, Z_EXC_PC @@ -793,7 +793,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { Register reg_fp = Z_R1_scratch; switch (id) { - case forward_exception_id: { + case C1StubId::forward_exception_id: { // We're handling an exception in the context of a compiled frame. // The registers have been saved in the standard places. Perform // an exception lookup in the caller and dispatch to the handler @@ -820,13 +820,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ clear_mem(Address(Z_thread, JavaThread::vm_result_2_offset()), sizeof(Metadata*)); break; } - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // At this point all registers MAY be live. DEBUG_ONLY(__ z_lgr(reg_fp, Z_SP);) - oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id, Z_EXC_PC); + oop_map = save_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id, Z_EXC_PC); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { // At this point all registers except Z_EXC_OOP and Z_EXC_PC are dead. DEBUG_ONLY(__ z_lgr(reg_fp, Z_SP);) __ save_return_pc(Z_EXC_PC); @@ -875,15 +875,15 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ invalidate_registers(Z_R2); switch(id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // Restore the registers that were saved at the beginning. __ z_lgr(Z_R1_scratch, Z_R2); // Restoring live registers kills Z_R2. - restore_live_registers(sasm, id != handle_exception_nofpu_id); // Pops as well the frame. + restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); // Pops as well the frame. __ z_br(Z_R1_scratch); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { __ pop_frame(); __ z_br(Z_R2); // Jump to exception handler. } diff --git a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp index 3641d82dabea9..025ef4c8915cd 100644 --- a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp @@ -34,12 +34,12 @@ #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box, Register temp1, Register temp2) { - compiler_fast_lock_lightweight_object(obj, temp1, temp2); + compiler_fast_lock_lightweight_object(obj, box, temp1, temp2); } void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register box, Register temp1, Register temp2) { - compiler_fast_unlock_lightweight_object(obj, temp1, temp2); + compiler_fast_unlock_lightweight_object(obj, box, temp1, temp2); } //------------------------------------------------------ diff --git a/src/hotspot/cpu/s390/downcallLinker_s390.cpp b/src/hotspot/cpu/s390/downcallLinker_s390.cpp index 383a32448745c..85ddc5bf18548 100644 --- a/src/hotspot/cpu/s390/downcallLinker_s390.cpp +++ b/src/hotspot/cpu/s390/downcallLinker_s390.cpp @@ -36,8 +36,8 @@ #define __ _masm-> -static const int native_invoker_code_base_size = 512; -static const int native_invoker_size_per_args = 8; +static const int native_invoker_code_base_size = 384; +static const int native_invoker_size_per_args = 12; RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, int num_args, diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp index d3457916bc9d5..28892da6ca4c1 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp @@ -105,16 +105,60 @@ void BarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators } } +// Generic implementation. GCs can provide an optimized one. void BarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2) { - NearLabel Ldone; - __ z_ltgr(tmp1, value); - __ z_bre(Ldone); // Use null result as-is. - __ z_nill(value, ~JNIHandles::tag_mask); - __ z_lg(value, 0, value); // Resolve (untagged) jobject. + assert_different_registers(value, tmp1, tmp2); + NearLabel done, weak_tag, verify, tagged; + __ z_ltgr(value, value); + __ z_bre(done); // Use null result as-is. + __ z_tmll(value, JNIHandles::tag_mask); + __ z_btrue(tagged); // not zero + + // Resolve Local handle + __ access_load_at(T_OBJECT, IN_NATIVE | AS_RAW, Address(value, 0), value, tmp1, tmp2); + __ z_bru(verify); + + __ bind(tagged); + __ testbit(value, exact_log2(JNIHandles::TypeTag::weak_global)); // test for weak tag + __ z_btrue(weak_tag); + + // resolve global handle + __ access_load_at(T_OBJECT, IN_NATIVE, Address(value, -JNIHandles::TypeTag::global), value, tmp1, tmp2); + __ z_bru(verify); + + __ bind(weak_tag); + // resolve jweak. + __ access_load_at(T_OBJECT, IN_NATIVE | ON_PHANTOM_OOP_REF, + Address(value, -JNIHandles::TypeTag::weak_global), value, tmp1, tmp2); + __ bind(verify); + __ verify_oop(value, FILE_AND_LINE); + __ bind(done); +} + +// Generic implementation. GCs can provide an optimized one. +void BarrierSetAssembler::resolve_global_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2) { + assert_different_registers(value, tmp1, tmp2); + NearLabel done; + + __ z_ltgr(value, value); + __ z_bre(done); // use null as-is. + +#ifdef ASSERT + { + NearLabel valid_global_tag; + __ testbit(value, exact_log2(JNIHandles::TypeTag::global)); // test for global tag + __ z_btrue(valid_global_tag); + __ stop("non global jobject using resolve_global_jobject"); + __ bind(valid_global_tag); + } +#endif // ASSERT + + // Resolve global handle + __ access_load_at(T_OBJECT, IN_NATIVE, Address(value, -JNIHandles::TypeTag::global), value, tmp1, tmp2); __ verify_oop(value, FILE_AND_LINE); - __ bind(Ldone); + __ bind(done); } void BarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp index f83bbb864ea47..de1de8a51a7f1 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp @@ -51,6 +51,7 @@ class BarrierSetAssembler: public CHeapObj { const Address& addr, Register val, Register tmp1, Register tmp2, Register tmp3); virtual void resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2); + virtual void resolve_global_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2); virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); diff --git a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp index fd21dd85e1195..f44a72c27abc1 100644 --- a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018, 2019 SAP SE. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024 SAP SE. 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 @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" #include "gc/shared/modRefBarrierSetAssembler.hpp" +#include "runtime/jniHandles.hpp" #define __ masm-> @@ -58,3 +59,16 @@ void ModRefBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet deco BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2, tmp3); } } + +void ModRefBarrierSetAssembler::resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2) { + NearLabel done; + + __ z_ltgr(value, value); + __ z_bre(done); // use null as-is. + + __ z_nill(value, ~JNIHandles::tag_mask); + __ z_lg(value, 0, value); // Resolve (untagged) jobject. + + __ verify_oop(value, FILE_AND_LINE); + __ bind(done); +} diff --git a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.hpp index 865638477cd7a..7f53d033780c1 100644 --- a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018 SAP SE. All rights reserved. + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024 SAP SE. 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 @@ -48,6 +48,8 @@ class ModRefBarrierSetAssembler: public BarrierSetAssembler { virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, const Address& dst, Register val, Register tmp1, Register tmp2, Register tmp3); + + virtual void resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2); }; #endif // CPU_S390_GC_SHARED_MODREFBARRIERSETASSEMBLER_S390_HPP diff --git a/src/hotspot/cpu/s390/interp_masm_s390.cpp b/src/hotspot/cpu/s390/interp_masm_s390.cpp index e56beaa9f569c..d00b6c3e2cc2e 100644 --- a/src/hotspot/cpu/s390/interp_masm_s390.cpp +++ b/src/hotspot/cpu/s390/interp_masm_s390.cpp @@ -1012,7 +1012,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { } if (LockingMode == LM_LIGHTWEIGHT) { - lightweight_lock(object, header, tmp, slow_case); + lightweight_lock(monitor, object, header, tmp, slow_case); } else if (LockingMode == LM_LEGACY) { // Load markWord from object into header. diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index 50de705cd9f0c..6c26e17d5ce3b 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -3674,6 +3674,11 @@ void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp bs->resolve_jobject(this, value, tmp1, tmp2); } +void MacroAssembler::resolve_global_jobject(Register value, Register tmp1, Register tmp2) { + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->resolve_global_jobject(this, value, tmp1, tmp2); +} + // Last_Java_sp must comply to the rules in frame_s390.hpp. void MacroAssembler::set_last_Java_frame(Register last_Java_sp, Register last_Java_pc, bool allow_relocation) { BLOCK_COMMENT("set_last_Java_frame {"); @@ -6002,10 +6007,10 @@ SkipIfEqual::~SkipIfEqual() { // - obj: the object to be locked, contents preserved. // - temp1, temp2: temporary registers, contents destroyed. // Note: make sure Z_R1 is not manipulated here when C2 compiler is in play -void MacroAssembler::lightweight_lock(Register obj, Register temp1, Register temp2, Label& slow) { +void MacroAssembler::lightweight_lock(Register basic_lock, Register obj, Register temp1, Register temp2, Label& slow) { assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking"); - assert_different_registers(obj, temp1, temp2); + assert_different_registers(basic_lock, obj, temp1, temp2); Label push; const Register top = temp1; @@ -6017,6 +6022,11 @@ void MacroAssembler::lightweight_lock(Register obj, Register temp1, Register tem // instruction emitted as it is part of C1's null check semantics. z_lg(mark, Address(obj, mark_offset)); + if (UseObjectMonitorTable) { + // Clear cache in case fast locking succeeds. + const Address om_cache_addr = Address(basic_lock, BasicObjectLock::lock_offset() + in_ByteSize((BasicLock::object_monitor_cache_offset_in_bytes()))); + z_mvghi(om_cache_addr, 0); + } // First we need to check if the lock-stack has room for pushing the object reference. z_lgf(top, Address(Z_thread, ls_top_offset)); @@ -6140,8 +6150,8 @@ void MacroAssembler::lightweight_unlock(Register obj, Register temp1, Register t bind(unlocked); } -void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Register tmp1, Register tmp2) { - assert_different_registers(obj, tmp1, tmp2); +void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Register box, Register tmp1, Register tmp2) { + assert_different_registers(obj, box, tmp1, tmp2); // Handle inflated monitor. NearLabel inflated; @@ -6150,6 +6160,11 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Registe // Finish fast lock unsuccessfully. MUST branch to with flag == EQ NearLabel slow_path; + if (UseObjectMonitorTable) { + // Clear cache in case fast locking succeeds. + z_mvghi(Address(box, BasicLock::object_monitor_cache_offset_in_bytes()), 0); + } + if (DiagnoseSyncOnValueBasedClasses != 0) { load_klass(tmp1, obj); z_tm(Address(tmp1, Klass::misc_flags_offset()), KlassFlags::_misc_is_value_based_class); @@ -6214,33 +6229,77 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Registe { // Handle inflated monitor. bind(inflated); + const Register tmp1_monitor = tmp1; if (!UseObjectMonitorTable) { - // mark contains the tagged ObjectMonitor*. - const Register tagged_monitor = mark; - const Register zero = tmp2; - - // Try to CAS m->owner from null to current thread. - // If m->owner is null, then csg succeeds and sets m->owner=THREAD and CR=EQ. - // Otherwise, register zero is filled with the current owner. - z_lghi(zero, 0); - z_csg(zero, Z_thread, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), tagged_monitor); - z_bre(locked); - - // Check if recursive. - z_cgr(Z_thread, zero); // zero contains the owner from z_csg instruction - z_brne(slow_path); - - // Recursive - z_agsi(Address(tagged_monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), 1ll); - z_cgr(zero, zero); - // z_bru(locked); - // Uncomment above line in the future, for now jump address is right next to us. + assert(tmp1_monitor == mark, "should be the same here"); } else { - // OMCache lookup not supported yet. Take the slowpath. - // Set flag to NE - z_ltgr(obj, obj); + NearLabel monitor_found; + + // load cache address + z_la(tmp1, Address(Z_thread, JavaThread::om_cache_oops_offset())); + + const int num_unrolled = 2; + for (int i = 0; i < num_unrolled; i++) { + z_cg(obj, Address(tmp1)); + z_bre(monitor_found); + add2reg(tmp1, in_bytes(OMCache::oop_to_oop_difference())); + } + + NearLabel loop; + // Search for obj in cache + + bind(loop); + + // check for match. + z_cg(obj, Address(tmp1)); + z_bre(monitor_found); + + // search until null encountered, guaranteed _null_sentinel at end. + add2reg(tmp1, in_bytes(OMCache::oop_to_oop_difference())); + z_cghsi(0, tmp1, 0); + z_brne(loop); // if not EQ to 0, go for another loop + + // we reached to the end, cache miss + z_ltgr(obj, obj); // set CC to NE z_bru(slow_path); + + // cache hit + bind(monitor_found); + z_lg(tmp1_monitor, Address(tmp1, OMCache::oop_to_monitor_difference())); + } + NearLabel monitor_locked; + // lock the monitor + + // mark contains the tagged ObjectMonitor*. + const Register tagged_monitor = mark; + const Register zero = tmp2; + + const ByteSize monitor_tag = in_ByteSize(UseObjectMonitorTable ? 0 : checked_cast(markWord::monitor_value)); + const Address owner_address(tmp1_monitor, ObjectMonitor::owner_offset() - monitor_tag); + const Address recursions_address(tmp1_monitor, ObjectMonitor::recursions_offset() - monitor_tag); + + + // Try to CAS m->owner from null to current thread. + // If m->owner is null, then csg succeeds and sets m->owner=THREAD and CR=EQ. + // Otherwise, register zero is filled with the current owner. + z_lghi(zero, 0); + z_csg(zero, Z_thread, owner_address); + z_bre(monitor_locked); + + // Check if recursive. + z_cgr(Z_thread, zero); // zero contains the owner from z_csg instruction + z_brne(slow_path); + + // Recursive + z_agsi(recursions_address, 1ll); + + bind(monitor_locked); + if (UseObjectMonitorTable) { + // Cache the monitor for unlock + z_stg(tmp1_monitor, Address(box, BasicLock::object_monitor_cache_offset_in_bytes())); } + // set the CC now + z_cgr(obj, obj); } BLOCK_COMMENT("} handle_inflated_monitor_lightweight_locking"); @@ -6265,11 +6324,11 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Registe // C2 uses the value of flag (NE vs EQ) to determine the continuation. } -void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Register tmp1, Register tmp2) { - assert_different_registers(obj, tmp1, tmp2); +void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Register box, Register tmp1, Register tmp2) { + assert_different_registers(obj, box, tmp1, tmp2); // Handle inflated monitor. - NearLabel inflated, inflated_load_monitor; + NearLabel inflated, inflated_load_mark; // Finish fast unlock successfully. MUST reach to with flag == EQ. NearLabel unlocked; // Finish fast unlock unsuccessfully. MUST branch to with flag == NE. @@ -6289,7 +6348,7 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis z_aghi(top, -oopSize); z_cg(obj, Address(Z_thread, top)); - branch_optimized(bcondNotEqual, inflated_load_monitor); + branch_optimized(bcondNotEqual, inflated_load_mark); // Pop lock-stack. #ifdef ASSERT @@ -6310,6 +6369,9 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis // Not recursive // Check for monitor (0b10). + // Because we got here by popping (meaning we pushed in locked) + // there will be no monitor in the box. So we need to push back the obj + // so that the runtime can fix any potential anonymous owner. z_lg(mark, Address(obj, mark_offset)); z_tmll(mark, markWord::monitor_value); if (!UseObjectMonitorTable) { @@ -6348,7 +6410,7 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis { // Handle inflated monitor. - bind(inflated_load_monitor); + bind(inflated_load_mark); z_lg(mark, Address(obj, mark_offset)); @@ -6373,49 +6435,61 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis bind(check_done); #endif // ASSERT + const Register tmp1_monitor = tmp1; + if (!UseObjectMonitorTable) { - // mark contains the tagged ObjectMonitor*. - const Register monitor = mark; + assert(tmp1_monitor == mark, "should be the same here"); + } else { + // Uses ObjectMonitorTable. Look for the monitor in our BasicLock on the stack. + z_lg(tmp1_monitor, Address(box, BasicLock::object_monitor_cache_offset_in_bytes())); + // null check with ZF == 0, no valid pointer below alignof(ObjectMonitor*) + z_cghi(tmp1_monitor, alignof(ObjectMonitor*)); - NearLabel not_recursive; - const Register recursions = tmp2; + z_brl(slow_path); + } - // Check if recursive. - load_and_test_long(recursions, Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); - z_bre(not_recursive); // if 0 then jump, it's not recursive locking + // mark contains the tagged ObjectMonitor*. + const Register monitor = mark; - // Recursive unlock - z_agsi(Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), -1ll); - z_cgr(monitor, monitor); // set the CC to EQUAL - z_bru(unlocked); + const ByteSize monitor_tag = in_ByteSize(UseObjectMonitorTable ? 0 : checked_cast(markWord::monitor_value)); + const Address recursions_address{monitor, ObjectMonitor::recursions_offset() - monitor_tag}; + const Address cxq_address{monitor, ObjectMonitor::cxq_offset() - monitor_tag}; + const Address EntryList_address{monitor, ObjectMonitor::EntryList_offset() - monitor_tag}; + const Address owner_address{monitor, ObjectMonitor::owner_offset() - monitor_tag}; - bind(not_recursive); + NearLabel not_recursive; + const Register recursions = tmp2; - NearLabel not_ok; - // Check if the entry lists are empty. - load_and_test_long(tmp2, Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); - z_brne(not_ok); - load_and_test_long(tmp2, Address(monitor, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); - z_brne(not_ok); + // Check if recursive. + load_and_test_long(recursions, recursions_address); + z_bre(not_recursive); // if 0 then jump, it's not recursive locking - z_release(); - z_stg(tmp2 /*=0*/, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), monitor); + // Recursive unlock + z_agsi(recursions_address, -1ll); + z_cgr(monitor, monitor); // set the CC to EQUAL + z_bru(unlocked); - z_bru(unlocked); // CC = EQ here + bind(not_recursive); - bind(not_ok); + NearLabel not_ok; + // Check if the entry lists are empty. + load_and_test_long(tmp2, EntryList_address); + z_brne(not_ok); + load_and_test_long(tmp2, cxq_address); + z_brne(not_ok); - // The owner may be anonymous, and we removed the last obj entry in - // the lock-stack. This loses the information about the owner. - // Write the thread to the owner field so the runtime knows the owner. - z_stg(Z_thread, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), monitor); - z_bru(slow_path); // CC = NE here - } else { - // OMCache lookup not supported yet. Take the slowpath. - // Set flag to NE - z_ltgr(obj, obj); - z_bru(slow_path); - } + z_release(); + z_stg(tmp2 /*=0*/, owner_address); + + z_bru(unlocked); // CC = EQ here + + bind(not_ok); + + // The owner may be anonymous, and we removed the last obj entry in + // the lock-stack. This loses the information about the owner. + // Write the thread to the owner field so the runtime knows the owner. + z_stg(Z_thread, owner_address); + z_bru(slow_path); // CC = NE here } bind(unlocked); diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp index 90210eb28c3ad..5d3a4c2994091 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp @@ -752,12 +752,13 @@ class MacroAssembler: public Assembler { void compiler_fast_lock_object(Register oop, Register box, Register temp1, Register temp2); void compiler_fast_unlock_object(Register oop, Register box, Register temp1, Register temp2); - void lightweight_lock(Register obj, Register tmp1, Register tmp2, Label& slow); + void lightweight_lock(Register basic_lock, Register obj, Register tmp1, Register tmp2, Label& slow); void lightweight_unlock(Register obj, Register tmp1, Register tmp2, Label& slow); - void compiler_fast_lock_lightweight_object(Register obj, Register tmp1, Register tmp2); - void compiler_fast_unlock_lightweight_object(Register obj, Register tmp1, Register tmp2); + void compiler_fast_lock_lightweight_object(Register obj, Register box, Register tmp1, Register tmp2); + void compiler_fast_unlock_lightweight_object(Register obj, Register box, Register tmp1, Register tmp2); void resolve_jobject(Register value, Register tmp1, Register tmp2); + void resolve_global_jobject(Register value, Register tmp1, Register tmp2); // Support for last Java frame (but use call_VM instead where possible). private: @@ -819,7 +820,6 @@ class MacroAssembler: public Assembler { void compare_klass_ptr(Register Rop1, int64_t disp, Register Rbase, bool maybenull); // Access heap oop, handle encoding and GC barriers. - private: void access_store_at(BasicType type, DecoratorSet decorators, const Address& addr, Register val, Register tmp1, Register tmp2, Register tmp3); diff --git a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp index 9954c78ce1efa..468610b588e91 100644 --- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp +++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp @@ -43,6 +43,7 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/timerTrace.hpp" #include "runtime/vframeArray.hpp" #include "utilities/align.hpp" #include "utilities/macros.hpp" @@ -1713,7 +1714,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, // Try fastpath for locking. if (LockingMode == LM_LIGHTWEIGHT) { // Fast_lock kills r_temp_1, r_temp_2. - __ compiler_fast_lock_lightweight_object(r_oop, r_tmp1, r_tmp2); + __ compiler_fast_lock_lightweight_object(r_oop, r_box, r_tmp1, r_tmp2); } else { // Fast_lock kills r_temp_1, r_temp_2. __ compiler_fast_lock_object(r_oop, r_box, r_tmp1, r_tmp2); @@ -1917,7 +1918,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, // Try fastpath for unlocking. if (LockingMode == LM_LIGHTWEIGHT) { // Fast_unlock kills r_tmp1, r_tmp2. - __ compiler_fast_unlock_lightweight_object(r_oop, r_tmp1, r_tmp2); + __ compiler_fast_unlock_lightweight_object(r_oop, r_box, r_tmp1, r_tmp2); } else { // Fast_unlock kills r_tmp1, r_tmp2. __ compiler_fast_unlock_object(r_oop, r_box, r_tmp1, r_tmp2); diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 345b779e8094e..07476ab342f6d 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -1385,6 +1385,14 @@ void Assembler::addl(Address dst, int32_t imm32) { emit_arith_operand(0x81, rax, dst, imm32); } +void Assembler::eaddl(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rax, src, imm32); +} + void Assembler::addb(Address dst, int imm8) { InstructionMark im(this); prefix(dst); @@ -1429,11 +1437,26 @@ void Assembler::addl(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::eaddl(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x01); + emit_operand(src2, src1, 0); +} + void Assembler::addl(Register dst, int32_t imm32) { prefix(dst); emit_arith(0x81, 0xC0, dst, imm32); } +void Assembler::eaddl(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xC0, src, imm32); +} + void Assembler::addl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -1441,11 +1464,27 @@ void Assembler::addl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::eaddl(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x03); + emit_operand(src1, src2, 0); +} + void Assembler::addl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x03, 0xC0, dst, src); } +void Assembler::eaddl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x01, 0xC0, src1, src2); +} + void Assembler::addr_nop_4() { assert(UseAddressNop, "no CPU support"); // 4 bytes: NOP DWORD PTR [EAX+0] @@ -1632,11 +1671,25 @@ void Assembler::andl(Address dst, int32_t imm32) { emit_arith_operand(0x81, as_Register(4), dst, imm32); } +void Assembler::eandl(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rsp, src, imm32); +} + void Assembler::andl(Register dst, int32_t imm32) { prefix(dst); emit_arith(0x81, 0xE0, dst, imm32); } +void Assembler::eandl(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xE0, src, imm32); +} + void Assembler::andl(Address dst, Register src) { InstructionMark im(this); prefix(dst, src); @@ -1651,11 +1704,27 @@ void Assembler::andl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::eandl(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x23); + emit_operand(src1, src2, 0); +} + void Assembler::andl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x23, 0xC0, dst, src); } +void Assembler::eandl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x21, 0xC0, src1, src2); +} + void Assembler::andnl(Register dst, Register src1, Register src2) { assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -1803,6 +1872,12 @@ void Assembler::cmovl(Condition cc, Register dst, Register src) { emit_opcode_prefix_and_encoding(0x40 | cc, 0xC0, encode); } +void Assembler::ecmovl(Condition cc, Register dst, Register src1, Register src2) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int16((0x40 | cc), (0xC0 | encode)); +} + void Assembler::cmovl(Condition cc, Register dst, Address src) { InstructionMark im(this); NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); @@ -1811,6 +1886,15 @@ void Assembler::cmovl(Condition cc, Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::ecmovl(Condition cc, Register dst, Register src1, Address src2) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int8((0x40 | cc)); + emit_operand(src1, src2, 0); +} + void Assembler::cmpb(Address dst, Register reg) { assert(reg->has_byte_register(), "must have byte register"); InstructionMark im(this); @@ -2429,6 +2513,15 @@ void Assembler::decl(Address dst) { emit_operand(rcx, dst, 0); } +void Assembler::edecl(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xFF); + emit_operand(rcx, src, 0); +} + void Assembler::divsd(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionMark im(this); @@ -2474,21 +2567,45 @@ void Assembler::idivl(Register src) { emit_int16((unsigned char)0xF7, (0xF8 | encode)); } +void Assembler::eidivl(Register src, bool no_flags) { // Signed + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xF8 | encode)); +} + void Assembler::divl(Register src) { // Unsigned int encode = prefix_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xF0 | encode)); } +void Assembler::edivl(Register src, bool no_flags) { // Unsigned + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xF0 | encode)); +} + void Assembler::imull(Register src) { int encode = prefix_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xE8 | encode)); } +void Assembler::eimull(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xE8 | encode)); +} + void Assembler::imull(Register dst, Register src) { int encode = prefix_and_encode(dst->encoding(), src->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xAF, 0xC0, encode); } +void Assembler::eimull(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xAF, (0xC0 | encode)); +} + void Assembler::imull(Register dst, Address src, int32_t value) { InstructionMark im(this); prefix(src, dst); @@ -2503,6 +2620,22 @@ void Assembler::imull(Register dst, Address src, int32_t value) { } } +void Assembler::eimull(Register dst, Address src, int32_t value, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (is8bit(value)) { + emit_int8((unsigned char)0x6B); + emit_operand(dst, src, 1); + emit_int8(value); + } else { + emit_int8((unsigned char)0x69); + emit_operand(dst, src, 4); + emit_int32(value); + } +} + void Assembler::imull(Register dst, Register src, int value) { int encode = prefix_and_encode(dst->encoding(), src->encoding()); if (is8bit(value)) { @@ -2513,6 +2646,17 @@ void Assembler::imull(Register dst, Register src, int value) { } } +void Assembler::eimull(Register dst, Register src, int value, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (is8bit(value)) { + emit_int24(0x6B, (0xC0 | encode), value & 0xFF); + } else { + emit_int16(0x69, (0xC0 | encode)); + emit_int32(value); + } +} + void Assembler::imull(Register dst, Address src) { InstructionMark im(this); prefix(src, dst, false, true /* is_map1 */); @@ -2520,6 +2664,14 @@ void Assembler::imull(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::eimull(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xAF); + emit_operand(src1, src2, 0); +} void Assembler::incl(Address dst) { // Don't use it directly. Use MacroAssembler::increment() instead. @@ -2529,6 +2681,16 @@ void Assembler::incl(Address dst) { emit_operand(rax, dst, 0); } +void Assembler::eincl(Register dst, Address src, bool no_flags) { + // Don't use it directly. Use MacroAssembler::increment() instead. + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xFF); + emit_operand(rax, src, 0); +} + void Assembler::jcc(Condition cc, Label& L, bool maybe_short) { InstructionMark im(this); assert((0 <= cc) && (cc < 16), "illegal cc"); @@ -2696,6 +2858,13 @@ void Assembler::lzcntl(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xBD, 0xC0, encode); } +void Assembler::elzcntl(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF5, (0xC0 | encode)); +} + void Assembler::lzcntl(Register dst, Address src) { assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); InstructionMark im(this); @@ -2705,6 +2874,16 @@ void Assembler::lzcntl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::elzcntl(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF5); + emit_operand(dst, src, 0); +} + // Emit mfence instruction void Assembler::mfence() { NOT_LP64(assert(VM_Version::supports_sse2(), "unsupported");) @@ -3855,11 +4034,26 @@ void Assembler::mull(Address src) { emit_operand(rsp, src, 0); } +void Assembler::emull(Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_nf(src, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF7); + emit_operand(rsp, src, 0); +} + void Assembler::mull(Register src) { int encode = prefix_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xE0 | encode)); } +void Assembler::emull(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xE0 | encode)); +} + void Assembler::mulsd(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionMark im(this); @@ -3901,6 +4095,12 @@ void Assembler::negl(Register dst) { emit_int16((unsigned char)0xF7, (0xD8 | encode)); } +void Assembler::enegl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xD8 | encode)); +} + void Assembler::negl(Address dst) { InstructionMark im(this); prefix(dst); @@ -3908,6 +4108,15 @@ void Assembler::negl(Address dst) { emit_operand(as_Register(3), dst, 0); } +void Assembler::enegl(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF7); + emit_operand(as_Register(3), src, 0); +} + void Assembler::nop(uint i) { #ifdef ASSERT assert(i > 0, " "); @@ -4219,17 +4428,48 @@ void Assembler::notl(Register dst) { emit_int16((unsigned char)0xF7, (0xD0 | encode)); } +void Assembler::enotl(Register dst, Register src) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int16((unsigned char)0xF7, (0xD0 | encode)); +} + +void Assembler::orw(Register dst, Register src) { + (void)prefix_and_encode(dst->encoding(), src->encoding()); + emit_arith(0x0B, 0xC0, dst, src); +} + +void Assembler::eorw(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x0B, 0xC0, src1, src2); +} + void Assembler::orl(Address dst, int32_t imm32) { InstructionMark im(this); prefix(dst); emit_arith_operand(0x81, rcx, dst, imm32); } +void Assembler::eorl(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rcx, src, imm32); +} + void Assembler::orl(Register dst, int32_t imm32) { prefix(dst); emit_arith(0x81, 0xC8, dst, imm32); } +void Assembler::eorl(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xC8, src, imm32); +} + void Assembler::orl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -4237,11 +4477,27 @@ void Assembler::orl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::eorl(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x0B); + emit_operand(src1, src2, 0); +} + void Assembler::orl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x0B, 0xC0, dst, src); } +void Assembler::eorl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x09, 0xC0, src1, src2); +} + void Assembler::orl(Address dst, Register src) { InstructionMark im(this); prefix(dst, src); @@ -4249,6 +4505,15 @@ void Assembler::orl(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::eorl(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x09); + emit_operand(src2, src1, 0); +} + void Assembler::orb(Address dst, int imm8) { InstructionMark im(this); prefix(dst); @@ -4257,6 +4522,16 @@ void Assembler::orb(Address dst, int imm8) { emit_int8(imm8); } +void Assembler::eorb(Register dst, Address src, int imm8, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_8bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0x80); + emit_operand(rcx, src, 1); + emit_int8(imm8); +} + void Assembler::orb(Address dst, Register src) { InstructionMark im(this); prefix(dst, src, true); @@ -4264,6 +4539,15 @@ void Assembler::orb(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::eorb(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_8bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x08); + emit_operand(src2, src1, 0); +} + void Assembler::packsswb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); @@ -5384,6 +5668,16 @@ void Assembler::popcntl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::epopcntl(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_popcnt(), "must support"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0x88); + emit_operand(dst, src, 0); +} + void Assembler::popcntl(Register dst, Register src) { assert(VM_Version::supports_popcnt(), "must support"); emit_int8((unsigned char)0xF3); @@ -5391,6 +5685,13 @@ void Assembler::popcntl(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xB8, 0xC0, encode); } +void Assembler::epopcntl(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_popcnt(), "must support"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0x88, (0xC0 | encode)); +} + void Assembler::evpopcntb(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { assert(VM_Version::supports_avx512_bitalg(), "must support avx512bitalg feature"); assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); @@ -5979,6 +6280,17 @@ void Assembler::rcll(Register dst, int imm8) { } } +void Assembler::ercll(Register dst, Register src, int imm8) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xD0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xD0 | encode), imm8); + } +} + void Assembler::rcpps(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); @@ -6059,11 +6371,28 @@ void Assembler::roll(Register dst, int imm8) { } } +void Assembler::eroll(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xC0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xc0 | encode), imm8); + } +} + void Assembler::roll(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xC0 | encode)); } +void Assembler::eroll(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xC0 | encode)); +} + void Assembler::rorl(Register dst, int imm8) { assert(isShiftCount(imm8), "illegal shift count"); int encode = prefix_and_encode(dst->encoding()); @@ -6074,17 +6403,40 @@ void Assembler::rorl(Register dst, int imm8) { } } +void Assembler::erorl(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xC8 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xc8 | encode), imm8); + } +} + void Assembler::rorl(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xC8 | encode)); } +void Assembler::erorl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xC8 | encode)); +} + #ifdef _LP64 void Assembler::rorq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xC8 | encode)); } +void Assembler::erorq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xC8 | encode)); +} + void Assembler::rorq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -6095,11 +6447,28 @@ void Assembler::rorq(Register dst, int imm8) { } } +void Assembler::erorq(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xC8 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xC8 | encode), imm8); + } +} + void Assembler::rolq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xC0 | encode)); } +void Assembler::erolq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xC0 | encode)); +} + void Assembler::rolq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -6109,6 +6478,17 @@ void Assembler::rolq(Register dst, int imm8) { emit_int24((unsigned char)0xC1, (0xc0 | encode), imm8); } } + +void Assembler::erolq(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xC0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xc0 | encode), imm8); + } + } #endif void Assembler::sahf() { @@ -6134,6 +6514,23 @@ void Assembler::sall(Address dst, int imm8) { } } +void Assembler::esall(Register dst, Address src, int imm8, bool no_flags) { + InstructionMark im(this); + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(4), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(4), src, 1); + emit_int8(imm8); + } +} + void Assembler::sall(Address dst) { InstructionMark im(this); prefix(dst); @@ -6141,8 +6538,17 @@ void Assembler::sall(Address dst) { emit_operand(as_Register(4), dst, 0); } -void Assembler::sall(Register dst, int imm8) { - assert(isShiftCount(imm8), "illegal shift count"); +void Assembler::esall(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(4), src, 0); +} + +void Assembler::sall(Register dst, int imm8) { + assert(isShiftCount(imm8), "illegal shift count"); int encode = prefix_and_encode(dst->encoding()); if (imm8 == 1) { emit_int16((unsigned char)0xD1, (0xE0 | encode)); @@ -6151,11 +6557,28 @@ void Assembler::sall(Register dst, int imm8) { } } +void Assembler::esall(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xE0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xE0 | encode), imm8); + } +} + void Assembler::sall(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xE0 | encode)); } +void Assembler::esall(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE0 | encode)); +} + void Assembler::sarl(Address dst, int imm8) { assert(isShiftCount(imm8), "illegal shift count"); InstructionMark im(this); @@ -6171,6 +6594,23 @@ void Assembler::sarl(Address dst, int imm8) { } } +void Assembler::esarl(Register dst, Address src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(7), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(7), src, 1); + emit_int8(imm8); + } +} + void Assembler::sarl(Address dst) { InstructionMark im(this); prefix(dst); @@ -6178,6 +6618,15 @@ void Assembler::sarl(Address dst) { emit_operand(as_Register(7), dst, 0); } +void Assembler::esarl(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(7), src, 0); +} + void Assembler::sarl(Register dst, int imm8) { int encode = prefix_and_encode(dst->encoding()); assert(isShiftCount(imm8), "illegal shift count"); @@ -6188,11 +6637,28 @@ void Assembler::sarl(Register dst, int imm8) { } } +void Assembler::esarl(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xF8 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xF8 | encode), imm8); + } +} + void Assembler::sarl(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xF8 | encode)); } +void Assembler::esarl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xF8 | encode)); +} + void Assembler::sbbl(Address dst, int32_t imm32) { InstructionMark im(this); prefix(dst); @@ -6204,7 +6670,6 @@ void Assembler::sbbl(Register dst, int32_t imm32) { emit_arith(0x81, 0xD8, dst, imm32); } - void Assembler::sbbl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -6297,7 +6762,6 @@ void Assembler::sha256msg2(XMMRegister dst, XMMRegister src) { emit_int16((unsigned char)0xCD, (0xC0 | encode)); } - void Assembler::shll(Register dst, int imm8) { assert(isShiftCount(imm8), "illegal shift count"); int encode = prefix_and_encode(dst->encoding()); @@ -6308,11 +6772,28 @@ void Assembler::shll(Register dst, int imm8) { } } +void Assembler::eshll(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1 ) { + emit_int16((unsigned char)0xD1, (0xE0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xE0 | encode), imm8); + } +} + void Assembler::shll(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xE0 | encode)); } +void Assembler::eshll(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE0 | encode)); +} + void Assembler::shrl(Register dst, int imm8) { assert(isShiftCount(imm8), "illegal shift count"); int encode = prefix_and_encode(dst->encoding()); @@ -6324,11 +6805,29 @@ void Assembler::shrl(Register dst, int imm8) { } } +void Assembler::eshrl(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xE8 | encode)); + } + else { + emit_int24((unsigned char)0xC1, (0xE8 | encode), imm8); + } +} + void Assembler::shrl(Register dst) { int encode = prefix_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xE8 | encode)); } +void Assembler::eshrl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE8 | encode)); +} + void Assembler::shrl(Address dst) { InstructionMark im(this); prefix(dst); @@ -6336,6 +6835,15 @@ void Assembler::shrl(Address dst) { emit_operand(as_Register(5), dst, 0); } +void Assembler::eshrl(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(5), src, 0); +} + void Assembler::shrl(Address dst, int imm8) { InstructionMark im(this); assert(isShiftCount(imm8), "illegal shift count"); @@ -6351,37 +6859,89 @@ void Assembler::shrl(Address dst, int imm8) { } } +void Assembler::eshrl(Register dst, Address src, int imm8, bool no_flags) { + InstructionMark im(this); + assert(isShiftCount(imm8), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(5), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(5), src, 1); + emit_int8(imm8); + } +} void Assembler::shldl(Register dst, Register src) { int encode = prefix_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xA5, 0xC0, encode); } +void Assembler::eshldl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16(0xA5, (0xC0 | encode)); +} + void Assembler::shldl(Register dst, Register src, int8_t imm8) { int encode = prefix_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xA4, 0xC0, encode, imm8); } +void Assembler::eshldl(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int24(0x24, (0xC0 | encode), imm8); +} + void Assembler::shrdl(Register dst, Register src) { int encode = prefix_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xAD, 0xC0, encode); } +void Assembler::eshrdl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16(0xAD, (0xC0 | encode)); +} + void Assembler::shrdl(Register dst, Register src, int8_t imm8) { int encode = prefix_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xAC, 0xC0, encode, imm8); } +void Assembler::eshrdl(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int24(0x2C, (0xC0 | encode), imm8); +} + #ifdef _LP64 void Assembler::shldq(Register dst, Register src, int8_t imm8) { int encode = prefixq_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xA4, 0xC0, encode, imm8); } +void Assembler::eshldq(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int24(0x24, (0xC0 | encode), imm8); +} + void Assembler::shrdq(Register dst, Register src, int8_t imm8) { int encode = prefixq_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xAC, 0xC0, encode, imm8); } + +void Assembler::eshrdq(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int24(0x2C, (0xC0 | encode), imm8); +} #endif // copies a single word from [esi] to [edi] @@ -6472,6 +7032,14 @@ void Assembler::subl(Address dst, int32_t imm32) { emit_arith_operand(0x81, rbp, dst, imm32); } +void Assembler::esubl(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rbp, src, imm32); +} + void Assembler::subl(Address dst, Register src) { InstructionMark im(this); prefix(dst, src); @@ -6479,17 +7047,38 @@ void Assembler::subl(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::esubl(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x29); + emit_operand(src2, src1, 0); +} + void Assembler::subl(Register dst, int32_t imm32) { prefix(dst); emit_arith(0x81, 0xE8, dst, imm32); } +void Assembler::esubl(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xE8, src, imm32); +} + // Force generation of a 4 byte immediate value even if it fits into 8bit void Assembler::subl_imm32(Register dst, int32_t imm32) { prefix(dst); emit_arith_imm32(0x81, 0xE8, dst, imm32); } +void Assembler::esubl_imm32(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_imm32(0x81, 0xE8, src, imm32); +} + void Assembler::subl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -6497,11 +7086,27 @@ void Assembler::subl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::esubl(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x2B); + emit_operand(src1, src2, 0); +} + void Assembler::subl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x2B, 0xC0, dst, src); } +void Assembler::esubl(Register dst, Register src2, Register src1, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x29, 0xC0, src1, src2); +} + void Assembler::subsd(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -6605,6 +7210,13 @@ void Assembler::tzcntl(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xBC, 0xC0, encode); } +void Assembler::etzcntl(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF4, (0xC0 | encode)); +} + void Assembler::tzcntl(Register dst, Address src) { assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); InstructionMark im(this); @@ -6614,6 +7226,16 @@ void Assembler::tzcntl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::etzcntl(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF4); + emit_operand(dst, src, 0); +} + void Assembler::tzcntq(Register dst, Register src) { assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); emit_int8((unsigned char)0xF3); @@ -6621,6 +7243,13 @@ void Assembler::tzcntq(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xBC, 0xC0, encode); } +void Assembler::etzcntq(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF4, (0xC0 | encode)); +} + void Assembler::tzcntq(Register dst, Address src) { assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); InstructionMark im(this); @@ -6630,6 +7259,16 @@ void Assembler::tzcntq(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::etzcntq(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF4); + emit_operand(dst, src, 0); +} + void Assembler::ucomisd(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionMark im(this); @@ -6749,11 +7388,25 @@ void Assembler::xorl(Address dst, int32_t imm32) { emit_arith_operand(0x81, as_Register(6), dst, imm32); } +void Assembler::exorl(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, as_Register(6), src, imm32); +} + void Assembler::xorl(Register dst, int32_t imm32) { prefix(dst); emit_arith(0x81, 0xF0, dst, imm32); } +void Assembler::exorl(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xF0, src, imm32); +} + void Assembler::xorl(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -6761,11 +7414,27 @@ void Assembler::xorl(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::exorl(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x33); + emit_operand(src1, src2, 0); +} + void Assembler::xorl(Register dst, Register src) { (void) prefix_and_encode(dst->encoding(), src->encoding()); emit_arith(0x33, 0xC0, dst, src); } +void Assembler::exorl(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x31, 0xC0, src1, src2); +} + void Assembler::xorl(Address dst, Register src) { InstructionMark im(this); prefix(dst, src); @@ -6773,6 +7442,15 @@ void Assembler::xorl(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::exorl(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x31); + emit_operand(src2, src1, 0); +} + void Assembler::xorb(Register dst, Address src) { InstructionMark im(this); prefix(src, dst); @@ -6780,6 +7458,15 @@ void Assembler::xorb(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::exorb(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_8bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x32); + emit_operand(src1, src2, 0); +} + void Assembler::xorb(Address dst, Register src) { InstructionMark im(this); prefix(dst, src, true); @@ -6787,6 +7474,15 @@ void Assembler::xorb(Address dst, Register src) { emit_operand(src, dst, 0); } +void Assembler::exorb(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_8bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x30); + emit_operand(src2, src1, 0); +} + void Assembler::xorw(Register dst, Address src) { InstructionMark im(this); emit_int8(0x66); @@ -6795,6 +7491,16 @@ void Assembler::xorw(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::exorw(Register dst, Register src1, Address src2, bool no_flags) { + InstructionMark im(this); + emit_int8(0x66); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x33); + emit_operand(src1, src2, 0); +} + // AVX 3-operands scalar float-point arithmetic instructions void Assembler::vaddsd(XMMRegister dst, XMMRegister nds, Address src) { @@ -7342,6 +8048,14 @@ void Assembler::andpd(XMMRegister dst, XMMRegister src) { emit_int16(0x54, (0xC0 | encode)); } +void Assembler::andnpd(XMMRegister dst, XMMRegister src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_rex_vex_w_reverted(); + int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x55, (0xC0 | encode)); +} + void Assembler::andps(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); @@ -11378,6 +12092,12 @@ void Assembler::decl(Register dst) { emit_int8(0x48 | dst->encoding()); } +void Assembler::edecl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x48 | src->encoding()); +} + // 64bit doesn't use the x87 void Assembler::fabs() { @@ -11816,7 +12536,7 @@ void Assembler::vex_prefix(bool vex_r, bool vex_b, bool vex_x, int nds_enc, VexS // This is a 4 byte encoding void Assembler::evex_prefix(bool vex_r, bool vex_b, bool vex_x, bool evex_r, bool eevex_b, bool evex_v, - bool eevex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc) { + bool eevex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc, bool no_flags) { // EVEX 0x62 prefix // byte1 = EVEX_4bytes; @@ -11842,11 +12562,17 @@ void Assembler::evex_prefix(bool vex_r, bool vex_b, bool vex_x, bool evex_r, boo // of form {66, F3, F2} byte3 |= pre; - // P2: byte 4 as zL'Lbv'aaa - // kregs are implemented in the low 3 bits as aaa - int byte4 = (_attributes->is_no_reg_mask()) ? - 0 : - _attributes->get_embedded_opmask_register_specifier(); + // P2: byte 4 as zL'Lbv'aaa or 00LXVF00 where V = V4, X(extended context) = ND and F = NF (no flags) + int byte4 = 0; + if (no_flags) { + assert(_attributes->is_no_reg_mask(), "mask register not supported with no_flags"); + byte4 |= 0x4; + } else { + // kregs are implemented in the low 3 bits as aaa + byte4 = (_attributes->is_no_reg_mask()) ? + 0 : + _attributes->get_embedded_opmask_register_specifier(); + } // EVEX.v` for extending EVEX.vvvv or VIDX byte4 |= (evex_v ? 0: EVEX_V); // third EXEC.b for broadcast actions @@ -11861,11 +12587,12 @@ void Assembler::evex_prefix(bool vex_r, bool vex_b, bool vex_x, bool evex_r, boo emit_int32(EVEX_4bytes, byte2, byte3, byte4); } -void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { - if (adr.base_needs_rex2() || adr.index_needs_rex2()) { +void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool nds_is_ndd, bool no_flags) { + if (adr.base_needs_rex2() || adr.index_needs_rex2() || nds_is_ndd || no_flags) { assert(UseAPX, "APX features not enabled"); } - bool is_extended = adr.base_needs_rex2() || adr.index_needs_rex2() || nds_enc >= 16 || xreg_enc >= 16; + if (nds_is_ndd) attributes->set_extended_context(); + bool is_extended = adr.base_needs_rex2() || adr.index_needs_rex2() || nds_enc >= 16 || xreg_enc >= 16 || nds_is_ndd; bool vex_r = (xreg_enc & 8) == 8; bool vex_b = adr.base_needs_rex(); bool vex_x; @@ -11908,7 +12635,7 @@ void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix bool eevex_x = adr.index_needs_rex2(); bool eevex_b = adr.base_needs_rex2(); attributes->set_is_evex_instruction(); - evex_prefix(vex_r, vex_b, vex_x, evex_r, eevex_b, evex_v, eevex_x, nds_enc, pre, opc); + evex_prefix(vex_r, vex_b, vex_x, evex_r, eevex_b, evex_v, eevex_x, nds_enc, pre, opc, no_flags); } else { if (UseAVX > 2 && attributes->is_rex_vex_w_reverted()) { attributes->set_rex_vex_w(false); @@ -11917,10 +12644,21 @@ void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix } } -int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool src_is_gpr) { - if (src_is_gpr && src_enc >= 16) { +void Assembler::evex_prefix_ndd(Address adr, int ndd_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool no_flags) { + attributes->set_is_evex_instruction(); + vex_prefix(adr, ndd_enc, xreg_enc, pre, opc, attributes, /* nds_is_ndd */ true, no_flags); +} + +void Assembler::evex_prefix_nf(Address adr, int ndd_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool no_flags) { + attributes->set_is_evex_instruction(); + vex_prefix(adr, ndd_enc, xreg_enc, pre, opc, attributes, /* nds_is_ndd */ false, no_flags); +} + +int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes, bool src_is_gpr, bool nds_is_ndd, bool no_flags) { + if (nds_is_ndd || no_flags || (src_is_gpr && src_enc >= 16)) { assert(UseAPX, "APX features not enabled"); } + if (nds_is_ndd) attributes->set_extended_context(); bool is_extended = dst_enc >= 16 || nds_enc >= 16 || src_enc >=16; bool vex_r = (dst_enc & 8) == 8; bool vex_b = (src_enc & 8) == 8; @@ -11962,7 +12700,7 @@ int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexS // can use vex_x as bank extender on rm encoding vex_x = (src_enc >= 16) && !src_is_gpr; attributes->set_is_evex_instruction(); - evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_b, evex_v, false /*eevex_x*/, nds_enc, pre, opc); + evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_b, evex_v, false /*eevex_x*/, nds_enc, pre, opc, no_flags); } else { if (UseAVX > 2 && attributes->is_rex_vex_w_reverted()) { attributes->set_rex_vex_w(false); @@ -11974,6 +12712,18 @@ int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexS return (((dst_enc & 7) << 3) | (src_enc & 7)); } +int Assembler::evex_prefix_and_encode_ndd(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags) { + attributes->set_is_evex_instruction(); + return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, attributes, /* src_is_gpr */ true, /* nds_is_ndd */ true, no_flags); +} + +int Assembler::evex_prefix_and_encode_nf(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags) { + attributes->set_is_evex_instruction(); + return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, attributes, /* src_is_gpr */ true, /* nds_is_ndd */ false, no_flags); +} + void Assembler::simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { if (UseAVX > 0) { @@ -12818,6 +13568,12 @@ void Assembler::incl(Register dst) { emit_int8(0x40 | dst->encoding()); } +void Assembler::eincl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x40 | src->encoding()); +} + void Assembler::lea(Register dst, Address src) { leal(dst, src); } @@ -13442,29 +14198,68 @@ void Assembler::addq(Address dst, int32_t imm32) { emit_arith_operand(0x81, rax, dst, imm32); } +void Assembler::eaddq(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rax, src, imm32); +} + void Assembler::addq(Address dst, Register src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst, src), 0x01); emit_operand(src, dst, 0); } +void Assembler::eaddq(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x01); + emit_operand(src2, src1, 0); +} + void Assembler::addq(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith(0x81, 0xC0, dst, imm32); } +void Assembler::eaddq(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xC0, src, imm32); +} + void Assembler::addq(Register dst, Address src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(src, dst), 0x03); emit_operand(dst, src, 0); } +void Assembler::eaddq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x03); + emit_operand(src1, src2, 0); +} + void Assembler::addq(Register dst, Register src) { (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x03, 0xC0, dst, src); } -void Assembler::adcxq(Register dst, Register src) { +void Assembler::eaddq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x01, 0xC0, src1, src2); +} + +void Assembler::adcxq(Register dst, Register src) { //assert(VM_Version::supports_adx(), "adx instructions not supported"); if (needs_rex2(dst, src)) { InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -13480,6 +14275,12 @@ void Assembler::adcxq(Register dst, Register src) { } } +void Assembler::eadcxq(Register dst, Register src1, Register src2) { + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3C, &attributes); + emit_int16((unsigned char)0x66, (0xC0 | encode)); +} + void Assembler::adoxq(Register dst, Register src) { //assert(VM_Version::supports_adx(), "adx instructions not supported"); if (needs_rex2(dst, src)) { @@ -13495,34 +14296,80 @@ void Assembler::adoxq(Register dst, Register src) { (0xC0 | encode)); } } + +void Assembler::eadoxq(Register dst, Register src1, Register src2) { + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_3C, &attributes); + emit_int16((unsigned char)0x66, (0xC0 | encode)); +} + void Assembler::andq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); emit_arith_operand(0x81, as_Register(4), dst, imm32); } +void Assembler::eandq(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, as_Register(4), src, imm32); +} + void Assembler::andq(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith(0x81, 0xE0, dst, imm32); } +void Assembler::eandq(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xE0, src, imm32); +} + void Assembler::andq(Register dst, Address src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(src, dst), 0x23); emit_operand(dst, src, 0); } +void Assembler::eandq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x23); + emit_operand(src1, src2, 0); +} + void Assembler::andq(Register dst, Register src) { (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x23, 0xC0, dst, src); } +void Assembler::eandq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x21, 0xC0, src1, src2); +} + void Assembler::andq(Address dst, Register src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst, src), 0x21); emit_operand(src, dst, 0); } +void Assembler::eandq(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x21); + emit_operand(src2, src1, 0); +} + void Assembler::andnq(Register dst, Register src1, Register src2) { assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -13656,6 +14503,12 @@ void Assembler::cmovq(Condition cc, Register dst, Register src) { emit_opcode_prefix_and_encoding((0x40 | cc), 0xC0, encode); } +void Assembler::ecmovq(Condition cc, Register dst, Register src1, Register src2) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int16((0x40 | cc), (0xC0 | encode)); +} + void Assembler::cmovq(Condition cc, Register dst, Address src) { InstructionMark im(this); int prefix = get_prefixq(src, dst, true /* is_map1 */); @@ -13663,6 +14516,15 @@ void Assembler::cmovq(Condition cc, Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::ecmovq(Condition cc, Register dst, Register src1, Address src2) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int8((0x40 | cc)); + emit_operand(src1, src2, 0); +} + void Assembler::cmpq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); @@ -13764,6 +14626,12 @@ void Assembler::decl(Register dst) { emit_int16((unsigned char)0xFF, (0xC8 | encode)); } +void Assembler::edecl(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xFF, (0xC8 | encode)); +} + void Assembler::decq(Register dst) { // Don't use it directly. Use MacroAssembler::decrementq() instead. // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) @@ -13771,6 +14639,12 @@ void Assembler::decq(Register dst) { emit_int16((unsigned char)0xFF, 0xC8 | encode); } +void Assembler::edecq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xFF, (0xC8 | encode)); +} + void Assembler::decq(Address dst) { // Don't use it directly. Use MacroAssembler::decrementq() instead. InstructionMark im(this); @@ -13778,6 +14652,15 @@ void Assembler::decq(Address dst) { emit_operand(rcx, dst, 0); } +void Assembler::edecq(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xFF); + emit_operand(rcx, src, 0); +} + // can't use REX2 void Assembler::fxrstor(Address src) { InstructionMark im(this); @@ -13811,21 +14694,51 @@ void Assembler::idivq(Register src) { emit_int16((unsigned char)0xF7, (0xF8 | encode)); } +void Assembler::eidivq(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xF8 | encode)); +} + void Assembler::divq(Register src) { int encode = prefixq_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xF0 | encode)); } +void Assembler::edivq(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xF0 | encode)); +} + void Assembler::imulq(Register dst, Register src) { int encode = prefixq_and_encode(dst->encoding(), src->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xAF, 0xC0, encode); } +void Assembler::eimulq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xAF, (0xC0 | encode)); +} + +void Assembler::eimulq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xAF, (0xC0 | encode)); +} + void Assembler::imulq(Register src) { int encode = prefixq_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xE8 | encode)); } +void Assembler::eimulq(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xE8 | encode)); +} + void Assembler::imulq(Register dst, Address src, int32_t value) { InstructionMark im(this); prefixq(src, dst); @@ -13840,6 +14753,22 @@ void Assembler::imulq(Register dst, Address src, int32_t value) { } } +void Assembler::eimulq(Register dst, Address src, int32_t value, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (is8bit(value)) { + emit_int8((unsigned char)0x6B); + emit_operand(dst, src, 1); + emit_int8(value); + } else { + emit_int8((unsigned char)0x69); + emit_operand(dst, src, 4); + emit_int32(value); + } +} + void Assembler::imulq(Register dst, Register src, int value) { int encode = prefixq_and_encode(dst->encoding(), src->encoding()); if (is8bit(value)) { @@ -13850,6 +14779,17 @@ void Assembler::imulq(Register dst, Register src, int value) { } } +void Assembler::eimulq(Register dst, Register src, int value, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, /* src_is_gpr */ true, /* nds_is_ndd */ false, no_flags); + if (is8bit(value)) { + emit_int24(0x6B, (0xC0 | encode), (value & 0xFF)); + } else { + emit_int16(0x69, (0xC0 | encode)); + emit_int32(value); + } +} + void Assembler::imulq(Register dst, Address src) { InstructionMark im(this); int prefix = get_prefixq(src, dst, true /* is_map1 */); @@ -13857,6 +14797,23 @@ void Assembler::imulq(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::eimulq(Register dst, Address src, bool no_flags) { + InstructionMark im(this); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes, /* nds_is_ndd */ false, no_flags); + emit_int8((unsigned char)0xAF); + emit_operand(dst, src, 0); +} + +void Assembler::eimulq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_32bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xAF); + emit_operand(src1, src2, 0); +} + void Assembler::incl(Register dst) { // Don't use it directly. Use MacroAssembler::incrementl() instead. // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) @@ -13864,6 +14821,15 @@ void Assembler::incl(Register dst) { emit_int16((unsigned char)0xFF, (0xC0 | encode)); } +void Assembler::eincl(Register dst, Register src, bool no_flags) { + // Don't use it directly. Use MacroAssembler::incrementl() instead. + // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + // int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xFF, (0xC0 | encode)); +} + void Assembler::incq(Register dst) { // Don't use it directly. Use MacroAssembler::incrementq() instead. // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) @@ -13871,6 +14837,14 @@ void Assembler::incq(Register dst) { emit_int16((unsigned char)0xFF, (0xC0 | encode)); } +void Assembler::eincq(Register dst, Register src, bool no_flags) { + // Don't use it directly. Use MacroAssembler::incrementq() instead. + // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xFF, (0xC0 | encode)); +} + void Assembler::incq(Address dst) { // Don't use it directly. Use MacroAssembler::incrementq() instead. InstructionMark im(this); @@ -13878,6 +14852,16 @@ void Assembler::incq(Address dst) { emit_operand(rax, dst, 0); } +void Assembler::eincq(Register dst, Address src, bool no_flags) { + // Don't use it directly. Use MacroAssembler::incrementq() instead. + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char) 0xFF); + emit_operand(rax, src, 0); +} + void Assembler::lea(Register dst, Address src) { leaq(dst, src); } @@ -13946,6 +14930,13 @@ void Assembler::lzcntq(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xBD, 0xC0, encode); } +void Assembler::elzcntq(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF5, (0xC0 | encode)); +} + void Assembler::lzcntq(Register dst, Address src) { assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); InstructionMark im(this); @@ -13955,6 +14946,16 @@ void Assembler::lzcntq(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::elzcntq(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF5); + emit_operand(dst, src, 0); +} + void Assembler::movdq(XMMRegister dst, Register src) { // table D-1 says MMX/SSE2 NOT_LP64(assert(VM_Version::supports_sse2(), "")); @@ -14077,11 +15078,26 @@ void Assembler::mulq(Address src) { emit_operand(rsp, src, 0); } +void Assembler::emulq(Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_nf(src, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0xF7); + emit_operand(rsp, src, 0); +} + void Assembler::mulq(Register src) { int encode = prefixq_and_encode(src->encoding()); emit_int16((unsigned char)0xF7, (0xE0 | encode)); } +void Assembler::emulq(Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(0, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xE0 | encode)); +} + void Assembler::mulxq(Register dst1, Register dst2, Register src) { assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -14094,17 +15110,38 @@ void Assembler::negq(Register dst) { emit_int16((unsigned char)0xF7, (0xD8 | encode)); } +void Assembler::enegq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xF7, (0xD8 | encode)); +} + void Assembler::negq(Address dst) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0xF7); emit_operand(as_Register(3), dst, 0); } +void Assembler::enegq(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xF7); + emit_operand(as_Register(3), src, 0); +} + void Assembler::notq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xF7, (0xD0 | encode)); } +void Assembler::enotq(Register dst, Register src) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + emit_int16((unsigned char)0xF7, (0xD0 | encode)); +} + void Assembler::btq(Register dst, Register src) { int encode = prefixq_and_encode(src->encoding(), dst->encoding(), true /* is_map1 */); emit_opcode_prefix_and_encoding((unsigned char)0xA3, 0xC0, encode); @@ -14141,33 +15178,78 @@ void Assembler::orq(Address dst, int32_t imm32) { emit_arith_operand(0x81, as_Register(1), dst, imm32); } +void Assembler::eorq(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, as_Register(1), src, imm32); +} + void Assembler::orq(Address dst, Register src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst, src), (unsigned char)0x09); emit_operand(src, dst, 0); } +void Assembler::eorq(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x09); + emit_operand(src2, src1, 0); +} + void Assembler::orq(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith(0x81, 0xC8, dst, imm32); } +void Assembler::eorq(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xC8, src, imm32); +} + void Assembler::orq_imm32(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith_imm32(0x81, 0xC8, dst, imm32); } +void Assembler::eorq_imm32(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_imm32(0x81, 0xC8, src, imm32); +} + void Assembler::orq(Register dst, Address src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(src, dst), 0x0B); emit_operand(dst, src, 0); } +void Assembler::eorq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x0B); + emit_operand(src1, src2, 0); +} + void Assembler::orq(Register dst, Register src) { (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x0B, 0xC0, dst, src); } +void Assembler::eorq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x09, 0xC0, src1, src2); +} + void Assembler::popcntq(Register dst, Address src) { assert(VM_Version::supports_popcnt(), "must support"); InstructionMark im(this); @@ -14176,6 +15258,16 @@ void Assembler::popcntq(Register dst, Address src) { emit_operand(dst, src, 0); } +void Assembler::epopcntq(Register dst, Address src, bool no_flags) { + assert(VM_Version::supports_popcnt(), "must support"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_nf(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char) 0x88); + emit_operand(dst, src, 0); +} + void Assembler::popcntq(Register dst, Register src) { assert(VM_Version::supports_popcnt(), "must support"); emit_int8((unsigned char)0xF3); @@ -14183,6 +15275,13 @@ void Assembler::popcntq(Register dst, Register src) { emit_opcode_prefix_and_encoding((unsigned char)0xB8, 0xC0, encode); } +void Assembler::epopcntq(Register dst, Register src, bool no_flags) { + assert(VM_Version::supports_popcnt(), "must support"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_nf(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0x88, (0xC0 | encode)); +} + void Assembler::popq(Address dst) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0x8F); @@ -14401,6 +15500,17 @@ void Assembler::rclq(Register dst, int imm8) { } } +void Assembler::erclq(Register dst, Register src, int imm8) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xD0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xD0 | encode), imm8); + } +} + void Assembler::rcrq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -14411,6 +15521,17 @@ void Assembler::rcrq(Register dst, int imm8) { } } +void Assembler::ercrq(Register dst, Register src, int imm8) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xD8 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xD8 | encode), imm8); + } +} + void Assembler::rorxl(Register dst, Register src, int imm8) { assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -14462,12 +15583,38 @@ void Assembler::salq(Address dst, int imm8) { } } +void Assembler::esalq(Register dst, Address src, int imm8, bool no_flags) { + InstructionMark im(this); + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(4), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(4), src, 1); + emit_int8(imm8); + } +} + void Assembler::salq(Address dst) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0xD3); emit_operand(as_Register(4), dst, 0); } +void Assembler::esalq(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(4), src, 0); +} + void Assembler::salq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -14478,11 +15625,28 @@ void Assembler::salq(Register dst, int imm8) { } } +void Assembler::esalq(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xE0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xE0 | encode), imm8); + } +} + void Assembler::salq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xE0 | encode)); } +void Assembler::esalq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE0 | encode)); +} + void Assembler::sarq(Address dst, int imm8) { InstructionMark im(this); assert(isShiftCount(imm8 >> 1), "illegal shift count"); @@ -14497,12 +15661,38 @@ void Assembler::sarq(Address dst, int imm8) { } } +void Assembler::esarq(Register dst, Address src, int imm8, bool no_flags) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(7), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(7), src, 1); + emit_int8(imm8); + } +} + void Assembler::sarq(Address dst) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0xD3); emit_operand(as_Register(7), dst, 0); } +void Assembler::esarq(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(7), src, 0); +} + void Assembler::sarq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -14513,10 +15703,26 @@ void Assembler::sarq(Register dst, int imm8) { } } +void Assembler::esarq(Register dst, Register src, int imm8, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xF8 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xF8 | encode), imm8); + } +} + void Assembler::sarq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xF8 | encode)); } + +void Assembler::esarq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xF8 | encode)); +} #endif void Assembler::sbbq(Address dst, int32_t imm32) { @@ -14551,11 +15757,28 @@ void Assembler::shlq(Register dst, int imm8) { } } +void Assembler::eshlq(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1 ) { + emit_int16((unsigned char)0xD1, (0xE0 | encode)); + } else { + emit_int24((unsigned char)0xC1, (0xE0 | encode), imm8); + } +} + void Assembler::shlq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, (0xE0 | encode)); } +void Assembler::eshlq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE0 | encode)); +} + void Assembler::shrq(Register dst, int imm8) { assert(isShiftCount(imm8 >> 1), "illegal shift count"); int encode = prefixq_and_encode(dst->encoding()); @@ -14567,17 +15790,44 @@ void Assembler::shrq(Register dst, int imm8) { } } +void Assembler::eshrq(Register dst, Register src, int imm8, bool no_flags) { + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int16((unsigned char)0xD1, (0xE8 | encode)); + } + else { + emit_int24((unsigned char)0xC1, (0xE8 | encode), imm8); + } +} + void Assembler::shrq(Register dst) { int encode = prefixq_and_encode(dst->encoding()); emit_int16((unsigned char)0xD3, 0xE8 | encode); } +void Assembler::eshrq(Register dst, Register src, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int16((unsigned char)0xD3, (0xE8 | encode)); +} + void Assembler::shrq(Address dst) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0xD3); emit_operand(as_Register(5), dst, 0); } +void Assembler::eshrq(Register dst, Address src, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8((unsigned char)0xD3); + emit_operand(as_Register(5), src, 0); +} + void Assembler::shrq(Address dst, int imm8) { InstructionMark im(this); assert(isShiftCount(imm8 >> 1), "illegal shift count"); @@ -14592,40 +15842,102 @@ void Assembler::shrq(Address dst, int imm8) { } } +void Assembler::eshrq(Register dst, Address src, int imm8, bool no_flags) { + InstructionMark im(this); + assert(isShiftCount(imm8 >> 1), "illegal shift count"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + if (imm8 == 1) { + emit_int8((unsigned char)0xD1); + emit_operand(as_Register(5), src, 0); + } + else { + emit_int8((unsigned char)0xC1); + emit_operand(as_Register(5), src, 1); + emit_int8(imm8); + } +} + void Assembler::subq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); emit_arith_operand(0x81, rbp, dst, imm32); } +void Assembler::esubq(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, rbp, src, imm32); +} + void Assembler::subq(Address dst, Register src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst, src), 0x29); emit_operand(src, dst, 0); } +void Assembler::esubq(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x29); + emit_operand(src2, src1, 0); +} + void Assembler::subq(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith(0x81, 0xE8, dst, imm32); } +void Assembler::esubq(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xE8, src, imm32); +} + // Force generation of a 4 byte immediate value even if it fits into 8bit void Assembler::subq_imm32(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith_imm32(0x81, 0xE8, dst, imm32); } +void Assembler::esubq_imm32(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_imm32(0x81, 0xE8, src, imm32); +} + void Assembler::subq(Register dst, Address src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(src, dst), 0x2B); emit_operand(dst, src, 0); } +void Assembler::esubq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x2B); + emit_operand(src1, src2, 0); +} + void Assembler::subq(Register dst, Register src) { (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x2B, 0xC0, dst, src); } +void Assembler::esubq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x29, 0xC0, src1, src2); +} + void Assembler::testq(Address dst, int32_t imm32) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst), (unsigned char)0xF7); @@ -14683,29 +15995,77 @@ void Assembler::xorq(Register dst, Register src) { emit_arith(0x33, 0xC0, dst, src); } +void Assembler::exorq(Register dst, Register src1, Register src2, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + (void) evex_prefix_and_encode_ndd(src1->encoding(), dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + // opcode matches gcc + emit_arith(0x31, 0xC0, src1, src2); +} + void Assembler::xorq(Register dst, Address src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(src, dst), 0x33); emit_operand(dst, src, 0); } +void Assembler::exorq(Register dst, Register src1, Address src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src2, dst->encoding(), src1->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x33); + emit_operand(src1, src2, 0); +} + void Assembler::xorq(Register dst, int32_t imm32) { (void) prefixq_and_encode(dst->encoding()); emit_arith(0x81, 0xF0, dst, imm32); } +void Assembler::exorq(Register dst, Register src, int32_t imm32, bool no_flags) { + InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + evex_prefix_and_encode_ndd(0, dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith(0x81, 0xF0, src, imm32); +} + void Assembler::xorq(Address dst, int32_t imm32) { InstructionMark im(this); prefixq(dst); emit_arith_operand(0x81, as_Register(6), dst, imm32); } +void Assembler::exorq(Register dst, Address src, int32_t imm32, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src, dst->encoding(), 0, VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_arith_operand(0x81, as_Register(6), src, imm32); +} + void Assembler::xorq(Address dst, Register src) { InstructionMark im(this); emit_prefix_and_int8(get_prefixq(dst, src), 0x31); emit_operand(src, dst, 0); } +void Assembler::esetzucc(Condition cc, Register dst) { + assert(VM_Version::supports_apx_f(), ""); + assert(0 <= cc && cc < 16, "illegal cc"); + InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + // Encoding Format : eevex_prefix (4 bytes) | opcode_cc | modrm + int encode = evex_prefix_and_encode_ndd(0, 0, dst->encoding(), VEX_SIMD_F2, /* MAP4 */VEX_OPCODE_0F_3C, &attributes); + emit_opcode_prefix_and_encoding((0x40 | cc), 0xC0, encode); +} + +void Assembler::exorq(Register dst, Address src1, Register src2, bool no_flags) { + 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_NOSCALE, /* input_size_in_bits */ EVEX_64bit); + evex_prefix_ndd(src1, dst->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3C, &attributes, no_flags); + emit_int8(0x31); + emit_operand(src2, src1, 0); +} + #endif // !LP64 void InstructionAttr::set_address_attributes(int tuple_type, int input_size_in_bits) { diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 9d1a12ca8e5c8..62700d1fa1bd5 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -789,14 +789,26 @@ class Assembler : public AbstractAssembler { void vex_prefix(bool vex_r, bool vex_b, bool vex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc); void evex_prefix(bool vex_r, bool vex_b, bool vex_x, bool evex_v, bool evex_r, bool evex_b, - bool eevex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc); + bool eevex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc, bool no_flags = false); + + void evex_prefix_ndd(Address adr, int ndd_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags = false); + + void evex_prefix_nf(Address adr, int ndd_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags = false); void vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, - InstructionAttr *attributes); + InstructionAttr *attributes, bool nds_is_ndd = false, bool no_flags = false); int vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, - InstructionAttr *attributes, bool src_is_gpr = false); + InstructionAttr *attributes, bool src_is_gpr = false, bool nds_is_ndd = false, bool no_flags = false); + + int evex_prefix_and_encode_ndd(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags = false); + + int evex_prefix_and_encode_nf(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, + InstructionAttr *attributes, bool no_flags = false); void simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes); @@ -941,13 +953,20 @@ class Assembler : public AbstractAssembler { // the product flag UseIncDec value. void decl(Register dst); + void edecl(Register dst, Register src, bool no_flags); void decl(Address dst); + void edecl(Register dst, Address src, bool no_flags); void decq(Address dst); + void edecq(Register dst, Address src, bool no_flags); void incl(Register dst); + void eincl(Register dst, Register src, bool no_flags); void incl(Address dst); + void eincl(Register dst, Address src, bool no_flags); void incq(Register dst); + void eincq(Register dst, Register src, bool no_flags); void incq(Address dst); + void eincq(Register dst, Address src, bool no_flags); // New cpus require use of movsd and movss to avoid partial register stall // when loading from memory. But for old Opteron use movlpd instead of movsd. @@ -1020,7 +1039,7 @@ class Assembler : public AbstractAssembler { void pusha_uncached(); void popa_uncached(); - // APX ISA extensions for register save/restore optimizations. + // APX ISA Extensions for register save/restore optimizations. void push2(Register src1, Register src2, bool with_ppx = false); void pop2(Register src1, Register src2, bool with_ppx = false); void push2p(Register src1, Register src2); @@ -1028,9 +1047,13 @@ class Assembler : public AbstractAssembler { void pushp(Register src); void popp(Register src); + // New Zero Upper setcc instruction. + void esetzucc(Condition cc, Register dst); + #endif void vzeroupper_uncached(); void decq(Register dst); + void edecq(Register dst, Register src, bool no_flags); void pusha(); void popa(); @@ -1072,23 +1095,35 @@ class Assembler : public AbstractAssembler { void addw(Address dst, Register src); void addl(Address dst, int32_t imm32); + void eaddl(Register dst, Address src, int32_t imm32, bool no_flags); void addl(Address dst, Register src); + void eaddl(Register dst, Address src1, Register src2, bool no_flags); void addl(Register dst, int32_t imm32); + void eaddl(Register dst, Register src, int32_t imm32, bool no_flags); void addl(Register dst, Address src); + void eaddl(Register dst, Register src1, Address src2, bool no_flags); void addl(Register dst, Register src); + void eaddl(Register dst, Register src1, Register src2, bool no_flags); void addq(Address dst, int32_t imm32); + void eaddq(Register dst, Address src, int32_t imm32, bool no_flags); void addq(Address dst, Register src); + void eaddq(Register dst, Address src1, Register src2, bool no_flags); void addq(Register dst, int32_t imm32); + void eaddq(Register dst, Register src, int32_t imm32, bool no_flags); void addq(Register dst, Address src); + void eaddq(Register dst, Register src1, Address src2, bool no_flags); void addq(Register dst, Register src); + void eaddq(Register dst, Register src1, Register src2, bool no_flags); #ifdef _LP64 //Add Unsigned Integers with Carry Flag void adcxq(Register dst, Register src); + void eadcxq(Register dst, Register src1, Register src2); //Add Unsigned Integers with Overflow Flag void adoxq(Register dst, Register src); + void eadoxq(Register dst, Register src1, Register src2); #endif void addr_nop_4(); @@ -1122,16 +1157,25 @@ class Assembler : public AbstractAssembler { void andb(Address dst, Register src); void andl(Address dst, int32_t imm32); + void eandl(Register dst, Address src, int32_t imm32, bool no_flags); void andl(Register dst, int32_t imm32); + void eandl(Register dst, Register src, int32_t imm32, bool no_flags); void andl(Register dst, Address src); + void eandl(Register dst, Register src1, Address src2, bool no_flags); void andl(Register dst, Register src); + void eandl(Register dst, Register src1, Register src2, bool no_flags); void andl(Address dst, Register src); void andq(Address dst, int32_t imm32); + void eandq(Register dst, Address src, int32_t imm32, bool no_flags); void andq(Register dst, int32_t imm32); + void eandq(Register dst, Register src, int32_t imm32, bool no_flags); void andq(Register dst, Address src); + void eandq(Register dst, Register src1, Address src2, bool no_flags); void andq(Register dst, Register src); + void eandq(Register dst, Register src1, Register src2, bool no_flags); void andq(Address dst, Register src); + void eandq(Register dst, Address src1, Register src2, bool no_flags); // BMI instructions void andnl(Register dst, Register src1, Register src2); @@ -1182,10 +1226,14 @@ class Assembler : public AbstractAssembler { void clwb(Address adr); void cmovl(Condition cc, Register dst, Register src); + void ecmovl(Condition cc, Register dst, Register src1, Register src2); void cmovl(Condition cc, Register dst, Address src); + void ecmovl(Condition cc, Register dst, Register src1, Address src2); void cmovq(Condition cc, Register dst, Register src); + void ecmovq(Condition cc, Register dst, Register src1, Register src2); void cmovq(Condition cc, Register dst, Address src); + void ecmovq(Condition cc, Register dst, Register src1, Address src2); void cmpb(Address dst, int imm8); @@ -1488,25 +1536,41 @@ class Assembler : public AbstractAssembler { void hlt(); void idivl(Register src); + void eidivl(Register src, bool no_flags); void divl(Register src); // Unsigned division + void edivl(Register src, bool no_flags); // Unsigned division #ifdef _LP64 void idivq(Register src); + void eidivq(Register src, bool no_flags); void divq(Register src); // Unsigned division + void edivq(Register src, bool no_flags); // Unsigned division #endif void imull(Register src); + void eimull(Register src, bool no_flags); void imull(Register dst, Register src); + void eimull(Register dst, Register src1, Register src2, bool no_flags); void imull(Register dst, Register src, int value); + void eimull(Register dst, Register src, int value, bool no_flags); void imull(Register dst, Address src, int value); + void eimull(Register dst, Address src, int value, bool no_flags); void imull(Register dst, Address src); + void eimull(Register dst, Register src1, Address src2, bool no_flags); #ifdef _LP64 void imulq(Register dst, Register src); + void eimulq(Register dst, Register src, bool no_flags); + void eimulq(Register dst, Register src1, Register src2, bool no_flags); void imulq(Register dst, Register src, int value); + void eimulq(Register dst, Register src, int value, bool no_flags); void imulq(Register dst, Address src, int value); + void eimulq(Register dst, Address src, int value, bool no_flags); void imulq(Register dst, Address src); + void eimulq(Register dst, Address src, bool no_flags); + void eimulq(Register dst, Register src1, Address src2, bool no_flags); void imulq(Register dst); + void eimulq(Register dst, bool no_flags); #endif // jcc is the generic conditional branch generator to run- @@ -1565,11 +1629,15 @@ class Assembler : public AbstractAssembler { void size_prefix(); void lzcntl(Register dst, Register src); + void elzcntl(Register dst, Register src, bool no_flags); void lzcntl(Register dst, Address src); + void elzcntl(Register dst, Address src, bool no_flags); #ifdef _LP64 void lzcntq(Register dst, Register src); + void elzcntq(Register dst, Register src, bool no_flags); void lzcntq(Register dst, Address src); + void elzcntq(Register dst, Address src, bool no_flags); #endif enum Membar_mask_bits { @@ -1785,11 +1853,15 @@ class Assembler : public AbstractAssembler { // Unsigned multiply with RAX destination register void mull(Address src); + void emull(Address src, bool no_flags); void mull(Register src); + void emull(Register src, bool no_flags); #ifdef _LP64 void mulq(Address src); + void emulq(Address src, bool no_flags); void mulq(Register src); + void emulq(Register src, bool no_flags); void mulxq(Register dst1, Register dst2, Register src); #endif @@ -1802,19 +1874,25 @@ class Assembler : public AbstractAssembler { void mulss(XMMRegister dst, XMMRegister src); void negl(Register dst); + void enegl(Register dst, Register src, bool no_flags); void negl(Address dst); + void enegl(Register dst, Address src, bool no_flags); #ifdef _LP64 void negq(Register dst); + void enegq(Register dst, Register src, bool no_flags); void negq(Address dst); + void enegq(Register dst, Address src, bool no_flags); #endif void nop(uint i = 1); void notl(Register dst); + void enotl(Register dst, Register src); #ifdef _LP64 void notq(Register dst); + void enotq(Register dst, Register src); void btsq(Address dst, int imm8); void btrq(Address dst, int imm8); @@ -1822,21 +1900,37 @@ class Assembler : public AbstractAssembler { #endif void btq(Register dst, Register src); + void orw(Register dst, Register src); + void eorw(Register dst, Register src1, Register src2, bool no_flags); + void orl(Address dst, int32_t imm32); + void eorl(Register dst, Address src, int32_t imm32, bool no_flags); void orl(Register dst, int32_t imm32); + void eorl(Register dst, Register src, int32_t imm32, bool no_flags); void orl(Register dst, Address src); + void eorl(Register dst, Register src1, Address src2, bool no_flags); void orl(Register dst, Register src); + void eorl(Register dst, Register src1, Register src2, bool no_flags); void orl(Address dst, Register src); + void eorl(Register dst, Address src1, Register src2, bool no_flags); void orb(Address dst, int imm8); + void eorb(Register dst, Address src, int imm8, bool no_flags); void orb(Address dst, Register src); + void eorb(Register dst, Address src1, Register src2, bool no_flags); void orq(Address dst, int32_t imm32); + void eorq(Register dst, Address src, int32_t imm32, bool no_flags); void orq(Address dst, Register src); + void eorq(Register dst, Address src1, Register src2, bool no_flags); void orq(Register dst, int32_t imm32); + void eorq(Register dst, Register src, int32_t imm32, bool no_flags); void orq_imm32(Register dst, int32_t imm32); + void eorq_imm32(Register dst, Register src, int32_t imm32, bool no_flags); void orq(Register dst, Address src); + void eorq(Register dst, Register src1, Address src2, bool no_flags); void orq(Register dst, Register src); + void eorq(Register dst, Register src1, Register src2, bool no_flags); // Pack with signed saturation void packsswb(XMMRegister dst, XMMRegister src); @@ -2022,7 +2116,9 @@ class Assembler : public AbstractAssembler { #endif void popcntl(Register dst, Address src); + void epopcntl(Register dst, Address src, bool no_flags); void popcntl(Register dst, Register src); + void epopcntl(Register dst, Register src, bool no_flags); void evpopcntb(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); void evpopcntw(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); @@ -2031,7 +2127,9 @@ class Assembler : public AbstractAssembler { #ifdef _LP64 void popcntq(Register dst, Address src); + void epopcntq(Register dst, Address src, bool no_flags); void popcntq(Register dst, Register src); + void epopcntq(Register dst, Register src, bool no_flags); #endif // Prefetches (SSE, SSE2, 3DNOW only) @@ -2131,10 +2229,13 @@ class Assembler : public AbstractAssembler { void pushq(Address src); void rcll(Register dst, int imm8); + void ercll(Register dst, Register src, int imm8); void rclq(Register dst, int imm8); + void erclq(Register dst, Register src, int imm8); void rcrq(Register dst, int imm8); + void ercrq(Register dst, Register src, int imm8); void rcpps(XMMRegister dst, XMMRegister src); @@ -2145,18 +2246,26 @@ class Assembler : public AbstractAssembler { void ret(int imm16); void roll(Register dst); + void eroll(Register dst, Register src, bool no_flags); void roll(Register dst, int imm8); + void eroll(Register dst, Register src, int imm8, bool no_flags); void rorl(Register dst); + void erorl(Register dst, Register src, bool no_flags); void rorl(Register dst, int imm8); + void erorl(Register dst, Register src, int imm8, bool no_flags); #ifdef _LP64 void rolq(Register dst); + void erolq(Register dst, Register src, bool no_flags); void rolq(Register dst, int imm8); + void erolq(Register dst, Register src, int imm8, bool no_flags); void rorq(Register dst); + void erorq(Register dst, Register src, bool no_flags); void rorq(Register dst, int imm8); + void erorq(Register dst, Register src, int imm8, bool no_flags); void rorxl(Register dst, Register src, int imm8); void rorxl(Register dst, Address src, int imm8); void rorxq(Register dst, Register src, int imm8); @@ -2166,25 +2275,41 @@ class Assembler : public AbstractAssembler { void sahf(); void sall(Register dst, int imm8); + void esall(Register dst, Register src, int imm8, bool no_flags); void sall(Register dst); + void esall(Register dst, Register src, bool no_flags); void sall(Address dst, int imm8); + void esall(Register dst, Address src, int imm8, bool no_flags); void sall(Address dst); + void esall(Register dst, Address src, bool no_flags); void sarl(Address dst, int imm8); + void esarl(Register dst, Address src, int imm8, bool no_flags); void sarl(Address dst); + void esarl(Register dst, Address src, bool no_flags); void sarl(Register dst, int imm8); + void esarl(Register dst, Register src, int imm8, bool no_flags); void sarl(Register dst); + void esarl(Register dst, Register src, bool no_flags); #ifdef _LP64 void salq(Register dst, int imm8); + void esalq(Register dst, Register src, int imm8, bool no_flags); void salq(Register dst); + void esalq(Register dst, Register src, bool no_flags); void salq(Address dst, int imm8); + void esalq(Register dst, Address src, int imm8, bool no_flags); void salq(Address dst); + void esalq(Register dst, Address src, bool no_flags); void sarq(Address dst, int imm8); + void esarq(Register dst, Address src, int imm8, bool no_flags); void sarq(Address dst); + void esarq(Register dst, Address src, bool no_flags); void sarq(Register dst, int imm8); + void esarq(Register dst, Register src, int imm8, bool no_flags); void sarq(Register dst); + void esarq(Register dst, Register src, bool no_flags); #endif void sbbl(Address dst, int32_t imm32); @@ -2216,29 +2341,47 @@ class Assembler : public AbstractAssembler { void sha256msg2(XMMRegister dst, XMMRegister src); void shldl(Register dst, Register src); + void eshldl(Register dst, Register src1, Register src2, bool no_flags); void shldl(Register dst, Register src, int8_t imm8); + void eshldl(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags); void shrdl(Register dst, Register src); + void eshrdl(Register dst, Register src1, Register src2, bool no_flags); void shrdl(Register dst, Register src, int8_t imm8); + void eshrdl(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags); #ifdef _LP64 void shldq(Register dst, Register src, int8_t imm8); + void eshldq(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags); void shrdq(Register dst, Register src, int8_t imm8); + void eshrdq(Register dst, Register src1, Register src2, int8_t imm8, bool no_flags); #endif void shll(Register dst, int imm8); + void eshll(Register dst, Register src, int imm8, bool no_flags); void shll(Register dst); + void eshll(Register dst, Register src, bool no_flags); void shlq(Register dst, int imm8); + void eshlq(Register dst, Register src, int imm8, bool no_flags); void shlq(Register dst); + void eshlq(Register dst, Register src, bool no_flags); void shrl(Register dst, int imm8); + void eshrl(Register dst, Register src, int imm8, bool no_flags); void shrl(Register dst); + void eshrl(Register dst, Register src, bool no_flags); void shrl(Address dst); + void eshrl(Register dst, Address src, bool no_flags); void shrl(Address dst, int imm8); + void eshrl(Register dst, Address src, int imm8, bool no_flags); void shrq(Register dst, int imm8); + void eshrq(Register dst, Register src, int imm8, bool no_flags); void shrq(Register dst); + void eshrq(Register dst, Register src, bool no_flags); void shrq(Address dst); + void eshrq(Register dst, Address src, bool no_flags); void shrq(Address dst, int imm8); + void eshrq(Register dst, Address src, int imm8, bool no_flags); void smovl(); // QQQ generic? @@ -2258,20 +2401,32 @@ class Assembler : public AbstractAssembler { void stmxcsr( Address dst ); void subl(Address dst, int32_t imm32); + void esubl(Register dst, Address src, int32_t imm32, bool no_flags); void subl(Address dst, Register src); + void esubl(Register dst, Address src1, Register src2, bool no_flags); void subl(Register dst, int32_t imm32); + void esubl(Register dst, Register src, int32_t imm32, bool no_flags); void subl(Register dst, Address src); + void esubl(Register dst, Register src1, Address src2, bool no_flags); void subl(Register dst, Register src); + void esubl(Register dst, Register src1, Register src2, bool no_flags); void subq(Address dst, int32_t imm32); + void esubq(Register dst, Address src, int32_t imm32, bool no_flags); void subq(Address dst, Register src); + void esubq(Register dst, Address src1, Register src2, bool no_flags); void subq(Register dst, int32_t imm32); + void esubq(Register dst, Register src, int32_t imm32, bool no_flags); void subq(Register dst, Address src); + void esubq(Register dst, Register src1, Address src2, bool no_flags); void subq(Register dst, Register src); + void esubq(Register dst, Register src1, Register src2, bool no_flags); // Force generation of a 4 byte immediate value even if it fits into 8bit void subl_imm32(Register dst, int32_t imm32); + void esubl_imm32(Register dst, Register src, int32_t imm32, bool no_flags); void subq_imm32(Register dst, int32_t imm32); + void esubq_imm32(Register dst, Register src, int32_t imm32, bool no_flags); // Subtract Scalar Double-Precision Floating-Point Values void subsd(XMMRegister dst, Address src); @@ -2296,9 +2451,13 @@ class Assembler : public AbstractAssembler { // BMI - count trailing zeros void tzcntl(Register dst, Register src); + void etzcntl(Register dst, Register src, bool no_flags); void tzcntl(Register dst, Address src); + void etzcntl(Register dst, Address src, bool no_flags); void tzcntq(Register dst, Register src); + void etzcntq(Register dst, Register src, bool no_flags); void tzcntq(Register dst, Address src); + void etzcntq(Register dst, Address src, bool no_flags); // Unordered Compare Scalar Double-Precision Floating-Point Values and set EFLAGS void ucomisd(XMMRegister dst, Address src); @@ -2331,20 +2490,33 @@ class Assembler : public AbstractAssembler { void xgetbv(); void xorl(Register dst, int32_t imm32); + void exorl(Register dst, Register src, int32_t imm32, bool no_flags); void xorl(Address dst, int32_t imm32); + void exorl(Register dst, Address src, int32_t imm32, bool no_flags); void xorl(Register dst, Address src); + void exorl(Register dst, Register src1, Address src2, bool no_flags); void xorl(Register dst, Register src); + void exorl(Register dst, Register src1, Register src2, bool no_flags); void xorl(Address dst, Register src); + void exorl(Register dst, Address src1, Register src2, bool no_flags); void xorb(Address dst, Register src); + void exorb(Register dst, Address src1, Register src2, bool no_flags); void xorb(Register dst, Address src); + void exorb(Register dst, Register src1, Address src2, bool no_flags); void xorw(Register dst, Address src); + void exorw(Register dst, Register src1, Address src2, bool no_flags); void xorq(Register dst, Address src); + void exorq(Register dst, Register src1, Address src2, bool no_flags); void xorq(Address dst, int32_t imm32); + void exorq(Register dst, Address src, int32_t imm32, bool no_flags); void xorq(Register dst, Register src); + void exorq(Register dst, Register src1, Register src2, bool no_flags); void xorq(Register dst, int32_t imm32); + void exorq(Register dst, Register src, int32_t imm32, bool no_flags); void xorq(Address dst, Register src); + void exorq(Register dst, Address src1, Register src2, bool no_flags); // AVX 3-operands scalar instructions (encoded with VEX prefix) @@ -2459,6 +2631,7 @@ class Assembler : public AbstractAssembler { // Bitwise Logical AND of Packed Floating-Point Values void andpd(XMMRegister dst, XMMRegister src); + void andnpd(XMMRegister dst, XMMRegister src); void andps(XMMRegister dst, XMMRegister src); void vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp index 7d89b148ba22f..71ca9351f86c9 100644 --- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp +++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -110,7 +110,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { Metadata *m = _method->as_constant_ptr()->as_metadata(); ce->store_parameter(m, 1); ce->store_parameter(_bci, 0); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::counter_overflow_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); __ jmp(_continuation); @@ -119,7 +119,7 @@ void CounterOverflowStub::emit_code(LIR_Assembler* ce) { void RangeCheckStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); if (_info->deoptimize_on_exception()) { - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -133,11 +133,11 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) { } else { ce->store_parameter(_index->as_jint(), 0); } - Runtime1::StubID stub_id; + C1StubId stub_id; if (_throw_index_out_of_bounds_exception) { - stub_id = Runtime1::throw_index_exception_id; + stub_id = C1StubId::throw_index_exception_id; } else { - stub_id = Runtime1::throw_range_check_failed_id; + stub_id = C1StubId::throw_range_check_failed_id; ce->store_parameter(_array->as_pointer_register(), 1); } __ call(RuntimeAddress(Runtime1::entry_for(stub_id))); @@ -152,7 +152,7 @@ PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { void PredicateFailedStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); - address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + address a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); __ call(RuntimeAddress(a)); ce->add_call_info_here(_info); ce->verify_oop_map(_info); @@ -164,7 +164,7 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); } __ bind(_entry); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::throw_div0_exception_id))); ce->add_call_info_here(_info); debug_only(__ should_not_reach_here()); } @@ -172,14 +172,14 @@ void DivByZeroStub::emit_code(LIR_Assembler* ce) { // Implementation of NewInstanceStub -NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id) { _result = result; _klass = klass; _klass_reg = klass_reg; _info = new CodeEmitInfo(info); - assert(stub_id == Runtime1::new_instance_id || - stub_id == Runtime1::fast_new_instance_id || - stub_id == Runtime1::fast_new_instance_init_check_id, + assert(stub_id == C1StubId::new_instance_id || + stub_id == C1StubId::fast_new_instance_id || + stub_id == C1StubId::fast_new_instance_init_check_id, "need new_instance id"); _stub_id = stub_id; } @@ -212,7 +212,7 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == rbx, "length must in rbx,"); assert(_klass_reg->as_register() == rdx, "klass_reg must in rdx"); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_type_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == rax, "result must in rax,"); @@ -235,7 +235,7 @@ void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(_length->as_register() == rbx, "length must in rbx,"); assert(_klass_reg->as_register() == rdx, "klass_reg must in rdx"); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::new_object_array_id))); ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == rax, "result must in rax,"); @@ -247,11 +247,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_obj_reg->as_register(), 1); ce->store_parameter(_lock_reg->as_register(), 0); - Runtime1::StubID enter_id; + C1StubId enter_id; if (ce->compilation()->has_fpu_code()) { - enter_id = Runtime1::monitorenter_id; + enter_id = C1StubId::monitorenter_id; } else { - enter_id = Runtime1::monitorenter_nofpu_id; + enter_id = C1StubId::monitorenter_nofpu_id; } __ call(RuntimeAddress(Runtime1::entry_for(enter_id))); ce->add_call_info_here(_info); @@ -268,11 +268,11 @@ void MonitorExitStub::emit_code(LIR_Assembler* ce) { } ce->store_parameter(_lock_reg->as_register(), 0); // note: non-blocking leaf routine => no call info needed - Runtime1::StubID exit_id; + C1StubId exit_id; if (ce->compilation()->has_fpu_code()) { - exit_id = Runtime1::monitorexit_id; + exit_id = C1StubId::monitorexit_id; } else { - exit_id = Runtime1::monitorexit_nofpu_id; + exit_id = C1StubId::monitorexit_nofpu_id; } __ call(RuntimeAddress(Runtime1::entry_for(exit_id))); __ jmp(_continuation); @@ -407,10 +407,10 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { address target = nullptr; relocInfo::relocType reloc_type = relocInfo::none; switch (_id) { - case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; - case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; - case load_mirror_id: target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; - case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; + case access_field_id: target = Runtime1::entry_for(C1StubId::access_field_patching_id); break; + case load_klass_id: target = Runtime1::entry_for(C1StubId::load_klass_patching_id); reloc_type = relocInfo::metadata_type; break; + case load_mirror_id: target = Runtime1::entry_for(C1StubId::load_mirror_patching_id); reloc_type = relocInfo::oop_type; break; + case load_appendix_id: target = Runtime1::entry_for(C1StubId::load_appendix_patching_id); reloc_type = relocInfo::oop_type; break; default: ShouldNotReachHere(); } __ bind(call_patch); @@ -440,7 +440,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); ce->store_parameter(_trap_request, 0); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::deoptimize_id))); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); } @@ -450,9 +450,9 @@ void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { address a; if (_info->deoptimize_on_exception()) { // Deoptimize, do not throw the exception, because it is probably wrong to do it here. - a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + a = Runtime1::entry_for(C1StubId::predicate_failed_trap_id); } else { - a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + a = Runtime1::entry_for(C1StubId::throw_null_pointer_exception_id); } ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index e2fde10b98d86..c3444d5a5abce 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -399,7 +399,7 @@ int LIR_Assembler::emit_exception_handler() { __ verify_not_null_oop(rax); // search an exception handler (rax: exception oop, rdx: throwing pc) - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::handle_exception_from_callee_id))); __ should_not_reach_here(); guarantee(code_offset() - offset <= exception_handler_size(), "overflow"); __ end_a_stub(); @@ -463,7 +463,7 @@ int LIR_Assembler::emit_unwind_handler() { // remove the activation and dispatch to the unwind handler __ remove_frame(initial_frame_size_in_bytes()); - __ jump(RuntimeAddress(Runtime1::entry_for(Runtime1::unwind_exception_id))); + __ jump(RuntimeAddress(Runtime1::entry_for(C1StubId::unwind_exception_id))); // Emit the slow path assembly if (stub != nullptr) { @@ -1566,7 +1566,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { // instruction sequence too long to inline it here { - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::fpu2long_stub_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::fpu2long_stub_id))); } break; #endif // _LP64 @@ -1781,7 +1781,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L #else __ pushklass(k->constant_encoding(), noreg); #endif // _LP64 - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ pop(klass_RInfo); __ pop(klass_RInfo); // result is a boolean @@ -1795,7 +1795,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L // call out-of-line instance of __ check_klass_subtype_slow_path(...): __ push(klass_RInfo); __ push(k_RInfo); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ pop(klass_RInfo); __ pop(k_RInfo); // result is a boolean @@ -1874,7 +1874,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { // call out-of-line instance of __ check_klass_subtype_slow_path(...): __ push(klass_RInfo); __ push(k_RInfo); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ pop(klass_RInfo); __ pop(k_RInfo); // result is a boolean @@ -2893,7 +2893,7 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit // exception object is not added to oop map by LinearScan // (LinearScan assumes that no oops are in fixed registers) info->add_register_oop(exceptionOop); - Runtime1::StubID unwind_id; + C1StubId unwind_id; // get current pc information // pc is only needed if the method has an exception handler, the unwind code does not need it. @@ -2905,9 +2905,9 @@ void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmit __ verify_not_null_oop(rax); // search an exception handler (rax: exception oop, rdx: throwing pc) if (compilation()->has_fpu_code()) { - unwind_id = Runtime1::handle_exception_id; + unwind_id = C1StubId::handle_exception_id; } else { - unwind_id = Runtime1::handle_exception_nofpu_id; + unwind_id = C1StubId::handle_exception_nofpu_id; } __ call(RuntimeAddress(Runtime1::entry_for(unwind_id))); @@ -3262,7 +3262,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { __ push(src); __ push(dst); - __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); + __ call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id))); __ pop(dst); __ pop(src); diff --git a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp index d3add6975b4f2..36e2021138f2e 100644 --- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp @@ -807,7 +807,11 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan || - x->id() == vmIntrinsics::_dlog10) { + x->id() == vmIntrinsics::_dlog10 +#ifdef _LP64 + || x->id() == vmIntrinsics::_dtanh +#endif + ) { do_LibmIntrinsic(x); return; } @@ -989,11 +993,17 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { break; case vmIntrinsics::_dtan: if (StubRoutines::dtan() != nullptr) { - __ call_runtime_leaf(StubRoutines::dtan(), getThreadTemp(), result_reg, cc->args()); + __ call_runtime_leaf(StubRoutines::dtan(), getThreadTemp(), result_reg, cc->args()); } else { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtan), getThreadTemp(), result_reg, cc->args()); } break; + case vmIntrinsics::_dtanh: + assert(StubRoutines::dtanh() != nullptr, "tanh intrinsic not found"); + if (StubRoutines::dtanh() != nullptr) { + __ call_runtime_leaf(StubRoutines::dtanh(), getThreadTemp(), result_reg, cc->args()); + } + break; default: ShouldNotReachHere(); } #endif // _LP64 @@ -1430,7 +1440,7 @@ void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { args->append(rank); args->append(varargs); LIR_Opr reg = result_register_for(x->type()); - __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + __ call_runtime(Runtime1::entry_for(C1StubId::new_multi_array_id), LIR_OprFact::illegalOpr, reg, args, info); @@ -1463,12 +1473,12 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == nullptr, "can't patch this"); - stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); } else if (x->is_invokespecial_receiver_check()) { assert(patching_info == nullptr, "can't patch this"); stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { - stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + stub = new SimpleExceptionStub(C1StubId::throw_class_cast_exception_id, obj.result(), info_for_exception); } LIR_Opr reg = rlock_result(x); LIR_Opr tmp3 = LIR_OprFact::illegalOpr; diff --git a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp index 4dcacd00a6339..bf5b90db5fcb0 100644 --- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp @@ -271,7 +271,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == rax, "must be"); - call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); @@ -309,7 +309,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1, if (CURRENT_ENV->dtrace_alloc_probes()) { assert(obj == rax, "must be"); - call(RuntimeAddress(Runtime1::entry_for(Runtime1::dtrace_object_alloc_id))); + call(RuntimeAddress(Runtime1::entry_for(C1StubId::dtrace_object_alloc_id))); } verify_oop(obj); diff --git a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp index 11b39ce15eb1a..1ccb06df48937 100644 --- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp +++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp @@ -60,7 +60,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre #ifdef _LP64 // At a method handle call, the stack may not be properly aligned // when returning with an exception. - align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id); + align_stack = (stub_id() == (int)C1StubId::handle_exception_from_callee_id); #endif #ifdef _LP64 @@ -124,10 +124,10 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre if (frame_size() == no_frame_size) { leave(); jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - } else if (_stub_id == Runtime1::forward_exception_id) { + } else if (_stub_id == (int)C1StubId::forward_exception_id) { should_not_reach_here(); } else { - jump(RuntimeAddress(Runtime1::entry_for(Runtime1::forward_exception_id))); + jump(RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id))); } bind(L); } @@ -671,7 +671,7 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe } -OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { +OopMapSet* Runtime1::generate_handle_exception(C1StubId id, StubAssembler *sasm) { __ block_comment("generate_handle_exception"); // incoming parameters @@ -684,7 +684,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { OopMapSet* oop_maps = new OopMapSet(); OopMap* oop_map = nullptr; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: // We're handling an exception in the context of a compiled frame. // The registers have been saved in the standard places. Perform // an exception lookup in the caller and dispatch to the handler @@ -703,12 +703,12 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ movptr(Address(thread, JavaThread::vm_result_offset()), NULL_WORD); __ movptr(Address(thread, JavaThread::vm_result_2_offset()), NULL_WORD); break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // At this point all registers MAY be live. - oop_map = save_live_registers(sasm, 1 /*thread*/, id != handle_exception_nofpu_id); + oop_map = save_live_registers(sasm, 1 /*thread*/, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: { + case C1StubId::handle_exception_from_callee_id: { // At this point all registers except exception oop (RAX) and // exception pc (RDX) are dead. const int frame_size = 2 /*BP, return address*/ NOT_LP64(+ 1 /*thread*/) WIN64_ONLY(+ frame::arg_reg_save_area_bytes / BytesPerWord); @@ -775,13 +775,13 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { __ movptr(Address(rbp, 1*BytesPerWord), rax); switch (id) { - case forward_exception_id: - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::forward_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: // Restore the registers that were saved at the beginning. - restore_live_registers(sasm, id != handle_exception_nofpu_id); + restore_live_registers(sasm, id != C1StubId::handle_exception_nofpu_id); break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: // WIN64_ONLY: No need to add frame::arg_reg_save_area_bytes to SP // since we do a leave anyway. @@ -935,7 +935,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { __ testptr(rax, rax); // have we deoptimized? __ jump_cc(Assembler::equal, - RuntimeAddress(Runtime1::entry_for(Runtime1::forward_exception_id))); + RuntimeAddress(Runtime1::entry_for(C1StubId::forward_exception_id))); // the deopt blob expects exceptions in the special fields of // JavaThread, so copy and clear pending exception. @@ -1007,7 +1007,7 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { } -OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { +OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) { // for better readability const bool must_gc_arguments = true; @@ -1019,7 +1019,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // stub code & info for the different stubs OopMapSet* oop_maps = nullptr; switch (id) { - case forward_exception_id: + case C1StubId::forward_exception_id: { oop_maps = generate_handle_exception(id, sasm); __ leave(); @@ -1027,19 +1027,19 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_instance_id: - case fast_new_instance_id: - case fast_new_instance_init_check_id: + case C1StubId::new_instance_id: + case C1StubId::fast_new_instance_id: + case C1StubId::fast_new_instance_init_check_id: { Register klass = rdx; // Incoming Register obj = rax; // Result - if (id == new_instance_id) { + if (id == C1StubId::new_instance_id) { __ set_info("new_instance", dont_gc_arguments); - } else if (id == fast_new_instance_id) { + } else if (id == C1StubId::fast_new_instance_id) { __ set_info("fast new_instance", dont_gc_arguments); } else { - assert(id == fast_new_instance_init_check_id, "bad StubID"); + assert(id == C1StubId::fast_new_instance_init_check_id, "bad C1StubId"); __ set_info("fast new_instance init check", dont_gc_arguments); } @@ -1058,7 +1058,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { break; - case counter_overflow_id: + case C1StubId::counter_overflow_id: { Register bci = rax, method = rbx; __ enter(); @@ -1076,14 +1076,14 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_type_array_id: - case new_object_array_id: + case C1StubId::new_type_array_id: + case C1StubId::new_object_array_id: { Register length = rbx; // Incoming Register klass = rdx; // Incoming Register obj = rax; // Result - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { __ set_info("new_type_array", dont_gc_arguments); } else { __ set_info("new_object_array", dont_gc_arguments); @@ -1096,7 +1096,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Register t0 = obj; __ movl(t0, Address(klass, Klass::layout_helper_offset())); __ sarl(t0, Klass::_lh_array_tag_shift); - int tag = ((id == new_type_array_id) + int tag = ((id == C1StubId::new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value); __ cmpl(t0, tag); @@ -1110,7 +1110,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ enter(); OopMap* map = save_live_registers(sasm, 3); int call_offset; - if (id == new_type_array_id) { + if (id == C1StubId::new_type_array_id) { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length); } else { call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length); @@ -1128,7 +1128,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case new_multi_array_id: + case C1StubId::new_multi_array_id: { StubFrame f(sasm, "new_multi_array", dont_gc_arguments); // rax,: klass // rbx,: rank @@ -1145,7 +1145,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case register_finalizer_id: + case C1StubId::register_finalizer_id: { __ set_info("register_finalizer", dont_gc_arguments); @@ -1185,44 +1185,44 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_range_check_failed_id: + case C1StubId::throw_range_check_failed_id: { StubFrame f(sasm, "range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), true); } break; - case throw_index_exception_id: + case C1StubId::throw_index_exception_id: { StubFrame f(sasm, "index_range_check_failed", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); } break; - case throw_div0_exception_id: + case C1StubId::throw_div0_exception_id: { StubFrame f(sasm, "throw_div0_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); } break; - case throw_null_pointer_exception_id: + case C1StubId::throw_null_pointer_exception_id: { StubFrame f(sasm, "throw_null_pointer_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); } break; - case handle_exception_nofpu_id: - case handle_exception_id: + case C1StubId::handle_exception_nofpu_id: + case C1StubId::handle_exception_id: { StubFrame f(sasm, "handle_exception", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case handle_exception_from_callee_id: + case C1StubId::handle_exception_from_callee_id: { StubFrame f(sasm, "handle_exception_from_callee", dont_gc_arguments); oop_maps = generate_handle_exception(id, sasm); } break; - case unwind_exception_id: + case C1StubId::unwind_exception_id: { __ set_info("unwind_exception", dont_gc_arguments); // note: no stubframe since we are about to leave the current // activation and we are calling a leaf VM function only. @@ -1230,7 +1230,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_array_store_exception_id: + case C1StubId::throw_array_store_exception_id: { StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments); // tos + 0: link // + 1: return address @@ -1238,19 +1238,19 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case throw_class_cast_exception_id: + case C1StubId::throw_class_cast_exception_id: { StubFrame f(sasm, "throw_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); } break; - case throw_incompatible_class_change_error_id: + case C1StubId::throw_incompatible_class_change_error_id: { StubFrame f(sasm, "throw_incompatible_class_cast_exception", dont_gc_arguments); oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); } break; - case slow_subtype_check_id: + case C1StubId::slow_subtype_check_id: { // Typical calling sequence: // __ push(klass_RInfo); // object klass or other subclass @@ -1303,10 +1303,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorenter_nofpu_id: + case C1StubId::monitorenter_nofpu_id: save_fpu_registers = false; // fall through - case monitorenter_id: + case C1StubId::monitorenter_id: { StubFrame f(sasm, "monitorenter", dont_gc_arguments); OopMap* map = save_live_registers(sasm, 3, save_fpu_registers); @@ -1324,10 +1324,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case monitorexit_nofpu_id: + case C1StubId::monitorexit_nofpu_id: save_fpu_registers = false; // fall through - case monitorexit_id: + case C1StubId::monitorexit_id: { StubFrame f(sasm, "monitorexit", dont_gc_arguments); OopMap* map = save_live_registers(sasm, 2, save_fpu_registers); @@ -1347,7 +1347,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case deoptimize_id: + case C1StubId::deoptimize_id: { StubFrame f(sasm, "deoptimize", dont_gc_arguments); const int num_rt_args = 2; // thread, trap_request @@ -1364,35 +1364,35 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case access_field_patching_id: + case C1StubId::access_field_patching_id: { StubFrame f(sasm, "access_field_patching", dont_gc_arguments); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); } break; - case load_klass_patching_id: + case C1StubId::load_klass_patching_id: { StubFrame f(sasm, "load_klass_patching", dont_gc_arguments); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); } break; - case load_mirror_patching_id: + case C1StubId::load_mirror_patching_id: { StubFrame f(sasm, "load_mirror_patching", dont_gc_arguments); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); } break; - case load_appendix_patching_id: + case C1StubId::load_appendix_patching_id: { StubFrame f(sasm, "load_appendix_patching", dont_gc_arguments); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); } break; - case dtrace_object_alloc_id: + case C1StubId::dtrace_object_alloc_id: { // rax,: object StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); // we can't gc here so skip the oopmap but make sure that all @@ -1407,7 +1407,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case fpu2long_stub_id: + case C1StubId::fpu2long_stub_id: { #ifdef _LP64 Label done; @@ -1496,7 +1496,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { } break; - case predicate_failed_trap_id: + case C1StubId::predicate_failed_trap_id: { StubFrame f(sasm, "predicate_failed_trap", dont_gc_arguments); diff --git a/src/hotspot/cpu/x86/gc/x/x_x86_64.ad b/src/hotspot/cpu/x86/gc/x/x_x86_64.ad index 116fb3cbc6d5e..ba4b3cb6df05f 100644 --- a/src/hotspot/cpu/x86/gc/x/x_x86_64.ad +++ b/src/hotspot/cpu/x86/gc/x/x_x86_64.ad @@ -126,8 +126,7 @@ instruct xCompareAndSwapP(rRegI res, indirect mem, rRegP newval, rRegP tmp, rFla format %{ "lock\n\t" "cmpxchgq $newval, $mem\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ precond($oldval$$Register == rax); @@ -135,8 +134,7 @@ instruct xCompareAndSwapP(rRegI res, indirect mem, rRegP newval, rRegP tmp, rFla if (barrier_data() != XLoadBarrierElided) { __ cmpptr($tmp$$Register, rax); } - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe(pipe_cmpxchg); diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp index f5f0d6c884198..65d7c1e3303ba 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp @@ -636,7 +636,7 @@ void ZBarrierSetAssembler::copy_load_at(MacroAssembler* masm, // Remove metadata bits so that the store side (vectorized or non-vectorized) can // inject the store-good color with an or instruction. - __ andq(dst, _zpointer_address_mask); + __ andq(dst, ZPointerAddressMask); if ((decorators & ARRAYCOPY_CHECKCAST) != 0) { // The checkcast arraycopy needs to be able to dereference the oops in order to perform a typechecks. diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp index 7c3716ba0da9f..5fbc7ea1be16e 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp @@ -64,7 +64,7 @@ class ZBarrierSetAssembler : public ZBarrierSetAssemblerBase { GrowableArrayCHeap _store_good_relocations; public: - static const int32_t _zpointer_address_mask = 0xFFFF0000; + static const int32_t ZPointerAddressMask = 0xFFFF0000; ZBarrierSetAssembler(); diff --git a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad index 1a4499c3d447d..455d622acdf17 100644 --- a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad +++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad @@ -141,7 +141,7 @@ instruct zLoadPNullCheck(rFlagsReg cr, memory op, immP0 zero) ins_encode %{ // A null pointer will have all address bits 0. This mask sign extends // all address bits, so we can test if the address is 0. - __ testq($op$$Address, ZBarrierSetAssembler::_zpointer_address_mask); + __ testq($op$$Address, ZBarrierSetAssembler::ZPointerAddressMask); %} ins_pipe(ialu_cr_reg_imm); %} @@ -212,8 +212,7 @@ instruct zCompareAndSwapP(rRegI res, indirect mem, rRegP newval, rRegP tmp, rax_ format %{ "lock\n\t" "cmpxchgq $newval, $mem\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ assert_different_registers($oldval$$Register, $mem$$Register); @@ -222,8 +221,7 @@ instruct zCompareAndSwapP(rRegI res, indirect mem, rRegP newval, rRegP tmp, rax_ z_color(masm, this, $oldval$$Register); __ lock(); __ cmpxchgptr($tmp$$Register, mem_addr); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe(pipe_cmpxchg); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index ba337751d19d1..893ae4e844ba4 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -5756,7 +5756,7 @@ void MacroAssembler::verify_heapbase(const char* msg) { assert (Universe::heap() != nullptr, "java heap should be initialized"); if (CheckCompressedOops) { Label ok; - ExternalAddress src2(CompressedOops::ptrs_base_addr()); + ExternalAddress src2(CompressedOops::base_addr()); const bool is_src2_reachable = reachable(src2); if (!is_src2_reachable) { push(rscratch1); // cmpptr trashes rscratch1 @@ -6047,10 +6047,10 @@ void MacroAssembler::reinit_heapbase() { if (CompressedOops::base() == nullptr) { MacroAssembler::xorptr(r12_heapbase, r12_heapbase); } else { - mov64(r12_heapbase, (int64_t)CompressedOops::ptrs_base()); + mov64(r12_heapbase, (int64_t)CompressedOops::base()); } } else { - movptr(r12_heapbase, ExternalAddress(CompressedOops::ptrs_base_addr())); + movptr(r12_heapbase, ExternalAddress(CompressedOops::base_addr())); } } } @@ -10421,4 +10421,13 @@ void MacroAssembler::restore_legacy_gprs() { movq(rax, Address(rsp, 15 * wordSize)); addq(rsp, 16 * wordSize); } + +void MacroAssembler::setcc(Assembler::Condition comparison, Register dst) { + if (VM_Version::supports_apx_f()) { + esetzucc(comparison, dst); + } else { + setb(comparison, dst); + movzbl(dst, dst); + } +} #endif diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 594f0b95ca3e2..2ce4fc40e90e0 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -2154,6 +2154,7 @@ class MacroAssembler: public Assembler { #ifdef _LP64 void save_legacy_gprs(); void restore_legacy_gprs(); + void setcc(Assembler::Condition comparison, Register dst); #endif }; diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 2bc4a0a9cba94..4f37dc31d0305 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -3573,6 +3573,9 @@ void StubGenerator::generate_libm_stubs() { if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtan)) { StubRoutines::_dtan = generate_libmTan(); // from stubGenerator_x86_64_tan.cpp } + if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtanh)) { + StubRoutines::_dtanh = generate_libmTanh(); // from stubGenerator_x86_64_tanh.cpp + } if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dexp)) { StubRoutines::_dexp = generate_libmExp(); // from stubGenerator_x86_64_exp.cpp } diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp index d65c681585d6d..0a81da4f7c957 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp @@ -546,6 +546,7 @@ class StubGenerator: public StubCodeGenerator { address generate_libmSin(); address generate_libmCos(); address generate_libmTan(); + address generate_libmTanh(); address generate_libmExp(); address generate_libmPow(); address generate_libmLog(); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp index 5b316881d0346..c72c32e796d2d 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp @@ -2627,7 +2627,6 @@ address StubGenerator::generate_unsafe_setmemory(const char *name, // Fill words { - Label L_wordsTail, L_wordsLoop, L_wordsTailLoop; UnsafeMemoryAccessMark umam(this, true, true); // At this point, we know the lower bit of size is zero and a @@ -2641,7 +2640,6 @@ address StubGenerator::generate_unsafe_setmemory(const char *name, // Fill QUADWORDs { - Label L_qwordLoop, L_qwordsTail, L_qwordsTailLoop; UnsafeMemoryAccessMark umam(this, true, true); // At this point, we know the lower 3 bits of size are zero and a @@ -2658,7 +2656,6 @@ address StubGenerator::generate_unsafe_setmemory(const char *name, // Fill DWORDs { - Label L_dwordLoop, L_dwordsTail, L_dwordsTailLoop; UnsafeMemoryAccessMark umam(this, true, true); // At this point, we know the lower 2 bits of size are zero and a diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp new file mode 100644 index 0000000000000..92ac78e15cba9 --- /dev/null +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp @@ -0,0 +1,502 @@ +/* +* Copyright (c) 2024, Intel Corporation. All rights reserved. +* Intel Math Library (LIBM) Source Code +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +* +*/ + +#include "precompiled.hpp" +#include "macroAssembler_x86.hpp" +#include "stubGenerator_x86_64.hpp" + +/******************************************************************************/ +// ALGORITHM DESCRIPTION +// --------------------- +// +// tanh(x)=(exp(x)-exp(-x))/(exp(x)+exp(-x))=(1-exp(-2*x))/(1+exp(-2*x)) +// +// Let |x|=xH+xL (upper 26 bits, lower 27 bits) +// log2(e) rounded to 26 bits (high part) plus a double precision low part is +// L2EH+L2EL (upper 26, lower 53 bits) +// +// Let xH*L2EH=k+f+r`, where (k+f)*2^8*2=int(xH*L2EH*2^9), +// f=0.b1 b2 ... b8, k integer +// 2^{-f} is approximated as Tn[f]+Dn[f] +// Tn stores the high 53 bits, Dn stores (2^{-f}-Tn[f]) rounded to double precision +// +// r=r`+xL*L2EH+|x|*L2EL, |r|<2^{-9}+2^{-14}, +// for |x| in [23/64,3*2^7) +// e^{-2*|x|}=2^{-k-f}*2^{-r} ~ 2^{-k}*(Tn+Dn)*(1+p)=(T0+D0)*(1+p) +// +// For |x| in [2^{-4},2^5): +// 2^{-r}-1 ~ p=c1*r+c2*r^2+..+c5*r^5 +// Let R=1/(1+T0+p*T0), truncated to 35 significant bits +// R=1/(1+T0+D0+p*(T0+D0))*(1+eps), |eps|<2^{-33} +// 1+T0+D0+p*(T0+D0)=KH+KL, where +// KH=(1+T0+c1*r*T0)_high (leading 17 bits) +// KL=T0_low+D0+(c1*r*T0)_low+c1*r*D0+(c2*r^2+..c5*r^5)*T0 +// eps ~ (R*KH-1)+R*KL +// 1/(1+T0+D0+p*(T0+D0)) ~ R-R*eps +// The result is approximated as (1-T0-D0-(T0+D0)*p)*(R-R*eps) +// 1-T0-D0-(T0+D0)*p=-((KH-2)+KL) +// The result is formed as +// (KH-2)*R+(-(KH-2)*R*eps+(KL*R-KL*R*eps)), with the correct sign +// set at the end +// +// For |x| in [2^{-64},2^{-4}): +// A Taylor series expansion is used (x+p3*x^3+..+p13*x^{13}) +// +// For |x|<2^{-64}: x is returned +// +// For |x|>=2^32: return +/-1 +// +// Special cases: +// tanh(NaN) = quiet NaN, and raise invalid exception +// tanh(INF) = that INF +// tanh(+/-0) = +/-0 +// +/******************************************************************************/ + +ATTRIBUTE_ALIGNED(4) static const juint _HALFMASK[] = +{ + 4160749568, 2147483647 +}; + +ATTRIBUTE_ALIGNED(4) static const juint _ONEMASK[] = +{ + 0, 1072693248 +}; + +ATTRIBUTE_ALIGNED(4) static const juint _TWOMASK[] = +{ + 0, 1073741824 +}; + +ATTRIBUTE_ALIGNED(16) static const juint _MASK3[] = +{ + 0, 4294967280, 0, 4294967280 +}; + +ATTRIBUTE_ALIGNED(16) static const juint _RMASK[] = +{ + 4294705152, 4294967295, 4294705152, 4294967295 +}; + +ATTRIBUTE_ALIGNED(16) static const juint _L2E[] = +{ + 1610612736, 1082594631, 4166901572, 1055174155 +}; + +ATTRIBUTE_ALIGNED(16) static const juint _Shifter[] = +{ + 0, 1127743488, 0, 3275227136 +}; + +ATTRIBUTE_ALIGNED(16) static const juint _cv[] = +{ + 3884607281, 3168131199, 3607404735, 3190582024, 1874480759, + 1032041131, 4286760334, 1053736893, 4277811695, 3211144770, + 0, 0 +}; + +ATTRIBUTE_ALIGNED(4) static const juint _pv[] = +{ + 236289503, 1064135997, 463583772, 3215696314, 1441186365, + 3212977891, 286331153, 1069617425, 2284589306, 1066820852, + 1431655765, 3218429269 +}; + +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 +}; + +#define __ _masm-> + +address StubGenerator::generate_libmTanh() { + StubCodeMark mark(this, "StubRoutines", "libmTanh"); + address start = __ pc(); + + Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1; + Label L_2TAG_PACKET_4_0_1, L_2TAG_PACKET_5_0_1; + Label B1_2, B1_4; + + address HALFMASK = (address)_HALFMASK; + address ONEMASK = (address)_ONEMASK; + address TWOMASK = (address)_TWOMASK; + address MASK3 = (address)_MASK3; + address RMASK = (address)_RMASK; + address L2E = (address)_L2E; + address Shifter = (address)_Shifter; + address cv = (address)_cv; + address pv = (address)_pv; + address T2_neg_f = (address) _T2_neg_f; + + __ enter(); // required for proper stackwalking of RuntimeStub frame + + __ bind(B1_2); + __ movsd(xmm3, ExternalAddress(HALFMASK), r11 /*rscratch*/); + __ xorpd(xmm4, xmm4); + __ movsd(xmm1, ExternalAddress(L2E), r11 /*rscratch*/); + __ movsd(xmm2, ExternalAddress(L2E + 8), r11 /*rscratch*/); + __ movl(rax, 32768); + __ pinsrw(xmm4, rax, 3); + __ movsd(xmm6, ExternalAddress(Shifter), r11 /*rscratch*/); + __ pextrw(rcx, xmm0, 3); + __ andpd(xmm3, xmm0); + __ andnpd(xmm4, xmm0); + __ pshufd(xmm5, xmm4, 68); + __ movl(rdx, 32768); + __ andl(rdx, rcx); + __ andl(rcx, 32767); + __ subl(rcx, 16304); + __ cmpl(rcx, 144); + __ jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_1); + __ subsd(xmm4, xmm3); + __ mulsd(xmm3, xmm1); + __ mulsd(xmm2, xmm5); + __ cvtsd2siq(rax, xmm3); + __ movq(xmm7, xmm3); + __ addsd(xmm3, xmm6); + __ mulsd(xmm1, xmm4); + __ movsd(xmm4, ExternalAddress(ONEMASK), r11 /*rscratch*/); + __ subsd(xmm3, xmm6); + __ xorpd(xmm0, xmm0); + __ addsd(xmm2, xmm1); + __ subsd(xmm7, xmm3); + __ movdqu(xmm6, ExternalAddress(cv), r11 /*rscratch*/); + __ addsd(xmm2, xmm7); + __ movl(rcx, 255); + __ andl(rcx, rax); + __ addl(rcx, rcx); + __ lea(r8, ExternalAddress(T2_neg_f)); + __ movdqu(xmm5, Address(r8, rcx, Address::times(8))); + __ shrl(rax, 4); + __ andl(rax, 65520); + __ subl(rax, 16368); + __ negl(rax); + __ pinsrw(xmm0, rax, 3); + __ movdqu(xmm1, ExternalAddress(cv + 16), r11 /*rscratch*/); + __ pshufd(xmm0, xmm0, 68); + __ mulpd(xmm0, xmm5); + __ movsd(xmm7, ExternalAddress(cv + 32), r11 /*rscratch*/); + __ pshufd(xmm2, xmm2, 68); + __ movq(xmm5, xmm4); + __ addsd(xmm4, xmm0); + __ mulpd(xmm6, xmm2); + __ mulsd(xmm7, xmm2); + __ mulpd(xmm2, xmm2); + __ addpd(xmm1, xmm6); + __ mulsd(xmm2, xmm2); + __ movsd(xmm3, ExternalAddress(ONEMASK), r11 /*rscratch*/); + __ mulpd(xmm1, xmm2); + __ pshufd(xmm6, xmm1, 78); + __ addsd(xmm1, xmm6); + __ movq(xmm6, xmm1); + __ addsd(xmm1, xmm7); + __ mulsd(xmm1, xmm0); + __ addsd(xmm1, xmm4); + __ andpd(xmm4, ExternalAddress(MASK3), r11 /*rscratch*/); + __ divsd(xmm5, xmm1); + __ subsd(xmm3, xmm4); + __ pshufd(xmm1, xmm0, 238); + __ addsd(xmm3, xmm0); + __ movq(xmm2, xmm4); + __ addsd(xmm3, xmm1); + __ mulsd(xmm1, xmm7); + __ mulsd(xmm7, xmm0); + __ addsd(xmm3, xmm1); + __ addsd(xmm4, xmm7); + __ movsd(xmm1, ExternalAddress(RMASK), r11 /*rscratch*/); + __ mulsd(xmm6, xmm0); + __ andpd(xmm4, ExternalAddress(MASK3), r11 /*rscratch*/); + __ addsd(xmm3, xmm6); + __ movq(xmm6, xmm4); + __ subsd(xmm2, xmm4); + __ addsd(xmm2, xmm7); + __ movsd(xmm7, ExternalAddress(ONEMASK), r11 /*rscratch*/); + __ andpd(xmm5, xmm1); + __ addsd(xmm3, xmm2); + __ mulsd(xmm4, xmm5); + __ xorpd(xmm2, xmm2); + __ mulsd(xmm3, xmm5); + __ subsd(xmm6, ExternalAddress(TWOMASK), r11 /*rscratch*/); + __ subsd(xmm4, xmm7); + __ xorl(rdx, 32768); + __ pinsrw(xmm2, rdx, 3); + __ addsd(xmm4, xmm3); + __ mulsd(xmm6, xmm5); + __ movq(xmm1, xmm3); + __ mulsd(xmm3, xmm4); + __ movq(xmm0, xmm6); + __ mulsd(xmm6, xmm4); + __ subsd(xmm1, xmm3); + __ subsd(xmm1, xmm6); + __ addsd(xmm0, xmm1); + __ xorpd(xmm0, xmm2); + __ jmp(B1_4); + + __ bind(L_2TAG_PACKET_0_0_1); + __ addl(rcx, 960); + __ cmpl(rcx, 1104); + __ jcc(Assembler::aboveEqual, L_2TAG_PACKET_1_0_1); + __ movdqu(xmm2, ExternalAddress(pv), r11 /*rscratch*/); + __ pshufd(xmm1, xmm0, 68); + __ movdqu(xmm3, ExternalAddress(pv + 16), r11 /*rscratch*/); + __ mulpd(xmm1, xmm1); + __ movdqu(xmm4, ExternalAddress(pv + 32), r11 /*rscratch*/); + __ mulpd(xmm2, xmm1); + __ pshufd(xmm5, xmm1, 68); + __ addpd(xmm2, xmm3); + __ mulsd(xmm5, xmm5); + __ mulpd(xmm2, xmm1); + __ mulsd(xmm5, xmm5); + __ addpd(xmm2, xmm4); + __ mulpd(xmm2, xmm5); + __ pshufd(xmm5, xmm2, 238); + __ addsd(xmm2, xmm5); + __ mulsd(xmm2, xmm0); + __ addsd(xmm0, xmm2); + __ jmp(B1_4); + + __ bind(L_2TAG_PACKET_1_0_1); + __ addl(rcx, 15344); + __ cmpl(rcx, 16448); + __ jcc(Assembler::aboveEqual, L_2TAG_PACKET_2_0_1); + __ cmpl(rcx, 16); + __ jcc(Assembler::below, L_2TAG_PACKET_3_0_1); + __ xorpd(xmm2, xmm2); + __ movl(rax, 17392); + __ pinsrw(xmm2, rax, 3); + __ mulsd(xmm2, xmm0); + __ addsd(xmm2, xmm0); + __ jmp(B1_4); + + __ bind(L_2TAG_PACKET_3_0_1); + __ movq(xmm2, xmm0); + __ mulsd(xmm2, xmm2); + __ jmp(B1_4); + + __ bind(L_2TAG_PACKET_2_0_1); + __ cmpl(rcx, 32752); + __ jcc(Assembler::aboveEqual, L_2TAG_PACKET_4_0_1); + __ xorpd(xmm2, xmm2); + __ movl(rcx, 15344); + __ pinsrw(xmm2, rcx, 3); + __ movq(xmm3, xmm2); + __ mulsd(xmm2, xmm2); + __ addsd(xmm2, xmm3); + + __ bind(L_2TAG_PACKET_5_0_1); + __ xorpd(xmm0, xmm0); + __ orl(rdx, 16368); + __ pinsrw(xmm0, rdx, 3); + __ jmp(B1_4); + + __ bind(L_2TAG_PACKET_4_0_1); + __ movq(xmm2, xmm0); + __ movdl(rax, xmm0); + __ psrlq(xmm2, 20); + __ movdl(rcx, xmm2); + __ orl(rcx, rax); + __ cmpl(rcx, 0); + __ jcc(Assembler::equal, L_2TAG_PACKET_5_0_1); + __ addsd(xmm0, xmm0); + + __ bind(B1_4); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; +} + +#undef __ diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp index ba9eb32e8c13e..75611524e3b0a 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -373,6 +373,10 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M // [ lo(arg) ] // [ hi(arg) ] // + if (kind == Interpreter::java_lang_math_tanh) { + return nullptr; + } + if (kind == Interpreter::java_lang_math_fmaD) { if (!UseFMA) { return nullptr; // Generate a vanilla entry diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp index 26eea4c1d6a5f..5ea2d8eba259b 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -465,6 +465,10 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M } else { __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dtan)); } + } else if (kind == Interpreter::java_lang_math_tanh) { + assert(StubRoutines::dtanh() != nullptr, "not initialized"); + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtanh()))); } else if (kind == Interpreter::java_lang_math_abs) { assert(StubRoutines::x86::double_sign_mask() != nullptr, "not initialized"); __ movdbl(xmm0, Address(rsp, wordSize)); diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 6216cf44b887a..2549feb8a4069 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1045,6 +1045,10 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseAPX, apx_supported ? true : false); } + if (!UseAPX) { + _features &= ~CPU_APX_F; + } + if (UseAVX < 2) { _features &= ~CPU_AVX2; _features &= ~CPU_AVX_IFMA; diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index e0740ad7f3124..1b271683bd60d 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -657,8 +657,7 @@ static void emit_cmpfp3(MacroAssembler* masm, Register dst) { __ movl(dst, -1); __ jcc(Assembler::parity, done); __ jcc(Assembler::below, done); - __ setb(Assembler::notEqual, dst); - __ movzbl(dst, dst); + __ setcc(Assembler::notEqual, dst); __ bind(done); } @@ -7070,13 +7069,11 @@ instruct compareAndSwapP(rRegI res, format %{ "cmpxchgq $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgq($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -7092,13 +7089,11 @@ instruct compareAndSwapL(rRegI res, format %{ "cmpxchgq $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgq($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -7114,13 +7109,11 @@ instruct compareAndSwapI(rRegI res, format %{ "cmpxchgl $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgl($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -7136,13 +7129,11 @@ instruct compareAndSwapB(rRegI res, format %{ "cmpxchgb $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgb($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -7158,13 +7149,11 @@ instruct compareAndSwapS(rRegI res, format %{ "cmpxchgw $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgw($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -7179,13 +7168,11 @@ instruct compareAndSwapN(rRegI res, format %{ "cmpxchgl $mem_ptr,$newval\t# " "If rax == $mem_ptr then store $newval into $mem_ptr\n\t" - "sete $res\n\t" - "movzbl $res, $res" %} + "setcc $res \t# emits sete + movzbl or setzue for APX" %} ins_encode %{ __ lock(); __ cmpxchgl($newval$$Register, $mem_ptr$$Address); - __ setb(Assembler::equal, $res$$Register); - __ movzbl($res$$Register, $res$$Register); + __ setcc(Assembler::equal, $res$$Register); %} ins_pipe( pipe_cmpxchg ); %} @@ -9729,13 +9716,11 @@ instruct cmpLTMask(rRegI dst, rRegI p, rRegI q, rFlagsReg cr) ins_cost(400); format %{ "cmpl $p, $q\t# cmpLTMask\n\t" - "setlt $dst\n\t" - "movzbl $dst, $dst\n\t" + "setcc $dst \t# emits setlt + movzbl or setzul for APX" "negl $dst" %} ins_encode %{ __ cmpl($p$$Register, $q$$Register); - __ setb(Assembler::less, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + __ setcc(Assembler::less, $dst$$Register); __ negl($dst$$Register); %} ins_pipe(pipe_slow); @@ -11860,16 +11845,14 @@ instruct cmpU3_reg_reg(rRegI dst, rRegI src1, rRegI src2, rFlagsReg flags) format %{ "cmpl $src1, $src2\t# CmpL3\n\t" "movl $dst, -1\n\t" "jb,u done\n\t" - "setne $dst\n\t" - "movzbl $dst, $dst\n\t" + "setcc $dst \t# emits setne + movzbl or setzune for APX" "done:" %} ins_encode %{ Label done; __ cmpl($src1$$Register, $src2$$Register); __ movl($dst$$Register, -1); __ jccb(Assembler::below, done); - __ setb(Assembler::notZero, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + __ setcc(Assembler::notZero, $dst$$Register); __ bind(done); %} ins_pipe(pipe_slow); @@ -11886,16 +11869,14 @@ instruct cmpL3_reg_reg(rRegI dst, rRegL src1, rRegL src2, rFlagsReg flags) format %{ "cmpq $src1, $src2\t# CmpL3\n\t" "movl $dst, -1\n\t" "jl,s done\n\t" - "setne $dst\n\t" - "movzbl $dst, $dst\n\t" + "setcc $dst \t# emits setne + movzbl or setzune for APX" "done:" %} ins_encode %{ Label done; __ cmpq($src1$$Register, $src2$$Register); __ movl($dst$$Register, -1); __ jccb(Assembler::less, done); - __ setb(Assembler::notZero, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + __ setcc(Assembler::notZero, $dst$$Register); __ bind(done); %} ins_pipe(pipe_slow); @@ -11912,16 +11893,14 @@ instruct cmpUL3_reg_reg(rRegI dst, rRegL src1, rRegL src2, rFlagsReg flags) format %{ "cmpq $src1, $src2\t# CmpL3\n\t" "movl $dst, -1\n\t" "jb,u done\n\t" - "setne $dst\n\t" - "movzbl $dst, $dst\n\t" + "setcc $dst \t# emits setne + movzbl or setzune for APX" "done:" %} ins_encode %{ Label done; __ cmpq($src1$$Register, $src2$$Register); __ movl($dst$$Register, -1); __ jccb(Assembler::below, done); - __ setb(Assembler::notZero, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + __ setcc(Assembler::notZero, $dst$$Register); __ bind(done); %} ins_pipe(pipe_slow); diff --git a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp index 1da0e44dbf48e..d51499611a8d1 100644 --- a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp +++ b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp @@ -609,7 +609,7 @@ jlong CgroupSubsystem::memory_limit_in_bytes() { bool CgroupController::read_string(const char* filename, char* buf, size_t buf_size) { assert(buf != nullptr, "buffer must not be null"); assert(filename != nullptr, "filename must be given"); - char* s_path = subsystem_path(); + const char* s_path = subsystem_path(); if (s_path == nullptr) { log_debug(os, container)("read_string: subsystem path is null"); return false; @@ -679,7 +679,7 @@ bool CgroupController::read_numerical_key_value(const char* filename, const char assert(key != nullptr, "key must be given"); assert(result != nullptr, "result pointer must not be null"); assert(filename != nullptr, "file to search in must be given"); - char* s_path = subsystem_path(); + const char* s_path = subsystem_path(); if (s_path == nullptr) { log_debug(os, container)("read_numerical_key_value: subsystem path is null"); return false; diff --git a/src/hotspot/os/linux/cgroupSubsystem_linux.hpp b/src/hotspot/os/linux/cgroupSubsystem_linux.hpp index 4d5fa5d487900..40948dc5e2883 100644 --- a/src/hotspot/os/linux/cgroupSubsystem_linux.hpp +++ b/src/hotspot/os/linux/cgroupSubsystem_linux.hpp @@ -103,9 +103,15 @@ } class CgroupController: public CHeapObj { + protected: + char* _cgroup_path; + char* _mount_point; public: - virtual char* subsystem_path() = 0; + virtual const char* subsystem_path() = 0; virtual bool is_read_only() = 0; + const char* cgroup_path() { return _cgroup_path; } + const char* mount_point() { return _mount_point; } + virtual bool needs_hierarchy_adjustment() { return false; } /* Read a numerical value as unsigned long * @@ -202,7 +208,12 @@ class CgroupCpuController: public CHeapObj { virtual int cpu_quota() = 0; virtual int cpu_period() = 0; virtual int cpu_shares() = 0; + virtual bool needs_hierarchy_adjustment() = 0; virtual bool is_read_only() = 0; + virtual const char* subsystem_path() = 0; + virtual void set_subsystem_path(const char* cgroup_path) = 0; + virtual const char* mount_point() = 0; + virtual const char* cgroup_path() = 0; }; // Pure virtual class representing version agnostic memory controllers @@ -217,7 +228,12 @@ class CgroupMemoryController: public CHeapObj { 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 bool needs_hierarchy_adjustment() = 0; virtual bool is_read_only() = 0; + virtual const char* subsystem_path() = 0; + virtual void set_subsystem_path(const char* cgroup_path) = 0; + virtual const char* mount_point() = 0; + virtual const char* cgroup_path() = 0; }; class CgroupSubsystem: public CHeapObj { diff --git a/src/hotspot/os/linux/cgroupUtil_linux.cpp b/src/hotspot/os/linux/cgroupUtil_linux.cpp index 24046991905ee..bc0e018d6be03 100644 --- a/src/hotspot/os/linux/cgroupUtil_linux.cpp +++ b/src/hotspot/os/linux/cgroupUtil_linux.cpp @@ -22,6 +22,7 @@ * */ +#include "os_linux.hpp" #include "cgroupUtil_linux.hpp" int CgroupUtil::processor_count(CgroupCpuController* cpu_ctrl, int host_cpus) { @@ -46,3 +47,113 @@ int CgroupUtil::processor_count(CgroupCpuController* cpu_ctrl, int host_cpus) { log_trace(os, container)("OSContainer::active_processor_count: %d", result); return result; } + +void CgroupUtil::adjust_controller(CgroupMemoryController* mem) { + if (!mem->needs_hierarchy_adjustment()) { + // nothing to do + return; + } + log_trace(os, container)("Adjusting controller path for memory: %s", mem->subsystem_path()); + assert(mem->cgroup_path() != nullptr, "invariant"); + char* orig = os::strdup(mem->cgroup_path()); + char* cg_path = os::strdup(orig); + char* last_slash; + assert(cg_path[0] == '/', "cgroup path must start with '/'"); + julong phys_mem = os::Linux::physical_memory(); + char* limit_cg_path = nullptr; + jlong limit = mem->read_memory_limit_in_bytes(phys_mem); + jlong lowest_limit = phys_mem; + while ((last_slash = strrchr(cg_path, '/')) != cg_path) { + *last_slash = '\0'; // strip path + // update to shortened path and try again + mem->set_subsystem_path(cg_path); + limit = mem->read_memory_limit_in_bytes(phys_mem); + if (limit >= 0 && limit < lowest_limit) { + lowest_limit = limit; + os::free(limit_cg_path); // handles nullptr + limit_cg_path = os::strdup(cg_path); + } + } + // need to check limit at mount point + mem->set_subsystem_path("/"); + limit = mem->read_memory_limit_in_bytes(phys_mem); + if (limit >= 0 && limit < lowest_limit) { + lowest_limit = limit; + os::free(limit_cg_path); // handles nullptr + limit_cg_path = os::strdup("/"); + } + assert(lowest_limit >= 0, "limit must be positive"); + if ((julong)lowest_limit != phys_mem) { + // we've found a lower limit anywhere in the hierarchy, + // set the path to the limit path + assert(limit_cg_path != nullptr, "limit path must be set"); + mem->set_subsystem_path(limit_cg_path); + log_trace(os, container)("Adjusted controller path for memory to: %s. " + "Lowest limit was: " JLONG_FORMAT, + mem->subsystem_path(), + lowest_limit); + } else { + log_trace(os, container)("No lower limit found for memory in hierarchy %s, " + "adjusting to original path %s", + mem->mount_point(), orig); + mem->set_subsystem_path(orig); + } + os::free(cg_path); + os::free(orig); + os::free(limit_cg_path); +} + +void CgroupUtil::adjust_controller(CgroupCpuController* cpu) { + if (!cpu->needs_hierarchy_adjustment()) { + // nothing to do + return; + } + log_trace(os, container)("Adjusting controller path for cpu: %s", cpu->subsystem_path()); + assert(cpu->cgroup_path() != nullptr, "invariant"); + char* orig = os::strdup(cpu->cgroup_path()); + char* cg_path = os::strdup(orig); + char* last_slash; + assert(cg_path[0] == '/', "cgroup path must start with '/'"); + int host_cpus = os::Linux::active_processor_count(); + int cpus = CgroupUtil::processor_count(cpu, host_cpus); + int lowest_limit = host_cpus; + char* limit_cg_path = nullptr; + while ((last_slash = strrchr(cg_path, '/')) != cg_path) { + *last_slash = '\0'; // strip path + // update to shortened path and try again + cpu->set_subsystem_path(cg_path); + cpus = CgroupUtil::processor_count(cpu, host_cpus); + if (cpus != host_cpus && cpus < lowest_limit) { + lowest_limit = cpus; + os::free(limit_cg_path); // handles nullptr + limit_cg_path = os::strdup(cg_path); + } + } + // need to check limit at mount point + cpu->set_subsystem_path("/"); + cpus = CgroupUtil::processor_count(cpu, host_cpus); + if (cpus != host_cpus && cpus < lowest_limit) { + lowest_limit = cpus; + os::free(limit_cg_path); // handles nullptr + limit_cg_path = os::strdup(cg_path); + } + assert(lowest_limit >= 0, "limit must be positive"); + if (lowest_limit != host_cpus) { + // we've found a lower limit anywhere in the hierarchy, + // set the path to the limit path + assert(limit_cg_path != nullptr, "limit path must be set"); + cpu->set_subsystem_path(limit_cg_path); + log_trace(os, container)("Adjusted controller path for cpu to: %s. " + "Lowest limit was: %d", + cpu->subsystem_path(), + lowest_limit); + } else { + log_trace(os, container)("No lower limit found for cpu in hierarchy %s, " + "adjusting to original path %s", + cpu->mount_point(), orig); + cpu->set_subsystem_path(orig); + } + os::free(cg_path); + os::free(orig); + os::free(limit_cg_path); +} diff --git a/src/hotspot/os/linux/cgroupUtil_linux.hpp b/src/hotspot/os/linux/cgroupUtil_linux.hpp index fdcc4806c3b93..19220af317766 100644 --- a/src/hotspot/os/linux/cgroupUtil_linux.hpp +++ b/src/hotspot/os/linux/cgroupUtil_linux.hpp @@ -32,6 +32,12 @@ class CgroupUtil: AllStatic { public: static int processor_count(CgroupCpuController* cpu, int host_cpus); + // Given a memory controller, adjust its path to a point in the hierarchy + // that represents the closest memory limit. + static void adjust_controller(CgroupMemoryController* m); + // Given a cpu controller, adjust its path to a point in the hierarchy + // that represents the closest cpu limit. + static void adjust_controller(CgroupCpuController* c); }; #endif // CGROUP_UTIL_LINUX_HPP diff --git a/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp b/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp index d7f9918afdad8..388ee5c6ea093 100644 --- a/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp +++ b/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp @@ -38,7 +38,15 @@ * Set directory to subsystem specific files based * on the contents of the mountinfo and cgroup files. */ -void CgroupV1Controller::set_subsystem_path(char *cgroup_path) { +void CgroupV1Controller::set_subsystem_path(const char* cgroup_path) { + if (_cgroup_path != nullptr) { + os::free(_cgroup_path); + } + if (_path != nullptr) { + os::free(_path); + _path = nullptr; + } + _cgroup_path = os::strdup(cgroup_path); stringStream ss; if (_root != nullptr && cgroup_path != nullptr) { if (strcmp(_root, "/") == 0) { @@ -52,7 +60,7 @@ void CgroupV1Controller::set_subsystem_path(char *cgroup_path) { ss.print_raw(_mount_point); _path = os::strdup(ss.base()); } else { - char *p = strstr(cgroup_path, _root); + char *p = strstr((char*)cgroup_path, _root); if (p != nullptr && p == _root) { if (strlen(cgroup_path) > strlen(_root)) { ss.print_raw(_mount_point); @@ -66,27 +74,15 @@ void CgroupV1Controller::set_subsystem_path(char *cgroup_path) { } } -/* uses_mem_hierarchy - * - * Return whether or not hierarchical cgroup accounting is being - * done. - * - * return: - * A number > 0 if true, or - * OSCONTAINER_ERROR for not supported +/* + * The common case, containers, we have _root == _cgroup_path, and thus set the + * controller path to the _mount_point. This is where the limits are exposed in + * the cgroup pseudo filesystem (at the leaf) and adjustment of the path won't + * be needed for that reason. */ -jlong CgroupV1MemoryController::uses_mem_hierarchy() { - julong use_hierarchy; - CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.use_hierarchy", "Use Hierarchy", use_hierarchy); - return (jlong)use_hierarchy; -} - -void CgroupV1MemoryController::set_subsystem_path(char *cgroup_path) { - reader()->set_subsystem_path(cgroup_path); - jlong hierarchy = uses_mem_hierarchy(); - if (hierarchy > 0) { - set_hierarchical(true); - } +bool CgroupV1Controller::needs_hierarchy_adjustment() { + assert(_cgroup_path != nullptr, "sanity"); + return strcmp(_root, _cgroup_path) != 0; } static inline @@ -115,20 +111,6 @@ jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) { julong memlimit; CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.limit_in_bytes", "Memory Limit", memlimit); if (memlimit >= phys_mem) { - log_trace(os, container)("Non-Hierarchical Memory Limit is: Unlimited"); - if (is_hierarchical()) { - julong hier_memlimit; - bool is_ok = reader()->read_numerical_key_value("/memory.stat", "hierarchical_memory_limit", &hier_memlimit); - if (!is_ok) { - return OSCONTAINER_ERROR; - } - log_trace(os, container)("Hierarchical Memory Limit is: " JULONG_FORMAT, hier_memlimit); - if (hier_memlimit < phys_mem) { - verbose_log(hier_memlimit, phys_mem); - return (jlong)hier_memlimit; - } - log_trace(os, container)("Hierarchical Memory Limit is: Unlimited"); - } verbose_log(memlimit, phys_mem); return (jlong)-1; } else { @@ -150,26 +132,10 @@ jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) { * upper bound) */ jlong CgroupV1MemoryController::read_mem_swap(julong host_total_memsw) { - julong hier_memswlimit; julong memswlimit; CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.memsw.limit_in_bytes", "Memory and Swap Limit", memswlimit); if (memswlimit >= host_total_memsw) { - log_trace(os, container)("Non-Hierarchical Memory and Swap Limit is: Unlimited"); - if (is_hierarchical()) { - const char* matchline = "hierarchical_memsw_limit"; - bool is_ok = reader()->read_numerical_key_value("/memory.stat", - matchline, - &hier_memswlimit); - if (!is_ok) { - return OSCONTAINER_ERROR; - } - log_trace(os, container)("Hierarchical Memory and Swap Limit is: " JULONG_FORMAT, hier_memswlimit); - if (hier_memswlimit >= host_total_memsw) { - log_trace(os, container)("Hierarchical Memory and Swap Limit is: Unlimited"); - } else { - return (jlong)hier_memswlimit; - } - } + log_trace(os, container)("Memory and Swap Limit is: Unlimited"); return (jlong)-1; } else { return (jlong)memswlimit; @@ -233,6 +199,21 @@ jlong CgroupV1MemoryController::memory_soft_limit_in_bytes(julong phys_mem) { } } +// Constructor +CgroupV1Subsystem::CgroupV1Subsystem(CgroupV1Controller* cpuset, + CgroupV1CpuController* cpu, + CgroupV1Controller* cpuacct, + CgroupV1Controller* pids, + CgroupV1MemoryController* memory) : + _cpuset(cpuset), + _cpuacct(cpuacct), + _pids(pids) { + CgroupUtil::adjust_controller(memory); + CgroupUtil::adjust_controller(cpu); + _memory = new CachingCgroupController(memory); + _cpu = new CachingCgroupController(cpu); +} + bool CgroupV1Subsystem::is_containerized() { // containerized iff all required controllers are mounted // read-only. See OSContainer::is_containerized() for diff --git a/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp b/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp index 56af87881e757..0c191ab91c7f5 100644 --- a/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp +++ b/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp @@ -28,6 +28,7 @@ #include "runtime/os.hpp" #include "memory/allocation.hpp" #include "cgroupSubsystem_linux.hpp" +#include "cgroupUtil_linux.hpp" // Cgroups version 1 specific implementation @@ -35,7 +36,6 @@ class CgroupV1Controller: public CgroupController { private: /* mountinfo contents */ char* _root; - char* _mount_point; bool _read_only; /* Constructed subsystem directory */ @@ -45,24 +45,27 @@ class CgroupV1Controller: public CgroupController { CgroupV1Controller(char *root, char *mountpoint, bool ro) : _root(os::strdup(root)), - _mount_point(os::strdup(mountpoint)), _read_only(ro), _path(nullptr) { + _cgroup_path = nullptr; + _mount_point = os::strdup(mountpoint); } // Shallow copy constructor CgroupV1Controller(const CgroupV1Controller& o) : _root(o._root), - _mount_point(o._mount_point), _read_only(o._read_only), _path(o._path) { + _cgroup_path = o._cgroup_path; + _mount_point = o._mount_point; } ~CgroupV1Controller() { // At least one subsystem controller exists with paths to malloc'd path // names } - void set_subsystem_path(char *cgroup_path); - char *subsystem_path() override { return _path; } + void set_subsystem_path(const char *cgroup_path); + const char* subsystem_path() override { return _path; } bool is_read_only() override { return _read_only; } + bool needs_hierarchy_adjustment() override; }; class CgroupV1MemoryController final : public CgroupMemoryController { @@ -71,8 +74,9 @@ class CgroupV1MemoryController final : public CgroupMemoryController { CgroupV1Controller _reader; CgroupV1Controller* reader() { return &_reader; } public: - bool is_hierarchical() { return _uses_mem_hierarchy; } - void set_subsystem_path(char *cgroup_path); + void set_subsystem_path(const char *cgroup_path) override { + reader()->set_subsystem_path(cgroup_path); + } 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; @@ -85,23 +89,22 @@ class CgroupV1MemoryController final : public CgroupMemoryController { jlong kernel_memory_limit_in_bytes(julong host_mem); jlong kernel_memory_max_usage_in_bytes(); void print_version_specific_info(outputStream* st, julong host_mem) override; + bool needs_hierarchy_adjustment() override { + return reader()->needs_hierarchy_adjustment(); + } bool is_read_only() override { return reader()->is_read_only(); } + const char* subsystem_path() override { return reader()->subsystem_path(); } + const char* mount_point() override { return reader()->mount_point(); } + const char* cgroup_path() override { return reader()->cgroup_path(); } private: - /* Some container runtimes set limits via cgroup - * hierarchy. If set to true consider also memory.stat - * file if everything else seems unlimited */ - bool _uses_mem_hierarchy; - jlong uses_mem_hierarchy(); - void set_hierarchical(bool value) { _uses_mem_hierarchy = value; } jlong read_mem_swappiness(); jlong read_mem_swap(julong host_total_memsw); public: CgroupV1MemoryController(const CgroupV1Controller& reader) - : _reader(reader), - _uses_mem_hierarchy(false) { + : _reader(reader) { } }; @@ -115,12 +118,22 @@ class CgroupV1CpuController final : public CgroupCpuController { int cpu_quota() override; int cpu_period() override; int cpu_shares() override; - void set_subsystem_path(char *cgroup_path) { + void set_subsystem_path(const char *cgroup_path) override { reader()->set_subsystem_path(cgroup_path); } bool is_read_only() override { return reader()->is_read_only(); } + const char* subsystem_path() override { + return reader()->subsystem_path(); + } + const char* mount_point() override { + return reader()->mount_point(); + } + bool needs_hierarchy_adjustment() override { + return reader()->needs_hierarchy_adjustment(); + } + const char* cgroup_path() override { return reader()->cgroup_path(); } public: CgroupV1CpuController(const CgroupV1Controller& reader) : _reader(reader) { @@ -130,6 +143,12 @@ class CgroupV1CpuController final : public CgroupCpuController { class CgroupV1Subsystem: public CgroupSubsystem { public: + CgroupV1Subsystem(CgroupV1Controller* cpuset, + CgroupV1CpuController* cpu, + CgroupV1Controller* cpuacct, + CgroupV1Controller* pids, + CgroupV1MemoryController* memory); + jlong kernel_memory_usage_in_bytes(); jlong kernel_memory_limit_in_bytes(); jlong kernel_memory_max_usage_in_bytes(); @@ -155,18 +174,6 @@ class CgroupV1Subsystem: public CgroupSubsystem { CgroupV1Controller* _cpuacct = nullptr; CgroupV1Controller* _pids = nullptr; - public: - CgroupV1Subsystem(CgroupV1Controller* cpuset, - CgroupV1CpuController* cpu, - CgroupV1Controller* cpuacct, - CgroupV1Controller* pids, - CgroupV1MemoryController* memory) : - _memory(new CachingCgroupController(memory)), - _cpuset(cpuset), - _cpu(new CachingCgroupController(cpu)), - _cpuacct(cpuacct), - _pids(pids) { - } }; #endif // CGROUP_V1_SUBSYSTEM_LINUX_HPP diff --git a/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp b/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp index 8f7e12d095474..62e8cac3a62b2 100644 --- a/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp +++ b/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp @@ -25,6 +25,22 @@ #include "cgroupV2Subsystem_linux.hpp" #include "cgroupUtil_linux.hpp" +// Constructor +CgroupV2Controller::CgroupV2Controller(char* mount_path, + char *cgroup_path, + bool ro) : _read_only(ro), + _path(construct_path(mount_path, cgroup_path)) { + _cgroup_path = os::strdup(cgroup_path); + _mount_point = os::strdup(mount_path); +} +// Shallow copy constructor +CgroupV2Controller::CgroupV2Controller(const CgroupV2Controller& o) : + _read_only(o._read_only), + _path(o._path) { + _cgroup_path = o._cgroup_path; + _mount_point = o._mount_point; +} + /* cpu_shares * * Return the amount of cpu shares available to the process @@ -95,6 +111,17 @@ int CgroupV2CpuController::cpu_quota() { return limit; } +// Constructor +CgroupV2Subsystem::CgroupV2Subsystem(CgroupV2MemoryController * memory, + CgroupV2CpuController* cpu, + CgroupV2Controller unified) : + _unified(unified) { + CgroupUtil::adjust_controller(memory); + CgroupUtil::adjust_controller(cpu); + _memory = new CachingCgroupController(memory); + _cpu = new CachingCgroupController(cpu); +} + bool CgroupV2Subsystem::is_containerized() { return _unified.is_read_only() && _memory->controller()->is_read_only() && @@ -264,6 +291,18 @@ jlong memory_swap_limit_value(CgroupV2Controller* ctrl) { return swap_limit; } +void CgroupV2Controller::set_subsystem_path(const char* cgroup_path) { + if (_path != nullptr) { + os::free(_path); + } + _path = construct_path(_mount_point, cgroup_path); +} + +// For cgv2 we only need hierarchy walk if the cgroup path isn't '/' (root) +bool CgroupV2Controller::needs_hierarchy_adjustment() { + return strcmp(_cgroup_path, "/") != 0; +} + void CgroupV2MemoryController::print_version_specific_info(outputStream* st, julong phys_mem) { jlong swap_current = memory_swap_current_value(reader()); jlong swap_limit = memory_swap_limit_value(reader()); @@ -272,7 +311,7 @@ void CgroupV2MemoryController::print_version_specific_info(outputStream* st, jul OSContainer::print_container_helper(st, swap_limit, "memory_swap_max_limit_in_bytes"); } -char* CgroupV2Controller::construct_path(char* mount_path, char *cgroup_path) { +char* CgroupV2Controller::construct_path(char* mount_path, const char* cgroup_path) { stringStream ss; ss.print_raw(mount_path); if (strcmp(cgroup_path, "/") != 0) { diff --git a/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp b/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp index cd100f298747c..527573644a816 100644 --- a/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp +++ b/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp @@ -26,39 +26,28 @@ #define CGROUP_V2_SUBSYSTEM_LINUX_HPP #include "cgroupSubsystem_linux.hpp" +#include "cgroupUtil_linux.hpp" class CgroupV2Controller: public CgroupController { private: - /* the mount path of the cgroup v2 hierarchy */ - char *_mount_path; - /* The cgroup path for the controller */ - char *_cgroup_path; bool _read_only; /* Constructed full path to the subsystem directory */ char *_path; - static char* construct_path(char* mount_path, char *cgroup_path); + static char* construct_path(char* mount_path, const char *cgroup_path); public: - CgroupV2Controller(char* mount_path, - char *cgroup_path, - bool ro) : _mount_path(os::strdup(mount_path)), - _cgroup_path(os::strdup(cgroup_path)), - _read_only(ro), - _path(construct_path(mount_path, cgroup_path)) { - } + CgroupV2Controller(char* mount_path, char *cgroup_path, bool ro); // Shallow copy constructor - CgroupV2Controller(const CgroupV2Controller& o) : - _mount_path(o._mount_path), - _cgroup_path(o._cgroup_path), - _read_only(o._read_only), - _path(o._path) { - } + CgroupV2Controller(const CgroupV2Controller& o); ~CgroupV2Controller() { // At least one controller exists with references to the paths } - char *subsystem_path() override { return _path; } + const char* subsystem_path() override { return _path; } + bool needs_hierarchy_adjustment() override; + // Allow for optional updates of the subsystem path + void set_subsystem_path(const char* cgroup_path); bool is_read_only() override { return _read_only; } }; @@ -75,6 +64,17 @@ class CgroupV2CpuController: public CgroupCpuController { bool is_read_only() override { return reader()->is_read_only(); } + const char* subsystem_path() { + return reader()->subsystem_path(); + } + bool needs_hierarchy_adjustment() override { + return reader()->needs_hierarchy_adjustment(); + } + void set_subsystem_path(const char* cgroup_path) { + reader()->set_subsystem_path(cgroup_path); + } + const char* mount_point() { return reader()->mount_point(); } + const char* cgroup_path() override { return reader()->cgroup_path(); } }; class CgroupV2MemoryController final: public CgroupMemoryController { @@ -97,6 +97,17 @@ class CgroupV2MemoryController final: public CgroupMemoryController { bool is_read_only() override { return reader()->is_read_only(); } + const char* subsystem_path() { + return reader()->subsystem_path(); + } + bool needs_hierarchy_adjustment() override { + return reader()->needs_hierarchy_adjustment(); + } + void set_subsystem_path(const char* cgroup_path) { + reader()->set_subsystem_path(cgroup_path); + } + const char* mount_point() { return reader()->mount_point(); } + const char* cgroup_path() override { return reader()->cgroup_path(); } }; class CgroupV2Subsystem: public CgroupSubsystem { @@ -110,13 +121,9 @@ class CgroupV2Subsystem: public CgroupSubsystem { CgroupV2Controller* unified() { return &_unified; } public: - CgroupV2Subsystem(CgroupV2MemoryController* memory, + CgroupV2Subsystem(CgroupV2MemoryController * memory, CgroupV2CpuController* cpu, - CgroupV2Controller unified) : - _unified(unified), - _memory(new CachingCgroupController(memory)), - _cpu(new CachingCgroupController(cpu)) { - } + CgroupV2Controller unified); char * cpu_cpuset_cpus() override; char * cpu_cpuset_memory_nodes() override; diff --git a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp index b80124cc34e43..f967fee930579 100644 --- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp +++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp @@ -103,14 +103,14 @@ #define ZFILENAME_HEAP "java_heap" // Preferred tmpfs mount points, ordered by priority -static const char* z_preferred_tmpfs_mountpoints[] = { +static const char* ZPreferredTmpfsMountpoints[] = { "/dev/shm", "/run/shm", nullptr }; // Preferred hugetlbfs mount points, ordered by priority -static const char* z_preferred_hugetlbfs_mountpoints[] = { +static const char* ZPreferredHugetlbfsMountpoints[] = { "/dev/hugepages", "/hugepages", nullptr @@ -226,8 +226,8 @@ int ZPhysicalMemoryBacking::create_file_fd(const char* name) const { ? ZFILESYSTEM_HUGETLBFS : ZFILESYSTEM_TMPFS; const char** const preferred_mountpoints = ZLargePages::is_explicit() - ? z_preferred_hugetlbfs_mountpoints - : z_preferred_tmpfs_mountpoints; + ? ZPreferredHugetlbfsMountpoints + : ZPreferredTmpfsMountpoints; // Find mountpoint ZMountPoint mountpoint(filesystem, preferred_mountpoints); diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index d4699567733b2..609317df45fc2 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -4602,7 +4602,7 @@ static void workaround_expand_exec_shield_cs_limit() { return; // No matter, we tried, best effort. } - MemTracker::record_virtual_memory_type((address)codebuf, mtInternal); + MemTracker::record_virtual_memory_tag((address)codebuf, mtInternal); log_info(os)("[CS limit NX emulation work-around, exec code at: %p]", codebuf); diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 26bff6c8bd4e6..60efdeb2ef59a 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -367,7 +367,7 @@ bool os::dir_is_empty(const char* path) { return result; } -static char* reserve_mmapped_memory(size_t bytes, char* requested_addr, MEMFLAGS flag) { +static char* reserve_mmapped_memory(size_t bytes, char* requested_addr, MemTag mem_tag) { char * addr; int flags = MAP_PRIVATE NOT_AIX( | MAP_NORESERVE ) | MAP_ANONYMOUS; if (requested_addr != nullptr) { @@ -382,7 +382,7 @@ static char* reserve_mmapped_memory(size_t bytes, char* requested_addr, MEMFLAGS flags, -1, 0); if (addr != MAP_FAILED) { - MemTracker::record_virtual_memory_reserve((address)addr, bytes, CALLER_PC, flag); + MemTracker::record_virtual_memory_reserve((address)addr, bytes, CALLER_PC, mem_tag); return addr; } return nullptr; @@ -495,7 +495,7 @@ char* os::reserve_memory_aligned(size_t size, size_t alignment, bool exec) { return chop_extra_memory(size, alignment, extra_base, extra_size); } -char* os::map_memory_to_file_aligned(size_t size, size_t alignment, int file_desc, MEMFLAGS flag) { +char* os::map_memory_to_file_aligned(size_t size, size_t alignment, int file_desc, MemTag mem_tag) { size_t extra_size = calculate_aligned_extra_size(size, alignment); // For file mapping, we do not call os:map_memory_to_file(size,fd) since: // - we later chop away parts of the mapping using os::release_memory and that could fail if the @@ -503,7 +503,7 @@ char* os::map_memory_to_file_aligned(size_t size, size_t alignment, int file_des // - The memory API os::reserve_memory uses is an implementation detail. It may (and usually is) // mmap but it also may System V shared memory which cannot be uncommitted as a whole, so // chopping off and unmapping excess bits back and front (see below) would not work. - char* extra_base = reserve_mmapped_memory(extra_size, nullptr, flag); + char* extra_base = reserve_mmapped_memory(extra_size, nullptr, mem_tag); if (extra_base == nullptr) { return nullptr; } diff --git a/src/hotspot/os/windows/memMapPrinter_windows.cpp b/src/hotspot/os/windows/memMapPrinter_windows.cpp new file mode 100644 index 0000000000000..eb6b24a9d139a --- /dev/null +++ b/src/hotspot/os/windows/memMapPrinter_windows.cpp @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "nmt/memMapPrinter.hpp" +#include "os_windows.hpp" +#include "runtime/vm_version.hpp" + +#include +#include +#include +#include + +/* maximum number of mapping records returned */ +static const int MAX_REGIONS_RETURNED = 1000000; + +class MappingInfo { +public: + stringStream _ap_buffer; + stringStream _state_buffer; + stringStream _protect_buffer; + stringStream _type_buffer; + char _file_name[MAX_PATH]; + + MappingInfo() {} + + void process(MEMORY_BASIC_INFORMATION& mem_info) { + _ap_buffer.reset(); + _state_buffer.reset(); + _protect_buffer.reset(); + _type_buffer.reset(); + get_protect_string(_ap_buffer, mem_info.AllocationProtect); + get_state_string(_state_buffer, mem_info); + get_protect_string(_protect_buffer, mem_info.Protect); + get_type_string(_type_buffer, mem_info); + _file_name[0] = 0; + if (mem_info.Type == MEM_IMAGE) { + HMODULE hModule = 0; + if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, static_cast(mem_info.AllocationBase), &hModule)) { + GetModuleFileName(hModule, _file_name, sizeof(_file_name)); + } + } + } + + void get_protect_string(outputStream& out, DWORD prot) { + const char read_c = prot & (PAGE_READONLY | PAGE_READWRITE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY) ? 'r' : '-'; + const char write_c = prot & (PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY) ? 'w' : '-'; + const char execute_c = prot & (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY) ? 'x' : '-'; + out.print("%c%c%c", read_c, write_c, execute_c); + if (prot & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)) { + out.put('c'); + } + if (prot & PAGE_GUARD) { + out.put('g'); + } + if (prot & PAGE_NOCACHE) { + out.put('n'); + } + if (prot & PAGE_WRITECOMBINE) { + out.put('W'); + } + const DWORD bits = PAGE_NOACCESS | PAGE_READONLY | PAGE_READWRITE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE + | PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY | PAGE_EXECUTE + | PAGE_GUARD | PAGE_NOCACHE | PAGE_WRITECOMBINE; + if ((prot & bits) != prot) { + out.print_cr("Unknown Windows memory protection value: 0x%x unknown bits: 0x%x", prot, prot & ~bits); + assert(false, "Unknown Windows memory protection value: 0x%x unknown bits: 0x%x", prot, prot & ~bits); + } + } + + void get_state_string(outputStream& out, MEMORY_BASIC_INFORMATION& mem_info) { + if (mem_info.State == MEM_COMMIT) { + out.put('c'); + } else if (mem_info.State == MEM_FREE) { + out.put('f'); + } else if (mem_info.State == MEM_RESERVE) { + out.put('r'); + } else { + out.print_cr("Unknown Windows memory state value: 0x%x", mem_info.State); + assert(false, "Unknown Windows memory state value: 0x%x", mem_info.State); + } + } + + void get_type_string(outputStream& out, MEMORY_BASIC_INFORMATION& mem_info) { + if (mem_info.Type == MEM_IMAGE) { + out.print("img"); + } else if (mem_info.Type == MEM_MAPPED) { + out.print("map"); + } else if (mem_info.Type == MEM_PRIVATE) { + out.print("pvt"); + } else if (mem_info.Type == 0 && mem_info.State == MEM_FREE) { + out.print("---"); + } else { + out.print_cr("Unknown Windows memory type 0x%x", mem_info.Type); + assert(false, "Unknown Windows memory type 0x%x", mem_info.Type); + } + } +}; + +class MappingInfoSummary { + unsigned _num_mappings; + size_t _total_region_size; // combined resident set size + size_t _total_committed; // combined committed size + class WinOsInfo : public os::win32 { + public: + static void printOsInfo(outputStream* st) { + st->print("OS:"); + os::win32::print_windows_version(st); + os::win32::print_uptime_info(st); + VM_Version::print_platform_virtualization_info(st); + os::print_memory_info(st); + } + }; +public: + MappingInfoSummary() : _num_mappings(0), _total_region_size(0), + _total_committed(0) {} + + void add_mapping(const MEMORY_BASIC_INFORMATION& mem_info, const MappingInfo& mapping_info) { + if (mem_info.State != MEM_FREE) { + _num_mappings++; + _total_region_size += mem_info.RegionSize; + _total_committed += mem_info.State == MEM_COMMIT ? mem_info.RegionSize : 0; + } + } + + void print_on(const MappingPrintSession& session) const { + outputStream* st = session.out(); + WinOsInfo::printOsInfo(st); + st->print_cr("current process reserved memory: " PROPERFMT, PROPERFMTARGS(_total_region_size)); + st->print_cr("current process committed memory: " PROPERFMT, PROPERFMTARGS(_total_committed)); + st->print_cr("current process region count: " PROPERFMT, PROPERFMTARGS(_num_mappings)); + } +}; + +class MappingInfoPrinter { + const MappingPrintSession& _session; +public: + MappingInfoPrinter(const MappingPrintSession& session) : + _session(session) + {} + + void print_single_mapping(const MEMORY_BASIC_INFORMATION& mem_info, const MappingInfo& mapping_info) const { + outputStream* st = _session.out(); +#define INDENT_BY(n) \ + if (st->fill_to(n) == 0) { \ + st->print(" "); \ + } + st->print(PTR_FORMAT "-" PTR_FORMAT, mem_info.BaseAddress, static_cast(mem_info.BaseAddress) + mem_info.RegionSize); + INDENT_BY(38); + st->print("%12zu", mem_info.RegionSize); + INDENT_BY(51); + st->print("%s", mapping_info._protect_buffer.base()); + INDENT_BY(57); + st->print("%s-%s", mapping_info._state_buffer.base(), mapping_info._type_buffer.base()); + INDENT_BY(63); + st->print("%#11llx", reinterpret_cast(mem_info.BaseAddress) - reinterpret_cast(mem_info.AllocationBase)); + INDENT_BY(72); + if (_session.print_nmt_info_for_region(mem_info.BaseAddress, static_cast(mem_info.BaseAddress) + mem_info.RegionSize)) { + st->print(" "); + } + st->print_raw(mapping_info._file_name); + #undef INDENT_BY + st->cr(); + } + + void print_legend() const { + outputStream* st = _session.out(); + st->print_cr("from, to, vsize: address range and size"); + st->print_cr("prot: protection:"); + st->print_cr(" rwx: read / write / execute"); + st->print_cr(" c: copy on write"); + st->print_cr(" g: guard"); + st->print_cr(" n: no cache"); + st->print_cr(" W: write combine"); + st->print_cr("state: region state and type:"); + st->print_cr(" state: committed / reserved"); + st->print_cr(" type: image / mapped / private"); + st->print_cr("file: file mapped, if mapping is not anonymous"); + st->print_cr("vm info: VM information (requires NMT)"); + { + streamIndentor si(st, 16); + _session.print_nmt_flag_legend(); + } + } + + void print_header() const { + outputStream* st = _session.out(); + // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 + // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + // 0x00007ffb24565000-0x00007ffb24a7e000 5345280 r-- c-img 0x1155000 C:\work\jdk\build\fastdebug\jdk\bin\server\jvm.dll + st->print_cr("from to vsize prot state offset vminfo/file"); + st->print_cr("==========================================================================================="); + } +}; + +void MemMapPrinter::pd_print_all_mappings(const MappingPrintSession& session) { + + HANDLE hProcess = GetCurrentProcess(); + + MappingInfoPrinter printer(session); + MappingInfoSummary summary; + + outputStream* const st = session.out(); + + printer.print_legend(); + st->cr(); + printer.print_header(); + + MEMORY_BASIC_INFORMATION mem_info; + MappingInfo mapping_info; + + int region_count = 0; + ::memset(&mem_info, 0, sizeof(mem_info)); + for (char* ptr = 0; VirtualQueryEx(hProcess, ptr, &mem_info, sizeof(mem_info)) == sizeof(mem_info); ) { + assert(mem_info.RegionSize > 0, "RegionSize is not greater than zero"); + if (++region_count > MAX_REGIONS_RETURNED) { + st->print_cr("limit of %d regions reached (results inaccurate)", region_count); + break; + } + mapping_info.process(mem_info); + if (mem_info.State != MEM_FREE) { + printer.print_single_mapping(mem_info, mapping_info); + summary.add_mapping(mem_info, mapping_info); + } + ptr += mem_info.RegionSize; + ::memset(&mem_info, 0, sizeof(mem_info)); + } + st->cr(); + summary.print_on(session); + st->cr(); +} diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index a1e0a78837f74..817757f1ac6a2 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1947,7 +1947,10 @@ void os::win32::print_windows_version(outputStream* st) { // - 2016 GA 10/2016 build: 14393 // - 2019 GA 11/2018 build: 17763 // - 2022 GA 08/2021 build: 20348 - if (build_number > 20347) { + // - 2025 Preview build : 26040 + if (build_number > 26039) { + st->print("Server 2025"); + } else if (build_number > 20347) { st->print("Server 2022"); } else if (build_number > 17762) { st->print("Server 2019"); @@ -3428,7 +3431,7 @@ char* os::replace_existing_mapping_with_file_mapping(char* base, size_t size, in // Multiple threads can race in this code but it's not possible to unmap small sections of // virtual space to get requested alignment, like posix-like os's. // Windows prevents multiple thread from remapping over each other so this loop is thread-safe. -static char* map_or_reserve_memory_aligned(size_t size, size_t alignment, int file_desc, MEMFLAGS flag = mtNone) { +static char* map_or_reserve_memory_aligned(size_t size, size_t alignment, int file_desc, MemTag mem_tag = mtNone) { assert(is_aligned(alignment, os::vm_allocation_granularity()), "Alignment must be a multiple of allocation granularity (page size)"); assert(is_aligned(size, os::vm_allocation_granularity()), @@ -3441,8 +3444,8 @@ static char* map_or_reserve_memory_aligned(size_t size, size_t alignment, int fi static const int max_attempts = 20; for (int attempt = 0; attempt < max_attempts && aligned_base == nullptr; attempt ++) { - char* extra_base = file_desc != -1 ? os::map_memory_to_file(extra_size, file_desc, flag) : - os::reserve_memory(extra_size, false, flag); + char* extra_base = file_desc != -1 ? os::map_memory_to_file(extra_size, file_desc, mem_tag) : + os::reserve_memory(extra_size, false, mem_tag); if (extra_base == nullptr) { return nullptr; } @@ -3458,8 +3461,8 @@ static char* map_or_reserve_memory_aligned(size_t size, size_t alignment, int fi // Attempt to map, into the just vacated space, the slightly smaller aligned area. // Which may fail, hence the loop. - aligned_base = file_desc != -1 ? os::attempt_map_memory_to_file_at(aligned_base, size, file_desc, flag) : - os::attempt_reserve_memory_at(aligned_base, size, false, flag); + aligned_base = file_desc != -1 ? os::attempt_map_memory_to_file_at(aligned_base, size, file_desc, mem_tag) : + os::attempt_reserve_memory_at(aligned_base, size, false, mem_tag); } assert(aligned_base != nullptr, @@ -3473,8 +3476,8 @@ char* os::reserve_memory_aligned(size_t size, size_t alignment, bool exec) { return map_or_reserve_memory_aligned(size, alignment, -1 /* file_desc */); } -char* os::map_memory_to_file_aligned(size_t size, size_t alignment, int fd, MEMFLAGS flag) { - return map_or_reserve_memory_aligned(size, alignment, fd, flag); +char* os::map_memory_to_file_aligned(size_t size, size_t alignment, int fd, MemTag mem_tag) { + return map_or_reserve_memory_aligned(size, alignment, fd, mem_tag); } char* os::pd_reserve_memory(size_t bytes, bool exec) { @@ -4090,6 +4093,39 @@ int os::win32::_build_minor = 0; bool os::win32::_processor_group_warning_displayed = false; bool os::win32::_job_object_processor_group_warning_displayed = false; +void getWindowsInstallationType(char* buffer, int bufferSize) { + HKEY hKey; + const char* subKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; + const char* valueName = "InstallationType"; + + DWORD valueLength = bufferSize; + + // Initialize buffer with empty string + buffer[0] = '\0'; + + // Open the registry key + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) { + // Return empty buffer if key cannot be opened + return; + } + + // Query the value + if (RegQueryValueExA(hKey, valueName, NULL, NULL, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) { + RegCloseKey(hKey); + buffer[0] = '\0'; + return; + } + + RegCloseKey(hKey); +} + +bool isNanoServer() { + const int BUFFER_SIZE = 256; + char installationType[BUFFER_SIZE]; + getWindowsInstallationType(installationType, BUFFER_SIZE); + return (strcmp(installationType, "Nano Server") == 0); +} + void os::win32::initialize_windows_version() { assert(_major_version == 0, "windows version already initialized."); @@ -4107,7 +4143,13 @@ void os::win32::initialize_windows_version() { warning("Attempt to determine system directory failed: %s", buf_len != 0 ? error_msg_buffer : ""); return; } - strncat(kernel32_path, "\\kernel32.dll", MAX_PATH - ret); + + if (isNanoServer()) { + // On Windows Nanoserver the kernel32.dll is located in the forwarders subdirectory + strncat(kernel32_path, "\\forwarders\\kernel32.dll", MAX_PATH - ret); + } else { + strncat(kernel32_path, "\\kernel32.dll", MAX_PATH - ret); + } DWORD version_size = GetFileVersionInfoSize(kernel32_path, nullptr); if (version_size == 0) { diff --git a/src/hotspot/os/windows/os_windows.inline.hpp b/src/hotspot/os/windows/os_windows.inline.hpp index 3aa88c36958a7..e9b30a33dfdbf 100644 --- a/src/hotspot/os/windows/os_windows.inline.hpp +++ b/src/hotspot/os/windows/os_windows.inline.hpp @@ -49,12 +49,17 @@ inline void os::map_stack_shadow_pages(address sp) { // If we decrement stack pointer more than one page // the OS may not map an intervening page into our space // and may fault on a memory access to interior of our frame. + address original_sp = sp; const size_t page_size = os::vm_page_size(); const size_t n_pages = StackOverflow::stack_shadow_zone_size() / page_size; for (size_t pages = 1; pages <= n_pages; pages++) { sp -= page_size; *sp = 0; } + StackOverflow* state = JavaThread::current()->stack_overflow_state(); + assert(original_sp > state->shadow_zone_safe_limit(), "original_sp=" INTPTR_FORMAT ", " + "shadow_zone_safe_limit=" INTPTR_FORMAT, p2i(original_sp), p2i(state->shadow_zone_safe_limit())); + state->set_shadow_zone_growth_watermark(original_sp); } inline bool os::numa_has_group_homing() { return false; } diff --git a/src/hotspot/share/adlc/adlArena.cpp b/src/hotspot/share/adlc/adlArena.cpp index d29a255a905ae..d5a1dd500fa66 100644 --- a/src/hotspot/share/adlc/adlArena.cpp +++ b/src/hotspot/share/adlc/adlArena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -45,6 +45,7 @@ void* AdlReAllocateHeap(void* old_ptr, size_t size) { } void* AdlChunk::operator new(size_t requested_size, size_t length) throw() { + assert(requested_size <= SIZE_MAX - length, "overflow"); return AdlCHeapObj::operator new(requested_size + length); } @@ -129,6 +130,7 @@ void* AdlArena::grow( size_t x ) { //------------------------------calloc----------------------------------------- // Allocate zeroed storage in AdlArena void *AdlArena::Acalloc( size_t items, size_t x ) { + assert(items <= SIZE_MAX / x, "overflow"); size_t z = items*x; // Total size needed void *ptr = Amalloc(z); // Get space memset( ptr, 0, z ); // Zap space @@ -136,21 +138,26 @@ void *AdlArena::Acalloc( size_t items, size_t x ) { } //------------------------------realloc---------------------------------------- +static size_t pointer_delta(const void *left, const void *right) { + assert(left >= right, "pointer delta underflow"); + return (uintptr_t)left - (uintptr_t)right; +} + // Reallocate storage in AdlArena. void *AdlArena::Arealloc( void *old_ptr, size_t old_size, size_t new_size ) { char *c_old = (char*)old_ptr; // Handy name - // Stupid fast special case - if( new_size <= old_size ) { // Shrink in-place - if( c_old+old_size == _hwm) // Attempt to free the excess bytes - _hwm = c_old+new_size; // Adjust hwm - return c_old; - } - // See if we can resize in-place - if( (c_old+old_size == _hwm) && // Adjusting recent thing - (c_old+new_size <= _max) ) { // Still fits where it sits - _hwm = c_old+new_size; // Adjust hwm - return c_old; // Return old pointer + // Reallocating the latest allocation? + if (c_old + old_size == _hwm) { + assert(_chunk->bottom() <= c_old, "invariant"); + + // Reallocate in place if it fits. Also handles shrinking + if (pointer_delta(_max, c_old) >= new_size) { + _hwm = c_old + new_size; + return c_old; + } + } else if (new_size <= old_size) { // Shrink in place + return c_old; } // Oops, got to relocate guts diff --git a/src/hotspot/share/adlc/adlArena.hpp b/src/hotspot/share/adlc/adlArena.hpp index 254f414f707c2..2e8d8ae8ae2f9 100644 --- a/src/hotspot/share/adlc/adlArena.hpp +++ b/src/hotspot/share/adlc/adlArena.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -105,8 +105,10 @@ class AdlArena: public AdlCHeapObj { // Fast allocate in the arena. Common case is: pointer test + increment. void* Amalloc(size_t x) { #ifdef _LP64 + assert(x <= SIZE_MAX - (8-1), "overflow"); x = (x + (8-1)) & ((unsigned)(-8)); #else + assert(x <= SIZE_MAX - (4-1), "overflow"); x = (x + (4-1)) & ((unsigned)(-4)); #endif if (_hwm + x > _max) { diff --git a/src/hotspot/share/asm/register.hpp b/src/hotspot/share/asm/register.hpp index 7dfc9b03f878d..6078edecb4ad1 100644 --- a/src/hotspot/share/asm/register.hpp +++ b/src/hotspot/share/asm/register.hpp @@ -276,19 +276,23 @@ inline constexpr bool different_registers(R first_register, Rx... more_registers } template -inline void assert_different_registers(R first_register, Rx... more_registers) { +inline void assert_different_registers_impl(const char* file, int line, R first_register, Rx... more_registers) { #ifdef ASSERT if (!different_registers(first_register, more_registers...)) { const R regs[] = { first_register, more_registers... }; // Find a duplicate entry. for (size_t i = 0; i < ARRAY_SIZE(regs) - 1; ++i) { for (size_t j = i + 1; j < ARRAY_SIZE(regs); ++j) { - assert(!regs[i]->is_valid() || regs[i] != regs[j], - "Multiple uses of register: %s", regs[i]->name()); + if (regs[i]->is_valid()) { + assert_with_file_and_line(regs[i] != regs[j], file, line, "regs[%zu] and regs[%zu] are both: %s", + i, j, regs[i]->name()); + } } } } #endif } +#define assert_different_registers(...) assert_different_registers_impl(__FILE__, __LINE__, __VA_ARGS__) + #endif // SHARE_ASM_REGISTER_HPP diff --git a/src/hotspot/share/c1/c1_CodeStubs.hpp b/src/hotspot/share/c1/c1_CodeStubs.hpp index 04e379842e152..9abfa45785bda 100644 --- a/src/hotspot/share/c1/c1_CodeStubs.hpp +++ b/src/hotspot/share/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -264,10 +264,10 @@ class NewInstanceStub: public CodeStub { LIR_Opr _klass_reg; LIR_Opr _result; CodeEmitInfo* _info; - Runtime1::StubID _stub_id; + C1StubId _stub_id; public: - NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id); + NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id); virtual void emit_code(LIR_Assembler* e); virtual CodeEmitInfo* info() const { return _info; } virtual void visit(LIR_OpVisitState* visitor) { @@ -515,11 +515,11 @@ class DeoptimizeStub : public CodeStub { class SimpleExceptionStub: public CodeStub { private: LIR_Opr _obj; - Runtime1::StubID _stub; + C1StubId _stub; CodeEmitInfo* _info; public: - SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info): + SimpleExceptionStub(C1StubId stub, LIR_Opr obj, CodeEmitInfo* info): _obj(obj), _stub(stub), _info(info) { FrameMap* f = Compilation::current()->frame_map(); f->update_reserved_argument_area_size(2 * BytesPerWord); @@ -546,7 +546,7 @@ class SimpleExceptionStub: public CodeStub { class ArrayStoreExceptionStub: public SimpleExceptionStub { public: - ArrayStoreExceptionStub(LIR_Opr obj, CodeEmitInfo* info): SimpleExceptionStub(Runtime1::throw_array_store_exception_id, obj, info) {} + ArrayStoreExceptionStub(LIR_Opr obj, CodeEmitInfo* info): SimpleExceptionStub(C1StubId::throw_array_store_exception_id, obj, info) {} #ifndef PRODUCT virtual void print_name(outputStream* out) const { out->print("ArrayStoreExceptionStub"); } #endif // PRODUCT diff --git a/src/hotspot/share/c1/c1_Compilation.cpp b/src/hotspot/share/c1/c1_Compilation.cpp index 48201a8605376..7e0d439aff4ef 100644 --- a/src/hotspot/share/c1/c1_Compilation.cpp +++ b/src/hotspot/share/c1/c1_Compilation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -274,8 +274,6 @@ void Compilation::emit_lir() { // Assign physical registers to LIR operands using a linear scan algorithm. allocator->do_linear_scan(); CHECK_BAILOUT(); - - _max_spills = allocator->max_spills(); } if (BailoutAfterLIR) { @@ -568,7 +566,6 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho , _method(method) , _osr_bci(osr_bci) , _hir(nullptr) -, _max_spills(-1) , _frame_map(nullptr) , _masm(nullptr) , _has_exception_handlers(false) diff --git a/src/hotspot/share/c1/c1_Compilation.hpp b/src/hotspot/share/c1/c1_Compilation.hpp index d55a8debca72c..0ac0a4d4169ab 100644 --- a/src/hotspot/share/c1/c1_Compilation.hpp +++ b/src/hotspot/share/c1/c1_Compilation.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -73,7 +73,6 @@ class Compilation: public StackObj { ciMethod* _method; int _osr_bci; IR* _hir; - int _max_spills; FrameMap* _frame_map; C1_MacroAssembler* _masm; bool _has_exception_handlers; @@ -151,7 +150,6 @@ class Compilation: public StackObj { int osr_bci() const { return _osr_bci; } bool is_osr_compile() const { return osr_bci() >= 0; } IR* hir() const { return _hir; } - int max_spills() const { return _max_spills; } FrameMap* frame_map() const { return _frame_map; } CodeBuffer* code() { return &_code; } C1_MacroAssembler* masm() const { return _masm; } diff --git a/src/hotspot/share/c1/c1_Compiler.cpp b/src/hotspot/share/c1/c1_Compiler.cpp index e1c4e90d0637d..a0944c864e68f 100644 --- a/src/hotspot/share/c1/c1_Compiler.cpp +++ b/src/hotspot/share/c1/c1_Compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -167,6 +167,9 @@ bool Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + #if defined(AMD64) + case vmIntrinsics::_dtanh: + #endif case vmIntrinsics::_dlog: case vmIntrinsics::_dlog10: case vmIntrinsics::_dexp: diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index a2e903edc342f..02be6f8d49e4a 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -3339,6 +3339,7 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) case vmIntrinsics::_dsin : // fall through case vmIntrinsics::_dcos : // fall through case vmIntrinsics::_dtan : // fall through + case vmIntrinsics::_dtanh : // fall through case vmIntrinsics::_dlog : // fall through case vmIntrinsics::_dlog10 : // fall through case vmIntrinsics::_dexp : // fall through diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index 5d73ab5b88dba..d9c3e9d3cb68f 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -2033,8 +2033,9 @@ class LIR_OpProfileCall : public LIR_Op { virtual void print_instr(outputStream* out) const PRODUCT_RETURN; bool should_profile_receiver_type() const { bool callee_is_static = _profiled_callee->is_loaded() && _profiled_callee->is_static(); + bool callee_is_private = _profiled_callee->is_loaded() && _profiled_callee->is_private(); Bytecodes::Code bc = _profiled_method->java_code_at_bci(_profiled_bci); - bool call_is_virtual = (bc == Bytecodes::_invokevirtual && !_profiled_callee->can_be_statically_bound()) || bc == Bytecodes::_invokeinterface; + bool call_is_virtual = (bc == Bytecodes::_invokevirtual && !callee_is_private) || bc == Bytecodes::_invokeinterface; return C1ProfileVirtualCalls && call_is_virtual && !callee_is_static; } }; diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 7b519804bfecd..74fdf7a5b76a3 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -659,7 +659,7 @@ void LIRGenerator::new_instance(LIR_Opr dst, ciInstanceKlass* klass, bool is_unr if (UseFastNewInstance && klass->is_loaded() && !Klass::layout_helper_needs_slow_path(klass->layout_helper())) { - Runtime1::StubID stub_id = klass->is_initialized() ? Runtime1::fast_new_instance_id : Runtime1::fast_new_instance_init_check_id; + C1StubId stub_id = klass->is_initialized() ? C1StubId::fast_new_instance_id : C1StubId::fast_new_instance_init_check_id; CodeStub* slow_path = new NewInstanceStub(klass_reg, dst, klass, info, stub_id); @@ -670,7 +670,7 @@ void LIRGenerator::new_instance(LIR_Opr dst, ciInstanceKlass* klass, bool is_unr __ allocate_object(dst, scratch1, scratch2, scratch3, scratch4, oopDesc::header_size(), instance_size, klass_reg, !klass->is_initialized(), slow_path); } else { - CodeStub* slow_path = new NewInstanceStub(klass_reg, dst, klass, info, Runtime1::new_instance_id); + CodeStub* slow_path = new NewInstanceStub(klass_reg, dst, klass, info, C1StubId::new_instance_id); __ branch(lir_cond_always, slow_path); __ branch_destination(slow_path->continuation()); } @@ -1479,7 +1479,7 @@ void LIRGenerator::do_RegisterFinalizer(Intrinsic* x) { args->append(receiver.result()); CodeEmitInfo* info = state_for(x, x->state()); call_runtime(&signature, args, - CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::register_finalizer_id)), + CAST_FROM_FN_PTR(address, Runtime1::entry_for(C1StubId::register_finalizer_id)), voidType, info); set_no_result(x); @@ -2971,6 +2971,7 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { case vmIntrinsics::_dsqrt: // fall through case vmIntrinsics::_dsqrt_strict: // fall through case vmIntrinsics::_dtan: // fall through + case vmIntrinsics::_dtanh: // fall through case vmIntrinsics::_dsin : // fall through case vmIntrinsics::_dcos : // fall through case vmIntrinsics::_dexp : // fall through diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index 8524f37177b45..915f00f77c523 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -109,10 +109,13 @@ void StubAssembler::set_num_rt_args(int args) { // Implementation of Runtime1 -CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids]; +CodeBlob* Runtime1::_blobs[(int)C1StubId::NUM_STUBIDS]; + +#define C1_BLOB_NAME_DEFINE(name) "C1 Runtime " # name "_blob", const char *Runtime1::_blob_names[] = { - RUNTIME1_STUBS(STUB_NAME, LAST_STUB_NAME) + C1_STUBS_DO(C1_BLOB_NAME_DEFINE) }; +#undef C1_STUB_NAME_DEFINE #ifndef PRODUCT // statistics @@ -190,17 +193,17 @@ static void deopt_caller(JavaThread* current) { } } -class StubIDStubAssemblerCodeGenClosure: public StubAssemblerCodeGenClosure { +class C1StubIdStubAssemblerCodeGenClosure: public StubAssemblerCodeGenClosure { private: - Runtime1::StubID _id; + C1StubId _id; public: - StubIDStubAssemblerCodeGenClosure(Runtime1::StubID id) : _id(id) {} + C1StubIdStubAssemblerCodeGenClosure(C1StubId id) : _id(id) {} virtual OopMapSet* generate_code(StubAssembler* sasm) { return Runtime1::generate_code_for(_id, sasm); } }; -CodeBlob* Runtime1::generate_blob(BufferBlob* buffer_blob, int stub_id, const char* name, bool expect_oop_map, StubAssemblerCodeGenClosure* cl) { +CodeBlob* Runtime1::generate_blob(BufferBlob* buffer_blob, C1StubId id, const char* name, bool expect_oop_map, StubAssemblerCodeGenClosure* cl) { ResourceMark rm; // create code buffer for code storage CodeBuffer code(buffer_blob); @@ -212,7 +215,7 @@ CodeBlob* Runtime1::generate_blob(BufferBlob* buffer_blob, int stub_id, const ch Compilation::setup_code_buffer(&code, 0); // create assembler for code generation - StubAssembler* sasm = new StubAssembler(&code, name, stub_id); + StubAssembler* sasm = new StubAssembler(&code, name, (int)id); // generate code for runtime stub oop_maps = cl->generate_code(sasm); assert(oop_maps == nullptr || sasm->frame_size() != no_frame_size, @@ -237,40 +240,41 @@ CodeBlob* Runtime1::generate_blob(BufferBlob* buffer_blob, int stub_id, const ch return blob; } -void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) { - assert(0 <= id && id < number_of_ids, "illegal stub id"); +void Runtime1::generate_blob_for(BufferBlob* buffer_blob, C1StubId id) { + assert(C1StubId::NO_STUBID < id && id < C1StubId::NUM_STUBIDS, "illegal stub id"); bool expect_oop_map = true; #ifdef ASSERT // Make sure that stubs that need oopmaps have them switch (id) { // These stubs don't need to have an oopmap - case dtrace_object_alloc_id: - case slow_subtype_check_id: - case fpu2long_stub_id: - case unwind_exception_id: - case counter_overflow_id: + case C1StubId::dtrace_object_alloc_id: + case C1StubId::slow_subtype_check_id: + case C1StubId::fpu2long_stub_id: + case C1StubId::unwind_exception_id: + case C1StubId::counter_overflow_id: expect_oop_map = false; break; default: break; } #endif - StubIDStubAssemblerCodeGenClosure cl(id); + C1StubIdStubAssemblerCodeGenClosure cl(id); CodeBlob* blob = generate_blob(buffer_blob, id, name_for(id), expect_oop_map, &cl); // install blob - _blobs[id] = blob; + _blobs[(int)id] = blob; } void Runtime1::initialize(BufferBlob* blob) { // platform-dependent initialization initialize_pd(); // generate stubs - for (int id = 0; id < number_of_ids; id++) generate_blob_for(blob, (StubID)id); + int limit = (int)C1StubId::NUM_STUBIDS; + for (int id = 0; id < limit; id++) generate_blob_for(blob, (C1StubId)id); // printing #ifndef PRODUCT if (PrintSimpleStubs) { ResourceMark rm; - for (int id = 0; id < number_of_ids; id++) { + for (int id = 0; id < limit; id++) { _blobs[id]->print(); if (_blobs[id]->oop_maps() != nullptr) { _blobs[id]->oop_maps()->print(); @@ -282,20 +286,22 @@ void Runtime1::initialize(BufferBlob* blob) { bs->generate_c1_runtime_stubs(blob); } -CodeBlob* Runtime1::blob_for(StubID id) { - assert(0 <= id && id < number_of_ids, "illegal stub id"); - return _blobs[id]; +CodeBlob* Runtime1::blob_for(C1StubId id) { + assert(C1StubId::NO_STUBID < id && id < C1StubId::NUM_STUBIDS, "illegal stub id"); + return _blobs[(int)id]; } -const char* Runtime1::name_for(StubID id) { - assert(0 <= id && id < number_of_ids, "illegal stub id"); - return _blob_names[id]; +const char* Runtime1::name_for(C1StubId id) { + assert(C1StubId::NO_STUBID < id && id < C1StubId::NUM_STUBIDS, "illegal stub id"); + return _blob_names[(int)id]; } const char* Runtime1::name_for_address(address entry) { - for (int id = 0; id < number_of_ids; id++) { - if (entry == entry_for((StubID)id)) return name_for((StubID)id); + int limit = (int)C1StubId::NUM_STUBIDS; + for (int i = 0; i < limit; i++) { + C1StubId id = (C1StubId)i; + if (entry == entry_for(id)) return name_for(id); } #define FUNCTION_CASE(a, f) \ @@ -341,6 +347,7 @@ const char* Runtime1::name_for_address(address entry) { FUNCTION_CASE(entry, StubRoutines::dsin()); FUNCTION_CASE(entry, StubRoutines::dcos()); FUNCTION_CASE(entry, StubRoutines::dtan()); + FUNCTION_CASE(entry, StubRoutines::dtanh()); #undef FUNCTION_CASE @@ -425,8 +432,8 @@ JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* current, Klass* klass, int JRT_END -JRT_ENTRY(void, Runtime1::unimplemented_entry(JavaThread* current, StubID id)) - tty->print_cr("Runtime1::entry_for(%d) returned unimplemented entry point", id); +JRT_ENTRY(void, Runtime1::unimplemented_entry(JavaThread* current, C1StubId id)) + tty->print_cr("Runtime1::entry_for(%d) returned unimplemented entry point", (int)id); JRT_END @@ -525,8 +532,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* c // This function is called when we are about to throw an exception. Therefore, // we have to poll the stack watermark barrier to make sure that not yet safe // stack frames are made safe before returning into them. - if (current->last_frame().cb() == Runtime1::blob_for(Runtime1::handle_exception_from_callee_id)) { - // The Runtime1::handle_exception_from_callee_id handler is invoked after the + if (current->last_frame().cb() == Runtime1::blob_for(C1StubId::handle_exception_from_callee_id)) { + // The C1StubId::handle_exception_from_callee_id handler is invoked after the // frame has been unwound. It instead builds its own stub frame, to call the // runtime. But the throwing frame has already been unwound here. StackWatermarkSet::after_unwind(current); @@ -922,7 +929,7 @@ static Klass* resolve_field_return_klass(const methodHandle& caller, int bci, TR // Therefore, if there is any chance of a race condition, we try to // patch only naturally aligned words, as single, full-word writes. -JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_id )) +JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, C1StubId stub_id )) #ifndef PRODUCT if (PrintC1Statistics) { _patch_code_slowcase_cnt++; @@ -959,9 +966,9 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ Handle mirror(current, nullptr); // oop needed by load_mirror_patching code Handle appendix(current, nullptr); // oop needed by appendix_patching code bool load_klass_or_mirror_patch_id = - (stub_id == Runtime1::load_klass_patching_id || stub_id == Runtime1::load_mirror_patching_id); + (stub_id == C1StubId::load_klass_patching_id || stub_id == C1StubId::load_mirror_patching_id); - if (stub_id == Runtime1::access_field_patching_id) { + if (stub_id == C1StubId::access_field_patching_id) { Bytecode_field field_access(caller_method, bci); fieldDescriptor result; // initialize class if needed @@ -1044,7 +1051,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ default: fatal("unexpected bytecode for load_klass_or_mirror_patch_id"); } load_klass = k; - } else if (stub_id == load_appendix_patching_id) { + } else if (stub_id == C1StubId::load_appendix_patching_id) { Bytecode_invoke bytecode(caller_method, bci); Bytecodes::Code bc = bytecode.invoke_code(); @@ -1128,7 +1135,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ if (TracePatching) { ttyLocker ttyl; tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, - p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); + p2i(instr_pc), (stub_id == C1StubId::access_field_patching_id) ? "field" : "klass"); nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc()); assert(caller_code != nullptr, "nmethod not found"); @@ -1144,7 +1151,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ } // depending on the code below, do_patch says whether to copy the patch body back into the nmethod bool do_patch = true; - if (stub_id == Runtime1::access_field_patching_id) { + if (stub_id == C1StubId::access_field_patching_id) { // The offset may not be correct if the class was not loaded at code generation time. // Set it now. NativeMovRegMem* n_move = nativeMovRegMem_at(copy_buff); @@ -1170,7 +1177,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ assert(n_copy->data() == 0 || n_copy->data() == (intptr_t)Universe::non_oop_word(), "illegal init value"); - if (stub_id == Runtime1::load_klass_patching_id) { + if (stub_id == C1StubId::load_klass_patching_id) { assert(load_klass != nullptr, "klass not set"); n_copy->set_data((intx) (load_klass)); } else { @@ -1182,7 +1189,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ Disassembler::decode(copy_buff, copy_buff + *byte_count, tty); } } - } else if (stub_id == Runtime1::load_appendix_patching_id) { + } else if (stub_id == C1StubId::load_appendix_patching_id) { NativeMovConstReg* n_copy = nativeMovConstReg_at(copy_buff); assert(n_copy->data() == 0 || n_copy->data() == (intptr_t)Universe::non_oop_word(), @@ -1201,7 +1208,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ // first replace the tail, then the call #ifdef ARM if((load_klass_or_mirror_patch_id || - stub_id == Runtime1::load_appendix_patching_id) && + stub_id == C1StubId::load_appendix_patching_id) && nativeMovConstReg_at(copy_buff)->is_pc_relative()) { nmethod* nm = CodeCache::find_nmethod(instr_pc); address addr = nullptr; @@ -1209,13 +1216,13 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ RelocIterator mds(nm, copy_buff, copy_buff + 1); while (mds.next()) { if (mds.type() == relocInfo::oop_type) { - assert(stub_id == Runtime1::load_mirror_patching_id || - stub_id == Runtime1::load_appendix_patching_id, "wrong stub id"); + assert(stub_id == C1StubId::load_mirror_patching_id || + stub_id == C1StubId::load_appendix_patching_id, "wrong stub id"); oop_Relocation* r = mds.oop_reloc(); addr = (address)r->oop_addr(); break; } else if (mds.type() == relocInfo::metadata_type) { - assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id"); + assert(stub_id == C1StubId::load_klass_patching_id, "wrong stub id"); metadata_Relocation* r = mds.metadata_reloc(); addr = (address)r->metadata_addr(); break; @@ -1238,9 +1245,9 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ NativeGeneralJump::replace_mt_safe(instr_pc, copy_buff); if (load_klass_or_mirror_patch_id || - stub_id == Runtime1::load_appendix_patching_id) { + stub_id == C1StubId::load_appendix_patching_id) { relocInfo::relocType rtype = - (stub_id == Runtime1::load_klass_patching_id) ? + (stub_id == C1StubId::load_klass_patching_id) ? relocInfo::metadata_type : relocInfo::oop_type; // update relocInfo to metadata @@ -1278,9 +1285,9 @@ JRT_END #else // DEOPTIMIZE_WHEN_PATCHING -static bool is_patching_needed(JavaThread* current, Runtime1::StubID stub_id) { - if (stub_id == Runtime1::load_klass_patching_id || - stub_id == Runtime1::load_mirror_patching_id) { +static bool is_patching_needed(JavaThread* current, C1StubId stub_id) { + if (stub_id == C1StubId::load_klass_patching_id || + stub_id == C1StubId::load_mirror_patching_id) { // last java frame on stack vframeStream vfst(current, true); assert(!vfst.at_end(), "Java frame must exist"); @@ -1309,7 +1316,7 @@ static bool is_patching_needed(JavaThread* current, Runtime1::StubID stub_id) { return true; } -void Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_id) { +void Runtime1::patch_code(JavaThread* current, C1StubId stub_id) { #ifndef PRODUCT if (PrintC1Statistics) { _patch_code_slowcase_cnt++; @@ -1364,7 +1371,7 @@ int Runtime1::move_klass_patching(JavaThread* current) { { // Enter VM mode ResetNoHandleMark rnhm; - patch_code(current, load_klass_patching_id); + patch_code(current, C1StubId::load_klass_patching_id); } // Back in JAVA, use no oops DON'T safepoint @@ -1381,7 +1388,7 @@ int Runtime1::move_mirror_patching(JavaThread* current) { { // Enter VM mode ResetNoHandleMark rnhm; - patch_code(current, load_mirror_patching_id); + patch_code(current, C1StubId::load_mirror_patching_id); } // Back in JAVA, use no oops DON'T safepoint @@ -1398,7 +1405,7 @@ int Runtime1::move_appendix_patching(JavaThread* current) { { // Enter VM mode ResetNoHandleMark rnhm; - patch_code(current, load_appendix_patching_id); + patch_code(current, C1StubId::load_appendix_patching_id); } // Back in JAVA, use no oops DON'T safepoint @@ -1425,7 +1432,7 @@ int Runtime1::access_field_patching(JavaThread* current) { { // Enter VM mode ResetNoHandleMark rnhm; - patch_code(current, access_field_patching_id); + patch_code(current, C1StubId::access_field_patching_id); } // Back in JAVA, use no oops DON'T safepoint diff --git a/src/hotspot/share/c1/c1_Runtime1.hpp b/src/hotspot/share/c1/c1_Runtime1.hpp index 2e4c9f8a73379..330c40675041b 100644 --- a/src/hotspot/share/c1/c1_Runtime1.hpp +++ b/src/hotspot/share/c1/c1_Runtime1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "memory/allStatic.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/stubDeclarations.hpp" class StubAssembler; @@ -37,61 +38,26 @@ class StubAssembler; // runtime routines needed by code code generated // by the Compiler1. -#define RUNTIME1_STUBS(stub, last_entry) \ - stub(dtrace_object_alloc) \ - stub(unwind_exception) \ - stub(forward_exception) \ - stub(throw_range_check_failed) /* throws ArrayIndexOutOfBoundsException */ \ - stub(throw_index_exception) /* throws IndexOutOfBoundsException */ \ - stub(throw_div0_exception) \ - stub(throw_null_pointer_exception) \ - stub(register_finalizer) \ - stub(new_instance) \ - stub(fast_new_instance) \ - stub(fast_new_instance_init_check) \ - stub(new_type_array) \ - stub(new_object_array) \ - stub(new_multi_array) \ - stub(handle_exception_nofpu) /* optimized version that does not preserve fpu registers */ \ - stub(handle_exception) \ - stub(handle_exception_from_callee) \ - stub(throw_array_store_exception) \ - stub(throw_class_cast_exception) \ - stub(throw_incompatible_class_change_error) \ - stub(slow_subtype_check) \ - stub(monitorenter) \ - stub(monitorenter_nofpu) /* optimized version that does not preserve fpu registers */ \ - stub(monitorexit) \ - stub(monitorexit_nofpu) /* optimized version that does not preserve fpu registers */ \ - stub(deoptimize) \ - stub(access_field_patching) \ - stub(load_klass_patching) \ - stub(load_mirror_patching) \ - stub(load_appendix_patching) \ - stub(fpu2long_stub) \ - stub(counter_overflow) \ - stub(predicate_failed_trap) \ - last_entry(number_of_ids) - -#define DECLARE_STUB_ID(x) x ## _id , -#define DECLARE_LAST_STUB_ID(x) x -#define STUB_NAME(x) #x " Runtime1 stub", -#define LAST_STUB_NAME(x) #x " Runtime1 stub" - class StubAssemblerCodeGenClosure: public Closure { public: virtual OopMapSet* generate_code(StubAssembler* sasm) = 0; }; +// define C1StubId enum tags: unwind_exception_id etc + +#define C1_STUB_ID_ENUM_DECLARE(name) STUB_ID_NAME(name), +enum class C1StubId :int { + NO_STUBID = -1, + C1_STUBS_DO(C1_STUB_ID_ENUM_DECLARE) + NUM_STUBIDS +}; +#undef C1_STUB_ID_ENUM_DECLARE + class Runtime1: public AllStatic { friend class VMStructs; friend class ArrayCopyStub; - public: - enum StubID { - RUNTIME1_STUBS(DECLARE_STUB_ID, DECLARE_LAST_STUB_ID) - }; - +public: // statistics #ifndef PRODUCT static uint _generic_arraycopystub_cnt; @@ -115,17 +81,17 @@ class Runtime1: public AllStatic { #endif private: - static CodeBlob* _blobs[number_of_ids]; + static CodeBlob* _blobs[(int)C1StubId::NUM_STUBIDS]; static const char* _blob_names[]; // stub generation public: - static CodeBlob* generate_blob(BufferBlob* buffer_blob, int stub_id, const char* name, bool expect_oop_map, StubAssemblerCodeGenClosure *cl); - static void generate_blob_for(BufferBlob* blob, StubID id); - static OopMapSet* generate_code_for(StubID id, StubAssembler* sasm); + static CodeBlob* generate_blob(BufferBlob* buffer_blob, C1StubId id, const char* name, bool expect_oop_map, StubAssemblerCodeGenClosure *cl); + static void generate_blob_for(BufferBlob* blob, C1StubId id); + static OopMapSet* generate_code_for(C1StubId id, StubAssembler* sasm); private: static OopMapSet* generate_exception_throw(StubAssembler* sasm, address target, bool has_argument); - static OopMapSet* generate_handle_exception(StubID id, StubAssembler* sasm); + static OopMapSet* generate_handle_exception(C1StubId id, StubAssembler* sasm); static void generate_unwind_exception(StubAssembler *sasm); static OopMapSet* generate_patching(StubAssembler* sasm, address target); @@ -140,7 +106,7 @@ class Runtime1: public AllStatic { static address counter_overflow(JavaThread* current, int bci, Method* method); - static void unimplemented_entry(JavaThread* current, StubID id); + static void unimplemented_entry(JavaThread* current, C1StubId id); static address exception_handler_for_pc(JavaThread* current); @@ -162,7 +128,7 @@ class Runtime1: public AllStatic { static int move_mirror_patching(JavaThread* current); static int move_appendix_patching(JavaThread* current); - static void patch_code(JavaThread* current, StubID stub_id); + static void patch_code(JavaThread* current, C1StubId stub_id); public: // initialization @@ -170,9 +136,9 @@ class Runtime1: public AllStatic { static void initialize_pd(); // stubs - static CodeBlob* blob_for (StubID id); - static address entry_for(StubID id) { return blob_for(id)->code_begin(); } - static const char* name_for (StubID id); + static CodeBlob* blob_for (C1StubId id); + static address entry_for(C1StubId id) { return blob_for(id)->code_begin(); } + static const char* name_for (C1StubId id); static const char* name_for_address(address entry); // platform might add runtime names. diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp index 76b6698a40099..3c67216d4c5bf 100644 --- a/src/hotspot/share/cds/archiveBuilder.cpp +++ b/src/hotspot/share/cds/archiveBuilder.cpp @@ -1104,6 +1104,17 @@ class ArchiveBuilder::CDSMapLogger : AllStatic { LogStreamHandle(Info, cds, map) st; + HeapRootSegments segments = heap_info->heap_root_segments(); + assert(segments.base_offset() == 0, "Sanity"); + + for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) { + address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start); + st.print_cr(PTR_FORMAT ": Heap roots segment [%d]", + p2i(requested_start), segments.size_in_elems(seg_idx)); + start += segments.size_in_bytes(seg_idx); + } + log_heap_roots(); + while (start < end) { size_t byte_size; oop source_oop = ArchiveHeapWriter::buffered_addr_to_source_obj(start); @@ -1114,12 +1125,6 @@ class ArchiveBuilder::CDSMapLogger : AllStatic { // This is a regular oop that got archived. print_oop_with_requested_addr_cr(&st, source_oop, false); byte_size = source_oop->size() * BytesPerWord; - } else if (start == ArchiveHeapWriter::buffered_heap_roots_addr()) { - // HeapShared::roots() is copied specially, so it doesn't exist in - // ArchiveHeapWriter::BufferOffsetToSourceObjectTable. - // See ArchiveHeapWriter::copy_roots_to_buffer(). - st.print_cr("HeapShared::roots[%d]", HeapShared::pending_roots()->length()); - byte_size = ArchiveHeapWriter::heap_roots_word_size() * BytesPerWord; } else if ((byte_size = ArchiveHeapWriter::get_filler_size_at(start)) > 0) { // We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable. st.print_cr("filler " SIZE_FORMAT " bytes", byte_size); @@ -1132,8 +1137,6 @@ class ArchiveBuilder::CDSMapLogger : AllStatic { if (source_oop != nullptr) { log_oop_details(heap_info, source_oop, /*buffered_addr=*/start); - } else if (start == ArchiveHeapWriter::buffered_heap_roots_addr()) { - log_heap_roots(); } start = oop_end; } diff --git a/src/hotspot/share/cds/archiveHeapLoader.cpp b/src/hotspot/share/cds/archiveHeapLoader.cpp index feaf245d22c6b..6325fb6f49d73 100644 --- a/src/hotspot/share/cds/archiveHeapLoader.cpp +++ b/src/hotspot/share/cds/archiveHeapLoader.cpp @@ -374,8 +374,18 @@ void ArchiveHeapLoader::finish_initialization() { if (is_in_use()) { patch_native_pointers(); intptr_t bottom = is_loaded() ? _loaded_heap_bottom : _mapped_heap_bottom; - intptr_t roots_oop = bottom + FileMapInfo::current_info()->heap_roots_offset(); - HeapShared::init_roots(cast_to_oop(roots_oop)); + + // The heap roots are stored in one or more segments that are laid out consecutively. + // The byte size of each segment (except for the last one) is max_size. + HeapRootSegments segments = FileMapInfo::current_info()->heap_root_segments(); + int max_size = segments.max_size_in_bytes(); + HeapShared::init_root_segment_sizes(max_size); + intptr_t first_segment_addr = bottom + segments.base_offset(); + for (size_t c = 0; c < segments.count(); c++) { + oop segment_oop = cast_to_oop(first_segment_addr + (c * max_size)); + assert(segment_oop->is_objArray(), "Must be"); + HeapShared::add_root_segment((objArrayOop)segment_oop); + } } } diff --git a/src/hotspot/share/cds/archiveHeapWriter.cpp b/src/hotspot/share/cds/archiveHeapWriter.cpp index bf49805658c09..853d459c691dd 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.cpp +++ b/src/hotspot/share/cds/archiveHeapWriter.cpp @@ -52,9 +52,9 @@ GrowableArrayCHeap* ArchiveHeapWriter::_buffer = nullptr; // The following are offsets from buffer_bottom() size_t ArchiveHeapWriter::_buffer_used; -size_t ArchiveHeapWriter::_heap_roots_offset; -size_t ArchiveHeapWriter::_heap_roots_word_size; +// Heap root segments +HeapRootSegments ArchiveHeapWriter::_heap_root_segments; address ArchiveHeapWriter::_requested_bottom; address ArchiveHeapWriter::_requested_top; @@ -88,7 +88,6 @@ void ArchiveHeapWriter::init() { _native_pointers = new GrowableArrayCHeap(2048); _source_objs = new GrowableArrayCHeap(10000); - guarantee(UseG1GC, "implementation limitation"); guarantee(MIN_GC_REGION_ALIGNMENT <= G1HeapRegion::min_region_size_in_words() * HeapWordSize, "must be"); } } @@ -164,10 +163,6 @@ address ArchiveHeapWriter::buffered_addr_to_requested_addr(address buffered_addr return _requested_bottom + buffered_address_to_offset(buffered_addr); } -oop ArchiveHeapWriter::heap_roots_requested_address() { - return cast_to_oop(_requested_bottom + _heap_roots_offset); -} - address ArchiveHeapWriter::requested_address() { assert(_buffer != nullptr, "must be initialized"); return _requested_bottom; @@ -186,54 +181,83 @@ void ArchiveHeapWriter::ensure_buffer_space(size_t min_bytes) { _buffer->at_grow(to_array_index(min_bytes)); } -void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeap* roots) { - Klass* k = Universe::objectArrayKlass(); // already relocated to point to archived klass - int length = roots->length(); - _heap_roots_word_size = objArrayOopDesc::object_size(length); - size_t byte_size = _heap_roots_word_size * HeapWordSize; - if (byte_size >= MIN_GC_REGION_ALIGNMENT) { - log_error(cds, heap)("roots array is too large. Please reduce the number of classes"); - vm_exit(1); - } - - maybe_fill_gc_region_gap(byte_size); +objArrayOop ArchiveHeapWriter::allocate_root_segment(size_t offset, int element_count) { + HeapWord* mem = offset_to_buffered_address(offset); + memset(mem, 0, objArrayOopDesc::object_size(element_count)); - size_t new_used = _buffer_used + byte_size; - ensure_buffer_space(new_used); + // The initialization code is copied from MemAllocator::finish and ObjArrayAllocator::initialize. + oopDesc::set_mark(mem, markWord::prototype()); + oopDesc::release_set_klass(mem, Universe::objectArrayKlass()); + arrayOopDesc::set_length(mem, element_count); + return objArrayOop(cast_to_oop(mem)); +} - HeapWord* mem = offset_to_buffered_address(_buffer_used); - memset(mem, 0, byte_size); - { - // This is copied from MemAllocator::finish - oopDesc::set_mark(mem, markWord::prototype()); - oopDesc::release_set_klass(mem, k); - } - { - // This is copied from ObjArrayAllocator::initialize - arrayOopDesc::set_length(mem, length); +void ArchiveHeapWriter::root_segment_at_put(objArrayOop segment, int index, oop root) { + // Do not use arrayOop->obj_at_put(i, o) as arrayOop is outside the real heap! + if (UseCompressedOops) { + *segment->obj_at_addr(index) = CompressedOops::encode(root); + } else { + *segment->obj_at_addr(index) = root; } +} - objArrayOop arrayOop = objArrayOop(cast_to_oop(mem)); - for (int i = 0; i < length; i++) { - // Do not use arrayOop->obj_at_put(i, o) as arrayOop is outside of the real heap! - oop o = roots->at(i); - if (UseCompressedOops) { - * arrayOop->obj_at_addr(i) = CompressedOops::encode(o); - } else { - * arrayOop->obj_at_addr(i) = o; +void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeap* roots) { + // Depending on the number of classes we are archiving, a single roots array may be + // larger than MIN_GC_REGION_ALIGNMENT. Roots are allocated first in the buffer, which + // allows us to chop the large array into a series of "segments". Current layout + // starts with zero or more segments exactly fitting MIN_GC_REGION_ALIGNMENT, and end + // with a single segment that may be smaller than MIN_GC_REGION_ALIGNMENT. + // This is simple and efficient. We do not need filler objects anywhere between the segments, + // or immediately after the last segment. This allows starting the object dump immediately + // after the roots. + + assert((_buffer_used % MIN_GC_REGION_ALIGNMENT) == 0, + "Pre-condition: Roots start at aligned boundary: " SIZE_FORMAT, _buffer_used); + + int max_elem_count = ((MIN_GC_REGION_ALIGNMENT - arrayOopDesc::header_size_in_bytes()) / heapOopSize); + assert(objArrayOopDesc::object_size(max_elem_count)*HeapWordSize == MIN_GC_REGION_ALIGNMENT, + "Should match exactly"); + + HeapRootSegments segments(_buffer_used, + roots->length(), + MIN_GC_REGION_ALIGNMENT, + max_elem_count); + + for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) { + int size_elems = segments.size_in_elems(seg_idx); + size_t size_bytes = segments.size_in_bytes(seg_idx); + + size_t oop_offset = _buffer_used; + _buffer_used = oop_offset + size_bytes; + ensure_buffer_space(_buffer_used); + + assert((oop_offset % MIN_GC_REGION_ALIGNMENT) == 0, + "Roots segment " SIZE_FORMAT " start is not aligned: " SIZE_FORMAT, + segments.count(), oop_offset); + + int root_index = 0; + objArrayOop seg_oop = allocate_root_segment(oop_offset, size_elems); + for (int i = 0; i < size_elems; i++) { + root_segment_at_put(seg_oop, i, roots->at(root_index++)); } + + log_info(cds, heap)("archived obj root segment [%d] = " SIZE_FORMAT " bytes, obj = " PTR_FORMAT, + size_elems, size_bytes, p2i(seg_oop)); } - log_info(cds, heap)("archived obj roots[%d] = " SIZE_FORMAT " bytes, klass = %p, obj = %p", length, byte_size, k, mem); - _heap_roots_offset = _buffer_used; - _buffer_used = new_used; + _heap_root_segments = segments; } +// The goal is to sort the objects in increasing order of: +// - objects that have only oop pointers +// - objects that have both native and oop pointers +// - objects that have only native pointers +// - objects that have no pointers static int oop_sorting_rank(oop o) { bool has_oop_ptr, has_native_ptr; HeapShared::get_pointer_info(o, has_oop_ptr, has_native_ptr); - if (!has_oop_ptr) { + if (has_oop_ptr) { if (!has_native_ptr) { return 0; } else { @@ -248,11 +272,6 @@ static int oop_sorting_rank(oop o) { } } -// The goal is to sort the objects in increasing order of: -// - objects that have no pointers -// - objects that have only native pointers -// - objects that have both native and oop pointers -// - objects that have only oop pointers int ArchiveHeapWriter::compare_objs_by_oop_fields(HeapObjOrder* a, HeapObjOrder* b) { int rank_a = a->_rank; int rank_b = b->_rank; @@ -282,6 +301,10 @@ void ArchiveHeapWriter::sort_source_objs() { } void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeap* roots) { + // There could be multiple root segments, which we want to be aligned by region. + // Putting them ahead of objects makes sure we waste no space. + copy_roots_to_buffer(roots); + sort_source_objs(); for (int i = 0; i < _source_objs_order->length(); i++) { int src_obj_index = _source_objs_order->at(i)._index; @@ -295,8 +318,6 @@ void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeapmaybe_grow(); } - copy_roots_to_buffer(roots); - log_info(cds)("Size of heap region = " SIZE_FORMAT " bytes, %d objects, %d roots, %d native ptrs", _buffer_used, _source_objs->length() + 1, roots->length(), _num_native_ptrs); } @@ -430,32 +451,36 @@ size_t ArchiveHeapWriter::copy_one_source_obj_to_buffer(oop src_obj) { void ArchiveHeapWriter::set_requested_address(ArchiveHeapInfo* info) { assert(!info->is_used(), "only set once"); - assert(UseG1GC, "must be"); - address heap_end = (address)G1CollectedHeap::heap()->reserved().end(); - log_info(cds, heap)("Heap end = %p", heap_end); size_t heap_region_byte_size = _buffer_used; assert(heap_region_byte_size > 0, "must archived at least one object!"); - if (UseCompressedOops) { - _requested_bottom = align_down(heap_end - heap_region_byte_size, G1HeapRegion::GrainBytes); + if (UseG1GC) { + address heap_end = (address)G1CollectedHeap::heap()->reserved().end(); + log_info(cds, heap)("Heap end = %p", heap_end); + _requested_bottom = align_down(heap_end - heap_region_byte_size, G1HeapRegion::GrainBytes); + _requested_bottom = align_down(_requested_bottom, MIN_GC_REGION_ALIGNMENT); + assert(is_aligned(_requested_bottom, G1HeapRegion::GrainBytes), "sanity"); + } else { + _requested_bottom = align_up(CompressedOops::begin(), MIN_GC_REGION_ALIGNMENT); + } } else { // We always write the objects as if the heap started at this address. This // makes the contents of the archive heap deterministic. // // Note that at runtime, the heap address is selected by the OS, so the archive // heap will not be mapped at 0x10000000, and the contents need to be patched. - _requested_bottom = (address)NOCOOPS_REQUESTED_BASE; + _requested_bottom = align_up((address)NOCOOPS_REQUESTED_BASE, MIN_GC_REGION_ALIGNMENT); } - assert(is_aligned(_requested_bottom, G1HeapRegion::GrainBytes), "sanity"); + assert(is_aligned(_requested_bottom, MIN_GC_REGION_ALIGNMENT), "sanity"); _requested_top = _requested_bottom + _buffer_used; info->set_buffer_region(MemRegion(offset_to_buffered_address(0), offset_to_buffered_address(_buffer_used))); - info->set_heap_roots_offset(_heap_roots_offset); + info->set_heap_root_segments(_heap_root_segments); } // Oop relocation @@ -543,12 +568,6 @@ void ArchiveHeapWriter::update_header_for_requested_obj(oop requested_obj, oop s } } -// Relocate an element in the buffered copy of HeapShared::roots() -template void ArchiveHeapWriter::relocate_root_at(oop requested_roots, int index, CHeapBitMap* oopmap) { - size_t offset = (size_t)((objArrayOop)requested_roots)->obj_at_offset(index); - relocate_field_in_buffer((T*)(buffered_heap_roots_addr() + offset), oopmap); -} - class ArchiveHeapWriter::EmbeddedOopRelocator: public BasicOopIterateClosure { oop _src_obj; address _buffered_obj; @@ -600,14 +619,24 @@ void ArchiveHeapWriter::relocate_embedded_oops(GrowableArrayCHeaplength() : 0; - for (int i = 0; i < length; i++) { + for (size_t seg_idx = 0; seg_idx < _heap_root_segments.count(); seg_idx++) { + size_t seg_offset = _heap_root_segments.segment_offset(seg_idx); + + objArrayOop requested_obj = (objArrayOop)requested_obj_from_buffer_offset(seg_offset); + update_header_for_requested_obj(requested_obj, nullptr, Universe::objectArrayKlass()); + address buffered_obj = offset_to_buffered_address
(seg_offset); + int length = _heap_root_segments.size_in_elems(seg_idx); + if (UseCompressedOops) { - relocate_root_at(requested_roots, i, heap_info->oopmap()); + for (int i = 0; i < length; i++) { + narrowOop* addr = (narrowOop*)(buffered_obj + objArrayOopDesc::obj_at_offset(i)); + relocate_field_in_buffer(addr, heap_info->oopmap()); + } } else { - relocate_root_at(requested_roots, i, heap_info->oopmap()); + for (int i = 0; i < length; i++) { + oop* addr = (oop*)(buffered_obj + objArrayOopDesc::obj_at_offset(i)); + relocate_field_in_buffer(addr, heap_info->oopmap()); + } } } diff --git a/src/hotspot/share/cds/archiveHeapWriter.hpp b/src/hotspot/share/cds/archiveHeapWriter.hpp index 352aeb9a08f7c..29ea50ba5fe86 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.hpp +++ b/src/hotspot/share/cds/archiveHeapWriter.hpp @@ -41,8 +41,7 @@ class ArchiveHeapInfo { MemRegion _buffer_region; // Contains the archived objects to be written into the CDS archive. CHeapBitMap _oopmap; CHeapBitMap _ptrmap; - size_t _heap_roots_offset; // Offset of the HeapShared::roots() object, from the bottom - // of the archived heap objects, in bytes. + HeapRootSegments _heap_root_segments; public: ArchiveHeapInfo() : _buffer_region(), _oopmap(128, mtClassShared), _ptrmap(128, mtClassShared) {} @@ -57,8 +56,8 @@ class ArchiveHeapInfo { CHeapBitMap* oopmap() { return &_oopmap; } CHeapBitMap* ptrmap() { return &_ptrmap; } - void set_heap_roots_offset(size_t n) { _heap_roots_offset = n; } - size_t heap_roots_offset() const { return _heap_roots_offset; } + void set_heap_root_segments(HeapRootSegments segments) { _heap_root_segments = segments; }; + HeapRootSegments heap_root_segments() { return _heap_root_segments; } }; #if INCLUDE_CDS_JAVA_HEAP @@ -112,11 +111,10 @@ class ArchiveHeapWriter : AllStatic { public: static const intptr_t NOCOOPS_REQUESTED_BASE = 0x10000000; - // The minimum region size of all collectors that are supported by CDS in - // ArchiveHeapLoader::can_map() mode. Currently only G1 is supported. G1's region size - // depends on -Xmx, but can never be smaller than 1 * M. - // (TODO: Perhaps change to 256K to be compatible with Shenandoah) - static constexpr int MIN_GC_REGION_ALIGNMENT = 1 * M; + // The minimum region size of all collectors that are supported by CDS. + // G1 heap region size can never be smaller than 1M. + // Shenandoah heap region size can never be smaller than 256K. + static constexpr int MIN_GC_REGION_ALIGNMENT = 256 * K; private: class EmbeddedOopRelocator; @@ -130,9 +128,8 @@ class ArchiveHeapWriter : AllStatic { // The number of bytes that have written into _buffer (may be smaller than _buffer->length()). static size_t _buffer_used; - // The bottom of the copy of Heap::roots() inside this->_buffer. - static size_t _heap_roots_offset; - static size_t _heap_roots_word_size; + // The heap root segments information. + static HeapRootSegments _heap_root_segments; // The address range of the requested location of the archived heap objects. static address _requested_bottom; @@ -193,6 +190,8 @@ class ArchiveHeapWriter : AllStatic { return buffered_addr - buffer_bottom(); } + static void root_segment_at_put(objArrayOop segment, int index, oop root); + static objArrayOop allocate_root_segment(size_t offset, int element_count); static void copy_roots_to_buffer(GrowableArrayCHeap* roots); static void copy_source_objs_to_buffer(GrowableArrayCHeap* roots); static size_t copy_one_source_obj_to_buffer(oop src_obj); @@ -219,7 +218,6 @@ class ArchiveHeapWriter : AllStatic { template static T* requested_addr_to_buffered_addr(T* p); template static void relocate_field_in_buffer(T* field_addr_in_buffer, CHeapBitMap* oopmap); template static void mark_oop_pointer(T* buffered_addr, CHeapBitMap* oopmap); - template static void relocate_root_at(oop requested_roots, int index, CHeapBitMap* oopmap); static void update_header_for_requested_obj(oop requested_obj, oop src_obj, Klass* src_klass); @@ -234,13 +232,6 @@ class ArchiveHeapWriter : AllStatic { static bool is_string_too_large_to_archive(oop string); static void write(GrowableArrayCHeap*, ArchiveHeapInfo* heap_info); static address requested_address(); // requested address of the lowest achived heap object - static oop heap_roots_requested_address(); // requested address of HeapShared::roots() - static address buffered_heap_roots_addr() { - return offset_to_buffered_address
(_heap_roots_offset); - } - static size_t heap_roots_word_size() { - return _heap_roots_word_size; - } static size_t get_filler_size_at(address buffered_addr); static void mark_native_pointer(oop src_obj, int offset); diff --git a/src/hotspot/share/cds/archiveUtils.cpp b/src/hotspot/share/cds/archiveUtils.cpp index 76cfa441fa7f8..4622a27cbec72 100644 --- a/src/hotspot/share/cds/archiveUtils.cpp +++ b/src/hotspot/share/cds/archiveUtils.cpp @@ -369,3 +369,24 @@ void ArchiveUtils::log_to_classlist(BootstrapInfo* bootstrap_specifier, TRAPS) { } } } + +size_t HeapRootSegments::size_in_bytes(size_t seg_idx) { + assert(seg_idx < _count, "In range"); + return objArrayOopDesc::object_size(size_in_elems(seg_idx)) * HeapWordSize; +} + +int HeapRootSegments::size_in_elems(size_t seg_idx) { + assert(seg_idx < _count, "In range"); + if (seg_idx != _count - 1) { + return _max_size_in_elems; + } else { + // Last slice, leftover + return _roots_count % _max_size_in_elems; + } +} + +size_t HeapRootSegments::segment_offset(size_t seg_idx) { + assert(seg_idx < _count, "In range"); + return _base_offset + seg_idx * _max_size_in_bytes; +} + diff --git a/src/hotspot/share/cds/archiveUtils.hpp b/src/hotspot/share/cds/archiveUtils.hpp index 32cef97886f06..2e361ab0c4650 100644 --- a/src/hotspot/share/cds/archiveUtils.hpp +++ b/src/hotspot/share/cds/archiveUtils.hpp @@ -250,4 +250,45 @@ class ArchiveUtils { static void log_to_classlist(BootstrapInfo* bootstrap_specifier, TRAPS) NOT_CDS_RETURN; }; +class HeapRootSegments { +private: + size_t _base_offset; + size_t _count; + int _roots_count; + int _max_size_in_bytes; + int _max_size_in_elems; + +public: + size_t base_offset() { return _base_offset; } + size_t count() { return _count; } + int roots_count() { return _roots_count; } + int max_size_in_bytes() { return _max_size_in_bytes; } + int max_size_in_elems() { return _max_size_in_elems; } + + size_t size_in_bytes(size_t seg_idx); + int size_in_elems(size_t seg_idx); + size_t segment_offset(size_t seg_idx); + + // Trivial copy assignments are allowed to copy the entire object representation. + // We also inline this class into archive header. Therefore, it is important to make + // sure any gaps in object representation are initialized to zeroes. This is why + // constructors memset before doing field assignments. + HeapRootSegments() { + memset(this, 0, sizeof(*this)); + } + HeapRootSegments(size_t base_offset, int roots_count, int max_size_in_bytes, int max_size_in_elems) { + assert(is_power_of_2(max_size_in_bytes), "must be"); + memset(this, 0, sizeof(*this)); + _base_offset = base_offset; + _count = (roots_count + max_size_in_elems - 1) / max_size_in_elems; + _roots_count = roots_count; + _max_size_in_bytes = max_size_in_bytes; + _max_size_in_elems = max_size_in_elems; + } + + // This class is trivially copyable and assignable. + HeapRootSegments(const HeapRootSegments&) = default; + HeapRootSegments& operator=(const HeapRootSegments&) = default; +}; + #endif // SHARE_CDS_ARCHIVEUTILS_HPP diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 35c43157b1ab3..c935541d7cf0a 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -289,7 +289,11 @@ void FileMapHeader::print(outputStream* st) { st->print_cr("- has_non_jar_in_classpath: %d", _has_non_jar_in_classpath); st->print_cr("- requested_base_address: " INTPTR_FORMAT, p2i(_requested_base_address)); st->print_cr("- mapped_base_address: " INTPTR_FORMAT, p2i(_mapped_base_address)); - st->print_cr("- heap_roots_offset: " SIZE_FORMAT, _heap_roots_offset); + st->print_cr("- heap_root_segments.roots_count: %d" , _heap_root_segments.roots_count()); + st->print_cr("- heap_root_segments.base_offset: " SIZE_FORMAT_X, _heap_root_segments.base_offset()); + st->print_cr("- heap_root_segments.count: " SIZE_FORMAT, _heap_root_segments.count()); + st->print_cr("- heap_root_segments.max_size_elems: %d", _heap_root_segments.max_size_in_elems()); + st->print_cr("- heap_root_segments.max_size_bytes: %d", _heap_root_segments.max_size_in_bytes()); st->print_cr("- _heap_oopmap_start_pos: " SIZE_FORMAT, _heap_oopmap_start_pos); st->print_cr("- _heap_ptrmap_start_pos: " SIZE_FORMAT, _heap_ptrmap_start_pos); st->print_cr("- _rw_ptrmap_start_pos: " SIZE_FORMAT, _rw_ptrmap_start_pos); @@ -1577,39 +1581,38 @@ static size_t write_bitmap(const CHeapBitMap* map, char* output, size_t offset) return offset + size_in_bytes; } -// The start of the archived heap has many primitive arrays (String -// bodies) that are not marked by the oop/ptr maps. So we must have -// lots of leading zeros. -size_t FileMapInfo::remove_bitmap_leading_zeros(CHeapBitMap* map) { - size_t old_zeros = map->find_first_set_bit(0); +// The sorting code groups the objects with non-null oop/ptrs together. +// Relevant bitmaps then have lots of leading and trailing zeros, which +// we do not have to store. +size_t FileMapInfo::remove_bitmap_zeros(CHeapBitMap* map) { + BitMap::idx_t first_set = map->find_first_set_bit(0); + BitMap::idx_t last_set = map->find_last_set_bit(0); size_t old_size = map->size(); // Slice and resize bitmap - map->truncate(old_zeros, map->size()); + map->truncate(first_set, last_set + 1); - DEBUG_ONLY( - size_t new_zeros = map->find_first_set_bit(0); - assert(new_zeros == 0, "Should have removed leading zeros"); - ) + assert(map->at(0), "First bit should be set"); + assert(map->at(map->size() - 1), "Last bit should be set"); assert(map->size() <= old_size, "sanity"); - return old_zeros; + + return first_set; } char* FileMapInfo::write_bitmap_region(CHeapBitMap* rw_ptrmap, CHeapBitMap* ro_ptrmap, ArchiveHeapInfo* heap_info, size_t &size_in_bytes) { - size_t removed_rw_zeros = remove_bitmap_leading_zeros(rw_ptrmap); - size_t removed_ro_zeros = remove_bitmap_leading_zeros(ro_ptrmap); - header()->set_rw_ptrmap_start_pos(removed_rw_zeros); - header()->set_ro_ptrmap_start_pos(removed_ro_zeros); + size_t removed_rw_leading_zeros = remove_bitmap_zeros(rw_ptrmap); + size_t removed_ro_leading_zeros = remove_bitmap_zeros(ro_ptrmap); + header()->set_rw_ptrmap_start_pos(removed_rw_leading_zeros); + header()->set_ro_ptrmap_start_pos(removed_ro_leading_zeros); size_in_bytes = rw_ptrmap->size_in_bytes() + ro_ptrmap->size_in_bytes(); if (heap_info->is_used()) { - // Remove leading zeros - size_t removed_oop_zeros = remove_bitmap_leading_zeros(heap_info->oopmap()); - size_t removed_ptr_zeros = remove_bitmap_leading_zeros(heap_info->ptrmap()); - - header()->set_heap_oopmap_start_pos(removed_oop_zeros); - header()->set_heap_ptrmap_start_pos(removed_ptr_zeros); + // Remove leading and trailing zeros + size_t removed_oop_leading_zeros = remove_bitmap_zeros(heap_info->oopmap()); + size_t removed_ptr_leading_zeros = remove_bitmap_zeros(heap_info->ptrmap()); + header()->set_heap_oopmap_start_pos(removed_oop_leading_zeros); + header()->set_heap_ptrmap_start_pos(removed_ptr_leading_zeros); size_in_bytes += heap_info->oopmap()->size_in_bytes(); size_in_bytes += heap_info->ptrmap()->size_in_bytes(); @@ -1647,7 +1650,7 @@ size_t FileMapInfo::write_heap_region(ArchiveHeapInfo* heap_info) { char* buffer_start = heap_info->buffer_start(); size_t buffer_size = heap_info->buffer_byte_size(); write_region(MetaspaceShared::hp, buffer_start, buffer_size, false, false); - header()->set_heap_roots_offset(heap_info->heap_roots_offset()); + header()->set_heap_root_segments(heap_info->heap_root_segments()); return buffer_size; } @@ -1712,10 +1715,10 @@ void FileMapInfo::close() { */ static char* map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, - bool allow_exec, MEMFLAGS flags = mtNone) { + bool allow_exec, MemTag mem_tag = mtNone) { char* mem = os::map_memory(fd, file_name, file_offset, addr, bytes, AlwaysPreTouch ? false : read_only, - allow_exec, flags); + allow_exec, mem_tag); if (mem != nullptr && AlwaysPreTouch) { os::pretouch_memory(mem, mem + bytes); } @@ -2174,7 +2177,7 @@ bool FileMapInfo::map_heap_region_impl() { _mapped_heap_memregion = MemRegion(start, word_size); - // Map the archived heap data. No need to call MemTracker::record_virtual_memory_type() + // Map the archived heap data. No need to call MemTracker::record_virtual_memory_tag() // for mapped region as it is part of the reserved java heap, which is already recorded. char* addr = (char*)_mapped_heap_memregion.start(); char* base; diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index 7b10c16920b8f..1bf2510a3351c 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_CDS_FILEMAP_HPP #define SHARE_CDS_FILEMAP_HPP +#include "cds/archiveUtils.hpp" #include "cds/metaspaceShared.hpp" #include "include/cds.h" #include "logging/logLevel.hpp" @@ -225,8 +226,7 @@ class FileMapHeader: private CDSFileMapHeaderBase { bool _use_optimized_module_handling;// No module-relation VM options were specified, so we can skip // some expensive operations. bool _has_full_module_graph; // Does this CDS archive contain the full archived module graph? - size_t _heap_roots_offset; // Offset of the HeapShared::roots() object, from the bottom - // of the archived heap objects, in bytes. + HeapRootSegments _heap_root_segments; // Heap root segments info size_t _heap_oopmap_start_pos; // The first bit in the oopmap corresponds to this position in the heap. size_t _heap_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the heap. size_t _rw_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the rw region @@ -270,7 +270,7 @@ class FileMapHeader: private CDSFileMapHeaderBase { bool has_non_jar_in_classpath() const { return _has_non_jar_in_classpath; } bool compressed_oops() const { return _compressed_oops; } bool compressed_class_pointers() const { return _compressed_class_ptrs; } - size_t heap_roots_offset() const { return _heap_roots_offset; } + HeapRootSegments heap_root_segments() const { return _heap_root_segments; } size_t heap_oopmap_start_pos() const { return _heap_oopmap_start_pos; } size_t heap_ptrmap_start_pos() const { return _heap_ptrmap_start_pos; } size_t rw_ptrmap_start_pos() const { return _rw_ptrmap_start_pos; } @@ -285,7 +285,7 @@ class FileMapHeader: private CDSFileMapHeaderBase { void set_cloned_vtables(char* p) { set_as_offset(p, &_cloned_vtables_offset); } void set_serialized_data(char* p) { set_as_offset(p, &_serialized_data_offset); } void set_mapped_base_address(char* p) { _mapped_base_address = p; } - void set_heap_roots_offset(size_t n) { _heap_roots_offset = n; } + void set_heap_root_segments(HeapRootSegments segments) { _heap_root_segments = segments; } void set_heap_oopmap_start_pos(size_t n) { _heap_oopmap_start_pos = n; } void set_heap_ptrmap_start_pos(size_t n) { _heap_ptrmap_start_pos = n; } void set_rw_ptrmap_start_pos(size_t n) { _rw_ptrmap_start_pos = n; } @@ -385,7 +385,7 @@ class FileMapInfo : public CHeapObj { address narrow_oop_base() const { return header()->narrow_oop_base(); } int narrow_oop_shift() const { return header()->narrow_oop_shift(); } uintx max_heap_size() const { return header()->max_heap_size(); } - size_t heap_roots_offset() const { return header()->heap_roots_offset(); } + HeapRootSegments heap_root_segments() const { return header()->heap_root_segments(); } size_t core_region_alignment() const { return header()->core_region_alignment(); } size_t heap_oopmap_start_pos() const { return header()->heap_oopmap_start_pos(); } size_t heap_ptrmap_start_pos() const { return header()->heap_ptrmap_start_pos(); } @@ -445,7 +445,7 @@ class FileMapInfo : public CHeapObj { void write_header(); void write_region(int region, char* base, size_t size, bool read_only, bool allow_exec); - size_t remove_bitmap_leading_zeros(CHeapBitMap* map); + size_t remove_bitmap_zeros(CHeapBitMap* map); char* write_bitmap_region(CHeapBitMap* rw_ptrmap, CHeapBitMap* ro_ptrmap, ArchiveHeapInfo* heap_info, size_t &size_in_bytes); size_t write_heap_region(ArchiveHeapInfo* heap_info); diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index abfc0f9d64be1..1fddcb0d81f8a 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -133,7 +133,9 @@ static ArchivableStaticFieldInfo fmg_archive_subgraph_entry_fields[] = { KlassSubGraphInfo* HeapShared::_default_subgraph_info; GrowableArrayCHeap* HeapShared::_pending_roots = nullptr; -OopHandle HeapShared::_roots; +GrowableArrayCHeap* HeapShared::_root_segments; +int HeapShared::_root_segment_max_size_shift; +int HeapShared::_root_segment_max_size_mask; OopHandle HeapShared::_scratch_basic_type_mirrors[T_VOID+1]; MetaspaceObjToOopHandleTable* HeapShared::_scratch_java_mirror_table = nullptr; MetaspaceObjToOopHandleTable* HeapShared::_scratch_references_table = nullptr; @@ -225,7 +227,7 @@ int HeapShared::append_root(oop obj) { return _pending_roots->append(obj); } -objArrayOop HeapShared::roots() { +objArrayOop HeapShared::root_segment(int segment_idx) { if (CDSConfig::is_dumping_heap()) { assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); if (!HeapShared::can_write()) { @@ -235,17 +237,21 @@ objArrayOop HeapShared::roots() { assert(CDSConfig::is_using_archive(), "must be"); } - objArrayOop roots = (objArrayOop)_roots.resolve(); - assert(roots != nullptr, "should have been initialized"); - return roots; + objArrayOop segment = (objArrayOop)_root_segments->at(segment_idx).resolve(); + assert(segment != nullptr, "should have been initialized"); + return segment; } // Returns an objArray that contains all the roots of the archived objects oop HeapShared::get_root(int index, bool clear) { + assert(_root_segment_max_size_shift > 0, "sanity"); + assert(_root_segment_max_size_mask > 0, "sanity"); assert(index >= 0, "sanity"); assert(!CDSConfig::is_dumping_heap() && CDSConfig::is_using_archive(), "runtime only"); - assert(!_roots.is_empty(), "must have loaded shared heap"); - oop result = roots()->obj_at(index); + assert(!_root_segments->is_empty(), "must have loaded shared heap"); + int seg_idx = index >> _root_segment_max_size_shift; + int int_idx = index & _root_segment_max_size_mask; + oop result = root_segment(seg_idx)->obj_at(int_idx); if (clear) { clear_root(index); } @@ -256,11 +262,15 @@ void HeapShared::clear_root(int index) { assert(index >= 0, "sanity"); assert(CDSConfig::is_using_archive(), "must be"); if (ArchiveHeapLoader::is_in_use()) { + assert(_root_segment_max_size_shift > 0, "sanity"); + assert(_root_segment_max_size_mask > 0, "sanity"); + int seg_idx = index >> _root_segment_max_size_shift; + int int_idx = index & _root_segment_max_size_mask; if (log_is_enabled(Debug, cds, heap)) { - oop old = roots()->obj_at(index); + oop old = root_segment(seg_idx)->obj_at(int_idx); log_debug(cds, heap)("Clearing root %d: was " PTR_FORMAT, index, p2i(old)); } - roots()->obj_at_put(index, nullptr); + root_segment(seg_idx)->obj_at_put(int_idx, nullptr); } } @@ -461,11 +471,13 @@ void HeapShared::archive_objects(ArchiveHeapInfo *heap_info) { // Cache for recording where the archived objects are copied to create_archived_object_cache(); - log_info(cds)("Heap range = [" PTR_FORMAT " - " PTR_FORMAT "]", - UseCompressedOops ? p2i(CompressedOops::begin()) : - p2i((address)G1CollectedHeap::heap()->reserved().start()), - UseCompressedOops ? p2i(CompressedOops::end()) : - p2i((address)G1CollectedHeap::heap()->reserved().end())); + if (UseCompressedOops || UseG1GC) { + log_info(cds)("Heap range = [" PTR_FORMAT " - " PTR_FORMAT "]", + UseCompressedOops ? p2i(CompressedOops::begin()) : + p2i((address)G1CollectedHeap::heap()->reserved().start()), + UseCompressedOops ? p2i(CompressedOops::end()) : + p2i((address)G1CollectedHeap::heap()->reserved().end())); + } copy_objects(); CDSHeapVerifier::verify(); @@ -764,11 +776,19 @@ void HeapShared::write_subgraph_info_table() { } } -void HeapShared::init_roots(oop roots_oop) { - if (roots_oop != nullptr) { - assert(ArchiveHeapLoader::is_in_use(), "must be"); - _roots = OopHandle(Universe::vm_global(), roots_oop); +void HeapShared::add_root_segment(objArrayOop segment_oop) { + assert(segment_oop != nullptr, "must be"); + assert(ArchiveHeapLoader::is_in_use(), "must be"); + if (_root_segments == nullptr) { + _root_segments = new GrowableArrayCHeap(10); } + _root_segments->push(OopHandle(Universe::vm_global(), segment_oop)); +} + +void HeapShared::init_root_segment_sizes(int max_size) { + assert(is_power_of_2(max_size), "must be"); + _root_segment_max_size_shift = log2i_exact(max_size); + _root_segment_max_size_mask = max_size - 1; } void HeapShared::serialize_tables(SerializeClosure* soc) { @@ -1304,6 +1324,9 @@ void HeapShared::check_default_subgraph_classes() { name == vmSymbols::java_lang_ArithmeticException() || name == vmSymbols::java_lang_NullPointerException() || name == vmSymbols::java_lang_InternalError() || + name == vmSymbols::java_lang_ArrayIndexOutOfBoundsException() || + name == vmSymbols::java_lang_ArrayStoreException() || + name == vmSymbols::java_lang_ClassCastException() || name == vmSymbols::object_array_signature() || name == vmSymbols::byte_array_signature() || name == vmSymbols::char_array_signature(), diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 0ba20f1e313b7..01610ebe64e15 100644 --- a/src/hotspot/share/cds/heapShared.hpp +++ b/src/hotspot/share/cds/heapShared.hpp @@ -143,13 +143,13 @@ class HeapShared: AllStatic { friend class VerifySharedOopClosure; public: - // Can this VM write a heap region into the CDS archive? Currently only G1+compressed{oops,cp} + // Can this VM write a heap region into the CDS archive? Currently only {G1|Parallel|Serial}+compressed_cp static bool can_write() { CDS_JAVA_HEAP_ONLY( if (_disable_writing) { return false; } - return (UseG1GC && UseCompressedClassPointers); + return (UseG1GC || UseParallelGC || UseSerialGC) && UseCompressedClassPointers; ) NOT_CDS_JAVA_HEAP(return false;) } @@ -290,7 +290,9 @@ class HeapShared: AllStatic { static KlassSubGraphInfo* _default_subgraph_info; static GrowableArrayCHeap* _pending_roots; - static OopHandle _roots; + static GrowableArrayCHeap* _root_segments; + static int _root_segment_max_size_shift; + static int _root_segment_max_size_mask; static OopHandle _scratch_basic_type_mirrors[T_VOID+1]; static MetaspaceObjToOopHandleTable* _scratch_java_mirror_table; static MetaspaceObjToOopHandleTable* _scratch_references_table; @@ -399,7 +401,7 @@ class HeapShared: AllStatic { static GrowableArrayCHeap* pending_roots() { return _pending_roots; } // Dump-time and runtime - static objArrayOop roots(); + static objArrayOop root_segment(int segment_idx); static oop get_root(int index, bool clear=false); // Run-time only @@ -422,7 +424,8 @@ class HeapShared: AllStatic { static void init_for_dumping(TRAPS) NOT_CDS_JAVA_HEAP_RETURN; static void write_subgraph_info_table() NOT_CDS_JAVA_HEAP_RETURN; - static void init_roots(oop roots_oop) NOT_CDS_JAVA_HEAP_RETURN; + static void add_root_segment(objArrayOop segment_oop) NOT_CDS_JAVA_HEAP_RETURN; + static void init_root_segment_sizes(int max_size) NOT_CDS_JAVA_HEAP_RETURN; static void serialize_tables(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN; #ifndef PRODUCT diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index 4d978a7ad880f..c66398cefac5a 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -1299,7 +1299,7 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma assert(base_address == nullptr || (address)archive_space_rs.base() == base_address, "Sanity"); // Register archive space with NMT. - MemTracker::record_virtual_memory_type(archive_space_rs.base(), mtClassShared); + MemTracker::record_virtual_memory_tag(archive_space_rs.base(), mtClassShared); return archive_space_rs.base(); } return nullptr; @@ -1361,8 +1361,8 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma return nullptr; } // NMT: fix up the space tags - MemTracker::record_virtual_memory_type(archive_space_rs.base(), mtClassShared); - MemTracker::record_virtual_memory_type(class_space_rs.base(), mtClass); + MemTracker::record_virtual_memory_tag(archive_space_rs.base(), mtClassShared); + MemTracker::record_virtual_memory_tag(class_space_rs.base(), mtClass); } else { if (use_archive_base_addr && base_address != nullptr) { total_space_rs = ReservedSpace(total_range_size, base_address_alignment, diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 3079d469ebe48..9caf89628ccfd 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -100,10 +100,6 @@ ciSymbol* ciEnv::_unloaded_cisymbol = nullptr; ciInstanceKlass* ciEnv::_unloaded_ciinstance_klass = nullptr; ciObjArrayKlass* ciEnv::_unloaded_ciobjarrayklass = nullptr; -jobject ciEnv::_ArrayIndexOutOfBoundsException_handle = nullptr; -jobject ciEnv::_ArrayStoreException_handle = nullptr; -jobject ciEnv::_ClassCastException_handle = nullptr; - #ifndef PRODUCT static bool firstEnv = true; #endif /* PRODUCT */ @@ -158,10 +154,16 @@ ciEnv::ciEnv(CompileTask* task) o = Universe::arithmetic_exception_instance(); assert(o != nullptr, "should have been initialized"); _ArithmeticException_instance = get_object(o)->as_instance(); + o = Universe::array_index_out_of_bounds_exception_instance(); + assert(o != nullptr, "should have been initialized"); + _ArrayIndexOutOfBoundsException_instance = get_object(o)->as_instance(); + o = Universe::array_store_exception_instance(); + assert(o != nullptr, "should have been initialized"); + _ArrayStoreException_instance = get_object(o)->as_instance(); + o = Universe::class_cast_exception_instance(); + assert(o != nullptr, "should have been initialized"); + _ClassCastException_instance = get_object(o)->as_instance(); - _ArrayIndexOutOfBoundsException_instance = nullptr; - _ArrayStoreException_instance = nullptr; - _ClassCastException_instance = nullptr; _the_null_string = nullptr; _the_min_jint_string = nullptr; @@ -363,29 +365,6 @@ void ciEnv::cache_dtrace_flags() { _dtrace_alloc_probes = DTraceAllocProbes; } -// ------------------------------------------------------------------ -// helper for lazy exception creation -ciInstance* ciEnv::get_or_create_exception(jobject& handle, Symbol* name) { - VM_ENTRY_MARK; - if (handle == nullptr) { - // Cf. universe.cpp, creation of Universe::_null_ptr_exception_instance. - InstanceKlass* ik = SystemDictionary::find_instance_klass(THREAD, name, Handle(), Handle()); - jobject objh = nullptr; - if (ik != nullptr) { - oop obj = ik->allocate_instance(THREAD); - if (!HAS_PENDING_EXCEPTION) - objh = JNIHandles::make_global(Handle(THREAD, obj)); - } - if (HAS_PENDING_EXCEPTION) { - CLEAR_PENDING_EXCEPTION; - } else { - handle = objh; - } - } - oop obj = JNIHandles::resolve(handle); - return obj == nullptr? nullptr: get_object(obj)->as_instance(); -} - ciInstanceKlass* ciEnv::get_box_klass_for_primitive_type(BasicType type) { switch (type) { case T_BOOLEAN: return Boolean_klass(); @@ -403,31 +382,6 @@ ciInstanceKlass* ciEnv::get_box_klass_for_primitive_type(BasicType type) { } } -ciInstance* ciEnv::ArrayIndexOutOfBoundsException_instance() { - if (_ArrayIndexOutOfBoundsException_instance == nullptr) { - _ArrayIndexOutOfBoundsException_instance - = get_or_create_exception(_ArrayIndexOutOfBoundsException_handle, - vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); - } - return _ArrayIndexOutOfBoundsException_instance; -} -ciInstance* ciEnv::ArrayStoreException_instance() { - if (_ArrayStoreException_instance == nullptr) { - _ArrayStoreException_instance - = get_or_create_exception(_ArrayStoreException_handle, - vmSymbols::java_lang_ArrayStoreException()); - } - return _ArrayStoreException_instance; -} -ciInstance* ciEnv::ClassCastException_instance() { - if (_ClassCastException_instance == nullptr) { - _ClassCastException_instance - = get_or_create_exception(_ClassCastException_handle, - vmSymbols::java_lang_ClassCastException()); - } - return _ClassCastException_instance; -} - ciInstance* ciEnv::the_null_string() { if (_the_null_string == nullptr) { VM_ENTRY_MARK; diff --git a/src/hotspot/share/ci/ciEnv.hpp b/src/hotspot/share/ci/ciEnv.hpp index 5ee9b420033ef..6c66633ee1749 100644 --- a/src/hotspot/share/ci/ciEnv.hpp +++ b/src/hotspot/share/ci/ciEnv.hpp @@ -94,10 +94,6 @@ class ciEnv : StackObj { static ciInstanceKlass* _unloaded_ciinstance_klass; static ciObjArrayKlass* _unloaded_ciobjarrayklass; - static jobject _ArrayIndexOutOfBoundsException_handle; - static jobject _ArrayStoreException_handle; - static jobject _ClassCastException_handle; - ciInstance* _NullPointerException_instance; ciInstance* _ArithmeticException_instance; ciInstance* _ArrayIndexOutOfBoundsException_instance; @@ -230,8 +226,6 @@ class ciEnv : StackObj { ciMethod* get_method_from_handle(Method* method); - ciInstance* get_or_create_exception(jobject& handle, Symbol* name); - // Get a ciMethod representing either an unfound method or // a method with an unloaded holder. Ensures uniqueness of // the result. @@ -402,11 +396,18 @@ class ciEnv : StackObj { assert(_ArithmeticException_instance != nullptr, "initialization problem"); return _ArithmeticException_instance; } - - // Lazy constructors: - ciInstance* ArrayIndexOutOfBoundsException_instance(); - ciInstance* ArrayStoreException_instance(); - ciInstance* ClassCastException_instance(); + ciInstance* ArrayIndexOutOfBoundsException_instance() { + assert(_ArrayIndexOutOfBoundsException_instance != nullptr, "initialization problem"); + return _ArrayIndexOutOfBoundsException_instance; + } + ciInstance* ArrayStoreException_instance() { + assert(_ArrayStoreException_instance != nullptr, "initialization problem"); + return _ArrayStoreException_instance; + } + ciInstance* ClassCastException_instance() { + assert(_ClassCastException_instance != nullptr, "initialization problem"); + return _ClassCastException_instance; + } ciInstance* the_null_string(); ciInstance* the_min_jint_string(); diff --git a/src/hotspot/share/ci/ciKlass.hpp b/src/hotspot/share/ci/ciKlass.hpp index 58a62b248a4e8..10d8395ed7fb9 100644 --- a/src/hotspot/share/ci/ciKlass.hpp +++ b/src/hotspot/share/ci/ciKlass.hpp @@ -107,6 +107,13 @@ class ciKlass : public ciType { return false; } + bool is_in_encoding_range() { + Klass* k = get_Klass(); + bool is_in_encoding_range = CompressedKlassPointers::is_encodable(k); + assert(is_in_encoding_range || k->is_interface() || k->is_abstract(), "sanity"); + return is_in_encoding_range; + } + // Attempt to get a klass using this ciKlass's loader. ciKlass* find_klass(ciSymbol* klass_name); // Note: To find a class from its name string, use ciSymbol::make, diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 60fed287df594..c8e95149b7c1a 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -1150,30 +1150,40 @@ static void parse_annotations(const ConstantPool* const cp, if (AnnotationCollector::_unknown == id) continue; coll->set_annotation(id); if (AnnotationCollector::_java_lang_Deprecated == id) { - assert(count <= 2, "change this if more element-value pairs are added to the @Deprecated annotation"); - // @Deprecated can specify forRemoval=true + // @Deprecated can specify forRemoval=true, which we need + // to record for JFR to use. If the annotation is not well-formed + // then we may not be able to determine that. const u1* offset = abase + member_off; - for (int i = 0; i < count; ++i) { + // There are only 2 members in @Deprecated. + int n_members = MIN2(count, 2); + for (int i = 0; i < n_members; ++i) { int member_index = Bytes::get_Java_u2((address)offset); offset += 2; member = check_symbol_at(cp, member_index); - if (member == vmSymbols::since()) { - assert(*((address)offset) == s_tag_val, "invariant"); + if (member == vmSymbols::since() && + (*((address)offset) == s_tag_val)) { + // Found `since` first so skip over it offset += 3; - continue; } - if (member == vmSymbols::for_removal()) { - assert(*((address)offset) == b_tag_val, "invariant"); + else if (member == vmSymbols::for_removal() && + (*((address)offset) == b_tag_val)) { const u2 boolean_value_index = Bytes::get_Java_u2((address)offset + 1); - if (cp->int_at(boolean_value_index) == 1) { + // No guarantee the entry is valid so check it refers to an int in the CP. + if (cp->is_within_bounds(boolean_value_index) && + cp->tag_at(boolean_value_index).is_int() && + cp->int_at(boolean_value_index) == 1) { // forRemoval == true coll->set_annotation(AnnotationCollector::_java_lang_Deprecated_for_removal); } + break; // no need to check further + } + else { + // This @Deprecated annotation is malformed so we don't try to + // determine whether forRemoval is set. break; } - } - continue; + continue; // proceed to next annotation } if (AnnotationCollector::_jdk_internal_vm_annotation_Contended == id) { @@ -1194,11 +1204,21 @@ static void parse_annotations(const ConstantPool* const cp, && s_tag_val == *(abase + tag_off) && member == vmSymbols::value_name()) { group_index = Bytes::get_Java_u2((address)abase + s_con_off); - if (cp->symbol_at(group_index)->utf8_length() == 0) { - group_index = 0; // default contended group + // No guarantee the group_index is valid so check it refers to a + // symbol in the CP. + if (cp->is_within_bounds(group_index) && + cp->tag_at(group_index).is_utf8()) { + // Seems valid, so check for empty string and reset + if (cp->symbol_at(group_index)->utf8_length() == 0) { + group_index = 0; // default contended group + } + } else { + // Not valid so use the default + group_index = 0; } } coll->set_contended_group(group_index); + continue; // proceed to next annotation } } } diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index e410824e3001c..5309fcd20a8be 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -834,7 +834,8 @@ bool ClassLoader::add_to_app_classpath_entries(JavaThread* current, ClassPathEntry* e = _app_classpath_entries; if (check_for_duplicates) { while (e != nullptr) { - if (strcmp(e->name(), entry->name()) == 0) { + if (strcmp(e->name(), entry->name()) == 0 && + e->from_class_path_attr() == entry->from_class_path_attr()) { // entry already exists return false; } diff --git a/src/hotspot/share/classfile/classLoaderExt.cpp b/src/hotspot/share/classfile/classLoaderExt.cpp index 78e29f990d7d1..3cd7dd7cd3ba6 100644 --- a/src/hotspot/share/classfile/classLoaderExt.cpp +++ b/src/hotspot/share/classfile/classLoaderExt.cpp @@ -213,6 +213,15 @@ void ClassLoaderExt::process_jar_manifest(JavaThread* current, ClassPathEntry* e char sep = os::file_separator()[0]; const char* dir_name = entry->name(); const char* dir_tail = strrchr(dir_name, sep); +#ifdef _WINDOWS + // On Windows, we also support forward slash as the file separator when locating entries in the classpath entry. + const char* dir_tail2 = strrchr(dir_name, '/'); + if (dir_tail == nullptr) { + dir_tail = dir_tail2; + } else if (dir_tail2 != nullptr && dir_tail2 > dir_tail) { + dir_tail = dir_tail2; + } +#endif int dir_len; if (dir_tail == nullptr) { dir_len = 0; diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp index 19306a2a9dba1..50453cee61dcf 100644 --- a/src/hotspot/share/classfile/symbolTable.cpp +++ b/src/hotspot/share/classfile/symbolTable.cpp @@ -174,7 +174,8 @@ class SymbolTableConfig : public AllStatic { log_trace_symboltable_helper(&value, "Freeing permanent symbol"); size_t alloc_size = SymbolTableHash::get_dynamic_node_size(value.byte_size()); if (!SymbolTable::arena()->Afree(memory, alloc_size)) { - log_trace_symboltable_helper(&value, "Leaked permanent symbol"); + // Can't access the symbol after Afree, but we just printed it above. + NOT_PRODUCT(log_trace(symboltable)(" - Leaked permanent symbol");) } } SymbolTable::item_removed(); diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index b9a559cf9779f..bcddddc0c7c78 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1149,10 +1149,12 @@ InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik, Symbol* class_name = ik->name(); if (!is_shared_class_visible(class_name, ik, pkg_entry, class_loader)) { + ik->set_shared_loading_failed(); return nullptr; } if (!check_shared_class_super_types(ik, class_loader, protection_domain, THREAD)) { + ik->set_shared_loading_failed(); return nullptr; } diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp index b470eb9b8380d..5e352e42efbc1 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.cpp +++ b/src/hotspot/share/classfile/vmIntrinsics.cpp @@ -90,6 +90,7 @@ bool vmIntrinsics::preserves_state(vmIntrinsics::ID id) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + case vmIntrinsics::_dtanh: case vmIntrinsics::_dlog: case vmIntrinsics::_dlog10: case vmIntrinsics::_dexp: @@ -141,6 +142,7 @@ bool vmIntrinsics::can_trap(vmIntrinsics::ID id) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + case vmIntrinsics::_dtanh: case vmIntrinsics::_dlog: case vmIntrinsics::_dlog10: case vmIntrinsics::_dexp: @@ -288,6 +290,7 @@ bool vmIntrinsics::disabled_by_jvm_flags(vmIntrinsics::ID id) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + case vmIntrinsics::_dtanh: case vmIntrinsics::_dlog: case vmIntrinsics::_dexp: case vmIntrinsics::_dpow: diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 4b772c171d5a6..af1c2b31a9809 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -135,7 +135,7 @@ class methodHandle; do_name(log_name,"log") do_name(log10_name,"log10") do_name(pow_name,"pow") \ do_name(exp_name,"exp") do_name(min_name,"min") do_name(max_name,"max") \ do_name(floor_name, "floor") do_name(ceil_name, "ceil") do_name(rint_name, "rint") \ - do_name(round_name, "round") \ + do_name(round_name, "round") do_name(tanh_name,"tanh") \ \ do_name(addExact_name,"addExact") \ do_name(decrementExact_name,"decrementExact") \ @@ -161,6 +161,7 @@ class methodHandle; do_intrinsic(_dcos, java_lang_Math, cos_name, double_double_signature, F_S) \ do_intrinsic(_dtan, java_lang_Math, tan_name, double_double_signature, F_S) \ do_intrinsic(_datan2, java_lang_Math, atan2_name, double2_double_signature, F_S) \ + do_intrinsic(_dtanh, java_lang_Math, tanh_name, double_double_signature, F_S) \ do_intrinsic(_dsqrt, java_lang_Math, sqrt_name, double_double_signature, F_S) \ do_intrinsic(_dlog, java_lang_Math, log_name, double_double_signature, F_S) \ do_intrinsic(_dlog10, java_lang_Math, log10_name, double_double_signature, F_S) \ diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 11e070862fe2f..f0769e240ddbd 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1767,9 +1767,13 @@ void CodeCache::print_codelist(outputStream* st) { nmethod* nm = iter.method(); ResourceMark rm; char* method_name = nm->method()->name_and_sig_as_C_string(); - st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]", + const char* jvmci_name = nullptr; +#if INCLUDE_JVMCI + jvmci_name = nm->jvmci_name(); +#endif + st->print_cr("%d %d %d %s%s%s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]", nm->compile_id(), nm->comp_level(), nm->get_state(), - method_name, + method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : "", (intptr_t)nm->header_begin(), (intptr_t)nm->code_begin(), (intptr_t)nm->code_end()); } } @@ -1811,12 +1815,20 @@ void CodeCache::write_perf_map(const char* filename, outputStream* st) { while (iter.next()) { CodeBlob *cb = iter.method(); ResourceMark rm; - const char* method_name = - cb->is_nmethod() ? cb->as_nmethod()->method()->external_name() - : cb->name(); - fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s", + const char* method_name = nullptr; + const char* jvmci_name = nullptr; + if (cb->is_nmethod()) { + nmethod* nm = cb->as_nmethod(); + method_name = nm->method()->external_name(); +#if INCLUDE_JVMCI + jvmci_name = nm->jvmci_name(); +#endif + } else { + method_name = cb->name(); + } + fs.print_cr(INTPTR_FORMAT " " INTPTR_FORMAT " %s%s%s", (intptr_t)cb->code_begin(), (intptr_t)cb->code_size(), - method_name); + method_name, jvmci_name ? " jvmci_name=" : "", jvmci_name ? jvmci_name : ""); } } #endif // LINUX diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp index 48c8410ac47fc..1ea3f258dd229 100644 --- a/src/hotspot/share/code/codeHeapState.cpp +++ b/src/hotspot/share/code/codeHeapState.cpp @@ -735,7 +735,16 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular } else { blob_name = os::strdup(cb->name()); } - +#if INCLUDE_JVMCI + const char* jvmci_name = nm->jvmci_name(); + if (jvmci_name != nullptr) { + size_t size = ::strlen(blob_name) + ::strlen(" jvmci_name=") + ::strlen(jvmci_name) + 1; + char* new_blob_name = (char*)os::malloc(size, mtInternal); + os::snprintf(new_blob_name, size, "%s jvmci_name=%s", blob_name, jvmci_name); + os::free((void*)blob_name); + blob_name = new_blob_name; + } +#endif nm_size = nm->total_size(); compile_id = nm->compile_id(); comp_lvl = (CompLevel)(nm->comp_level()); @@ -2184,6 +2193,12 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) { ast->print("%s.", classNameS); ast->print("%s", methNameS); ast->print("%s", methSigS); +#if INCLUDE_JVMCI + const char* jvmci_name = nm->jvmci_name(); + if (jvmci_name != nullptr) { + ast->print(" jvmci_name=%s", jvmci_name); + } +#endif } else { ast->print("%s", blob_name); } diff --git a/src/hotspot/share/code/compiledIC.cpp b/src/hotspot/share/code/compiledIC.cpp index 079c8199b1870..f142e306a6b02 100644 --- a/src/hotspot/share/code/compiledIC.cpp +++ b/src/hotspot/share/code/compiledIC.cpp @@ -83,6 +83,7 @@ void CompiledICData::initialize(CallInfo* call_info, Klass* receiver_klass) { _speculated_klass = (uintptr_t)receiver_klass; } if (call_info->call_kind() == CallInfo::itable_call) { + assert(call_info->resolved_method() != nullptr, "virtual or interface method must be found"); _itable_defc_klass = call_info->resolved_method()->method_holder(); _itable_refc_klass = call_info->resolved_klass(); } @@ -238,6 +239,7 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info) { return; } #ifdef ASSERT + assert(call_info->resolved_method() != nullptr, "virtual or interface method must be found"); int index = call_info->resolved_method()->itable_index(); assert(index == itable_index, "CallInfo pre-computes this"); InstanceKlass* k = call_info->resolved_method()->method_holder(); @@ -254,6 +256,7 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info) { } } + assert(call_info->selected_method() != nullptr, "virtual or interface method must be found"); log_trace(inlinecache)("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT, p2i(_call->instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry)); diff --git a/src/hotspot/share/compiler/oopMap.cpp b/src/hotspot/share/compiler/oopMap.cpp index 09b9feee3db57..376057aa72e25 100644 --- a/src/hotspot/share/compiler/oopMap.cpp +++ b/src/hotspot/share/compiler/oopMap.cpp @@ -246,10 +246,13 @@ class OopMapSort { }; void OopMapSort::sort() { +#ifdef ASSERT for (OopMapStream oms(_map); !oms.is_done(); oms.next()) { OopMapValue omv = oms.current(); - assert(omv.type() == OopMapValue::oop_value || omv.type() == OopMapValue::narrowoop_value || omv.type() == OopMapValue::derived_oop_value || omv.type() == OopMapValue::callee_saved_value, ""); + assert(omv.type() == OopMapValue::oop_value || omv.type() == OopMapValue::narrowoop_value || + omv.type() == OopMapValue::derived_oop_value || omv.type() == OopMapValue::callee_saved_value, ""); } +#endif for (OopMapStream oms(_map); !oms.is_done(); oms.next()) { if (oms.current().type() == OopMapValue::callee_saved_value) { diff --git a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp index f82b5cfcc556a..449ff2e4acf8b 100644 --- a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp +++ b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -219,8 +219,8 @@ class C1G1PostBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { void G1BarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { C1G1PreBarrierCodeGenClosure pre_code_gen_cl; C1G1PostBarrierCodeGenClosure post_code_gen_cl; - _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "g1_pre_barrier_slow", + _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "g1_pre_barrier_slow", false, &pre_code_gen_cl); - _post_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "g1_post_barrier_slow", + _post_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "g1_post_barrier_slow", false, &post_code_gen_cl); } diff --git a/src/hotspot/share/gc/g1/g1BatchedTask.hpp b/src/hotspot/share/gc/g1/g1BatchedTask.hpp index aa16f4ddfd48d..020fda634e4b8 100644 --- a/src/hotspot/share/gc/g1/g1BatchedTask.hpp +++ b/src/hotspot/share/gc/g1/g1BatchedTask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -29,7 +29,7 @@ #include "gc/shared/workerThread.hpp" #include "memory/allocation.hpp" -template +template class GrowableArrayCHeap; // G1AbstractSubTask represents a task to be performed either within a diff --git a/src/hotspot/share/gc/g1/g1MonotonicArena.cpp b/src/hotspot/share/gc/g1/g1MonotonicArena.cpp index 81748d277cff9..b2706d7a9463c 100644 --- a/src/hotspot/share/gc/g1/g1MonotonicArena.cpp +++ b/src/hotspot/share/gc/g1/g1MonotonicArena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -29,22 +29,22 @@ #include "runtime/vmOperations.hpp" #include "utilities/globalCounter.inline.hpp" -G1MonotonicArena::Segment::Segment(uint slot_size, uint num_slots, Segment* next, MEMFLAGS flag) : +G1MonotonicArena::Segment::Segment(uint slot_size, uint num_slots, Segment* next, MemTag mem_tag) : _slot_size(slot_size), _num_slots(num_slots), _next(next), _next_allocate(0), - _mem_flag(flag) { + _mem_tag(mem_tag) { _bottom = ((char*) this) + header_size(); } G1MonotonicArena::Segment* G1MonotonicArena::Segment::create_segment(uint slot_size, uint num_slots, Segment* next, - MEMFLAGS mem_flag) { + MemTag mem_tag) { size_t block_size = size_in_bytes(slot_size, num_slots); - char* alloc_block = NEW_C_HEAP_ARRAY(char, block_size, mem_flag); - return new (alloc_block) Segment(slot_size, num_slots, next, mem_flag); + char* alloc_block = NEW_C_HEAP_ARRAY(char, block_size, mem_tag); + return new (alloc_block) Segment(slot_size, num_slots, next, mem_tag); } void G1MonotonicArena::Segment::delete_segment(Segment* segment) { @@ -54,7 +54,7 @@ void G1MonotonicArena::Segment::delete_segment(Segment* segment) { GlobalCounter::write_synchronize(); } segment->~Segment(); - FREE_C_HEAP_ARRAY(_mem_flag, segment); + FREE_C_HEAP_ARRAY(_mem_tag, segment); } void G1MonotonicArena::SegmentFreeList::bulk_add(Segment& first, @@ -108,7 +108,7 @@ G1MonotonicArena::Segment* G1MonotonicArena::new_segment(Segment* const prev) { uint prev_num_slots = (prev != nullptr) ? prev->num_slots() : 0; uint num_slots = _alloc_options->next_num_slots(prev_num_slots); - next = Segment::create_segment(slot_size(), num_slots, prev, _alloc_options->mem_flag()); + next = Segment::create_segment(slot_size(), num_slots, prev, _alloc_options->mem_tag()); } else { assert(slot_size() == next->slot_size() , "Mismatch %d != %d", slot_size(), next->slot_size()); diff --git a/src/hotspot/share/gc/g1/g1MonotonicArena.hpp b/src/hotspot/share/gc/g1/g1MonotonicArena.hpp index bf46e4a33513a..b51f3e37db180 100644 --- a/src/hotspot/share/gc/g1/g1MonotonicArena.hpp +++ b/src/hotspot/share/gc/g1/g1MonotonicArena.hpp @@ -27,7 +27,7 @@ #define SHARE_GC_G1_G1MONOTONICARENA_HPP #include "gc/shared/freeListAllocator.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/lockFreeStack.hpp" @@ -120,7 +120,7 @@ class G1MonotonicArena::Segment { // to _num_slots (can be larger because we atomically increment this value and // check only afterwards if the allocation has been successful). uint volatile _next_allocate; - const MEMFLAGS _mem_flag; + const MemTag _mem_tag; char* _bottom; // Actual data. // Do not add class member variables beyond this point @@ -136,7 +136,7 @@ class G1MonotonicArena::Segment { NONCOPYABLE(Segment); - Segment(uint slot_size, uint num_slots, Segment* next, MEMFLAGS flag); + Segment(uint slot_size, uint num_slots, Segment* next, MemTag mem_tag); ~Segment() = default; public: Segment* volatile* next_addr() { return &_next; } @@ -173,7 +173,7 @@ class G1MonotonicArena::Segment { return header_size() + payload_size(slot_size, num_slots); } - static Segment* create_segment(uint slot_size, uint num_slots, Segment* next, MEMFLAGS mem_flag); + static Segment* create_segment(uint slot_size, uint num_slots, Segment* next, MemTag mem_tag); static void delete_segment(Segment* segment); // Copies the contents of this segment into the destination. @@ -222,7 +222,7 @@ class G1MonotonicArena::SegmentFreeList { class G1MonotonicArena::AllocOptions { protected: - const MEMFLAGS _mem_flag; + const MemTag _mem_tag; const uint _slot_size; const uint _initial_num_slots; // Defines a limit to the number of slots in the segment @@ -230,8 +230,8 @@ class G1MonotonicArena::AllocOptions { const uint _slot_alignment; public: - AllocOptions(MEMFLAGS mem_flag, uint slot_size, uint initial_num_slots, uint max_num_slots, uint alignment) : - _mem_flag(mem_flag), + AllocOptions(MemTag mem_tag, uint slot_size, uint initial_num_slots, uint max_num_slots, uint alignment) : + _mem_tag(mem_tag), _slot_size(align_up(slot_size, alignment)), _initial_num_slots(initial_num_slots), _max_num_slots(max_num_slots), @@ -250,7 +250,7 @@ class G1MonotonicArena::AllocOptions { uint slot_alignment() const { return _slot_alignment; } - MEMFLAGS mem_flag() const {return _mem_flag; } + MemTag mem_tag() const {return _mem_tag; } }; #endif //SHARE_GC_G1_MONOTONICARENA_HPP diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp index 1cfd6fca08a6f..3f7fefd8a07a6 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp @@ -87,8 +87,6 @@ class G1ParScanThreadState : public CHeapObj { // Indicates whether in the last generation (old) there is no more space // available for allocation. bool _old_gen_is_full; - // Size (in elements) of a partial objArray task chunk. - size_t _partial_objarray_chunk_size; PartialArrayStateAllocator* _partial_array_state_allocator; PartialArrayTaskStepper _partial_array_stepper; StringDedup::Requests _string_dedup_requests; diff --git a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp index 5f903960cce8c..4403b4c8dd981 100644 --- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp +++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -40,15 +40,15 @@ G1RegionToSpaceMapper::G1RegionToSpaceMapper(ReservedSpace rs, size_t page_size, size_t region_granularity, size_t commit_factor, - MEMFLAGS type) : + MemTag mem_tag) : _listener(nullptr), _storage(rs, used_size, page_size), _region_commit_map(rs.size() * commit_factor / region_granularity, mtGC), - _memory_type(type) { + _memory_tag(mem_tag) { guarantee(is_power_of_2(page_size), "must be"); guarantee(is_power_of_2(region_granularity), "must be"); - MemTracker::record_virtual_memory_type((address)rs.base(), type); + MemTracker::record_virtual_memory_tag((address)rs.base(), mem_tag); } // Used to manually signal a mapper to handle a set of regions as committed. @@ -72,8 +72,8 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper { size_t page_size, size_t alloc_granularity, size_t commit_factor, - MEMFLAGS type) : - G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type), + MemTag mem_tag) : + G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, mem_tag), _pages_per_region(alloc_granularity / (page_size * commit_factor)) { guarantee(alloc_granularity >= page_size, "allocation granularity smaller than commit granularity"); @@ -97,7 +97,7 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper { const size_t start_page = (size_t)start_idx * _pages_per_region; const size_t size_in_pages = num_regions * _pages_per_region; bool zero_filled = _storage.commit(start_page, size_in_pages); - if (_memory_type == mtJavaHeap) { + if (_memory_tag == mtJavaHeap) { for (uint region_index = start_idx; region_index < start_idx + num_regions; region_index++ ) { void* address = _storage.page_start(region_index * _pages_per_region); size_t size_in_bytes = _storage.page_size() * _pages_per_region; @@ -150,7 +150,7 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper { } void numa_request_on_node(size_t page_idx) { - if (_memory_type == mtJavaHeap) { + if (_memory_tag == mtJavaHeap) { uint region = (uint)(page_idx * _regions_per_page); void* address = _storage.page_start(page_idx); size_t size_in_bytes = _storage.page_size(); @@ -164,8 +164,8 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper { size_t page_size, size_t alloc_granularity, size_t commit_factor, - MEMFLAGS type) : - G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type), + MemTag mem_tag) : + G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, mem_tag), _regions_per_page((page_size * commit_factor) / alloc_granularity), _lock(Mutex::service-3, "G1Mapper_lock") { @@ -263,10 +263,10 @@ G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_mapper(ReservedSpace rs, size_t page_size, size_t region_granularity, size_t commit_factor, - MEMFLAGS type) { + MemTag mem_tag) { if (region_granularity >= (page_size * commit_factor)) { - return new G1RegionsLargerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type); + return new G1RegionsLargerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, mem_tag); } else { - return new G1RegionsSmallerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type); + return new G1RegionsSmallerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, mem_tag); } } diff --git a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp index 02498b394b39f..5ef0f8ec5ab51 100644 --- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp +++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -52,9 +52,9 @@ class G1RegionToSpaceMapper : public CHeapObj { // Mapping management CHeapBitMap _region_commit_map; - MEMFLAGS _memory_type; + MemTag _memory_tag; - G1RegionToSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, size_t commit_factor, MEMFLAGS type); + G1RegionToSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, size_t commit_factor, MemTag mem_tag); void fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled); public: @@ -85,7 +85,7 @@ class G1RegionToSpaceMapper : public CHeapObj { size_t page_size, size_t region_granularity, size_t byte_translation_factor, - MEMFLAGS type); + MemTag mem_tag); }; #endif // SHARE_GC_G1_G1REGIONTOSPACEMAPPER_HPP diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp index b1fc956a54a21..ef9de7abfd771 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.cpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp @@ -51,7 +51,7 @@ void ObjectStartArray::initialize(MemRegion reserved_region) { if (!backing_store.is_reserved()) { vm_exit_during_initialization("Could not reserve space for ObjectStartArray"); } - MemTracker::record_virtual_memory_type(backing_store.base(), mtGC); + MemTracker::record_virtual_memory_tag(backing_store.base(), mtGC); // We do not commit any memory initially _virtual_space.initialize(backing_store); diff --git a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp index 658c3ef106fa0..46a178500e576 100644 --- a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp +++ b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp @@ -51,7 +51,7 @@ ParMarkBitMap::initialize(MemRegion covered_region) os::trace_page_sizes("Mark Bitmap", raw_bytes, raw_bytes, rs.base(), rs.size(), used_page_sz); - MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); + MemTracker::record_virtual_memory_tag((address)rs.base(), mtGC); _virtual_space = new PSVirtualSpace(rs, page_sz); if (_virtual_space != nullptr && _virtual_space->expand_by(_reserved_byte_size)) { diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index 4bff8f8a7d06a..1ab7b2af7ed74 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -235,7 +235,7 @@ ParallelCompactData::create_vspace(size_t count, size_t element_size) os::trace_page_sizes("Parallel Compact Data", raw_bytes, raw_bytes, rs.base(), rs.size(), page_sz); - MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); + MemTracker::record_virtual_memory_tag((address)rs.base(), mtGC); PSVirtualSpace* vspace = new PSVirtualSpace(rs, page_sz); if (vspace != nullptr) { diff --git a/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp b/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp index 59b7f130df30b..31f18652c63d6 100644 --- a/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp +++ b/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp @@ -42,7 +42,7 @@ SerialBlockOffsetTable::SerialBlockOffsetTable(MemRegion reserved, vm_exit_during_initialization("Could not reserve enough space for heap offset array"); } - MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); + MemTracker::record_virtual_memory_tag((address)rs.base(), mtGC); if (!_vs.initialize(rs, 0)) { vm_exit_during_initialization("Could not reserve enough space for heap offset array"); diff --git a/src/hotspot/share/gc/shared/cardTable.cpp b/src/hotspot/share/gc/shared/cardTable.cpp index 95f7058f4e4ee..acd4bda6e1071 100644 --- a/src/hotspot/share/gc/shared/cardTable.cpp +++ b/src/hotspot/share/gc/shared/cardTable.cpp @@ -84,7 +84,7 @@ void CardTable::initialize(void* region0_start, void* region1_start) { MAX2(_page_size, os::vm_allocation_granularity()); ReservedSpace heap_rs(_byte_map_size, rs_align, _page_size); - MemTracker::record_virtual_memory_type((address)heap_rs.base(), mtGC); + MemTracker::record_virtual_memory_tag((address)heap_rs.base(), mtGC); os::trace_page_sizes("Card Table", num_bytes, num_bytes, heap_rs.base(), heap_rs.size(), _page_size); diff --git a/src/hotspot/share/gc/shared/oopStorage.cpp b/src/hotspot/share/gc/shared/oopStorage.cpp index 7117b86b26403..568888ac7d97e 100644 --- a/src/hotspot/share/gc/shared/oopStorage.cpp +++ b/src/hotspot/share/gc/shared/oopStorage.cpp @@ -127,10 +127,10 @@ OopStorage::ActiveArray::~ActiveArray() { } OopStorage::ActiveArray* OopStorage::ActiveArray::create(size_t size, - MEMFLAGS memflags, + MemTag mem_tag, AllocFailType alloc_fail) { size_t size_in_bytes = blocks_offset() + sizeof(Block*) * size; - void* mem = NEW_C_HEAP_ARRAY3(char, size_in_bytes, memflags, CURRENT_PC, alloc_fail); + void* mem = NEW_C_HEAP_ARRAY3(char, size_in_bytes, mem_tag, CURRENT_PC, alloc_fail); if (mem == nullptr) return nullptr; return new (mem) ActiveArray(size); } @@ -343,7 +343,7 @@ OopStorage::Block* OopStorage::Block::new_block(const OopStorage* owner) { // _data must be first member: aligning block => aligning _data. STATIC_ASSERT(_data_pos == 0); size_t size_needed = allocation_size(); - void* memory = NEW_C_HEAP_ARRAY_RETURN_NULL(char, size_needed, owner->memflags()); + void* memory = NEW_C_HEAP_ARRAY_RETURN_NULL(char, size_needed, owner->mem_tag()); if (memory == nullptr) { return nullptr; } @@ -575,7 +575,7 @@ bool OopStorage::expand_active_array() { log_debug(oopstorage, blocks)("%s: expand active array " SIZE_FORMAT, name(), new_size); ActiveArray* new_array = ActiveArray::create(new_size, - memflags(), + mem_tag(), AllocFailStrategy::RETURN_NULL); if (new_array == nullptr) return false; new_array->copy_from(old_array); @@ -805,8 +805,8 @@ void OopStorage::release(const oop* const* ptrs, size_t size) { } } -OopStorage* OopStorage::create(const char* name, MEMFLAGS memflags) { - return new (memflags) OopStorage(name, memflags); +OopStorage* OopStorage::create(const char* name, MemTag mem_tag) { + return new (mem_tag) OopStorage(name, mem_tag); } const size_t initial_active_array_size = 8; @@ -819,9 +819,9 @@ static Mutex* make_oopstorage_mutex(const char* storage_name, return new PaddedMutex(rank, name); } -OopStorage::OopStorage(const char* name, MEMFLAGS memflags) : +OopStorage::OopStorage(const char* name, MemTag mem_tag) : _name(os::strdup(name)), - _active_array(ActiveArray::create(initial_active_array_size, memflags)), + _active_array(ActiveArray::create(initial_active_array_size, mem_tag)), _allocation_list(), _deferred_updates(nullptr), _allocation_mutex(make_oopstorage_mutex(name, "alloc", Mutex::oopstorage)), @@ -829,7 +829,7 @@ OopStorage::OopStorage(const char* name, MEMFLAGS memflags) : _num_dead_callback(nullptr), _allocation_count(0), _concurrent_iteration_count(0), - _memflags(memflags), + _mem_tag(mem_tag), _needs_cleanup(false) { _active_array->increment_refcount(); @@ -1030,7 +1030,7 @@ size_t OopStorage::total_memory_usage() const { return total_size; } -MEMFLAGS OopStorage::memflags() const { return _memflags; } +MemTag OopStorage::mem_tag() const { return _mem_tag; } // Parallel iteration support @@ -1135,6 +1135,26 @@ void OopStorage::BasicParState::report_num_dead() const { const char* OopStorage::name() const { return _name; } +bool OopStorage::print_containing(const oop* addr, outputStream* st) { + if (addr != nullptr) { + Block* block = find_block_or_null(addr); + if (block != nullptr && block->print_containing(addr, st)) { + st->print(" in oop storage \"%s\"", name()); + return true; + } + } + return false; +} + +bool OopStorage::Block::print_containing(const oop* addr, outputStream* st) { + if (contains(addr)) { + st->print(PTR_FORMAT " is a pointer %u/%zu into block %zu", + p2i(addr), get_index(addr), ARRAY_SIZE(_data), _active_index); + return true; + } + return false; +} + #ifndef PRODUCT void OopStorage::print_on(outputStream* st) const { diff --git a/src/hotspot/share/gc/shared/oopStorage.hpp b/src/hotspot/share/gc/shared/oopStorage.hpp index dfc0f83fc1912..96cc5a23d6a91 100644 --- a/src/hotspot/share/gc/shared/oopStorage.hpp +++ b/src/hotspot/share/gc/shared/oopStorage.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -74,7 +74,7 @@ class outputStream; class OopStorage : public CHeapObjBase { public: - static OopStorage* create(const char* name, MEMFLAGS memflags); + static OopStorage* create(const char* name, MemTag mem_tag); ~OopStorage(); // These count and usage accessors are racy unless at a safepoint. @@ -89,8 +89,8 @@ class OopStorage : public CHeapObjBase { // bookkeeping overhead, including this storage object. size_t total_memory_usage() const; - // The memory type for allocations. - MEMFLAGS memflags() const; + // The memory tag for allocations. + MemTag mem_tag() const; enum EntryStatus { INVALID_ENTRY, @@ -213,6 +213,7 @@ class OopStorage : public CHeapObjBase { // Debugging and logging support. const char* name() const; void print_on(outputStream* st) const PRODUCT_RETURN; + bool print_containing(const oop* addr, outputStream* st); // Provides access to storage internals, for unit testing. // Declare, but not define, the public class OopStorage::TestAccess. @@ -273,14 +274,14 @@ class OopStorage : public CHeapObjBase { // mutable because this gets set even for const iteration. mutable int _concurrent_iteration_count; - // The memory type for allocations. - MEMFLAGS _memflags; + // The memory tag for allocations. + MemTag _mem_tag; // Flag indicating this storage object is a candidate for empty block deletion. volatile bool _needs_cleanup; // Clients construct via "create" factory function. - OopStorage(const char* name, MEMFLAGS memflags); + OopStorage(const char* name, MemTag mem_tag); NONCOPYABLE(OopStorage); bool try_add_block(); diff --git a/src/hotspot/share/gc/shared/oopStorage.inline.hpp b/src/hotspot/share/gc/shared/oopStorage.inline.hpp index e1e815acd094e..545da0be0a76e 100644 --- a/src/hotspot/share/gc/shared/oopStorage.inline.hpp +++ b/src/hotspot/share/gc/shared/oopStorage.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -60,7 +60,7 @@ class OopStorage::ActiveArray { public: static ActiveArray* create(size_t size, - MEMFLAGS memflags = mtGC, + MemTag mem_tag = mtGC, AllocFailType alloc_fail = AllocFailStrategy::EXIT_OOM); static void destroy(ActiveArray* ba); @@ -196,6 +196,8 @@ class OopStorage::Block /* No base class, to avoid messing up alignment. */ { template bool iterate(F f); template bool iterate(F f) const; + + bool print_containing(const oop* addr, outputStream* st); }; // class Block inline OopStorage::Block* OopStorage::AllocationList::head() { diff --git a/src/hotspot/share/gc/shared/oopStorageSet.cpp b/src/hotspot/share/gc/shared/oopStorageSet.cpp index e119e570759a4..c6947590d96fb 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.cpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -31,18 +31,18 @@ OopStorage* OopStorageSet::_storages[all_count] = {}; -OopStorage* OopStorageSet::create_strong(const char* name, MEMFLAGS memflags) { +OopStorage* OopStorageSet::create_strong(const char* name, MemTag mem_tag) { static uint registered_strong = 0; assert(registered_strong < strong_count, "More registered strong storages than slots"); - OopStorage* storage = OopStorage::create(name, memflags); + OopStorage* storage = OopStorage::create(name, mem_tag); _storages[strong_start + registered_strong++] = storage; return storage; } -OopStorage* OopStorageSet::create_weak(const char* name, MEMFLAGS memflags) { +OopStorage* OopStorageSet::create_weak(const char* name, MemTag mem_tag) { static uint registered_weak = 0; assert(registered_weak < weak_count, "More registered strong storages than slots"); - OopStorage* storage = OopStorage::create(name, memflags); + OopStorage* storage = OopStorage::create(name, mem_tag); _storages[weak_start + registered_weak++] = storage; return storage; } @@ -82,6 +82,23 @@ template OopStorage* OopStorageSet::get_storage(StrongId); template OopStorage* OopStorageSet::get_storage(WeakId); template OopStorage* OopStorageSet::get_storage(Id); +bool OopStorageSet::print_containing(const void* addr, outputStream* st) { + if (addr != nullptr) { + const void* aligned_addr = align_down(addr, alignof(oop)); + for (OopStorage* storage : Range()) { + if (storage->print_containing((oop*) aligned_addr, st)) { + if (aligned_addr != addr) { + st->print_cr(" (unaligned)"); + } else { + st->cr(); + } + return true; + } + } + } + return false; +} + #ifdef ASSERT void OopStorageSet::verify_initialized(uint index) { diff --git a/src/hotspot/share/gc/shared/oopStorageSet.hpp b/src/hotspot/share/gc/shared/oopStorageSet.hpp index 26e0e9f5a7775..867172c41ad74 100644 --- a/src/hotspot/share/gc/shared/oopStorageSet.hpp +++ b/src/hotspot/share/gc/shared/oopStorageSet.hpp @@ -25,7 +25,8 @@ #ifndef SHARE_GC_SHARED_OOPSTORAGESET_HPP #define SHARE_GC_SHARED_OOPSTORAGESET_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" +#include "oops/oop.hpp" #include "utilities/debug.hpp" #include "utilities/enumIterator.hpp" #include "utilities/globalDefinitions.hpp" @@ -79,8 +80,8 @@ class OopStorageSet : public AllStatic { static OopStorage* storage(WeakId id) { return get_storage(id); } static OopStorage* storage(Id id) { return get_storage(id); } - static OopStorage* create_strong(const char* name, MEMFLAGS memflags); - static OopStorage* create_weak(const char* name, MEMFLAGS memflags); + static OopStorage* create_strong(const char* name, MemTag mem_tag); + static OopStorage* create_weak(const char* name, MemTag mem_tag); // Support iteration over the storage objects. template class Range; @@ -89,6 +90,8 @@ class OopStorageSet : public AllStatic { template static void strong_oops_do(Closure* cl); + // Debugging: print location info, if in storage. + static bool print_containing(const void* addr, outputStream* st); }; ENUMERATOR_VALUE_RANGE(OopStorageSet::StrongId, diff --git a/src/hotspot/share/gc/shared/partialArrayState.cpp b/src/hotspot/share/gc/shared/partialArrayState.cpp index fd23a32022208..48ef974ecfa53 100644 --- a/src/hotspot/share/gc/shared/partialArrayState.cpp +++ b/src/hotspot/share/gc/shared/partialArrayState.cpp @@ -26,7 +26,7 @@ #include "gc/shared/partialArrayState.hpp" #include "memory/allocation.inline.hpp" #include "memory/arena.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "oops/oopsHierarchy.hpp" #include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp index aab2f5d312399..ab85c293941df 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp @@ -35,7 +35,7 @@ #include "gc/shared/stringdedup/stringDedupTable.hpp" #include "logging/log.hpp" #include "memory/iterator.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "oops/access.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/cpuTimeCounters.hpp" diff --git a/src/hotspot/share/gc/shared/taskqueue.hpp b/src/hotspot/share/gc/shared/taskqueue.hpp index f4a3731583bc9..efbc1882fbed8 100644 --- a/src/hotspot/share/gc/shared/taskqueue.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.hpp @@ -116,8 +116,8 @@ void TaskQueueStats::reset() { // TaskQueueSuper collects functionality common to all GenericTaskQueue instances. -template -class TaskQueueSuper: public CHeapObj { +template +class TaskQueueSuper: public CHeapObj { protected: // Internal type for indexing the queue; also used for the tag. typedef NOT_LP64(uint16_t) LP64_ONLY(uint32_t) idx_t; @@ -324,39 +324,39 @@ class TaskQueueSuper: public CHeapObj { // practice of parallel programming (PPoPP 2013), 69-80 // -template -class GenericTaskQueue: public TaskQueueSuper { +template +class GenericTaskQueue: public TaskQueueSuper { protected: - typedef typename TaskQueueSuper::Age Age; - typedef typename TaskQueueSuper::idx_t idx_t; + typedef typename TaskQueueSuper::Age Age; + typedef typename TaskQueueSuper::idx_t idx_t; - using TaskQueueSuper::MOD_N_MASK; + using TaskQueueSuper::MOD_N_MASK; - using TaskQueueSuper::bottom_relaxed; - using TaskQueueSuper::bottom_acquire; + using TaskQueueSuper::bottom_relaxed; + using TaskQueueSuper::bottom_acquire; - using TaskQueueSuper::set_bottom_relaxed; - using TaskQueueSuper::release_set_bottom; + using TaskQueueSuper::set_bottom_relaxed; + using TaskQueueSuper::release_set_bottom; - using TaskQueueSuper::age_relaxed; - using TaskQueueSuper::set_age_relaxed; - using TaskQueueSuper::cmpxchg_age; - using TaskQueueSuper::age_top_relaxed; + using TaskQueueSuper::age_relaxed; + using TaskQueueSuper::set_age_relaxed; + using TaskQueueSuper::cmpxchg_age; + using TaskQueueSuper::age_top_relaxed; - using TaskQueueSuper::increment_index; - using TaskQueueSuper::decrement_index; - using TaskQueueSuper::dirty_size; - using TaskQueueSuper::clean_size; - using TaskQueueSuper::assert_not_underflow; + using TaskQueueSuper::increment_index; + using TaskQueueSuper::decrement_index; + using TaskQueueSuper::dirty_size; + using TaskQueueSuper::clean_size; + using TaskQueueSuper::assert_not_underflow; public: - typedef typename TaskQueueSuper::PopResult PopResult; + typedef typename TaskQueueSuper::PopResult PopResult; - using TaskQueueSuper::max_elems; - using TaskQueueSuper::size; + using TaskQueueSuper::max_elems; + using TaskQueueSuper::size; #if TASKQUEUE_STATS - using TaskQueueSuper::stats; + using TaskQueueSuper::stats; #endif private: @@ -428,12 +428,12 @@ class GenericTaskQueue: public TaskQueueSuper { // Note that size() is not hidden--it returns the number of elements in the // TaskQueue, and does not include the size of the overflow stack. This // simplifies replacement of GenericTaskQueues with OverflowTaskQueues. -template -class OverflowTaskQueue: public GenericTaskQueue +template +class OverflowTaskQueue: public GenericTaskQueue { public: - typedef Stack overflow_t; - typedef GenericTaskQueue taskqueue_t; + typedef Stack overflow_t; + typedef GenericTaskQueue taskqueue_t; TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;) @@ -467,11 +467,11 @@ class TaskQueueSetSuper { virtual uint tasks() const = 0; }; -template class TaskQueueSetSuperImpl: public CHeapObj, public TaskQueueSetSuper { +template class TaskQueueSetSuperImpl: public CHeapObj, public TaskQueueSetSuper { }; -template -class GenericTaskQueueSet: public TaskQueueSetSuperImpl { +template +class GenericTaskQueueSet: public TaskQueueSetSuperImpl { public: typedef typename T::element_type E; typedef typename T::PopResult PopResult; @@ -518,29 +518,29 @@ class GenericTaskQueueSet: public TaskQueueSetSuperImpl { #endif // TASKQUEUE_STATS }; -template void -GenericTaskQueueSet::register_queue(uint i, T* q) { +template void +GenericTaskQueueSet::register_queue(uint i, T* q) { assert(i < _n, "index out of range."); _queues[i] = q; } -template T* -GenericTaskQueueSet::queue(uint i) { +template T* +GenericTaskQueueSet::queue(uint i) { assert(i < _n, "index out of range."); return _queues[i]; } #ifdef ASSERT -template -void GenericTaskQueueSet::assert_empty() const { +template +void GenericTaskQueueSet::assert_empty() const { for (uint j = 0; j < _n; j++) { _queues[j]->assert_empty(); } } #endif // ASSERT -template -uint GenericTaskQueueSet::tasks() const { +template +uint GenericTaskQueueSet::tasks() const { uint n = 0; for (uint j = 0; j < _n; j++) { n += _queues[j]->size(); diff --git a/src/hotspot/share/gc/shared/taskqueue.inline.hpp b/src/hotspot/share/gc/shared/taskqueue.inline.hpp index f937ce8a2e993..8e65cfd704fda 100644 --- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -38,30 +38,30 @@ #include "utilities/ostream.hpp" #include "utilities/stack.inline.hpp" -template -inline GenericTaskQueueSet::GenericTaskQueueSet(uint n) : _n(n) { +template +inline GenericTaskQueueSet::GenericTaskQueueSet(uint n) : _n(n) { typedef T* GenericTaskQueuePtr; - _queues = NEW_C_HEAP_ARRAY(GenericTaskQueuePtr, n, F); + _queues = NEW_C_HEAP_ARRAY(GenericTaskQueuePtr, n, MT); for (uint i = 0; i < n; i++) { _queues[i] = nullptr; } } -template -inline GenericTaskQueueSet::~GenericTaskQueueSet() { +template +inline GenericTaskQueueSet::~GenericTaskQueueSet() { FREE_C_HEAP_ARRAY(T*, _queues); } #if TASKQUEUE_STATS -template -void GenericTaskQueueSet::print_taskqueue_stats_hdr(outputStream* const st, const char* label) { +template +void GenericTaskQueueSet::print_taskqueue_stats_hdr(outputStream* const st, const char* label) { st->print_cr("GC Task Stats %s", label); st->print("thr "); TaskQueueStats::print_header(1, st); st->cr(); st->print("--- "); TaskQueueStats::print_header(2, st); st->cr(); } -template -void GenericTaskQueueSet::print_taskqueue_stats(outputStream* const st, const char* label) { +template +void GenericTaskQueueSet::print_taskqueue_stats(outputStream* const st, const char* label) { print_taskqueue_stats_hdr(st, label); TaskQueueStats totals; @@ -75,16 +75,16 @@ void GenericTaskQueueSet::print_taskqueue_stats(outputStream* const st, co DEBUG_ONLY(totals.verify()); } -template -void GenericTaskQueueSet::reset_taskqueue_stats() { +template +void GenericTaskQueueSet::reset_taskqueue_stats() { const uint n = size(); for (uint i = 0; i < n; ++i) { queue(i)->stats.reset(); } } -template -inline void GenericTaskQueueSet::print_and_reset_taskqueue_stats(const char* label) { +template +inline void GenericTaskQueueSet::print_and_reset_taskqueue_stats(const char* label) { if (!log_is_enabled(Trace, gc, task, stats)) { return; } @@ -97,19 +97,19 @@ inline void GenericTaskQueueSet::print_and_reset_taskqueue_stats(const cha } #endif // TASKQUEUE_STATS -template -inline GenericTaskQueue::GenericTaskQueue() : - _elems(MallocArrayAllocator::allocate(N, F)), +template +inline GenericTaskQueue::GenericTaskQueue() : + _elems(MallocArrayAllocator::allocate(N, MT)), _last_stolen_queue_id(InvalidQueueId), _seed(17 /* random number */) {} -template -inline GenericTaskQueue::~GenericTaskQueue() { +template +inline GenericTaskQueue::~GenericTaskQueue() { MallocArrayAllocator::free(_elems); } -template inline bool -GenericTaskQueue::push(E t) { +template inline bool +GenericTaskQueue::push(E t) { uint localBot = bottom_relaxed(); assert(localBot < N, "_bottom out of range."); idx_t top = age_top_relaxed(); @@ -134,8 +134,8 @@ GenericTaskQueue::push(E t) { return false; // Queue is full. } -template -inline bool OverflowTaskQueue::push(E t) { +template +inline bool OverflowTaskQueue::push(E t) { if (!taskqueue_t::push(t)) { overflow_stack()->push(t); TASKQUEUE_STATS_ONLY(stats.record_overflow(overflow_stack()->size())); @@ -143,8 +143,8 @@ inline bool OverflowTaskQueue::push(E t) { return true; } -template -inline bool OverflowTaskQueue::try_push_to_taskqueue(E t) { +template +inline bool OverflowTaskQueue::try_push_to_taskqueue(E t) { return taskqueue_t::push(t); } @@ -154,8 +154,8 @@ inline bool OverflowTaskQueue::try_push_to_taskqueue(E t) { // whenever the queue goes empty which it will do here if this thread // gets the last task or in pop_global() if the queue wraps (top == 0 // and pop_global() succeeds, see pop_global()). -template -bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) { +template +bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) { // This queue was observed to contain exactly one element; either this // thread will claim it, or a competing "pop_global". In either case, // the queue will be logically empty afterwards. Create a new Age value @@ -187,8 +187,8 @@ bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) { return false; } -template inline bool -GenericTaskQueue::pop_local(E& t, uint threshold) { +template inline bool +GenericTaskQueue::pop_local(E& t, uint threshold) { uint localBot = bottom_relaxed(); // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method @@ -224,8 +224,8 @@ GenericTaskQueue::pop_local(E& t, uint threshold) { } } -template -bool OverflowTaskQueue::pop_overflow(E& t) +template +bool OverflowTaskQueue::pop_overflow(E& t) { if (overflow_empty()) return false; t = overflow_stack()->pop(); @@ -253,8 +253,8 @@ bool OverflowTaskQueue::pop_overflow(E& t) // (3) Owner starts a push, writing elems[bottom]. At the same time, Thief // reads elems[oldAge.top]. The owner's bottom == the thief's oldAge.top. // (4) Thief will discard the read value, because its cmpxchg of age will fail. -template -typename GenericTaskQueue::PopResult GenericTaskQueue::pop_global(E& t) { +template +typename GenericTaskQueue::PopResult GenericTaskQueue::pop_global(E& t) { Age oldAge = age_relaxed(); // Architectures with non-multi-copy-atomic memory model require a @@ -311,13 +311,13 @@ inline int randomParkAndMiller(int *seed0) { return seed; } -template -int GenericTaskQueue::next_random_queue_id() { +template +int GenericTaskQueue::next_random_queue_id() { return randomParkAndMiller(&_seed); } -template -typename GenericTaskQueueSet::PopResult GenericTaskQueueSet::steal_best_of_2(uint queue_num, E& t) { +template +typename GenericTaskQueueSet::PopResult GenericTaskQueueSet::steal_best_of_2(uint queue_num, E& t) { T* const local_queue = queue(queue_num); if (_n > 2) { uint k1 = queue_num; @@ -372,8 +372,8 @@ typename GenericTaskQueueSet::PopResult GenericTaskQueueSet::steal_b } } -template -bool GenericTaskQueueSet::steal(uint queue_num, E& t) { +template +bool GenericTaskQueueSet::steal(uint queue_num, E& t) { uint const num_retries = 2 * _n; TASKQUEUE_STATS_ONLY(uint contended_in_a_row = 0;) @@ -394,9 +394,9 @@ bool GenericTaskQueueSet::steal(uint queue_num, E& t) { return false; } -template +template template -inline void GenericTaskQueue::iterate(Fn fn) { +inline void GenericTaskQueue::iterate(Fn fn) { uint iters = size(); uint index = bottom_relaxed(); for (uint i = 0; i < iters; ++i) { diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp index 6b104e7e19935..0e8b02d247e9b 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved. + * Copyright (c) 2018, 2024, Red Hat, Inc. 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 @@ -263,27 +263,27 @@ class C1ShenandoahLoadReferenceBarrierCodeGenClosure : public StubAssemblerCodeG void ShenandoahBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { C1ShenandoahPreBarrierCodeGenClosure pre_code_gen_cl; - _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, + _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "shenandoah_pre_barrier_slow", false, &pre_code_gen_cl); if (ShenandoahLoadRefBarrier) { C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_strong_code_gen_cl(ON_STRONG_OOP_REF); - _load_reference_barrier_strong_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + _load_reference_barrier_strong_rt_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "shenandoah_load_reference_barrier_strong_slow", false, &lrb_strong_code_gen_cl); C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_strong_native_code_gen_cl(ON_STRONG_OOP_REF | IN_NATIVE); - _load_reference_barrier_strong_native_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + _load_reference_barrier_strong_native_rt_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "shenandoah_load_reference_barrier_strong_native_slow", false, &lrb_strong_native_code_gen_cl); C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_weak_code_gen_cl(ON_WEAK_OOP_REF); - _load_reference_barrier_weak_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + _load_reference_barrier_weak_rt_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "shenandoah_load_reference_barrier_weak_slow", false, &lrb_weak_code_gen_cl); C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_phantom_code_gen_cl(ON_PHANTOM_OOP_REF | IN_NATIVE); - _load_reference_barrier_phantom_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + _load_reference_barrier_phantom_rt_code_blob = Runtime1::generate_blob(buffer_blob, C1StubId::NO_STUBID, "shenandoah_load_reference_barrier_phantom_slow", false, &lrb_phantom_code_gen_cl); } diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index d2820f3aa267f..71174d11a6214 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -271,6 +271,11 @@ bool ShenandoahBarrierSetC2::is_shenandoah_wb_pre_call(Node* call) { call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry); } +bool ShenandoahBarrierSetC2::is_shenandoah_clone_call(Node* call) { + return call->is_CallLeaf() && + call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::shenandoah_clone_barrier); +} + bool ShenandoahBarrierSetC2::is_shenandoah_lrb_call(Node* call) { if (!call->is_CallLeaf()) { return false; @@ -281,7 +286,8 @@ bool ShenandoahBarrierSetC2::is_shenandoah_lrb_call(Node* call) { (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong_narrow)) || (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)) || (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow)) || - (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom)); + (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom)) || + (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom_narrow)); } bool ShenandoahBarrierSetC2::is_shenandoah_marking_if(PhaseValues* phase, Node* n) { @@ -674,20 +680,10 @@ bool ShenandoahBarrierSetC2::is_gc_pre_barrier_node(Node* node) const { return is_shenandoah_wb_pre_call(node); } -// Support for GC barriers emitted during parsing bool ShenandoahBarrierSetC2::is_gc_barrier_node(Node* node) const { - if (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) return true; - if (node->Opcode() != Op_CallLeaf && node->Opcode() != Op_CallLeafNoFP) { - return false; - } - CallLeafNode *call = node->as_CallLeaf(); - if (call->_name == nullptr) { - return false; - } - - return strcmp(call->_name, "shenandoah_clone_barrier") == 0 || - strcmp(call->_name, "shenandoah_cas_obj") == 0 || - strcmp(call->_name, "shenandoah_wb_pre") == 0; + return is_shenandoah_lrb_call(node) || + is_shenandoah_wb_pre_call(node) || + is_shenandoah_clone_call(node); } Node* ShenandoahBarrierSetC2::step_over_gc_barrier(Node* c) const { diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp index 4619b217e96c6..cbfacea31ab7a 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp @@ -85,6 +85,7 @@ class ShenandoahBarrierSetC2 : public BarrierSetC2 { static ShenandoahBarrierSetC2* bsc2(); static bool is_shenandoah_wb_pre_call(Node* call); + static bool is_shenandoah_clone_call(Node* call); static bool is_shenandoah_lrb_call(Node* call); static bool is_shenandoah_marking_if(PhaseValues* phase, Node* n); static bool is_shenandoah_state_load(Node* n); diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 0a51f74299545..7526f895f2f7f 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -414,7 +414,7 @@ void ShenandoahBarrierC2Support::verify(RootNode* root) { "cipherBlockChaining_decryptAESCrypt", { { TypeFunc::Parms, ShenandoahLoad }, { TypeFunc::Parms+1, ShenandoahStore }, { TypeFunc::Parms+2, ShenandoahLoad }, { TypeFunc::Parms+3, ShenandoahLoad }, { -1, ShenandoahNone}, { -1, ShenandoahNone} }, - "shenandoah_clone_barrier", + "shenandoah_clone", { { TypeFunc::Parms, ShenandoahLoad }, { -1, ShenandoahNone}, { -1, ShenandoahNone}, { -1, ShenandoahNone}, { -1, ShenandoahNone}, { -1, ShenandoahNone} }, "ghash_processBlocks", diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp index 25062c5317dcb..70401b4246189 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2016, 2023, Red Hat, Inc. All rights reserved. + * Copyright (c) 2024, 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,7 +58,7 @@ ShenandoahCollectionSet::ShenandoahCollectionSet(ShenandoahHeap* heap, ReservedS // subsystem for mapping not-yet-written-to pages to a single physical backing page, // but this is not guaranteed, and would confuse NMT and other memory accounting tools. - MemTracker::record_virtual_memory_type(_map_space.base(), mtGC); + MemTracker::record_virtual_memory_tag(_map_space.base(), mtGC); size_t page_size = os::vm_page_size(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp index 6ed75a9d96106..75cdb99e177d1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp @@ -225,8 +225,7 @@ void ShenandoahConcurrentMark::finish_mark() { assert(Thread::current()->is_VM_thread(), "Must by VM Thread"); finish_mark_work(); assert(task_queues()->is_empty(), "Should be empty"); - TASKQUEUE_STATS_ONLY(task_queues()->print_taskqueue_stats()); - TASKQUEUE_STATS_ONLY(task_queues()->reset_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(task_queues()->print_and_reset_taskqueue_stats("")); ShenandoahHeap* const heap = ShenandoahHeap::heap(); heap->set_concurrent_mark_in_progress(false); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp index 95a70de5790e9..8a4ef63b8e38b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp @@ -371,6 +371,16 @@ void ShenandoahControlThread::request_gc(GCCause::Cause cause) { } void ShenandoahControlThread::handle_requested_gc(GCCause::Cause cause) { + // For normal requested GCs (System.gc) we want to block the caller. However, + // for whitebox requested GC, we want to initiate the GC and return immediately. + // The whitebox caller thread will arrange for itself to wait until the GC notifies + // it that has reached the requested breakpoint (phase in the GC). + if (cause == GCCause::_wb_breakpoint) { + _requested_gc_cause = cause; + _gc_requested.set(); + return; + } + // Make sure we have at least one complete GC cycle before unblocking // from the explicit GC request. // @@ -390,9 +400,7 @@ void ShenandoahControlThread::handle_requested_gc(GCCause::Cause cause) { _requested_gc_cause = cause; _gc_requested.set(); - if (cause != GCCause::_wb_breakpoint) { - ml.wait(); - } + ml.wait(); current_gc_id = get_gc_id(); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp index 3dfc6a7966562..03e19a3af5e30 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp @@ -1009,7 +1009,9 @@ void ShenandoahFreeSet::find_regions_with_alloc_capacity(size_t &cset_regions) { } } } - _partitions.establish_mutator_intervals(mutator_leftmost, mutator_rightmost, mutator_leftmost_empty, mutator_rightmost_empty, + idx_t rightmost_idx = (mutator_leftmost == max_regions)? -1: (idx_t) mutator_rightmost; + idx_t rightmost_empty_idx = (mutator_leftmost_empty == max_regions)? -1: (idx_t) mutator_rightmost_empty; + _partitions.establish_mutator_intervals(mutator_leftmost, rightmost_idx, mutator_leftmost_empty, rightmost_empty_idx, mutator_regions, mutator_used); } @@ -1134,7 +1136,7 @@ void ShenandoahFreeSet::reserve_regions(size_t to_reserve) { } if (LogTarget(Info, gc, free)::is_enabled()) { - size_t reserve = _partitions.capacity_of(ShenandoahFreeSetPartitionId::Collector); + size_t reserve = _partitions.available_in(ShenandoahFreeSetPartitionId::Collector); if (reserve < to_reserve) { log_debug(gc)("Wanted " PROPERFMT " for young reserve, but only reserved: " PROPERFMT, PROPERFMTARGS(to_reserve), PROPERFMTARGS(reserve)); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index a587cc417e319..4ab17aabcc5ea 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -252,7 +252,7 @@ jint ShenandoahHeap::initialize() { bitmap_size_orig, bitmap_page_size, bitmap.base(), bitmap.size(), bitmap.page_size()); - MemTracker::record_virtual_memory_type(bitmap.base(), mtGC); + MemTracker::record_virtual_memory_tag(bitmap.base(), mtGC); _bitmap_region = MemRegion((HeapWord*) bitmap.base(), bitmap.size() / HeapWordSize); _bitmap_region_special = bitmap.special(); @@ -276,7 +276,7 @@ jint ShenandoahHeap::initialize() { os::commit_memory_or_exit(verify_bitmap.base(), verify_bitmap.size(), bitmap_page_size, false, "Cannot commit verification bitmap memory"); } - MemTracker::record_virtual_memory_type(verify_bitmap.base(), mtGC); + MemTracker::record_virtual_memory_tag(verify_bitmap.base(), mtGC); MemRegion verify_bitmap_region = MemRegion((HeapWord *) verify_bitmap.base(), verify_bitmap.size() / HeapWordSize); _verification_bit_map.initialize(_heap_region, verify_bitmap_region); _verifier = new ShenandoahVerifier(this, &_verification_bit_map); @@ -290,7 +290,7 @@ jint ShenandoahHeap::initialize() { bitmap_size_orig, aux_bitmap_page_size, aux_bitmap.base(), aux_bitmap.size(), aux_bitmap.page_size()); - MemTracker::record_virtual_memory_type(aux_bitmap.base(), mtGC); + MemTracker::record_virtual_memory_tag(aux_bitmap.base(), mtGC); _aux_bitmap_region = MemRegion((HeapWord*) aux_bitmap.base(), aux_bitmap.size() / HeapWordSize); _aux_bitmap_region_special = aux_bitmap.special(); _aux_bit_map.initialize(_heap_region, _aux_bitmap_region); @@ -308,7 +308,7 @@ jint ShenandoahHeap::initialize() { region_storage_size_orig, region_page_size, region_storage.base(), region_storage.size(), region_storage.page_size()); - MemTracker::record_virtual_memory_type(region_storage.base(), mtGC); + MemTracker::record_virtual_memory_tag(region_storage.base(), mtGC); if (!region_storage.special()) { os::commit_memory_or_exit(region_storage.base(), region_storage_size, region_page_size, false, "Cannot commit region memory"); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp index 05cd8ef66b9d1..9a30b1fed8724 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp @@ -133,8 +133,7 @@ void ShenandoahSTWMark::mark() { ShenandoahCodeRoots::disarm_nmethods(); assert(task_queues()->is_empty(), "Should be empty"); - TASKQUEUE_STATS_ONLY(task_queues()->print_taskqueue_stats()); - TASKQUEUE_STATS_ONLY(task_queues()->reset_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(task_queues()->print_and_reset_taskqueue_stats("")); } void ShenandoahSTWMark::mark_roots(uint worker_id) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp index 3cddc0c6c0a83..eb185c197bd5d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp @@ -51,45 +51,6 @@ bool ShenandoahObjToScanQueueSet::is_empty() { return true; } -#if TASKQUEUE_STATS -void ShenandoahObjToScanQueueSet::print_taskqueue_stats_hdr(outputStream* const st) { - st->print_raw_cr("GC Task Stats"); - st->print_raw("thr "); TaskQueueStats::print_header(1, st); st->cr(); - st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); -} - -void ShenandoahObjToScanQueueSet::print_taskqueue_stats() const { - if (!log_develop_is_enabled(Trace, gc, task, stats)) { - return; - } - Log(gc, task, stats) log; - ResourceMark rm; - LogStream ls(log.trace()); - outputStream* st = &ls; - print_taskqueue_stats_hdr(st); - - ShenandoahObjToScanQueueSet* queues = const_cast(this); - TaskQueueStats totals; - const uint n = size(); - for (uint i = 0; i < n; ++i) { - st->print(UINT32_FORMAT_W(3), i); - queues->queue(i)->stats.print(st); - st->cr(); - totals += queues->queue(i)->stats; - } - st->print("tot "); totals.print(st); st->cr(); - DEBUG_ONLY(totals.verify()); - -} - -void ShenandoahObjToScanQueueSet::reset_taskqueue_stats() { - const uint n = size(); - for (uint i = 0; i < n; ++i) { - queue(i)->stats.reset(); - } -} -#endif // TASKQUEUE_STATS - bool ShenandoahTerminatorTerminator::should_exit_termination() { return _heap->cancelled_gc(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp index 50f18a8c73f92..10887ad8c19d6 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2016, 2024, Red Hat, Inc. All rights reserved. + * Copyright (c) 2024, 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 @@ -28,7 +29,7 @@ #include "gc/shared/taskTerminator.hpp" #include "gc/shared/taskqueue.hpp" #include "gc/shenandoah/shenandoahPadding.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "runtime/atomic.hpp" #include "runtime/javaThread.hpp" #include "runtime/mutex.hpp" @@ -36,11 +37,11 @@ class ShenandoahHeap; -template -class BufferedOverflowTaskQueue: public OverflowTaskQueue +template +class BufferedOverflowTaskQueue: public OverflowTaskQueue { public: - typedef OverflowTaskQueue taskqueue_t; + typedef OverflowTaskQueue taskqueue_t; BufferedOverflowTaskQueue() : _buf_empty(true) {}; @@ -301,8 +302,8 @@ class ShenandoahMarkTask typedef BufferedOverflowTaskQueue ShenandoahBufferedOverflowTaskQueue; typedef Padded ShenandoahObjToScanQueue; -template -class ParallelClaimableQueueSet: public GenericTaskQueueSet { +template +class ParallelClaimableQueueSet: public GenericTaskQueueSet { private: shenandoah_padding(0); volatile jint _claimed_index; @@ -311,10 +312,10 @@ class ParallelClaimableQueueSet: public GenericTaskQueueSet { debug_only(uint _reserved; ) public: - using GenericTaskQueueSet::size; + using GenericTaskQueueSet::size; public: - ParallelClaimableQueueSet(int n) : GenericTaskQueueSet(n), _claimed_index(0) { + ParallelClaimableQueueSet(int n) : GenericTaskQueueSet(n), _claimed_index(0) { debug_only(_reserved = 0; ) } @@ -331,9 +332,9 @@ class ParallelClaimableQueueSet: public GenericTaskQueueSet { debug_only(uint get_reserved() const { return (uint)_reserved; }) }; -template -T* ParallelClaimableQueueSet::claim_next() { - jint size = (jint)GenericTaskQueueSet::size(); +template +T* ParallelClaimableQueueSet::claim_next() { + jint size = (jint)GenericTaskQueueSet::size(); if (_claimed_index >= size) { return nullptr; @@ -342,7 +343,7 @@ T* ParallelClaimableQueueSet::claim_next() { jint index = Atomic::add(&_claimed_index, 1, memory_order_relaxed); if (index <= size) { - return GenericTaskQueueSet::queue((uint)index - 1); + return GenericTaskQueueSet::queue((uint)index - 1); } else { return nullptr; } @@ -354,12 +355,6 @@ class ShenandoahObjToScanQueueSet: public ParallelClaimableQueueSet -bool BufferedOverflowTaskQueue::pop(E &t) { +template +bool BufferedOverflowTaskQueue::pop(E &t) { if (!_buf_empty) { t = _elem; _buf_empty = true; @@ -45,8 +46,8 @@ bool BufferedOverflowTaskQueue::pop(E &t) { return taskqueue_t::pop_overflow(t); } -template -inline bool BufferedOverflowTaskQueue::push(E t) { +template +inline bool BufferedOverflowTaskQueue::push(E t) { if (_buf_empty) { _elem = t; _buf_empty = false; @@ -58,8 +59,8 @@ inline bool BufferedOverflowTaskQueue::push(E t) { return true; } -template -void BufferedOverflowTaskQueue::clear() { +template +void BufferedOverflowTaskQueue::clear() { _buf_empty = true; taskqueue_t::set_empty(); taskqueue_t::overflow_stack()->clear(); diff --git a/src/hotspot/share/gc/x/c1/xBarrierSetC1.cpp b/src/hotspot/share/gc/x/c1/xBarrierSetC1.cpp index caf7eb2e514e9..6f64392cefced 100644 --- a/src/hotspot/share/gc/x/c1/xBarrierSetC1.cpp +++ b/src/hotspot/share/gc/x/c1/xBarrierSetC1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -225,7 +225,7 @@ class XLoadBarrierRuntimeStubCodeGenClosure : public StubAssemblerCodeGenClosure static address generate_c1_runtime_stub(BufferBlob* blob, DecoratorSet decorators, const char* name) { XLoadBarrierRuntimeStubCodeGenClosure cl(decorators); - CodeBlob* const code_blob = Runtime1::generate_blob(blob, -1 /* stub_id */, name, false /* expect_oop_map*/, &cl); + CodeBlob* const code_blob = Runtime1::generate_blob(blob, C1StubId::NO_STUBID /* stub_id */, name, false /* expect_oop_map*/, &cl); return code_blob->code_begin(); } diff --git a/src/hotspot/share/gc/x/xVirtualMemory.cpp b/src/hotspot/share/gc/x/xVirtualMemory.cpp index 1d66cdd069ef7..63cb789d8de12 100644 --- a/src/hotspot/share/gc/x/xVirtualMemory.cpp +++ b/src/hotspot/share/gc/x/xVirtualMemory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -182,7 +182,7 @@ bool XVirtualMemoryManager::reserve(size_t max_capacity) { void XVirtualMemoryManager::nmt_reserve(uintptr_t start, size_t size) { MemTracker::record_virtual_memory_reserve((void*)start, size, CALLER_PC); - MemTracker::record_virtual_memory_type((void*)start, mtJavaHeap); + MemTracker::record_virtual_memory_tag((void*)start, mtJavaHeap); } bool XVirtualMemoryManager::is_initialized() const { diff --git a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp index 68e215e9ebca0..9c16714b26e3f 100644 --- a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp +++ b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -507,7 +507,7 @@ class ZLoadBarrierRuntimeStubCodeGenClosure : public StubAssemblerCodeGenClosure static address generate_c1_load_runtime_stub(BufferBlob* blob, DecoratorSet decorators, const char* name) { ZLoadBarrierRuntimeStubCodeGenClosure cl(decorators); - CodeBlob* const code_blob = Runtime1::generate_blob(blob, -1 /* stub_id */, name, false /* expect_oop_map*/, &cl); + CodeBlob* const code_blob = Runtime1::generate_blob(blob, C1StubId::NO_STUBID /* stub_id */, name, false /* expect_oop_map*/, &cl); return code_blob->code_begin(); } @@ -527,7 +527,7 @@ class ZStoreBarrierRuntimeStubCodeGenClosure : public StubAssemblerCodeGenClosur static address generate_c1_store_runtime_stub(BufferBlob* blob, bool self_healing, const char* name) { ZStoreBarrierRuntimeStubCodeGenClosure cl(self_healing); - CodeBlob* const code_blob = Runtime1::generate_blob(blob, -1 /* stub_id */, name, false /* expect_oop_map*/, &cl); + CodeBlob* const code_blob = Runtime1::generate_blob(blob, C1StubId::NO_STUBID /* stub_id */, name, false /* expect_oop_map*/, &cl); return code_blob->code_begin(); } diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp index f72e84eaf5935..a46681d131c94 100644 --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp @@ -46,7 +46,7 @@ #include "utilities/growableArray.hpp" #include "utilities/macros.hpp" -template +template class ZArenaHashtable : public ResourceObj { class ZArenaHashtableEntry : public ResourceObj { public: @@ -55,10 +55,10 @@ class ZArenaHashtable : public ResourceObj { V _value; }; - static const size_t _table_mask = _table_size - 1; + static const size_t TableMask = TableSize - 1; Arena* _arena; - ZArenaHashtableEntry* _table[_table_size]; + ZArenaHashtableEntry* _table[TableSize]; public: class Iterator { @@ -84,7 +84,7 @@ class ZArenaHashtable : public ResourceObj { if (_current_entry != nullptr) { _current_entry = _current_entry->_next; } - while (_current_entry == nullptr && ++_current_index < _table_size) { + while (_current_entry == nullptr && ++_current_index < TableSize) { _current_entry = _table->_table[_current_index]; } } @@ -100,12 +100,12 @@ class ZArenaHashtable : public ResourceObj { ZArenaHashtableEntry* entry = new (_arena) ZArenaHashtableEntry(); entry->_key = key; entry->_value = value; - entry->_next = _table[key & _table_mask]; - _table[key & _table_mask] = entry; + entry->_next = _table[key & TableMask]; + _table[key & TableMask] = entry; } V* get(K key) const { - for (ZArenaHashtableEntry* e = _table[key & _table_mask]; e != nullptr; e = e->_next) { + for (ZArenaHashtableEntry* e = _table[key & TableMask]; e != nullptr; e = e->_next) { if (e->_key == key) { return &(e->_value); } diff --git a/src/hotspot/share/gc/z/zBarrierSet.hpp b/src/hotspot/share/gc/z/zBarrierSet.hpp index bf233df683afb..9c20211e2285d 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.hpp @@ -155,7 +155,7 @@ class ZBarrierSet : public BarrierSet { }; template<> struct BarrierSet::GetName { - static const BarrierSet::Name value = BarrierSet::ZBarrierSet; + static const BarrierSet::Name Value = BarrierSet::ZBarrierSet; }; template<> struct BarrierSet::GetType { diff --git a/src/hotspot/share/gc/z/zDirector.cpp b/src/hotspot/share/gc/z/zDirector.cpp index 3ba8698bd8e22..481525c425af0 100644 --- a/src/hotspot/share/gc/z/zDirector.cpp +++ b/src/hotspot/share/gc/z/zDirector.cpp @@ -488,7 +488,8 @@ static bool rule_major_allocation_rate(const ZDirectorStats& stats) { // Calculate the GC cost for each reclaimed byte const double current_young_gc_time_per_bytes_freed = double(young_gc_time) / double(reclaimed_per_young_gc); - const double current_old_gc_time_per_bytes_freed = double(old_gc_time) / double(reclaimed_per_old_gc); + const double current_old_gc_time_per_bytes_freed = reclaimed_per_old_gc == 0 ? std::numeric_limits::infinity() + : (double(old_gc_time) / double(reclaimed_per_old_gc)); // Calculate extra time per young collection inflicted by *not* doing an // old collection that frees up memory in the old generation. @@ -838,7 +839,7 @@ void ZDirector::evaluate_rules() { } bool ZDirector::wait_for_tick() { - const uint64_t interval_ms = MILLIUNITS / decision_hz; + const uint64_t interval_ms = MILLIUNITS / DecisionHz; ZLocker locker(&_monitor); diff --git a/src/hotspot/share/gc/z/zDirector.hpp b/src/hotspot/share/gc/z/zDirector.hpp index 73c556a2fbd46..929ec6c2c566b 100644 --- a/src/hotspot/share/gc/z/zDirector.hpp +++ b/src/hotspot/share/gc/z/zDirector.hpp @@ -29,7 +29,7 @@ class ZDirector : public ZThread { private: - static const uint64_t decision_hz = 100; + static const uint64_t DecisionHz = 100; static ZDirector* _director; ZConditionLock _monitor; diff --git a/src/hotspot/share/gc/z/zForwarding.cpp b/src/hotspot/share/gc/z/zForwarding.cpp index d8a3913806ca8..4df6e9a2d81f5 100644 --- a/src/hotspot/share/gc/z/zForwarding.cpp +++ b/src/hotspot/share/gc/z/zForwarding.cpp @@ -73,7 +73,7 @@ void ZForwarding::in_place_relocation_finish() { if (_from_age == ZPageAge::old || _to_age != ZPageAge::old) { // Only do this for non-promoted pages, that still need to reset live map. // Done with iterating over the "from-page" view, so can now drop the _livemap. - _page->finalize_reset_for_in_place_relocation(); + _page->reset_livemap(); } // Disable relaxed ZHeap::is_in checks diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index 21ff703796219..dc5f1e3d21d57 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -248,8 +248,7 @@ void ZHeap::free_page(ZPage* page) { _page_table.remove(page); if (page->is_old()) { - page->verify_remset_cleared_current(); - page->verify_remset_cleared_previous(); + page->remset_delete(); } // Free page @@ -261,12 +260,10 @@ size_t ZHeap::free_empty_pages(const ZArray* pages) { // Remove page table entries ZArrayIterator iter(pages); for (ZPage* page; iter.next(&page);) { + _page_table.remove(page); if (page->is_old()) { - // The remset of pages should be clean when installed into the page - // cache. - page->remset_clear(); + page->remset_delete(); } - _page_table.remove(page); freed += page->size(); } diff --git a/src/hotspot/share/gc/z/zLiveMap.cpp b/src/hotspot/share/gc/z/zLiveMap.cpp index 4123620f8b7e0..715ebc6291724 100644 --- a/src/hotspot/share/gc/z/zLiveMap.cpp +++ b/src/hotspot/share/gc/z/zLiveMap.cpp @@ -35,9 +35,9 @@ static const ZStatCounter ZCounterMarkSeqNumResetContention("Contention", "Mark SeqNum Reset Contention", ZStatUnitOpsPerSecond); static const ZStatCounter ZCounterMarkSegmentResetContention("Contention", "Mark Segment Reset Contention", ZStatUnitOpsPerSecond); -static size_t bitmap_size(uint32_t size, size_t nsegments) { +static size_t bitmap_size(uint32_t size, size_t NumSegments) { // We need at least one bit per segment - return MAX2(size, nsegments) * 2; + return MAX2(size, NumSegments) * 2; } ZLiveMap::ZLiveMap(uint32_t size) @@ -46,7 +46,7 @@ ZLiveMap::ZLiveMap(uint32_t size) _live_bytes(0), _segment_live_bits(0), _segment_claim_bits(0), - _bitmap(bitmap_size(size, nsegments)), + _bitmap(bitmap_size(size, NumSegments)), _segment_shift(log2i_exact(segment_size())) {} void ZLiveMap::reset(ZGenerationId id) { @@ -127,7 +127,7 @@ void ZLiveMap::reset_segment(BitMap::idx_t segment) { } void ZLiveMap::resize(uint32_t size) { - const size_t new_bitmap_size = bitmap_size(size, nsegments); + const size_t new_bitmap_size = bitmap_size(size, NumSegments); if (_bitmap.size() != new_bitmap_size) { _bitmap.reinitialize(new_bitmap_size, false /* clear */); _segment_shift = log2i_exact(segment_size()); diff --git a/src/hotspot/share/gc/z/zLiveMap.hpp b/src/hotspot/share/gc/z/zLiveMap.hpp index f8b16d06dc52c..7c18e1db06096 100644 --- a/src/hotspot/share/gc/z/zLiveMap.hpp +++ b/src/hotspot/share/gc/z/zLiveMap.hpp @@ -35,7 +35,7 @@ class ZLiveMap { friend class ZLiveMapTest; private: - static const size_t nsegments = 64; + static const size_t NumSegments = 64; volatile uint32_t _seqnum; volatile uint32_t _live_objects; diff --git a/src/hotspot/share/gc/z/zLiveMap.inline.hpp b/src/hotspot/share/gc/z/zLiveMap.inline.hpp index 28390b72a89ca..a9382522480c0 100644 --- a/src/hotspot/share/gc/z/zLiveMap.inline.hpp +++ b/src/hotspot/share/gc/z/zLiveMap.inline.hpp @@ -52,19 +52,19 @@ inline size_t ZLiveMap::live_bytes() const { } inline const BitMapView ZLiveMap::segment_live_bits() const { - return BitMapView(const_cast(&_segment_live_bits), nsegments); + return BitMapView(const_cast(&_segment_live_bits), NumSegments); } inline const BitMapView ZLiveMap::segment_claim_bits() const { - return BitMapView(const_cast(&_segment_claim_bits), nsegments); + return BitMapView(const_cast(&_segment_claim_bits), NumSegments); } inline BitMapView ZLiveMap::segment_live_bits() { - return BitMapView(&_segment_live_bits, nsegments); + return BitMapView(&_segment_live_bits, NumSegments); } inline BitMapView ZLiveMap::segment_claim_bits() { - return BitMapView(&_segment_claim_bits, nsegments); + return BitMapView(&_segment_claim_bits, NumSegments); } inline bool ZLiveMap::is_segment_live(BitMap::idx_t segment) const { @@ -80,15 +80,15 @@ inline bool ZLiveMap::claim_segment(BitMap::idx_t segment) { } inline BitMap::idx_t ZLiveMap::first_live_segment() const { - return segment_live_bits().find_first_set_bit(0, nsegments); + return segment_live_bits().find_first_set_bit(0, NumSegments); } inline BitMap::idx_t ZLiveMap::next_live_segment(BitMap::idx_t segment) const { - return segment_live_bits().find_first_set_bit(segment + 1, nsegments); + return segment_live_bits().find_first_set_bit(segment + 1, NumSegments); } inline BitMap::idx_t ZLiveMap::segment_size() const { - return _bitmap.size() / nsegments; + return _bitmap.size() / NumSegments; } inline BitMap::idx_t ZLiveMap::index_to_segment(BitMap::idx_t index) const { @@ -167,7 +167,7 @@ inline void ZLiveMap::iterate(ZGenerationId id, Function function) { return true; }; - for (BitMap::idx_t segment = first_live_segment(); segment < nsegments; segment = next_live_segment(segment)) { + for (BitMap::idx_t segment = first_live_segment(); segment < NumSegments; segment = next_live_segment(segment)) { // For each live segment iterate_segment(segment, live_only); } diff --git a/src/hotspot/share/gc/z/zNMT.cpp b/src/hotspot/share/gc/z/zNMT.cpp index 41d99b102bf08..b23452eb15647 100644 --- a/src/hotspot/share/gc/z/zNMT.cpp +++ b/src/hotspot/share/gc/z/zNMT.cpp @@ -26,7 +26,7 @@ #include "gc/z/zGlobals.hpp" #include "gc/z/zNMT.hpp" #include "gc/z/zVirtualMemory.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/memTracker.hpp" #include "nmt/memoryFileTracker.hpp" #include "utilities/nativeCallStack.hpp" diff --git a/src/hotspot/share/gc/z/zPage.cpp b/src/hotspot/share/gc/z/zPage.cpp index bfeda56de37dd..ff56768e9ad99 100644 --- a/src/hotspot/share/gc/z/zPage.cpp +++ b/src/hotspot/share/gc/z/zPage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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,14 +57,9 @@ ZPage::ZPage(ZPageType type, const ZVirtualMemory& vmem, const ZPhysicalMemory& } ZPage* ZPage::clone_limited() const { - // Only copy type and memory layouts. Let the rest be lazily reconstructed when needed. - return new ZPage(_type, _virtual, _physical); -} - -ZPage* ZPage::clone_limited_promote_flipped() const { + // Only copy type and memory layouts, and also update _top. Let the rest be + // lazily reconstructed when needed. ZPage* const page = new ZPage(_type, _virtual, _physical); - - // The page is still filled with the same objects, need to retain the top pointer. page->_top = _top; return page; @@ -83,58 +78,19 @@ void ZPage::reset_seqnum() { Atomic::store(&_seqnum_other, ZGeneration::generation(_generation_id == ZGenerationId::young ? ZGenerationId::old : ZGenerationId::young)->seqnum()); } -void ZPage::remset_clear() { - _remembered_set.clear_all(); -} - -void ZPage::verify_remset_after_reset(ZPageAge prev_age, ZPageResetType type) { - // Young-to-old reset - if (prev_age != ZPageAge::old) { - verify_remset_cleared_previous(); - verify_remset_cleared_current(); - return; - } +void ZPage::remset_alloc() { + // Remsets should only be allocated/initialized once and only for old pages. + assert(!_remembered_set.is_initialized(), "Should not be initialized"); + assert(is_old(), "Only old pages need a remset"); - // Old-to-old reset - switch (type) { - case ZPageResetType::InPlaceRelocation: - // Relocation failed and page is being compacted in-place. - // The remset bits are flipped each young mark start, so - // the verification code below needs to use the right remset. - if (ZGeneration::old()->active_remset_is_current()) { - verify_remset_cleared_previous(); - } else { - verify_remset_cleared_current(); - } - break; - - case ZPageResetType::FlipAging: - fatal("Should not have called this for old-to-old flipping"); - break; - - case ZPageResetType::Allocation: - verify_remset_cleared_previous(); - verify_remset_cleared_current(); - break; - }; + _remembered_set.initialize(size()); } -void ZPage::reset_remembered_set() { - if (is_young()) { - // Remset not needed - return; - } - - // Clearing of remsets is done when freeing a page, so this code only - // needs to ensure the remset is initialized the first time a page - // becomes old. - if (!_remembered_set.is_initialized()) { - _remembered_set.initialize(size()); - } +void ZPage::remset_delete() { + _remembered_set.delete_all(); } -void ZPage::reset(ZPageAge age, ZPageResetType type) { - const ZPageAge prev_age = _age; +void ZPage::reset(ZPageAge age) { _age = age; _last_used = 0; @@ -143,31 +99,19 @@ void ZPage::reset(ZPageAge age, ZPageResetType type) { : ZGenerationId::young; reset_seqnum(); - - // Flip aged pages are still filled with the same objects, need to retain the top pointer. - if (type != ZPageResetType::FlipAging) { - _top = to_zoffset_end(start()); - } - - reset_remembered_set(); - verify_remset_after_reset(prev_age, type); - - if (type != ZPageResetType::InPlaceRelocation || (prev_age != ZPageAge::old && age == ZPageAge::old)) { - // Promoted in-place relocations reset the live map, - // because they clone the page. - _livemap.reset(); - } } -void ZPage::finalize_reset_for_in_place_relocation() { - // Now we're done iterating over the livemaps +void ZPage::reset_livemap() { _livemap.reset(); } +void ZPage::reset_top_for_allocation() { + _top = to_zoffset_end(start()); +} + void ZPage::reset_type_and_size(ZPageType type) { _type = type; _livemap.resize(object_max_count()); - _remembered_set.resize(size()); } ZPage* ZPage::retype(ZPageType type) { @@ -260,12 +204,8 @@ void ZPage::verify_remset_cleared_previous() const { } } -void ZPage::clear_remset_current() { - _remembered_set.clear_current(); -} - void ZPage::clear_remset_previous() { - _remembered_set.clear_previous(); + _remembered_set.clear_previous(); } void ZPage::swap_remset_bitmaps() { diff --git a/src/hotspot/share/gc/z/zPage.hpp b/src/hotspot/share/gc/z/zPage.hpp index 3c9b3deda9f07..9b6c155f77d9f 100644 --- a/src/hotspot/share/gc/z/zPage.hpp +++ b/src/hotspot/share/gc/z/zPage.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -36,16 +36,6 @@ class ZGeneration; -enum class ZPageResetType { - // Normal allocation path - Allocation, - // Relocation failed and started to relocate in-place - InPlaceRelocation, - // Page was not selected for relocation, all objects - // stayed, but the page aged. - FlipAging, -}; - class ZPage : public CHeapObj { friend class VMStructs; friend class ZList; @@ -80,17 +70,13 @@ class ZPage : public CHeapObj { const ZGeneration* generation() const; void reset_seqnum(); - void reset_remembered_set(); ZPage* split_with_pmem(ZPageType type, const ZPhysicalMemory& pmem); - void verify_remset_after_reset(ZPageAge prev_age, ZPageResetType type); - public: ZPage(ZPageType type, const ZVirtualMemory& vmem, const ZPhysicalMemory& pmem); ZPage* clone_limited() const; - ZPage* clone_limited_promote_flipped() const; uint32_t object_max_count() const; size_t object_alignment_shift() const; @@ -126,10 +112,9 @@ class ZPage : public CHeapObj { uint64_t last_used() const; void set_last_used(); - void reset(ZPageAge age, ZPageResetType type); - - void finalize_reset_for_in_place_relocation(); - + void reset(ZPageAge age); + void reset_livemap(); + void reset_top_for_allocation(); void reset_type_and_size(ZPageType type); ZPage* retype(ZPageType type); @@ -170,7 +155,8 @@ class ZPage : public CHeapObj { void clear_remset_range_non_par_current(uintptr_t l_offset, size_t size); void swap_remset_bitmaps(); - void remset_clear(); + void remset_alloc(); + void remset_delete(); ZBitMap::ReverseIterator remset_reverse_iterator_previous(); BitMap::Iterator remset_iterator_limited_current(uintptr_t l_offset, size_t size); @@ -195,7 +181,6 @@ class ZPage : public CHeapObj { void verify_remset_cleared_current() const; void verify_remset_cleared_previous() const; - void clear_remset_current(); void clear_remset_previous(); void* remset_current(); diff --git a/src/hotspot/share/gc/z/zPageAllocator.cpp b/src/hotspot/share/gc/z/zPageAllocator.cpp index b1fb1e4837391..01200f76b519e 100644 --- a/src/hotspot/share/gc/z/zPageAllocator.cpp +++ b/src/hotspot/share/gc/z/zPageAllocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -729,7 +729,12 @@ ZPage* ZPageAllocator::alloc_page(ZPageType type, size_t size, ZAllocationFlags // Reset page. This updates the page's sequence number and must // be done after we potentially blocked in a safepoint (stalled) // where the global sequence number was updated. - page->reset(age, ZPageResetType::Allocation); + page->reset(age); + page->reset_top_for_allocation(); + page->reset_livemap(); + if (age == ZPageAge::old) { + page->remset_alloc(); + } // Update allocation statistics. Exclude gc relocations to avoid // artificial inflation of the allocation rate during relocation. diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.hpp b/src/hotspot/share/gc/z/zReferenceProcessor.hpp index f8e924ed99fc1..31c789ee859e5 100644 --- a/src/hotspot/share/gc/z/zReferenceProcessor.hpp +++ b/src/hotspot/share/gc/z/zReferenceProcessor.hpp @@ -36,8 +36,8 @@ class ZReferenceProcessor : public ReferenceDiscoverer { friend class ZReferenceProcessorTask; private: - static const size_t reference_type_count = REF_PHANTOM + 1; - typedef size_t Counters[reference_type_count]; + static const size_t ReferenceTypeCount = REF_PHANTOM + 1; + typedef size_t Counters[ReferenceTypeCount]; ZWorkers* const _workers; ReferencePolicy* _soft_reference_policy; diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp index b55a1863bdee3..33304bcefd37f 100644 --- a/src/hotspot/share/gc/z/zRelocate.cpp +++ b/src/hotspot/share/gc/z/zRelocate.cpp @@ -843,7 +843,23 @@ class ZRelocateWork : public StackObj { // Promotions happen through a new cloned page ZPage* const to_page = promotion ? from_page->clone_limited() : from_page; - to_page->reset(to_age, ZPageResetType::InPlaceRelocation); + + // Reset page for in-place relocation + to_page->reset(to_age); + to_page->reset_top_for_allocation(); + if (promotion) { + to_page->remset_alloc(); + } + + // Verify that the inactive remset is clear when resetting the page for + // in-place relocation. + if (from_page->age() == ZPageAge::old) { + if (ZGeneration::old()->active_remset_is_current()) { + to_page->verify_remset_cleared_previous(); + } else { + to_page->verify_remset_cleared_current(); + } + } // Clear remset bits for all objects that were relocated // before this page became an in-place relocated page. @@ -927,35 +943,15 @@ class ZRelocateWork : public StackObj { return ZGeneration::old()->active_remset_is_current(); } - void clear_remset_before_reuse(ZPage* page, bool in_place) { + void clear_remset_before_in_place_reuse(ZPage* page) { if (_forwarding->from_age() != ZPageAge::old) { // No remset bits return; } - if (in_place) { - // Clear 'previous' remset bits. For in-place relocated pages, the previous - // remset bits are always used, even when active_remset_is_current(). - page->clear_remset_previous(); - - return; - } - - // Normal relocate - - // Clear active remset bits - if (active_remset_is_current()) { - page->clear_remset_current(); - } else { - page->clear_remset_previous(); - } - - // Verify that inactive remset bits are all cleared - if (active_remset_is_current()) { - page->verify_remset_cleared_previous(); - } else { - page->verify_remset_cleared_current(); - } + // Clear 'previous' remset bits. For in-place relocated pages, the previous + // remset bits are always used, even when active_remset_is_current(). + page->clear_remset_previous(); } void finish_in_place_relocation() { @@ -1001,7 +997,7 @@ class ZRelocateWork : public StackObj { ZPage* const page = _forwarding->detach_page(); // Ensure that previous remset bits are cleared - clear_remset_before_reuse(page, true /* in_place */); + clear_remset_before_in_place_reuse(page); page->log_msg(" (relocate page done in-place)"); @@ -1013,11 +1009,6 @@ class ZRelocateWork : public StackObj { // Wait for all other threads to call release_page ZPage* const page = _forwarding->detach_page(); - // Ensure that all remset bits are cleared - // Note: cleared after detach_page, when we know that - // the young generation isn't scanning the remset. - clear_remset_before_reuse(page, false /* in_place */); - page->log_msg(" (relocate page done normal)"); // Free page @@ -1270,8 +1261,14 @@ class ZFlipAgePagesTask : public ZTask { prev_page->log_msg(promotion ? " (flip promoted)" : " (flip survived)"); // Setup to-space page - ZPage* const new_page = promotion ? prev_page->clone_limited_promote_flipped() : prev_page; - new_page->reset(to_age, ZPageResetType::FlipAging); + ZPage* const new_page = promotion ? prev_page->clone_limited() : prev_page; + + // Reset page for flip aging + new_page->reset(to_age); + new_page->reset_livemap(); + if (promotion) { + new_page->remset_alloc(); + } if (promotion) { ZGeneration::young()->flip_promote(prev_page, new_page); diff --git a/src/hotspot/share/gc/z/zRememberedSet.cpp b/src/hotspot/share/gc/z/zRememberedSet.cpp index ed1dcfaf14d55..f605401648dfb 100644 --- a/src/hotspot/share/gc/z/zRememberedSet.cpp +++ b/src/hotspot/share/gc/z/zRememberedSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -55,18 +55,10 @@ void ZRememberedSet::initialize(size_t page_size) { _bitmap[1].initialize(size_in_bits, true /* clear */); } -void ZRememberedSet::resize(size_t page_size) { - // The bitmaps only need to be resized if remset has been - // initialized, and hence the bitmaps have been initialized. - if (is_initialized()) { - const BitMap::idx_t size_in_bits = to_bit_size(page_size); - - // The bitmaps need to be cleared when free, but since this function is - // only used for shrinking the clear argument is correct but not crucial. - assert(size_in_bits <= _bitmap[0].size(), "Only used for shrinking"); - _bitmap[0].resize(size_in_bits, true /* clear */); - _bitmap[1].resize(size_in_bits, true /* clear */); - } +void ZRememberedSet::delete_all() { + assert(is_initialized(), "precondition"); + _bitmap[0].resize(0); + _bitmap[1].resize(0); } bool ZRememberedSet::is_cleared_current() const { @@ -77,15 +69,6 @@ bool ZRememberedSet::is_cleared_previous() const { return previous()->is_empty(); } -void ZRememberedSet::clear_all() { - _bitmap[0].clear_large(); - _bitmap[1].clear_large(); -} - -void ZRememberedSet::clear_current() { - current()->clear_large(); -} - void ZRememberedSet::clear_previous() { previous()->clear_large(); } diff --git a/src/hotspot/share/gc/z/zRememberedSet.hpp b/src/hotspot/share/gc/z/zRememberedSet.hpp index d18c357f0ddbe..c3c6e8bc31317 100644 --- a/src/hotspot/share/gc/z/zRememberedSet.hpp +++ b/src/hotspot/share/gc/z/zRememberedSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -114,8 +114,7 @@ class ZRememberedSet { bool is_initialized() const; void initialize(size_t page_size); - - void resize(size_t page_size); + void delete_all(); bool at_current(uintptr_t offset) const; bool at_previous(uintptr_t offset) const; @@ -133,8 +132,6 @@ class ZRememberedSet { bool is_cleared_current() const; bool is_cleared_previous() const; - void clear_all(); - void clear_current(); void clear_previous(); void swap_remset_bitmaps(); diff --git a/src/hotspot/share/gc/z/zStackWatermark.cpp b/src/hotspot/share/gc/z/zStackWatermark.cpp index ead5300e9c318..0c7ec553e5c0c 100644 --- a/src/hotspot/share/gc/z/zStackWatermark.cpp +++ b/src/hotspot/share/gc/z/zStackWatermark.cpp @@ -130,7 +130,7 @@ void ZStackWatermark::save_old_watermark() { } else { // Found none too replace - push it to the top _old_watermarks_newest++; - assert(_old_watermarks_newest < _old_watermarks_max, "Unexpected amount of old watermarks"); + assert(_old_watermarks_newest < OldWatermarksMax, "Unexpected amount of old watermarks"); } // Install old watermark diff --git a/src/hotspot/share/gc/z/zStackWatermark.hpp b/src/hotspot/share/gc/z/zStackWatermark.hpp index fd4efeef76131..f2cf59d3b4a80 100644 --- a/src/hotspot/share/gc/z/zStackWatermark.hpp +++ b/src/hotspot/share/gc/z/zStackWatermark.hpp @@ -59,8 +59,8 @@ class ZStackWatermark : public StackWatermark { private: // Stores old watermarks, which describes the // colors of the non-processed part of the stack. - const static int _old_watermarks_max = 3; - ZColorWatermark _old_watermarks[_old_watermarks_max]; + static const int OldWatermarksMax = 3; + ZColorWatermark _old_watermarks[OldWatermarksMax]; int _old_watermarks_newest; ThreadLocalAllocStats _stats; diff --git a/src/hotspot/share/gc/z/zStat.cpp b/src/hotspot/share/gc/z/zStat.cpp index c2a7a23c04f53..56b3590960f7c 100644 --- a/src/hotspot/share/gc/z/zStat.cpp +++ b/src/hotspot/share/gc/z/zStat.cpp @@ -1019,7 +1019,7 @@ ZStatMutatorAllocRateStats ZStatMutatorAllocRate::stats() { // Stat thread // ZStat::ZStat() - : _metronome(sample_hz) { + : _metronome(SampleHz) { set_name("ZStat"); create_and_start(); ZStatMutatorAllocRate::initialize(); @@ -1098,11 +1098,11 @@ void ZStat::terminate() { // class ZStatTablePrinter { private: - static const size_t _buffer_size = 256; + static const size_t BufferSize = 256; const size_t _column0_width; const size_t _columnN_width; - char _buffer[_buffer_size]; + char _buffer[BufferSize]; public: class ZColumn { @@ -1119,7 +1119,7 @@ class ZStatTablePrinter { } size_t print(size_t position, const char* fmt, va_list va) { - const int res = jio_vsnprintf(_buffer + position, _buffer_size - position, fmt, va); + const int res = jio_vsnprintf(_buffer + position, BufferSize - position, fmt, va); if (res < 0) { return 0; } diff --git a/src/hotspot/share/gc/z/zStat.hpp b/src/hotspot/share/gc/z/zStat.hpp index d7482dbe6aaaf..d7fff6d7b8e13 100644 --- a/src/hotspot/share/gc/z/zStat.hpp +++ b/src/hotspot/share/gc/z/zStat.hpp @@ -384,7 +384,7 @@ class ZStatMutatorAllocRate : public AllStatic { // class ZStat : public ZThread { private: - static const uint64_t sample_hz = 1; + static const uint64_t SampleHz = 1; ZMetronome _metronome; diff --git a/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp b/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp index c94551dc62d20..78106aad729b7 100644 --- a/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp +++ b/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp @@ -55,7 +55,7 @@ ZStoreBarrierBuffer::ZStoreBarrierBuffer() _last_installed_color(), _base_pointer_lock(), _base_pointers(), - _current(ZBufferStoreBarriers ? _buffer_size_bytes : 0) {} + _current(ZBufferStoreBarriers ? BufferSizeBytes : 0) {} void ZStoreBarrierBuffer::initialize() { _last_processed_color = ZPointerStoreGoodMask; @@ -63,11 +63,11 @@ void ZStoreBarrierBuffer::initialize() { } void ZStoreBarrierBuffer::clear() { - _current = _buffer_size_bytes; + _current = BufferSizeBytes; } bool ZStoreBarrierBuffer::is_empty() const { - return _current == _buffer_size_bytes; + return _current == BufferSizeBytes; } void ZStoreBarrierBuffer::install_base_pointers_inner() { @@ -79,7 +79,7 @@ void ZStoreBarrierBuffer::install_base_pointers_inner() { (ZPointer::remap_bits(_last_processed_color) & ZPointerRemappedOldMask) == 0, "Should not have double bit errors"); - for (size_t i = current(); i < _buffer_length; ++i) { + for (size_t i = current(); i < BufferLength; ++i) { const ZStoreBarrierEntry& entry = _buffer[i]; volatile zpointer* const p = entry._p; const zaddress_unsafe p_unsafe = to_zaddress_unsafe((uintptr_t)p); @@ -229,7 +229,7 @@ void ZStoreBarrierBuffer::on_new_phase() { // Install all base pointers for relocation install_base_pointers(); - for (size_t i = current(); i < _buffer_length; ++i) { + for (size_t i = current(); i < BufferLength; ++i) { on_new_phase_relocate(i); on_new_phase_remember(i); on_new_phase_mark(i); @@ -259,7 +259,7 @@ void ZStoreBarrierBuffer::on_error(outputStream* st) { st->print_cr(" _last_processed_color: " PTR_FORMAT, _last_processed_color); st->print_cr(" _last_installed_color: " PTR_FORMAT, _last_installed_color); - for (size_t i = current(); i < _buffer_length; ++i) { + for (size_t i = current(); i < BufferLength; ++i) { st->print_cr(" [%2zu]: base: " PTR_FORMAT " p: " PTR_FORMAT " prev: " PTR_FORMAT, i, untype(_base_pointers[i]), @@ -276,7 +276,7 @@ void ZStoreBarrierBuffer::flush() { OnError on_error(this); VMErrorCallbackMark mark(&on_error); - for (size_t i = current(); i < _buffer_length; ++i) { + for (size_t i = current(); i < BufferLength; ++i) { const ZStoreBarrierEntry& entry = _buffer[i]; const zaddress addr = ZBarrier::make_load_good(entry._prev); ZBarrier::mark_and_remember(entry._p, addr); @@ -296,7 +296,7 @@ bool ZStoreBarrierBuffer::is_in(volatile zpointer* p) { const uintptr_t last_remap_bits = ZPointer::remap_bits(buffer->_last_processed_color) & ZPointerRemappedMask; const bool needs_remap = last_remap_bits != ZPointerRemapped; - for (size_t i = buffer->current(); i < _buffer_length; ++i) { + for (size_t i = buffer->current(); i < BufferLength; ++i) { const ZStoreBarrierEntry& entry = buffer->_buffer[i]; volatile zpointer* entry_p = entry._p; diff --git a/src/hotspot/share/gc/z/zStoreBarrierBuffer.hpp b/src/hotspot/share/gc/z/zStoreBarrierBuffer.hpp index 5903edb6ad409..68984a15a1ee9 100644 --- a/src/hotspot/share/gc/z/zStoreBarrierBuffer.hpp +++ b/src/hotspot/share/gc/z/zStoreBarrierBuffer.hpp @@ -42,10 +42,10 @@ class ZStoreBarrierBuffer : public CHeapObj { friend class ZVerify; private: - static const size_t _buffer_length = 32; - static const size_t _buffer_size_bytes = _buffer_length * sizeof(ZStoreBarrierEntry); + static const size_t BufferLength = 32; + static const size_t BufferSizeBytes = BufferLength * sizeof(ZStoreBarrierEntry); - ZStoreBarrierEntry _buffer[_buffer_length]; + ZStoreBarrierEntry _buffer[BufferLength]; // Color from previous phase this buffer was processed uintptr_t _last_processed_color; @@ -54,7 +54,7 @@ class ZStoreBarrierBuffer : public CHeapObj { uintptr_t _last_installed_color; ZLock _base_pointer_lock; - zaddress_unsafe _base_pointers[_buffer_length]; + zaddress_unsafe _base_pointers[BufferLength]; // sizeof(ZStoreBarrierEntry) scaled index growing downwards size_t _current; diff --git a/src/hotspot/share/gc/z/zValue.hpp b/src/hotspot/share/gc/z/zValue.hpp index 29f1b707e7c6b..4953978297f52 100644 --- a/src/hotspot/share/gc/z/zValue.hpp +++ b/src/hotspot/share/gc/z/zValue.hpp @@ -39,7 +39,7 @@ class ZValueStorage : public AllStatic { static uintptr_t _end; public: - static const size_t offset = 4 * K; + static const size_t Offset = 4 * K; static uintptr_t alloc(size_t size); }; diff --git a/src/hotspot/share/gc/z/zValue.inline.hpp b/src/hotspot/share/gc/z/zValue.inline.hpp index 2367bac0f0aab..c2aa8bbbb4004 100644 --- a/src/hotspot/share/gc/z/zValue.inline.hpp +++ b/src/hotspot/share/gc/z/zValue.inline.hpp @@ -44,7 +44,7 @@ template uintptr_t ZValueStorage::_top = 0; template uintptr_t ZValueStorage::alloc(size_t size) { - assert(size <= offset, "Allocation too large"); + assert(size <= Offset, "Allocation too large"); // Allocate entry in existing memory block const uintptr_t addr = align_up(_top, S::alignment()); @@ -56,10 +56,10 @@ uintptr_t ZValueStorage::alloc(size_t size) { } // Allocate new block of memory - const size_t block_alignment = offset; - const size_t block_size = offset * S::count(); + const size_t block_alignment = Offset; + const size_t block_size = Offset * S::count(); _top = ZUtils::alloc_aligned_unfreeable(block_alignment, block_size); - _end = _top + offset; + _end = _top + Offset; // Retry allocation return alloc(size); @@ -119,7 +119,7 @@ inline uint32_t ZPerWorkerStorage::id() { template inline uintptr_t ZValue::value_addr(uint32_t value_id) const { - return _addr + (value_id * S::offset); + return _addr + (value_id * S::Offset); } template diff --git a/src/hotspot/share/gc/z/zVerify.cpp b/src/hotspot/share/gc/z/zVerify.cpp index b735965e9d49b..03b50e110e4c4 100644 --- a/src/hotspot/share/gc/z/zVerify.cpp +++ b/src/hotspot/share/gc/z/zVerify.cpp @@ -589,7 +589,7 @@ void ZVerify::on_color_flip() { for (JavaThreadIteratorWithHandle jtiwh; JavaThread* const jt = jtiwh.next(); ) { const ZStoreBarrierBuffer* const buffer = ZThreadLocalData::store_barrier_buffer(jt); - for (size_t i = buffer->current(); i < ZStoreBarrierBuffer::_buffer_length; ++i) { + for (size_t i = buffer->current(); i < ZStoreBarrierBuffer::BufferLength; ++i) { volatile zpointer* const p = buffer->_buffer[i]._p; bool created = false; z_verify_store_barrier_buffer_table->put_if_absent(p, true, &created); diff --git a/src/hotspot/share/interpreter/abstractInterpreter.cpp b/src/hotspot/share/interpreter/abstractInterpreter.cpp index 2fad5ba39ef5c..9d72f9ba0edec 100644 --- a/src/hotspot/share/interpreter/abstractInterpreter.cpp +++ b/src/hotspot/share/interpreter/abstractInterpreter.cpp @@ -138,6 +138,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan case vmIntrinsics::_dsin: return java_lang_math_sin; case vmIntrinsics::_dcos: return java_lang_math_cos; case vmIntrinsics::_dtan: return java_lang_math_tan; + case vmIntrinsics::_dtanh: return java_lang_math_tanh; case vmIntrinsics::_dabs: return java_lang_math_abs; case vmIntrinsics::_dlog: return java_lang_math_log; case vmIntrinsics::_dlog10: return java_lang_math_log10; @@ -198,6 +199,7 @@ vmIntrinsics::ID AbstractInterpreter::method_intrinsic(MethodKind kind) { case java_lang_math_sin : return vmIntrinsics::_dsin; case java_lang_math_cos : return vmIntrinsics::_dcos; case java_lang_math_tan : return vmIntrinsics::_dtan; + case java_lang_math_tanh : return vmIntrinsics::_dtanh; case java_lang_math_abs : return vmIntrinsics::_dabs; case java_lang_math_log : return vmIntrinsics::_dlog; case java_lang_math_log10 : return vmIntrinsics::_dlog10; @@ -309,6 +311,7 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; + case java_lang_math_tanh : tty->print("java_lang_math_tanh" ); break; case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; case java_lang_math_log : tty->print("java_lang_math_log" ); break; case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; diff --git a/src/hotspot/share/interpreter/abstractInterpreter.hpp b/src/hotspot/share/interpreter/abstractInterpreter.hpp index e487b152b76ea..790706c2de3cd 100644 --- a/src/hotspot/share/interpreter/abstractInterpreter.hpp +++ b/src/hotspot/share/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -72,6 +72,7 @@ class AbstractInterpreter: AllStatic { java_lang_math_sin, // implementation of java.lang.Math.sin (x) java_lang_math_cos, // implementation of java.lang.Math.cos (x) java_lang_math_tan, // implementation of java.lang.Math.tan (x) + java_lang_math_tanh, // implementation of java.lang.Math.tanh (x) java_lang_math_abs, // implementation of java.lang.Math.abs (x) java_lang_math_sqrt, // implementation of java.lang.Math.sqrt (x) java_lang_math_sqrt_strict, // implementation of java.lang.StrictMath.sqrt(x) @@ -151,6 +152,7 @@ class AbstractInterpreter: AllStatic { case vmIntrinsics::_dsin : // fall thru case vmIntrinsics::_dcos : // fall thru case vmIntrinsics::_dtan : // fall thru + case vmIntrinsics::_dtanh : // fall thru case vmIntrinsics::_dabs : // fall thru case vmIntrinsics::_dsqrt : // fall thru case vmIntrinsics::_dsqrt_strict : // fall thru diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp index cadc3e8a2e802..36847580d9c63 100644 --- a/src/hotspot/share/interpreter/linkResolver.cpp +++ b/src/hotspot/share/interpreter/linkResolver.cpp @@ -87,7 +87,7 @@ void CallInfo::set_interface(Klass* resolved_klass, // we should pick the vtable index from the resolved method. // In that case, the caller must call set_virtual instead of set_interface. assert(resolved_method->method_holder()->is_interface(), ""); - assert(itable_index == resolved_method()->itable_index(), ""); + assert(itable_index == resolved_method->itable_index(), ""); set_common(resolved_klass, resolved_method, selected_method, CallInfo::itable_call, itable_index, CHECK); } @@ -1541,7 +1541,7 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, } // resolve the method in the receiver class, unless it is private - if (!is_abstract_interpretation && !resolved_method()->is_private()) { + if (!is_abstract_interpretation && !resolved_method->is_private()) { // do lookup based on receiver klass // This search must match the linktime preparation search for itable initialization // to correctly enforce loader constraints for interface method inheritance. @@ -1590,17 +1590,17 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, assert(is_abstract_interpretation || vtable_index == selected_method->vtable_index(), "sanity check"); result.set_virtual(resolved_klass, resolved_method, selected_method, vtable_index, CHECK); } else if (resolved_method->has_itable_index()) { - int itable_index = resolved_method()->itable_index(); + int itable_index = resolved_method->itable_index(); log_develop_trace(itables)(" -- itable index: %d", itable_index); result.set_interface(resolved_klass, resolved_method, selected_method, itable_index, CHECK); } else { int index = resolved_method->vtable_index(); log_develop_trace(itables)(" -- non itable/vtable index: %d", index); assert(index == Method::nonvirtual_vtable_index, "Oops hit another case!"); - assert(resolved_method()->is_private() || - (resolved_method()->is_final() && resolved_method->method_holder() == vmClasses::Object_klass()), + assert(resolved_method->is_private() || + (resolved_method->is_final() && resolved_method->method_holder() == vmClasses::Object_klass()), "Should only have non-virtual invokeinterface for private or final-Object methods!"); - assert(resolved_method()->can_be_statically_bound(), "Should only have non-virtual invokeinterface for statically bound methods!"); + assert(resolved_method->can_be_statically_bound(), "Should only have non-virtual invokeinterface for statically bound methods!"); // This sets up the nonvirtual form of "virtual" call (as needed for final and private methods) result.set_virtual(resolved_klass, resolved_method, resolved_method, index, CHECK); } diff --git a/src/hotspot/share/interpreter/linkResolver.hpp b/src/hotspot/share/interpreter/linkResolver.hpp index 340c7d412d599..69bdf56137d41 100644 --- a/src/hotspot/share/interpreter/linkResolver.hpp +++ b/src/hotspot/share/interpreter/linkResolver.hpp @@ -99,7 +99,6 @@ class CallInfo : public StackObj { // Materialize a java.lang.invoke.ResolvedMethodName for this resolved_method void set_resolved_method_name(TRAPS); - BasicType result_type() const { return selected_method()->result_type(); } CallKind call_kind() const { return _call_kind; } int vtable_index() const { // Even for interface calls the vtable index could be non-negative. diff --git a/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp b/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp index 9cd6f5ceffbe9..3f497c3360b7e 100644 --- a/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp +++ b/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -192,6 +192,7 @@ void TemplateInterpreterGenerator::generate_all() { method_entry(java_lang_math_sin ) method_entry(java_lang_math_cos ) method_entry(java_lang_math_tan ) + method_entry(java_lang_math_tanh ) method_entry(java_lang_math_abs ) method_entry(java_lang_math_sqrt ) method_entry(java_lang_math_sqrt_strict) @@ -457,6 +458,7 @@ address TemplateInterpreterGenerator::generate_intrinsic_entry(AbstractInterpret case Interpreter::java_lang_math_sin : // fall thru case Interpreter::java_lang_math_cos : // fall thru case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_tanh : // fall thru case Interpreter::java_lang_math_abs : // fall thru case Interpreter::java_lang_math_log : // fall thru case Interpreter::java_lang_math_log10 : // fall thru diff --git a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp index e08d9553c3e07..27ea1b9706719 100644 --- a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp +++ b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -54,6 +54,7 @@ void ZeroInterpreterGenerator::generate_all() { method_entry(java_lang_math_sin ); method_entry(java_lang_math_cos ); method_entry(java_lang_math_tan ); + method_entry(java_lang_math_tanh ); method_entry(java_lang_math_abs ); method_entry(java_lang_math_sqrt ); method_entry(java_lang_math_sqrt_strict); @@ -95,6 +96,7 @@ address ZeroInterpreterGenerator::generate_method_entry( case Interpreter::java_lang_math_sin : // fall thru case Interpreter::java_lang_math_cos : // fall thru case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_tanh : // fall thru case Interpreter::java_lang_math_abs : // fall thru case Interpreter::java_lang_math_log : // fall thru case Interpreter::java_lang_math_log10 : // fall thru diff --git a/src/hotspot/share/jfr/leakprofiler/chains/jfrbitset.hpp b/src/hotspot/share/jfr/leakprofiler/chains/jfrbitset.hpp index 8f1d2b4d5b120..9a123a916299f 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/jfrbitset.hpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/jfrbitset.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_JFR_LEAKPROFILER_JFRBITSET_HPP #define SHARE_JFR_LEAKPROFILER_JFRBITSET_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/objectBitSet.inline.hpp" typedef ObjectBitSet JFRBitSet; diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml index 0782f94a9034d..babb24f28ea1d 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xml +++ b/src/hotspot/share/jfr/metadata/metadata.xml @@ -735,7 +735,7 @@ + description="Native memory usage for a given memory tag in the JVM" period="everyChunk"> diff --git a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp index 2b86108121586..6c0584f50ff31 100644 --- a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp +++ b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -63,10 +63,10 @@ void JfrNativeMemoryEvent::send_total_event(const Ticks& timestamp) { event.commit(); } -void JfrNativeMemoryEvent::send_type_event(const Ticks& starttime, MEMFLAGS flag, size_t reserved, size_t committed) { +void JfrNativeMemoryEvent::send_type_event(const Ticks& starttime, MemTag mem_tag, size_t reserved, size_t committed) { EventNativeMemoryUsage event(UNTIMED); event.set_starttime(starttime); - event.set_type(NMTUtil::flag_to_index(flag)); + event.set_type(NMTUtil::tag_to_index(mem_tag)); event.set_reserved(reserved); event.set_committed(committed); event.commit(); @@ -79,12 +79,12 @@ void JfrNativeMemoryEvent::send_type_events(const Ticks& timestamp) { NMTUsage* usage = get_usage(timestamp); - for (int index = 0; index < mt_number_of_types; index ++) { - MEMFLAGS flag = NMTUtil::index_to_flag(index); - if (flag == mtNone) { + for (int index = 0; index < mt_number_of_tags; index ++) { + MemTag mem_tag = NMTUtil::index_to_tag(index); + if (mem_tag == mtNone) { // Skip mtNone since it is not really used. continue; } - send_type_event(timestamp, flag, usage->reserved(flag), usage->committed(flag)); + send_type_event(timestamp, mem_tag, usage->reserved(mem_tag), usage->committed(mem_tag)); } } diff --git a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.hpp b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.hpp index c5a476c78a89c..f2628bc1287ab 100644 --- a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.hpp +++ b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_JFR_PERIODIC_JFRNATIVEMEMORYEVENT_HPP #define SHARE_JFR_PERIODIC_JFRNATIVEMEMORYEVENT_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/nmtUsage.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ticks.hpp" @@ -35,7 +35,7 @@ // so no more synchronization is needed. class JfrNativeMemoryEvent : public AllStatic { private: - static void send_type_event(const Ticks& starttime, MEMFLAGS flag, size_t reserved, size_t committed); + static void send_type_event(const Ticks& starttime, MemTag mem_tag, size_t reserved, size_t committed); public: static void send_total_event(const Ticks& timestamp); static void send_type_events(const Ticks& timestamp); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp index 5cd9e6b253b1e..63c7a027373be 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -332,10 +332,10 @@ void CompilerTypeConstant::serialize(JfrCheckpointWriter& writer) { } void NMTTypeConstant::serialize(JfrCheckpointWriter& writer) { - writer.write_count(mt_number_of_types); - for (int i = 0; i < mt_number_of_types; ++i) { + writer.write_count(mt_number_of_tags); + for (int i = 0; i < mt_number_of_tags; ++i) { writer.write_key(i); - MEMFLAGS flag = NMTUtil::index_to_flag(i); - writer.write(NMTUtil::flag_to_name(flag)); + MemTag mem_tag = NMTUtil::index_to_tag(i); + writer.write(NMTUtil::tag_to_name(mem_tag)); } } diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp index f7873b5005807..30f2afd880c43 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp @@ -75,7 +75,7 @@ static size_t element_size(bool compressed) { } static bool can_compress_element(const Klass* klass) { - return CompressedKlassPointers::is_in_encoding_range(klass) && + return CompressedKlassPointers::is_encodable(klass) && JfrTraceId::load_raw(klass) < uncompressed_threshold; } diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp index 595fcc9c65daa..4982e24e8987d 100644 --- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp +++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -208,7 +208,7 @@ static DCmdArgument _dcmd_globalbuffersize( static DCmdArgument _dcmd_numglobalbuffers( "numglobalbuffers", "Number of global buffers", - "JULONG", + "INT", false, default_num_global_buffers); @@ -222,7 +222,7 @@ static DCmdArgument _dcmd_maxchunksize( static DCmdArgument _dcmd_old_object_queue_size ( "old-object-queue-size", "Maximum number of old objects to track", - "JINT", + "INT", false, default_old_object_queue_size); @@ -245,7 +245,7 @@ static DCmdArgument _dcmd_sample_protection( static DCmdArgument _dcmd_stackdepth( "stackdepth", "Stack depth for stacktraces (minimum 1, maximum 2048)", - "JULONG", + "INT", false, default_stack_depth); diff --git a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp index 78309f00913cc..aaae65ed10dce 100644 --- a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp +++ b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -117,7 +117,7 @@ bool JfrVirtualMemorySegment::initialize(size_t reservation_size_request_bytes) _rs.base(), _rs.size(), os::vm_page_size()); - MemTracker::record_virtual_memory_type((address)_rs.base(), mtTracing); + MemTracker::record_virtual_memory_tag((address)_rs.base(), mtTracing); assert(is_aligned(_rs.base(), os::vm_page_size()), "invariant"); assert(is_aligned(_rs.size(), os::vm_page_size()), "invariant"); diff --git a/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp b/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp index 920e07eca454b..5e80e31a9987a 100644 --- a/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp +++ b/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2023, 2024, 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 @@ -117,6 +117,7 @@ static void commit(const HelperType& helper) { JavaThread* jt = JavaThread::cast(thread); if (jt->thread_state() == _thread_in_native) { // For a JavaThread to take a JFR stacktrace, it must be in _thread_in_vm. Can safepoint here. + MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, jt)); ThreadInVMfromNative transition(jt); event.commit(); return; diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp index fa4b1c75c0573..0773de6ddbaa0 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp @@ -116,6 +116,7 @@ class CompilerToVM { static address dsin; static address dcos; static address dtan; + static address dtanh; static address dexp; static address dlog; static address dlog10; diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index 26c88abec0f18..1612038008a32 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -135,6 +135,7 @@ int CompilerToVM::Data::sizeof_ZStoreBarrierEntry = sizeof(ZStoreBarrierEntry); address CompilerToVM::Data::dsin; address CompilerToVM::Data::dcos; address CompilerToVM::Data::dtan; +address CompilerToVM::Data::dtanh; address CompilerToVM::Data::dexp; address CompilerToVM::Data::dlog; address CompilerToVM::Data::dlog10; @@ -268,6 +269,19 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { SET_TRIGFUNC(dpow); #undef SET_TRIGFUNC + +#define SET_TRIGFUNC_OR_NULL(name) \ + if (StubRoutines::name() != nullptr) { \ + name = StubRoutines::name(); \ + } else { \ + name = nullptr; \ + } + + SET_TRIGFUNC_OR_NULL(dtanh); + +#undef SET_TRIGFUNC_OR_NULL + + } static jboolean is_c1_supported(vmIntrinsics::ID id){ diff --git a/src/hotspot/share/jvmci/jvmci_globals.cpp b/src/hotspot/share/jvmci/jvmci_globals.cpp index 86d8491b73303..36740560dd23f 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.cpp +++ b/src/hotspot/share/jvmci/jvmci_globals.cpp @@ -80,6 +80,15 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { CHECK_NOT_SET(LibJVMCICompilerThreadHidden, UseJVMCICompiler) if (UseJVMCICompiler) { + if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) { + jio_fprintf(defaultStream::error_stream(), + "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n"); + return false; + } + FLAG_SET_DEFAULT(EnableJVMCI, true); + } + + if (EnableJVMCI) { if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) { char path[JVM_MAXPATHLEN]; if (os::dll_locate_lib(path, sizeof(path), Arguments::get_dll_dir(), JVMCI_SHARED_LIBRARY_NAME)) { @@ -88,12 +97,9 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { FLAG_SET_DEFAULT(UseJVMCINativeLibrary, true); } } - if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) { - jio_fprintf(defaultStream::error_stream(), - "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n"); - return false; - } - FLAG_SET_DEFAULT(EnableJVMCI, true); + } + + if (UseJVMCICompiler) { if (BootstrapJVMCI && UseJVMCINativeLibrary) { jio_fprintf(defaultStream::error_stream(), "-XX:+BootstrapJVMCI is not compatible with -XX:+UseJVMCINativeLibrary\n"); return false; diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp index 1f2c0c647ab1e..30f2e6c2c73e0 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.hpp +++ b/src/hotspot/share/jvmci/jvmci_globals.hpp @@ -140,7 +140,7 @@ class fileStream; product(bool, UseJVMCINativeLibrary, false, EXPERIMENTAL, \ "Execute JVMCI Java code from a shared library (\"libjvmci\") " \ "instead of loading it from class files and executing it " \ - "on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \ + "on the HotSpot heap. Defaults to true if EnableJVMCI is " \ "true and a JVMCI native library is available.") \ \ product(double, JVMCINativeLibraryThreadFraction, 0.33, EXPERIMENTAL, \ diff --git a/src/hotspot/share/memory/allocation.cpp b/src/hotspot/share/memory/allocation.cpp index 73bc9d4ad2a80..096ee6964210e 100644 --- a/src/hotspot/share/memory/allocation.cpp +++ b/src/hotspot/share/memory/allocation.cpp @@ -36,10 +36,10 @@ // allocate using malloc; will fail if no memory available char* AllocateHeap(size_t size, - MEMFLAGS flags, + MemTag mem_tag, const NativeCallStack& stack, AllocFailType alloc_failmode /* = AllocFailStrategy::EXIT_OOM*/) { - char* p = (char*) os::malloc(size, flags, stack); + char* p = (char*) os::malloc(size, mem_tag, stack); if (p == nullptr && alloc_failmode == AllocFailStrategy::EXIT_OOM) { vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "AllocateHeap"); } @@ -47,16 +47,16 @@ char* AllocateHeap(size_t size, } char* AllocateHeap(size_t size, - MEMFLAGS flags, + MemTag mem_tag, AllocFailType alloc_failmode /* = AllocFailStrategy::EXIT_OOM*/) { - return AllocateHeap(size, flags, CALLER_PC, alloc_failmode); + return AllocateHeap(size, mem_tag, CALLER_PC, alloc_failmode); } char* ReallocateHeap(char *old, size_t size, - MEMFLAGS flag, + MemTag mem_tag, AllocFailType alloc_failmode) { - char* p = (char*) os::realloc(old, size, flag, CALLER_PC); + char* p = (char*) os::realloc(old, size, mem_tag, CALLER_PC); if (p == nullptr && alloc_failmode == AllocFailStrategy::EXIT_OOM) { vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "ReallocateHeap"); } @@ -119,16 +119,16 @@ void* AnyObj::operator new(size_t size, Arena *arena) { return res; } -void* AnyObj::operator new(size_t size, MEMFLAGS flags) throw() { - address res = (address)AllocateHeap(size, flags, CALLER_PC); +void* AnyObj::operator new(size_t size, MemTag mem_tag) throw() { + address res = (address)AllocateHeap(size, mem_tag, CALLER_PC); DEBUG_ONLY(set_allocation_type(res, C_HEAP);) return res; } void* AnyObj::operator new(size_t size, const std::nothrow_t& nothrow_constant, - MEMFLAGS flags) throw() { + MemTag mem_tag) throw() { // should only call this with std::nothrow, use other operator new() otherwise - address res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL); + address res = (address)AllocateHeap(size, mem_tag, CALLER_PC, AllocFailStrategy::RETURN_NULL); DEBUG_ONLY(if (res!= nullptr) set_allocation_type(res, C_HEAP);) return res; } diff --git a/src/hotspot/share/memory/allocation.hpp b/src/hotspot/share/memory/allocation.hpp index da5f7b1983002..9841ce3183caa 100644 --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp @@ -26,7 +26,7 @@ #define SHARE_MEMORY_ALLOCATION_HPP #include "memory/allStatic.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" @@ -94,9 +94,9 @@ typedef AllocFailStrategy::AllocFailEnum AllocFailType; // NEW_C_HEAP_OBJ* // FREE_C_HEAP_OBJ // -// char* AllocateHeap(size_t size, MEMFLAGS flags, const NativeCallStack& stack, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); -// char* AllocateHeap(size_t size, MEMFLAGS flags, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); -// char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); +// char* AllocateHeap(size_t size, MemTag mem_tag, const NativeCallStack& stack, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); +// char* AllocateHeap(size_t size, MemTag mem_tag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); +// char* ReallocateHeap(char *old, size_t size, MemTag mem_tag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); // void FreeHeap(void* p); // @@ -106,16 +106,16 @@ class NativeCallStack; char* AllocateHeap(size_t size, - MEMFLAGS flags, + MemTag mem_tag, const NativeCallStack& stack, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); char* AllocateHeap(size_t size, - MEMFLAGS flags, + MemTag mem_tag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); char* ReallocateHeap(char *old, size_t size, - MEMFLAGS flag, + MemTag mem_tag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); // handles null pointers @@ -123,50 +123,50 @@ void FreeHeap(void* p); class CHeapObjBase { public: - ALWAYSINLINE void* operator new(size_t size, MEMFLAGS f) { - return AllocateHeap(size, f); + ALWAYSINLINE void* operator new(size_t size, MemTag mem_tag) { + return AllocateHeap(size, mem_tag); } ALWAYSINLINE void* operator new(size_t size, - MEMFLAGS f, + MemTag mem_tag, const NativeCallStack& stack) { - return AllocateHeap(size, f, stack); + return AllocateHeap(size, mem_tag, stack); } ALWAYSINLINE void* operator new(size_t size, - MEMFLAGS f, + MemTag mem_tag, const std::nothrow_t&, const NativeCallStack& stack) throw() { - return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, mem_tag, stack, AllocFailStrategy::RETURN_NULL); } ALWAYSINLINE void* operator new(size_t size, - MEMFLAGS f, + MemTag mem_tag, const std::nothrow_t&) throw() { - return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, mem_tag, AllocFailStrategy::RETURN_NULL); } - ALWAYSINLINE void* operator new[](size_t size, MEMFLAGS f) { - return AllocateHeap(size, f); + ALWAYSINLINE void* operator new[](size_t size, MemTag mem_tag) { + return AllocateHeap(size, mem_tag); } ALWAYSINLINE void* operator new[](size_t size, - MEMFLAGS f, + MemTag mem_tag, const NativeCallStack& stack) { - return AllocateHeap(size, f, stack); + return AllocateHeap(size, mem_tag, stack); } ALWAYSINLINE void* operator new[](size_t size, - MEMFLAGS f, + MemTag mem_tag, const std::nothrow_t&, const NativeCallStack& stack) throw() { - return AllocateHeap(size, f, stack, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, mem_tag, stack, AllocFailStrategy::RETURN_NULL); } ALWAYSINLINE void* operator new[](size_t size, - MEMFLAGS f, + MemTag mem_tag, const std::nothrow_t&) throw() { - return AllocateHeap(size, f, AllocFailStrategy::RETURN_NULL); + return AllocateHeap(size, mem_tag, AllocFailStrategy::RETURN_NULL); } void operator delete(void* p) { FreeHeap(p); } @@ -174,43 +174,43 @@ class CHeapObjBase { }; // Uses the implicitly static new and delete operators of CHeapObjBase -template +template class CHeapObj { public: ALWAYSINLINE void* operator new(size_t size) { - return CHeapObjBase::operator new(size, F); + return CHeapObjBase::operator new(size, MT); } ALWAYSINLINE void* operator new(size_t size, const NativeCallStack& stack) { - return CHeapObjBase::operator new(size, F, stack); + return CHeapObjBase::operator new(size, MT, stack); } ALWAYSINLINE void* operator new(size_t size, const std::nothrow_t& nt, const NativeCallStack& stack) throw() { - return CHeapObjBase::operator new(size, F, nt, stack); + return CHeapObjBase::operator new(size, MT, nt, stack); } ALWAYSINLINE void* operator new(size_t size, const std::nothrow_t& nt) throw() { - return CHeapObjBase::operator new(size, F, nt); + return CHeapObjBase::operator new(size, MT, nt); } ALWAYSINLINE void* operator new[](size_t size) { - return CHeapObjBase::operator new[](size, F); + return CHeapObjBase::operator new[](size, MT); } ALWAYSINLINE void* operator new[](size_t size, const NativeCallStack& stack) { - return CHeapObjBase::operator new[](size, F, stack); + return CHeapObjBase::operator new[](size, MT, stack); } ALWAYSINLINE void* operator new[](size_t size, const std::nothrow_t& nt, const NativeCallStack& stack) throw() { - return CHeapObjBase::operator new[](size, F, nt, stack); + return CHeapObjBase::operator new[](size, MT, nt, stack); } ALWAYSINLINE void* operator new[](size_t size, const std::nothrow_t& nt) throw() { - return CHeapObjBase::operator new[](size, F, nt); + return CHeapObjBase::operator new[](size, MT, nt); } void operator delete(void* p) { @@ -439,10 +439,10 @@ class AnyObj { public: // CHeap allocations - void* operator new(size_t size, MEMFLAGS flags) throw(); - void* operator new [](size_t size, MEMFLAGS flags) throw() = delete; - void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw(); - void* operator new [](size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() = delete; + void* operator new(size_t size, MemTag mem_tag) throw(); + void* operator new [](size_t size, MemTag mem_tag) throw() = delete; + void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MemTag mem_tag) throw(); + void* operator new [](size_t size, const std::nothrow_t& nothrow_constant, MemTag mem_tag) throw() = delete; // Arena allocations void* operator new(size_t size, Arena *arena); @@ -510,36 +510,36 @@ class AnyObj { #define NEW_RESOURCE_OBJ_RETURN_NULL(type)\ NEW_RESOURCE_ARRAY_RETURN_NULL(type, 1) -#define NEW_C_HEAP_ARRAY3(type, size, memflags, pc, allocfail)\ - (type*) AllocateHeap((size) * sizeof(type), memflags, pc, allocfail) +#define NEW_C_HEAP_ARRAY3(type, size, mem_tag, pc, allocfail)\ + (type*) AllocateHeap((size) * sizeof(type), mem_tag, pc, allocfail) -#define NEW_C_HEAP_ARRAY2(type, size, memflags, pc)\ - (type*) (AllocateHeap((size) * sizeof(type), memflags, pc)) +#define NEW_C_HEAP_ARRAY2(type, size, mem_tag, pc)\ + (type*) (AllocateHeap((size) * sizeof(type), mem_tag, pc)) -#define NEW_C_HEAP_ARRAY(type, size, memflags)\ - (type*) (AllocateHeap((size) * sizeof(type), memflags)) +#define NEW_C_HEAP_ARRAY(type, size, mem_tag)\ + (type*) (AllocateHeap((size) * sizeof(type), mem_tag)) -#define NEW_C_HEAP_ARRAY2_RETURN_NULL(type, size, memflags, pc)\ - NEW_C_HEAP_ARRAY3(type, (size), memflags, pc, AllocFailStrategy::RETURN_NULL) +#define NEW_C_HEAP_ARRAY2_RETURN_NULL(type, size, mem_tag, pc)\ + NEW_C_HEAP_ARRAY3(type, (size), mem_tag, pc, AllocFailStrategy::RETURN_NULL) -#define NEW_C_HEAP_ARRAY_RETURN_NULL(type, size, memflags)\ - NEW_C_HEAP_ARRAY2(type, (size), memflags, AllocFailStrategy::RETURN_NULL) +#define NEW_C_HEAP_ARRAY_RETURN_NULL(type, size, mem_tag)\ + NEW_C_HEAP_ARRAY2(type, (size), mem_tag, AllocFailStrategy::RETURN_NULL) -#define REALLOC_C_HEAP_ARRAY(type, old, size, memflags)\ - (type*) (ReallocateHeap((char*)(old), (size) * sizeof(type), memflags)) +#define REALLOC_C_HEAP_ARRAY(type, old, size, mem_tag)\ + (type*) (ReallocateHeap((char*)(old), (size) * sizeof(type), mem_tag)) -#define REALLOC_C_HEAP_ARRAY_RETURN_NULL(type, old, size, memflags)\ - (type*) (ReallocateHeap((char*)(old), (size) * sizeof(type), memflags, AllocFailStrategy::RETURN_NULL)) +#define REALLOC_C_HEAP_ARRAY_RETURN_NULL(type, old, size, mem_tag)\ + (type*) (ReallocateHeap((char*)(old), (size) * sizeof(type), mem_tag, AllocFailStrategy::RETURN_NULL)) #define FREE_C_HEAP_ARRAY(type, old) \ FreeHeap((char*)(old)) // allocate type in heap without calling ctor -#define NEW_C_HEAP_OBJ(type, memflags)\ - NEW_C_HEAP_ARRAY(type, 1, memflags) +#define NEW_C_HEAP_OBJ(type, mem_tag)\ + NEW_C_HEAP_ARRAY(type, 1, mem_tag) -#define NEW_C_HEAP_OBJ_RETURN_NULL(type, memflags)\ - NEW_C_HEAP_ARRAY_RETURN_NULL(type, 1, memflags) +#define NEW_C_HEAP_OBJ_RETURN_NULL(type, mem_tag)\ + NEW_C_HEAP_ARRAY_RETURN_NULL(type, 1, mem_tag) // deallocate obj of type in heap without calling dtor #define FREE_C_HEAP_OBJ(objname)\ @@ -568,8 +568,8 @@ class MmapArrayAllocator : public AllStatic { static size_t size_for(size_t length); public: - static E* allocate_or_null(size_t length, MEMFLAGS flags); - static E* allocate(size_t length, MEMFLAGS flags); + static E* allocate_or_null(size_t length, MemTag mem_tag); + static E* allocate(size_t length, MemTag mem_tag); static void free(E* addr, size_t length); }; @@ -579,8 +579,8 @@ class MallocArrayAllocator : public AllStatic { public: static size_t size_for(size_t length); - static E* allocate(size_t length, MEMFLAGS flags); - static E* reallocate(E* addr, size_t new_length, MEMFLAGS flags); + static E* allocate(size_t length, MemTag mem_tag); + static E* reallocate(E* addr, size_t new_length, MemTag mem_tag); static void free(E* addr); }; diff --git a/src/hotspot/share/memory/allocation.inline.hpp b/src/hotspot/share/memory/allocation.inline.hpp index 4a1b0b0c5971b..8d531c6dd2318 100644 --- a/src/hotspot/share/memory/allocation.inline.hpp +++ b/src/hotspot/share/memory/allocation.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -55,10 +55,10 @@ size_t MmapArrayAllocator::size_for(size_t length) { } template -E* MmapArrayAllocator::allocate_or_null(size_t length, MEMFLAGS flags) { +E* MmapArrayAllocator::allocate_or_null(size_t length, MemTag mem_tag) { size_t size = size_for(length); - char* addr = os::reserve_memory(size, !ExecMem, flags); + char* addr = os::reserve_memory(size, !ExecMem, mem_tag); if (addr == nullptr) { return nullptr; } @@ -72,10 +72,10 @@ E* MmapArrayAllocator::allocate_or_null(size_t length, MEMFLAGS flags) { } template -E* MmapArrayAllocator::allocate(size_t length, MEMFLAGS flags) { +E* MmapArrayAllocator::allocate(size_t length, MemTag mem_tag) { size_t size = size_for(length); - char* addr = os::reserve_memory(size, !ExecMem, flags); + char* addr = os::reserve_memory(size, !ExecMem, mem_tag); if (addr == nullptr) { vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "Allocator (reserve)"); } @@ -97,13 +97,13 @@ size_t MallocArrayAllocator::size_for(size_t length) { } template -E* MallocArrayAllocator::allocate(size_t length, MEMFLAGS flags) { - return (E*)AllocateHeap(size_for(length), flags); +E* MallocArrayAllocator::allocate(size_t length, MemTag mem_tag) { + return (E*)AllocateHeap(size_for(length), mem_tag); } template -E* MallocArrayAllocator::reallocate(E* addr, size_t new_length, MEMFLAGS flags) { - return (E*)ReallocateHeap((char*)addr, size_for(new_length), flags); +E* MallocArrayAllocator::reallocate(E* addr, size_t new_length, MemTag mem_tag) { + return (E*)ReallocateHeap((char*)addr, size_for(new_length), mem_tag); } template diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp index 435a8cfdd584f..51d7cda9c61ec 100644 --- a/src/hotspot/share/memory/arena.cpp +++ b/src/hotspot/share/memory/arena.cpp @@ -222,8 +222,8 @@ void Chunk::next_chop(Chunk* k) { k->_next = nullptr; } -Arena::Arena(MEMFLAGS flag, Tag tag, size_t init_size) : - _flags(flag), _tag(tag), +Arena::Arena(MemTag mem_tag, Tag tag, size_t init_size) : + _mem_tag(mem_tag), _tag(tag), _size_in_bytes(0), _first(nullptr), _chunk(nullptr), _hwm(nullptr), _max(nullptr) @@ -233,13 +233,13 @@ Arena::Arena(MEMFLAGS flag, Tag tag, size_t init_size) : _first = _chunk; _hwm = _chunk->bottom(); // Save the cached hwm, max _max = _chunk->top(); - MemTracker::record_new_arena(flag); + MemTracker::record_new_arena(mem_tag); set_size_in_bytes(init_size); } Arena::~Arena() { destruct_contents(); - MemTracker::record_arena_free(_flags); + MemTracker::record_arena_free(_mem_tag); } // Destroy this arenas contents and reset to empty @@ -259,8 +259,8 @@ void Arena::set_size_in_bytes(size_t size) { if (_size_in_bytes != size) { ssize_t delta = size - size_in_bytes(); _size_in_bytes = size; - MemTracker::record_arena_size_change(delta, _flags); - if (CompilationMemoryStatistic::enabled() && _flags == mtCompiler) { + MemTracker::record_arena_size_change(delta, _mem_tag); + if (CompilationMemoryStatistic::enabled() && _mem_tag == mtCompiler) { Thread* const t = Thread::current(); if (t != nullptr && t->is_Compiler_thread()) { CompilationMemoryStatistic::on_arena_change(delta, this); @@ -286,7 +286,7 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) { // (Note: all chunk sizes have to be 64-bit aligned) size_t len = MAX2(ARENA_ALIGN(x), (size_t) Chunk::size); - if (MemTracker::check_exceeds_limit(x, _flags)) { + if (MemTracker::check_exceeds_limit(x, _mem_tag)) { return nullptr; } @@ -311,8 +311,6 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) { return result; } - - // Reallocate storage in Arena. void *Arena::Arealloc(void* old_ptr, size_t old_size, size_t new_size, AllocFailType alloc_failmode) { if (new_size == 0) { @@ -324,21 +322,21 @@ void *Arena::Arealloc(void* old_ptr, size_t old_size, size_t new_size, AllocFail return Amalloc(new_size, alloc_failmode); // as with realloc(3), a null old ptr is equivalent to malloc(3) } char *c_old = (char*)old_ptr; // Handy name - // Stupid fast special case - if( new_size <= old_size ) { // Shrink in-place - if( c_old+old_size == _hwm) // Attempt to free the excess bytes - _hwm = c_old+new_size; // Adjust hwm - return c_old; - } - // make sure that new_size is legal + // Make sure that new_size is legal size_t corrected_new_size = ARENA_ALIGN(new_size); - // See if we can resize in-place - if( (c_old+old_size == _hwm) && // Adjusting recent thing - (c_old+corrected_new_size <= _max) ) { // Still fits where it sits - _hwm = c_old+corrected_new_size; // Adjust hwm - return c_old; // Return old pointer + // Reallocating the latest allocation? + if (c_old + old_size == _hwm) { + assert(_chunk->bottom() <= c_old, "invariant"); + + // Reallocate in place if it fits. Also handles shrinking + if (pointer_delta(_max, c_old, 1) >= corrected_new_size) { + _hwm = c_old + corrected_new_size; + return c_old; + } + } else if (new_size <= old_size) { // Shrink in place + return c_old; } // Oops, got to relocate guts diff --git a/src/hotspot/share/memory/arena.hpp b/src/hotspot/share/memory/arena.hpp index 1f3c5eb4e8bac..5f0def2a6556d 100644 --- a/src/hotspot/share/memory/arena.hpp +++ b/src/hotspot/share/memory/arena.hpp @@ -107,7 +107,7 @@ class Arena : public CHeapObjBase { static const char* tag_desc[static_cast(Arena::Tag::tag_count)]; private: - const MEMFLAGS _flags; // Memory tracking flags + const MemTag _mem_tag; // Native Memory Tracking tag const Tag _tag; size_t _size_in_bytes; // Size of arena (used for native memory tracking) @@ -138,7 +138,7 @@ class Arena : public CHeapObjBase { public: // Start the chunk_pool cleaner task static void start_chunk_pool_cleaner_task(); - Arena(MEMFLAGS memflag, Tag tag = Tag::tag_other, size_t init_size = Chunk::init_size); + Arena(MemTag mem_tag, Tag tag = Tag::tag_other, size_t init_size = Chunk::init_size); ~Arena(); void destruct_contents(); char* hwm() const { return _hwm; } diff --git a/src/hotspot/share/memory/guardedMemory.cpp b/src/hotspot/share/memory/guardedMemory.cpp index 7b676d725882a..12ffde3cc1b94 100644 --- a/src/hotspot/share/memory/guardedMemory.cpp +++ b/src/hotspot/share/memory/guardedMemory.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" #include "memory/guardedMemory.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "runtime/os.hpp" void* GuardedMemory::wrap_copy(const void* ptr, const size_t len, const void* tag) { diff --git a/src/hotspot/share/memory/heap.cpp b/src/hotspot/share/memory/heap.cpp index 98e59f5818432..658ec3e8de773 100644 --- a/src/hotspot/share/memory/heap.cpp +++ b/src/hotspot/share/memory/heap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -232,7 +232,7 @@ bool CodeHeap::reserve(ReservedSpace rs, size_t committed_size, size_t segment_s return false; } - MemTracker::record_virtual_memory_type((address)_segmap.low_boundary(), mtCode); + MemTracker::record_virtual_memory_tag((address)_segmap.low_boundary(), mtCode); assert(_segmap.committed_size() >= (size_t) _number_of_committed_segments, "could not commit enough space for segment map"); assert(_segmap.reserved_size() >= (size_t) _number_of_reserved_segments , "could not reserve enough space for segment map"); diff --git a/src/hotspot/share/memory/memRegion.cpp b/src/hotspot/share/memory/memRegion.cpp index 7dd7e1be4ab05..d6565b0032442 100644 --- a/src/hotspot/share/memory/memRegion.cpp +++ b/src/hotspot/share/memory/memRegion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -102,8 +102,8 @@ MemRegion MemRegion::minus(const MemRegion mr2) const { return MemRegion(); } -MemRegion* MemRegion::create_array(size_t length, MEMFLAGS flags) { - MemRegion* result = NEW_C_HEAP_ARRAY(MemRegion, length, flags); +MemRegion* MemRegion::create_array(size_t length, MemTag mem_tag) { + MemRegion* result = NEW_C_HEAP_ARRAY(MemRegion, length, mem_tag); for (size_t i = 0; i < length; i++) { ::new (&result[i]) MemRegion(); } diff --git a/src/hotspot/share/memory/memRegion.hpp b/src/hotspot/share/memory/memRegion.hpp index 5d3d635c650cd..920efe7528844 100644 --- a/src/hotspot/share/memory/memRegion.hpp +++ b/src/hotspot/share/memory/memRegion.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -90,7 +90,7 @@ class MemRegion { bool is_empty() const { return word_size() == 0; } // Creates and initializes an array of MemRegions of the given length. - static MemRegion* create_array(size_t length, MEMFLAGS flags); + static MemRegion* create_array(size_t length, MemTag mem_tag); static void destroy_array(MemRegion* array, size_t length); }; diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index 2674278ec9939..f86be4774d5ab 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -772,7 +772,7 @@ void Metaspace::global_initialize() { } // Mark class space as such - MemTracker::record_virtual_memory_type((address)rs.base(), mtClass); + MemTracker::record_virtual_memory_tag((address)rs.base(), mtClass); // Initialize space Metaspace::initialize_class_space(rs); diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp index a8afbc130c968..83a591e4cad8a 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp @@ -259,7 +259,7 @@ VirtualSpaceNode* VirtualSpaceNode::create_node(size_t word_size, if (!rs.is_reserved()) { vm_exit_out_of_memory(word_size * BytesPerWord, OOM_MMAP_ERROR, "Failed to reserve memory for metaspace"); } - MemTracker::record_virtual_memory_type(rs.base(), mtMetaspace); + MemTracker::record_virtual_memory_tag(rs.base(), mtMetaspace); assert_is_aligned(rs.base(), chunklevel::MAX_CHUNK_BYTE_SIZE); InternalStats::inc_num_vsnodes_births(); return new VirtualSpaceNode(rs, true, limiter, reserve_words_counter, commit_words_counter); diff --git a/src/hotspot/share/memory/padded.hpp b/src/hotspot/share/memory/padded.hpp index bca1d168cb5ae..7e0e06152081e 100644 --- a/src/hotspot/share/memory/padded.hpp +++ b/src/hotspot/share/memory/padded.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_MEMORY_PADDED_HPP #define SHARE_MEMORY_PADDED_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/align.hpp" #include "utilities/globalDefinitions.hpp" @@ -89,7 +89,7 @@ class PaddedEnd : public PaddedEndImpl { // Helper class to create an array of PaddedEnd objects. All elements will // start at a multiple of alignment and the size will be aligned to alignment. -template +template class PaddedArray { public: // Creates an aligned padded array. @@ -100,7 +100,7 @@ class PaddedArray { // Helper class to create an array of references to arrays of primitive types // Both the array of references and the data arrays are aligned to the given // alignment. The allocated memory is zero-filled. -template +template class Padded2DArray { public: // Creates an aligned padded 2D array. @@ -112,7 +112,7 @@ class Padded2DArray { // Helper class to create an array of T objects. The array as a whole will // start at a multiple of alignment and its size will be aligned to alignment. -template +template class PaddedPrimitiveArray { public: static T* create_unfreeable(size_t length); diff --git a/src/hotspot/share/memory/padded.inline.hpp b/src/hotspot/share/memory/padded.inline.hpp index 72001e3aad6d2..ba477bfe88f04 100644 --- a/src/hotspot/share/memory/padded.inline.hpp +++ b/src/hotspot/share/memory/padded.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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,13 +34,13 @@ // Creates an aligned padded array. // The memory can't be deleted since the raw memory chunk is not returned. -template -PaddedEnd* PaddedArray::create_unfreeable(uint length) { +template +PaddedEnd* PaddedArray::create_unfreeable(uint length) { // Check that the PaddedEnd class works as intended. STATIC_ASSERT(is_aligned(sizeof(PaddedEnd), alignment)); // Allocate a chunk of memory large enough to allow for some alignment. - void* chunk = AllocateHeap(length * sizeof(PaddedEnd) + alignment, flags); + void* chunk = AllocateHeap(length * sizeof(PaddedEnd) + alignment, MT); // Make the initial alignment. PaddedEnd* aligned_padded_array = (PaddedEnd*)align_up(chunk, alignment); @@ -53,8 +53,8 @@ PaddedEnd* PaddedArray::create_unfreeable(uint length) { return aligned_padded_array; } -template -T** Padded2DArray::create_unfreeable(uint rows, uint columns, size_t* allocation_size) { +template +T** Padded2DArray::create_unfreeable(uint rows, uint columns, size_t* allocation_size) { // Calculate and align the size of the first dimension's table. size_t table_size = align_up(rows * sizeof(T*), alignment); // The size of the separate rows. @@ -63,7 +63,7 @@ T** Padded2DArray::create_unfreeable(uint rows, uint column size_t total_size = table_size + rows * row_size + alignment; // Allocate a chunk of memory large enough to allow alignment of the chunk. - void* chunk = MmapArrayAllocator::allocate(total_size, flags); + void* chunk = MmapArrayAllocator::allocate(total_size, MT); // Clear the allocated memory. // Align the chunk of memory. T** result = (T**)align_up(chunk, alignment); @@ -81,16 +81,16 @@ T** Padded2DArray::create_unfreeable(uint rows, uint column return result; } -template -T* PaddedPrimitiveArray::create_unfreeable(size_t length) { +template +T* PaddedPrimitiveArray::create_unfreeable(size_t length) { void* temp; return create(length, &temp); } -template -T* PaddedPrimitiveArray::create(size_t length, void** alloc_base) { +template +T* PaddedPrimitiveArray::create(size_t length, void** alloc_base) { // Allocate a chunk of memory large enough to allow for some alignment. - void* chunk = AllocateHeap(length * sizeof(T) + alignment, flags); + void* chunk = AllocateHeap(length * sizeof(T) + alignment, MT); memset(chunk, 0, length * sizeof(T) + alignment); diff --git a/src/hotspot/share/memory/resourceArea.hpp b/src/hotspot/share/memory/resourceArea.hpp index 5fd376068c5b3..b9a1904b5078c 100644 --- a/src/hotspot/share/memory/resourceArea.hpp +++ b/src/hotspot/share/memory/resourceArea.hpp @@ -51,11 +51,11 @@ class ResourceArea: public Arena { #endif // ASSERT public: - ResourceArea(MEMFLAGS flags = mtThread) : - Arena(flags, Arena::Tag::tag_ra) DEBUG_ONLY(COMMA _nesting(0)) {} + ResourceArea(MemTag mem_tag = mtThread) : + Arena(mem_tag, Arena::Tag::tag_ra) DEBUG_ONLY(COMMA _nesting(0)) {} - ResourceArea(size_t init_size, MEMFLAGS flags = mtThread) : - Arena(flags, Arena::Tag::tag_ra, init_size) DEBUG_ONLY(COMMA _nesting(0)) { + ResourceArea(size_t init_size, MemTag mem_tag = mtThread) : + Arena(mem_tag, Arena::Tag::tag_ra, init_size) DEBUG_ONLY(COMMA _nesting(0)) { } char* allocate_bytes(size_t size, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index 8f20f331235ff..4b6554173f994 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -229,6 +229,9 @@ class BuiltinException { static BuiltinException _null_ptr_exception; static BuiltinException _arithmetic_exception; static BuiltinException _internal_error; +static BuiltinException _array_index_out_of_bounds_exception; +static BuiltinException _array_store_exception; +static BuiltinException _class_cast_exception; objArrayOop Universe::the_empty_class_array () { return (objArrayOop)_the_empty_class_array.resolve(); @@ -246,6 +249,9 @@ oop Universe::the_min_jint_string() { return _the_min_jint_string. oop Universe::null_ptr_exception_instance() { return _null_ptr_exception.instance(); } oop Universe::arithmetic_exception_instance() { return _arithmetic_exception.instance(); } oop Universe::internal_error_instance() { return _internal_error.instance(); } +oop Universe::array_index_out_of_bounds_exception_instance() { return _array_index_out_of_bounds_exception.instance(); } +oop Universe::array_store_exception_instance() { return _array_store_exception.instance(); } +oop Universe::class_cast_exception_instance() { return _class_cast_exception.instance(); } oop Universe::the_null_sentinel() { return _the_null_sentinel.resolve(); } @@ -302,6 +308,9 @@ void Universe::archive_exception_instances() { _null_ptr_exception.store_in_cds(); _arithmetic_exception.store_in_cds(); _internal_error.store_in_cds(); + _array_index_out_of_bounds_exception.store_in_cds(); + _array_store_exception.store_in_cds(); + _class_cast_exception.store_in_cds(); } void Universe::load_archived_object_instances() { @@ -318,6 +327,9 @@ void Universe::load_archived_object_instances() { _null_ptr_exception.load_from_cds(); _arithmetic_exception.load_from_cds(); _internal_error.load_from_cds(); + _array_index_out_of_bounds_exception.load_from_cds(); + _array_store_exception.load_from_cds(); + _class_cast_exception.load_from_cds(); } } #endif @@ -334,6 +346,9 @@ void Universe::serialize(SerializeClosure* f) { _null_ptr_exception.serialize(f); _arithmetic_exception.serialize(f); _internal_error.serialize(f); + _array_index_out_of_bounds_exception.serialize(f); + _array_store_exception.serialize(f); + _class_cast_exception.serialize(f); #endif f->do_ptr(&_fillerArrayKlass); @@ -1083,10 +1098,12 @@ bool universe_post_init() { Universe::_delayed_stack_overflow_error_message = OopHandle(Universe::vm_global(), instance); } - // Setup preallocated NullPointerException/ArithmeticException - // (used for a cheap & dirty solution in compiler exception handling) + // Setup preallocated exceptions used for a cheap & dirty solution in compiler exception handling _null_ptr_exception.init_if_empty(vmSymbols::java_lang_NullPointerException(), CHECK_false); _arithmetic_exception.init_if_empty(vmSymbols::java_lang_ArithmeticException(), CHECK_false); + _array_index_out_of_bounds_exception.init_if_empty(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), CHECK_false); + _array_store_exception.init_if_empty(vmSymbols::java_lang_ArrayStoreException(), CHECK_false); + _class_cast_exception.init_if_empty(vmSymbols::java_lang_ClassCastException(), CHECK_false); // Virtual Machine Error for when we get into a situation we can't resolve Klass* k = vmClasses::InternalError_klass(); diff --git a/src/hotspot/share/memory/universe.hpp b/src/hotspot/share/memory/universe.hpp index c7bdb8f233970..0a3b9eaae01eb 100644 --- a/src/hotspot/share/memory/universe.hpp +++ b/src/hotspot/share/memory/universe.hpp @@ -230,6 +230,9 @@ class Universe: AllStatic { static oop null_ptr_exception_instance(); static oop arithmetic_exception_instance(); static oop internal_error_instance(); + static oop array_index_out_of_bounds_exception_instance(); + static oop array_store_exception_instance(); + static oop class_cast_exception_instance(); static oop vm_exception() { return internal_error_instance(); } static Array* the_array_interfaces_array() { return _the_array_interfaces_array; } diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index c27e607353af1..0cc81ce85a617 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -653,7 +653,7 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, size_t page_ "area must be distinguishable from marks for mark-sweep"); if (base() != nullptr) { - MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); + MemTracker::record_virtual_memory_tag((address)base(), mtJavaHeap); } if (_fd_for_heap != -1) { @@ -671,7 +671,7 @@ ReservedCodeSpace::ReservedCodeSpace(size_t r_size, size_t rs_align, size_t rs_page_size) : ReservedSpace() { initialize(r_size, rs_align, rs_page_size, /*requested address*/ nullptr, /*executable*/ true); - MemTracker::record_virtual_memory_type((address)base(), mtCode); + MemTracker::record_virtual_memory_tag((address)base(), mtCode); } // VirtualSpace diff --git a/src/hotspot/share/nmt/allocationSite.hpp b/src/hotspot/share/nmt/allocationSite.hpp index 022fb6f4390d8..a7bc2e962501c 100644 --- a/src/hotspot/share/nmt/allocationSite.hpp +++ b/src/hotspot/share/nmt/allocationSite.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_NMT_ALLOCATIONSITE_HPP #define SHARE_NMT_ALLOCATIONSITE_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/nativeCallStack.hpp" // Allocation site represents a code path that makes a memory @@ -33,9 +33,9 @@ class AllocationSite { private: const NativeCallStack _call_stack; - const MEMFLAGS _flag; + const MemTag _mem_tag; public: - AllocationSite(const NativeCallStack& stack, MEMFLAGS flag) : _call_stack(stack), _flag(flag) { } + AllocationSite(const NativeCallStack& stack, MemTag mem_tag) : _call_stack(stack), _mem_tag(mem_tag) { } bool equals(const NativeCallStack& stack) const { return _call_stack.equals(stack); @@ -49,7 +49,7 @@ class AllocationSite { return &_call_stack; } - MEMFLAGS flag() const { return _flag; } + MemTag mem_tag() const { return _mem_tag; } }; #endif // SHARE_NMT_ALLOCATIONSITE_HPP diff --git a/src/hotspot/share/nmt/arrayWithFreeList.hpp b/src/hotspot/share/nmt/arrayWithFreeList.hpp index 13aa1045fe7cb..2c1812dcc5283 100644 --- a/src/hotspot/share/nmt/arrayWithFreeList.hpp +++ b/src/hotspot/share/nmt/arrayWithFreeList.hpp @@ -31,7 +31,7 @@ // A flat array of elements E, backed by C-heap, growing on-demand. It allows for // returning arbitrary elements and keeps them in a freelist. Elements can be uniquely // identified via array index. -template +template class ArrayWithFreeList { // An E must be trivially copyable and destructible, but it may be constructed @@ -52,7 +52,7 @@ class ArrayWithFreeList { E e; }; - GrowableArrayCHeap _backing_storage; + GrowableArrayCHeap _backing_storage; I _free_start; bool is_in_bounds(I i) { diff --git a/src/hotspot/share/nmt/mallocHeader.cpp b/src/hotspot/share/nmt/mallocHeader.cpp index d5a7b689c2a48..defe2fc045d41 100644 --- a/src/hotspot/share/nmt/mallocHeader.cpp +++ b/src/hotspot/share/nmt/mallocHeader.cpp @@ -26,16 +26,16 @@ #include "nmt/mallocHeader.inline.hpp" #include "nmt/mallocSiteTable.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "runtime/os.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/nativeCallStack.hpp" #include "utilities/ostream.hpp" -// The malloc header, as well as the coming VMATree implementation, rely on MEMFLAGS +// The malloc header, as well as the coming VMATree implementation, rely on MemTag // fitting into eight bits. -STATIC_ASSERT(sizeof(MEMFLAGS) == sizeof(uint8_t)); +STATIC_ASSERT(sizeof(MemTag) == sizeof(uint8_t)); void MallocHeader::print_block_on_error(outputStream* st, address bad_address) const { assert(bad_address >= (address)this, "sanity"); diff --git a/src/hotspot/share/nmt/mallocHeader.hpp b/src/hotspot/share/nmt/mallocHeader.hpp index 9f9f7f97ea7f5..c76e61fb4b5a2 100644 --- a/src/hotspot/share/nmt/mallocHeader.hpp +++ b/src/hotspot/share/nmt/mallocHeader.hpp @@ -26,7 +26,7 @@ #ifndef SHARE_NMT_MALLOCHEADER_HPP #define SHARE_NMT_MALLOCHEADER_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/nativeCallStack.hpp" @@ -92,7 +92,7 @@ class MallocHeader { NOT_LP64(uint32_t _alt_canary); const size_t _size; const uint32_t _mst_marker; - const MEMFLAGS _flags; + const MemTag _mem_tag; const uint8_t _unused; uint16_t _canary; @@ -121,19 +121,19 @@ class MallocHeader { // Contains all of the necessary data to to deaccount block with NMT. struct FreeInfo { const size_t size; - const MEMFLAGS flags; + const MemTag mem_tag; const uint32_t mst_marker; }; - inline MallocHeader(size_t size, MEMFLAGS flags, uint32_t mst_marker); + inline MallocHeader(size_t size, MemTag mem_tag, uint32_t mst_marker); - inline size_t size() const { return _size; } - inline MEMFLAGS flags() const { return _flags; } + inline size_t size() const { return _size; } + inline MemTag mem_tag() const { return _mem_tag; } inline uint32_t mst_marker() const { return _mst_marker; } // Return the necessary data to deaccount the block with NMT. FreeInfo free_info() { - return FreeInfo{this->size(), this->flags(), this->mst_marker()}; + return FreeInfo{this->size(), this->mem_tag(), this->mst_marker()}; } inline void mark_block_as_dead(); inline void revive(); diff --git a/src/hotspot/share/nmt/mallocHeader.inline.hpp b/src/hotspot/share/nmt/mallocHeader.inline.hpp index d763241b36d8c..34ec891d33f78 100644 --- a/src/hotspot/share/nmt/mallocHeader.inline.hpp +++ b/src/hotspot/share/nmt/mallocHeader.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -34,8 +34,8 @@ #include "utilities/macros.hpp" #include "utilities/nativeCallStack.hpp" -inline MallocHeader::MallocHeader(size_t size, MEMFLAGS flags, uint32_t mst_marker) - : _size(size), _mst_marker(mst_marker), _flags(flags), +inline MallocHeader::MallocHeader(size_t size, MemTag mem_tag, uint32_t mst_marker) + : _size(size), _mst_marker(mst_marker), _mem_tag(mem_tag), _unused(0), _canary(_header_canary_live_mark) { assert(size < max_reasonable_malloc_size, "Too large allocation size?"); diff --git a/src/hotspot/share/nmt/mallocLimit.cpp b/src/hotspot/share/nmt/mallocLimit.cpp index 746c3b9201bd9..5e16a406821ea 100644 --- a/src/hotspot/share/nmt/mallocLimit.cpp +++ b/src/hotspot/share/nmt/mallocLimit.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "nmt/mallocLimit.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/nmtCommon.hpp" #include "runtime/java.hpp" #include "runtime/globals.hpp" @@ -80,7 +80,7 @@ class ParserHelper { // Check if string at position matches a category name. // Advances position on match. - bool match_category(MEMFLAGS* out) { + bool match_category(MemTag* out) { if (eof()) { return false; } @@ -90,9 +90,9 @@ class ParserHelper { } stringStream ss; ss.print("%.*s", (int)(end - _p), _p); - MEMFLAGS f = NMTUtil::string_to_flag(ss.base()); - if (f != mtNone) { - *out = f; + MemTag mem_tag = NMTUtil::string_to_mem_tag(ss.base()); + if (mem_tag != mtNone) { + *out = mem_tag; _p = end; return true; } @@ -131,16 +131,16 @@ void MallocLimitSet::set_global_limit(size_t s, MallocLimitMode flag) { _glob.sz = s; _glob.mode = flag; } -void MallocLimitSet::set_category_limit(MEMFLAGS f, size_t s, MallocLimitMode flag) { - const int i = NMTUtil::flag_to_index(f); +void MallocLimitSet::set_category_limit(MemTag mem_tag, size_t s, MallocLimitMode flag) { + const int i = NMTUtil::tag_to_index(mem_tag); _cat[i].sz = s; _cat[i].mode = flag; } void MallocLimitSet::reset() { set_global_limit(0, MallocLimitMode::trigger_fatal); _glob.sz = 0; _glob.mode = MallocLimitMode::trigger_fatal; - for (int i = 0; i < mt_number_of_types; i++) { - set_category_limit(NMTUtil::index_to_flag(i), 0, MallocLimitMode::trigger_fatal); + for (int i = 0; i < mt_number_of_tags; i++) { + set_category_limit(NMTUtil::index_to_tag(i), 0, MallocLimitMode::trigger_fatal); } } @@ -150,10 +150,10 @@ void MallocLimitSet::print_on(outputStream* st) const { st->print_cr("MallocLimit: total limit: " PROPERFMT " (%s)", PROPERFMTARGS(_glob.sz), mode_to_name(_glob.mode)); } else { - for (int i = 0; i < mt_number_of_types; i++) { + for (int i = 0; i < mt_number_of_tags; i++) { if (_cat[i].sz > 0) { st->print_cr("MallocLimit: category \"%s\" limit: " PROPERFMT " (%s)", - NMTUtil::flag_to_enum_name(NMTUtil::index_to_flag(i)), + NMTUtil::tag_to_enum_name(NMTUtil::index_to_tag(i)), PROPERFMTARGS(_cat[i].sz), mode_to_name(_cat[i].mode)); } } @@ -187,13 +187,13 @@ bool MallocLimitSet::parse_malloclimit_option(const char* v, const char** err) { // Category-specific form? else { while (!sst.eof()) { - MEMFLAGS f; + MemTag mem_tag; // Match category, followed by : - BAIL_UNLESS(sst.match_category(&f), "Expected category name"); + BAIL_UNLESS(sst.match_category(&mem_tag), "Expected category name"); BAIL_UNLESS(sst.match_char(':'), "Expected colon following category"); - malloclimit* const modified_limit = &_cat[NMTUtil::flag_to_index(f)]; + malloclimit* const modified_limit = &_cat[NMTUtil::tag_to_index(mem_tag)]; // Match size BAIL_UNLESS(sst.match_size(&modified_limit->sz), "Expected size"); diff --git a/src/hotspot/share/nmt/mallocLimit.hpp b/src/hotspot/share/nmt/mallocLimit.hpp index 2034e3ce24b77..ec6799b41a392 100644 --- a/src/hotspot/share/nmt/mallocLimit.hpp +++ b/src/hotspot/share/nmt/mallocLimit.hpp @@ -27,7 +27,7 @@ #define SHARE_SERVICES_MALLOCLIMIT_HPP #include "memory/allStatic.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" @@ -46,18 +46,18 @@ class outputStream; class MallocLimitSet { malloclimit _glob; // global limit - malloclimit _cat[mt_number_of_types]; // per-category limit + malloclimit _cat[mt_number_of_tags]; // per-category limit public: MallocLimitSet(); void reset(); bool parse_malloclimit_option(const char* optionstring, const char** err); - void set_global_limit(size_t s, MallocLimitMode flag); - void set_category_limit(MEMFLAGS f, size_t s, MallocLimitMode flag); + void set_global_limit(size_t s, MallocLimitMode type); + void set_category_limit(MemTag mem_tag, size_t s, MallocLimitMode mode); const malloclimit* global_limit() const { return &_glob; } - const malloclimit* category_limit(MEMFLAGS f) const { return &_cat[(int)f]; } + const malloclimit* category_limit(MemTag mem_tag) const { return &_cat[(int)mem_tag]; } void print_on(outputStream* st) const; }; @@ -69,7 +69,7 @@ class MallocLimitHandler : public AllStatic { public: static const malloclimit* global_limit() { return _limits.global_limit(); } - static const malloclimit* category_limit(MEMFLAGS f) { return _limits.category_limit(f); } + static const malloclimit* category_limit(MemTag mem_tag) { return _limits.category_limit(mem_tag); } static void initialize(const char* options); static void print_on(outputStream* st); diff --git a/src/hotspot/share/nmt/mallocSiteTable.cpp b/src/hotspot/share/nmt/mallocSiteTable.cpp index 0fdf9e0f83dcc..9411f76c491ac 100644 --- a/src/hotspot/share/nmt/mallocSiteTable.cpp +++ b/src/hotspot/share/nmt/mallocSiteTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -111,15 +111,15 @@ bool MallocSiteTable::walk(MallocSiteWalker* walker) { * 2. Overflow hash bucket. * Under any of above circumstances, caller should handle the situation. */ -MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, uint32_t* marker, MEMFLAGS flags) { - assert(flags != mtNone, "Should have a real memory type"); +MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, uint32_t* marker, MemTag mem_tag) { + assert(mem_tag != mtNone, "Should have a real memory tag"); const unsigned int hash = key.calculate_hash(); const unsigned int index = hash_to_index(hash); *marker = 0; // First entry for this hash bucket if (_table[index] == nullptr) { - MallocSiteHashtableEntry* entry = new_entry(key, flags); + MallocSiteHashtableEntry* entry = new_entry(key, mem_tag); // OOM check if (entry == nullptr) return nullptr; @@ -137,14 +137,14 @@ MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, uint32_t* while (head != nullptr && pos_idx < MAX_BUCKET_LENGTH) { if (head->hash() == hash) { MallocSite* site = head->data(); - if (site->flag() == flags && site->equals(key)) { + if (site->mem_tag() == mem_tag && site->equals(key)) { *marker = build_marker(index, pos_idx); return head->data(); } } if (head->next() == nullptr && pos_idx < (MAX_BUCKET_LENGTH - 1)) { - MallocSiteHashtableEntry* entry = new_entry(key, flags); + MallocSiteHashtableEntry* entry = new_entry(key, mem_tag); // OOM check if (entry == nullptr) return nullptr; if (head->atomic_insert(entry)) { @@ -177,10 +177,10 @@ MallocSite* MallocSiteTable::malloc_site(uint32_t marker) { // Allocates MallocSiteHashtableEntry object. Special call stack // (pre-installed allocation site) has to be used to avoid infinite // recursion. -MallocSiteHashtableEntry* MallocSiteTable::new_entry(const NativeCallStack& key, MEMFLAGS flags) { +MallocSiteHashtableEntry* MallocSiteTable::new_entry(const NativeCallStack& key, MemTag mem_tag) { void* p = AllocateHeap(sizeof(MallocSiteHashtableEntry), mtNMT, *hash_entry_allocation_stack(), AllocFailStrategy::RETURN_NULL); - return ::new (p) MallocSiteHashtableEntry(key, flags); + return ::new (p) MallocSiteHashtableEntry(key, mem_tag); } bool MallocSiteTable::walk_malloc_site(MallocSiteWalker* walker) { diff --git a/src/hotspot/share/nmt/mallocSiteTable.hpp b/src/hotspot/share/nmt/mallocSiteTable.hpp index ae9266f5369a0..472bc397dd49e 100644 --- a/src/hotspot/share/nmt/mallocSiteTable.hpp +++ b/src/hotspot/share/nmt/mallocSiteTable.hpp @@ -38,8 +38,8 @@ class MallocSite : public AllocationSite { MemoryCounter _c; public: - MallocSite(const NativeCallStack& stack, MEMFLAGS flags) : - AllocationSite(stack, flags) {} + MallocSite(const NativeCallStack& stack, MemTag mem_tag) : + AllocationSite(stack, mem_tag) {} void allocate(size_t size) { _c.allocate(size); } void deallocate(size_t size) { _c.deallocate(size); } @@ -63,9 +63,9 @@ class MallocSiteHashtableEntry : public CHeapObj { public: - MallocSiteHashtableEntry(NativeCallStack stack, MEMFLAGS flags): - _malloc_site(stack, flags), _hash(stack.calculate_hash()), _next(nullptr) { - assert(flags != mtNone, "Expect a real memory type"); + MallocSiteHashtableEntry(NativeCallStack stack, MemTag mem_tag): + _malloc_site(stack, mem_tag), _hash(stack.calculate_hash()), _next(nullptr) { + assert(mem_tag != mtNone, "Expect a real memory tag"); } inline const MallocSiteHashtableEntry* next() const { @@ -147,8 +147,8 @@ class MallocSiteTable : AllStatic { // 1. out of memory // 2. overflow hash bucket static inline bool allocation_at(const NativeCallStack& stack, size_t size, - uint32_t* marker, MEMFLAGS flags) { - MallocSite* site = lookup_or_add(stack, marker, flags); + uint32_t* marker, MemTag mem_tag) { + MallocSite* site = lookup_or_add(stack, marker, mem_tag); if (site != nullptr) site->allocate(size); return site != nullptr; } @@ -170,9 +170,9 @@ class MallocSiteTable : AllStatic { static void print_tuning_statistics(outputStream* st); private: - static MallocSiteHashtableEntry* new_entry(const NativeCallStack& key, MEMFLAGS flags); + static MallocSiteHashtableEntry* new_entry(const NativeCallStack& key, MemTag mem_tag); - static MallocSite* lookup_or_add(const NativeCallStack& key, uint32_t* marker, MEMFLAGS flags); + static MallocSite* lookup_or_add(const NativeCallStack& key, uint32_t* marker, MemTag mem_tag); static MallocSite* malloc_site(uint32_t marker); static bool walk(MallocSiteWalker* walker); diff --git a/src/hotspot/share/nmt/mallocTracker.cpp b/src/hotspot/share/nmt/mallocTracker.cpp index 021ce5d1332b1..6829db90b4bc1 100644 --- a/src/hotspot/share/nmt/mallocTracker.cpp +++ b/src/hotspot/share/nmt/mallocTracker.cpp @@ -69,7 +69,7 @@ void MallocMemorySnapshot::copy_to(MallocMemorySnapshot* s) { s->_all_mallocs = _all_mallocs; size_t total_size = 0; size_t total_count = 0; - for (int index = 0; index < mt_number_of_types; index ++) { + for (int index = 0; index < mt_number_of_tags; index ++) { s->_malloc[index] = _malloc[index]; total_size += s->_malloc[index].malloc_size(); total_count += s->_malloc[index].malloc_count(); @@ -81,7 +81,7 @@ void MallocMemorySnapshot::copy_to(MallocMemorySnapshot* s) { // Total malloc'd memory used by arenas size_t MallocMemorySnapshot::total_arena() const { size_t amount = 0; - for (int index = 0; index < mt_number_of_types; index ++) { + for (int index = 0; index < mt_number_of_tags; index ++) { amount += _malloc[index].arena_size(); } return amount; @@ -91,7 +91,7 @@ size_t MallocMemorySnapshot::total_arena() const { // from total chunks to get total free chunk size void MallocMemorySnapshot::make_adjustment() { size_t arena_size = total_arena(); - int chunk_idx = NMTUtil::flag_to_index(mtChunk); + int chunk_idx = NMTUtil::tag_to_index(mtChunk); _malloc[chunk_idx].record_free(arena_size); _all_mallocs.deallocate(arena_size); } @@ -128,11 +128,11 @@ bool MallocMemorySummary::total_limit_reached(size_t s, size_t so_far, const mal return true; } -bool MallocMemorySummary::category_limit_reached(MEMFLAGS f, size_t s, size_t so_far, const malloclimit* limit) { +bool MallocMemorySummary::category_limit_reached(MemTag mem_tag, size_t s, size_t so_far, const malloclimit* limit) { #define FORMATTED \ "MallocLimit: reached category \"%s\" limit (triggering allocation size: " PROPERFMT ", allocated so far: " PROPERFMT ", limit: " PROPERFMT ") ", \ - NMTUtil::flag_to_enum_name(f), PROPERFMTARGS(s), PROPERFMTARGS(so_far), PROPERFMTARGS(limit->sz) + NMTUtil::tag_to_enum_name(mem_tag), PROPERFMTARGS(s), PROPERFMTARGS(so_far), PROPERFMTARGS(limit->sz) // If we hit the limit during error reporting, we print a short warning but otherwise ignore it. // We don't want to risk recursive assertion or torn hs-err logs. @@ -167,20 +167,20 @@ bool MallocTracker::initialize(NMT_TrackingLevel level) { } // Record a malloc memory allocation -void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, +void* MallocTracker::record_malloc(void* malloc_base, size_t size, MemTag mem_tag, const NativeCallStack& stack) { assert(MemTracker::enabled(), "precondition"); assert(malloc_base != nullptr, "precondition"); - MallocMemorySummary::record_malloc(size, flags); + MallocMemorySummary::record_malloc(size, mem_tag); uint32_t mst_marker = 0; if (MemTracker::tracking_level() == NMT_detail) { - MallocSiteTable::allocation_at(stack, size, &mst_marker, flags); + MallocSiteTable::allocation_at(stack, size, &mst_marker, mem_tag); } // Uses placement global new operator to initialize malloc header - MallocHeader* const header = ::new (malloc_base)MallocHeader(size, flags, mst_marker); + MallocHeader* const header = ::new (malloc_base)MallocHeader(size, mem_tag, mst_marker); void* const memblock = (void*)((char*)malloc_base + sizeof(MallocHeader)); // The alignment check: 8 bytes alignment for 32 bit systems. @@ -192,7 +192,7 @@ void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flag { const MallocHeader* header2 = MallocHeader::resolve_checked(memblock); assert(header2->size() == size, "Wrong size"); - assert(header2->flags() == flags, "Wrong flags"); + assert(header2->mem_tag() == mem_tag, "Wrong memory tag"); } #endif @@ -213,7 +213,7 @@ void* MallocTracker::record_free_block(void* memblock) { } void MallocTracker::deaccount(MallocHeader::FreeInfo free_info) { - MallocMemorySummary::record_free(free_info.size, free_info.flags); + MallocMemorySummary::record_free(free_info.size, free_info.mem_tag); if (MemTracker::tracking_level() == NMT_detail) { MallocSiteTable::deallocation_at(free_info.size, free_info.mst_marker); } @@ -296,7 +296,7 @@ bool MallocTracker::print_pointer_information(const void* p, outputStream* st) { p2i(p), where, (block->is_dead() ? "dead" : "live"), p2i(block + 1), // lets print the payload start, not the header - block->size(), NMTUtil::flag_to_enum_name(block->flags())); + block->size(), NMTUtil::tag_to_enum_name(block->mem_tag())); if (MemTracker::tracking_level() == NMT_detail) { NativeCallStack ncs; if (MallocSiteTable::access_stack(ncs, *block)) { diff --git a/src/hotspot/share/nmt/mallocTracker.hpp b/src/hotspot/share/nmt/mallocTracker.hpp index 9c14ea04bf0f2..39d120433ef02 100644 --- a/src/hotspot/share/nmt/mallocTracker.hpp +++ b/src/hotspot/share/nmt/mallocTracker.hpp @@ -27,7 +27,7 @@ #define SHARE_NMT_MALLOCTRACKER_HPP #include "nmt/mallocHeader.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/nmtCommon.hpp" #include "runtime/atomic.hpp" #include "runtime/threadCritical.hpp" @@ -150,18 +150,18 @@ class MallocMemorySnapshot { friend class MallocMemorySummary; private: - MallocMemory _malloc[mt_number_of_types]; + MallocMemory _malloc[mt_number_of_tags]; MemoryCounter _all_mallocs; public: - inline MallocMemory* by_type(MEMFLAGS flags) { - int index = NMTUtil::flag_to_index(flags); + inline MallocMemory* by_type(MemTag mem_tag) { + int index = NMTUtil::tag_to_index(mem_tag); return &_malloc[index]; } - inline const MallocMemory* by_type(MEMFLAGS flags) const { - int index = NMTUtil::flag_to_index(flags); + inline const MallocMemory* by_type(MemTag mem_tag) const { + int index = NMTUtil::tag_to_index(mem_tag); return &_malloc[index]; } @@ -214,31 +214,31 @@ class MallocMemorySummary : AllStatic { // Called when a total limit break was detected. // Will return true if the limit was handled, false if it was ignored. - static bool category_limit_reached(MEMFLAGS f, size_t s, size_t so_far, const malloclimit* limit); + static bool category_limit_reached(MemTag mem_tag, size_t s, size_t so_far, const malloclimit* limit); public: static void initialize(); - static inline void record_malloc(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->record_malloc(size); + static inline void record_malloc(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->record_malloc(size); as_snapshot()->_all_mallocs.allocate(size); } - static inline void record_free(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->record_free(size); + static inline void record_free(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->record_free(size); as_snapshot()->_all_mallocs.deallocate(size); } - static inline void record_new_arena(MEMFLAGS flag) { - as_snapshot()->by_type(flag)->record_new_arena(); + static inline void record_new_arena(MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->record_new_arena(); } - static inline void record_arena_free(MEMFLAGS flag) { - as_snapshot()->by_type(flag)->record_arena_free(); + static inline void record_arena_free(MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->record_arena_free(); } - static inline void record_arena_size_change(ssize_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->record_arena_size_change(size); + static inline void record_arena_size_change(ssize_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->record_arena_size_change(size); } static void snapshot(MallocMemorySnapshot* s) { @@ -257,7 +257,7 @@ class MallocMemorySummary : AllStatic { // MallocLimit: returns true if allocating s bytes on f would trigger // either global or the category limit - static inline bool check_exceeds_limit(size_t s, MEMFLAGS f); + static inline bool check_exceeds_limit(size_t s, MemTag mem_tag); }; @@ -280,7 +280,7 @@ class MallocTracker : AllStatic { // // Record malloc on specified memory block - static void* record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, + static void* record_malloc(void* malloc_base, size_t size, MemTag mem_tag, const NativeCallStack& stack); // Given a block returned by os::malloc() or os::realloc(): @@ -289,21 +289,21 @@ class MallocTracker : AllStatic { // Given the free info from a block, de-account block from NMT. static void deaccount(MallocHeader::FreeInfo free_info); - static inline void record_new_arena(MEMFLAGS flags) { - MallocMemorySummary::record_new_arena(flags); + static inline void record_new_arena(MemTag mem_tag) { + MallocMemorySummary::record_new_arena(mem_tag); } - static inline void record_arena_free(MEMFLAGS flags) { - MallocMemorySummary::record_arena_free(flags); + static inline void record_arena_free(MemTag mem_tag) { + MallocMemorySummary::record_arena_free(mem_tag); } - static inline void record_arena_size_change(ssize_t size, MEMFLAGS flags) { - MallocMemorySummary::record_arena_size_change(size, flags); + static inline void record_arena_size_change(ssize_t size, MemTag mem_tag) { + MallocMemorySummary::record_arena_size_change(size, mem_tag); } // MallocLimt: Given an allocation size s, check if mallocing this much - // under category f would hit either the global limit or the limit for category f. - static inline bool check_exceeds_limit(size_t s, MEMFLAGS f); + // for MemTag would hit either the global limit or the limit for MemTag. + static inline bool check_exceeds_limit(size_t s, MemTag mem_tag); // Given a pointer, look for the containing malloc block. // Print the block. Note that since there is very low risk of memory looking diff --git a/src/hotspot/share/nmt/mallocTracker.inline.hpp b/src/hotspot/share/nmt/mallocTracker.inline.hpp index 243f965a3829a..19d3775ed778e 100644 --- a/src/hotspot/share/nmt/mallocTracker.inline.hpp +++ b/src/hotspot/share/nmt/mallocTracker.inline.hpp @@ -32,7 +32,7 @@ #include "utilities/globalDefinitions.hpp" // Returns true if allocating s bytes on f would trigger either global or the category limit -inline bool MallocMemorySummary::check_exceeds_limit(size_t s, MEMFLAGS f) { +inline bool MallocMemorySummary::check_exceeds_limit(size_t s, MemTag mem_tag) { // Note: checks are ordered to have as little impact as possible on the standard code path, // when MallocLimit is unset, resp. it is set but we have reached no limit yet. @@ -50,12 +50,12 @@ inline bool MallocMemorySummary::check_exceeds_limit(size_t s, MEMFLAGS f) { } } else { // Category Limit? - l = MallocLimitHandler::category_limit(f); + l = MallocLimitHandler::category_limit(mem_tag); if (l->sz > 0) { - const MallocMemory* mm = as_snapshot()->by_type(f); + const MallocMemory* mm = as_snapshot()->by_type(mem_tag); size_t so_far = mm->malloc_size() + mm->arena_size(); if ((so_far + s) > l->sz) { - return category_limit_reached(f, s, so_far, l); + return category_limit_reached(mem_tag, s, so_far, l); } } } @@ -64,8 +64,8 @@ inline bool MallocMemorySummary::check_exceeds_limit(size_t s, MEMFLAGS f) { return false; } -inline bool MallocTracker::check_exceeds_limit(size_t s, MEMFLAGS f) { - return MallocMemorySummary::check_exceeds_limit(s, f); +inline bool MallocTracker::check_exceeds_limit(size_t s, MemTag mem_tag) { + return MallocMemorySummary::check_exceeds_limit(s, mem_tag); } diff --git a/src/hotspot/share/nmt/memBaseline.cpp b/src/hotspot/share/nmt/memBaseline.cpp index 7c7dd3ec24e5f..6f82b2de9f106 100644 --- a/src/hotspot/share/nmt/memBaseline.cpp +++ b/src/hotspot/share/nmt/memBaseline.cpp @@ -61,11 +61,11 @@ int compare_malloc_site(const MallocSite& s1, const MallocSite& s2) { return s1.call_stack()->compare(*s2.call_stack()); } -// Sort into allocation site addresses and memory type order for baseline comparison +// Sort into allocation site addresses and memory tag order for baseline comparison int compare_malloc_site_and_type(const MallocSite& s1, const MallocSite& s2) { int res = compare_malloc_site(s1, s2); if (res == 0) { - res = (int)(NMTUtil::flag_to_index(s1.flag()) - NMTUtil::flag_to_index(s2.flag())); + res = (int)(NMTUtil::tag_to_index(s1.mem_tag()) - NMTUtil::tag_to_index(s2.mem_tag())); } return res; @@ -207,7 +207,7 @@ bool MemBaseline::aggregate_virtual_memory_allocation_sites() { const ReservedMemoryRegion* rgn; VirtualMemoryAllocationSite* site; while ((rgn = itr.next()) != nullptr) { - VirtualMemoryAllocationSite tmp(*rgn->call_stack(), rgn->flag()); + VirtualMemoryAllocationSite tmp(*rgn->call_stack(), rgn->mem_tag()); site = allocation_sites.find(tmp); if (site == nullptr) { LinkedListNode* node = diff --git a/src/hotspot/share/nmt/memBaseline.hpp b/src/hotspot/share/nmt/memBaseline.hpp index 903f558051103..be389e375e342 100644 --- a/src/hotspot/share/nmt/memBaseline.hpp +++ b/src/hotspot/share/nmt/memBaseline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -53,7 +53,7 @@ class MemBaseline { by_address, // by memory address by_size, // by memory size by_site, // by call site where the memory is allocated from - by_site_and_type // by call site and memory type + by_site_and_type // by call site and memory tag }; private: @@ -144,14 +144,14 @@ class MemBaseline { return bl->_malloc_memory_snapshot.malloc_overhead(); } - MallocMemory* malloc_memory(MEMFLAGS flag) { + MallocMemory* malloc_memory(MemTag mem_tag) { assert(baseline_type() != Not_baselined, "Not yet baselined"); - return _malloc_memory_snapshot.by_type(flag); + return _malloc_memory_snapshot.by_type(mem_tag); } - VirtualMemory* virtual_memory(MEMFLAGS flag) { + VirtualMemory* virtual_memory(MemTag mem_tag) { assert(baseline_type() != Not_baselined, "Not yet baselined"); - return _virtual_memory_snapshot.by_type(flag); + return _virtual_memory_snapshot.by_type(mem_tag); } @@ -203,7 +203,7 @@ class MemBaseline { void malloc_sites_to_size_order(); // Sort allocation sites in call site address order void malloc_sites_to_allocation_site_order(); - // Sort allocation sites in call site address and memory type order + // Sort allocation sites in call site address and memory tag order void malloc_sites_to_allocation_site_and_type_order(); // Sort allocation sites in reserved size order diff --git a/src/hotspot/share/nmt/memMapPrinter.cpp b/src/hotspot/share/nmt/memMapPrinter.cpp index 5f920b102a977..34ddb7a871336 100644 --- a/src/hotspot/share/nmt/memMapPrinter.cpp +++ b/src/hotspot/share/nmt/memMapPrinter.cpp @@ -25,15 +25,15 @@ #include "precompiled.hpp" -#ifdef LINUX +#if defined(LINUX) || defined(_WIN64) #include "gc/shared/collectedHeap.hpp" #include "logging/logAsyncWriter.hpp" #include "memory/allocation.hpp" #include "memory/universe.hpp" #include "memory/resourceArea.hpp" -#include "nmt/memflags.hpp" -#include "nmt/memFlagBitmap.hpp" +#include "nmt/memTag.hpp" +#include "nmt/memTagBitmap.hpp" #include "nmt/memMapPrinter.hpp" #include "nmt/memTracker.hpp" #include "nmt/virtualMemoryTracker.hpp" @@ -50,9 +50,9 @@ /// NMT mechanics // Short, clear, descriptive names for all possible markers. Note that we only expect to see -// those that have been used with mmap. Flags left out are printed with their nmt flag name. +// those that have been used with mmap. Flags left out are printed with their nmt tags name. #define NMT_FLAGS_DO(f) \ - /* flag, short, description */ \ + /* mem_tag, short, description */ \ f(mtGCCardSet, "CARDTBL", "GC Card table") \ f(mtClassShared, "CDS", "CDS archives") \ f(mtClass, "CLASS", "Class Space") \ @@ -67,11 +67,11 @@ f(mtTest, "TEST", "JVM internal test mappings") //end -static const char* get_shortname_for_nmt_flag(MEMFLAGS f) { -#define DO(flag, shortname, text) if (flag == f) return shortname; +static const char* get_shortname_for_mem_tag(MemTag mem_tag) { +#define DO(t, shortname, text) if (t == mem_tag) return shortname; NMT_FLAGS_DO(DO) #undef DO - return NMTUtil::flag_to_enum_name(f); + return NMTUtil::tag_to_enum_name(mem_tag); } /// NMT virtual memory @@ -80,7 +80,7 @@ static bool range_intersects(const void* from1, const void* to1, const void* fro return MAX2(from1, from2) < MIN2(to1, to2); } -// A Cache that correlates range with MEMFLAG, optimized to be iterated quickly +// A Cache that correlates range with MemTag, optimized to be iterated quickly // (cache friendly). class CachedNMTInformation : public VirtualMemoryWalker { struct Range { const void* from; const void* to; }; @@ -88,24 +88,24 @@ class CachedNMTInformation : public VirtualMemoryWalker { // structure would have, and it allows for faster iteration of ranges since more // of them fit into a cache line. Range* _ranges; - MEMFLAGS* _flags; + MemTag* _mem_tags; size_t _count, _capacity; mutable size_t _last; public: - CachedNMTInformation() : _ranges(nullptr), _flags(nullptr), + CachedNMTInformation() : _ranges(nullptr), _mem_tags(nullptr), _count(0), _capacity(0), _last(0) {} ~CachedNMTInformation() { ALLOW_C_FUNCTION(free, ::free(_ranges);) - ALLOW_C_FUNCTION(free, ::free(_flags);) + ALLOW_C_FUNCTION(free, ::free(_mem_tags);) } - bool add(const void* from, const void* to, MEMFLAGS f) { + bool add(const void* from, const void* to, MemTag mem_tag) { // We rely on NMT regions being sorted by base assert(_count == 0 || (from >= _ranges[_count - 1].to), "NMT regions unordered?"); - // we can just fold two regions if they are adjacent and have the same flag. - if (_count > 0 && from == _ranges[_count - 1].to && f == _flags[_count - 1]) { + // we can just fold two regions if they are adjacent and have the same mem_tag. + if (_count > 0 && from == _ranges[_count - 1].to && mem_tag == _mem_tags[_count - 1]) { _ranges[_count - 1].to = to; return true; } @@ -114,8 +114,8 @@ class CachedNMTInformation : public VirtualMemoryWalker { const size_t new_capacity = MAX2((size_t)4096, 2 * _capacity); // Unfortunately, we need to allocate manually, raw, since we must prevent NMT deadlocks (ThreadCritical). ALLOW_C_FUNCTION(realloc, _ranges = (Range*)::realloc(_ranges, new_capacity * sizeof(Range));) - ALLOW_C_FUNCTION(realloc, _flags = (MEMFLAGS*)::realloc(_flags, new_capacity * sizeof(MEMFLAGS));) - if (_ranges == nullptr || _flags == nullptr) { + ALLOW_C_FUNCTION(realloc, _mem_tags = (MemTag*)::realloc(_mem_tags, new_capacity * sizeof(MemTag));) + if (_ranges == nullptr || _mem_tags == nullptr) { // In case of OOM lets make no fuss. Just return. return false; } @@ -123,14 +123,14 @@ class CachedNMTInformation : public VirtualMemoryWalker { } assert(_capacity > _count, "Sanity"); _ranges[_count] = Range { from, to }; - _flags[_count] = f; + _mem_tags[_count] = mem_tag; _count++; return true; } // Given a vma [from, to), find all regions that intersect with this vma and // return their collective flags. - MemFlagBitmap lookup(const void* from, const void* to) const { + MemTagBitmap lookup(const void* from, const void* to) const { assert(from <= to, "Sanity"); // We optimize for sequential lookups. Since this class is used when a list // of OS mappings is scanned (VirtualQuery, /proc/pid/maps), and these lists @@ -139,10 +139,10 @@ class CachedNMTInformation : public VirtualMemoryWalker { // the range is to the right of the given section, we need to re-start the search _last = 0; } - MemFlagBitmap bm; + MemTagBitmap bm; for(uintx i = _last; i < _count; i++) { if (range_intersects(from, to, _ranges[i].from, _ranges[i].to)) { - bm.set_flag(_flags[i]); + bm.set_tag(_mem_tags[i]); } else if (to <= _ranges[i].from) { _last = i; break; @@ -153,7 +153,7 @@ class CachedNMTInformation : public VirtualMemoryWalker { bool do_allocation_site(const ReservedMemoryRegion* rgn) override { // Cancel iteration if we run out of memory (add returns false); - return add(rgn->base(), rgn->end(), rgn->flag()); + return add(rgn->base(), rgn->end(), rgn->mem_tag()); } // Iterate all NMT virtual memory regions and fill this cache. @@ -247,16 +247,16 @@ bool MappingPrintSession::print_nmt_info_for_region(const void* vma_from, const // print NMT information, if available if (MemTracker::enabled()) { // Correlate vma region (from, to) with NMT region(s) we collected previously. - const MemFlagBitmap flags = _nmt_info.lookup(vma_from, vma_to); + const MemTagBitmap flags = _nmt_info.lookup(vma_from, vma_to); if (flags.has_any()) { - for (int i = 0; i < mt_number_of_types; i++) { - const MEMFLAGS flag = (MEMFLAGS)i; - if (flags.has_flag(flag)) { + for (int i = 0; i < mt_number_of_tags; i++) { + const MemTag mem_tag = (MemTag)i; + if (flags.has_tag(mem_tag)) { if (num_printed > 0) { _out->put(','); } - _out->print("%s", get_shortname_for_nmt_flag(flag)); - if (flag == mtThreadStack) { + _out->print("%s", get_shortname_for_mem_tag(mem_tag)); + if (mem_tag == mtThreadStack) { print_thread_details_for_supposed_stack_address(vma_from, vma_to, _out); } num_printed++; diff --git a/src/hotspot/share/nmt/memMapPrinter.hpp b/src/hotspot/share/nmt/memMapPrinter.hpp index aa35a830001e3..7f3ef9abca893 100644 --- a/src/hotspot/share/nmt/memMapPrinter.hpp +++ b/src/hotspot/share/nmt/memMapPrinter.hpp @@ -27,10 +27,10 @@ #define SHARE_SERVICES_MEMMAPPRINTER_HPP #include "memory/allStatic.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef LINUX +#if defined(LINUX) || defined(_WIN64) class outputStream; class CachedNMTInformation; diff --git a/src/hotspot/share/nmt/memReporter.cpp b/src/hotspot/share/nmt/memReporter.cpp index d53782dfdaa15..6ce6206ebcc2a 100644 --- a/src/hotspot/share/nmt/memReporter.cpp +++ b/src/hotspot/share/nmt/memReporter.cpp @@ -26,7 +26,7 @@ #include "memory/metaspace.hpp" #include "memory/metaspaceUtils.hpp" #include "nmt/mallocTracker.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/memReporter.hpp" #include "nmt/memoryFileTracker.hpp" #include "nmt/threadStackTracker.hpp" @@ -70,17 +70,17 @@ void MemReporterBase::print_total(size_t reserved, size_t committed, size_t peak } } -void MemReporterBase::print_malloc(const MemoryCounter* c, MEMFLAGS flag) const { +void MemReporterBase::print_malloc(const MemoryCounter* c, MemTag mem_tag) const { const char* scale = current_scale(); outputStream* out = output(); - const char* alloc_type = (flag == mtThreadStack) ? "" : "malloc="; + const char* alloc_type = (mem_tag == mtThreadStack) ? "" : "malloc="; const size_t amount = c->size(); const size_t count = c->count(); - if (flag != mtNone) { + if (mem_tag != mtNone) { out->print("(%s" SIZE_FORMAT "%s type=%s", alloc_type, - amount_in_current_scale(amount), scale, NMTUtil::flag_to_name(flag)); + amount_in_current_scale(amount), scale, NMTUtil::tag_to_name(mem_tag)); } else { out->print("(%s" SIZE_FORMAT "%s", alloc_type, amount_in_current_scale(amount), scale); @@ -176,31 +176,31 @@ void MemSummaryReporter::report() { out->cr(); out->cr(); - // Summary by memory type - for (int index = 0; index < mt_number_of_types; index ++) { - MEMFLAGS flag = NMTUtil::index_to_flag(index); + // Summary by memory tag + for (int index = 0; index < mt_number_of_tags; index ++) { + MemTag mem_tag = NMTUtil::index_to_tag(index); // thread stack is reported as part of thread category - if (flag == mtThreadStack) continue; - MallocMemory* malloc_memory = _malloc_snapshot->by_type(flag); - VirtualMemory* virtual_memory = _vm_snapshot->by_type(flag); + if (mem_tag == mtThreadStack) continue; + MallocMemory* malloc_memory = _malloc_snapshot->by_type(mem_tag); + VirtualMemory* virtual_memory = _vm_snapshot->by_type(mem_tag); - report_summary_of_type(flag, malloc_memory, virtual_memory); + report_summary_of_type(mem_tag, malloc_memory, virtual_memory); } } -void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, +void MemSummaryReporter::report_summary_of_type(MemTag mem_tag, MallocMemory* malloc_memory, VirtualMemory* virtual_memory) { size_t reserved_amount = reserved_total (malloc_memory, virtual_memory); size_t committed_amount = committed_total(malloc_memory, virtual_memory); // Count thread's native stack in "Thread" category - if (flag == mtThread) { + if (mem_tag == mtThread) { const VirtualMemory* thread_stack_usage = (const VirtualMemory*)_vm_snapshot->by_type(mtThreadStack); reserved_amount += thread_stack_usage->reserved(); committed_amount += thread_stack_usage->committed(); - } else if (flag == mtNMT) { + } else if (mem_tag == mtNMT) { // Count malloc headers in "NMT" category reserved_amount += _malloc_snapshot->malloc_overhead(); committed_amount += _malloc_snapshot->malloc_overhead(); @@ -219,10 +219,10 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, outputStream* out = output(); const char* scale = current_scale(); constexpr int indent = 28; - out->print("-%*s (", indent - 2, NMTUtil::flag_to_name(flag)); + out->print("-%*s (", indent - 2, NMTUtil::tag_to_name(mem_tag)); print_total(reserved_amount, committed_amount); #if INCLUDE_CDS - if (flag == mtClassShared) { + if (mem_tag == mtClassShared) { size_t read_only_bytes = FileMapInfo::readonly_total(); output()->print(", readonly=" SIZE_FORMAT "%s", amount_in_current_scale(read_only_bytes), scale); @@ -232,12 +232,12 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, streamIndentor si(out, indent); - if (flag == mtClass) { + if (mem_tag == mtClass) { // report class count out->print_cr("(classes #" SIZE_FORMAT ")", (_instance_class_count + _array_class_count)); out->print_cr("( instance classes #" SIZE_FORMAT ", array classes #" SIZE_FORMAT ")", _instance_class_count, _array_class_count); - } else if (flag == mtThread) { + } else if (mem_tag == mtThread) { const VirtualMemory* thread_stack_usage = _vm_snapshot->by_type(mtThreadStack); // report thread count @@ -263,11 +263,11 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, out->cr(); } - if (flag == mtNMT && + if (mem_tag == mtNMT && amount_in_current_scale(_malloc_snapshot->malloc_overhead()) > 0) { out->print_cr("(tracking overhead=" SIZE_FORMAT "%s)", amount_in_current_scale(_malloc_snapshot->malloc_overhead()), scale); - } else if (flag == mtClass) { + } else if (mem_tag == mtClass) { // Metadata information report_metadata(Metaspace::NonClassType); if (Metaspace::using_class_space()) { @@ -338,12 +338,12 @@ int MemDetailReporter::report_malloc_sites() { } const NativeCallStack* stack = malloc_site->call_stack(); _stackprinter.print_stack(stack); - MEMFLAGS flag = malloc_site->flag(); - assert(NMTUtil::flag_is_valid(flag) && flag != mtNone, - "Must have a valid memory type"); + MemTag mem_tag = malloc_site->mem_tag(); + assert(NMTUtil::tag_is_valid(mem_tag) && mem_tag != mtNone, + "Must have a valid memory tag"); INDENT_BY(29, out->print("("); - print_malloc(malloc_site->counter(), flag); + print_malloc(malloc_site->counter(), mem_tag); out->print_cr(")"); ) out->cr(); @@ -378,9 +378,9 @@ int MemDetailReporter::report_virtual_memory_allocation_sites() { INDENT_BY(29, out->print("("); print_total(virtual_memory_site->reserved(), virtual_memory_site->committed()); - const MEMFLAGS flag = virtual_memory_site->flag(); - if (flag != mtNone) { - out->print(" Type=%s", NMTUtil::flag_to_name(flag)); + const MemTag mem_tag = virtual_memory_site->mem_tag(); + if (mem_tag != mtNone) { + out->print(" Type=%s", NMTUtil::tag_to_name(mem_tag)); } out->print_cr(")"); ) @@ -423,7 +423,7 @@ void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* const char* region_type = (all_committed ? "reserved and committed" : "reserved"); out->cr(); print_virtual_memory_region(region_type, reserved_rgn->base(), reserved_rgn->size()); - out->print(" for %s", NMTUtil::flag_to_name(reserved_rgn->flag())); + out->print(" for %s", NMTUtil::tag_to_name(reserved_rgn->mem_tag())); if (stack->is_empty()) { out->cr(); } else { @@ -519,31 +519,31 @@ void MemSummaryDiffReporter::report_diff() { out->cr(); out->cr(); - // Summary diff by memory type - for (int index = 0; index < mt_number_of_types; index ++) { - MEMFLAGS flag = NMTUtil::index_to_flag(index); + // Summary diff by memory tag + for (int index = 0; index < mt_number_of_tags; index ++) { + MemTag mem_tag = NMTUtil::index_to_tag(index); // thread stack is reported as part of thread category - if (flag == mtThreadStack) continue; - diff_summary_of_type(flag, - _early_baseline.malloc_memory(flag), - _early_baseline.virtual_memory(flag), + if (mem_tag == mtThreadStack) continue; + diff_summary_of_type(mem_tag, + _early_baseline.malloc_memory(mem_tag), + _early_baseline.virtual_memory(mem_tag), _early_baseline.metaspace_stats(), - _current_baseline.malloc_memory(flag), - _current_baseline.virtual_memory(flag), + _current_baseline.malloc_memory(mem_tag), + _current_baseline.virtual_memory(mem_tag), _current_baseline.metaspace_stats()); } } void MemSummaryDiffReporter::print_malloc_diff(size_t current_amount, size_t current_count, - size_t early_amount, size_t early_count, MEMFLAGS flags) const { + size_t early_amount, size_t early_count, MemTag mem_tag) const { const char* scale = current_scale(); outputStream* out = output(); - const char* alloc_type = (flags == mtThread) ? "" : "malloc="; + const char* alloc_tag = (mem_tag == mtThread) ? "" : "malloc="; - out->print("%s" SIZE_FORMAT "%s", alloc_type, amount_in_current_scale(current_amount), scale); + out->print("%s" SIZE_FORMAT "%s", alloc_tag, amount_in_current_scale(current_amount), scale); // Report type only if it is valid and not under "thread" category - if (flags != mtNone && flags != mtThread) { - out->print(" type=%s", NMTUtil::flag_to_name(flags)); + if (mem_tag != mtNone && mem_tag != mtThread) { + out->print(" type=%s", NMTUtil::tag_to_name(mem_tag)); } int64_t amount_diff = diff_in_current_scale(current_amount, early_amount); @@ -594,7 +594,7 @@ void MemSummaryDiffReporter::print_virtual_memory_diff(size_t current_reserved, } -void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, +void MemSummaryDiffReporter::diff_summary_of_type(MemTag mem_tag, const MallocMemory* early_malloc, const VirtualMemory* early_vm, const MetaspaceCombinedStats& early_ms, const MallocMemory* current_malloc, const VirtualMemory* current_vm, @@ -613,7 +613,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, size_t early_committed_amount = committed_total(early_malloc, early_vm); // Adjust virtual memory total - if (flag == mtThread) { + if (mem_tag == mtThread) { const VirtualMemory* early_thread_stack_usage = _early_baseline.virtual_memory(mtThreadStack); const VirtualMemory* current_thread_stack_usage = @@ -624,7 +624,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, current_reserved_amount += current_thread_stack_usage->reserved(); current_committed_amount += current_thread_stack_usage->committed(); - } else if (flag == mtNMT) { + } else if (mem_tag == mtNMT) { early_reserved_amount += _early_baseline.malloc_tracking_overhead(); early_committed_amount += _early_baseline.malloc_tracking_overhead(); @@ -636,7 +636,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, diff_in_current_scale(current_reserved_amount, early_reserved_amount) != 0) { // print summary line - out->print("-%*s (", indent - 2, NMTUtil::flag_to_name(flag)); + out->print("-%*s (", indent - 2, NMTUtil::tag_to_name(mem_tag)); print_virtual_memory_diff(current_reserved_amount, current_committed_amount, early_reserved_amount, early_committed_amount); out->print_cr(")"); @@ -644,7 +644,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, streamIndentor si(out, indent); // detail lines - if (flag == mtClass) { + if (mem_tag == mtClass) { // report class count out->print("(classes #" SIZE_FORMAT, _current_baseline.class_count()); const ssize_t class_count_diff = @@ -668,7 +668,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, } out->print_cr(")"); - } else if (flag == mtThread) { + } else if (mem_tag == mtThread) { // report thread count out->print("(threads #" SIZE_FORMAT, _current_baseline.thread_count()); const ssize_t thread_count_diff = counter_diff(_current_baseline.thread_count(), _early_baseline.thread_count()); @@ -696,7 +696,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, if (amount_in_current_scale(current_malloc_amount) > 0 || diff_in_current_scale(current_malloc_amount, early_malloc_amount) != 0) { out->print("("); - print_malloc_diff(current_malloc_amount, (flag == mtChunk) ? 0 : current_malloc->malloc_count(), + print_malloc_diff(current_malloc_amount, (mem_tag == mtChunk) ? 0 : current_malloc->malloc_count(), early_malloc_amount, early_malloc->malloc_count(), mtNone); out->print_cr(")"); } @@ -720,7 +720,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, } // Report native memory tracking overhead - if (flag == mtNMT) { + if (mem_tag == mtNMT) { size_t current_tracking_overhead = amount_in_current_scale(_current_baseline.malloc_tracking_overhead()); size_t early_tracking_overhead = amount_in_current_scale(_early_baseline.malloc_tracking_overhead()); @@ -733,7 +733,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, out->print(" " INT64_PLUS_FORMAT "%s", overhead_diff, scale); } out->print_cr(")"); - } else if (flag == mtClass) { + } else if (mem_tag == mtClass) { print_metaspace_diff(current_ms, early_ms); } out->cr(); @@ -847,9 +847,9 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const { } else if (compVal > 0) { old_virtual_memory_site(early_site); early_site = early_itr.next(); - } else if (early_site->flag() != current_site->flag()) { - // This site was originally allocated with one flag, then released, - // then re-allocated at the same site (as far as we can tell) with a different flag. + } else if (early_site->mem_tag() != current_site->mem_tag()) { + // This site was originally allocated with one memory tag, then released, + // then re-allocated at the same site (as far as we can tell) with a different memory tag. old_virtual_memory_site(early_site); early_site = early_itr.next(); new_virtual_memory_site(current_site); @@ -866,29 +866,29 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const { void MemDetailDiffReporter::new_malloc_site(const MallocSite* malloc_site) const { diff_malloc_site(malloc_site->call_stack(), malloc_site->size(), malloc_site->count(), - 0, 0, malloc_site->flag()); + 0, 0, malloc_site->mem_tag()); } void MemDetailDiffReporter::old_malloc_site(const MallocSite* malloc_site) const { diff_malloc_site(malloc_site->call_stack(), 0, 0, malloc_site->size(), - malloc_site->count(), malloc_site->flag()); + malloc_site->count(), malloc_site->mem_tag()); } void MemDetailDiffReporter::diff_malloc_site(const MallocSite* early, const MallocSite* current) const { - if (early->flag() != current->flag()) { + if (early->mem_tag() != current->mem_tag()) { // If malloc site type changed, treat it as deallocation of old type and // allocation of new type. old_malloc_site(early); new_malloc_site(current); } else { diff_malloc_site(current->call_stack(), current->size(), current->count(), - early->size(), early->count(), early->flag()); + early->size(), early->count(), early->mem_tag()); } } void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_t current_size, - size_t current_count, size_t early_size, size_t early_count, MEMFLAGS flags) const { + size_t current_count, size_t early_size, size_t early_count, MemTag mem_tag) const { outputStream* out = output(); assert(stack != nullptr, "null stack"); @@ -900,7 +900,7 @@ void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_ _stackprinter.print_stack(stack); INDENT_BY(28, out->print("("); - print_malloc_diff(current_size, current_count, early_size, early_count, flags); + print_malloc_diff(current_size, current_count, early_size, early_count, mem_tag); out->print_cr(")"); ) out->cr(); @@ -909,21 +909,21 @@ void MemDetailDiffReporter::diff_malloc_site(const NativeCallStack* stack, size_ void MemDetailDiffReporter::new_virtual_memory_site(const VirtualMemoryAllocationSite* site) const { - diff_virtual_memory_site(site->call_stack(), site->reserved(), site->committed(), 0, 0, site->flag()); + diff_virtual_memory_site(site->call_stack(), site->reserved(), site->committed(), 0, 0, site->mem_tag()); } void MemDetailDiffReporter::old_virtual_memory_site(const VirtualMemoryAllocationSite* site) const { - diff_virtual_memory_site(site->call_stack(), 0, 0, site->reserved(), site->committed(), site->flag()); + diff_virtual_memory_site(site->call_stack(), 0, 0, site->reserved(), site->committed(), site->mem_tag()); } void MemDetailDiffReporter::diff_virtual_memory_site(const VirtualMemoryAllocationSite* early, const VirtualMemoryAllocationSite* current) const { diff_virtual_memory_site(current->call_stack(), current->reserved(), current->committed(), - early->reserved(), early->committed(), current->flag()); + early->reserved(), early->committed(), current->mem_tag()); } void MemDetailDiffReporter::diff_virtual_memory_site(const NativeCallStack* stack, size_t current_reserved, - size_t current_committed, size_t early_reserved, size_t early_committed, MEMFLAGS flag) const { + size_t current_committed, size_t early_reserved, size_t early_committed, MemTag mem_tag) const { outputStream* out = output(); // no change @@ -936,8 +936,8 @@ void MemDetailDiffReporter::diff_virtual_memory_site(const NativeCallStack* stac INDENT_BY(28, out->print("(mmap: "); print_virtual_memory_diff(current_reserved, current_committed, early_reserved, early_committed); - if (flag != mtNone) { - out->print(" Type=%s", NMTUtil::flag_to_name(flag)); + if (mem_tag != mtNone) { + out->print(" Type=%s", NMTUtil::tag_to_name(mem_tag)); } out->print_cr(")"); ) diff --git a/src/hotspot/share/nmt/memReporter.hpp b/src/hotspot/share/nmt/memReporter.hpp index 095c05509391b..773377b5e20c7 100644 --- a/src/hotspot/share/nmt/memReporter.hpp +++ b/src/hotspot/share/nmt/memReporter.hpp @@ -108,7 +108,7 @@ class MemReporterBase : public StackObj { // Print summary total, malloc and virtual memory void print_total(size_t reserved, size_t committed, size_t peak = 0) const; - void print_malloc(const MemoryCounter* c, MEMFLAGS flag = mtNone) const; + void print_malloc(const MemoryCounter* c, MemTag mem_tag = mtNone) const; void print_virtual_memory(size_t reserved, size_t committed, size_t peak) const; void print_arena(const MemoryCounter* c) const; @@ -138,8 +138,8 @@ class MemSummaryReporter : public MemReporterBase { // Generate summary report virtual void report(); private: - // Report summary for each memory type - void report_summary_of_type(MEMFLAGS type, MallocMemory* malloc_memory, + // Report summary for each memory tag + void report_summary_of_type(MemTag mem_tag, MallocMemory* malloc_memory, VirtualMemory* virtual_memory); void report_metadata(Metaspace::MetadataType type) const; @@ -203,8 +203,8 @@ class MemSummaryDiffReporter : public MemReporterBase { virtual void report_diff(); private: - // report the comparison of each memory type - void diff_summary_of_type(MEMFLAGS type, + // report the comparison of each mem_tag + void diff_summary_of_type(MemTag mem_tag, const MallocMemory* early_malloc, const VirtualMemory* early_vm, const MetaspaceCombinedStats& early_ms, const MallocMemory* current_malloc, const VirtualMemory* current_vm, @@ -212,7 +212,7 @@ class MemSummaryDiffReporter : public MemReporterBase { protected: void print_malloc_diff(size_t current_amount, size_t current_count, - size_t early_amount, size_t early_count, MEMFLAGS flags) const; + size_t early_amount, size_t early_count, MemTag mem_tag) const; void print_virtual_memory_diff(size_t current_reserved, size_t current_committed, size_t early_reserved, size_t early_committed) const; void print_arena_diff(size_t current_amount, size_t current_count, @@ -262,9 +262,9 @@ class MemDetailDiffReporter : public MemSummaryDiffReporter { const VirtualMemoryAllocationSite* current) const; void diff_malloc_site(const NativeCallStack* stack, size_t current_size, - size_t currrent_count, size_t early_size, size_t early_count, MEMFLAGS flags) const; + size_t currrent_count, size_t early_size, size_t early_count, MemTag mem_tag) const; void diff_virtual_memory_site(const NativeCallStack* stack, size_t current_reserved, - size_t current_committed, size_t early_reserved, size_t early_committed, MEMFLAGS flag) const; + size_t current_committed, size_t early_reserved, size_t early_committed, MemTag mem_tag) const; }; #endif // SHARE_NMT_MEMREPORTER_HPP diff --git a/src/hotspot/share/nmt/memflags.hpp b/src/hotspot/share/nmt/memTag.hpp similarity index 84% rename from src/hotspot/share/nmt/memflags.hpp rename to src/hotspot/share/nmt/memTag.hpp index 530c9ae9d9528..9255645638d83 100644 --- a/src/hotspot/share/nmt/memflags.hpp +++ b/src/hotspot/share/nmt/memTag.hpp @@ -22,13 +22,13 @@ * */ -#ifndef SHARE_NMT_MEMFLAGS_HPP -#define SHARE_NMT_MEMFLAGS_HPP +#ifndef SHARE_NMT_MEM_TAG_HPP +#define SHARE_NMT_MEM_TAG_HPP #include "utilities/globalDefinitions.hpp" -#define MEMORY_TYPES_DO(f) \ - /* Memory type by sub systems. It occupies lower byte. */ \ +#define MEMORY_TAG_DO(f) \ + /* Memory tag by sub systems. It occupies lower byte. */ \ f(mtJavaHeap, "Java Heap") /* Java heap */ \ f(mtClass, "Class") /* Java classes */ \ f(mtThread, "Thread") /* thread objects */ \ @@ -61,22 +61,22 @@ f(mtNone, "Unknown") \ //end -#define MEMORY_TYPE_DECLARE_ENUM(type, human_readable) \ - type, +#define MEMORY_TAG_DECLARE_ENUM(mem_tag, human_readable) \ +mem_tag, -enum class MEMFLAGS : uint8_t { - MEMORY_TYPES_DO(MEMORY_TYPE_DECLARE_ENUM) - mt_number_of_types // number of memory types (mtDontTrack - // is not included as validate type) +enum class MemTag : uint8_t { + MEMORY_TAG_DO(MEMORY_TAG_DECLARE_ENUM) + mt_number_of_tags // number of memory tags (mtDontTrack + // is not included as validate tag) }; -#define MEMORY_TYPE_SHORTNAME(type, human_readable) \ - constexpr MEMFLAGS type = MEMFLAGS::type; +#define MEMORY_TAG_SHORTNAME(mem_tag, human_readable) \ + constexpr MemTag mem_tag = MemTag::mem_tag; -// Generate short aliases for the enum values. E.g. mtGC instead of MEMFLAGS::mtGC. -MEMORY_TYPES_DO(MEMORY_TYPE_SHORTNAME) +// Generate short aliases for the enum values. E.g. mtGC instead of MemTag::mtGC. +MEMORY_TAG_DO(MEMORY_TAG_SHORTNAME) // Make an int version of the sentinel end value. -constexpr int mt_number_of_types = static_cast(MEMFLAGS::mt_number_of_types); +constexpr int mt_number_of_tags = static_cast(MemTag::mt_number_of_tags); -#endif // SHARE_NMT_MEMFLAGS_HPP +#endif // SHARE_NMT_MEM_TAG_HPP diff --git a/src/hotspot/share/nmt/memFlagBitmap.hpp b/src/hotspot/share/nmt/memTagBitmap.hpp similarity index 75% rename from src/hotspot/share/nmt/memFlagBitmap.hpp rename to src/hotspot/share/nmt/memTagBitmap.hpp index 0464179948b54..f65dce60fa62b 100644 --- a/src/hotspot/share/nmt/memFlagBitmap.hpp +++ b/src/hotspot/share/nmt/memTagBitmap.hpp @@ -23,34 +23,34 @@ * */ -#ifndef SHARE_NMT_MEMFLAGBITMAP_HPP -#define SHARE_NMT_MEMFLAGBITMAP_HPP +#ifndef SHARE_NMT_MEMTAGBITMAP_HPP +#define SHARE_NMT_MEMTAGBITMAP_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" -class MemFlagBitmap { +class MemTagBitmap { uint32_t _v; - STATIC_ASSERT(sizeof(_v) * BitsPerByte >= mt_number_of_types); + STATIC_ASSERT(sizeof(_v) * BitsPerByte >= mt_number_of_tags); public: - MemFlagBitmap(uint32_t v = 0) : _v(v) {} - MemFlagBitmap(const MemFlagBitmap& o) : _v(o._v) {} + MemTagBitmap(uint32_t v = 0) : _v(v) {} + MemTagBitmap(const MemTagBitmap& o) : _v(o._v) {} uint32_t raw_value() const { return _v; } - void set_flag(MEMFLAGS f) { - const int bitno = (int)f; + void set_tag(MemTag mem_tag) { + const int bitno = (int)mem_tag; _v |= nth_bit(bitno); } - bool has_flag(MEMFLAGS f) const { - const int bitno = (int)f; + bool has_tag(MemTag mem_tag) const { + const int bitno = (int)mem_tag; return _v & nth_bit(bitno); } bool has_any() const { return _v > 0; } }; -#endif // SHARE_NMT_NMTUSAGE_HPP +#endif // SHARE_NMT_MEMTAGBITMAP_HPP diff --git a/src/hotspot/share/nmt/memTracker.cpp b/src/hotspot/share/nmt/memTracker.cpp index f40f9428443c1..fb9c9a50db1f7 100644 --- a/src/hotspot/share/nmt/memTracker.cpp +++ b/src/hotspot/share/nmt/memTracker.cpp @@ -63,7 +63,7 @@ void MemTracker::initialize() { // Memory type is encoded into tracking header as a byte field, // make sure that we don't overflow it. - STATIC_ASSERT(mt_number_of_types <= max_jubyte); + STATIC_ASSERT(mt_number_of_tags <= max_jubyte); if (level > NMT_off) { if (!MallocTracker::initialize(level) || diff --git a/src/hotspot/share/nmt/memTracker.hpp b/src/hotspot/share/nmt/memTracker.hpp index 74aa9f803b1bf..31b1e66b8a6b3 100644 --- a/src/hotspot/share/nmt/memTracker.hpp +++ b/src/hotspot/share/nmt/memTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -75,11 +75,11 @@ class MemTracker : AllStatic { return enabled() ? MallocTracker::overhead_per_malloc : 0; } - static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, + static inline void* record_malloc(void* mem_base, size_t size, MemTag mem_tag, const NativeCallStack& stack) { assert(mem_base != nullptr, "caller should handle null"); if (enabled()) { - return MallocTracker::record_malloc(mem_base, size, flag, stack); + return MallocTracker::record_malloc(mem_base, size, mem_tag, stack); } return mem_base; } @@ -99,34 +99,34 @@ class MemTracker : AllStatic { } // Record creation of an arena - static inline void record_new_arena(MEMFLAGS flag) { + static inline void record_new_arena(MemTag mem_tag) { if (!enabled()) return; - MallocTracker::record_new_arena(flag); + MallocTracker::record_new_arena(mem_tag); } // Record destruction of an arena - static inline void record_arena_free(MEMFLAGS flag) { + static inline void record_arena_free(MemTag mem_tag) { if (!enabled()) return; - MallocTracker::record_arena_free(flag); + MallocTracker::record_arena_free(mem_tag); } // Record arena size change. Arena size is the size of all arena // chunks that are backing up the arena. - static inline void record_arena_size_change(ssize_t diff, MEMFLAGS flag) { + static inline void record_arena_size_change(ssize_t diff, MemTag mem_tag) { if (!enabled()) return; - MallocTracker::record_arena_size_change(diff, flag); + MallocTracker::record_arena_size_change(diff, mem_tag); } // Note: virtual memory operations should only ever be called after NMT initialization // (we do not do any reservations before that). static inline void record_virtual_memory_reserve(void* addr, size_t size, const NativeCallStack& stack, - MEMFLAGS flag = mtNone) { + MemTag mem_tag = mtNone) { assert_post_init(); if (!enabled()) return; if (addr != nullptr) { ThreadCritical tc; - VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, flag); + VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, mem_tag); } } @@ -147,12 +147,12 @@ class MemTracker : AllStatic { } static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size, - const NativeCallStack& stack, MEMFLAGS flag = mtNone) { + const NativeCallStack& stack, MemTag mem_tag = mtNone) { assert_post_init(); if (!enabled()) return; if (addr != nullptr) { ThreadCritical tc; - VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, flag); + VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, mem_tag); VirtualMemoryTracker::add_committed_region((address)addr, size, stack); } } @@ -183,12 +183,12 @@ class MemTracker : AllStatic { } static inline void allocate_memory_in(MemoryFileTracker::MemoryFile* file, size_t offset, size_t size, - const NativeCallStack& stack, MEMFLAGS flag) { + const NativeCallStack& stack, MemTag mem_tag) { assert_post_init(); if (!enabled()) return; assert(file != nullptr, "must be"); MemoryFileTracker::Instance::Locker lock; - MemoryFileTracker::Instance::allocate_memory(file, offset, size, stack, flag); + MemoryFileTracker::Instance::allocate_memory(file, offset, size, stack, mem_tag); } static inline void free_memory_in(MemoryFileTracker::MemoryFile* file, @@ -206,21 +206,21 @@ class MemTracker : AllStatic { // // The two new memory regions will be both registered under stack and // memory flags of the original region. - static inline void record_virtual_memory_split_reserved(void* addr, size_t size, size_t split, MEMFLAGS flag, MEMFLAGS split_flag) { + static inline void record_virtual_memory_split_reserved(void* addr, size_t size, size_t split, MemTag mem_tag, MemTag split_tag) { assert_post_init(); if (!enabled()) return; if (addr != nullptr) { ThreadCritical tc; - VirtualMemoryTracker::split_reserved_region((address)addr, size, split, flag, split_flag); + VirtualMemoryTracker::split_reserved_region((address)addr, size, split, mem_tag, split_tag); } } - static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { + static inline void record_virtual_memory_tag(void* addr, MemTag mem_tag) { assert_post_init(); if (!enabled()) return; if (addr != nullptr) { ThreadCritical tc; - VirtualMemoryTracker::set_reserved_region_type((address)addr, flag); + VirtualMemoryTracker::set_reserved_region_type((address)addr, mem_tag); } } @@ -262,8 +262,8 @@ class MemTracker : AllStatic { static void tuning_statistics(outputStream* out); // MallocLimt: Given an allocation size s, check if mallocing this much - // under category f would hit either the global limit or the limit for category f. - static inline bool check_exceeds_limit(size_t s, MEMFLAGS f); + // for MemTag would hit either the global limit or the limit for MemTag. + static inline bool check_exceeds_limit(size_t s, MemTag mem_tag); // Given an unknown pointer, check if it points into a known region; print region if found // and return true; false if not found. diff --git a/src/hotspot/share/nmt/memTracker.inline.hpp b/src/hotspot/share/nmt/memTracker.inline.hpp index 500f2a75d8cf7..a850c6b07fdce 100644 --- a/src/hotspot/share/nmt/memTracker.inline.hpp +++ b/src/hotspot/share/nmt/memTracker.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -30,11 +30,11 @@ #include "nmt/mallocTracker.inline.hpp" -inline bool MemTracker::check_exceeds_limit(size_t s, MEMFLAGS f) { +inline bool MemTracker::check_exceeds_limit(size_t s, MemTag mem_tag) { if (!enabled()) { return false; } - return MallocTracker::check_exceeds_limit(s, f); + return MallocTracker::check_exceeds_limit(s, mem_tag); } #endif // SHARE_NMT_MEMTRACKER_INLINE_HPP diff --git a/src/hotspot/share/nmt/memoryFileTracker.cpp b/src/hotspot/share/nmt/memoryFileTracker.cpp index 25f2667e5c387..ede483ed33727 100644 --- a/src/hotspot/share/nmt/memoryFileTracker.cpp +++ b/src/hotspot/share/nmt/memoryFileTracker.cpp @@ -42,23 +42,23 @@ MemoryFileTracker::MemoryFileTracker(bool is_detailed_mode) void MemoryFileTracker::allocate_memory(MemoryFile* file, size_t offset, size_t size, const NativeCallStack& stack, - MEMFLAGS flag) { + MemTag mem_tag) { NativeCallStackStorage::StackIndex sidx = _stack_storage.push(stack); - VMATree::RegionData regiondata(sidx, flag); + VMATree::RegionData regiondata(sidx, mem_tag); VMATree::SummaryDiff diff = file->_tree.commit_mapping(offset, size, regiondata); - for (int i = 0; i < mt_number_of_types; i++) { - VirtualMemory* summary = file->_summary.by_type(NMTUtil::index_to_flag(i)); - summary->reserve_memory(diff.flag[i].commit); - summary->commit_memory(diff.flag[i].commit); + for (int i = 0; i < mt_number_of_tags; i++) { + VirtualMemory* summary = file->_summary.by_type(NMTUtil::index_to_tag(i)); + summary->reserve_memory(diff.tag[i].commit); + summary->commit_memory(diff.tag[i].commit); } } void MemoryFileTracker::free_memory(MemoryFile* file, size_t offset, size_t size) { VMATree::SummaryDiff diff = file->_tree.release_mapping(offset, size); - for (int i = 0; i < mt_number_of_types; i++) { - VirtualMemory* summary = file->_summary.by_type(NMTUtil::index_to_flag(i)); - summary->reserve_memory(diff.flag[i].commit); - summary->commit_memory(diff.flag[i].commit); + for (int i = 0; i < mt_number_of_tags; i++) { + VirtualMemory* summary = file->_summary.by_type(NMTUtil::index_to_tag(i)); + summary->reserve_memory(diff.tag[i].commit); + summary->commit_memory(diff.tag[i].commit); } } @@ -79,7 +79,7 @@ void MemoryFileTracker::print_report_on(const MemoryFile* file, outputStream* st return; } #ifdef ASSERT - if (broken_start != nullptr && prev->val().out.type() != current->val().in.type()) { + if (broken_start != nullptr && prev->val().out.mem_tag() != current->val().in.mem_tag()) { broken_start = prev; broken_end = current; } @@ -91,7 +91,7 @@ void MemoryFileTracker::print_report_on(const MemoryFile* file, outputStream* st start_addr, end_addr, NMTUtil::amount_in_scale(end_addr - start_addr, scale), NMTUtil::scale_name(scale), - NMTUtil::flag_to_name(prev->val().out.flag())); + NMTUtil::tag_to_name(prev->val().out.mem_tag())); { streamIndentor si(stream, 4); _stack_storage.get(prev->val().out.stack()).print_on(stream); @@ -138,8 +138,8 @@ bool MemoryFileTracker::Instance::initialize(NMT_TrackingLevel tracking_level) { void MemoryFileTracker::Instance::allocate_memory(MemoryFile* file, size_t offset, size_t size, const NativeCallStack& stack, - MEMFLAGS flag) { - _tracker->allocate_memory(file, offset, size, stack, flag); + MemTag mem_tag) { + _tracker->allocate_memory(file, offset, size, stack, mem_tag); } void MemoryFileTracker::Instance::free_memory(MemoryFile* file, size_t offset, size_t size) { @@ -181,9 +181,9 @@ const GrowableArrayCHeap& MemoryFileTrack void MemoryFileTracker::summary_snapshot(VirtualMemorySnapshot* snapshot) const { for (int d = 0; d < _files.length(); d++) { const MemoryFile* file = _files.at(d); - for (int i = 0; i < mt_number_of_types; i++) { - VirtualMemory* snap = snapshot->by_type(NMTUtil::index_to_flag(i)); - const VirtualMemory* current = file->_summary.by_type(NMTUtil::index_to_flag(i)); + for (int i = 0; i < mt_number_of_tags; i++) { + VirtualMemory* snap = snapshot->by_type(NMTUtil::index_to_tag(i)); + const VirtualMemory* current = file->_summary.by_type(NMTUtil::index_to_tag(i)); // Only account the committed memory. snap->commit_memory(current->committed()); } diff --git a/src/hotspot/share/nmt/memoryFileTracker.hpp b/src/hotspot/share/nmt/memoryFileTracker.hpp index 432b6f9d99e1e..42902701a16df 100644 --- a/src/hotspot/share/nmt/memoryFileTracker.hpp +++ b/src/hotspot/share/nmt/memoryFileTracker.hpp @@ -66,7 +66,7 @@ class MemoryFileTracker { MemoryFileTracker(bool is_detailed_mode); void allocate_memory(MemoryFile* file, size_t offset, size_t size, const NativeCallStack& stack, - MEMFLAGS flag); + MemTag mem_tag); void free_memory(MemoryFile* file, size_t offset, size_t size); MemoryFile* make_file(const char* descriptive_name); @@ -96,7 +96,7 @@ class MemoryFileTracker { static void free_file(MemoryFile* device); static void allocate_memory(MemoryFile* device, size_t offset, size_t size, - const NativeCallStack& stack, MEMFLAGS flag); + const NativeCallStack& stack, MemTag mem_tag); static void free_memory(MemoryFile* device, size_t offset, size_t size); static void summary_snapshot(VirtualMemorySnapshot* snapshot); diff --git a/src/hotspot/share/nmt/nativeCallStackPrinter.hpp b/src/hotspot/share/nmt/nativeCallStackPrinter.hpp index deebb338626eb..78fd541fc980f 100644 --- a/src/hotspot/share/nmt/nativeCallStackPrinter.hpp +++ b/src/hotspot/share/nmt/nativeCallStackPrinter.hpp @@ -27,7 +27,7 @@ #define SHARE_NMT_NATIVECALLSTACKPRINTER_HPP #include "memory/arena.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/resourceHash.hpp" diff --git a/src/hotspot/share/nmt/nmtCommon.cpp b/src/hotspot/share/nmt/nmtCommon.cpp index dadb830f29182..24a4cb1105adf 100644 --- a/src/hotspot/share/nmt/nmtCommon.cpp +++ b/src/hotspot/share/nmt/nmtCommon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -29,11 +29,11 @@ STATIC_ASSERT(NMT_off > NMT_unknown); STATIC_ASSERT(NMT_summary > NMT_off); STATIC_ASSERT(NMT_detail > NMT_summary); -#define MEMORY_TYPE_DECLARE_NAME(type, human_readable) \ +#define MEMORY_TAG_DECLARE_NAME(type, human_readable) \ { #type, human_readable }, NMTUtil::S NMTUtil::_strings[] = { - MEMORY_TYPES_DO(MEMORY_TYPE_DECLARE_NAME) + MEMORY_TAG_DO(MEMORY_TAG_DECLARE_NAME) }; const char* NMTUtil::scale_name(size_t scale) { @@ -87,14 +87,14 @@ NMT_TrackingLevel NMTUtil::parse_tracking_level(const char* s) { return NMT_unknown; } -MEMFLAGS NMTUtil::string_to_flag(const char* s) { - for (int i = 0; i < mt_number_of_types; i ++) { +MemTag NMTUtil::string_to_mem_tag(const char* s) { + for (int i = 0; i < mt_number_of_tags; i ++) { assert(::strlen(_strings[i].enum_s) > 2, "Sanity"); // should always start with "mt" if (::strcasecmp(_strings[i].human_readable, s) == 0 || ::strcasecmp(_strings[i].enum_s, s) == 0 || ::strcasecmp(_strings[i].enum_s + 2, s) == 0) // "mtXXX" -> match also "XXX" or "xxx" { - return (MEMFLAGS)i; + return (MemTag)i; } } return mtNone; diff --git a/src/hotspot/share/nmt/nmtCommon.hpp b/src/hotspot/share/nmt/nmtCommon.hpp index 8ca0965b3d35b..3f72960f21fde 100644 --- a/src/hotspot/share/nmt/nmtCommon.hpp +++ b/src/hotspot/share/nmt/nmtCommon.hpp @@ -28,7 +28,7 @@ #define SHARE_NMT_NMTCOMMON_HPP #include "memory/allStatic.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "utilities/align.hpp" #include "utilities/globalDefinitions.hpp" @@ -75,37 +75,37 @@ const int NMT_TrackingStackDepth = 4; // A few common utilities for native memory tracking class NMTUtil : AllStatic { public: - // Check if index is a valid MEMFLAGS enum value (including mtNone) - static inline bool flag_index_is_valid(int index) { - return index >= 0 && index < mt_number_of_types; + // Check if index is a valid MemTag enum value (including mtNone) + static inline bool tag_index_is_valid(int index) { + return index >= 0 && index < mt_number_of_tags; } - // Check if flag value is a valid MEMFLAGS enum value (including mtNone) - static inline bool flag_is_valid(MEMFLAGS flag) { - const int index = static_cast(flag); - return flag_index_is_valid(index); + // Check if tag value is a valid MemTag enum value (including mtNone) + static inline bool tag_is_valid(MemTag mem_tag) { + const int index = static_cast(mem_tag); + return tag_index_is_valid(index); } - // Map memory type to index - static inline int flag_to_index(MEMFLAGS flag) { - assert(flag_is_valid(flag), "Invalid flag (%u)", (unsigned)flag); - return static_cast(flag); + // Map memory tag to index + static inline int tag_to_index(MemTag mem_tag) { + assert(tag_is_valid(mem_tag), "Invalid type (%u)", (unsigned)mem_tag); + return static_cast(mem_tag); } - // Map memory type to human readable name - static const char* flag_to_name(MEMFLAGS flag) { - return _strings[flag_to_index(flag)].human_readable; + // Map memory tag to human readable name + static const char* tag_to_name(MemTag mem_tag) { + return _strings[tag_to_index(mem_tag)].human_readable; } - // Map memory type to literalized enum name (e.g. "mtTest") - static const char* flag_to_enum_name(MEMFLAGS flag) { - return _strings[flag_to_index(flag)].enum_s; + // Map memory tag to literalized enum name (e.g. "mtTest") + static const char* tag_to_enum_name(MemTag mem_tag) { + return _strings[tag_to_index(mem_tag)].enum_s; } - // Map an index to memory type - static MEMFLAGS index_to_flag(int index) { - assert(flag_index_is_valid(index), "Invalid flag index (%d)", index); - return static_cast(index); + // Map an index to memory tag + static MemTag index_to_tag(int index) { + assert(tag_index_is_valid(index), "Invalid type index (%d)", index); + return static_cast(index); } // Memory size scale @@ -121,10 +121,10 @@ class NMTUtil : AllStatic { // string is not a valid level. static NMT_TrackingLevel parse_tracking_level(const char* s); - // Given a string, return associated flag. mtNone if name is invalid. + // Given a string, return associated mem_tag. mtNone if name is invalid. // String can be either the human readable name or the // stringified enum (with or without leading "mt". In all cases, case is ignored. - static MEMFLAGS string_to_flag(const char* name); + static MemTag string_to_mem_tag(const char* name); // Returns textual representation of a tracking level. static const char* tracking_level_to_string(NMT_TrackingLevel level); @@ -134,7 +134,7 @@ class NMTUtil : AllStatic { const char* enum_s; // e.g. "mtNMT" const char* human_readable; // e.g. "Native Memory Tracking" }; - static S _strings[mt_number_of_types]; + static S _strings[mt_number_of_tags]; }; diff --git a/src/hotspot/share/nmt/nmtPreInit.cpp b/src/hotspot/share/nmt/nmtPreInit.cpp index a8ff18f3b62b2..0aa74566f42cb 100644 --- a/src/hotspot/share/nmt/nmtPreInit.cpp +++ b/src/hotspot/share/nmt/nmtPreInit.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023 SAP SE. All rights reserved. - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -198,8 +198,8 @@ void NMTPreInit::create_table() { } // Allocate with os::malloc (hidden to prevent having to include os.hpp) -void* NMTPreInit::do_os_malloc(size_t size, MEMFLAGS memflags) { - return os::malloc(size, memflags); +void* NMTPreInit::do_os_malloc(size_t size, MemTag mem_tag) { + return os::malloc(size, mem_tag); } // Switches from NMT pre-init state to NMT post-init state; diff --git a/src/hotspot/share/nmt/nmtPreInit.hpp b/src/hotspot/share/nmt/nmtPreInit.hpp index 38a34616b3f38..1524c2bd7dc69 100644 --- a/src/hotspot/share/nmt/nmtPreInit.hpp +++ b/src/hotspot/share/nmt/nmtPreInit.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023 SAP SE. All rights reserved. - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -255,7 +255,7 @@ class NMTPreInit : public AllStatic { } // Just a wrapper for os::malloc to avoid including os.hpp here. - static void* do_os_malloc(size_t size, MEMFLAGS memflags); + static void* do_os_malloc(size_t size, MemTag mem_tag); public: @@ -283,7 +283,7 @@ class NMTPreInit : public AllStatic { // Called from os::realloc. // Returns true if reallocation was handled here; in that case, // *rc contains the return address. - static bool handle_realloc(void** rc, void* old_p, size_t new_size, MEMFLAGS memflags) { + static bool handle_realloc(void** rc, void* old_p, size_t new_size, MemTag mem_tag) { if (old_p == nullptr) { // realloc(null, n) return handle_malloc(rc, new_size); } @@ -322,7 +322,7 @@ class NMTPreInit : public AllStatic { // and confusing us. const NMTPreInitAllocation* a = find_in_map(old_p); if (a != nullptr) { // this was originally a pre-init allocation - void* p_new = do_os_malloc(new_size, memflags); + void* p_new = do_os_malloc(new_size, mem_tag); ::memcpy(p_new, a->payload, MIN2(a->size, new_size)); (*rc) = p_new; return true; diff --git a/src/hotspot/share/nmt/nmtUsage.cpp b/src/hotspot/share/nmt/nmtUsage.cpp index 62c4122544171..a854f001593c1 100644 --- a/src/hotspot/share/nmt/nmtUsage.cpp +++ b/src/hotspot/share/nmt/nmtUsage.cpp @@ -57,9 +57,9 @@ void NMTUsage::update_malloc_usage() { const MallocMemorySnapshot* ms = MallocMemorySummary::as_snapshot(); size_t total_arena_size = 0; - for (int i = 0; i < mt_number_of_types; i++) { - MEMFLAGS flag = NMTUtil::index_to_flag(i); - const MallocMemory* mm = ms->by_type(flag); + for (int i = 0; i < mt_number_of_tags; i++) { + MemTag mem_tag = NMTUtil::index_to_tag(i); + const MallocMemory* mm = ms->by_type(mem_tag); _malloc_by_type[i] = mm->malloc_size() + mm->arena_size(); total_arena_size += mm->arena_size(); } @@ -68,11 +68,11 @@ void NMTUsage::update_malloc_usage() { _malloc_total = ms->total(); // Adjustment due to mtChunk double counting. - _malloc_by_type[NMTUtil::flag_to_index(mtChunk)] -= total_arena_size; + _malloc_by_type[NMTUtil::tag_to_index(mtChunk)] -= total_arena_size; _malloc_total -= total_arena_size; // Adjust mtNMT to include malloc overhead. - _malloc_by_type[NMTUtil::flag_to_index(mtNMT)] += ms->malloc_overhead(); + _malloc_by_type[NMTUtil::tag_to_index(mtNMT)] += ms->malloc_overhead(); } void NMTUsage::update_vm_usage() { @@ -81,9 +81,9 @@ void NMTUsage::update_vm_usage() { // Reset total to allow recalculation. _vm_total.committed = 0; _vm_total.reserved = 0; - for (int i = 0; i < mt_number_of_types; i++) { - MEMFLAGS flag = NMTUtil::index_to_flag(i); - const VirtualMemory* vm = vms->by_type(flag); + for (int i = 0; i < mt_number_of_tags; i++) { + MemTag mem_tag = NMTUtil::index_to_tag(i); + const VirtualMemory* vm = vms->by_type(mem_tag); _vm_by_type[i].reserved = vm->reserved(); _vm_by_type[i].committed = vm->committed(); @@ -116,12 +116,12 @@ size_t NMTUsage::total_committed() const { return _malloc_total + _vm_total.committed; } -size_t NMTUsage::reserved(MEMFLAGS flag) const { - int index = NMTUtil::flag_to_index(flag); +size_t NMTUsage::reserved(MemTag mem_tag) const { + int index = NMTUtil::tag_to_index(mem_tag); return _malloc_by_type[index] + _vm_by_type[index].reserved; } -size_t NMTUsage::committed(MEMFLAGS flag) const { - int index = NMTUtil::flag_to_index(flag); +size_t NMTUsage::committed(MemTag mem_tag) const { + int index = NMTUtil::tag_to_index(mem_tag); return _malloc_by_type[index] + _vm_by_type[index].committed; } diff --git a/src/hotspot/share/nmt/nmtUsage.hpp b/src/hotspot/share/nmt/nmtUsage.hpp index cfff59db9af85..390d207250cb0 100644 --- a/src/hotspot/share/nmt/nmtUsage.hpp +++ b/src/hotspot/share/nmt/nmtUsage.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -41,9 +41,9 @@ struct NMTUsageOptions { class NMTUsage : public CHeapObj { private: - size_t _malloc_by_type[mt_number_of_types]; + size_t _malloc_by_type[mt_number_of_tags]; size_t _malloc_total; - NMTUsagePair _vm_by_type[mt_number_of_types]; + NMTUsagePair _vm_by_type[mt_number_of_tags]; NMTUsagePair _vm_total; NMTUsageOptions _usage_options; @@ -61,8 +61,8 @@ class NMTUsage : public CHeapObj { size_t total_reserved() const; size_t total_committed() const; - size_t reserved(MEMFLAGS flag) const; - size_t committed(MEMFLAGS flag) const; + size_t reserved(MemTag mem_tag) const; + size_t committed(MemTag mem_tag) const; }; #endif // SHARE_NMT_NMTUSAGE_HPP diff --git a/src/hotspot/share/nmt/virtualMemoryTracker.cpp b/src/hotspot/share/nmt/virtualMemoryTracker.cpp index d25f3689a4268..d298381f1038f 100644 --- a/src/hotspot/share/nmt/virtualMemoryTracker.cpp +++ b/src/hotspot/share/nmt/virtualMemoryTracker.cpp @@ -142,7 +142,7 @@ bool ReservedMemoryRegion::add_committed_region(address addr, size_t size, const // At this point the previous overlapping regions have been // cleared, and the full region is guaranteed to be inserted. - VirtualMemorySummary::record_committed_memory(size, flag()); + VirtualMemorySummary::record_committed_memory(size, mem_tag()); // Try to merge with prev and possibly next. if (try_merge_with(prev, addr, size, stack)) { @@ -212,14 +212,14 @@ bool ReservedMemoryRegion::remove_uncommitted_region(address addr, size_t sz) { crgn = head->data(); if (crgn->same_region(addr, sz)) { - VirtualMemorySummary::record_uncommitted_memory(crgn->size(), flag()); + VirtualMemorySummary::record_uncommitted_memory(crgn->size(), mem_tag()); _committed_regions.remove_after(prev); return true; } // del_rgn contains crgn if (del_rgn.contain_region(crgn->base(), crgn->size())) { - VirtualMemorySummary::record_uncommitted_memory(crgn->size(), flag()); + VirtualMemorySummary::record_uncommitted_memory(crgn->size(), mem_tag()); head = head->next(); _committed_regions.remove_after(prev); continue; // don't update head or prev @@ -230,20 +230,20 @@ bool ReservedMemoryRegion::remove_uncommitted_region(address addr, size_t sz) { // (1) Found addr+size in current crgn as well. (del_rgn is contained in crgn) if (crgn->contain_address(end - 1)) { - VirtualMemorySummary::record_uncommitted_memory(sz, flag()); + VirtualMemorySummary::record_uncommitted_memory(sz, mem_tag()); return remove_uncommitted_region(head, addr, sz); // done! } else { // (2) Did not find del_rgn's end in crgn. size_t size = crgn->end() - del_rgn.base(); crgn->exclude_region(addr, size); - VirtualMemorySummary::record_uncommitted_memory(size, flag()); + VirtualMemorySummary::record_uncommitted_memory(size, mem_tag()); } } else if (crgn->contain_address(end - 1)) { // Found del_rgn's end, but not its base addr. size_t size = del_rgn.end() - crgn->base(); crgn->exclude_region(crgn->base(), size); - VirtualMemorySummary::record_uncommitted_memory(size, flag()); + VirtualMemorySummary::record_uncommitted_memory(size, mem_tag()); return true; // should be done if the list is sorted properly! } @@ -292,19 +292,19 @@ size_t ReservedMemoryRegion::committed_size() const { return committed; } -void ReservedMemoryRegion::set_flag(MEMFLAGS f) { - assert((flag() == mtNone || flag() == f), - "Overwrite memory type for region [" INTPTR_FORMAT "-" INTPTR_FORMAT "), %u->%u.", - p2i(base()), p2i(end()), (unsigned)flag(), (unsigned)f); - if (flag() != f) { - VirtualMemorySummary::move_reserved_memory(flag(), f, size()); - VirtualMemorySummary::move_committed_memory(flag(), f, committed_size()); - _flag = f; +void ReservedMemoryRegion::set_mem_tag(MemTag new_mem_tag) { + assert((mem_tag() == mtNone || mem_tag() == new_mem_tag), + "Overwrite memory tag for region [" INTPTR_FORMAT "-" INTPTR_FORMAT "), %u->%u.", + p2i(base()), p2i(end()), (unsigned)mem_tag(), (unsigned)new_mem_tag); + if (mem_tag() != new_mem_tag) { + VirtualMemorySummary::move_reserved_memory(mem_tag(), new_mem_tag, size()); + VirtualMemorySummary::move_committed_memory(mem_tag(), new_mem_tag, committed_size()); + _mem_tag = new_mem_tag; } } address ReservedMemoryRegion::thread_stack_uncommitted_bottom() const { - assert(flag() == mtThreadStack, "Only for thread stack"); + assert(mem_tag() == mtThreadStack, "Only for thread stack"); LinkedListNode* head = _committed_regions.head(); address bottom = base(); address top = base() + size(); @@ -334,26 +334,26 @@ bool VirtualMemoryTracker::initialize(NMT_TrackingLevel level) { } bool VirtualMemoryTracker::add_reserved_region(address base_addr, size_t size, - const NativeCallStack& stack, MEMFLAGS flag) { + const NativeCallStack& stack, MemTag mem_tag) { assert(base_addr != nullptr, "Invalid address"); assert(size > 0, "Invalid size"); assert(_reserved_regions != nullptr, "Sanity check"); - ReservedMemoryRegion rgn(base_addr, size, stack, flag); + ReservedMemoryRegion rgn(base_addr, size, stack, mem_tag); ReservedMemoryRegion* reserved_rgn = _reserved_regions->find(rgn); log_debug(nmt)("Add reserved region \'%s\' (" INTPTR_FORMAT ", " SIZE_FORMAT ")", - rgn.flag_name(), p2i(rgn.base()), rgn.size()); + rgn.mem_tag_name(), p2i(rgn.base()), rgn.size()); if (reserved_rgn == nullptr) { - VirtualMemorySummary::record_reserved_memory(size, flag); + VirtualMemorySummary::record_reserved_memory(size, mem_tag); return _reserved_regions->add(rgn) != nullptr; } else { // Deal with recursive reservation // os::reserve_memory() -> pd_reserve_memory() -> os::reserve_memory() // See JDK-8198226. if (reserved_rgn->same_region(base_addr, size) && - (reserved_rgn->flag() == flag || reserved_rgn->flag() == mtNone)) { + (reserved_rgn->mem_tag() == mem_tag || reserved_rgn->mem_tag() == mtNone)) { reserved_rgn->set_call_stack(stack); - reserved_rgn->set_flag(flag); + reserved_rgn->set_mem_tag(mem_tag); return true; } else { assert(reserved_rgn->overlap_region(base_addr, size), "Must be"); @@ -362,16 +362,16 @@ bool VirtualMemoryTracker::add_reserved_region(address base_addr, size_t size, // It can happen when the regions are thread stacks, as JNI // thread does not detach from VM before exits, and leads to // leak JavaThread object - if (reserved_rgn->flag() == mtThreadStack) { + if (reserved_rgn->mem_tag() == mtThreadStack) { guarantee(!CheckJNICalls, "Attached JNI thread exited without being detached"); // Overwrite with new region // Release old region - VirtualMemorySummary::record_uncommitted_memory(reserved_rgn->committed_size(), reserved_rgn->flag()); - VirtualMemorySummary::record_released_memory(reserved_rgn->size(), reserved_rgn->flag()); + VirtualMemorySummary::record_uncommitted_memory(reserved_rgn->committed_size(), reserved_rgn->mem_tag()); + VirtualMemorySummary::record_released_memory(reserved_rgn->size(), reserved_rgn->mem_tag()); // Add new region - VirtualMemorySummary::record_reserved_memory(rgn.size(), flag); + VirtualMemorySummary::record_reserved_memory(rgn.size(), mem_tag); *reserved_rgn = rgn; return true; @@ -380,27 +380,27 @@ bool VirtualMemoryTracker::add_reserved_region(address base_addr, size_t size, // CDS mapping region. // CDS reserves the whole region for mapping CDS archive, then maps each section into the region. // NMT reports CDS as a whole. - if (reserved_rgn->flag() == mtClassShared) { + if (reserved_rgn->mem_tag() == mtClassShared) { log_debug(nmt)("CDS reserved region \'%s\' as a whole (" INTPTR_FORMAT ", " SIZE_FORMAT ")", - reserved_rgn->flag_name(), p2i(reserved_rgn->base()), reserved_rgn->size()); + reserved_rgn->mem_tag_name(), p2i(reserved_rgn->base()), reserved_rgn->size()); assert(reserved_rgn->contain_region(base_addr, size), "Reserved CDS region should contain this mapping region"); return true; } // Mapped CDS string region. // The string region(s) is part of the java heap. - if (reserved_rgn->flag() == mtJavaHeap) { + if (reserved_rgn->mem_tag() == mtJavaHeap) { log_debug(nmt)("CDS reserved region \'%s\' as a whole (" INTPTR_FORMAT ", " SIZE_FORMAT ")", - reserved_rgn->flag_name(), p2i(reserved_rgn->base()), reserved_rgn->size()); + reserved_rgn->mem_tag_name(), p2i(reserved_rgn->base()), reserved_rgn->size()); assert(reserved_rgn->contain_region(base_addr, size), "Reserved heap region should contain this mapping region"); return true; } // Print some more details. Don't use UL here to avoid circularities. - tty->print_cr("Error: existing region: [" INTPTR_FORMAT "-" INTPTR_FORMAT "), flag %u.\n" - " new region: [" INTPTR_FORMAT "-" INTPTR_FORMAT "), flag %u.", - p2i(reserved_rgn->base()), p2i(reserved_rgn->end()), (unsigned)reserved_rgn->flag(), - p2i(base_addr), p2i(base_addr + size), (unsigned)flag); + tty->print_cr("Error: existing region: [" INTPTR_FORMAT "-" INTPTR_FORMAT "), memory tag %u.\n" + " new region: [" INTPTR_FORMAT "-" INTPTR_FORMAT "), memory tag %u.", + p2i(reserved_rgn->base()), p2i(reserved_rgn->end()), (unsigned)reserved_rgn->mem_tag(), + p2i(base_addr), p2i(base_addr + size), (unsigned)mem_tag); if (MemTracker::tracking_level() == NMT_detail) { tty->print_cr("Existing region allocated from:"); reserved_rgn->call_stack()->print_on(tty); @@ -413,7 +413,7 @@ bool VirtualMemoryTracker::add_reserved_region(address base_addr, size_t size, } } -void VirtualMemoryTracker::set_reserved_region_type(address addr, MEMFLAGS flag) { +void VirtualMemoryTracker::set_reserved_region_type(address addr, MemTag mem_tag) { assert(addr != nullptr, "Invalid address"); assert(_reserved_regions != nullptr, "Sanity check"); @@ -421,10 +421,10 @@ void VirtualMemoryTracker::set_reserved_region_type(address addr, MEMFLAGS flag) ReservedMemoryRegion* reserved_rgn = _reserved_regions->find(rgn); if (reserved_rgn != nullptr) { assert(reserved_rgn->contain_address(addr), "Containment"); - if (reserved_rgn->flag() != flag) { - assert(reserved_rgn->flag() == mtNone, "Overwrite memory type (should be mtNone, is: \"%s\")", - NMTUtil::flag_to_name(reserved_rgn->flag())); - reserved_rgn->set_flag(flag); + if (reserved_rgn->mem_tag() != mem_tag) { + assert(reserved_rgn->mem_tag() == mtNone, "Overwrite memory tag (should be mtNone, is: \"%s\")", + NMTUtil::tag_to_name(reserved_rgn->mem_tag())); + reserved_rgn->set_mem_tag(mem_tag); } } } @@ -440,13 +440,13 @@ bool VirtualMemoryTracker::add_committed_region(address addr, size_t size, if (reserved_rgn == nullptr) { log_debug(nmt)("Add committed region \'%s\', No reserved region found for (" INTPTR_FORMAT ", " SIZE_FORMAT ")", - rgn.flag_name(), p2i(rgn.base()), rgn.size()); + rgn.mem_tag_name(), p2i(rgn.base()), rgn.size()); } assert(reserved_rgn != nullptr, "Add committed region, No reserved region found"); assert(reserved_rgn->contain_region(addr, size), "Not completely contained"); bool result = reserved_rgn->add_committed_region(addr, size, stack); log_debug(nmt)("Add committed region \'%s\'(" INTPTR_FORMAT ", " SIZE_FORMAT ") %s", - reserved_rgn->flag_name(), p2i(rgn.base()), rgn.size(), (result ? "Succeeded" : "Failed")); + reserved_rgn->mem_tag_name(), p2i(rgn.base()), rgn.size(), (result ? "Succeeded" : "Failed")); return result; } @@ -459,10 +459,10 @@ bool VirtualMemoryTracker::remove_uncommitted_region(address addr, size_t size) ReservedMemoryRegion* reserved_rgn = _reserved_regions->find(rgn); assert(reserved_rgn != nullptr, "No reserved region (" INTPTR_FORMAT ", " SIZE_FORMAT ")", p2i(addr), size); assert(reserved_rgn->contain_region(addr, size), "Not completely contained"); - const char* flag_name = reserved_rgn->flag_name(); // after remove, info is not complete + const char* type_name = reserved_rgn->mem_tag_name(); // after remove, info is not complete bool result = reserved_rgn->remove_uncommitted_region(addr, size); log_debug(nmt)("Removed uncommitted region \'%s\' (" INTPTR_FORMAT ", " SIZE_FORMAT ") %s", - flag_name, p2i(addr), size, (result ? " Succeeded" : "Failed")); + type_name, p2i(addr), size, (result ? " Succeeded" : "Failed")); return result; } @@ -474,15 +474,15 @@ bool VirtualMemoryTracker::remove_released_region(ReservedMemoryRegion* rgn) { ReservedMemoryRegion backup(*rgn); bool result = rgn->remove_uncommitted_region(rgn->base(), rgn->size()); log_debug(nmt)("Remove uncommitted region \'%s\' (" INTPTR_FORMAT ", " SIZE_FORMAT ") %s", - backup.flag_name(), p2i(backup.base()), backup.size(), (result ? "Succeeded" : "Failed")); + backup.mem_tag_name(), p2i(backup.base()), backup.size(), (result ? "Succeeded" : "Failed")); if (!result) { return false; } - VirtualMemorySummary::record_released_memory(rgn->size(), rgn->flag()); + VirtualMemorySummary::record_released_memory(rgn->size(), rgn->mem_tag()); result = _reserved_regions->remove(*rgn); log_debug(nmt)("Removed region \'%s\' (" INTPTR_FORMAT ", " SIZE_FORMAT ") from _reserved_regions %s" , - backup.flag_name(), p2i(backup.base()), backup.size(), (result ? "Succeeded" : "Failed")); + backup.mem_tag_name(), p2i(backup.base()), backup.size(), (result ? "Succeeded" : "Failed")); return result; } @@ -508,7 +508,7 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { return false; } - if (reserved_rgn->flag() == mtClassShared) { + if (reserved_rgn->mem_tag() == mtClassShared) { if (reserved_rgn->contain_region(addr, size)) { // This is an unmapped CDS region, which is part of the reserved shared // memory region. @@ -523,14 +523,14 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { (size - reserved_rgn->size())); ReservedMemoryRegion* cls_rgn = _reserved_regions->find(class_rgn); assert(cls_rgn != nullptr, "Class space region not recorded?"); - assert(cls_rgn->flag() == mtClass, "Must be class type"); + assert(cls_rgn->mem_tag() == mtClass, "Must be class mem tag"); remove_released_region(reserved_rgn); remove_released_region(cls_rgn); return true; } } - VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag()); + VirtualMemorySummary::record_released_memory(size, reserved_rgn->mem_tag()); assert(reserved_rgn->contain_region(addr, size), "Not completely contained"); if (reserved_rgn->base() == addr || @@ -541,7 +541,7 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { address top = reserved_rgn->end(); address high_base = addr + size; ReservedMemoryRegion high_rgn(high_base, top - high_base, - *reserved_rgn->call_stack(), reserved_rgn->flag()); + *reserved_rgn->call_stack(), reserved_rgn->mem_tag()); // use original region for lower region reserved_rgn->exclude_region(addr, top - addr); @@ -557,8 +557,8 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { // Given an existing memory mapping registered with NMT, split the mapping in // two. The newly created two mappings will be registered under the call -// stack and the memory flags of the original section. -bool VirtualMemoryTracker::split_reserved_region(address addr, size_t size, size_t split, MEMFLAGS flag, MEMFLAGS split_flag) { +// stack and the memory tags of the original section. +bool VirtualMemoryTracker::split_reserved_region(address addr, size_t size, size_t split, MemTag mem_tag, MemTag split_tag) { ReservedMemoryRegion rgn(addr, size); ReservedMemoryRegion* reserved_rgn = _reserved_regions->find(rgn); @@ -567,15 +567,15 @@ bool VirtualMemoryTracker::split_reserved_region(address addr, size_t size, size assert(reserved_rgn->committed_size() == 0, "Splitting committed region?"); NativeCallStack original_stack = *reserved_rgn->call_stack(); - MEMFLAGS original_flags = reserved_rgn->flag(); + MemTag original_tag = reserved_rgn->mem_tag(); - const char* name = reserved_rgn->flag_name(); + const char* name = reserved_rgn->mem_tag_name(); remove_released_region(reserved_rgn); log_debug(nmt)("Split region \'%s\' (" INTPTR_FORMAT ", " SIZE_FORMAT ") with size " SIZE_FORMAT, name, p2i(rgn.base()), rgn.size(), split); // Now, create two new regions. - add_reserved_region(addr, split, original_stack, flag); - add_reserved_region(addr + split, size - split, original_stack, split_flag); + add_reserved_region(addr, split, original_stack, mem_tag); + add_reserved_region(addr + split, size - split, original_stack, split_tag); return true; } @@ -621,7 +621,7 @@ class SnapshotThreadStackWalker : public VirtualMemoryWalker { SnapshotThreadStackWalker() {} bool do_allocation_site(const ReservedMemoryRegion* rgn) { - if (rgn->flag() == mtThreadStack) { + if (rgn->mem_tag() == mtThreadStack) { address stack_bottom = rgn->thread_stack_uncommitted_bottom(); address committed_start; size_t committed_size; @@ -688,7 +688,7 @@ class PrintRegionWalker : public VirtualMemoryWalker { bool do_allocation_site(const ReservedMemoryRegion* rgn) { if (rgn->contain_address(_p)) { _st->print_cr(PTR_FORMAT " in mmap'd memory region [" PTR_FORMAT " - " PTR_FORMAT "], tag %s", - p2i(_p), p2i(rgn->base()), p2i(rgn->base() + rgn->size()), NMTUtil::flag_to_enum_name(rgn->flag())); + p2i(_p), p2i(rgn->base()), p2i(rgn->base() + rgn->size()), NMTUtil::tag_to_enum_name(rgn->mem_tag())); if (MemTracker::tracking_level() == NMT_detail) { _stackprinter.print_stack(rgn->call_stack()); _st->cr(); diff --git a/src/hotspot/share/nmt/virtualMemoryTracker.hpp b/src/hotspot/share/nmt/virtualMemoryTracker.hpp index e84245ce1f8db..6e36d3a858ad5 100644 --- a/src/hotspot/share/nmt/virtualMemoryTracker.hpp +++ b/src/hotspot/share/nmt/virtualMemoryTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -77,8 +77,8 @@ class VirtualMemory { class VirtualMemoryAllocationSite : public AllocationSite { VirtualMemory _c; public: - VirtualMemoryAllocationSite(const NativeCallStack& stack, MEMFLAGS flag) : - AllocationSite(stack, flag) { } + VirtualMemoryAllocationSite(const NativeCallStack& stack, MemTag mem_tag) : + AllocationSite(stack, mem_tag) { } inline void reserve_memory(size_t sz) { _c.reserve_memory(sz); } inline void commit_memory (size_t sz) { _c.commit_memory(sz); } @@ -95,22 +95,22 @@ class VirtualMemorySnapshot : public ResourceObj { friend class VirtualMemorySummary; private: - VirtualMemory _virtual_memory[mt_number_of_types]; + VirtualMemory _virtual_memory[mt_number_of_tags]; public: - inline VirtualMemory* by_type(MEMFLAGS flag) { - int index = NMTUtil::flag_to_index(flag); + inline VirtualMemory* by_type(MemTag mem_tag) { + int index = NMTUtil::tag_to_index(mem_tag); return &_virtual_memory[index]; } - inline const VirtualMemory* by_type(MEMFLAGS flag) const { - int index = NMTUtil::flag_to_index(flag); + inline const VirtualMemory* by_type(MemTag mem_tag) const { + int index = NMTUtil::tag_to_index(mem_tag); return &_virtual_memory[index]; } inline size_t total_reserved() const { size_t amount = 0; - for (int index = 0; index < mt_number_of_types; index ++) { + for (int index = 0; index < mt_number_of_tags; index ++) { amount += _virtual_memory[index].reserved(); } return amount; @@ -118,14 +118,14 @@ class VirtualMemorySnapshot : public ResourceObj { inline size_t total_committed() const { size_t amount = 0; - for (int index = 0; index < mt_number_of_types; index ++) { + for (int index = 0; index < mt_number_of_tags; index ++) { amount += _virtual_memory[index].committed(); } return amount; } void copy_to(VirtualMemorySnapshot* s) { - for (int index = 0; index < mt_number_of_types; index ++) { + for (int index = 0; index < mt_number_of_tags; index ++) { s->_virtual_memory[index] = _virtual_memory[index]; } } @@ -134,32 +134,32 @@ class VirtualMemorySnapshot : public ResourceObj { class VirtualMemorySummary : AllStatic { public: - static inline void record_reserved_memory(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->reserve_memory(size); + static inline void record_reserved_memory(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->reserve_memory(size); } - static inline void record_committed_memory(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->commit_memory(size); + static inline void record_committed_memory(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->commit_memory(size); } - static inline void record_uncommitted_memory(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->uncommit_memory(size); + static inline void record_uncommitted_memory(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->uncommit_memory(size); } - static inline void record_released_memory(size_t size, MEMFLAGS flag) { - as_snapshot()->by_type(flag)->release_memory(size); + static inline void record_released_memory(size_t size, MemTag mem_tag) { + as_snapshot()->by_type(mem_tag)->release_memory(size); } - // Move virtual memory from one memory type to another. - // Virtual memory can be reserved before it is associated with a memory type, and tagged + // Move virtual memory from one memory tag to another. + // Virtual memory can be reserved before it is associated with a memory tag, and tagged // as 'unknown'. Once the memory is tagged, the virtual memory will be moved from 'unknown' - // type to specified memory type. - static inline void move_reserved_memory(MEMFLAGS from, MEMFLAGS to, size_t size) { + // type to specified memory tag. + static inline void move_reserved_memory(MemTag from, MemTag to, size_t size) { as_snapshot()->by_type(from)->release_memory(size); as_snapshot()->by_type(to)->reserve_memory(size); } - static inline void move_committed_memory(MEMFLAGS from, MEMFLAGS to, size_t size) { + static inline void move_committed_memory(MemTag from, MemTag to, size_t size) { as_snapshot()->by_type(from)->uncommit_memory(size); as_snapshot()->by_type(to)->commit_memory(size); } @@ -293,16 +293,16 @@ class ReservedMemoryRegion : public VirtualMemoryRegion { _committed_regions; NativeCallStack _stack; - MEMFLAGS _flag; + MemTag _mem_tag; public: ReservedMemoryRegion(address base, size_t size, const NativeCallStack& stack, - MEMFLAGS flag = mtNone) : - VirtualMemoryRegion(base, size), _stack(stack), _flag(flag) { } + MemTag mem_tag = mtNone) : + VirtualMemoryRegion(base, size), _stack(stack), _mem_tag(mem_tag) { } ReservedMemoryRegion(address base, size_t size) : - VirtualMemoryRegion(base, size), _stack(NativeCallStack::empty_stack()), _flag(mtNone) { } + VirtualMemoryRegion(base, size), _stack(NativeCallStack::empty_stack()), _mem_tag(mtNone) { } // Copy constructor ReservedMemoryRegion(const ReservedMemoryRegion& rr) : @@ -313,8 +313,8 @@ class ReservedMemoryRegion : public VirtualMemoryRegion { inline void set_call_stack(const NativeCallStack& stack) { _stack = stack; } inline const NativeCallStack* call_stack() const { return &_stack; } - void set_flag(MEMFLAGS flag); - inline MEMFLAGS flag() const { return _flag; } + void set_mem_tag(MemTag mem_tag); + inline MemTag mem_tag() const { return _mem_tag; } // uncommitted thread stack bottom, above guard pages if there is any. address thread_stack_uncommitted_bottom() const; @@ -336,8 +336,8 @@ class ReservedMemoryRegion : public VirtualMemoryRegion { set_base(other.base()); set_size(other.size()); - _stack = *other.call_stack(); - _flag = other.flag(); + _stack = *other.call_stack(); + _mem_tag = other.mem_tag(); _committed_regions.clear(); CommittedRegionIterator itr = other.iterate_committed_regions(); @@ -350,7 +350,7 @@ class ReservedMemoryRegion : public VirtualMemoryRegion { return *this; } - const char* flag_name() const { return NMTUtil::flag_to_name(_flag); } + const char* mem_tag_name() const { return NMTUtil::tag_to_name(_mem_tag); } private: // The committed region contains the uncommitted region, subtract the uncommitted @@ -380,18 +380,18 @@ class VirtualMemoryTracker : AllStatic { public: static bool initialize(NMT_TrackingLevel level); - static bool add_reserved_region (address base_addr, size_t size, const NativeCallStack& stack, MEMFLAGS flag = mtNone); + static bool add_reserved_region (address base_addr, size_t size, const NativeCallStack& stack, MemTag mem_tag = mtNone); static bool add_committed_region (address base_addr, size_t size, const NativeCallStack& stack); static bool remove_uncommitted_region (address base_addr, size_t size); static bool remove_released_region (address base_addr, size_t size); static bool remove_released_region (ReservedMemoryRegion* rgn); - static void set_reserved_region_type (address addr, MEMFLAGS flag); + static void set_reserved_region_type (address addr, MemTag mem_tag); // Given an existing memory mapping registered with NMT, split the mapping in // two. The newly created two mappings will be registered under the call - // stack and the memory flags of the original section. - static bool split_reserved_region(address addr, size_t size, size_t split, MEMFLAGS flag, MEMFLAGS split_flag); + // stack and the memory tag of the original section. + static bool split_reserved_region(address addr, size_t size, size_t split, MemTag mem_tag, MemTag split_type); // Walk virtual memory data structure for creating baseline, etc. static bool walk_virtual_memory(VirtualMemoryWalker* walker); diff --git a/src/hotspot/share/nmt/vmatree.cpp b/src/hotspot/share/nmt/vmatree.cpp index cef2d48e8165b..3795376d4768d 100644 --- a/src/hotspot/share/nmt/vmatree.cpp +++ b/src/hotspot/share/nmt/vmatree.cpp @@ -83,8 +83,8 @@ VMATree::SummaryDiff VMATree::register_mapping(position A, position B, StateType } else { // If the state is not matching then we have different operations, such as: // reserve [x1, A); ... commit [A, x2); or - // reserve [x1, A), flag1; ... reserve [A, x2), flag2; or - // reserve [A, x1), flag1; ... reserve [A, x2), flag2; + // reserve [x1, A), mem_tag1; ... reserve [A, x2), mem_tag2; or + // reserve [A, x1), mem_tag1; ... reserve [A, x2), mem_tag2; // then we re-use the existing out node, overwriting its old metadata. leqA_n->val() = stA; } @@ -147,7 +147,7 @@ VMATree::SummaryDiff VMATree::register_mapping(position A, position B, StateType if (to_be_deleted_inbetween_a_b.length() == 0 && LEQ_A_found) { // We must have smashed a hole in an existing region (or replaced it entirely). // LEQ_A < A < B <= C - SingleDiff& rescom = diff.flag[NMTUtil::flag_to_index(LEQ_A.out().flag())]; + SingleDiff& rescom = diff.tag[NMTUtil::tag_to_index(LEQ_A.out().mem_tag())]; if (LEQ_A.out().type() == StateType::Reserved) { rescom.reserve -= B - A; } else if (LEQ_A.out().type() == StateType::Committed) { @@ -163,7 +163,7 @@ VMATree::SummaryDiff VMATree::register_mapping(position A, position B, StateType _tree.remove(delete_me.address); // Perform summary accounting - SingleDiff& rescom = diff.flag[NMTUtil::flag_to_index(delete_me.in().flag())]; + SingleDiff& rescom = diff.tag[NMTUtil::tag_to_index(delete_me.in().mem_tag())]; if (delete_me.in().type() == StateType::Reserved) { rescom.reserve -= delete_me.address - prev.address; } else if (delete_me.in().type() == StateType::Committed) { @@ -178,17 +178,17 @@ VMATree::SummaryDiff VMATree::register_mapping(position A, position B, StateType // A - prev - B - (some node >= B) // It might be that prev.address == B == (some node >= B), this is fine. if (prev.out().type() == StateType::Reserved) { - SingleDiff& rescom = diff.flag[NMTUtil::flag_to_index(prev.out().flag())]; + SingleDiff& rescom = diff.tag[NMTUtil::tag_to_index(prev.out().mem_tag())]; rescom.reserve -= B - prev.address; } else if (prev.out().type() == StateType::Committed) { - SingleDiff& rescom = diff.flag[NMTUtil::flag_to_index(prev.out().flag())]; + SingleDiff& rescom = diff.tag[NMTUtil::tag_to_index(prev.out().mem_tag())]; rescom.commit -= B - prev.address; rescom.reserve -= B - prev.address; } } // Finally, we can register the new region [A, B)'s summary data. - SingleDiff& rescom = diff.flag[NMTUtil::flag_to_index(metadata.flag)]; + SingleDiff& rescom = diff.tag[NMTUtil::tag_to_index(metadata.mem_tag)]; if (state == StateType::Reserved) { rescom.reserve += B - A; } else if (state == StateType::Committed) { diff --git a/src/hotspot/share/nmt/vmatree.hpp b/src/hotspot/share/nmt/vmatree.hpp index 3316219a1d340..55399e51b9d22 100644 --- a/src/hotspot/share/nmt/vmatree.hpp +++ b/src/hotspot/share/nmt/vmatree.hpp @@ -35,7 +35,7 @@ // A VMATree stores a sequence of points on the natural number line. // Each of these points stores information about a state change. // For example, the state may go from released memory to committed memory, -// or from committed memory of a certain MEMFLAGS to committed memory of a different MEMFLAGS. +// or from committed memory of a certain MemTag to committed memory of a different MemTag. // The set of points is stored in a balanced binary tree for efficient querying and updating. class VMATree { friend class NMTVMATreeTest; @@ -69,15 +69,15 @@ class VMATree { // Each point has some stack and a flag associated with it. struct RegionData { const NativeCallStackStorage::StackIndex stack_idx; - const MEMFLAGS flag; + const MemTag mem_tag; - RegionData() : stack_idx(), flag(mtNone) {} + RegionData() : stack_idx(), mem_tag(mtNone) {} - RegionData(NativeCallStackStorage::StackIndex stack_idx, MEMFLAGS flag) - : stack_idx(stack_idx), flag(flag) {} + RegionData(NativeCallStackStorage::StackIndex stack_idx, MemTag mem_tag) + : stack_idx(stack_idx), mem_tag(mem_tag) {} static bool equals(const RegionData& a, const RegionData& b) { - return a.flag == b.flag && + return a.mem_tag == b.mem_tag && NativeCallStackStorage::equals(a.stack_idx, b.stack_idx); } }; @@ -87,16 +87,16 @@ class VMATree { private: struct IntervalState { private: - // Store the type and flag as two bytes + // Store the type and mem_tag as two bytes uint8_t type_flag[2]; NativeCallStackStorage::StackIndex sidx; public: IntervalState() : type_flag{0,0}, sidx() {} IntervalState(const StateType type, const RegionData data) { - assert(!(type == StateType::Released) || data.flag == mtNone, "Released type must have flag mtNone"); + assert(!(type == StateType::Released) || data.mem_tag == mtNone, "Released type must have memory tag mtNone"); type_flag[0] = static_cast(type); - type_flag[1] = static_cast(data.flag); + type_flag[1] = static_cast(data.mem_tag); sidx = data.stack_idx; } @@ -104,12 +104,12 @@ class VMATree { return static_cast(type_flag[0]); } - MEMFLAGS flag() const { - return static_cast(type_flag[1]); + MemTag mem_tag() const { + return static_cast(type_flag[1]); } RegionData regiondata() const { - return RegionData{sidx, flag()}; + return RegionData{sidx, mem_tag()}; } NativeCallStackStorage::StackIndex stack() const { @@ -159,10 +159,10 @@ class VMATree { delta commit; }; struct SummaryDiff { - SingleDiff flag[mt_number_of_types]; + SingleDiff tag[mt_number_of_tags]; SummaryDiff() { - for (int i = 0; i < mt_number_of_types; i++) { - flag[i] = SingleDiff{0, 0}; + for (int i = 0; i < mt_number_of_tags; i++) { + tag[i] = SingleDiff{0, 0}; } } }; diff --git a/src/hotspot/share/oops/compressedKlass.cpp b/src/hotspot/share/oops/compressedKlass.cpp index 4a94eb9bde02d..02483d25a9a3c 100644 --- a/src/hotspot/share/oops/compressedKlass.cpp +++ b/src/hotspot/share/oops/compressedKlass.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "logging/log.hpp" #include "memory/metaspace.hpp" -#include "oops/compressedKlass.hpp" +#include "oops/compressedKlass.inline.hpp" #include "runtime/globals.hpp" #include "runtime/os.hpp" #include "utilities/debug.hpp" @@ -34,7 +34,8 @@ address CompressedKlassPointers::_base = nullptr; int CompressedKlassPointers::_shift = 0; -size_t CompressedKlassPointers::_range = 0; +address CompressedKlassPointers::_klass_range_start = nullptr; +address CompressedKlassPointers::_klass_range_end = nullptr; #ifdef _LP64 @@ -60,9 +61,12 @@ void CompressedKlassPointers::initialize_for_given_encoding(address addr, size_t assert(requested_base == addr, "Invalid requested base"); assert(encoding_range_end >= end, "Encoding does not cover the full Klass range"); + // Remember Klass range: + _klass_range_start = addr; + _klass_range_end = addr + len; + _base = requested_base; _shift = requested_shift; - _range = encoding_range_size; DEBUG_ONLY(assert_is_valid_encoding(addr, len, _base, _shift);) } @@ -87,6 +91,11 @@ char* CompressedKlassPointers::reserve_address_space_for_16bit_move(size_t size, #if !defined(AARCH64) || defined(ZERO) // On aarch64 we have an own version; all other platforms use the default version void CompressedKlassPointers::initialize(address addr, size_t len) { + + // Remember the Klass range: + _klass_range_start = addr; + _klass_range_end = addr + len; + // The default version of this code tries, in order of preference: // -unscaled (base=0 shift=0) // -zero-based (base=0 shift>0) @@ -111,16 +120,20 @@ void CompressedKlassPointers::initialize(address addr, size_t len) { _shift = 0; } } - _range = end - _base; DEBUG_ONLY(assert_is_valid_encoding(addr, len, _base, _shift);) } #endif // !AARCH64 || ZERO void CompressedKlassPointers::print_mode(outputStream* st) { - st->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: %d, " - "Narrow klass range: " SIZE_FORMAT_X, p2i(base()), shift(), - range()); + if (UseCompressedClassPointers) { + st->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: %d", + p2i(base()), shift()); + st->print_cr("Encoding Range: " RANGE2FMT, RANGE2FMTARGS(_base, encoding_range_end())); + st->print_cr("Klass Range: " RANGE2FMT, RANGE2FMTARGS(_klass_range_start, _klass_range_end)); + } else { + st->print_cr("UseCompressedClassPointers off"); + } } #endif // _LP64 diff --git a/src/hotspot/share/oops/compressedKlass.hpp b/src/hotspot/share/oops/compressedKlass.hpp index 26e0a5f6256c6..8f89b0550ff3d 100644 --- a/src/hotspot/share/oops/compressedKlass.hpp +++ b/src/hotspot/share/oops/compressedKlass.hpp @@ -31,6 +31,69 @@ class outputStream; class Klass; +// Narrow Klass Encoding +// +// Klass Range: +// a contiguous memory range into which we place Klass that should be encodable. Not every Klass +// needs to be encodable. There is only one such memory range. +// If CDS is disabled, this Klass Range is the same as the metaspace class space. If CDS is enabled, the +// Klass Range contains both CDS and class space adjacent to each other (with a potential small +// unused alignment gap between them). +// +// Encoding Range: +// This is the range covered by the current encoding scheme. The encoding scheme is defined by +// the encoding base, encoding shift and (implicitly) the bit size of the narrowKlass. The +// Encoding Range is: +// [ ... + (1 << ( + ) ) +// +// Note that while the Klass Range must be contained within the Encoding Range, the Encoding Range +// is typically a lot larger than the Klass Range: +// - the encoding base can start before the Klass Range start (specifically, it can start at 0 for +// zero-based encoding) +// - the end of the Encoding Range usually extends far beyond the end of the Klass Range. +// +// +// Examples: +// +// "unscaled" (zero-based zero-shift) encoding, CDS off, class space of 1G starts at 0x4B00_0000: +// - Encoding Range: [0 .. 0x1_0000_0000 ) (4 GB) +// - Klass Range: [0x4B00_0000 .. 0x 8B00_0000 ) (1 GB) +// +// +// _base _klass_range_start _klass_range_end encoding end +// | |//////////////////////////////| | +// | ... |///////1gb class space////////| ... | +// | |//////////////////////////////| | +// 0x0 0x4B00_0000 0x8B00_0000 0x1_0000_0000 +// +// +// +// "zero-based" (but scaled) encoding, shift=3, CDS off, 1G Class space at 0x7_C000_0000 (31GB): +// - Encoding Range: [0 .. 0x8_0000_0000 ) (32 GB) +// - Klass Range: [0x7_C000_0000 .. 0x8_0000_0000 ) (1 GB) +// +// encoding end +// _base _klass_range_start _klass_range_end +// | |//////////////////////////////| +// | ... |///////1gb class space////////| +// | |//////////////////////////////| +// 0x0 0x7_C000_0000 0x8_0000_0000 +// +// +// CDS enabled, 128MB CDS region starts 0x8_0000_0000, followed by a 1GB class space. Encoding +// base will point to CDS region start, shift=0: +// - Encoding Range: [0x8_0000_0000 .. 0x9_0000_0000 ) (4 GB) +// - Klass Range: [0x8_0000_0000 .. 0x8_4800_0000 ) (128 MB + 1 GB) +// +// _base +// _klass_range_start _klass_range_end encoding end +// |//////////|///////////////////////////| | +// |///CDS////|////1gb class space////////| ... ... | +// |//////////|///////////////////////////| | +// | | | +// 0x8_0000_0000 0x8_4800_0000 0x9_0000_0000 +// + // If compressed klass pointers then use narrowKlass. typedef juint narrowKlass; @@ -50,12 +113,10 @@ class CompressedKlassPointers : public AllStatic { static address _base; static int _shift; - // Together with base, this defines the address range within which Klass - // structures will be located: [base, base+range). While the maximal - // possible encoding range is 4|32G for shift 0|3, if we know beforehand - // the expected range of Klass* pointers will be smaller, a platform - // could use this info to optimize encoding. - static size_t _range; + // Start and end of the Klass Range. + // Note: guaranteed to be aligned to KlassAlignmentInBytes + static address _klass_range_start; + static address _klass_range_end; // Helper function for common cases. static char* reserve_address_space_X(uintptr_t from, uintptr_t to, size_t size, size_t alignment, bool aslr); @@ -92,9 +153,13 @@ class CompressedKlassPointers : public AllStatic { static void print_mode(outputStream* st); static address base() { return _base; } - static size_t range() { return _range; } static int shift() { return _shift; } + static address klass_range_start() { return _klass_range_start; } + static address klass_range_end() { return _klass_range_end; } + + static inline address encoding_range_end(); + static bool is_null(Klass* v) { return v == nullptr; } static bool is_null(narrowKlass v) { return v == 0; } @@ -110,14 +175,9 @@ class CompressedKlassPointers : public AllStatic { // Returns whether the pointer is in the memory region used for encoding compressed // class pointers. This includes CDS. - - // encoding encoding - // base end (base+range) - // |-----------------------------------------------------------------------| - // |----CDS---| |--------------------class space---------------------------| - - static inline bool is_in_encoding_range(const void* p) { - return p >= _base && p < (_base + _range); + static inline bool is_encodable(const void* p) { + return (address) p >= _klass_range_start && + (address) p < _klass_range_end; } }; diff --git a/src/hotspot/share/oops/compressedKlass.inline.hpp b/src/hotspot/share/oops/compressedKlass.inline.hpp index 87ef2102b3890..c9c9af24ad8a8 100644 --- a/src/hotspot/share/oops/compressedKlass.inline.hpp +++ b/src/hotspot/share/oops/compressedKlass.inline.hpp @@ -51,7 +51,7 @@ inline narrowKlass CompressedKlassPointers::encode_not_null(Klass* v, address na assert(!is_null(v), "klass value can never be zero"); assert(check_alignment(v), "Address not aligned"); uint64_t pd = (uint64_t)(pointer_delta(v, narrow_base, 1)); - assert(KlassEncodingMetaspaceMax > pd, "change encoding max if new encoding"); + assert(KlassEncodingMetaspaceMax > pd, "change encoding max if new encoding (Klass " PTR_FORMAT ", Base " PTR_FORMAT ")", p2i(v), p2i(narrow_base)); uint64_t result = pd >> shift; assert((result & CONST64(0xffffffff00000000)) == 0, "narrow klass pointer overflow"); assert(decode_not_null((narrowKlass)result, narrow_base, shift) == v, "reversibility"); @@ -82,4 +82,9 @@ inline narrowKlass CompressedKlassPointers::encode(Klass* v) { return is_null(v) ? (narrowKlass)0 : encode_not_null(v); } +inline address CompressedKlassPointers::encoding_range_end() { + const int max_bits = (sizeof(narrowKlass) * BitsPerByte) + _shift; // narrowKlass are 32 bit + return _base + nth_bit(max_bits); +} + #endif // SHARE_OOPS_COMPRESSEDKLASS_INLINE_HPP diff --git a/src/hotspot/share/oops/compressedOops.cpp b/src/hotspot/share/oops/compressedOops.cpp index 08f78b1d7734c..98a4438383a79 100644 --- a/src/hotspot/share/oops/compressedOops.cpp +++ b/src/hotspot/share/oops/compressedOops.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -35,8 +35,10 @@ #include "runtime/globals.hpp" // For UseCompressedOops. -NarrowPtrStruct CompressedOops::_narrow_oop = { nullptr, 0, true }; -MemRegion CompressedOops::_heap_address_range; +address CompressedOops::_base = nullptr; +int CompressedOops::_shift = 0; +bool CompressedOops::_use_implicit_null_checks = true; +MemRegion CompressedOops::_heap_address_range; // Choose the heap base address and oop encoding mode // when compressed oops are used: @@ -88,16 +90,16 @@ void CompressedOops::initialize(const ReservedHeapSpace& heap_space) { void CompressedOops::set_base(address base) { assert(UseCompressedOops, "no compressed oops?"); - _narrow_oop._base = base; + _base = base; } void CompressedOops::set_shift(int shift) { - _narrow_oop._shift = shift; + _shift = shift; } void CompressedOops::set_use_implicit_null_checks(bool use) { assert(UseCompressedOops, "no compressed ptrs?"); - _narrow_oop._use_implicit_null_checks = use; + _use_implicit_null_checks = use; } bool CompressedOops::is_in(void* addr) { @@ -148,14 +150,14 @@ bool CompressedOops::is_disjoint_heap_base_address(address addr) { // Check for disjoint base compressed oops. bool CompressedOops::base_disjoint() { - return _narrow_oop._base != nullptr && is_disjoint_heap_base_address(_narrow_oop._base); + return _base != nullptr && is_disjoint_heap_base_address(_base); } // Check for real heapbased compressed oops. // We must subtract the base as the bits overlap. // If we negate above function, we also get unscaled and zerobased. bool CompressedOops::base_overlaps() { - return _narrow_oop._base != nullptr && !is_disjoint_heap_base_address(_narrow_oop._base); + return _base != nullptr && !is_disjoint_heap_base_address(_base); } void CompressedOops::print_mode(outputStream* st) { diff --git a/src/hotspot/share/oops/compressedOops.hpp b/src/hotspot/share/oops/compressedOops.hpp index cd3f00393ca44..33af420305cba 100644 --- a/src/hotspot/share/oops/compressedOops.hpp +++ b/src/hotspot/share/oops/compressedOops.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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,23 +34,18 @@ class outputStream; class ReservedHeapSpace; -struct NarrowPtrStruct { +class CompressedOops : public AllStatic { + friend class VMStructs; + // Base address for oop-within-java-object materialization. // null if using wide oops or zero based narrow oops. - address _base; + static address _base; // Number of shift bits for encoding/decoding narrow ptrs. - // 0 if using wide ptrs or zero based unscaled narrow ptrs, + // 0 if using wide oops or zero based unscaled narrow oops, // LogMinObjAlignmentInBytes otherwise. - int _shift; - // Generate code with implicit null checks for narrow ptrs. - bool _use_implicit_null_checks; -}; - -class CompressedOops : public AllStatic { - friend class VMStructs; - - // For UseCompressedOops. - static NarrowPtrStruct _narrow_oop; + static int _shift; + // Generate code with implicit null checks for narrow oops. + static bool _use_implicit_null_checks; // The address range of the heap static MemRegion _heap_address_range; @@ -73,8 +68,7 @@ class CompressedOops : public AllStatic { UnscaledNarrowOop = 0, ZeroBasedNarrowOop = 1, DisjointBaseNarrowOop = 2, - HeapBasedNarrowOop = 3, - AnyNarrowOopMode = 4 + HeapBasedNarrowOop = 3 }; // The representation type for narrowOop is assumed to be uint32_t. @@ -87,15 +81,13 @@ class CompressedOops : public AllStatic { static void set_shift(int shift); static void set_use_implicit_null_checks(bool use); - static address base() { return _narrow_oop._base; } + static address base() { return _base; } + static address base_addr() { return (address)&_base; } static address begin() { return (address)_heap_address_range.start(); } static address end() { return (address)_heap_address_range.end(); } static bool is_base(void* addr) { return (base() == (address)addr); } - static int shift() { return _narrow_oop._shift; } - static bool use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; } - - static address ptrs_base_addr() { return (address)&_narrow_oop._base; } - static address ptrs_base() { return _narrow_oop._base; } + static int shift() { return _shift; } + static bool use_implicit_null_checks() { return _use_implicit_null_checks; } static bool is_in(void* addr); static bool is_in(MemRegion mr); diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp index 817a35959f348..321d8add75594 100644 --- a/src/hotspot/share/oops/cpCache.cpp +++ b/src/hotspot/share/oops/cpCache.cpp @@ -604,6 +604,7 @@ void ConstantPoolCache::adjust_method_entries(bool * trace_name_printed) { if (old_method == nullptr || !old_method->is_old()) { continue; } + assert(!old_method->is_deleted(), "cannot delete these methods"); Method* new_method = old_method->get_new_method(); resolved_indy_entry_at(j)->adjust_method_entry(new_method); log_adjust("indy", old_method, new_method, trace_name_printed); diff --git a/src/hotspot/share/oops/oop.cpp b/src/hotspot/share/oops/oop.cpp index fde91969ea5ef..38dee491a103e 100644 --- a/src/hotspot/share/oops/oop.cpp +++ b/src/hotspot/share/oops/oop.cpp @@ -218,14 +218,3 @@ void oopDesc::release_float_field_put(int offset, jfloat value) { Atomic:: jdouble oopDesc::double_field_acquire(int offset) const { return Atomic::load_acquire(field_addr(offset)); } void oopDesc::release_double_field_put(int offset, jdouble value) { Atomic::release_store(field_addr(offset), value); } - -#ifdef ASSERT -bool oopDesc::size_might_change() { - // UseParallelGC and UseG1GC can change the length field - // of an "old copy" of an object array in the young gen so it indicates - // the grey portion of an already copied array. This will cause the first - // disjunct below to fail if the two comparands are computed across such - // a concurrent change. - return Universe::heap()->is_stw_gc_active() && is_objArray() && is_forwarded() && (UseParallelGC || UseG1GC); -} -#endif diff --git a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp index 2d827699b41fa..a330b3df529a4 100644 --- a/src/hotspot/share/oops/oop.hpp +++ b/src/hotspot/share/oops/oop.hpp @@ -319,8 +319,6 @@ class oopDesc { // for error reporting static void* load_oop_raw(oop obj, int offset); - - DEBUG_ONLY(bool size_might_change();) }; // An oopDesc is not initialized via a constructor. Space is allocated in diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp index ffcc9af24c328..95b99b215fa8f 100644 --- a/src/hotspot/share/oops/oop.inline.hpp +++ b/src/hotspot/share/oops/oop.inline.hpp @@ -190,7 +190,7 @@ size_t oopDesc::size_given_klass(Klass* klass) { // skipping the intermediate round to HeapWordSize. s = align_up(size_in_bytes, MinObjAlignmentInBytes) / HeapWordSize; - assert(s == klass->oop_size(this) || size_might_change(), "wrong array object size"); + assert(s == klass->oop_size(this), "wrong array object size"); } else { // Must be zero, so bite the bullet and take the virtual call. s = klass->oop_size(this); diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index 7288533cd33e7..42de77acca931 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -58,6 +58,9 @@ product(bool, StressMacroExpansion, false, DIAGNOSTIC, \ "Randomize macro node expansion order") \ \ + product(bool, StressUnstableIfTraps, false, DIAGNOSTIC, \ + "Randomly take unstable if traps") \ + \ product(uint, StressSeed, 0, DIAGNOSTIC, \ "Seed for randomized stress testing (if unset, a random one is " \ "generated). The seed is recorded in the compilation log, if " \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index 2f087858efd48..117e06acd6f31 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -610,6 +610,7 @@ bool C2Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + case vmIntrinsics::_dtanh: case vmIntrinsics::_dabs: case vmIntrinsics::_fabs: case vmIntrinsics::_iabs: diff --git a/src/hotspot/share/opto/cfgnode.hpp b/src/hotspot/share/opto/cfgnode.hpp index 5edd31fa71695..ac8896705dea0 100644 --- a/src/hotspot/share/opto/cfgnode.hpp +++ b/src/hotspot/share/opto/cfgnode.hpp @@ -347,7 +347,6 @@ class IfNode : public MultiBranchNode { bool is_null_check(ProjNode* proj, PhaseIterGVN* igvn); bool is_side_effect_free_test(ProjNode* proj, PhaseIterGVN* igvn); void reroute_side_effect_free_unc(ProjNode* proj, ProjNode* dom_proj, PhaseIterGVN* igvn); - ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call) const; bool fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn); static bool is_dominator_unc(CallStaticJavaNode* dom_unc, CallStaticJavaNode* unc); @@ -442,6 +441,7 @@ class IfNode : public MultiBranchNode { static Node* up_one_dom(Node* curr, bool linear_only = false); bool is_zero_trip_guard() const; Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_access_nodes); + ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call, Deoptimization::DeoptReason reason = Deoptimization::Reason_none) const; // Takes the type of val and filters it through the test represented // by if_proj and returns a more refined type if one is produced. diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 58a716abd216c..5abc398cb8ce2 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -719,6 +719,11 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci, method()->ensure_method_data(); } + if (StressLCM || StressGCM || StressIGVN || StressCCP || + StressIncrementalInlining || StressMacroExpansion || StressUnstableIfTraps) { + initialize_stress_seed(directive); + } + Init(/*do_aliasing=*/ true); print_compile_messages(); @@ -843,11 +848,6 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci, if (failing()) return; NOT_PRODUCT( verify_graph_edges(); ) - if (StressLCM || StressGCM || StressIGVN || StressCCP || - StressIncrementalInlining || StressMacroExpansion) { - initialize_stress_seed(directive); - } - // Now optimize Optimize(); if (failing()) return; @@ -3161,6 +3161,30 @@ void Compile::final_graph_reshaping_impl(Node *n, Final_Reshape_Counts& frc, Uni } } +void Compile::handle_div_mod_op(Node* n, BasicType bt, bool is_unsigned) { + if (!UseDivMod) { + return; + } + + // Check if "a % b" and "a / b" both exist + Node* d = n->find_similar(Op_DivIL(bt, is_unsigned)); + if (d == nullptr) { + return; + } + + // Replace them with a fused divmod if supported + if (Matcher::has_match_rule(Op_DivModIL(bt, is_unsigned))) { + DivModNode* divmod = DivModNode::make(n, bt, is_unsigned); + d->subsume_by(divmod->div_proj(), this); + n->subsume_by(divmod->mod_proj(), this); + } else { + // Replace "a % b" with "a - ((a / b) * b)" + Node* mult = MulNode::make(d, d->in(2), bt); + Node* sub = SubNode::make(d->in(1), mult, bt); + n->subsume_by(sub, this); + } +} + void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop, Unique_Node_List& dead_nodes) { switch( nop ) { // Count all float operations that may use FPU @@ -3323,8 +3347,9 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f bool is_oop = t->isa_oopptr() != nullptr; bool is_klass = t->isa_klassptr() != nullptr; - if ((is_oop && Matcher::const_oop_prefer_decode() ) || - (is_klass && Matcher::const_klass_prefer_decode())) { + if ((is_oop && UseCompressedOops && Matcher::const_oop_prefer_decode() ) || + (is_klass && UseCompressedClassPointers && Matcher::const_klass_prefer_decode() && + t->isa_klassptr()->exact_klass()->is_in_encoding_range())) { Node* nn = nullptr; int op = is_oop ? Op_ConN : Op_ConNKlass; @@ -3609,83 +3634,19 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f #endif case Op_ModI: - if (UseDivMod) { - // Check if a%b and a/b both exist - Node* d = n->find_similar(Op_DivI); - if (d) { - // Replace them with a fused divmod if supported - if (Matcher::has_match_rule(Op_DivModI)) { - DivModINode* divmod = DivModINode::make(n); - d->subsume_by(divmod->div_proj(), this); - n->subsume_by(divmod->mod_proj(), this); - } else { - // replace a%b with a-((a/b)*b) - Node* mult = new MulINode(d, d->in(2)); - Node* sub = new SubINode(d->in(1), mult); - n->subsume_by(sub, this); - } - } - } + handle_div_mod_op(n, T_INT, false); break; case Op_ModL: - if (UseDivMod) { - // Check if a%b and a/b both exist - Node* d = n->find_similar(Op_DivL); - if (d) { - // Replace them with a fused divmod if supported - if (Matcher::has_match_rule(Op_DivModL)) { - DivModLNode* divmod = DivModLNode::make(n); - d->subsume_by(divmod->div_proj(), this); - n->subsume_by(divmod->mod_proj(), this); - } else { - // replace a%b with a-((a/b)*b) - Node* mult = new MulLNode(d, d->in(2)); - Node* sub = new SubLNode(d->in(1), mult); - n->subsume_by(sub, this); - } - } - } + handle_div_mod_op(n, T_LONG, false); break; case Op_UModI: - if (UseDivMod) { - // Check if a%b and a/b both exist - Node* d = n->find_similar(Op_UDivI); - if (d) { - // Replace them with a fused unsigned divmod if supported - if (Matcher::has_match_rule(Op_UDivModI)) { - UDivModINode* divmod = UDivModINode::make(n); - d->subsume_by(divmod->div_proj(), this); - n->subsume_by(divmod->mod_proj(), this); - } else { - // replace a%b with a-((a/b)*b) - Node* mult = new MulINode(d, d->in(2)); - Node* sub = new SubINode(d->in(1), mult); - n->subsume_by(sub, this); - } - } - } + handle_div_mod_op(n, T_INT, true); break; case Op_UModL: - if (UseDivMod) { - // Check if a%b and a/b both exist - Node* d = n->find_similar(Op_UDivL); - if (d) { - // Replace them with a fused unsigned divmod if supported - if (Matcher::has_match_rule(Op_UDivModL)) { - UDivModLNode* divmod = UDivModLNode::make(n); - d->subsume_by(divmod->div_proj(), this); - n->subsume_by(divmod->mod_proj(), this); - } else { - // replace a%b with a-((a/b)*b) - Node* mult = new MulLNode(d, d->in(2)); - Node* sub = new SubLNode(d->in(1), mult); - n->subsume_by(sub, this); - } - } - } + handle_div_mod_op(n, T_LONG, true); break; case Op_LoadVector: diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index e1574da568bf9..13ad980434b79 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -1216,6 +1216,7 @@ class Compile : public Phase { void final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop, Unique_Node_List& dead_nodes); void final_graph_reshaping_walk(Node_Stack& nstack, Node* root, Final_Reshape_Counts& frc, Unique_Node_List& dead_nodes); void eliminate_redundant_card_marks(Node* n); + void handle_div_mod_op(Node* n, BasicType bt, bool is_unsigned); // Logic cone optimization. void optimize_logic_cones(PhaseIterGVN &igvn); diff --git a/src/hotspot/share/opto/divnode.cpp b/src/hotspot/share/opto/divnode.cpp index 967d6661eec54..b9a207b2deea1 100644 --- a/src/hotspot/share/opto/divnode.cpp +++ b/src/hotspot/share/opto/divnode.cpp @@ -1360,6 +1360,24 @@ DivModNode::DivModNode( Node *c, Node *dividend, Node *divisor ) : MultiNode(3) init_req(2, divisor); } +DivModNode* DivModNode::make(Node* div_or_mod, BasicType bt, bool is_unsigned) { + assert(bt == T_INT || bt == T_LONG, "only int or long input pattern accepted"); + + if (bt == T_INT) { + if (is_unsigned) { + return UDivModINode::make(div_or_mod); + } else { + return DivModINode::make(div_or_mod); + } + } else { + if (is_unsigned) { + return UDivModLNode::make(div_or_mod); + } else { + return DivModLNode::make(div_or_mod); + } + } +} + //------------------------------make------------------------------------------ DivModINode* DivModINode::make(Node* div_or_mod) { Node* n = div_or_mod; diff --git a/src/hotspot/share/opto/divnode.hpp b/src/hotspot/share/opto/divnode.hpp index 12368642fb2d0..b2298faee780d 100644 --- a/src/hotspot/share/opto/divnode.hpp +++ b/src/hotspot/share/opto/divnode.hpp @@ -202,6 +202,8 @@ class DivModNode : public MultiNode { virtual bool is_CFG() const { return false; } virtual uint ideal_reg() const { return NotAMachineReg; } + static DivModNode* make(Node* div_or_mod, BasicType bt, bool is_unsigned); + ProjNode* div_proj() { return proj_out_or_null(div_proj_num); } ProjNode* mod_proj() { return proj_out_or_null(mod_proj_num); } }; diff --git a/src/hotspot/share/opto/escape.cpp b/src/hotspot/share/opto/escape.cpp index eb6887f11baf6..6ab28eaa6eeba 100644 --- a/src/hotspot/share/opto/escape.cpp +++ b/src/hotspot/share/opto/escape.cpp @@ -2043,7 +2043,7 @@ void ConnectionGraph::add_call_node(CallNode* call) { ciMethod* meth = call->as_CallJava()->method(); if (meth == nullptr) { const char* name = call->as_CallStaticJava()->_name; - assert(strncmp(name, "_multianewarray", 15) == 0, "TODO: add failed case check"); + assert(strncmp(name, "C2 Runtime multianewarray", 25) == 0, "TODO: add failed case check"); // Returns a newly allocated non-escaped object. add_java_object(call, PointsToNode::NoEscape); set_not_scalar_replaceable(ptnode_adr(call_idx) NOT_PRODUCT(COMMA "is result of multinewarray")); @@ -2738,7 +2738,7 @@ int ConnectionGraph::find_init_values_phantom(JavaObjectNode* pta) { #ifdef ASSERT if (!pta->arraycopy_dst() && alloc->as_CallStaticJava()->method() == nullptr) { const char* name = alloc->as_CallStaticJava()->_name; - assert(strncmp(name, "_multianewarray", 15) == 0, "sanity"); + assert(strncmp(name, "C2 Runtime multianewarray", 25) == 0, "sanity"); } #endif // Non-escaped allocation returned from Java or runtime call have unknown values in fields. diff --git a/src/hotspot/share/opto/gcm.cpp b/src/hotspot/share/opto/gcm.cpp index 3880bea07d711..4646e1bb9c701 100644 --- a/src/hotspot/share/opto/gcm.cpp +++ b/src/hotspot/share/opto/gcm.cpp @@ -562,6 +562,103 @@ bool PhaseCFG::unrelated_load_in_store_null_block(Node* store, Node* load) { return false; } +class DefUseMemStatesQueue : public StackObj { +private: + class DefUsePair : public StackObj { + private: + Node* _def; // memory state + Node* _use; // use of the memory state that also modifies the memory state + + public: + DefUsePair(Node* def, Node* use) : + _def(def), _use(use) { + } + + DefUsePair() : + _def(nullptr), _use(nullptr) { + } + + Node* def() const { + return _def; + } + + Node* use() const { + return _use; + } + }; + + GrowableArray _queue; + GrowableArray _worklist_visited; // visited mergemem nodes + + bool already_enqueued(Node* def_mem, PhiNode* use_phi) const { + // def_mem is one of the inputs of use_phi and at least one input of use_phi is + // not def_mem. It's however possible that use_phi has def_mem as input multiple + // times. If that happens, use_phi is recorded as a use of def_mem multiple + // times as well. When PhaseCFG::insert_anti_dependences() goes over + // uses of def_mem and enqueues them for processing, use_phi would then be + // enqueued for processing multiple times when it only needs to be + // processed once. The code below checks if use_phi as a use of def_mem was + // already enqueued to avoid redundant processing of use_phi. + int j = _queue.length()-1; + // If there are any use of def_mem already enqueued, they were enqueued + // last (all use of def_mem are processed in one go). + for (; j >= 0; j--) { + const DefUsePair& def_use_pair = _queue.at(j); + if (def_use_pair.def() != def_mem) { + // We're done with the uses of def_mem + break; + } + if (def_use_pair.use() == use_phi) { + return true; + } + } +#ifdef ASSERT + for (; j >= 0; j--) { + const DefUsePair& def_use_pair = _queue.at(j); + assert(def_use_pair.def() != def_mem, "Should be done with the uses of def_mem"); + } +#endif + return false; + } + +public: + DefUseMemStatesQueue(ResourceArea* area) { + } + + void push(Node* def_mem_state, Node* use_mem_state) { + if (use_mem_state->is_MergeMem()) { + // Be sure we don't get into combinatorial problems. + if (!_worklist_visited.append_if_missing(use_mem_state->as_MergeMem())) { + return; // already on work list; do not repeat + } + } else if (use_mem_state->is_Phi()) { + // A Phi could have the same mem as input multiple times. If that's the case, we don't need to enqueue it + // more than once. We otherwise allow phis to be repeated; they can merge two relevant states. + if (already_enqueued(def_mem_state, use_mem_state->as_Phi())) { + return; + } + } + + _queue.push(DefUsePair(def_mem_state, use_mem_state)); + } + + bool is_nonempty() const { + return _queue.is_nonempty(); + } + + Node* top_def() const { + return _queue.top().def(); + } + + Node* top_use() const { + return _queue.top().use(); + } + + void pop() { + _queue.pop(); + } +}; + //--------------------------insert_anti_dependences--------------------------- // A load may need to witness memory that nearby stores can overwrite. // For each nearby store, either insert an "anti-dependence" edge @@ -579,6 +676,7 @@ bool PhaseCFG::unrelated_load_in_store_null_block(Node* store, Node* load) { // preserve anti-dependences. The caller may also hoist the load // above the LCA, if it is not the early block. Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { + ResourceMark rm; assert(load->needs_anti_dependence_check(), "must be a load of some sort"); assert(LCA != nullptr, ""); DEBUG_ONLY(Block* LCA_orig = LCA); @@ -625,10 +723,8 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { early = memory_early_block(load, early, this); } - ResourceArea *area = Thread::current()->resource_area(); - Node_List worklist_mem(area); // prior memory state to store - Node_List worklist_store(area); // possible-def to explore - Node_List worklist_visited(area); // visited mergemem nodes + ResourceArea* area = Thread::current()->resource_area(); + DefUseMemStatesQueue worklist_def_use_mem_states(area); // prior memory state to store and possible-def to explore Node_List non_early_stores(area); // all relevant stores outside of early bool must_raise_LCA = false; @@ -644,60 +740,56 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { // The relevant stores "nearby" the load consist of a tree rooted // at initial_mem, with internal nodes of type MergeMem. // Therefore, the branches visited by the worklist are of this form: - // initial_mem -> (MergeMem ->)* store + // initial_mem -> (MergeMem ->)* Memory state modifying node + // Memory state modifying nodes include Store and Phi nodes and any node for which needs_anti_dependence_check() + // returns false. // The anti-dependence constraints apply only to the fringe of this tree. Node* initial_mem = load->in(MemNode::Memory); - worklist_store.push(initial_mem); - worklist_visited.push(initial_mem); - worklist_mem.push(nullptr); - while (worklist_store.size() > 0) { + worklist_def_use_mem_states.push(nullptr, initial_mem); + while (worklist_def_use_mem_states.is_nonempty()) { // Examine a nearby store to see if it might interfere with our load. - Node* mem = worklist_mem.pop(); - Node* store = worklist_store.pop(); - uint op = store->Opcode(); + Node* def_mem_state = worklist_def_use_mem_states.top_def(); + Node* use_mem_state = worklist_def_use_mem_states.top_use(); + worklist_def_use_mem_states.pop(); + + uint op = use_mem_state->Opcode(); + assert(!use_mem_state->needs_anti_dependence_check(), "no loads"); // MergeMems do not directly have anti-deps. // Treat them as internal nodes in a forward tree of memory states, // the leaves of which are each a 'possible-def'. - if (store == initial_mem // root (exclusive) of tree we are searching + if (use_mem_state == initial_mem // root (exclusive) of tree we are searching || op == Op_MergeMem // internal node of tree we are searching ) { - mem = store; // It's not a possibly interfering store. - if (store == initial_mem) + def_mem_state = use_mem_state; // It's not a possibly interfering store. + if (use_mem_state == initial_mem) initial_mem = nullptr; // only process initial memory once - for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) { - store = mem->fast_out(i); - if (store->is_MergeMem()) { - // Be sure we don't get into combinatorial problems. - // (Allow phis to be repeated; they can merge two relevant states.) - uint j = worklist_visited.size(); - for (; j > 0; j--) { - if (worklist_visited.at(j-1) == store) break; - } - if (j > 0) continue; // already on work list; do not repeat - worklist_visited.push(store); + for (DUIterator_Fast imax, i = def_mem_state->fast_outs(imax); i < imax; i++) { + use_mem_state = def_mem_state->fast_out(i); + if (use_mem_state->needs_anti_dependence_check()) { + // use_mem_state is also a kind of load (i.e. needs_anti_dependence_check), and it is not a memory state + // modifying node (store, Phi or MergeMem). Hence, load can't be anti dependent on this node. + continue; } - worklist_mem.push(mem); - worklist_store.push(store); + worklist_def_use_mem_states.push(def_mem_state, use_mem_state); } continue; } if (op == Op_MachProj || op == Op_Catch) continue; - if (store->needs_anti_dependence_check()) continue; // not really a store // Compute the alias index. Loads and stores with different alias // indices do not need anti-dependence edges. Wide MemBar's are // anti-dependent on everything (except immutable memories). - const TypePtr* adr_type = store->adr_type(); + const TypePtr* adr_type = use_mem_state->adr_type(); if (!C->can_alias(adr_type, load_alias_idx)) continue; // Most slow-path runtime calls do NOT modify Java memory, but // they can block and so write Raw memory. - if (store->is_Mach()) { - MachNode* mstore = store->as_Mach(); + if (use_mem_state->is_Mach()) { + MachNode* mstore = use_mem_state->as_Mach(); if (load_alias_idx != Compile::AliasIdxRaw) { // Check for call into the runtime using the Java calling // convention (and from there into a wrapper); it has no @@ -736,10 +828,10 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { // or else observe that 'store' is all the way up in the // earliest legal block for 'load'. In the latter case, // immediately insert an anti-dependence edge. - Block* store_block = get_block_for_node(store); + Block* store_block = get_block_for_node(use_mem_state); assert(store_block != nullptr, "unused killing projections skipped above"); - if (store->is_Phi()) { + if (use_mem_state->is_Phi()) { // Loop-phis need to raise load before input. (Other phis are treated // as store below.) // @@ -754,8 +846,8 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { // Do not assert(store_block != early, "Phi merging memory after access") // PhiNode may be at start of block 'early' with backedge to 'early' DEBUG_ONLY(bool found_match = false); - for (uint j = PhiNode::Input, jmax = store->req(); j < jmax; j++) { - if (store->in(j) == mem) { // Found matching input? + for (uint j = PhiNode::Input, jmax = use_mem_state->req(); j < jmax; j++) { + if (use_mem_state->in(j) == def_mem_state) { // Found matching input? DEBUG_ONLY(found_match = true); Block* pred_block = get_block_for_node(store_block->pred(j)); if (pred_block != early) { @@ -781,21 +873,21 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { // will find him on the non_early_stores list and stick him // with a precedence edge. // (But, don't bother if LCA is already raised all the way.) - if (LCA != early && !unrelated_load_in_store_null_block(store, load)) { + if (LCA != early && !unrelated_load_in_store_null_block(use_mem_state, load)) { store_block->set_raise_LCA_mark(load_index); must_raise_LCA = true; - non_early_stores.push(store); + non_early_stores.push(use_mem_state); } } else { // Found a possibly-interfering store in the load's 'early' block. // This means 'load' cannot sink at all in the dominator tree. // Add an anti-dep edge, and squeeze 'load' into the highest block. - assert(store != load->find_exact_control(load->in(0)), "dependence cycle found"); + assert(use_mem_state != load->find_exact_control(load->in(0)), "dependence cycle found"); if (verify) { - assert(store->find_edge(load) != -1 || unrelated_load_in_store_null_block(store, load), + assert(use_mem_state->find_edge(load) != -1 || unrelated_load_in_store_null_block(use_mem_state, load), "missing precedence edge"); } else { - store->add_prec(load); + use_mem_state->add_prec(load); } LCA = early; // This turns off the process of gathering non_early_stores. diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index 8e5cd2702137a..4313b2cf907a9 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -840,9 +840,9 @@ bool IfNode::is_dominator_unc(CallStaticJavaNode* dom_unc, CallStaticJavaNode* u } // Return projection that leads to an uncommon trap if any -ProjNode* IfNode::uncommon_trap_proj(CallStaticJavaNode*& call) const { +ProjNode* IfNode::uncommon_trap_proj(CallStaticJavaNode*& call, Deoptimization::DeoptReason reason) const { for (int i = 0; i < 2; i++) { - call = proj_out(i)->is_uncommon_trap_proj(); + call = proj_out(i)->is_uncommon_trap_proj(reason); if (call != nullptr) { return proj_out(i); } diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index c95a450272989..8bbb2f8115ec4 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -254,6 +254,7 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: + case vmIntrinsics::_dtanh: case vmIntrinsics::_dabs: case vmIntrinsics::_fabs: case vmIntrinsics::_iabs: @@ -1879,6 +1880,9 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { return StubRoutines::dtan() != nullptr ? runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dtan(), "dtan") : runtime_math(OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dtan), "TAN"); + case vmIntrinsics::_dtanh: + return StubRoutines::dtanh() != nullptr ? + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dtanh(), "dtanh") : false; case vmIntrinsics::_dexp: return StubRoutines::dexp() != nullptr ? runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dexp(), "dexp") : diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 6e53705464366..59662ad53fe07 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -1683,8 +1683,8 @@ void PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree *loop, Node_List &old_n // use by range check elimination. Node *pre_opaq = new Opaque1Node(C, pre_limit, limit); - register_new_node(pre_limit, pre_head->in(0)); - register_new_node(pre_opaq , pre_head->in(0)); + register_new_node(pre_limit, pre_head->in(LoopNode::EntryControl)); + register_new_node(pre_opaq , pre_head->in(LoopNode::EntryControl)); // Since no other users of pre-loop compare, I can hack limit directly assert(cmp_end->outcnt() == 1, "no other users"); @@ -2790,6 +2790,7 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // Find the main loop limit; we will trim it's iterations // to not ever trip end tests Node *main_limit = cl->limit(); + Node* main_limit_ctrl = get_ctrl(main_limit); // Check graph shape. Cannot optimize a loop if zero-trip // Opaque1 node is optimized away and then another round @@ -2822,9 +2823,15 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { } Opaque1Node *pre_opaq = (Opaque1Node*)pre_opaq1; Node *pre_limit = pre_opaq->in(1); + Node* pre_limit_ctrl = get_ctrl(pre_limit); // Where do we put new limit calculations - Node *pre_ctrl = pre_end->loopnode()->in(LoopNode::EntryControl); + Node* pre_ctrl = pre_end->loopnode()->in(LoopNode::EntryControl); + // Range check elimination optimizes out conditions whose parameters are loop invariant in the main loop. They usually + // have control above the pre loop, but there's no guarantee that they do. There's no guarantee either that the pre + // loop limit has control that's out of loop (a previous round of range check elimination could have set a limit that's + // not loop invariant). + Node* new_limit_ctrl = dominated_node(pre_ctrl, pre_limit_ctrl); // Ensure the original loop limit is available from the // pre-loop Opaque1 node. @@ -2884,14 +2891,14 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { Node *limit = cmp->in(2); int scale_con= 1; // Assume trip counter not scaled - Node *limit_c = get_ctrl(limit); - if (loop->is_member(get_loop(limit_c))) { + Node* limit_ctrl = get_ctrl(limit); + if (loop->is_member(get_loop(limit_ctrl))) { // Compare might have operands swapped; commute them b_test = b_test.commute(); rc_exp = cmp->in(2); limit = cmp->in(1); - limit_c = get_ctrl(limit); - if (loop->is_member(get_loop(limit_c))) { + limit_ctrl = get_ctrl(limit); + if (loop->is_member(get_loop(limit_ctrl))) { continue; // Both inputs are loop varying; cannot RCE } } @@ -2900,11 +2907,11 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // 'limit' maybe pinned below the zero trip test (probably from a // previous round of rce), in which case, it can't be used in the // zero trip test expression which must occur before the zero test's if. - if (is_dominator(ctrl, limit_c)) { + if (is_dominator(ctrl, limit_ctrl)) { continue; // Don't rce this check but continue looking for other candidates. } - assert(is_dominator(compute_early_ctrl(limit, limit_c), pre_end), "node pinned on loop exit test?"); + assert(is_dominator(compute_early_ctrl(limit, limit_ctrl), pre_end), "node pinned on loop exit test?"); // Check for scaled induction variable plus an offset Node *offset = nullptr; @@ -2913,19 +2920,26 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { continue; } - Node *offset_c = get_ctrl(offset); - if (loop->is_member(get_loop(offset_c))) { + Node* offset_ctrl = get_ctrl(offset); + if (loop->is_member(get_loop(offset_ctrl))) { continue; // Offset is not really loop invariant } // Here we know 'offset' is loop invariant. // As above for the 'limit', the 'offset' maybe pinned below the // zero trip test. - if (is_dominator(ctrl, offset_c)) { + if (is_dominator(ctrl, offset_ctrl)) { continue; // Don't rce this check but continue looking for other candidates. } - assert(is_dominator(compute_early_ctrl(offset, offset_c), pre_end), "node pinned on loop exit test?"); + // offset and limit can have control set below the pre loop when they are not loop invariant in the pre loop. + // Update their control (and the control of inputs as needed) to be above pre_end + offset_ctrl = ensure_node_and_inputs_are_above_pre_end(pre_end, offset); + limit_ctrl = ensure_node_and_inputs_are_above_pre_end(pre_end, limit); + + // offset and limit could have control below new_limit_ctrl if they are not loop invariant in the pre loop. + new_limit_ctrl = dominated_node(new_limit_ctrl, offset_ctrl, limit_ctrl); + #ifdef ASSERT if (TraceRangeLimitCheck) { tty->print_cr("RC bool node%s", flip ? " flipped:" : ":"); @@ -2945,16 +2959,16 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { jlong lscale_con = scale_con; Node* int_offset = offset; offset = new ConvI2LNode(offset); - register_new_node(offset, pre_ctrl); + register_new_node(offset, new_limit_ctrl); Node* int_limit = limit; limit = new ConvI2LNode(limit); - register_new_node(limit, pre_ctrl); + register_new_node(limit, new_limit_ctrl); // Adjust pre and main loop limits to guard the correct iteration set if (cmp->Opcode() == Op_CmpU) { // Unsigned compare is really 2 tests if (b_test._test == BoolTest::lt) { // Range checks always use lt // The underflow and overflow limits: 0 <= scale*I+offset < limit - add_constraint(stride_con, lscale_con, offset, zero, limit, pre_ctrl, &pre_limit, &main_limit); + add_constraint(stride_con, lscale_con, offset, zero, limit, new_limit_ctrl, &pre_limit, &main_limit); Node* init = cl->init_trip(); Node* opaque_init = new OpaqueLoopInitNode(C, init); register_new_node(opaque_init, loop_entry); @@ -3013,22 +3027,22 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // Convert (I*scale+offset) >= Limit to (I*(-scale)+(-offset)) <= -Limit lscale_con = -lscale_con; offset = new SubLNode(zero, offset); - register_new_node(offset, pre_ctrl); + register_new_node(offset, new_limit_ctrl); limit = new SubLNode(zero, limit); - register_new_node(limit, pre_ctrl); + register_new_node(limit, new_limit_ctrl); // Fall into LE case case BoolTest::le: if (b_test._test != BoolTest::gt) { // Convert X <= Y to X < Y+1 limit = new AddLNode(limit, one); - register_new_node(limit, pre_ctrl); + register_new_node(limit, new_limit_ctrl); } // Fall into LT case case BoolTest::lt: // The underflow and overflow limits: MIN_INT <= scale*I+offset < limit // Note: (MIN_INT+1 == -MAX_INT) is used instead of MIN_INT here // to avoid problem with scale == -1: MIN_INT/(-1) == MIN_INT. - add_constraint(stride_con, lscale_con, offset, mini, limit, pre_ctrl, &pre_limit, &main_limit); + add_constraint(stride_con, lscale_con, offset, mini, limit, new_limit_ctrl, &pre_limit, &main_limit); break; default: if (PrintOpto) { @@ -3072,8 +3086,14 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // Computed pre-loop limit can be outside of loop iterations range. pre_limit = (stride_con > 0) ? (Node*)new MinINode(pre_limit, orig_limit) : (Node*)new MaxINode(pre_limit, orig_limit); - register_new_node(pre_limit, pre_ctrl); + register_new_node(pre_limit, new_limit_ctrl); } + // new pre_limit can push Bool/Cmp/Opaque nodes down (when one of the eliminated condition has parameters that are not + // loop invariant in the pre loop. + set_ctrl(pre_opaq, new_limit_ctrl); + set_ctrl(pre_end->cmp_node(), new_limit_ctrl); + set_ctrl(pre_end->in(1), new_limit_ctrl); + _igvn.replace_input_of(pre_opaq, 1, pre_limit); // Note:: we are making the main loop limit no longer precise; @@ -3093,7 +3113,7 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { register_new_node(main_cmp, main_cle->in(0)); _igvn.replace_input_of(main_bol, 1, main_cmp); } - assert(main_limit == cl->limit() || get_ctrl(main_limit) == pre_ctrl, "wrong control for added limit"); + assert(main_limit == cl->limit() || get_ctrl(main_limit) == new_limit_ctrl, "wrong control for added limit"); const TypeInt* orig_limit_t = _igvn.type(orig_limit)->is_int(); bool upward = cl->stride_con() > 0; // The new loop limit is <= (for an upward loop) >= (for a downward loop) than the orig limit. @@ -3101,7 +3121,7 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // may be too pessimistic. A CastII here guarantees it's not lost. main_limit = new CastIINode(pre_ctrl, main_limit, TypeInt::make(upward ? min_jint : orig_limit_t->_lo, upward ? orig_limit_t->_hi : max_jint, Type::WidenMax)); - register_new_node(main_limit, pre_ctrl); + register_new_node(main_limit, new_limit_ctrl); // Hack the now-private loop bounds _igvn.replace_input_of(main_cmp, 2, main_limit); if (abs_stride_is_one) { @@ -3112,6 +3132,37 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) { // The OpaqueNode is unshared by design assert(opqzm->outcnt() == 1, "cannot hack shared node"); _igvn.replace_input_of(opqzm, 1, main_limit); + // new main_limit can push Bool/Cmp nodes down (when one of the eliminated condition has parameters that are not loop + // invariant in the pre loop. + set_ctrl(opqzm, new_limit_ctrl); + set_ctrl(iffm->in(1)->in(1), new_limit_ctrl); + set_ctrl(iffm->in(1), new_limit_ctrl); +} + +// Adjust control for node and its inputs (and inputs of its inputs) to be above the pre end +Node* PhaseIdealLoop::ensure_node_and_inputs_are_above_pre_end(CountedLoopEndNode* pre_end, Node* node) { + Node* control = get_ctrl(node); + assert(is_dominator(compute_early_ctrl(node, control), pre_end), "node pinned on loop exit test?"); + + if (is_dominator(control, pre_end)) { + return control; + } + control = pre_end->in(0); + ResourceMark rm; + Unique_Node_List wq; + wq.push(node); + for (uint i = 0; i < wq.size(); i++) { + Node* n = wq.at(i); + assert(is_dominator(compute_early_ctrl(n, get_ctrl(n)), pre_end), "node pinned on loop exit test?"); + set_ctrl(n, control); + for (uint j = 0; j < n->req(); j++) { + Node* in = n->in(j); + if (in != nullptr && has_ctrl(in) && !is_dominator(get_ctrl(in), pre_end)) { + wq.push(in); + } + } + } + return control; } bool IdealLoopTree::compute_has_range_checks() const { diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 3128e23d79c49..b2a1a9d5e2102 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -1918,12 +1918,28 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ // Since stride > 0 and limit_correction <= stride + 1, we can restate this with no over- or underflow into: // max_int - canonicalized_correction - limit_correction >= limit // Since canonicalized_correction and limit_correction are both constants, we can replace them with a new constant: - // final_correction = canonicalized_correction + limit_correction + // (v) final_correction = canonicalized_correction + limit_correction + // // which gives us: // // Final predicate condition: // max_int - final_correction >= limit // + // However, we need to be careful that (v) does not over- or underflow. + // We know that: + // canonicalized_correction = stride - 1 + // and + // limit_correction <= stride + 1 + // and thus + // canonicalized_correction + limit_correction <= 2 * stride + // To prevent an over- or underflow of (v), we must ensure that + // 2 * stride <= max_int + // which can safely be checked without over- or underflow with + // (vi) stride != min_int AND abs(stride) <= max_int / 2 + // + // We could try to further optimize the cases where (vi) does not hold but given that such large strides are + // very uncommon and the loop would only run for a very few iterations anyway, we simply bail out if (vi) fails. + // // (2) Loop Limit Check Predicate for (ii): // Using (ii): init < limit // @@ -1954,6 +1970,10 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ // there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii) // again and can skip the predicate. + // Check (vi) and bail out if the stride is too big. + if (stride_con == min_signed_integer(iv_bt) || (ABS(stride_con) > max_signed_integer(iv_bt) / 2)) { + return false; + } // Accounting for (LE3) and (LE4) where we use pre-incremented phis in the loop exit check. const jlong limit_correction_for_pre_iv_exit_check = (phi_incr != nullptr) ? stride_con : 0; diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 6b2ad120a6380..2d169a6459b38 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1180,6 +1180,16 @@ class PhaseIdealLoop : public PhaseTransform { } Node *dom_lca_internal( Node *n1, Node *n2 ) const; + Node* dominated_node(Node* c1, Node* c2) { + assert(is_dominator(c1, c2) || is_dominator(c2, c1), "nodes must be related"); + return is_dominator(c1, c2) ? c2 : c1; + } + + // Return control node that's dominated by the 2 others + Node* dominated_node(Node* c1, Node* c2, Node* c3) { + return dominated_node(c1, dominated_node(c2, c3)); + } + // Build and verify the loop tree without modifying the graph. This // is useful to verify that all inputs properly dominate their uses. static void verify(PhaseIterGVN& igvn) { @@ -1780,6 +1790,8 @@ class PhaseIdealLoop : public PhaseTransform { bool can_move_to_inner_loop(Node* n, LoopNode* n_loop, Node* x); void pin_array_access_nodes_dependent_on(Node* ctrl); + + Node* ensure_node_and_inputs_are_above_pre_end(CountedLoopEndNode* pre_end, Node* node); }; diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index 1f22c60832388..ad98fda025f07 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -594,6 +594,69 @@ const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot) { return TypeLong::LONG; } +template +static const IntegerType* and_value(const IntegerType* r0, const IntegerType* r1) { + typedef typename IntegerType::NativeType NativeType; + static_assert(std::is_signed::value, "Native type of IntegerType must be signed!"); + + int widen = MAX2(r0->_widen, r1->_widen); + + // If both types are constants, we can calculate a constant result. + if (r0->is_con() && r1->is_con()) { + return IntegerType::make(r0->get_con() & r1->get_con()); + } + + // If both ranges are positive, the result will range from 0 up to the hi value of the smaller range. The minimum + // of the two constrains the upper bound because any higher value in the other range will see all zeroes, so it will be masked out. + if (r0->_lo >= 0 && r1->_lo >= 0) { + return IntegerType::make(0, MIN2(r0->_hi, r1->_hi), widen); + } + + // If only one range is positive, the result will range from 0 up to that range's maximum value. + // For the operation 'x & C' where C is a positive constant, the result will be in the range [0..C]. With that observation, + // we can say that for any integer c such that 0 <= c <= C will also be in the range [0..C]. Therefore, 'x & [c..C]' + // where c >= 0 will be in the range [0..C]. + if (r0->_lo >= 0) { + return IntegerType::make(0, r0->_hi, widen); + } + + if (r1->_lo >= 0) { + return IntegerType::make(0, r1->_hi, widen); + } + + // At this point, all positive ranges will have already been handled, so the only remaining cases will be negative ranges + // and constants. + + assert(r0->_lo < 0 && r1->_lo < 0, "positive ranges should already be handled!"); + + // As two's complement means that both numbers will start with leading 1s, the lower bound of both ranges will contain + // the common leading 1s of both minimum values. In order to count them with count_leading_zeros, the bits are inverted. + NativeType sel_val = ~MIN2(r0->_lo, r1->_lo); + + NativeType min; + if (sel_val == 0) { + // Since count_leading_zeros is undefined at 0, we short-circuit the condition where both ranges have a minimum of -1. + min = -1; + } else { + // To get the number of bits to shift, we count the leading 0-bits and then subtract one, as the sign bit is already set. + int shift_bits = count_leading_zeros(sel_val) - 1; + min = std::numeric_limits::min() >> shift_bits; + } + + NativeType max; + if (r0->_hi < 0 && r1->_hi < 0) { + // If both ranges are negative, then the same optimization as both positive ranges will apply, and the smaller hi + // value will mask off any bits set by higher values. + max = MIN2(r0->_hi, r1->_hi); + } else { + // In the case of ranges that cross zero, negative values can cause the higher order bits to be set, so the maximum + // positive value can be as high as the larger hi value. + max = MAX2(r0->_hi, r1->_hi); + } + + return IntegerType::make(min, max, widen); +} + //============================================================================= //------------------------------mul_ring--------------------------------------- // Supplied function returns the product of the inputs IN THE CURRENT RING. @@ -601,29 +664,10 @@ const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot) { // This also type-checks the inputs for sanity. Guaranteed never to // be passed a TOP or BOTTOM type, these are filtered out by pre-check. const Type *AndINode::mul_ring( const Type *t0, const Type *t1 ) const { - const TypeInt *r0 = t0->is_int(); // Handy access - const TypeInt *r1 = t1->is_int(); - int widen = MAX2(r0->_widen,r1->_widen); - - // If either input is a constant, might be able to trim cases - if( !r0->is_con() && !r1->is_con() ) - return TypeInt::INT; // No constants to be had - - // Both constants? Return bits - if( r0->is_con() && r1->is_con() ) - return TypeInt::make( r0->get_con() & r1->get_con() ); - - if( r0->is_con() && r0->get_con() > 0 ) - return TypeInt::make(0, r0->get_con(), widen); + const TypeInt* r0 = t0->is_int(); + const TypeInt* r1 = t1->is_int(); - if( r1->is_con() && r1->get_con() > 0 ) - return TypeInt::make(0, r1->get_con(), widen); - - if( r0 == TypeInt::BOOL || r1 == TypeInt::BOOL ) { - return TypeInt::BOOL; - } - - return TypeInt::INT; // No constants to be had + return and_value(r0, r1); } const Type* AndINode::Value(PhaseGVN* phase) const { @@ -751,25 +795,10 @@ Node *AndINode::Ideal(PhaseGVN *phase, bool can_reshape) { // This also type-checks the inputs for sanity. Guaranteed never to // be passed a TOP or BOTTOM type, these are filtered out by pre-check. const Type *AndLNode::mul_ring( const Type *t0, const Type *t1 ) const { - const TypeLong *r0 = t0->is_long(); // Handy access - const TypeLong *r1 = t1->is_long(); - int widen = MAX2(r0->_widen,r1->_widen); - - // If either input is a constant, might be able to trim cases - if( !r0->is_con() && !r1->is_con() ) - return TypeLong::LONG; // No constants to be had - - // Both constants? Return bits - if( r0->is_con() && r1->is_con() ) - return TypeLong::make( r0->get_con() & r1->get_con() ); - - if( r0->is_con() && r0->get_con() > 0 ) - return TypeLong::make(CONST64(0), r0->get_con(), widen); - - if( r1->is_con() && r1->get_con() > 0 ) - return TypeLong::make(CONST64(0), r1->get_con(), widen); + const TypeLong* r0 = t0->is_long(); + const TypeLong* r1 = t1->is_long(); - return TypeLong::LONG; // No constants to be had + return and_value(r0, r1); } const Type* AndLNode::Value(PhaseGVN* phase) const { diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index bc5842866a186..07a623e2f936d 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -2066,4 +2066,36 @@ inline int Op_Cast(BasicType bt) { return Op_CastLL; } +inline int Op_DivIL(BasicType bt, bool is_unsigned) { + assert(bt == T_INT || bt == T_LONG, "only for int or longs"); + if (bt == T_INT) { + if (is_unsigned) { + return Op_UDivI; + } else { + return Op_DivI; + } + } + if (is_unsigned) { + return Op_UDivL; + } else { + return Op_DivL; + } +} + +inline int Op_DivModIL(BasicType bt, bool is_unsigned) { + assert(bt == T_INT || bt == T_LONG, "only for int or longs"); + if (bt == T_INT) { + if (is_unsigned) { + return Op_UDivModI; + } else { + return Op_DivModI; + } + } + if (is_unsigned) { + return Op_UDivModL; + } else { + return Op_DivModL; + } +} + #endif // SHARE_OPTO_NODE_HPP diff --git a/src/hotspot/share/opto/parse.hpp b/src/hotspot/share/opto/parse.hpp index a2690aa6704f0..484c49367cc4d 100644 --- a/src/hotspot/share/opto/parse.hpp +++ b/src/hotspot/share/opto/parse.hpp @@ -612,6 +612,11 @@ class Parse : public GraphKit { // Use speculative type to optimize CmpP node Node* optimize_cmp_with_klass(Node* c); + // Stress unstable if traps + void stress_trap(IfNode* orig_iff, Node* counter, Node* incr_store); + // Increment counter used by StressUnstableIfTraps + void increment_trap_stress_counter(Node*& counter, Node*& incr_store); + public: #ifndef PRODUCT // Handle PrintOpto, etc. diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp index cbd9323c3a93a..6b7cb4eaa99e3 100644 --- a/src/hotspot/share/opto/parse2.cpp +++ b/src/hotspot/share/opto/parse2.cpp @@ -1371,10 +1371,27 @@ inline int Parse::repush_if_args() { return bc_depth; } +// Used by StressUnstableIfTraps +static volatile int _trap_stress_counter = 0; + +void Parse::increment_trap_stress_counter(Node*& counter, Node*& incr_store) { + Node* counter_addr = makecon(TypeRawPtr::make((address)&_trap_stress_counter)); + counter = make_load(control(), counter_addr, TypeInt::INT, T_INT, Compile::AliasIdxRaw, MemNode::unordered); + counter = _gvn.transform(new AddINode(counter, intcon(1))); + incr_store = store_to_memory(control(), counter_addr, counter, T_INT, Compile::AliasIdxRaw, MemNode::unordered); +} + //----------------------------------do_ifnull---------------------------------- void Parse::do_ifnull(BoolTest::mask btest, Node *c) { int target_bci = iter().get_dest(); + Node* counter = nullptr; + Node* incr_store = nullptr; + bool do_stress_trap = StressUnstableIfTraps && ((C->random() % 2) == 0); + if (do_stress_trap) { + increment_trap_stress_counter(counter, incr_store); + } + Block* branch_block = successor_for_bci(target_bci); Block* next_block = successor_for_bci(iter().next_bci()); @@ -1439,6 +1456,10 @@ void Parse::do_ifnull(BoolTest::mask btest, Node *c) { } else { // Path is live. adjust_map_after_if(BoolTest(btest).negate(), c, 1.0-prob, next_block); } + + if (do_stress_trap) { + stress_trap(iff, counter, incr_store); + } } //------------------------------------do_if------------------------------------ @@ -1468,6 +1489,13 @@ void Parse::do_if(BoolTest::mask btest, Node* c) { return; } + Node* counter = nullptr; + Node* incr_store = nullptr; + bool do_stress_trap = StressUnstableIfTraps && ((C->random() % 2) == 0); + if (do_stress_trap) { + increment_trap_stress_counter(counter, incr_store); + } + // Sanity check the probability value assert(0.0f < prob && prob < 1.0f,"Bad probability in Parser"); @@ -1550,9 +1578,58 @@ void Parse::do_if(BoolTest::mask btest, Node* c) { } else { adjust_map_after_if(untaken_btest, c, untaken_prob, next_block); } + + if (do_stress_trap) { + stress_trap(iff, counter, incr_store); + } +} + +// Force unstable if traps to be taken randomly to trigger intermittent bugs such as incorrect debug information. +// Add another if before the unstable if that checks a "random" condition at runtime (a simple shared counter) and +// then either takes the trap or executes the original, unstable if. +void Parse::stress_trap(IfNode* orig_iff, Node* counter, Node* incr_store) { + // Search for an unstable if trap + CallStaticJavaNode* trap = nullptr; + assert(orig_iff->Opcode() == Op_If && orig_iff->outcnt() == 2, "malformed if"); + ProjNode* trap_proj = orig_iff->uncommon_trap_proj(trap, Deoptimization::Reason_unstable_if); + if (trap == nullptr || !trap->jvms()->should_reexecute()) { + // No suitable trap found. Remove unused counter load and increment. + C->gvn_replace_by(incr_store, incr_store->in(MemNode::Memory)); + return; + } + + // Remove trap from optimization list since we add another path to the trap. + bool success = C->remove_unstable_if_trap(trap, true); + assert(success, "Trap already modified"); + + // Add a check before the original if that will trap with a certain frequency and execute the original if otherwise + int freq_log = (C->random() % 31) + 1; // Random logarithmic frequency in [1, 31] + Node* mask = intcon(right_n_bits(freq_log)); + counter = _gvn.transform(new AndINode(counter, mask)); + Node* cmp = _gvn.transform(new CmpINode(counter, intcon(0))); + Node* bol = _gvn.transform(new BoolNode(cmp, BoolTest::mask::eq)); + IfNode* iff = _gvn.transform(new IfNode(orig_iff->in(0), bol, orig_iff->_prob, orig_iff->_fcnt))->as_If(); + Node* if_true = _gvn.transform(new IfTrueNode(iff)); + Node* if_false = _gvn.transform(new IfFalseNode(iff)); + assert(!if_true->is_top() && !if_false->is_top(), "trap always / never taken"); + + // Trap + assert(trap_proj->outcnt() == 1, "some other nodes are dependent on the trap projection"); + + Node* trap_region = new RegionNode(3); + trap_region->set_req(1, trap_proj); + trap_region->set_req(2, if_true); + trap->set_req(0, _gvn.transform(trap_region)); + + // Don't trap, execute original if + orig_iff->set_req(0, if_false); } bool Parse::path_is_suitable_for_uncommon_trap(float prob) const { + // Randomly skip emitting an uncommon trap + if (StressUnstableIfTraps && ((C->random() % 2) == 0)) { + return false; + } // Don't want to speculate on uncommon traps when running with -Xcomp if (!UseInterpreter) { return false; diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index 54408146d0c26..3dd94f619fd1a 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -88,34 +88,27 @@ // At command line specify the parameters: -XX:+FullGCALot -XX:FullGCALotStart=100000000 - - -// Compiled code entry points -address OptoRuntime::_new_instance_Java = nullptr; -address OptoRuntime::_new_array_Java = nullptr; -address OptoRuntime::_new_array_nozero_Java = nullptr; -address OptoRuntime::_multianewarray2_Java = nullptr; -address OptoRuntime::_multianewarray3_Java = nullptr; -address OptoRuntime::_multianewarray4_Java = nullptr; -address OptoRuntime::_multianewarray5_Java = nullptr; -address OptoRuntime::_multianewarrayN_Java = nullptr; -address OptoRuntime::_vtable_must_compile_Java = nullptr; -address OptoRuntime::_complete_monitor_locking_Java = nullptr; -address OptoRuntime::_monitor_notify_Java = nullptr; -address OptoRuntime::_monitor_notifyAll_Java = nullptr; -address OptoRuntime::_rethrow_Java = nullptr; - -address OptoRuntime::_slow_arraycopy_Java = nullptr; -address OptoRuntime::_register_finalizer_Java = nullptr; -#if INCLUDE_JVMTI -address OptoRuntime::_notify_jvmti_vthread_start = nullptr; -address OptoRuntime::_notify_jvmti_vthread_end = nullptr; -address OptoRuntime::_notify_jvmti_vthread_mount = nullptr; -address OptoRuntime::_notify_jvmti_vthread_unmount = nullptr; -#endif - -UncommonTrapBlob* OptoRuntime::_uncommon_trap_blob; -ExceptionBlob* OptoRuntime::_exception_blob; +#define C2_BLOB_FIELD_DEFINE(name, type) \ + type OptoRuntime:: BLOB_FIELD_NAME(name) = nullptr; +#define C2_STUB_FIELD_NAME(name) _ ## name ## _Java +#define C2_STUB_FIELD_DEFINE(name, f, t, r) \ + address OptoRuntime:: C2_STUB_FIELD_NAME(name) = nullptr; +#define C2_JVMTI_STUB_FIELD_DEFINE(name) \ + address OptoRuntime:: STUB_FIELD_NAME(name) = nullptr; +C2_STUBS_DO(C2_BLOB_FIELD_DEFINE, C2_STUB_FIELD_DEFINE, C2_JVMTI_STUB_FIELD_DEFINE) +#undef C2_BLOB_FIELD_DEFINE +#undef C2_STUB_FIELD_DEFINE +#undef C2_JVMTI_STUB_FIELD_DEFINE + +#define C2_BLOB_NAME_DEFINE(name, type) "C2 Runtime " # name "_blob", +#define C2_STUB_NAME_DEFINE(name, f, t, r) "C2 Runtime " # name, +#define C2_JVMTI_STUB_NAME_DEFINE(name) "C2 Runtime " # name, +const char* OptoRuntime::_stub_names[] = { + C2_STUBS_DO(C2_BLOB_NAME_DEFINE, C2_STUB_NAME_DEFINE, C2_JVMTI_STUB_NAME_DEFINE) +}; +#undef C2_BLOB_NAME_DEFINE +#undef C2_STUB_NAME_DEFINE +#undef C2_JVMTI_STUB_NAME_DEFINE // This should be called in an assertion at the start of OptoRuntime routines // which are entered from compiled code (all of them) @@ -132,46 +125,72 @@ static bool check_compiled_frame(JavaThread* thread) { } #endif // ASSERT - +/* #define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, return_pc) \ var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, return_pc); \ if (var == nullptr) { return false; } +*/ -bool OptoRuntime::generate(ciEnv* env) { +#define GEN_C2_BLOB(name, type) \ + generate_ ## name ## _blob(); + +// a few helper macros to conjure up generate_stub call arguments +#define C2_STUB_FIELD_NAME(name) _ ## name ## _Java +#define C2_STUB_TYPEFUNC(name) name ## _Type +#define C2_STUB_C_FUNC(name) CAST_FROM_FN_PTR(address, name ## _C) +#define C2_STUB_NAME(name) stub_name(OptoStubId::name ## _id) + +// Almost all the C functions targeted from the generated stubs are +// implemented locally to OptoRuntime with names that can be generated +// from the stub name by appending suffix '_C'. However, in two cases +// a common target method also needs to be called from shared runtime +// stubs. In these two cases the opto stubs rely on method +// imlementations defined in class SharedRuntime. The following +// defines temporarily rebind the generated names to reference the +// relevant implementations. + +#define GEN_C2_STUB(name, fancy_jump, pass_tls, pass_retpc ) \ + C2_STUB_FIELD_NAME(name) = \ + generate_stub(env, \ + C2_STUB_TYPEFUNC(name), \ + C2_STUB_C_FUNC(name), \ + C2_STUB_NAME(name), \ + fancy_jump, \ + pass_tls, \ + pass_retpc); \ + if (C2_STUB_FIELD_NAME(name) == nullptr) { return false; } \ + +#define C2_JVMTI_STUB_C_FUNC(name) CAST_FROM_FN_PTR(address, SharedRuntime::name) + +#define GEN_C2_JVMTI_STUB(name) \ + STUB_FIELD_NAME(name) = \ + generate_stub(env, \ + notify_jvmti_vthread_Type, \ + C2_JVMTI_STUB_C_FUNC(name), \ + C2_STUB_NAME(name), \ + 0, \ + true, \ + false); \ + if (STUB_FIELD_NAME(name) == nullptr) { return false; } \ - generate_uncommon_trap_blob(); - generate_exception_blob(); - - // Note: tls: Means fetching the return oop out of the thread-local storage - // - // variable/name type-function-gen , runtime method ,fncy_jp, tls,retpc - // ------------------------------------------------------------------------------------------------------------------------------- - gen(env, _new_instance_Java , new_instance_Type , new_instance_C , 0 , true, false); - gen(env, _new_array_Java , new_array_Type , new_array_C , 0 , true, false); - gen(env, _new_array_nozero_Java , new_array_Type , new_array_nozero_C , 0 , true, false); - gen(env, _multianewarray2_Java , multianewarray2_Type , multianewarray2_C , 0 , true, false); - gen(env, _multianewarray3_Java , multianewarray3_Type , multianewarray3_C , 0 , true, false); - gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true, false); - gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true, false); - gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true, false); -#if INCLUDE_JVMTI - gen(env, _notify_jvmti_vthread_start , notify_jvmti_vthread_Type , SharedRuntime::notify_jvmti_vthread_start, 0, true, false); - gen(env, _notify_jvmti_vthread_end , notify_jvmti_vthread_Type , SharedRuntime::notify_jvmti_vthread_end, 0, true, false); - gen(env, _notify_jvmti_vthread_mount , notify_jvmti_vthread_Type , SharedRuntime::notify_jvmti_vthread_mount, 0, true, false); - gen(env, _notify_jvmti_vthread_unmount , notify_jvmti_vthread_Type , SharedRuntime::notify_jvmti_vthread_unmount, 0, true, false); -#endif - gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false); - gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false); - gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false); - gen(env, _rethrow_Java , rethrow_Type , rethrow_C , 2 , true , true ); +bool OptoRuntime::generate(ciEnv* env) { - gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false); - gen(env, _register_finalizer_Java , register_finalizer_Type , register_finalizer , 0 , false, false); + C2_STUBS_DO(GEN_C2_BLOB, GEN_C2_STUB, GEN_C2_JVMTI_STUB) return true; } -#undef gen +#undef GEN_C2_BLOB + +#undef C2_STUB_FIELD_NAME +#undef C2_STUB_TYPEFUNC +#undef C2_STUB_C_FUNC +#undef C2_STUB_NAME +#undef GEN_C2_STUB + +#undef C2_JVMTI_STUB_C_FUNC +#undef GEN_C2_JVMTI_STUB +// #undef gen // Helper method to do generation of RunTimeStub's @@ -201,6 +220,19 @@ const char* OptoRuntime::stub_name(address entry) { #endif } +// local methods passed as arguments to stub generator that forward +// control to corresponding JRT methods of SharedRuntime + +void OptoRuntime::slow_arraycopy_C(oopDesc* src, jint src_pos, + oopDesc* dest, jint dest_pos, + jint length, JavaThread* thread) { + SharedRuntime::slow_arraycopy_C(src, src_pos, dest, dest_pos, length, thread); +} + +void OptoRuntime::complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* current) { + SharedRuntime::complete_monitor_locking_C(obj, lock, current); +} + //============================================================================= // Opto compiler runtime routines @@ -529,6 +561,10 @@ const TypeFunc *OptoRuntime::new_array_Type() { return TypeFunc::make(domain, range); } +const TypeFunc *OptoRuntime::new_array_nozero_Type() { + return new_array_Type(); +} + const TypeFunc *OptoRuntime::multianewarray_Type(int ndim) { // create input type (domain) const int nargs = ndim + 1; @@ -607,6 +643,9 @@ const TypeFunc *OptoRuntime::complete_monitor_enter_Type() { return TypeFunc::make(domain,range); } +const TypeFunc *OptoRuntime::complete_monitor_locking_Type() { + return complete_monitor_enter_Type(); +} //----------------------------------------------------------------------------- const TypeFunc *OptoRuntime::complete_monitor_exit_Type() { @@ -637,6 +676,10 @@ const TypeFunc *OptoRuntime::monitor_notify_Type() { return TypeFunc::make(domain, range); } +const TypeFunc *OptoRuntime::monitor_notifyAll_Type() { + return monitor_notify_Type(); +} + const TypeFunc* OptoRuntime::flush_windows_Type() { // create input type (domain) const Type** fields = TypeTuple::fields(1); @@ -1827,7 +1870,7 @@ const TypeFunc *OptoRuntime::dtrace_object_alloc_Type() { } -JRT_ENTRY_NO_ASYNC(void, OptoRuntime::register_finalizer(oopDesc* obj, JavaThread* current)) +JRT_ENTRY_NO_ASYNC(void, OptoRuntime::register_finalizer_C(oopDesc* obj, JavaThread* current)) assert(oopDesc::is_oop(obj), "must be a valid oop"); assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise"); InstanceKlass::register_finalizer(instanceOop(obj), CHECK); diff --git a/src/hotspot/share/opto/runtime.hpp b/src/hotspot/share/opto/runtime.hpp index 34c2780a2f8d7..da08fc0f38660 100644 --- a/src/hotspot/share/opto/runtime.hpp +++ b/src/hotspot/share/opto/runtime.hpp @@ -30,6 +30,7 @@ #include "opto/optoreg.hpp" #include "opto/type.hpp" #include "runtime/deoptimization.hpp" +#include "runtime/stubDeclarations.hpp" #include "runtime/vframe.hpp" //------------------------------OptoRuntime------------------------------------ @@ -98,37 +99,46 @@ class NamedCounter : public CHeapObj { typedef const TypeFunc*(*TypeFunc_generator)(); +// define OptoStubId enum tags: uncommon_trap_id etc + +#define C2_BLOB_ID_ENUM_DECLARE(name, type) STUB_ID_NAME(name), +#define C2_STUB_ID_ENUM_DECLARE(name, f, t, r) STUB_ID_NAME(name), +#define C2_JVMTI_STUB_ID_ENUM_DECLARE(name) STUB_ID_NAME(name), +enum class OptoStubId :int { + NO_STUBID = -1, + C2_STUBS_DO(C2_BLOB_ID_ENUM_DECLARE, C2_STUB_ID_ENUM_DECLARE, C2_JVMTI_STUB_ID_ENUM_DECLARE) + NUM_STUBIDS +}; +#undef C2_BLOB_ID_ENUM_DECLARE +#undef C2_STUB_ID_ENUM_DECLARE +#undef C2_JVMTI_STUB_ID_ENUM_DECLARE + class OptoRuntime : public AllStatic { friend class Matcher; // allow access to stub names private: + // declare opto stub address/blob holder static fields +#define C2_BLOB_FIELD_DECLARE(name, type) \ + static type BLOB_FIELD_NAME(name); +#define C2_STUB_FIELD_NAME(name) _ ## name ## _Java +#define C2_STUB_FIELD_DECLARE(name, f, t, r) \ + static address C2_STUB_FIELD_NAME(name) ; +#define C2_JVMTI_STUB_FIELD_DECLARE(name) \ + static address STUB_FIELD_NAME(name); + + C2_STUBS_DO(C2_BLOB_FIELD_DECLARE, C2_STUB_FIELD_DECLARE, C2_JVMTI_STUB_FIELD_DECLARE) + +#undef C2_BLOB_FIELD_DECLARE +#undef C2_STUB_FIELD_NAME +#undef C2_STUB_FIELD_DECLARE +#undef C2_JVMTI_STUB_FIELD_DECLARE + + // Stub names indexed by sharedStubId + static const char *_stub_names[]; + // define stubs static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, int is_fancy_jump, bool pass_tls, bool return_pc); - // References to generated stubs - static address _new_instance_Java; - static address _new_array_Java; - static address _new_array_nozero_Java; - static address _multianewarray2_Java; - static address _multianewarray3_Java; - static address _multianewarray4_Java; - static address _multianewarray5_Java; - static address _multianewarrayN_Java; - static address _vtable_must_compile_Java; - static address _complete_monitor_locking_Java; - static address _rethrow_Java; - static address _monitor_notify_Java; - static address _monitor_notifyAll_Java; - - static address _slow_arraycopy_Java; - static address _register_finalizer_Java; -#if INCLUDE_JVMTI - static address _notify_jvmti_vthread_start; - static address _notify_jvmti_vthread_end; - static address _notify_jvmti_vthread_mount; - static address _notify_jvmti_vthread_unmount; -#endif - // // Implementation of runtime methods // ================================= @@ -148,6 +158,13 @@ class OptoRuntime : public AllStatic { static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current); static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current); + // local methods passed as arguments to stub generator that forward + // control to corresponding JRT methods of SharedRuntime + static void slow_arraycopy_C(oopDesc* src, jint src_pos, + oopDesc* dest, jint dest_pos, + jint length, JavaThread* thread); + static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* current); + public: static void monitor_notify_C(oopDesc* obj, JavaThread* current); static void monitor_notifyAll_C(oopDesc* obj, JavaThread* current); @@ -168,13 +185,10 @@ class OptoRuntime : public AllStatic { // CodeBlob support // =================================================================== - static UncommonTrapBlob* _uncommon_trap_blob; - static ExceptionBlob* _exception_blob; - static void generate_uncommon_trap_blob(void); static void generate_exception_blob(); - static void register_finalizer(oopDesc* obj, JavaThread* current); + static void register_finalizer_C(oopDesc* obj, JavaThread* current); public: @@ -188,6 +202,12 @@ class OptoRuntime : public AllStatic { // Returns the name of a stub static const char* stub_name(address entry); + // Returns the name associated with a given stub id + static const char* stub_name(OptoStubId id) { + assert(id > OptoStubId::NO_STUBID && id < OptoStubId::NUM_STUBIDS, "stub id out of range"); + return _stub_names[(int)id]; + } + // access to runtime stubs entry points for java code static address new_instance_Java() { return _new_instance_Java; } static address new_array_Java() { return _new_array_Java; } @@ -197,7 +217,6 @@ class OptoRuntime : public AllStatic { static address multianewarray4_Java() { return _multianewarray4_Java; } static address multianewarray5_Java() { return _multianewarray5_Java; } static address multianewarrayN_Java() { return _multianewarrayN_Java; } - static address vtable_must_compile_stub() { return _vtable_must_compile_Java; } static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; } static address monitor_notify_Java() { return _monitor_notify_Java; } static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; } @@ -227,6 +246,7 @@ class OptoRuntime : public AllStatic { static const TypeFunc* new_instance_Type(); // object allocation (slow case) static const TypeFunc* new_array_Type (); // [a]newarray (slow case) + static const TypeFunc* new_array_nozero_Type (); // [a]newarray (slow case) static const TypeFunc* multianewarray_Type(int ndim); // multianewarray static const TypeFunc* multianewarray2_Type(); // multianewarray static const TypeFunc* multianewarray3_Type(); // multianewarray @@ -234,8 +254,10 @@ class OptoRuntime : public AllStatic { static const TypeFunc* multianewarray5_Type(); // multianewarray static const TypeFunc* multianewarrayN_Type(); // multianewarray static const TypeFunc* complete_monitor_enter_Type(); + static const TypeFunc* complete_monitor_locking_Type(); static const TypeFunc* complete_monitor_exit_Type(); static const TypeFunc* monitor_notify_Type(); + static const TypeFunc* monitor_notifyAll_Type(); static const TypeFunc* uncommon_trap_Type(); static const TypeFunc* athrow_Type(); static const TypeFunc* rethrow_Type(); diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index fbb2c6e3e08eb..1f115c783e6d7 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -2409,7 +2409,7 @@ static char* get_bad_address() { if (bad_address != nullptr) { os::protect_memory(bad_address, size, os::MEM_PROT_READ, /*is_committed*/false); - MemTracker::record_virtual_memory_type((void*)bad_address, mtInternal); + MemTracker::record_virtual_memory_tag((void*)bad_address, mtInternal); } } return bad_address; diff --git a/src/hotspot/share/prims/jvmtiAgentList.hpp b/src/hotspot/share/prims/jvmtiAgentList.hpp index 671def0268197..d53f5e63d9b86 100644 --- a/src/hotspot/share/prims/jvmtiAgentList.hpp +++ b/src/hotspot/share/prims/jvmtiAgentList.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_PRIMS_JVMTIAGENTLIST_HPP #define SHARE_PRIMS_JVMTIAGENTLIST_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "prims/jvmtiAgent.hpp" #include "utilities/growableArray.hpp" diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp index a36d12059a96a..097ce33154051 100644 --- a/src/hotspot/share/prims/jvmtiEnv.cpp +++ b/src/hotspot/share/prims/jvmtiEnv.cpp @@ -3132,7 +3132,9 @@ JvmtiEnv::GetFieldName(fieldDescriptor* fdesc_ptr, char** name_ptr, char** signa // declaring_class_ptr - pre-checked for null jvmtiError JvmtiEnv::GetFieldDeclaringClass(fieldDescriptor* fdesc_ptr, jclass* declaring_class_ptr) { - + // As for the GetFieldDeclaringClass method, the XSL generated C++ code that calls it has + // a jclass of the relevant class or a subclass of it, which is fine in terms of ensuring + // the holder is kept alive. *declaring_class_ptr = get_jni_class_non_null(fdesc_ptr->field_holder()); return JVMTI_ERROR_NONE; } /* end GetFieldDeclaringClass */ @@ -3210,7 +3212,9 @@ JvmtiEnv::GetMethodName(Method* method, char** name_ptr, char** signature_ptr, c jvmtiError JvmtiEnv::GetMethodDeclaringClass(Method* method, jclass* declaring_class_ptr) { NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID); - (*declaring_class_ptr) = get_jni_class_non_null(method->method_holder()); + Klass* k = method->method_holder(); + Handle holder(Thread::current(), k->klass_holder()); // keep the klass alive + (*declaring_class_ptr) = get_jni_class_non_null(k); return JVMTI_ERROR_NONE; } /* end GetMethodDeclaringClass */ diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index a05d69980931c..167ca557cde31 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -599,6 +599,7 @@ JvmtiEnvBase::jvf_for_thread_and_depth(JavaThread* java_thread, jint depth) { jclass JvmtiEnvBase::get_jni_class_non_null(Klass* k) { assert(k != nullptr, "k != null"); + assert(k->is_loader_alive(), "Must be alive"); Thread *thread = Thread::current(); return (jclass)jni_reference(Handle(thread, k->java_mirror())); } diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 8a08a12a0b0e2..ca440b69913fa 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -676,7 +676,7 @@ WB_END #endif // INCLUDE_G1GC -// Alloc memory using the test memory type so that we can use that to see if +// Alloc memory using the test memory tag so that we can use that to see if // NMT picks it up correctly WB_ENTRY(jlong, WB_NMTMalloc(JNIEnv* env, jobject o, jlong size)) jlong addr = 0; @@ -692,11 +692,11 @@ WB_ENTRY(jlong, WB_NMTMallocWithPseudoStack(JNIEnv* env, jobject o, jlong size, return (jlong)(uintptr_t)os::malloc(size, mtTest, stack); WB_END -// Alloc memory with pseudo call stack and specific memory type. -WB_ENTRY(jlong, WB_NMTMallocWithPseudoStackAndType(JNIEnv* env, jobject o, jlong size, jint pseudo_stack, jint type)) +// Alloc memory with pseudo call stack and specific memory tag. +WB_ENTRY(jlong, WB_NMTMallocWithPseudoStackAndType(JNIEnv* env, jobject o, jlong size, jint pseudo_stack, jint mem_tag)) address pc = (address)(size_t)pseudo_stack; NativeCallStack stack(&pc, 1); - return (jlong)(uintptr_t)os::malloc(size, (MEMFLAGS)type, stack); + return (jlong)(uintptr_t)os::malloc(size, (MemTag)mem_tag, stack); WB_END // Free the memory allocated by NMTAllocTest @@ -708,21 +708,21 @@ WB_ENTRY(jlong, WB_NMTReserveMemory(JNIEnv* env, jobject o, jlong size)) jlong addr = 0; addr = (jlong)(uintptr_t)os::reserve_memory(size); - MemTracker::record_virtual_memory_type((address)addr, mtTest); + MemTracker::record_virtual_memory_tag((address)addr, mtTest); return addr; WB_END WB_ENTRY(jlong, WB_NMTAttemptReserveMemoryAt(JNIEnv* env, jobject o, jlong addr, jlong size)) addr = (jlong)(uintptr_t)os::attempt_reserve_memory_at((char*)(uintptr_t)addr, (size_t)size); - MemTracker::record_virtual_memory_type((address)addr, mtTest); + MemTracker::record_virtual_memory_tag((address)addr, mtTest); return addr; WB_END WB_ENTRY(void, WB_NMTCommitMemory(JNIEnv* env, jobject o, jlong addr, jlong size)) os::commit_memory((char *)(uintptr_t)addr, size, !ExecMem); - MemTracker::record_virtual_memory_type((address)(uintptr_t)addr, mtTest); + MemTracker::record_virtual_memory_tag((address)(uintptr_t)addr, mtTest); WB_END WB_ENTRY(void, WB_NMTUncommitMemory(JNIEnv* env, jobject o, jlong addr, jlong size)) @@ -2497,6 +2497,13 @@ WB_ENTRY(jint, WB_ValidateCgroup(JNIEnv* env, return ret; WB_END +// Available cpus of the host machine, Linux only. +// Used in container testing. +WB_ENTRY(jint, WB_HostCPUs(JNIEnv* env, jobject o)) + LINUX_ONLY(return os::Linux::active_processor_count();) + return -1; // Not used/implemented on other platforms +WB_END + WB_ENTRY(void, WB_PrintOsInfo(JNIEnv* env, jobject o)) os::print_os_info(tty); WB_END @@ -2938,6 +2945,7 @@ static JNINativeMethod methods[] = { (void*)&WB_ValidateCgroup }, {CC"hostPhysicalMemory", CC"()J", (void*)&WB_HostPhysicalMemory }, {CC"hostPhysicalSwap", CC"()J", (void*)&WB_HostPhysicalSwap }, + {CC"hostCPUs", CC"()I", (void*)&WB_HostCPUs }, {CC"printOsInfo", CC"()V", (void*)&WB_PrintOsInfo }, {CC"disableElfSectionCache", CC"()V", (void*)&WB_DisableElfSectionCache }, {CC"resolvedMethodItemsCount", CC"()J", (void*)&WB_ResolvedMethodItemsCount }, diff --git a/src/hotspot/share/runtime/basicLock.inline.hpp b/src/hotspot/share/runtime/basicLock.inline.hpp index c04c8e5b11706..30abd575da46a 100644 --- a/src/hotspot/share/runtime/basicLock.inline.hpp +++ b/src/hotspot/share/runtime/basicLock.inline.hpp @@ -39,7 +39,7 @@ inline void BasicLock::set_displaced_header(markWord header) { inline ObjectMonitor* BasicLock::object_monitor_cache() const { assert(UseObjectMonitorTable, "must be"); -#if defined(X86) || defined(AARCH64) || defined(RISCV64) +#if defined(X86) || defined(AARCH64) || defined(RISCV64) || defined(PPC64) || defined(S390) return reinterpret_cast(get_metadata()); #else // Other platforms do not make use of the cache yet, diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index 0a763d76badbd..e36b252362b78 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -277,12 +277,31 @@ class Config { } }; +#ifdef _WINDOWS +static void map_stack_pages(JavaThread* thread, size_t size, address sp) { + address new_sp = sp - size; + address watermark = thread->stack_overflow_state()->shadow_zone_growth_watermark(); + + if (new_sp < watermark) { + size_t page_size = os::vm_page_size(); + address last_touched_page = watermark - StackOverflow::stack_shadow_zone_size(); + size_t pages_to_touch = align_up(watermark - new_sp, page_size) / page_size; + while (pages_to_touch-- > 0) { + last_touched_page -= page_size; + *last_touched_page = 0; + } + thread->stack_overflow_state()->set_shadow_zone_growth_watermark(new_sp); + } +} +#endif + static bool stack_overflow_check(JavaThread* thread, size_t size, address sp) { const size_t page_size = os::vm_page_size(); if (size > page_size) { if (sp - size < thread->stack_overflow_state()->shadow_zone_safe_limit()) { return false; } + WINDOWS_ONLY(map_stack_pages(thread, size, sp)); } return true; } @@ -2043,7 +2062,7 @@ NOINLINE intptr_t* ThawBase::thaw_slow(stackChunkOop chunk, bool return_barrier) assert(_cont.chunk_invariant(), ""); - JVMTI_ONLY(if (!return_barrier) invalidate_jvmti_stack(_thread)); + JVMTI_ONLY(invalidate_jvmti_stack(_thread)); _thread->set_cont_fastpath(_fastpath); diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index d442894798b78..8dafc9a508d99 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1201,9 +1201,6 @@ const int ObjectAlignmentInBytes = 8; product(bool, UseCompiler, true, \ "Use Just-In-Time compilation") \ \ - develop(intx, CounterHalfLifeTime, 30, \ - "Half-life time of invocation counters (in seconds)") \ - \ product(bool, AlwaysCompileLoopMethods, false, \ "When using recompilation, never interpret methods " \ "containing loops") \ diff --git a/src/hotspot/share/runtime/handles.hpp b/src/hotspot/share/runtime/handles.hpp index 39e59cc1ef0ef..8ed16d33a2f06 100644 --- a/src/hotspot/share/runtime/handles.hpp +++ b/src/hotspot/share/runtime/handles.hpp @@ -187,7 +187,7 @@ class HandleArea: public Arena { HandleArea* _prev; // link to outer (older) area public: // Constructor - HandleArea(MEMFLAGS flags, HandleArea* prev) : Arena(flags, Tag::tag_ha, Chunk::tiny_size) { + HandleArea(MemTag mem_tag, HandleArea* prev) : Arena(mem_tag, Tag::tag_ha, Chunk::tiny_size) { debug_only(_handle_mark_nesting = 0); debug_only(_no_handle_mark_nesting = 0); _prev = prev; diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index 416e79d584477..3528fc5b1bced 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -409,8 +409,8 @@ void JavaThread::check_for_valid_safepoint_state() { // A JavaThread is a normal Java thread -JavaThread::JavaThread(MEMFLAGS flags) : - Thread(flags), +JavaThread::JavaThread(MemTag mem_tag) : + Thread(mem_tag), // Initialize fields _on_thread_list(false), DEBUG_ONLY(_java_call_counter(0) COMMA) @@ -634,7 +634,7 @@ void JavaThread::block_if_vm_exited() { } } -JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz, MEMFLAGS flags) : JavaThread(flags) { +JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz, MemTag mem_tag) : JavaThread(mem_tag) { set_entry_point(entry_point); // Create the native thread itself. // %note runtime_23 diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index 54a11dad9b832..e36b7dfe888a8 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -479,8 +479,8 @@ class JavaThread: public Thread { public: // Constructor - JavaThread(MEMFLAGS flags = mtThread); // delegating constructor - JavaThread(ThreadFunction entry_point, size_t stack_size = 0, MEMFLAGS flags = mtThread); + JavaThread(MemTag mem_tag = mtThread); // delegating constructor + JavaThread(ThreadFunction entry_point, size_t stack_size = 0, MemTag mem_tag = mtThread); ~JavaThread(); // Factory method to create a new JavaThread whose attach state is "is attaching" diff --git a/src/hotspot/share/runtime/lightweightSynchronizer.cpp b/src/hotspot/share/runtime/lightweightSynchronizer.cpp index 0e360dba97bdd..5037bb9607b5d 100644 --- a/src/hotspot/share/runtime/lightweightSynchronizer.cpp +++ b/src/hotspot/share/runtime/lightweightSynchronizer.cpp @@ -29,7 +29,7 @@ #include "logging/log.hpp" #include "memory/allStatic.hpp" #include "memory/resourceArea.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/basicLock.inline.hpp" @@ -60,14 +60,14 @@ class ObjectMonitorTable : AllStatic { } static void* allocate_node(void* context, size_t size, Value const& value) { ObjectMonitorTable::inc_items_count(); - return AllocateHeap(size, MEMFLAGS::mtObjectMonitor); + return AllocateHeap(size, mtObjectMonitor); }; static void free_node(void* context, void* memory, Value const& value) { ObjectMonitorTable::dec_items_count(); FreeHeap(memory); } }; - using ConcurrentTable = ConcurrentHashTable; + using ConcurrentTable = ConcurrentHashTable; static ConcurrentTable* _table; static volatile size_t _items_count; diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index a8f3bc5c1d55a..8b1c52a5d33cc 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -32,6 +32,7 @@ #include "code/codeCache.hpp" #include "code/vtableStubs.hpp" #include "gc/shared/gcVMOperations.hpp" +#include "gc/shared/oopStorageSet.hpp" #include "interpreter/interpreter.hpp" #include "jvm.h" #include "logging/log.hpp" @@ -600,16 +601,16 @@ bool os::find_builtin_agent(JvmtiAgent* agent, const char *syms[], // --------------------- heap allocation utilities --------------------- -char *os::strdup(const char *str, MEMFLAGS flags) { +char *os::strdup(const char *str, MemTag mem_tag) { size_t size = strlen(str); - char *dup_str = (char *)malloc(size + 1, flags); + char *dup_str = (char *)malloc(size + 1, mem_tag); if (dup_str == nullptr) return nullptr; strcpy(dup_str, str); return dup_str; } -char* os::strdup_check_oom(const char* str, MEMFLAGS flags) { - char* p = os::strdup(str, flags); +char* os::strdup_check_oom(const char* str, MemTag mem_tag) { + char* p = os::strdup(str, mem_tag); if (p == nullptr) { vm_exit_out_of_memory(strlen(str) + 1, OOM_MALLOC_ERROR, "os::strdup_check_oom"); } @@ -629,11 +630,11 @@ static void break_if_ptr_caught(void* ptr) { } #endif // ASSERT -void* os::malloc(size_t size, MEMFLAGS flags) { - return os::malloc(size, flags, CALLER_PC); +void* os::malloc(size_t size, MemTag mem_tag) { + return os::malloc(size, mem_tag, CALLER_PC); } -void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { +void* os::malloc(size_t size, MemTag mem_tag, const NativeCallStack& stack) { // Special handling for NMT preinit phase before arguments are parsed void* rc = nullptr; @@ -651,7 +652,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { size = MAX2((size_t)1, size); // Observe MallocLimit - if (MemTracker::check_exceeds_limit(size, memflags)) { + if (MemTracker::check_exceeds_limit(size, mem_tag)) { return nullptr; } @@ -667,7 +668,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { return nullptr; } - void* const inner_ptr = MemTracker::record_malloc((address)outer_ptr, size, memflags, stack); + void* const inner_ptr = MemTracker::record_malloc((address)outer_ptr, size, mem_tag, stack); if (CDSConfig::is_dumping_static_archive()) { // Need to deterministically fill all the alignment gaps in C++ structures. @@ -679,20 +680,20 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { return inner_ptr; } -void* os::realloc(void *memblock, size_t size, MEMFLAGS flags) { - return os::realloc(memblock, size, flags, CALLER_PC); +void* os::realloc(void *memblock, size_t size, MemTag mem_tag) { + return os::realloc(memblock, size, mem_tag, CALLER_PC); } -void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { +void* os::realloc(void *memblock, size_t size, MemTag mem_tag, const NativeCallStack& stack) { // Special handling for NMT preinit phase before arguments are parsed void* rc = nullptr; - if (NMTPreInit::handle_realloc(&rc, memblock, size, memflags)) { + if (NMTPreInit::handle_realloc(&rc, memblock, size, mem_tag)) { return rc; } if (memblock == nullptr) { - return os::malloc(size, memflags, stack); + return os::malloc(size, mem_tag, stack); } DEBUG_ONLY(check_crash_protection()); @@ -715,15 +716,15 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa const size_t old_size = MallocTracker::malloc_header(memblock)->size(); // Observe MallocLimit - if ((size > old_size) && MemTracker::check_exceeds_limit(size - old_size, memflags)) { + if ((size > old_size) && MemTracker::check_exceeds_limit(size - old_size, mem_tag)) { return nullptr; } // Perform integrity checks on and mark the old block as dead *before* calling the real realloc(3) since it // may invalidate the old block, including its header. MallocHeader* header = MallocHeader::resolve_checked(memblock); - assert(memflags == header->flags(), "weird NMT flags mismatch (new:\"%s\" != old:\"%s\")\n", - NMTUtil::flag_to_name(memflags), NMTUtil::flag_to_name(header->flags())); + assert(mem_tag == header->mem_tag(), "weird NMT type mismatch (new:\"%s\" != old:\"%s\")\n", + NMTUtil::tag_to_name(mem_tag), NMTUtil::tag_to_name(header->mem_tag())); const MallocHeader::FreeInfo free_info = header->free_info(); header->mark_block_as_dead(); @@ -742,7 +743,7 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa // After a successful realloc(3), we account the resized block with its new size // to NMT. - void* const new_inner_ptr = MemTracker::record_malloc(new_outer_ptr, size, memflags, stack); + void* const new_inner_ptr = MemTracker::record_malloc(new_outer_ptr, size, mem_tag, stack); #ifdef ASSERT assert(old_size == free_info.size, "Sanity"); @@ -1317,6 +1318,11 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) { } #endif + // Ask if any OopStorage knows about this address. + if (OopStorageSet::print_containing(addr, st)) { + return; + } + // Still nothing? If NMT is enabled, we can ask what it thinks... if (MemTracker::print_containing_region(addr, st)) { return; @@ -1871,10 +1877,10 @@ bool os::create_stack_guard_pages(char* addr, size_t bytes) { return os::pd_create_stack_guard_pages(addr, bytes); } -char* os::reserve_memory(size_t bytes, bool executable, MEMFLAGS flags) { +char* os::reserve_memory(size_t bytes, bool executable, MemTag mem_tag) { char* result = pd_reserve_memory(bytes, executable); if (result != nullptr) { - MemTracker::record_virtual_memory_reserve(result, bytes, CALLER_PC, flags); + MemTracker::record_virtual_memory_reserve(result, bytes, CALLER_PC, mem_tag); log_debug(os, map)("Reserved " RANGEFMT, RANGEFMTARGS(result, bytes)); } else { log_info(os, map)("Reserve failed (%zu bytes)", bytes); @@ -1882,10 +1888,10 @@ char* os::reserve_memory(size_t bytes, bool executable, MEMFLAGS flags) { return result; } -char* os::attempt_reserve_memory_at(char* addr, size_t bytes, bool executable, MEMFLAGS flag) { +char* os::attempt_reserve_memory_at(char* addr, size_t bytes, bool executable, MemTag mem_tag) { char* result = SimulateFullAddressSpace ? nullptr : pd_attempt_reserve_memory_at(addr, bytes, executable); if (result != nullptr) { - MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC, flag); + MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC, mem_tag); log_debug(os, map)("Reserved " RANGEFMT, RANGEFMTARGS(result, bytes)); } else { log_info(os, map)("Attempt to reserve " RANGEFMT " failed", @@ -2235,31 +2241,31 @@ void os::pretouch_memory(void* start, void* end, size_t page_size) { } } -char* os::map_memory_to_file(size_t bytes, int file_desc, MEMFLAGS flag) { +char* os::map_memory_to_file(size_t bytes, int file_desc, MemTag mem_tag) { // Could have called pd_reserve_memory() followed by replace_existing_mapping_with_file_mapping(), // but AIX may use SHM in which case its more trouble to detach the segment and remap memory to the file. // On all current implementations null is interpreted as any available address. char* result = os::map_memory_to_file(nullptr /* addr */, bytes, file_desc); if (result != nullptr) { - MemTracker::record_virtual_memory_reserve_and_commit(result, bytes, CALLER_PC, flag); + MemTracker::record_virtual_memory_reserve_and_commit(result, bytes, CALLER_PC, mem_tag); } return result; } -char* os::attempt_map_memory_to_file_at(char* addr, size_t bytes, int file_desc, MEMFLAGS flag) { +char* os::attempt_map_memory_to_file_at(char* addr, size_t bytes, int file_desc, MemTag mem_tag) { char* result = pd_attempt_map_memory_to_file_at(addr, bytes, file_desc); if (result != nullptr) { - MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC, flag); + MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC, mem_tag); } return result; } char* os::map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only, - bool allow_exec, MEMFLAGS flags) { + bool allow_exec, MemTag mem_tag) { char* result = pd_map_memory(fd, file_name, file_offset, addr, bytes, read_only, allow_exec); if (result != nullptr) { - MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC, flags); + MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC, mem_tag); } return result; } diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 1d81612c033b7..35a5be77b6058 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -450,14 +450,14 @@ class os: AllStatic { inline static size_t cds_core_region_alignment(); // Reserves virtual memory. - static char* reserve_memory(size_t bytes, bool executable = false, MEMFLAGS flags = mtNone); + static char* reserve_memory(size_t bytes, bool executable = false, MemTag mem_tag = mtNone); // Reserves virtual memory that starts at an address that is aligned to 'alignment'. static char* reserve_memory_aligned(size_t size, size_t alignment, bool executable = false); // Attempts to reserve the virtual memory at [addr, addr + bytes). // Does not overwrite existing mappings. - static char* attempt_reserve_memory_at(char* addr, size_t bytes, bool executable = false, MEMFLAGS flag = mtNone); + static char* attempt_reserve_memory_at(char* addr, size_t bytes, bool executable = false, MemTag mem_tag = mtNone); // Given an address range [min, max), attempts to reserve memory within this area, with the given alignment. // If randomize is true, the location will be randomized. @@ -509,16 +509,16 @@ class os: AllStatic { static int create_file_for_heap(const char* dir); // Map memory to the file referred by fd. This function is slightly different from map_memory() // and is added to be used for implementation of -XX:AllocateHeapAt - static char* map_memory_to_file(size_t size, int fd, MEMFLAGS flag = mtNone); - static char* map_memory_to_file_aligned(size_t size, size_t alignment, int fd, MEMFLAGS flag = mtNone); + static char* map_memory_to_file(size_t size, int fd, MemTag mem_tag = mtNone); + static char* map_memory_to_file_aligned(size_t size, size_t alignment, int fd, MemTag mem_tag = mtNone); static char* map_memory_to_file(char* base, size_t size, int fd); - static char* attempt_map_memory_to_file_at(char* base, size_t size, int fd, MEMFLAGS flag = mtNone); + static char* attempt_map_memory_to_file_at(char* base, size_t size, int fd, MemTag mem_tag = mtNone); // Replace existing reserved memory with file mapping static char* replace_existing_mapping_with_file_mapping(char* base, size_t size, int fd); static char* map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, bool read_only = false, - bool allow_exec = false, MEMFLAGS flags = mtNone); + bool allow_exec = false, MemTag mem_tag = mtNone); static bool unmap_memory(char *addr, size_t bytes); static void disclaim_memory(char *addr, size_t bytes); static void realign_memory(char *addr, size_t bytes, size_t alignment_hint); @@ -900,16 +900,16 @@ class os: AllStatic { static int get_native_stack(address* stack, int size, int toSkip = 0); // General allocation (must be MT-safe) - static void* malloc (size_t size, MEMFLAGS flags, const NativeCallStack& stack); - static void* malloc (size_t size, MEMFLAGS flags); - static void* realloc (void *memblock, size_t size, MEMFLAGS flag, const NativeCallStack& stack); - static void* realloc (void *memblock, size_t size, MEMFLAGS flag); + static void* malloc (size_t size, MemTag mem_tag, const NativeCallStack& stack); + static void* malloc (size_t size, MemTag mem_tag); + static void* realloc (void *memblock, size_t size, MemTag mem_tag, const NativeCallStack& stack); + static void* realloc (void *memblock, size_t size, MemTag mem_tag); // handles null pointers static void free (void *memblock); - static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup + static char* strdup(const char *, MemTag mem_tag = mtInternal); // Like strdup // Like strdup, but exit VM when strdup() returns null - static char* strdup_check_oom(const char*, MEMFLAGS flags = mtInternal); + static char* strdup_check_oom(const char*, MemTag mem_tag = mtInternal); // SocketInterface (ex HPI SocketInterface ) static int socket_close(int fd); diff --git a/src/hotspot/share/runtime/safepointMechanism.cpp b/src/hotspot/share/runtime/safepointMechanism.cpp index 624583db3d130..a6aadf5ebc400 100644 --- a/src/hotspot/share/runtime/safepointMechanism.cpp +++ b/src/hotspot/share/runtime/safepointMechanism.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, 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 @@ -60,7 +60,7 @@ void SafepointMechanism::default_initialize() { const size_t allocation_size = 2 * page_size; char* polling_page = os::reserve_memory(allocation_size); os::commit_memory_or_exit(polling_page, allocation_size, false, "Unable to commit Safepoint polling page"); - MemTracker::record_virtual_memory_type((address)polling_page, mtSafepoint); + MemTracker::record_virtual_memory_tag((address)polling_page, mtSafepoint); char* bad_page = polling_page; char* good_page = polling_page + page_size; diff --git a/src/hotspot/share/runtime/stackOverflow.hpp b/src/hotspot/share/runtime/stackOverflow.hpp index b897c86d24981..4734a6c67880a 100644 --- a/src/hotspot/share/runtime/stackOverflow.hpp +++ b/src/hotspot/share/runtime/stackOverflow.hpp @@ -293,6 +293,16 @@ class StackOverflow { return _shadow_zone_safe_limit; } + address shadow_zone_growth_watermark() const { + assert(_shadow_zone_growth_watermark != nullptr, "Don't call this before the field is initialized."); + return _shadow_zone_growth_watermark; + } + + void set_shadow_zone_growth_watermark(address new_watermark) { + assert(_shadow_zone_growth_watermark != nullptr, "Don't call this before the field is initialized."); + _shadow_zone_growth_watermark = new_watermark; + } + void create_stack_guard_pages(); void remove_stack_guard_pages(); diff --git a/src/hotspot/share/runtime/stubDeclarations.hpp b/src/hotspot/share/runtime/stubDeclarations.hpp index c9e946906f796..ccca14c61b5b8 100644 --- a/src/hotspot/share/runtime/stubDeclarations.hpp +++ b/src/hotspot/share/runtime/stubDeclarations.hpp @@ -70,13 +70,108 @@ /* other stubs */ \ SHARED_JFR_STUBS_DO(do_blob) \ -// generate a stub id enum tag from a name +// C1 stubs are always generated in a generic CodeBlob + +#ifdef COMPILER1 +// do_blob(name) +#define C1_STUBS_DO(do_blob) \ + do_blob(dtrace_object_alloc) \ + do_blob(unwind_exception) \ + do_blob(forward_exception) \ + do_blob(throw_range_check_failed) /* throws ArrayIndexOutOfBoundsException */ \ + do_blob(throw_index_exception) /* throws IndexOutOfBoundsException */ \ + do_blob(throw_div0_exception) \ + do_blob(throw_null_pointer_exception) \ + do_blob(register_finalizer) \ + do_blob(new_instance) \ + do_blob(fast_new_instance) \ + do_blob(fast_new_instance_init_check) \ + do_blob(new_type_array) \ + do_blob(new_object_array) \ + do_blob(new_multi_array) \ + do_blob(handle_exception_nofpu) /* optimized version that does not preserve fpu registers */ \ + do_blob(handle_exception) \ + do_blob(handle_exception_from_callee) \ + do_blob(throw_array_store_exception) \ + do_blob(throw_class_cast_exception) \ + do_blob(throw_incompatible_class_change_error) \ + do_blob(slow_subtype_check) \ + do_blob(monitorenter) \ + do_blob(monitorenter_nofpu) /* optimized version that does not preserve fpu registers */ \ + do_blob(monitorexit) \ + do_blob(monitorexit_nofpu) /* optimized version that does not preserve fpu registers */ \ + do_blob(deoptimize) \ + do_blob(access_field_patching) \ + do_blob(load_klass_patching) \ + do_blob(load_mirror_patching) \ + do_blob(load_appendix_patching) \ + do_blob(fpu2long_stub) \ + do_blob(counter_overflow) \ + do_blob(predicate_failed_trap) \ + +#else +#define C1_STUBS_DO(do_blob) +#endif + +// Opto stubs can be stored as entries with just an address or as +// blobs of different types. The former may include some JVMTI stubs. +// +// n.b. blobs and stub defines are generated in the order defined by +// C2_STUBS_DO, allowing dependencies from any givem stub on its +// predecessors to be guaranteed. That explains the initial placement +// of the blob declarations and intermediate placement of the jvmti +// stubs. + +#ifdef COMPILER2 +// do_jvmti_stub(name) +#if INCLUDE_JVMTI +#define C2_JVMTI_STUBS_DO(do_jvmti_stub) \ + do_jvmti_stub(notify_jvmti_vthread_start) \ + do_jvmti_stub(notify_jvmti_vthread_end) \ + do_jvmti_stub(notify_jvmti_vthread_mount) \ + do_jvmti_stub(notify_jvmti_vthread_unmount) \ + +#else +#define C2_JVMTI_STUBS_DO(do_jvmti_stub) +#endif // INCLUDE_JVMTI + +// do_blob(name, type) +// do_stub(name, fancy_jump, pass_tls, return_pc) +// do_jvmti_stub(name) +// +// n.b. non-jvmti stubs may employ a special type of jump (0, 1 or 2) +// and require access to TLS and the return pc. jvmti stubs always +// employ jump 0, and require no special access +#define C2_STUBS_DO(do_blob, do_stub, do_jvmti_stub) \ + do_blob(uncommon_trap, UncommonTrapBlob*) \ + do_blob(exception, ExceptionBlob*) \ + do_stub(new_instance, 0, true, false) \ + do_stub(new_array, 0, true, false) \ + do_stub(new_array_nozero, 0, true, false) \ + do_stub(multianewarray2, 0, true, false) \ + do_stub(multianewarray3, 0, true, false) \ + do_stub(multianewarray4, 0, true, false) \ + do_stub(multianewarray5, 0, true, false) \ + do_stub(multianewarrayN, 0, true, false) \ + C2_JVMTI_STUBS_DO(do_jvmti_stub) \ + do_stub(complete_monitor_locking, 0, false, false) \ + do_stub(monitor_notify, 0, false, false) \ + do_stub(monitor_notifyAll, 0, false, false) \ + do_stub(rethrow, 2, true, true) \ + do_stub(slow_arraycopy, 0, false, false) \ + do_stub(register_finalizer, 0, false, false) \ + +#else +#define C2_STUBS_DO(do_blob, do_stub, do_jvmti_stub) +#endif + +// generate a stub or blob id enum tag from a name #define STUB_ID_NAME(base) base##_id -// generate a blob id enum tag from a name +// generate a stub field name -#define BLOB_ID_NAME(base) base##_id +#define STUB_FIELD_NAME(base) _##base // generate a blob field name diff --git a/src/hotspot/share/runtime/stubRoutines.cpp b/src/hotspot/share/runtime/stubRoutines.cpp index c13f64fca4bed..a2b8c1da64490 100644 --- a/src/hotspot/share/runtime/stubRoutines.cpp +++ b/src/hotspot/share/runtime/stubRoutines.cpp @@ -171,6 +171,7 @@ address StubRoutines::_dlibm_sin_cos_huge = nullptr; address StubRoutines::_dlibm_reduce_pi04l = nullptr; address StubRoutines::_dlibm_tan_cot_huge = nullptr; address StubRoutines::_dtan = nullptr; +address StubRoutines::_dtanh = nullptr; address StubRoutines::_f2hf = nullptr; address StubRoutines::_hf2f = nullptr; diff --git a/src/hotspot/share/runtime/stubRoutines.hpp b/src/hotspot/share/runtime/stubRoutines.hpp index 206a5ec2e992c..b58c591bbf75c 100644 --- a/src/hotspot/share/runtime/stubRoutines.hpp +++ b/src/hotspot/share/runtime/stubRoutines.hpp @@ -281,6 +281,7 @@ class StubRoutines: AllStatic { static address _dlibm_reduce_pi04l; static address _dlibm_tan_cot_huge; static address _dtan; + static address _dtanh; static address _fmod; static address _f2hf; @@ -404,7 +405,7 @@ class StubRoutines: AllStatic { static address unsafe_setmemory() { return _unsafe_setmemory; } - typedef void (*UnsafeSetMemoryStub)(const void* src, size_t count, char byte); + typedef void (*UnsafeSetMemoryStub)(void* dst, size_t count, char byte); static UnsafeSetMemoryStub UnsafeSetMemory_stub() { return CAST_TO_FN_PTR(UnsafeSetMemoryStub, _unsafe_setmemory); } static address generic_arraycopy() { return _generic_arraycopy; } @@ -472,6 +473,7 @@ class StubRoutines: AllStatic { static address dlibm_sin_cos_huge() { return _dlibm_sin_cos_huge; } static address dlibm_tan_cot_huge() { return _dlibm_tan_cot_huge; } static address dtan() { return _dtan; } + static address dtanh() { return _dtanh; } // These are versions of the java.lang.Float::floatToFloat16() and float16ToFloat() // methods which perform the same operations as the intrinsic version. diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index e72077adabf3b..7c01c8d4e16b3 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -64,7 +64,7 @@ THREAD_LOCAL Thread* Thread::_thr_current = nullptr; DEBUG_ONLY(Thread* Thread::_starting_thread = nullptr;) -Thread::Thread(MEMFLAGS flags) { +Thread::Thread(MemTag mem_tag) { DEBUG_ONLY(_run_state = PRE_CALL_RUN;) @@ -78,9 +78,9 @@ Thread::Thread(MEMFLAGS flags) { // allocated data structures set_osthread(nullptr); - set_resource_area(new (flags) ResourceArea(flags)); + set_resource_area(new (mem_tag) ResourceArea(mem_tag)); DEBUG_ONLY(_current_resource_mark = nullptr;) - set_handle_area(new (flags) HandleArea(flags, nullptr)); + set_handle_area(new (mem_tag) HandleArea(mem_tag, nullptr)); set_metadata_handles(new (mtClass) GrowableArray(30, mtClass)); set_last_handle_mark(nullptr); DEBUG_ONLY(_missed_ic_stub_refill_verifier = nullptr); diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index e9fee4d113aaa..567a76d0eadea 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -277,7 +277,7 @@ class Thread: public ThreadShadow { // is waiting to lock public: // Constructor - Thread(MEMFLAGS flag = mtThread); + Thread(MemTag mem_tag = mtThread); virtual ~Thread() = 0; // Thread is abstract. // Manage Thread::current() diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index af904bdcfcd28..8266bd86a9682 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -393,6 +393,7 @@ void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) { initialize_class(vmSymbols::java_lang_ClassCastException(), CHECK); initialize_class(vmSymbols::java_lang_ArrayStoreException(), CHECK); initialize_class(vmSymbols::java_lang_ArithmeticException(), CHECK); + initialize_class(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), CHECK); initialize_class(vmSymbols::java_lang_StackOverflowError(), CHECK); initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK); initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK); diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 483b96fccf382..e0a36330687dc 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -373,9 +373,9 @@ /* CompressedOops */ \ /******************/ \ \ - static_field(CompressedOops, _narrow_oop._base, address) \ - static_field(CompressedOops, _narrow_oop._shift, int) \ - static_field(CompressedOops, _narrow_oop._use_implicit_null_checks, bool) \ + static_field(CompressedOops, _base, address) \ + static_field(CompressedOops, _shift, int) \ + static_field(CompressedOops, _use_implicit_null_checks, bool) \ \ /***************************/ \ /* CompressedKlassPointers */ \ diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index 7a2c083814614..78c655a43fcf2 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -138,9 +138,11 @@ void DCmd::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); +#endif // LINUX +#if defined(LINUX) || defined(_WIN64) DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true,false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true,false)); -#endif // LINUX +#endif // LINUX or WINDOWS DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -899,7 +901,6 @@ void EventLogDCmd::execute(DCmdSource source, TRAPS) { int max = -1; if (max_value != nullptr) { char* endptr = nullptr; - int max; if (!parse_integer(max_value, &max)) { output()->print_cr("Invalid max option: \"%s\".", max_value); return; @@ -1173,7 +1174,7 @@ void CompilationMemoryStatisticDCmd::execute(DCmdSource source, TRAPS) { CompilationMemoryStatistic::print_all_by_size(output(), human_readable, minsize); } -#ifdef LINUX +#if defined(LINUX) || defined(_WIN64) SystemMapDCmd::SystemMapDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} @@ -1191,16 +1192,22 @@ SystemDumpMapDCmd::SystemDumpMapDCmd(outputStream* output, bool heap) : void SystemDumpMapDCmd::execute(DCmdSource source, TRAPS) { const char* name = _filename.value(); + if (name == nullptr || name[0] == 0) { + output()->print_cr("filename is empty or not specified. No file written"); + return; + } fileStream fs(name); if (fs.is_open()) { if (!MemTracker::enabled()) { output()->print_cr("(NMT is disabled, will not annotate mappings)."); } MemMapPrinter::print_all_mappings(&fs); +#ifndef _WIN64 // For the readers convenience, resolve path name. char tmp[JVM_MAXPATHLEN]; const char* absname = os::Posix::realpath(name, tmp, sizeof(tmp)); name = absname != nullptr ? absname : name; +#endif output()->print_cr("Memory map dumped to \"%s\".", name); } else { output()->print_cr("Failed to open \"%s\" for writing (%s).", name, os::strerror(errno)); diff --git a/src/hotspot/share/services/diagnosticCommand.hpp b/src/hotspot/share/services/diagnosticCommand.hpp index ec3469c8d1523..99b5a3510645a 100644 --- a/src/hotspot/share/services/diagnosticCommand.hpp +++ b/src/hotspot/share/services/diagnosticCommand.hpp @@ -981,14 +981,14 @@ class CompilationMemoryStatisticDCmd: public DCmdWithParser { virtual void execute(DCmdSource source, TRAPS); }; -#ifdef LINUX +#if defined(LINUX) || defined(_WIN64) class SystemMapDCmd : public DCmd { public: SystemMapDCmd(outputStream* output, bool heap); static const char* name() { return "System.map"; } static const char* description() { - return "Prints an annotated process memory map of the VM process (linux only)."; + return "Prints an annotated process memory map of the VM process (linux and Windows only)."; } static const char* impact() { return "Medium; can be high for very large java heaps."; } static const JavaPermission permission() { @@ -1006,7 +1006,7 @@ class SystemDumpMapDCmd : public DCmdWithParser { SystemDumpMapDCmd(outputStream* output, bool heap); static const char* name() { return "System.dump_map"; } static const char* description() { - return "Dumps an annotated process memory map to an output file (linux only)."; + return "Dumps an annotated process memory map to an output file (linux and Windows only)."; } static const char* impact() { return "Medium; can be high for very large java heaps."; } static const JavaPermission permission() { @@ -1017,6 +1017,6 @@ class SystemDumpMapDCmd : public DCmdWithParser { virtual void execute(DCmdSource source, TRAPS); }; -#endif // LINUX +#endif // LINUX or WINDOWS #endif // SHARE_SERVICES_DIAGNOSTICCOMMAND_HPP diff --git a/src/hotspot/share/services/threadService.cpp b/src/hotspot/share/services/threadService.cpp index 09cb7ffb25a71..a1ad0a910f6d6 100644 --- a/src/hotspot/share/services/threadService.cpp +++ b/src/hotspot/share/services/threadService.cpp @@ -32,7 +32,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "oops/instanceKlass.hpp" #include "oops/klass.inline.hpp" #include "oops/objArrayKlass.hpp" diff --git a/src/hotspot/share/utilities/bitMap.cpp b/src/hotspot/share/utilities/bitMap.cpp index a07807070918f..423bc22cd9d6e 100644 --- a/src/hotspot/share/utilities/bitMap.cpp +++ b/src/hotspot/share/utilities/bitMap.cpp @@ -173,8 +173,8 @@ bm_word_t* ResourceBitMap::reallocate(bm_word_t* old_map, size_t old_size_in_wor return pseudo_reallocate(*this, old_map, old_size_in_words, new_size_in_words); } -CHeapBitMap::CHeapBitMap(idx_t size_in_bits, MEMFLAGS flags, bool clear) - : GrowableBitMap(), _flags(flags) { +CHeapBitMap::CHeapBitMap(idx_t size_in_bits, MemTag mem_tag, bool clear) + : GrowableBitMap(), _mem_tag(mem_tag) { initialize(size_in_bits, clear); } @@ -183,7 +183,7 @@ CHeapBitMap::~CHeapBitMap() { } bm_word_t* CHeapBitMap::allocate(idx_t size_in_words) const { - return MallocArrayAllocator::allocate(size_in_words, _flags); + return MallocArrayAllocator::allocate(size_in_words, _mem_tag); } // GrowableBitMap::resize uses free(ptr, size) for T as CHeapBitMap, ArenaBitMap and ResourceBitMap allocators. @@ -193,7 +193,7 @@ void CHeapBitMap::free(bm_word_t* map, idx_t size_in_words) const { } bm_word_t* CHeapBitMap::reallocate(bm_word_t* map, size_t old_size_in_words, size_t new_size_in_words) const { - return MallocArrayAllocator::reallocate(map, new_size_in_words, _flags); + return MallocArrayAllocator::reallocate(map, new_size_in_words, _mem_tag); } #ifdef ASSERT @@ -705,8 +705,6 @@ void BitMap::IteratorImpl::assert_not_empty() const { } #endif -#ifndef PRODUCT - void BitMap::print_on(outputStream* st) const { st->print("Bitmap (" SIZE_FORMAT " bits):", size()); for (idx_t index = 0; index < size(); index++) { @@ -722,8 +720,6 @@ void BitMap::print_on(outputStream* st) const { st->cr(); } -#endif - template class GrowableBitMap; template class GrowableBitMap; template class GrowableBitMap; diff --git a/src/hotspot/share/utilities/bitMap.hpp b/src/hotspot/share/utilities/bitMap.hpp index 5db12badbc95e..1c69a0d43f832 100644 --- a/src/hotspot/share/utilities/bitMap.hpp +++ b/src/hotspot/share/utilities/bitMap.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_UTILITIES_BITMAP_HPP #define SHARE_UTILITIES_BITMAP_HPP -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "runtime/atomic.hpp" #include "utilities/globalDefinitions.hpp" @@ -391,13 +391,10 @@ class BitMap { bool is_empty() const; void write_to(bm_word_t* buffer, size_t buffer_size_in_bytes) const; - void print_on_error(outputStream* st, const char* prefix) const; -#ifndef PRODUCT - public: // Printing + void print_on_error(outputStream* st, const char* prefix) const; void print_on(outputStream* st) const; -#endif }; // Implementation support for bitmap iteration. While it could be used to @@ -641,16 +638,16 @@ class ResourceBitMap : public GrowableBitMap { // A BitMap with storage in the CHeap. class CHeapBitMap : public GrowableBitMap { - // NMT memory type - const MEMFLAGS _flags; + // NMT memory tag + const MemTag _mem_tag; // Don't allow copy or assignment, to prevent the // allocated memory from leaking out to other instances. NONCOPYABLE(CHeapBitMap); public: - explicit CHeapBitMap(MEMFLAGS flags) : GrowableBitMap(), _flags(flags) {} - CHeapBitMap(idx_t size_in_bits, MEMFLAGS flags, bool clear = true); + explicit CHeapBitMap(MemTag mem_tag) : GrowableBitMap(), _mem_tag(mem_tag) {} + CHeapBitMap(idx_t size_in_bits, MemTag mem_tag, bool clear = true); ~CHeapBitMap(); bm_word_t* allocate(idx_t size_in_words) const; diff --git a/src/hotspot/share/utilities/chunkedList.hpp b/src/hotspot/share/utilities/chunkedList.hpp index 9a600e4ce1b50..3269c305e783c 100644 --- a/src/hotspot/share/utilities/chunkedList.hpp +++ b/src/hotspot/share/utilities/chunkedList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -28,7 +28,7 @@ #include "memory/allocation.hpp" #include "utilities/debug.hpp" -template class ChunkedList : public CHeapObj { +template class ChunkedList : public CHeapObj { template friend class TestChunkedList; static const size_t BufferSize = 64; @@ -36,8 +36,8 @@ template class ChunkedList : public CHeapObj { T _values[BufferSize]; T* _top; - ChunkedList* _next_used; - ChunkedList* _next_free; + ChunkedList* _next_used; + ChunkedList* _next_free; T const * end() const { return &_values[BufferSize]; @@ -62,11 +62,11 @@ template class ChunkedList : public CHeapObj { _top++; } - void set_next_used(ChunkedList* buffer) { _next_used = buffer; } - void set_next_free(ChunkedList* buffer) { _next_free = buffer; } + void set_next_used(ChunkedList* buffer) { _next_used = buffer; } + void set_next_free(ChunkedList* buffer) { _next_free = buffer; } - ChunkedList* next_used() const { return _next_used; } - ChunkedList* next_free() const { return _next_free; } + ChunkedList* next_used() const { return _next_used; } + ChunkedList* next_free() const { return _next_free; } size_t size() const { return pointer_delta(_top, _values, sizeof(T)); diff --git a/src/hotspot/share/utilities/concurrentHashTable.hpp b/src/hotspot/share/utilities/concurrentHashTable.hpp index 4e506d5fe84f1..402a767c0b8ab 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.hpp @@ -40,8 +40,8 @@ class Thread; class Mutex; -template -class ConcurrentHashTable : public CHeapObj { +template +class ConcurrentHashTable : public CHeapObj { typedef typename CONFIG::Value VALUE; private: // _stats_rate is null if statistics are not enabled. @@ -61,7 +61,7 @@ class ConcurrentHashTable : public CHeapObj { TableStatistics statistics_calculate(Thread* thread, VALUE_SIZE_FUNC& vs_f); // This is the internal node structure. - // Only constructed with placement new from memory allocated with MEMFLAGS of + // Only constructed with placement new from memory allocated with MemTag of // the InternalTable or user-defined memory. class Node { private: @@ -105,7 +105,7 @@ class ConcurrentHashTable : public CHeapObj { } }; - // Only constructed with placement new from an array allocated with MEMFLAGS + // Only constructed with placement new from an array allocated with MemTag // of InternalTable. class Bucket { private: @@ -202,7 +202,7 @@ class ConcurrentHashTable : public CHeapObj { // - Re-size can only change the size into half or double // (any pow 2 would also be possible). // - Use masking of hash for bucket index. - class InternalTable : public CHeapObj { + class InternalTable : public CHeapObj { private: Bucket* _buckets; // Bucket array. public: @@ -277,10 +277,10 @@ class ConcurrentHashTable : public CHeapObj { class ScopedCS: public StackObj { protected: Thread* _thread; - ConcurrentHashTable* _cht; + ConcurrentHashTable* _cht; GlobalCounter::CSContext _cs_context; public: - ScopedCS(Thread* thread, ConcurrentHashTable* cht); + ScopedCS(Thread* thread, ConcurrentHashTable* cht); ~ScopedCS(); }; @@ -372,7 +372,7 @@ class ConcurrentHashTable : public CHeapObj { // Check for dead items in a bucket. template size_t delete_check_nodes(Bucket* bucket, EVALUATE_FUNC& eval_f, - size_t num_del, Node** ndel, GrowableArrayCHeap& ndel_heap); + size_t num_del, Node** ndel, GrowableArrayCHeap& ndel_heap); // Check for dead items in this table. During shrink/grow we cannot guarantee // that we only visit nodes once. To keep it simple caller will have locked @@ -539,12 +539,12 @@ class ConcurrentHashTable : public CHeapObj { // Moves all nodes from this table to to_cht with new hash code. // Must be done at a safepoint. - void rehash_nodes_to(Thread* thread, ConcurrentHashTable* to_cht); + void rehash_nodes_to(Thread* thread, ConcurrentHashTable* to_cht); // Scoped multi getter. class MultiGetHandle : private ScopedCS { public: - MultiGetHandle(Thread* thread, ConcurrentHashTable* cht) + MultiGetHandle(Thread* thread, ConcurrentHashTable* cht) : ScopedCS(thread, cht) {} // In the MultiGetHandle scope you can lookup items matching LOOKUP_FUNC. // The VALUEs are safe as long as you never save the VALUEs outside the diff --git a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp index f035aeae44847..5656655275adb 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp @@ -58,28 +58,28 @@ static void* const POISON_PTR = (void*)0xffbadbac; #endif // Node -template -inline typename ConcurrentHashTable::Node* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::Node* +ConcurrentHashTable:: Node::next() const { return Atomic::load_acquire(&_next); } // Bucket -template -inline typename ConcurrentHashTable::Node* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::Node* +ConcurrentHashTable:: Bucket::first_raw() const { return Atomic::load_acquire(&_first); } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: Bucket::release_assign_node_ptr( - typename ConcurrentHashTable::Node* const volatile * dst, - typename ConcurrentHashTable::Node* node) const + typename ConcurrentHashTable::Node* const volatile * dst, + typename ConcurrentHashTable::Node* node) const { // Due to this assert this methods is not static. assert(is_locked(), "Must be locked."); @@ -87,31 +87,31 @@ inline void ConcurrentHashTable:: Atomic::release_store(tmp, clear_set_state(node, *dst)); } -template -inline typename ConcurrentHashTable::Node* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::Node* +ConcurrentHashTable:: Bucket::first() const { // We strip the states bit before returning the ptr. return clear_state(Atomic::load_acquire(&_first)); } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: Bucket::have_redirect() const { return is_state(first_raw(), STATE_REDIRECT_BIT); } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: Bucket::is_locked() const { return is_state(first_raw(), STATE_LOCK_BIT); } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: Bucket::lock() { int i = 0; @@ -128,10 +128,10 @@ inline void ConcurrentHashTable:: } } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: Bucket::release_assign_last_node_next( - typename ConcurrentHashTable::Node* node) + typename ConcurrentHashTable::Node* node) { assert(is_locked(), "Must be locked."); Node* const volatile * ret = first_ptr(); @@ -141,10 +141,10 @@ inline void ConcurrentHashTable:: release_assign_node_ptr(ret, node); } -template -inline bool ConcurrentHashTable:: - Bucket::cas_first(typename ConcurrentHashTable::Node* node, - typename ConcurrentHashTable::Node* expect +template +inline bool ConcurrentHashTable:: + Bucket::cas_first(typename ConcurrentHashTable::Node* node, + typename ConcurrentHashTable::Node* expect ) { if (is_locked()) { @@ -156,8 +156,8 @@ inline bool ConcurrentHashTable:: return false; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: Bucket::trylock() { if (is_locked()) { @@ -171,8 +171,8 @@ inline bool ConcurrentHashTable:: return false; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: Bucket::unlock() { assert(is_locked(), "Must be locked."); @@ -181,8 +181,8 @@ inline void ConcurrentHashTable:: Atomic::release_store(&_first, clear_state(first())); } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: Bucket::redirect() { assert(is_locked(), "Must be locked."); @@ -190,15 +190,15 @@ inline void ConcurrentHashTable:: } // InternalTable -template -inline ConcurrentHashTable:: +template +inline ConcurrentHashTable:: InternalTable::InternalTable(size_t log2_size) : _log2_size(log2_size), _size(((size_t)1ul) << _log2_size), _hash_mask(~(~((size_t)0) << _log2_size)) { assert(_log2_size >= SIZE_SMALL_LOG2 && _log2_size <= SIZE_BIG_LOG2, "Bad size"); - _buckets = NEW_C_HEAP_ARRAY(Bucket, _size, F); + _buckets = NEW_C_HEAP_ARRAY(Bucket, _size, MT); // Use placement new for each element instead of new[] which could use more // memory than allocated. for (size_t i = 0; i < _size; ++i) { @@ -206,17 +206,17 @@ inline ConcurrentHashTable:: } } -template -inline ConcurrentHashTable:: +template +inline ConcurrentHashTable:: InternalTable::~InternalTable() { FREE_C_HEAP_ARRAY(Bucket, _buckets); } // ScopedCS -template -inline ConcurrentHashTable:: - ScopedCS::ScopedCS(Thread* thread, ConcurrentHashTable* cht) +template +inline ConcurrentHashTable:: + ScopedCS::ScopedCS(Thread* thread, ConcurrentHashTable* cht) : _thread(thread), _cht(cht), _cs_context(GlobalCounter::critical_section_begin(_thread)) @@ -227,25 +227,25 @@ inline ConcurrentHashTable:: } } -template -inline ConcurrentHashTable:: +template +inline ConcurrentHashTable:: ScopedCS::~ScopedCS() { GlobalCounter::critical_section_end(_thread, _cs_context); } -template +template template -inline typename CONFIG::Value* ConcurrentHashTable:: +inline typename CONFIG::Value* ConcurrentHashTable:: MultiGetHandle::get(LOOKUP_FUNC& lookup_f, bool* grow_hint) { return ScopedCS::_cht->internal_get(ScopedCS::_thread, lookup_f, grow_hint); } // HaveDeletables -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: HaveDeletables::have_deletable(Bucket* bucket, EVALUATE_FUNC& eval_f, Bucket* prefetch_bucket) @@ -271,9 +271,9 @@ inline bool ConcurrentHashTable:: return false; } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: HaveDeletables::have_deletable(Bucket* bucket, EVALUATE_FUNC& eval_f, Bucket* preb) @@ -287,8 +287,8 @@ inline bool ConcurrentHashTable:: } // ConcurrentHashTable -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: write_synchonize_on_visible_epoch(Thread* thread) { assert(_resize_lock_owner == thread, "Re-size lock not held"); @@ -304,8 +304,8 @@ inline void ConcurrentHashTable:: GlobalCounter::write_synchronize(); } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: try_resize_lock(Thread* locker) { if (_resize_lock->try_lock()) { @@ -323,8 +323,8 @@ inline bool ConcurrentHashTable:: return true; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: lock_resize_lock(Thread* locker) { size_t i = 0; @@ -348,8 +348,8 @@ inline void ConcurrentHashTable:: _invisible_epoch = nullptr; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: unlock_resize_lock(Thread* locker) { _invisible_epoch = nullptr; @@ -358,8 +358,8 @@ inline void ConcurrentHashTable:: _resize_lock->unlock(); } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: free_nodes() { // We assume we are not MT during freeing. @@ -374,25 +374,25 @@ inline void ConcurrentHashTable:: } } -template -inline typename ConcurrentHashTable::InternalTable* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::InternalTable* +ConcurrentHashTable:: get_table() const { return Atomic::load_acquire(&_table); } -template -inline typename ConcurrentHashTable::InternalTable* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::InternalTable* +ConcurrentHashTable:: get_new_table() const { return Atomic::load_acquire(&_new_table); } -template -inline typename ConcurrentHashTable::InternalTable* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::InternalTable* +ConcurrentHashTable:: set_table_from_new() { InternalTable* old_table = _table; @@ -406,8 +406,8 @@ ConcurrentHashTable:: return old_table; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: internal_grow_range(Thread* thread, size_t start, size_t stop) { assert(stop <= _table->_size, "Outside backing array"); @@ -446,9 +446,9 @@ inline void ConcurrentHashTable:: } } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: internal_remove(Thread* thread, LOOKUP_FUNC& lookup_f, DELETE_FUNC& delete_f) { Bucket* bucket = get_bucket_locked(thread, lookup_f.get_hash()); @@ -478,9 +478,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: do_bulk_delete_locked_for(Thread* thread, size_t start_idx, size_t stop_idx, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f, bool is_mt) { @@ -513,7 +513,7 @@ inline void ConcurrentHashTable:: // We left critical section but the bucket cannot be removed while we hold // the _resize_lock. bucket->lock(); - GrowableArrayCHeap extra(0); // use this buffer if StackBufferSize is not enough + GrowableArrayCHeap extra(0); // use this buffer if StackBufferSize is not enough size_t nd = delete_check_nodes(bucket, eval_f, StackBufferSize, ndel_stack, extra); bucket->unlock(); if (is_mt) { @@ -533,9 +533,9 @@ inline void ConcurrentHashTable:: GlobalCounter::critical_section_end(thread, cs_context); } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: delete_in_bucket(Thread* thread, Bucket* bucket, LOOKUP_FUNC& lookup_f) { assert(bucket->is_locked(), "Must be locked."); @@ -568,9 +568,9 @@ inline void ConcurrentHashTable:: } } -template -inline typename ConcurrentHashTable::Bucket* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::Bucket* +ConcurrentHashTable:: get_bucket(uintx hash) const { InternalTable* table = get_table(); @@ -582,9 +582,9 @@ ConcurrentHashTable:: return bucket; } -template -inline typename ConcurrentHashTable::Bucket* -ConcurrentHashTable:: +template +inline typename ConcurrentHashTable::Bucket* +ConcurrentHashTable:: get_bucket_locked(Thread* thread, const uintx hash) { Bucket* bucket; @@ -613,10 +613,10 @@ ConcurrentHashTable:: } // Always called within critical section -template +template template -typename ConcurrentHashTable::Node* -ConcurrentHashTable:: +typename ConcurrentHashTable::Node* +ConcurrentHashTable:: get_node(const Bucket* const bucket, LOOKUP_FUNC& lookup_f, bool* have_dead, size_t* loops) const { @@ -638,8 +638,8 @@ ConcurrentHashTable:: return node; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: unzip_bucket(Thread* thread, InternalTable* old_table, InternalTable* new_table, size_t even_index, size_t odd_index) { @@ -698,8 +698,8 @@ inline bool ConcurrentHashTable:: return true; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: internal_shrink_prolog(Thread* thread, size_t log2_size) { if (!try_resize_lock(thread)) { @@ -715,8 +715,8 @@ inline bool ConcurrentHashTable:: return true; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: internal_shrink_epilog(Thread* thread) { assert(_resize_lock_owner == thread, "Re-size lock not held"); @@ -734,8 +734,8 @@ inline void ConcurrentHashTable:: delete old_table; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: internal_shrink_range(Thread* thread, size_t start, size_t stop) { // The state is also copied here. @@ -771,8 +771,8 @@ inline void ConcurrentHashTable:: } } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: internal_shrink(Thread* thread, size_t log2_size) { if (!internal_shrink_prolog(thread, log2_size)) { @@ -786,8 +786,8 @@ inline bool ConcurrentHashTable:: return true; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: internal_reset(size_t log2_size) { assert(_table != nullptr, "table failed"); @@ -800,8 +800,8 @@ inline void ConcurrentHashTable:: Atomic::release_store(&_table, table); } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: internal_grow_prolog(Thread* thread, size_t log2_size) { // This double checking of _size_limit_reached/is_max_size_reached() @@ -826,8 +826,8 @@ inline bool ConcurrentHashTable:: return true; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: internal_grow_epilog(Thread* thread) { assert(_resize_lock_owner == thread, "Should be locked"); @@ -844,8 +844,8 @@ inline void ConcurrentHashTable:: delete old_table; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: internal_grow(Thread* thread, size_t log2_size) { if (!internal_grow_prolog(thread, log2_size)) { @@ -860,9 +860,9 @@ inline bool ConcurrentHashTable:: } // Always called within critical section -template +template template -inline typename CONFIG::Value* ConcurrentHashTable:: +inline typename CONFIG::Value* ConcurrentHashTable:: internal_get(Thread* thread, LOOKUP_FUNC& lookup_f, bool* grow_hint) { bool clean = false; @@ -881,9 +881,9 @@ inline typename CONFIG::Value* ConcurrentHashTable:: return ret; } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: internal_insert_get(Thread* thread, LOOKUP_FUNC& lookup_f, const VALUE& value, FOUND_FUNC& foundf, bool* grow_hint, bool* clean_hint) { @@ -949,9 +949,9 @@ inline bool ConcurrentHashTable:: return ret; } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: visit_nodes(Bucket* bucket, FUNC& visitor_f) { Node* current_node = bucket->first(); @@ -965,9 +965,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: do_scan_locked(Thread* thread, FUNC& scan_f) { assert(_resize_lock_owner == thread, "Re-size lock not held"); @@ -982,11 +982,11 @@ inline void ConcurrentHashTable:: } /* ends critical section */ } -template +template template -inline size_t ConcurrentHashTable:: +inline size_t ConcurrentHashTable:: delete_check_nodes(Bucket* bucket, EVALUATE_FUNC& eval_f, - size_t num_del, Node** ndel, GrowableArrayCHeap& extra) + size_t num_del, Node** ndel, GrowableArrayCHeap& extra) { size_t dels = 0; Node* const volatile * rem_n_prev = bucket->first_ptr(); @@ -1013,8 +1013,8 @@ inline size_t ConcurrentHashTable:: } // Constructor -template -inline ConcurrentHashTable:: +template +inline ConcurrentHashTable:: ConcurrentHashTable(size_t log2size, size_t log2size_limit, size_t grow_hint, bool enable_statistics, Mutex::Rank rank, void* context) : _context(context), _new_table(nullptr), _log2_size_limit(log2size_limit), _log2_start_size(log2size), _grow_hint(grow_hint), @@ -1032,8 +1032,8 @@ ConcurrentHashTable(size_t log2size, size_t log2size_limit, size_t grow_hint, bo _size_limit_reached = _table->_log2_size == _log2_size_limit; } -template -inline ConcurrentHashTable:: +template +inline ConcurrentHashTable:: ~ConcurrentHashTable() { delete _resize_lock; @@ -1042,24 +1042,24 @@ inline ConcurrentHashTable:: delete _stats_rate; } -template -inline size_t ConcurrentHashTable:: +template +inline size_t ConcurrentHashTable:: get_mem_size(Thread* thread) { ScopedCS cs(thread, this); return sizeof(*this) + _table->get_mem_size(); } -template -inline size_t ConcurrentHashTable:: +template +inline size_t ConcurrentHashTable:: get_size_log2(Thread* thread) { ScopedCS cs(thread, this); return _table->_log2_size; } -template -inline size_t ConcurrentHashTable:: +template +inline size_t ConcurrentHashTable:: get_dynamic_node_size(size_t value_size) { assert(Node::is_dynamic_sized_value_compatible(), "VALUE must be compatible"); @@ -1067,8 +1067,8 @@ inline size_t ConcurrentHashTable:: return sizeof(Node) - sizeof(VALUE) + value_size; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: shrink(Thread* thread, size_t size_limit_log2) { size_t tmp = size_limit_log2 == 0 ? _log2_start_size : size_limit_log2; @@ -1076,25 +1076,25 @@ inline bool ConcurrentHashTable:: return ret; } -template -inline void ConcurrentHashTable:: +template +inline void ConcurrentHashTable:: unsafe_reset(size_t size_log2) { size_t tmp = size_log2 == 0 ? _log2_start_size : size_log2; internal_reset(tmp); } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: grow(Thread* thread, size_t size_limit_log2) { size_t tmp = size_limit_log2 == 0 ? _log2_size_limit : size_limit_log2; return internal_grow(thread, tmp); } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: get(Thread* thread, LOOKUP_FUNC& lookup_f, FOUND_FUNC& found_f, bool* grow_hint) { bool ret = false; @@ -1107,8 +1107,8 @@ inline bool ConcurrentHashTable:: return ret; } -template -inline bool ConcurrentHashTable:: +template +inline bool ConcurrentHashTable:: unsafe_insert(const VALUE& value) { bool dead_hash = false; size_t hash = CONFIG::get_hash(value, &dead_hash); @@ -1128,9 +1128,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: try_scan(Thread* thread, SCAN_FUNC& scan_f) { if (!try_resize_lock(thread)) { @@ -1141,9 +1141,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: do_scan(Thread* thread, SCAN_FUNC& scan_f) { assert(!SafepointSynchronize::is_at_safepoint(), @@ -1155,9 +1155,9 @@ inline void ConcurrentHashTable:: assert(_resize_lock_owner != thread, "Re-size lock held"); } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: do_safepoint_scan(SCAN_FUNC& scan_f) { // We only allow this method to be used during a safepoint. @@ -1179,9 +1179,9 @@ inline void ConcurrentHashTable:: do_scan_for_range(scan_f, 0, table->_size, table); } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: do_scan_for_range(FUNC& scan_f, size_t start_idx, size_t stop_idx, InternalTable* table) { assert(start_idx < stop_idx, "Must be"); @@ -1204,9 +1204,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline bool ConcurrentHashTable:: +inline bool ConcurrentHashTable:: try_bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f) { if (!try_resize_lock(thread)) { @@ -1218,9 +1218,9 @@ inline bool ConcurrentHashTable:: return true; } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: bulk_delete(Thread* thread, EVALUATE_FUNC& eval_f, DELETE_FUNC& del_f) { assert(!SafepointSynchronize::is_at_safepoint(), @@ -1230,9 +1230,9 @@ inline void ConcurrentHashTable:: unlock_resize_lock(thread); } -template +template template -inline TableStatistics ConcurrentHashTable:: +inline TableStatistics ConcurrentHashTable:: statistics_calculate(Thread* thread, VALUE_SIZE_FUNC& vs_f) { constexpr size_t batch_size = 128; @@ -1268,9 +1268,9 @@ inline TableStatistics ConcurrentHashTable:: } } -template +template template -inline TableStatistics ConcurrentHashTable:: +inline TableStatistics ConcurrentHashTable:: statistics_get(Thread* thread, VALUE_SIZE_FUNC& vs_f, TableStatistics old) { if (!try_resize_lock(thread)) { @@ -1283,9 +1283,9 @@ inline TableStatistics ConcurrentHashTable:: return ts; } -template +template template -inline void ConcurrentHashTable:: +inline void ConcurrentHashTable:: statistics_to(Thread* thread, VALUE_SIZE_FUNC& vs_f, outputStream* st, const char* table_name) { @@ -1300,9 +1300,9 @@ inline void ConcurrentHashTable:: ts.print(st, table_name); } -template -inline void ConcurrentHashTable:: - rehash_nodes_to(Thread* thread, ConcurrentHashTable* to_cht) +template +inline void ConcurrentHashTable:: + rehash_nodes_to(Thread* thread, ConcurrentHashTable* to_cht) { assert(is_safepoint_safe(), "rehashing is at a safepoint - cannot be resizing"); assert(_new_table == nullptr || _new_table == POISON_PTR, "Must be null"); diff --git a/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp b/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp index db9dcae987c3f..44b2f91c3f231 100644 --- a/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp +++ b/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -35,10 +35,10 @@ // operations, which they are serialized with each other. // Base class for pause and/or parallel bulk operations. -template -class ConcurrentHashTable::BucketsOperation { +template +class ConcurrentHashTable::BucketsOperation { protected: - ConcurrentHashTable* _cht; + ConcurrentHashTable* _cht; class InternalTableClaimer { volatile size_t _next; @@ -88,7 +88,7 @@ class ConcurrentHashTable::BucketsOperation { InternalTableClaimer _table_claimer; bool _is_mt; - BucketsOperation(ConcurrentHashTable* cht, bool is_mt = false) + BucketsOperation(ConcurrentHashTable* cht, bool is_mt = false) : _cht(cht), _table_claimer(DEFAULT_TASK_SIZE_LOG2, _cht->_table), _is_mt(is_mt) {} // Returns true if you succeeded to claim the range start -> (stop-1). @@ -146,12 +146,12 @@ class ConcurrentHashTable::BucketsOperation { }; // For doing pausable/parallel bulk delete. -template -class ConcurrentHashTable::BulkDeleteTask : +template +class ConcurrentHashTable::BulkDeleteTask : public BucketsOperation { public: - BulkDeleteTask(ConcurrentHashTable* cht, bool is_mt = false) + BulkDeleteTask(ConcurrentHashTable* cht, bool is_mt = false) : BucketsOperation(cht, is_mt) { } // Before start prepare must be called. @@ -190,12 +190,12 @@ class ConcurrentHashTable::BulkDeleteTask : } }; -template -class ConcurrentHashTable::GrowTask : +template +class ConcurrentHashTable::GrowTask : public BucketsOperation { public: - GrowTask(ConcurrentHashTable* cht) : BucketsOperation(cht) { + GrowTask(ConcurrentHashTable* cht) : BucketsOperation(cht) { } // Before start prepare must be called. bool prepare(Thread* thread) { @@ -229,8 +229,8 @@ class ConcurrentHashTable::GrowTask : } }; -template -class ConcurrentHashTable::ScanTask : +template +class ConcurrentHashTable::ScanTask : public BucketsOperation { // If there is a paused resize, we need to scan items already @@ -255,11 +255,11 @@ class ConcurrentHashTable::ScanTask : } public: - ScanTask(ConcurrentHashTable* cht, size_t claim_size) : BucketsOperation(cht), _new_table_claimer() { + ScanTask(ConcurrentHashTable* cht, size_t claim_size) : BucketsOperation(cht), _new_table_claimer() { set(cht, claim_size); } - void set(ConcurrentHashTable* cht, size_t claim_size) { + void set(ConcurrentHashTable* cht, size_t claim_size) { this->_table_claimer.set(claim_size, cht->get_table()); InternalTable* new_table = cht->get_new_table(); diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp index 9f839fc1a136b..119d1cf17fd2d 100644 --- a/src/hotspot/share/utilities/debug.cpp +++ b/src/hotspot/share/utilities/debug.cpp @@ -711,7 +711,7 @@ static ucontext_t g_stored_assertion_context; void initialize_assert_poison() { char* page = os::reserve_memory(os::vm_page_size()); if (page) { - MemTracker::record_virtual_memory_type(page, mtInternal); + MemTracker::record_virtual_memory_tag(page, mtInternal); if (os::commit_memory(page, os::vm_page_size(), false) && os::protect_memory(page, os::vm_page_size(), os::MEM_PROT_NONE)) { g_assert_poison = page; diff --git a/src/hotspot/share/utilities/debug.hpp b/src/hotspot/share/utilities/debug.hpp index f4e97832a5de0..567e72cda57f0 100644 --- a/src/hotspot/share/utilities/debug.hpp +++ b/src/hotspot/share/utilities/debug.hpp @@ -139,22 +139,25 @@ class DebuggingContext { // assertions #ifndef ASSERT +#define vmassert_with_file_and_line(p, file, line, ...) #define vmassert(p, ...) #else // Note: message says "assert" rather than "vmassert" for backward // compatibility with tools that parse/match the message text. // Note: The signature is vmassert(p, format, ...), but the solaris // compiler can't handle an empty ellipsis in a macro without a warning. -#define vmassert(p, ...) \ -do { \ - if (! VMASSERT_CHECK_PASSED(p)) { \ - TOUCH_ASSERT_POISON; \ - report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", __VA_ARGS__); \ - } \ +#define vmassert_with_file_and_line(p, file, line, ...) \ +do { \ + if (! VMASSERT_CHECK_PASSED(p)) { \ + TOUCH_ASSERT_POISON; \ + report_vm_error(file, line, "assert(" #p ") failed", __VA_ARGS__); \ + } \ } while (0) +#define vmassert(p, ...) vmassert_with_file_and_line(p, __FILE__, __LINE__, __VA_ARGS__) #endif // For backward compatibility. +#define assert_with_file_and_line(p, file, line, ...) vmassert_with_file_and_line(p, file, line, __VA_ARGS__) #define assert(p, ...) vmassert(p, __VA_ARGS__) #define precond(p) assert(p, "precond") diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index b7be6dc04bfa5..6d385165b8b1b 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -384,9 +384,14 @@ inline T byte_size_in_proper_unit(T s) { #define PROPERFMT SIZE_FORMAT "%s" #define PROPERFMTARGS(s) byte_size_in_proper_unit(s), proper_unit_for_byte_size(s) +// Printing a range, with start and bytes given #define RANGEFMT "[" PTR_FORMAT " - " PTR_FORMAT "), (" SIZE_FORMAT " bytes)" #define RANGEFMTARGS(p1, size) p2i(p1), p2i(p1 + size), size +// Printing a range, with start and end given +#define RANGE2FMT "[" PTR_FORMAT " - " PTR_FORMAT "), (" SIZE_FORMAT " bytes)" +#define RANGE2FMTARGS(p1, p2) p2i(p1), p2i(p2), ((uintptr_t)p2 - (uintptr_t)p1) + inline const char* exact_unit_for_byte_size(size_t s) { #ifdef _LP64 if (s >= G && (s % G) == 0) { diff --git a/src/hotspot/share/utilities/growableArray.cpp b/src/hotspot/share/utilities/growableArray.cpp index 8e1057dd9f846..60ed0a477e8e0 100644 --- a/src/hotspot/share/utilities/growableArray.cpp +++ b/src/hotspot/share/utilities/growableArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -42,13 +42,13 @@ void* GrowableArrayArenaAllocator::allocate(int max, int element_size, Arena* ar return arena->Amalloc(byte_size); } -void* GrowableArrayCHeapAllocator::allocate(int max, int element_size, MEMFLAGS memflags) { +void* GrowableArrayCHeapAllocator::allocate(int max, int element_size, MemTag mem_tag) { assert(max >= 0, "integer overflow"); size_t byte_size = element_size * (size_t) max; - // memory type has to be specified for C heap allocation - assert(memflags != mtNone, "memory type not specified for C heap object"); - return (void*)AllocateHeap(byte_size, memflags); + // memory tag has to be specified for C heap allocation + assert(mem_tag != mtNone, "memory tag not specified for C heap object"); + return (void*)AllocateHeap(byte_size, mem_tag); } void GrowableArrayCHeapAllocator::deallocate(void* elements) { diff --git a/src/hotspot/share/utilities/growableArray.hpp b/src/hotspot/share/utilities/growableArray.hpp index 79d03f58a9e7d..2eb8e6fd09e12 100644 --- a/src/hotspot/share/utilities/growableArray.hpp +++ b/src/hotspot/share/utilities/growableArray.hpp @@ -595,7 +595,7 @@ class GrowableArrayArenaAllocator { // CHeap allocator class GrowableArrayCHeapAllocator { public: - static void* allocate(int max, int element_size, MEMFLAGS memflags); + static void* allocate(int max, int element_size, MemTag mem_tag); static void deallocate(void* mem); }; @@ -628,9 +628,9 @@ class GrowableArrayMetadata { } // CHeap allocation - static uintptr_t bits(MEMFLAGS memflags) { - assert(memflags != mtNone, "Must provide a proper MEMFLAGS"); - return (uintptr_t(memflags) << 1) | 1; + static uintptr_t bits(MemTag mem_tag) { + assert(mem_tag != mtNone, "Must provide a proper MemTag"); + return (uintptr_t(mem_tag) << 1) | 1; } // Arena allocation @@ -653,8 +653,8 @@ class GrowableArrayMetadata { } // CHeap allocation - GrowableArrayMetadata(MEMFLAGS memflags) : - _bits(bits(memflags)) + GrowableArrayMetadata(MemTag mem_tag) : + _bits(bits(mem_tag)) debug_only(COMMA _nesting_check(false)) { } @@ -683,14 +683,14 @@ class GrowableArrayMetadata { bool on_arena() const { return (_bits & 1) == 0 && _bits != 0; } Arena* arena() const { return (Arena*)_bits; } - MEMFLAGS memflags() const { return MEMFLAGS(_bits >> 1); } + MemTag mem_tag() const { return MemTag(_bits >> 1); } }; // THE GrowableArray. // // Supports multiple allocation strategies: // - Resource stack allocation: if no extra argument is provided -// - CHeap allocation: if memflags is provided +// - CHeap allocation: if mem_tag is provided // - Arena allocation: if an arena is provided // // There are some drawbacks of using GrowableArray, that are removed in some @@ -712,8 +712,8 @@ class GrowableArray : public GrowableArrayWithAllocator> { return (E*)GrowableArrayResourceAllocator::allocate(max, sizeof(E)); } - static E* allocate(int max, MEMFLAGS memflags) { - return (E*)GrowableArrayCHeapAllocator::allocate(max, sizeof(E), memflags); + static E* allocate(int max, MemTag mem_tag) { + return (E*)GrowableArrayCHeapAllocator::allocate(max, sizeof(E), mem_tag); } static E* allocate(int max, Arena* arena) { @@ -736,7 +736,7 @@ class GrowableArray : public GrowableArrayWithAllocator> { } if (on_C_heap()) { - return allocate(this->_capacity, _metadata.memflags()); + return allocate(this->_capacity, _metadata.mem_tag()); } assert(on_arena(), "Sanity"); @@ -760,11 +760,11 @@ class GrowableArray : public GrowableArrayWithAllocator> { init_checks(); } - GrowableArray(int initial_capacity, MEMFLAGS memflags) : + GrowableArray(int initial_capacity, MemTag mem_tag) : GrowableArrayWithAllocator( - allocate(initial_capacity, memflags), + allocate(initial_capacity, mem_tag), initial_capacity), - _metadata(memflags) { + _metadata(mem_tag) { init_checks(); } @@ -776,11 +776,11 @@ class GrowableArray : public GrowableArrayWithAllocator> { init_checks(); } - GrowableArray(int initial_capacity, int initial_len, const E& filler, MEMFLAGS memflags) : + GrowableArray(int initial_capacity, int initial_len, const E& filler, MemTag mem_tag) : GrowableArrayWithAllocator( - allocate(initial_capacity, memflags), + allocate(initial_capacity, mem_tag), initial_capacity, initial_len, filler), - _metadata(memflags) { + _metadata(mem_tag) { init_checks(); } @@ -799,25 +799,25 @@ class GrowableArray : public GrowableArrayWithAllocator> { } }; -// Leaner GrowableArray for CHeap backed data arrays, with compile-time decided MEMFLAGS. -template -class GrowableArrayCHeap : public GrowableArrayWithAllocator > { - friend class GrowableArrayWithAllocator >; +// Leaner GrowableArray for CHeap backed data arrays, with compile-time decided MemTag. +template +class GrowableArrayCHeap : public GrowableArrayWithAllocator > { + friend class GrowableArrayWithAllocator >; - STATIC_ASSERT(F != mtNone); + STATIC_ASSERT(MT != mtNone); - static E* allocate(int max, MEMFLAGS flags) { + static E* allocate(int max, MemTag mem_tag) { if (max == 0) { return nullptr; } - return (E*)GrowableArrayCHeapAllocator::allocate(max, sizeof(E), flags); + return (E*)GrowableArrayCHeapAllocator::allocate(max, sizeof(E), mem_tag); } NONCOPYABLE(GrowableArrayCHeap); E* allocate() { - return allocate(this->_capacity, F); + return allocate(this->_capacity, MT); } void deallocate(E* mem) { @@ -826,13 +826,13 @@ class GrowableArrayCHeap : public GrowableArrayWithAllocator >( - allocate(initial_capacity, F), + GrowableArrayWithAllocator >( + allocate(initial_capacity, MT), initial_capacity) {} GrowableArrayCHeap(int initial_capacity, int initial_len, const E& filler) : - GrowableArrayWithAllocator >( - allocate(initial_capacity, F), + GrowableArrayWithAllocator >( + allocate(initial_capacity, MT), initial_capacity, initial_len, filler) {} ~GrowableArrayCHeap() { @@ -840,11 +840,11 @@ class GrowableArrayCHeap : public GrowableArrayWithAllocator class LinkedList : public AnyObj { // A linked list implementation. // The linked list can be allocated in various type of memory: C heap, arena and resource area, etc. template + MemTag MT = mtNMT, AllocFailType alloc_failmode = AllocFailStrategy::RETURN_NULL> class LinkedListImpl : public LinkedList { protected: Arena* _arena; @@ -342,9 +342,9 @@ template (e); + return new(std::nothrow, MT) LinkedListNode(e); } else { - return new(F) LinkedListNode(e); + return new(MT) LinkedListNode(e); } } default: @@ -365,14 +365,14 @@ template - class SortedLinkedList : public LinkedListImpl { + MemTag MT = mtNMT, AllocFailType alloc_failmode = AllocFailStrategy::RETURN_NULL> + class SortedLinkedList : public LinkedListImpl { public: SortedLinkedList() { } - SortedLinkedList(Arena* a) : LinkedListImpl(a) { } + SortedLinkedList(Arena* a) : LinkedListImpl(a) { } virtual LinkedListNode* add(const E& e) { - return LinkedListImpl::add(e); + return LinkedListImpl::add(e); } virtual void move(LinkedList* list) { @@ -409,7 +409,7 @@ template * list) { - return LinkedListImpl::add(list); + return LinkedListImpl::add(list); } virtual LinkedListNode* find_node(const E& e) { diff --git a/src/hotspot/share/utilities/objectBitSet.hpp b/src/hotspot/share/utilities/objectBitSet.hpp index 002e107972c89..124188cd32150 100644 --- a/src/hotspot/share/utilities/objectBitSet.hpp +++ b/src/hotspot/share/utilities/objectBitSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -39,8 +39,8 @@ class MemRegion; * allocated on-demand only, in fragments covering 64M heap ranges. Fragments are never deleted * during the lifetime of the ObjectBitSet. The underlying memory is allocated from C-Heap. */ -template -class ObjectBitSet : public CHeapObj { +template +class ObjectBitSet : public CHeapObj { const static size_t _bitmap_granularity_shift = 26; // 64M const static size_t _bitmap_granularity_size = (size_t)1 << _bitmap_granularity_shift; const static size_t _bitmap_granularity_mask = _bitmap_granularity_size - 1; @@ -52,7 +52,7 @@ class ObjectBitSet : public CHeapObj { return hash ^ (hash >> 3); } - typedef ResizeableResourceHashtable BitMapFragmentTable; CHeapBitMap* get_fragment_bits(uintptr_t addr); @@ -81,8 +81,8 @@ class ObjectBitSet : public CHeapObj { } }; -template -class ObjectBitSet::BitMapFragment : public CHeapObj { +template +class ObjectBitSet::BitMapFragment : public CHeapObj { CHeapBitMap _bits; BitMapFragment* _next; diff --git a/src/hotspot/share/utilities/objectBitSet.inline.hpp b/src/hotspot/share/utilities/objectBitSet.inline.hpp index 144f886cbd9b2..482a97bc2d137 100644 --- a/src/hotspot/share/utilities/objectBitSet.inline.hpp +++ b/src/hotspot/share/utilities/objectBitSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -30,22 +30,22 @@ #include "memory/memRegion.hpp" #include "utilities/bitMap.inline.hpp" -template -ObjectBitSet::BitMapFragment::BitMapFragment(uintptr_t granule, BitMapFragment* next) : - _bits(_bitmap_granularity_size >> LogMinObjAlignmentInBytes, F, true /* clear */), +template +ObjectBitSet::BitMapFragment::BitMapFragment(uintptr_t granule, BitMapFragment* next) : + _bits(_bitmap_granularity_size >> LogMinObjAlignmentInBytes, MT, true /* clear */), _next(next) { } -template -ObjectBitSet::ObjectBitSet() : +template +ObjectBitSet::ObjectBitSet() : _bitmap_fragments(32, 8*K), _fragment_list(nullptr), _last_fragment_bits(nullptr), _last_fragment_granule(UINTPTR_MAX) { } -template -ObjectBitSet::~ObjectBitSet() { +template +ObjectBitSet::~ObjectBitSet() { BitMapFragment* current = _fragment_list; while (current != nullptr) { BitMapFragment* next = current->next(); @@ -56,13 +56,13 @@ ObjectBitSet::~ObjectBitSet() { // ResizeableResourceHashtableStorage deletes the table. } -template -inline BitMap::idx_t ObjectBitSet::addr_to_bit(uintptr_t addr) const { +template +inline BitMap::idx_t ObjectBitSet::addr_to_bit(uintptr_t addr) const { return (addr & _bitmap_granularity_mask) >> LogMinObjAlignmentInBytes; } -template -inline CHeapBitMap* ObjectBitSet::get_fragment_bits(uintptr_t addr) { +template +inline CHeapBitMap* ObjectBitSet::get_fragment_bits(uintptr_t addr) { uintptr_t granule = addr >> _bitmap_granularity_shift; if (granule == _last_fragment_granule) { return _last_fragment_bits; @@ -86,15 +86,15 @@ inline CHeapBitMap* ObjectBitSet::get_fragment_bits(uintptr_t addr) { return bits; } -template -inline void ObjectBitSet::mark_obj(uintptr_t addr) { +template +inline void ObjectBitSet::mark_obj(uintptr_t addr) { CHeapBitMap* bits = get_fragment_bits(addr); const BitMap::idx_t bit = addr_to_bit(addr); bits->set_bit(bit); } -template -inline bool ObjectBitSet::is_marked(uintptr_t addr) { +template +inline bool ObjectBitSet::is_marked(uintptr_t addr) { CHeapBitMap* bits = get_fragment_bits(addr); const BitMap::idx_t bit = addr_to_bit(addr); return bits->at(bit); diff --git a/src/hotspot/share/utilities/resizeableResourceHash.hpp b/src/hotspot/share/utilities/resizeableResourceHash.hpp index 03ae8cec4c168..b0c992bf1ef2b 100644 --- a/src/hotspot/share/utilities/resizeableResourceHash.hpp +++ b/src/hotspot/share/utilities/resizeableResourceHash.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -30,7 +30,7 @@ template< typename K, typename V, AnyObj::allocation_type ALLOC_TYPE, - MEMFLAGS MEM_TYPE> + MemTag MEM_TAG> class ResizeableResourceHashtableStorage : public AnyObj { using Node = ResourceHashtableNode; @@ -52,7 +52,7 @@ class ResizeableResourceHashtableStorage : public AnyObj { Node** alloc_table(unsigned table_size) { Node** table; if (ALLOC_TYPE == C_HEAP) { - table = NEW_C_HEAP_ARRAY(Node*, table_size, MEM_TYPE); + table = NEW_C_HEAP_ARRAY(Node*, table_size, MEM_TAG); } else { table = NEW_RESOURCE_ARRAY(Node*, table_size); } @@ -72,17 +72,17 @@ class ResizeableResourceHashtableStorage : public AnyObj { template< typename K, typename V, AnyObj::allocation_type ALLOC_TYPE = AnyObj::RESOURCE_AREA, - MEMFLAGS MEM_TYPE = mtInternal, + MemTag MEM_TAG = mtInternal, unsigned (*HASH) (K const&) = primitive_hash, bool (*EQUALS)(K const&, K const&) = primitive_equals > class ResizeableResourceHashtable : public ResourceHashtableBase< - ResizeableResourceHashtableStorage, - K, V, ALLOC_TYPE, MEM_TYPE, HASH, EQUALS> { + ResizeableResourceHashtableStorage, + K, V, ALLOC_TYPE, MEM_TAG, HASH, EQUALS> { unsigned _max_size; - using BASE = ResourceHashtableBase, - K, V, ALLOC_TYPE, MEM_TYPE, HASH, EQUALS>; + using BASE = ResourceHashtableBase, + K, V, ALLOC_TYPE, MEM_TAG, HASH, EQUALS>; using Node = ResourceHashtableNode; NONCOPYABLE(ResizeableResourceHashtable); diff --git a/src/hotspot/share/utilities/resourceHash.hpp b/src/hotspot/share/utilities/resourceHash.hpp index b449dc6ea6c10..a99239b21a038 100644 --- a/src/hotspot/share/utilities/resourceHash.hpp +++ b/src/hotspot/share/utilities/resourceHash.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -54,7 +54,7 @@ template< class STORAGE, typename K, typename V, AnyObj::allocation_type ALLOC_TYPE, - MEMFLAGS MEM_TYPE, + MemTag MEM_TAG, unsigned (*HASH) (K const&), bool (*EQUALS)(K const&, K const&) > @@ -153,7 +153,7 @@ class ResourceHashtableBase : public STORAGE { assert(*lookup_node(hv, key) == nullptr, "use put_if_absent"); Node** ptr = bucket_at(index); if (ALLOC_TYPE == AnyObj::C_HEAP) { - *ptr = new (MEM_TYPE) Node(hv, key, value, *ptr); + *ptr = new (MEM_TAG) Node(hv, key, value, *ptr); } else { *ptr = new Node(hv, key, value, *ptr); } @@ -174,7 +174,7 @@ class ResourceHashtableBase : public STORAGE { return false; } else { if (ALLOC_TYPE == AnyObj::C_HEAP) { - *ptr = new (MEM_TYPE) Node(hv, key, value); + *ptr = new (MEM_TAG) Node(hv, key, value); } else { *ptr = new Node(hv, key, value); } @@ -193,7 +193,7 @@ class ResourceHashtableBase : public STORAGE { Node** ptr = lookup_node(hv, key); if (*ptr == nullptr) { if (ALLOC_TYPE == AnyObj::C_HEAP) { - *ptr = new (MEM_TYPE) Node(hv, key); + *ptr = new (MEM_TAG) Node(hv, key); } else { *ptr = new Node(hv, key); } @@ -215,7 +215,7 @@ class ResourceHashtableBase : public STORAGE { Node** ptr = lookup_node(hv, key); if (*ptr == nullptr) { if (ALLOC_TYPE == AnyObj::C_HEAP) { - *ptr = new (MEM_TYPE) Node(hv, key, value); + *ptr = new (MEM_TAG) Node(hv, key, value); } else { *ptr = new Node(hv, key, value); } @@ -364,17 +364,17 @@ template< typename K, typename V, unsigned SIZE = 256, AnyObj::allocation_type ALLOC_TYPE = AnyObj::RESOURCE_AREA, - MEMFLAGS MEM_TYPE = mtInternal, + MemTag MEM_TAG = mtInternal, unsigned (*HASH) (K const&) = primitive_hash, bool (*EQUALS)(K const&, K const&) = primitive_equals > class ResourceHashtable : public ResourceHashtableBase< FixedResourceHashtableStorage, - K, V, ALLOC_TYPE, MEM_TYPE, HASH, EQUALS> { + K, V, ALLOC_TYPE, MEM_TAG, HASH, EQUALS> { NONCOPYABLE(ResourceHashtable); public: ResourceHashtable() : ResourceHashtableBase, - K, V, ALLOC_TYPE, MEM_TYPE, HASH, EQUALS>() {} + K, V, ALLOC_TYPE, MEM_TAG, HASH, EQUALS>() {} }; #endif // SHARE_UTILITIES_RESOURCEHASH_HPP diff --git a/src/hotspot/share/utilities/stack.hpp b/src/hotspot/share/utilities/stack.hpp index 8b2ce3802e02d..1a9df130dff0c 100644 --- a/src/hotspot/share/utilities/stack.hpp +++ b/src/hotspot/share/utilities/stack.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, 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 @@ -51,11 +51,11 @@ // implementation in class Stack assumes that alloc() will terminate the process // if the allocation fails. -template class StackIterator; +template class StackIterator; // StackBase holds common data/methods that don't depend on the element type, // factored out to reduce template code duplication. -template class StackBase +template class StackBase { public: size_t segment_size() const { return _seg_size; } // Elements per segment. @@ -85,11 +85,11 @@ template class StackBase size_t _cache_size; // Number of segments in the cache. }; -template -class Stack: public StackBase +template +class Stack: public StackBase { public: - friend class StackIterator; + friend class StackIterator; // Number of elements that fit in 4K bytes minus the size of two pointers // (link field and malloc header). @@ -160,13 +160,13 @@ class Stack: public StackBase E* _cache; // Segment cache to avoid ping-ponging. }; -template +template class StackIterator: public StackObj { public: - StackIterator(Stack& stack): _stack(stack) { sync(); } + StackIterator(Stack& stack): _stack(stack) { sync(); } - Stack& stack() const { return _stack; } + Stack& stack() const { return _stack; } bool is_empty() const { return _cur_seg == nullptr; } @@ -176,7 +176,7 @@ class StackIterator: public StackObj void sync(); // Sync the iterator's state to the stack's current state. private: - Stack& _stack; + Stack& _stack; size_t _cur_seg_size; E* _cur_seg; size_t _full_seg_size; diff --git a/src/hotspot/share/utilities/stack.inline.hpp b/src/hotspot/share/utilities/stack.inline.hpp index bed33bd6652ca..49ccf4166290c 100644 --- a/src/hotspot/share/utilities/stack.inline.hpp +++ b/src/hotspot/share/utilities/stack.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, 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 @@ -31,7 +31,7 @@ #include "utilities/align.hpp" #include "utilities/copy.hpp" -template StackBase::StackBase(size_t segment_size, size_t max_cache_size, +template StackBase::StackBase(size_t segment_size, size_t max_cache_size, size_t max_size): _seg_size(segment_size), _max_size(adjust_max_size(max_size, segment_size)), @@ -40,7 +40,7 @@ template StackBase::StackBase(size_t segment_size, size_t max_ca assert(_max_size % _seg_size == 0, "not a multiple"); } -template size_t StackBase::adjust_max_size(size_t max_size, size_t seg_size) +template size_t StackBase::adjust_max_size(size_t max_size, size_t seg_size) { assert(seg_size > 0, "cannot be 0"); assert(max_size >= seg_size || max_size == 0, "max_size too small"); @@ -51,15 +51,15 @@ template size_t StackBase::adjust_max_size(size_t max_size, size return (max_size + seg_size - 1) / seg_size * seg_size; } -template -Stack::Stack(size_t segment_size, size_t max_cache_size, size_t max_size): - StackBase(adjust_segment_size(segment_size), max_cache_size, max_size) +template +Stack::Stack(size_t segment_size, size_t max_cache_size, size_t max_size): + StackBase(adjust_segment_size(segment_size), max_cache_size, max_size) { reset(true); } -template -void Stack::push(E item) +template +void Stack::push(E item) { assert(!is_full(), "pushing onto a full stack"); size_t index = this->_cur_seg_size; @@ -71,8 +71,8 @@ void Stack::push(E item) this->_cur_seg_size = index + 1; } -template -E Stack::pop() +template +E Stack::pop() { assert(!is_empty(), "popping from an empty stack"); // _cur_seg_size is never 0 if not empty. pop that empties a @@ -85,16 +85,16 @@ E Stack::pop() return result; } -template -void Stack::clear(bool clear_cache) +template +void Stack::clear(bool clear_cache) { free_segments(_cur_seg); if (clear_cache) free_segments(_cache); reset(clear_cache); } -template -size_t Stack::adjust_segment_size(size_t seg_size) +template +size_t Stack::adjust_segment_size(size_t seg_size) { const size_t elem_sz = sizeof(E); const size_t ptr_sz = sizeof(E*); @@ -105,45 +105,45 @@ size_t Stack::adjust_segment_size(size_t seg_size) return seg_size; } -template -size_t Stack::link_offset() const +template +size_t Stack::link_offset() const { return align_up(this->_seg_size * sizeof(E), sizeof(E*)); } -template -size_t Stack::segment_bytes() const +template +size_t Stack::segment_bytes() const { return link_offset() + sizeof(E*); } -template -E** Stack::link_addr(E* seg) const +template +E** Stack::link_addr(E* seg) const { return (E**) ((char*)seg + link_offset()); } -template -E* Stack::get_link(E* seg) const +template +E* Stack::get_link(E* seg) const { return *link_addr(seg); } -template -E* Stack::set_link(E* new_seg, E* old_seg) +template +E* Stack::set_link(E* new_seg, E* old_seg) { *link_addr(new_seg) = old_seg; return new_seg; } -template -E* Stack::alloc(size_t bytes) +template +E* Stack::alloc(size_t bytes) { - return (E*) NEW_C_HEAP_ARRAY(char, bytes, F); + return (E*) NEW_C_HEAP_ARRAY(char, bytes, MT); } -template -void Stack::free(E* addr, size_t bytes) +template +void Stack::free(E* addr, size_t bytes) { FREE_C_HEAP_ARRAY(char, (char*) addr); } @@ -152,8 +152,8 @@ void Stack::free(E* addr, size_t bytes) // code gets inlined. This is generally good, but when too much code has // been inlined, further inlining in the caller might be inhibited. So // prevent infrequent slow path segment manipulation from being inlined. -template -NOINLINE void Stack::push_segment() +template +NOINLINE void Stack::push_segment() { assert(this->_cur_seg_size == this->_seg_size, "current segment is not full"); E* next; @@ -173,8 +173,8 @@ NOINLINE void Stack::push_segment() DEBUG_ONLY(verify(at_empty_transition);) } -template -NOINLINE void Stack::pop_segment() +template +NOINLINE void Stack::pop_segment() { assert(this->_cur_seg_size == 0, "current segment is not empty"); E* const prev = get_link(_cur_seg); @@ -194,8 +194,8 @@ NOINLINE void Stack::pop_segment() DEBUG_ONLY(verify(at_empty_transition);) } -template -void Stack::free_segments(E* seg) +template +void Stack::free_segments(E* seg) { const size_t bytes = segment_bytes(); while (seg != nullptr) { @@ -205,8 +205,8 @@ void Stack::free_segments(E* seg) } } -template -void Stack::reset(bool reset_cache) +template +void Stack::reset(bool reset_cache) { this->_cur_seg_size = this->_seg_size; // So push() will alloc a new segment. this->_full_seg_size = 0; @@ -218,8 +218,8 @@ void Stack::reset(bool reset_cache) } #ifdef ASSERT -template -void Stack::verify(bool at_empty_transition) const +template +void Stack::verify(bool at_empty_transition) const { assert(size() <= this->max_size(), "stack exceeded bounds"); assert(this->cache_size() <= this->max_cache_size(), "cache exceeded bounds"); @@ -234,8 +234,8 @@ void Stack::verify(bool at_empty_transition) const } } -template -void Stack::zap_segment(E* seg, bool zap_link_field) const +template +void Stack::zap_segment(E* seg, bool zap_link_field) const { if (!ZapStackSegments) return; const size_t zap_bytes = segment_bytes() - (zap_link_field ? 0 : sizeof(E*)); @@ -243,16 +243,16 @@ void Stack::zap_segment(E* seg, bool zap_link_field) const } #endif -template -void StackIterator::sync() +template +void StackIterator::sync() { _full_seg_size = _stack._full_seg_size; _cur_seg_size = _stack._cur_seg_size; _cur_seg = _stack._cur_seg; } -template -E* StackIterator::next_addr() +template +E* StackIterator::next_addr() { assert(!is_empty(), "no items left"); if (_cur_seg_size == 1) { diff --git a/src/java.base/macosx/native/libjli/java_md_macosx.m b/src/java.base/macosx/native/libjli/java_md_macosx.m index 4ac2f2c10a215..c5e7ba580a503 100644 --- a/src/java.base/macosx/native/libjli/java_md_macosx.m +++ b/src/java.base/macosx/native/libjli/java_md_macosx.m @@ -60,115 +60,79 @@ #define LD_LIBRARY_PATH "DYLD_FALLBACK_LIBRARY_PATH" /* - * If a processor / os combination has the ability to run binaries of - * two data models and cohabitation of jre/jdk bits with both data - * models is supported, then DUAL_MODE is defined. MacOSX is a hybrid - * system in that, the universal library can contain all types of libraries - * 32/64 and client/server, thus the spawn is capable of linking with the - * appropriate library as requested. + * Following is the high level flow of the launcher + * code residing in the common java.c and this + * macosx specific java_md_macosx file: * - * Notes: - * 1. VM. DUAL_MODE is disabled, and not supported, however, it is left here in - * for experimentation and perhaps enable it in the future. - * 2. At the time of this writing, the universal library contains only - * a server 64-bit server JVM. - * 3. "-client" command line option is supported merely as a command line flag, - * for, compatibility reasons, however, a server VM will be launched. - */ - -/* - * Flowchart of launcher execs and options processing on unix + * - JLI_Launch function, which is the entry point + * to the launcher, calls CreateExecutionEnvironment. + * + * - CreateExecutionEnvironment does the following + * (not necessarily in this order): + * - determines the relevant JVM type that needs + * to be ultimately created + * - determines the path and asserts the presence + * of libjava and relevant libjvm library + * - removes any JVM selection options from the + * arguments that were passed to the launcher + * + * - CreateExecutionEnvironment then creates a new + * thread, within the same process, to launch the + * application's main() Java method and parks the + * current thread, on which CreateExecutionEnvironment + * was invoked, in Apple's Cocoa event loop. Before + * doing so, CreateExecutionEnvironment maintains a + * state flag to keep note that a new thread has + * been spawned. + * + * - The newly created thread (in which the application's + * main() method will ultimately run) starts right from + * the beginning of the current process' main function, + * which effectively means that JLI_Launch is re-invoked + * on this new thread and the same above sequence of code + * flow repeats again. During this "recursive" call, when + * at the point of creating a new thread in + * CreateExecutionEnvironment, the CreateExecutionEnvironment + * will check for the state flag to see if a new thread + * has already been spawned and upon noticing that it + * has, it will skip spawning any more threads and will + * return back from CreateExecutionEnvironment. + * + * - The control returns back from CreateExecutionEnvironment + * to JLI_Launch, and the thread on which the control + * returns is the thread on which the application's main() + * Java method will be invoked. + * + * - JLI_Launch then invokes LoadJavaVM which dlopen()s the + * JVM library and asserts the presence of JNI Invocation + * Functions "JNI_CreateJavaVM", "JNI_GetDefaultJavaVMInitArgs" + * and "JNI_GetCreatedJavaVMs" in that library. It then sets + * internal function pointers in the launcher to point to + * those functions. + * + * - JLI_Launch then translates any -J options by invoking + * TranslateApplicationArgs. + * + * - JLI_Launch then invokes ParseArguments to parse/process + * the launcher arguments. * - * The selection of the proper vm shared library to open depends on - * several classes of command line options, including vm "flavor" - * options (-client, -server) and the data model options, -d32 and - * -d64, as well as a version specification which may have come from - * the command line or from the manifest of an executable jar file. - * The vm selection options are not passed to the running - * virtual machine; they must be screened out by the launcher. + * - JLI_Launch then ultimately calls JVMInit. * - * The version specification (if any) is processed first by the - * platform independent routine SelectVersion. This may result in - * the exec of the specified launcher version. + * - JVMInit then invokes JavaMain. * - * Now, in most cases,the launcher will dlopen the target libjvm.so. All - * required libraries are loaded by the runtime linker, using the known paths - * baked into the shared libraries at compile time. Therefore, - * in most cases, the launcher will only exec, if the data models are - * mismatched, and will not set any environment variables, regardless of the - * data models. + * - JavaMain, before launching the application, invokes + * PostJVMInit. * + * - PostJVMInit invokes ShowSplashScreen which displays + * a splash screen for the application, if applicable. * + * - Control then returns back from PostJVMInit into + * JavaMain, which then loads the application's main + * class and invokes the relevant main() Java method. * - * Main - * (incoming argv) - * | - * \|/ - * CreateExecutionEnvironment - * (determines desired data model) - * | - * | - * \|/ - * Have Desired Model ? --> NO --> Is Dual-Mode ? --> NO --> Exit(with error) - * | | - * | | - * | \|/ - * | YES - * | | - * | | - * | \|/ - * | CheckJvmType - * | (removes -client, -server etc.) - * | | - * | | - * \|/ \|/ - * YES Find the desired executable/library - * | | - * | | - * \|/ \|/ - * CheckJvmType POINT A - * (removes -client, -server, etc.) - * | - * | - * \|/ - * TranslateDashJArgs... - * (Prepare to pass args to vm) - * | - * | - * \|/ - * ParseArguments - * (processes version options, - * creates argument list for vm, - * etc.) - * | - * | - * \|/ - * POINT A - * | - * | - * \|/ - * Path is desired JRE ? YES --> Continue - * NO - * | - * | - * \|/ - * Paths have well known - * jvm paths ? --> NO --> Continue - * YES - * | - * | - * \|/ - * Does libjvm.so exist - * in any of them ? --> NO --> Continue - * YES - * | - * | - * \|/ - * Re-exec / Spawn - * | - * | - * \|/ - * Main + * - JavaMain then returns back an integer result which + * then gets propagated as a return value all the way + * out of the JLI_Launch function. */ /* Store the name of the executable once computed */ diff --git a/src/java.base/share/classes/java/io/DataInputStream.java b/src/java.base/share/classes/java/io/DataInputStream.java index eab7a6e2f189a..59377aca429ca 100644 --- a/src/java.base/share/classes/java/io/DataInputStream.java +++ b/src/java.base/share/classes/java/io/DataInputStream.java @@ -1,5 +1,6 @@ /* * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Alibaba Group Holding Limited. 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 @@ -25,8 +26,11 @@ package java.io; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.ByteArray; +import java.nio.charset.StandardCharsets; import java.util.Objects; /** @@ -45,6 +49,7 @@ * @since 1.0 */ public class DataInputStream extends FilterInputStream implements DataInput { + private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; private static final char[] EMPTY_CHAR_ARRAY = new char[0]; @@ -573,18 +578,16 @@ public final String readUTF() throws IOException { */ public static final String readUTF(DataInput in) throws IOException { int utflen = in.readUnsignedShort(); - byte[] bytearr; - char[] chararr; + byte[] bytearr = null; if (in instanceof DataInputStream dis) { - if (dis.bytearr.length < utflen) { - dis.bytearr = new byte[utflen*2]; - dis.chararr = new char[utflen*2]; + if (dis.bytearr.length >= utflen) { + bytearr = dis.bytearr; } - chararr = dis.chararr; - bytearr = dis.bytearr; - } else { + } + boolean trusted = false; + if (bytearr == null) { bytearr = new byte[utflen]; - chararr = new char[utflen]; + trusted = true; } int c, char2, char3; @@ -592,12 +595,35 @@ public static final String readUTF(DataInput in) throws IOException { int chararr_count=0; in.readFully(bytearr, 0, utflen); + int ascii = JLA.countPositives(bytearr, 0, utflen); + if (ascii == utflen) { + String str; + if (trusted) { + str = JLA.newStringNoRepl(bytearr, StandardCharsets.ISO_8859_1); + } else { + str = new String(bytearr, 0, utflen, StandardCharsets.ISO_8859_1); + } + return str; + } + if (trusted && in instanceof DataInputStream dis) { + dis.bytearr = bytearr; + trusted = false; + } - while (count < utflen) { - c = (int) bytearr[count] & 0xff; - if (c > 127) break; - count++; - chararr[chararr_count++]=(char)c; + char[] chararr; + if (in instanceof DataInputStream dis) { + if (dis.chararr.length < (utflen << 1)) { + dis.chararr = new char[utflen << 1]; + } + chararr = dis.chararr; + } else { + chararr = new char[utflen]; + } + + if (ascii != 0) { + JLA.inflateBytesToChars(bytearr, 0, chararr, 0, ascii); + count += ascii; + chararr_count += ascii; } while (count < utflen) { diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index b603e15551353..61c15bdd15c0b 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -79,6 +79,10 @@ * {@code user.dir}, and is typically the directory in which the Java * virtual machine was invoked. * + *

Unless otherwise noted, {@linkplain java.nio.file##links symbolic links} + * are automatically redirected to the target of the link, whether they + * are provided by a pathname string or via a {@code File} object. + * *

The parent of an abstract pathname may be obtained by invoking * the {@link #getParent} method of this class and consists of the pathname's * prefix and each name in the pathname's name sequence except for the last. @@ -904,8 +908,16 @@ public boolean isFile() { * Tests whether the file named by this abstract pathname is a hidden * file. The exact definition of hidden is system-dependent. On * UNIX systems, a file is considered to be hidden if its name begins with - * a period character ({@code '.'}). On Microsoft Windows systems, a file is - * considered to be hidden if it has been marked as such in the filesystem. + * a period character ({@code '.'}). On Microsoft Windows systems, a file + * is considered to be hidden if it has been marked as such in the + * filesystem. + * + * + * @implNote + * If the file is a symbolic link, then on UNIX system it is considered to + * be hidden if the name of the link itself, not that of its target, begins + * with a period character. On Windows systems, a symbolic link is + * considered hidden if its target is so marked in the filesystem. * * @return {@code true} if and only if the file denoted by this * abstract pathname is hidden according to the conventions of the @@ -1048,7 +1060,8 @@ public boolean createNewFile() throws IOException { /** * Deletes the file or directory denoted by this abstract pathname. If * this pathname denotes a directory, then the directory must be empty in - * order to be deleted. + * order to be deleted. If this pathname denotes a symbolic link, then the + * link itself, not its target, will be deleted. * *

Note that the {@link java.nio.file.Files} class defines the {@link * java.nio.file.Files#delete(Path) delete} method to throw an {@link IOException} @@ -1078,6 +1091,8 @@ public boolean delete() { /** * Requests that the file or directory denoted by this abstract * pathname be deleted when the virtual machine terminates. + * If this pathname denotes a symbolic link, then the + * link itself, not its target, will be deleted. * Files (or directories) are deleted in the reverse order that * they are registered. Invoking this method to delete a file or * directory that is already registered for deletion has no effect. @@ -1421,7 +1436,9 @@ public boolean mkdirs() { } /** - * Renames the file denoted by this abstract pathname. + * Renames the file denoted by this abstract pathname. If this pathname + * denotes a symbolic link, then the link itself, not its target, will be + * renamed. * *

Many aspects of the behavior of this method are inherently * platform-dependent: The rename operation might not be able to move a diff --git a/src/java.base/share/classes/java/io/FileInputStream.java b/src/java.base/share/classes/java/io/FileInputStream.java index 2750710823771..60b289637fdfc 100644 --- a/src/java.base/share/classes/java/io/FileInputStream.java +++ b/src/java.base/share/classes/java/io/FileInputStream.java @@ -85,7 +85,9 @@ public class FileInputStream extends InputStream * Creates a {@code FileInputStream} by * opening a connection to an actual file, * the file named by the path name {@code name} - * in the file system. A new {@code FileDescriptor} + * in the file system. {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@code FileDescriptor} * object is created to represent this file * connection. *

@@ -117,6 +119,8 @@ public FileInputStream(String name) throws FileNotFoundException { * opening a connection to an actual file, * the file named by the {@code File} * object {@code file} in the file system. + * {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. * A new {@code FileDescriptor} object * is created to represent this file connection. *

diff --git a/src/java.base/share/classes/java/io/FileOutputStream.java b/src/java.base/share/classes/java/io/FileOutputStream.java index b8c26f38143fb..ff15e831b9530 100644 --- a/src/java.base/share/classes/java/io/FileOutputStream.java +++ b/src/java.base/share/classes/java/io/FileOutputStream.java @@ -97,7 +97,10 @@ public class FileOutputStream extends OutputStream /** * Creates a file output stream to write to the file with the - * specified name. A new {@code FileDescriptor} object is + * specified name. If the file exists, it is truncated, otherwise a + * new file is created. {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@code FileDescriptor} object is * created to represent this file connection. *

* First, if there is a security manager, its {@code checkWrite} @@ -126,8 +129,11 @@ public FileOutputStream(String name) throws FileNotFoundException { /** * Creates a file output stream to write to the file with the specified - * name. If the second argument is {@code true}, then - * bytes will be written to the end of the file rather than the beginning. + * name. If the file exists, it is truncated unless the second + * argument is {@code true}, in which case bytes will be written to the + * end of the file rather than the beginning. If the file does not exist, + * it is created. {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. * A new {@code FileDescriptor} object is created to represent this * file connection. *

@@ -158,9 +164,12 @@ public FileOutputStream(String name, boolean append) /** * Creates a file output stream to write to the file represented by - * the specified {@code File} object. A new - * {@code FileDescriptor} object is created to represent this - * file connection. + * the specified {@code File} object. + * If the file exists, it is truncated, otherwise a + * new file is created. {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@code FileDescriptor} object is + * created to represent this file connection. *

* First, if there is a security manager, its {@code checkWrite} * method is called with the path represented by the {@code file} @@ -187,10 +196,14 @@ public FileOutputStream(File file) throws FileNotFoundException { /** * Creates a file output stream to write to the file represented by - * the specified {@code File} object. If the second argument is - * {@code true}, then bytes will be written to the end of the file - * rather than the beginning. A new {@code FileDescriptor} object is - * created to represent this file connection. + * the specified {@code File} object. + * If the file exists, it is truncated unless the second + * argument is {@code true}, in which case bytes will be written to the + * end of the file rather than the beginning. If the file does not exist, + * it is created. {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@code FileDescriptor} object is created to represent this + * file connection. *

* First, if there is a security manager, its {@code checkWrite} * method is called with the path represented by the {@code file} diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index e40a24072060d..879820761c129 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -1218,8 +1218,7 @@ private static boolean matchesPackage(Class c, String pkg) { } /** - * Returns the pattern used to create this filter. - * @return the pattern used to create this filter + * {@return the pattern used to create this filter} */ @Override public String toString() { diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index 74c34d80a7beb..983b80d2bc673 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -3859,8 +3859,7 @@ private int readUTFChar(StringBuilder sbuf, long utflen) } /** - * Returns the number of bytes read from the input stream. - * @return the number of bytes read from the input stream + * {@return the number of bytes read from the input stream} */ long getBytesRead() { return in.getBytesRead(); diff --git a/src/java.base/share/classes/java/io/RandomAccessFile.java b/src/java.base/share/classes/java/io/RandomAccessFile.java index d0dde87bdca69..cf8ae43dc2147 100644 --- a/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -101,8 +101,12 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { /** * Creates a random access file stream to read from, and optionally - * to write to, a file with the specified pathname. A new - * {@link FileDescriptor} object is created to represent the + * to write to, a file with the specified pathname. If the file exists + * it is opened; if it does not exist and write mode is specified, a + * new file is created. + * {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@link FileDescriptor} object is created to represent the * connection to the file. * *

The {@code mode} argument specifies the access mode with which the @@ -146,9 +150,14 @@ public RandomAccessFile(String pathname, String mode) } /** - * Creates a random access file stream to read from, and optionally to - * write to, the file specified by the {@link File} argument. A new {@link - * FileDescriptor} object is created to represent this file connection. + * Creates a random access file stream to read from, and optionally + * to write to, the file specified by the {@link File} argument. If + * the file exists it is opened; if it does not exist and write mode + * is specified, a new file is created. + * {@linkplain java.nio.file##links Symbolic links} + * are automatically redirected to the target of the link. + * A new {@link FileDescriptor} object is created to represent the + * connection to the file. * *

The {@code mode} argument specifies the access mode * in which the file is to be opened. The permitted values and their diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 61b59784e0e63..6b576c88b4710 100644 --- a/src/java.base/share/classes/java/lang/Math.java +++ b/src/java.base/share/classes/java/lang/Math.java @@ -31,6 +31,8 @@ import jdk.internal.math.DoubleConsts; import jdk.internal.vm.annotation.IntrinsicCandidate; +import static java.lang.Double.*; + /** * The class {@code Math} contains methods for performing basic * numeric operations such as the elementary exponential, logarithm, @@ -2735,6 +2737,7 @@ public static double cosh(double x) { * @return The hyperbolic tangent of {@code x}. * @since 1.5 */ + @IntrinsicCandidate public static double tanh(double x) { return StrictMath.tanh(x); } @@ -3283,6 +3286,9 @@ public static float nextDown(float f) { } } + private static final double F_UP = 0x1p1023; // normal, exact, 2^DoubleConsts.EXP_BIAS + private static final double F_DOWN = 0x1p-1023; // subnormal, exact, 2^-DoubleConsts.EXP_BIAS + /** * Returns {@code d} × 2{@code scaleFactor} * rounded as if performed by a single correctly rounded @@ -3314,60 +3320,25 @@ public static float nextDown(float f) { * @since 1.6 */ public static double scalb(double d, int scaleFactor) { - /* - * When scaling up, it does not matter what order the - * multiply-store operations are done; the result will be - * finite or overflow regardless of the operation ordering. - * However, to get the correct result when scaling down, a - * particular ordering must be used. - * - * When scaling down, the multiply-store operations are - * sequenced so that it is not possible for two consecutive - * multiply-stores to return subnormal results. If one - * multiply-store result is subnormal, the next multiply will - * round it away to zero. This is done by first multiplying - * by 2 ^ (scaleFactor % n) and then multiplying several - * times by 2^n as needed where n is the exponent of number - * that is a convenient power of two. In this way, at most one - * real rounding error occurs. - */ - - // magnitude of a power of two so large that scaling a finite - // nonzero value by it would be guaranteed to over or - // underflow; due to rounding, scaling down takes an - // additional power of two which is reflected here - final int MAX_SCALE = Double.MAX_EXPONENT + -Double.MIN_EXPONENT + - DoubleConsts.SIGNIFICAND_WIDTH + 1; - int exp_adjust = 0; - int scale_increment = 0; - double exp_delta = Double.NaN; - - // Make sure scaling factor is in a reasonable range - - if(scaleFactor < 0) { - scaleFactor = Math.max(scaleFactor, -MAX_SCALE); - scale_increment = -512; - exp_delta = 0x1p-512; + if (scaleFactor > -DoubleConsts.EXP_BIAS) { + if (scaleFactor <= DoubleConsts.EXP_BIAS) { + return d * primPowerOfTwoD(scaleFactor); + } + if (scaleFactor <= 2 * DoubleConsts.EXP_BIAS) { + return d * primPowerOfTwoD(scaleFactor - DoubleConsts.EXP_BIAS) * F_UP; + } + if (scaleFactor < 2 * DoubleConsts.EXP_BIAS + PRECISION - 1) { + return d * primPowerOfTwoD(scaleFactor - 2 * DoubleConsts.EXP_BIAS) * F_UP * F_UP; + } + return d * F_UP * F_UP * F_UP; } - else { - scaleFactor = Math.min(scaleFactor, MAX_SCALE); - scale_increment = 512; - exp_delta = 0x1p512; + if (scaleFactor > -2 * DoubleConsts.EXP_BIAS) { + return d * primPowerOfTwoD(scaleFactor + DoubleConsts.EXP_BIAS) * F_DOWN; } - - // Calculate (scaleFactor % +/-512), 512 = 2^9, using - // technique from "Hacker's Delight" section 10-2. - int t = (scaleFactor >> 9-1) >>> 32 - 9; - exp_adjust = ((scaleFactor + t) & (512 -1)) - t; - - d *= powerOfTwoD(exp_adjust); - scaleFactor -= exp_adjust; - - while(scaleFactor != 0) { - d *= exp_delta; - scaleFactor -= scale_increment; + if (scaleFactor > -2 * DoubleConsts.EXP_BIAS - PRECISION) { + return d * primPowerOfTwoD(scaleFactor + 2 * DoubleConsts.EXP_BIAS) * F_DOWN * F_DOWN; } - return d; + return d * MIN_VALUE * MIN_VALUE; } /** @@ -3426,9 +3397,15 @@ public static float scalb(float f, int scaleFactor) { */ static double powerOfTwoD(int n) { assert(n >= Double.MIN_EXPONENT && n <= Double.MAX_EXPONENT); - return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) << - (DoubleConsts.SIGNIFICAND_WIDTH-1)) - & DoubleConsts.EXP_BIT_MASK); + return primPowerOfTwoD(n); + } + + /** + * Returns a floating-point power of two in the normal range. + * No checks are performed on the argument. + */ + private static double primPowerOfTwoD(int n) { + return longBitsToDouble((long) (n + DoubleConsts.EXP_BIAS) << PRECISION - 1); } /** diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 4dac486bee4b1..07b3c7c9bd2d1 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -457,19 +457,20 @@ public static void yield() { * Called before sleeping to create a jdk.ThreadSleep event. */ private static ThreadSleepEvent beforeSleep(long nanos) { - ThreadSleepEvent event = null; - if (ThreadSleepEvent.isTurnedOn()) { - try { - event = new ThreadSleepEvent(); + try { + ThreadSleepEvent event = new ThreadSleepEvent(); + if (event.isEnabled()) { event.time = nanos; event.begin(); - } catch (OutOfMemoryError e) { - event = null; + return event; } + } catch (OutOfMemoryError e) { + // ignore } - return event; + return null; } + /** * Called after sleeping to commit the jdk.ThreadSleep event. */ diff --git a/src/java.base/share/classes/java/lang/ThreadBuilders.java b/src/java.base/share/classes/java/lang/ThreadBuilders.java index ca29dc4f53589..234807d4cc2a7 100644 --- a/src/java.base/share/classes/java/lang/ThreadBuilders.java +++ b/src/java.base/share/classes/java/lang/ThreadBuilders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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,6 +34,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.ThreadFactory; import jdk.internal.misc.Unsafe; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.ContinuationSupport; /** @@ -273,15 +274,9 @@ public ThreadFactory factory() { * Base ThreadFactory implementation. */ private abstract static class BaseThreadFactory implements ThreadFactory { - private static final VarHandle COUNT; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - COUNT = l.findVarHandle(BaseThreadFactory.class, "count", long.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle COUNT = MhUtil.findVarHandle( + MethodHandles.lookup(), "count", long.class); + private final String name; private final int characteristics; private final UncaughtExceptionHandler uhe; diff --git a/src/java.base/share/classes/java/lang/TypeNotPresentException.java b/src/java.base/share/classes/java/lang/TypeNotPresentException.java index fdf42548c0371..c5a899ef2851d 100644 --- a/src/java.base/share/classes/java/lang/TypeNotPresentException.java +++ b/src/java.base/share/classes/java/lang/TypeNotPresentException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -28,9 +28,9 @@ /** * Thrown when an application tries to access a type using a string * representing the type's name, but no definition for the type with - * the specified name can be found. This exception differs from - * {@link ClassNotFoundException} in that {@code ClassNotFoundException} is a - * checked exception, whereas this exception is unchecked. + * the specified name can be found. This exception differs from + * {@link ClassNotFoundException} in that {@code ClassNotFoundException} + * is a checked exception, whereas this exception is unchecked. * *

Note that this exception may be used when undefined type variables * are accessed as well as when types (e.g., classes, interfaces or @@ -48,15 +48,15 @@ public class TypeNotPresentException extends RuntimeException { private static final long serialVersionUID = -5101214195716534496L; /** - * The type name. + * The type name or the name of a type variable. */ private String typeName; /** - * Constructs a {@code TypeNotPresentException} for the named type - * with the specified cause. + * Constructs a {@code TypeNotPresentException} for the named type or + * type variable with the specified cause. * - * @param typeName the fully qualified name of the unavailable type + * @param typeName the fully qualified name of the unavailable type or type variable * @param cause the exception that was thrown when the system attempted to * load the named type, or {@code null} if unavailable or inapplicable */ @@ -66,9 +66,9 @@ public TypeNotPresentException(String typeName, Throwable cause) { } /** - * Returns the fully qualified name of the unavailable type. + * Returns the fully qualified name of the unavailable type or type variable name. * - * @return the fully qualified name of the unavailable type + * @return the fully qualified name of the unavailable type or type variable name */ public String typeName() { return typeName;} } diff --git a/src/java.base/share/classes/java/lang/annotation/Retention.java b/src/java.base/share/classes/java/lang/annotation/Retention.java index daf5f6e9b23d3..a8afc76ac79f7 100644 --- a/src/java.base/share/classes/java/lang/annotation/Retention.java +++ b/src/java.base/share/classes/java/lang/annotation/Retention.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -45,8 +45,7 @@ @Target(ElementType.ANNOTATION_TYPE) public @interface Retention { /** - * Returns the retention policy. - * @return the retention policy + * {@return the retention policy} */ RetentionPolicy value(); } diff --git a/src/java.base/share/classes/java/lang/classfile/Annotation.java b/src/java.base/share/classes/java/lang/classfile/Annotation.java index 357a7cb77ee83..009248ffd7856 100644 --- a/src/java.base/share/classes/java/lang/classfile/Annotation.java +++ b/src/java.base/share/classes/java/lang/classfile/Annotation.java @@ -34,6 +34,8 @@ import java.lang.constant.ClassDesc; import java.util.List; + +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -78,7 +80,7 @@ public sealed interface Annotation * {@return the annotation interface, as a symbolic descriptor} */ default ClassDesc classSymbol() { - return ClassDesc.ofDescriptor(className().stringValue()); + return Util.fieldTypeSymbol(className()); } /** @@ -115,7 +117,7 @@ static Annotation of(Utf8Entry annotationClass, */ static Annotation of(ClassDesc annotationClass, List elements) { - return of(TemporaryConstantPool.INSTANCE.utf8Entry(annotationClass.descriptorString()), elements); + return of(TemporaryConstantPool.INSTANCE.utf8Entry(annotationClass), elements); } /** @@ -125,6 +127,6 @@ static Annotation of(ClassDesc annotationClass, */ static Annotation of(ClassDesc annotationClass, AnnotationElement... elements) { - return of(TemporaryConstantPool.INSTANCE.utf8Entry(annotationClass.descriptorString()), elements); + return of(TemporaryConstantPool.INSTANCE.utf8Entry(annotationClass), elements); } } diff --git a/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java b/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java index 613142077552d..c4474a248b520 100644 --- a/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java +++ b/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java @@ -38,6 +38,8 @@ import java.lang.constant.Constable; import java.util.ArrayList; import java.util.List; + +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -405,7 +407,7 @@ sealed interface OfClass extends AnnotationValue /** {@return the class descriptor} */ default ClassDesc classSymbol() { - return ClassDesc.ofDescriptor(className().stringValue()); + return Util.fieldTypeSymbol(className()); } } @@ -423,7 +425,7 @@ sealed interface OfEnum extends AnnotationValue /** {@return the enum class descriptor} */ default ClassDesc classSymbol() { - return ClassDesc.ofDescriptor(className().stringValue()); + return Util.fieldTypeSymbol(className()); } /** {@return the enum constant name} */ @@ -452,7 +454,7 @@ static OfEnum ofEnum(Utf8Entry className, * @param constantName the name of the enum constant */ static OfEnum ofEnum(ClassDesc className, String constantName) { - return ofEnum(TemporaryConstantPool.INSTANCE.utf8Entry(className.descriptorString()), + return ofEnum(TemporaryConstantPool.INSTANCE.utf8Entry(className), TemporaryConstantPool.INSTANCE.utf8Entry(constantName)); } @@ -469,7 +471,7 @@ static OfClass ofClass(Utf8Entry className) { * @param className the descriptor of the class */ static OfClass ofClass(ClassDesc className) { - return ofClass(TemporaryConstantPool.INSTANCE.utf8Entry(className.descriptorString())); + return ofClass(TemporaryConstantPool.INSTANCE.utf8Entry(className)); } /** diff --git a/src/java.base/share/classes/java/lang/classfile/ClassBuilder.java b/src/java.base/share/classes/java/lang/classfile/ClassBuilder.java index 1d5bb271dbe21..905c7355c3406 100644 --- a/src/java.base/share/classes/java/lang/classfile/ClassBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/ClassBuilder.java @@ -194,7 +194,9 @@ default ClassBuilder withField(String name, default ClassBuilder withField(String name, ClassDesc descriptor, int flags) { - return withField(name, descriptor, Util.buildingFlags(flags)); + return withField(constantPool().utf8Entry(name), + constantPool().utf8Entry(descriptor), + flags); } /** diff --git a/src/java.base/share/classes/java/lang/classfile/ClassFile.java b/src/java.base/share/classes/java/lang/classfile/ClassFile.java index 08745f7e1bafc..a305878d3ebf2 100644 --- a/src/java.base/share/classes/java/lang/classfile/ClassFile.java +++ b/src/java.base/share/classes/java/lang/classfile/ClassFile.java @@ -295,7 +295,7 @@ enum AttributesProcessingOption implements Option { DROP_UNKNOWN_ATTRIBUTES, /** Drop unknown and unstable original attributes during transformation */ - DROP_UNSTABLE_ATRIBUTES; + DROP_UNSTABLE_ATTRIBUTES } /** diff --git a/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java b/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java index be0778d198458..16f513801a249 100644 --- a/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/CodeBuilder.java @@ -615,36 +615,77 @@ default CodeBuilder loadConstant(ConstantDesc value) { if (value == null || value == ConstantDescs.NULL) return aconst_null(); if (value instanceof Number) { - if (value instanceof Integer iVal) - return switch (iVal) { - case -1 -> iconst_m1(); - case 0 -> iconst_0(); - case 1 -> iconst_1(); - case 2 -> iconst_2(); - case 3 -> iconst_3(); - case 4 -> iconst_4(); - case 5 -> iconst_5(); - default -> (iVal >= Byte.MIN_VALUE && iVal <= Byte.MAX_VALUE) ? bipush(iVal) - : (iVal >= Short.MIN_VALUE && iVal <= Short.MAX_VALUE) ? sipush(iVal) - : ldc(constantPool().intEntry(iVal)); - }; - if (value instanceof Long lVal) - return lVal == 0L ? lconst_0() - : lVal == 1L ? lconst_1() - : ldc(constantPool().longEntry(lVal)); - if (value instanceof Float fVal) - return Float.floatToRawIntBits(fVal) == 0 ? fconst_0() - : fVal == 1.0f ? fconst_1() - : fVal == 2.0f ? fconst_2() - : ldc(constantPool().floatEntry(fVal)); - if (value instanceof Double dVal) - return Double.doubleToRawLongBits(dVal) == 0L ? dconst_0() - : dVal == 1.0d ? dconst_1() - : ldc(constantPool().doubleEntry(dVal)); + if (value instanceof Integer) return loadConstant((int) value); + if (value instanceof Long ) return loadConstant((long) value); + if (value instanceof Float ) return loadConstant((float) value); + if (value instanceof Double ) return loadConstant((double) value); } return ldc(value); } + + /** + * Generate an instruction pushing a constant int value onto the operand stack. + * This is identical to {@link #loadConstant(ConstantDesc) loadConstant(Integer.valueOf(value))}. + * @param value the int value + * @return this builder + * @since 24 + */ + default CodeBuilder loadConstant(int value) { + return switch (value) { + case -1 -> iconst_m1(); + case 0 -> iconst_0(); + case 1 -> iconst_1(); + case 2 -> iconst_2(); + case 3 -> iconst_3(); + case 4 -> iconst_4(); + case 5 -> iconst_5(); + default -> (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE ) ? bipush(value) + : (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) ? sipush(value) + : ldc(constantPool().intEntry(value)); + }; + } + + /** + * Generate an instruction pushing a constant long value onto the operand stack. + * This is identical to {@link #loadConstant(ConstantDesc) loadConstant(Long.valueOf(value))}. + * @param value the long value + * @return this builder + * @since 24 + */ + default CodeBuilder loadConstant(long value) { + return value == 0l ? lconst_0() + : value == 1l ? lconst_1() + : ldc(constantPool().longEntry(value)); + } + + /** + * Generate an instruction pushing a constant float value onto the operand stack. + * This is identical to {@link #loadConstant(ConstantDesc) loadConstant(Float.valueOf(value))}. + * @param value the float value + * @return this builder + * @since 24 + */ + default CodeBuilder loadConstant(float value) { + return Float.floatToRawIntBits(value) == 0 ? fconst_0() + : value == 1.0f ? fconst_1() + : value == 2.0f ? fconst_2() + : ldc(constantPool().floatEntry(value)); + } + + /** + * Generate an instruction pushing a constant double value onto the operand stack. + * This is identical to {@link #loadConstant(ConstantDesc) loadConstant(Double.valueOf(value))}. + * @param value the double value + * @return this builder + * @since 24 + */ + default CodeBuilder loadConstant(double value) { + return Double.doubleToRawLongBits(value) == 0l ? dconst_0() + : value == 1.0d ? dconst_1() + : ldc(constantPool().doubleEntry(value)); + } + /** * Generate a do nothing instruction * @return this builder @@ -769,7 +810,7 @@ default CodeBuilder localVariable(int slot, Utf8Entry nameEntry, Utf8Entry descr default CodeBuilder localVariable(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) { return localVariable(slot, constantPool().utf8Entry(name), - constantPool().utf8Entry(descriptor.descriptorString()), + constantPool().utf8Entry(descriptor), startScope, endScope); } diff --git a/src/java.base/share/classes/java/lang/classfile/FieldModel.java b/src/java.base/share/classes/java/lang/classfile/FieldModel.java index e14f264ca2a98..006103d5f9cbc 100644 --- a/src/java.base/share/classes/java/lang/classfile/FieldModel.java +++ b/src/java.base/share/classes/java/lang/classfile/FieldModel.java @@ -31,6 +31,7 @@ import java.lang.classfile.constantpool.Utf8Entry; import jdk.internal.classfile.impl.BufferedFieldBuilder; import jdk.internal.classfile.impl.FieldImpl; +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -59,6 +60,6 @@ public sealed interface FieldModel /** {@return the field descriptor of this field, as a symbolic descriptor} */ default ClassDesc fieldTypeSymbol() { - return ClassDesc.ofDescriptor(fieldType().stringValue()); + return Util.fieldTypeSymbol(fieldType()); } } diff --git a/src/java.base/share/classes/java/lang/classfile/MethodModel.java b/src/java.base/share/classes/java/lang/classfile/MethodModel.java index 651bc194ee3e0..bd51f3c97d72e 100644 --- a/src/java.base/share/classes/java/lang/classfile/MethodModel.java +++ b/src/java.base/share/classes/java/lang/classfile/MethodModel.java @@ -31,6 +31,7 @@ import java.lang.classfile.constantpool.Utf8Entry; import jdk.internal.classfile.impl.BufferedMethodBuilder; import jdk.internal.classfile.impl.MethodImpl; +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -59,7 +60,7 @@ public sealed interface MethodModel /** {@return the method descriptor of this method, as a symbolic descriptor} */ default MethodTypeDesc methodTypeSymbol() { - return MethodTypeDesc.ofDescriptor(methodType().stringValue()); + return Util.methodTypeSymbol(methodType()); } /** {@return the body of this method, if there is one} */ diff --git a/src/java.base/share/classes/java/lang/classfile/attribute/LocalVariableInfo.java b/src/java.base/share/classes/java/lang/classfile/attribute/LocalVariableInfo.java index 954682f665def..0ef8542e05c55 100644 --- a/src/java.base/share/classes/java/lang/classfile/attribute/LocalVariableInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/LocalVariableInfo.java @@ -28,6 +28,7 @@ import java.lang.classfile.constantpool.Utf8Entry; import jdk.internal.classfile.impl.BoundLocalVariable; import jdk.internal.classfile.impl.UnboundAttribute; +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -65,7 +66,7 @@ public sealed interface LocalVariableInfo * {@return the field descriptor of the local variable} */ default ClassDesc typeSymbol() { - return ClassDesc.ofDescriptor(type().stringValue()); + return Util.fieldTypeSymbol(type()); } /** diff --git a/src/java.base/share/classes/java/lang/classfile/attribute/RecordComponentInfo.java b/src/java.base/share/classes/java/lang/classfile/attribute/RecordComponentInfo.java index ab7df7a5db2b4..5a4c0d87b839a 100644 --- a/src/java.base/share/classes/java/lang/classfile/attribute/RecordComponentInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/RecordComponentInfo.java @@ -33,6 +33,7 @@ import jdk.internal.classfile.impl.BoundRecordComponentInfo; import jdk.internal.classfile.impl.TemporaryConstantPool; import jdk.internal.classfile.impl.UnboundAttribute; +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -58,7 +59,7 @@ public sealed interface RecordComponentInfo * {@return the field descriptor of this component, as a {@linkplain ClassDesc}} */ default ClassDesc descriptorSymbol() { - return ClassDesc.ofDescriptor(descriptor().stringValue()); + return Util.fieldTypeSymbol(descriptor()); } /** @@ -95,7 +96,7 @@ static RecordComponentInfo of(String name, ClassDesc descriptor, List> attributes) { return new UnboundAttribute.UnboundRecordComponentInfo(TemporaryConstantPool.INSTANCE.utf8Entry(name), - TemporaryConstantPool.INSTANCE.utf8Entry(descriptor.descriptorString()), + TemporaryConstantPool.INSTANCE.utf8Entry(descriptor), attributes); } diff --git a/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java b/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java index 7334d8e54604e..1c0d6e55e3143 100644 --- a/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java @@ -223,9 +223,7 @@ default ModuleEntry moduleEntry(ModuleDesc moduleDesc) { * @param type the symbolic descriptor for a field type */ default NameAndTypeEntry nameAndTypeEntry(String name, ClassDesc type) { - var ret = (NameAndTypeEntryImpl)nameAndTypeEntry(utf8Entry(name), utf8Entry(type.descriptorString())); - ret.typeSym = type; - return ret; + return nameAndTypeEntry(utf8Entry(name), utf8Entry(type)); } /** @@ -238,9 +236,7 @@ default NameAndTypeEntry nameAndTypeEntry(String name, ClassDesc type) { * @param type the symbolic descriptor for a method type */ default NameAndTypeEntry nameAndTypeEntry(String name, MethodTypeDesc type) { - var ret = (NameAndTypeEntryImpl)nameAndTypeEntry(utf8Entry(name), utf8Entry(type.descriptorString())); - ret.typeSym = type; - return ret; + return nameAndTypeEntry(utf8Entry(name), utf8Entry(type)); } /** diff --git a/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariable.java b/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariable.java index 4d3d755386763..84a8599315218 100644 --- a/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariable.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/LocalVariable.java @@ -36,6 +36,7 @@ import jdk.internal.classfile.impl.AbstractPseudoInstruction; import jdk.internal.classfile.impl.BoundLocalVariable; import jdk.internal.classfile.impl.TemporaryConstantPool; +import jdk.internal.classfile.impl.Util; import jdk.internal.javac.PreviewFeature; /** @@ -70,7 +71,7 @@ public sealed interface LocalVariable extends PseudoInstruction * {@return the local variable type, as a symbolic descriptor} */ default ClassDesc typeSymbol() { - return ClassDesc.ofDescriptor(type().stringValue()); + return Util.fieldTypeSymbol(type()); } /** @@ -109,7 +110,7 @@ static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) { return of(slot, TemporaryConstantPool.INSTANCE.utf8Entry(name), - TemporaryConstantPool.INSTANCE.utf8Entry(descriptor.descriptorString()), + TemporaryConstantPool.INSTANCE.utf8Entry(descriptor), startScope, endScope); } } diff --git a/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html b/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html index c680c0d2745a5..9f3ad156727a0 100644 --- a/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html +++ b/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html @@ -71,7 +71,7 @@

What should I use instead of Thread.stop?

communication of the stop-request, the variable must be volatile (or access to the variable must be synchronized).

-

For example, suppose your applet contains the following +

For example, suppose your application contains the following start, stop and run methods:

@@ -92,12 +92,12 @@ 

What should I use instead of Thread.stop?

Thread.sleep(interval); } catch (InterruptedException e){ } - repaint(); + blink(); } }
You can avoid the use of Thread.stop by replacing the -applet's stop and run methods with: +application's stop and run methods with:
     private volatile Thread blinker;
 
@@ -112,7 +112,7 @@ 

What should I use instead of Thread.stop?

Thread.sleep(interval); } catch (InterruptedException e){ } - repaint(); + blink(); } }
diff --git a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java index 38fd36bbb1584..9fadc2f0f56d1 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemorySegment.java +++ b/src/java.base/share/classes/java/lang/foreign/MemorySegment.java @@ -43,6 +43,7 @@ import java.util.stream.Stream; import jdk.internal.foreign.AbstractMemorySegmentImpl; import jdk.internal.foreign.MemorySessionImpl; +import jdk.internal.foreign.SegmentBulkOperations; import jdk.internal.foreign.SegmentFactories; import jdk.internal.javac.Restricted; import jdk.internal.reflect.CallerSensitive; @@ -1284,6 +1285,14 @@ MemorySegment reinterpret(long newSize, * sequences with this charset's default replacement string. The {@link * java.nio.charset.CharsetDecoder} class should be used when more control * over the decoding process is required. + *

+ * Getting a string from a segment with a known byte offset and + * known byte length can be done like so: + * {@snippet lang=java : + * byte[] bytes = new byte[length]; + * MemorySegment.copy(segment, JAVA_BYTE, offset, bytes, 0, length); + * return new String(bytes, charset); + * } * * @param offset offset in bytes (relative to this segment address) at which this * access operation will occur @@ -1571,7 +1580,7 @@ static MemorySegment ofAddress(long address) { static void copy(MemorySegment srcSegment, long srcOffset, MemorySegment dstSegment, long dstOffset, long bytes) { - AbstractMemorySegmentImpl.copy((AbstractMemorySegmentImpl) srcSegment, srcOffset, + SegmentBulkOperations.copy((AbstractMemorySegmentImpl) srcSegment, srcOffset, (AbstractMemorySegmentImpl) dstSegment, dstOffset, bytes); } @@ -2635,8 +2644,9 @@ static void copy(Object srcArray, int srcIndex, */ static long mismatch(MemorySegment srcSegment, long srcFromOffset, long srcToOffset, MemorySegment dstSegment, long dstFromOffset, long dstToOffset) { - return AbstractMemorySegmentImpl.mismatch(srcSegment, srcFromOffset, srcToOffset, - dstSegment, dstFromOffset, dstToOffset); + return SegmentBulkOperations.mismatch( + (AbstractMemorySegmentImpl)Objects.requireNonNull(srcSegment), srcFromOffset, srcToOffset, + (AbstractMemorySegmentImpl)Objects.requireNonNull(dstSegment), dstFromOffset, dstToOffset); } /** diff --git a/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java index 44bca025b8b6d..90da523dec831 100644 --- a/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java @@ -143,7 +143,7 @@ static LambdaForm makeReinvokerForm(MethodHandle target, final int PRE_ACTION = hasPreAction ? nameCursor++ : -1; final int NEXT_MH = customized ? -1 : nameCursor++; final int REINVOKE = nameCursor++; - LambdaForm.Name[] names = LambdaForm.arguments(nameCursor - ARG_LIMIT, mtype.invokerType()); + LambdaForm.Name[] names = LambdaForm.invokeArguments(nameCursor - ARG_LIMIT, mtype); assert(names.length == nameCursor); names[THIS_DMH] = names[THIS_DMH].withConstraint(constraint); Object[] targetArgs; diff --git a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java index 850ed2f53f91f..8316c867dc2c7 100644 --- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java @@ -250,11 +250,17 @@ static LambdaForm makePreparedLambdaForm(MethodType mtype, int which) { default: throw new InternalError("which="+which); } - MethodType mtypeWithArg = mtype.appendParameterTypes(MemberName.class); - if (doesAlloc) - mtypeWithArg = mtypeWithArg - .insertParameterTypes(0, Object.class) // insert newly allocated obj - .changeReturnType(void.class); // returns void + MethodType mtypeWithArg; + if (doesAlloc) { + var ptypes = mtype.ptypes(); + var newPtypes = new Class[ptypes.length + 2]; + newPtypes[0] = Object.class; // insert newly allocated obj + System.arraycopy(ptypes, 0, newPtypes, 1, ptypes.length); + newPtypes[newPtypes.length - 1] = MemberName.class; + mtypeWithArg = MethodType.methodType(void.class, newPtypes, true); + } else { + mtypeWithArg = mtype.appendParameterTypes(MemberName.class); + } MemberName linker = new MemberName(MethodHandle.class, linkerName, mtypeWithArg, REF_invokeStatic); try { linker = IMPL_NAMES.resolveOrFail(REF_invokeStatic, linker, null, LM_TRUSTED, @@ -270,7 +276,7 @@ static LambdaForm makePreparedLambdaForm(MethodType mtype, int which) { final int GET_MEMBER = nameCursor++; final int CHECK_RECEIVER = (needsReceiverCheck ? nameCursor++ : -1); final int LINKER_CALL = nameCursor++; - Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType()); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, mtype); assert(names.length == nameCursor); if (doesAlloc) { // names = { argx,y,z,... new C, init method } @@ -786,7 +792,7 @@ static LambdaForm makePreparedFieldLambdaForm(byte formOp, boolean isVolatile, i final int LINKER_CALL = nameCursor++; final int POST_CAST = (needsCast && isGetter ? nameCursor++ : -1); final int RESULT = nameCursor-1; // either the call or the cast - Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType()); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, mtype); if (needsInit) names[INIT_BAR] = new Name(getFunction(NF_ensureInitialized), names[DMH_THIS]); if (needsCast && !isGetter) diff --git a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 23893cb3c263b..92c02c433c524 100644 --- a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -53,6 +53,8 @@ import java.lang.classfile.constantpool.ConstantPoolBuilder; import java.lang.classfile.constantpool.MethodRefEntry; import static java.lang.constant.ConstantDescs.*; +import static java.lang.invoke.MethodHandleNatives.Constants.NESTMATE_CLASS; +import static java.lang.invoke.MethodHandleNatives.Constants.STRONG_LOADER_LINK; import static java.lang.invoke.MethodHandles.Lookup.ClassOption.NESTMATE; import static java.lang.invoke.MethodHandles.Lookup.ClassOption.STRONG; import static java.lang.invoke.MethodType.methodType; @@ -348,7 +350,7 @@ else if (finalAccidentallySerializable) try { // this class is linked at the indy callsite; so define a hidden nestmate var classdata = useImplMethodHandle? implementation : null; - return caller.makeHiddenClassDefiner(lambdaClassName, classBytes, Set.of(NESTMATE, STRONG), lambdaProxyClassFileDumper) + return caller.makeHiddenClassDefiner(lambdaClassName, classBytes, lambdaProxyClassFileDumper, NESTMATE_CLASS | STRONG_LOADER_LINK) .defineClass(!disableEagerInitialization, classdata); } catch (Throwable t) { diff --git a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index c69913ba6cd84..4a905a3030b9a 100644 --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -47,7 +47,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.Set; import java.util.function.Consumer; import java.util.stream.Stream; import jdk.internal.constant.MethodTypeDescImpl; @@ -224,7 +223,7 @@ FieldRefEntry classData(ClassFileBuilder cfb, Object arg, ClassDesc desc) * Extract the MemberName of a newly-defined method. */ private MemberName loadMethod(byte[] classFile) { - Class invokerClass = LOOKUP.makeHiddenClassDefiner(className, classFile, Set.of(), dumper()) + Class invokerClass = LOOKUP.makeHiddenClassDefiner(className, classFile, dumper()) .defineClass(true, classDataValues()); return resolveInvokerMember(invokerClass, invokerName, invokerType); } @@ -1646,7 +1645,7 @@ private void bogusMethod(ClassBuilder clb, Object os) { clb.withMethodBody("dummy", MTD_void, ACC_STATIC, new Consumer<>() { @Override public void accept(CodeBuilder cob) { - cob.loadConstant(os.toString()); + cob.ldc(os.toString()); cob.pop(); cob.return_(); } diff --git a/src/java.base/share/classes/java/lang/invoke/Invokers.java b/src/java.base/share/classes/java/lang/invoke/Invokers.java index 6c383dd3f2ca3..9990370ae25b6 100644 --- a/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -25,6 +25,7 @@ package java.lang.invoke; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.annotation.DontInline; import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.Hidden; @@ -314,14 +315,14 @@ static LambdaForm invokeHandleForm(MethodType mtype, boolean customized, int whi final int CHECK_TYPE = nameCursor++; final int CHECK_CUSTOM = (CUSTOMIZE_THRESHOLD >= 0) ? nameCursor++ : -1; final int LINKER_CALL = nameCursor++; - MethodType invokerFormType = mtype.invokerType(); + MethodType invokerFormType = mtype; if (isLinker) { if (!customized) invokerFormType = invokerFormType.appendParameterTypes(MemberName.class); } else { invokerFormType = invokerFormType.invokerType(); } - Name[] names = arguments(nameCursor - INARG_LIMIT, invokerFormType); + Name[] names = invokeArguments(nameCursor - INARG_LIMIT, invokerFormType); assert(names.length == nameCursor) : Arrays.asList(mtype, customized, which, nameCursor, names.length); if (MTYPE_ARG >= INARG_LIMIT) { @@ -390,11 +391,11 @@ private static LambdaForm varHandleMethodGenericLinkerHandleForm(MethodType mtyp final int LINKER_CALL = nameCursor++; Name[] names = new Name[LINKER_CALL + 1]; - names[THIS_VH] = argument(THIS_VH, BasicType.basicType(Object.class)); + names[THIS_VH] = argument(THIS_VH, BasicType.L_TYPE); for (int i = 0; i < mtype.parameterCount(); i++) { names[ARG_BASE + i] = argument(ARG_BASE + i, BasicType.basicType(mtype.parameterType(i))); } - names[VAD_ARG] = new Name(ARG_LIMIT, BasicType.basicType(Object.class)); + names[VAD_ARG] = new Name(ARG_LIMIT, BasicType.L_TYPE); names[UNBOUND_VH] = new Name(getFunction(NF_directVarHandleTarget), names[THIS_VH]); @@ -446,8 +447,8 @@ private static LambdaForm varHandleMethodInvokerHandleForm(MethodType mtype, boo final int LINKER_CALL = nameCursor++; Name[] names = new Name[LINKER_CALL + 1]; - names[THIS_MH] = argument(THIS_MH, BasicType.basicType(Object.class)); - names[CALL_VH] = argument(CALL_VH, BasicType.basicType(Object.class)); + names[THIS_MH] = argument(THIS_MH, BasicType.L_TYPE); + names[CALL_VH] = argument(CALL_VH, BasicType.L_TYPE); for (int i = 0; i < mtype.parameterCount(); i++) { names[ARG_BASE + i] = argument(ARG_BASE + i, BasicType.basicType(mtype.parameterType(i))); } @@ -589,17 +590,16 @@ static LambdaForm callSiteForm(MethodType mtype, boolean skipCallSite) { final int CSITE_ARG = skipCallSite ? -1 : APPENDIX_ARG; final int CALL_MH = skipCallSite ? APPENDIX_ARG : nameCursor++; // result of getTarget final int LINKER_CALL = nameCursor++; - MethodType invokerFormType = mtype.appendParameterTypes(skipCallSite ? MethodHandle.class : CallSite.class); - Name[] names = arguments(nameCursor - INARG_LIMIT, invokerFormType); - assert(names.length == nameCursor); - assert(names[APPENDIX_ARG] != null); + Name[] names = arguments(nameCursor - INARG_LIMIT + 1, mtype); + assert(names.length == nameCursor && names[APPENDIX_ARG] == null); + names[APPENDIX_ARG] = argument(APPENDIX_ARG, BasicType.L_TYPE); if (!skipCallSite) names[CALL_MH] = new Name(getFunction(NF_getCallSiteTarget), names[CSITE_ARG]); // (site.)invokedynamic(a*):R => mh = site.getTarget(); mh.invokeBasic(a*) final int PREPEND_MH = 0, PREPEND_COUNT = 1; - Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, OUTARG_LIMIT + PREPEND_COUNT, Object[].class); + Object[] outArgs = new Object[OUTARG_LIMIT + PREPEND_COUNT]; + System.arraycopy(names, 0, outArgs, PREPEND_COUNT, outArgs.length - PREPEND_COUNT); // prepend MH argument: - System.arraycopy(outArgs, 0, outArgs, PREPEND_COUNT, outArgs.length - PREPEND_COUNT); outArgs[PREPEND_MH] = names[CALL_MH]; names[LINKER_CALL] = new Name(mtype, outArgs); lform = LambdaForm.create(INARG_LIMIT, names, @@ -682,16 +682,9 @@ private static NamedFunction getNamedFunction(String name, MethodType type) } private static class Lazy { - private static final MethodHandle MH_asSpreader; - - static { - try { - MH_asSpreader = IMPL_LOOKUP.findVirtual(MethodHandle.class, "asSpreader", - MethodType.methodType(MethodHandle.class, Class.class, int.class)); - } catch (ReflectiveOperationException ex) { - throw newInternalError(ex); - } - } + private static final MethodHandle MH_asSpreader = MhUtil.findVirtual( + IMPL_LOOKUP, MethodHandle.class, "asSpreader", + MethodType.methodType(MethodHandle.class, Class.class, int.class)); } static { diff --git a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index 0132cc6edf589..7109f35f069ce 100644 --- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -1636,6 +1636,16 @@ static Name[] arguments(int extra, MethodType types) { names[i] = argument(i, basicType(types.parameterType(i))); return names; } + + static Name[] invokeArguments(int extra, MethodType types) { + int length = types.parameterCount(); + Name[] names = new Name[length + extra + 1]; + names[0] = argument(0, L_TYPE); + for (int i = 0; i < length; i++) + names[i + 1] = argument(i + 1, basicType(types.parameterType(i))); + return names; + } + static final int INTERNED_ARGUMENT_LIMIT = 10; private static final Name[][] INTERNED_ARGUMENTS = new Name[ARG_TYPE_LIMIT][INTERNED_ARGUMENT_LIMIT]; diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index 57446c9b2fdf0..992ef38768484 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -64,6 +64,7 @@ import static java.lang.invoke.LambdaForm.*; import static java.lang.invoke.MethodHandleNatives.Constants.MN_CALLER_SENSITIVE; import static java.lang.invoke.MethodHandleNatives.Constants.MN_HIDDEN_MEMBER; +import static java.lang.invoke.MethodHandleNatives.Constants.NESTMATE_CLASS; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; import static java.lang.invoke.MethodHandles.Lookup.ClassOption.NESTMATE; @@ -809,8 +810,7 @@ static LambdaForm makeGuardWithTestForm(MethodType basicType) { final int CALL_TARGET = nameCursor++; assert(CALL_TARGET == SELECT_ALT+1); // must be true to trigger IBG.emitSelectAlternative - MethodType lambdaType = basicType.invokerType(); - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); BoundMethodHandle.SpeciesData data = (GET_COUNTERS != -1) ? BoundMethodHandle.speciesData_LLLL() @@ -842,7 +842,7 @@ static LambdaForm makeGuardWithTestForm(MethodType basicType) { invokeArgs[0] = names[SELECT_ALT]; names[CALL_TARGET] = new Name(basicType, invokeArgs); - lform = LambdaForm.create(lambdaType.parameterCount(), names, /*forceInline=*/true, Kind.GUARD); + lform = LambdaForm.create(basicType.parameterCount() + 1, names, /*forceInline=*/true, Kind.GUARD); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWT, lform); } @@ -869,8 +869,6 @@ static LambdaForm makeGuardWithTestForm(MethodType basicType) { * among catchException combinators with the same basic type. */ private static LambdaForm makeGuardWithCatchForm(MethodType basicType) { - MethodType lambdaType = basicType.invokerType(); - LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_GWC); if (lform != null) { return lform; @@ -889,7 +887,7 @@ private static LambdaForm makeGuardWithCatchForm(MethodType basicType) { final int TRY_CATCH = nameCursor++; final int UNBOX_RESULT = nameCursor++; - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLL(); names[THIS_MH] = names[THIS_MH].withConstraint(data); @@ -918,7 +916,7 @@ private static LambdaForm makeGuardWithCatchForm(MethodType basicType) { Object[] unboxArgs = new Object[] {names[GET_UNBOX_RESULT], names[TRY_CATCH]}; names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); - lform = LambdaForm.create(lambdaType.parameterCount(), names, Kind.GUARD_WITH_CATCH); + lform = LambdaForm.create(basicType.parameterCount() + 1, names, Kind.GUARD_WITH_CATCH); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform); } @@ -1111,7 +1109,7 @@ private static Class makeInjectedInvoker(Class targetClass) { } name = name.replace('.', '/'); Class invokerClass = new Lookup(targetClass) - .makeHiddenClassDefiner(name, INJECTED_INVOKER_TEMPLATE, Set.of(NESTMATE), dumper()) + .makeHiddenClassDefiner(name, INJECTED_INVOKER_TEMPLATE, dumper(), NESTMATE_CLASS) .defineClass(true, targetClass); assert checkInjectedInvoker(targetClass, invokerClass); return invokerClass; @@ -1732,8 +1730,6 @@ private static MethodHandle[] toArray(List l) { * bytecode generation}. */ private static LambdaForm makeLoopForm(MethodType basicType, BasicType[] localVarTypes) { - MethodType lambdaType = basicType.invokerType(); - final int THIS_MH = 0; // the BMH_LLL final int ARG_BASE = 1; // start of incoming arguments final int ARG_LIMIT = ARG_BASE + basicType.parameterCount(); @@ -1748,7 +1744,7 @@ private static LambdaForm makeLoopForm(MethodType basicType, BasicType[] localVa LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_LOOP); if (lform == null) { - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL(); names[THIS_MH] = names[THIS_MH].withConstraint(data); @@ -1776,7 +1772,7 @@ private static LambdaForm makeLoopForm(MethodType basicType, BasicType[] localVa names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); lform = basicType.form().setCachedLambdaForm(MethodTypeForm.LF_LOOP, - LambdaForm.create(lambdaType.parameterCount(), names, Kind.LOOP)); + LambdaForm.create(basicType.parameterCount() + 1, names, Kind.LOOP)); } // BOXED_ARGS is the index into the names array where the loop idiom starts @@ -1965,8 +1961,6 @@ static MethodHandle makeTryFinally(MethodHandle target, MethodHandle cleanup, Cl * forms among tryFinally combinators with the same basic type. */ private static LambdaForm makeTryFinallyForm(MethodType basicType) { - MethodType lambdaType = basicType.invokerType(); - LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_TF); if (lform != null) { return lform; @@ -1984,7 +1978,7 @@ private static LambdaForm makeTryFinallyForm(MethodType basicType) { final int TRY_FINALLY = nameCursor++; final int UNBOX_RESULT = nameCursor++; - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLL(); names[THIS_MH] = names[THIS_MH].withConstraint(data); @@ -2010,7 +2004,7 @@ private static LambdaForm makeTryFinallyForm(MethodType basicType) { Object[] unboxArgs = new Object[] {names[GET_UNBOX_RESULT], names[TRY_FINALLY]}; names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); - lform = LambdaForm.create(lambdaType.parameterCount(), names, Kind.TRY_FINALLY); + lform = LambdaForm.create(basicType.parameterCount() + 1, names, Kind.TRY_FINALLY); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_TF, lform); } @@ -2054,7 +2048,6 @@ private static MethodHandle makeCollector(Class arrayType, int parameterCount } private static LambdaForm makeCollectorForm(MethodType basicType, Class arrayType) { - MethodType lambdaType = basicType.invokerType(); int parameterCount = basicType.parameterCount(); // Only share the lambda form for empty arrays and reference types. @@ -2087,7 +2080,7 @@ private static LambdaForm makeCollectorForm(MethodType basicType, Class array final int STORE_ELEMENT_LIMIT = STORE_ELEMENT_BASE + parameterCount; nameCursor = STORE_ELEMENT_LIMIT; - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_L(); names[THIS_MH] = names[THIS_MH].withConstraint(data); @@ -2105,7 +2098,7 @@ private static LambdaForm makeCollectorForm(MethodType basicType, Class array names[CALL_NEW_ARRAY], storeIndex, names[argCursor]); } - LambdaForm lform = LambdaForm.create(lambdaType.parameterCount(), names, CALL_NEW_ARRAY, Kind.COLLECTOR); + LambdaForm lform = LambdaForm.create(basicType.parameterCount() + 1, names, CALL_NEW_ARRAY, Kind.COLLECTOR); if (isSharedLambdaForm) { lform = basicType.form().setCachedLambdaForm(MethodTypeForm.LF_COLLECTOR, lform); } @@ -2168,8 +2161,6 @@ public int hashCode() { private static LambdaForm makeTableSwitchForm(MethodType basicType, BoundMethodHandle.SpeciesData data, int numCases) { - MethodType lambdaType = basicType.invokerType(); - // We need to cache based on the basic type X number of cases, // since the number of cases is used when generating bytecode. // This also means that we can't use the cache in MethodTypeForm, @@ -2201,7 +2192,7 @@ private static LambdaForm makeTableSwitchForm(MethodType basicType, BoundMethodH final int FIELD_UNBOX_RESULT = fieldCursor++; final int FIELD_CASES = fieldCursor++; - Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType); + Name[] names = invokeArguments(nameCursor - ARG_LIMIT, basicType); names[THIS_MH] = names[THIS_MH].withConstraint(data); names[GET_DEFAULT_CASE] = new Name(data.getterFunction(FIELD_DEFAULT_CASE), names[THIS_MH]); @@ -2230,7 +2221,7 @@ private static LambdaForm makeTableSwitchForm(MethodType basicType, BoundMethodH names[UNBOXED_RESULT] = new Name(invokeBasic, unboxArgs); } - lform = LambdaForm.create(lambdaType.parameterCount(), names, Kind.TABLE_SWITCH); + lform = LambdaForm.create(basicType.parameterCount() + 1, names, Kind.TABLE_SWITCH); LambdaForm prev = TableSwitchCacheKey.CACHE.putIfAbsent(key, lform); return prev != null ? prev : lform; } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java index 8f0f355a9802d..c6a5c2763f4a6 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java @@ -285,7 +285,7 @@ private static Class newProxyClass(Class intfc) { byte[] template = createTemplate(loader, binaryNameToDesc(className), referenceClassDesc(intfc), uniqueName, methods); // define the dynamic module to the class loader of the interface - var definer = new Lookup(intfc).makeHiddenClassDefiner(className, template, Set.of(), DUMPER); + var definer = new Lookup(intfc).makeHiddenClassDefiner(className, template, DUMPER); @SuppressWarnings("removal") var sm = System.getSecurityManager(); diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 30c8ee03601f7..6a73266ae80a4 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -1906,9 +1906,12 @@ public enum ClassOption { this.flag = flag; } - static int optionsToFlag(Set options) { + static int optionsToFlag(ClassOption[] options) { int flags = 0; for (ClassOption cp : options) { + if ((flags & cp.flag) != 0) { + throw new IllegalArgumentException("Duplicate ClassOption " + cp); + } flags |= cp.flag; } return flags; @@ -2126,14 +2129,13 @@ public Lookup defineHiddenClass(byte[] bytes, boolean initialize, ClassOption... throws IllegalAccessException { Objects.requireNonNull(bytes); - Objects.requireNonNull(options); - + int flags = ClassOption.optionsToFlag(options); ensureDefineClassPermission(); if (!hasFullPrivilegeAccess()) { throw new IllegalAccessException(this + " does not have full privilege access"); } - return makeHiddenClassDefiner(bytes.clone(), Set.of(options), false).defineClassAsLookup(initialize); + return makeHiddenClassDefiner(bytes.clone(), false, flags).defineClassAsLookup(initialize); } /** @@ -2213,14 +2215,15 @@ public Lookup defineHiddenClassWithClassData(byte[] bytes, Object classData, boo { Objects.requireNonNull(bytes); Objects.requireNonNull(classData); - Objects.requireNonNull(options); + + int flags = ClassOption.optionsToFlag(options); ensureDefineClassPermission(); if (!hasFullPrivilegeAccess()) { throw new IllegalAccessException(this + " does not have full privilege access"); } - return makeHiddenClassDefiner(bytes.clone(), Set.of(options), false) + return makeHiddenClassDefiner(bytes.clone(), false, flags) .defineClassAsLookup(initialize, classData); } @@ -2366,7 +2369,7 @@ ClassDefiner makeClassDefiner(String name, byte[] bytes, ClassFileDumper dumper) */ ClassDefiner makeHiddenClassDefiner(byte[] bytes, ClassFileDumper dumper) { ClassFile cf = ClassFile.newInstance(bytes, lookupClass().getPackageName()); - return makeHiddenClassDefiner(cf, Set.of(), false, dumper); + return makeHiddenClassDefiner(cf, false, dumper, 0); } /** @@ -2378,7 +2381,7 @@ ClassDefiner makeHiddenClassDefiner(byte[] bytes, ClassFileDumper dumper) { * before calling this factory method. * * @param bytes class bytes - * @param options class options + * @param flags class option flag mask * @param accessVmAnnotations true to give the hidden class access to VM annotations * @return ClassDefiner that defines a hidden class of the given bytes and options * @@ -2386,10 +2389,25 @@ ClassDefiner makeHiddenClassDefiner(byte[] bytes, ClassFileDumper dumper) { * {@code bytes} denotes a class in a different package than the lookup class */ private ClassDefiner makeHiddenClassDefiner(byte[] bytes, - Set options, - boolean accessVmAnnotations) { + boolean accessVmAnnotations, + int flags) { ClassFile cf = ClassFile.newInstance(bytes, lookupClass().getPackageName()); - return makeHiddenClassDefiner(cf, options, accessVmAnnotations, defaultDumper()); + return makeHiddenClassDefiner(cf, accessVmAnnotations, defaultDumper(), flags); + } + + /** + * Returns a ClassDefiner that creates a {@code Class} object of a hidden class + * from the given bytes and the given options. No package name check on the given bytes. + * + * @param name internal name that specifies the prefix of the hidden class + * @param bytes class bytes + * @param dumper dumper to write the given bytes to the dumper's output directory + * @return ClassDefiner that defines a hidden class of the given bytes and options. + */ + ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes, ClassFileDumper dumper) { + Objects.requireNonNull(dumper); + // skip name and access flags validation + return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), false, dumper, 0); } /** @@ -2398,14 +2416,14 @@ private ClassDefiner makeHiddenClassDefiner(byte[] bytes, * * @param name internal name that specifies the prefix of the hidden class * @param bytes class bytes - * @param options class options + * @param flags class options flag mask * @param dumper dumper to write the given bytes to the dumper's output directory * @return ClassDefiner that defines a hidden class of the given bytes and options. */ - ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes, Set options, ClassFileDumper dumper) { + ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes, ClassFileDumper dumper, int flags) { Objects.requireNonNull(dumper); // skip name and access flags validation - return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), options, false, dumper); + return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), false, dumper, flags); } /** @@ -2413,15 +2431,15 @@ ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes, Set * from the given class file and options. * * @param cf ClassFile - * @param options class options + * @param flags class option flag mask * @param accessVmAnnotations true to give the hidden class access to VM annotations * @param dumper dumper to write the given bytes to the dumper's output directory */ private ClassDefiner makeHiddenClassDefiner(ClassFile cf, - Set options, boolean accessVmAnnotations, - ClassFileDumper dumper) { - int flags = HIDDEN_CLASS | ClassOption.optionsToFlag(options); + ClassFileDumper dumper, + int flags) { + flags |= HIDDEN_CLASS; if (accessVmAnnotations | VM.isSystemDomainLoader(lookupClass.getClassLoader())) { // jdk.internal.vm.annotations are permitted for classes // defined to boot loader and platform loader diff --git a/src/java.base/share/classes/java/lang/invoke/NativeMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/NativeMethodHandle.java index 4d09b96775dd7..35cc610dad15e 100644 --- a/src/java.base/share/classes/java/lang/invoke/NativeMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/NativeMethodHandle.java @@ -108,7 +108,7 @@ private static LambdaForm makePreparedLambdaForm(MethodType mtype) { final int GET_NEP = nameCursor++; final int LINKER_CALL = nameCursor++; - LambdaForm.Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType()); + LambdaForm.Name[] names = invokeArguments(nameCursor - ARG_LIMIT, mtype); assert (names.length == nameCursor); names[GET_NEP] = new LambdaForm.Name(Lazy.NF_internalNativeEntryPoint, names[NMH_THIS]); diff --git a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java index ab429899d30f8..4fbbec1769364 100644 --- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -51,7 +51,6 @@ import java.lang.ref.SoftReference; import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Consumer; import java.util.function.Supplier; @@ -1353,7 +1352,7 @@ public void accept(MethodBuilder mb) { } }}); try { - var hiddenClass = lookup.makeHiddenClassDefiner(CLASS_NAME, classBytes, Set.of(), DUMPER) + var hiddenClass = lookup.makeHiddenClassDefiner(CLASS_NAME, classBytes, DUMPER) .defineClass(true, null); if (staticConcat) { diff --git a/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java b/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java index 52580a4b82173..cc1bcd7dfddfd 100644 --- a/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java +++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -47,8 +47,8 @@ * * As defined by The Java Language Specification * section {@jls 9.7.4}, an annotation on an element is a - * declaration annotation and an annotation on a type is a - * type annotation. + * {@index "declaration annotation"} and an annotation on a type is a + * {@index "type annotation"}. * * Note that any annotations returned by methods on the {@link * AnnotatedType AnnotatedType} interface and its subinterfaces are @@ -78,21 +78,21 @@ * *

    * - *
  • An annotation A is directly present on an + *
  • An annotation A is {@index "directly present"} on an * element E if E has a {@code * RuntimeVisibleAnnotations} or {@code * RuntimeVisibleParameterAnnotations} or {@code * RuntimeVisibleTypeAnnotations} attribute, and the attribute * contains A. * - *
  • An annotation A is indirectly present on an + *
  • An annotation A is {@index "indirectly present"} on an * element E if E has a {@code RuntimeVisibleAnnotations} or * {@code RuntimeVisibleParameterAnnotations} or {@code RuntimeVisibleTypeAnnotations} * attribute, and A 's type is repeatable, and the attribute contains * exactly one annotation whose value element contains A and whose * type is the containing annotation type of A 's type. * - *
  • An annotation A is present on an element E if either: + *
  • An annotation A is {@index "present"} on an element E if either: * *
      * @@ -104,7 +104,7 @@ * *
    * - *
  • An annotation A is associated with an element E + *
  • An annotation A is {@index "associated"} with an element E * if either: * *
      diff --git a/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java b/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java index 2e56d03c6ad89..abdcaf5ae1fa2 100644 --- a/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java +++ b/src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java @@ -114,11 +114,18 @@ final class ProxyGenerator { private static final Method OBJECT_EQUALS_METHOD; private static final Method OBJECT_TO_STRING_METHOD; + private static final String OBJECT_HASH_CODE_SIG; + private static final String OBJECT_EQUALS_SIG; + private static final String OBJECT_TO_STRING_SIG; + static { try { OBJECT_HASH_CODE_METHOD = Object.class.getMethod("hashCode"); + OBJECT_HASH_CODE_SIG = OBJECT_HASH_CODE_METHOD.toShortSignature(); OBJECT_EQUALS_METHOD = Object.class.getMethod("equals", Object.class); + OBJECT_EQUALS_SIG = OBJECT_EQUALS_METHOD.toShortSignature(); OBJECT_TO_STRING_METHOD = Object.class.getMethod("toString"); + OBJECT_TO_STRING_SIG = OBJECT_TO_STRING_METHOD.toShortSignature(); } catch (NoSuchMethodException e) { throw new NoSuchMethodError(e.getMessage()); } @@ -446,9 +453,9 @@ private byte[] generateClassFile() { * java.lang.Object take precedence over duplicate methods in the * proxy interfaces. */ - addProxyMethod(new ProxyMethod(OBJECT_HASH_CODE_METHOD, "m0")); - addProxyMethod(new ProxyMethod(OBJECT_EQUALS_METHOD, "m1")); - addProxyMethod(new ProxyMethod(OBJECT_TO_STRING_METHOD, "m2")); + addProxyMethod(new ProxyMethod(OBJECT_HASH_CODE_METHOD, OBJECT_HASH_CODE_SIG, "m0")); + addProxyMethod(new ProxyMethod(OBJECT_EQUALS_METHOD, OBJECT_EQUALS_SIG, "m1")); + addProxyMethod(new ProxyMethod(OBJECT_TO_STRING_METHOD, OBJECT_TO_STRING_SIG, "m2")); /* * Accumulate all of the methods from the proxy interfaces. @@ -526,7 +533,7 @@ private void addProxyMethod(Method m, Class fromClass) { return; } } - sigmethods.add(new ProxyMethod(m, sig, m.getSharedParameterTypes(), returnType, + sigmethods.add(new ProxyMethod(m, sig, returnType, exceptionTypes, fromClass, "m" + proxyMethodCount++)); } @@ -617,11 +624,11 @@ private void generateLookupAccessor(ClassBuilder clb) { Label failLabel = cob.newLabel(); ClassEntry mhl = cp.classEntry(CD_MethodHandles_Lookup); ClassEntry iae = cp.classEntry(CD_IllegalAccessException); - cob.aload(cob.parameterSlot(0)) + cob.aload(0) .invokevirtual(cp.methodRefEntry(mhl, cp.nameAndTypeEntry("lookupClass", MTD_Class))) .ldc(proxyCE) .if_acmpne(failLabel) - .aload(cob.parameterSlot(0)) + .aload(0) .invokevirtual(cp.methodRefEntry(mhl, cp.nameAndTypeEntry("hasFullPrivilegeAccess", MTD_boolean))) .ifeq(failLabel) .invokestatic(CD_MethodHandles, "lookup", MTD_MethodHandles$Lookup) @@ -629,7 +636,7 @@ private void generateLookupAccessor(ClassBuilder clb) { .labelBinding(failLabel) .new_(iae) .dup() - .aload(cob.parameterSlot(0)) + .aload(0) .invokevirtual(cp.methodRefEntry(mhl, cp.nameAndTypeEntry("toString", MTD_String))) .invokespecial(cp.methodRefEntry(iae, exInit)) .athrow() @@ -650,18 +657,16 @@ private class ProxyMethod { private final Method method; private final String shortSignature; private final Class fromClass; - private final Class[] parameterTypes; private final Class returnType; private final String methodFieldName; private Class[] exceptionTypes; private final FieldRefEntry methodField; - private ProxyMethod(Method method, String sig, Class[] parameterTypes, + private ProxyMethod(Method method, String sig, Class returnType, Class[] exceptionTypes, Class fromClass, String methodFieldName) { this.method = method; this.shortSignature = sig; - this.parameterTypes = parameterTypes; this.returnType = returnType; this.exceptionTypes = exceptionTypes; this.fromClass = fromClass; @@ -670,14 +675,17 @@ private ProxyMethod(Method method, String sig, Class[] parameterTypes, cp.nameAndTypeEntry(methodFieldName, CD_Method)); } + private Class[] parameterTypes() { + return method.getSharedParameterTypes(); + } + /** * Create a new specific ProxyMethod with a specific field name * * @param method The method for which to create a proxy */ - private ProxyMethod(Method method, String methodFieldName) { - this(method, method.toShortSignature(), - method.getSharedParameterTypes(), method.getReturnType(), + private ProxyMethod(Method method, String sig, String methodFieldName) { + this(method, sig, method.getReturnType(), method.getSharedExceptionTypes(), method.getDeclaringClass(), methodFieldName); } @@ -685,17 +693,18 @@ private ProxyMethod(Method method, String methodFieldName) { * Generate this method, including the code and exception table entry. */ private void generateMethod(ClassBuilder clb) { - var desc = methodTypeDesc(returnType, parameterTypes); + var desc = methodTypeDesc(returnType, parameterTypes()); int accessFlags = (method.isVarArgs()) ? ACC_VARARGS | ACC_PUBLIC | ACC_FINAL : ACC_PUBLIC | ACC_FINAL; - var catchList = computeUniqueCatchList(exceptionTypes); clb.withMethod(method.getName(), desc, accessFlags, mb -> mb.with(ExceptionsAttribute.of(toClassEntries(cp, List.of(exceptionTypes)))) .withCode(cob -> { + var catchList = computeUniqueCatchList(exceptionTypes); cob.aload(cob.receiverSlot()) .getfield(handlerField) .aload(cob.receiverSlot()) .getstatic(methodField); + Class[] parameterTypes = parameterTypes(); if (parameterTypes.length > 0) { // Create an array and fill with the parameters converting primitives to wrappers cob.loadConstant(parameterTypes.length) @@ -784,6 +793,7 @@ private void codeFieldInitialization(CodeBuilder cob) { var cp = cob.constantPool(); codeClassForName(cob, fromClass); + Class[] parameterTypes = parameterTypes(); cob.ldc(method.getName()) .loadConstant(parameterTypes.length) .anewarray(classCE); @@ -817,10 +827,14 @@ private void codeFieldInitialization(CodeBuilder cob) { * loader is anticipated at local variable index 0. */ private void codeClassForName(CodeBuilder cob, Class cl) { - cob.ldc(cl.getName()) - .iconst_0() // false - .aload(0)// classLoader - .invokestatic(classForName); + if (cl == Object.class) { + cob.ldc(objectCE); + } else { + cob.ldc(cl.getName()) + .iconst_0() // false + .aload(0)// classLoader + .invokestatic(classForName); + } } @Override diff --git a/src/java.base/share/classes/java/net/HttpURLConnection.java b/src/java.base/share/classes/java/net/HttpURLConnection.java index b405fb10a1655..625fd30424eea 100644 --- a/src/java.base/share/classes/java/net/HttpURLConnection.java +++ b/src/java.base/share/classes/java/net/HttpURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2024, 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 @@ -373,8 +373,7 @@ protected HttpURLConnection (URL u) { /** * Sets whether HTTP redirects (requests with response code 3xx) should - * be automatically followed by this class. True by default. Applets - * cannot change this variable. + * be automatically followed by this class. True by default. *

      * If there is a security manager, this method first calls * the security manager's {@code checkSetFactory} method diff --git a/src/java.base/share/classes/java/net/NetworkInterface.java b/src/java.base/share/classes/java/net/NetworkInterface.java index f2d039d2502a2..90e52527b63d1 100644 --- a/src/java.base/share/classes/java/net/NetworkInterface.java +++ b/src/java.base/share/classes/java/net/NetworkInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -35,12 +35,43 @@ import java.util.stream.StreamSupport; /** - * This class represents a Network Interface made up of a name, - * and a list of IP addresses assigned to this interface. - * It is used to identify the local interface on which a multicast group - * is joined. + * This class represents a Network Interface. + *

      + * A Network Interface is an abstraction encapsulating + * the characteristics of a Network Interface Controller, or + * Virtual Network adapter, which is a system hardware/software + * component connecting a computer, or host system, to a computer + * network. A Network Interface can be physical or virtual. + * A Network Interface has a name, zero or more assigned + * {@linkplain InetAddress IP addresses}, zero or more {@linkplain + * InterfaceAddress MAC Addresses}, and may have an index. + * The name is highly platform specific but a name such as "le0" + * is typical; it may not be unique. The index is a highly platform + * specific number that identifies the interface. The network + * configuration may change during the lifetime of the JVM. + * For example, the set of IP addresses assigned to a network + * interface can be transient and dynamically allocated, and may + * change at any time. + *

      + * When obtaining a {@code NetworkInterface} instance, part of its + * configuration (such as its name and the list of assigned IP addresses), + * is reflective of its configuration at creation time. + * Obtaining an updated view of the network configuration may require + * looking up a network interface again in order to obtain a new instance. + *

      + * Network interface instances are typically used to identify the local + * interface on which a multicast group is joined. * - * Interfaces are normally known by names such as "le0". + * @apiNote Several static methods in this class are + * factory methods, returning a new instance of a {@code NetworkInterface}, + * reflecting the configuration at the time of instantiation. + * The network configuration may change at any time, and as such, + * these methods may need to be invoked again in order to obtain + * a more up-to-date view of the network interfaces. + * In particular, there is no guarantee that the same interface will be + * found at the same index, or that the same network addresses will be + * bound to the interface, if the network configuration of the system + * has changed. * * @since 1.4 */ @@ -87,7 +118,7 @@ public String getName() { } /** - * Get an Enumeration with all or a subset of the InetAddresses bound to + * Get an Enumeration with all, or a subset, of the InetAddresses bound to * this network interface. *

      * If there is a security manager, its {@code checkConnect} @@ -97,7 +128,12 @@ public String getName() { * {@link NetPermission}("getNetworkInformation") permission, then all * InetAddresses are returned. * - * @return an Enumeration object with all or a subset of the InetAddresses + * @implNote + * The returned enumeration contains all, or a subset, of the InetAddresses that were + * bound to the interface at the time the {@linkplain #getNetworkInterfaces() + * interface configuration was read} + * + * @return an Enumeration object with all, or a subset, of the InetAddresses * bound to this network interface * @see #inetAddresses() */ @@ -106,7 +142,7 @@ public Enumeration getInetAddresses() { } /** - * Get a Stream of all or a subset of the InetAddresses bound to this + * Get a Stream of all, or a subset, of the InetAddresses bound to this * network interface. *

      * If there is a security manager, its {@code checkConnect} @@ -116,7 +152,12 @@ public Enumeration getInetAddresses() { * {@link NetPermission}("getNetworkInformation") permission, then all * InetAddresses are returned. * - * @return a Stream object with all or a subset of the InetAddresses + * @implNote + * The stream contains all, or a subset, of the InetAddresses that were + * bound to the interface at the time the {@linkplain #getNetworkInterfaces() + * interface configuration was read} + * + * @return a Stream object with all, or a subset, of the InetAddresses * bound to this network interface * @since 9 */ @@ -150,7 +191,7 @@ private InetAddress[] getCheckedInetAddresses() { } /** - * Get a List of all or a subset of the {@code InterfaceAddresses} + * Get a List of all, or a subset, of the {@code InterfaceAddresses} * of this network interface. *

      * If there is a security manager, its {@code checkConnect} @@ -158,7 +199,7 @@ private InetAddress[] getCheckedInetAddresses() { * Only InterfaceAddresses where the {@code checkConnect} doesn't throw * a SecurityException will be returned in the List. * - * @return a {@code List} object with all or a subset of the + * @return a {@code List} object with all, or a subset, of the * InterfaceAddress of this network interface * @since 1.6 */ @@ -249,6 +290,12 @@ public String getDisplayName() { /** * Searches for the network interface with the specified name. * + * @apiNote + * The returned interface instance may reflect a snapshot of the + * configuration taken at the time the instance is created. + * See the general discussion of {@linkplain NetworkInterface##lookup + * snapshots and configuration} for the semantics of the returned interface. + * * @param name * The name of the network interface. * @@ -271,6 +318,12 @@ public static NetworkInterface getByName(String name) throws SocketException { /** * Get a network interface given its index. * + * @apiNote + * The returned interface instance may reflect a snapshot of the + * configuration taken at the time the instance is created. + * See the general discussion of {@linkplain NetworkInterface##lookup + * snapshots and configuration} for the semantics of the returned interface. + * * @param index an integer, the index of the interface * @return the NetworkInterface obtained from its index, or {@code null} if * there is no interface with such an index on the system @@ -294,6 +347,12 @@ public static NetworkInterface getByIndex(int index) throws SocketException { * interfaces it is not defined which network interface is * returned. * + * @apiNote + * The returned interface instance may reflect a snapshot of the + * configuration taken at the time the instance is created. + * See the general discussion of {@linkplain NetworkInterface##lookup + * snapshots and configuration} for the semantics of the returned interface. + * * @param addr * The {@code InetAddress} to search with. * @@ -334,8 +393,14 @@ public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketE * a loopback interface that only supports communication between entities on * this machine. * - * @apiNote this method can be used in combination with - * {@link #getInetAddresses()} to obtain all IP addresses for this node + * @apiNote + * This method can be used in combination with + * {@link #getInetAddresses()} to obtain all IP addresses for this node. + *

      + * The returned interface instances may reflect a snapshot of the + * configuration taken at the time the instance is created. + * See the general discussion of {@linkplain NetworkInterface##lookup + * snapshots and configuration} for the semantics of the returned interface. * * @return an Enumeration of NetworkInterfaces found on this machine * @throws SocketException if an I/O error occurs, @@ -359,13 +424,18 @@ public static Enumeration getNetworkInterfaces() * loopback interface that only supports communication between entities on * this machine. * - * @apiNote this method can be used in combination with + * @apiNote This method can be used in combination with * {@link #inetAddresses()}} to obtain a stream of all IP addresses for * this node, for example: *

       {@code
            * Stream addrs = NetworkInterface.networkInterfaces()
            *     .flatMap(NetworkInterface::inetAddresses);
            * }
      + *

      + * The returned interface instances may reflect a snapshot of the + * configuration taken at the time the instance is created. + * See the general discussion of {@linkplain NetworkInterface##lookup + * snapshots and configuration} for the semantics of the returned interface. * * @return a Stream of NetworkInterfaces found on this machine * @throws SocketException if an I/O error occurs, diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java index 23c225fbb2d29..309fa7a80d099 100644 --- a/src/java.base/share/classes/java/net/Socket.java +++ b/src/java.base/share/classes/java/net/Socket.java @@ -27,6 +27,7 @@ import jdk.internal.event.SocketReadEvent; import jdk.internal.event.SocketWriteEvent; +import jdk.internal.invoke.MhUtil; import sun.security.util.SecurityConstants; import java.io.InputStream; @@ -102,14 +103,10 @@ public class Socket implements java.io.Closeable { private static final VarHandle STATE, IN, OUT; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - STATE = l.findVarHandle(Socket.class, "state", int.class); - IN = l.findVarHandle(Socket.class, "in", InputStream.class); - OUT = l.findVarHandle(Socket.class, "out", OutputStream.class); - } catch (Exception e) { - throw new InternalError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + STATE = MhUtil.findVarHandle(l, "state", int.class); + IN = MhUtil.findVarHandle(l, "in", InputStream.class); + OUT = MhUtil.findVarHandle(l, "out", OutputStream.class); } // the underlying SocketImpl, may be null, may be swapped when connecting diff --git a/src/java.base/share/classes/java/nio/Buffer.java b/src/java.base/share/classes/java/nio/Buffer.java index 7bfcbea9639d7..828ae417f79ec 100644 --- a/src/java.base/share/classes/java/nio/Buffer.java +++ b/src/java.base/share/classes/java/nio/Buffer.java @@ -27,6 +27,7 @@ import jdk.internal.access.JavaNioAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.access.foreign.MappedMemoryUtilsProxy; import jdk.internal.access.foreign.UnmapperProxy; import jdk.internal.foreign.AbstractMemorySegmentImpl; import jdk.internal.foreign.MemorySessionImpl; @@ -804,6 +805,7 @@ final void checkSession() { } static { + // setup access to this package in SharedSecrets SharedSecrets.setJavaNioAccess( new JavaNioAccess() { @@ -886,23 +888,8 @@ public boolean hasSession(Buffer buffer) { } @Override - public void force(FileDescriptor fd, long address, boolean isSync, long offset, long size) { - MappedMemoryUtils.force(fd, address, isSync, offset, size); - } - - @Override - public void load(long address, boolean isSync, long size) { - MappedMemoryUtils.load(address, isSync, size); - } - - @Override - public void unload(long address, boolean isSync, long size) { - MappedMemoryUtils.unload(address, isSync, size); - } - - @Override - public boolean isLoaded(long address, boolean isSync, long size) { - return MappedMemoryUtils.isLoaded(address, isSync, size); + public MappedMemoryUtilsProxy mappedMemoryUtils() { + return MappedMemoryUtils.PROXY; } @Override diff --git a/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/src/java.base/share/classes/java/nio/MappedByteBuffer.java index d560d3843d23b..9c1f21c73702b 100644 --- a/src/java.base/share/classes/java/nio/MappedByteBuffer.java +++ b/src/java.base/share/classes/java/nio/MappedByteBuffer.java @@ -31,6 +31,7 @@ import java.lang.ref.Reference; import java.util.Objects; +import jdk.internal.access.foreign.MappedMemoryUtilsProxy; import jdk.internal.access.foreign.UnmapperProxy; import jdk.internal.misc.ScopedMemoryAccess; import jdk.internal.misc.Unsafe; @@ -194,7 +195,7 @@ public final boolean isLoaded() { if (fd == null) { return true; } - return SCOPED_MEMORY_ACCESS.isLoaded(session(), address, isSync, capacity()); + return SCOPED_MEMORY_ACCESS.isLoaded(session(), MappedMemoryUtils.PROXY, address, isSync, capacity()); } /** @@ -212,7 +213,7 @@ public final MappedByteBuffer load() { return this; } try { - SCOPED_MEMORY_ACCESS.load(session(), address, isSync, capacity()); + SCOPED_MEMORY_ACCESS.load(session(), MappedMemoryUtils.PROXY, address, isSync, capacity()); } finally { Reference.reachabilityFence(this); } @@ -312,7 +313,7 @@ public final MappedByteBuffer force(int index, int length) { if ((address != 0) && (capacity != 0)) { // check inputs Objects.checkFromIndexSize(index, length, capacity); - SCOPED_MEMORY_ACCESS.force(session(), fd, address, isSync, index, length); + SCOPED_MEMORY_ACCESS.force(session(), MappedMemoryUtils.PROXY, fd, address, isSync, index, length); } return this; } diff --git a/src/java.base/share/classes/java/nio/MappedMemoryUtils.java b/src/java.base/share/classes/java/nio/MappedMemoryUtils.java index 241ac6b59e7e2..d0ec627f81764 100644 --- a/src/java.base/share/classes/java/nio/MappedMemoryUtils.java +++ b/src/java.base/share/classes/java/nio/MappedMemoryUtils.java @@ -28,6 +28,8 @@ import java.io.FileDescriptor; import java.io.IOException; import java.io.UncheckedIOException; + +import jdk.internal.access.foreign.MappedMemoryUtilsProxy; import jdk.internal.misc.Blocker; import jdk.internal.misc.Unsafe; @@ -125,7 +127,6 @@ static void force(FileDescriptor fd, long address, boolean isSync, long index, l private static native void registerNatives(); static { registerNatives(); - isLoaded0(0, 0, 0); } // utility methods @@ -176,4 +177,26 @@ private static long alignDown(long address, int pageSize) { // pageSize must be a power of 2 return address & ~(pageSize - 1); } + + static final MappedMemoryUtilsProxy PROXY = new MappedMemoryUtilsProxy() { + @Override + public boolean isLoaded(long address, boolean isSync, long size) { + return MappedMemoryUtils.isLoaded(address, isSync, size); + } + + @Override + public void load(long address, boolean isSync, long size) { + MappedMemoryUtils.load(address, isSync, size); + } + + @Override + public void unload(long address, boolean isSync, long size) { + MappedMemoryUtils.unload(address, isSync, size); + } + + @Override + public void force(FileDescriptor fd, long address, boolean isSync, long index, long length) { + MappedMemoryUtils.force(fd, address, isSync, index, length); + } + }; } diff --git a/src/java.base/share/classes/java/nio/channels/SelectionKey.java b/src/java.base/share/classes/java/nio/channels/SelectionKey.java index ca6df2a7aa054..79029e6365353 100644 --- a/src/java.base/share/classes/java/nio/channels/SelectionKey.java +++ b/src/java.base/share/classes/java/nio/channels/SelectionKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -25,6 +25,8 @@ package java.nio.channels; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -429,15 +431,9 @@ public final boolean isAcceptable() { // -- Attachments -- - private static final VarHandle ATTACHMENT; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - ATTACHMENT = l.findVarHandle(SelectionKey.class, "attachment", Object.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle ATTACHMENT = MhUtil.findVarHandle( + MethodHandles.lookup(), "attachment", Object.class); + private volatile Object attachment; /** diff --git a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectionKey.java b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectionKey.java index 0a79ca321dd33..3005fc9522c64 100644 --- a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectionKey.java +++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelectionKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -30,6 +30,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.Selector; +import jdk.internal.invoke.MhUtil; import sun.nio.ch.SelectionKeyImpl; import sun.nio.ch.SelectorImpl; @@ -46,15 +47,8 @@ public abstract class AbstractSelectionKey extends SelectionKey { - private static final VarHandle INVALID; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - INVALID = l.findVarHandle(AbstractSelectionKey.class, "invalid", boolean.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle INVALID = MhUtil.findVarHandle( + MethodHandles.lookup(), "invalid", boolean.class); /** * Initializes a new instance of this class. diff --git a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java index 7ea5f89221834..71dc8620eb804 100644 --- a/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java +++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractSelector.java @@ -32,6 +32,8 @@ import java.nio.channels.Selector; import java.util.HashSet; import java.util.Set; + +import jdk.internal.invoke.MhUtil; import sun.nio.ch.Interruptible; import sun.nio.ch.SelectorImpl; @@ -72,15 +74,9 @@ public abstract class AbstractSelector extends Selector { - private static final VarHandle CLOSED; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - CLOSED = l.findVarHandle(AbstractSelector.class, "closed", boolean.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle CLOSED = MhUtil.findVarHandle( + MethodHandles.lookup(), "closed", boolean.class); + private volatile boolean closed; // The provider that created this selector diff --git a/src/java.base/share/classes/java/nio/charset/MalformedInputException.java b/src/java.base/share/classes/java/nio/charset/MalformedInputException.java index 37e20040dd554..c36f81f9153d9 100644 --- a/src/java.base/share/classes/java/nio/charset/MalformedInputException.java +++ b/src/java.base/share/classes/java/nio/charset/MalformedInputException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -56,16 +56,14 @@ public MalformedInputException(int inputLength) { } /** - * Returns the length of the input. - * @return the length of the input + * {@return the length of the input} */ public int getInputLength() { return inputLength; } /** - * Returns the message. - * @return the message + * {@return the message} */ public String getMessage() { return "Input length = " + inputLength; diff --git a/src/java.base/share/classes/java/nio/charset/UnmappableCharacterException.java b/src/java.base/share/classes/java/nio/charset/UnmappableCharacterException.java index c5fddd1684fd1..857c519974d7c 100644 --- a/src/java.base/share/classes/java/nio/charset/UnmappableCharacterException.java +++ b/src/java.base/share/classes/java/nio/charset/UnmappableCharacterException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, 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 @@ -56,16 +56,14 @@ public UnmappableCharacterException(int inputLength) { } /** - * Returns the length of the input. - * @return the length of the input + * {@return the length of the input} */ public int getInputLength() { return inputLength; } /** - * Returns the message. - * @return the message + * {@return the message} */ public String getMessage() { return "Input length = " + inputLength; diff --git a/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java b/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java index 87ff0d07854ef..11d36ee242d56 100644 --- a/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/src/java.base/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -36,7 +36,7 @@ * zero-argument constructor and some number of associated charset * implementation classes. Charset providers may be installed in an instance * of the Java platform as extensions. Providers may also be made available by - * adding them to the applet or application class path or by some other + * adding them to the application class path or by some other * platform-specific means. Charset providers are looked up via the current * thread's {@link java.lang.Thread#getContextClassLoader() context class * loader}. diff --git a/src/java.base/share/classes/java/nio/file/Path.java b/src/java.base/share/classes/java/nio/file/Path.java index 6a47e1ba82bb1..a461152803be6 100644 --- a/src/java.base/share/classes/java/nio/file/Path.java +++ b/src/java.base/share/classes/java/nio/file/Path.java @@ -803,8 +803,8 @@ default Path resolveSibling(String other) { * "{@code ..}" (or equivalent) is preceded by a non-"{@code ..}" name then * an implementation will typically cause both names to be removed. When * not resolving symbolic links and the preceding name is a symbolic link - * then the names are only removed if it guaranteed that the resulting path - * will locate the same file as this path. + * then the names are only removed if it is guaranteed that the resulting + * path will locate the same file as this path. * * @param options * options indicating how symbolic links are handled diff --git a/src/java.base/share/classes/java/security/Policy.java b/src/java.base/share/classes/java/security/Policy.java index 838366b7e3862..37f7cc3d9a686 100644 --- a/src/java.base/share/classes/java/security/Policy.java +++ b/src/java.base/share/classes/java/security/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -896,5 +896,15 @@ public UnsupportedEmptyCollection() { @Override public Enumeration elements() { return perms.elements(); } + + /** + * If this object is readonly, no new objects can be added to it using {@code add}. + * + * @return {@code true} if this object is marked as readonly, {@code false} otherwise. + */ + @Override + public boolean isReadOnly() { + return perms.isReadOnly(); + } } } diff --git a/src/java.base/share/classes/java/security/Security.java b/src/java.base/share/classes/java/security/Security.java index 0cdd22340dfbf..6628b717eb073 100644 --- a/src/java.base/share/classes/java/security/Security.java +++ b/src/java.base/share/classes/java/security/Security.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2024, 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 @@ -25,22 +25,39 @@ package java.security; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.net.MalformedURLException; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.io.*; +import java.net.URI; import java.net.URL; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jdk.internal.access.JavaSecurityPropertiesAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.event.EventHelper; import jdk.internal.event.SecurityPropertyModificationEvent; -import jdk.internal.access.SharedSecrets; import jdk.internal.util.StaticProperty; +import sun.security.jca.GetInstance; +import sun.security.jca.ProviderList; +import sun.security.jca.Providers; import sun.security.util.Debug; import sun.security.util.PropertyExpander; -import sun.security.jca.*; - /** *

      This class centralizes all security properties and common security * methods. One of its primary uses is to manage providers. @@ -63,7 +80,17 @@ public final class Security { Debug.getInstance("properties"); /* The java.security properties */ - private static Properties props; + private static final Properties props = new Properties() { + @Override + public synchronized Object put(Object key, Object val) { + if (key instanceof String strKey && val instanceof String strVal && + SecPropLoader.isInclude(strKey)) { + SecPropLoader.loadInclude(strVal); + return null; + } + return super.put(key, val); + } + }; /* cache a copy for recording purposes */ private static Properties initialSecurityProperties; @@ -74,11 +101,220 @@ private static class ProviderProperty { Provider provider; } + private static final class SecPropLoader { + private enum LoadingMode {OVERRIDE, APPEND} + + private static final String OVERRIDE_SEC_PROP = + "security.overridePropertiesFile"; + + private static final String EXTRA_SYS_PROP = + "java.security.properties"; + + private static Path currentPath; + + private static final Set activePaths = new HashSet<>(); + + static void loadAll() { + // first load the master properties file to + // determine the value of OVERRIDE_SEC_PROP + loadMaster(); + loadExtra(); + } + + static boolean isInclude(String key) { + return "include".equals(key); + } + + static void checkReservedKey(String key) + throws IllegalArgumentException { + if (isInclude(key)) { + throw new IllegalArgumentException("Key '" + key + + "' is reserved and cannot be used as a " + + "Security property name."); + } + } + + private static void loadMaster() { + try { + loadFromPath(Path.of(StaticProperty.javaHome(), "conf", + "security", "java.security"), LoadingMode.APPEND); + } catch (IOException e) { + throw new InternalError("Error loading java.security file", e); + } + } + + private static void loadExtra() { + if ("true".equalsIgnoreCase(props.getProperty(OVERRIDE_SEC_PROP))) { + String propFile = System.getProperty(EXTRA_SYS_PROP); + if (propFile != null) { + LoadingMode mode = LoadingMode.APPEND; + if (propFile.startsWith("=")) { + mode = LoadingMode.OVERRIDE; + propFile = propFile.substring(1); + } + try { + loadExtraHelper(propFile, mode); + } catch (Exception e) { + if (sdebug != null) { + sdebug.println("unable to load security " + + "properties from " + propFile); + e.printStackTrace(); + } + } + } + } + } + + private static void loadExtraHelper(String propFile, LoadingMode mode) + throws Exception { + propFile = PropertyExpander.expand(propFile); + if (propFile.isEmpty()) { + throw new IOException("Empty extra properties file path"); + } + + // Try to interpret propFile as a path + Exception error; + if ((error = loadExtraFromPath(propFile, mode)) == null) { + return; + } + + // Try to interpret propFile as a file URL + URI uri = null; + try { + uri = new URI(propFile); + } catch (Exception ignore) {} + if (uri != null && "file".equalsIgnoreCase(uri.getScheme()) && + (error = loadExtraFromFileUrl(uri, mode)) == null) { + return; + } + + // Try to interpret propFile as a URL + URL url; + try { + url = newURL(propFile); + } catch (MalformedURLException ignore) { + // URL has no scheme: previous error is more accurate + throw error; + } + loadFromUrl(url, mode); + } + + private static Exception loadExtraFromPath(String propFile, + LoadingMode mode) throws Exception { + Path path; + try { + path = Path.of(propFile); + if (!Files.exists(path)) { + return new FileNotFoundException(propFile); + } + } catch (InvalidPathException e) { + return e; + } + loadFromPath(path, mode); + return null; + } + + + private static Exception loadExtraFromFileUrl(URI uri, LoadingMode mode) + throws Exception { + Path path; + try { + path = Path.of(uri); + } catch (Exception e) { + return e; + } + loadFromPath(path, mode); + return null; + } + + private static void reset(LoadingMode mode) { + if (mode == LoadingMode.OVERRIDE) { + if (sdebug != null) { + sdebug.println( + "overriding other security properties files!"); + } + props.clear(); + } + } + + static void loadInclude(String propFile) { + String expPropFile = PropertyExpander.expandNonStrict(propFile); + if (sdebug != null) { + sdebug.println("processing include: '" + propFile + "'" + + (propFile.equals(expPropFile) ? "" : + " (expanded to '" + expPropFile + "')")); + } + try { + Path path = Path.of(expPropFile); + if (!path.isAbsolute()) { + if (currentPath == null) { + throw new InternalError("Cannot resolve '" + + expPropFile + "' relative path when included " + + "from a non-regular properties file " + + "(e.g. HTTP served file)"); + } + path = currentPath.resolveSibling(path); + } + loadFromPath(path, LoadingMode.APPEND); + } catch (IOException | InvalidPathException e) { + throw new InternalError("Unable to include '" + expPropFile + + "'", e); + } + } + + private static void loadFromPath(Path path, LoadingMode mode) + throws IOException { + boolean isRegularFile = Files.isRegularFile(path); + if (isRegularFile) { + path = path.toRealPath(); + } else if (Files.isDirectory(path)) { + throw new IOException("Is a directory"); + } else { + path = path.toAbsolutePath(); + } + if (activePaths.contains(path)) { + throw new InternalError("Cyclic include of '" + path + "'"); + } + try (InputStream is = Files.newInputStream(path)) { + reset(mode); + Path previousPath = currentPath; + currentPath = isRegularFile ? path : null; + activePaths.add(path); + try { + debugLoad(true, path); + props.load(is); + debugLoad(false, path); + } finally { + activePaths.remove(path); + currentPath = previousPath; + } + } + } + + private static void loadFromUrl(URL url, LoadingMode mode) + throws IOException { + try (InputStream is = url.openStream()) { + reset(mode); + debugLoad(true, url); + props.load(is); + debugLoad(false, url); + } + } + + private static void debugLoad(boolean start, Object source) { + if (sdebug != null) { + int level = activePaths.isEmpty() ? 1 : activePaths.size(); + sdebug.println((start ? + ">".repeat(level) + " starting to process " : + "<".repeat(level) + " finished processing ") + source); + } + } + } + static { // doPrivileged here because there are multiple // things in initialize that might require privs. - // (the FileInputStream call and the File.exists call, - // the securityPropFile call, etc) + // (the FileInputStream call and the File.exists call, etc) @SuppressWarnings("removal") var dummy = AccessController.doPrivileged((PrivilegedAction) () -> { initialize(); @@ -94,28 +330,7 @@ public Properties getInitialProperties() { } private static void initialize() { - props = new Properties(); - boolean overrideAll = false; - - // first load the system properties file - // to determine the value of security.overridePropertiesFile - File propFile = securityPropFile("java.security"); - boolean success = loadProps(propFile, null, false); - if (!success) { - throw new InternalError("Error loading java.security file"); - } - - if ("true".equalsIgnoreCase(props.getProperty - ("security.overridePropertiesFile"))) { - - String extraPropFile = System.getProperty - ("java.security.properties"); - if (extraPropFile != null && extraPropFile.startsWith("=")) { - overrideAll = true; - extraPropFile = extraPropFile.substring(1); - } - loadProps(null, extraPropFile, overrideAll); - } + SecPropLoader.loadAll(); initialSecurityProperties = (Properties) props.clone(); if (sdebug != null) { for (String key : props.stringPropertyNames()) { @@ -123,63 +338,6 @@ private static void initialize() { props.getProperty(key)); } } - - } - - private static boolean loadProps(File masterFile, String extraPropFile, boolean overrideAll) { - InputStream is = null; - try { - if (masterFile != null && masterFile.exists()) { - is = new FileInputStream(masterFile); - } else if (extraPropFile != null) { - extraPropFile = PropertyExpander.expand(extraPropFile); - File propFile = new File(extraPropFile); - URL propURL; - if (propFile.exists()) { - propURL = newURL - ("file:" + propFile.getCanonicalPath()); - } else { - propURL = newURL(extraPropFile); - } - - is = propURL.openStream(); - if (overrideAll) { - props = new Properties(); - if (sdebug != null) { - sdebug.println - ("overriding other security properties files!"); - } - } - } else { - // unexpected - return false; - } - props.load(is); - if (sdebug != null) { - // ExceptionInInitializerError if masterFile.getName() is - // called here (NPE!). Leave as is (and few lines down) - sdebug.println("reading security properties file: " + - masterFile == null ? extraPropFile : "java.security"); - } - return true; - } catch (IOException | PropertyExpander.ExpandException e) { - if (sdebug != null) { - sdebug.println("unable to load security properties from " + - masterFile == null ? extraPropFile : "java.security"); - e.printStackTrace(); - } - return false; - } finally { - if (is != null) { - try { - is.close(); - } catch (IOException ioe) { - if (sdebug != null) { - sdebug.println("unable to close input stream"); - } - } - } - } } /** @@ -188,14 +346,6 @@ private static boolean loadProps(File masterFile, String extraPropFile, boolean private Security() { } - private static File securityPropFile(String filename) { - // maybe check for a system property which will specify where to - // look. Someday. - String sep = File.separator; - return new File(StaticProperty.javaHome() + sep + "conf" + sep + - "security" + sep + filename); - } - /** * Looks up providers, and returns the property (and its associated * provider) mapping the key, if any. @@ -714,17 +864,16 @@ static Object[] getImpl(String algorithm, String type, Provider provider, * denies * access to retrieve the specified security property value * @throws NullPointerException if key is {@code null} + * @throws IllegalArgumentException if key is reserved and cannot be + * used as a Security property name. Reserved keys are: + * "include". * * @see #setProperty * @see java.security.SecurityPermission */ public static String getProperty(String key) { - @SuppressWarnings("removal") - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new SecurityPermission("getProperty."+ - key)); - } + SecPropLoader.checkReservedKey(key); + check("getProperty." + key); String name = props.getProperty(key); if (name != null) name = name.trim(); // could be a class name with trailing ws @@ -749,11 +898,15 @@ public static String getProperty(String key) { * java.lang.SecurityManager#checkPermission} method * denies access to set the specified security property value * @throws NullPointerException if key or datum is {@code null} + * @throws IllegalArgumentException if key is reserved and cannot be + * used as a Security property name. Reserved keys are: + * "include". * * @see #getProperty * @see java.security.SecurityPermission */ public static void setProperty(String key, String datum) { + SecPropLoader.checkReservedKey(key); check("setProperty." + key); props.put(key, datum); invalidateSMCache(key); /* See below. */ diff --git a/src/java.base/share/classes/java/time/format/TextStyle.java b/src/java.base/share/classes/java/time/format/TextStyle.java index ec49da271adc7..2a1f8b896cab4 100644 --- a/src/java.base/share/classes/java/time/format/TextStyle.java +++ b/src/java.base/share/classes/java/time/format/TextStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -137,8 +137,7 @@ public boolean isStandalone() { } /** - * Returns the stand-alone style with the same size. - * @return the stand-alone style with the same size + * {@return the stand-alone style with the same size} */ public TextStyle asStandalone() { return TextStyle.values()[ordinal() | 1]; diff --git a/src/java.base/share/classes/java/util/SplittableRandom.java b/src/java.base/share/classes/java/util/SplittableRandom.java index cb1801f56805d..686fe66da2f53 100644 --- a/src/java.base/share/classes/java/util/SplittableRandom.java +++ b/src/java.base/share/classes/java/util/SplittableRandom.java @@ -47,7 +47,7 @@ *
    • Series of generated values pass the DieHarder suite testing * independence and uniformity properties of random number generators. * (Most recently validated with version + * href="https://webhome.phy.duke.edu/~rgb/General/dieharder.php"> version * 3.31.1.) These tests validate only the methods for certain * types and ranges, but similar properties are expected to hold, at * least approximately, for others as well. The period diff --git a/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java b/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java index 8adfd106eebb4..d690494405085 100644 --- a/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java +++ b/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java @@ -35,6 +35,8 @@ package java.util.concurrent; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.concurrent.locks.LockSupport; @@ -3079,14 +3081,10 @@ static final class MinimalStage extends CompletableFuture { private static final VarHandle STACK; private static final VarHandle NEXT; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - RESULT = l.findVarHandle(CompletableFuture.class, "result", Object.class); - STACK = l.findVarHandle(CompletableFuture.class, "stack", Completion.class); - NEXT = l.findVarHandle(Completion.class, "next", Completion.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + RESULT = MhUtil.findVarHandle(l, "result", Object.class); + STACK = MhUtil.findVarHandle(l, "stack", Completion.class); + NEXT = MhUtil.findVarHandle(l, Completion.class, "next", Completion.class); // Reduce the risk of rare disastrous classloading in first call to // LockSupport.park: https://bugs.openjdk.org/browse/JDK-8074773 diff --git a/src/java.base/share/classes/java/util/concurrent/Exchanger.java b/src/java.base/share/classes/java/util/concurrent/Exchanger.java index 8674ea9af39bc..75de69b3e5283 100644 --- a/src/java.base/share/classes/java/util/concurrent/Exchanger.java +++ b/src/java.base/share/classes/java/util/concurrent/Exchanger.java @@ -36,6 +36,8 @@ package java.util.concurrent; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.concurrent.locks.LockSupport; @@ -530,15 +532,11 @@ public V exchange(V x, long timeout, TimeUnit unit) private static final VarHandle ENTRY; private static final VarHandle AA; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - BOUND = l.findVarHandle(Exchanger.class, "bound", int.class); - MATCH = l.findVarHandle(Node.class, "match", Object.class); - ENTRY = l.findVarHandle(Slot.class, "entry", Node.class); - AA = MethodHandles.arrayElementVarHandle(Slot[].class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + BOUND = MhUtil.findVarHandle(l, "bound", int.class); + MATCH = MhUtil.findVarHandle(l, Node.class, "match", Object.class); + ENTRY = MhUtil.findVarHandle(l, Slot.class, "entry", Node.class); + AA = MethodHandles.arrayElementVarHandle(Slot[].class); } } diff --git a/src/java.base/share/classes/java/util/concurrent/FutureTask.java b/src/java.base/share/classes/java/util/concurrent/FutureTask.java index 627e69559c856..b905e71aeef95 100644 --- a/src/java.base/share/classes/java/util/concurrent/FutureTask.java +++ b/src/java.base/share/classes/java/util/concurrent/FutureTask.java @@ -35,6 +35,8 @@ package java.util.concurrent; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.concurrent.locks.LockSupport; @@ -582,14 +584,10 @@ public String toString() { private static final VarHandle RUNNER; private static final VarHandle WAITERS; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - STATE = l.findVarHandle(FutureTask.class, "state", int.class); - RUNNER = l.findVarHandle(FutureTask.class, "runner", Thread.class); - WAITERS = l.findVarHandle(FutureTask.class, "waiters", WaitNode.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + STATE = MhUtil.findVarHandle(l, "state", int.class); + RUNNER = MhUtil.findVarHandle(l, "runner", Thread.class); + WAITERS = MhUtil.findVarHandle(l, "waiters", WaitNode.class); // Reduce the risk of rare disastrous classloading in first call to // LockSupport.park: https://bugs.openjdk.org/browse/JDK-8074773 diff --git a/src/java.base/share/classes/java/util/concurrent/Phaser.java b/src/java.base/share/classes/java/util/concurrent/Phaser.java index 22e2f663cb9a7..9cd2376d84714 100644 --- a/src/java.base/share/classes/java/util/concurrent/Phaser.java +++ b/src/java.base/share/classes/java/util/concurrent/Phaser.java @@ -35,6 +35,8 @@ package java.util.concurrent; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.concurrent.atomic.AtomicReference; @@ -1137,15 +1139,9 @@ public boolean block() { } // VarHandle mechanics - private static final VarHandle STATE; + private static final VarHandle STATE = MhUtil.findVarHandle( + MethodHandles.lookup(), "state", long.class); static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - STATE = l.findVarHandle(Phaser.class, "state", long.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - // Reduce the risk of rare disastrous classloading in first call to // LockSupport.park: https://bugs.openjdk.org/browse/JDK-8074773 Class ensureLoaded = LockSupport.class; diff --git a/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java b/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java index fdb0128b7a755..f51e356736dea 100644 --- a/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java @@ -53,6 +53,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; import jdk.internal.util.ArraysSupport; /** @@ -1093,15 +1094,8 @@ public void forEach(Consumer action) { } // VarHandle mechanics - private static final VarHandle ALLOCATIONSPINLOCK; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - ALLOCATIONSPINLOCK = l.findVarHandle(PriorityBlockingQueue.class, - "allocationSpinLock", - int.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle ALLOCATIONSPINLOCK = + MhUtil.findVarHandle( + MethodHandles.lookup(), "allocationSpinLock", int.class); + } diff --git a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java index 31b4cd6c6a613..edb2708934d90 100644 --- a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java +++ b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -37,6 +37,7 @@ import java.util.function.Supplier; import jdk.internal.javac.PreviewFeature; import jdk.internal.misc.ThreadFlock; +import jdk.internal.invoke.MhUtil; /** * A basic API for structured concurrency. {@code StructuredTaskScope} supports @@ -990,13 +991,9 @@ public static final class ShutdownOnSuccess extends StructuredTaskScope { private static final VarHandle FIRST_RESULT; private static final VarHandle FIRST_EXCEPTION; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - FIRST_RESULT = l.findVarHandle(ShutdownOnSuccess.class, "firstResult", Object.class); - FIRST_EXCEPTION = l.findVarHandle(ShutdownOnSuccess.class, "firstException", Throwable.class); - } catch (Exception e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + FIRST_RESULT = MhUtil.findVarHandle(l, "firstResult", Object.class); + FIRST_EXCEPTION = MhUtil.findVarHandle(l, "firstException", Throwable.class); } private volatile Object firstResult; private volatile Throwable firstException; @@ -1177,15 +1174,8 @@ public T result(Function esf) thro */ @PreviewFeature(feature = PreviewFeature.Feature.STRUCTURED_CONCURRENCY) public static final class ShutdownOnFailure extends StructuredTaskScope { - private static final VarHandle FIRST_EXCEPTION; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - FIRST_EXCEPTION = l.findVarHandle(ShutdownOnFailure.class, "firstException", Throwable.class); - } catch (Exception e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle FIRST_EXCEPTION = + MhUtil.findVarHandle(MethodHandles.lookup(), "firstException", Throwable.class); private volatile Throwable firstException; /** diff --git a/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java b/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java index b27c57114d620..a2fc3ac92bdbc 100644 --- a/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java +++ b/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java @@ -35,6 +35,8 @@ package java.util.concurrent; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.ArrayList; @@ -1505,16 +1507,10 @@ else if (timed) static final VarHandle QA; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - CTL = l.findVarHandle(BufferedSubscription.class, "ctl", - int.class); - DEMAND = l.findVarHandle(BufferedSubscription.class, "demand", - long.class); - QA = MethodHandles.arrayElementVarHandle(Object[].class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + CTL = MhUtil.findVarHandle(l, "ctl", int.class); + DEMAND = MhUtil.findVarHandle(l, "demand", long.class); + QA = MethodHandles.arrayElementVarHandle(Object[].class); // Reduce the risk of rare disastrous classloading in first call to // LockSupport.park: https://bugs.openjdk.org/browse/JDK-8074773 diff --git a/src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java b/src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java index 6d6d9efad0398..f5a2ce4d9b4cc 100644 --- a/src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java +++ b/src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java @@ -477,8 +477,7 @@ public Spliterator spliterator() { } /** - * Returns a zero-length array. - * @return a zero-length array + * {@return a zero-length array} */ public Object[] toArray() { return new Object[0]; diff --git a/src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java b/src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java index ca9ce08db7466..e98ece084c0df 100644 --- a/src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java +++ b/src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -38,6 +38,7 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.ThreadContainer; import jdk.internal.vm.ThreadContainers; @@ -48,15 +49,8 @@ class ThreadPerTaskExecutor extends ThreadContainer implements ExecutorService { private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); private static final Permission MODIFY_THREAD = new RuntimePermission("modifyThread"); - private static final VarHandle STATE; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - STATE = l.findVarHandle(ThreadPerTaskExecutor.class, "state", int.class); - } catch (Exception e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle STATE = MhUtil.findVarHandle( + MethodHandles.lookup(), "state", int.class); private final ThreadFactory factory; private final Set threads = ConcurrentHashMap.newKeySet(); @@ -506,14 +500,10 @@ private static class AnyResultHolder { private static final VarHandle EXCEPTION; private static final VarHandle EXCEPTION_COUNT; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - RESULT = l.findVarHandle(AnyResultHolder.class, "result", Object.class); - EXCEPTION = l.findVarHandle(AnyResultHolder.class, "exception", Throwable.class); - EXCEPTION_COUNT = l.findVarHandle(AnyResultHolder.class, "exceptionCount", int.class); - } catch (Exception e) { - throw new InternalError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + RESULT = MhUtil.findVarHandle(l, "result", Object.class); + EXCEPTION = MhUtil.findVarHandle(l, "exception", Throwable.class); + EXCEPTION_COUNT = MhUtil.findVarHandle(l, "exceptionCount", int.class); } private static final Object NULL = new Object(); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java index d8cb9869afecd..fb171e9c1d99f 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java @@ -35,6 +35,8 @@ package java.util.concurrent.atomic; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -50,15 +52,8 @@ */ public class AtomicBoolean implements java.io.Serializable { private static final long serialVersionUID = 4654671469794556979L; - private static final VarHandle VALUE; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - VALUE = l.findVarHandle(AtomicBoolean.class, "value", int.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle VALUE = MhUtil.findVarHandle( + MethodHandles.lookup(), "value", int.class); private volatile int value; @@ -176,8 +171,7 @@ public final boolean getAndSet(boolean newValue) { } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return Boolean.toString(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java index 4f08ed3f64b68..4ebd758ccc7a3 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java @@ -340,8 +340,7 @@ public final int accumulateAndGet(int x, } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return Integer.toString(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java index 676788e4204ab..7e253ead3354f 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java @@ -366,8 +366,7 @@ public final int accumulateAndGet(int i, int x, } /** - * Returns the String representation of the current values of array. - * @return the String representation of the current values of array + * {@return the String representation of the current values of array} */ public String toString() { int iMax = array.length - 1; diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java index e446df8fd3e0c..d0e50b0fda885 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java @@ -341,8 +341,7 @@ public final long accumulateAndGet(long x, } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return Long.toString(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java index af2ff6729fd77..2145c79579971 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java @@ -366,8 +366,7 @@ public final long accumulateAndGet(int i, long x, } /** - * Returns the String representation of the current values of array. - * @return the String representation of the current values of array + * {@return the String representation of the current values of array} */ public String toString() { int iMax = array.length - 1; diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java index 8e1727c8f1972..d74c3f2ef4f4f 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java @@ -35,6 +35,8 @@ package java.util.concurrent.atomic; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -190,16 +192,8 @@ public boolean attemptMark(V expectedReference, boolean newMark) { } // VarHandle mechanics - private static final VarHandle PAIR; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - PAIR = l.findVarHandle(AtomicMarkableReference.class, "pair", - Pair.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle PAIR = MhUtil.findVarHandle( + MethodHandles.lookup(), "pair", Pair.class); private boolean casPair(Pair cmp, Pair val) { return PAIR.compareAndSet(this, cmp, val); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java index b2c692df5e7c7..e512c91f2dfac 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java @@ -35,6 +35,8 @@ package java.util.concurrent.atomic; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.function.BinaryOperator; @@ -50,15 +52,8 @@ */ public class AtomicReference implements java.io.Serializable { private static final long serialVersionUID = -1848883965231344442L; - private static final VarHandle VALUE; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - VALUE = l.findVarHandle(AtomicReference.class, "value", Object.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle VALUE = MhUtil.findVarHandle( + MethodHandles.lookup(), "value", Object.class); @SuppressWarnings("serial") // Conditionally serializable private volatile V value; @@ -269,8 +264,7 @@ public final V accumulateAndGet(V x, } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return String.valueOf(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java index f85fb9376ad93..e8238320e2179 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java @@ -297,8 +297,7 @@ public final E accumulateAndGet(int i, E x, } /** - * Returns the String representation of the current values of array. - * @return the String representation of the current values of array + * {@return the String representation of the current values of array} */ public String toString() { int iMax = array.length - 1; diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java index b4152c50855c1..bac164b874a1d 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java @@ -35,6 +35,8 @@ package java.util.concurrent.atomic; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; @@ -190,16 +192,8 @@ public boolean attemptStamp(V expectedReference, int newStamp) { } // VarHandle mechanics - private static final VarHandle PAIR; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - PAIR = l.findVarHandle(AtomicStampedReference.class, "pair", - Pair.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle PAIR = MhUtil.findVarHandle( + MethodHandles.lookup(), "pair", Pair.class); private boolean casPair(Pair cmp, Pair val) { return PAIR.compareAndSet(this, cmp, val); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java index d04b8253ee76d..eb837a0fd29ad 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java @@ -189,8 +189,7 @@ public double getThenReset() { } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return Double.toString(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java b/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java index be96853ce0921..0d48a686cf2a1 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java @@ -183,8 +183,7 @@ public long getThenReset() { } /** - * Returns the String representation of the current value. - * @return the String representation of the current value + * {@return the String representation of the current value} */ public String toString() { return Long.toString(get()); diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java b/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java index 61a9f4d79e9a3..04ae2b4515825 100644 --- a/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java @@ -35,6 +35,8 @@ package java.util.concurrent.atomic; +import jdk.internal.invoke.MhUtil; + import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.util.Arrays; @@ -138,15 +140,8 @@ final long getAndSet(long val) { } // VarHandle mechanics - private static final VarHandle VALUE; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - VALUE = l.findVarHandle(Cell.class, "value", long.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + private static final VarHandle VALUE = MhUtil.findVarHandle( + MethodHandles.lookup(), "value", long.class); } /** Number of CPUS, to place bound on table size */ @@ -381,14 +376,12 @@ else if (casBase(v = base, apply(fn, v, x))) private static final VarHandle CELLSBUSY; private static final VarHandle THREAD_PROBE; static { - try { - MethodHandles.Lookup l1 = MethodHandles.lookup(); - BASE = l1.findVarHandle(Striped64.class, - "base", long.class); - CELLSBUSY = l1.findVarHandle(Striped64.class, - "cellsBusy", int.class); + MethodHandles.Lookup l1 = MethodHandles.lookup(); + + BASE = MhUtil.findVarHandle(l1, "base", long.class); + CELLSBUSY = MhUtil.findVarHandle(l1, "cellsBusy", int.class); @SuppressWarnings("removal") - MethodHandles.Lookup l2 = java.security.AccessController.doPrivileged( + MethodHandles.Lookup l2 = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<>() { public MethodHandles.Lookup run() { try { @@ -397,11 +390,7 @@ public MethodHandles.Lookup run() { throw new ExceptionInInitializerError(e); } }}); - THREAD_PROBE = l2.findVarHandle(Thread.class, - "threadLocalRandomProbe", int.class); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } + THREAD_PROBE = MhUtil.findVarHandle(l2, "threadLocalRandomProbe", int.class); } } diff --git a/src/java.base/share/classes/java/util/jar/JarFile.java b/src/java.base/share/classes/java/util/jar/JarFile.java index 77dfed3b84f2e..3dc3a49dc778e 100644 --- a/src/java.base/share/classes/java/util/jar/JarFile.java +++ b/src/java.base/share/classes/java/util/jar/JarFile.java @@ -90,7 +90,7 @@ *

      If the {@code verify} flag is on when opening a signed jar file, the content * of the jar entry is verified against the signature embedded inside the manifest * that is associated with its {@link JarEntry#getRealName() path name}. For a - * multi-release jar file, the content of a versioned entry is verfieid against + * multi-release jar file, the content of a versioned entry is verified against * its own signature and {@link JarEntry#getCodeSigners()} returns its own signers. * * Please note that the verification process does not include validating the diff --git a/src/java.base/share/classes/java/util/jar/Manifest.java b/src/java.base/share/classes/java/util/jar/Manifest.java index c0e30707a35ee..d584503329336 100644 --- a/src/java.base/share/classes/java/util/jar/Manifest.java +++ b/src/java.base/share/classes/java/util/jar/Manifest.java @@ -119,8 +119,7 @@ public Manifest(Manifest man) { } /** - * Returns the main Attributes for the Manifest. - * @return the main Attributes for the Manifest + * {@return the main Attributes for the Manifest} */ public Attributes getMainAttributes() { return attr; diff --git a/src/java.base/share/classes/java/util/stream/ForEachOps.java b/src/java.base/share/classes/java/util/stream/ForEachOps.java index 0c6b8aa665a78..1ba5970915226 100644 --- a/src/java.base/share/classes/java/util/stream/ForEachOps.java +++ b/src/java.base/share/classes/java/util/stream/ForEachOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -24,6 +24,8 @@ */ package java.util.stream; +import jdk.internal.invoke.MhUtil; + import java.util.Objects; import java.util.Spliterator; import java.util.concurrent.CountedCompleter; @@ -370,15 +372,8 @@ static final class ForEachOrderedTask extends CountedCompleter { private Node node; private ForEachOrderedTask next; - private static final VarHandle NEXT; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - NEXT = l.findVarHandle(ForEachOrderedTask.class, "next", ForEachOrderedTask.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle NEXT = MhUtil.findVarHandle( + MethodHandles.lookup(), "next", ForEachOrderedTask.class); protected ForEachOrderedTask(PipelineHelper helper, Spliterator spliterator, diff --git a/src/java.base/share/classes/java/util/stream/GathererOp.java b/src/java.base/share/classes/java/util/stream/GathererOp.java index 8a7073f63ef72..37f01901201eb 100644 --- a/src/java.base/share/classes/java/util/stream/GathererOp.java +++ b/src/java.base/share/classes/java/util/stream/GathererOp.java @@ -24,6 +24,7 @@ */ package java.util.stream; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.annotation.ForceInline; import java.lang.invoke.MethodHandles; @@ -453,16 +454,8 @@ final class Hybrid extends CountedCompleter { private Spliterator spliterator; private Hybrid next; - private static final VarHandle NEXT; - - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - NEXT = l.findVarHandle(Hybrid.class, "next", Hybrid.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle NEXT = MhUtil.findVarHandle( + MethodHandles.lookup(), "next", Hybrid.class); protected Hybrid(Spliterator spliterator) { super(null); diff --git a/src/java.base/share/classes/java/util/zip/Deflater.java b/src/java.base/share/classes/java/util/zip/Deflater.java index 56d0978dbc00d..a23f8395c2178 100644 --- a/src/java.base/share/classes/java/util/zip/Deflater.java +++ b/src/java.base/share/classes/java/util/zip/Deflater.java @@ -782,8 +782,7 @@ public int deflate(ByteBuffer output, int flush) { } /** - * Returns the ADLER-32 value of the uncompressed data. - * @return the ADLER-32 value of the uncompressed data + * {@return the ADLER-32 value of the uncompressed data} */ public int getAdler() { synchronized (zsRef) { diff --git a/src/java.base/share/classes/java/util/zip/Inflater.java b/src/java.base/share/classes/java/util/zip/Inflater.java index 22ab21d88c0b0..109208bd9ad8c 100644 --- a/src/java.base/share/classes/java/util/zip/Inflater.java +++ b/src/java.base/share/classes/java/util/zip/Inflater.java @@ -282,8 +282,7 @@ public boolean needsInput() { } /** - * Returns true if a preset dictionary is needed for decompression. - * @return true if a preset dictionary is needed for decompression + * {@return true if a preset dictionary is needed for decompression} * @see Inflater#setDictionary */ public boolean needsDictionary() { @@ -293,10 +292,8 @@ public boolean needsDictionary() { } /** - * Returns true if the end of the compressed data stream has been - * reached. - * @return true if the end of the compressed data stream has been - * reached + * {@return true if the end of the compressed data stream has been + * reached} */ public boolean finished() { synchronized (zsRef) { @@ -602,8 +599,7 @@ public int inflate(ByteBuffer output) throws DataFormatException { } /** - * Returns the ADLER-32 value of the uncompressed data. - * @return the ADLER-32 value of the uncompressed data + * {@return the ADLER-32 value of the uncompressed data} */ public int getAdler() { synchronized (zsRef) { diff --git a/src/java.base/share/classes/java/util/zip/ZipCoder.java b/src/java.base/share/classes/java/util/zip/ZipCoder.java index 25c6e3a2e4acd..6692703c1b3f0 100644 --- a/src/java.base/share/classes/java/util/zip/ZipCoder.java +++ b/src/java.base/share/classes/java/util/zip/ZipCoder.java @@ -158,13 +158,6 @@ static int hash(String name) { return hsh; } - boolean hasTrailingSlash(byte[] a, int end) { - byte[] slashBytes = slashBytes(); - return end >= slashBytes.length && - Arrays.mismatch(a, end - slashBytes.length, end, slashBytes, 0, slashBytes.length) == -1; - } - - private byte[] slashBytes; private final Charset cs; protected CharsetDecoder dec; private CharsetEncoder enc; @@ -191,23 +184,6 @@ private CharsetEncoder encoder() { return enc; } - // This method produces an array with the bytes that will correspond to a - // trailing '/' in the chosen character encoding. - // - // While in most charsets a trailing slash will be encoded as the byte - // value of '/', this does not hold in the general case. E.g., in charsets - // such as UTF-16 and UTF-32 it will be represented by a sequence of 2 or 4 - // bytes, respectively. - private byte[] slashBytes() { - if (slashBytes == null) { - // Take into account charsets that produce a BOM, e.g., UTF-16 - byte[] slash = "/".getBytes(cs); - byte[] doubleSlash = "//".getBytes(cs); - slashBytes = Arrays.copyOfRange(doubleSlash, slash.length, doubleSlash.length); - } - return slashBytes; - } - /** * This method is used by ZipFile.Source.getEntryPos when comparing the * name being looked up to candidate names encoded in the CEN byte @@ -297,8 +273,7 @@ int checkedHash(byte[] a, int off, int len) throws Exception { return h; } - @Override - boolean hasTrailingSlash(byte[] a, int end) { + private boolean hasTrailingSlash(byte[] a, int end) { return end > 0 && a[end - 1] == '/'; } diff --git a/src/java.base/share/classes/java/util/zip/ZipEntry.java b/src/java.base/share/classes/java/util/zip/ZipEntry.java index d97760d950ab3..243779a7c4913 100644 --- a/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -78,7 +78,7 @@ public class ZipEntry implements ZipConstants, Cloneable { /** * Approximately 128 years, in milliseconds (ignoring leap years etc). * - * This establish an approximate high-bound value for DOS times in + * This establishes an approximate high-bound value for DOS times in * milliseconds since epoch, used to enable an efficient but * sufficient bounds check to avoid generating extended last modified * time entries. @@ -138,8 +138,7 @@ public ZipEntry(ZipEntry e) { } /** - * Returns the name of the entry. - * @return the name of the entry + * {@return the name of the entry} */ public String getName() { return name; diff --git a/src/java.base/share/classes/java/util/zip/ZipFile.java b/src/java.base/share/classes/java/util/zip/ZipFile.java index 6ab70d4bdb81d..333e3d0184976 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -347,9 +347,12 @@ public ZipEntry getEntry(String name) { ZipEntry entry = null; synchronized (this) { ensureOpen(); - int pos = res.zsrc.getEntryPos(name, true); - if (pos != -1) { - entry = getZipEntry(name, pos); + // Look up the name and CEN header position of the entry. + // The resolved name may include a trailing slash. + // See Source::getEntryPos for details. + EntryPos pos = res.zsrc.getEntryPos(name, true); + if (pos != null) { + entry = getZipEntry(pos.name, pos.pos); } } return entry; @@ -387,7 +390,12 @@ public InputStream getInputStream(ZipEntry entry) throws IOException { if (Objects.equals(lastEntryName, entry.name)) { pos = lastEntryPos; } else { - pos = zsrc.getEntryPos(entry.name, false); + EntryPos entryPos = zsrc.getEntryPos(entry.name, false); + if (entryPos != null) { + pos = entryPos.pos; + } else { + pos = -1; + } } if (pos == -1) { return null; @@ -490,8 +498,7 @@ public int available() throws IOException { } /** - * Returns the path name of the ZIP file. - * @return the path name of the ZIP file + * {@return the path name of the ZIP file} */ public String getName() { return filePath; @@ -540,7 +547,8 @@ public T next() { throw new NoSuchElementException(); } // each "entry" has 3 ints in table entries - return (T)getZipEntry(null, res.zsrc.getEntryPos(i++ * 3)); + int pos = res.zsrc.getEntryPos(i++ * 3); + return (T)getZipEntry(getEntryName(pos), pos); } } @@ -551,8 +559,7 @@ public Iterator asIterator() { } /** - * Returns an enumeration of the ZIP file entries. - * @return an enumeration of the ZIP file entries + * {@return an enumeration of the ZIP file entries} * @throws IllegalStateException if the ZIP file has been closed */ public Enumeration entries() { @@ -612,7 +619,7 @@ public Stream stream() { synchronized (this) { ensureOpen(); return StreamSupport.stream(new EntrySpliterator<>(0, res.zsrc.total, - pos -> getZipEntry(null, pos)), false); + pos -> getZipEntry(getEntryName(pos), pos)), false); } } @@ -655,7 +662,7 @@ private Stream jarStream() { synchronized (this) { ensureOpen(); return StreamSupport.stream(new EntrySpliterator<>(0, res.zsrc.total, - pos -> (JarEntry)getZipEntry(null, pos)), false); + pos -> (JarEntry)getZipEntry(getEntryName(pos), pos)), false); } } @@ -665,30 +672,10 @@ private Stream jarStream() { /* Check ensureOpen() before invoking this method */ private ZipEntry getZipEntry(String name, int pos) { byte[] cen = res.zsrc.cen; - int nlen = CENNAM(cen, pos); - int elen = CENEXT(cen, pos); - int clen = CENCOM(cen, pos); + ZipEntry e = this instanceof JarFile jarFile + ? Source.JUJA.entryFor(jarFile, name) + : new ZipEntry(name); - ZipCoder zc = res.zsrc.zipCoderForPos(pos); - if (name != null) { - // only need to check for mismatch of trailing slash - if (nlen > 0 && - !name.isEmpty() && - zc.hasTrailingSlash(cen, pos + CENHDR + nlen) && - !name.endsWith("/")) - { - name += '/'; - } - } else { - // invoked from iterator, use the entry name stored in cen - name = zc.toString(cen, pos + CENHDR, nlen); - } - ZipEntry e; - if (this instanceof JarFile) { - e = Source.JUJA.entryFor((JarFile)this, name); - } else { - e = new ZipEntry(name); - } e.flag = CENFLG(cen, pos); e.xdostime = CENTIM(cen, pos); e.crc = CENCRC(cen, pos); @@ -700,12 +687,17 @@ private ZipEntry getZipEntry(String name, int pos) { e.externalFileAttributes = CENATX_PERMS(cen, pos) & 0xFFFF; } + int nlen = CENNAM(cen, pos); + int elen = CENEXT(cen, pos); + int clen = CENCOM(cen, pos); + if (elen != 0) { int start = pos + CENHDR + nlen; e.setExtra0(Arrays.copyOfRange(cen, start, start + elen), true, false); } if (clen != 0) { int start = pos + CENHDR + nlen + elen; + ZipCoder zc = res.zsrc.zipCoderForPos(pos); e.comment = zc.toString(cen, start, clen); } lastEntryName = e.name; @@ -1176,6 +1168,8 @@ public void setExternalFileAttributes(ZipEntry ze, int externalFileAttributes) { } ); } + // Represents the resolved name and position of a CEN record + static record EntryPos(String name, int pos) {} private static class Source { // While this is only used from ZipFile, defining it there would cause @@ -1849,12 +1843,12 @@ private static void zerror(String msg) throws ZipException { } /* - * Returns the {@code pos} of the ZIP cen entry corresponding to the - * specified entry name, or -1 if not found. + * Returns the resolved name and position of the ZIP cen entry corresponding + * to the specified entry name, or {@code null} if not found. */ - private int getEntryPos(String name, boolean addSlash) { + private EntryPos getEntryPos(String name, boolean addSlash) { if (total == 0) { - return -1; + return null; } int hsh = ZipCoder.hash(name); @@ -1877,7 +1871,7 @@ private int getEntryPos(String name, boolean addSlash) { switch (zc.compare(name, cen, noff, nlen, addSlash)) { case EXACT_MATCH: // We found an exact match for "name" - return pos; + return new EntryPos(name, pos); case DIRECTORY_MATCH: // We found the directory "name/" // Track its position, then continue the search for "name" @@ -1892,10 +1886,10 @@ private int getEntryPos(String name, boolean addSlash) { // Reaching this point means we did not find "name". // Return the position of "name/" if we found it if (dirPos != -1) { - return dirPos; + return new EntryPos(name + "/", dirPos); } // No entry found - return -1; + return null; } private ZipCoder zipCoderForPos(int pos) { diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index f68c27b265ee1..f9712731a0894 100644 --- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -378,6 +378,10 @@ public synchronized void write(byte[] b, int off, int len) * Finishes writing the contents of the ZIP output stream without closing * the underlying stream. Use this method when applying multiple filters * in succession to the same output stream. + *

      + * A ZipException will be thrown if the combined length, after encoding, + * of the entry name, the extra field data, the entry comment and + * {@linkplain #CENHDR CEN Header size}, exceeds 65,535 bytes. * @throws ZipException if a ZIP file error has occurred * @throws IOException if an I/O exception has occurred */ @@ -398,7 +402,9 @@ public void finish() throws IOException { } /** - * Closes the ZIP output stream as well as the stream being filtered. + * Closes the underlying stream and the stream being filtered after + * the contents of the ZIP output stream are fully written. + * * @throws ZipException if a ZIP file error has occurred * @throws IOException if an I/O error has occurred */ @@ -589,7 +595,8 @@ private void writeCEN(XEntry xentry) throws IOException { writeInt(csize); // compressed size writeInt(size); // uncompressed size byte[] nameBytes = zc.getBytes(e.name); - writeShort(nameBytes.length); + int nlen = nameBytes.length; + writeShort(nlen); int elen = getExtraLen(e.extra); if (hasZip64) { @@ -626,20 +633,19 @@ private void writeCEN(XEntry xentry) throws IOException { } } writeShort(elen); - byte[] commentBytes; + byte[] commentBytes = null; + int clen = 0; if (e.comment != null) { commentBytes = zc.getBytes(e.comment); - writeShort(Math.min(commentBytes.length, 0xffff)); - } else { - commentBytes = null; - writeShort(0); + clen = Math.min(commentBytes.length, 0xffff); } + writeShort(clen); // file comment length writeShort(0); // starting disk number writeShort(0); // internal file attributes (unused) // extra file attributes, used for storing posix permissions etc. writeInt(e.externalFileAttributes > 0 ? e.externalFileAttributes << 16 : 0); writeInt(offset); // relative offset of local header - writeBytes(nameBytes, 0, nameBytes.length); + writeBytes(nameBytes, 0, nlen); // take care of EXTID_ZIP64 and EXTID_EXTT if (hasZip64) { @@ -679,9 +685,17 @@ private void writeCEN(XEntry xentry) throws IOException { } } } + + // CEN header size + name length + comment length + extra length + // should not exceed 65,535 bytes per the PKWare APP.NOTE + // 4.4.10, 4.4.11, & 4.4.12. + long headerSize = (long)CENHDR + nlen + clen + elen; + if (headerSize > 0xFFFF ) { + throw new ZipException("invalid CEN header (bad header size)"); + } writeExtra(e.extra); if (commentBytes != null) { - writeBytes(commentBytes, 0, Math.min(commentBytes.length, 0xffff)); + writeBytes(commentBytes, 0, clen); } } diff --git a/src/java.base/share/classes/javax/crypto/CryptoPermission.java b/src/java.base/share/classes/javax/crypto/CryptoPermission.java index f13eec7a1d92a..46b5b5fdef6b6 100644 --- a/src/java.base/share/classes/javax/crypto/CryptoPermission.java +++ b/src/java.base/share/classes/javax/crypto/CryptoPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -39,7 +39,7 @@ * The {@code CryptoPermission} class extends the * {@code java.security.Permission} class. A * {@code CryptoPermission} object is used to represent - * the ability of an application/applet to use certain + * the ability of an application to use certain * algorithms with certain key sizes and other * restrictions in certain environments. * diff --git a/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java b/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java index c08187d88a646..d360b3577a01c 100644 --- a/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java +++ b/src/java.base/share/classes/javax/crypto/ExemptionMechanism.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -43,7 +43,7 @@ * of which are key recovery, key weakening, and * key escrow. * - *

      Applications or applets that use an exemption mechanism may be granted + *

      Applications that use an exemption mechanism may be granted * stronger encryption capabilities than those which don't. * * @since 1.4 diff --git a/src/java.base/share/classes/javax/crypto/JceSecurityManager.java b/src/java.base/share/classes/javax/crypto/JceSecurityManager.java index e9c408a2a56c0..b178c8bfb0253 100644 --- a/src/java.base/share/classes/javax/crypto/JceSecurityManager.java +++ b/src/java.base/share/classes/javax/crypto/JceSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -36,9 +36,9 @@ * The JCE security manager. * *

      The JCE security manager is responsible for determining the maximum - * allowable cryptographic strength for a given applet/application, for a given + * allowable cryptographic strength for a given application, for a given * algorithm, by consulting the configured jurisdiction policy files and - * the cryptographic permissions bundled with the applet/application. + * the cryptographic permissions bundled with the application. * * @author Jan Luehe * @@ -85,7 +85,7 @@ private JceSecurityManager() { /** * Returns the maximum allowable crypto strength for the given - * applet/application, for the given algorithm. + * application, for the given algorithm. */ CryptoPermission getCryptoPermission(String theAlg) { diff --git a/src/java.base/share/classes/javax/net/SocketFactory.java b/src/java.base/share/classes/javax/net/SocketFactory.java index dd351e9275881..9ef82caf3f9f0 100644 --- a/src/java.base/share/classes/javax/net/SocketFactory.java +++ b/src/java.base/share/classes/javax/net/SocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -60,7 +60,7 @@ * *

      Factory classes are specified by environment-specific configuration * mechanisms. For example, the getDefault method could return - * a factory that was appropriate for a particular user or applet, and a + * a factory that was appropriate for a particular application, and a * framework could use a factory customized to its own purposes. * * @since 1.4 diff --git a/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java b/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java index b34a0d42085aa..a5d7c84399801 100644 --- a/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java +++ b/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java @@ -25,6 +25,7 @@ package jdk.internal.access; +import jdk.internal.access.foreign.MappedMemoryUtilsProxy; import jdk.internal.access.foreign.UnmapperProxy; import jdk.internal.misc.VM.BufferPool; @@ -107,25 +108,10 @@ public interface JavaNioAccess { boolean hasSession(Buffer buffer); - /** - * Used by {@code jdk.internal.foreign.MappedMemorySegmentImpl} and byte buffer var handle views. - */ - void force(FileDescriptor fd, long address, boolean isSync, long offset, long size); - - /** - * Used by {@code jdk.internal.foreign.MappedMemorySegmentImpl} and byte buffer var handle views. - */ - void load(long address, boolean isSync, long size); - /** * Used by {@code jdk.internal.foreign.MappedMemorySegmentImpl}. */ - void unload(long address, boolean isSync, long size); - - /** - * Used by {@code jdk.internal.foreign.MappedMemorySegmentImpl} and byte buffer var handle views. - */ - boolean isLoaded(long address, boolean isSync, long size); + MappedMemoryUtilsProxy mappedMemoryUtils(); /** * Used by {@code jdk.internal.foreign.NativeMemorySegmentImpl}. diff --git a/src/java.base/share/classes/jdk/internal/access/foreign/MappedMemoryUtilsProxy.java b/src/java.base/share/classes/jdk/internal/access/foreign/MappedMemoryUtilsProxy.java new file mode 100644 index 0000000000000..eb5cf3884701f --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/access/foreign/MappedMemoryUtilsProxy.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024, 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. + */ + +package jdk.internal.access.foreign; + +import java.io.FileDescriptor; + +/** + * This proxy interface is required to allow access to @{code MappedMemoryUtils} methods from {@code ScopedMemoryAccess}. + * This allows to avoid pesky initialization issues in the middle of memory mapped scoped methods. + */ +public interface MappedMemoryUtilsProxy { + boolean isLoaded(long address, boolean isSync, long size); + void load(long address, boolean isSync, long size); + void unload(long address, boolean isSync, long size); + void force(FileDescriptor fd, long address, boolean isSync, long index, long length); +} diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java index 450f6ae1c8c90..8498e77cb36bc 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java @@ -24,6 +24,7 @@ */ package jdk.internal.classfile.impl; +import java.lang.classfile.constantpool.ConstantPoolException; import java.lang.constant.*; import java.lang.invoke.TypeDescriptor; import java.nio.charset.StandardCharsets; @@ -54,6 +55,9 @@ import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.util.ArraysSupport; +import jdk.internal.vm.annotation.Stable; + +import static java.lang.classfile.ClassFile.*; public abstract sealed class AbstractPoolEntry { /* @@ -82,24 +86,32 @@ public static int hashString(int stringHash) { return stringHash | NON_ZERO; } - public static Utf8Entry rawUtf8EntryFromStandardAttributeName(String name) { - //assuming standard attribute names are all US_ASCII - var raw = name.getBytes(StandardCharsets.US_ASCII); - return new Utf8EntryImpl(null, 0, raw, 0, raw.length); + static int hashClassFromUtf8(boolean isArray, Utf8EntryImpl content) { + int hash = content.contentHash(); + return hashClassFromDescriptor(isArray ? hash : Util.descriptorStringHash(content.length(), hash)); + } + + static int hashClassFromDescriptor(int descriptorHash) { + return hash1(ClassFile.TAG_CLASS, descriptorHash); + } + + static boolean isArrayDescriptor(Utf8EntryImpl cs) { + // Do not throw out-of-bounds for empty strings + return !cs.isEmpty() && cs.charAt(0) == '['; } @SuppressWarnings("unchecked") public static T maybeClone(ConstantPoolBuilder cp, T entry) { + if (cp.canWriteDirect(entry.constantPool())) + return entry; return (T)((AbstractPoolEntry)entry).clone(cp); } final ConstantPool constantPool; - public final byte tag; private final int index; private final int hash; - private AbstractPoolEntry(ConstantPool constantPool, int tag, int index, int hash) { - this.tag = (byte) tag; + private AbstractPoolEntry(ConstantPool constantPool, int index, int hash) { this.index = index; this.hash = hash; this.constantPool = constantPool; @@ -114,12 +126,10 @@ public int hashCode() { return hash; } - public byte tag() { - return tag; - } + public abstract byte tag(); public int width() { - return (tag == ClassFile.TAG_LONG || tag == ClassFile.TAG_DOUBLE) ? 2 : 1; + return 1; } abstract void writeTo(BufWriterImpl buf); @@ -146,16 +156,18 @@ enum State { RAW, BYTE, CHAR, STRING } private final int offset; private final int rawLen; // Set in any state other than RAW - private int hash; - private int charLen; + private @Stable int contentHash; + private @Stable int charLen; // Set in CHAR state - private char[] chars; + private @Stable char[] chars; // Only set in STRING state - private String stringValue; + private @Stable String stringValue; + // The descriptor symbol, if this is a descriptor + @Stable TypeDescriptor typeSym; Utf8EntryImpl(ConstantPool cpm, int index, byte[] rawBytes, int offset, int rawLen) { - super(cpm, ClassFile.TAG_UTF8, index, 0); + super(cpm, index, 0); this.rawBytes = rawBytes; this.offset = offset; this.rawLen = rawLen; @@ -163,30 +175,36 @@ enum State { RAW, BYTE, CHAR, STRING } } Utf8EntryImpl(ConstantPool cpm, int index, String s) { - this(cpm, index, s, hashString(s.hashCode())); + this(cpm, index, s, s.hashCode()); } - Utf8EntryImpl(ConstantPool cpm, int index, String s, int hash) { - super(cpm, ClassFile.TAG_UTF8, index, 0); + Utf8EntryImpl(ConstantPool cpm, int index, String s, int contentHash) { + super(cpm, index, 0); this.rawBytes = null; this.offset = 0; this.rawLen = 0; this.state = State.STRING; this.stringValue = s; this.charLen = s.length(); - this.hash = hash; + this.contentHash = contentHash; } Utf8EntryImpl(ConstantPool cpm, int index, Utf8EntryImpl u) { - super(cpm, ClassFile.TAG_UTF8, index, 0); + super(cpm, index, 0); this.rawBytes = u.rawBytes; this.offset = u.offset; this.rawLen = u.rawLen; this.state = u.state; - this.hash = u.hash; + this.contentHash = u.contentHash; this.charLen = u.charLen; this.chars = u.chars; this.stringValue = u.stringValue; + this.typeSym = u.typeSym; + } + + @Override + public byte tag() { + return TAG_UTF8; } /** @@ -228,7 +246,7 @@ private void inflate() { int singleBytes = JLA.countPositives(rawBytes, offset, rawLen); int hash = ArraysSupport.hashCodeOfUnsigned(rawBytes, offset, singleBytes, 0); if (singleBytes == rawLen) { - this.hash = hashString(hash); + this.contentHash = hash; charLen = rawLen; state = State.BYTE; } @@ -254,11 +272,11 @@ private void inflate() { // 110x xxxx 10xx xxxx px += 2; if (px > utfend) { - throw new CpException("malformed input: partial character at end"); + throw malformedInput(utfend); } int char2 = rawBytes[px - 1]; if ((char2 & 0xC0) != 0x80) { - throw new CpException("malformed input around byte " + px); + throw malformedInput(px); } char v = (char) (((c & 0x1F) << 6) | (char2 & 0x3F)); chararr[chararr_count++] = v; @@ -269,12 +287,12 @@ private void inflate() { // 1110 xxxx 10xx xxxx 10xx xxxx px += 3; if (px > utfend) { - throw new CpException("malformed input: partial character at end"); + throw malformedInput(utfend); } int char2 = rawBytes[px - 2]; int char3 = rawBytes[px - 1]; if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) { - throw new CpException("malformed input around byte " + (px - 1)); + throw malformedInput(px - 1); } char v = (char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F)); chararr[chararr_count++] = v; @@ -283,21 +301,22 @@ private void inflate() { } default: // 10xx xxxx, 1111 xxxx - throw new CpException("malformed input around byte " + px); + throw malformedInput(px); } } - this.hash = hashString(hash); + this.contentHash = hash; charLen = chararr_count; this.chars = chararr; state = State.CHAR; } + } + private ConstantPoolException malformedInput(int px) { + return new ConstantPoolException("#%d: malformed modified UTF8 around byte %d".formatted(index(), px)); } @Override public Utf8EntryImpl clone(ConstantPoolBuilder cp) { - if (cp.canWriteDirect(constantPool)) - return this; return (state == State.STRING && rawBytes == null) ? (Utf8EntryImpl) cp.utf8Entry(stringValue) : ((SplitConstantPool) cp).maybeCloneUtf8Entry(this); @@ -305,9 +324,13 @@ public Utf8EntryImpl clone(ConstantPoolBuilder cp) { @Override public int hashCode() { + return hashString(contentHash()); + } + + int contentHash() { if (state == State.RAW) inflate(); - return hash; + return contentHash; } @Override @@ -378,6 +401,38 @@ else if ((state == State.STRING && u.state == State.STRING)) return stringValue().equals(u.stringValue()); } + /** + * Returns if this utf8 entry's content equals a substring + * of {@code s} obtained as {@code s.substring(start, end - start)}. + * This check avoids a substring allocation. + */ + public boolean equalsRegion(String s, int start, int end) { + // start and end values trusted + if (state == State.RAW) + inflate(); + int len = charLen; + if (len != end - start) + return false; + + var sv = stringValue; + if (sv != null) { + return sv.regionMatches(0, s, start, len); + } + + var chars = this.chars; + if (chars != null) { + for (int i = 0; i < len; i++) + if (chars[i] != s.charAt(start + i)) + return false; + } else { + var bytes = this.rawBytes; + for (int i = 0; i < len; i++) + if (bytes[offset + i] != s.charAt(start + i)) + return false; + } + return true; + } + @Override public boolean equalsString(String s) { if (state == State.RAW) @@ -386,7 +441,7 @@ public boolean equalsString(String s) { case STRING: return stringValue.equals(s); case CHAR: - if (charLen != s.length() || hash != hashString(s.hashCode())) + if (charLen != s.length() || contentHash != s.hashCode()) return false; for (int i=0; i extends AbstractPoolEntry { protected final T ref1; public AbstractRefEntry(ConstantPool constantPool, int tag, int index, T ref1) { - super(constantPool, tag, index, hash1(tag, ref1.index())); + super(constantPool, index, hash1(tag, ref1.index())); this.ref1 = ref1; } @@ -434,7 +505,7 @@ public T ref1() { } void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(tag()); pool.writeU2(ref1.index()); } @@ -450,7 +521,7 @@ abstract static sealed class AbstractRefsEntry implements NameAndTypeEntry { - public TypeDescriptor typeSym = null; - NameAndTypeEntryImpl(ConstantPool cpm, int index, Utf8EntryImpl name, Utf8EntryImpl type) { - super(cpm, ClassFile.TAG_NAMEANDTYPE, index, name, type); + super(cpm, TAG_NAMEANDTYPE, index, name, type); + } + + @Override + public byte tag() { + return TAG_NAMEANDTYPE; } @Override @@ -601,31 +714,9 @@ public Utf8Entry type() { return ref2; } - public ClassDesc fieldTypeSymbol() { - if (typeSym instanceof ClassDesc cd) { - return cd; - } else { - return (ClassDesc)(typeSym = ClassDesc.ofDescriptor(ref2.stringValue())); - } - } - - public MethodTypeDesc methodTypeSymbol() { - if (typeSym instanceof MethodTypeDesc mtd) { - return mtd; - } else { - return (MethodTypeDesc)(typeSym = MethodTypeDesc.ofDescriptor(ref2.stringValue())); - } - } - @Override public NameAndTypeEntry clone(ConstantPoolBuilder cp) { - if (cp.canWriteDirect(constantPool)) { - return this; - } else { - var ret = (NameAndTypeEntryImpl)cp.nameAndTypeEntry(ref1, ref2); - ret.typeSym = typeSym; - return ret; - } + return cp.nameAndTypeEntry(ref1, ref2); } @Override @@ -667,7 +758,7 @@ public String toString() { public boolean equals(Object o) { if (this == o) return true; if (o instanceof AbstractMemberRefEntry m) { - return tag == m.tag() + return tag() == m.tag() && owner().equals(m.owner()) && nameAndType().equals(m.nameAndType()); } @@ -679,12 +770,17 @@ public static final class FieldRefEntryImpl extends AbstractMemberRefEntry imple FieldRefEntryImpl(ConstantPool cpm, int index, ClassEntryImpl owner, NameAndTypeEntryImpl nameAndType) { - super(cpm, ClassFile.TAG_FIELDREF, index, owner, nameAndType); + super(cpm, TAG_FIELDREF, index, owner, nameAndType); + } + + @Override + public byte tag() { + return TAG_FIELDREF; } @Override public FieldRefEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.fieldRefEntry(ref1, ref2); + return cp.fieldRefEntry(ref1, ref2); } } @@ -695,9 +791,14 @@ public static final class MethodRefEntryImpl extends AbstractMemberRefEntry impl super(cpm, ClassFile.TAG_METHODREF, index, owner, nameAndType); } + @Override + public byte tag() { + return TAG_METHODREF; + } + @Override public MethodRefEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.methodRefEntry(ref1, ref2); + return cp.methodRefEntry(ref1, ref2); } } @@ -708,9 +809,14 @@ public static final class InterfaceMethodRefEntryImpl extends AbstractMemberRefE super(cpm, ClassFile.TAG_INTERFACEMETHODREF, index, owner, nameAndType); } + @Override + public byte tag() { + return TAG_INTERFACEMETHODREF; + } + @Override public InterfaceMethodRefEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.interfaceMethodRefEntry(ref1, ref2); + return cp.interfaceMethodRefEntry(ref1, ref2); } } @@ -720,17 +826,17 @@ public abstract static sealed class AbstractDynamicConstantPoolEntry extends Abs private BootstrapMethodEntryImpl bootstrapMethod; private final NameAndTypeEntryImpl nameAndType; - AbstractDynamicConstantPoolEntry(ConstantPool cpm, int tag, int index, int hash, BootstrapMethodEntryImpl bootstrapMethod, + AbstractDynamicConstantPoolEntry(ConstantPool cpm, int index, int hash, BootstrapMethodEntryImpl bootstrapMethod, NameAndTypeEntryImpl nameAndType) { - super(cpm, tag, index, hash); + super(cpm, index, hash); this.bsmIndex = bootstrapMethod.bsmIndex(); this.bootstrapMethod = bootstrapMethod; this.nameAndType = nameAndType; } - AbstractDynamicConstantPoolEntry(ConstantPool cpm, int tag, int index, int hash, int bsmIndex, + AbstractDynamicConstantPoolEntry(ConstantPool cpm, int index, int hash, int bsmIndex, NameAndTypeEntryImpl nameAndType) { - super(cpm, tag, index, hash); + super(cpm, index, hash); this.bsmIndex = bsmIndex; this.bootstrapMethod = null; this.nameAndType = nameAndType; @@ -761,7 +867,7 @@ public NameAndTypeEntryImpl nameAndType() { } void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(tag()); pool.writeU2(bsmIndex); pool.writeU2(nameAndType.index()); } @@ -790,18 +896,23 @@ public static final class InvokeDynamicEntryImpl InvokeDynamicEntryImpl(ConstantPool cpm, int index, int hash, BootstrapMethodEntryImpl bootstrapMethod, NameAndTypeEntryImpl nameAndType) { - super(cpm, ClassFile.TAG_INVOKEDYNAMIC, index, hash, bootstrapMethod, nameAndType); + super(cpm, index, hash, bootstrapMethod, nameAndType); } InvokeDynamicEntryImpl(ConstantPool cpm, int index, int bsmIndex, NameAndTypeEntryImpl nameAndType) { - super(cpm, ClassFile.TAG_INVOKEDYNAMIC, index, hash2(ClassFile.TAG_INVOKEDYNAMIC, bsmIndex, nameAndType.index()), + super(cpm, index, hash2(TAG_INVOKEDYNAMIC, bsmIndex, nameAndType.index()), bsmIndex, nameAndType); } + @Override + public byte tag() { + return TAG_INVOKEDYNAMIC; + } + @Override public InvokeDynamicEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.invokeDynamicEntry(bootstrap(), nameAndType()); + return cp.invokeDynamicEntry(bootstrap(), nameAndType()); } } @@ -810,18 +921,23 @@ public static final class ConstantDynamicEntryImpl extends AbstractDynamicConsta ConstantDynamicEntryImpl(ConstantPool cpm, int index, int hash, BootstrapMethodEntryImpl bootstrapMethod, NameAndTypeEntryImpl nameAndType) { - super(cpm, ClassFile.TAG_CONSTANTDYNAMIC, index, hash, bootstrapMethod, nameAndType); + super(cpm, index, hash, bootstrapMethod, nameAndType); } ConstantDynamicEntryImpl(ConstantPool cpm, int index, int bsmIndex, NameAndTypeEntryImpl nameAndType) { - super(cpm, ClassFile.TAG_CONSTANTDYNAMIC, index, hash2(ClassFile.TAG_CONSTANTDYNAMIC, bsmIndex, nameAndType.index()), + super(cpm, index, hash2(TAG_CONSTANTDYNAMIC, bsmIndex, nameAndType.index()), bsmIndex, nameAndType); } + @Override + public byte tag() { + return TAG_CONSTANTDYNAMIC; + } + @Override public ConstantDynamicEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.constantDynamicEntry(bootstrap(), nameAndType()); + return cp.constantDynamicEntry(bootstrap(), nameAndType()); } } @@ -833,18 +949,23 @@ public static final class MethodHandleEntryImpl extends AbstractPoolEntry MethodHandleEntryImpl(ConstantPool cpm, int index, int hash, int refKind, AbstractPoolEntry.AbstractMemberRefEntry reference) { - super(cpm, ClassFile.TAG_METHODHANDLE, index, hash); + super(cpm, index, hash); this.refKind = refKind; this.reference = reference; } MethodHandleEntryImpl(ConstantPool cpm, int index, int refKind, AbstractPoolEntry.AbstractMemberRefEntry reference) { - super(cpm, ClassFile.TAG_METHODHANDLE, index, hash2(ClassFile.TAG_METHODHANDLE, refKind, reference.index())); + super(cpm, index, hash2(ClassFile.TAG_METHODHANDLE, refKind, reference.index())); this.refKind = refKind; this.reference = reference; } + @Override + public byte tag() { + return TAG_METHODHANDLE; + } + @Override public int kind() { return refKind; @@ -866,14 +987,14 @@ public DirectMethodHandleDesc asSymbol() { @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_METHODHANDLE); pool.writeU1(refKind); pool.writeU2(reference.index()); } @Override public MethodHandleEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.methodHandleEntry(refKind, reference); + return cp.methodHandleEntry(refKind, reference); } @Override @@ -897,10 +1018,13 @@ public static final class MethodTypeEntryImpl extends AbstractRefEntry implements MethodTypeEntry { - public MethodTypeDesc sym = null; - MethodTypeEntryImpl(ConstantPool cpm, int index, Utf8EntryImpl descriptor) { - super(cpm, ClassFile.TAG_METHODTYPE, index, descriptor); + super(cpm, TAG_METHODTYPE, index, descriptor); + } + + @Override + public byte tag() { + return TAG_METHODTYPE; } @Override @@ -910,22 +1034,12 @@ public Utf8Entry descriptor() { @Override public MethodTypeEntry clone(ConstantPoolBuilder cp) { - if (cp.canWriteDirect(constantPool)) { - return this; - } else { - var ret = (MethodTypeEntryImpl)cp.methodTypeEntry(ref1); - ret.sym = sym; - return ret; - } + return cp.methodTypeEntry(ref1); } @Override public MethodTypeDesc asSymbol() { - var sym = this.sym; - if (sym != null) { - return sym; - } - return this.sym = MethodTypeDesc.ofDescriptor(descriptor().stringValue()); + return ref1.methodTypeSymbol(); } @Override @@ -943,7 +1057,12 @@ public static final class StringEntryImpl implements StringEntry { StringEntryImpl(ConstantPool cpm, int index, Utf8EntryImpl utf8) { - super(cpm, ClassFile.TAG_STRING, index, utf8); + super(cpm, TAG_STRING, index, utf8); + } + + @Override + public byte tag() { + return TAG_STRING; } @Override @@ -963,7 +1082,7 @@ public ConstantDesc constantValue() { @Override public StringEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.stringEntry(ref1); + return cp.stringEntry(ref1); } @Override @@ -989,19 +1108,24 @@ public static final class IntegerEntryImpl extends AbstractPoolEntry implements private final int val; IntegerEntryImpl(ConstantPool cpm, int index, int i) { - super(cpm, ClassFile.TAG_INTEGER, index, hash1(ClassFile.TAG_INTEGER, Integer.hashCode(i))); + super(cpm, index, hash1(ClassFile.TAG_INTEGER, Integer.hashCode(i))); val = i; } + @Override + public byte tag() { + return TAG_INTEGER; + } + @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_INTEGER); pool.writeInt(val); } @Override public IntegerEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.intEntry(val); + return cp.intEntry(val); } @Override @@ -1030,19 +1154,24 @@ public static final class FloatEntryImpl extends AbstractPoolEntry private final float val; FloatEntryImpl(ConstantPool cpm, int index, float f) { - super(cpm, ClassFile.TAG_FLOAT, index, hash1(ClassFile.TAG_FLOAT, Float.hashCode(f))); + super(cpm, index, hash1(ClassFile.TAG_FLOAT, Float.hashCode(f))); val = f; } + @Override + public byte tag() { + return TAG_FLOAT; + } + @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_FLOAT); pool.writeFloat(val); } @Override public FloatEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.floatEntry(val); + return cp.floatEntry(val); } @Override @@ -1070,19 +1199,29 @@ public static final class LongEntryImpl extends AbstractPoolEntry implements Lon private final long val; LongEntryImpl(ConstantPool cpm, int index, long l) { - super(cpm, ClassFile.TAG_LONG, index, hash1(ClassFile.TAG_LONG, Long.hashCode(l))); + super(cpm, index, hash1(ClassFile.TAG_LONG, Long.hashCode(l))); val = l; } + @Override + public byte tag() { + return TAG_LONG; + } + + @Override + public int width() { + return 2; + } + @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_LONG); pool.writeLong(val); } @Override public LongEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.longEntry(val); + return cp.longEntry(val); } @Override @@ -1110,19 +1249,29 @@ public static final class DoubleEntryImpl extends AbstractPoolEntry implements D private final double val; DoubleEntryImpl(ConstantPool cpm, int index, double d) { - super(cpm, ClassFile.TAG_DOUBLE, index, hash1(ClassFile.TAG_DOUBLE, Double.hashCode(d))); + super(cpm, index, hash1(ClassFile.TAG_DOUBLE, Double.hashCode(d))); val = d; } + @Override + public byte tag() { + return TAG_DOUBLE; + } + + @Override + public int width() { + return 2; + } + @Override void writeTo(BufWriterImpl pool) { - pool.writeU1(tag); + pool.writeU1(TAG_DOUBLE); pool.writeDouble(val); } @Override public DoubleEntry clone(ConstantPoolBuilder cp) { - return cp.canWriteDirect(constantPool) ? this : cp.doubleEntry(val); + return cp.doubleEntry(val); } @Override @@ -1144,12 +1293,4 @@ public boolean equals(Object o) { return false; } } - - static class CpException extends RuntimeException { - static final long serialVersionUID = 32L; - - CpException(String s) { - super(s); - } - } } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/BoundLocalVariable.java b/src/java.base/share/classes/jdk/internal/classfile/impl/BoundLocalVariable.java index a5953c86f5dcc..3bbcd243cc11e 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/BoundLocalVariable.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/BoundLocalVariable.java @@ -46,7 +46,7 @@ public Utf8Entry type() { @Override public ClassDesc typeSymbol() { - return ClassDesc.ofDescriptor(type().stringValue()); + return Util.fieldTypeSymbol(type()); } @Override diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java index 84ddd09b990ec..bc6ab555ae597 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java @@ -53,7 +53,6 @@ public final class BufferedMethodBuilder private AccessFlags flags; private final MethodModel original; private int[] parameterSlots; - MethodTypeDesc mDesc; public BufferedMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, @@ -102,14 +101,7 @@ public Utf8Entry methodType() { @Override public MethodTypeDesc methodTypeSymbol() { - if (mDesc == null) { - if (original instanceof MethodInfo mi) { - mDesc = mi.methodTypeSymbol(); - } else { - mDesc = MethodTypeDesc.ofDescriptor(methodType().stringValue()); - } - } - return mDesc; + return Util.methodTypeSymbol(methodType()); } @Override diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/ChainedClassBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/ChainedClassBuilder.java index 50c1590e8a271..8f05f20d739be 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/ChainedClassBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/ChainedClassBuilder.java @@ -79,15 +79,6 @@ public ClassBuilder withMethod(Utf8Entry name, Utf8Entry descriptor, int flags, return this; } - @Override - public ClassBuilder withMethod(String name, MethodTypeDesc descriptor, int flags, Consumer handler) { - var mb = new BufferedMethodBuilder(terminal.constantPool, terminal.context, - constantPool().utf8Entry(name), constantPool().utf8Entry(descriptor), flags, null); - mb.mDesc = descriptor; - consumer.accept(mb.run(handler).toModel()); - return this; - } - @Override public ClassBuilder transformMethod(MethodModel method, MethodTransform transform) { BufferedMethodBuilder builder = new BufferedMethodBuilder(terminal.constantPool, terminal.context, diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectClassBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectClassBuilder.java index 7d67ed272aff2..6901ae7e24cf9 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectClassBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectClassBuilder.java @@ -90,14 +90,6 @@ public ClassBuilder withFlags(int flags) { return this; } - @Override - public ClassBuilder withField(String name, - ClassDesc descriptor, - int flags) { - return withField(new DirectFieldBuilder(constantPool, context, - constantPool.utf8Entry(name), constantPool.utf8Entry(descriptor), flags, null)); - } - @Override public ClassBuilder withField(Utf8Entry name, Utf8Entry descriptor, @@ -130,13 +122,6 @@ public ClassBuilder withMethod(Utf8Entry name, .run(handler)); } - @Override - public ClassBuilder withMethod(String name, MethodTypeDesc descriptor, int flags, Consumer handler) { - var method = new DirectMethodBuilder(constantPool, context, constantPool.utf8Entry(name), constantPool.utf8Entry(descriptor), flags, null); - method.mDesc = descriptor; - return withMethod(method.run(handler)); - } - @Override public ClassBuilder transformMethod(MethodModel method, MethodTransform transform) { DirectMethodBuilder builder = new DirectMethodBuilder(constantPool, context, method.methodName(), diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectMethodBuilder.java b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectMethodBuilder.java index fac6b7384e2fc..ec4e148baf30d 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/DirectMethodBuilder.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/DirectMethodBuilder.java @@ -46,7 +46,6 @@ public final class DirectMethodBuilder final Utf8Entry desc; int flags; int[] parameterSlots; - MethodTypeDesc mDesc; public DirectMethodBuilder(SplitConstantPool constantPool, ClassFileImpl context, @@ -87,14 +86,7 @@ public Utf8Entry methodType() { @Override public MethodTypeDesc methodTypeSymbol() { - if (mDesc == null) { - if (original instanceof MethodInfo mi) { - mDesc = mi.methodTypeSymbol(); - } else { - mDesc = MethodTypeDesc.ofDescriptor(methodType().stringValue()); - } - } - return mDesc; + return Util.methodTypeSymbol(methodType()); } @Override diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java b/src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java index 4270dbf79a36f..d5ebbbebe7ada 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java @@ -33,10 +33,10 @@ * element is the hash and the second is the mapped index. To look something up * in the map, provide a hash value and an index to map it to, and invoke * firstToken(hash). This returns an opaque token that can be provided to - * nextToken(hash, token) to get the next candidate, or to getElementByToken(token) - * or getIndexByToken to get the mapped element or index. + * nextToken(hash, token) to get the next candidate, or to getIndexByToken to + * get the mapped element or index. */ -public abstract class EntryMap { +public final class EntryMap { public static final int NO_VALUE = -1; /** @@ -77,8 +77,6 @@ public EntryMap(int size, float fillFactor) { data = new int[capacity * 2]; } - protected abstract T fetchElement(int index); - public int firstToken(int hash) { if (hash == 0) throw new IllegalArgumentException("hash must be nonzero"); @@ -110,10 +108,6 @@ public int getIndexByToken(int token) { return data[token + 1]; } - public T getElementByToken(int token) { - return fetchElement(data[token + 1]); - } - public void put(int hash, int index) { if (hash == 0) throw new IllegalArgumentException("hash must be nonzero"); diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/MethodImpl.java b/src/java.base/share/classes/jdk/internal/classfile/impl/MethodImpl.java index 05de881ba297f..8467152504ee5 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/MethodImpl.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/MethodImpl.java @@ -41,7 +41,6 @@ public final class MethodImpl private final int startPos, endPos, attributesPos; private List> attributes; private int[] parameterSlots; - private MethodTypeDesc mDesc; public MethodImpl(ClassReader reader, int startPos, int endPos, int attrStart) { this.reader = reader; @@ -75,10 +74,7 @@ public Utf8Entry methodType() { @Override public MethodTypeDesc methodTypeSymbol() { - if (mDesc == null) { - mDesc = MethodTypeDesc.ofDescriptor(methodType().stringValue()); - } - return mDesc; + return Util.methodTypeSymbol(methodType()); } @Override diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java b/src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java index 4f48c8b731db0..0541e92e5c319 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/SplitConstantPool.java @@ -24,7 +24,7 @@ */ package jdk.internal.classfile.impl; -import java.lang.constant.ConstantDesc; +import java.lang.constant.ClassDesc; import java.lang.constant.MethodTypeDesc; import java.util.Arrays; import java.util.List; @@ -37,6 +37,8 @@ import java.lang.classfile.constantpool.*; import java.util.Objects; +import jdk.internal.constant.ConstantUtils; + import static java.lang.classfile.ClassFile.TAG_CLASS; import static java.lang.classfile.ClassFile.TAG_CONSTANTDYNAMIC; import static java.lang.classfile.ClassFile.TAG_DOUBLE; @@ -63,8 +65,8 @@ public final class SplitConstantPool implements ConstantPoolBuilder { private PoolEntry[] myEntries; private BootstrapMethodEntryImpl[] myBsmEntries; private boolean doneFullScan; - private EntryMap map; - private EntryMap bsmMap; + private EntryMap map; + private EntryMap bsmMap; public SplitConstantPool() { this.size = 1; @@ -178,14 +180,10 @@ void writeTo(BufWriterImpl buf) { } } - private EntryMap map() { + private EntryMap map() { if (map == null) { - map = new EntryMap<>(Math.max(size, 1024), .75f) { - @Override - protected PoolEntry fetchElement(int index) { - return entryByIndex(index); - } - }; + map = new EntryMap(Math.max(size, 1024), .75f); + // Doing a full scan here yields fall-off-the-cliff performance results, // especially if we only need a few entries that are already // inflated (such as attribute names). @@ -220,14 +218,9 @@ private void fullScan() { doneFullScan = true; } - private EntryMap bsmMap() { + private EntryMap bsmMap() { if (bsmMap == null) { - bsmMap = new EntryMap<>(Math.max(bsmSize, 16), .75f) { - @Override - protected BootstrapMethodEntryImpl fetchElement(int index) { - return bootstrapMethodEntry(index); - } - }; + bsmMap = new EntryMap(Math.max(bsmSize, 16), .75f); for (int i=0; i map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == TAG_INTEGER && e instanceof AbstractPoolEntry.IntegerEntryImpl ce && ce.intValue() == val) @@ -285,9 +278,9 @@ private IntegerEntry findIntEntry(int val) { private LongEntry findLongEntry(long val) { int hash = AbstractPoolEntry.hash1(TAG_LONG, Long.hashCode(val)); - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == TAG_LONG && e instanceof AbstractPoolEntry.LongEntryImpl ce && ce.longValue() == val) @@ -302,9 +295,9 @@ private LongEntry findLongEntry(long val) { private FloatEntry findFloatEntry(float val) { int hash = AbstractPoolEntry.hash1(TAG_FLOAT, Float.hashCode(val)); - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == TAG_FLOAT && e instanceof AbstractPoolEntry.FloatEntryImpl ce && ce.floatValue() == val) @@ -319,9 +312,9 @@ private FloatEntry findFloatEntry(float val) { private DoubleEntry findDoubleEntry(double val) { int hash = AbstractPoolEntry.hash1(TAG_DOUBLE, Double.hashCode(val)); - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == TAG_DOUBLE && e instanceof AbstractPoolEntry.DoubleEntryImpl ce && ce.doubleValue() == val) @@ -337,9 +330,9 @@ private DoubleEntry findDoubleEntry(double val) { private AbstractPoolEntry findEntry(int tag, T ref1) { // invariant: canWriteDirect(ref1.constantPool()) int hash = AbstractPoolEntry.hash1(tag, ref1.index()); - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == tag && e instanceof AbstractPoolEntry.AbstractRefEntry re && re.ref1 == ref1) @@ -356,9 +349,9 @@ private AbstractPoolEntry findEntry(int tag, T ref1 AbstractPoolEntry findEntry(int tag, T ref1, U ref2) { // invariant: canWriteDirect(ref1.constantPool()), canWriteDirect(ref2.constantPool()) int hash = AbstractPoolEntry.hash2(tag, ref1.index(), ref2.index()); - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == tag && e instanceof AbstractPoolEntry.AbstractRefsEntry re && re.ref1 == ref1 @@ -374,13 +367,12 @@ AbstractPoolEntry findEntry(int tag, T ref1, U ref2) { } private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, String target) { - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == ClassFile.TAG_UTF8 && e instanceof AbstractPoolEntry.Utf8EntryImpl ce - && ce.hashCode() == hash && target.equals(ce.stringValue())) return ce; } @@ -392,9 +384,9 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, String target) { } private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, AbstractPoolEntry.Utf8EntryImpl target) { - EntryMap map = map(); + EntryMap map = map(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - PoolEntry e = map.getElementByToken(token); + PoolEntry e = entryByIndex(map.getIndexByToken(token)); if (e.tag() == ClassFile.TAG_UTF8 && e instanceof AbstractPoolEntry.Utf8EntryImpl ce && target.equalsUtf8(ce)) @@ -407,11 +399,111 @@ private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8(int hash, AbstractPoolEntry. return null; } + private AbstractPoolEntry.Utf8EntryImpl tryFindUtf8OfRegion(int hash, String target, int start, int end) { + EntryMap map = map(); + while (true) { + for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { + PoolEntry e = entryByIndex(map.getIndexByToken(token)); + if (e.tag() == ClassFile.TAG_UTF8 + && e instanceof AbstractPoolEntry.Utf8EntryImpl ce + && ce.equalsRegion(target, start, end)) + return ce; + } + if (!doneFullScan) { + fullScan(); + continue; + } + return null; + } + } + + private AbstractPoolEntry.ClassEntryImpl tryFindClassOrInterface(int hash, ClassDesc cd) { + while (true) { + EntryMap map = map(); + for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { + PoolEntry e = entryByIndex(map.getIndexByToken(token)); + if (e.tag() == TAG_CLASS + && e instanceof AbstractPoolEntry.ClassEntryImpl ce) { + var esym = ce.sym; + + if (esym != null) { + if (cd.equals(esym)) { + return ce; // definite match + } + continue; // definite mismatch + } + + // no symbol available + var desc = cd.descriptorString(); + if (ce.ref1.equalsRegion(desc, 1, desc.length() - 1)) { + // definite match, propagate symbol + ce.sym = cd; + return ce; + } + // definite mismatch + } + } + if (!doneFullScan) { + fullScan(); + continue; + } + return null; + } + } + + private AbstractPoolEntry.ClassEntryImpl classEntryForClassOrInterface(ClassDesc cd) { + var desc = cd.descriptorString(); + + int hash = AbstractPoolEntry.hashClassFromDescriptor(desc.hashCode()); + var ce = tryFindClassOrInterface(hash, cd); + if (ce != null) + return ce; + + var utfHash = Util.internalNameHash(desc); + var utf = tryFindUtf8OfRegion(AbstractPoolEntry.hashString(utfHash), desc, 1, desc.length() - 1); + if (utf == null) + utf = internalAdd(new AbstractPoolEntry.Utf8EntryImpl(this, size, ConstantUtils.dropFirstAndLastChar(desc), utfHash)); + + return internalAdd(new AbstractPoolEntry.ClassEntryImpl(this, size, utf, hash, cd)); + } + + private AbstractPoolEntry.ClassEntryImpl tryFindClassEntry(int hash, AbstractPoolEntry.Utf8EntryImpl utf8) { + EntryMap map = map(); + for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { + PoolEntry e = entryByIndex(map.getIndexByToken(token)); + if (e.tag() == ClassFile.TAG_CLASS + && e instanceof AbstractPoolEntry.ClassEntryImpl ce + && ce.ref1.equalsUtf8(utf8)) + return ce; + } + if (!doneFullScan) { + fullScan(); + return tryFindClassEntry(hash, utf8); + } + return null; + } + + @Override + public AbstractPoolEntry.Utf8EntryImpl utf8Entry(ClassDesc desc) { + var utf8 = utf8Entry(desc.descriptorString()); + if (utf8.typeSym == null) + utf8.typeSym = desc; + return utf8; + } + + @Override + public Utf8Entry utf8Entry(MethodTypeDesc desc) { + var utf8 = utf8Entry(desc.descriptorString()); + if (utf8.typeSym == null) + utf8.typeSym = desc; + return utf8; + } + @Override public AbstractPoolEntry.Utf8EntryImpl utf8Entry(String s) { - int hash = AbstractPoolEntry.hashString(s.hashCode()); - var ce = tryFindUtf8(hash, s); - return ce == null ? internalAdd(new AbstractPoolEntry.Utf8EntryImpl(this, size, s, hash)) : ce; + int contentHash = s.hashCode(); + var ce = tryFindUtf8(AbstractPoolEntry.hashString(contentHash), s); + return ce == null ? internalAdd(new AbstractPoolEntry.Utf8EntryImpl(this, size, s, contentHash)) : ce; } AbstractPoolEntry.Utf8EntryImpl maybeCloneUtf8Entry(Utf8Entry entry) { @@ -424,9 +516,37 @@ AbstractPoolEntry.Utf8EntryImpl maybeCloneUtf8Entry(Utf8Entry entry) { @Override public AbstractPoolEntry.ClassEntryImpl classEntry(Utf8Entry nameEntry) { - AbstractPoolEntry.Utf8EntryImpl ne = maybeCloneUtf8Entry(nameEntry); - var e = (AbstractPoolEntry.ClassEntryImpl) findEntry(TAG_CLASS, ne); - return e == null ? internalAdd(new AbstractPoolEntry.ClassEntryImpl(this, size, ne)) : e; + var ne = maybeCloneUtf8Entry(nameEntry); + return classEntry(ne, AbstractPoolEntry.isArrayDescriptor(ne)); + } + + AbstractPoolEntry.ClassEntryImpl classEntry(AbstractPoolEntry.Utf8EntryImpl ne, boolean isArray) { + int hash = AbstractPoolEntry.hashClassFromUtf8(isArray, ne); + var e = tryFindClassEntry(hash, ne); + return e == null ? internalAdd(new AbstractPoolEntry.ClassEntryImpl(this, size, ne, hash, + isArray && ne.typeSym instanceof ClassDesc cd ? cd : null)) : e; + } + + @Override + public ClassEntry classEntry(ClassDesc cd) { + if (cd.isClassOrInterface()) { // implicit null check + return classEntryForClassOrInterface(cd); + } + if (cd.isArray()) { + return classEntry(utf8Entry(cd), true); + } + throw new IllegalArgumentException("Cannot be encoded as ClassEntry: " + cd.displayName()); + } + + AbstractPoolEntry.ClassEntryImpl cloneClassEntry(AbstractPoolEntry.ClassEntryImpl e) { + var ce = tryFindClassEntry(e.hashCode(), e.ref1); + if (ce != null) { + return ce; + } + + var utf8 = maybeCloneUtf8Entry(e.ref1); // call order matters + return internalAdd(new AbstractPoolEntry.ClassEntryImpl(this, size, + utf8, e.hashCode(), e.sym)); } @Override @@ -453,45 +573,31 @@ public AbstractPoolEntry.NameAndTypeEntryImpl nameAndTypeEntry(Utf8Entry nameEnt @Override public FieldRefEntry fieldRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) { - AbstractPoolEntry.ClassEntryImpl oe = (AbstractPoolEntry.ClassEntryImpl) owner; - AbstractPoolEntry.NameAndTypeEntryImpl ne = (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType; - if (!canWriteDirect(oe.constantPool)) - oe = classEntry(owner.name()); - if (!canWriteDirect(ne.constantPool)) - ne = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); + var oe = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.ClassEntryImpl) owner); + var ne = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType); var e = (AbstractPoolEntry.FieldRefEntryImpl) findEntry(TAG_FIELDREF, oe, ne); return e == null ? internalAdd(new AbstractPoolEntry.FieldRefEntryImpl(this, size, oe, ne)) : e; } @Override public MethodRefEntry methodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) { - AbstractPoolEntry.ClassEntryImpl oe = (AbstractPoolEntry.ClassEntryImpl) owner; - AbstractPoolEntry.NameAndTypeEntryImpl ne = (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType; - if (!canWriteDirect(oe.constantPool)) - oe = classEntry(owner.name()); - if (!canWriteDirect(ne.constantPool)) - ne = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); + var oe = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.ClassEntryImpl) owner); + var ne = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType); var e = (AbstractPoolEntry.MethodRefEntryImpl) findEntry(TAG_METHODREF, oe, ne); return e == null ? internalAdd(new AbstractPoolEntry.MethodRefEntryImpl(this, size, oe, ne)) : e; } @Override public InterfaceMethodRefEntry interfaceMethodRefEntry(ClassEntry owner, NameAndTypeEntry nameAndType) { - AbstractPoolEntry.ClassEntryImpl oe = (AbstractPoolEntry.ClassEntryImpl) owner; - AbstractPoolEntry.NameAndTypeEntryImpl ne = (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType; - if (!canWriteDirect(oe.constantPool)) - oe = classEntry(owner.name()); - if (!canWriteDirect(ne.constantPool)) - ne = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); + var oe = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.ClassEntryImpl) owner); + var ne = AbstractPoolEntry.maybeClone(this, (AbstractPoolEntry.NameAndTypeEntryImpl) nameAndType); var e = (AbstractPoolEntry.InterfaceMethodRefEntryImpl) findEntry(TAG_INTERFACEMETHODREF, oe, ne); return e == null ? internalAdd(new AbstractPoolEntry.InterfaceMethodRefEntryImpl(this, size, oe, ne)) : e; } @Override public MethodTypeEntry methodTypeEntry(MethodTypeDesc descriptor) { - var ret = (AbstractPoolEntry.MethodTypeEntryImpl)methodTypeEntry(utf8Entry(descriptor.descriptorString())); - ret.sym = descriptor; - return ret; + return methodTypeEntry(utf8Entry(descriptor)); } @Override @@ -503,19 +609,11 @@ public MethodTypeEntry methodTypeEntry(Utf8Entry descriptor) { @Override public MethodHandleEntry methodHandleEntry(int refKind, MemberRefEntry reference) { - if (!canWriteDirect(reference.constantPool())) { - reference = switch (reference.tag()) { - case TAG_FIELDREF -> fieldRefEntry(reference.owner(), reference.nameAndType()); - case TAG_METHODREF -> methodRefEntry(reference.owner(), reference.nameAndType()); - case TAG_INTERFACEMETHODREF -> interfaceMethodRefEntry(reference.owner(), reference.nameAndType()); - default -> throw new IllegalArgumentException(String.format("Bad tag %d", reference.tag())); - }; - } - + reference = AbstractPoolEntry.maybeClone(this, reference); int hash = AbstractPoolEntry.hash2(TAG_METHODHANDLE, refKind, reference.index()); - EntryMap map1 = map(); + EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { - PoolEntry e = map1.getElementByToken(token); + PoolEntry e = entryByIndex(map1.getIndexByToken(token)); if (e.tag() == TAG_METHODHANDLE && e instanceof AbstractPoolEntry.MethodHandleEntryImpl ce && ce.kind() == refKind && ce.reference() == reference) @@ -535,13 +633,12 @@ public InvokeDynamicEntry invokeDynamicEntry(BootstrapMethodEntry bootstrapMetho if (!canWriteDirect(bootstrapMethodEntry.constantPool())) bootstrapMethodEntry = bsmEntry(bootstrapMethodEntry.bootstrapMethod(), bootstrapMethodEntry.arguments()); - if (!canWriteDirect(nameAndType.constantPool())) - nameAndType = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); + nameAndType = AbstractPoolEntry.maybeClone(this, nameAndType); int hash = AbstractPoolEntry.hash2(TAG_INVOKEDYNAMIC, bootstrapMethodEntry.bsmIndex(), nameAndType.index()); - EntryMap map1 = map(); + EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { - PoolEntry e = map1.getElementByToken(token); + PoolEntry e = entryByIndex(map1.getIndexByToken(token)); if (e.tag() == TAG_INVOKEDYNAMIC && e instanceof AbstractPoolEntry.InvokeDynamicEntryImpl ce && ce.bootstrap() == bootstrapMethodEntry && ce.nameAndType() == nameAndType) @@ -566,13 +663,12 @@ public ConstantDynamicEntry constantDynamicEntry(BootstrapMethodEntry bootstrapM if (!canWriteDirect(bootstrapMethodEntry.constantPool())) bootstrapMethodEntry = bsmEntry(bootstrapMethodEntry.bootstrapMethod(), bootstrapMethodEntry.arguments()); - if (!canWriteDirect(nameAndType.constantPool())) - nameAndType = nameAndTypeEntry(nameAndType.name(), nameAndType.type()); + nameAndType = AbstractPoolEntry.maybeClone(this, nameAndType); int hash = AbstractPoolEntry.hash2(TAG_CONSTANTDYNAMIC, bootstrapMethodEntry.bsmIndex(), nameAndType.index()); - EntryMap map1 = map(); + EntryMap map1 = map(); for (int token = map1.firstToken(hash); token != -1; token = map1.nextToken(hash, token)) { - PoolEntry e = map1.getElementByToken(token); + PoolEntry e = entryByIndex(map1.getIndexByToken(token)); if (e.tag() == TAG_CONSTANTDYNAMIC && e instanceof AbstractPoolEntry.ConstantDynamicEntryImpl ce && ce.bootstrap() == bootstrapMethodEntry && ce.nameAndType() == nameAndType) @@ -625,8 +721,7 @@ public StringEntry stringEntry(Utf8Entry utf8) { @Override public BootstrapMethodEntry bsmEntry(MethodHandleEntry methodReference, List arguments) { - if (!canWriteDirect(methodReference.constantPool())) - methodReference = methodHandleEntry(methodReference.kind(), methodReference.reference()); + methodReference = AbstractPoolEntry.maybeClone(this, methodReference); for (LoadableConstantEntry a : arguments) { if (!canWriteDirect(a.constantPool())) { // copy args list @@ -640,9 +735,9 @@ public BootstrapMethodEntry bsmEntry(MethodHandleEntry methodReference, } AbstractPoolEntry.MethodHandleEntryImpl mre = (AbstractPoolEntry.MethodHandleEntryImpl) methodReference; int hash = BootstrapMethodEntryImpl.computeHashCode(mre, arguments); - EntryMap map = bsmMap(); + EntryMap map = bsmMap(); for (int token = map.firstToken(hash); token != -1; token = map.nextToken(hash, token)) { - BootstrapMethodEntryImpl e = map.getElementByToken(token); + BootstrapMethodEntryImpl e = bootstrapMethodEntry(map.getIndexByToken(token)); if (e.bootstrapMethod() == mre && e.arguments().equals(arguments)) { return e; } diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java b/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java index c6564c289d6f5..f5cd9b80af844 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java @@ -1043,34 +1043,37 @@ private void setLocalRawInternal(int index, Type type) { void setLocalsFromArg(String name, MethodTypeDesc methodDesc, boolean isStatic, Type thisKlass) { int localsSize = 0; // Pre-emptively create a locals array that encompass all parameter slots - checkLocal(methodDesc.parameterCount() + (isStatic ? -1 : 0)); + checkLocal(Util.parameterSlots(methodDesc) + (isStatic ? -1 : 0)); + Type type; + Type[] locals = this.locals; if (!isStatic) { - localsSize++; if (OBJECT_INITIALIZER_NAME.equals(name) && !CD_Object.equals(thisKlass.sym)) { - setLocal(0, Type.UNITIALIZED_THIS_TYPE); + type = Type.UNITIALIZED_THIS_TYPE; flags |= FLAG_THIS_UNINIT; } else { - setLocalRawInternal(0, thisKlass); + type = thisKlass; } + locals[localsSize++] = type; } for (int i = 0; i < methodDesc.parameterCount(); i++) { var desc = methodDesc.parameterType(i); - if (!desc.isPrimitive()) { - setLocalRawInternal(localsSize++, Type.referenceType(desc)); - } else switch (desc.descriptorString().charAt(0)) { - case 'J' -> { - setLocalRawInternal(localsSize++, Type.LONG_TYPE); - setLocalRawInternal(localsSize++, Type.LONG2_TYPE); - } - case 'D' -> { - setLocalRawInternal(localsSize++, Type.DOUBLE_TYPE); - setLocalRawInternal(localsSize++, Type.DOUBLE2_TYPE); + if (desc == CD_long) { + locals[localsSize ] = Type.LONG_TYPE; + locals[localsSize + 1] = Type.LONG2_TYPE; + localsSize += 2; + } else if (desc == CD_double) { + locals[localsSize ] = Type.DOUBLE_TYPE; + locals[localsSize + 1] = Type.DOUBLE2_TYPE; + localsSize += 2; + } else { + if (desc instanceof ReferenceClassDescImpl) { + type = Type.referenceType(desc); + } else if (desc == CD_float) { + type = Type.FLOAT_TYPE; + } else { + type = Type.INTEGER_TYPE; } - case 'I', 'Z', 'B', 'C', 'S' -> - setLocalRawInternal(localsSize++, Type.INTEGER_TYPE); - case 'F' -> - setLocalRawInternal(localsSize++, Type.FLOAT_TYPE); - default -> throw new AssertionError("Should not reach here"); + locals[localsSize++] = type; } } this.localsSize = localsSize; diff --git a/src/java.base/share/classes/jdk/internal/classfile/impl/Util.java b/src/java.base/share/classes/jdk/internal/classfile/impl/Util.java index b0f1de65d9291..80d908f6ce749 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/impl/Util.java +++ b/src/java.base/share/classes/jdk/internal/classfile/impl/Util.java @@ -30,6 +30,7 @@ import java.lang.classfile.MethodBuilder; import java.lang.classfile.PseudoInstruction; import java.lang.classfile.constantpool.PoolEntry; +import java.lang.classfile.constantpool.Utf8Entry; import java.lang.constant.ClassDesc; import java.lang.constant.MethodTypeDesc; import java.util.AbstractList; @@ -49,6 +50,7 @@ import java.lang.constant.ModuleDesc; import java.lang.reflect.AccessFlag; import jdk.internal.access.SharedSecrets; +import jdk.internal.vm.annotation.Stable; import static java.lang.classfile.ClassFile.ACC_STATIC; import java.lang.classfile.attribute.CodeAttribute; @@ -220,12 +222,20 @@ public static boolean has(AccessFlag.Location location, int flagsMask, AccessFla return (flag.mask() & flagsMask) == flag.mask() && flag.locations().contains(location); } + public static ClassDesc fieldTypeSymbol(Utf8Entry utf8) { + return ((AbstractPoolEntry.Utf8EntryImpl) utf8).fieldTypeSymbol(); + } + + public static MethodTypeDesc methodTypeSymbol(Utf8Entry utf8) { + return ((AbstractPoolEntry.Utf8EntryImpl) utf8).methodTypeSymbol(); + } + public static ClassDesc fieldTypeSymbol(NameAndTypeEntry nat) { - return ((AbstractPoolEntry.NameAndTypeEntryImpl)nat).fieldTypeSymbol(); + return fieldTypeSymbol(nat.type()); } public static MethodTypeDesc methodTypeSymbol(NameAndTypeEntry nat) { - return ((AbstractPoolEntry.NameAndTypeEntryImpl)nat).methodTypeSymbol(); + return methodTypeSymbol(nat.type()); } @SuppressWarnings("unchecked") @@ -328,4 +338,82 @@ interface Writable { interface WritableLocalVariable { boolean writeLocalTo(BufWriterImpl buf); } + + /** + * Returns the hash code of an internal name given the class or interface L descriptor. + */ + public static int internalNameHash(String desc) { + if (desc.length() > 0xffff) + throw new IllegalArgumentException("String too long: ".concat(Integer.toString(desc.length()))); + return (desc.hashCode() - pow31(desc.length() - 1) * 'L' - ';') * INVERSE_31; + } + + /** + * Returns the hash code of a class or interface L descriptor given the internal name. + */ + public static int descriptorStringHash(int length, int hash) { + if (length > 0xffff) + throw new IllegalArgumentException("String too long: ".concat(Integer.toString(length))); + return 'L' * pow31(length + 1) + hash * 31 + ';'; + } + + // k is at most 65536, length of Utf8 entry + 1 + public static int pow31(int k) { + int r = 1; + // calculate the power contribution from index-th octal digit + // from least to most significant (right to left) + // e.g. decimal 26=octal 32, power(26)=powerOctal(2,0)*powerOctal(3,1) + for (int i = 0; i < SIGNIFICANT_OCTAL_DIGITS; i++) { + r *= powerOctal(k & 7, i); + k >>= 3; + } + return r; + } + + // The inverse of 31 in Z/2^32Z* modulo group, a * INVERSE_31 * 31 = a + static final int INVERSE_31 = 0xbdef7bdf; + + // k is at most 65536 = octal 200000, only consider 6 octal digits + // Note: 31 powers repeat beyond 1 << 27, only 9 octal digits matter + static final int SIGNIFICANT_OCTAL_DIGITS = 6; + + // for base k, storage is k * log_k(N)=k/ln(k) * ln(N) + // k = 2 or 4 is better for space at the cost of more multiplications + /** + * The code below is as if: + * {@snippet lang=java : + * int[] powers = new int[7 * SIGNIFICANT_OCTAL_DIGITS]; + * + * for (int i = 1, k = 31; i <= 7; i++, k *= 31) { + * int t = powers[powersIndex(i, 0)] = k; + * for (int j = 1; j < SIGNIFICANT_OCTAL_DIGITS; j++) { + * t *= t; + * t *= t; + * t *= t; + * powers[powersIndex(i, j)] = t; + * } + * } + * } + * This is converted to explicit initialization to avoid bootstrap overhead. + * Validated in UtilTest. + */ + static final @Stable int[] powers = new int[] { + 0x0000001f, 0x000003c1, 0x0000745f, 0x000e1781, 0x01b4d89f, 0x34e63b41, 0x67e12cdf, + 0x94446f01, 0x50a9de01, 0x84304d01, 0x7dd7bc01, 0x8ca02b01, 0xff899a01, 0x25940901, + 0x4dbf7801, 0xe3bef001, 0xc1fe6801, 0xe87de001, 0x573d5801, 0x0e3cd001, 0x0d7c4801, + 0x54fbc001, 0xb9f78001, 0x2ef34001, 0xb3ef0001, 0x48eac001, 0xede68001, 0xa2e24001, + 0x67de0001, 0xcfbc0001, 0x379a0001, 0x9f780001, 0x07560001, 0x6f340001, 0xd7120001, + 0x3ef00001, 0x7de00001, 0xbcd00001, 0xfbc00001, 0x3ab00001, 0x79a00001, 0xb8900001, + }; + + static int powersIndex(int digit, int index) { + return (digit - 1) + index * 7; + } + + // (31 ^ digit) ^ (8 * index) = 31 ^ (digit * (8 ^ index)) + // digit: 0 - 7 + // index: 0 - SIGNIFICANT_OCTAL_DIGITS - 1 + private static int powerOctal(int digit, int index) { + return digit == 0 ? 1 : powers[powersIndex(digit, index)]; + } } diff --git a/src/java.base/share/classes/jdk/internal/event/ThreadSleepEvent.java b/src/java.base/share/classes/jdk/internal/event/ThreadSleepEvent.java index ab9b377c0f336..283ba4259777f 100644 --- a/src/java.base/share/classes/jdk/internal/event/ThreadSleepEvent.java +++ b/src/java.base/share/classes/jdk/internal/event/ThreadSleepEvent.java @@ -30,14 +30,5 @@ */ public final class ThreadSleepEvent extends Event { - private static final ThreadSleepEvent EVENT = new ThreadSleepEvent(); - - /** - * Returns {@code true} if event is enabled, {@code false} otherwise. - */ - public static boolean isTurnedOn() { - return EVENT.isEnabled(); - } - public long time; } diff --git a/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java b/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java index 83b11b7ce686b..64994af5cb790 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java +++ b/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java @@ -72,8 +72,6 @@ public abstract sealed class AbstractMemorySegmentImpl implements MemorySegment, SegmentAllocator, BiFunction, RuntimeException> permits HeapMemorySegmentImpl, NativeMemorySegmentImpl { - private static final ScopedMemoryAccess SCOPED_MEMORY_ACCESS = ScopedMemoryAccess.getScopedMemoryAccess(); - static final JavaNioAccess NIO_ACCESS = SharedSecrets.getJavaNioAccess(); final long length; @@ -189,53 +187,10 @@ public Stream elements(MemoryLayout elementLayout) { return StreamSupport.stream(spliterator(elementLayout), false); } - // FILL_NATIVE_THRESHOLD must be a power of two and should be greater than 2^3 - // Update the value for Aarch64 once 8338975 is fixed. - private static final long FILL_NATIVE_THRESHOLD = 1L << (Architecture.isAARCH64() ? 10 : 5); - - @Override @ForceInline + @Override public final MemorySegment fill(byte value) { - checkReadOnly(false); - if (length == 0) { - // Implicit state check - checkValidState(); - } else if (length < FILL_NATIVE_THRESHOLD) { - // 0 <= length < FILL_NATIVE_LIMIT : 0...0X...XXXX - - // Handle smaller segments directly without transitioning to native code - final long u = Byte.toUnsignedLong(value); - final long longValue = u << 56 | u << 48 | u << 40 | u << 32 | u << 24 | u << 16 | u << 8 | u; - - int offset = 0; - // 0...0X...X000 - final int limit = (int) (length & (FILL_NATIVE_THRESHOLD - 8)); - for (; offset < limit; offset += 8) { - SCOPED_MEMORY_ACCESS.putLong(sessionImpl(), unsafeGetBase(), unsafeGetOffset() + offset, longValue); - } - int remaining = (int) length - limit; - // 0...0X00 - if (remaining >= 4) { - SCOPED_MEMORY_ACCESS.putInt(sessionImpl(), unsafeGetBase(), unsafeGetOffset() + offset, (int) longValue); - offset += 4; - remaining -= 4; - } - // 0...00X0 - if (remaining >= 2) { - SCOPED_MEMORY_ACCESS.putShort(sessionImpl(), unsafeGetBase(), unsafeGetOffset() + offset, (short) longValue); - offset += 2; - remaining -= 2; - } - // 0...000X - if (remaining == 1) { - SCOPED_MEMORY_ACCESS.putByte(sessionImpl(), unsafeGetBase(), unsafeGetOffset() + offset, value); - } - // We have now fully handled 0...0X...XXXX - } else { - // Handle larger segments via native calls - SCOPED_MEMORY_ACCESS.setMemory(sessionImpl(), unsafeGetBase(), unsafeGetOffset(), length, value); - } - return this; + return SegmentBulkOperations.fill(this, value); } @Override @@ -244,38 +199,6 @@ public MemorySegment allocate(long byteSize, long byteAlignment) { return asSlice(0, byteSize, byteAlignment); } - /** - * Mismatch over long lengths. - */ - public static long vectorizedMismatchLargeForBytes(MemorySessionImpl aSession, MemorySessionImpl bSession, - Object a, long aOffset, - Object b, long bOffset, - long length) { - long off = 0; - long remaining = length; - int i, size; - boolean lastSubRange = false; - while (remaining > 7 && !lastSubRange) { - if (remaining > Integer.MAX_VALUE) { - size = Integer.MAX_VALUE; - } else { - size = (int) remaining; - lastSubRange = true; - } - i = SCOPED_MEMORY_ACCESS.vectorizedMismatch(aSession, bSession, - a, aOffset + off, - b, bOffset + off, - size, ArraysSupport.LOG2_ARRAY_BYTE_INDEX_SCALE); - if (i >= 0) - return off + i; - - i = size - ~i; - off += i; - remaining -= i; - } - return ~remaining; - } - @Override public final ByteBuffer asByteBuffer() { checkArraySize("ByteBuffer", 1); @@ -314,7 +237,7 @@ public final Optional asOverlappingSlice(MemorySegment other) { } @ForceInline - private boolean overlaps(AbstractMemorySegmentImpl that) { + boolean overlaps(AbstractMemorySegmentImpl that) { if (unsafeGetBase() == that.unsafeGetBase()) { // both either native or the same heap segment final long thisStart = this.unsafeGetOffset(); final long thatStart = that.unsafeGetOffset(); @@ -334,7 +257,8 @@ public MemorySegment copyFrom(MemorySegment src) { @Override public long mismatch(MemorySegment other) { Objects.requireNonNull(other); - return MemorySegment.mismatch(this, 0, byteSize(), other, 0, other.byteSize()); + return SegmentBulkOperations.mismatch(this, 0, byteSize(), + (AbstractMemorySegmentImpl) other, 0, other.byteSize()); } @Override @@ -650,64 +574,6 @@ private static Object bufferRef(Buffer buffer) { } } - // COPY_NATIVE_THRESHOLD must be a power of two and should be greater than 2^3 - private static final long COPY_NATIVE_THRESHOLD = 1 << 6; - - @ForceInline - public static void copy(AbstractMemorySegmentImpl src, long srcOffset, - AbstractMemorySegmentImpl dst, long dstOffset, - long size) { - - Utils.checkNonNegativeIndex(size, "size"); - // Implicit null check for src and dst - src.checkAccess(srcOffset, size, true); - dst.checkAccess(dstOffset, size, false); - - if (size <= 0) { - // Do nothing - } else if (size < COPY_NATIVE_THRESHOLD && !src.overlaps(dst)) { - // 0 < size < FILL_NATIVE_LIMIT : 0...0X...XXXX - // - // Strictly, we could check for !src.asSlice(srcOffset, size).overlaps(dst.asSlice(dstOffset, size) but - // this is a bit slower and it likely very unusual there is any difference in the outcome. Also, if there - // is an overlap, we could tolerate one particular direction of overlap (but not the other). - - // 0...0X...X000 - final int limit = (int) (size & (COPY_NATIVE_THRESHOLD - 8)); - int offset = 0; - for (; offset < limit; offset += 8) { - final long v = SCOPED_MEMORY_ACCESS.getLong(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset); - SCOPED_MEMORY_ACCESS.putLong(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v); - } - int remaining = (int) size - offset; - // 0...0X00 - if (remaining >= 4) { - final int v = SCOPED_MEMORY_ACCESS.getInt(src.sessionImpl(), src.unsafeGetBase(),src.unsafeGetOffset() + srcOffset + offset); - SCOPED_MEMORY_ACCESS.putInt(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v); - offset += 4; - remaining -= 4; - } - // 0...00X0 - if (remaining >= 2) { - final short v = SCOPED_MEMORY_ACCESS.getShort(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset); - SCOPED_MEMORY_ACCESS.putShort(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v); - offset += 2; - remaining -=2; - } - // 0...000X - if (remaining == 1) { - final byte v = SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset); - SCOPED_MEMORY_ACCESS.putByte(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v); - } - // We have now fully handled 0...0X...XXXX - } else { - // For larger sizes, the transition to native code pays off - SCOPED_MEMORY_ACCESS.copyMemory(src.sessionImpl(), dst.sessionImpl(), - src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset, - dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset, size); - } - } - @ForceInline public static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset, MemorySegment dstSegment, ValueLayout dstElementLayout, long dstOffset, @@ -794,40 +660,6 @@ public static void copy(Object srcArray, int srcIndex, } } - public static long mismatch(MemorySegment srcSegment, long srcFromOffset, long srcToOffset, - MemorySegment dstSegment, long dstFromOffset, long dstToOffset) { - AbstractMemorySegmentImpl srcImpl = (AbstractMemorySegmentImpl)Objects.requireNonNull(srcSegment); - AbstractMemorySegmentImpl dstImpl = (AbstractMemorySegmentImpl)Objects.requireNonNull(dstSegment); - long srcBytes = srcToOffset - srcFromOffset; - long dstBytes = dstToOffset - dstFromOffset; - srcImpl.checkAccess(srcFromOffset, srcBytes, true); - dstImpl.checkAccess(dstFromOffset, dstBytes, true); - - long bytes = Math.min(srcBytes, dstBytes); - long i = 0; - if (bytes > 7) { - if (srcImpl.get(JAVA_BYTE, srcFromOffset) != dstImpl.get(JAVA_BYTE, dstFromOffset)) { - return 0; - } - i = AbstractMemorySegmentImpl.vectorizedMismatchLargeForBytes(srcImpl.sessionImpl(), dstImpl.sessionImpl(), - srcImpl.unsafeGetBase(), srcImpl.unsafeGetOffset() + srcFromOffset, - dstImpl.unsafeGetBase(), dstImpl.unsafeGetOffset() + dstFromOffset, - bytes); - if (i >= 0) { - return i; - } - long remaining = ~i; - assert remaining < 8 : "remaining greater than 7: " + remaining; - i = bytes - remaining; - } - for (; i < bytes; i++) { - if (srcImpl.get(JAVA_BYTE, srcFromOffset + i) != dstImpl.get(JAVA_BYTE, dstFromOffset + i)) { - return i; - } - } - return srcBytes != dstBytes ? bytes : -1; - } - private static int getScaleFactor(Buffer buffer) { return switch (buffer) { case ByteBuffer _ -> 0; diff --git a/src/java.base/share/classes/jdk/internal/foreign/ConfinedSession.java b/src/java.base/share/classes/jdk/internal/foreign/ConfinedSession.java index 4ff0df787c54f..432b324c1bd09 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/ConfinedSession.java +++ b/src/java.base/share/classes/jdk/internal/foreign/ConfinedSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -28,6 +28,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.annotation.ForceInline; /** @@ -40,15 +41,8 @@ final class ConfinedSession extends MemorySessionImpl { private int asyncReleaseCount = 0; - static final VarHandle ASYNC_RELEASE_COUNT; - - static { - try { - ASYNC_RELEASE_COUNT = MethodHandles.lookup().findVarHandle(ConfinedSession.class, "asyncReleaseCount", int.class); - } catch (Throwable ex) { - throw new ExceptionInInitializerError(ex); - } - } + static final VarHandle ASYNC_RELEASE_COUNT= MhUtil.findVarHandle( + MethodHandles.lookup(), "asyncReleaseCount", int.class); public ConfinedSession(Thread owner) { super(owner, new ConfinedResourceList()); diff --git a/src/java.base/share/classes/jdk/internal/foreign/MappedMemorySegmentImpl.java b/src/java.base/share/classes/jdk/internal/foreign/MappedMemorySegmentImpl.java index e313780a34846..181a560c5f041 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/MappedMemorySegmentImpl.java +++ b/src/java.base/share/classes/jdk/internal/foreign/MappedMemorySegmentImpl.java @@ -72,23 +72,28 @@ public boolean isMapped() { public void load() { if (unmapper != null) { - SCOPED_MEMORY_ACCESS.load(sessionImpl(), min, unmapper.isSync(), length); + SCOPED_MEMORY_ACCESS.load(sessionImpl(), NIO_ACCESS.mappedMemoryUtils(), + min, unmapper.isSync(), length); } } public void unload() { if (unmapper != null) { - SCOPED_MEMORY_ACCESS.unload(sessionImpl(), min, unmapper.isSync(), length); + SCOPED_MEMORY_ACCESS.unload(sessionImpl(), NIO_ACCESS.mappedMemoryUtils(), + min, unmapper.isSync(), length); } } public boolean isLoaded() { - return unmapper == null || SCOPED_MEMORY_ACCESS.isLoaded(sessionImpl(), min, unmapper.isSync(), length); + return unmapper == null || + SCOPED_MEMORY_ACCESS.isLoaded(sessionImpl(), + NIO_ACCESS.mappedMemoryUtils(), min, unmapper.isSync(), length); } public void force() { if (unmapper != null) { - SCOPED_MEMORY_ACCESS.force(sessionImpl(), unmapper.fileDescriptor(), min, unmapper.isSync(), 0, length); + SCOPED_MEMORY_ACCESS.force(sessionImpl(), NIO_ACCESS.mappedMemoryUtils(), + unmapper.fileDescriptor(), min, unmapper.isSync(), 0, length); } } diff --git a/src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java b/src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java index aef62be815160..a12b16ca8b4fa 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java +++ b/src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -36,6 +36,7 @@ import jdk.internal.foreign.GlobalSession.HeapSession; import jdk.internal.misc.ScopedMemoryAccess; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.annotation.ForceInline; /** @@ -57,7 +58,9 @@ public abstract sealed class MemorySessionImpl static final int OPEN = 0; static final int CLOSED = -1; - static final VarHandle STATE; + static final VarHandle STATE = MhUtil.findVarHandle( + MethodHandles.lookup(), "state", int.class); + static final int MAX_FORKS = Integer.MAX_VALUE; static final ScopedMemoryAccess.ScopedAccessError ALREADY_CLOSED = new ScopedMemoryAccess.ScopedAccessError(MemorySessionImpl::alreadyClosed); @@ -69,14 +72,6 @@ public abstract sealed class MemorySessionImpl final Thread owner; int state = OPEN; - static { - try { - STATE = MethodHandles.lookup().findVarHandle(MemorySessionImpl.class, "state", int.class); - } catch (Exception ex) { - throw new ExceptionInInitializerError(ex); - } - } - public Arena asArena() { return new ArenaImpl(this); } diff --git a/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java new file mode 100644 index 0000000000000..30e146a82f49b --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2024, 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. + */ + +package jdk.internal.foreign; + +import jdk.internal.misc.ScopedMemoryAccess; +import jdk.internal.util.Architecture; +import jdk.internal.util.ArraysSupport; +import jdk.internal.vm.annotation.ForceInline; +import sun.security.action.GetIntegerAction; + +import java.lang.foreign.MemorySegment; + +/** + * This class contains optimized bulk operation methods that operate on one or several + * memory segments. + *

      + * Generally, the methods attempt to work with as-large-as-possible units of memory at + * a time. + *

      + * It should be noted that when invoking scoped memory access get/set operations, it + * is imperative from a performance perspective to convey the sharp types from the + * call site in order for the compiler to pick the correct Unsafe access variant. + */ +public final class SegmentBulkOperations { + + private SegmentBulkOperations() {} + + private static final ScopedMemoryAccess SCOPED_MEMORY_ACCESS = ScopedMemoryAccess.getScopedMemoryAccess(); + + // All the threshold values below MUST be a power of two and should preferably be + // greater or equal to 2^3. + + // Update the FILL value for Aarch64 once 8338975 is fixed. + private static final int NATIVE_THRESHOLD_FILL = powerOfPropertyOr("fill", Architecture.isAARCH64() ? 10 : 5); + private static final int NATIVE_THRESHOLD_MISMATCH = powerOfPropertyOr("mismatch", 6); + private static final int NATIVE_THRESHOLD_COPY = powerOfPropertyOr("copy", 6); + + @ForceInline + public static MemorySegment fill(AbstractMemorySegmentImpl dst, byte value) { + dst.checkReadOnly(false); + if (dst.length == 0) { + // Implicit state check + dst.checkValidState(); + } else if (dst.length < NATIVE_THRESHOLD_FILL) { + // 0 <= length < FILL_NATIVE_LIMIT : 0...0X...XXXX + + // Handle smaller segments directly without transitioning to native code + final long u = Byte.toUnsignedLong(value); + final long longValue = u << 56 | u << 48 | u << 40 | u << 32 | u << 24 | u << 16 | u << 8 | u; + + int offset = 0; + // 0...0X...X000 + final int limit = (int) (dst.length & (NATIVE_THRESHOLD_FILL - 8)); + for (; offset < limit; offset += 8) { + SCOPED_MEMORY_ACCESS.putLongUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + offset, longValue, !Architecture.isLittleEndian()); + } + int remaining = (int) dst.length - limit; + // 0...0X00 + if (remaining >= 4) { + SCOPED_MEMORY_ACCESS.putIntUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + offset, (int) longValue, !Architecture.isLittleEndian()); + offset += 4; + remaining -= 4; + } + // 0...00X0 + if (remaining >= 2) { + SCOPED_MEMORY_ACCESS.putShortUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + offset, (short) longValue, !Architecture.isLittleEndian()); + offset += 2; + remaining -= 2; + } + // 0...000X + if (remaining == 1) { + SCOPED_MEMORY_ACCESS.putByte(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + offset, value); + } + // We have now fully handled 0...0X...XXXX + } else { + // Handle larger segments via native calls + SCOPED_MEMORY_ACCESS.setMemory(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset(), dst.length, value); + } + return dst; + } + + @ForceInline + public static void copy(AbstractMemorySegmentImpl src, long srcOffset, + AbstractMemorySegmentImpl dst, long dstOffset, + long size) { + + Utils.checkNonNegativeIndex(size, "size"); + // Implicit null check for src and dst + src.checkAccess(srcOffset, size, true); + dst.checkAccess(dstOffset, size, false); + + if (size <= 0) { + // Do nothing + } else if (size < NATIVE_THRESHOLD_COPY && !src.overlaps(dst)) { + // 0 < size < FILL_NATIVE_LIMIT : 0...0X...XXXX + // + // Strictly, we could check for !src.asSlice(srcOffset, size).overlaps(dst.asSlice(dstOffset, size) but + // this is a bit slower and it likely very unusual there is any difference in the outcome. Also, if there + // is an overlap, we could tolerate one particular direction of overlap (but not the other). + + // 0...0X...X000 + final int limit = (int) (size & (NATIVE_THRESHOLD_COPY - 8)); + int offset = 0; + for (; offset < limit; offset += 8) { + final long v = SCOPED_MEMORY_ACCESS.getLongUnaligned(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset, !Architecture.isLittleEndian()); + SCOPED_MEMORY_ACCESS.putLongUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v, !Architecture.isLittleEndian()); + } + int remaining = (int) size - offset; + // 0...0X00 + if (remaining >= 4) { + final int v = SCOPED_MEMORY_ACCESS.getIntUnaligned(src.sessionImpl(), src.unsafeGetBase(),src.unsafeGetOffset() + srcOffset + offset, !Architecture.isLittleEndian()); + SCOPED_MEMORY_ACCESS.putIntUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v, !Architecture.isLittleEndian()); + offset += 4; + remaining -= 4; + } + // 0...00X0 + if (remaining >= 2) { + final short v = SCOPED_MEMORY_ACCESS.getShortUnaligned(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset, !Architecture.isLittleEndian()); + SCOPED_MEMORY_ACCESS.putShortUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v, !Architecture.isLittleEndian()); + offset += 2; + remaining -=2; + } + // 0...000X + if (remaining == 1) { + final byte v = SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset + offset); + SCOPED_MEMORY_ACCESS.putByte(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset + offset, v); + } + // We have now fully handled 0...0X...XXXX + } else { + // For larger sizes, the transition to native code pays off + SCOPED_MEMORY_ACCESS.copyMemory(src.sessionImpl(), dst.sessionImpl(), + src.unsafeGetBase(), src.unsafeGetOffset() + srcOffset, + dst.unsafeGetBase(), dst.unsafeGetOffset() + dstOffset, size); + } + } + + @ForceInline + public static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset, long srcToOffset, + AbstractMemorySegmentImpl dst, long dstFromOffset, long dstToOffset) { + final long srcBytes = srcToOffset - srcFromOffset; + final long dstBytes = dstToOffset - dstFromOffset; + src.checkAccess(srcFromOffset, srcBytes, true); + dst.checkAccess(dstFromOffset, dstBytes, true); + + final long length = Math.min(srcBytes, dstBytes); + final boolean srcAndDstBytesDiffer = srcBytes != dstBytes; + + if (length == 0) { + return srcAndDstBytesDiffer ? 0 : -1; + } else if (length < NATIVE_THRESHOLD_MISMATCH) { + return mismatch(src, srcFromOffset, dst, dstFromOffset, 0, (int) length, srcAndDstBytesDiffer); + } else { + long i; + if (SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset) != + SCOPED_MEMORY_ACCESS.getByte(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset)) { + return 0; + } + i = vectorizedMismatchLargeForBytes(src.sessionImpl(), dst.sessionImpl(), + src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset, + dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset, + length); + if (i >= 0) { + return i; + } + final long remaining = ~i; + assert remaining < 8 : "remaining greater than 7: " + remaining; + i = length - remaining; + return mismatch(src, srcFromOffset + i, dst, dstFromOffset + i, i, (int) remaining, srcAndDstBytesDiffer); + } + } + + // Mismatch is handled in chunks of 64 (unroll of eight 8s), 8, 4, 2, and 1 byte(s). + @ForceInline + private static long mismatch(AbstractMemorySegmentImpl src, long srcFromOffset, + AbstractMemorySegmentImpl dst, long dstFromOffset, + long start, int length, boolean srcAndDstBytesDiffer) { + int offset = 0; + final int limit = length & (NATIVE_THRESHOLD_MISMATCH - 8); + for (; offset < limit; offset += 8) { + final long s = SCOPED_MEMORY_ACCESS.getLongUnaligned(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset + offset, !Architecture.isLittleEndian()); + final long d = SCOPED_MEMORY_ACCESS.getLongUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset + offset, !Architecture.isLittleEndian()); + if (s != d) { + return start + offset + mismatch(s, d); + } + } + int remaining = length - offset; + + // 0...0X00 + if (remaining >= 4) { + final int s = SCOPED_MEMORY_ACCESS.getIntUnaligned(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset + offset, !Architecture.isLittleEndian()); + final int d = SCOPED_MEMORY_ACCESS.getIntUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset + offset, !Architecture.isLittleEndian()); + if (s != d) { + return start + offset + mismatch(s, d); + } + offset += 4; + remaining -= 4; + } + // 0...00X0 + if (remaining >= 2) { + final short s = SCOPED_MEMORY_ACCESS.getShortUnaligned(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset + offset, !Architecture.isLittleEndian()); + final short d = SCOPED_MEMORY_ACCESS.getShortUnaligned(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset + offset, !Architecture.isLittleEndian()); + if (s != d) { + return start + offset + mismatch(s, d); + } + offset += 2; + remaining -= 2; + } + // 0...000X + if (remaining == 1) { + final byte s = SCOPED_MEMORY_ACCESS.getByte(src.sessionImpl(), src.unsafeGetBase(), src.unsafeGetOffset() + srcFromOffset + offset); + final byte d = SCOPED_MEMORY_ACCESS.getByte(dst.sessionImpl(), dst.unsafeGetBase(), dst.unsafeGetOffset() + dstFromOffset + offset); + if (s != d) { + return start + offset; + } + } + return srcAndDstBytesDiffer ? (start + length) : -1; + // We have now fully handled 0...0X...XXXX + } + + @ForceInline + private static int mismatch(long first, long second) { + final long x = first ^ second; + return (Architecture.isLittleEndian() + ? Long.numberOfTrailingZeros(x) + : Long.numberOfLeadingZeros(x)) / 8; + } + + @ForceInline + private static int mismatch(int first, int second) { + final int x = first ^ second; + return (Architecture.isLittleEndian() + ? Integer.numberOfTrailingZeros(x) + : Integer.numberOfLeadingZeros(x)) / 8; + } + + @ForceInline + private static int mismatch(short first, short second) { + if (Architecture.isLittleEndian()) { + return ((0xff & first) == (0xff & second)) ? 1 : 0; + } else { + return ((0xff & first) == (0xff & second)) ? 0 : 1; + } + } + + /** + * Mismatch over long lengths. + */ + private static long vectorizedMismatchLargeForBytes(MemorySessionImpl aSession, MemorySessionImpl bSession, + Object a, long aOffset, + Object b, long bOffset, + long length) { + long off = 0; + long remaining = length; + int i, size; + boolean lastSubRange = false; + while (remaining > 7 && !lastSubRange) { + if (remaining > Integer.MAX_VALUE) { + size = Integer.MAX_VALUE; + } else { + size = (int) remaining; + lastSubRange = true; + } + i = SCOPED_MEMORY_ACCESS.vectorizedMismatch(aSession, bSession, + a, aOffset + off, + b, bOffset + off, + size, ArraysSupport.LOG2_ARRAY_BYTE_INDEX_SCALE); + if (i >= 0) + return off + i; + + i = size - ~i; + off += i; + remaining -= i; + } + return ~remaining; + } + + static final String PROPERTY_PATH = "java.lang.foreign.native.threshold.power."; + + // The returned value is in the interval [0, 2^30] + static int powerOfPropertyOr(String name, int defaultPower) { + final int power = GetIntegerAction.privilegedGetProperty(PROPERTY_PATH + name, defaultPower); + return 1 << Math.clamp(power, 0, Integer.SIZE - 2); + } + +} diff --git a/src/java.base/share/classes/jdk/internal/foreign/SharedSession.java b/src/java.base/share/classes/jdk/internal/foreign/SharedSession.java index 1569589ef9b81..6c9666c2b58fc 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/SharedSession.java +++ b/src/java.base/share/classes/jdk/internal/foreign/SharedSession.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -28,6 +28,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import jdk.internal.misc.ScopedMemoryAccess; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.annotation.ForceInline; /** @@ -91,15 +92,8 @@ void justClose() { */ static class SharedResourceList extends ResourceList { - static final VarHandle FST; - - static { - try { - FST = MethodHandles.lookup().findVarHandle(ResourceList.class, "fst", ResourceCleanup.class); - } catch (Throwable ex) { - throw new ExceptionInInitializerError(); - } - } + static final VarHandle FST = MhUtil.findVarHandle( + MethodHandles.lookup(), ResourceList.class, "fst", ResourceCleanup.class); @Override void add(ResourceCleanup cleanup) { diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/DowncallLinker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/DowncallLinker.java index 44fee62cb6fbe..c56cca3091221 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/DowncallLinker.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/DowncallLinker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -26,6 +26,7 @@ import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; import sun.security.action.GetPropertyAction; import java.lang.foreign.AddressLayout; @@ -38,7 +39,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; import java.util.stream.Stream; import jdk.internal.foreign.AbstractMemorySegmentImpl; @@ -56,18 +56,11 @@ public class DowncallLinker { private static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); - private static final MethodHandle MH_INVOKE_INTERP_BINDINGS; - private static final MethodHandle EMPTY_OBJECT_ARRAY_HANDLE = MethodHandles.constant(Object[].class, new Object[0]); + private static final MethodHandle MH_INVOKE_INTERP_BINDINGS = MhUtil.findVirtual( + MethodHandles.lookup(), DowncallLinker.class, "invokeInterpBindings", + methodType(Object.class, SegmentAllocator.class, Object[].class, InvocationData.class)); - static { - try { - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MH_INVOKE_INTERP_BINDINGS = lookup.findVirtual(DowncallLinker.class, "invokeInterpBindings", - methodType(Object.class, SegmentAllocator.class, Object[].class, InvocationData.class)); - } catch (ReflectiveOperationException e) { - throw new RuntimeException(e); - } - } + private static final MethodHandle EMPTY_OBJECT_ARRAY_HANDLE = MethodHandles.constant(Object[].class, new Object[0]); private final ABIDescriptor abi; private final CallingSequence callingSequence; diff --git a/src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java b/src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java index 796f0027158f1..b1821ba1d1afb 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java +++ b/src/java.base/share/classes/jdk/internal/foreign/layout/AbstractLayout.java @@ -27,6 +27,7 @@ import jdk.internal.foreign.LayoutPath; import jdk.internal.foreign.Utils; +import jdk.internal.invoke.MhUtil; import java.lang.foreign.GroupLayout; import java.lang.foreign.MemoryLayout; @@ -157,15 +158,9 @@ public long scale(long offset, long index) { public MethodHandle scaleHandle() { class Holder { - static final MethodHandle MH_SCALE; - static { - try { - MH_SCALE = MethodHandles.lookup().findVirtual(MemoryLayout.class, "scale", - MethodType.methodType(long.class, long.class, long.class)); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } + static final MethodHandle MH_SCALE = MhUtil.findVirtual( + MethodHandles.lookup(), MemoryLayout.class, "scale", + MethodType.methodType(long.class, long.class, long.class)); } return Holder.MH_SCALE.bindTo(this); } diff --git a/src/java.base/share/classes/jdk/internal/invoke/MhUtil.java b/src/java.base/share/classes/jdk/internal/invoke/MhUtil.java new file mode 100644 index 0000000000000..16a4e10221c66 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/invoke/MhUtil.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024, 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. + */ + +package jdk.internal.invoke; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.invoke.VarHandle; + +/** + * Static factories for certain VarHandle/MethodHandle variants. + *

      + * The methods will throw an {@link InternalError} if the lookup fails. + *

      + * Here is an example of how one of these methods could be used: + * {@snippet lang=java + * static MethodHandle BAR_HANDLE = + * MhUtil.findVirtual(MethodHandles.lookup(), + * Foo.class,"bar",MethodType.methodType(int.class)); + * } + */ +public final class MhUtil { + + private MhUtil() {} + + public static VarHandle findVarHandle(MethodHandles.Lookup lookup, + String name, + Class type) { + return findVarHandle(lookup, lookup.lookupClass(), name, type); + } + + public static VarHandle findVarHandle(MethodHandles.Lookup lookup, + Class recv, + String name, + Class type) { + try { + return lookup.findVarHandle(recv, name, type); + } catch (ReflectiveOperationException e) { + throw new InternalError(e); + } + } + + + public static MethodHandle findVirtual(MethodHandles.Lookup lookup, + Class refc, + String name, + MethodType type) { + try { + return lookup.findVirtual(refc, name, type); + } catch (ReflectiveOperationException e) { + throw new InternalError(e); + } + } + +} diff --git a/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java b/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java index e9c75d4a3b2fc..8bf38b7973489 100644 --- a/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java +++ b/src/java.base/share/classes/jdk/internal/misc/ThreadFlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -36,6 +36,7 @@ import java.util.stream.Stream; import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; import jdk.internal.vm.ScopedValueContainer; import jdk.internal.vm.ThreadContainer; import jdk.internal.vm.ThreadContainers; @@ -84,13 +85,9 @@ public class ThreadFlock implements AutoCloseable { private static final VarHandle THREAD_COUNT; private static final VarHandle PERMIT; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - THREAD_COUNT = l.findVarHandle(ThreadFlock.class, "threadCount", int.class); - PERMIT = l.findVarHandle(ThreadFlock.class, "permit", boolean.class); - } catch (Exception e) { - throw new InternalError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + THREAD_COUNT = MhUtil.findVarHandle(l, "threadCount", int.class); + PERMIT = MhUtil.findVarHandle(l, "permit", boolean.class); } private final Set threads = ConcurrentHashMap.newKeySet(); diff --git a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template index e3f8787e9e6f4..a1116e1df388c 100644 --- a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template +++ b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template @@ -34,6 +34,7 @@ import java.lang.ref.Reference; import java.io.FileDescriptor; import java.util.function.Supplier; +import jdk.internal.access.foreign.MappedMemoryUtilsProxy; import jdk.internal.access.JavaNioAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.foreign.AbstractMemorySegmentImpl; @@ -237,84 +238,84 @@ public class ScopedMemoryAccess { } @ForceInline - public boolean isLoaded(MemorySessionImpl session, long address, boolean isSync, long size) { + public boolean isLoaded(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { - return isLoadedInternal(session, address, isSync, size); + return isLoadedInternal(session, mappedUtils, address, isSync, size); } catch (ScopedAccessError ex) { throw ex.newRuntimeException(); } } @ForceInline @Scoped - public boolean isLoadedInternal(MemorySessionImpl session, long address, boolean isSync, long size) { + public boolean isLoadedInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { if (session != null) { session.checkValidStateRaw(); } - return SharedSecrets.getJavaNioAccess().isLoaded(address, isSync, size); + return mappedUtils.isLoaded(address, isSync, size); } finally { Reference.reachabilityFence(session); } } @ForceInline - public void load(MemorySessionImpl session, long address, boolean isSync, long size) { + public void load(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { - loadInternal(session, address, isSync, size); + loadInternal(session, mappedUtils, address, isSync, size); } catch (ScopedAccessError ex) { throw ex.newRuntimeException(); } } @ForceInline @Scoped - public void loadInternal(MemorySessionImpl session, long address, boolean isSync, long size) { + public void loadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { if (session != null) { session.checkValidStateRaw(); } - SharedSecrets.getJavaNioAccess().load(address, isSync, size); + mappedUtils.load(address, isSync, size); } finally { Reference.reachabilityFence(session); } } @ForceInline - public void unload(MemorySessionImpl session, long address, boolean isSync, long size) { + public void unload(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { - unloadInternal(session, address, isSync, size); + unloadInternal(session, mappedUtils, address, isSync, size); } catch (ScopedAccessError ex) { throw ex.newRuntimeException(); } } @ForceInline @Scoped - public void unloadInternal(MemorySessionImpl session, long address, boolean isSync, long size) { + public void unloadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) { try { if (session != null) { session.checkValidStateRaw(); } - SharedSecrets.getJavaNioAccess().unload(address, isSync, size); + mappedUtils.unload(address, isSync, size); } finally { Reference.reachabilityFence(session); } } @ForceInline - public void force(MemorySessionImpl session, FileDescriptor fd, long address, boolean isSync, long index, long length) { + public void force(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, FileDescriptor fd, long address, boolean isSync, long index, long length) { try { - forceInternal(session, fd, address, isSync, index, length); + forceInternal(session, mappedUtils, fd, address, isSync, index, length); } catch (ScopedAccessError ex) { throw ex.newRuntimeException(); } } @ForceInline @Scoped - public void forceInternal(MemorySessionImpl session, FileDescriptor fd, long address, boolean isSync, long index, long length) { + public void forceInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, FileDescriptor fd, long address, boolean isSync, long index, long length) { try { if (session != null) { session.checkValidStateRaw(); } - SharedSecrets.getJavaNioAccess().force(fd, address, isSync, index, length); + mappedUtils.force(fd, address, isSync, index, length); } finally { Reference.reachabilityFence(session); } diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java index facff0d6fdce8..04d607d06bb21 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java @@ -205,12 +205,11 @@ private static ModuleLayer boot2() { boolean haveModulePath = (appModulePath != null || upgradeModulePath != null); boolean needResolution = true; - boolean canArchive = false; - boolean hasSplitPackages; - boolean hasIncubatorModules; + boolean mayContainSplitPackages = true; + boolean mayContainIncubatorModules = true; - // If the java heap was archived at CDS dump time and the environment - // at dump time matches the current environment then use the archived + // If the java heap was archived at CDS dump time, and the environment + // at dump time matches the current environment, then use the archived // system modules and finder. ArchivedModuleGraph archivedModuleGraph = ArchivedModuleGraph.get(mainModule); if (archivedModuleGraph != null @@ -219,18 +218,20 @@ private static ModuleLayer boot2() { && limitModules.isEmpty() && !isPatched) { systemModuleFinder = archivedModuleGraph.finder(); - hasSplitPackages = archivedModuleGraph.hasSplitPackages(); - hasIncubatorModules = archivedModuleGraph.hasIncubatorModules(); + mayContainSplitPackages = archivedModuleGraph.hasSplitPackages(); + mayContainIncubatorModules = archivedModuleGraph.hasIncubatorModules(); needResolution = (traceOutput != null); } else { if (!haveModulePath && addModules.isEmpty() && limitModules.isEmpty()) { systemModules = SystemModuleFinders.systemModules(mainModule); - if (systemModules != null && !isPatched) { - needResolution = (traceOutput != null); - if (CDS.isDumpingStaticArchive()) - canArchive = true; + if (systemModules != null && !isPatched && traceOutput == null) { + // use pre-generated configuration + needResolution = false; + mayContainSplitPackages = systemModules.hasSplitPackages(); + mayContainIncubatorModules = systemModules.hasIncubatorModules(); } } + if (systemModules == null) { // all system modules are observable systemModules = SystemModuleFinders.allSystemModules(); @@ -244,8 +245,6 @@ private static ModuleLayer boot2() { systemModuleFinder = SystemModuleFinders.ofSystem(); } - hasSplitPackages = systemModules.hasSplitPackages(); - hasIncubatorModules = systemModules.hasIncubatorModules(); // not using the archived module graph - avoid accidental use archivedModuleGraph = null; } @@ -433,7 +432,7 @@ private static ModuleLayer boot2() { } // check for split packages in the modules mapped to the built-in loaders - if (hasSplitPackages || isPatched || haveModulePath) { + if (mayContainSplitPackages) { checkSplitPackages(cf, clf); } @@ -449,7 +448,7 @@ private static ModuleLayer boot2() { // Step 7: Miscellaneous // check incubating status - if (hasIncubatorModules || haveModulePath) { + if (mayContainIncubatorModules) { checkIncubatingStatus(cf); } @@ -462,31 +461,14 @@ private static ModuleLayer boot2() { Counters.add("jdk.module.boot.7.adjustModulesTime"); - // save module finders for later use - if (savedModuleFinder != null) { - unlimitedFinder = new SafeModuleFinder(savedModuleFinder); - if (savedModuleFinder != finder) - limitedFinder = new SafeModuleFinder(finder); - } + // Step 8: CDS dump phase - // If -Xshare:dump and mainModule are specified, check if the mainModule - // is in the runtime image and not on the upgrade module path. If so, - // set canArchive to true so that the module graph can be archived. - if (CDS.isDumpingStaticArchive() && mainModule != null) { - String scheme = systemModuleFinder.find(mainModule) - .stream() - .map(ModuleReference::location) - .flatMap(Optional::stream) - .findAny() - .map(URI::getScheme) - .orElse(null); - if ("jrt".equalsIgnoreCase(scheme)) { - canArchive = true; - } - } + if (CDS.isDumpingStaticArchive() && !haveModulePath && addModules.isEmpty()) { + assert !isPatched; - // Archive module graph and boot layer can be archived at CDS dump time. - if (canArchive) { + // Archive module graph and maybe boot layer + boolean hasSplitPackages = containsSplitPackages(cf); + boolean hasIncubatorModules = containsIncubatorModule(cf); ArchivedModuleGraph.archive(hasSplitPackages, hasIncubatorModules, systemModuleFinder, @@ -498,6 +480,13 @@ private static ModuleLayer boot2() { } } + // save module finders for later use + if (savedModuleFinder != null) { + unlimitedFinder = new SafeModuleFinder(savedModuleFinder); + if (savedModuleFinder != finder) + limitedFinder = new SafeModuleFinder(finder); + } + return bootLayer; } @@ -522,8 +511,18 @@ private static void loadModules(Configuration cf, } /** - * Checks for split packages between modules defined to the built-in class - * loaders. + * Returns true if the configuration contains modules with overlapping packages. + */ + private static boolean containsSplitPackages(Configuration cf) { + boolean found = cf.modules().stream() + .map(m -> m.reference().descriptor().packages()) + .flatMap(Set::stream) + .allMatch(new HashSet<>()::add); + return !found; + } + + /** + * Checks for split packages between modules defined to the built-in class loaders. */ private static void checkSplitPackages(Configuration cf, Function clf) { @@ -820,7 +819,9 @@ private static void addEnableNativeAccess(ModuleLayer layer) { * Grants native access for the given modules in the given layer. * Warns optionally about modules that were specified, but not present in the layer. */ - private static void addEnableNativeAccess(ModuleLayer layer, Set moduleNames, boolean shouldWarn) { + private static void addEnableNativeAccess(ModuleLayer layer, + Set moduleNames, + boolean shouldWarn) { for (String name : moduleNames) { if (name.equals("ALL-UNNAMED")) { JLA.addEnableNativeAccessToAllUnnamed(); @@ -951,6 +952,15 @@ private static String getAndRemoveProperty(String key) { return (String) System.getProperties().remove(key); } + /** + * Returns true if the configuration contains an incubator module. + */ + private static boolean containsIncubatorModule(Configuration cf) { + return cf.modules().stream() + .map(ResolvedModule::reference) + .anyMatch(ModuleResolution::hasIncubatingWarning); + } + /** * Checks incubating status of modules in the configuration */ diff --git a/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java b/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java index f345d4cdb712c..54f0c7c563d47 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java +++ b/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -27,6 +27,7 @@ import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; import jdk.internal.misc.VM; import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.Hidden; @@ -310,17 +311,10 @@ static Object invoke(MethodHandle target, Class caller, Object obj, Object[] } } - static final JavaLangInvokeAccess JLIA; - static final MethodHandle NATIVE_ACCESSOR_INVOKE; - static { - try { - JLIA = SharedSecrets.getJavaLangInvokeAccess(); - NATIVE_ACCESSOR_INVOKE = MethodHandles.lookup().findVirtual(NativeAccessor.class, "invoke", - genericMethodType(1, true)); - } catch (NoSuchMethodException|IllegalAccessException e) { - throw new InternalError(e); - } - } + static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); + static final MethodHandle NATIVE_ACCESSOR_INVOKE = MhUtil.findVirtual( + MethodHandles.lookup(), NativeAccessor.class, "invoke", + genericMethodType(1, true)); } } diff --git a/src/java.base/share/classes/jdk/internal/vm/SharedThreadContainer.java b/src/java.base/share/classes/jdk/internal/vm/SharedThreadContainer.java index 36933ad676918..ef9796b0c7d4a 100644 --- a/src/java.base/share/classes/jdk/internal/vm/SharedThreadContainer.java +++ b/src/java.base/share/classes/jdk/internal/vm/SharedThreadContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -31,6 +31,7 @@ import java.util.stream.Stream; import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.invoke.MhUtil; /** * A "shared" thread container. A shared thread container doesn't have an owner @@ -41,15 +42,9 @@ public class SharedThreadContainer extends ThreadContainer implements AutoClosea private static final VarHandle CLOSED; private static final VarHandle VIRTUAL_THREADS; static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - CLOSED = l.findVarHandle(SharedThreadContainer.class, - "closed", boolean.class); - VIRTUAL_THREADS = l.findVarHandle(SharedThreadContainer.class, - "virtualThreads", Set.class); - } catch (Exception e) { - throw new ExceptionInInitializerError(e); - } + MethodHandles.Lookup l = MethodHandles.lookup(); + CLOSED = MhUtil.findVarHandle(l, "closed", boolean.class); + VIRTUAL_THREADS = MhUtil.findVarHandle(l, "virtualThreads", Set.class); } // name of container, used by toString diff --git a/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/src/java.base/share/classes/sun/launcher/resources/launcher.properties index 71cdb161fc029..f493dfd36b66c 100644 --- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties +++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties @@ -141,9 +141,6 @@ java.launcher.X.usage=\n\ \ -Xcomp forces compilation of methods on first invocation\n\ \ -Xdebug does nothing; deprecated for removal in a future release.\n\ \ -Xdiag show additional diagnostic messages\n\ -\ -Xfuture enable strictest checks, anticipating future default.\n\ -\ This option is deprecated and may be removed in a\n\ -\ future release.\n\ \ -Xint interpreted mode execution only\n\ \ -Xinternalversion\n\ \ displays more detailed JVM version information than the\n\ diff --git a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java index 5fac688b3115e..9f85aec7cd39a 100644 --- a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java @@ -68,13 +68,13 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; import java.util.function.Consumer; import jdk.internal.access.JavaNioAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.ref.CleanerFactory; +import jdk.internal.invoke.MhUtil; import sun.net.ResourceManager; import sun.net.ext.ExtendedSocketOptions; import sun.net.util.IPAddressUtil; @@ -149,15 +149,8 @@ class DatagramChannelImpl private InetSocketAddress initialLocalAddress; // Socket adaptor, created lazily - private static final VarHandle SOCKET; - static { - try { - MethodHandles.Lookup l = MethodHandles.lookup(); - SOCKET = l.findVarHandle(DatagramChannelImpl.class, "socket", DatagramSocket.class); - } catch (Exception e) { - throw new InternalError(e); - } - } + private static final VarHandle SOCKET = MhUtil.findVarHandle( + MethodHandles.lookup(), "socket", DatagramSocket.class); private volatile DatagramSocket socket; // Multicast support diff --git a/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java b/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java index 0759c83be781e..bad68a07cea2b 100644 --- a/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java +++ b/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -106,7 +106,11 @@ public ParameterizedType makeParameterizedType(Type declaration, } public TypeVariable findTypeVariable(String name){ - return getScope().lookup(name); + TypeVariable variable = getScope().lookup(name); + if (variable == null) { + throw new TypeNotPresentException(name, null); + } + return variable; } public Type makeNamedType(String name){ diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 00e40c5f58761..3afd5b2142a5c 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -1132,7 +1132,6 @@ && isKeyStoreRelated(command) } } - KeyStore cakstore = buildTrustedCerts(); // -trustcacerts can be specified on -importcert, -printcert or -printcrl. // Reset it so that warnings on CA cert will remain for other command. if (command != IMPORTCERT && command != PRINTCERT @@ -1141,6 +1140,7 @@ && isKeyStoreRelated(command) } if (trustcacerts) { + KeyStore cakstore = buildTrustedCerts(); if (cakstore != null) { caks = cakstore; } else { diff --git a/src/java.base/share/classes/sun/security/util/Cache.java b/src/java.base/share/classes/sun/security/util/Cache.java index 3d8350c1ecd76..a8449f0fc277f 100644 --- a/src/java.base/share/classes/sun/security/util/Cache.java +++ b/src/java.base/share/classes/sun/security/util/Cache.java @@ -59,7 +59,7 @@ * However, note that because of the way SoftReferences are implemented in * HotSpot at the moment, this may not work perfectly as it clears them fairly * eagerly. Performance may be improved if the Java heap size is set to larger - * value using e.g. java -ms64M -mx128M foo.Test + * value using e.g. java -Xms64M -Xmx128M foo.Test * * Cache sizing: the memory cache is implemented on top of a LinkedHashMap. * In its current implementation, the number of buckets (NOT entries) in diff --git a/src/java.base/share/classes/sun/security/util/PropertyExpander.java b/src/java.base/share/classes/sun/security/util/PropertyExpander.java index 2cc4929e04bbc..e92d57bfee22d 100644 --- a/src/java.base/share/classes/sun/security/util/PropertyExpander.java +++ b/src/java.base/share/classes/sun/security/util/PropertyExpander.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -28,6 +28,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.security.GeneralSecurityException; +import java.util.function.UnaryOperator; /** * A utility class to expand properties embedded in a string. @@ -51,15 +52,31 @@ public ExpandException(String msg) { } } - public static String expand(String value) - throws ExpandException - { + public static String expand(String value) throws ExpandException { return expand(value, false); } - public static String expand(String value, boolean encodeURL) - throws ExpandException - { + public static String expand(String value, boolean encodeURL) + throws ExpandException { + return expand(value, encodeURL, System::getProperty); + } + + /* + * In non-strict mode an undefined property is replaced by an empty string. + */ + public static String expandNonStrict(String value) { + try { + return expand(value, false, key -> System.getProperty(key, "")); + } catch (ExpandException e) { + // should not happen + throw new AssertionError("unexpected expansion error: when " + + "expansion is non-strict, undefined properties should " + + "be replaced by an empty string", e); + } + } + + private static String expand(String value, boolean encodeURL, + UnaryOperator propertiesGetter) throws ExpandException { if (value == null) return null; @@ -105,7 +122,7 @@ public static String expand(String value, boolean encodeURL) if (prop.equals("/")) { sb.append(java.io.File.separatorChar); } else { - String val = System.getProperty(prop); + String val = propertiesGetter.apply(prop); if (val != null) { if (encodeURL) { // encode 'val' unless it's an absolute URI diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java index 3373d3e7a963e..af24b68e00441 100644 --- a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java +++ b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java @@ -264,7 +264,13 @@ private boolean regionFormatFallback(String[] names, int index, Locale l) { } private String toGMTFormat(String id, boolean daylight, Locale l) { - var zr = ZoneInfoFile.getZoneInfo(id).toZoneId().getRules(); + LocaleResources lr = LocaleProviderAdapter.forType(Type.CLDR).getLocaleResources(l); + ResourceBundle fd = lr.getJavaTimeFormatData(); + var zi = ZoneInfoFile.getZoneInfo(id); + if (zi == null) { + return fd.getString("timezone.gmtZeroFormat"); + } + var zr = zi.toZoneId().getRules(); var now = Instant.now(); var saving = zr.getTransitions().reversed().stream() .dropWhile(zot -> zot.getInstant().isAfter(now)) @@ -276,8 +282,6 @@ private String toGMTFormat(String id, boolean daylight, Locale l) { .orElse(0); int offset = (zr.getStandardOffset(now).getTotalSeconds() + (daylight ? saving : 0)) / 60; - LocaleResources lr = LocaleProviderAdapter.forType(Type.CLDR).getLocaleResources(l); - ResourceBundle fd = lr.getJavaTimeFormatData(); if (offset == 0) { return fd.getString("timezone.gmtZeroFormat"); diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security index c537a30960e49..9651ae2d373d4 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -28,6 +28,33 @@ # Properties in this file are typically parsed only once. If any of the # properties are modified, applications should be restarted to ensure the # changes are properly reflected. +# +# The special "include" property can be defined one or multiple times with +# a filesystem path value. The effect of each definition is to include a +# referred security properties file inline, adding all its properties. +# Security properties defined before an include statement may be overridden +# by properties in the included file, if their names match. Conversely, +# properties defined after an include statement may override properties in +# the included file. +# +# Included files, as well as files pointed to by java.security.properties, +# can include other files recursively. Paths may be absolute or relative. +# Each relative path is resolved against the base file containing its +# "include" definition, if local. Paths may contain system properties for +# expansion in the form of ${system.property}. If a system property does +# not have a value, it expands to the empty string. +# +# An error will be thrown if a file cannot be included. This may happen +# if the file cannot be resolved, does not exist, is a directory, there are +# insufficient permissions to read it, it is recursively included more than +# once, or for any other reason. For a secure JDK configuration, it is +# important to review OS write permissions assigned to any file included. +# +# Examples: +# 1) include ${java.home}/conf/security/extra.security +# 2) include extra.security +# 3) include ${java.home}/conf/security/profile${SecurityProfile}.security +# # In this file, various security properties are set for use by # java.security classes. This is where users can statically register diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1 index 5896a07304375..da7fb86099f5a 100644 --- a/src/java.base/share/man/java.1 +++ b/src/java.base/share/man/java.1 @@ -3749,12 +3749,6 @@ future JDK release. They\[aq]re still accepted and acted upon, but a warning is issued when they\[aq]re used. .TP -\f[V]-Xfuture\f[R] -Enables strict class-file format checks that enforce close conformance -to the class-file format specification. -Developers should use this flag when developing new code. -Stricter checks may become the default in future releases. -.TP \f[V]-Xloggc:\f[R]\f[I]filename\f[R] Sets the file to which verbose GC events information should be redirected for logging. @@ -3920,6 +3914,16 @@ of objects reachable from the old generation space into the young generation space. To disable GC of the young generation before each full GC, specify the option \f[V]-XX:-ScavengeBeforeFullGC\f[R]. +.TP +\f[V]-Xfuture\f[R] +Enables strict class-file format checks that enforce close conformance +to the class-file format specification. +Developers should use this flag when developing new code. +Stricter checks may become the default in future releases. +.RS +.PP +Use the option \f[V]-Xverify:all\f[R] instead. +.RE .PP For the lists and descriptions of options removed in previous releases see the \f[I]Removed Java Options\f[R] section in: @@ -4825,7 +4829,7 @@ level to a file called \f[V]gc.txt\f[R] with no decorations. The default configuration for all other messages at level \f[V]warning\f[R] is still in effect. .TP -\f[V]-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024\f[R] +\f[V]-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pid:filecount=5,filesize=1024\f[R] Logs messages tagged with the \f[V]gc\f[R] tag using the \f[V]trace\f[R] level to a rotating file set with 5 files with size 1 MB with the base name \f[V]gctrace.txt\f[R] and uses decorations \f[V]uptimemillis\f[R] diff --git a/src/java.base/share/native/libjli/emessages.h b/src/java.base/share/native/libjli/emessages.h index c74fae7a77b36..342b116bfc70c 100644 --- a/src/java.base/share/native/libjli/emessages.h +++ b/src/java.base/share/native/libjli/emessages.h @@ -103,9 +103,6 @@ #define JRE_ERROR12 "Error: Exec of %s failed" #define JRE_ERROR13 "Error: String processing operation failed" -#define SPC_ERROR1 "Error: Specifying an alternate JDK/JRE version is no longer supported.\n The use of the flag '-version:' is no longer valid.\n Please download and execute the appropriate version." -#define SPC_ERROR2 "Error: Specifying an alternate JDK/JRE is no longer supported.\n The related flags -jre-restrict-search | -jre-no-restrict-search are also no longer valid." - #define DLL_ERROR1 "Error: dl failure on line %d" #define DLL_ERROR2 "Error: failed %s, because %s" #define DLL_ERROR3 "Error: could not find executable %s" diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index 1b4ece834d6e5..ca0bc4df3c7d7 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2024, 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,20 +34,15 @@ /* * One job of the launcher is to remove command line options which the - * vm does not understand and will not process. These options include + * vm does not understand and will not process. These options include * options which select which style of vm is run (e.g. -client and - * -server) as well as options which select the data model to use. + * -server). * Additionally, for tools which invoke an underlying vm "-J-foo" * options are turned into "-foo" options to the vm. This option * filtering is handled in a number of places in the launcher, some of * it in machine-dependent code. In this file, the function * CheckJvmType removes vm style options and TranslateApplicationArgs - * removes "-J" prefixes. The CreateExecutionEnvironment function processes - * and removes -d options. On unix, there is a possibility that the running - * data model may not match to the desired data model, in this case an exec is - * required to start the desired model. If the data models match, then - * ParseArguments will remove the -d flags. If the data models do not match - * the CreateExecutionEnviroment will remove the -d flags. + * removes "-J" prefixes. */ @@ -55,11 +50,12 @@ #include "java.h" #include "jni.h" +#include "stdbool.h" /* * A NOTE TO DEVELOPERS: For performance reasons it is important that - * the program image remain relatively small until after SelectVersion - * CreateExecutionEnvironment have finished their possibly recursive + * the program image remain relatively small until after + * CreateExecutionEnvironment has finished its possibly recursive * processing. Watch everything, but resist all temptations to use Java * interfaces. */ @@ -88,10 +84,10 @@ static jboolean _wc_enabled = JNI_FALSE; static jboolean dumpSharedSpaces = JNI_FALSE; /* -Xshare:dump */ /* - * Entries for splash screen environment variables. - * putenv is performed in SelectVersion. We need - * them in memory until UnsetEnv, so they are made static - * global instead of auto local. + * Values that will be stored into splash screen environment variables. + * putenv is performed to set _JAVA_SPLASH_FILE and _JAVA_SPLASH_JAR + * with these values. We need them in memory until UnsetEnv in + * ShowSplashScreen, so they are made static global instead of auto local. */ static char* splash_file_entry = NULL; static char* splash_jar_entry = NULL; @@ -110,14 +106,14 @@ static jboolean IsJavaArgs(); static void SetJavaLauncherProp(); static void SetClassPath(const char *s); static void SetMainModule(const char *s); -static void SelectVersion(int argc, char **argv, char **main_class); static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, - int *pret, const char *jrepath); + int *pret); static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn); static jstring NewPlatformString(JNIEnv *env, char *s); static jclass LoadMainClass(JNIEnv *env, int mode, char *name); +static void SetupSplashScreenEnvVars(const char *splash_file_path, char *jar_path); static jclass GetApplicationClass(JNIEnv *env); static void TranslateApplicationArgs(int jargc, const char **jargv, int *pargc, char ***pargv); @@ -240,7 +236,6 @@ JLI_Launch(int argc, char ** argv, /* main argc, argv */ { int mode = LM_UNKNOWN; char *what = NULL; - char *main_class = NULL; int ret; InvocationFunctions ifn; jlong start = 0, end = 0; @@ -257,6 +252,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argv */ InitLauncher(javaw); DumpState(); if (JLI_IsTraceLauncher()) { + char *env_in; + if ((env_in = getenv(MAIN_CLASS_ENV_ENTRY)) != NULL) { + printf("Launched through Multiple JRE (mJRE) support\n"); + } int i; printf("Java args:\n"); for (i = 0; i < jargc ; i++) { @@ -269,18 +268,6 @@ JLI_Launch(int argc, char ** argv, /* main argc, argv */ AddOption("-Dsun.java.launcher.diag=true", NULL); } - /* - * SelectVersion() has several responsibilities: - * - * 1) Disallow specification of another JRE. With 1.9, another - * version of the JRE cannot be invoked. - * 2) Allow for a JRE version to invoke JDK 1.9 or later. Since - * all mJRE directives have been stripped from the request but - * the pre 1.9 JRE [ 1.6 thru 1.8 ], it is as if 1.9+ has been - * invoked from the command line. - */ - SelectVersion(argc, argv, &main_class); - CreateExecutionEnvironment(&argc, &argv, jrepath, sizeof(jrepath), jvmpath, sizeof(jvmpath), @@ -323,7 +310,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argv */ /* Parse command line options; if the return value of * ParseArguments is false, the program should exit. */ - if (!ParseArguments(&argc, &argv, &mode, &what, &ret, jrepath)) { + if (!ParseArguments(&argc, &argv, &mode, &what, &ret)) { return(ret); } @@ -1078,167 +1065,6 @@ SetMainModule(const char *s) AddOption(def, NULL); } -/* - * The SelectVersion() routine ensures that an appropriate version of - * the JRE is running. The specification for the appropriate version - * is obtained from either the manifest of a jar file (preferred) or - * from command line options. - * The routine also parses splash screen command line options and - * passes on their values in private environment variables. - */ -static void -SelectVersion(int argc, char **argv, char **main_class) -{ - char *arg; - char *operand; - int jarflag = 0; - int headlessflag = 0; - manifest_info info; - char *splash_file_name = NULL; - char *splash_jar_name = NULL; - char *env_in; - int res; - jboolean has_arg; - - /* - * If the version has already been selected, set *main_class - * with the value passed through the environment (if any) and - * simply return. - */ - - /* - * This environmental variable can be set by mJRE capable JREs - * [ 1.5 thru 1.8 ]. All other aspects of mJRE processing have been - * stripped by those JREs. This environmental variable allows 1.9+ - * JREs to be started by these mJRE capable JREs. - * Note that mJRE directives in the jar manifest file would have been - * ignored for a JRE started by another JRE... - * .. skipped for JRE 1.5 and beyond. - * .. not even checked for pre 1.5. - */ - if ((env_in = getenv(ENV_ENTRY)) != NULL) { - if (*env_in != '\0') - *main_class = JLI_StringDup(env_in); - return; - } - - /* - * Scan through the arguments for options relevant to multiple JRE - * support. Multiple JRE support existed in JRE versions 1.5 thru 1.8. - * - * This capability is no longer available with JRE versions 1.9 and later. - * These command line options are reported as errors. - */ - - argc--; - argv++; - while (argc > 0 && *(arg = *argv) == '-') { - has_arg = IsOptionWithArgument(argc, argv); - if (JLI_StrCCmp(arg, "-version:") == 0) { - JLI_ReportErrorMessage(SPC_ERROR1); - } else if (JLI_StrCmp(arg, "-jre-restrict-search") == 0) { - JLI_ReportErrorMessage(SPC_ERROR2); - } else if (JLI_StrCmp(arg, "-jre-no-restrict-search") == 0) { - JLI_ReportErrorMessage(SPC_ERROR2); - } else { - if (JLI_StrCmp(arg, "-jar") == 0) - jarflag = 1; - if (IsWhiteSpaceOption(arg)) { - if (has_arg) { - argc--; - argv++; - arg = *argv; - } - } - - /* - * Checking for headless toolkit option in the some way as AWT does: - * "true" means true and any other value means false - */ - if (JLI_StrCmp(arg, "-Djava.awt.headless=true") == 0) { - headlessflag = 1; - } else if (JLI_StrCCmp(arg, "-Djava.awt.headless=") == 0) { - headlessflag = 0; - } else if (JLI_StrCCmp(arg, "-splash:") == 0) { - splash_file_name = arg+8; - } - } - argc--; - argv++; - } - if (argc <= 0) { /* No operand? Possibly legit with -[full]version */ - operand = NULL; - } else { - argc--; - operand = *argv++; - } - - /* - * If there is a jar file, read the manifest. If the jarfile can't be - * read, the manifest can't be read from the jar file, or the manifest - * is corrupt, issue the appropriate error messages and exit. - * - * Even if there isn't a jar file, construct a manifest_info structure - * containing the command line information. It's a convenient way to carry - * this data around. - */ - if (jarflag && operand) { - if ((res = JLI_ParseManifest(operand, &info)) != 0) { - if (res == -1) - JLI_ReportErrorMessage(JAR_ERROR2, operand); - else - JLI_ReportErrorMessage(JAR_ERROR3, operand); - exit(1); - } - - /* - * Command line splash screen option should have precedence - * over the manifest, so the manifest data is used only if - * splash_file_name has not been initialized above during command - * line parsing - */ - if (!headlessflag && !splash_file_name && info.splashscreen_image_file_name) { - splash_file_name = info.splashscreen_image_file_name; - splash_jar_name = operand; - } - } else { - info.manifest_version = NULL; - info.main_class = NULL; - info.jre_version = NULL; - info.jre_restrict_search = 0; - } - - /* - * Passing on splash screen info in environment variables - */ - if (splash_file_name && !headlessflag) { - splash_file_entry = JLI_MemAlloc(JLI_StrLen(SPLASH_FILE_ENV_ENTRY "=")+JLI_StrLen(splash_file_name)+1); - JLI_StrCpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "="); - JLI_StrCat(splash_file_entry, splash_file_name); - putenv(splash_file_entry); - } - if (splash_jar_name && !headlessflag) { - splash_jar_entry = JLI_MemAlloc(JLI_StrLen(SPLASH_JAR_ENV_ENTRY "=")+JLI_StrLen(splash_jar_name)+1); - JLI_StrCpy(splash_jar_entry, SPLASH_JAR_ENV_ENTRY "="); - JLI_StrCat(splash_jar_entry, splash_jar_name); - putenv(splash_jar_entry); - } - - - /* - * "Valid" returns (other than unrecoverable errors) follow. Set - * main_class as a side-effect of this routine. - */ - if (info.main_class != NULL) - *main_class = JLI_StringDup(info.main_class); - - if (info.jre_version == NULL) { - JLI_FreeManifest(); - return; - } - -} - /* * Test if the current argv is an option, i.e. with a leading `-` * and followed with an argument without a leading `-`. @@ -1325,12 +1151,14 @@ GetOpt(int *pargc, char ***pargv, char **poption, char **pvalue) { static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, - int *pret, const char *jrepath) + int *pret) { int argc = *pargc; char **argv = *pargv; int mode = LM_UNKNOWN; char *arg = NULL; + bool headless = false; + char *splash_file_path = NULL; // value of "-splash:" option *pret = 0; @@ -1463,21 +1291,18 @@ ParseArguments(int *pargc, char ***pargv, JLI_ShowMessage("%s %s", _launcher_name, GetFullVersion()); return JNI_FALSE; } else if (JLI_StrCmp(arg, "-verbosegc") == 0) { + JLI_ReportErrorMessage(ARG_DEPRECATED, "-verbosegc"); AddOption("-verbose:gc", NULL); - } else if (JLI_StrCmp(arg, "-t") == 0) { - AddOption("-Xt", NULL); - } else if (JLI_StrCmp(arg, "-tm") == 0) { - AddOption("-Xtm", NULL); } else if (JLI_StrCmp(arg, "-debug") == 0) { JLI_ReportErrorMessage(ARG_DEPRECATED, "-debug"); } else if (JLI_StrCmp(arg, "-noclassgc") == 0) { + JLI_ReportErrorMessage(ARG_DEPRECATED, "-noclassgc"); AddOption("-Xnoclassgc", NULL); - } else if (JLI_StrCmp(arg, "-Xfuture") == 0) { - JLI_ReportErrorMessage(ARG_DEPRECATED, "-Xfuture"); - AddOption("-Xverify:all", NULL); } else if (JLI_StrCmp(arg, "-verify") == 0) { + JLI_ReportErrorMessage(ARG_DEPRECATED, "-verify"); AddOption("-Xverify:all", NULL); } else if (JLI_StrCmp(arg, "-verifyremote") == 0) { + JLI_ReportErrorMessage(ARG_DEPRECATED, "-verifyremote"); AddOption("-Xverify:remote", NULL); } else if (JLI_StrCmp(arg, "-noverify") == 0) { /* @@ -1486,20 +1311,16 @@ ParseArguments(int *pargc, char ***pargv, */ AddOption("-Xverify:none", NULL); } else if (JLI_StrCCmp(arg, "-ss") == 0 || - JLI_StrCCmp(arg, "-oss") == 0 || JLI_StrCCmp(arg, "-ms") == 0 || JLI_StrCCmp(arg, "-mx") == 0) { + JLI_ReportErrorMessage("Warning: %.3s option is deprecated" + " and may be removed in a future release.", arg); size_t tmpSize = JLI_StrLen(arg) + 6; char *tmp = JLI_MemAlloc(tmpSize); snprintf(tmp, tmpSize, "-X%s", arg + 1); /* skip '-' */ AddOption(tmp, NULL); - } else if (JLI_StrCmp(arg, "-checksource") == 0 || - JLI_StrCmp(arg, "-cs") == 0 || - JLI_StrCmp(arg, "-noasyncgc") == 0) { - /* No longer supported */ - JLI_ReportErrorMessage(ARG_WARN, arg); } else if (JLI_StrCCmp(arg, "-splash:") == 0) { - ; /* Ignore machine independent options already handled */ + splash_file_path = arg + 8; } else if (JLI_StrCmp(arg, "--disable-@files") == 0) { ; /* Ignore --disable-@files option already handled */ } else if (ProcessPlatformOption(arg)) { @@ -1508,6 +1329,14 @@ ParseArguments(int *pargc, char ***pargv, /* java.class.path set on the command line */ if (JLI_StrCCmp(arg, "-Djava.class.path=") == 0) { _have_classpath = JNI_TRUE; + } else if (JLI_StrCmp(arg, "-Djava.awt.headless=true") == 0) { + /* + * Checking for headless toolkit option in the same way as AWT does: + * "true" means true and any other value means false + */ + headless = true; + } else if (JLI_StrCCmp(arg, "-Djava.awt.headless=") == 0) { + headless = false; } AddOption(arg, NULL); } @@ -1558,9 +1387,82 @@ ParseArguments(int *pargc, char ***pargv, *pmode = mode; + if (!headless) { + char *jar_path = NULL; + if (mode == LM_JAR) { + jar_path = *pwhat; + } + // Not in headless mode. We now set a couple of env variables that + // will be used later by ShowSplashScreen(). + SetupSplashScreenEnvVars(splash_file_path, jar_path); + } + return JNI_TRUE; } +/* + * Sets the relevant environment variables that are subsequently used by + * the ShowSplashScreen() function. The splash_file_path and jar_path parameters + * are used to determine which environment variables to set. + * The splash_file_path is the value that was provided to the "-splash:" option + * when launching java. It may be null, which implies the "-splash:" option wasn't used. + * The jar_path is the value that was provided to the "-jar" option when launching java. + * It too may be null, which implies the "-jar" option wasn't used. + */ +static void +SetupSplashScreenEnvVars(const char *splash_file_path, char *jar_path) { + // Command line specified "-splash:" takes priority over manifest one. + if (splash_file_path) { + // We set up the splash file name as a env variable which then gets + // used when showing the splash screen in ShowSplashScreen(). + + // create the string of the form _JAVA_SPLASH_FILE= + splash_file_entry = JLI_MemAlloc(JLI_StrLen(SPLASH_FILE_ENV_ENTRY "=") + + JLI_StrLen(splash_file_path) + 1); + JLI_StrCpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "="); + JLI_StrCat(splash_file_entry, splash_file_path); + putenv(splash_file_entry); + return; + } + if (!jar_path) { + // no jar to look into for "SplashScreen-Image" manifest attribute + return; + } + // parse the jar's manifest to find any "SplashScreen-Image" + int res = 0; + manifest_info info; + if ((res = JLI_ParseManifest(jar_path, &info)) != 0) { + JLI_FreeManifest(); // cleanup any manifest structure + if (res == -1) { + JLI_ReportErrorMessage(JAR_ERROR2, jar_path); + } else { + JLI_ReportErrorMessage(JAR_ERROR3, jar_path); + } + exit(1); + } + if (!info.splashscreen_image_file_name) { + JLI_FreeManifest(); // cleanup the manifest structure + // no "SplashScreen-Image" in jar's manifest + return; + } + // The jar's manifest had a "Splashscreen-Image" specified. We set up the jar entry name + // and the jar file name as env variables which then get used when showing the splash screen + // in ShowSplashScreen(). + + // create the string of the form _JAVA_SPLASH_FILE= + splash_file_entry = JLI_MemAlloc(JLI_StrLen(SPLASH_FILE_ENV_ENTRY "=") + + JLI_StrLen(info.splashscreen_image_file_name) + 1); + JLI_StrCpy(splash_file_entry, SPLASH_FILE_ENV_ENTRY "="); + JLI_StrCat(splash_file_entry, info.splashscreen_image_file_name); + putenv(splash_file_entry); + // create the string of the form _JAVA_SPLASH_JAR= + splash_jar_entry = JLI_MemAlloc(JLI_StrLen(SPLASH_JAR_ENV_ENTRY "=") + JLI_StrLen(jar_path) + 1); + JLI_StrCpy(splash_jar_entry, SPLASH_JAR_ENV_ENTRY "="); + JLI_StrCat(splash_jar_entry, jar_path); + putenv(splash_jar_entry); + JLI_FreeManifest(); // cleanup the manifest structure +} + /* * Initializes the Java Virtual Machine. Also frees options array when * finished. @@ -2347,7 +2249,7 @@ ShowSplashScreen() * Done with all command line processing and potential re-execs so * clean up the environment. */ - (void)UnsetEnv(ENV_ENTRY); + (void)UnsetEnv(MAIN_CLASS_ENV_ENTRY); (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY); (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY); diff --git a/src/java.base/share/native/libjli/java.h b/src/java.base/share/native/libjli/java.h index f768b58a00150..281964d815f57 100644 --- a/src/java.base/share/native/libjli/java.h +++ b/src/java.base/share/native/libjli/java.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -51,23 +51,19 @@ #define CURRENT_DATA_MODEL (CHAR_BIT * sizeof(void*)) /* - * The following environment variable is used to influence the behavior - * of the jre exec'd through the SelectVersion routine. The command line - * options which specify the version are not passed to the exec'd version, - * because that jre may be an older version which wouldn't recognize them. - * This environment variable is known to this (and later) version and serves - * to suppress the version selection code. This is not only for efficiency, - * but also for correctness, since any command line options have been - * removed which would cause any value found in the manifest to be used. - * This would be incorrect because the command line options are defined - * to take precedence. - * - * The value associated with this environment variable is the MainClass - * name from within the executable jar file (if any). This is strictly a - * performance enhancement to avoid re-reading the jar file manifest. - * + * Older versions of java launcher used to support JRE version selection - specifically, + * the java launcher in JDK 1.8 can be used to launch a java application using a different + * java runtime (older, newer or same version JRE installed at a different location) than + * the one the launcher belongs to. + * That support was discontinued starting JDK 9. However, the JDK 8 launcher can still + * be started with JRE version selection options to launch Java runtimes greater than JDK 8. + * In such cases, the JDK 8 launcher when exec()ing the JDK N launcher, will set and propagate + * the _JAVA_VERSION_SET environment variable. The value of this environment variable is the + * Main-Class name from within the executable jar file (if any). + * The java launcher in the current version of the JDK doesn't use this environment variable + * in any way other than merely using it in debug logging. */ -#define ENV_ENTRY "_JAVA_VERSION_SET" +#define MAIN_CLASS_ENV_ENTRY "_JAVA_VERSION_SET" #define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE" #define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR" diff --git a/src/java.base/share/native/libjli/manifest_info.h b/src/java.base/share/native/libjli/manifest_info.h index ce18d27ebdeed..b3596f43e8236 100644 --- a/src/java.base/share/native/libjli/manifest_info.h +++ b/src/java.base/share/native/libjli/manifest_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -167,10 +167,6 @@ typedef struct zentry { /* Zip file entry */ * Java launcher). */ typedef struct manifest_info { /* Interesting fields from the Manifest */ - char *manifest_version; /* Manifest-Version string */ - char *main_class; /* Main-Class entry */ - char *jre_version; /* Appropriate J2SE release spec */ - char jre_restrict_search; /* Restricted JRE search */ char *splashscreen_image_file_name; /* splashscreen image file */ } manifest_info; diff --git a/src/java.base/share/native/libjli/parse_manifest.c b/src/java.base/share/native/libjli/parse_manifest.c index c351ae8abc1dc..274825a4af5dc 100644 --- a/src/java.base/share/native/libjli/parse_manifest.c +++ b/src/java.base/share/native/libjli/parse_manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -594,10 +594,6 @@ JLI_ParseManifest(char *jarfile, manifest_info *info) )) == -1) { return (-1); } - info->manifest_version = NULL; - info->main_class = NULL; - info->jre_version = NULL; - info->jre_restrict_search = 0; info->splashscreen_image_file_name = NULL; if ((rc = find_file(fd, &entry, manifest_name)) != 0) { close(fd); @@ -610,17 +606,7 @@ JLI_ParseManifest(char *jarfile, manifest_info *info) } lp = manifest; while ((rc = parse_nv_pair(&lp, &name, &value)) > 0) { - if (JLI_StrCaseCmp(name, "Manifest-Version") == 0) { - info->manifest_version = value; - } else if (JLI_StrCaseCmp(name, "Main-Class") == 0) { - info->main_class = value; - } else if (JLI_StrCaseCmp(name, "JRE-Version") == 0) { - /* - * Manifest specification overridden by command line option - * so we will silently override there with no specification. - */ - info->jre_version = 0; - } else if (JLI_StrCaseCmp(name, "Splashscreen-Image") == 0) { + if (JLI_StrCaseCmp(name, "Splashscreen-Image") == 0) { info->splashscreen_image_file_name = value; } } diff --git a/src/java.base/unix/native/libjava/java_props_md.c b/src/java.base/unix/native/libjava/java_props_md.c index 4766a8834729f..4a6d0f7f5a4b5 100644 --- a/src/java.base/unix/native/libjava/java_props_md.c +++ b/src/java.base/unix/native/libjava/java_props_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -521,11 +521,14 @@ GetJavaProperties(JNIEnv *env) { char buf[MAXPATHLEN]; errno = 0; - if (getcwd(buf, sizeof(buf)) == NULL) + if (getcwd(buf, sizeof(buf)) == NULL) { JNU_ThrowByName(env, "java/lang/Error", - "Properties init: Could not determine current working directory."); - else + "Properties init: Could not determine current working directory."); + return NULL; + } + else { sprops.user_dir = strdup(buf); + } } sprops.file_separator = "/"; diff --git a/src/java.base/unix/native/libjli/java_md.c b/src/java.base/unix/native/libjli/java_md.c index 2a1a4e7795a2e..7f2f5638a6b83 100644 --- a/src/java.base/unix/native/libjli/java_md.c +++ b/src/java.base/unix/native/libjli/java_md.c @@ -52,102 +52,86 @@ #endif /* - * Flowchart of launcher execs and options processing on unix + * Following is the high level flow of the launcher + * code residing in the common java.c and this + * unix specific java_md file: * - * The selection of the proper vm shared library to open depends on - * several classes of command line options, including vm "flavor" - * options (-client, -server). - * The vm selection options are not passed to the running - * virtual machine; they must be screened out by the launcher. + * - JLI_Launch function, which is the entry point + * to the launcher, calls CreateExecutionEnvironment. * - * The version specification (if any) is processed first by the - * platform independent routine SelectVersion. This may result in - * the exec of the specified launcher version. + * - CreateExecutionEnvironment does the following + * (not necessarily in this order): + * - determines the relevant JVM type that + * needs to be ultimately created + * - determines the path and asserts the presence + * of libjava and relevant libjvm library + * - removes any JVM selection options from the + * arguments that were passed to the launcher * - * Previously the launcher modified the LD_LIBRARY_PATH appropriately for the - * desired data model path, regardless if data models matched or not. The - * launcher subsequently exec'ed the desired executable, in order to make the - * LD_LIBRARY_PATH path available, for the runtime linker. + * - CreateExecutionEnvironment then determines (by calling + * RequiresSetenv function) if LD_LIBRARY_PATH environment + * variable needs to be set/updated. + * - If LD_LIBRARY_PATH needs to be set/updated, + * then CreateExecutionEnvironment exec()s + * the current process with the appropriate value + * for LD_LIBRARY_PATH. + * - Else if LD_LIBRARY_PATH need not be set or + * updated, then CreateExecutionEnvironment + * returns back. * - * Now, in most cases,the launcher will dlopen the target libjvm.so. All - * required libraries are loaded by the runtime linker, using the - * $RPATH/$ORIGIN baked into the shared libraries at compile time. Therefore, - * in most cases, the launcher will only exec, if the data models are - * mismatched, and will not set any environment variables, regardless of the - * data models. + * - If CreateExecutionEnvironment exec()ed the process + * in the previous step, then the code control for the + * process will again start from the process' entry + * point and JLI_Launch is thus re-invoked and the + * same above sequence of code flow repeats again. + * During this "recursive" call into CreateExecutionEnvironment, + * the implementation of the check for LD_LIBRARY_PATH + * will realize that no further exec() is required and + * the control will return back from CreateExecutionEnvironment. * - * However, if the environment contains a LD_LIBRARY_PATH, this will cause the - * launcher to inspect the LD_LIBRARY_PATH. The launcher will check - * a. if the LD_LIBRARY_PATH's first component is the path to the desired - * libjvm.so - * b. if any other libjvm.so is found in any of the paths. - * If case b is true, then the launcher will set the LD_LIBRARY_PATH to the - * desired JRE and reexec, in order to propagate the environment. + * - The control returns back from CreateExecutionEnvironment + * to JLI_Launch. * - * Main - * (incoming argv) - * | - * \|/ - * CreateExecutionEnvironment - * (determines desired data model) - * | - * | - * \|/ - * Have Desired Model ? --> NO --> Exit(with error) - * | - * | - * \|/ - * YES - * | - * | - * \|/ - * CheckJvmType - * (removes -client, -server, etc.) - * | - * | - * \|/ - * TranslateDashJArgs... - * (Prepare to pass args to vm) - * | - * | - * \|/ - * ParseArguments - * | - * | - * \|/ - * RequiresSetenv - * Is LD_LIBRARY_PATH - * and friends set ? --> NO --> Continue - * YES - * | - * | - * \|/ - * Path is desired JRE ? YES --> Continue - * NO - * | - * | - * \|/ - * Paths have well known - * jvm paths ? --> NO --> Error/Exit - * YES - * | - * | - * \|/ - * Does libjvm.so exist - * in any of them ? --> NO --> Continue - * YES - * | - * | - * \|/ - * Set the LD_LIBRARY_PATH - * | - * | - * \|/ - * Re-exec - * | - * | - * \|/ - * Main + * - JLI_Launch then invokes LoadJavaVM which dlopen()s + * the JVM library and asserts the presence of + * JNI Invocation Functions "JNI_CreateJavaVM", + * "JNI_GetDefaultJavaVMInitArgs" and + * "JNI_GetCreatedJavaVMs" in that library. It then + * sets internal function pointers in the launcher to + * point to those functions. + * + * - JLI_Launch then translates any -J options by + * invoking TranslateApplicationArgs. + * + * - JLI_Launch then invokes ParseArguments to + * parse/process the launcher arguments. + * + * - JLI_Launch then ultimately calls JVMInit. + * + * - JVMInit invokes ShowSplashScreen which displays + * a splash screen for the application, if applicable. + * + * - JVMInit then creates a new thread (T2), in the + * current process, and invokes JavaMain function + * in that new thread. The current thread (T1) then + * waits for the newly launched thread (T2) to complete. + * + * - JavaMain function, in thread T2, before launching + * the application, invokes PostJVMInit. + * + * - PostJVMInit is a no-op and returns back. + * + * - Control then returns back from PostJVMInit into JavaMain, + * which then loads the application's main class and invokes + * the relevant main() Java method. + * + * - JavaMain, in thread T2, then returns back an integer + * result and thread T2 execution ends here. + * + * - The thread T1 in JVMInit, which is waiting on T2 to + * complete, receives the integer result and then propagates + * it as a return value all the way out of the + * JLI_Launch function. */ /* Store the name of the executable once computed */ @@ -221,13 +205,12 @@ ContainsLibJVM(const char *env) { } /* - * Test whether the environment variable needs to be set, see flowchart. + * Test whether the LD_LIBRARY_PATH environment variable needs to be set. */ static jboolean RequiresSetenv(const char *jvmpath) { char jpath[PATH_MAX + 1]; char *llp; - char *dmllp = NULL; char *p; /* a utility pointer */ #ifdef MUSL_LIBC @@ -245,7 +228,7 @@ RequiresSetenv(const char *jvmpath) { llp = getenv("LD_LIBRARY_PATH"); /* no environment variable is a good environment variable */ - if (llp == NULL && dmllp == NULL) { + if (llp == NULL) { return JNI_FALSE; } #ifdef __linux @@ -284,9 +267,6 @@ RequiresSetenv(const char *jvmpath) { if (llp != NULL && ContainsLibJVM(llp)) { return JNI_TRUE; } - if (dmllp != NULL && ContainsLibJVM(dmllp)) { - return JNI_TRUE; - } return JNI_FALSE; } #endif /* SETENV_REQUIRED */ diff --git a/src/java.base/unix/native/libjsig/jsig.c b/src/java.base/unix/native/libjsig/jsig.c index 1a0a6bec892b5..180dd58339358 100644 --- a/src/java.base/unix/native/libjsig/jsig.c +++ b/src/java.base/unix/native/libjsig/jsig.c @@ -42,14 +42,7 @@ #include #include #include - -#if (__STDC_VERSION__ >= 199901L) - #include -#else - #define bool int - #define true 1 - #define false 0 -#endif +#include #define MAX_SIGNALS NSIG diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java b/src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java index 4e844df03f8a0..4ccd1d702bd1b 100644 --- a/src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java +++ b/src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -86,7 +86,7 @@ static String readLink(WindowsPath path) throws IOException { x.rethrowAsIOException(path); } try { - return readLinkImpl(handle); + return readLinkImpl(path, handle); } finally { CloseHandle(handle); } @@ -297,16 +297,18 @@ static String getRealPath(WindowsPath input, boolean resolveLinks) * Returns target of a symbolic link given the handle of an open file * (that should be a link). */ - private static String readLinkImpl(long handle) throws IOException { + private static String readLinkImpl(WindowsPath path, long handle) + throws IOException + { int size = MAXIMUM_REPARSE_DATA_BUFFER_SIZE; try (NativeBuffer buffer = NativeBuffers.getNativeBuffer(size)) { try { DeviceIoControlGetReparsePoint(handle, buffer.address(), size); } catch (WindowsException x) { - // FIXME: exception doesn't have file name + String pathname = path.getPathForExceptionMessage(); if (x.lastError() == ERROR_NOT_A_REPARSE_POINT) - throw new NotLinkException(null, null, x.errorString()); - x.rethrowAsIOException((String)null); + throw new NotLinkException(pathname, null, x.errorString()); + x.rethrowAsIOException(pathname + ": " + x.errorString()); } /* @@ -342,8 +344,8 @@ private static String readLinkImpl(long handle) throws IOException { int tag = (int)unsafe.getLong(buffer.address() + OFFSETOF_REPARSETAG); if (tag != IO_REPARSE_TAG_SYMLINK) { - // FIXME: exception doesn't have file name - throw new NotLinkException(null, null, "Reparse point is not a symbolic link"); + String pathname = path.getPathForExceptionMessage(); + throw new NotLinkException(pathname, null, "Reparse point is not a symbolic link"); } // get offset and length of target diff --git a/src/java.base/windows/native/libjava/java_props_md.c b/src/java.base/windows/native/libjava/java_props_md.c index 5eefb6a9fc9e8..d26d6df1affad 100644 --- a/src/java.base/windows/native/libjava/java_props_md.c +++ b/src/java.base/windows/native/libjava/java_props_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -233,9 +233,6 @@ cpu_isalist(void) SYSTEM_INFO info; GetSystemInfo(&info); switch (info.wProcessorArchitecture) { -#ifdef PROCESSOR_ARCHITECTURE_IA64 - case PROCESSOR_ARCHITECTURE_IA64: return "ia64"; -#endif #ifdef PROCESSOR_ARCHITECTURE_AMD64 case PROCESSOR_ARCHITECTURE_AMD64: return "amd64"; #endif @@ -444,6 +441,8 @@ GetJavaProperties(JNIEnv* env) * where (buildNumber > 17762) * Windows Server 2022 10 0 (!VER_NT_WORKSTATION) * where (buildNumber > 20347) + * Windows Server 2025 10 0 (!VER_NT_WORKSTATION) + * where (buildNumber > 26039) * * This mapping will presumably be augmented as new Windows * versions are released. @@ -527,7 +526,10 @@ GetJavaProperties(JNIEnv* env) case 0: /* Windows server 2019 GA 10/2018 build number is 17763 */ /* Windows server 2022 build number is 20348 */ - if (buildNumber > 20347) { + /* Windows server 2025 Preview build is 26040 */ + if (buildNumber > 26039) { + sprops.os_name = "Windows Server 2025"; + } else if (buildNumber > 20347) { sprops.os_name = "Windows Server 2022"; } else if (buildNumber > 17762) { sprops.os_name = "Windows Server 2019"; diff --git a/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java b/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java index 3d65d200c0d1a..108e3789d287f 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -157,7 +157,7 @@ public SourceVersion getSupportedSourceVersion() { * * @implSpec * Initializes the processor with the processing environment by - * setting the {@code processingEnv} field to the value of the + * setting the {@link #processingEnv} field to the value of the * {@code processingEnv} argument. An {@code * IllegalStateException} will be thrown if this method is called * more than once on the same object. diff --git a/src/java.compiler/share/classes/javax/annotation/processing/Processor.java b/src/java.compiler/share/classes/javax/annotation/processing/Processor.java index 01de039d2c2c8..4be159868fa10 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/Processor.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/Processor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -32,14 +32,15 @@ import javax.lang.model.SourceVersion; /** - * The interface for an annotation processor. - * - *

      Annotation processing happens in a sequence of {@linkplain - * javax.annotation.processing.RoundEnvironment rounds}. On each - * round, a processor may be asked to {@linkplain #process process} a - * subset of the annotations found on the source and class files - * produced by a prior round. The inputs to the first round of - * processing are the initial inputs to a run of the tool; these + * The interface for an {@index "annotation processor"}. + * + *

      Annotation processing happens in a sequence of rounds. + * On each + * {@linkplain RoundEnvironment round}, a processor may be asked to {@linkplain #process process} a + * subset of the annotations found on the + * {@linkplain RoundEnvironment#getRootElements() source and class files + * produced by a prior round}. The inputs to the first round of + * processing are the {@index "initial inputs"} to a run of the tool; these * initial inputs can be regarded as the output of a virtual zeroth * round of processing. If a processor was asked to process on a * given round, it will be asked to process on subsequent rounds, @@ -77,7 +78,7 @@ * protocol being followed, then the processor's behavior is not * defined by this interface specification. * - *

      The tool uses a discovery process to find annotation + *

      The tool uses a {@index "discovery process"} to find annotation * processors and decide whether or not they should be run. By * configuring the tool, the set of potential processors can be * controlled. For example, for a {@link javax.tools.JavaCompiler diff --git a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java index 49e94faf179e4..d0c43d929c8d9 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -146,7 +146,7 @@ default Set getElementsAnnotatedWithAny(TypeElement... annota * processing. The set of annotation interfaces present in the runtime * context may differ from the set of annotation interfaces present in * the context of annotation processing in a particular - * environmental configuration. If an runtime annotation interface is + * environmental configuration. If a runtime annotation interface is * not present in the annotation processing context, the situation * is not treated as an error and no elements are found for that * annotation interface. @@ -173,7 +173,7 @@ default Set getElementsAnnotatedWithAny(TypeElement... annota * processing. The set of annotation interfaces present in the runtime * context may differ from the set of annotation interfaces present in * the context of annotation processing in a particular - * environmental configuration. If an runtime annotation interface is + * environmental configuration. If a runtime annotation interface is * not present in the annotation processing context, the situation * is not treated as an error and no elements are found for that * annotation interface. diff --git a/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java b/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java index 10363b5a618d1..2bb275a046b09 100644 --- a/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java +++ b/src/java.compiler/share/classes/javax/lang/model/AnnotatedConstruct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -41,20 +41,20 @@ * * As defined by The Java Language Specification * section {@jls 9.7.4}, an annotation on an element is a - * declaration annotation and an annotation on a type is a - * type annotation. + * {@index "declaration annotation"} and an annotation on a type is a + * {@index "type annotation"}. * * The terms directly present, present, - * indirectly present, and associated are used + * indirectly present, and associated are used * throughout this interface to describe precisely which annotations, * either declaration annotations or type annotations, are returned by * the methods in this interface. * *

      In the definitions below, an annotation A has an * annotation interface AI. If AI is a repeatable annotation - * interface, the type of the containing annotation is AIC. + * interface, the type of the container annotation is AIC. * - *

      Annotation A is directly present on a construct + *

      Annotation A is {@index "directly present"} on a construct * C if either: * *

        @@ -78,7 +78,7 @@ * Specification (JLS {@jls 8.10.1}). * * If there are multiple annotations of type AI present on - * C, then if AI is repeatable annotation interface, an + * C, then if AI is a repeatable annotation interface, an * annotation of type AIC is {@linkplain javax.lang.model.util.Elements#getOrigin(AnnotatedConstruct, AnnotationMirror) implicitly declared} on C. *
      • A representation of A appears in the executable output * for C, such as the {@code RuntimeVisibleAnnotations} (JVMS {@jvms 4.7.16}) or @@ -87,7 +87,7 @@ * *
      * - *

      An annotation A is present on a + *

      An annotation A is {@index "present"} on a * construct C if either: *

        * @@ -99,7 +99,7 @@ * *
      * - * An annotation A is indirectly present on a construct + * An annotation A is {@index "indirectly present"} on a construct * C if both: * *
        @@ -114,7 +114,7 @@ * *
      * - * An annotation A is associated with a construct + * An annotation A is {@index "associated"} with a construct * C if either: * *
        @@ -189,10 +189,11 @@ public interface AnnotatedConstruct { A getAnnotation(Class annotationType); /** - * Returns annotations that are associated with this construct. + * Returns annotations of the specified type that are associated + * with this construct. * - * If there are no annotations associated with this construct, the - * return value is an array of length 0. + * If there are no annotations of the specified type associated with this + * construct, the return value is an array of length 0. * * The order of annotations which are directly or indirectly * present on a construct C is computed as if indirectly present diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index 4e32f0cdcd88e..231a5e34c62b7 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -70,8 +70,14 @@ public enum SourceVersion { * 21: pattern matching for switch and record patterns (string * templates in preview, unnamed patterns and variables in * preview, unnamed classes and instance main methods in preview) - * 22: Unnamed Variables & Patterns (Statements before super(...) - * in Preview) + * 22: unnamed variables & patterns (statements before super(...) + * in preview, string templates in second preview, implicitly + * declared classes and instance main methods in second preview) + * 23: no changes (primitive Types in Patterns, instanceof, and + * switch in preview, module Import Declarations in preview, + * implicitly declared classes and instance main in third + * preview, flexible constructor bodies in second preview) + * 24: tbd */ /** @@ -202,7 +208,7 @@ public enum SourceVersion { * @see * JEP 213: Milling Project Coin */ - RELEASE_9, + RELEASE_9, /** * The version introduced by the Java Platform, Standard Edition @@ -470,7 +476,7 @@ private static SourceVersion getLatestSupported() { * * @apiNote This method is included alongside {@link latest} to * allow identification of situations where the language model API - * is running on a platform version different than the latest + * is running on a platform version different from the latest * version modeled by the API. One way that sort of situation can * occur is if an IDE or similar tool is using the API to model * source version N while running on platform version @@ -496,8 +502,7 @@ public static SourceVersion latestSupported() { * followed only by characters for which {@link * Character#isJavaIdentifierPart(int)} returns {@code true}. * This pattern matches regular identifiers, keywords, contextual - * keywords, and the literals {@code "true"}, - * {@code "false"}, {@code "null"}. + * keywords, boolean literals, and the null literal. * * The method returns {@code false} for all other strings. * @@ -590,14 +595,14 @@ public static boolean isName(CharSequence name, SourceVersion version) { } /** - * Returns whether or not {@code s} is a keyword, boolean literal, - * or null literal in the latest source version. + * Returns whether or not {@code s} is a keyword, a boolean literal, + * or the null literal in the latest source version. * This method returns {@code false} for contextual * keywords. * * @param s the string to check - * @return {@code true} if {@code s} is a keyword, or boolean - * literal, or null literal, {@code false} otherwise. + * @return {@code true} if {@code s} is a keyword, a boolean + * literal, or the null literal, {@code false} otherwise. * @jls 3.9 Keywords * @jls 3.10.3 Boolean Literals * @jls 3.10.8 The Null Literal @@ -607,15 +612,15 @@ public static boolean isKeyword(CharSequence s) { } /** - * Returns whether or not {@code s} is a keyword, boolean literal, - * or null literal in the given source version. + * Returns whether or not {@code s} is a keyword, a boolean literal, + * or the null literal in the given source version. * This method returns {@code false} for contextual * keywords. * * @param s the string to check * @param version the version to use - * @return {@code true} if {@code s} is a keyword, or boolean - * literal, or null literal, {@code false} otherwise. + * @return {@code true} if {@code s} is a keyword, a boolean + * literal, or the null literal, {@code false} otherwise. * @jls 3.9 Keywords * @jls 3.10.3 Boolean Literals * @jls 3.10.8 The Null Literal diff --git a/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java b/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java index 908d171e9c7f8..2d92504edb68f 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -47,7 +47,7 @@ public interface AnnotationMirror { /** * Returns the values of this annotation's elements. - * This is returned in the form of a map that associates elements + * These are returned in the form of a map that associates elements * with their corresponding values. * Only those elements with values explicitly present in the * annotation are included, not those that are implicitly assuming diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java index 8bff37483947c..18923463248e2 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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,7 +34,7 @@ * elements. * Annotation interface elements are methods restricted to have no * formal parameters, no type parameters, and no {@code throws} - * clause, among other restrictions; see JLS {@jls 9.6.1} for details + * clause, among other restrictions; see JLS {@jls 9.6.1} for details. * * @see ExecutableType * @since 1.6 diff --git a/src/java.compiler/share/classes/javax/lang/model/element/NestingKind.java b/src/java.compiler/share/classes/javax/lang/model/element/NestingKind.java index 138f093be2f57..1faae30df5723 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/NestingKind.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/NestingKind.java @@ -26,7 +26,7 @@ package javax.lang.model.element; /** - * The nesting kind of a type element. + * The nesting kind of a type element. * Type elements come in four varieties: * top-level, member, local, and anonymous. * Nesting kind is a non-standard term used here to denote this @@ -107,7 +107,7 @@ public enum NestingKind { /** * Does this constant correspond to a nested type element? - * A nested type element is any that is not top-level. + * A nested type element is any that is not top-level. * More specifically, an inner type element is any nested type element that * is not {@linkplain Modifier#STATIC static}. * @return whether or not the constant is nested diff --git a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java index 3f34b1799929d..abf95bcefad50 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java @@ -58,14 +58,14 @@ * javax.lang.model.util.Elements#getFileObjectOf(Element) reference * representation} (either source code or executable output). Multiple * classes and interfaces can share the same reference representation - * backing construct. For example, multiple classes and interface can - * be declared in the same source file, including, but are not limited + * backing construct. For example, multiple classes and interfaces can + * be declared in the same source file, including, but not limited * to: *
          *
        • a {@linkplain NestingKind#TOP_LEVEL top-level} class or * interface and auxiliary classes and interfaces *
        • a top-level class or interface and {@linkplain - * NestingKind#isNested() nested class and interfaces} within it + * NestingKind#isNested() nested classes and interfaces} within it *
        *

        In the context of annotation processing, a type element can * be: diff --git a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java index 56edb89d3e35c..ab4eeb1e747ec 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java @@ -30,7 +30,7 @@ * elements, the declared entities that make up a program. Elements * include classes, interfaces, methods, constructors, and fields. * The interfaces in this package do not model the structure of a - * program inside a method body; for example there is no + * program inside a method body; for example, there is no * representation of a {@code for} loop or {@code try}-{@code finally} * block. Concretely, there is no model of any abstract syntax tree * (AST) structure of a Java program. However, the interfaces can @@ -84,7 +84,7 @@ * javax.lang.model.util.Elements#isBridge(ExecutableElement) * bridge methods} used in implementing covariant returns, are * translation artifacts strictly outside of this model. However, when - * operating on class files, it is helpful be able to operate on such + * operating on class files, it is helpful to be able to operate on such * elements, screening them out when appropriate. * *

        During annotation processing, operating on incomplete or diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java index 2faf3f5ec32b2..5159ac26e3bfa 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java @@ -56,11 +56,11 @@ public interface Elements { *

          *
        • find non-empty packages with the given name returned by * {@link #getPackageElement(ModuleElement, CharSequence)}, - * where the provided ModuleSymbol is any + * where the provided ModuleElement is any * {@linkplain java.lang.module##root-modules root module}, *
        • *
        • if the above yields an empty list, search - * {@link #getAllModuleElements() all modules} for observable + * {@linkplain #getAllModuleElements() all modules} for observable * packages with the given name *
        • *
        @@ -143,11 +143,11 @@ default Set getAllPackageElements(CharSequence name) { *
          *
        • find type elements with the given name returned by * {@link #getTypeElement(ModuleElement, CharSequence)}, - * where the provided ModuleSymbol is any + * where the provided ModuleElement is any * {@linkplain java.lang.module##root-modules root module}, *
        • *
        • if the above yields an empty list, search - * {@link #getAllModuleElements() all modules} for observable + * {@linkplain #getAllModuleElements() all modules} for observable * type elements with the given name *
        • *
        @@ -617,7 +617,7 @@ default ModuleElement getModuleOf(Element e) { /** * Returns all members of a type element, whether inherited or - * declared directly. For a class the result also includes its + * declared directly. For a class, the result also includes its * constructors, but not local or anonymous classes. * * @apiNote Elements of certain kinds can be isolated using @@ -878,10 +878,10 @@ default TypeElement getEnumConstantBody(VariableElement enumConstant) { * accessor. * * @implSpec The default implementation of this method checks if the element - * enclosing the accessor has kind {@link ElementKind#RECORD RECORD} if that is - * the case, then all the record components on the accessor's enclosing element - * are retrieved by invoking {@link ElementFilter#recordComponentsIn(Iterable)}. - * If the accessor of at least one of the record components retrieved happen to + * enclosing the accessor has kind {@link ElementKind#RECORD RECORD}, if that is + * the case, then all the record components of the accessor's enclosing element + * are isolated by invoking {@link ElementFilter#recordComponentsIn(Iterable)}. + * If the accessor of at least one of the record components retrieved happens to * be equal to the accessor passed as a parameter to this method, then that * record component is returned, in any other case {@code null} is returned. * diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Types.java b/src/java.compiler/share/classes/javax/lang/model/util/Types.java index 0cea2734e213c..266d63178ba08 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/Types.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/Types.java @@ -40,7 +40,7 @@ * ExecutableType Executable types} and the pseudo-types for * {@linkplain TypeKind#PACKAGE packages} and {@linkplain * TypeKind#MODULE modules} are generally out of scope for these - * methods. One or more out of scope arguments will typically result + * methods. One or more out-of-scope arguments will typically result * in a method throwing an {@link IllegalArgumentException}. * *

        Where a method returns a type mirror or a collection of type @@ -165,7 +165,7 @@ public interface Types { * the direct supertypes of a type mirror representing {@code * java.lang.Object}. * - * Annotations on the direct super types are preserved. + * Annotations on the direct supertypes are preserved. * * @param t the type being examined * @return the direct supertypes, or an empty list if none @@ -185,7 +185,7 @@ public interface Types { /** * {@return the class of a boxed value of the primitive type argument} - * That is, boxing conversion is applied. + * That is, boxing conversion is applied. * * @param p the primitive type to be converted * @jls 5.1.7 Boxing Conversion @@ -318,7 +318,7 @@ WildcardType getWildcardType(TypeMirror extendsBound, * Annotations on the type arguments are preserved. * *

        If the containing type is a parameterized type, - * the number of type arguments must equal the + * the number of type arguments must be equal to the * number of {@code typeElem}'s formal type parameters. * If it is not parameterized or if it is {@code null}, this method is * equivalent to {@code getDeclaredType(typeElem, typeArgs)}. @@ -354,7 +354,7 @@ DeclaredType getDeclaredType(DeclaredType containing, /** * {@return a type mirror equivalent to the argument, but with no annotations} * If the type mirror is a composite type, such as an array type - * or a wildcard type, any constitute types, such as the + * or a wildcard type, any constituent types, such as the * component type of an array and the type of the bounds of a * wildcard type, also have no annotations, recursively. * diff --git a/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java b/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java index 98bb5a650a406..d61198c6aef8b 100644 --- a/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java +++ b/src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, 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 @@ -39,7 +39,7 @@ * additional fields and methods. * *

        Unless stated otherwise, references in this class to "this file object" - * should be interpreted as referring indirectly to the {@link #fileObject delegate file object}. + * should be interpreted as referring indirectly to the {@linkplain #fileObject delegate file object}. * * @param the kind of file object forwarded to by this object * @since 1.6 diff --git a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java index 40224abbd509d..9db757f05a242 100644 --- a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -39,7 +39,7 @@ * additional fields and methods. * *

        Unless stated otherwise, references in this class to "this file manager" - * should be interpreted as referring indirectly to the {@link #fileManager delegate file manager}. + * should be interpreted as referring indirectly to the {@linkplain #fileManager delegate file manager}. * * @param the kind of file manager forwarded to by this object * @since 1.6 diff --git a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileObject.java b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileObject.java index a940b23009d8e..e8db8919750a3 100644 --- a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileObject.java +++ b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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,7 +34,7 @@ * additional fields and methods. * *

        Unless stated otherwise, references in this class to "this file object" - * should be interpreted as referring indirectly to the {@link #fileObject delegate file object}. + * should be interpreted as referring indirectly to the {@linkplain #fileObject delegate file object}. * * @param the kind of file object forwarded to by this object * @since 1.6 diff --git a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java index 327064b5a5215..da2a3b534acf1 100644 --- a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java @@ -52,7 +52,7 @@ * *

        Some methods in this interface use class names. Such class * names must be given in the Java Virtual Machine internal form of - * fully qualified class and interface names. For convenience '.' + * fully qualified class and interface names. For convenience, '.' * and '/' are interchangeable. The internal form is defined in * chapter four of * The Java Virtual Machine Specification. @@ -239,7 +239,7 @@ Iterable list(Location location, String inferBinaryName(Location location, JavaFileObject file); /** - * Compares two file objects and return true if they represent the + * Compares two file objects and returns true if they represent the * same underlying object. * * @param a a file object @@ -255,7 +255,7 @@ Iterable list(Location location, /** * Handles one option. If {@code current} is an option to this - * file manager it will consume any arguments to that option from + * file manager, it will consume any arguments to that option from * {@code remaining} and return true, otherwise return false. * * @param current current option diff --git a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java index 769856535acee..277f6d57b0eb5 100644 --- a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2024, 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 @@ -142,7 +142,7 @@ *

      * *

      All implementations of this interface must support Path objects representing - * files in the {@linkplain java.nio.file.FileSystems#getDefault() default file system.} + * files in the {@linkplain java.nio.file.FileSystems#getDefault() default file system}. * It is recommended that implementations should support Path objects from any filesystem.

      * * diff --git a/src/java.compiler/share/classes/javax/tools/ToolProvider.java b/src/java.compiler/share/classes/javax/tools/ToolProvider.java index d05b65b0ffe94..8cdfd63b17ded 100644 --- a/src/java.compiler/share/classes/javax/tools/ToolProvider.java +++ b/src/java.compiler/share/classes/javax/tools/ToolProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -90,8 +90,8 @@ public static DocumentationTool getSystemDocumentationTool() { * @implSpec This implementation always returns {@code null}. * @deprecated This method is subject to removal in a future version of * Java SE. - * Use the {@link java.util.spi.ToolProvider system tool provider} or - * {@link java.util.ServiceLoader service loader} mechanisms to + * Use the {@linkplain java.util.spi.ToolProvider system tool provider} or + * {@linkplain java.util.ServiceLoader service loader} mechanisms to * locate system tools as well as user-installed tools. * @return a class loader, or {@code null} */ diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java index a20eca94a3f05..56ea5c573d81c 100644 --- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -48,7 +48,7 @@ * {@code ColorSpace} class. This representation of device independent and * device dependent color spaces is based on the International Color Consortium * Specification ICC.1:2001-12, File Format for Color Profiles (see - * http://www.color.org). + * https://www.color.org). *

      * Typically, a {@code Color} or {@code ColorModel} would be associated with an * ICC Profile which is either an input, display, or output profile (see the ICC diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java index 0cf836b449abc..b7faab518f9dd 100644 --- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -64,7 +64,7 @@ * A representation of color profile data for device independent and device * dependent color spaces based on the International Color Consortium * Specification ICC.1:2001-12, File Format for Color Profiles, (see - * http://www.color.org). + * https://www.color.org). *

      * An {@code ICC_ColorSpace} object can be constructed from an appropriate * {@code ICC_Profile}. Typically, an {@code ICC_ColorSpace} would be associated diff --git a/src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java b/src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java index 1e7176e4b3988..3202d2d690d67 100644 --- a/src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java +++ b/src/java.desktop/share/classes/java/awt/image/ColorConvertOp.java @@ -690,7 +690,7 @@ private int getRenderingIntent (ICC_Profile profile) { * shall be set to zero. Thus, we are ignoring two most significant * bytes here. * - * See http://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. + * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. */ return ((header[index+2] & 0xff) << 8) | (header[index+3] & 0xff); diff --git a/src/java.desktop/share/classes/javax/imageio/package-info.java b/src/java.desktop/share/classes/javax/imageio/package-info.java index 24f86b3967fca..8d170e329929e 100644 --- a/src/java.desktop/share/classes/javax/imageio/package-info.java +++ b/src/java.desktop/share/classes/javax/imageio/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -101,7 +101,7 @@ * * * - * + * * WBMP * yes * yes diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java index be2cbf88c06e2..ebeb456b164b8 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -1008,7 +1008,7 @@ public final class BaselineTIFFTagSet extends TIFFTagSet { /** * Constant specifying the "ICC Profile" tag. * - * @see ICC Specification, section B.4: Embedding ICC profiles in TIFF files + * @see ICC Specification, section B.4: Embedding ICC profiles in TIFF files */ public static final int TAG_ICC_PROFILE = 34675; diff --git a/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java b/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java index 384a805996289..92f98fdfc992f 100644 --- a/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java +++ b/src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -87,8 +87,8 @@ public class SortingFocusTraversalPolicy private static final SwingContainerOrderFocusTraversalPolicy fitnessTestPolicy = new SwingContainerOrderFocusTraversalPolicy(); - private final int FORWARD_TRAVERSAL = 0; - private final int BACKWARD_TRAVERSAL = 1; + private static final int FORWARD_TRAVERSAL = 0; + private static final int BACKWARD_TRAVERSAL = 1; /* * When true (by default), the legacy merge-sort algo is used to sort an FTP cycle. diff --git a/src/java.desktop/share/classes/javax/swing/text/html/default.css b/src/java.desktop/share/classes/javax/swing/text/html/default.css index eb37a12b6d81b..32f54231f465e 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/default.css +++ b/src/java.desktop/share/classes/javax/swing/text/html/default.css @@ -102,7 +102,7 @@ dd {margin-left-ltr: 40; margin-bottom: 0} dd p {margin-left: 0; - margin-rigth: 0; + margin-right: 0; margin-top: 0; margin-bottom: 0} diff --git a/src/java.management/share/classes/javax/management/ClassAttributeValueExp.java b/src/java.management/share/classes/javax/management/ClassAttributeValueExp.java index 06c488f90fac7..f7c40691e39b5 100644 --- a/src/java.management/share/classes/javax/management/ClassAttributeValueExp.java +++ b/src/java.management/share/classes/javax/management/ClassAttributeValueExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -39,37 +39,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID is not constant class ClassAttributeValueExp extends AttributeValueExp { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -2212731951078526753L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -1081892073854801359L; - - private static final long serialVersionUID; - static { - boolean compat = false; - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: exception means no compat with 1.0, too bad - } - if (compat) - serialVersionUID = oldSerialVersionUID; - else - serialVersionUID = newSerialVersionUID; - } + private static final long serialVersionUID = -1081892073854801359L; /** * @serial The name of the attribute diff --git a/src/java.management/share/classes/javax/management/MBeanAttributeInfo.java b/src/java.management/share/classes/javax/management/MBeanAttributeInfo.java index 6d31becbb7317..6551e9ba81bfa 100644 --- a/src/java.management/share/classes/javax/management/MBeanAttributeInfo.java +++ b/src/java.management/share/classes/javax/management/MBeanAttributeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -40,33 +40,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class MBeanAttributeInfo extends MBeanFeatureInfo implements Cloneable { - /* Serial version */ - private static final long serialVersionUID; - static { - /* For complicated reasons, the serialVersionUID changed - between JMX 1.0 and JMX 1.1, even though JMX 1.1 did not - have compatibility code for this class. So the - serialization produced by this class with JMX 1.2 and - jmx.serial.form=1.0 is not the same as that produced by - this class with JMX 1.1 and jmx.serial.form=1.0. However, - the serialization without that property is the same, and - that is the only form required by JMX 1.2. - */ - long uid = 8644704819898565848L; - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - if ("1.0".equals(form)) - uid = 7043855487133450673L; - } catch (Exception e) { - // OK: exception means no compat with 1.0, too bad - } - serialVersionUID = uid; - } + private static final long serialVersionUID = 8644704819898565848L; static final MBeanAttributeInfo[] NO_ATTRIBUTES = new MBeanAttributeInfo[0]; diff --git a/src/java.management/share/classes/javax/management/Notification.java b/src/java.management/share/classes/javax/management/Notification.java index 9455264fa04eb..80cf4b464d268 100644 --- a/src/java.management/share/classes/javax/management/Notification.java +++ b/src/java.management/share/classes/javax/management/Notification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -53,46 +53,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID is not constant public class Notification extends EventObject { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 1716977971058914352L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -7516092053498031989L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("message", String.class), - new ObjectStreamField("sequenceNumber", Long.TYPE), - new ObjectStreamField("source", Object.class), - new ObjectStreamField("sourceObjectName", ObjectName.class), - new ObjectStreamField("timeStamp", Long.TYPE), - new ObjectStreamField("type", String.class), - new ObjectStreamField("userData", Object.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("message", String.class), - new ObjectStreamField("sequenceNumber", Long.TYPE), - new ObjectStreamField("source", Object.class), - new ObjectStreamField("timeStamp", Long.TYPE), - new ObjectStreamField("type", String.class), - new ObjectStreamField("userData", Object.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -7516092053498031989L; /** * @serialField type String The notification type. * A string expressed in a dot notation similar to Java properties. @@ -108,28 +71,15 @@ public class Notification extends EventObject { * @serialField message String The notification message. * @serialField source Object The object on which the notification initially occurred. */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: exception means no compat with 1.0, too bad - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff - + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("message", String.class), + new ObjectStreamField("sequenceNumber", Long.TYPE), + new ObjectStreamField("source", Object.class), + new ObjectStreamField("timeStamp", Long.TYPE), + new ObjectStreamField("type", String.class), + new ObjectStreamField("userData", Object.class) + }; /** * @serial The notification type. * A string expressed in a dot notation similar to Java properties. @@ -378,21 +328,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("type", type); - fields.put("sequenceNumber", sequenceNumber); - fields.put("timeStamp", timeStamp); - fields.put("userData", userData); - fields.put("message", message); - fields.put("source", source); - out.writeFields(); - } else { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/NumericValueExp.java b/src/java.management/share/classes/javax/management/NumericValueExp.java index 959375a2f500d..bae84019d2e31 100644 --- a/src/java.management/share/classes/javax/management/NumericValueExp.java +++ b/src/java.management/share/classes/javax/management/NumericValueExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -45,68 +45,19 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant class NumericValueExp extends QueryEval implements ValueExp { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -6227876276058904000L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -4679739485102359104L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("longVal", Long.TYPE), - new ObjectStreamField("doubleVal", Double.TYPE), - new ObjectStreamField("valIsLong", Boolean.TYPE) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("val", Number.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - + private static final long serialVersionUID = -4679739485102359104L; /** * @serialField val Number The numeric value * *

      The serialVersionUID of this class is -4679739485102359104L. */ - private static final ObjectStreamField[] serialPersistentFields; + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField("val", Number.class) + }; private Number val = 0.0; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: exception means no compat with 1.0, too bad - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff - - /** * Basic constructor. */ @@ -189,44 +140,7 @@ public ValueExp apply(ObjectName name) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - double doubleVal; - long longVal; - boolean isLong; - ObjectInputStream.GetField fields = in.readFields(); - doubleVal = fields.get("doubleVal", (double)0); - if (fields.defaulted("doubleVal")) - { - throw new NullPointerException("doubleVal"); - } - longVal = fields.get("longVal", (long)0); - if (fields.defaulted("longVal")) - { - throw new NullPointerException("longVal"); - } - isLong = fields.get("valIsLong", false); - if (fields.defaulted("valIsLong")) - { - throw new NullPointerException("valIsLong"); - } - if (isLong) - { - this.val = longVal; - } - else - { - this.val = doubleVal; - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -235,22 +149,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("doubleVal", doubleValue()); - fields.put("longVal", longValue()); - fields.put("valIsLong", isLong()); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } @Deprecated diff --git a/src/java.management/share/classes/javax/management/ObjectName.java b/src/java.management/share/classes/javax/management/ObjectName.java index 00d5cc6930d60..f20750c9d8a84 100644 --- a/src/java.management/share/classes/javax/management/ObjectName.java +++ b/src/java.management/share/classes/javax/management/ObjectName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -222,7 +222,6 @@ * @implNote The maximum allowed length of the domain name in this implementation * is {@code Integer.MAX_VALUE/4} */ -@SuppressWarnings("serial") // don't complain serialVersionUID not constant public class ObjectName implements Comparable, QueryExp { private static final int DOMAIN_PATTERN = 0x8000_0000; private static final int PROPLIST_PATTERN = 0x4000_0000; @@ -294,57 +293,7 @@ private static class PatternProperty extends Property { // Private fields ----------------------------------------> - // Serialization compatibility stuff --------------------> - - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -5467795090068647408L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 1081892073854801359L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("domain", String.class), - new ObjectStreamField("propertyList", Hashtable.class), - new ObjectStreamField("propertyListString", String.class), - new ObjectStreamField("canonicalName", String.class), - new ObjectStreamField("pattern", Boolean.TYPE), - new ObjectStreamField("propertyPattern", Boolean.TYPE) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = { }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: exception means no compat with 1.0, too bad - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - - // - // Serialization compatibility stuff <============================== + private static final long serialVersionUID = 1081892073854801359L; // Class private fields -----------------------------------> @@ -1088,90 +1037,32 @@ private void setDomainLength(int length) throws MalformedObjectNameException { /** * Deserializes an {@link ObjectName} from an {@link ObjectInputStream}. - * @serialData

        - *
      • In the current serial form (value of property - * jmx.serial.form differs from - * 1.0): the string - * "<domain>:<properties><wild>", - * where:
          - *
        • <domain> represents the domain part - * of the {@link ObjectName}
        • - *
        • <properties> represents the list of - * properties, as returned by - * {@link #getKeyPropertyListString} - *
        • <wild> is empty if not - * isPropertyPattern, or - * is the character "*" if - * isPropertyPattern - * and <properties> is empty, or - * is ",*" if - * isPropertyPattern and - * <properties> is not empty. - *
        • - *
        - * The intent is that this string could be supplied - * to the {@link #ObjectName(String)} constructor to - * produce an equivalent {@link ObjectName}. - *
      • - *
      • In the old serial form (value of property - * jmx.serial.form is - * 1.0): <domain> <propertyList> - * <propertyListString> <canonicalName> - * <pattern> <propertyPattern>, - * where:
          - *
        • <domain> represents the domain part - * of the {@link ObjectName}
        • - *
        • <propertyList> is the - * {@link Hashtable} that contains all the - * pairs (key,value) for this - * {@link ObjectName}
        • - *
        • <propertyListString> is the - * {@link String} representation of the - * list of properties in any order (not - * mandatorily a canonical representation) - *
        • - *
        • <canonicalName> is the - * {@link String} containing this - * {@link ObjectName}'s canonical name
        • - *
        • <pattern> is a boolean which is - * true if this - * {@link ObjectName} contains a pattern
        • - *
        • <propertyPattern> is a boolean which - * is true if this - * {@link ObjectName} contains a pattern in - * the list of properties
        • - *
        - *
      • + * @serialData The string "<domain>:<properties><wild>", where: + *
          + *
        • <domain> represents the domain part + * of the {@link ObjectName}
        • + *
        • <properties> represents the list of + * properties, as returned by + * {@link #getKeyPropertyListString}
        • + *
        • <wild> is empty if not + * isPropertyPattern, or + * is the character "*" if + * isPropertyPattern + * and <properties> is empty, or + * is ",*" if + * isPropertyPattern and + * <properties> is not empty.
        • *
        + * The intent is that this string could be supplied + * to the {@link #ObjectName(String)} constructor to + * produce an equivalent {@link ObjectName}. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { String cn; - if (compat) { - // Read an object serialized in the old serial form - // - //in.defaultReadObject(); - final ObjectInputStream.GetField fields = in.readFields(); - String propListString = - (String)fields.get("propertyListString", ""); - - // 6616825: take care of property patterns - final boolean propPattern = - fields.get("propertyPattern" , false); - if (propPattern) { - propListString = - (propListString.length()==0?"*":(propListString+",*")); - } - - cn = (String)fields.get("domain", "default")+ - ":"+ propListString; - } else { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - cn = (String)in.readObject(); - } + in.defaultReadObject(); + cn = (String)in.readObject(); try { construct(cn); @@ -1183,85 +1074,31 @@ private void readObject(ObjectInputStream in) /** * Serializes an {@link ObjectName} to an {@link ObjectOutputStream}. - * @serialData
          - *
        • In the current serial form (value of property - * jmx.serial.form differs from - * 1.0): the string - * "<domain>:<properties><wild>", - * where:
            - *
          • <domain> represents the domain part - * of the {@link ObjectName}
          • - *
          • <properties> represents the list of - * properties, as returned by - * {@link #getKeyPropertyListString} - *
          • <wild> is empty if not - * isPropertyPattern, or - * is the character "*" if - * this isPropertyPattern - * and <properties> is empty, or - * is ",*" if - * isPropertyPattern and - * <properties> is not empty. - *
          • - *
          - * The intent is that this string could be supplied - * to the {@link #ObjectName(String)} constructor to - * produce an equivalent {@link ObjectName}. - *
        • - *
        • In the old serial form (value of property - * jmx.serial.form is - * 1.0): <domain> <propertyList> - * <propertyListString> <canonicalName> - * <pattern> <propertyPattern>, - * where:
            - *
          • <domain> represents the domain part - * of the {@link ObjectName}
          • - *
          • <propertyList> is the - * {@link Hashtable} that contains all the - * pairs (key,value) for this - * {@link ObjectName}
          • - *
          • <propertyListString> is the - * {@link String} representation of the - * list of properties in any order (not - * mandatorily a canonical representation) - *
          • - *
          • <canonicalName> is the - * {@link String} containing this - * {@link ObjectName}'s canonical name
          • - *
          • <pattern> is a boolean which is - * true if this - * {@link ObjectName} contains a pattern
          • - *
          • <propertyPattern> is a boolean which - * is true if this - * {@link ObjectName} contains a pattern in - * the list of properties
          • - *
          - *
        • + * @serialData The string "<domain>:<properties><wild>", where: + *
            + *
          • <domain> represents the domain part + * of the {@link ObjectName}
          • + *
          • <properties> represents the list of + * properties, as returned by + * {@link #getKeyPropertyListString}
          • + *
          • <wild> is empty if not + * isPropertyPattern, or + * is the character "*" if + * this isPropertyPattern + * and <properties> is empty, or + * is ",*" if + * isPropertyPattern and + * <properties> is not empty.
          • *
          + * The intent is that this string could be supplied + * to the {@link #ObjectName(String)} constructor to + * produce an equivalent {@link ObjectName}. */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // Read CR 6441274 before making any changes to this code - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("domain", _canonicalName.substring(0, getDomainLength())); - fields.put("propertyList", getKeyPropertyList()); - fields.put("propertyListString", getKeyPropertyListString()); - fields.put("canonicalName", _canonicalName); - fields.put("pattern", (_compressed_storage & (DOMAIN_PATTERN | PROPLIST_PATTERN)) != 0); - fields.put("propertyPattern", isPropertyListPattern()); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - out.writeObject(getSerializedNameString()); - } + out.defaultWriteObject(); + out.writeObject(getSerializedNameString()); } // Category : Serialization <=================================== diff --git a/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java b/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java index 00aa6ab7eb7c3..bea7ad92d0ce7 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java +++ b/src/java.management/share/classes/javax/management/modelmbean/DescriptorSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -81,69 +81,18 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class DescriptorSupport implements javax.management.Descriptor { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 8071560848919417985L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -6292969195866300415L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("descriptor", HashMap.class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("descriptor", HashMap.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -6292969195866300415L; /** * @serialField descriptor HashMap The collection of fields representing this descriptor */ - private static final ObjectStreamField[] serialPersistentFields; - private static final String serialForm; - static { - serialForm = getForm(); - boolean compat = "1.0".equals(serialForm); // serialForm may be null - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - - @SuppressWarnings("removal") - private static String getForm() { - String form = null; - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - return AccessController.doPrivileged(act); - } catch (Exception e) { - // OK: No compat with 1.0 - return null; - } - } - - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("descriptor", HashMap.class) + }; /* Spec says that field names are case-insensitive, but that case is preserved. This means that we need to be able to map from a @@ -1286,22 +1235,8 @@ private void readObject(ObjectInputStream in) /** * Serializes a {@link DescriptorSupport} to an {@link ObjectOutputStream}. */ - /* If you set jmx.serial.form to "1.2.0" or "1.2.1", then we are - bug-compatible with those versions. Specifically, field names - are forced to lower-case before being written. This - contradicts the spec, which, though it does not mention - serialization explicitly, does say that the case of field names - is preserved. But in 1.2.0 and 1.2.1, this requirement was not - met. Instead, field names in the descriptor map were forced to - lower case. Those versions expect this to have happened to a - descriptor they deserialize and e.g. getFieldValue will not - find a field whose name is spelt with a different case. - */ private void writeObject(ObjectOutputStream out) throws IOException { ObjectOutputStream.PutField fields = out.putFields(); - boolean compat = "1.0".equals(serialForm); - if (compat) - fields.put("currClass", currClass); /* Purge the field "targetObject" from the DescriptorSupport before * serializing since the referenced object is typically not @@ -1315,15 +1250,7 @@ private void writeObject(ObjectOutputStream out) throws IOException { startMap.remove("targetObject"); } - final HashMap descriptor; - if (compat || "1.2.0".equals(serialForm) || - "1.2.1".equals(serialForm)) { - descriptor = new HashMap<>(); - for (Map.Entry entry : startMap.entrySet()) - descriptor.put(entry.getKey().toLowerCase(), entry.getValue()); - } else - descriptor = new HashMap<>(startMap); - + final HashMap descriptor = new HashMap<>(startMap); fields.put("descriptor", descriptor); out.writeFields(); } diff --git a/src/java.management/share/classes/javax/management/modelmbean/InvalidTargetObjectTypeException.java b/src/java.management/share/classes/javax/management/modelmbean/InvalidTargetObjectTypeException.java index 2c90dcaa20932..d7d3bed055c6f 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/InvalidTargetObjectTypeException.java +++ b/src/java.management/share/classes/javax/management/modelmbean/InvalidTargetObjectTypeException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -46,61 +46,16 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class InvalidTargetObjectTypeException extends Exception { - - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 3711724570458346634L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 1190536278266811217L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("msgStr", String.class), - new ObjectStreamField("relatedExcept", Exception.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("exception", Exception.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = 1190536278266811217L; /** * @serialField exception Exception Encapsulated {@link Exception} */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("exception", Exception.class) + }; /** * @serial Encapsulated {@link Exception} @@ -156,23 +111,7 @@ public InvalidTargetObjectTypeException (Exception e, String s) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - exception = (Exception) fields.get("relatedExcept", null); - if (fields.defaulted("relatedExcept")) - { - throw new NullPointerException("relatedExcept"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -181,20 +120,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("relatedExcept", exception); - fields.put("msgStr", ((exception != null)?exception.getMessage():"")); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java index b4e7ecfd1e731..d30bd368a63bf 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java +++ b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -116,63 +116,19 @@ * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID is not constant public class ModelMBeanAttributeInfo extends MBeanAttributeInfo implements DescriptorAccess { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 7098036920755973145L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 6181543027787327345L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("attrDescriptor", Descriptor.class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("attrDescriptor", Descriptor.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - /** - * @serialField attrDescriptor Descriptor The {@link Descriptor} - * containing the metadata corresponding to this attribute - */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final long serialVersionUID = 6181543027787327345L; + /** + * @serialField attrDescriptor Descriptor The {@link Descriptor} + * containing the metadata corresponding to this attribute + */ + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("attrDescriptor", Descriptor.class) + }; /** * @serial The {@link Descriptor} containing the metadata corresponding to @@ -508,21 +464,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("attrDescriptor", attrDescriptor); - fields.put("currClass", currClass); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java index 3b5863007a683..0b8413083ac01 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java +++ b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -89,63 +89,18 @@ * * @since 1.5 */ - -@SuppressWarnings("serial") // serialVersionUID is not constant public class ModelMBeanConstructorInfo extends MBeanConstructorInfo implements DescriptorAccess { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -4440125391095574518L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 3862947819818064362L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("consDescriptor", Descriptor.class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("consDescriptor", Descriptor.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - /** - * @serialField consDescriptor Descriptor The {@link Descriptor} containing the metadata for this instance - */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final long serialVersionUID = 3862947819818064362L; + /** + * @serialField consDescriptor Descriptor The {@link Descriptor} containing the metadata for this instance + */ + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("consDescriptor", Descriptor.class) + }; /** * @serial The {@link Descriptor} containing the metadata for this instance @@ -464,21 +419,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("consDescriptor", consDescriptor); - fields.put("currClass", currClass); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java index bf164b678cc85..a209c2c7f420b 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java +++ b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -81,44 +81,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -3944083498453227709L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -1935722590756516193L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("modelMBeanDescriptor", Descriptor.class), - new ObjectStreamField("mmbAttributes", MBeanAttributeInfo[].class), - new ObjectStreamField("mmbConstructors", MBeanConstructorInfo[].class), - new ObjectStreamField("mmbNotifications", MBeanNotificationInfo[].class), - new ObjectStreamField("mmbOperations", MBeanOperationInfo[].class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("modelMBeanDescriptor", Descriptor.class), - new ObjectStreamField("modelMBeanAttributes", MBeanAttributeInfo[].class), - new ObjectStreamField("modelMBeanConstructors", MBeanConstructorInfo[].class), - new ObjectStreamField("modelMBeanNotifications", MBeanNotificationInfo[].class), - new ObjectStreamField("modelMBeanOperations", MBeanOperationInfo[].class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -1935722590756516193L; /** * @serialField modelMBeanDescriptor Descriptor The descriptor containing * MBean wide policy @@ -135,27 +100,14 @@ public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo { * {@link ModelMBeanOperationInfo} objects which * have descriptors */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("modelMBeanDescriptor", Descriptor.class), + new ObjectStreamField("modelMBeanAttributes", MBeanAttributeInfo[].class), + new ObjectStreamField("modelMBeanConstructors", MBeanConstructorInfo[].class), + new ObjectStreamField("modelMBeanNotifications", MBeanNotificationInfo[].class), + new ObjectStreamField("modelMBeanOperations", MBeanOperationInfo[].class) + }; /** * @serial The descriptor containing MBean wide policy @@ -957,40 +909,8 @@ private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperations */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - modelMBeanDescriptor = - (Descriptor) fields.get("modelMBeanDescriptor", null); - if (fields.defaulted("modelMBeanDescriptor")) { - throw new NullPointerException("modelMBeanDescriptor"); - } - modelMBeanAttributes = - (MBeanAttributeInfo[]) fields.get("mmbAttributes", null); - if (fields.defaulted("mmbAttributes")) { - throw new NullPointerException("mmbAttributes"); - } - modelMBeanConstructors = - (MBeanConstructorInfo[]) fields.get("mmbConstructors", null); - if (fields.defaulted("mmbConstructors")) { - throw new NullPointerException("mmbConstructors"); - } - modelMBeanNotifications = - (MBeanNotificationInfo[]) fields.get("mmbNotifications", null); - if (fields.defaulted("mmbNotifications")) { - throw new NullPointerException("mmbNotifications"); - } - modelMBeanOperations = - (MBeanOperationInfo[]) fields.get("mmbOperations", null); - if (fields.defaulted("mmbOperations")) { - throw new NullPointerException("mmbOperations"); - } - } else { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + + in.defaultReadObject(); } @@ -999,22 +919,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("modelMBeanDescriptor", modelMBeanDescriptor); - fields.put("mmbAttributes", modelMBeanAttributes); - fields.put("mmbConstructors", modelMBeanConstructors); - fields.put("mmbNotifications", modelMBeanNotifications); - fields.put("mmbOperations", modelMBeanOperations); - fields.put("currClass", currClass); - out.writeFields(); - } else { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } diff --git a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java index 1f6cf566ba396..c0bce84a5d925 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java +++ b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -96,64 +96,19 @@ * * @since 1.5 */ - -@SuppressWarnings("serial") // serialVersionUID is not constant public class ModelMBeanNotificationInfo extends MBeanNotificationInfo implements DescriptorAccess { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form - // depends on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -5211564525059047097L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -7445681389570207141L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("notificationDescriptor", Descriptor.class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("notificationDescriptor", Descriptor.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -7445681389570207141L; /** * @serialField notificationDescriptor Descriptor The descriptor * containing the appropriate metadata for this instance */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("notificationDescriptor", Descriptor.class) + }; /** * @serial The descriptor containing the appropriate metadata for @@ -398,18 +353,7 @@ private void readObject(ObjectInputStream in) **/ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("notificationDescriptor", notificationDescriptor); - fields.put("currClass", currClass); - out.writeFields(); - } else { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java index 5550be20d6f3c..1d22b41b1e8ee 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java +++ b/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -108,64 +108,19 @@ * * @since 1.5 */ - -@SuppressWarnings("serial") // serialVersionUID is not constant public class ModelMBeanOperationInfo extends MBeanOperationInfo implements DescriptorAccess { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 9087646304346171239L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 6532732096650090465L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("operationDescriptor", Descriptor.class), - new ObjectStreamField("currClass", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("operationDescriptor", Descriptor.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - /** - * @serialField operationDescriptor Descriptor The descriptor - * containing the appropriate metadata for this instance - */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final long serialVersionUID = 6532732096650090465L; + /** + * @serialField operationDescriptor Descriptor The descriptor + * containing the appropriate metadata for this instance + */ + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("operationDescriptor", Descriptor.class) + }; /** * @serial The descriptor containing the appropriate metadata for this instance @@ -515,21 +470,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("operationDescriptor", operationDescriptor); - fields.put("currClass", currClass); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // out.defaultWriteObject(); - } } } diff --git a/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java b/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java index 2be6f37bf3bcf..daa1abf039efc 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java +++ b/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -49,54 +49,10 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class XMLParseException extends Exception { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -7780049316655891976L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 3176664577895105181L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("msgStr", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = { }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK: No compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final long serialVersionUID = 3176664577895105181L; /** * Default constructor . @@ -141,19 +97,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("msgStr", getMessage()); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java b/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java index d02d15cb1e5f5..7579e416e36d0 100644 --- a/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java +++ b/src/java.management/share/classes/javax/management/relation/MBeanServerNotificationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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,37 +57,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID must be constant public class MBeanServerNotificationFilter extends NotificationFilterSupport { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 6001782699077323605L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 2605900539589789736L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("mySelectObjNameList", Vector.class), - new ObjectStreamField("myDeselectObjNameList", Vector.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("selectedNames", List.class), - new ObjectStreamField("deselectedNames", List.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = 2605900539589789736L; /** * @serialField selectedNames List List of {@link ObjectName}s of interest *
            @@ -102,27 +74,11 @@ public class MBeanServerNotificationFilter extends NotificationFilterSupport { *
          • Empty vector means that no {@link ObjectName} is explicitly deselected
          • *
          */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("selectedNames", List.class), + new ObjectStreamField("deselectedNames", List.class) + }; // // Private members @@ -405,28 +361,7 @@ public synchronized boolean isNotificationEnabled(Notification notif) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - selectedNames = cast(fields.get("mySelectObjNameList", null)); - if (fields.defaulted("mySelectObjNameList")) - { - throw new NullPointerException("mySelectObjNameList"); - } - deselectedNames = cast(fields.get("myDeselectObjNameList", null)); - if (fields.defaulted("myDeselectObjNameList")) - { - throw new NullPointerException("myDeselectObjNameList"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -435,20 +370,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("mySelectObjNameList", selectedNames); - fields.put("myDeselectObjNameList", deselectedNames); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/RelationNotification.java b/src/java.management/share/classes/javax/management/relation/RelationNotification.java index 11c2fab163e06..16d660bc07fb8 100644 --- a/src/java.management/share/classes/javax/management/relation/RelationNotification.java +++ b/src/java.management/share/classes/javax/management/relation/RelationNotification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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,47 +57,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class RelationNotification extends Notification { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -2126464566505527147L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -6871117877523310399L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myNewRoleValue", ArrayList.class), - new ObjectStreamField("myOldRoleValue", ArrayList.class), - new ObjectStreamField("myRelId", String.class), - new ObjectStreamField("myRelObjName", ObjectName.class), - new ObjectStreamField("myRelTypeName", String.class), - new ObjectStreamField("myRoleName", String.class), - new ObjectStreamField("myUnregMBeanList", ArrayList.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("newRoleValue", List.class), - new ObjectStreamField("oldRoleValue", List.class), - new ObjectStreamField("relationId", String.class), - new ObjectStreamField("relationObjName", ObjectName.class), - new ObjectStreamField("relationTypeName", String.class), - new ObjectStreamField("roleName", String.class), - new ObjectStreamField("unregisterMBeanList", List.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -6871117877523310399L; /** * @serialField relationId String Relation identifier of * created/removed/updated relation @@ -115,27 +77,16 @@ public class RelationNotification extends Notification { * @serialField newRoleValue List New role value ({@link * ArrayList} of {@link ObjectName}s) (only for role update) */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("newRoleValue", List.class), + new ObjectStreamField("oldRoleValue", List.class), + new ObjectStreamField("relationId", String.class), + new ObjectStreamField("relationObjName", ObjectName.class), + new ObjectStreamField("relationTypeName", String.class), + new ObjectStreamField("roleName", String.class), + new ObjectStreamField("unregisterMBeanList", List.class) + }; // // Notification types @@ -541,26 +492,14 @@ private void readObject(ObjectInputStream in) ObjectInputStream.GetField fields = in.readFields(); - if (compat) { - tmpRelationId = (String)fields.get("myRelId", null); - tmpRelationTypeName = (String)fields.get("myRelTypeName", null); - tmpRoleName = (String)fields.get("myRoleName", null); + tmpRelationId = (String)fields.get("relationId", null); + tmpRelationTypeName = (String)fields.get("relationTypeName", null); + tmpRoleName = (String)fields.get("roleName", null); - tmpRelationObjName = (ObjectName)fields.get("myRelObjName", null); - tmpNewRoleValue = cast(fields.get("myNewRoleValue", null)); - tmpOldRoleValue = cast(fields.get("myOldRoleValue", null)); - tmpUnregMBeanList = cast(fields.get("myUnregMBeanList", null)); - } - else { - tmpRelationId = (String)fields.get("relationId", null); - tmpRelationTypeName = (String)fields.get("relationTypeName", null); - tmpRoleName = (String)fields.get("roleName", null); - - tmpRelationObjName = (ObjectName)fields.get("relationObjName", null); - tmpNewRoleValue = cast(fields.get("newRoleValue", null)); - tmpOldRoleValue = cast(fields.get("oldRoleValue", null)); - tmpUnregMBeanList = cast(fields.get("unregisterMBeanList", null)); - } + tmpRelationObjName = (ObjectName)fields.get("relationObjName", null); + tmpNewRoleValue = cast(fields.get("newRoleValue", null)); + tmpOldRoleValue = cast(fields.get("oldRoleValue", null)); + tmpUnregMBeanList = cast(fields.get("unregisterMBeanList", null)); // Validate fields we just read, throw InvalidObjectException // if something goes wrong @@ -591,25 +530,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myNewRoleValue", newRoleValue); - fields.put("myOldRoleValue", oldRoleValue); - fields.put("myRelId", relationId); - fields.put("myRelObjName", relationObjName); - fields.put("myRelTypeName", relationTypeName); - fields.put("myRoleName",roleName); - fields.put("myUnregMBeanList", unregisterMBeanList); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java b/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java index 5038fed2cfe59..766c42ca78079 100644 --- a/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java +++ b/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -63,39 +63,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class RelationTypeSupport implements RelationType { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -8179019472410837190L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 4611072955724144607L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myTypeName", String.class), - new ObjectStreamField("myRoleName2InfoMap", HashMap.class), - new ObjectStreamField("myIsInRelServFlg", boolean.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("typeName", String.class), - new ObjectStreamField("roleName2InfoMap", Map.class), - new ObjectStreamField("isInRelationService", boolean.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = 4611072955724144607L; /** * @serialField typeName String Relation type name * @serialField roleName2InfoMap Map {@link Map} holding the mapping: @@ -103,27 +73,12 @@ public class RelationTypeSupport implements RelationType { * @serialField isInRelationService boolean Flag specifying whether the relation type has been declared in the * Relation Service (so can no longer be updated) */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("typeName", String.class), + new ObjectStreamField("roleName2InfoMap", Map.class), + new ObjectStreamField("isInRelationService", boolean.class) + }; // // Private members @@ -421,33 +376,7 @@ static void checkRoleInfos(RoleInfo[] roleInfoArray) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - typeName = (String) fields.get("myTypeName", null); - if (fields.defaulted("myTypeName")) - { - throw new NullPointerException("myTypeName"); - } - roleName2InfoMap = cast(fields.get("myRoleName2InfoMap", null)); - if (fields.defaulted("myRoleName2InfoMap")) - { - throw new NullPointerException("myRoleName2InfoMap"); - } - isInRelationService = fields.get("myIsInRelServFlg", false); - if (fields.defaulted("myIsInRelServFlg")) - { - throw new NullPointerException("myIsInRelServFlg"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -456,21 +385,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myTypeName", typeName); - fields.put("myRoleName2InfoMap", roleName2InfoMap); - fields.put("myIsInRelServFlg", isInRelationService); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/Role.java b/src/java.management/share/classes/javax/management/relation/Role.java index 60accb2e00720..431092a3b4876 100644 --- a/src/java.management/share/classes/javax/management/relation/Role.java +++ b/src/java.management/share/classes/javax/management/relation/Role.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -51,62 +51,18 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class Role implements Serializable { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -1959486389343113026L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -279985518429862552L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myName", String.class), - new ObjectStreamField("myObjNameList", ArrayList.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("name", String.class), - new ObjectStreamField("objectNameList", List.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -279985518429862552L; /** * @serialField name String Role name * @serialField objectNameList List {@link List} of {@link ObjectName}s of referenced MBeans */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("name", String.class), + new ObjectStreamField("objectNameList", List.class) + }; // // Private members @@ -290,28 +246,7 @@ public static String roleValueToString(List roleValue) */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - name = (String) fields.get("myName", null); - if (fields.defaulted("myName")) - { - throw new NullPointerException("myName"); - } - objectNameList = cast(fields.get("myObjNameList", null)); - if (fields.defaulted("myObjNameList")) - { - throw new NullPointerException("myObjNameList"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -320,20 +255,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myName", name); - fields.put("myObjNameList", objectNameList); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/RoleInfo.java b/src/java.management/share/classes/javax/management/relation/RoleInfo.java index 23258ce8c72d0..6f2926005e965 100644 --- a/src/java.management/share/classes/javax/management/relation/RoleInfo.java +++ b/src/java.management/share/classes/javax/management/relation/RoleInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -46,47 +46,9 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class RoleInfo implements Serializable { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 7227256952085334351L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = 2504952983494636987L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myName", String.class), - new ObjectStreamField("myIsReadableFlg", boolean.class), - new ObjectStreamField("myIsWritableFlg", boolean.class), - new ObjectStreamField("myDescription", String.class), - new ObjectStreamField("myMinDegree", int.class), - new ObjectStreamField("myMaxDegree", int.class), - new ObjectStreamField("myRefMBeanClassName", String.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("name", String.class), - new ObjectStreamField("isReadable", boolean.class), - new ObjectStreamField("isWritable", boolean.class), - new ObjectStreamField("description", String.class), - new ObjectStreamField("minDegree", int.class), - new ObjectStreamField("maxDegree", int.class), - new ObjectStreamField("referencedMBeanClassName", String.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = 2504952983494636987L; /** * @serialField name String Role name * @serialField isReadable boolean Read access mode: {@code true} if role is readable @@ -96,27 +58,16 @@ public class RoleInfo implements Serializable { * @serialField maxDegree int Maximum degree (i.e. maximum number of referenced MBeans in corresponding role) * @serialField referencedMBeanClassName String Name of class of MBean(s) expected to be referenced in corresponding role */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("name", String.class), + new ObjectStreamField("isReadable", boolean.class), + new ObjectStreamField("isWritable", boolean.class), + new ObjectStreamField("description", String.class), + new ObjectStreamField("minDegree", int.class), + new ObjectStreamField("maxDegree", int.class), + new ObjectStreamField("referencedMBeanClassName", String.class) + }; // // Public constants @@ -530,53 +481,7 @@ private void init(String roleName, */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - name = (String) fields.get("myName", null); - if (fields.defaulted("myName")) - { - throw new NullPointerException("myName"); - } - isReadable = fields.get("myIsReadableFlg", false); - if (fields.defaulted("myIsReadableFlg")) - { - throw new NullPointerException("myIsReadableFlg"); - } - isWritable = fields.get("myIsWritableFlg", false); - if (fields.defaulted("myIsWritableFlg")) - { - throw new NullPointerException("myIsWritableFlg"); - } - description = (String) fields.get("myDescription", null); - if (fields.defaulted("myDescription")) - { - throw new NullPointerException("myDescription"); - } - minDegree = fields.get("myMinDegree", 0); - if (fields.defaulted("myMinDegree")) - { - throw new NullPointerException("myMinDegree"); - } - maxDegree = fields.get("myMaxDegree", 0); - if (fields.defaulted("myMaxDegree")) - { - throw new NullPointerException("myMaxDegree"); - } - referencedMBeanClassName = (String) fields.get("myRefMBeanClassName", null); - if (fields.defaulted("myRefMBeanClassName")) - { - throw new NullPointerException("myRefMBeanClassName"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -585,26 +490,7 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myName", name); - fields.put("myIsReadableFlg", isReadable); - fields.put("myIsWritableFlg", isWritable); - fields.put("myDescription", description); - fields.put("myMinDegree", minDegree); - fields.put("myMaxDegree", maxDegree); - fields.put("myRefMBeanClassName", referencedMBeanClassName); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/RoleResult.java b/src/java.management/share/classes/javax/management/relation/RoleResult.java index 60836c897e595..7f98a7f7a243b 100644 --- a/src/java.management/share/classes/javax/management/relation/RoleResult.java +++ b/src/java.management/share/classes/javax/management/relation/RoleResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -44,62 +44,18 @@ * * @since 1.5 */ -@SuppressWarnings("serial") public class RoleResult implements Serializable { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = 3786616013762091099L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -6304063118040985512L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myRoleList", RoleList.class), - new ObjectStreamField("myRoleUnresList", RoleUnresolvedList.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = - { - new ObjectStreamField("roleList", RoleList.class), - new ObjectStreamField("unresolvedRoleList", RoleUnresolvedList.class) - }; - // - // Actual serial version and serial form - private static final long serialVersionUID; + private static final long serialVersionUID = -6304063118040985512L; /** * @serialField roleList RoleList List of roles successfully accessed * @serialField unresolvedRoleList RoleUnresolvedList List of roles unsuccessfully accessed */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff + private static final ObjectStreamField[] serialPersistentFields = + { + new ObjectStreamField("roleList", RoleList.class), + new ObjectStreamField("unresolvedRoleList", RoleUnresolvedList.class) + }; // // Private members @@ -206,28 +162,7 @@ public void setRolesUnresolved(RoleUnresolvedList unresolvedList) { */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - roleList = (RoleList) fields.get("myRoleList", null); - if (fields.defaulted("myRoleList")) - { - throw new NullPointerException("myRoleList"); - } - unresolvedRoleList = (RoleUnresolvedList) fields.get("myRoleUnresList", null); - if (fields.defaulted("myRoleUnresList")) - { - throw new NullPointerException("myRoleUnresList"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -236,20 +171,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myRoleList", roleList); - fields.put("myRoleUnresList", unresolvedRoleList); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/java.management/share/classes/javax/management/relation/RoleUnresolved.java b/src/java.management/share/classes/javax/management/relation/RoleUnresolved.java index 169b1263fdb53..36b6dff9d71c6 100644 --- a/src/java.management/share/classes/javax/management/relation/RoleUnresolved.java +++ b/src/java.management/share/classes/javax/management/relation/RoleUnresolved.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -52,64 +52,19 @@ * * @since 1.5 */ -@SuppressWarnings("serial") // serialVersionUID not constant public class RoleUnresolved implements Serializable { - // Serialization compatibility stuff: - // Two serial forms are supported in this class. The selected form depends - // on system property "jmx.serial.form": - // - "1.0" for JMX 1.0 - // - any other value for JMX 1.1 and higher - // - // Serial version for old serial form - private static final long oldSerialVersionUID = -9026457686611660144L; - // - // Serial version for new serial form - private static final long newSerialVersionUID = -48350262537070138L; - // - // Serializable fields in old serial form - private static final ObjectStreamField[] oldSerialPersistentFields = - { - new ObjectStreamField("myRoleName", String.class), - new ObjectStreamField("myRoleValue", ArrayList.class), - new ObjectStreamField("myPbType", int.class) - }; - // - // Serializable fields in new serial form - private static final ObjectStreamField[] newSerialPersistentFields = + private static final long serialVersionUID = -48350262537070138L; + /** @serialField roleName String Role name + * @serialField roleValue List Role value ({@link List} of {@link ObjectName} objects) + * @serialField problemType int Problem type + */ + private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("roleName", String.class), new ObjectStreamField("roleValue", List.class), new ObjectStreamField("problemType", int.class) }; - // - // Actual serial version and serial form - private static final long serialVersionUID; - /** @serialField roleName String Role name - * @serialField roleValue List Role value ({@link List} of {@link ObjectName} objects) - * @serialField problemType int Problem type - */ - private static final ObjectStreamField[] serialPersistentFields; - private static boolean compat = false; - static { - try { - GetPropertyAction act = new GetPropertyAction("jmx.serial.form"); - @SuppressWarnings("removal") - String form = AccessController.doPrivileged(act); - compat = (form != null && form.equals("1.0")); - } catch (Exception e) { - // OK : Too bad, no compat with 1.0 - } - if (compat) { - serialPersistentFields = oldSerialPersistentFields; - serialVersionUID = oldSerialVersionUID; - } else { - serialPersistentFields = newSerialPersistentFields; - serialVersionUID = newSerialVersionUID; - } - } - // - // END Serialization compatibility stuff // // Private members @@ -304,33 +259,7 @@ public String toString() { */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // - ObjectInputStream.GetField fields = in.readFields(); - roleName = (String) fields.get("myRoleName", null); - if (fields.defaulted("myRoleName")) - { - throw new NullPointerException("myRoleName"); - } - roleValue = cast(fields.get("myRoleValue", null)); - if (fields.defaulted("myRoleValue")) - { - throw new NullPointerException("myRoleValue"); - } - problemType = fields.get("myPbType", 0); - if (fields.defaulted("myPbType")) - { - throw new NullPointerException("myPbType"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + in.defaultReadObject(); } @@ -339,21 +268,6 @@ private void readObject(ObjectInputStream in) */ private void writeObject(ObjectOutputStream out) throws IOException { - if (compat) - { - // Serializes this instance in the old serial form - // - ObjectOutputStream.PutField fields = out.putFields(); - fields.put("myRoleName", roleName); - fields.put("myRoleValue", roleValue); - fields.put("myPbType", problemType); - out.writeFields(); - } - else - { - // Serializes this instance in the new serial form - // - out.defaultWriteObject(); - } + out.defaultWriteObject(); } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java index 346aab18a60fd..a2937b73a143f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java @@ -285,7 +285,12 @@ public static EnumSet asFlagSet(long flags) { /** * Flag that marks a synthetic method body for a lambda expression */ - public static final long LAMBDA_METHOD = 1L<<49; + public static final long LAMBDA_METHOD = 1L<<49; //MethodSymbols only + + /** + * Flag that marks a synthetic local capture field in a local/anon class + */ + public static final long LOCAL_CAPTURE_FIELD = 1L<<49; //VarSymbols only /** * Flag to control recursion in TransTypes diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 44ccbade4a900..07a136c17003c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -182,6 +182,7 @@ protected Attr(Context context) { unknownTypeInfo = new ResultInfo(KindSelector.TYP, Type.noType); unknownTypeExprInfo = new ResultInfo(KindSelector.VAL_TYP, Type.noType); recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext); + initBlockType = new MethodType(List.nil(), syms.voidType, List.nil(), syms.methodClass); } /** Switch: reifiable types in instanceof enabled? @@ -628,6 +629,7 @@ public void report(DiagnosticPosition pos, JCDiagnostic details) { final ResultInfo unknownTypeInfo; final ResultInfo unknownTypeExprInfo; final ResultInfo recoveryInfo; + final MethodType initBlockType; Type pt() { return resultInfo.pt; @@ -1421,7 +1423,7 @@ public void visitBlock(JCBlock tree) { // created BLOCK-method. Symbol fakeOwner = new MethodSymbol(tree.flags | BLOCK | - env.info.scope.owner.flags() & STRICTFP, names.empty, null, + env.info.scope.owner.flags() & STRICTFP, names.empty, initBlockType, env.info.scope.owner); final Env localEnv = env.dup(tree, env.info.dup(env.info.scope.dupUnshared(fakeOwner))); @@ -3524,62 +3526,26 @@ void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkCon } } - /* Map to hold 'fake' clinit methods. If a lambda is used to initialize a - * static field and that lambda has type annotations, these annotations will - * also be stored at these fake clinit methods. - * - * LambdaToMethod also use fake clinit methods so they can be reused. - * Also as LTM is a phase subsequent to attribution, the methods from - * clinits can be safely removed by LTM to save memory. - */ - private Map clinits = new HashMap<>(); - - public MethodSymbol removeClinit(ClassSymbol sym) { - return clinits.remove(sym); - } - /* This method returns an environment to be used to attribute a lambda * expression. * * The owner of this environment is a method symbol. If the current owner - * is not a method, for example if the lambda is used to initialize - * a field, then if the field is: - * - * - an instance field, we use the first constructor. - * - a static field, we create a fake clinit method. + * is not a method (e.g. if the lambda occurs in a field initializer), then + * a synthetic method symbol owner is created. */ public Env lambdaEnv(JCLambda that, Env env) { Env lambdaEnv; Symbol owner = env.info.scope.owner; if (owner.kind == VAR && owner.owner.kind == TYP) { - //field initializer + // If the lambda is nested in a field initializer, we need to create a fake init method. + // Uniqueness of this symbol is not important (as e.g. annotations will be added on the + // init symbol's owner). ClassSymbol enclClass = owner.enclClass(); - Symbol newScopeOwner = env.info.scope.owner; - /* if the field isn't static, then we can get the first constructor - * and use it as the owner of the environment. This is what - * LTM code is doing to look for type annotations so we are fine. - */ - if ((owner.flags() & STATIC) == 0) { - for (Symbol s : enclClass.members_field.getSymbolsByName(names.init)) { - newScopeOwner = s; - break; - } - } else { - /* if the field is static then we need to create a fake clinit - * method, this method can later be reused by LTM. - */ - MethodSymbol clinit = clinits.get(enclClass); - if (clinit == null) { - Type clinitType = new MethodType(List.nil(), - syms.voidType, List.nil(), syms.methodClass); - clinit = new MethodSymbol(STATIC | SYNTHETIC | PRIVATE, - names.clinit, clinitType, enclClass); - clinit.params = List.nil(); - clinits.put(enclClass, clinit); - } - newScopeOwner = clinit; - } - lambdaEnv = env.dup(that, env.info.dup(env.info.scope.dupUnshared(newScopeOwner))); + Name initName = owner.isStatic() ? names.clinit : names.init; + MethodSymbol initSym = new MethodSymbol(BLOCK | (owner.isStatic() ? STATIC : 0) | SYNTHETIC | PRIVATE, + initName, initBlockType, enclClass); + initSym.params = List.nil(); + lambdaEnv = env.dup(that, env.info.dup(env.info.scope.dupUnshared(initSym))); } else { lambdaEnv = env.dup(that, env.info.dup(env.info.scope.dup())); } @@ -3936,6 +3902,7 @@ private void setFunctionalInfo(final Env env, final JCFunctionalExp inferenceContext -> setFunctionalInfo(env, fExpr, pt, inferenceContext.asInstType(descriptorType), inferenceContext.asInstType(primaryTarget), checkContext)); } else { + fExpr.owner = env.info.scope.owner; if (pt.hasTag(CLASS)) { fExpr.target = primaryTarget; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CaptureScanner.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CaptureScanner.java new file mode 100644 index 0000000000000..ef8a3ff584de6 --- /dev/null +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CaptureScanner.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024, 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. + */ + +package com.sun.tools.javac.comp; + +import com.sun.tools.javac.code.Symbol; +import com.sun.tools.javac.code.Symbol.VarSymbol; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.util.List; + +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.SequencedSet; +import java.util.Set; + +import static com.sun.tools.javac.code.Kinds.Kind.MTH; +import static com.sun.tools.javac.code.Kinds.Kind.VAR; + +/** + * A visitor which collects the set of local variables "captured" by a given tree. + */ +public class CaptureScanner extends TreeScanner { + + /** + * The tree under analysis. + */ + private final JCTree tree; + + /** + * The set of local variable declarations encountered in the tree under analysis. + */ + private final Set seenVars = new HashSet<>(); + + /** + * The set of captured local variables accessed from within the tree under analysis. + */ + private final SequencedSet fvs = new LinkedHashSet<>(); + + public CaptureScanner(JCTree ownerTree) { + this.tree = ownerTree; + } + + @Override + public void visitIdent(JCTree.JCIdent tree) { + Symbol sym = tree.sym; + if (sym.kind == VAR && sym.owner.kind == MTH) { + Symbol.VarSymbol vsym = (Symbol.VarSymbol) sym; + if (vsym.getConstValue() == null && !seenVars.contains(vsym)) { + addFreeVar(vsym); + } + } + } + + /** + * Add free variable to fvs list unless it is already there. + */ + protected void addFreeVar(Symbol.VarSymbol v) { + fvs.add(v); + } + + @Override + public void visitVarDef(JCTree.JCVariableDecl tree) { + if (tree.sym.owner.kind == MTH) { + seenVars.add(tree.sym); + } + super.visitVarDef(tree); + } + + /** + * Obtains the list of captured local variables in the tree under analysis. + */ + List analyzeCaptures() { + scan(tree); + return List.from(fvs); + } +} diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index 2c3d79c0ab6da..adfc3ceaa0d94 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -25,50 +25,87 @@ package com.sun.tools.javac.comp; -import com.sun.tools.javac.code.Symbol.MethodHandleSymbol; -import com.sun.tools.javac.code.Types.SignatureGenerator.InvalidSignatureException; -import com.sun.tools.javac.jvm.PoolConstant.LoadableConstant; -import com.sun.tools.javac.resources.CompilerProperties.Errors; -import com.sun.tools.javac.resources.CompilerProperties.Fragments; -import com.sun.tools.javac.tree.*; -import com.sun.tools.javac.tree.JCTree.*; -import com.sun.tools.javac.tree.JCTree.JCMemberReference.ReferenceKind; -import com.sun.tools.javac.tree.TreeMaker; -import com.sun.tools.javac.tree.TreeTranslator; import com.sun.tools.javac.code.Attribute; +import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.code.Symbol.DynamicMethodSymbol; +import com.sun.tools.javac.code.Symbol.MethodHandleSymbol; import com.sun.tools.javac.code.Symbol.MethodSymbol; import com.sun.tools.javac.code.Symbol.VarSymbol; import com.sun.tools.javac.code.Symtab; import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.Type.MethodType; import com.sun.tools.javac.code.Types; -import com.sun.tools.javac.comp.LambdaToMethod.LambdaAnalyzerPreprocessor.*; +import com.sun.tools.javac.code.Types.SignatureGenerator.InvalidSignatureException; +import com.sun.tools.javac.jvm.PoolConstant.LoadableConstant; +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.resources.CompilerProperties.Errors; +import com.sun.tools.javac.resources.CompilerProperties.Fragments; import com.sun.tools.javac.resources.CompilerProperties.Notes; -import com.sun.tools.javac.util.*; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.JCTree.JCAnnotation; +import com.sun.tools.javac.tree.JCTree.JCBinary; +import com.sun.tools.javac.tree.JCTree.JCBlock; +import com.sun.tools.javac.tree.JCTree.JCBreak; +import com.sun.tools.javac.tree.JCTree.JCCase; +import com.sun.tools.javac.tree.JCTree.JCClassDecl; +import com.sun.tools.javac.tree.JCTree.JCExpression; +import com.sun.tools.javac.tree.JCTree.JCFieldAccess; +import com.sun.tools.javac.tree.JCTree.JCFunctionalExpression; +import com.sun.tools.javac.tree.JCTree.JCIdent; +import com.sun.tools.javac.tree.JCTree.JCLambda; +import com.sun.tools.javac.tree.JCTree.JCMemberReference; +import com.sun.tools.javac.tree.JCTree.JCMethodDecl; +import com.sun.tools.javac.tree.JCTree.JCMethodInvocation; +import com.sun.tools.javac.tree.JCTree.JCNewClass; +import com.sun.tools.javac.tree.JCTree.JCReturn; +import com.sun.tools.javac.tree.JCTree.JCStatement; +import com.sun.tools.javac.tree.JCTree.JCSwitch; +import com.sun.tools.javac.tree.JCTree.JCVariableDecl; +import com.sun.tools.javac.tree.JCTree.Tag; +import com.sun.tools.javac.tree.TreeInfo; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.tree.TreeTranslator; +import com.sun.tools.javac.util.Assert; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.DiagnosticSource; +import com.sun.tools.javac.util.InvalidUtfException; +import com.sun.tools.javac.util.JCDiagnostic; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Log; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Names; +import com.sun.tools.javac.util.Options; -import java.util.EnumMap; +import javax.lang.model.element.ElementKind; +import java.lang.invoke.LambdaMetafactory; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedHashMap; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.function.Supplier; -import static com.sun.tools.javac.comp.LambdaToMethod.LambdaSymbolKind.*; -import static com.sun.tools.javac.code.Flags.*; -import static com.sun.tools.javac.code.Kinds.Kind.*; -import static com.sun.tools.javac.code.TypeTag.*; -import static com.sun.tools.javac.tree.JCTree.Tag.*; - -import javax.lang.model.element.ElementKind; - -import com.sun.tools.javac.main.Option; +import static com.sun.tools.javac.code.Flags.ABSTRACT; +import static com.sun.tools.javac.code.Flags.BLOCK; +import static com.sun.tools.javac.code.Flags.DEFAULT; +import static com.sun.tools.javac.code.Flags.FINAL; +import static com.sun.tools.javac.code.Flags.INTERFACE; +import static com.sun.tools.javac.code.Flags.LAMBDA_METHOD; +import static com.sun.tools.javac.code.Flags.LOCAL_CAPTURE_FIELD; +import static com.sun.tools.javac.code.Flags.PARAMETER; +import static com.sun.tools.javac.code.Flags.PRIVATE; +import static com.sun.tools.javac.code.Flags.STATIC; +import static com.sun.tools.javac.code.Flags.STRICTFP; +import static com.sun.tools.javac.code.Flags.SYNTHETIC; +import static com.sun.tools.javac.code.Kinds.Kind.MTH; +import static com.sun.tools.javac.code.Kinds.Kind.TYP; +import static com.sun.tools.javac.code.Kinds.Kind.VAR; +import static com.sun.tools.javac.code.TypeTag.BOT; +import static com.sun.tools.javac.code.TypeTag.VOID; /** * This pass desugars lambda expressions into static methods @@ -80,31 +117,28 @@ */ public class LambdaToMethod extends TreeTranslator { - private Attr attr; - private JCDiagnostic.Factory diags; - private Log log; - private Lower lower; - private Names names; - private Symtab syms; - private Resolve rs; - private Operators operators; + private final Attr attr; + private final JCDiagnostic.Factory diags; + private final Log log; + private final Lower lower; + private final Names names; + private final Symtab syms; + private final Resolve rs; + private final Operators operators; private TreeMaker make; - private Types types; - private TransTypes transTypes; + private final Types types; + private final TransTypes transTypes; private Env attrEnv; - /** the analyzer scanner */ - private LambdaAnalyzerPreprocessor analyzer; - - /** map from lambda trees to translation contexts */ - private Map> contextMap; - - /** current translation context (visitor argument) */ - private TranslationContext context; - /** info about the current class being processed */ private KlassInfo kInfo; + /** translation context of the current lambda expression */ + private LambdaTranslationContext lambdaContext; + + /** the variable whose initializer is pending */ + private VarSymbol pendingVar; + /** dump statistics about lambda code generation */ private final boolean dumpLambdaToMethodStats; @@ -121,13 +155,13 @@ public class LambdaToMethod extends TreeTranslator { private final boolean deduplicateLambdas; /** Flag for alternate metafactories indicating the lambda object is intended to be serializable */ - public static final int FLAG_SERIALIZABLE = 1 << 0; + public static final int FLAG_SERIALIZABLE = LambdaMetafactory.FLAG_SERIALIZABLE; /** Flag for alternate metafactories indicating the lambda object has multiple targets */ - public static final int FLAG_MARKERS = 1 << 1; + public static final int FLAG_MARKERS = LambdaMetafactory.FLAG_MARKERS; /** Flag for alternate metafactories indicating the lambda object requires multiple bridges */ - public static final int FLAG_BRIDGES = 1 << 2; + public static final int FLAG_BRIDGES = LambdaMetafactory.FLAG_BRIDGES; // protected static final Context.Key unlambdaKey = new Context.Key<>(); @@ -151,18 +185,17 @@ private LambdaToMethod(Context context) { make = TreeMaker.instance(context); types = Types.instance(context); transTypes = TransTypes.instance(context); - analyzer = new LambdaAnalyzerPreprocessor(); Options options = Options.instance(context); dumpLambdaToMethodStats = options.isSet("debug.dumpLambdaToMethodStats"); attr = Attr.instance(context); forceSerializable = options.isSet("forceSerializable"); boolean lineDebugInfo = - options.isUnset(Option.G_CUSTOM) || - options.isSet(Option.G_CUSTOM, "lines"); + options.isUnset(Option.G_CUSTOM) || + options.isSet(Option.G_CUSTOM, "lines"); boolean varDebugInfo = - options.isUnset(Option.G_CUSTOM) - ? options.isSet(Option.G) - : options.isSet(Option.G_CUSTOM, "vars"); + options.isUnset(Option.G_CUSTOM) + ? options.isSet(Option.G) + : options.isSet(Option.G_CUSTOM, "vars"); debugLinesOrVars = lineDebugInfo || varDebugInfo; verboseDeduplication = options.isSet("debug.dumpLambdaToMethodDeduplication"); deduplicateLambdas = options.getBoolean("deduplicateLambdas", true); @@ -180,7 +213,6 @@ class DedupedLambda { this.tree = tree; } - @Override public int hashCode() { int hashCode = this.hashCode; @@ -203,18 +235,18 @@ private class KlassInfo { /** * list of methods to append */ - private ListBuffer appendedMethodList; + private ListBuffer appendedMethodList = new ListBuffer<>(); - private Map dedupedLambdas; + private final Map dedupedLambdas = new HashMap<>(); - private Map dynMethSyms = new HashMap<>(); + private final Map dynMethSyms = new HashMap<>(); /** * list of deserialization cases */ - private final Map> deserializeCases; + private final Map> deserializeCases = new HashMap<>(); - /** + /** * deserialize method symbol */ private final MethodSymbol deserMethodSym; @@ -226,11 +258,10 @@ private class KlassInfo { private final JCClassDecl clazz; + private final Map syntheticNames = new HashMap<>(); + private KlassInfo(JCClassDecl clazz) { this.clazz = clazz; - appendedMethodList = new ListBuffer<>(); - dedupedLambdas = new HashMap<>(); - deserializeCases = new HashMap<>(); MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType, List.nil(), syms.methodClass); deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, clazz.sym); @@ -241,62 +272,50 @@ private KlassInfo(JCClassDecl clazz) { private void addMethod(JCTree decl) { appendedMethodList = appendedMethodList.prepend(decl); } - } - - // - @Override - public T translate(T tree) { - TranslationContext newContext = contextMap.get(tree); - return translate(tree, newContext != null ? newContext : context); - } - T translate(T tree, TranslationContext newContext) { - TranslationContext prevContext = context; - try { - context = newContext; - return super.translate(tree); - } - finally { - context = prevContext; - } - } - - List translate(List trees, TranslationContext newContext) { - ListBuffer buf = new ListBuffer<>(); - for (T tree : trees) { - buf.append(translate(tree, newContext)); + int syntheticNameIndex(StringBuilder buf, int start) { + String temp = buf.toString(); + Integer count = syntheticNames.get(temp); + if (count == null) { + count = start; + } + syntheticNames.put(temp, count + 1); + return count; } - return buf.toList(); } + // public JCTree translateTopLevelClass(Env env, JCTree cdef, TreeMaker make) { this.make = make; this.attrEnv = env; - this.context = null; - this.contextMap = new HashMap<>(); - cdef = analyzer.analyzeAndPreprocessClass((JCClassDecl) cdef); return translate(cdef); } - // - // /** * Visit a class. * Maintain the translatedMethodList across nested classes. * Append the translatedMethodList to the class after it is translated. - * @param tree */ @Override public void visitClassDef(JCClassDecl tree) { KlassInfo prevKlassInfo = kInfo; + DiagnosticSource prevSource = log.currentSource(); + LambdaTranslationContext prevLambdaContext = lambdaContext; + VarSymbol prevPendingVar = pendingVar; try { kInfo = new KlassInfo(tree); + log.useSource(tree.sym.sourcefile); + lambdaContext = null; + pendingVar = null; super.visitClassDef(tree); + if (prevLambdaContext != null) { + tree.sym.owner = prevLambdaContext.translatedSym; + } if (!kInfo.deserializeCases.isEmpty()) { int prevPos = make.pos; try { make.at(tree); - kInfo.addMethod(makeDeserializeMethod(tree.sym)); + kInfo.addMethod(makeDeserializeMethod()); } finally { make.at(prevPos); } @@ -310,6 +329,9 @@ public void visitClassDef(JCClassDecl tree) { result = tree; } finally { kInfo = prevKlassInfo; + log.useSource(prevSource.getFile()); + lambdaContext = prevLambdaContext; + pendingVar = prevPendingVar; } } @@ -317,11 +339,10 @@ public void visitClassDef(JCClassDecl tree) { * Translate a lambda into a method to be inserted into the class. * Then replace the lambda site with an invokedynamic call of to lambda * meta-factory, which will use the lambda method. - * @param tree */ @Override public void visitLambda(JCLambda tree) { - LambdaTranslationContext localContext = (LambdaTranslationContext)context; + LambdaTranslationContext localContext = new LambdaTranslationContext(tree); MethodSymbol sym = localContext.translatedSym; MethodType lambdaType = (MethodType) sym.type; @@ -332,26 +353,26 @@ public void visitLambda(JCLambda tree) { lambda and attach it to the implementation method. */ - Symbol owner = localContext.owner; + Symbol owner = tree.owner; apportionTypeAnnotations(tree, owner::getRawTypeAttributes, owner::setTypeAttributes, sym::setTypeAttributes); - - boolean init; - if ((init = (owner.name == names.init)) || owner.name == names.clinit) { - owner = owner.owner; + final long ownerFlags = owner.flags(); + if ((ownerFlags & Flags.BLOCK) != 0) { + ClassSymbol cs = (ClassSymbol) owner.owner; + boolean isStaticInit = (ownerFlags & Flags.STATIC) != 0; apportionTypeAnnotations(tree, - init ? owner::getInitTypeAttributes : owner::getClassInitTypeAttributes, - init ? owner::setInitTypeAttributes : owner::setClassInitTypeAttributes, + isStaticInit ? cs::getClassInitTypeAttributes : cs::getInitTypeAttributes, + isStaticInit ? cs::setClassInitTypeAttributes : cs::setInitTypeAttributes, sym::appendUniqueTypeAttributes); } - if (localContext.self != null && localContext.self.getKind() == ElementKind.FIELD) { - owner = localContext.self; + + if (pendingVar != null && pendingVar.getKind() == ElementKind.FIELD) { apportionTypeAnnotations(tree, - owner::getRawTypeAttributes, - owner::setTypeAttributes, + pendingVar::getRawTypeAttributes, + pendingVar::setTypeAttributes, sym::appendUniqueTypeAttributes); } } @@ -363,35 +384,13 @@ public void visitLambda(JCLambda tree) { List.nil(), localContext.syntheticParams, lambdaType.getThrownTypes() == null ? - List.nil() : - make.Types(lambdaType.getThrownTypes()), + List.nil() : + make.Types(lambdaType.getThrownTypes()), null, null); lambdaDecl.sym = sym; lambdaDecl.type = lambdaType; - //translate lambda body - //As the lambda body is translated, all references to lambda locals, - //captured variables, enclosing members are adjusted accordingly - //to refer to the static method parameters (rather than i.e. accessing - //captured members directly). - lambdaDecl.body = translate(makeLambdaBody(tree, lambdaDecl)); - - boolean dedupe = false; - if (deduplicateLambdas && !debugLinesOrVars && !localContext.isSerializable()) { - DedupedLambda dedupedLambda = new DedupedLambda(lambdaDecl.sym, lambdaDecl.body); - DedupedLambda existing = kInfo.dedupedLambdas.putIfAbsent(dedupedLambda, dedupedLambda); - if (existing != null) { - sym = existing.symbol; - dedupe = true; - if (verboseDeduplication) log.note(tree, Notes.VerboseL2mDeduplicate(sym)); - } - } - if (!dedupe) { - //Add the method to the list of methods to be added to this class. - kInfo.addMethod(lambdaDecl); - } - //now that we have generated a method for the lambda expression, //we can translate the lambda into a method reference pointing to the newly //created method. @@ -408,46 +407,72 @@ public void visitLambda(JCLambda tree) { if (!sym.isStatic()) { syntheticInits.append(makeThis( sym.owner.enclClass().asType(), - localContext.owner.enclClass())); + tree.owner.enclClass())); } //add captured locals - for (Symbol fv : localContext.getSymbolMap(CAPTURED_VAR).keySet()) { - if (fv != localContext.self) { - JCExpression captured_local = make.Ident(fv).setType(fv.type); - syntheticInits.append(captured_local); - } + for (Symbol fv : localContext.capturedVars) { + JCExpression captured_local = make.Ident(fv).setType(fv.type); + syntheticInits.append(captured_local); } //then, determine the arguments to the indy call - List indy_args = translate(syntheticInits.toList(), localContext.prev); + List indy_args = translate(syntheticInits.toList()); + + LambdaTranslationContext prevLambdaContext = lambdaContext; + try { + lambdaContext = localContext; + //translate lambda body + //As the lambda body is translated, all references to lambda locals, + //captured variables, enclosing members are adjusted accordingly + //to refer to the static method parameters (rather than i.e. accessing + //captured members directly). + lambdaDecl.body = translate(makeLambdaBody(tree, lambdaDecl)); + } finally { + lambdaContext = prevLambdaContext; + } + + boolean dedupe = false; + if (deduplicateLambdas && !debugLinesOrVars && !isSerializable(tree)) { + DedupedLambda dedupedLambda = new DedupedLambda(lambdaDecl.sym, lambdaDecl.body); + DedupedLambda existing = kInfo.dedupedLambdas.putIfAbsent(dedupedLambda, dedupedLambda); + if (existing != null) { + sym = existing.symbol; + dedupe = true; + if (verboseDeduplication) log.note(tree, Notes.VerboseL2mDeduplicate(sym)); + } + } + if (!dedupe) { + //Add the method to the list of methods to be added to this class. + kInfo.addMethod(lambdaDecl); + } //convert to an invokedynamic call - result = makeMetafactoryIndyCall(context, sym.asHandle(), indy_args); + result = makeMetafactoryIndyCall(tree, sym.asHandle(), localContext.translatedSym, indy_args); } // where - // Reassign type annotations from the source that should really belong to the lambda - private void apportionTypeAnnotations(JCLambda tree, - Supplier> source, - Consumer> owner, - Consumer> lambda) { - - ListBuffer ownerTypeAnnos = new ListBuffer<>(); - ListBuffer lambdaTypeAnnos = new ListBuffer<>(); - - for (Attribute.TypeCompound tc : source.get()) { - if (tc.position.onLambda == tree) { - lambdaTypeAnnos.append(tc); - } else { - ownerTypeAnnos.append(tc); - } - } - if (lambdaTypeAnnos.nonEmpty()) { - owner.accept(ownerTypeAnnos.toList()); - lambda.accept(lambdaTypeAnnos.toList()); + // Reassign type annotations from the source that should really belong to the lambda + private void apportionTypeAnnotations(JCLambda tree, + Supplier> source, + Consumer> owner, + Consumer> lambda) { + + ListBuffer ownerTypeAnnos = new ListBuffer<>(); + ListBuffer lambdaTypeAnnos = new ListBuffer<>(); + + for (Attribute.TypeCompound tc : source.get()) { + if (tc.position.onLambda == tree) { + lambdaTypeAnnos.append(tc); + } else { + ownerTypeAnnos.append(tc); } } + if (lambdaTypeAnnos.nonEmpty()) { + owner.accept(ownerTypeAnnos.toList()); + lambda.accept(lambdaTypeAnnos.toList()); + } + } private JCIdent makeThis(Type type, Symbol owner) { VarSymbol _this = new VarSymbol(PARAMETER | FINAL | SYNTHETIC, @@ -460,65 +485,46 @@ private JCIdent makeThis(Type type, Symbol owner) { /** * Translate a method reference into an invokedynamic call to the * meta-factory. - * @param tree */ @Override public void visitReference(JCMemberReference tree) { - ReferenceTranslationContext localContext = (ReferenceTranslationContext)context; - //first determine the method symbol to be used to generate the sam instance //this is either the method reference symbol, or the bridged reference symbol MethodSymbol refSym = (MethodSymbol)tree.sym; //the qualifying expression is treated as a special captured arg - JCExpression init; - switch(tree.kind) { - - case IMPLICIT_INNER: /** Inner :: new */ - case SUPER: /** super :: instMethod */ - init = makeThis( - localContext.owner.enclClass().asType(), - localContext.owner.enclClass()); - break; - - case BOUND: /** Expr :: instMethod */ - init = transTypes.coerce(attrEnv, tree.getQualifierExpression(), - types.erasure(tree.sym.owner.type)); - init = attr.makeNullCheck(init); - break; - - case UNBOUND: /** Type :: instMethod */ - case STATIC: /** Type :: staticMethod */ - case TOPLEVEL: /** Top level :: new */ - case ARRAY_CTOR: /** ArrayType :: new */ - init = null; - break; - - default: - throw new InternalError("Should not have an invalid kind"); - } - - List indy_args = init==null? List.nil() : translate(List.of(init), localContext.prev); - + JCExpression init = switch (tree.kind) { + case IMPLICIT_INNER, /* Inner :: new */ + SUPER -> /* super :: instMethod */ + makeThis(tree.owner.enclClass().asType(), tree.owner.enclClass()); + case BOUND -> /* Expr :: instMethod */ + attr.makeNullCheck(transTypes.coerce(attrEnv, tree.getQualifierExpression(), + types.erasure(tree.sym.owner.type))); + case UNBOUND, /* Type :: instMethod */ + STATIC, /* Type :: staticMethod */ + TOPLEVEL, /* Top level :: new */ + ARRAY_CTOR -> /* ArrayType :: new */ + null; + }; + + List indy_args = (init == null) ? + List.nil() : translate(List.of(init)); //build a sam instance using an indy call to the meta-factory - result = makeMetafactoryIndyCall(localContext, refSym.asHandle(), indy_args); + result = makeMetafactoryIndyCall(tree, refSym.asHandle(), refSym, indy_args); } /** * Translate identifiers within a lambda to the mapped identifier - * @param tree */ @Override public void visitIdent(JCIdent tree) { - if (context == null || !analyzer.lambdaIdentSymbolFilter(tree.sym)) { + if (lambdaContext == null) { super.visitIdent(tree); } else { int prevPos = make.pos; try { make.at(tree); - - LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context; JCTree ltree = lambdaContext.translate(tree); if (ltree != null) { result = ltree; @@ -535,13 +541,18 @@ public void visitIdent(JCIdent tree) { @Override public void visitVarDef(JCVariableDecl tree) { - LambdaTranslationContext lambdaContext = (LambdaTranslationContext)context; - if (context != null && lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) { - tree.init = translate(tree.init); - tree.sym = (VarSymbol) lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym); - result = tree; - } else { - super.visitVarDef(tree); + VarSymbol prevPendingVar = pendingVar; + try { + pendingVar = tree.sym; + if (lambdaContext != null) { + tree.sym = lambdaContext.addLocal(tree.sym); + tree.init = translate(tree.init); + result = tree; + } else { + super.visitVarDef(tree); + } + } finally { + pendingVar = prevPendingVar; } } @@ -609,7 +620,7 @@ public void visitReturn(JCReturn tree) { if (isTarget_void && !isLambda_void) { //Void to void conversion: // { TYPE $loc = RET-EXPR; return; } - VarSymbol loc = makeSyntheticVar(0, names.fromString("$loc"), tree.expr.type, lambdaMethodDecl.sym); + VarSymbol loc = new VarSymbol(SYNTHETIC, names.fromString("$loc"), tree.expr.type, lambdaMethodDecl.sym); JCVariableDecl varDef = make.VarDef(loc, tree.expr); result = make.Block(0, List.of(varDef, make.Return(null))); } else { @@ -628,7 +639,7 @@ public void visitReturn(JCReturn tree) { return trans_block; } - private JCMethodDecl makeDeserializeMethod(Symbol kSym) { + private JCMethodDecl makeDeserializeMethod() { ListBuffer cases = new ListBuffer<>(); ListBuffer breaks = new ListBuffer<>(); for (Map.Entry> entry : kInfo.deserializeCases.entrySet()) { @@ -644,16 +655,16 @@ private JCMethodDecl makeDeserializeMethod(Symbol kSym) { JCBlock body = make.Block(0L, List.of( sw, make.Throw(makeNewClass( - syms.illegalArgumentExceptionType, - List.of(make.Literal("Invalid lambda deserialization")))))); + syms.illegalArgumentExceptionType, + List.of(make.Literal("Invalid lambda deserialization")))))); JCMethodDecl deser = make.MethodDef(make.Modifiers(kInfo.deserMethodSym.flags()), - names.deserializeLambda, - make.QualIdent(kInfo.deserMethodSym.getReturnType().tsym), - List.nil(), - List.of(make.VarDef(kInfo.deserParamSym, null)), - List.nil(), - body, - null); + names.deserializeLambda, + make.QualIdent(kInfo.deserMethodSym.getReturnType().tsym), + List.nil(), + List.of(make.VarDef(kInfo.deserParamSym, null)), + List.nil(), + body, + null); deser.sym = kInfo.deserMethodSym; deser.type = kInfo.deserMethodSym.type; //System.err.printf("DESER: '%s'\n", deser); @@ -667,7 +678,7 @@ private JCMethodDecl makeDeserializeMethod(Symbol kSym) { */ JCNewClass makeNewClass(Type ctype, List args, Symbol cons) { JCNewClass tree = make.NewClass(null, - null, make.QualIdent(ctype.tsym), args, null); + null, make.QualIdent(ctype.tsym), args, null); tree.constructor = cons; tree.type = ctype; return tree; @@ -680,7 +691,7 @@ JCNewClass makeNewClass(Type ctype, List args, Symbol cons) { JCNewClass makeNewClass(Type ctype, List args) { return makeNewClass(ctype, args, rs.resolveConstructor(null, attrEnv, ctype, TreeInfo.types(args), List.nil())); - } + } private void addDeserializationCase(MethodHandleSymbol refSym, Type targetType, MethodSymbol samSym, DiagnosticPosition pos, List staticArgs, MethodType indyType) { @@ -711,17 +722,17 @@ private void addDeserializationCase(MethodHandleSymbol refSym, Type targetType, } JCStatement stmt = make.If( deserTest(deserTest(deserTest(deserTest(deserTest( - kindTest, - "getFunctionalInterfaceClass", functionalInterfaceClass), - "getFunctionalInterfaceMethodName", functionalInterfaceMethodName), - "getFunctionalInterfaceMethodSignature", functionalInterfaceMethodSignature), - "getImplClass", implClass), - "getImplMethodSignature", implMethodSignature), + kindTest, + "getFunctionalInterfaceClass", functionalInterfaceClass), + "getFunctionalInterfaceMethodName", functionalInterfaceMethodName), + "getFunctionalInterfaceMethodSignature", functionalInterfaceMethodSignature), + "getImplClass", implClass), + "getImplMethodSignature", implMethodSignature), make.Return(makeIndyCall( - pos, - syms.lambdaMetafactory, - names.altMetafactory, - staticArgs, indyType, serArgs.toList(), samSym.name)), + pos, + syms.lambdaMetafactory, + names.altMetafactory, + staticArgs, indyType, serArgs.toList(), samSym.name)), null); ListBuffer stmts = kInfo.deserializeCases.get(implMethodName); if (stmts == null) { @@ -742,8 +753,8 @@ private void addDeserializationCase(MethodHandleSymbol refSym, Type targetType, } private JCExpression eqTest(Type argType, JCExpression arg1, JCExpression arg2) { - JCBinary testExpr = make.Binary(JCTree.Tag.EQ, arg1, arg2); - testExpr.operator = operators.resolveBinary(testExpr, JCTree.Tag.EQ, argType, argType); + JCBinary testExpr = make.Binary(Tag.EQ, arg1, arg2); + testExpr.operator = operators.resolveBinary(testExpr, Tag.EQ, argType, argType); testExpr.setType(syms.booleanType); return testExpr; } @@ -756,8 +767,8 @@ private JCExpression deserTest(JCExpression prev, String func, String lit) { make.Select(deserGetter(func, syms.stringType), eqsym).setType(eqmt), List.of(make.Literal(lit))); eqtest.setType(syms.booleanType); - JCBinary compound = make.Binary(JCTree.Tag.AND, prev, eqtest); - compound.operator = operators.resolveBinary(compound, JCTree.Tag.AND, syms.booleanType, syms.booleanType); + JCBinary compound = make.Binary(Tag.AND, prev, eqtest); + compound.operator = operators.resolveBinary(compound, Tag.AND, syms.booleanType, syms.booleanType); compound.setType(syms.booleanType); return compound; } @@ -770,9 +781,9 @@ private JCExpression deserGetter(String func, Type type, List argTypes, Li MethodType getmt = new MethodType(argTypes, type, List.nil(), syms.methodClass); Symbol getsym = rs.resolveQualifiedMethod(null, attrEnv, syms.serializedLambdaType, names.fromString(func), argTypes, List.nil()); return make.Apply( - List.nil(), - make.Select(make.Ident(kInfo.deserParamSym).setType(syms.serializedLambdaType), getsym).setType(getmt), - args).setType(type); + List.nil(), + make.Select(make.Ident(kInfo.deserParamSym).setType(syms.serializedLambdaType), getsym).setType(getmt), + args).setType(type); } /** @@ -782,29 +793,20 @@ private MethodSymbol makePrivateSyntheticMethod(long flags, Name name, Type type return new MethodSymbol(flags | SYNTHETIC | PRIVATE, name, type, owner); } - /** - * Create new synthetic variable with given flags, name, type, owner - */ - private VarSymbol makeSyntheticVar(long flags, Name name, Type type, Symbol owner) { - return new VarSymbol(flags | SYNTHETIC, name, type, owner); - } - - // - private MethodType typeToMethodType(Type mt) { Type type = types.erasure(mt); return new MethodType(type.getParameterTypes(), - type.getReturnType(), - type.getThrownTypes(), - syms.methodClass); + type.getReturnType(), + type.getThrownTypes(), + syms.methodClass); } /** * Generate an indy method call to the meta factory */ - private JCExpression makeMetafactoryIndyCall(TranslationContext context, - MethodHandleSymbol refSym, List indy_args) { - JCFunctionalExpression tree = context.tree; + private JCExpression makeMetafactoryIndyCall(JCFunctionalExpression tree, + MethodHandleSymbol refSym, MethodSymbol nonDedupedRefSym, + List indy_args) { //determine the static bsm args MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.target.tsym); List staticArgs = List.of( @@ -824,10 +826,17 @@ private JCExpression makeMetafactoryIndyCall(TranslationContext context, List.nil(), syms.methodClass); - Name metafactoryName = context.needsAltMetafactory() ? + List bridges = bridges(tree); + boolean isSerializable = isSerializable(tree); + boolean needsAltMetafactory = tree.target.isIntersection() || + isSerializable || bridges.length() > 1; + + dumpStats(tree, needsAltMetafactory, nonDedupedRefSym); + + Name metafactoryName = needsAltMetafactory ? names.altMetafactory : names.metafactory; - if (context.needsAltMetafactory()) { + if (needsAltMetafactory) { ListBuffer markers = new ListBuffer<>(); List targets = tree.target.isIntersection() ? types.directSupertypes(tree.target) : @@ -835,14 +844,14 @@ private JCExpression makeMetafactoryIndyCall(TranslationContext context, for (Type t : targets) { t = types.erasure(t); if (t.tsym != syms.serializableType.tsym && - t.tsym != tree.type.tsym && - t.tsym != syms.objectType.tsym) { + t.tsym != tree.type.tsym && + t.tsym != syms.objectType.tsym) { markers.append(t); } } - int flags = context.isSerializable() ? FLAG_SERIALIZABLE : 0; + int flags = isSerializable ? FLAG_SERIALIZABLE : 0; boolean hasMarkers = markers.nonEmpty(); - boolean hasBridges = context.bridges.nonEmpty(); + boolean hasBridges = bridges.nonEmpty(); if (hasMarkers) { flags |= FLAG_MARKERS; } @@ -855,15 +864,15 @@ private JCExpression makeMetafactoryIndyCall(TranslationContext context, staticArgs = staticArgs.appendList(List.convert(LoadableConstant.class, markers.toList())); } if (hasBridges) { - staticArgs = staticArgs.append(LoadableConstant.Int(context.bridges.length() - 1)); - for (Symbol s : context.bridges) { + staticArgs = staticArgs.append(LoadableConstant.Int(bridges.length() - 1)); + for (Symbol s : bridges) { Type s_erasure = s.erasure(types); if (!types.isSameType(s_erasure, samSym.erasure(types))) { staticArgs = staticArgs.append(((MethodType)s.erasure(types))); } } } - if (context.isSerializable()) { + if (isSerializable) { int prevPos = make.pos; try { make.at(kInfo.clazz); @@ -889,18 +898,18 @@ private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmNam try { make.at(pos); List bsm_staticArgs = List.of(syms.methodHandleLookupType, - syms.stringType, - syms.methodTypeType).appendList(staticArgs.map(types::constantType)); + syms.stringType, + syms.methodTypeType).appendList(staticArgs.map(types::constantType)); MethodSymbol bsm = rs.resolveInternalMethod(pos, attrEnv, site, bsmName, bsm_staticArgs, List.nil()); DynamicMethodSymbol dynSym = new DynamicMethodSymbol(methName, - syms.noSymbol, - bsm.asHandle(), - indyType, - staticArgs.toArray(new LoadableConstant[staticArgs.length()])); + syms.noSymbol, + bsm.asHandle(), + indyType, + staticArgs.toArray(new LoadableConstant[staticArgs.length()])); JCFieldAccess qualifier = make.Select(make.QualIdent(site.tsym), bsmName); DynamicMethodSymbol existing = kInfo.dynMethSyms.putIfAbsent( dynSym.poolKey(types), dynSym); @@ -915,833 +924,337 @@ private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmNam } } - // - /** - * This visitor collects information about translation of a lambda expression. - * More specifically, it keeps track of the enclosing contexts and captured locals - * accessed by the lambda being translated (as well as other useful info). - * It also translates away problems for LambdaToMethod. - */ - class LambdaAnalyzerPreprocessor extends TreeTranslator { - - /** the frame stack - used to reconstruct translation info about enclosing scopes */ - private List frameStack; + List bridges(JCFunctionalExpression tree) { + ClassSymbol csym = + types.makeFunctionalInterfaceClass(attrEnv, names.empty, tree.target, ABSTRACT | INTERFACE); + return types.functionalInterfaceBridges(csym); + } - /** - * keep the count of lambda expression (used to generate unambiguous - * names) - */ - private int lambdaCount = 0; + /** does this functional expression require serialization support? */ + boolean isSerializable(JCFunctionalExpression tree) { + if (forceSerializable) { + return true; + } + return types.asSuper(tree.target, syms.serializableType.tsym) != null; + } - /** - * keep the count of lambda expression defined in given context (used to - * generate unambiguous names for serializable lambdas) - */ - private class SyntheticMethodNameCounter { - private Map map = new HashMap<>(); - int getIndex(StringBuilder buf) { - String temp = buf.toString(); - Integer count = map.get(temp); - if (count == null) { - count = 0; - } - ++count; - map.put(temp, count); - return count; + void dumpStats(JCFunctionalExpression tree, boolean needsAltMetafactory, Symbol sym) { + if (dumpLambdaToMethodStats) { + if (tree instanceof JCLambda lambda) { + log.note(tree, diags.noteKey(lambda.wasMethodReference ? "mref.stat.1" : "lambda.stat", + needsAltMetafactory, sym)); + } else if (tree instanceof JCMemberReference) { + log.note(tree, Notes.MrefStat(needsAltMetafactory, null)); } } - private SyntheticMethodNameCounter syntheticMethodNameCounts = - new SyntheticMethodNameCounter(); + } - private Map localClassDefs; + /** + * This class retains all the useful information about a lambda expression, + * and acts as a translation map that is used by the main translation routines + * in order to adjust references to captured locals/members, etc. + */ + class LambdaTranslationContext { - /** - * maps for fake clinit symbols to be used as owners of lambda occurring in - * a static var init context - */ - private Map clinits = new HashMap<>(); + /** the underlying (untranslated) tree */ + final JCFunctionalExpression tree; - private JCClassDecl analyzeAndPreprocessClass(JCClassDecl tree) { - frameStack = List.nil(); - localClassDefs = new HashMap<>(); - return translate(tree); - } + /** a translation map from source symbols to translated symbols */ + final Map lambdaProxies = new HashMap<>(); - @Override - public void visitBlock(JCBlock tree) { - List prevStack = frameStack; - try { - if (frameStack.nonEmpty() && frameStack.head.tree.hasTag(CLASSDEF)) { - frameStack = frameStack.prepend(new Frame(tree)); - } - super.visitBlock(tree); - } - finally { - frameStack = prevStack; - } - } + /** the list of symbols captured by this lambda expression */ + final List capturedVars; - @Override - public void visitClassDef(JCClassDecl tree) { - List prevStack = frameStack; - int prevLambdaCount = lambdaCount; - SyntheticMethodNameCounter prevSyntheticMethodNameCounts = - syntheticMethodNameCounts; - Map prevClinits = clinits; - DiagnosticSource prevSource = log.currentSource(); - try { - log.useSource(tree.sym.sourcefile); - lambdaCount = 0; - syntheticMethodNameCounts = new SyntheticMethodNameCounter(); - prevClinits = new HashMap<>(); - if (tree.sym.owner.kind == MTH) { - localClassDefs.put(tree.sym, tree); - } - if (directlyEnclosingLambda() != null) { - tree.sym.owner = owner(); - } - frameStack = frameStack.prepend(new Frame(tree)); - super.visitClassDef(tree); - } - finally { - log.useSource(prevSource.getFile()); - frameStack = prevStack; - lambdaCount = prevLambdaCount; - syntheticMethodNameCounts = prevSyntheticMethodNameCounts; - clinits = prevClinits; - } - } + /** the synthetic symbol for the method hoisting the translated lambda */ + final MethodSymbol translatedSym; - @Override - public void visitIdent(JCIdent tree) { - if (context() != null && lambdaIdentSymbolFilter(tree.sym)) { - if (tree.sym.kind == VAR && - tree.sym.owner.kind == MTH && - tree.type.constValue() == null) { - TranslationContext localContext = context(); - while (localContext != null) { - if (localContext.tree.getTag() == LAMBDA) { - JCTree block = capturedDecl(localContext.depth, tree.sym); - if (block == null) break; - ((LambdaTranslationContext)localContext) - .addSymbol(tree.sym, CAPTURED_VAR); - } - localContext = localContext.prev; - } - } else if (tree.sym.owner.kind == TYP) { - TranslationContext localContext = context(); - while (localContext != null && !localContext.owner.isStatic()) { - if (localContext.tree.hasTag(LAMBDA)) { - JCTree block = capturedDecl(localContext.depth, tree.sym); - if (block == null) break; - switch (block.getTag()) { - case CLASSDEF: - JCClassDecl cdecl = (JCClassDecl)block; - ((LambdaTranslationContext)localContext) - .addSymbol(cdecl.sym, CAPTURED_THIS); - break; - default: - Assert.error("bad block kind"); - } - } - localContext = localContext.prev; + /** the list of parameter declarations of the translated lambda method */ + final List syntheticParams; + + LambdaTranslationContext(JCLambda tree) { + this.tree = tree; + // This symbol will be filled-in in complete + Symbol owner = tree.owner; + if (owner.kind == MTH) { + final MethodSymbol originalOwner = (MethodSymbol)owner.clone(owner.owner); + this.translatedSym = new MethodSymbol(0, null, null, owner.enclClass()) { + @Override + public MethodSymbol originalEnclosingMethod() { + return originalOwner; } - } + }; + } else { + this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass()); } - super.visitIdent(tree); - } - - @Override - public void visitLambda(JCLambda tree) { - analyzeLambda(tree, tree.wasMethodReference ? "mref.stat.1" : "lambda.stat"); - } - - private LambdaTranslationContext analyzeLambda(JCLambda tree, String statKey) { - List prevStack = frameStack; - try { - LambdaTranslationContext context = new LambdaTranslationContext(tree); - frameStack = frameStack.prepend(new Frame(tree)); - for (JCVariableDecl param : tree.params) { - context.addSymbol(param.sym, PARAM); - frameStack.head.addLocal(param.sym); - } - contextMap.put(tree, context); - super.visitLambda(tree); - context.complete(); - if (dumpLambdaToMethodStats) { - log.note(tree, diags.noteKey(statKey, context.needsAltMetafactory(), context.translatedSym)); - } - return context; + ListBuffer params = new ListBuffer<>(); + ListBuffer parameterSymbols = new ListBuffer<>(); + LambdaCaptureScanner captureScanner = new LambdaCaptureScanner(tree); + capturedVars = captureScanner.analyzeCaptures(); + for (VarSymbol captured : capturedVars) { + VarSymbol trans = addSymbol(captured, LambdaSymbolKind.CAPTURED_VAR); + params.append(make.VarDef(trans, null)); + parameterSymbols.add(trans); } - finally { - frameStack = prevStack; + for (JCVariableDecl param : tree.params) { + VarSymbol trans = addSymbol(param.sym, LambdaSymbolKind.PARAM); + params.append(make.VarDef(trans, null)); + parameterSymbols.add(trans); } + syntheticParams = params.toList(); + completeLambdaMethodSymbol(owner, captureScanner.capturesThis); + translatedSym.params = parameterSymbols.toList(); } - @Override - public void visitMethodDef(JCMethodDecl tree) { - List prevStack = frameStack; - try { - frameStack = frameStack.prepend(new Frame(tree)); - super.visitMethodDef(tree); - } - finally { - frameStack = prevStack; - } + void completeLambdaMethodSymbol(Symbol owner, boolean thisReferenced) { + boolean inInterface = owner.enclClass().isInterface(); + + // Compute and set the lambda name + Name name = isSerializable(tree) + ? serializedLambdaName(owner) + : lambdaName(owner); + + //prepend synthetic args to translated lambda method signature + Type type = types.createMethodTypeWithParameters( + generatedLambdaSig(), + TreeInfo.types(syntheticParams)); + + // If instance access isn't needed, make it static. + // Interface instance methods must be default methods. + // Lambda methods are private synthetic. + // Inherit ACC_STRICT from the enclosing method, or, for clinit, + // from the class. + long flags = SYNTHETIC | LAMBDA_METHOD | + owner.flags_field & STRICTFP | + owner.owner.flags_field & STRICTFP | + PRIVATE | + (thisReferenced? (inInterface? DEFAULT : 0) : STATIC); + + translatedSym.type = type; + translatedSym.name = name; + translatedSym.flags_field = flags; } /** - * Method references to local class constructors, may, if the local - * class references local variables, have implicit constructor - * parameters added in Lower; As a result, the invokedynamic bootstrap - * information added in the LambdaToMethod pass will have the wrong - * signature. Hooks between Lower and LambdaToMethod have been added to - * handle normal "new" in this case. This visitor converts potentially - * affected method references into a lambda containing a normal - * expression. + * For a serializable lambda, generate a disambiguating string + * which maximizes stability across deserialization. * - * @param tree + * @return String to differentiate synthetic lambda method names */ - @Override - public void visitReference(JCMemberReference tree) { - ReferenceTranslationContext rcontext = new ReferenceTranslationContext(tree); - contextMap.put(tree, rcontext); - super.visitReference(tree); - if (dumpLambdaToMethodStats) { - log.note(tree, Notes.MrefStat(rcontext.needsAltMetafactory(), null)); + private String serializedLambdaDisambiguation(Symbol owner) { + StringBuilder buf = new StringBuilder(); + // Append the enclosing method signature to differentiate + // overloaded enclosing methods. For lambdas enclosed in + // lambdas, the generated lambda method will not have type yet, + // but the enclosing method's name will have been generated + // with this same method, so it will be unique and never be + // overloaded. + Assert.check( + owner.type != null || + lambdaContext != null); + if (owner.type != null) { + buf.append(typeSig(owner.type, true)); + buf.append(":"); } - } - @Override - public void visitSelect(JCFieldAccess tree) { - if (context() != null && tree.sym.kind == VAR && - (tree.sym.name == names._this || - tree.sym.name == names._super)) { - // A select of this or super means, if we are in a lambda, - // we much have an instance context - TranslationContext localContext = context(); - while (localContext != null && !localContext.owner.isStatic()) { - if (localContext.tree.hasTag(LAMBDA)) { - JCClassDecl clazz = (JCClassDecl)capturedDecl(localContext.depth, tree.sym); - if (clazz == null) break; - ((LambdaTranslationContext)localContext).addSymbol(clazz.sym, CAPTURED_THIS); - } - localContext = localContext.prev; - } - } - super.visitSelect(tree); - } + // Add target type info + buf.append(types.findDescriptorSymbol(tree.type.tsym).owner.flatName()); + buf.append(" "); - @Override - public void visitVarDef(JCVariableDecl tree) { - TranslationContext context = context(); - if (context != null && context instanceof LambdaTranslationContext lambdaContext) { - for (Frame frame : frameStack) { - if (frame.tree.hasTag(VARDEF)) { - //skip variable frames inside a lambda: - continue; - } else if (frame.tree.hasTag(LAMBDA)) { - lambdaContext.addSymbol(tree.sym, LOCAL_VAR); - } else { - break; - } - } - // Check for type variables (including as type arguments). - // If they occur within class nested in a lambda, mark for erasure - Type type = tree.sym.asType(); + // Add variable assigned to + if (pendingVar != null) { + buf.append(pendingVar.flatName()); + buf.append("="); } - - List prevStack = frameStack; - try { - if (tree.sym.owner.kind == MTH) { - frameStack.head.addLocal(tree.sym); + //add captured locals info: type, name, order + for (Symbol fv : capturedVars) { + if (fv != owner) { + buf.append(typeSig(fv.type, true)); + buf.append(" "); + buf.append(fv.flatName()); + buf.append(","); } - frameStack = frameStack.prepend(new Frame(tree)); - super.visitVarDef(tree); - } - finally { - frameStack = prevStack; } + + return buf.toString(); } /** - * Return a valid owner given the current declaration stack - * (required to skip synthetic lambda symbols) + * For a non-serializable lambda, generate a simple method. + * + * @return Name to use for the synthetic lambda method name */ - private Symbol owner() { - return owner(false); + private Name lambdaName(Symbol owner) { + StringBuilder buf = new StringBuilder(); + buf.append(names.lambda); + buf.append(syntheticMethodNameComponent(owner)); + buf.append("$"); + buf.append(kInfo.syntheticNameIndex(buf, 0)); + return names.fromString(buf.toString()); } - @SuppressWarnings("fallthrough") - private Symbol owner(boolean skipLambda) { - List frameStack2 = frameStack; - while (frameStack2.nonEmpty()) { - switch (frameStack2.head.tree.getTag()) { - case VARDEF: - if (((JCVariableDecl)frameStack2.head.tree).sym.isDirectlyOrIndirectlyLocal()) { - frameStack2 = frameStack2.tail; - break; - } - JCClassDecl cdecl = (JCClassDecl)frameStack2.tail.head.tree; - return initSym(cdecl.sym, - ((JCVariableDecl)frameStack2.head.tree).sym.flags() & STATIC); - case BLOCK: - JCClassDecl cdecl2 = (JCClassDecl)frameStack2.tail.head.tree; - return initSym(cdecl2.sym, - ((JCBlock)frameStack2.head.tree).flags & STATIC); - case CLASSDEF: - return ((JCClassDecl)frameStack2.head.tree).sym; - case METHODDEF: - return ((JCMethodDecl)frameStack2.head.tree).sym; - case LAMBDA: - if (!skipLambda) - return ((LambdaTranslationContext)contextMap - .get(frameStack2.head.tree)).translatedSym; - default: - frameStack2 = frameStack2.tail; - } - } - Assert.error(); - return null; - } - - private Symbol initSym(ClassSymbol csym, long flags) { - boolean isStatic = (flags & STATIC) != 0; - if (isStatic) { - /* static clinits are generated in Gen, so we need to use a fake - * one. Attr creates a fake clinit method while attributing - * lambda expressions used as initializers of static fields, so - * let's use that one. - */ - MethodSymbol clinit = attr.removeClinit(csym); - if (clinit != null) { - clinits.put(csym, clinit); - return clinit; - } - - /* if no clinit is found at Attr, then let's try at clinits. - */ - clinit = (MethodSymbol)clinits.get(csym); - if (clinit == null) { - /* no luck, let's create a new one - */ - clinit = makePrivateSyntheticMethod(STATIC, - names.clinit, - new MethodType(List.nil(), syms.voidType, - List.nil(), syms.methodClass), - csym); - clinits.put(csym, clinit); - } - return clinit; + /** + * @return Method name in a form that can be folded into a + * component of a synthetic method name + */ + String syntheticMethodNameComponent(Symbol owner) { + long ownerFlags = owner.flags(); + if ((ownerFlags & BLOCK) != 0) { + return (ownerFlags & STATIC) != 0 ? + "static" : "new"; + } else if (owner.isConstructor()) { + return "new"; } else { - //get the first constructor and treat it as the instance init sym - for (Symbol s : csym.members_field.getSymbolsByName(names.init)) { - return s; - } + return owner.name.toString(); } - Assert.error("init not found"); - return null; - } - - private JCTree directlyEnclosingLambda() { - if (frameStack.isEmpty()) { - return null; - } - List frameStack2 = frameStack; - while (frameStack2.nonEmpty()) { - switch (frameStack2.head.tree.getTag()) { - case CLASSDEF: - case METHODDEF: - return null; - case LAMBDA: - return frameStack2.head.tree; - default: - frameStack2 = frameStack2.tail; - } - } - Assert.error(); - return null; - } - - private boolean inClassWithinLambda() { - if (frameStack.isEmpty()) { - return false; - } - List frameStack2 = frameStack; - boolean classFound = false; - while (frameStack2.nonEmpty()) { - switch (frameStack2.head.tree.getTag()) { - case LAMBDA: - return classFound; - case CLASSDEF: - classFound = true; - frameStack2 = frameStack2.tail; - break; - default: - frameStack2 = frameStack2.tail; - } - } - // No lambda - return false; } /** - * Return the declaration corresponding to a symbol in the enclosing - * scope; the depth parameter is used to filter out symbols defined - * in nested scopes (which do not need to undergo capture). + * For a serializable lambda, generate a method name which maximizes + * name stability across deserialization. + * + * @return Name to use for the synthetic lambda method name */ - private JCTree capturedDecl(int depth, Symbol sym) { - Assert.check(sym.kind != TYP); - int currentDepth = frameStack.size() - 1; - for (Frame block : frameStack) { - switch (block.tree.getTag()) { - case CLASSDEF: - ClassSymbol clazz = ((JCClassDecl)block.tree).sym; - if (clazz.isSubClass(sym.enclClass(), types)) { - return currentDepth > depth ? null : block.tree; - } - break; - case VARDEF: - if ((((JCVariableDecl)block.tree).sym == sym && - sym.owner.kind == MTH) || //only locals are captured - (block.locals != null && block.locals.contains(sym))) { - return currentDepth > depth ? null : block.tree; - } - break; - case BLOCK: - case METHODDEF: - case LAMBDA: - if (block.locals != null && block.locals.contains(sym)) { - return currentDepth > depth ? null : block.tree; - } - break; - default: - Assert.error("bad decl kind " + block.tree.getTag()); - } - currentDepth--; - } - return null; - } - - private TranslationContext context() { - for (Frame frame : frameStack) { - TranslationContext context = contextMap.get(frame.tree); - if (context != null) { - return context; - } - } - return null; + private Name serializedLambdaName(Symbol owner) { + StringBuilder buf = new StringBuilder(); + buf.append(names.lambda); + // Append the name of the method enclosing the lambda. + buf.append(syntheticMethodNameComponent(owner)); + buf.append('$'); + // Append a hash of the disambiguating string : enclosing method + // signature, etc. + String disam = serializedLambdaDisambiguation(owner); + buf.append(Integer.toHexString(disam.hashCode())); + buf.append('$'); + // The above appended name components may not be unique, append + // a count based on the above name components. + buf.append(kInfo.syntheticNameIndex(buf, 1)); + String result = buf.toString(); + //System.err.printf("serializedLambdaName: %s -- %s\n", result, disam); + return names.fromString(result); } /** - * This is used to filter out those identifiers that needs to be adjusted - * when translating away lambda expressions + * Translate a symbol of a given kind into something suitable for the + * synthetic lambda body */ - private boolean lambdaIdentSymbolFilter(Symbol sym) { - return (sym.kind == VAR || sym.kind == MTH) - && !sym.isStatic() - && sym.name != names.init; - } - - private class Frame { - final JCTree tree; - List locals; - - public Frame(JCTree tree) { - this.tree = tree; + VarSymbol translate(final VarSymbol sym, LambdaSymbolKind skind) { + VarSymbol ret; + boolean propagateAnnos = true; + switch (skind) { + case CAPTURED_VAR: + Name name = (sym.flags() & LOCAL_CAPTURE_FIELD) != 0 ? + sym.baseSymbol().name : sym.name; + ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym); + propagateAnnos = false; + break; + case LOCAL_VAR: + ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym); + ret.pos = sym.pos; + // If sym.data == ElementKind.EXCEPTION_PARAMETER, + // set ret.data = ElementKind.EXCEPTION_PARAMETER too. + // Because method com.sun.tools.javac.jvm.Code.fillExceptionParameterPositions and + // com.sun.tools.javac.jvm.Code.fillLocalVarPosition would use it. + // See JDK-8257740 for more information. + if (sym.isExceptionParameter()) { + ret.setData(ElementKind.EXCEPTION_PARAMETER); + } + break; + case PARAM: + ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym); + ret.pos = sym.pos; + break; + default: + Assert.error(skind.name()); + throw new AssertionError(); } - - void addLocal(Symbol sym) { - if (locals == null) { - locals = List.nil(); - } - locals = locals.prepend(sym); + if (ret != sym && propagateAnnos) { + ret.setDeclarationAttributes(sym.getRawAttributes()); + ret.setTypeAttributes(sym.getRawTypeAttributes()); } + return ret; } - /** - * This class is used to store important information regarding translation of - * lambda expression/method references (see subclasses). - */ - abstract class TranslationContext { - - /** the underlying (untranslated) tree */ - final T tree; - - /** points to the adjusted enclosing scope in which this lambda/mref expression occurs */ - final Symbol owner; - - /** the depth of this lambda expression in the frame stack */ - final int depth; - - /** the enclosing translation context (set for nested lambdas/mref) */ - final TranslationContext prev; - - /** list of methods to be bridged by the meta-factory */ - final List bridges; - - TranslationContext(T tree) { - this.tree = tree; - this.owner = owner(true); - this.depth = frameStack.size() - 1; - this.prev = context(); - ClassSymbol csym = - types.makeFunctionalInterfaceClass(attrEnv, names.empty, tree.target, ABSTRACT | INTERFACE); - this.bridges = types.functionalInterfaceBridges(csym); - } - - /** does this functional expression need to be created using alternate metafactory? */ - boolean needsAltMetafactory() { - return tree.target.isIntersection() || - isSerializable() || - bridges.length() > 1; - } + VarSymbol addLocal(VarSymbol sym) { + return addSymbol(sym, LambdaSymbolKind.LOCAL_VAR); + } - /** does this functional expression require serialization support? */ - boolean isSerializable() { - if (forceSerializable) { - return true; - } - return types.asSuper(tree.target, syms.serializableType.tsym) != null; - } + private VarSymbol addSymbol(VarSymbol sym, LambdaSymbolKind skind) { + return lambdaProxies.computeIfAbsent(sym, s -> translate(s, skind)); + } - /** - * @return Name of the enclosing method to be folded into synthetic - * method name - */ - String enclosingMethodName() { - return syntheticMethodNameComponent(owner.name); - } + JCTree translate(JCIdent lambdaIdent) { + Symbol tSym = lambdaProxies.get(lambdaIdent.sym); + return tSym != null ? + make.Ident(tSym).setType(lambdaIdent.type) : + null; + } - /** - * @return Method name in a form that can be folded into a - * component of a synthetic method name - */ - String syntheticMethodNameComponent(Name name) { - if (name == null) { - return "null"; - } - String methodName = name.toString(); - if (methodName.equals("")) { - methodName = "static"; - } else if (methodName.equals("")) { - methodName = "new"; - } - return methodName; - } + Type generatedLambdaSig() { + return types.erasure(tree.getDescriptorType(types)); } /** - * This class retains all the useful information about a lambda expression; - * the contents of this class are filled by the LambdaAnalyzer visitor, - * and the used by the main translation routines in order to adjust references - * to captured locals/members, etc. + * Compute the set of local variables captured by this lambda expression. + * Also determines whether this lambda expression captures the enclosing 'this'. */ - class LambdaTranslationContext extends TranslationContext { - - /** variable in the enclosing context to which this lambda is assigned */ - final Symbol self; - - /** variable in the enclosing context to which this lambda is assigned */ - final Symbol assignedTo; - - Map> translatedSymbols; - - /** the synthetic symbol for the method hoisting the translated lambda */ - MethodSymbol translatedSym; - - List syntheticParams; - - LambdaTranslationContext(JCLambda tree) { - super(tree); - Frame frame = frameStack.head; - switch (frame.tree.getTag()) { - case VARDEF: - assignedTo = self = ((JCVariableDecl) frame.tree).sym; - break; - case ASSIGN: - self = null; - assignedTo = TreeInfo.symbol(((JCAssign) frame.tree).getVariable()); - break; - default: - assignedTo = self = null; - break; - } - - // This symbol will be filled-in in complete - if (owner.kind == MTH) { - final MethodSymbol originalOwner = (MethodSymbol)owner.clone(owner.owner); - this.translatedSym = new MethodSymbol(SYNTHETIC | PRIVATE, null, null, owner.enclClass()) { - @Override - public MethodSymbol originalEnclosingMethod() { - return originalOwner; - } - }; - } else { - this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass()); - } - translatedSymbols = new EnumMap<>(LambdaSymbolKind.class); - - translatedSymbols.put(PARAM, new LinkedHashMap<>()); - translatedSymbols.put(LOCAL_VAR, new LinkedHashMap<>()); - translatedSymbols.put(CAPTURED_VAR, new LinkedHashMap<>()); - translatedSymbols.put(CAPTURED_THIS, new LinkedHashMap<>()); - } - - /** - * For a serializable lambda, generate a disambiguating string - * which maximizes stability across deserialization. - * - * @return String to differentiate synthetic lambda method names - */ - private String serializedLambdaDisambiguation() { - StringBuilder buf = new StringBuilder(); - // Append the enclosing method signature to differentiate - // overloaded enclosing methods. For lambdas enclosed in - // lambdas, the generated lambda method will not have type yet, - // but the enclosing method's name will have been generated - // with this same method, so it will be unique and never be - // overloaded. - Assert.check( - owner.type != null || - directlyEnclosingLambda() != null); - if (owner.type != null) { - buf.append(typeSig(owner.type, true)); - buf.append(":"); - } - - // Add target type info - buf.append(types.findDescriptorSymbol(tree.type.tsym).owner.flatName()); - buf.append(" "); - - // Add variable assigned to - if (assignedTo != null) { - buf.append(assignedTo.flatName()); - buf.append("="); - } - //add captured locals info: type, name, order - for (Symbol fv : getSymbolMap(CAPTURED_VAR).keySet()) { - if (fv != self) { - buf.append(typeSig(fv.type, true)); - buf.append(" "); - buf.append(fv.flatName()); - buf.append(","); - } - } - - return buf.toString(); - } + class LambdaCaptureScanner extends CaptureScanner { + boolean capturesThis; + Set seenClasses = new HashSet<>(); - /** - * For a non-serializable lambda, generate a simple method. - * - * @return Name to use for the synthetic lambda method name - */ - private Name lambdaName() { - return names.lambda.append(names.fromString(enclosingMethodName() + "$" + lambdaCount++)); + LambdaCaptureScanner(JCLambda ownerTree) { + super(ownerTree); } - /** - * For a serializable lambda, generate a method name which maximizes - * name stability across deserialization. - * - * @return Name to use for the synthetic lambda method name - */ - private Name serializedLambdaName() { - StringBuilder buf = new StringBuilder(); - buf.append(names.lambda); - // Append the name of the method enclosing the lambda. - buf.append(enclosingMethodName()); - buf.append('$'); - // Append a hash of the disambiguating string : enclosing method - // signature, etc. - String disam = serializedLambdaDisambiguation(); - buf.append(Integer.toHexString(disam.hashCode())); - buf.append('$'); - // The above appended name components may not be unique, append - // a count based on the above name components. - buf.append(syntheticMethodNameCounts.getIndex(buf)); - String result = buf.toString(); - //System.err.printf("serializedLambdaName: %s -- %s\n", result, disam); - return names.fromString(result); - } - - /** - * Translate a symbol of a given kind into something suitable for the - * synthetic lambda body - */ - Symbol translate(final Symbol sym, LambdaSymbolKind skind) { - Symbol ret; - switch (skind) { - case CAPTURED_THIS: - ret = sym; // self represented - break; - case CAPTURED_VAR: - ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, sym.name, types.erasure(sym.type), translatedSym) { - @Override - public Symbol baseSymbol() { - //keep mapping with original captured symbol - return sym; - } - }; - break; - case LOCAL_VAR: - ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym) { - @Override - public Symbol baseSymbol() { - //keep mapping with original symbol - return sym; - } - }; - ((VarSymbol) ret).pos = ((VarSymbol) sym).pos; - // If sym.data == ElementKind.EXCEPTION_PARAMETER, - // set ret.data = ElementKind.EXCEPTION_PARAMETER too. - // Because method com.sun.tools.javac.jvm.Code.fillExceptionParameterPositions and - // com.sun.tools.javac.jvm.Code.fillLocalVarPosition would use it. - // See JDK-8257740 for more information. - if (((VarSymbol) sym).isExceptionParameter()) { - ((VarSymbol) ret).setData(ElementKind.EXCEPTION_PARAMETER); - } - break; - case PARAM: - ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym); - ((VarSymbol) ret).pos = ((VarSymbol) sym).pos; - // Set ret.data. Same as case LOCAL_VAR above. - if (((VarSymbol) sym).isExceptionParameter()) { - ((VarSymbol) ret).setData(ElementKind.EXCEPTION_PARAMETER); - } - break; - default: - Assert.error(skind.name()); - throw new AssertionError(); - } - if (ret != sym && skind.propagateAnnotations()) { - ret.setDeclarationAttributes(sym.getRawAttributes()); - ret.setTypeAttributes(sym.getRawTypeAttributes()); - } - return ret; - } - - void addSymbol(Symbol sym, LambdaSymbolKind skind) { - Map transMap = getSymbolMap(skind); - if (!transMap.containsKey(sym)) { - transMap.put(sym, translate(sym, skind)); - } - } - - Map getSymbolMap(LambdaSymbolKind skind) { - Map m = translatedSymbols.get(skind); - Assert.checkNonNull(m); - return m; + @Override + public void visitClassDef(JCClassDecl tree) { + seenClasses.add(tree.sym); + super.visitClassDef(tree); } - JCTree translate(JCIdent lambdaIdent) { - for (LambdaSymbolKind kind : LambdaSymbolKind.values()) { - Map m = getSymbolMap(kind); - switch(kind) { - default: - if (m.containsKey(lambdaIdent.sym)) { - Symbol tSym = m.get(lambdaIdent.sym); - JCTree t = make.Ident(tSym).setType(lambdaIdent.type); - return t; - } - break; + @Override + public void visitIdent(JCIdent tree) { + if (!tree.sym.isStatic() && + tree.sym.owner.kind == TYP && + (tree.sym.kind == VAR || tree.sym.kind == MTH) && + !seenClasses.contains(tree.sym.owner)) { + if ((tree.sym.flags() & LOCAL_CAPTURE_FIELD) != 0) { + // a local, captured by Lower - re-capture! + addFreeVar((VarSymbol) tree.sym); + } else { + // a reference to an enclosing field or method, we need to capture 'this' + capturesThis = true; } + } else { + // might be a local capture + super.visitIdent(tree); } - return null; } - /** - * The translatedSym is not complete/accurate until the analysis is - * finished. Once the analysis is finished, the translatedSym is - * "completed" -- updated with type information, access modifiers, - * and full parameter list. - */ - void complete() { - if (syntheticParams != null) { - return; - } - boolean inInterface = translatedSym.owner.isInterface(); - boolean thisReferenced = !getSymbolMap(CAPTURED_THIS).isEmpty(); - - // If instance access isn't needed, make it static. - // Interface instance methods must be default methods. - // Lambda methods are private synthetic. - // Inherit ACC_STRICT from the enclosing method, or, for clinit, - // from the class. - translatedSym.flags_field = SYNTHETIC | LAMBDA_METHOD | - owner.flags_field & STRICTFP | - owner.owner.flags_field & STRICTFP | - PRIVATE | - (thisReferenced? (inInterface? DEFAULT : 0) : STATIC); - - //compute synthetic params - ListBuffer params = new ListBuffer<>(); - ListBuffer parameterSymbols = new ListBuffer<>(); - - // The signature of the method is augmented with the following - // synthetic parameters: - // - // 1) reference to enclosing contexts captured by the lambda expression - // 2) enclosing locals captured by the lambda expression - for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) { - params.append(make.VarDef((VarSymbol) thisSym, null)); - parameterSymbols.append((VarSymbol) thisSym); - } - for (Symbol thisSym : getSymbolMap(PARAM).values()) { - params.append(make.VarDef((VarSymbol) thisSym, null)); - parameterSymbols.append((VarSymbol) thisSym); + @Override + public void visitSelect(JCFieldAccess tree) { + if (tree.sym.kind == VAR && + (tree.sym.name == names._this || + tree.sym.name == names._super) && + !seenClasses.contains(tree.sym.type.tsym)) { + capturesThis = true; } - syntheticParams = params.toList(); - - translatedSym.params = parameterSymbols.toList(); - - // Compute and set the lambda name - translatedSym.name = isSerializable() - ? serializedLambdaName() - : lambdaName(); - - //prepend synthetic args to translated lambda method signature - translatedSym.type = types.createMethodTypeWithParameters( - generatedLambdaSig(), - TreeInfo.types(syntheticParams)); + super.visitSelect(tree); } - Type generatedLambdaSig() { - return types.erasure(tree.getDescriptorType(types)); + @Override + public void visitAnnotation(JCAnnotation tree) { + // do nothing (annotation values look like captured instance fields) } } - /** - * Simple subclass modelling the translation context of a method reference. + /* + * These keys provide mappings for various translated lambda symbols + * and the prevailing order must be maintained. */ - final class ReferenceTranslationContext extends TranslationContext { - - ReferenceTranslationContext(JCMemberReference tree) { - super(tree); - } - } - } - // - - /* - * These keys provide mappings for various translated lambda symbols - * and the prevailing order must be maintained. - */ - enum LambdaSymbolKind { - PARAM, // original to translated lambda parameters - LOCAL_VAR, // original to translated lambda locals - CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters - CAPTURED_THIS; // class symbols to translated synthetic parameters (for captured member access) - - boolean propagateAnnotations() { - switch (this) { - case CAPTURED_VAR: - case CAPTURED_THIS: - return false; - default: - return true; - } + enum LambdaSymbolKind { + PARAM, // original to translated lambda parameters + LOCAL_VAR, // original to translated lambda locals + CAPTURED_VAR; // variables in enclosing scope to translated synthetic parameters } } @@ -1791,7 +1304,7 @@ private class L2MSignatureGenerator extends Types.SignatureGenerator { /** * Are signatures incompatible with JVM spec allowed? - * Used by {@link LambdaTranslationContext#serializedLambdaDisambiguation()}. + * Used by {@link LambdaTranslationContext#serializedLambdaDisambiguation(Symbol)}}. */ boolean allowIllegalSignatures; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java index c5fd2177d49a7..62117583a96e9 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java @@ -267,26 +267,22 @@ List enumNamesFor(ClassSymbol c) { Map> freevarCache; /** A navigator class for collecting the free variables accessed - * from a local class. There is only one case; all other cases simply - * traverse down the tree. This class doesn't deal with the specific - * of Lower - it's an abstract visitor that is meant to be reused in - * order to share the local variable capture logic. + * from a local class. */ - abstract class BasicFreeVarCollector extends TreeScanner { + class FreeVarCollector extends CaptureScanner { - /** Add all free variables of class c to fvs list - * unless they are already there. - */ - abstract void addFreeVars(ClassSymbol c); + FreeVarCollector(JCTree ownerTree) { + super(ownerTree); + } - /** If tree refers to a variable in owner of local class, add it to - * free variables list. - */ - public void visitIdent(JCIdent tree) { - visitSymbol(tree.sym); + void addFreeVars(ClassSymbol c) { + List fvs = freevarCache.get(c); + if (fvs != null) { + for (List l = fvs; l.nonEmpty(); l = l.tail) { + addFreeVar(l.head); + } + } } - // where - abstract void visitSymbol(Symbol _sym); /** If tree refers to a class instance creation expression * add all free variables of the freshly created class. @@ -306,84 +302,6 @@ public void visitApply(JCMethodInvocation tree) { } super.visitApply(tree); } - - @Override - public void visitYield(JCYield tree) { - scan(tree.value); - } - - } - - /** - * Lower-specific subclass of {@code BasicFreeVarCollector}. - */ - class FreeVarCollector extends BasicFreeVarCollector { - - /** The owner of the local class. - */ - Symbol owner; - - /** The local class. - */ - ClassSymbol clazz; - - /** The list of owner's variables accessed from within the local class, - * without any duplicates. - */ - List fvs; - - FreeVarCollector(ClassSymbol clazz) { - this.clazz = clazz; - this.owner = clazz.owner; - this.fvs = List.nil(); - } - - /** Add free variable to fvs list unless it is already there. - */ - private void addFreeVar(VarSymbol v) { - for (List l = fvs; l.nonEmpty(); l = l.tail) - if (l.head == v) return; - fvs = fvs.prepend(v); - } - - @Override - void addFreeVars(ClassSymbol c) { - List fvs = freevarCache.get(c); - if (fvs != null) { - for (List l = fvs; l.nonEmpty(); l = l.tail) { - addFreeVar(l.head); - } - } - } - - @Override - void visitSymbol(Symbol _sym) { - Symbol sym = _sym; - if (sym.kind == VAR || sym.kind == MTH) { - if (sym != null && sym.owner != owner) - sym = proxies.get(sym); - if (sym != null && sym.owner == owner) { - VarSymbol v = (VarSymbol)sym; - if (v.getConstValue() == null) { - addFreeVar(v); - } - } - } - } - } - - ClassSymbol ownerToCopyFreeVarsFrom(ClassSymbol c) { - if (!c.isDirectlyOrIndirectlyLocal()) { - return null; - } - Symbol currentOwner = c.owner; - while (currentOwner.owner.kind.matches(KindSelector.TYP) && currentOwner.isDirectlyOrIndirectlyLocal()) { - currentOwner = currentOwner.owner; - } - if (currentOwner.owner.kind.matches(KindSelector.VAL_MTH) && c.isSubClass(currentOwner, types)) { - return (ClassSymbol)currentOwner; - } - return null; } /** Return the variables accessed from within a local class, which @@ -395,22 +313,10 @@ List freevars(ClassSymbol c) { if (fvs != null) { return fvs; } - if (c.owner.kind.matches(KindSelector.VAL_MTH) && !c.isStatic()) { - FreeVarCollector collector = new FreeVarCollector(c); - collector.scan(classDef(c)); - fvs = collector.fvs; - freevarCache.put(c, fvs); - return fvs; - } else { - ClassSymbol owner = ownerToCopyFreeVarsFrom(c); - if (owner != null) { - fvs = freevarCache.get(owner); - freevarCache.put(c, fvs); - return fvs; - } else { - return List.nil(); - } - } + FreeVarCollector collector = new FreeVarCollector(classDef(c)); + fvs = collector.analyzeCaptures().reverse(); + freevarCache.put(c, fvs); + return fvs; } Map enumSwitchMap = new LinkedHashMap<>(); @@ -1501,7 +1407,7 @@ Name proxyName(Name name, int index) { * @param owner The class in which the definitions go. */ List freevarDefs(int pos, List freevars, Symbol owner) { - return freevarDefs(pos, freevars, owner, 0); + return freevarDefs(pos, freevars, owner, LOCAL_CAPTURE_FIELD); } List freevarDefs(int pos, List freevars, Symbol owner, @@ -1517,7 +1423,12 @@ List freevarDefs(int pos, List freevars, Symbol owner proxyName = proxyName(v.name, index++); } while (!proxyNames.add(proxyName)); VarSymbol proxy = new VarSymbol( - flags, proxyName, v.erasure(types), owner); + flags, proxyName, v.erasure(types), owner) { + @Override + public Symbol baseSymbol() { + return v; + } + }; proxies.put(v, proxy); JCVariableDecl vd = make.at(pos).VarDef(proxy, null); vd.vartype = access(vd.vartype); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java index bfe35dbec9c1f..d232f2e6d9f3d 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java @@ -679,6 +679,7 @@ JCExpression lambda() { JCLambda slam = make.Lambda(params.toList(), expr); slam.target = tree.target; + slam.owner = tree.owner; slam.type = tree.type; slam.pos = tree.pos; slam.wasMethodReference = true; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java index dfa92efae7421..6679bb43fb807 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java @@ -329,7 +329,7 @@ protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) { int alenIdx = writeAttr(attributeName); ClassSymbol enclClass = c.owner.enclClass(); MethodSymbol enclMethod = - (c.owner.type == null // local to init block + ((c.owner.flags() & BLOCK) != 0 // local to init block || c.owner.kind != MTH) // or member init ? null : ((MethodSymbol)c.owner).originalEnclosingMethod(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java index acd79c69bd45f..be311bb3ab84c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java @@ -286,16 +286,17 @@ protected List content(Phase phase) { int depth = 1; // only used when phase is INLINE int pos = bp; // only used when phase is INLINE + if (textKind == DocTree.Kind.MARKDOWN) { + initMarkdownLine(); + } + loop: while (bp < buflen) { switch (ch) { case '\n', '\r' -> { nextChar(); if (textKind == DocTree.Kind.MARKDOWN) { - markdown.update(); - if (markdown.isIndentedCodeBlock()) { - markdown.skipLine(); - } + initMarkdownLine(); } } @@ -488,6 +489,17 @@ void defaultContentCharacter() { nextChar(); } + void initMarkdownLine() { + if (textStart == -1) { + textStart = bp; + } + markdown.update(); + if (markdown.isIndentedCodeBlock()) { + markdown.skipLine(); + lastNonWhite = bp - 1; // do not include newline or EOF + } + } + private IllegalStateException unknownTextKind(DocTree.Kind textKind) { return new IllegalStateException(textKind.toString()); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java index 77f6eefc073eb..9e0767b6e2161 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java @@ -592,27 +592,33 @@ Pair, List> splitBody(List list) { case TEXT, MARKDOWN -> { var peekedNext = iter.hasNext() ? alist.get(iter.nextIndex()) : null; var content = getContent(dt); - int breakOffset = getSentenceBreak(dt.getKind(), content, peekedNext); - if (breakOffset > 0) { - // the end of sentence is within the current node; - // split it, skipping whitespace in between the two parts - var fsPart = newNode(dt.getKind(), dt.pos, content.substring(0, breakOffset).stripTrailing()); - fs.add(fsPart); - int wsOffset = skipWhiteSpace(content, breakOffset); - if (wsOffset > 0) { - var bodyPart = newNode(dt.getKind(), dt.pos + wsOffset, content.substring(wsOffset)); - body.add(bodyPart); - } - foundFirstSentence = true; - } else if (peekedNext != null && isSentenceBreak(peekedNext, false)) { - // the next node is a sentence break, so this is the end of the first sentence; - // remove trailing spaces - var fsPart = newNode(dt.getKind(), dt.pos, content.stripTrailing()); - fs.add(fsPart); + if (isFirst && dt.getKind() == Kind.MARKDOWN && isIndented(content)) { + // begins with an indented code block (unusual), so no first sentence + body.add(dt); foundFirstSentence = true; } else { - // no sentence break found; keep scanning - fs.add(dt); + int breakOffset = getSentenceBreak(dt.getKind(), content, peekedNext); + if (breakOffset > 0) { + // the end of sentence is within the current node; + // split it, skipping whitespace in between the two parts + var fsPart = newNode(dt.getKind(), dt.pos, content.substring(0, breakOffset).stripTrailing()); + fs.add(fsPart); + int wsOffset = skipWhiteSpace(content, breakOffset); + if (wsOffset > 0) { + var bodyPart = newNode(dt.getKind(), dt.pos + wsOffset, content.substring(wsOffset)); + body.add(bodyPart); + } + foundFirstSentence = true; + } else if (peekedNext != null && isSentenceBreak(peekedNext, false)) { + // the next node is a sentence break, so this is the end of the first sentence; + // remove trailing spaces + var fsPart = newNode(dt.getKind(), dt.pos, content.stripTrailing()); + fs.add(fsPart); + foundFirstSentence = true; + } else { + // no sentence break found; keep scanning + fs.add(dt); + } } } @@ -651,6 +657,11 @@ private String getContent(DCTree dt) { }; } + private static final Pattern INDENT = Pattern.compile(" {4}| {0,3}\t"); + private boolean isIndented(String s) { + return INDENT.matcher(s).lookingAt(); + } + private DCTree newNode(DocTree.Kind kind, int pos, String text) { return switch (kind) { case TEXT -> m.at(pos).newTextTree(text); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java index 6f3b8b5d8aaca..6041da6723aa4 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java @@ -807,6 +807,8 @@ public JCFunctionalExpression() { /** list of target types inferred for this functional expression. */ public Type target; + /** The owner of this functional expression. */ + public Symbol owner; public Type getDescriptorType(Types types) { return target != null ? types.findDescriptorType(target) : types.createErrorType(null); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java index 0336f3c4191ac..b9ae35da9df1f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java @@ -273,8 +273,8 @@ public void visitNewArray(JCNewArray tree) { } public void visitLambda(JCLambda tree) { - scan(tree.body); scan(tree.params); + scan(tree.body); } public void visitParens(JCParens tree) { diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java index 4d10584fa09ba..44a2c4efb0694 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -27,7 +27,7 @@ import java.io.*; import java.util.*; - +import java.util.stream.Collectors; import java.security.*; import java.security.interfaces.*; @@ -1272,7 +1272,11 @@ private void initToken(CK_SLOT_INFO slotInfo) throws PKCS11Exception { CKM_SHA3_512_RSA_PKCS_PSS); } } + long[] supportedMechanisms = p11.C_GetMechanismList(slotID); + Set supportedMechSet = + Arrays.stream(supportedMechanisms).boxed().collect + (Collectors.toCollection(HashSet::new)); // Create a map from the various Descriptors to the "most // preferred" mechanism that was defined during the @@ -1281,10 +1285,9 @@ private void initToken(CK_SLOT_INFO slotInfo) throws PKCS11Exception { // the earliest entry. When asked for "DES/CBC/PKCS5Padding", we // return a CKM_DES_CBC_PAD. final Map supportedAlgs = - new HashMap(); + new HashMap(); - for (int i = 0; i < supportedMechanisms.length; i++) { - long longMech = supportedMechanisms[i]; + for (long longMech : supportedMechanisms) { CK_MECHANISM_INFO mechInfo = token.getMechanismInfo(longMech); if (showInfo) { System.out.println("Mechanism " + @@ -1331,13 +1334,19 @@ private void initToken(CK_SLOT_INFO slotInfo) throws PKCS11Exception { for (Descriptor d : ds) { Integer oldMech = supportedAlgs.get(d); if (oldMech == null) { + // check all required mechs are supported if (d.requiredMechs != null) { - // Check that other mechanisms required for the - // service are supported before listing it as - // available for the first time. - for (int requiredMech : d.requiredMechs) { - if (token.getMechanismInfo( - requiredMech & 0xFFFFFFFFL) == null) { + for (int reqMech : d.requiredMechs) { + long longReqMech = reqMech & 0xFFFFFFFFL; + if (!config.isEnabled(longReqMech) || + !supportedMechSet.contains(longReqMech) || + brokenMechanisms.contains(longReqMech)) { + if (showInfo) { + System.out.println("DISABLED " + d.type + + " " + d.algorithm + + " due to no support for req'd mech " + + Functions.getMechanismName(longReqMech)); + } continue descLoop; } } @@ -1350,7 +1359,7 @@ private void initToken(CK_SLOT_INFO slotInfo) throws PKCS11Exception { (d.type == SIG && (mechInfo.flags & CKF_SIGN) == 0)) { if (showInfo) { - System.out.println("DISABLED " + d.type + + System.out.println("DISABLED " + d.type + " " + d.algorithm + " due to partial support"); } @@ -1374,7 +1383,6 @@ private void initToken(CK_SLOT_INFO slotInfo) throws PKCS11Exception { } } } - } // register algorithms in provider diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedOops.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedOops.java index 056d75199579c..01c9974153392 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedOops.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedOops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -64,8 +64,8 @@ private static boolean typeExists(TypeDataBase db, String type) { private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("CompressedOops"); - baseField = type.getAddressField("_narrow_oop._base"); - shiftField = type.getCIntegerField("_narrow_oop._shift"); + baseField = type.getAddressField("_base"); + shiftField = type.getCIntegerField("_shift"); } public CompressedOops() { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java index 224206ee6fe59..a47a632c286ef 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java @@ -345,8 +345,9 @@ private Frame senderForUpcallStub(PPC64RegisterMap map, UpcallStub stub) { //------------------------------------------------------------------------------ // frame::adjust_unextended_sp private void adjustUnextendedSP() { - raw_unextendedSP = getFP(); + // Nothing to do. senderForInterpreterFrame finds the correct unextendedSP. } + private Frame senderForInterpreterFrame(PPC64RegisterMap map) { if (DEBUG) { System.out.println("senderForInterpreterFrame"); diff --git a/src/jdk.hotspot.agent/share/man/jhsdb.1 b/src/jdk.hotspot.agent/share/man/jhsdb.1 index 5b65f7eafb465..93cc1fedb158a 100644 --- a/src/jdk.hotspot.agent/share/man/jhsdb.1 +++ b/src/jdk.hotspot.agent/share/man/jhsdb.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2019, 2024, 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 @@ -44,6 +44,10 @@ analyze the content of a core dump from a crashed Java Virtual Machine (JVM) .SH SYNOPSIS .PP +\f[B]WARNING:\f[R] The \f[V]debugd\f[R] subcommand and +\f[V]--connect\f[R] options are deprecated. +They will be removed in a future release. +.PP \f[V]jhsdb\f[R] \f[V]clhsdb\f[R] [\f[V]--pid\f[R] \f[I]pid\f[R] | \f[V]--exe\f[R] \f[I]executable\f[R] \f[V]--core\f[R] \f[I]coredump\f[R]] diff --git a/src/jdk.incubator.vector/linux/legal/sleef.md b/src/jdk.incubator.vector/linux/legal/sleef.md new file mode 100644 index 0000000000000..ad4c4cba790f9 --- /dev/null +++ b/src/jdk.incubator.vector/linux/legal/sleef.md @@ -0,0 +1,439 @@ +## SLEEF v3.6.1 + +### Notice +``` +Copyright © 2010-2024 SLEEF Project, Naoki Shibata and contributors + +------- +src/arch/helpersve.h has the following copyright: +Copyright ARM Ltd. 2010 - 2024. +------- +src/gencoef/{dp.h, gencoef.c, ld.h, qp.h, simplexfr.c, sp.h} have no copyright but has the following license text: +// The code is distributed under the Creative Commons Attribution 4.0 International License. +// https://creativecommons.org/licenses/by/4.0/ +Attribution 4.0 International +``` + +### LICENSE Boost v1.0 +``` + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +``` + +### LICENSE Creative Commons Attribution 4.0 International License + +``` +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. +``` diff --git a/src/jdk.incubator.vector/linux/native/libsleef/README.md b/src/jdk.incubator.vector/linux/native/libsleef/README.md new file mode 100644 index 0000000000000..1f20f3dda1016 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/README.md @@ -0,0 +1,54 @@ +# About SLEEF + +This directory contains the source code for the SLEEF library, the +**SIMD Library for Evaluating Elementary Functions**. For more information on +SLEEF, see https://sleef.org/. + +The currently imported libsleef sources is version 3.6.1, which has +git tag `3.6.1` and git commit hash `6ee14bcae5fe92c2ff8b000d5a01102dab08d774`. + +# About the libsleef integration in the JDK + +The upstream original source code is available in +`src/jdk.incubator.vector/linux/native/libsleef/upstream`. However, this code is +not directly usable in the JDK build system, but is instead used as the base for +the generation of additional souce code files. This generation is done by +the libsleef CMake files. If this should have been done at build time, it would +have meant adding CMake as a required dependency to build the JDK. + +Instead, we create these generated files only once, when we import a new +version of the libsleef source code, and check in the generated files into +the JDK source tree. The generated files reside in +`src/jdk.incubator.vector/linux/native/libsleef/generated`. + +# Import instructions + +To update the version of libsleef that is used in the JDK, clone +`https://github.com/shibatch/sleef.git`, and copy all files, except the `docs`, +`.github` and `.git` directories, into +`src/jdk.incubator.vector/linux/native/libsleef/upstream`. + +The libsleef source code does not follow the JDK whitespace rules as enforced by +jcheck. You will need to remove trailing whitespace, and expand tabs to 8 +spaces in the imported source code. + +Update the note above with information about what version you import. + +You will need to repeat the process below for each of the platforms in the JDK +that uses libsleef; currently this is aarch64 and riscv64. The rest of this +instruction assumes you are doing this on linux/x64; at this point, any other +setup is not supported. Also, make sure you have CMake installed. + +First, run configure for cross-compiling to your selected target platform +(e.g. aarch64). + +Run `make update-sleef-source` to process the upstream source code and +store the generated files in the `generated` directory. + +Now, you can repeat this for the next platform. For instance, you can +create a separate configuration using `configure --with-conf-name=riscv64` and +then generate the updated libsleef source code by +`make update-sleef-source CONF=riscv64`. + +Finally, verify with git that the local changes made to the files in +`src/jdk.incubator.vector/linux/native/libsleef/generated` look okay. diff --git a/src/jdk.incubator.vector/linux/native/libsleef/generated/misc.h b/src/jdk.incubator.vector/linux/native/libsleef/generated/misc.h new file mode 100644 index 0000000000000..472cae68bd571 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/generated/misc.h @@ -0,0 +1,332 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// + +#ifndef __MISC_H__ +#define __MISC_H__ + +#if !defined(SLEEF_GENHEADER) +#include +#include +#endif + +#ifndef M_PI +#define M_PI 3.141592653589793238462643383279502884 +#endif + +#ifndef M_PIl +#define M_PIl 3.141592653589793238462643383279502884L +#endif + +#ifndef M_1_PI +#define M_1_PI 0.318309886183790671537767526745028724 +#endif + +#ifndef M_1_PIl +#define M_1_PIl 0.318309886183790671537767526745028724L +#endif + +#ifndef M_2_PI +#define M_2_PI 0.636619772367581343075535053490057448 +#endif + +#ifndef M_2_PIl +#define M_2_PIl 0.636619772367581343075535053490057448L +#endif + +#if !defined(SLEEF_GENHEADER) + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#endif + +#define SLEEF_SNAN (((union { long long int i; double d; }) { .i = INT64_C(0x7ff0000000000001) }).d) +#define SLEEF_SNANf (((union { long int i; float f; }) { .i = 0xff800001 }).f) + +#define SLEEF_FLT_MIN 0x1p-126 +#define SLEEF_DBL_MIN 0x1p-1022 +#define SLEEF_INT_MAX 2147483647 +#define SLEEF_DBL_DENORM_MIN 4.9406564584124654e-324 +#define SLEEF_FLT_DENORM_MIN 1.40129846e-45F + +// + +/* + PI_A to PI_D are constants that satisfy the following two conditions. + + * For PI_A, PI_B and PI_C, the last 28 bits are zero. + * PI_A + PI_B + PI_C + PI_D is close to PI as much as possible. + + The argument of a trig function is multiplied by 1/PI, and the + integral part is divided into two parts, each has at most 28 + bits. So, the maximum argument that could be correctly reduced + should be 2^(28*2-1) PI = 1.1e+17. However, due to internal + double precision calculation, the actual maximum argument that can + be correctly reduced is around 2^47. + */ + +#define PI_A 3.1415926218032836914 +#define PI_B 3.1786509424591713469e-08 +#define PI_C 1.2246467864107188502e-16 +#define PI_D 1.2736634327021899816e-24 +#define TRIGRANGEMAX 1e+14 + +/* + PI_A2 and PI_B2 are constants that satisfy the following two conditions. + + * The last 3 bits of PI_A2 are zero. + * PI_A2 + PI_B2 is close to PI as much as possible. + + The argument of a trig function is multiplied by 1/PI, and the + integral part is multiplied by PI_A2. So, the maximum argument that + could be correctly reduced should be 2^(3-1) PI = 12.6. By testing, + we confirmed that it correctly reduces the argument up to around 15. + */ + +#define PI_A2 3.141592653589793116 +#define PI_B2 1.2246467991473532072e-16 +#define TRIGRANGEMAX2 15 + +#define M_2_PI_H 0.63661977236758138243 +#define M_2_PI_L -3.9357353350364971764e-17 + +#define SQRT_DBL_MAX 1.3407807929942596355e+154 + +#define TRIGRANGEMAX3 1e+9 + +#define M_4_PI 1.273239544735162542821171882678754627704620361328125 + +#define L2U .69314718055966295651160180568695068359375 +#define L2L .28235290563031577122588448175013436025525412068e-12 +#define R_LN2 1.442695040888963407359924681001892137426645954152985934135449406931 + +#define L10U 0.30102999566383914498 // log 2 / log 10 +#define L10L 1.4205023227266099418e-13 +#define LOG10_2 3.3219280948873623478703194294893901758648313930 + +#define L10Uf 0.3010253906f +#define L10Lf 4.605038981e-06f + +// + +#define PI_Af 3.140625f +#define PI_Bf 0.0009670257568359375f +#define PI_Cf 6.2771141529083251953e-07f +#define PI_Df 1.2154201256553420762e-10f +#define TRIGRANGEMAXf 39000 + +#define PI_A2f 3.1414794921875f +#define PI_B2f 0.00011315941810607910156f +#define PI_C2f 1.9841872589410058936e-09f +#define TRIGRANGEMAX2f 125.0f + +#define TRIGRANGEMAX4f 8e+6f + +#define SQRT_FLT_MAX 18446743523953729536.0 + +#define L2Uf 0.693145751953125f +#define L2Lf 1.428606765330187045e-06f + +#define R_LN2f 1.442695040888963407359924681001892137426645954152985934135449406931f +#ifndef M_PIf +# define M_PIf ((float)M_PI) +#endif + +// + +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + +#ifndef ABS +#define ABS(x) ((x) < 0 ? -(x) : (x)) +#endif + +#define stringify(s) stringify_(s) +#define stringify_(s) #s + +#if !defined(SLEEF_GENHEADER) +typedef long double longdouble; +#endif + +#if !defined(Sleef_double2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_double2_DEFINED +typedef struct { + double x, y; +} Sleef_double2; +#endif + +#if !defined(Sleef_float2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_float2_DEFINED +typedef struct { + float x, y; +} Sleef_float2; +#endif + +#if !defined(Sleef_longdouble2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_longdouble2_DEFINED +typedef struct { + long double x, y; +} Sleef_longdouble2; +#endif + +#if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#define LIKELY(condition) __builtin_expect(!!(condition), 1) +#define UNLIKELY(condition) __builtin_expect(!!(condition), 0) +#define RESTRICT __restrict__ + +#ifndef __arm__ +#define ALIGNED(x) __attribute__((aligned(x))) +#else +#define ALIGNED(x) +#endif + +#if defined(SLEEF_GENHEADER) + +#define INLINE SLEEF_ALWAYS_INLINE +#define EXPORT SLEEF_INLINE +#define CONST SLEEF_CONST +#define NOEXPORT + +#else // #if defined(SLEEF_GENHEADER) + +#define CONST __attribute__((const)) +#define INLINE __attribute__((always_inline)) + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) +#ifndef SLEEF_STATIC_LIBS +#define EXPORT __stdcall __declspec(dllexport) +#define NOEXPORT +#else // #ifndef SLEEF_STATIC_LIBS +#define EXPORT +#define NOEXPORT +#endif // #ifndef SLEEF_STATIC_LIBS +#else // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) +#define EXPORT __attribute__((visibility("default"))) +#define NOEXPORT __attribute__ ((visibility ("hidden"))) +#endif // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) + +#endif // #if defined(SLEEF_GENHEADER) + +#define SLEEF_NAN __builtin_nan("") +#define SLEEF_NANf __builtin_nanf("") +#define SLEEF_NANl __builtin_nanl("") +#define SLEEF_INFINITY __builtin_inf() +#define SLEEF_INFINITYf __builtin_inff() +#define SLEEF_INFINITYl __builtin_infl() + +#if defined(__INTEL_COMPILER) || defined (__clang__) +#define SLEEF_INFINITYq __builtin_inf() +#define SLEEF_NANq __builtin_nan("") +#else +#define SLEEF_INFINITYq __builtin_infq() +#define SLEEF_NANq (SLEEF_INFINITYq - SLEEF_INFINITYq) +#endif + +#elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#if defined(SLEEF_GENHEADER) + +#define INLINE SLEEF_ALWAYS_INLINE +#define CONST SLEEF_CONST +#define EXPORT SLEEF_INLINE +#define NOEXPORT + +#else // #if defined(SLEEF_GENHEADER) + +#define INLINE __forceinline +#define CONST +#ifndef SLEEF_STATIC_LIBS +#define EXPORT __declspec(dllexport) +#define NOEXPORT +#else +#define EXPORT +#define NOEXPORT +#endif + +#endif // #if defined(SLEEF_GENHEADER) + +#define RESTRICT +#define ALIGNED(x) +#define LIKELY(condition) (condition) +#define UNLIKELY(condition) (condition) + +#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) && !defined(SLEEF_GENHEADER) +#include +#endif + +#define SLEEF_INFINITY (1e+300 * 1e+300) +#define SLEEF_NAN (SLEEF_INFINITY - SLEEF_INFINITY) +#define SLEEF_INFINITYf ((float)SLEEF_INFINITY) +#define SLEEF_NANf ((float)SLEEF_NAN) +#define SLEEF_INFINITYl ((long double)SLEEF_INFINITY) +#define SLEEF_NANl ((long double)SLEEF_NAN) + +#if (defined(_M_AMD64) || defined(_M_X64)) +#ifndef __SSE2__ +#define __SSE2__ +#define __SSE3__ +#define __SSE4_1__ +#endif +#elif _M_IX86_FP == 2 +#ifndef __SSE2__ +#define __SSE2__ +#define __SSE3__ +#define __SSE4_1__ +#endif +#elif _M_IX86_FP == 1 +#ifndef __SSE__ +#define __SSE__ +#endif +#endif + +#endif // #elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#if !defined(__linux__) +#define isinff(x) ((x) == SLEEF_INFINITYf || (x) == -SLEEF_INFINITYf) +#define isinfl(x) ((x) == SLEEF_INFINITYl || (x) == -SLEEF_INFINITYl) +#define isnanf(x) ((x) != (x)) +#define isnanl(x) ((x) != (x)) +#endif + +#endif // #ifndef __MISC_H__ + +#ifdef ENABLE_AAVPCS +#define VECTOR_CC __attribute__((aarch64_vector_pcs)) +#else +#define VECTOR_CC +#endif + +// + +#if defined (__GNUC__) && !defined(__INTEL_COMPILER) +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wattribute-alias" +#pragma GCC diagnostic ignored "-Wlto-type-mismatch" +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif +#endif + +#if defined(_MSC_VER) +#pragma warning(disable:4101) // warning C4101: 'v': unreferenced local variable +#pragma warning(disable:4116) // warning C4116: unnamed type definition in parentheses +#pragma warning(disable:4244) // warning C4244: 'function': conversion from 'vopmask' to '__mmask8', possible loss of data +#pragma warning(disable:4267) // warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data +#pragma warning(disable:4305) // warning C4305: 'function': truncation from 'double' to 'float' +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_advsimd.h b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_advsimd.h new file mode 100644 index 0000000000000..7e02768cf1ef5 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_advsimd.h @@ -0,0 +1,6907 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF 3.6.1 + +#ifndef SLEEF_ALWAYS_INLINE +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_ALWAYS_INLINE inline __forceinline +#else +#define SLEEF_ALWAYS_INLINE inline +#endif +#endif + +#ifndef SLEEF_INLINE +#define SLEEF_INLINE static inline +#endif + +#ifndef SLEEF_CONST +#define SLEEF_CONST +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#define SLEEFINLINE_ADVSIMD_H_INCLUDED + +#ifndef __SLEEF_REMPITAB__ +#define __SLEEF_REMPITAB__ +static const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, +}; + +static const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, +}; +#endif // #ifndef __SLEEF_REMPITAB__ + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const double Sleef_rempitabdp[]; + +typedef uint32x4_t vmask_advsimd_sleef; +typedef uint32x4_t vopmask_advsimd_sleef; + +typedef float32x4_t vfloat_advsimd_sleef; +typedef int32x4_t vint2_advsimd_sleef; + +typedef float64x2_t vdouble_advsimd_sleef; +typedef int32x2_t vint_advsimd_sleef; + +typedef int64x2_t vint64_advsimd_sleef; +typedef uint64x2_t vuint64_advsimd_sleef; + +typedef struct { + vmask_advsimd_sleef x, y; +} vquad_advsimd_sleef; + +typedef vquad_advsimd_sleef vargquad_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE int vavailability_i_advsimd_sleef(int name) { return 3; } +static SLEEF_ALWAYS_INLINE void vprefetch_v_p_advsimd_sleef(const void *ptr) { } + +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo32_advsimd_sleef(vopmask_advsimd_sleef g) { + uint32x2_t x0 = vand_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmin_u32(x0, x0); + return vget_lane_u32(x1, 0); +} + +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo64_advsimd_sleef(vopmask_advsimd_sleef g) { + uint32x2_t x0 = vand_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmin_u32(x0, x0); + return vget_lane_u32(x1, 0); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vload_vd_p_advsimd_sleef(const double *ptr) { return vld1q_f64(ptr); } +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vloadu_vd_p_advsimd_sleef(const double *ptr) { return vld1q_f64(ptr); } +static SLEEF_ALWAYS_INLINE void vstore_v_p_vd_advsimd_sleef(double *ptr, vdouble_advsimd_sleef v) { vst1q_f64(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vd_advsimd_sleef(double *ptr, vdouble_advsimd_sleef v) { vst1q_f64(ptr, v); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vload_vf_p_advsimd_sleef(const float *ptr) { return vld1q_f32(ptr); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vloadu_vf_p_advsimd_sleef(const float *ptr) { return vld1q_f32(ptr); } +static SLEEF_ALWAYS_INLINE void vstore_v_p_vf_advsimd_sleef(float *ptr, vfloat_advsimd_sleef v) { vst1q_f32(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vf_advsimd_sleef(float *ptr, vfloat_advsimd_sleef v) { vst1q_f32(ptr, v); } +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vloadu_vi2_p_advsimd_sleef(int32_t *p) { return vld1q_s32(p); } +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi2_advsimd_sleef(int32_t *p, vint2_advsimd_sleef v) { vst1q_s32(p, v); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vloadu_vi_p_advsimd_sleef(int32_t *p) { return vld1_s32(p); } +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi_advsimd_sleef(int32_t *p, vint_advsimd_sleef v) { vst1_s32(p, v); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vgather_vd_p_vi_advsimd_sleef(const double *ptr, vint_advsimd_sleef vi) { + return ((vdouble_advsimd_sleef) { ptr[vget_lane_s32(vi, 0)], ptr[vget_lane_s32(vi, 1)]} ); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vgather_vf_p_vi2_advsimd_sleef(const float *ptr, vint2_advsimd_sleef vi2) { + return ((vfloat_advsimd_sleef) { + ptr[vgetq_lane_s32(vi2, 0)], + ptr[vgetq_lane_s32(vi2, 1)], + ptr[vgetq_lane_s32(vi2, 2)], + ptr[vgetq_lane_s32(vi2, 3)] + }); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vand_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return vandq_u32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vandnot_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vbicq_u32(y, x); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vor_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return vorrq_u32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vxor_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return veorq_u32(x, y); } + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vreinterpret_vm_vf_advsimd_sleef(vfloat_advsimd_sleef vf) { + return vreinterpretq_u32_f32(vf); +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vreinterpret_vf_vm_advsimd_sleef(vmask_advsimd_sleef vm) { + return vreinterpretq_f32_u32(vm); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vcast_vi2_vm_advsimd_sleef(vmask_advsimd_sleef vm) { return vreinterpretq_s32_u32(vm); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcast_vm_vi2_advsimd_sleef(vint2_advsimd_sleef vi) { return vreinterpretq_u32_s32(vi); } + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vreinterpret_vm_vd_advsimd_sleef(vdouble_advsimd_sleef vd_advsimd_sleef) { + return vreinterpretq_u32_f64(vd_advsimd_sleef); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vreinterpret_vd_vm_advsimd_sleef(vmask_advsimd_sleef vm) { + return vreinterpretq_f64_u32(vm); +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vreinterpret_vf_vi2_advsimd_sleef(vint2_advsimd_sleef vm) { + return vreinterpretq_f32_s32(vm); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vreinterpret_vi2_vf_advsimd_sleef(vfloat_advsimd_sleef vf) { + return vreinterpretq_s32_f32(vf); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vcast_vf_f_advsimd_sleef(float f) { return vdupq_n_f32(f); } + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vadd_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vaddq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsub_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vsubq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmul_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vmulq_f32(x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vabs_vf_vf_advsimd_sleef(vfloat_advsimd_sleef f) { return vabsq_f32(f); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vneg_vf_vf_advsimd_sleef(vfloat_advsimd_sleef f) { return vnegq_f32(f); } + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmla_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vfmaq_f32(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmlanp_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vfmsq_f32(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmlapn_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vneg_vf_vf_advsimd_sleef(vfmsq_f32(z, x, y)); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vfma_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vfmaq_f32(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vfmanp_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vfmsq_f32(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vfmapn_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + return vfma_vf_vf_vf_vf_advsimd_sleef(x, y, vneg_vf_vf_advsimd_sleef(z)); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vdiv_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef n, vfloat_advsimd_sleef d) { + + return vdivq_f32(n, d); + +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vrec_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + + return vdiv_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), d); + +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsqrt_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + + return vsqrtq_f32(d); + +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmax_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vmaxq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmin_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vminq_f32(x, y); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef veq_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vceqq_f32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vneq_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vmvnq_u32(vceqq_f32(x, y)); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vlt_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vcltq_f32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vle_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vcleq_f32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vgt_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vcgtq_f32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vge_vm_vf_vf(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vcgeq_f32(x, y); } + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsel_vf_vm_vf_vf(vmask_advsimd_sleef mask, vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vbslq_f32(mask, x, y); +} + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vtruncate_vi2_vf_advsimd_sleef(vfloat_advsimd_sleef vf) { return vcvtq_s32_f32(vf); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vcast_vf_vi2_advsimd_sleef(vint2_advsimd_sleef vi) { return vcvtq_f32_s32(vi); } +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vcast_vi2_i_advsimd_sleef(int i) { return vdupq_n_s32(i); } +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vrint_vi2_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return vcvtq_s32_f32(vrndnq_f32(d)); +} + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vadd_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vaddq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vsub_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vsubq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vneg_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef e) { return vnegq_s32(e); } + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vand_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vandq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vandnot_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vbicq_s32(y, x); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vor_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vorrq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vxor_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return veorq_s32(x, y); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef veq_vm_vi2_vi2(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { return vceqq_s32(x, y); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vgt_vm_vi2_vi2(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { return vcgeq_s32(x, y); } + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vgt_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vreinterpretq_s32_u32(vcgtq_s32(x, y)); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef veq_vi2_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vreinterpretq_s32_u32(vceqq_s32(x, y)); +} + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vsel_vi2_vm_vi2_vi2(vmask_advsimd_sleef m, vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vbslq_s32(m, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vcast_vd_d_advsimd_sleef(double f) { return vdupq_n_f64(f); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vadd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vaddq_f64(x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsub_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vsubq_f64(x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmul_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vmulq_f64(x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vabs_vd_vd_advsimd_sleef(vdouble_advsimd_sleef f) { return vabsq_f64(f); } +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vneg_vd_vd_advsimd_sleef(vdouble_advsimd_sleef f) { return vnegq_f64(f); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmax_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vmaxq_f64(x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmin_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vminq_f64(x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmla_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vfmaq_f64(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmlanp_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vfmsq_f64(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmlapn_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vneg_vd_vd_advsimd_sleef(vfmsq_f64(z, x, y)); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vfma_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vfmaq_f64(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vfmanp_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vfmsq_f64(z, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vfmapn_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return vfma_vd_vd_vd_vd_advsimd_sleef(x, y, vneg_vd_vd_advsimd_sleef(z)); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vdiv_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef n, vdouble_advsimd_sleef d) { + + return vdivq_f64(n, d); + +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vrec_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + + return vdiv_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1.0f), d); + +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsqrt_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + + return vsqrtq_f64(d); + +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef veq_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpretq_u32_u64(vceqq_f64(x, y)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vneq_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vmvnq_u32(vreinterpretq_u32_u64(vceqq_f64(x, y))); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vlt_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpretq_u32_u64(vcltq_f64(x, y)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vgt_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpretq_u32_u64(vcgtq_f64(x, y)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vle_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpretq_u32_u64(vcleq_f64(x, y)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vge_vo_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpretq_u32_u64(vcgeq_f64(x, y)); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsel_vd_vo_vd_vd_advsimd_sleef(vopmask_advsimd_sleef mask, vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vbslq_f64(vreinterpretq_u64_u32(mask), x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsel_vd_vo_d_d_advsimd_sleef(vopmask_advsimd_sleef o, double v1, double v0) { + return vsel_vd_vo_vd_vd_advsimd_sleef(o, vcast_vd_d_advsimd_sleef(v1), vcast_vd_d_advsimd_sleef(v0)); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsel_vd_vo_vo_d_d_d_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd_advsimd_sleef(o0, vcast_vd_d_advsimd_sleef(d0), vsel_vd_vo_d_d_advsimd_sleef(o1, d1, d2)); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, vopmask_advsimd_sleef o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd_advsimd_sleef(o0, vcast_vd_d_advsimd_sleef(d0), vsel_vd_vo_vd_vd_advsimd_sleef(o1, vcast_vd_d_advsimd_sleef(d1), vsel_vd_vo_d_d_advsimd_sleef(o2, d2, d3))); +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vrint_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { return vrndnq_f64(d); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vrint_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { return vrndnq_f32(d); } + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vtruncate_vi_vd_advsimd_sleef(vdouble_advsimd_sleef vf) { + return vmovn_s64(vcvtq_s64_f64(vf)); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vcast_vd_vi_advsimd_sleef(vint_advsimd_sleef vi) { + return vcvtq_f64_s64(vmovl_s32(vi)); +} +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vcast_vi_i_advsimd_sleef(int i) { return vdup_n_s32(i); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vrint_vi_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vqmovn_s64(vcvtq_s64_f64(vrndnq_f64(d))); +} + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vadd_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return vadd_s32(x, y); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vsub_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return vsub_s32(x, y); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vneg_vi_vi_advsimd_sleef(vint_advsimd_sleef e) { return vneg_s32(e); } + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vand_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return vand_s32(x, y); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vandnot_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return vbic_s32(y, x); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vor_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return vorr_s32(x, y); } +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vxor_vi_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { return veor_s32(x, y); } + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef veq_vo_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { + return vcombine_u32(vceq_s32(x, y), vdup_n_u32(0)); +} + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vsel_vi_vm_vi_vi(vmask_advsimd_sleef m, vint_advsimd_sleef x, vint_advsimd_sleef y) { + return vbsl_s32(vget_low_u32(m), x, y); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visinf_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + const float64x2_t inf = vdupq_n_f64(__builtin_inf()); + const float64x2_t neg_inf = vdupq_n_f64(-__builtin_inf()); + uint64x2_t cmp = vorrq_u64(vceqq_f64(d, inf), vceqq_f64(d, neg_inf)); + return vreinterpretq_u32_u64(cmp); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visnan_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vmvnq_u32(vreinterpretq_u32_u64(vceqq_f64(d, d))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vispinf_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vreinterpretq_u32_u64(vceqq_f64(d, vdupq_n_f64(__builtin_inf()))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visminf_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vreinterpretq_u32_u64(vceqq_f64(d, vdupq_n_f64(-__builtin_inf()))); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsel_vf_vo_vf_vf_advsimd_sleef(vopmask_advsimd_sleef mask, vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vbslq_f32(mask, x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vsel_vf_vo_f_f_advsimd_sleef(vopmask_advsimd_sleef o, float v1, float v0) { + return vsel_vf_vo_vf_vf_advsimd_sleef(o, vcast_vf_f_advsimd_sleef(v1), vcast_vf_f_advsimd_sleef(v0)); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsel_vf_vo_vo_f_f_f_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf_advsimd_sleef(o0, vcast_vf_f_advsimd_sleef(d0), vsel_vf_vo_f_f_advsimd_sleef(o1, d1, d2)); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, vopmask_advsimd_sleef o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf_advsimd_sleef(o0, vcast_vf_f_advsimd_sleef(d0), vsel_vf_vo_vf_vf_advsimd_sleef(o1, vcast_vf_f_advsimd_sleef(d1), vsel_vf_vo_f_f_advsimd_sleef(o2, d2, d3))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef veq_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vceqq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vneq_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vmvnq_u32(vceqq_f32(x, y)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vlt_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vcltq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vle_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vcleq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vgt_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vcgtq_f32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vge_vo_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vcgeq_f32(x, y); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef veq_vo_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vceqq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vgt_vo_vi2_vi2_advsimd_sleef(vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vcgtq_s32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vgt_vo_vi_vi_advsimd_sleef(vint_advsimd_sleef x, vint_advsimd_sleef y) { + return vcombine_u32(vcgt_s32(x, y), vdup_n_u32(0)); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visinf_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return veq_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inff())); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vispinf_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(__builtin_inff())); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visminf_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-__builtin_inff())); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef visnan_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { return vneq_vo_vf_vf_advsimd_sleef(d, d); } + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vcast_vo32_vo64_advsimd_sleef(vopmask_advsimd_sleef m) { + return vuzpq_u32(m, m).val[0]; +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vcast_vo64_vo32_advsimd_sleef(vopmask_advsimd_sleef m) { + return vzipq_u32(m, m).val[0]; +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vcast_vo_i_advsimd_sleef(int i) { + return vreinterpretq_u32_u64(vdupq_n_u64((uint64_t)(i ? -1 : 0))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vand_vo_vo_vo_advsimd_sleef(vopmask_advsimd_sleef x, vopmask_advsimd_sleef y) { + return vandq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vandnot_vo_vo_vo_advsimd_sleef(vopmask_advsimd_sleef x, vopmask_advsimd_sleef y) { + return vbicq_u32(y, x); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vor_vo_vo_vo_advsimd_sleef(vopmask_advsimd_sleef x, vopmask_advsimd_sleef y) { + return vorrq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vxor_vo_vo_vo_advsimd_sleef(vopmask_advsimd_sleef x, vopmask_advsimd_sleef y) { + return veorq_u32(x, y); +} + +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vsel_vi2_vo_vi2_vi2_advsimd_sleef(vopmask_advsimd_sleef m, vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vbslq_s32(m, x, y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vand_vi2_vo_vi2_advsimd_sleef(vopmask_advsimd_sleef x, vint2_advsimd_sleef y) { + return vandq_s32(vreinterpretq_s32_u32(x), y); +} +static SLEEF_ALWAYS_INLINE vint2_advsimd_sleef vandnot_vi2_vo_vi2_advsimd_sleef(vopmask_advsimd_sleef x, vint2_advsimd_sleef y) { + return vbicq_s32(y, vreinterpretq_s32_u32(x)); +} +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vandnot_vi_vo_vi_advsimd_sleef(vopmask_advsimd_sleef x, vint_advsimd_sleef y) { + return vbic_s32(y, vget_low_s32(vreinterpretq_s32_u32(x))); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vand_vm_vo32_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vandq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vand_vm_vo64_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vandq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vandnot_vm_vo32_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vbicq_u32(y, x); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vandnot_vm_vo64_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vbicq_u32(y, x); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vor_vm_vo32_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vorrq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vor_vm_vo64_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vorrq_u32(x, y); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vxor_vm_vo32_vm_advsimd_sleef(vopmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return veorq_u32(x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vtruncate_vf_vf_advsimd_sleef(vfloat_advsimd_sleef vd_advsimd_sleef) { return vrndq_f32(vd_advsimd_sleef); } + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcast_vm_i_i_advsimd_sleef(int i0, int i1) { + return vreinterpretq_u32_u64(vdupq_n_u64((0xffffffff & (uint64_t)i1) | (((uint64_t)i0) << 32))); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcast_vm_i64_advsimd_sleef(int64_t i) { + return vreinterpretq_u32_u64(vdupq_n_u64((uint64_t)i)); +} +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcast_vm_u64_advsimd_sleef(uint64_t i) { + return vreinterpretq_u32_u64(vdupq_n_u64(i)); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef veq64_vo_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vreinterpretq_u32_u64(vceqq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vadd64_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vreinterpretq_u32_s64(vaddq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vsel_vi_vo_vi_vi_advsimd_sleef(vopmask_advsimd_sleef m, vint_advsimd_sleef x, vint_advsimd_sleef y) { + return vbsl_s32(vget_low_u32(m), x, y); +} + +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vand_vi_vo_vi_advsimd_sleef(vopmask_advsimd_sleef x, vint_advsimd_sleef y) { + return vand_s32(vreinterpret_s32_u32(vget_low_u32(x)), y); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcastu_vm_vi_advsimd_sleef(vint_advsimd_sleef vi) { + return vrev64q_u32(vreinterpretq_u32_u64(vmovl_u32(vreinterpret_u32_s32(vi)))); +} +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vcastu_vi_vm_advsimd_sleef(vmask_advsimd_sleef vi2) { + return vreinterpret_s32_u32(vmovn_u64(vreinterpretq_u64_u32(vrev64q_u32(vi2)))); +} +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vtruncate_vd_vd_advsimd_sleef(vdouble_advsimd_sleef vd_advsimd_sleef) { return vrndq_f64(vd_advsimd_sleef); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vposneg_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { return vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(((vdouble_advsimd_sleef) { +0.0, -0.0 })))); } +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vnegpos_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { return vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(((vdouble_advsimd_sleef) { -0.0, +0.0 })))); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vposneg_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { return (vfloat_advsimd_sleef)vxor_vm_vm_vm_advsimd_sleef((vmask_advsimd_sleef)d, (vmask_advsimd_sleef)((vfloat_advsimd_sleef) { +0.0f, -0.0f, +0.0f, -0.0f })); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vnegpos_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { return (vfloat_advsimd_sleef)vxor_vm_vm_vm_advsimd_sleef((vmask_advsimd_sleef)d, (vmask_advsimd_sleef)((vfloat_advsimd_sleef) { -0.0f, +0.0f, -0.0f, +0.0f })); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vsubadd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { return vadd_vd_vd_vd_advsimd_sleef(x, vnegpos_vd_vd_advsimd_sleef(y)); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vsubadd_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d0, vfloat_advsimd_sleef d1) { return vadd_vf_vf_vf_advsimd_sleef(d0, vnegpos_vf_vf_advsimd_sleef(d1)); } +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vmlsubadd_vd_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { return vsubadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, y), z); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vmlsubadd_vf_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { return vsubadd_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x, y), z); } + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vrev21_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d0) { return (float64x2_t)vcombine_u64(vget_high_u64((uint64x2_t)d0), vget_low_u64((uint64x2_t)d0)); } +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vreva2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef vd_advsimd_sleef) { return vd_advsimd_sleef; } + +static SLEEF_ALWAYS_INLINE void vstream_v_p_vd_advsimd_sleef(double *ptr, vdouble_advsimd_sleef v) { vstore_v_p_vd_advsimd_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vd_advsimd_sleef(double *ptr, int offset, int step, vdouble_advsimd_sleef v) { vstore_v_p_vd_advsimd_sleef((double *)(&ptr[2*offset]), v); } +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vd_advsimd_sleef(double *ptr, int offset, int step, vdouble_advsimd_sleef v) { vstore_v_p_vd_advsimd_sleef((double *)(&ptr[2*offset]), v); } + +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vrev21_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d0) { return vrev64q_f32(d0); } +static SLEEF_ALWAYS_INLINE vfloat_advsimd_sleef vreva2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d0) { return vcombine_f32(vget_high_f32(d0), vget_low_f32(d0)); } + +static SLEEF_ALWAYS_INLINE void vstream_v_p_vf_advsimd_sleef(float *ptr, vfloat_advsimd_sleef v) { vstore_v_p_vf_advsimd_sleef(ptr, v); } + +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vf_advsimd_sleef(float *ptr, int offset, int step, vfloat_advsimd_sleef v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} + +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vf_advsimd_sleef(float *ptr, int offset, int step, vfloat_advsimd_sleef v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} + +static vquad_advsimd_sleef loadu_vq_p_advsimd_sleef(void *p) { + vquad_advsimd_sleef vq; + memcpy(&vq, p, (1 << 1) * 16); + return vq; +} + +static SLEEF_ALWAYS_INLINE vquad_advsimd_sleef cast_vq_aq_advsimd_sleef(vargquad_advsimd_sleef aq) { + vquad_advsimd_sleef vq; + memcpy(&vq, &aq, (1 << 1) * 16); + return vq; +} + +static SLEEF_ALWAYS_INLINE vargquad_advsimd_sleef cast_aq_vq_advsimd_sleef(vquad_advsimd_sleef vq) { + vargquad_advsimd_sleef aq; + memcpy(&aq, &vq, (1 << 1) * 16); + return aq; +} + +static SLEEF_ALWAYS_INLINE int vtestallzeros_i_vo64_advsimd_sleef(vopmask_advsimd_sleef g) { + uint32x2_t x0 = vorr_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmax_u32(x0, x0); + return ~vget_lane_u32(x1, 0); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vsel_vm_vo64_vm_vm_advsimd_sleef(vopmask_advsimd_sleef m, vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return vbslq_u32(m, x, y); } + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vsub64_vm_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vreinterpretq_u32_s64(vsubq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vneg64_vm_vm_advsimd_sleef(vmask_advsimd_sleef x) { + return vreinterpretq_u32_s64(vnegq_s64(vreinterpretq_s64_u32(x))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vgt64_vo_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + return vreinterpretq_u32_u64(vcgtq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vcast_vm_vi_advsimd_sleef(vint_advsimd_sleef vi) { + vmask_advsimd_sleef m = vreinterpretq_u32_u64(vmovl_u32(vreinterpret_u32_s32(vi))); + return vor_vm_vm_vm_advsimd_sleef(vcastu_vm_vi_advsimd_sleef(vreinterpret_s32_u32(vget_low_u32(vgt_vo_vi_vi_advsimd_sleef(vcast_vi_i_advsimd_sleef(0), vi)))), m); +} +static SLEEF_ALWAYS_INLINE vint_advsimd_sleef vcast_vi_vm_advsimd_sleef(vmask_advsimd_sleef vm) { return vreinterpret_s32_u32(vmovn_u64(vreinterpretq_u64_u32(vm))); } + +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vreinterpret_vm_vi64_advsimd_sleef(vint64_advsimd_sleef v) { return vreinterpretq_u32_s64(v); } +static SLEEF_ALWAYS_INLINE vint64_advsimd_sleef vreinterpret_vi64_vm_advsimd_sleef(vmask_advsimd_sleef m) { return vreinterpretq_s64_u32(m); } +static SLEEF_ALWAYS_INLINE vmask_advsimd_sleef vreinterpret_vm_vu64_advsimd_sleef(vuint64_advsimd_sleef v) { return vreinterpretq_u32_u64(v); } +static SLEEF_ALWAYS_INLINE vuint64_advsimd_sleef vreinterpret_vu64_vm_advsimd_sleef(vmask_advsimd_sleef m) { return vreinterpretq_u64_u32(m); } + +typedef struct { + vdouble_advsimd_sleef x, y; +} vdouble2_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vd2getx_vd_vd2_advsimd_sleef(vdouble2_advsimd_sleef v) { return v.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vd2gety_vd_vd2_advsimd_sleef(vdouble2_advsimd_sleef v) { return v.y; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vd2setxy_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { vdouble2_advsimd_sleef v; v.x = x; v.y = y; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vd2setx_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef v, vdouble_advsimd_sleef d) { v.x = d; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vd2sety_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef v, vdouble_advsimd_sleef d) { v.y = d; return v; } + +typedef struct { + double x, y; +} double2_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST double2_advsimd_sleef dd_advsimd_sleef(double h, double l) { + double2_advsimd_sleef ret = { h, l }; + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vupper_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vreinterpret_vd_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vcast_vm_i_i_advsimd_sleef(0xffffffff, 0xf8000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vcast_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef h, vdouble_advsimd_sleef l) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vcast_vd2_d_d_advsimd_sleef(double h, double l) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(h), vcast_vd_d_advsimd_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vcast_vd2_d2_advsimd_sleef(double2_advsimd_sleef dd_advsimd_sleef) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(dd_advsimd_sleef.x), vcast_vd_d_advsimd_sleef(dd_advsimd_sleef.y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vsel_vd2_vo_vd2_vd2_advsimd_sleef(vopmask_advsimd_sleef m, vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(m, vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)), + vsel_vd_vo_vd_vd_advsimd_sleef(m, vd2gety_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef vsel_vd2_vo_d_d_d_d_advsimd_sleef(vopmask_advsimd_sleef o, double x1, double y1, double x0, double y0) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_d_d_advsimd_sleef(o, x1, x0), + vsel_vd_vo_d_d_advsimd_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vadd_vd_3vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2) { + return vadd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vadd_vd_4vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3) { + return vadd_vd_3vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vadd_vd_5vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3, vdouble_advsimd_sleef v4) { + return vadd_vd_4vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vadd_vd_6vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3, vdouble_advsimd_sleef v4, vdouble_advsimd_sleef v5) { + return vadd_vd_5vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vadd_vd_7vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3, vdouble_advsimd_sleef v4, vdouble_advsimd_sleef v5, vdouble_advsimd_sleef v6) { + return vadd_vd_6vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsub_vd_3vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2) { + return vsub_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsub_vd_4vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3) { + return vsub_vd_3vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsub_vd_5vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3, vdouble_advsimd_sleef v4) { + return vsub_vd_4vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsub_vd_6vd_advsimd_sleef(vdouble_advsimd_sleef v0, vdouble_advsimd_sleef v1, vdouble_advsimd_sleef v2, vdouble_advsimd_sleef v3, vdouble_advsimd_sleef v4, vdouble_advsimd_sleef v5) { + return vsub_vd_5vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddneg_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x) { + return vcast_vd2_vd_vd_advsimd_sleef(vneg_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)), vneg_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddabs_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x) { + return vcast_vd2_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)), + vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x)), + vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)), + vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddnormalize_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef t) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), vd2gety_vd_vd2_advsimd_sleef(t)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), s), vd2gety_vd_vd2_advsimd_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddscale_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef d, vdouble_advsimd_sleef s) { + return vd2setxy_vd2_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), s), vmul_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddscale_vd2_vd2_d_advsimd_sleef(vdouble2_advsimd_sleef d, double s) { return ddscale_vd2_vd2_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(s)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(x, y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd2_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(x, y); + vdouble_advsimd_sleef v = vsub_vd_vd_vd_advsimd_sleef(s, x); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, vsub_vd_vd_vd_advsimd_sleef(s, v)), vsub_vd_vd_vd_advsimd_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_3vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), s), y, vd2gety_vd_vd2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsub_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), s), y), vd2gety_vd_vd2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd2_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), y); + vdouble_advsimd_sleef v = vsub_vd_vd_vd_advsimd_sleef(s, vd2getx_vd_vd2_advsimd_sleef(x)); + vdouble_advsimd_sleef w = vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vsub_vd_vd_vd_advsimd_sleef(s, v)), vsub_vd_vd_vd_advsimd_sleef(y, v)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(w, vd2gety_vd_vd2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd_vd2_vd_vd2_advsimd_sleef(vdouble_advsimd_sleef x, vdouble2_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(x, vd2getx_vd_vd2_advsimd_sleef(y)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_3vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, s), vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd2_vd2_vd_vd2_advsimd_sleef(vdouble_advsimd_sleef x, vdouble2_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(x, vd2getx_vd_vd2_advsimd_sleef(y)); + vdouble_advsimd_sleef v = vsub_vd_vd_vd_advsimd_sleef(s, x); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, vsub_vd_vd_vd_advsimd_sleef(s, v)), + vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), v)), vd2gety_vd_vd2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_4vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), s), vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddadd2_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + vdouble_advsimd_sleef s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)); + vdouble_advsimd_sleef v = vsub_vd_vd_vd_advsimd_sleef(s, vd2getx_vd_vd2_advsimd_sleef(x)); + vdouble_advsimd_sleef t = vadd_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vsub_vd_vd_vd_advsimd_sleef(s, v)), vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), v)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vadd_vd_vd_vd_advsimd_sleef(t, vadd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsub_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + + vdouble_advsimd_sleef s = vsub_vd_vd_vd_advsimd_sleef(x, y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vsub_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsub_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + + vdouble_advsimd_sleef s = vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)); + vdouble_advsimd_sleef t = vsub_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), s); + t = vsub_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(y)); + t = vadd_vd_vd_vd_advsimd_sleef(t, vd2gety_vd_vd2_advsimd_sleef(x)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vsub_vd_vd_vd_advsimd_sleef(t, vd2gety_vd_vd2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef dddiv_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef n, vdouble2_advsimd_sleef d) { + vdouble_advsimd_sleef t = vrec_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d)); + vdouble_advsimd_sleef s = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(n), t); + vdouble_advsimd_sleef u = vfmapn_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(n), s); + vdouble_advsimd_sleef v = vfmanp_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(d), t, vfmanp_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), t, vcast_vd_d_advsimd_sleef(1))); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vfma_vd_vd_vd_vd_advsimd_sleef(s, v, vfma_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddmul_vd2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vmul_vd_vd_vd_advsimd_sleef(x, y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vfmapn_vd_vd_vd_vd_advsimd_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsqu_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x) { + vdouble_advsimd_sleef s = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vfma_vd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)), vd2gety_vd_vd2_advsimd_sleef(x), vfmapn_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddmul_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + vdouble_advsimd_sleef s = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vfma_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(y), vfma_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y), vfmapn_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef ddmul_vd_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y) { + return vfma_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y), vfma_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y), vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef ddsqu_vd_vd2_advsimd_sleef(vdouble2_advsimd_sleef x) { + return vfma_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x), vadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)), vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddmul_vd2_vd2_vd_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef s = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), y); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vfma_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x), y, vfmapn_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddrec_vd2_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef s = vrec_vd_vd_advsimd_sleef(d); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(s, vfmanp_vd_vd_vd_vd_advsimd_sleef(d, s, vcast_vd_d_advsimd_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddrec_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef d) { + vdouble_advsimd_sleef s = vrec_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d)); + return vd2setxy_vd2_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(s, vfmanp_vd_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(d), s, vfmanp_vd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), s, vcast_vd_d_advsimd_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsqrt_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef d) { + vdouble_advsimd_sleef t = vsqrt_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d))); + return ddscale_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd2_advsimd_sleef(d, ddmul_vd2_vd_vd_advsimd_sleef(t, t)), ddrec_vd2_vd_advsimd_sleef(t)), vcast_vd_d_advsimd_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddsqrt_vd2_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef t = vsqrt_vd_vd_advsimd_sleef(d); + return ddscale_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd2_advsimd_sleef(d, ddmul_vd2_vd_vd_advsimd_sleef(t, t)), ddrec_vd2_vd_advsimd_sleef(t)), vcast_vd_d_advsimd_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddmla_vd2_vd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef x, vdouble2_advsimd_sleef y, vdouble2_advsimd_sleef z) { + return ddadd_vd2_vd2_vd2_advsimd_sleef(z, ddmul_vd2_vd2_vd2_advsimd_sleef(x, y)); +} + +typedef struct { + vdouble_advsimd_sleef x, y, z; +} vdouble3_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vd3getx_vd_vd3_advsimd_sleef(vdouble3_advsimd_sleef v) { return v.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vd3gety_vd_vd3_advsimd_sleef(vdouble3_advsimd_sleef v) { return v.y; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vd3getz_vd_vd3_advsimd_sleef(vdouble3_advsimd_sleef v) { return v.z; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef vd3setxyz_vd3_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + vdouble3_advsimd_sleef v = { x, y, z }; + return v; +} +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef vd3setx_vd3_vd3_vd_advsimd_sleef(vdouble3_advsimd_sleef v, vdouble_advsimd_sleef d) { v.x = d; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef vd3sety_vd3_vd3_vd_advsimd_sleef(vdouble3_advsimd_sleef v, vdouble_advsimd_sleef d) { v.y = d; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef vd3setz_vd3_vd3_vd_advsimd_sleef(vdouble3_advsimd_sleef v, vdouble_advsimd_sleef d) { v.z = d; return v; } + +typedef struct { + vdouble2_advsimd_sleef a, b; +} dd2_advsimd_sleef; + +static dd2_advsimd_sleef dd2setab_dd2_vd2_vd2_advsimd_sleef(vdouble2_advsimd_sleef a, vdouble2_advsimd_sleef b) { + dd2_advsimd_sleef r = { a, b }; + return r; +} +static vdouble2_advsimd_sleef dd2geta_vd2_dd2_advsimd_sleef(dd2_advsimd_sleef d) { return d.a; } +static vdouble2_advsimd_sleef dd2getb_vd2_dd2_advsimd_sleef(dd2_advsimd_sleef d) { return d.b; } + +typedef struct { + vmask_advsimd_sleef e; + vdouble3_advsimd_sleef d3; +} tdx_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef tdxgete_vm_tdx_advsimd_sleef(tdx_advsimd_sleef t) { return t.e; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef tdxgetd3_vd3_tdx_advsimd_sleef(tdx_advsimd_sleef t) { return t.d3; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef tdxgetd3x_vd_tdx_advsimd_sleef(tdx_advsimd_sleef t) { return t.d3.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef tdxgetd3y_vd_tdx_advsimd_sleef(tdx_advsimd_sleef t) { return t.d3.y; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef tdxgetd3z_vd_tdx_advsimd_sleef(tdx_advsimd_sleef t) { return t.d3.z; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsete_tdx_tdx_vm_advsimd_sleef(tdx_advsimd_sleef t, vmask_advsimd_sleef e) { t.e = e; return t; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsetd3_tdx_tdx_vd3_advsimd_sleef(tdx_advsimd_sleef t, vdouble3_advsimd_sleef d3) { t.d3 = d3; return t; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsetx_tdx_tdx_vd_advsimd_sleef(tdx_advsimd_sleef t, vdouble_advsimd_sleef x) { t.d3.x = x; return t; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsety_tdx_tdx_vd_advsimd_sleef(tdx_advsimd_sleef t, vdouble_advsimd_sleef y) { t.d3.y = y; return t; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsetz_tdx_tdx_vd_advsimd_sleef(tdx_advsimd_sleef t, vdouble_advsimd_sleef z) { t.d3.z = z; return t; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsetxyz_tdx_tdx_vd_vd_vd_advsimd_sleef(tdx_advsimd_sleef t, vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + t.d3 = (vdouble3_advsimd_sleef) { x, y, z }; + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxseted3_tdx_vm_vd3_advsimd_sleef(vmask_advsimd_sleef e, vdouble3_advsimd_sleef d3) { return (tdx_advsimd_sleef) { e, d3 }; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdx_advsimd_sleef tdxsetexyz_tdx_vm_vd_vd_vd_advsimd_sleef(vmask_advsimd_sleef e, vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + return (tdx_advsimd_sleef) { e, (vdouble3_advsimd_sleef) { x, y, z } }; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vqgetx_vm_vq_advsimd_sleef(vquad_advsimd_sleef v) { return v.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vqgety_vm_vq_advsimd_sleef(vquad_advsimd_sleef v) { return v.y; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef vqsetxy_vq_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return (vquad_advsimd_sleef) { x, y }; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef vqsetx_vq_vq_vm_advsimd_sleef(vquad_advsimd_sleef v, vmask_advsimd_sleef x) { v.x = x; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef vqsety_vq_vq_vm_advsimd_sleef(vquad_advsimd_sleef v, vmask_advsimd_sleef y) { v.y = y; return v; } + +typedef struct { + vdouble_advsimd_sleef d; + vint_advsimd_sleef i; +} di_t_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef digetd_vd_di_advsimd_sleef(di_t_advsimd_sleef d) { return d.d; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef digeti_vi_di_advsimd_sleef(di_t_advsimd_sleef d) { return d.i; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST di_t_advsimd_sleef disetdi_di_vd_vi_advsimd_sleef(vdouble_advsimd_sleef d, vint_advsimd_sleef i) { + di_t_advsimd_sleef r = { d, i }; + return r; +} + +typedef struct { + vdouble2_advsimd_sleef dd_advsimd_sleef; + vint_advsimd_sleef i; +} ddi_t_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddigetdd_vd2_ddi_advsimd_sleef(ddi_t_advsimd_sleef d) { return d.dd_advsimd_sleef; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef ddigeti_vi_ddi_advsimd_sleef(ddi_t_advsimd_sleef d) { return d.i; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST ddi_t_advsimd_sleef ddisetddi_ddi_vd2_vi_advsimd_sleef(vdouble2_advsimd_sleef v, vint_advsimd_sleef i) { + ddi_t_advsimd_sleef r = { v, i }; + return r; +} +static SLEEF_ALWAYS_INLINE SLEEF_CONST ddi_t_advsimd_sleef ddisetdd_ddi_ddi_vd2_advsimd_sleef(ddi_t_advsimd_sleef ddi_advsimd_sleef, vdouble2_advsimd_sleef v) { + ddi_advsimd_sleef.dd_advsimd_sleef = v; + return ddi_advsimd_sleef; +} + +typedef struct { + vdouble3_advsimd_sleef td_advsimd_sleef; + vint_advsimd_sleef i; +} tdi_t_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble3_advsimd_sleef tdigettd_vd3_tdi_advsimd_sleef(tdi_t_advsimd_sleef d) { return d.td_advsimd_sleef; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef tdigetx_vd_tdi_advsimd_sleef(tdi_t_advsimd_sleef d) { return d.td_advsimd_sleef.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef tdigeti_vi_tdi_advsimd_sleef(tdi_t_advsimd_sleef d) { return d.i; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST tdi_t_advsimd_sleef tdisettdi_tdi_vd3_vi_advsimd_sleef(vdouble3_advsimd_sleef v, vint_advsimd_sleef i) { + tdi_t_advsimd_sleef r = { v, i }; + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visnegzero_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return veq64_vo_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visnumber_vo_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + return vandnot_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), veq_vo_vd_vd_advsimd_sleef(x, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visnonfinite_vo_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + return veq64_vo_vm_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(x), vcast_vm_i64_advsimd_sleef(INT64_C(0x7ff0000000000000))), vcast_vm_i64_advsimd_sleef(INT64_C(0x7ff0000000000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vsignbit_vm_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef vsignbit_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return veq64_vo_vm_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vclearlsb_vd_vd_i_advsimd_sleef(vdouble_advsimd_sleef d, int n) { + return vreinterpret_vd_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vcast_vm_u64_advsimd_sleef((~UINT64_C(0)) << n))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vtoward0_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef t = vreinterpret_vd_vm_advsimd_sleef(vadd64_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(x), vcast_vm_i64_advsimd_sleef(-1))); + return vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vmulsign_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(x), vsignbit_vm_vd_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vsign_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1.0), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vorsign_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpret_vd_vm_advsimd_sleef(vor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(x), vsignbit_vm_vd_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vcopysign_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + return vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vandnot_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0)), vreinterpret_vm_vd_advsimd_sleef(x)), + vand_vm_vm_vm_advsimd_sleef (vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0)), vreinterpret_vm_vd_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vtruncate2_vd_vd_advsimd_sleef_advsimd_sleef(vdouble_advsimd_sleef x) { + + return vtruncate_vd_vd_advsimd_sleef(x); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vfloor2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef fr = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(INT64_C(1) << 31), vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_advsimd_sleef(fr, vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(fr))); + fr = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(0)), vadd_vd_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(1.0)), fr); + return vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), vge_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vceil2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef fr = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(INT64_C(1) << 31), vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_advsimd_sleef(fr, vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(fr))); + fr = vsel_vd_vo_vd_vd_advsimd_sleef(vle_vo_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(0)), fr, vsub_vd_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(1.0))); + return vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), vge_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vround2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef x = vadd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.5)); + vdouble_advsimd_sleef fr = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(INT64_C(1) << 31), vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_advsimd_sleef(fr, vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(fr))); + x = vsel_vd_vo_vd_vd_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vle_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), veq_vo_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(0))), vsub_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0)), x); + fr = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(0)), vadd_vd_vd_vd_advsimd_sleef(fr, vcast_vd_d_advsimd_sleef(1.0)), fr); + x = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.49999999999999994449)), vcast_vd_d_advsimd_sleef(0), x); + return vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vge_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(INT64_C(1) << 52))), d, vcopysign_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, fr), d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vrint2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + + return vrint_vd_vd_advsimd_sleef(d); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visint_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + return veq_vo_vd_vd_advsimd_sleef(vrint2_vd_vd_advsimd_sleef(d), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visodd_vo_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef x = vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.5)); + return vneq_vo_vd_vd_advsimd_sleef(vrint2_vd_vd_advsimd_sleef(x), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef vilogbk_vi_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2.037035976334486E90), d), d); + vint_advsimd_sleef q = vcastu_vi_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d)); + q = vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef((int)(((1U << 12) - 1) << 20))); + q = vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 20)); + q = vsub_vi_vi_vi_advsimd_sleef(q, vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vcast_vi_i_advsimd_sleef(300 + 0x3ff), vcast_vi_i_advsimd_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef vilogb2k_vi_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vint_advsimd_sleef q = vcastu_vi_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d)); + q = vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 20)); + q = vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(0x7ff)); + q = vsub_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(0x3ff)); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vilogb2k_vm_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vmask_advsimd_sleef m = vreinterpret_vm_vd_advsimd_sleef(d); + m = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(m), 20 + 32)); + m = vand_vm_vm_vm_advsimd_sleef(m, vcast_vm_i64_advsimd_sleef(0x7ff)); + m = vsub64_vm_vm_vm_advsimd_sleef(m, vcast_vm_i64_advsimd_sleef(0x3ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vilogb3k_vm_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vmask_advsimd_sleef m = vreinterpret_vm_vd_advsimd_sleef(d); + m = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(m), 20 + 32)); + m = vand_vm_vm_vm_advsimd_sleef(m, vcast_vm_i64_advsimd_sleef(0x7ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vpow2i_vd_vi_advsimd_sleef(vint_advsimd_sleef q) { + q = vadd_vi_vi_vi_advsimd_sleef(vcast_vi_i_advsimd_sleef(0x3ff), q); + vmask_advsimd_sleef r = vcastu_vm_vi_advsimd_sleef(vshl_n_s32(q, 20)); + return vreinterpret_vd_vm_advsimd_sleef(r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vpow2i_vd_vm_advsimd_sleef(vmask_advsimd_sleef q) { + q = vadd64_vm_vm_vm_advsimd_sleef(vcast_vm_i64_advsimd_sleef(0x3ff), q); + return vreinterpret_vd_vm_advsimd_sleef(vreinterpretq_u32_u64(vshlq_n_u64(vreinterpretq_u64_u32(q), 52))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp_vd_vd_vi_advsimd_sleef(vdouble_advsimd_sleef x, vint_advsimd_sleef q) { + vint_advsimd_sleef m = vshr_n_s32(q, 31); + m = vshl_n_s32(vsub_vi_vi_vi_advsimd_sleef(vshr_n_s32(vadd_vi_vi_vi_advsimd_sleef(m, q), 9), m), 7); + q = vsub_vi_vi_vi_advsimd_sleef(q, vshl_n_s32(m, 2)); + m = vadd_vi_vi_vi_advsimd_sleef(vcast_vi_i_advsimd_sleef(0x3ff), m); + m = vandnot_vi_vo_vi_advsimd_sleef(vgt_vo_vi_vi_advsimd_sleef(vcast_vi_i_advsimd_sleef(0), m), m); + m = vsel_vi_vo_vi_vi_advsimd_sleef(vgt_vo_vi_vi_advsimd_sleef(m, vcast_vi_i_advsimd_sleef(0x7ff)), vcast_vi_i_advsimd_sleef(0x7ff), m); + vmask_advsimd_sleef r = vcastu_vm_vi_advsimd_sleef(vshl_n_s32(m, 20)); + vdouble_advsimd_sleef y = vreinterpret_vd_vm_advsimd_sleef(r); + return vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, y), y), y), y), vpow2i_vd_vi_advsimd_sleef(q)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp2_vd_vd_vi_advsimd_sleef(vdouble_advsimd_sleef d, vint_advsimd_sleef e) { + return vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vi_advsimd_sleef(vshr_n_s32(e, 1))), vpow2i_vd_vi_advsimd_sleef(vsub_vi_vi_vi_advsimd_sleef(e, vshr_n_s32(e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp3_vd_vd_vi_advsimd_sleef(vdouble_advsimd_sleef d, vint_advsimd_sleef q) { + return vreinterpret_vd_vm_advsimd_sleef(vadd64_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vcastu_vm_vi_advsimd_sleef(vshl_n_s32(q, 20)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp1_vd_vd_vm_advsimd_sleef(vdouble_advsimd_sleef d, vmask_advsimd_sleef e) { + vmask_advsimd_sleef m = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(e), 2)); + e = vsub64_vm_vm_vm_advsimd_sleef(vsub64_vm_vm_vm_advsimd_sleef(vsub64_vm_vm_vm_advsimd_sleef(e, m), m), m); + d = vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vm_advsimd_sleef(m)); + d = vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vm_advsimd_sleef(m)); + d = vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vm_advsimd_sleef(m)); + d = vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vm_advsimd_sleef(e)); + return d; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp2_vd_vd_vm_advsimd_sleef(vdouble_advsimd_sleef d, vmask_advsimd_sleef e) { + return vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vpow2i_vd_vm_advsimd_sleef(vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(e), 1)))), vpow2i_vd_vm_advsimd_sleef(vsub64_vm_vm_vm_advsimd_sleef(e, vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(e), 1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vldexp3_vd_vd_vm_advsimd_sleef(vdouble_advsimd_sleef d, vmask_advsimd_sleef q) { + return vreinterpret_vd_vm_advsimd_sleef(vadd64_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpretq_u32_u64(vshlq_n_u64(vreinterpretq_u64_u32(q), 52)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vcast_vd_vm_advsimd_sleef(vmask_advsimd_sleef m) { return vcast_vd_vi_advsimd_sleef(vcast_vi_vm_advsimd_sleef(m)); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vtruncate_vm_vd_advsimd_sleef(vdouble_advsimd_sleef d) { return vcast_vm_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(d)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef vlt64_vo_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { return vgt64_vo_vm_vm_advsimd_sleef(y, x); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef vnot_vo64_vo64_advsimd_sleef(vopmask_advsimd_sleef x) { + return vxor_vo_vo_vo_advsimd_sleef(x, veq64_vo_vm_vm_advsimd_sleef(vcast_vm_i64_advsimd_sleef(0), vcast_vm_i64_advsimd_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef vugt64_vo_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { + x = vxor_vm_vm_vm_advsimd_sleef(vcast_vm_u64_advsimd_sleef(UINT64_C(0x8000000000000000)), x); + y = vxor_vm_vm_vm_advsimd_sleef(vcast_vm_u64_advsimd_sleef(UINT64_C(0x8000000000000000)), y); + return vgt64_vo_vm_vm_advsimd_sleef(x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vilogbk_vm_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2.037035976334486E90), d), d); + vmask_advsimd_sleef q = vreinterpret_vm_vd_advsimd_sleef(d); + q = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(q), 20 + 32)); + q = vand_vm_vm_vm_advsimd_sleef(q, vcast_vm_i64_advsimd_sleef(0x7ff)); + q = vsub64_vm_vm_vm_advsimd_sleef(q, vsel_vm_vo64_vm_vm_advsimd_sleef(o, vcast_vm_i64_advsimd_sleef(300 + 0x3ff), vcast_vm_i64_advsimd_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef sel_vq_vo_vq_vq_advsimd_sleef(vopmask_advsimd_sleef o, vquad_advsimd_sleef x, vquad_advsimd_sleef y) { + return vqsetxy_vq_vm_vm_advsimd_sleef(vsel_vm_vo64_vm_vm_advsimd_sleef(o, vqgetx_vm_vq_advsimd_sleef(x), vqgetx_vm_vq_advsimd_sleef(y)), vsel_vm_vo64_vm_vm_advsimd_sleef(o, vqgety_vm_vq_advsimd_sleef(x), vqgety_vm_vq_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef add128_vq_vq_vq_advsimd_sleef(vquad_advsimd_sleef x, vquad_advsimd_sleef y) { + vquad_advsimd_sleef r = vqsetxy_vq_vm_vm_advsimd_sleef(vadd64_vm_vm_vm_advsimd_sleef(vqgetx_vm_vq_advsimd_sleef(x), vqgetx_vm_vq_advsimd_sleef(y)), vadd64_vm_vm_vm_advsimd_sleef(vqgety_vm_vq_advsimd_sleef(x), vqgety_vm_vq_advsimd_sleef(y))); + r = vqsety_vq_vq_vm_advsimd_sleef(r, vadd64_vm_vm_vm_advsimd_sleef(vqgety_vm_vq_advsimd_sleef(r), vand_vm_vo64_vm_advsimd_sleef(vugt64_vo_vm_vm_advsimd_sleef(vqgetx_vm_vq_advsimd_sleef(x), vqgetx_vm_vq_advsimd_sleef(r)), vcast_vm_i64_advsimd_sleef(1)))); + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_advsimd_sleef imdvq_vq_vm_vm_advsimd_sleef(vmask_advsimd_sleef x, vmask_advsimd_sleef y) { vquad_advsimd_sleef r = vqsetxy_vq_vm_vm_advsimd_sleef(x, y); return r; } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST di_t_advsimd_sleef rempisub_advsimd_sleef(vdouble_advsimd_sleef x) { + + vdouble_advsimd_sleef y = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(4))); + vint_advsimd_sleef vi = vtruncate_vi_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(y, vmul_vd_vd_vd_advsimd_sleef(vrint_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(4)))); + return disetdi_di_vd_vi_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0.25))), vi); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef vsel_vi_vd_vd_vi_vi_advsimd_sleef(vdouble_advsimd_sleef d0, vdouble_advsimd_sleef d1, vint_advsimd_sleef x, vint_advsimd_sleef y) { return vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d0, d1)), x, y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_advsimd_sleef vsel_vi_vd_vi_advsimd_sleef(vdouble_advsimd_sleef d, vint_advsimd_sleef x) { return vand_vi_vo_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(d)), x); } + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_ldexpd2_advsimd(vdouble_advsimd_sleef x, vint_advsimd_sleef q) { return vldexp_vd_vd_vi_advsimd_sleef(x, q); } + +SLEEF_INLINE SLEEF_CONST vint_advsimd_sleef Sleef_ilogbd2_advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef e = vcast_vd_vi_advsimd_sleef(vilogbk_vi_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d))); + e = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vd_vo_vd_vd_advsimd_sleef(visnan_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(2147483647), e); + return vrint_vi_vd_advsimd_sleef(e); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST ddi_t_advsimd_sleef rempi_advsimd_sleef(vdouble_advsimd_sleef a) { + vdouble2_advsimd_sleef x, y; + vint_advsimd_sleef ex = vilogb2k_vi_vd_advsimd_sleef(a); + + ex = vsub_vi_vi_vi_advsimd_sleef(ex, vcast_vi_i_advsimd_sleef(55)); + vint_advsimd_sleef q = vand_vi_vo_vi_advsimd_sleef(vgt_vo_vi_vi_advsimd_sleef(ex, vcast_vi_i_advsimd_sleef(700-55)), vcast_vi_i_advsimd_sleef(-64)); + a = vldexp3_vd_vd_vi_advsimd_sleef(a, q); + ex = vandnot_vi_vi_vi_advsimd_sleef(vshr_n_s32(ex, 31), ex); + ex = vshl_n_s32(ex, 2); + x = ddmul_vd2_vd_vd_advsimd_sleef(a, vgather_vd_p_vi_advsimd_sleef(Sleef_rempitabdp, ex)); + di_t_advsimd_sleef di = rempisub_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)); + q = digeti_vi_di_advsimd_sleef(di); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, digetd_vd_di_advsimd_sleef(di)); + x = ddnormalize_vd2_vd2_advsimd_sleef(x); + y = ddmul_vd2_vd_vd_advsimd_sleef(a, vgather_vd_p_vi_advsimd_sleef(Sleef_rempitabdp+1, ex)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(x, y); + di = rempisub_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)); + q = vadd_vi_vi_vi_advsimd_sleef(q, digeti_vi_di_advsimd_sleef(di)); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, digetd_vd_di_advsimd_sleef(di)); + x = ddnormalize_vd2_vd2_advsimd_sleef(x); + y = vcast_vd2_vd_vd_advsimd_sleef(vgather_vd_p_vi_advsimd_sleef(Sleef_rempitabdp+2, ex), vgather_vd_p_vi_advsimd_sleef(Sleef_rempitabdp+3, ex)); + y = ddmul_vd2_vd2_vd_advsimd_sleef(y, a); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(x, y); + x = ddnormalize_vd2_vd2_advsimd_sleef(x); + x = ddmul_vd2_vd2_vd2_advsimd_sleef(x, vcast_vd2_d_d_advsimd_sleef(3.141592653589793116*2, 1.2246467991473532072e-16*2)); + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(a), vcast_vd_d_advsimd_sleef(0.7)); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, vsel_vd_vo_vd_vd_advsimd_sleef(o, a, vd2getx_vd_vd2_advsimd_sleef(x))); + x = vd2sety_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x))))); + return ddisetddi_ddi_vd2_vi_advsimd_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sind2_u35advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u, s, r = d; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmlapn_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_advsimd_sleef(dql); + + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24), d); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(3)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0))), vcast_vi_i_advsimd_sleef(2), vcast_vi_i_advsimd_sleef(1))); + ql = vshr_n_s32(ql, 2); + vopmask_advsimd_sleef o = veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1)); + vdouble2_advsimd_sleef x = vcast_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)))); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef), x); + ddi_advsimd_sleef = ddisetdd_ddi_ddi_vd2_advsimd_sleef(ddi_advsimd_sleef, vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(o), x, ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + d = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vd2gety_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + d = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(r), visnan_vo_vd_advsimd_sleef(r)), vreinterpret_vm_vd_advsimd_sleef(d))); + } + + s = vmul_vd_vd_vd_advsimd_sleef(d, d); + + d = vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1))), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(d))); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_advsimd_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_advsimd_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_advsimd_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-0.000198412698412696162806809)), (vcast_vd_d_advsimd_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(u, d)), d); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sind2_u10advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u; + vdouble2_advsimd_sleef s, t, x; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + const vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + u = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116), d); + s = ddadd_vd2_vd_vd_advsimd_sleef (u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + const vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmlapn_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_advsimd_sleef(dql); + + u = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914), d); + s = ddadd_vd2_vd_vd_advsimd_sleef (u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24))); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(3)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0))), vcast_vi_i_advsimd_sleef(2), vcast_vi_i_advsimd_sleef(1))); + ql = vshr_n_s32(ql, 2); + vopmask_advsimd_sleef o = veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1)); + vdouble2_advsimd_sleef x = vcast_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)))); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef), x); + ddi_advsimd_sleef = ddisetdd_ddi_ddi_vd2_advsimd_sleef(ddi_advsimd_sleef, vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(o), x, ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + s = ddnormalize_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)); + s = vd2setx_vd2_vd2_vd_advsimd_sleef(s, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_advsimd_sleef(s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2getx_vd_vd2_advsimd_sleef(s)), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_advsimd_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_advsimd_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_advsimd_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_advsimd_sleef(t, x); + + u = vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1))), + vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(u))); + u = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_cosd2_u35advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u, s, r = d; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vmla_vd_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), + vrint_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724), vcast_vd_d_advsimd_sleef(-0.5))), + vcast_vd_d_advsimd_sleef(1)); + ql = vrint_vi_vd_advsimd_sleef(dql); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_advsimd_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-(1 << 23)), vcast_vd_d_advsimd_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vcast_vi_i_advsimd_sleef(1)); + vdouble_advsimd_sleef dql = vcast_vd_vi_advsimd_sleef(ql); + + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24 * 0.5), d); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(3)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0))), vcast_vi_i_advsimd_sleef(8), vcast_vi_i_advsimd_sleef(7))); + ql = vshr_n_s32(ql, 1); + vopmask_advsimd_sleef o = veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(0)); + vdouble_advsimd_sleef y = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(0), vcast_vd_d_advsimd_sleef(-1)); + vdouble2_advsimd_sleef x = vcast_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef), x); + ddi_advsimd_sleef = ddisetdd_ddi_ddi_vd2_advsimd_sleef(ddi_advsimd_sleef, vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(o), x, ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + d = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vd2gety_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + d = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(r), visnan_vo_vd_advsimd_sleef(r)), vreinterpret_vm_vd_advsimd_sleef(d))); + } + + s = vmul_vd_vd_vd_advsimd_sleef(d, d); + + d = vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(0))), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(d))); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_advsimd_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_advsimd_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_advsimd_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(-0.000198412698412696162806809)), (vcast_vd_d_advsimd_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_cosd2_u10advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u; + vdouble2_advsimd_sleef s, t, x; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724), vcast_vd_d_advsimd_sleef(-0.5))); + dql = vmla_vd_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), dql, vcast_vd_d_advsimd_sleef(1)); + ql = vrint_vi_vd_advsimd_sleef(dql); + s = ddadd2_vd2_vd_vd_advsimd_sleef(d, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116*0.5))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_advsimd_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-(1 << 23)), vcast_vd_d_advsimd_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vcast_vi_i_advsimd_sleef(1)); + const vdouble_advsimd_sleef dql = vcast_vd_vi_advsimd_sleef(ql); + + u = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd2_vd2_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(3)); + ql = vadd_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, ql), vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0))), vcast_vi_i_advsimd_sleef(8), vcast_vi_i_advsimd_sleef(7))); + ql = vshr_n_s32(ql, 1); + vopmask_advsimd_sleef o = veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef), vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(0)); + vdouble_advsimd_sleef y = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(0), vcast_vd_d_advsimd_sleef(-1)); + vdouble2_advsimd_sleef x = vcast_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef), x); + ddi_advsimd_sleef = ddisetdd_ddi_ddi_vd2_advsimd_sleef(ddi_advsimd_sleef, vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(o), x, ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + s = ddnormalize_vd2_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)); + s = vd2setx_vd2_vd2_vd_advsimd_sleef(s, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_advsimd_sleef(s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2getx_vd_vd2_advsimd_sleef(s)), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_advsimd_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_advsimd_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_advsimd_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_advsimd_sleef(t, x); + + u = vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(0))), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; + +} + +SLEEF_INLINE vdouble2_advsimd_sleef Sleef_sincosd2_u35advsimd(vdouble_advsimd_sleef d) { + + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, t, rx, ry, s; + vdouble2_advsimd_sleef r; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), s); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_advsimd_sleef(dql); + + s = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), s); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24 * 0.5), s); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef); + s = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vd2gety_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + s = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)), vreinterpret_vm_vd_advsimd_sleef(s))); + } + + t = s; + + s = vmul_vd_vd_vd_advsimd_sleef(s, s); + + u = vcast_vd_d_advsimd_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.166666666666666130709393)); + + rx = vmla_vd_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(u, s), t, t); + rx = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-0.0), rx); + + u = vcast_vd_d_advsimd_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.5)); + + ry = vmla_vd_vd_vd_vd_advsimd_sleef(s, u, vcast_vd_d_advsimd_sleef(1)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(0))); + r = vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(o, rx, ry), vsel_vd_vo_vd_vd_advsimd_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_advsimd_sleef Sleef_sincosd2_u10advsimd(vdouble_advsimd_sleef d) { + + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, rx, ry; + vdouble2_advsimd_sleef r, s, t, x; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + const vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + u = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_advsimd_sleef (u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + const vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_advsimd_sleef(dql); + + u = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef); + s = ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef); + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)); + s = vd2setxy_vd2_vd_vd_advsimd_sleef(vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s)))), + vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(s))))); + } + + t = s; + + s = vd2setx_vd2_vd2_vd_advsimd_sleef(s, ddsqu_vd_vd2_advsimd_sleef(s)); + + u = vcast_vd_d_advsimd_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-0.166666666666666130709393)); + + u = vmul_vd_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2getx_vd_vd2_advsimd_sleef(t))); + + x = ddadd_vd2_vd2_vd_advsimd_sleef(t, u); + rx = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + rx = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-0.0), rx); + + u = vcast_vd_d_advsimd_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(-0.5)); + + x = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), ddmul_vd2_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), u)); + ry = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(0))); + r = vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(o, rx, ry), vsel_vd_vo_vd_vd_advsimd_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_advsimd_sleef Sleef_sincospid2_u05advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, s, t, rx, ry; + vdouble2_advsimd_sleef r, x, s2; + + u = vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(4.0)); + vint_advsimd_sleef q = vtruncate_vi_vd_advsimd_sleef(u); + q = vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vxor_vi_vi_vi_advsimd_sleef(vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 31)), vcast_vi_i_advsimd_sleef(1))), vcast_vi_i_advsimd_sleef(~1)); + s = vsub_vd_vd_vd_advsimd_sleef(u, vcast_vd_vi_advsimd_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_advsimd_sleef(s, s); + s2 = ddmul_vd2_vd_vd_advsimd_sleef(t, t); + + u = vcast_vd_d_advsimd_sleef(-2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(6.94821830580179461327784e-12)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(3.13361688966868392878422e-07)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-3.6576204182161551920361e-05)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(0.00249039457019271850274356)); + x = ddadd2_vd2_vd_vd2_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(u, s), vcast_vd2_d_d_advsimd_sleef(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s2, x), vcast_vd2_d_d_advsimd_sleef(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd_advsimd_sleef(x, t); + rx = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + rx = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-0.0), rx); + + u = vcast_vd_d_advsimd_sleef(9.94480387626843774090208e-16); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-3.89796226062932799164047e-13)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1.15011582539996035266901e-10)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-2.4611369501044697495359e-08)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(3.59086044859052754005062e-06)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.000325991886927389905997954)); + x = ddadd2_vd2_vd_vd2_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(u, s), vcast_vd2_d_d_advsimd_sleef(0.0158543442438155018914259, -1.04693272280631521908845e-18)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s2, x), vcast_vd2_d_d_advsimd_sleef(-0.308425137534042437259529, -1.95698492133633550338345e-17)); + + x = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(x, s2), vcast_vd_d_advsimd_sleef(1)); + ry = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(0))); + r = vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(o, rx, ry), vsel_vd_vo_vd_vd_advsimd_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + o = vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vsel_vd_vo_vd_vd_advsimd_sleef(o, vcast_vd_d_advsimd_sleef(1), vd2gety_vd_vd2_advsimd_sleef(r))); + + o = visinf_vo_vd_advsimd_sleef(d); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + return r; +} + +SLEEF_INLINE vdouble2_advsimd_sleef Sleef_sincospid2_u35advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, s, t, rx, ry; + vdouble2_advsimd_sleef r; + + u = vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(4.0)); + vint_advsimd_sleef q = vtruncate_vi_vd_advsimd_sleef(u); + q = vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vxor_vi_vi_vi_advsimd_sleef(vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 31)), vcast_vi_i_advsimd_sleef(1))), vcast_vi_i_advsimd_sleef(~1)); + s = vsub_vd_vd_vd_advsimd_sleef(u, vcast_vd_vi_advsimd_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_advsimd_sleef(s, s); + + u = vcast_vd_d_advsimd_sleef(+0.6880638894766060136e-11); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.1757159564542310199e-8)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.3133616327257867311e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.3657620416388486452e-4)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.2490394570189932103e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.8074551218828056320e-1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.7853981633974482790e+0)); + + rx = vmul_vd_vd_vd_advsimd_sleef(u, t); + + u = vcast_vd_d_advsimd_sleef(-0.3860141213683794352e-12); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1150057888029681415e-9)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.2461136493006663553e-7)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.3590860446623516713e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.3259918869269435942e-3)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1585434424381541169e-1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(-0.3084251375340424373e+0)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1)); + + ry = u; + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(0))); + r = vd2setxy_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(o, rx, ry), vsel_vd_vo_vd_vd_advsimd_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + o = vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + o = visinf_vo_vd_advsimd_sleef(d); + r = vd2setx_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r))))); + r = vd2sety_vd2_vd2_vd_advsimd_sleef(r, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble2_advsimd_sleef Sleef_modfd2_advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef fr = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(INT64_C(1) << 31), vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_advsimd_sleef(fr, vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(fr))); + fr = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(INT64_C(1) << 52)), vcast_vd_d_advsimd_sleef(0), fr); + + vdouble2_advsimd_sleef ret; + + ret = vd2setxy_vd2_vd_vd_advsimd_sleef(vcopysign_vd_vd_vd_advsimd_sleef(fr, x), vcopysign_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(x, fr), x)); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef sinpik_advsimd_sleef(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, s, t; + vdouble2_advsimd_sleef x, s2; + + u = vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(4.0)); + vint_advsimd_sleef q = vtruncate_vi_vd_advsimd_sleef(u); + q = vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vxor_vi_vi_vi_advsimd_sleef(vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 31)), vcast_vi_i_advsimd_sleef(1))), vcast_vi_i_advsimd_sleef(~1)); + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))); + + s = vsub_vd_vd_vd_advsimd_sleef(u, vcast_vd_vi_advsimd_sleef(q)); + t = s; + s = vmul_vd_vd_vd_advsimd_sleef(s, s); + s2 = ddmul_vd2_vd_vd_advsimd_sleef(t, t); + + u = vsel_vd_vo_d_d_advsimd_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(u, s), + vsel_vd2_vo_d_d_d_d_advsimd_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_advsimd_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_advsimd_sleef(x, vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, s2, vcast_vd2_vd_vd_advsimd_sleef(t, vcast_vd_d_advsimd_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1)), x); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x))))); + x = vd2sety_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sinpid2_u05advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x = sinpik_advsimd_sleef(d); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-0.0), r); + r = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+9/4)), vreinterpret_vm_vd_advsimd_sleef(r))); + r = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef cospik_advsimd_sleef(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vdouble_advsimd_sleef u, s, t; + vdouble2_advsimd_sleef x, s2; + + u = vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(4.0)); + vint_advsimd_sleef q = vtruncate_vi_vd_advsimd_sleef(u); + q = vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vxor_vi_vi_vi_advsimd_sleef(vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(q), 31)), vcast_vi_i_advsimd_sleef(1))), vcast_vi_i_advsimd_sleef(~1)); + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(0))); + + s = vsub_vd_vd_vd_advsimd_sleef(u, vcast_vd_vi_advsimd_sleef(q)); + t = s; + s = vmul_vd_vd_vd_advsimd_sleef(s, s); + s2 = ddmul_vd2_vd_vd_advsimd_sleef(t, t); + + u = vsel_vd_vo_d_d_advsimd_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vsel_vd_vo_d_d_advsimd_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(u, s), + vsel_vd2_vo_d_d_d_d_advsimd_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_advsimd_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_advsimd_sleef(x, vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, s2, vcast_vd2_vd_vd_advsimd_sleef(t, vcast_vd_d_advsimd_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1)), x); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(4)), vcast_vi_i_advsimd_sleef(4))); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x))))); + x = vd2sety_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_cospid2_u05advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x = cospik_advsimd_sleef(d); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+9/4)), vcast_vd_d_advsimd_sleef(1), r); + r = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(r))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_tand2_u35advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u, s, x, y; + vopmask_advsimd_sleef o; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116 * 0.5), d); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16 * 0.5), x); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+6)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_advsimd_sleef(dql); + + x = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), x); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24 * 0.5), x); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef); + x = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef)), vd2gety_vd_vd2_advsimd_sleef(ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef))); + x = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(x))); + x = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)), vreinterpret_vm_vd_advsimd_sleef(x))); + } + + x = vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0.5)); + s = vmul_vd_vd_vd_advsimd_sleef(x, x); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_advsimd_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_advsimd_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_advsimd_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_advsimd_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.3333333333333343695e+0)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(u, x), x); + + y = vmla_vd_vd_vd_vd_advsimd_sleef(u, u, vcast_vd_d_advsimd_sleef(-1)); + x = vmul_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-2)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1))); + u = vdiv_vd_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(o, vneg_vd_vd_advsimd_sleef(y), x), + vsel_vd_vo_vd_vd_advsimd_sleef(o, x, y)); + u = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_tand2_u10advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef u; + vdouble2_advsimd_sleef s, t, x, y; + vopmask_advsimd_sleef o; + vint_advsimd_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(15)))), 1)) { + vdouble_advsimd_sleef dql = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_advsimd_sleef(dql); + u = vmla_vd_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_advsimd_sleef (u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1e+14)))), 1)) { + vdouble_advsimd_sleef dqh = vtruncate_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(1 << 24)); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.63661977236758138243, -3.9357353350364971764e-17), d), + vsub_vd_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), + vcast_vd_d_advsimd_sleef(-0.5), vcast_vd_d_advsimd_sleef(0.5)), dqh)); + const vdouble_advsimd_sleef dql = vtruncate_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s))); + ql = vrint_vi_vd_advsimd_sleef(dql); + + u = vmla_vd_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1415926218032836914*0.5 ))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-3.1786509424591713469e-08*0.5 ))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dqh, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dql, vcast_vd_d_advsimd_sleef(-1.2246467864107188502e-16*0.5 ))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(dqh, dql), vcast_vd_d_advsimd_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_advsimd_sleef ddi_advsimd_sleef = rempi_advsimd_sleef(d); + ql = ddigeti_vi_ddi_advsimd_sleef(ddi_advsimd_sleef); + s = ddigetdd_vd2_ddi_advsimd_sleef(ddi_advsimd_sleef); + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), visnan_vo_vd_advsimd_sleef(d)); + s = vd2setx_vd2_vd2_vd_advsimd_sleef(s, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s))))); + s = vd2sety_vd2_vd2_vd_advsimd_sleef(s, vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(o, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(s))))); + } + + t = ddscale_vd2_vd2_vd_advsimd_sleef(s, vcast_vd_d_advsimd_sleef(0.5)); + s = ddsqu_vd2_vd2_advsimd_sleef(t); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2getx_vd_vd2_advsimd_sleef(s)), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_advsimd_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_advsimd_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_advsimd_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_advsimd_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(+0.3333333333333343695e+0)); + x = ddadd_vd2_vd2_vd2_advsimd_sleef(t, ddmul_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s, t), u)); + + y = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), ddsqu_vd2_vd2_advsimd_sleef(x)); + x = ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(-2)); + + o = vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(ql, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1))); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddneg_vd2_vd2_advsimd_sleef(y), x), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, x, y)); + + u = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), d, u); + + return u; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef atan2k_advsimd_sleef(vdouble_advsimd_sleef y, vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef s, t, u; + vint_advsimd_sleef q; + vopmask_advsimd_sleef p; + + q = vsel_vi_vd_vi_advsimd_sleef(x, vcast_vi_i_advsimd_sleef(-2)); + x = vabs_vd_vd_advsimd_sleef(x); + + q = vsel_vi_vd_vd_vi_vi_advsimd_sleef(x, y, vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(1)), q); + p = vlt_vo_vd_vd_advsimd_sleef(x, y); + s = vsel_vd_vo_vd_vd_advsimd_sleef(p, vneg_vd_vd_advsimd_sleef(x), y); + t = vmax_vd_vd_vd_advsimd_sleef(x, y); + + s = vdiv_vd_vd_vd_advsimd_sleef(s, t); + t = vmul_vd_vd_vd_advsimd_sleef(s, s); + + vdouble_advsimd_sleef t2 = vmul_vd_vd_vd_advsimd_sleef(t, t), t4 = vmul_vd_vd_vd_advsimd_sleef(t2, t2), t8 = vmul_vd_vd_vd_advsimd_sleef(t4, t4), t16 = vmul_vd_vd_vd_advsimd_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((t16), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vcast_vd_d_advsimd_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.000209850076645816976906797)), (vcast_vd_d_advsimd_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t8), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.00370026744188713119232403)), (vcast_vd_d_advsimd_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.016599329773529201970117)), (vcast_vd_d_advsimd_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0337852580001353069993897)), (vcast_vd_d_advsimd_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0466667150077840625632675)), (vcast_vd_d_advsimd_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0587666392926673580854313)), (vcast_vd_d_advsimd_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0769219538311769618355029)), (vcast_vd_d_advsimd_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.111111105648261418443745)), (vcast_vd_d_advsimd_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.199999999996591265594148)), (vcast_vd_d_advsimd_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(t, u), s); + t = vmla_vd_vd_vd_vd_advsimd_sleef(vcast_vd_vi_advsimd_sleef(q), vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef atan2k_u1_advsimd_sleef(vdouble2_advsimd_sleef y, vdouble2_advsimd_sleef x) { + vdouble_advsimd_sleef u; + vdouble2_advsimd_sleef s, t; + vint_advsimd_sleef q; + vopmask_advsimd_sleef p; + + q = vsel_vi_vd_vi_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vcast_vi_i_advsimd_sleef(-2)); + p = vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(0)); + vmask_advsimd_sleef b = vand_vm_vo64_vm_advsimd_sleef(p, vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))); + x = vd2setx_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(b, vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x))))); + x = vd2sety_vd2_vd2_vd_advsimd_sleef(x, vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(b, vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(x))))); + + q = vsel_vi_vd_vd_vi_vi_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y), vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(1)), q); + p = vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(y)); + s = vsel_vd2_vo_vd2_vd2_advsimd_sleef(p, ddneg_vd2_vd2_advsimd_sleef(x), y); + t = vsel_vd2_vo_vd2_vd2_advsimd_sleef(p, y, x); + + s = dddiv_vd2_vd2_vd2_advsimd_sleef(s, t); + t = ddsqu_vd2_vd2_advsimd_sleef(s); + t = ddnormalize_vd2_vd2_advsimd_sleef(t); + + vdouble_advsimd_sleef t2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), vd2getx_vd_vd2_advsimd_sleef(t)), t4 = vmul_vd_vd_vd_advsimd_sleef(t2, t2), t8 = vmul_vd_vd_vd_advsimd_sleef(t4, t4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((t8), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(1.06298484191448746607415e-05)), (vcast_vd_d_advsimd_sleef(-0.000125620649967286867384336)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.00070557664296393412389774)), (vcast_vd_d_advsimd_sleef(-0.00251865614498713360352999)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.00646262899036991172313504)), (vcast_vd_d_advsimd_sleef(-0.0128281333663399031014274)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.0208024799924145797902497)), (vcast_vd_d_advsimd_sleef(-0.0289002344784740315686289)))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.0359785005035104590853656)), (vcast_vd_d_advsimd_sleef(-0.041848579703592507506027)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.0470843011653283988193763)), (vcast_vd_d_advsimd_sleef(-0.0524914210588448421068719)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.0587946590969581003860434)), (vcast_vd_d_advsimd_sleef(-0.0666620884778795497194182)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(t)), (vcast_vd_d_advsimd_sleef(0.0769225330296203768654095)), (vcast_vd_d_advsimd_sleef(-0.0909090442773387574781907))))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(t), vcast_vd_d_advsimd_sleef(0.111111108376896236538123)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(t), vcast_vd_d_advsimd_sleef(-0.142857142756268568062339)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(t), vcast_vd_d_advsimd_sleef(0.199999999997977351284817)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(t), vcast_vd_d_advsimd_sleef(-0.333333333333317605173818)); + + t = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddmul_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(s, t), u)); + + t = ddadd_vd2_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(1.570796326794896557998982, 6.12323399573676603586882e-17), vcast_vd_vi_advsimd_sleef(q)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef visinf2_vd_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d, vdouble_advsimd_sleef m) { + return vreinterpret_vd_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vor_vm_vm_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(d), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_atan2d2_u35advsimd(vdouble_advsimd_sleef y, vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef r = atan2k_advsimd_sleef(vabs_vd_vd_advsimd_sleef(y), x); + + r = vmulsign_vd_vd_vd_advsimd_sleef(r, x); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0))), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_advsimd_sleef(x, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(y), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_advsimd_sleef(x, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0.0)), vreinterpret_vd_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vreinterpret_vm_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_atan2d2_u10advsimd(vdouble_advsimd_sleef y, vdouble_advsimd_sleef x) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(5.5626846462680083984e-309)); + x = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 53)), x); + y = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 53)), y); + + vdouble2_advsimd_sleef d = atan2k_u1_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(y), vcast_vd_d_advsimd_sleef(0)), vcast_vd2_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0))); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)); + + r = vmulsign_vd_vd_vd_advsimd_sleef(r, x); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0))), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_advsimd_sleef(x, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(y), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_advsimd_sleef(x, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0.0)), vreinterpret_vd_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vreinterpret_vm_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_asind2_u35advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0.5)); + vdouble_advsimd_sleef x2 = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, d), vmul_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vabs_vd_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5))); + vdouble_advsimd_sleef x = vsel_vd_vo_vd_vd_advsimd_sleef(o, vabs_vd_vd_advsimd_sleef(d), vsqrt_vd_vd_advsimd_sleef(x2)), u; + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_advsimd_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_advsimd_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_advsimd_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_advsimd_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_advsimd_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_advsimd_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(x, x2), x); + + vdouble_advsimd_sleef r = vsel_vd_vo_vd_vd_advsimd_sleef(o, u, vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-2), vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2))); + return vmulsign_vd_vd_vd_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_asind2_u10advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0.5)); + vdouble_advsimd_sleef x2 = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, d), vmul_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vabs_vd_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5))), u; + vdouble2_advsimd_sleef x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, vcast_vd2_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0)), ddsqrt_vd2_vd_advsimd_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1.0)), vcast_vd2_d_d_advsimd_sleef(0, 0), x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_advsimd_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_advsimd_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_advsimd_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_advsimd_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_advsimd_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_advsimd_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x))); + + vdouble2_advsimd_sleef y = ddsub_vd2_vd2_vd_advsimd_sleef(ddsub_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(3.141592653589793116/4, 1.2246467991473532072e-16/4), x), u); + + vdouble_advsimd_sleef r = vsel_vd_vo_vd_vd_advsimd_sleef(o, vadd_vd_vd_vd_advsimd_sleef(u, vd2getx_vd_vd2_advsimd_sleef(x)), + vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(2))); + return vmulsign_vd_vd_vd_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_acosd2_u35advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0.5)); + vdouble_advsimd_sleef x2 = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, d), + vmul_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vabs_vd_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5))), u; + vdouble_advsimd_sleef x = vsel_vd_vo_vd_vd_advsimd_sleef(o, vabs_vd_vd_advsimd_sleef(d), vsqrt_vd_vd_advsimd_sleef(x2)); + x = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1.0)), vcast_vd_d_advsimd_sleef(0), x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_advsimd_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_advsimd_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_advsimd_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_advsimd_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_advsimd_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_advsimd_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(x2, x)); + + vdouble_advsimd_sleef y = vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), vadd_vd_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(x, d), vmulsign_vd_vd_vd_advsimd_sleef(u, d))); + x = vadd_vd_vd_vd_advsimd_sleef(x, u); + vdouble_advsimd_sleef r = vsel_vd_vo_vd_vd_advsimd_sleef(o, y, vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + return vsel_vd_vo_vd_vd_advsimd_sleef(vandnot_vo_vo_vo_advsimd_sleef(o, vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0))), + vd2getx_vd_vd2_advsimd_sleef(ddadd_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(3.141592653589793116, 1.2246467991473532072e-16), + vneg_vd_vd_advsimd_sleef(r))), r); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_acosd2_u10advsimd(vdouble_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0.5)); + vdouble_advsimd_sleef x2 = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, d), vmul_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vabs_vd_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5))), u; + vdouble2_advsimd_sleef x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, vcast_vd2_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0)), ddsqrt_vd2_vd_advsimd_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1.0)), vcast_vd2_d_d_advsimd_sleef(0, 0), x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_advsimd_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_advsimd_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_advsimd_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_advsimd_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_advsimd_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_advsimd_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_advsimd_sleef(u, vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x))); + + vdouble2_advsimd_sleef y = ddsub_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(3.141592653589793116/2, 1.2246467991473532072e-16/2), + ddadd_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), d), vmulsign_vd_vd_vd_advsimd_sleef(u, d))); + x = ddadd_vd2_vd2_vd_advsimd_sleef(x, u); + + y = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, y, ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + + y = vsel_vd2_vo_vd2_vd2_advsimd_sleef(vandnot_vo_vo_vo_advsimd_sleef(o, vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0))), + ddsub_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(3.141592653589793116, 1.2246467991473532072e-16), y), y); + + return vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_atand2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef d2 = atan2k_u1_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(0)), vcast_vd2_d_d_advsimd_sleef(1, 0)); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d2), vd2gety_vd_vd2_advsimd_sleef(d2)); + r = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1.570796326794896557998982), r); + return vmulsign_vd_vd_vd_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_atand2_u35advsimd(vdouble_advsimd_sleef s) { + vdouble_advsimd_sleef t, u; + vint_advsimd_sleef q; + + q = vsel_vi_vd_vi_advsimd_sleef(s, vcast_vi_i_advsimd_sleef(2)); + s = vabs_vd_vd_advsimd_sleef(s); + + q = vsel_vi_vd_vd_vi_vi_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), s, vadd_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(1)), q); + s = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), s), vrec_vd_vd_advsimd_sleef(s), s); + + t = vmul_vd_vd_vd_advsimd_sleef(s, s); + + vdouble_advsimd_sleef t2 = vmul_vd_vd_vd_advsimd_sleef(t, t), t4 = vmul_vd_vd_vd_advsimd_sleef(t2, t2), t8 = vmul_vd_vd_vd_advsimd_sleef(t4, t4), t16 = vmul_vd_vd_vd_advsimd_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_advsimd_sleef((t16), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vcast_vd_d_advsimd_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.000209850076645816976906797)), (vcast_vd_d_advsimd_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t8), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.00370026744188713119232403)), (vcast_vd_d_advsimd_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.016599329773529201970117)), (vcast_vd_d_advsimd_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0337852580001353069993897)), (vcast_vd_d_advsimd_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0466667150077840625632675)), (vcast_vd_d_advsimd_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t4), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0587666392926673580854313)), (vcast_vd_d_advsimd_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.0769219538311769618355029)), (vcast_vd_d_advsimd_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((t2), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.111111105648261418443745)), (vcast_vd_d_advsimd_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_advsimd_sleef((t), (vcast_vd_d_advsimd_sleef(0.199999999996591265594148)), (vcast_vd_d_advsimd_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(t, u), s); + + t = vsel_vd_vo_vd_vd_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(1)), vcast_vi_i_advsimd_sleef(1))), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3.141592653589793238462643383279502884/2), t), t); + t = vreinterpret_vd_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo64_vm_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(2)), vcast_vi_i_advsimd_sleef(2))), vreinterpret_vm_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-0.0))), vreinterpret_vm_vd_advsimd_sleef(t))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_logd2_u35advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef x, x2; + vdouble_advsimd_sleef t, m; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = vdiv_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(1)), vadd_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), m)); + x2 = vmul_vd_vd_vd_advsimd_sleef(x, x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x3 = vmul_vd_vd_vd_advsimd_sleef(x, x2); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(0.153487338491425068243146)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.152519917006351951593857)), (vcast_vd_d_advsimd_sleef(0.181863266251982985677316)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.222221366518767365905163)), (vcast_vd_d_advsimd_sleef(0.285714294746548025383248)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.399999999950799600689777)), (vcast_vd_d_advsimd_sleef(0.6666666666667778740063))))))) + + ; + + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2), vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.693147180559945286226764), vcast_vd_vi_advsimd_sleef(e))); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x3, t, x); + + x = vsel_vd_vo_vd_vd_advsimd_sleef(vispinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), x); + x = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_expd2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.2081276378237164457e-8)), (vcast_vd_d_advsimd_sleef(+0.2511210703042288022e-7)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.2755762628169491192e-6)), (vcast_vd_d_advsimd_sleef(+0.2755723402025388239e-5)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.2480158687479686264e-4)), (vcast_vd_d_advsimd_sleef(+0.1984126989855865850e-3)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1388888888914497797e-2)), (vcast_vd_d_advsimd_sleef(+0.8333333333314938210e-2)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.4166666666666602598e-1)), (vcast_vd_d_advsimd_sleef(+0.1666666666666669072e+0))))))))) + + ; + u = vfma_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.5000000000000000000e+0)); + u = vfma_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1000000000000000000e+1)); + u = vfma_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1000000000000000000e+1)); + + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(709.78271114955742909217217426)), vcast_vd_d_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-1000)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef expm1k_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(2.08860621107283687536341e-09)), (vcast_vd_d_advsimd_sleef(2.51112930892876518610661e-08)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(2.75573911234900471893338e-07)), (vcast_vd_d_advsimd_sleef(2.75572362911928827629423e-06)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(2.4801587159235472998791e-05)), (vcast_vd_d_advsimd_sleef(0.000198412698960509205564975)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(0.00138888888889774492207962)), (vcast_vd_d_advsimd_sleef(0.00833333333331652721664984)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(0.0416666666666665047591422)), (vcast_vd_d_advsimd_sleef(0.166666666666666851703837))))))))) + + ; + + u = vadd_vd_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(s2, vcast_vd_d_advsimd_sleef(0.5), vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(s2, s), u)), s); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(q, vcast_vi_i_advsimd_sleef(0))), u, + vsub_vd_vd_vd_advsimd_sleef(vldexp2_vd_vd_vi_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(1)), q), vcast_vd_d_advsimd_sleef(1))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef logk_advsimd_sleef(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x, x2, s; + vdouble_advsimd_sleef t, m; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), m), ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), m)); + x2 = ddsqu_vd2_vd2_advsimd_sleef(x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x2), vd2getx_vd_vd2_advsimd_sleef(x2)), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vcast_vd_d_advsimd_sleef(0.116255524079935043668677)), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.103239680901072952701192)), (vcast_vd_d_advsimd_sleef(0.117754809412463995466069)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.13332981086846273921509)), (vcast_vd_d_advsimd_sleef(0.153846227114512262845736)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.181818180850050775676507)), (vcast_vd_d_advsimd_sleef(0.222222222230083560345903)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.285714285714249172087875)), (vcast_vd_d_advsimd_sleef(0.400000000000000077715612))))))))) + + ; + + vdouble2_advsimd_sleef c = vcast_vd2_d_d_advsimd_sleef(0.666666666666666629659233, 3.80554962542412056336616e-17); + + s = ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_advsimd_sleef(e)); + + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + x = ddmul_vd2_vd2_vd2_advsimd_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddmul_vd2_vd2_vd2_advsimd_sleef(x, c)); + x = ddmul_vd2_vd2_vd2_advsimd_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddmul_vd2_vd2_vd_advsimd_sleef(x, t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_logd2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x; + vdouble_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), m), ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), m)); + x2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.1525629051003428716e+0)), (vcast_vd_d_advsimd_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.2222214519839380009e+0)), (vcast_vd_d_advsimd_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.3999999999635251990e+0)), (vcast_vd_d_advsimd_sleef(0.6666666666667333541e+0))))))) + + ; + + vdouble2_advsimd_sleef s = ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_advsimd_sleef(e)); + + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x)), t)); + + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vispinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef expk_advsimd_sleef(vdouble2_advsimd_sleef d) { + vdouble_advsimd_sleef u = vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_advsimd_sleef dq = vrint_vd_vd_advsimd_sleef(u); + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(dq); + vdouble2_advsimd_sleef s, t; + + s = ddadd2_vd2_vd2_vd_advsimd_sleef(d, vmul_vd_vd_vd_advsimd_sleef(dq, vcast_vd_d_advsimd_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dq, vcast_vd_d_advsimd_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + s = ddnormalize_vd2_vd2_advsimd_sleef(s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2getx_vd_vd2_advsimd_sleef(s)), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.51069683420950419527139e-08)), (vcast_vd_d_advsimd_sleef(2.76286166770270649116855e-07)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(2.75572496725023574143864e-06)), (vcast_vd_d_advsimd_sleef(2.48014973989819794114153e-05)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(0.000198412698809069797676111)), (vcast_vd_d_advsimd_sleef(0.0013888888939977128960529)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(0.00833333333332371417601081)), (vcast_vd_d_advsimd_sleef(0.0416666666665409524128449)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(0.166666666666666740681535)), (vcast_vd_d_advsimd_sleef(0.500000000000000999200722))))))))) + + ; + + t = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), s); + t = ddadd_vd2_vd2_vd2_advsimd_sleef(t, ddmul_vd2_vd2_vd_advsimd_sleef(ddsqu_vd2_vd2_advsimd_sleef(s), u)); + + u = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), vd2gety_vd_vd2_advsimd_sleef(t)); + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-1000)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_powd2_u10advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + + vopmask_advsimd_sleef yisint = visint_vo_vd_advsimd_sleef(y); + vopmask_advsimd_sleef yisodd = vand_vo_vo_vo_advsimd_sleef(visodd_vo_vd_advsimd_sleef(y), yisint); + + vdouble2_advsimd_sleef d = ddmul_vd2_vd2_vd_advsimd_sleef(logk_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x)), y); + vdouble_advsimd_sleef result = expk_advsimd_sleef(d); + result = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(709.78271114955742909217217426)), vcast_vd_d_advsimd_sleef(__builtin_inf()), result); + + result = vmul_vd_vd_vd_advsimd_sleef(result, + vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), + vcast_vd_d_advsimd_sleef(1), + vsel_vd_vo_vd_vd_advsimd_sleef(yisint, vsel_vd_vo_vd_vd_advsimd_sleef(yisodd, vcast_vd_d_advsimd_sleef(-1.0), vcast_vd_d_advsimd_sleef(1)), vcast_vd_d_advsimd_sleef(__builtin_nan(""))))); + + vdouble_advsimd_sleef efx = vmulsign_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(1)), y); + + result = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(y), + vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(efx, vcast_vd_d_advsimd_sleef(0.0)), + vreinterpret_vm_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(efx, vcast_vd_d_advsimd_sleef(0.0)), + vcast_vd_d_advsimd_sleef(1.0), + vcast_vd_d_advsimd_sleef(__builtin_inf()))))), + result); + + result = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0.0))), + vmulsign_vd_vd_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(vxor_vo_vo_vo_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(y), veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0.0))), + vcast_vd_d_advsimd_sleef(0), vcast_vd_d_advsimd_sleef(__builtin_inf())), + vsel_vd_vo_vd_vd_advsimd_sleef(yisodd, x, vcast_vd_d_advsimd_sleef(1))), result); + + result = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vreinterpret_vm_vd_advsimd_sleef(result))); + + result = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0)), veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1))), vcast_vd_d_advsimd_sleef(1), result); + + return result; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef expk2_advsimd_sleef(vdouble2_advsimd_sleef d) { + vdouble_advsimd_sleef u = vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_advsimd_sleef dq = vrint_vd_vd_advsimd_sleef(u); + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(dq); + vdouble2_advsimd_sleef s, t; + + s = ddadd2_vd2_vd2_vd_advsimd_sleef(d, vmul_vd_vd_vd_advsimd_sleef(dq, vcast_vd_d_advsimd_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(dq, vcast_vd_d_advsimd_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + vdouble2_advsimd_sleef s2 = ddsqu_vd2_vd2_advsimd_sleef(s), s4 = ddsqu_vd2_vd2_advsimd_sleef(s2); + vdouble_advsimd_sleef s8 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s4), vd2getx_vd_vd2_advsimd_sleef(s4)); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.1602472219709932072e-9)), (vcast_vd_d_advsimd_sleef(+0.2092255183563157007e-8)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s4)), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s2)), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.2505230023782644465e-7)), (vcast_vd_d_advsimd_sleef(+0.2755724800902135303e-6)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.2755731892386044373e-5)), (vcast_vd_d_advsimd_sleef(+0.2480158735605815065e-4)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s2)), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.1984126984148071858e-3)), (vcast_vd_d_advsimd_sleef(+0.1388888888886763255e-2)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(s)), (vcast_vd_d_advsimd_sleef(+0.8333333333333347095e-2)), (vcast_vd_d_advsimd_sleef(+0.4166666666666669905e-1))))))))) + + ; + + t = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), ddmul_vd2_vd2_vd_advsimd_sleef(s, vcast_vd_d_advsimd_sleef(+0.1666666666666666574e+0))); + t = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1.0), ddmul_vd2_vd2_vd2_advsimd_sleef(t, s)); + t = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1.0), ddmul_vd2_vd2_vd2_advsimd_sleef(t, s)); + t = ddadd_vd2_vd2_vd2_advsimd_sleef(t, ddmul_vd2_vd2_vd_advsimd_sleef(s4, u)); + + t = vd2setx_vd2_vd2_vd_advsimd_sleef(t, vldexp2_vd_vd_vi_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), q)); + t = vd2sety_vd2_vd2_vd_advsimd_sleef(t, vldexp2_vd_vd_vi_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(t), q)); + + t = vd2setx_vd2_vd2_vd_advsimd_sleef(t, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-1000)), vreinterpret_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t))))); + t = vd2sety_vd2_vd2_vd_advsimd_sleef(t, vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-1000)), vreinterpret_vm_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sinhd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef y = vabs_vd_vd_advsimd_sleef(x); + vdouble2_advsimd_sleef d = expk2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0))); + d = ddsub_vd2_vd2_vd2_advsimd_sleef(d, ddrec_vd2_vd2_advsimd_sleef(d)); + y = vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(710)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_advsimd_sleef(y, x); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_coshd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef y = vabs_vd_vd_advsimd_sleef(x); + vdouble2_advsimd_sleef d = expk2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0))); + d = ddadd_vd2_vd2_vd2_advsimd_sleef(d, ddrec_vd2_vd2_advsimd_sleef(d)); + y = vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(710)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_tanhd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef y = vabs_vd_vd_advsimd_sleef(x); + vdouble2_advsimd_sleef d = expk2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0))); + vdouble2_advsimd_sleef e = ddrec_vd2_vd2_advsimd_sleef(d); + d = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd2_advsimd_sleef(d, ddneg_vd2_vd2_advsimd_sleef(e)), ddadd2_vd2_vd2_vd2_advsimd_sleef(d, e)); + y = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(18.714973875)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(1.0), y); + y = vmulsign_vd_vd_vd_advsimd_sleef(y, x); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sinhd2_u35advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef e = expm1k_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x)); + + vdouble_advsimd_sleef y = vdiv_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(e, vcast_vd_d_advsimd_sleef(2)), vadd_vd_vd_vd_advsimd_sleef(e, vcast_vd_d_advsimd_sleef(1))); + y = vmul_vd_vd_vd_advsimd_sleef(y, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(709)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_advsimd_sleef(y, x); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_coshd2_u35advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef e = Sleef_expd2_u10advsimd(vabs_vd_vd_advsimd_sleef(x)); + vdouble_advsimd_sleef y = vmla_vd_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), e, vdiv_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(709)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_tanhd2_u35advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef d = expm1k_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), vabs_vd_vd_advsimd_sleef(x))); + vdouble_advsimd_sleef y = vdiv_vd_vd_vd_advsimd_sleef(d, vadd_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), d)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(18.714973875)), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(1.0), y); + y = vmulsign_vd_vd_vd_advsimd_sleef(y, x); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef logk2_advsimd_sleef(vdouble2_advsimd_sleef d) { + vdouble2_advsimd_sleef x, x2, m, s; + vdouble_advsimd_sleef t; + vint_advsimd_sleef e; + + e = vilogbk_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1.0/0.75))); + + m = vd2setxy_vd2_vd_vd_advsimd_sleef(vldexp2_vd_vd_vi_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vneg_vi_vi_advsimd_sleef(e)), + vldexp2_vd_vd_vi_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(d), vneg_vi_vi_advsimd_sleef(e))); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(-1)), ddadd2_vd2_vd2_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(1))); + x2 = ddsqu_vd2_vd2_advsimd_sleef(x); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x2), vd2getx_vd_vd2_advsimd_sleef(x2)), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(0.13860436390467167910856)), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.131699838841615374240845)), (vcast_vd_d_advsimd_sleef(0.153914168346271945653214)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.181816523941564611721589)), (vcast_vd_d_advsimd_sleef(0.22222224632662035403996)))), (vmla_vd_vd_vd_vd_advsimd_sleef((vd2getx_vd_vd2_advsimd_sleef(x2)), (vcast_vd_d_advsimd_sleef(0.285714285511134091777308)), (vcast_vd_d_advsimd_sleef(0.400000000000914013309483))))))) + + ; + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(x2), vcast_vd_d_advsimd_sleef(0.666666666666664853302393)); + + s = ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_advsimd_sleef(e)); + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddmul_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_asinhd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef y = vabs_vd_vd_advsimd_sleef(x); + vopmask_advsimd_sleef o = vgt_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(1)); + vdouble2_advsimd_sleef d; + + d = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddrec_vd2_vd_advsimd_sleef(x), vcast_vd2_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0))); + d = ddsqrt_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(ddsqu_vd2_vd2_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(1))); + d = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddmul_vd2_vd2_vd_advsimd_sleef(d, y), d); + + d = logk2_advsimd_sleef(ddnormalize_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(d, x))); + y = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_advsimd_sleef(y)), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(__builtin_inf()), x), y); + + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + y = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_acoshd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble2_advsimd_sleef d = logk2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddsqrt_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1))), ddsqrt_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(-1)))), x)); + vdouble_advsimd_sleef y = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)); + + y = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_advsimd_sleef(y)), + vcast_vd_d_advsimd_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0)), vreinterpret_vm_vd_advsimd_sleef(y))); + + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.0)), vreinterpret_vm_vd_advsimd_sleef(y))); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_atanhd2_u10advsimd(vdouble_advsimd_sleef x) { + vdouble_advsimd_sleef y = vabs_vd_vd_advsimd_sleef(x); + vdouble2_advsimd_sleef d = logk2_advsimd_sleef(dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), y), ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vneg_vd_vd_advsimd_sleef(y)))); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(1.0)), vreinterpret_vm_vd_advsimd_sleef(vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(1.0)), vcast_vd_d_advsimd_sleef(__builtin_inf()), vmul_vd_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(0.5)))))); + + y = vmulsign_vd_vd_vd_advsimd_sleef(y, x); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vreinterpret_vm_vd_advsimd_sleef(y))); + y = vreinterpret_vd_vm_advsimd_sleef(vor_vm_vo64_vm_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), vreinterpret_vm_vd_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_cbrtd2_u35advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef x, y, q = vcast_vd_d_advsimd_sleef(1.0); + vint_advsimd_sleef e, qu, re; + vdouble_advsimd_sleef t; + + e = vadd_vi_vi_vi_advsimd_sleef(vilogbk_vi_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d)), vcast_vi_i_advsimd_sleef(1)); + d = vldexp2_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + + t = vadd_vd_vd_vd_advsimd_sleef(vcast_vd_vi_advsimd_sleef(e), vcast_vd_d_advsimd_sleef(6144)); + qu = vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(t, vcast_vd_d_advsimd_sleef(1.0/3.0))); + re = vtruncate_vi_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(t, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_vi_advsimd_sleef(qu), vcast_vd_d_advsimd_sleef(3)))); + + q = vsel_vd_vo_vd_vd_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(re, vcast_vi_i_advsimd_sleef(1))), vcast_vd_d_advsimd_sleef(1.2599210498948731647672106), q); + q = vsel_vd_vo_vd_vd_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(re, vcast_vi_i_advsimd_sleef(2))), vcast_vd_d_advsimd_sleef(1.5874010519681994747517056), q); + q = vldexp2_vd_vd_vi_advsimd_sleef(q, vsub_vi_vi_vi_advsimd_sleef(qu, vcast_vi_i_advsimd_sleef(2048))); + + q = vmulsign_vd_vd_vd_advsimd_sleef(q, d); + + d = vabs_vd_vd_advsimd_sleef(d); + + x = vcast_vd_d_advsimd_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_advsimd_sleef(x, x); y = vmul_vd_vd_vd_advsimd_sleef(y, y); x = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vmlapn_vd_vd_vd_vd_advsimd_sleef(d, y, x), vcast_vd_d_advsimd_sleef(1.0 / 3.0))); + y = vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, x), x); + y = vmul_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(y, vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2.0 / 3.0), y), vmla_vd_vd_vd_vd_advsimd_sleef(y, x, vcast_vd_d_advsimd_sleef(-1.0)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_cbrtd2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef x, y, z, t; + vdouble2_advsimd_sleef q2 = vcast_vd2_d_d_advsimd_sleef(1, 0), u, v; + vint_advsimd_sleef e, qu, re; + + e = vadd_vi_vi_vi_advsimd_sleef(vilogbk_vi_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(d)), vcast_vi_i_advsimd_sleef(1)); + d = vldexp2_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + + t = vadd_vd_vd_vd_advsimd_sleef(vcast_vd_vi_advsimd_sleef(e), vcast_vd_d_advsimd_sleef(6144)); + qu = vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(t, vcast_vd_d_advsimd_sleef(1.0/3.0))); + re = vtruncate_vi_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(t, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_vi_advsimd_sleef(qu), vcast_vd_d_advsimd_sleef(3)))); + + q2 = vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(re, vcast_vi_i_advsimd_sleef(1))), vcast_vd2_d_d_advsimd_sleef(1.2599210498948731907, -2.5899333753005069177e-17), q2); + q2 = vsel_vd2_vo_vd2_vd2_advsimd_sleef(vcast_vo64_vo32_advsimd_sleef(veq_vo_vi_vi_advsimd_sleef(re, vcast_vi_i_advsimd_sleef(2))), vcast_vd2_d_d_advsimd_sleef(1.5874010519681995834, -1.0869008194197822986e-16), q2); + + q2 = vd2setxy_vd2_vd_vd_advsimd_sleef(vmulsign_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(q2), d), vmulsign_vd_vd_vd_advsimd_sleef(vd2gety_vd_vd2_advsimd_sleef(q2), d)); + d = vabs_vd_vd_advsimd_sleef(d); + + x = vcast_vd_d_advsimd_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_advsimd_sleef(x, d, vcast_vd_d_advsimd_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_advsimd_sleef(x, x); y = vmul_vd_vd_vd_advsimd_sleef(y, y); x = vsub_vd_vd_vd_advsimd_sleef(x, vmul_vd_vd_vd_advsimd_sleef(vmlapn_vd_vd_vd_vd_advsimd_sleef(d, y, x), vcast_vd_d_advsimd_sleef(1.0 / 3.0))); + + z = x; + + u = ddmul_vd2_vd_vd_advsimd_sleef(x, x); + u = ddmul_vd2_vd2_vd2_advsimd_sleef(u, u); + u = ddmul_vd2_vd2_vd_advsimd_sleef(u, d); + u = ddadd2_vd2_vd2_vd_advsimd_sleef(u, vneg_vd_vd_advsimd_sleef(x)); + y = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(u), vd2gety_vd_vd2_advsimd_sleef(u)); + + y = vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-2.0 / 3.0), y), z); + v = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd_vd_advsimd_sleef(z, z), y); + v = ddmul_vd2_vd2_vd_advsimd_sleef(v, d); + v = ddmul_vd2_vd2_vd2_advsimd_sleef(v, q2); + z = vldexp2_vd_vd_vi_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(v), vd2gety_vd_vd2_advsimd_sleef(v)), vsub_vi_vi_vi_advsimd_sleef(qu, vcast_vi_i_advsimd_sleef(2048))); + + z = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(d), vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(__builtin_inf()), vd2getx_vd_vd2_advsimd_sleef(q2)), z); + z = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vreinterpret_vd_vm_advsimd_sleef(vsignbit_vm_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(q2))), z); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_exp2d2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(d), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vsub_vd_vd_vd_advsimd_sleef(d, u); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_advsimd_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_advsimd_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_advsimd_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_advsimd_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_advsimd_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.6931471805599452862e+0)); + + u = vfma_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1)); + + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vge_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1024)), vcast_vd_d_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-2000)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_exp2d2_u35advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(d), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vsub_vd_vd_vd_advsimd_sleef(d, u); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_advsimd_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_advsimd_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_advsimd_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_advsimd_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_advsimd_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.6931471805599452862e+0)); + + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1)); + + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vge_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1024)), vcast_vd_d_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-2000)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_exp10d2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-1.4205023227266099418e-13), s); + + u = vcast_vd_d_advsimd_sleef(+0.2411463498334267652e-3); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1157488415217187375e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.5013975546789733659e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1959762320720533080e-1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.6808936399446784138e-1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.2069958494722676234e+0)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.5393829292058536229e+0)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.1171255148908541655e+1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.2034678592293432953e+1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.2650949055239205876e+1)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(+0.2302585092994045901e+1)); + + u = vfma_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1)); + + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(308.25471555991671)), vcast_vd_d_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-350)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_exp10d2_u35advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef u = vrint_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_advsimd_sleef q = vrint_vi_vd_advsimd_sleef(u); + + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_advsimd_sleef(u, vcast_vd_d_advsimd_sleef(-1.4205023227266099418e-13), s); + + vdouble_advsimd_sleef s2 = vmul_vd_vd_vd_advsimd_sleef(s, s), s4 = vmul_vd_vd_vd_advsimd_sleef(s2, s2), s8 = vmul_vd_vd_vd_advsimd_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_advsimd_sleef((s8), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vcast_vd_d_advsimd_sleef(+0.2411463498334267652e-3)), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1157488415217187375e-2)), (vcast_vd_d_advsimd_sleef(+0.5013975546789733659e-2)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s4), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1959762320720533080e-1)), (vcast_vd_d_advsimd_sleef(+0.6808936399446784138e-1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.2069958494722676234e+0)), (vcast_vd_d_advsimd_sleef(+0.5393829292058536229e+0)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((s2), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.1171255148908541655e+1)), (vcast_vd_d_advsimd_sleef(+0.2034678592293432953e+1)))), (vmla_vd_vd_vd_vd_advsimd_sleef((s), (vcast_vd_d_advsimd_sleef(+0.2650949055239205876e+1)), (vcast_vd_d_advsimd_sleef(+0.2302585092994045901e+1))))))))) + + ; + + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, s, vcast_vd_d_advsimd_sleef(1)); + + u = vldexp2_vd_vd_vi_advsimd_sleef(u, q); + + u = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(308.25471555991671)), vcast_vd_d_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_advsimd_sleef(vandnot_vm_vo64_vm_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-350)), vreinterpret_vm_vd_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_expm1d2_u10advsimd(vdouble_advsimd_sleef a) { + vdouble2_advsimd_sleef d = ddadd2_vd2_vd2_vd_advsimd_sleef(expk2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0))), vcast_vd_d_advsimd_sleef(-1.0)); + vdouble_advsimd_sleef x = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(d), vd2gety_vd_vd2_advsimd_sleef(d)); + x = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(709.782712893383996732223)), vcast_vd_d_advsimd_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(-36.736800569677101399113302437)), vcast_vd_d_advsimd_sleef(-1), x); + x = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(a), vcast_vd_d_advsimd_sleef(-0.0), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_log10d2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x; + vdouble_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), m), ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), m)); + x2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(+0.6653725819576758460e-1)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.6625722782820833712e-1)), (vcast_vd_d_advsimd_sleef(+0.7898105214313944078e-1)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.9650955035715275132e-1)), (vcast_vd_d_advsimd_sleef(+0.1240841409721444993e+0)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.1737177927454605086e+0)), (vcast_vd_d_advsimd_sleef(+0.2895296546021972617e+0))))))) + + ; + + vdouble2_advsimd_sleef s = ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.30102999566398119802, -2.803728127785170339e-18), vcast_vd_vi_advsimd_sleef(e)); + + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddmul_vd2_vd2_vd2_advsimd_sleef(x, vcast_vd2_d_d_advsimd_sleef(0.86858896380650363334, 1.1430059694096389311e-17))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x)), t)); + + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vispinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_log2d2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x; + vdouble_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), m), ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), m)); + x2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(+0.2211941750456081490e+0)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.2200768693152277689e+0)), (vcast_vd_d_advsimd_sleef(+0.2623708057488514656e+0)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.3205977477944495502e+0)), (vcast_vd_d_advsimd_sleef(+0.4121985945485324709e+0)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(+0.5770780162997058982e+0)), (vcast_vd_d_advsimd_sleef(+0.96179669392608091449))))))) + + ; + + vdouble2_advsimd_sleef s = ddadd2_vd2_vd_vd2_advsimd_sleef(vcast_vd_vi_advsimd_sleef(e), + ddmul_vd2_vd2_vd2_advsimd_sleef(x, vcast_vd2_d_d_advsimd_sleef(2.885390081777926774, 6.0561604995516736434e-18))); + + s = ddadd2_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x)), t)); + + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vispinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_log2d2_u35advsimd(vdouble_advsimd_sleef d) { + vdouble_advsimd_sleef m, t, x, x2; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_advsimd_sleef(d, vneg_vi_vi_advsimd_sleef(e)); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + + x = vdiv_vd_vd_vd_advsimd_sleef(vsub_vd_vd_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(1)), vadd_vd_vd_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(1))); + x2 = vmul_vd_vd_vd_advsimd_sleef(x, x); + + t = vcast_vd_d_advsimd_sleef(+0.2211941750456081490e+0); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.2200768693152277689e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.2623708057488514656e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.3205977477944495502e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.4121985945485324709e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.5770780162997058982e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, x2, vcast_vd_d_advsimd_sleef(+0.96179669392608091449 )); + + vdouble2_advsimd_sleef s = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_vi_advsimd_sleef(e), + ddmul_vd2_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2.885390081777926774))); + + vdouble_advsimd_sleef r = vmla_vd_vd_vd_vd_advsimd_sleef(t, vmul_vd_vd_vd_advsimd_sleef(x, x2), vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s))); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vispinf_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_log1pd2_u10advsimd(vdouble_advsimd_sleef d) { + vdouble2_advsimd_sleef x; + vdouble_advsimd_sleef t, m, x2; + + vdouble_advsimd_sleef dp1 = vadd_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1)); + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(dp1, vcast_vd_d_advsimd_sleef(0x1p-1022)); + dp1 = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(dp1, vcast_vd_d_advsimd_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), dp1); + vint_advsimd_sleef e = vilogb2k_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(dp1, vcast_vd_d_advsimd_sleef(1.0/0.75))); + t = vldexp3_vd_vd_vi_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vneg_vi_vi_advsimd_sleef(e)); + m = vmla_vd_vd_vd_vd_advsimd_sleef(d, t, vsub_vd_vd_vd_advsimd_sleef(t, vcast_vd_d_advsimd_sleef(1))); + e = vsel_vi_vo_vi_vi_advsimd_sleef(vcast_vo32_vo64_advsimd_sleef(o), vsub_vi_vi_vi_advsimd_sleef(e, vcast_vi_i_advsimd_sleef(64)), e); + vdouble2_advsimd_sleef s = ddmul_vd2_vd2_vd_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_advsimd_sleef(e)); + + x = dddiv_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(m, vcast_vd_d_advsimd_sleef(0)), ddadd_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), m)); + x2 = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2getx_vd_vd2_advsimd_sleef(x)); + + vdouble_advsimd_sleef x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2), x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.1525629051003428716e+0)), (vcast_vd_d_advsimd_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.2222214519839380009e+0)), (vcast_vd_d_advsimd_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vcast_vd_d_advsimd_sleef(0.3999999999635251990e+0)), (vcast_vd_d_advsimd_sleef(0.6666666666667333541e+0))))))) + + ; + + s = ddadd_vd2_vd2_vd2_advsimd_sleef(s, ddscale_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2))); + s = ddadd_vd2_vd2_vd_advsimd_sleef(s, vmul_vd_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x2, vd2getx_vd_vd2_advsimd_sleef(x)), t)); + + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(s), vd2gety_vd_vd2_advsimd_sleef(s)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1e+307)), vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-1)), visnan_vo_vd_advsimd_sleef(d)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(-1)), vcast_vd_d_advsimd_sleef(-__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(visnegzero_vo_vd_advsimd_sleef(d), vcast_vd_d_advsimd_sleef(-0.0), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fabsd2_advsimd(vdouble_advsimd_sleef x) { return vabs_vd_vd_advsimd_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_copysignd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { return vcopysign_vd_vd_vd_advsimd_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fmaxd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + + return vsel_vd_vo_vd_vd_advsimd_sleef(visnan_vo_vd_advsimd_sleef(y), x, vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fmind2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + + return vsel_vd_vo_vd_vd_advsimd_sleef(visnan_vo_vd_advsimd_sleef(y), x, vsel_vd_vo_vd_vd_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fdimd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef ret = vsub_vd_vd_vd_advsimd_sleef(x, y); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(ret, vcast_vd_d_advsimd_sleef(0)), veq_vo_vd_vd_advsimd_sleef(x, y)), vcast_vd_d_advsimd_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_truncd2_advsimd(vdouble_advsimd_sleef x) { return vtruncate2_vd_vd_advsimd_sleef_advsimd_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_floord2_advsimd(vdouble_advsimd_sleef x) { return vfloor2_vd_vd_advsimd_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_ceild2_advsimd(vdouble_advsimd_sleef x) { return vceil2_vd_vd_advsimd_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_roundd2_advsimd(vdouble_advsimd_sleef x) { return vround2_vd_vd_advsimd_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_rintd2_advsimd(vdouble_advsimd_sleef x) { return vrint2_vd_vd_advsimd_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_nextafterd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + x = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0), y), x); + vmask_advsimd_sleef xi2 = vreinterpret_vm_vd_advsimd_sleef(x); + vopmask_advsimd_sleef c = vxor_vo_vo_vo_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(x), vge_vo_vd_vd_advsimd_sleef(y, x)); + + xi2 = vsel_vm_vo64_vm_vm_advsimd_sleef(c, vneg64_vm_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(xi2, vcast_vm_i_i_advsimd_sleef((int)(1U << 31), 0))), xi2); + + xi2 = vsel_vm_vo64_vm_vm_advsimd_sleef(vneq_vo_vd_vd_advsimd_sleef(x, y), vsub64_vm_vm_vm_advsimd_sleef(xi2, vcast_vm_i_i_advsimd_sleef(0, 1)), xi2); + + xi2 = vsel_vm_vo64_vm_vm_advsimd_sleef(c, vneg64_vm_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(xi2, vcast_vm_i_i_advsimd_sleef((int)(1U << 31), 0))), xi2); + + vdouble_advsimd_sleef ret = vreinterpret_vd_vm_advsimd_sleef(xi2); + + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(ret, vcast_vd_d_advsimd_sleef(0)), vneq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0))), + vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0), x), ret); + + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(0))), y, ret); + + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_frfrexpd2_advsimd(vdouble_advsimd_sleef x) { + x = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(0x1p-1022)), vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 63)), x); + + vmask_advsimd_sleef xm = vreinterpret_vm_vd_advsimd_sleef(x); + xm = vand_vm_vm_vm_advsimd_sleef(xm, vcast_vm_i64_advsimd_sleef(~INT64_C(0x7ff0000000000000))); + xm = vor_vm_vm_vm_advsimd_sleef (xm, vcast_vm_i64_advsimd_sleef( INT64_C(0x3fe0000000000000))); + + vdouble_advsimd_sleef ret = vreinterpret_vd_vm_advsimd_sleef(xm); + + ret = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(__builtin_inf()), x), ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint_advsimd_sleef Sleef_expfrexpd2_advsimd(vdouble_advsimd_sleef x) { + x = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(0x1p-1022)), vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 63)), x); + + vint_advsimd_sleef ret = vcastu_vi_vm_advsimd_sleef(vreinterpret_vm_vd_advsimd_sleef(x)); + ret = vsub_vi_vi_vi_advsimd_sleef(vand_vi_vi_vi_advsimd_sleef(vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(ret), 20)), vcast_vi_i_advsimd_sleef(0x7ff)), vcast_vi_i_advsimd_sleef(0x3fe)); + + ret = vsel_vi_vo_vi_vi_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(0)), visnan_vo_vd_advsimd_sleef(x)), visinf_vo_vd_advsimd_sleef(x)), vcast_vi_i_advsimd_sleef(0), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fmad2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y, vdouble_advsimd_sleef z) { + + return vfma_vd_vd_vd_vd_advsimd_sleef(x, y, z); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sqrtd2_u05advsimd(vdouble_advsimd_sleef d) { + + vdouble_advsimd_sleef q, w, x, y, z; + + d = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), d); + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(8.636168555094445E-78)); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.157920892373162E77)), d); + q = vsel_vd_vo_vd_vd_advsimd_sleef(o, vcast_vd_d_advsimd_sleef(2.9387358770557188E-39), vcast_vd_d_advsimd_sleef(1)); + + y = vreinterpret_vd_vm_advsimd_sleef(vsub64_vm_vm_vm_advsimd_sleef(vcast_vm_i_i_advsimd_sleef(0x5fe6ec85, 0xe7de30da), vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(vreinterpret_vm_vd_advsimd_sleef(d)), 1)))); + + x = vmul_vd_vd_vd_advsimd_sleef(d, y); w = vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), y); + y = vfmanp_vd_vd_vd_vd_advsimd_sleef(x, w, vcast_vd_d_advsimd_sleef(0.5)); + x = vfma_vd_vd_vd_vd_advsimd_sleef(x, y, x); w = vfma_vd_vd_vd_vd_advsimd_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_advsimd_sleef(x, w, vcast_vd_d_advsimd_sleef(0.5)); + x = vfma_vd_vd_vd_vd_advsimd_sleef(x, y, x); w = vfma_vd_vd_vd_vd_advsimd_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_advsimd_sleef(x, w, vcast_vd_d_advsimd_sleef(0.5)); + x = vfma_vd_vd_vd_vd_advsimd_sleef(x, y, x); w = vfma_vd_vd_vd_vd_advsimd_sleef(w, y, w); + + y = vfmanp_vd_vd_vd_vd_advsimd_sleef(x, w, vcast_vd_d_advsimd_sleef(1.5)); w = vadd_vd_vd_vd_advsimd_sleef(w, w); + w = vmul_vd_vd_vd_advsimd_sleef(w, y); + x = vmul_vd_vd_vd_advsimd_sleef(w, d); + y = vfmapn_vd_vd_vd_vd_advsimd_sleef(w, d, x); z = vfmanp_vd_vd_vd_vd_advsimd_sleef(w, x, vcast_vd_d_advsimd_sleef(1)); + + z = vfmanp_vd_vd_vd_vd_advsimd_sleef(w, y, z); w = vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), x); + w = vfma_vd_vd_vd_vd_advsimd_sleef(w, z, y); + w = vadd_vd_vd_vd_advsimd_sleef(w, x); + + w = vmul_vd_vd_vd_advsimd_sleef(w, q); + + w = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), + veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(__builtin_inf()))), d, w); + + w = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sqrtd2_advsimd(vdouble_advsimd_sleef d) { + + return vsqrt_vd_vd_advsimd_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_sqrtd2_u35advsimd(vdouble_advsimd_sleef d) { return Sleef_sqrtd2_u05advsimd(d); } + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_hypotd2_u05advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + x = vabs_vd_vd_advsimd_sleef(x); + y = vabs_vd_vd_advsimd_sleef(y); + vdouble_advsimd_sleef min = vmin_vd_vd_vd_advsimd_sleef(x, y), n = min; + vdouble_advsimd_sleef max = vmax_vd_vd_vd_advsimd_sleef(x, y), d = max; + + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(max, vcast_vd_d_advsimd_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), d); + + vdouble2_advsimd_sleef t = dddiv_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(0)), vcast_vd2_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0))); + t = ddmul_vd2_vd2_vd_advsimd_sleef(ddsqrt_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(ddsqu_vd2_vd2_advsimd_sleef(t), vcast_vd_d_advsimd_sleef(1))), max); + vdouble_advsimd_sleef ret = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t), vd2gety_vd_vd2_advsimd_sleef(t)); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(visnan_vo_vd_advsimd_sleef(ret), vcast_vd_d_advsimd_sleef(__builtin_inf()), ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(min, vcast_vd_d_advsimd_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(__builtin_inf())), veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(__builtin_inf()))), vcast_vd_d_advsimd_sleef(__builtin_inf()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_hypotd2_u35advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + x = vabs_vd_vd_advsimd_sleef(x); + y = vabs_vd_vd_advsimd_sleef(y); + vdouble_advsimd_sleef min = vmin_vd_vd_vd_advsimd_sleef(x, y); + vdouble_advsimd_sleef max = vmax_vd_vd_vd_advsimd_sleef(x, y); + + vdouble_advsimd_sleef t = vdiv_vd_vd_vd_advsimd_sleef(min, max); + vdouble_advsimd_sleef ret = vmul_vd_vd_vd_advsimd_sleef(max, vsqrt_vd_vd_advsimd_sleef(vmla_vd_vd_vd_vd_advsimd_sleef(t, t, vcast_vd_d_advsimd_sleef(1)))); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(min, vcast_vd_d_advsimd_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vd_advsimd_sleef(x), visnan_vo_vd_advsimd_sleef(y)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(__builtin_inf())), veq_vo_vd_vd_advsimd_sleef(y, vcast_vd_d_advsimd_sleef(__builtin_inf()))), vcast_vd_d_advsimd_sleef(__builtin_inf()), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_advsimd_sleef vptrunc_vd_vd_advsimd_sleef(vdouble_advsimd_sleef x) { + + return vtruncate_vd_vd_advsimd_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_fmodd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef n = vabs_vd_vd_advsimd_sleef(x), d = vabs_vd_vd_advsimd_sleef(y), s = vcast_vd_d_advsimd_sleef(1), q; + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(s , vcast_vd_d_advsimd_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble2_advsimd_sleef r = vcast_vd2_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(0)); + vdouble_advsimd_sleef rd = vtoward0_vd_vd_advsimd_sleef(vrec_vd_vd_advsimd_sleef(d)); + + for(int i=0;i<21;i++) { + q = vptrunc_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vtoward0_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r)), rd)); + + q = vsel_vd_vo_vd_vd_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(3), d), vd2getx_vd_vd2_advsimd_sleef(r)), + vge_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), d)), + vcast_vd_d_advsimd_sleef(2), q); + q = vsel_vd_vo_vd_vd_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vgt_vo_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(d, d), vd2getx_vd_vd2_advsimd_sleef(r)), + vge_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), d)), + vcast_vd_d_advsimd_sleef(1), q); + r = ddnormalize_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd2_advsimd_sleef(r, ddmul_vd2_vd_vd_advsimd_sleef(q, vneg_vd_vd_advsimd_sleef(d)))); + if (vtestallones_i_vo64_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), d))) break; + } + + vdouble_advsimd_sleef ret = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), s); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), vd2gety_vd_vd2_advsimd_sleef(r)), d), vcast_vd_d_advsimd_sleef(0), ret); + + ret = vmulsign_vd_vd_vd_advsimd_sleef(ret, x); + + ret = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(n, d), x, ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE vdouble_advsimd_sleef vrintk2_vd_vd_advsimd_sleef(vdouble_advsimd_sleef d) { + + return vrint_vd_vd_advsimd_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_remainderd2_advsimd(vdouble_advsimd_sleef x, vdouble_advsimd_sleef y) { + vdouble_advsimd_sleef n = vabs_vd_vd_advsimd_sleef(x), d = vabs_vd_vd_advsimd_sleef(y), s = vcast_vd_d_advsimd_sleef(1), q; + vopmask_advsimd_sleef o = vlt_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0x1p-1022*2)); + n = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmul_vd_vd_vd_advsimd_sleef(s , vcast_vd_d_advsimd_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble_advsimd_sleef rd = vrec_vd_vd_advsimd_sleef(d); + vdouble2_advsimd_sleef r = vcast_vd2_vd_vd_advsimd_sleef(n, vcast_vd_d_advsimd_sleef(0)); + vopmask_advsimd_sleef qisodd = vneq_vo_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0), vcast_vd_d_advsimd_sleef(0)); + + for(int i=0;i<21;i++) { + q = vrintk2_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), rd)); + + q = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r)), vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(1.5))), vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1.0), vd2getx_vd_vd2_advsimd_sleef(r)), q); + q = vsel_vd_vo_vd_vd_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r)), vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.5))), + vandnot_vo_vo_vo_advsimd_sleef(qisodd, veq_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r)), vmul_vd_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0.5))))), + vcast_vd_d_advsimd_sleef(0.0), q); + if (vtestallones_i_vo64_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(q, vcast_vd_d_advsimd_sleef(0)))) break; + q = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(q, vneg_vd_vd_advsimd_sleef(d))), vadd_vd_vd_vd_advsimd_sleef(q, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(-1), vd2getx_vd_vd2_advsimd_sleef(r))), q); + qisodd = vxor_vo_vo_vo_advsimd_sleef(qisodd, visodd_vo_vd_advsimd_sleef(q)); + r = ddnormalize_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd2_advsimd_sleef(r, ddmul_vd2_vd_vd_advsimd_sleef(q, vneg_vd_vd_advsimd_sleef(d)))); + } + + vdouble_advsimd_sleef ret = vmul_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(r), s); + ret = vmulsign_vd_vd_vd_advsimd_sleef(ret, x); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(y), vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(__builtin_nan("")), x), ret); + ret = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(d, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(__builtin_nan("")), ret); + return ret; +} + +static SLEEF_CONST dd2_advsimd_sleef gammak_advsimd_sleef(vdouble_advsimd_sleef a) { + vdouble2_advsimd_sleef clc = vcast_vd2_d_d_advsimd_sleef(0, 0), clln = vcast_vd2_d_d_advsimd_sleef(1, 0), clld = vcast_vd2_d_d_advsimd_sleef(1, 0); + vdouble2_advsimd_sleef x, y, z; + vdouble_advsimd_sleef t, u; + + vopmask_advsimd_sleef otiny = vlt_vo_vd_vd_advsimd_sleef(vabs_vd_vd_advsimd_sleef(a), vcast_vd_d_advsimd_sleef(1e-306)), oref = vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0.5)); + + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(otiny, vcast_vd2_d_d_advsimd_sleef(0, 0), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(oref, ddadd2_vd2_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), vneg_vd_vd_advsimd_sleef(a)), + vcast_vd2_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)))); + + vopmask_advsimd_sleef o0 = vand_vo_vo_vo_advsimd_sleef(vle_vo_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(0.5), vd2getx_vd_vd2_advsimd_sleef(x)), vle_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(1.1))); + vopmask_advsimd_sleef o2 = vle_vo_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2.3), vd2getx_vd_vd2_advsimd_sleef(x)); + + y = ddnormalize_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1)), x)); + y = ddnormalize_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2)), y)); + y = ddnormalize_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(3)), y)); + y = ddnormalize_vd2_vd2_advsimd_sleef(ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(4)), y)); + + vopmask_advsimd_sleef o = vand_vo_vo_vo_advsimd_sleef(o2, vle_vo_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vcast_vd_d_advsimd_sleef(7))); + clln = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, y, clln); + + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o, ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(5)), x); + + t = vsel_vd_vo_vd_vd_advsimd_sleef(o2, vrec_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x)), vd2getx_vd_vd2_advsimd_sleef(ddnormalize_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vsel_vd_vo_d_d_advsimd_sleef(o0, -1, -2))))); + + u = vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -156.801412704022726379848862, +0.2947916772827614196e+2, +0.7074816000864609279e-7); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +1.120804464289911606838558160000, +0.1281459691827820109e+3, +0.4009244333008730443e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +13.39798545514258921833306020000, +0.2617544025784515043e+3, +0.1040114641628246946e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.116546276599463200848033357000, +0.3287022855685790432e+3, +0.1508349150733329167e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -1.391801093265337481495562410000, +0.2818145867730348186e+3, +0.1288143074933901020e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.015056113040026424412918973400, +0.1728670414673559605e+3, +0.4744167749884993937e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.179540117061234856098844714000, +0.7748735764030416817e+2, -0.6554816306542489902e-7)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.002481743600264997730942489280, +0.2512856643080930752e+2, -0.3189252471452599844e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.029527880945699120504851034100, +0.5766792106140076868e+1, +0.1358883821470355377e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.000540164767892604515196325186, +0.7270275473996180571e+0, -0.4343931277157336040e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.006403362833808069794787256200, +0.8396709124579147809e-1, +0.9724785897406779555e-6)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.000162516262783915816896611252, -0.8211558669746804595e-1, -0.2036886057225966011e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.001914438498565477526465972390, +0.6828831828341884458e-1, +0.4373363141819725815e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +7.20489541602001055898311517e-05, -0.7712481339961671511e-1, -0.9439951268304008677e-5)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.000839498720672087279971000786, +0.8337492023017314957e-1, +0.2050727030376389804e-4)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -5.17179090826059219329394422e-05, -0.9094964931456242518e-1, -0.4492620183431184018e-4)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.000592166437353693882857342347, +0.1000996313575929358e+0, +0.9945751236071875931e-4)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.1113342861544207724e+0, -0.2231547599034983196e-3)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.000784039221720066627493314301, +0.1255096673213020875e+0, +0.5096695247101967622e-3)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.000229472093621399176949318732, -0.1440498967843054368e+0, -0.1192753911667886971e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, -0.002681327160493827160473958490, +0.1695571770041949811e+0, +0.2890510330742210310e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.003472222222222222222175164840, -0.2073855510284092762e+0, -0.7385551028674461858e-2)); + u = vmla_vd_vd_vd_vd_advsimd_sleef(u, t, vsel_vd_vo_vo_d_d_d_advsimd_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705808084277815939e+0, +0.2058080842778455335e-1)); + + y = ddmul_vd2_vd2_vd2_advsimd_sleef(ddadd2_vd2_vd2_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(-0.5)), logk2_advsimd_sleef(x)); + y = ddadd2_vd2_vd2_vd2_advsimd_sleef(y, ddneg_vd2_vd2_advsimd_sleef(x)); + y = ddadd2_vd2_vd2_vd2_advsimd_sleef(y, vcast_vd2_d_d_advsimd_sleef(0.91893853320467278056, -3.8782941580672414498e-17)); + + z = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd_vd_advsimd_sleef (u, t), vsel_vd_vo_d_d_advsimd_sleef(o0, -0.4006856343865314862e+0, -0.6735230105319810201e-1)); + z = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd_advsimd_sleef(z, t), vsel_vd_vo_d_d_advsimd_sleef(o0, +0.8224670334241132030e+0, +0.3224670334241132030e+0)); + z = ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd2_vd_advsimd_sleef(z, t), vsel_vd_vo_d_d_advsimd_sleef(o0, -0.5772156649015328655e+0, +0.4227843350984671345e+0)); + z = ddmul_vd2_vd2_vd_advsimd_sleef(z, t); + + clc = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o2, y, z); + + clld = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o2, ddadd2_vd2_vd2_vd_advsimd_sleef(ddmul_vd2_vd_vd_advsimd_sleef(u, t), vcast_vd_d_advsimd_sleef(1)), clld); + + y = clln; + + clc = vsel_vd2_vo_vd2_vd2_advsimd_sleef(otiny, vcast_vd2_d_d_advsimd_sleef(83.1776616671934334590333, 3.67103459631568507221878e-15), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(oref, ddadd2_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(1.1447298858494001639, 1.026595116270782638e-17), ddneg_vd2_vd2_advsimd_sleef(clc)), clc)); + clln = vsel_vd2_vo_vd2_vd2_advsimd_sleef(otiny, vcast_vd2_d_d_advsimd_sleef(1, 0), vsel_vd2_vo_vd2_vd2_advsimd_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo64_advsimd_sleef(vnot_vo64_vo64_advsimd_sleef(oref))) { + t = vsub_vd_vd_vd_advsimd_sleef(a, vmul_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(INT64_C(1) << 28), vcast_vd_vi_advsimd_sleef(vtruncate_vi_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(1.0 / (INT64_C(1) << 28))))))); + x = ddmul_vd2_vd2_vd2_advsimd_sleef(clld, sinpik_advsimd_sleef(t)); + } + + clld = vsel_vd2_vo_vd2_vd2_advsimd_sleef(otiny, vcast_vd2_vd_vd_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef((INT64_C(1) << 60)*(double)(INT64_C(1) << 60))), vcast_vd_d_advsimd_sleef(0)), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(oref, x, y)); + + return dd2setab_dd2_vd2_vd2_advsimd_sleef(clc, dddiv_vd2_vd2_vd2_advsimd_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_tgammad2_u10advsimd(vdouble_advsimd_sleef a) { + dd2_advsimd_sleef d = gammak_advsimd_sleef(a); + vdouble2_advsimd_sleef y = ddmul_vd2_vd2_vd2_advsimd_sleef(expk2_advsimd_sleef(dd2geta_vd2_dd2_advsimd_sleef(d)), dd2getb_vd2_dd2_advsimd_sleef(d)); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(y)); + vopmask_advsimd_sleef o; + + o = vor_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(-__builtin_inf())), + vand_vo_vo_vo_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)), visint_vo_vd_advsimd_sleef(a))), + vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(visnumber_vo_vd_advsimd_sleef(a), vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0))), visnan_vo_vd_advsimd_sleef(r))); + r = vsel_vd_vo_vd_vd_advsimd_sleef(o, vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + + o = vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(__builtin_inf())), visnumber_vo_vd_advsimd_sleef(a)), + vge_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(-0x1p-1022))), + vor_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)), vgt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(200))), visnan_vo_vd_advsimd_sleef(r))); + r = vsel_vd_vo_vd_vd_advsimd_sleef(o, vmulsign_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(__builtin_inf()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_lgammad2_u10advsimd(vdouble_advsimd_sleef a) { + dd2_advsimd_sleef d = gammak_advsimd_sleef(a); + vdouble2_advsimd_sleef y = ddadd2_vd2_vd2_vd2_advsimd_sleef(dd2geta_vd2_dd2_advsimd_sleef(d), logk2_advsimd_sleef(ddabs_vd2_vd2_advsimd_sleef(dd2getb_vd2_dd2_advsimd_sleef(d)))); + vdouble_advsimd_sleef r = vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(y), vd2gety_vd_vd2_advsimd_sleef(y)); + vopmask_advsimd_sleef o; + + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vd_advsimd_sleef(a), + vor_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vle_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)), visint_vo_vd_advsimd_sleef(a)), + vand_vo_vo_vo_advsimd_sleef(visnumber_vo_vd_advsimd_sleef(a), visnan_vo_vd_advsimd_sleef(r)))); + r = vsel_vd_vo_vd_vd_advsimd_sleef(o, vcast_vd_d_advsimd_sleef(__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef ddmla_vd2_vd_vd2_vd2_advsimd_sleef(vdouble_advsimd_sleef x, vdouble2_advsimd_sleef y, vdouble2_advsimd_sleef z) { + return ddadd_vd2_vd2_vd2_advsimd_sleef(z, ddmul_vd2_vd2_vd_advsimd_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef poly2dd_b_advsimd_sleef(vdouble_advsimd_sleef x, vdouble2_advsimd_sleef c1, vdouble2_advsimd_sleef c0) { return ddmla_vd2_vd_vd2_vd2_advsimd_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef poly2dd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef c1, vdouble2_advsimd_sleef c0) { return ddmla_vd2_vd_vd2_vd2_advsimd_sleef(x, vcast_vd2_vd_vd_advsimd_sleef(c1, vcast_vd_d_advsimd_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_advsimd_sleef poly4dd_advsimd_sleef(vdouble_advsimd_sleef x, vdouble_advsimd_sleef c3, vdouble2_advsimd_sleef c2, vdouble2_advsimd_sleef c1, vdouble2_advsimd_sleef c0) { + return ddmla_vd2_vd_vd2_vd2_advsimd_sleef(vmul_vd_vd_vd_advsimd_sleef(x, x), poly2dd_advsimd_sleef(x, c3, c2), poly2dd_b_advsimd_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_erfd2_u10advsimd(vdouble_advsimd_sleef a) { + vdouble_advsimd_sleef t, x = vabs_vd_vd_advsimd_sleef(a); + vdouble2_advsimd_sleef t2; + vdouble_advsimd_sleef x2 = vmul_vd_vd_vd_advsimd_sleef(x, x), x4 = vmul_vd_vd_vd_advsimd_sleef(x2, x2); + vdouble_advsimd_sleef x8 = vmul_vd_vd_vd_advsimd_sleef(x4, x4), x16 = vmul_vd_vd_vd_advsimd_sleef(x8, x8); + vopmask_advsimd_sleef o25 = vle_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo64_advsimd_sleef(o25)), 1)) { + + t = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vcast_vd_d_advsimd_sleef(-0.2083271002525222097e-14)), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.7151909970790897009e-13)), (vcast_vd_d_advsimd_sleef(-0.1162238220110999364e-11)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.1186474230821585259e-10)), (vcast_vd_d_advsimd_sleef(-0.8499973178354613440e-10)))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.4507647462598841629e-9)), (vcast_vd_d_advsimd_sleef(-0.1808044474288848915e-8)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.5435081826716212389e-8)), (vcast_vd_d_advsimd_sleef(-0.1143939895758628484e-7)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.1215442362680889243e-7)), (vcast_vd_d_advsimd_sleef(+0.1669878756181250355e-7)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(-0.9808074602255194288e-7)), (vcast_vd_d_advsimd_sleef(+0.1389000557865837204e-6)))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.2945514529987331866e-6)), (vcast_vd_d_advsimd_sleef(-0.1842918273003998283e-5)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.3417987836115362136e-5)), (vcast_vd_d_advsimd_sleef(+0.3860236356493129101e-5)))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(-0.3309403072749947546e-4)), (vcast_vd_d_advsimd_sleef(+0.1060862922597579532e-3)))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), (vcast_vd_d_advsimd_sleef(+0.2323253155213076174e-3)), (vcast_vd_d_advsimd_sleef(+0.1490149719145544729e-3))))))))))) + + ; + t2 = poly4dd_advsimd_sleef(x, t, + vcast_vd2_d_d_advsimd_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_advsimd_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_advsimd_sleef(0.07052369794346953491, 9.5846628070792092842e-19)); + t2 = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), ddmul_vd2_vd2_vd_advsimd_sleef(t2, x)); + t2 = ddsqu_vd2_vd2_advsimd_sleef(t2); + t2 = ddsqu_vd2_vd2_advsimd_sleef(t2); + t2 = ddsqu_vd2_vd2_advsimd_sleef(t2); + t2 = ddsqu_vd2_vd2_advsimd_sleef(t2); + t2 = ddrec_vd2_vd2_advsimd_sleef(t2); + } else { + + t = vmla_vd_vd_vd_vd_advsimd_sleef((x16), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.2083271002525222097e-14, -0.4024015130752621932e-18))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.7151909970790897009e-13, +0.3847193332817048172e-16))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.1162238220110999364e-11, -0.1749316241455644088e-14))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1186474230821585259e-10, +0.5029618322872872715e-13))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.8499973178354613440e-10, -0.1025221466851463164e-11))))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x8), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.4507647462598841629e-9, +0.1573695559331945583e-10))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.1808044474288848915e-8, -0.1884658558040203709e-9))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.5435081826716212389e-8, +0.1798167853032159309e-8))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.1143939895758628484e-7, -0.1380745342355033142e-7))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1215442362680889243e-7, +0.8525705726469103499e-7))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1669878756181250355e-7, -0.4160448058101303405e-6))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.9808074602255194288e-7, +0.1517272660008588485e-5))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1389000557865837204e-6, -0.3341634127317201697e-5))))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x4), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.2945514529987331866e-6, -0.2515023395879724513e-5))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.1842918273003998283e-5, +0.6539731269664907554e-4))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.3417987836115362136e-5, -0.3551065097428388658e-3))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.3860236356493129101e-5, +0.1210736097958368864e-2))))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x2), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, -0.3309403072749947546e-4, -0.2605566912579998680e-2))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1060862922597579532e-3, +0.1252823202436093193e-2))))), (vmla_vd_vd_vd_vd_advsimd_sleef((x), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.2323253155213076174e-3, +0.1820191395263313222e-1))), ((vsel_vd_vo_d_d_advsimd_sleef(o25, +0.1490149719145544729e-3, -0.1021557155453465954e+0)))))))))))) + + ; + t2 = poly4dd_advsimd_sleef(x, t, + vsel_vd2_vo_vd2_vd2_advsimd_sleef(o25, vcast_vd2_d_d_advsimd_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_advsimd_sleef(-0.63691044383641748361, -2.4249477526539431839e-17)), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(o25, vcast_vd2_d_d_advsimd_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_advsimd_sleef(-1.1282926061803961737, -6.2970338860410996505e-17)), + vsel_vd2_vo_vd2_vd2_advsimd_sleef(o25, vcast_vd2_d_d_advsimd_sleef(0.07052369794346953491, 9.5846628070792092842e-19), + vcast_vd2_d_d_advsimd_sleef(-1.2261313785184804967e-05, -5.5329707514490107044e-22))); + vdouble2_advsimd_sleef s2 = ddadd_vd2_vd_vd2_advsimd_sleef(vcast_vd_d_advsimd_sleef(1), ddmul_vd2_vd2_vd_advsimd_sleef(t2, x)); + s2 = ddsqu_vd2_vd2_advsimd_sleef(s2); + s2 = ddsqu_vd2_vd2_advsimd_sleef(s2); + s2 = ddsqu_vd2_vd2_advsimd_sleef(s2); + s2 = ddsqu_vd2_vd2_advsimd_sleef(s2); + s2 = ddrec_vd2_vd2_advsimd_sleef(s2); + t2 = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o25, s2, vcast_vd2_vd_vd_advsimd_sleef(expk_advsimd_sleef(t2), vcast_vd_d_advsimd_sleef(0))); + } + + t2 = ddadd2_vd2_vd2_vd_advsimd_sleef(t2, vcast_vd_d_advsimd_sleef(-1)); + + vdouble_advsimd_sleef z = vneg_vd_vd_advsimd_sleef(vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(t2), vd2gety_vd_vd2_advsimd_sleef(t2))); + z = vsel_vd_vo_vd_vd_advsimd_sleef(vlt_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1e-8)), vmul_vd_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(1.12837916709551262756245475959)), z); + z = vsel_vd_vo_vd_vd_advsimd_sleef(vge_vo_vd_vd_advsimd_sleef(x, vcast_vd_d_advsimd_sleef(6)), vcast_vd_d_advsimd_sleef(1), z); + z = vsel_vd_vo_vd_vd_advsimd_sleef(visinf_vo_vd_advsimd_sleef(a), vcast_vd_d_advsimd_sleef(1), z); + z = vsel_vd_vo_vd_vd_advsimd_sleef(veq_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)), vcast_vd_d_advsimd_sleef(0), z); + z = vmulsign_vd_vd_vd_advsimd_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_advsimd_sleef Sleef_erfcd2_u15advsimd(vdouble_advsimd_sleef a) { + vdouble_advsimd_sleef s = a, r = vcast_vd_d_advsimd_sleef(0), t; + vdouble2_advsimd_sleef u, d, x; + a = vabs_vd_vd_advsimd_sleef(a); + vopmask_advsimd_sleef o0 = vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(1.0)); + vopmask_advsimd_sleef o1 = vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(2.2)); + vopmask_advsimd_sleef o2 = vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(4.2)); + vopmask_advsimd_sleef o3 = vlt_vo_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(27.3)); + + u = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o0, ddmul_vd2_vd_vd_advsimd_sleef(a, a), vsel_vd2_vo_vd2_vd2_advsimd_sleef(o1, vcast_vd2_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0)), dddiv_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(1, 0), vcast_vd2_vd_vd_advsimd_sleef(a, vcast_vd_d_advsimd_sleef(0))))); + + t = vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.6801072401395386139e-20, +0.3438010341362585303e-12, -0.5757819536420710449e+2, +0.2334249729638701319e+5); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.2161766247570055669e-18, -0.1237021188160598264e-10, +0.4669289654498104483e+3, -0.4695661044933107769e+5)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.4695919173301595670e-17, +0.2117985839877627852e-09, -0.1796329879461355858e+4, +0.3173403108748643353e+5)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.9049140419888007122e-16, -0.2290560929177369506e-08, +0.4355892193699575728e+4, +0.3242982786959573787e+4)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.1634018903557410728e-14, +0.1748931621698149538e-07, -0.7456258884965764992e+4, -0.2014717999760347811e+5)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.2783485786333451745e-13, -0.9956602606623249195e-07, +0.9553977358167021521e+4, +0.1554006970967118286e+5)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.4463221276786415752e-12, +0.4330010240640327080e-06, -0.9470019905444229153e+4, -0.6150874190563554293e+4)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.6711366622850136563e-11, -0.1435050600991763331e-05, +0.7387344321849855078e+4, +0.1240047765634815732e+4)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.9422759050232662223e-10, +0.3460139479650695662e-05, -0.4557713054166382790e+4, -0.8210325475752699731e+2)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.1229055530100229098e-08, -0.4988908180632898173e-05, +0.2207866967354055305e+4, +0.3242443880839930870e+2)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.1480719281585086512e-07, -0.1308775976326352012e-05, -0.8217975658621754746e+3, -0.2923418863833160586e+2)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.1636584469123399803e-06, +0.2825086540850310103e-04, +0.2268659483507917400e+3, +0.3457461732814383071e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.1646211436588923575e-05, -0.6393913713069986071e-04, -0.4633361260318560682e+2, +0.5489730155952392998e+1)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.1492565035840623511e-04, -0.2566436514695078926e-04, +0.9557380123733945965e+1, +0.1559934132251294134e-2)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.1205533298178967851e-03, +0.5895792375659440364e-03, -0.2958429331939661289e+1, -0.1541741566831520638e+1)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.8548327023450850081e-03, -0.1695715579163588598e-02, +0.1670329508092765480e+0, +0.2823152230558364186e-5)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, +0.5223977625442187932e-02, +0.2089116434918055149e-03, +0.6096615680115419211e+0, +0.6249999184195342838e+0)); + t = vmla_vd_vd_vd_vd_advsimd_sleef(t, vd2getx_vd_vd2_advsimd_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.2686617064513125222e-01, +0.1912855949584917753e-01, +0.1059212443193543585e-2, +0.1741749416408701288e-8)); + + d = ddmul_vd2_vd2_vd_advsimd_sleef(u, t); + d = ddadd2_vd2_vd2_vd2_advsimd_sleef(d, vcast_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, 0.11283791670955126141, -0.10277263343147646779, -0.50005180473999022439, -0.5000000000258444377), + vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -4.0175691625932118483e-18, -6.2338714083404900225e-18, 2.6362140569041995803e-17, -4.0074044712386992281e-17))); + d = ddmul_vd2_vd2_vd2_advsimd_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_advsimd_sleef(d, vcast_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.37612638903183753802, -0.63661976742916359662, 1.601106273924963368e-06, 2.3761973137523364792e-13), + vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, 1.3391897206042552387e-17, 7.6321019159085724662e-18, 1.1974001857764476775e-23, -1.1670076950531026582e-29))); + d = ddmul_vd2_vd2_vd2_advsimd_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_advsimd_sleef(d, vcast_vd2_vd_vd_advsimd_sleef(vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, 1.1283791670955125586, -1.1283791674717296161, -0.57236496645145429341, -0.57236494292470108114), + vsel_vd_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, 1.5335459613165822674e-17, 8.0896847755965377194e-17, 3.0704553245872027258e-17, -2.3984352208056898003e-17))); + + x = ddmul_vd2_vd2_vd_advsimd_sleef(vsel_vd2_vo_vd2_vd2_advsimd_sleef(o1, d, vcast_vd2_vd_vd_advsimd_sleef(vneg_vd_vd_advsimd_sleef(a), vcast_vd_d_advsimd_sleef(0))), a); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o1, x, ddadd2_vd2_vd2_vd2_advsimd_sleef(x, d)); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o0, ddsub_vd2_vd2_vd2_advsimd_sleef(vcast_vd2_d_d_advsimd_sleef(1, 0), x), expk2_advsimd_sleef(x)); + x = vsel_vd2_vo_vd2_vd2_advsimd_sleef(o1, x, ddmul_vd2_vd2_vd2_advsimd_sleef(x, u)); + + r = vsel_vd_vo_vd_vd_advsimd_sleef(o3, vadd_vd_vd_vd_advsimd_sleef(vd2getx_vd_vd2_advsimd_sleef(x), vd2gety_vd_vd2_advsimd_sleef(x)), vcast_vd_d_advsimd_sleef(0)); + r = vsel_vd_vo_vd_vd_advsimd_sleef(vsignbit_vo_vd_advsimd_sleef(s), vsub_vd_vd_vd_advsimd_sleef(vcast_vd_d_advsimd_sleef(2), r), r); + r = vsel_vd_vo_vd_vd_advsimd_sleef(visnan_vo_vd_advsimd_sleef(s), vcast_vd_d_advsimd_sleef(__builtin_nan("")), r); + return r; +} + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const float Sleef_rempitabsp[]; + +typedef struct { + vfloat_advsimd_sleef x, y; +} vfloat2_advsimd_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vf2getx_vf_vf2_advsimd_sleef(vfloat2_advsimd_sleef v) { return v.x; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vf2gety_vf_vf2_advsimd_sleef(vfloat2_advsimd_sleef v) { return v.y; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vf2setxy_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { vfloat2_advsimd_sleef v; v.x = x; v.y = y; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vf2setx_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef v, vfloat_advsimd_sleef d) { v.x = d; return v; } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vf2sety_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef v, vfloat_advsimd_sleef d) { v.y = d; return v; } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vupper_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return vreinterpret_vf_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vreinterpret_vi2_vf_advsimd_sleef(d), vcast_vi2_i_advsimd_sleef(0xfffff000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vcast_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef h, vfloat_advsimd_sleef l) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vcast_vf2_f_f_advsimd_sleef(float h, float l) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(h), vcast_vf_f_advsimd_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vcast_vf2_d_advsimd_sleef(double d) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(d - (float)d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vsel_vf2_vo_vf2_vf2_advsimd_sleef(vopmask_advsimd_sleef m, vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(m, vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)), vsel_vf_vo_vf_vf_advsimd_sleef(m, vf2gety_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vsel_vf2_vo_f_f_f_f_advsimd_sleef(vopmask_advsimd_sleef o, float x1, float y1, float x0, float y0) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_f_f_advsimd_sleef(o, x1, x0), vsel_vf_vo_f_f_advsimd_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vsel_vf2_vo_vo_d_d_d_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, double d0, double d1, double d2) { + return vsel_vf2_vo_vf2_vf2_advsimd_sleef(o0, vcast_vf2_d_advsimd_sleef(d0), vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, vcast_vf2_d_advsimd_sleef(d1), vcast_vf2_d_advsimd_sleef(d2))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vsel_vf2_vo_vo_vo_d_d_d_d_advsimd_sleef(vopmask_advsimd_sleef o0, vopmask_advsimd_sleef o1, vopmask_advsimd_sleef o2, double d0, double d1, double d2, double d3) { + return vsel_vf2_vo_vf2_vf2_advsimd_sleef(o0, vcast_vf2_d_advsimd_sleef(d0), vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, vcast_vf2_d_advsimd_sleef(d1), vsel_vf2_vo_vf2_vf2_advsimd_sleef(o2, vcast_vf2_d_advsimd_sleef(d2), vcast_vf2_d_advsimd_sleef(d3)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef vabs_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x) { + return vcast_vf2_vf_vf_advsimd_sleef(vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0)), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)))), + vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0)), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vadd_vf_3vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2) { + return vadd_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vadd_vf_4vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3) { + return vadd_vf_3vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vadd_vf_5vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3, vfloat_advsimd_sleef v4) { + return vadd_vf_4vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vadd_vf_6vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3, vfloat_advsimd_sleef v4, vfloat_advsimd_sleef v5) { + return vadd_vf_5vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vadd_vf_7vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3, vfloat_advsimd_sleef v4, vfloat_advsimd_sleef v5, vfloat_advsimd_sleef v6) { + return vadd_vf_6vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vsub_vf_3vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2) { + return vsub_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vsub_vf_4vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3) { + return vsub_vf_3vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vsub_vf_5vf_advsimd_sleef(vfloat_advsimd_sleef v0, vfloat_advsimd_sleef v1, vfloat_advsimd_sleef v2, vfloat_advsimd_sleef v3, vfloat_advsimd_sleef v4) { + return vsub_vf_4vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfneg_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x) { + return vcast_vf2_vf_vf_advsimd_sleef(vneg_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)), vneg_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfabs_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x) { + return vcast_vf2_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)), + vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x)), vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfnormalize_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef t) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t), vf2gety_vf_vf2_advsimd_sleef(t)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t), s), vf2gety_vf_vf2_advsimd_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfscale_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef d, vfloat_advsimd_sleef s) { + return vf2setxy_vf2_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), s), vmul_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(x, y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd2_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(x, y); + vfloat_advsimd_sleef v = vsub_vf_vf_vf_advsimd_sleef(s, x); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, vsub_vf_vf_vf_advsimd_sleef(s, v)), vsub_vf_vf_vf_advsimd_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd2_vf2_vf_vf2_advsimd_sleef(vfloat_advsimd_sleef x, vfloat2_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(x, vf2getx_vf_vf2_advsimd_sleef(y)); + vfloat_advsimd_sleef v = vsub_vf_vf_vf_advsimd_sleef(s, x); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, vsub_vf_vf_vf_advsimd_sleef(s, v)), vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), v)), vf2gety_vf_vf2_advsimd_sleef(y))); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_3vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), s), y, vf2gety_vf_vf2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsub_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), s), y), vf2gety_vf_vf2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd2_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), y); + vfloat_advsimd_sleef v = vsub_vf_vf_vf_advsimd_sleef(s, vf2getx_vf_vf2_advsimd_sleef(x)); + vfloat_advsimd_sleef t = vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vsub_vf_vf_vf_advsimd_sleef(s, v)), vsub_vf_vf_vf_advsimd_sleef(y, v)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(t, vf2gety_vf_vf2_advsimd_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd_vf2_vf_vf2_advsimd_sleef(vfloat_advsimd_sleef x, vfloat2_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(x, vf2getx_vf_vf2_advsimd_sleef(y)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_3vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, s), vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd_vf2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_4vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), s), vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfadd2_vf2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + vfloat_advsimd_sleef s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)); + vfloat_advsimd_sleef v = vsub_vf_vf_vf_advsimd_sleef(s, vf2getx_vf_vf2_advsimd_sleef(x)); + vfloat_advsimd_sleef t = vadd_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vsub_vf_vf_vf_advsimd_sleef(s, v)), vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), v)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vadd_vf_vf_vf_advsimd_sleef(t, vadd_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsub_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + + vfloat_advsimd_sleef s = vsub_vf_vf_vf_advsimd_sleef(x, y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vsub_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsub_vf2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + + vfloat_advsimd_sleef s = vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)); + vfloat_advsimd_sleef t = vsub_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), s); + t = vsub_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(y)); + t = vadd_vf_vf_vf_advsimd_sleef(t, vf2gety_vf_vf2_advsimd_sleef(x)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vsub_vf_vf_vf_advsimd_sleef(t, vf2gety_vf_vf2_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfdiv_vf2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef n, vfloat2_advsimd_sleef d) { + vfloat_advsimd_sleef t = vrec_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d)); + vfloat_advsimd_sleef s = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(n), t); + vfloat_advsimd_sleef u = vfmapn_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(n), s); + vfloat_advsimd_sleef v = vfmanp_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(d), t, vfmanp_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), t, vcast_vf_f_advsimd_sleef(1))); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vfma_vf_vf_vf_vf_advsimd_sleef(s, v, vfma_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfmul_vf2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vmul_vf_vf_vf_advsimd_sleef(x, y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vfmapn_vf_vf_vf_vf_advsimd_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsqu_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x) { + vfloat_advsimd_sleef s = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vfma_vf_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)), vf2gety_vf_vf2_advsimd_sleef(x), vfmapn_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef dfsqu_vf_vf2_advsimd_sleef(vfloat2_advsimd_sleef x) { + return vfma_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x), vadd_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)), vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfmul_vf2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + vfloat_advsimd_sleef s = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vfma_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(y), vfma_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y), vfmapn_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef dfmul_vf_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat2_advsimd_sleef y) { + return vfma_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y), vfma_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y), vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfmul_vf2_vf2_vf_advsimd_sleef(vfloat2_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef s = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), y); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vfma_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x), y, vfmapn_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfrec_vf2_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef s = vrec_vf_vf_advsimd_sleef(d); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(s, vfmanp_vf_vf_vf_vf_advsimd_sleef(d, s, vcast_vf_f_advsimd_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfrec_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef d) { + vfloat_advsimd_sleef s = vrec_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d)); + return vf2setxy_vf2_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(s, vfmanp_vf_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(d), s, vfmanp_vf_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), s, vcast_vf_f_advsimd_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsqrt_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef d) { + + vfloat_advsimd_sleef t = vsqrt_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d))); + return dfscale_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf2_advsimd_sleef(d, dfmul_vf2_vf_vf_advsimd_sleef(t, t)), dfrec_vf2_vf_advsimd_sleef(t)), vcast_vf_f_advsimd_sleef(0.5)); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfsqrt_vf2_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef t = vsqrt_vf_vf_advsimd_sleef(d); + return dfscale_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf2_advsimd_sleef(d, dfmul_vf2_vf_vf_advsimd_sleef(t, t)), dfrec_vf2_vf_advsimd_sleef(t)), vcast_vf_f_advsimd_sleef(0.5f)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visnegzero_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return veq_vo_vi2_vi2_advsimd_sleef(vreinterpret_vi2_vf_advsimd_sleef(d), vreinterpret_vi2_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE vopmask_advsimd_sleef vnot_vo32_vo32_advsimd_sleef(vopmask_advsimd_sleef x) { + return vxor_vo_vo_vo_advsimd_sleef(x, veq_vo_vi2_vi2_advsimd_sleef(vcast_vi2_i_advsimd_sleef(0), vcast_vi2_i_advsimd_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_advsimd_sleef vsignbit_vm_vf_advsimd_sleef(vfloat_advsimd_sleef f) { + return vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(f), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vmulsign_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(x), vsignbit_vm_vf_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vcopysign_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vandnot_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f)), vreinterpret_vm_vf_advsimd_sleef(x)), + vand_vm_vm_vm_advsimd_sleef (vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f)), vreinterpret_vm_vf_advsimd_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vsign_vf_vf_advsimd_sleef(vfloat_advsimd_sleef f) { + return vreinterpret_vf_vm_advsimd_sleef(vor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f)), vand_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f)), vreinterpret_vm_vf_advsimd_sleef(f)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef vsignbit_vo_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + return veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vreinterpret_vi2_vf_advsimd_sleef(d), vcast_vi2_i_advsimd_sleef(0x80000000)), vcast_vi2_i_advsimd_sleef(0x80000000)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_advsimd_sleef vsel_vi2_vf_vf_vi2_vi2_advsimd_sleef(vfloat_advsimd_sleef f0, vfloat_advsimd_sleef f1, vint2_advsimd_sleef x, vint2_advsimd_sleef y) { + return vsel_vi2_vo_vi2_vi2_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(f0, f1), x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_advsimd_sleef vsel_vi2_vf_vi2_advsimd_sleef(vfloat_advsimd_sleef d, vint2_advsimd_sleef x) { + return vand_vi2_vo_vi2_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(d), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visint_vo_vf_advsimd_sleef(vfloat_advsimd_sleef y) { return veq_vo_vf_vf_advsimd_sleef(vtruncate_vf_vf_advsimd_sleef(y), y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_advsimd_sleef visnumber_vo_vf_advsimd_sleef(vfloat_advsimd_sleef x) { return vnot_vo32_vo32_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(x))); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_advsimd_sleef vilogbk_vi2_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(5.421010862427522E-20f)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.8446744073709552E19f), d), d); + vint2_advsimd_sleef q = vand_vi2_vi2_vi2_advsimd_sleef(vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(vreinterpret_vi2_vf_advsimd_sleef(d)), 23)), vcast_vi2_i_advsimd_sleef(0xff)); + q = vsub_vi2_vi2_vi2_advsimd_sleef(q, vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vcast_vi2_i_advsimd_sleef(64 + 0x7f), vcast_vi2_i_advsimd_sleef(0x7f))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_advsimd_sleef vilogb2k_vi2_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q = vreinterpret_vi2_vf_advsimd_sleef(d); + q = vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(q), 23)); + q = vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(0xff)); + q = vsub_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(0x7f)); + return q; +} + +SLEEF_INLINE SLEEF_CONST vint2_advsimd_sleef Sleef_ilogbf4_advsimd(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef e = vilogbk_vi2_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.0f)), vcast_vi2_i_advsimd_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(visnan_vo_vf_advsimd_sleef(d), vcast_vi2_i_advsimd_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vcast_vi2_i_advsimd_sleef(2147483647), e); + return e; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vpow2i_vf_vi2_advsimd_sleef(vint2_advsimd_sleef q) { + return vreinterpret_vf_vi2_advsimd_sleef(vshlq_n_s32(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(0x7f)), 23)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vldexp_vf_vf_vi2_advsimd_sleef(vfloat_advsimd_sleef x, vint2_advsimd_sleef q) { + vfloat_advsimd_sleef u; + vint2_advsimd_sleef m = vshrq_n_s32(q, 31); + m = vshlq_n_s32(vsub_vi2_vi2_vi2_advsimd_sleef(vshrq_n_s32(vadd_vi2_vi2_vi2_advsimd_sleef(m, q), 6), m), 4); + q = vsub_vi2_vi2_vi2_advsimd_sleef(q, vshlq_n_s32(m, 2)); + m = vadd_vi2_vi2_vi2_advsimd_sleef(m, vcast_vi2_i_advsimd_sleef(0x7f)); + m = vand_vi2_vi2_vi2_advsimd_sleef(vgt_vi2_vi2_vi2_advsimd_sleef(m, vcast_vi2_i_advsimd_sleef(0)), m); + vint2_advsimd_sleef n = vgt_vi2_vi2_vi2_advsimd_sleef(m, vcast_vi2_i_advsimd_sleef(0xff)); + m = vor_vi2_vi2_vi2_advsimd_sleef(vandnot_vi2_vi2_vi2_advsimd_sleef(n, m), vand_vi2_vi2_vi2_advsimd_sleef(n, vcast_vi2_i_advsimd_sleef(0xff))); + u = vreinterpret_vf_vi2_advsimd_sleef(vshlq_n_s32(m, 23)); + x = vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x, u), u), u), u); + u = vreinterpret_vf_vi2_advsimd_sleef(vshlq_n_s32(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(0x7f)), 23)); + return vmul_vf_vf_vf_advsimd_sleef(x, u); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vldexp2_vf_vf_vi2_advsimd_sleef(vfloat_advsimd_sleef d, vint2_advsimd_sleef e) { + return vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vpow2i_vf_vi2_advsimd_sleef(vshrq_n_s32(e, 1))), vpow2i_vf_vi2_advsimd_sleef(vsub_vi2_vi2_vi2_advsimd_sleef(e, vshrq_n_s32(e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vldexp3_vf_vf_vi2_advsimd_sleef(vfloat_advsimd_sleef d, vint2_advsimd_sleef q) { + return vreinterpret_vf_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(vreinterpret_vi2_vf_advsimd_sleef(d), vshlq_n_s32(q, 23))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_ldexpf4_advsimd(vfloat_advsimd_sleef x, vint2_advsimd_sleef q) { return vldexp_vf_vf_vi2_advsimd_sleef(x, q); } + +typedef struct { + vfloat_advsimd_sleef d; + vint2_advsimd_sleef i; +} fi_t_advsimd_sleef; + +static vfloat_advsimd_sleef figetd_vf_di_advsimd_sleef(fi_t_advsimd_sleef d) { return d.d; } +static vint2_advsimd_sleef figeti_vi2_di_advsimd_sleef(fi_t_advsimd_sleef d) { return d.i; } +static fi_t_advsimd_sleef fisetdi_fi_vf_vi2_advsimd_sleef(vfloat_advsimd_sleef d, vint2_advsimd_sleef i) { + fi_t_advsimd_sleef r = { d, i }; + return r; +} + +typedef struct { + vfloat2_advsimd_sleef df_advsimd_sleef; + vint2_advsimd_sleef i; +} dfi_t_advsimd_sleef; + +static vfloat2_advsimd_sleef dfigetdf_vf2_dfi_advsimd_sleef(dfi_t_advsimd_sleef d) { return d.df_advsimd_sleef; } +static vint2_advsimd_sleef dfigeti_vi2_dfi_advsimd_sleef(dfi_t_advsimd_sleef d) { return d.i; } +static dfi_t_advsimd_sleef dfisetdfi_dfi_vf2_vi2_advsimd_sleef(vfloat2_advsimd_sleef v, vint2_advsimd_sleef i) { + dfi_t_advsimd_sleef r = { v, i }; + return r; +} +static dfi_t_advsimd_sleef dfisetdf_dfi_dfi_vf2_advsimd_sleef(dfi_t_advsimd_sleef dfi_advsimd_sleef, vfloat2_advsimd_sleef v) { + dfi_advsimd_sleef.df_advsimd_sleef = v; + return dfi_advsimd_sleef; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vorsign_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + return vreinterpret_vf_vm_advsimd_sleef(vor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(x), vsignbit_vm_vf_advsimd_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST fi_t_advsimd_sleef rempisubf_advsimd_sleef(vfloat_advsimd_sleef x) { + + vfloat_advsimd_sleef y = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(4))); + vint2_advsimd_sleef vi = vtruncate_vi2_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(y, vmul_vf_vf_vf_advsimd_sleef(vrint_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(4)))); + return fisetdi_fi_vf_vi2_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, vmul_vf_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0.25))), vi); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST dfi_t_advsimd_sleef rempif_advsimd_sleef(vfloat_advsimd_sleef a) { + vfloat2_advsimd_sleef x, y; + vint2_advsimd_sleef ex = vilogb2k_vi2_vf_advsimd_sleef(a); + + ex = vsub_vi2_vi2_vi2_advsimd_sleef(ex, vcast_vi2_i_advsimd_sleef(25)); + vint2_advsimd_sleef q = vand_vi2_vo_vi2_advsimd_sleef(vgt_vo_vi2_vi2_advsimd_sleef(ex, vcast_vi2_i_advsimd_sleef(90-25)), vcast_vi2_i_advsimd_sleef(-64)); + a = vldexp3_vf_vf_vi2_advsimd_sleef(a, q); + ex = vandnot_vi2_vi2_vi2_advsimd_sleef(vshrq_n_s32(ex, 31), ex); + ex = vshlq_n_s32(ex, 2); + x = dfmul_vf2_vf_vf_advsimd_sleef(a, vgather_vf_p_vi2_advsimd_sleef(Sleef_rempitabsp, ex)); + fi_t_advsimd_sleef di = rempisubf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)); + q = figeti_vi2_di_advsimd_sleef(di); + x = vf2setx_vf2_vf2_vf_advsimd_sleef(x, figetd_vf_di_advsimd_sleef(di)); + x = dfnormalize_vf2_vf2_advsimd_sleef(x); + y = dfmul_vf2_vf_vf_advsimd_sleef(a, vgather_vf_p_vi2_advsimd_sleef(Sleef_rempitabsp+1, ex)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(x, y); + di = rempisubf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)); + q = vadd_vi2_vi2_vi2_advsimd_sleef(q, figeti_vi2_di_advsimd_sleef(di)); + x = vf2setx_vf2_vf2_vf_advsimd_sleef(x, figetd_vf_di_advsimd_sleef(di)); + x = dfnormalize_vf2_vf2_advsimd_sleef(x); + y = vcast_vf2_vf_vf_advsimd_sleef(vgather_vf_p_vi2_advsimd_sleef(Sleef_rempitabsp+2, ex), vgather_vf_p_vi2_advsimd_sleef(Sleef_rempitabsp+3, ex)); + y = dfmul_vf2_vf2_vf_advsimd_sleef(y, a); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(x, y); + x = dfnormalize_vf2_vf2_advsimd_sleef(x); + x = dfmul_vf2_vf2_vf2_advsimd_sleef(x, vcast_vf2_f_f_advsimd_sleef(3.1415927410125732422f*2, -8.7422776573475857731e-08f*2)); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(a), vcast_vf_f_advsimd_sleef(0.7f)), vcast_vf2_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), x); + return dfisetdfi_dfi_vf2_vi2_advsimd_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sinf4_u35advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_advsimd_sleef(q); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(39000)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_advsimd_sleef(q); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.140625f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.0009670257568359375f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-6.2771141529083251953e-07f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.2154201256553420762e-10f), d); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(3)); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vsel_vi2_vo_vi2_vi2_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vi2_i_advsimd_sleef(2), vcast_vi2_i_advsimd_sleef(1))); + q = vshrq_n_s32(q, 2); + vopmask_advsimd_sleef o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)); + vfloat2_advsimd_sleef x = vcast_vf2_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)))); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef), x); + dfi_advsimd_sleef = dfisetdf_dfi_dfi_vf2_advsimd_sleef(dfi_advsimd_sleef, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, x, dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + d = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vf2gety_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + + d = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(r), visnan_vo_vf_advsimd_sleef(r)), vreinterpret_vm_vf_advsimd_sleef(d))); + } + + s = vmul_vf_vf_vf_advsimd_sleef(d, d); + + d = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(d))); + + u = vcast_vf_f_advsimd_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, d)), d); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_cosf4_u35advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_advsimd_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vcast_vi2_i_advsimd_sleef(1)); + + u = vcast_vf_vi2_advsimd_sleef(q); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(39000)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_advsimd_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vcast_vi2_i_advsimd_sleef(1)); + + u = vcast_vf_vi2_advsimd_sleef(q); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.140625f*0.5f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.0009670257568359375f*0.5f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-6.2771141529083251953e-07f*0.5f), d); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.2154201256553420762e-10f*0.5f), d); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(3)); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vsel_vi2_vo_vi2_vi2_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vi2_i_advsimd_sleef(8), vcast_vi2_i_advsimd_sleef(7))); + q = vshrq_n_s32(q, 1); + vopmask_advsimd_sleef o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(0)); + vfloat_advsimd_sleef y = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(0), vcast_vf_f_advsimd_sleef(-1)); + vfloat2_advsimd_sleef x = vcast_vf2_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef), x); + dfi_advsimd_sleef = dfisetdf_dfi_dfi_vf2_advsimd_sleef(dfi_advsimd_sleef, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, x, dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + d = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vf2gety_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + + d = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(r), visnan_vo_vf_advsimd_sleef(r)), vreinterpret_vm_vf_advsimd_sleef(d))); + } + + s = vmul_vf_vf_vf_advsimd_sleef(d, d); + + d = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(0)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(d))); + + u = vcast_vf_f_advsimd_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_tanf4_u35advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, x; + + x = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f*0.5f)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_advsimd_sleef(q); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f), x); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f), x); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f), x); + } else if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(39000)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_advsimd_sleef(q); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.140625f*0.5f), x); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.0009670257568359375f*0.5f), x); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-6.2771141529083251953e-07f*0.5f), x); + x = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.2154201256553420762e-10f*0.5f), x); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef); + x = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vf2gety_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + x = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)), vreinterpret_vm_vf_advsimd_sleef(x))); + x = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), d, x); + } + + s = vmul_vf_vf_vf_advsimd_sleef(x, x); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)); + x = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(x))); + + vfloat_advsimd_sleef s2 = vmul_vf_vf_vf_advsimd_sleef(s, s), s4 = vmul_vf_vf_vf_advsimd_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_advsimd_sleef((s4), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.00927245803177356719970703f)), (vcast_vf_f_advsimd_sleef(0.00331984995864331722259521f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((s2), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.0242998078465461730957031f)), (vcast_vf_f_advsimd_sleef(0.0534495301544666290283203f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.133383005857467651367188f)), (vcast_vf_f_advsimd_sleef(0.333331853151321411132812f))))))) + + ; + + u = vmla_vf_vf_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, x), x); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(o, vrec_vf_vf_advsimd_sleef(u), u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sinf4_u10advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, v; + vfloat2_advsimd_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_advsimd_sleef(u); + v = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f), d); + s = dfadd2_vf2_vf_vf_advsimd_sleef(v, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f))); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(3)); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vsel_vi2_vo_vi2_vi2_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vi2_i_advsimd_sleef(2), vcast_vi2_i_advsimd_sleef(1))); + q = vshrq_n_s32(q, 2); + vopmask_advsimd_sleef o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)); + vfloat2_advsimd_sleef x = vcast_vf2_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)))); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef), x); + dfi_advsimd_sleef = dfisetdf_dfi_dfi_vf2_advsimd_sleef(dfi_advsimd_sleef, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, x, dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + s = dfnormalize_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)); + + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_advsimd_sleef(s); + + u = vcast_vf_f_advsimd_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_advsimd_sleef(t, x); + + u = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(u))); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_cosf4_u10advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u; + vfloat2_advsimd_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + vfloat_advsimd_sleef dq = vmla_vf_vf_vf_vf_advsimd_sleef(vrint_vf_vf_advsimd_sleef(vmla_vf_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.318309886183790671537767526745028724), vcast_vf_f_advsimd_sleef(-0.5f))), + vcast_vf_f_advsimd_sleef(2), vcast_vf_f_advsimd_sleef(1)); + q = vrint_vi2_vf_advsimd_sleef(dq); + s = dfadd2_vf2_vf_vf_advsimd_sleef (d, vmul_vf_vf_vf_advsimd_sleef(dq, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f))); + s = dfadd2_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(dq, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd2_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(dq, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(3)); + q = vadd_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, q), vsel_vi2_vo_vi2_vi2_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vi2_i_advsimd_sleef(8), vcast_vi2_i_advsimd_sleef(7))); + q = vshrq_n_s32(q, 1); + vopmask_advsimd_sleef o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(0)); + vfloat_advsimd_sleef y = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(0), vcast_vf_f_advsimd_sleef(-1)); + vfloat2_advsimd_sleef x = vcast_vf2_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef), x); + dfi_advsimd_sleef = dfisetdf_dfi_dfi_vf2_advsimd_sleef(dfi_advsimd_sleef, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, x, dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + s = dfnormalize_vf2_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)); + + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_advsimd_sleef(s); + + u = vcast_vf_f_advsimd_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_advsimd_sleef(t, x); + + u = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(0)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fastsinf4_u3500advsimd(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, s, t = d; + + s = vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724)); + u = vrint_vf_vf_advsimd_sleef(s); + q = vrint_vi2_vf_advsimd_sleef(s); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-(float)3.141592653589793238462643383279502884), d); + + s = vmul_vf_vf_vf_advsimd_sleef(d, d); + + u = vcast_vf_f_advsimd_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(u))); + + vopmask_advsimd_sleef g = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(g)), 1)) return vsel_vf_vo_vf_vf_advsimd_sleef(g, u, Sleef_sinf4_u35advsimd(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fastcosf4_u3500advsimd(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, s, t = d; + + s = vmla_vf_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.318309886183790671537767526745028724), vcast_vf_f_advsimd_sleef(-0.5f)); + u = vrint_vf_vf_advsimd_sleef(s); + q = vrint_vi2_vf_advsimd_sleef(s); + d = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-(float)3.141592653589793238462643383279502884), vsub_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)3.141592653589793238462643383279502884 * 0.5f))); + + s = vmul_vf_vf_vf_advsimd_sleef(d, d); + + u = vcast_vf_f_advsimd_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(0)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(u))); + + vopmask_advsimd_sleef g = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(g)), 1)) return vsel_vf_vo_vf_vf_advsimd_sleef(g, u, Sleef_cosf4_u35advsimd(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_advsimd_sleef Sleef_sincosf4_u35advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, t, rx, ry; + vfloat2_advsimd_sleef r; + + s = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_advsimd_sleef(q); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f), s); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f), s); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f), s); + } else if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(39000)))), 1)) { + q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_advsimd_sleef(q); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.140625f*0.5f), s); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.0009670257568359375f*0.5f), s); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-6.2771141529083251953e-07f*0.5f), s); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.2154201256553420762e-10f*0.5f), s); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef); + s = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef)), vf2gety_vf_vf2_advsimd_sleef(dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef))); + s = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)), vreinterpret_vm_vf_advsimd_sleef(s))); + } + + t = s; + + s = vmul_vf_vf_vf_advsimd_sleef(s, s); + + u = vcast_vf_f_advsimd_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.166666537523269653320312f)); + + rx = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(u, s), t, t); + rx = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-0.0f), rx); + + u = vcast_vf_f_advsimd_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.5)); + + ry = vmla_vf_vf_vf_vf_advsimd_sleef(s, u, vcast_vf_f_advsimd_sleef(1)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(0)); + r = vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(o, rx, ry), vsel_vf_vo_vf_vf_advsimd_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_advsimd_sleef Sleef_sincosf4_u10advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, v, rx, ry; + vfloat2_advsimd_sleef r, s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_advsimd_sleef(u); + v = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_advsimd_sleef(v, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef); + s = dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef); + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)); + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s))))); + } + + t = s; + + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, dfsqu_vf_vf2_advsimd_sleef(s)); + + u = vcast_vf_f_advsimd_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-0.166666537523269653320312f)); + + u = vmul_vf_vf_vf_advsimd_sleef(u, vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), vf2getx_vf_vf2_advsimd_sleef(t))); + + x = dfadd_vf2_vf2_vf_advsimd_sleef(t, u); + rx = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + rx = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-0.0f), rx); + + u = vcast_vf_f_advsimd_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-0.5)); + + x = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), u)); + ry = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(0)); + r = vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(o, rx, ry), vsel_vf_vo_vf_vf_advsimd_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_advsimd_sleef Sleef_sincospif4_u05advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, t, rx, ry; + vfloat2_advsimd_sleef r, x, s2; + + u = vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(4)); + vint2_advsimd_sleef q = vtruncate_vi2_vf_advsimd_sleef(u); + q = vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vxor_vi2_vi2_vi2_advsimd_sleef(vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(q), 31)), vcast_vi2_i_advsimd_sleef(1))), vcast_vi2_i_advsimd_sleef(~1)); + s = vsub_vf_vf_vf_advsimd_sleef(u, vcast_vf_vi2_advsimd_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_advsimd_sleef(s, s); + s2 = dfmul_vf2_vf_vf_advsimd_sleef(t, t); + + u = vcast_vf_f_advsimd_sleef(+0.3093842054e-6); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.3657307388e-4)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2490393585e-2)); + x = dfadd2_vf2_vf_vf2_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(u, s), vcast_vf2_f_f_advsimd_sleef(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(s2, x), vcast_vf2_f_f_advsimd_sleef(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf_advsimd_sleef(x, t); + rx = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + rx = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-0.0f), rx); + + u = vcast_vf_f_advsimd_sleef(-0.2430611801e-7); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.3590577080e-5)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.3259917721e-3)); + x = dfadd2_vf2_vf_vf2_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(u, s), vcast_vf2_f_f_advsimd_sleef(0.015854343771934509277, 4.4940051354032242811e-10)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(s2, x), vcast_vf2_f_f_advsimd_sleef(-0.30842512845993041992, -9.0728339030733922277e-09)); + + x = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(x, s2), vcast_vf_f_advsimd_sleef(1)); + ry = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(0)); + r = vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(o, rx, ry), vsel_vf_vo_vf_vf_advsimd_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + o = vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + o = visinf_vo_vf_advsimd_sleef(d); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_advsimd_sleef Sleef_sincospif4_u35advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, t, rx, ry; + vfloat2_advsimd_sleef r; + + u = vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(4)); + vint2_advsimd_sleef q = vtruncate_vi2_vf_advsimd_sleef(u); + q = vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vxor_vi2_vi2_vi2_advsimd_sleef(vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(q), 31)), vcast_vi2_i_advsimd_sleef(1))), vcast_vi2_i_advsimd_sleef(~1)); + s = vsub_vf_vf_vf_advsimd_sleef(u, vcast_vf_vi2_advsimd_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_advsimd_sleef(s, s); + + u = vcast_vf_f_advsimd_sleef(-0.3600925265e-4); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2490088111e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.8074551076e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.7853981853e+0)); + + rx = vmul_vf_vf_vf_advsimd_sleef(u, t); + + u = vcast_vf_f_advsimd_sleef(+0.3539815225e-5); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.3259574005e-3)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1585431583e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(-0.3084251285e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(1)); + + ry = u; + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(0)); + r = vf2setxy_vf2_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(o, rx, ry), vsel_vf_vo_vf_vf_advsimd_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + o = vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + o = visinf_vo_vf_advsimd_sleef(d); + r = vf2setx_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r))))); + r = vf2sety_vf2_vf2_vf_advsimd_sleef(r, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(r))))); + + return r; +} + +SLEEF_INLINE vfloat2_advsimd_sleef Sleef_modff4_advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef fr = vsub_vf_vf_vf_advsimd_sleef(x, vcast_vf_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(x))); + fr = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(INT64_C(1) << 23)), vcast_vf_f_advsimd_sleef(0), fr); + + vfloat2_advsimd_sleef ret; + + ret = vf2setxy_vf2_vf_vf_advsimd_sleef(vcopysign_vf_vf_vf_advsimd_sleef(fr, x), vcopysign_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, fr), x)); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_tanf4_u10advsimd(vfloat_advsimd_sleef d) { + + vint2_advsimd_sleef q; + vfloat_advsimd_sleef u, v; + vfloat2_advsimd_sleef s, t, x; + vopmask_advsimd_sleef o; + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_advsimd_sleef(u); + v = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_advsimd_sleef(v, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_advsimd_sleef dfi_advsimd_sleef = rempif_advsimd_sleef(d); + q = dfigeti_vi2_dfi_advsimd_sleef(dfi_advsimd_sleef); + s = dfigetdf_vf2_dfi_advsimd_sleef(dfi_advsimd_sleef); + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), visnan_vo_vf_advsimd_sleef(d)); + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s))))); + s = vf2sety_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(s))))); + } + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)); + vmask_advsimd_sleef n = vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))); + + s = vf2setx_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s)), n))); + s = vf2sety_vf2_vf2_vf_advsimd_sleef(s, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(s)), n))); + + t = s; + s = dfsqu_vf2_vf2_advsimd_sleef(s); + s = dfnormalize_vf2_vf2_advsimd_sleef(s); + + u = vcast_vf_f_advsimd_sleef(0.00446636462584137916564941f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(-8.3920182078145444393158e-05f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.0109639242291450500488281f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.0212360303848981857299805f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.0540687143802642822265625f)); + + x = dfadd_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.133325666189193725585938f), vmul_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s))); + x = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.33333361148834228515625f), dfmul_vf2_vf2_vf2_advsimd_sleef(s, x)), s)); + x = dfmul_vf2_vf2_vf2_advsimd_sleef(t, x); + + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfrec_vf2_vf2_advsimd_sleef(x), x); + + u = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_atanf4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef s, t, u; + vint2_advsimd_sleef q; + + q = vsel_vi2_vf_vi2_advsimd_sleef(d, vcast_vi2_i_advsimd_sleef(2)); + s = vabs_vf_vf_advsimd_sleef(d); + + q = vsel_vi2_vf_vf_vi2_vi2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), s, vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), q); + s = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), s), vrec_vf_vf_advsimd_sleef(s), s); + + t = vmul_vf_vf_vf_advsimd_sleef(s, s); + + vfloat_advsimd_sleef t2 = vmul_vf_vf_vf_advsimd_sleef(t, t), t4 = vmul_vf_vf_vf_advsimd_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_advsimd_sleef((t4), (vmla_vf_vf_vf_vf_advsimd_sleef((t2), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.00282363896258175373077393f)), (vcast_vf_f_advsimd_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.0425049886107444763183594f)), (vcast_vf_f_advsimd_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_advsimd_sleef((t2), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.106347933411598205566406f)), (vcast_vf_f_advsimd_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.199926957488059997558594f)), (vcast_vf_f_advsimd_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(t, u), s); + + t = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/2)), t), t); + + t = vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0f))), vreinterpret_vm_vf_advsimd_sleef(t))); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef atan2kf_advsimd_sleef(vfloat_advsimd_sleef y, vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef s, t, u; + vint2_advsimd_sleef q; + vopmask_advsimd_sleef p; + + q = vsel_vi2_vf_vi2_advsimd_sleef(x, vcast_vi2_i_advsimd_sleef(-2)); + x = vabs_vf_vf_advsimd_sleef(x); + + q = vsel_vi2_vf_vf_vi2_vi2_advsimd_sleef(x, y, vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), q); + p = vlt_vo_vf_vf_advsimd_sleef(x, y); + s = vsel_vf_vo_vf_vf_advsimd_sleef(p, vneg_vf_vf_advsimd_sleef(x), y); + t = vmax_vf_vf_vf_advsimd_sleef(x, y); + + s = vdiv_vf_vf_vf_advsimd_sleef(s, t); + t = vmul_vf_vf_vf_advsimd_sleef(s, s); + + vfloat_advsimd_sleef t2 = vmul_vf_vf_vf_advsimd_sleef(t, t), t4 = vmul_vf_vf_vf_advsimd_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_advsimd_sleef((t4), (vmla_vf_vf_vf_vf_advsimd_sleef((t2), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.00282363896258175373077393f)), (vcast_vf_f_advsimd_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.0425049886107444763183594f)), (vcast_vf_f_advsimd_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_advsimd_sleef((t2), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.106347933411598205566406f)), (vcast_vf_f_advsimd_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_advsimd_sleef((t), (vcast_vf_f_advsimd_sleef(0.199926957488059997558594f)), (vcast_vf_f_advsimd_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(t, u), s); + t = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/2)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef visinf2_vf_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d, vfloat_advsimd_sleef m) { + return vreinterpret_vf_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vor_vm_vm_vm_advsimd_sleef(vsignbit_vm_vf_advsimd_sleef(d), vreinterpret_vm_vf_advsimd_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_atan2f4_u35advsimd(vfloat_advsimd_sleef y, vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef r = atan2kf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), x); + + r = vmulsign_vf_vf_vf_advsimd_sleef(r, x); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0.0f))), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_advsimd_sleef(x, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/2)), x))), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(y), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_advsimd_sleef(x, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)(3.141592653589793238462643383279502884/4)), x))), r); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0.0f)), vreinterpret_vf_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vreinterpret_vm_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_asinf4_u35advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0.5f)); + vfloat_advsimd_sleef x2 = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, d), vmul_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vabs_vf_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5f))); + vfloat_advsimd_sleef x = vsel_vf_vo_vf_vf_advsimd_sleef(o, vabs_vf_vf_advsimd_sleef(d), vsqrt_vf_vf_advsimd_sleef(x2)), u; + + u = vcast_vf_f_advsimd_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.1666677296e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vmul_vf_vf_vf_advsimd_sleef(x, x2), x); + + vfloat_advsimd_sleef r = vsel_vf_vo_vf_vf_advsimd_sleef(o, u, vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-2), vcast_vf_f_advsimd_sleef(((float)3.141592653589793238462643383279502884)/2))); + return vmulsign_vf_vf_vf_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_acosf4_u35advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0.5f)); + vfloat_advsimd_sleef x2 = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, d), + vmul_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vabs_vf_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5f))), u; + vfloat_advsimd_sleef x = vsel_vf_vo_vf_vf_advsimd_sleef(o, vabs_vf_vf_advsimd_sleef(d), vsqrt_vf_vf_advsimd_sleef(x2)); + x = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1.0f)), vcast_vf_f_advsimd_sleef(0), x); + + u = vcast_vf_f_advsimd_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_advsimd_sleef(u, vmul_vf_vf_vf_advsimd_sleef(x2, x)); + + vfloat_advsimd_sleef y = vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.1415926535897932f/2), vadd_vf_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(x, d), vmulsign_vf_vf_vf_advsimd_sleef(u, d))); + x = vadd_vf_vf_vf_advsimd_sleef(x, u); + vfloat_advsimd_sleef r = vsel_vf_vo_vf_vf_advsimd_sleef(o, y, vmul_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + return vsel_vf_vo_vf_vf_advsimd_sleef(vandnot_vo_vo_vo_advsimd_sleef(o, vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0))), + vf2getx_vf_vf2_advsimd_sleef(dfadd_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(3.1415927410125732422f,-8.7422776573475857731e-08f), + vneg_vf_vf_advsimd_sleef(r))), r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef atan2kf_u1_advsimd_sleef(vfloat2_advsimd_sleef y, vfloat2_advsimd_sleef x) { + vfloat_advsimd_sleef u; + vfloat2_advsimd_sleef s, t; + vint2_advsimd_sleef q; + vopmask_advsimd_sleef p; + vmask_advsimd_sleef r; + + q = vsel_vi2_vf_vf_vi2_vi2_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(0), vcast_vi2_i_advsimd_sleef(-2), vcast_vi2_i_advsimd_sleef(0)); + p = vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(0)); + r = vand_vm_vo32_vm_advsimd_sleef(p, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))); + x = vf2setx_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)), r))); + x = vf2sety_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x)), r))); + + q = vsel_vi2_vf_vf_vi2_vi2_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y), vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(1)), q); + p = vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(y)); + s = vsel_vf2_vo_vf2_vf2_advsimd_sleef(p, dfneg_vf2_vf2_advsimd_sleef(x), y); + t = vsel_vf2_vo_vf2_vf2_advsimd_sleef(p, y, x); + + s = dfdiv_vf2_vf2_vf2_advsimd_sleef(s, t); + t = dfsqu_vf2_vf2_advsimd_sleef(s); + t = dfnormalize_vf2_vf2_advsimd_sleef(t); + + u = vcast_vf_f_advsimd_sleef(-0.00176397908944636583328247f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(0.0107900900766253471374512f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(-0.0309564601629972457885742f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(0.0577365085482597351074219f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(-0.0838950723409652709960938f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(0.109463557600975036621094f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(-0.142626821994781494140625f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(0.199983194470405578613281f)); + + t = dfmul_vf2_vf2_vf2_advsimd_sleef(t, dfadd_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.333332866430282592773438f), vmul_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(t)))); + t = dfmul_vf2_vf2_vf2_advsimd_sleef(s, dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), t)); + t = dfadd_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(1.5707963705062866211f, -4.3711388286737928865e-08f), vcast_vf_vi2_advsimd_sleef(q)), t); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_atan2f4_u10advsimd(vfloat_advsimd_sleef y, vfloat_advsimd_sleef x) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(2.9387372783541830947e-39f)); + x = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1 << 24)), x); + y = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(1 << 24)), y); + + vfloat2_advsimd_sleef d = atan2kf_u1_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), vcast_vf_f_advsimd_sleef(0)), vcast_vf2_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0))); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)); + + r = vmulsign_vf_vf_vf_advsimd_sleef(r, x); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0))), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_advsimd_sleef(x, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(y), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_advsimd_sleef(x, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0.0f)), vreinterpret_vf_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vreinterpret_vm_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_asinf4_u10advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0.5f)); + vfloat_advsimd_sleef x2 = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, d), vmul_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vabs_vf_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5f))), u; + vfloat2_advsimd_sleef x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, vcast_vf2_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0)), dfsqrt_vf2_vf_advsimd_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1.0f)), vcast_vf2_f_f_advsimd_sleef(0, 0), x); + + u = vcast_vf_f_advsimd_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_advsimd_sleef(u, vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x))); + + vfloat2_advsimd_sleef y = dfsub_vf2_vf2_vf_advsimd_sleef(dfsub_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(3.1415927410125732422f/4,-8.7422776573475857731e-08f/4), x), u); + + vfloat_advsimd_sleef r = vsel_vf_vo_vf_vf_advsimd_sleef(o, vadd_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(x)), + vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(2))); + return vmulsign_vf_vf_vf_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_acosf4_u10advsimd(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0.5f)); + vfloat_advsimd_sleef x2 = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, d), vmul_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vabs_vf_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5f))), u; + vfloat2_advsimd_sleef x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, vcast_vf2_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0)), dfsqrt_vf2_vf_advsimd_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1.0f)), vcast_vf2_f_f_advsimd_sleef(0, 0), x); + + u = vcast_vf_f_advsimd_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, x2, vcast_vf_f_advsimd_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_advsimd_sleef(u, vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x))); + + vfloat2_advsimd_sleef y = dfsub_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(3.1415927410125732422f/2, -8.7422776573475857731e-08f/2), + dfadd_vf2_vf_vf_advsimd_sleef(vmulsign_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), d), vmulsign_vf_vf_vf_advsimd_sleef(u, d))); + x = dfadd_vf2_vf2_vf_advsimd_sleef(x, u); + + y = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, y, dfscale_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + + y = vsel_vf2_vo_vf2_vf2_advsimd_sleef(vandnot_vo_vo_vo_advsimd_sleef(o, vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0))), + dfsub_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(3.1415927410125732422f, -8.7422776573475857731e-08f), y), y); + + return vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_atanf4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef d2 = atan2kf_u1_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(0)), vcast_vf2_f_f_advsimd_sleef(1, 0)); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d2), vf2gety_vf_vf2_advsimd_sleef(d2)); + r = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1.570796326794896557998982), r); + return vmulsign_vf_vf_vf_advsimd_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_logf4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef x, x2, t, m; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = vdiv_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(1.0f)), vadd_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(x, x); + + t = vcast_vf_f_advsimd_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, t, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.693147180559945286226764f), vcast_vf_vi2_advsimd_sleef(e))); + x = vsel_vf_vo_vf_vf_advsimd_sleef(vispinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), visnan_vo_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), x); + x = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(-__builtin_inff()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_expf4_u10advsimd(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_advsimd_sleef s, u; + + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_advsimd_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.5)); + + u = vadd_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, s), u, s)); + + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-104)), vreinterpret_vm_vf_advsimd_sleef(u))); + u = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(100), d), vcast_vf_f_advsimd_sleef(__builtin_inff()), u); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef expm1fk_advsimd_sleef(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_advsimd_sleef s, u; + + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-1.428606765330187045e-06f), s); + + vfloat_advsimd_sleef s2 = vmul_vf_vf_vf_advsimd_sleef(s, s), s4 = vmul_vf_vf_vf_advsimd_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_advsimd_sleef((s4), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.000198527617612853646278381)), (vcast_vf_f_advsimd_sleef(0.00139304355252534151077271)))), (vmla_vf_vf_vf_vf_advsimd_sleef((s2), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.00833336077630519866943359)), (vcast_vf_f_advsimd_sleef(0.0416664853692054748535156)))), (vmla_vf_vf_vf_vf_advsimd_sleef((s), (vcast_vf_f_advsimd_sleef(0.166666671633720397949219)), (vcast_vf_f_advsimd_sleef(0.5))))))) + + ; + + u = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, s), u, s); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(0)), u, + vsub_vf_vf_vf_advsimd_sleef(vldexp2_vf_vf_vi2_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(1)), q), vcast_vf_f_advsimd_sleef(1))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sqrtf4_u35advsimd(vfloat_advsimd_sleef d) { return vsqrt_vf_vf_advsimd_sleef(d); } + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_cbrtf4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef x, y, q = vcast_vf_f_advsimd_sleef(1.0), t; + vint2_advsimd_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_advsimd_sleef(vilogbk_vi2_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d)), vcast_vi2_i_advsimd_sleef(1)); + d = vldexp2_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + + t = vadd_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(e), vcast_vf_f_advsimd_sleef(6144)); + qu = vtruncate_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(t, vcast_vf_f_advsimd_sleef(1.0f/3.0f))); + re = vtruncate_vi2_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(t, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(qu), vcast_vf_f_advsimd_sleef(3)))); + + q = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(re, vcast_vi2_i_advsimd_sleef(1)), vcast_vf_f_advsimd_sleef(1.2599210498948731647672106f), q); + q = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(re, vcast_vi2_i_advsimd_sleef(2)), vcast_vf_f_advsimd_sleef(1.5874010519681994747517056f), q); + q = vldexp2_vf_vf_vi2_advsimd_sleef(q, vsub_vi2_vi2_vi2_advsimd_sleef(qu, vcast_vi2_i_advsimd_sleef(2048))); + + q = vmulsign_vf_vf_vf_advsimd_sleef(q, d); + d = vabs_vf_vf_advsimd_sleef(d); + + x = vcast_vf_f_advsimd_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, x), x); + y = vmul_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(y, vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2.0f / 3.0f), y), vmla_vf_vf_vf_vf_advsimd_sleef(y, x, vcast_vf_f_advsimd_sleef(-1.0f)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_cbrtf4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef x, y, z, t; + vfloat2_advsimd_sleef q2 = vcast_vf2_f_f_advsimd_sleef(1, 0), u, v; + vint2_advsimd_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_advsimd_sleef(vilogbk_vi2_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d)), vcast_vi2_i_advsimd_sleef(1)); + d = vldexp2_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + + t = vadd_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(e), vcast_vf_f_advsimd_sleef(6144)); + qu = vtruncate_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(t, vcast_vf_f_advsimd_sleef(1.0/3.0))); + re = vtruncate_vi2_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(t, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(qu), vcast_vf_f_advsimd_sleef(3)))); + + q2 = vsel_vf2_vo_vf2_vf2_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(re, vcast_vi2_i_advsimd_sleef(1)), vcast_vf2_f_f_advsimd_sleef(1.2599210739135742188f, -2.4018701694217270415e-08), q2); + q2 = vsel_vf2_vo_vf2_vf2_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(re, vcast_vi2_i_advsimd_sleef(2)), vcast_vf2_f_f_advsimd_sleef(1.5874010324478149414f, 1.9520385308169352356e-08), q2); + + q2 = vf2setx_vf2_vf2_vf_advsimd_sleef(q2, vmulsign_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(q2), d)); + q2 = vf2sety_vf2_vf2_vf_advsimd_sleef(q2, vmulsign_vf_vf_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(q2), d)); + d = vabs_vf_vf_advsimd_sleef(d); + + x = vcast_vf_f_advsimd_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, d, vcast_vf_f_advsimd_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_advsimd_sleef(x, x); y = vmul_vf_vf_vf_advsimd_sleef(y, y); x = vsub_vf_vf_vf_advsimd_sleef(x, vmul_vf_vf_vf_advsimd_sleef(vmlanp_vf_vf_vf_vf_advsimd_sleef(d, y, x), vcast_vf_f_advsimd_sleef(-1.0 / 3.0))); + + z = x; + + u = dfmul_vf2_vf_vf_advsimd_sleef(x, x); + u = dfmul_vf2_vf2_vf2_advsimd_sleef(u, u); + u = dfmul_vf2_vf2_vf_advsimd_sleef(u, d); + u = dfadd2_vf2_vf2_vf_advsimd_sleef(u, vneg_vf_vf_advsimd_sleef(x)); + y = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(u), vf2gety_vf_vf2_advsimd_sleef(u)); + + y = vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-2.0 / 3.0), y), z); + v = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf_vf_advsimd_sleef(z, z), y); + v = dfmul_vf2_vf2_vf_advsimd_sleef(v, d); + v = dfmul_vf2_vf2_vf2_advsimd_sleef(v, q2); + z = vldexp2_vf_vf_vi2_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(v), vf2gety_vf_vf2_advsimd_sleef(v)), vsub_vi2_vi2_vi2_advsimd_sleef(qu, vcast_vi2_i_advsimd_sleef(2048))); + + z = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(__builtin_inff()), vf2getx_vf_vf2_advsimd_sleef(q2)), z); + z = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vreinterpret_vf_vm_advsimd_sleef(vsignbit_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(q2))), z); + + return z; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef logkf_advsimd_sleef(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x, x2; + vfloat_advsimd_sleef t, m; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), m), dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), m)); + x2 = dfsqu_vf2_vf2_advsimd_sleef(x); + + t = vcast_vf_f_advsimd_sleef(0.240320354700088500976562); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(x2), vcast_vf_f_advsimd_sleef(0.285112679004669189453125)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(x2), vcast_vf_f_advsimd_sleef(0.400007992982864379882812)); + vfloat2_advsimd_sleef c = vcast_vf2_f_f_advsimd_sleef(0.66666662693023681640625f, 3.69183861259614332084311e-09f); + + vfloat2_advsimd_sleef s = dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_advsimd_sleef(e)); + + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfscale_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfmul_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(x2, x), + dfadd2_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(x2, t), c))); + return s; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef logk3f_advsimd_sleef(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef x, x2, t, m; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = vdiv_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(1.0f)), vadd_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(x, x); + + t = vcast_vf_f_advsimd_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_advsimd_sleef(x, t, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.693147180559945286226764f), vcast_vf_vi2_advsimd_sleef(e))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_logf4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x; + vfloat_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + vfloat2_advsimd_sleef s = dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_advsimd_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), m), dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)); + + t = vcast_vf_f_advsimd_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfscale_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x)), t)); + + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), vf2gety_vf_vf2_advsimd_sleef(s)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vispinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), visnan_vo_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(-__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef expkf_advsimd_sleef(vfloat2_advsimd_sleef d) { + vfloat_advsimd_sleef u = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + vfloat2_advsimd_sleef s, t; + + s = dfadd2_vf2_vf2_vf_advsimd_sleef(d, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-1.428606765330187045e-06f))); + + s = dfnormalize_vf2_vf2_advsimd_sleef(s); + + u = vcast_vf_f_advsimd_sleef(0.00136324646882712841033936f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.00836596917361021041870117f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.0416710823774337768554688f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.166665524244308471679688f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(0.499999850988388061523438f)); + + t = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfmul_vf2_vf2_vf_advsimd_sleef(dfsqu_vf2_vf2_advsimd_sleef(s), u)); + + t = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), t); + u = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t), vf2gety_vf_vf2_advsimd_sleef(t)); + u = vldexp_vf_vf_vi2_advsimd_sleef(u, q); + + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-104)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef expk3f_advsimd_sleef(vfloat_advsimd_sleef d) { + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_advsimd_sleef s, u; + + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_advsimd_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(0.5)); + + u = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(s, s), u, vadd_vf_vf_vf_advsimd_sleef(s, vcast_vf_f_advsimd_sleef(1.0f))); + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-104)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_powf4_u10advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + + vopmask_advsimd_sleef yisint = vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vtruncate_vf_vf_advsimd_sleef(y), y), vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), vcast_vf_f_advsimd_sleef(1 << 24))); + vopmask_advsimd_sleef yisodd = vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(y), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), yisint), + vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), vcast_vf_f_advsimd_sleef(1 << 24))); + + vfloat_advsimd_sleef result = expkf_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(logkf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x)), y)); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(visnan_vo_vf_advsimd_sleef(result), vcast_vf_f_advsimd_sleef(__builtin_inff()), result); + + result = vmul_vf_vf_vf_advsimd_sleef(result, + vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), + vcast_vf_f_advsimd_sleef(1), + vsel_vf_vo_vf_vf_advsimd_sleef(yisint, vsel_vf_vo_vf_vf_advsimd_sleef(yisodd, vcast_vf_f_advsimd_sleef(-1.0f), vcast_vf_f_advsimd_sleef(1)), vcast_vf_f_advsimd_sleef(__builtin_nanf(""))))); + + vfloat_advsimd_sleef efx = vmulsign_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(1)), y); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(y), + vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(efx, vcast_vf_f_advsimd_sleef(0.0f)), + vreinterpret_vm_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(efx, vcast_vf_f_advsimd_sleef(0.0f)), + vcast_vf_f_advsimd_sleef(1.0f), + vcast_vf_f_advsimd_sleef(__builtin_inff()))))), + result); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0.0))), + vmulsign_vf_vf_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(vxor_vo_vo_vo_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(y), veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0.0f))), + vcast_vf_f_advsimd_sleef(0), vcast_vf_f_advsimd_sleef(__builtin_inff())), + vsel_vf_vo_vf_vf_advsimd_sleef(yisodd, x, vcast_vf_f_advsimd_sleef(1))), result); + + result = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vreinterpret_vm_vf_advsimd_sleef(result))); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0)), veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1))), vcast_vf_f_advsimd_sleef(1), result); + + return result; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fastpowf4_u3500advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef result = expk3f_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(logk3f_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x)), y)); + vopmask_advsimd_sleef yisint = vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vtruncate_vf_vf_advsimd_sleef(y), y), vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), vcast_vf_f_advsimd_sleef(1 << 24))); + vopmask_advsimd_sleef yisodd = vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(y), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), yisint), + vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(y), vcast_vf_f_advsimd_sleef(1 << 24))); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(x), yisodd), vneg_vf_vf_advsimd_sleef(result), result); + + result = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(0), result); + result = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(1), result); + + return result; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef expk2f_advsimd_sleef(vfloat2_advsimd_sleef d) { + vfloat_advsimd_sleef u = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + vfloat2_advsimd_sleef s, t; + + s = dfadd2_vf2_vf2_vf_advsimd_sleef(d, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(-1.428606765330187045e-06f))); + + u = vcast_vf_f_advsimd_sleef(+0.1980960224e-3f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(+0.1394256484e-2f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(+0.8333456703e-2f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, vf2getx_vf_vf2_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(+0.4166637361e-1f)); + + t = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(s, u), vcast_vf_f_advsimd_sleef(+0.166666659414234244790680580464e+0f)); + t = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(s, t), vcast_vf_f_advsimd_sleef(0.5)); + t = dfadd2_vf2_vf2_vf2_advsimd_sleef(s, dfmul_vf2_vf2_vf2_advsimd_sleef(dfsqu_vf2_vf2_advsimd_sleef(s), t)); + + t = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), t); + + t = vf2setx_vf2_vf2_vf_advsimd_sleef(t, vldexp2_vf_vf_vi2_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t), q)); + t = vf2sety_vf2_vf2_vf_advsimd_sleef(t, vldexp2_vf_vf_vi2_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(t), q)); + + t = vf2setx_vf2_vf2_vf_advsimd_sleef(t, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-104)), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t))))); + t = vf2sety_vf2_vf2_vf_advsimd_sleef(t, vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-104)), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sinhf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef y = vabs_vf_vf_advsimd_sleef(x); + vfloat2_advsimd_sleef d = expk2f_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0))); + d = dfsub_vf2_vf2_vf2_advsimd_sleef(d, dfrec_vf2_vf2_advsimd_sleef(d)); + y = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(89)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_advsimd_sleef(y, x); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_coshf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef y = vabs_vf_vf_advsimd_sleef(x); + vfloat2_advsimd_sleef d = expk2f_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0))); + d = dfadd_vf2_vf2_vf2_advsimd_sleef(d, dfrec_vf2_vf2_advsimd_sleef(d)); + y = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(89)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_tanhf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef y = vabs_vf_vf_advsimd_sleef(x); + vfloat2_advsimd_sleef d = expk2f_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0))); + vfloat2_advsimd_sleef e = dfrec_vf2_vf2_advsimd_sleef(d); + d = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd_vf2_vf2_vf2_advsimd_sleef(d, dfneg_vf2_vf2_advsimd_sleef(e)), dfadd_vf2_vf2_vf2_advsimd_sleef(d, e)); + y = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(8.664339742f)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_advsimd_sleef(y, x); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sinhf4_u35advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef e = expm1fk_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x)); + vfloat_advsimd_sleef y = vdiv_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(e, vcast_vf_f_advsimd_sleef(2)), vadd_vf_vf_vf_advsimd_sleef(e, vcast_vf_f_advsimd_sleef(1))); + y = vmul_vf_vf_vf_advsimd_sleef(y, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5f), e)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(88)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_advsimd_sleef(y, x); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_coshf4_u35advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef e = Sleef_expf4_u10advsimd(vabs_vf_vf_advsimd_sleef(x)); + vfloat_advsimd_sleef y = vmla_vf_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5f), e, vdiv_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5), e)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(88)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_tanhf4_u35advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef d = expm1fk_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2), vabs_vf_vf_advsimd_sleef(x))); + vfloat_advsimd_sleef y = vdiv_vf_vf_vf_advsimd_sleef(d, vadd_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2), d)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(8.664339742f)), + visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_advsimd_sleef(y, x); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef logk2f_advsimd_sleef(vfloat2_advsimd_sleef d) { + vfloat2_advsimd_sleef x, x2, m, s; + vfloat_advsimd_sleef t; + vint2_advsimd_sleef e; + + e = vilogbk_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + + m = dfscale_vf2_vf2_vf_advsimd_sleef(d, vpow2i_vf_vi2_advsimd_sleef(vneg_vi2_vi2_advsimd_sleef(e))); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(-1)), dfadd2_vf2_vf2_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(1))); + x2 = dfsqu_vf2_vf2_advsimd_sleef(x); + + t = vcast_vf_f_advsimd_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(x2), vcast_vf_f_advsimd_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(x2), vcast_vf_f_advsimd_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(x2), vcast_vf_f_advsimd_sleef(0.666666686534881591796875f)); + + s = dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.69314718246459960938f), vcast_vf_f_advsimd_sleef(-1.904654323148236017e-09f)), vcast_vf_vi2_advsimd_sleef(e)); + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfscale_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfmul_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_asinhf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef y = vabs_vf_vf_advsimd_sleef(x); + vopmask_advsimd_sleef o = vgt_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(1)); + vfloat2_advsimd_sleef d; + + d = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfrec_vf2_vf_advsimd_sleef(x), vcast_vf2_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0))); + d = dfsqrt_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(dfsqu_vf2_vf2_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(1))); + d = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfmul_vf2_vf2_vf_advsimd_sleef(d, y), d); + + d = logk2f_advsimd_sleef(dfnormalize_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(d, x))); + y = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(18446743523953729536.0)), + visnan_vo_vf_advsimd_sleef(y)), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(__builtin_inff()), x), y); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + y = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_acoshf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat2_advsimd_sleef d = logk2f_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(dfsqrt_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1))), dfsqrt_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(-1)))), x)); + vfloat_advsimd_sleef y = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)); + + y = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(18446743523953729536.0)), + visnan_vo_vf_advsimd_sleef(y)), + vcast_vf_f_advsimd_sleef(__builtin_inff()), y); + + y = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1.0f)), vreinterpret_vm_vf_advsimd_sleef(y))); + + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1.0f)), vreinterpret_vm_vf_advsimd_sleef(y))); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_atanhf4_u10advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef y = vabs_vf_vf_advsimd_sleef(x); + vfloat2_advsimd_sleef d = logk2f_advsimd_sleef(dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), y), dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vneg_vf_vf_advsimd_sleef(y)))); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(1.0)), vreinterpret_vm_vf_advsimd_sleef(vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(1.0)), vcast_vf_f_advsimd_sleef(__builtin_inff()), vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(0.5)))))); + + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vreinterpret_vm_vf_advsimd_sleef(y))); + y = vmulsign_vf_vf_vf_advsimd_sleef(y, x); + y = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), vreinterpret_vm_vf_advsimd_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_exp2f4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef u = vrint_vf_vf_advsimd_sleef(d), s; + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + + s = vsub_vf_vf_vf_advsimd_sleef(d, u); + + u = vcast_vf_f_advsimd_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.6931471825e+0)); + + u = vfma_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(1)); + + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(vge_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(128)), vcast_vf_f_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-150)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_exp2f4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef u = vrint_vf_vf_advsimd_sleef(d), s; + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + + s = vsub_vf_vf_vf_advsimd_sleef(d, u); + + u = vcast_vf_f_advsimd_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.6931471825e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(vge_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(128)), vcast_vf_f_advsimd_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-150)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_exp10f4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef u = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_advsimd_sleef(+0.6802555919e-1); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2078080326e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.5393903852e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1171245337e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2034678698e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2650949001e+1)); + vfloat2_advsimd_sleef x = dfadd_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(2.3025851249694824219, -3.1705172516493593157e-08), vmul_vf_vf_vf_advsimd_sleef(u, s)); + u = vf2getx_vf_vf2_advsimd_sleef(dfnormalize_vf2_vf2_advsimd_sleef(dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf2_vf_advsimd_sleef(x, s)))); + + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(38.5318394191036238941387f)), vcast_vf_f_advsimd_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-50)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_exp10f4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef u = vrint_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_advsimd_sleef q = vrint_vi2_vf_advsimd_sleef(u); + + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_advsimd_sleef(u, vcast_vf_f_advsimd_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_advsimd_sleef(+0.2064004987e+0); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.5417877436e+0)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1171286821e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2034656048e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2650948763e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.2302585125e+1)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vcast_vf_f_advsimd_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_advsimd_sleef(u, q); + + u = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(38.5318394191036238941387f)), vcast_vf_f_advsimd_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-50)), vreinterpret_vm_vf_advsimd_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_expm1f4_u10advsimd(vfloat_advsimd_sleef a) { + vfloat2_advsimd_sleef d = dfadd2_vf2_vf2_vf_advsimd_sleef(expk2f_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0))), vcast_vf_f_advsimd_sleef(-1.0)); + vfloat_advsimd_sleef x = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(d), vf2gety_vf_vf2_advsimd_sleef(d)); + x = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(88.72283172607421875f)), vcast_vf_f_advsimd_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(-16.635532333438687426013570f)), vcast_vf_f_advsimd_sleef(-1), x); + x = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(a), vcast_vf_f_advsimd_sleef(-0.0f), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_log10f4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x; + vfloat_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), m), dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)); + + t = vcast_vf_f_advsimd_sleef(+0.1314289868e+0); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef( +0.1735493541e+0)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef( +0.2895309627e+0)); + + vfloat2_advsimd_sleef s = dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(0.30103001, -1.432098889e-08), vcast_vf_vi2_advsimd_sleef(e)); + + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfmul_vf2_vf2_vf2_advsimd_sleef(x, vcast_vf2_f_f_advsimd_sleef(0.868588984, -2.170757285e-08))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x)), t)); + + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), vf2gety_vf_vf2_advsimd_sleef(s)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vispinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), visnan_vo_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_log2f4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x; + vfloat_advsimd_sleef t, m, x2; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), m), dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)); + + t = vcast_vf_f_advsimd_sleef(+0.4374550283e+0f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.5764790177e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.9618012905120f)); + + vfloat2_advsimd_sleef s = dfadd2_vf2_vf_vf2_advsimd_sleef(vcast_vf_vi2_advsimd_sleef(e), + dfmul_vf2_vf2_vf2_advsimd_sleef(x, vcast_vf2_f_f_advsimd_sleef(2.8853900432586669922, 3.2734474483568488616e-08))); + + s = dfadd2_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x)), t)); + + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), vf2gety_vf_vf2_advsimd_sleef(s)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vispinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), visnan_vo_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_log2f4_u35advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef m, t, x, x2; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_advsimd_sleef(d, vneg_vi2_vi2_advsimd_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + + x = vdiv_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(1)), vadd_vf_vf_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(1))); + x2 = vmul_vf_vf_vf_advsimd_sleef(x, x); + + t = vcast_vf_f_advsimd_sleef(+0.4374088347e+0); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.5764843822e+0)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.9618024230e+0)); + + vfloat_advsimd_sleef r = vmla_vf_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x2, x), t, + vmla_vf_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(+0.2885390043e+1), vcast_vf_vi2_advsimd_sleef(e))); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vispinf_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), visnan_vo_vf_advsimd_sleef(d)), vcast_vf_f_advsimd_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_log1pf4_u10advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x; + vfloat_advsimd_sleef t, m, x2; + + vfloat_advsimd_sleef dp1 = vadd_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1)); + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(dp1, vcast_vf_f_advsimd_sleef(0x1p-126)); + dp1 = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(dp1, vcast_vf_f_advsimd_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), dp1); + vint2_advsimd_sleef e = vilogb2k_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(dp1, vcast_vf_f_advsimd_sleef(1.0f/0.75f))); + t = vldexp3_vf_vf_vi2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vneg_vi2_vi2_advsimd_sleef(e)); + m = vmla_vf_vf_vf_vf_advsimd_sleef(d, t, vsub_vf_vf_vf_advsimd_sleef(t, vcast_vf_f_advsimd_sleef(1))); + e = vsel_vi2_vo_vi2_vi2_advsimd_sleef(o, vsub_vi2_vi2_vi2_advsimd_sleef(e, vcast_vi2_i_advsimd_sleef(64)), e); + vfloat2_advsimd_sleef s = dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_advsimd_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(m, vcast_vf_f_advsimd_sleef(0)), dfadd_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2), m)); + x2 = vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2getx_vf_vf2_advsimd_sleef(x)); + + t = vcast_vf_f_advsimd_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, x2, vcast_vf_f_advsimd_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_advsimd_sleef(s, dfscale_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2))); + s = dfadd_vf2_vf2_vf_advsimd_sleef(s, vmul_vf_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x2, vf2getx_vf_vf2_advsimd_sleef(x)), t)); + + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(s), vf2gety_vf_vf2_advsimd_sleef(s)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1e+38)), vcast_vf_f_advsimd_sleef(__builtin_inff()), r); + r = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), d), vreinterpret_vm_vf_advsimd_sleef(r))); + r = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(-1)), vcast_vf_f_advsimd_sleef(-__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-0.0f), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fabsf4_advsimd(vfloat_advsimd_sleef x) { return vabs_vf_vf_advsimd_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_copysignf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { return vcopysign_vf_vf_vf_advsimd_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fmaxf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + + return vsel_vf_vo_vf_vf_advsimd_sleef(visnan_vo_vf_advsimd_sleef(y), x, vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fminf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + + return vsel_vf_vo_vf_vf_advsimd_sleef(visnan_vo_vf_advsimd_sleef(y), x, vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fdimf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef ret = vsub_vf_vf_vf_advsimd_sleef(x, y); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(ret, vcast_vf_f_advsimd_sleef(0)), veq_vo_vf_vf_advsimd_sleef(x, y)), vcast_vf_f_advsimd_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_truncf4_advsimd(vfloat_advsimd_sleef x) { + + return vtruncate_vf_vf_advsimd_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_floorf4_advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef fr = vsub_vf_vf_vf_advsimd_sleef(x, vcast_vf_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(x))); + fr = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(0)), vadd_vf_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(1.0f)), fr); + return vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), vge_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_ceilf4_advsimd(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef fr = vsub_vf_vf_vf_advsimd_sleef(x, vcast_vf_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(x))); + fr = vsel_vf_vo_vf_vf_advsimd_sleef(vle_vo_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(0)), fr, vsub_vf_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(1.0f))); + return vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), vge_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_roundf4_advsimd(vfloat_advsimd_sleef d) { + vfloat_advsimd_sleef x = vadd_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.5f)); + vfloat_advsimd_sleef fr = vsub_vf_vf_vf_advsimd_sleef(x, vcast_vf_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(x))); + x = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vle_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), veq_vo_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(0))), vsub_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1.0f)), x); + fr = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(0)), vadd_vf_vf_vf_advsimd_sleef(fr, vcast_vf_f_advsimd_sleef(1.0f)), fr); + x = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.4999999701976776123f)), vcast_vf_f_advsimd_sleef(0), x); + return vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vge_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(INT64_C(1) << 23))), d, vcopysign_vf_vf_vf_advsimd_sleef(vsub_vf_vf_vf_advsimd_sleef(x, fr), d)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_rintf4_advsimd(vfloat_advsimd_sleef d) { + + return vrint_vf_vf_advsimd_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fmaf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y, vfloat_advsimd_sleef z) { + + return vfma_vf_vf_vf_vf_advsimd_sleef(x, y, z); + +} + +SLEEF_INLINE vfloat_advsimd_sleef Sleef_sqrtf4_u05advsimd(vfloat_advsimd_sleef d) { + + vfloat_advsimd_sleef q, w, x, y, z; + + d = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), d); + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(5.2939559203393770e-23f)); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.8889465931478580e+22f)), d); + q = vsel_vf_vo_vf_vf_advsimd_sleef(o, vcast_vf_f_advsimd_sleef(7.2759576141834260e-12f), vcast_vf_f_advsimd_sleef(1.0f)); + + y = vreinterpret_vf_vi2_advsimd_sleef(vsub_vi2_vi2_vi2_advsimd_sleef(vcast_vi2_i_advsimd_sleef(0x5f3759df), vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(vreinterpret_vi2_vf_advsimd_sleef(d)), 1)))); + + x = vmul_vf_vf_vf_advsimd_sleef(d, y); w = vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5), y); + y = vfmanp_vf_vf_vf_vf_advsimd_sleef(x, w, vcast_vf_f_advsimd_sleef(0.5)); + x = vfma_vf_vf_vf_vf_advsimd_sleef(x, y, x); w = vfma_vf_vf_vf_vf_advsimd_sleef(w, y, w); + y = vfmanp_vf_vf_vf_vf_advsimd_sleef(x, w, vcast_vf_f_advsimd_sleef(0.5)); + x = vfma_vf_vf_vf_vf_advsimd_sleef(x, y, x); w = vfma_vf_vf_vf_vf_advsimd_sleef(w, y, w); + + y = vfmanp_vf_vf_vf_vf_advsimd_sleef(x, w, vcast_vf_f_advsimd_sleef(1.5)); w = vadd_vf_vf_vf_advsimd_sleef(w, w); + w = vmul_vf_vf_vf_advsimd_sleef(w, y); + x = vmul_vf_vf_vf_advsimd_sleef(w, d); + y = vfmapn_vf_vf_vf_vf_advsimd_sleef(w, d, x); z = vfmanp_vf_vf_vf_vf_advsimd_sleef(w, x, vcast_vf_f_advsimd_sleef(1)); + + z = vfmanp_vf_vf_vf_vf_advsimd_sleef(w, y, z); w = vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5), x); + w = vfma_vf_vf_vf_vf_advsimd_sleef(w, z, y); + w = vadd_vf_vf_vf_advsimd_sleef(w, x); + + w = vmul_vf_vf_vf_advsimd_sleef(w, q); + + w = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), + veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(__builtin_inff()))), d, w); + + w = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sqrtf4_advsimd(vfloat_advsimd_sleef d) { + + return vsqrt_vf_vf_advsimd_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_hypotf4_u05advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + x = vabs_vf_vf_advsimd_sleef(x); + y = vabs_vf_vf_advsimd_sleef(y); + vfloat_advsimd_sleef min = vmin_vf_vf_vf_advsimd_sleef(x, y), n = min; + vfloat_advsimd_sleef max = vmax_vf_vf_vf_advsimd_sleef(x, y), d = max; + + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(max, vcast_vf_f_advsimd_sleef(0x1p-126)); + n = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(n, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 24)), n); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 24)), d); + + vfloat2_advsimd_sleef t = dfdiv_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_vf_vf_advsimd_sleef(n, vcast_vf_f_advsimd_sleef(0)), vcast_vf2_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0))); + t = dfmul_vf2_vf2_vf_advsimd_sleef(dfsqrt_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(dfsqu_vf2_vf2_advsimd_sleef(t), vcast_vf_f_advsimd_sleef(1))), max); + vfloat_advsimd_sleef ret = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t), vf2gety_vf_vf2_advsimd_sleef(t)); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(visnan_vo_vf_advsimd_sleef(ret), vcast_vf_f_advsimd_sleef(__builtin_inff()), ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(min, vcast_vf_f_advsimd_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(__builtin_inff())), veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(__builtin_inff()))), vcast_vf_f_advsimd_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_hypotf4_u35advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + x = vabs_vf_vf_advsimd_sleef(x); + y = vabs_vf_vf_advsimd_sleef(y); + vfloat_advsimd_sleef min = vmin_vf_vf_vf_advsimd_sleef(x, y); + vfloat_advsimd_sleef max = vmax_vf_vf_vf_advsimd_sleef(x, y); + + vfloat_advsimd_sleef t = vdiv_vf_vf_vf_advsimd_sleef(min, max); + vfloat_advsimd_sleef ret = vmul_vf_vf_vf_advsimd_sleef(max, vsqrt_vf_vf_advsimd_sleef(vmla_vf_vf_vf_vf_advsimd_sleef(t, t, vcast_vf_f_advsimd_sleef(1)))); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(min, vcast_vf_f_advsimd_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(__builtin_inff())), veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(__builtin_inff()))), vcast_vf_f_advsimd_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_nextafterf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + x = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0), y), x); + vint2_advsimd_sleef xi2 = vreinterpret_vi2_vf_advsimd_sleef(x); + vopmask_advsimd_sleef c = vxor_vo_vo_vo_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(x), vge_vo_vf_vf_advsimd_sleef(y, x)); + + xi2 = vsel_vi2_vo_vi2_vi2_advsimd_sleef(c, vsub_vi2_vi2_vi2_advsimd_sleef(vcast_vi2_i_advsimd_sleef(0), vxor_vi2_vi2_vi2_advsimd_sleef(xi2, vcast_vi2_i_advsimd_sleef((int)(1U << 31)))), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_advsimd_sleef(vneq_vo_vf_vf_advsimd_sleef(x, y), vsub_vi2_vi2_vi2_advsimd_sleef(xi2, vcast_vi2_i_advsimd_sleef(1)), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_advsimd_sleef(c, vsub_vi2_vi2_vi2_advsimd_sleef(vcast_vi2_i_advsimd_sleef(0), vxor_vi2_vi2_vi2_advsimd_sleef(xi2, vcast_vi2_i_advsimd_sleef((int)(1U << 31)))), xi2); + + vfloat_advsimd_sleef ret = vreinterpret_vf_vi2_advsimd_sleef(xi2); + + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(ret, vcast_vf_f_advsimd_sleef(0)), vneq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0))), + vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0), x), ret); + + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), veq_vo_vf_vf_advsimd_sleef(y, vcast_vf_f_advsimd_sleef(0))), y, ret); + + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(visnan_vo_vf_advsimd_sleef(x), visnan_vo_vf_advsimd_sleef(y)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_frfrexpf4_advsimd(vfloat_advsimd_sleef x) { + x = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(0x1p-126)), vmul_vf_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 30)), x); + + vmask_advsimd_sleef xm = vreinterpret_vm_vf_advsimd_sleef(x); + xm = vand_vm_vm_vm_advsimd_sleef(xm, vcast_vm_i_i_advsimd_sleef(~0x7f800000U, ~0x7f800000U)); + xm = vor_vm_vm_vm_advsimd_sleef (xm, vcast_vm_i_i_advsimd_sleef( 0x3f000000U, 0x3f000000U)); + + vfloat_advsimd_sleef ret = vreinterpret_vf_vm_advsimd_sleef(xm); + + ret = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(__builtin_inff()), x), ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint2_advsimd_sleef Sleef_expfrexpf4_advsimd(vfloat_advsimd_sleef x) { + + return vcast_vi2_i_advsimd_sleef(0); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vtoward0_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x) { + vfloat_advsimd_sleef t = vreinterpret_vf_vi2_advsimd_sleef(vsub_vi2_vi2_vi2_advsimd_sleef(vreinterpret_vi2_vf_advsimd_sleef(x), vcast_vi2_i_advsimd_sleef(1))); + return vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vptrunc_vf_vf_advsimd_sleef(vfloat_advsimd_sleef x) { + + return vtruncate_vf_vf_advsimd_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_fmodf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef nu = vabs_vf_vf_advsimd_sleef(x), de = vabs_vf_vf_advsimd_sleef(y), s = vcast_vf_f_advsimd_sleef(1), q; + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(de, vcast_vf_f_advsimd_sleef(0x1p-126)); + nu = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(nu, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 25)), nu); + de = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(de, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 25)), de); + s = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(s , vcast_vf_f_advsimd_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat_advsimd_sleef rde = vtoward0_vf_vf_advsimd_sleef(vrec_vf_vf_advsimd_sleef(de)); + + vfloat2_advsimd_sleef r = vcast_vf2_vf_vf_advsimd_sleef(nu, vcast_vf_f_advsimd_sleef(0)); + + for(int i=0;i<8;i++) { + q = vptrunc_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vtoward0_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r)), rde)); + q = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(3), de), vf2getx_vf_vf2_advsimd_sleef(r)), + vge_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), de)), + vcast_vf_f_advsimd_sleef(2), q); + q = vsel_vf_vo_vf_vf_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2), de), vf2getx_vf_vf2_advsimd_sleef(r)), + vge_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), de)), + vcast_vf_f_advsimd_sleef(1), q); + r = dfnormalize_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf2_advsimd_sleef(r, dfmul_vf2_vf_vf_advsimd_sleef(vptrunc_vf_vf_advsimd_sleef(q), vneg_vf_vf_advsimd_sleef(de)))); + if (vtestallones_i_vo32_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), de))) break; + } + + vfloat_advsimd_sleef ret = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), vf2gety_vf_vf2_advsimd_sleef(r)), s); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), vf2gety_vf_vf2_advsimd_sleef(r)), de), vcast_vf_f_advsimd_sleef(0), ret); + + ret = vmulsign_vf_vf_vf_advsimd_sleef(ret, x); + + ret = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(nu, de), x, ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(de, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_advsimd_sleef vrintfk2_vf_vf_advsimd_sleef(vfloat_advsimd_sleef d) { + + return vrint_vf_vf_advsimd_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_remainderf4_advsimd(vfloat_advsimd_sleef x, vfloat_advsimd_sleef y) { + vfloat_advsimd_sleef n = vabs_vf_vf_advsimd_sleef(x), d = vabs_vf_vf_advsimd_sleef(y), s = vcast_vf_f_advsimd_sleef(1), q; + vopmask_advsimd_sleef o = vlt_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0x1p-126*2)); + n = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(n, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 25)), n); + d = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(UINT64_C(1) << 25)), d); + s = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmul_vf_vf_vf_advsimd_sleef(s , vcast_vf_f_advsimd_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat2_advsimd_sleef r = vcast_vf2_vf_vf_advsimd_sleef(n, vcast_vf_f_advsimd_sleef(0)); + vfloat_advsimd_sleef rd = vrec_vf_vf_advsimd_sleef(d); + vopmask_advsimd_sleef qisodd = vneq_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0), vcast_vf_f_advsimd_sleef(0)); + + for(int i=0;i<8;i++) { + q = vrintfk2_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), rd)); + q = vsel_vf_vo_vf_vf_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r)), vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(1.5f))), vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1.0f), vf2getx_vf_vf2_advsimd_sleef(r)), q); + q = vsel_vf_vo_vf_vf_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r)), vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.5f))), + vandnot_vo_vo_vo_advsimd_sleef(qisodd, veq_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r)), vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0.5f))))), + vcast_vf_f_advsimd_sleef(0.0), q); + if (vtestallones_i_vo32_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(q, vcast_vf_f_advsimd_sleef(0)))) break; + q = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(q, vneg_vf_vf_advsimd_sleef(d))), vadd_vf_vf_vf_advsimd_sleef(q, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-1), vf2getx_vf_vf2_advsimd_sleef(r))), q); + qisodd = vxor_vo_vo_vo_advsimd_sleef(qisodd, vand_vo_vo_vo_advsimd_sleef(veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(q), vcast_vi2_i_advsimd_sleef(1)), vcast_vi2_i_advsimd_sleef(1)), + vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(q), vcast_vf_f_advsimd_sleef(1 << 24)))); + r = dfnormalize_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf2_advsimd_sleef(r, dfmul_vf2_vf_vf_advsimd_sleef(q, vneg_vf_vf_advsimd_sleef(d)))); + } + + vfloat_advsimd_sleef ret = vmul_vf_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(r), vf2gety_vf_vf2_advsimd_sleef(r)), s); + ret = vmulsign_vf_vf_vf_advsimd_sleef(ret, x); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(y), vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), x), ret); + ret = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), ret); + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef sinpifk_advsimd_sleef(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, t; + vfloat2_advsimd_sleef x, s2; + + u = vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(4.0)); + vint2_advsimd_sleef q = vtruncate_vi2_vf_advsimd_sleef(u); + q = vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vxor_vi2_vi2_vi2_advsimd_sleef(vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(q), 31)), vcast_vi2_i_advsimd_sleef(1))), vcast_vi2_i_advsimd_sleef(~1)); + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(2)); + + s = vsub_vf_vf_vf_advsimd_sleef(u, vcast_vf_vi2_advsimd_sleef(q)); + t = s; + s = vmul_vf_vf_vf_advsimd_sleef(s, s); + s2 = dfmul_vf2_vf_vf_advsimd_sleef(t, t); + + u = vsel_vf_vo_f_f_advsimd_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vsel_vf_vo_f_f_advsimd_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vsel_vf_vo_f_f_advsimd_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(u, s), + vsel_vf2_vo_f_f_f_f_advsimd_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_advsimd_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_advsimd_sleef(x, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, s2, vcast_vf2_vf_vf_advsimd_sleef(t, vcast_vf_f_advsimd_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1)), x); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + x = vf2setx_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x))))); + x = vf2sety_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_sinpif4_u05advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x = sinpifk_advsimd_sleef(d); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(visnegzero_vo_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(-0.0), r); + r = vreinterpret_vf_vm_advsimd_sleef(vandnot_vm_vo32_vm_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(8e+6f)), vreinterpret_vm_vf_advsimd_sleef(r))); + r = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vreinterpret_vm_vf_advsimd_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef cospifk_advsimd_sleef(vfloat_advsimd_sleef d) { + vopmask_advsimd_sleef o; + vfloat_advsimd_sleef u, s, t; + vfloat2_advsimd_sleef x, s2; + + u = vmul_vf_vf_vf_advsimd_sleef(d, vcast_vf_f_advsimd_sleef(4.0)); + vint2_advsimd_sleef q = vtruncate_vi2_vf_advsimd_sleef(u); + q = vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vxor_vi2_vi2_vi2_advsimd_sleef(vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(q), 31)), vcast_vi2_i_advsimd_sleef(1))), vcast_vi2_i_advsimd_sleef(~1)); + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(0)); + + s = vsub_vf_vf_vf_advsimd_sleef(u, vcast_vf_vi2_advsimd_sleef(q)); + t = s; + s = vmul_vf_vf_vf_advsimd_sleef(s, s); + s2 = dfmul_vf2_vf_vf_advsimd_sleef(t, t); + + u = vsel_vf_vo_f_f_advsimd_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vsel_vf_vo_f_f_advsimd_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, s, vsel_vf_vo_f_f_advsimd_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(u, s), + vsel_vf2_vo_f_f_f_f_advsimd_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_advsimd_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_advsimd_sleef(x, vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, s2, vcast_vf2_vf_vf_advsimd_sleef(t, vcast_vf_f_advsimd_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1)), x); + + o = veq_vo_vi2_vi2_advsimd_sleef(vand_vi2_vi2_vi2_advsimd_sleef(vadd_vi2_vi2_vi2_advsimd_sleef(q, vcast_vi2_i_advsimd_sleef(2)), vcast_vi2_i_advsimd_sleef(4)), vcast_vi2_i_advsimd_sleef(4)); + x = vf2setx_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x))))); + x = vf2sety_vf2_vf2_vf_advsimd_sleef(x, vreinterpret_vf_vm_advsimd_sleef(vxor_vm_vm_vm_advsimd_sleef(vand_vm_vo32_vm_advsimd_sleef(o, vreinterpret_vm_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(-0.0))), vreinterpret_vm_vf_advsimd_sleef(vf2gety_vf_vf2_advsimd_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_cospif4_u05advsimd(vfloat_advsimd_sleef d) { + vfloat2_advsimd_sleef x = cospifk_advsimd_sleef(d); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(vgt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(d), vcast_vf_f_advsimd_sleef(8e+6f)), vcast_vf_f_advsimd_sleef(1), r); + r = vreinterpret_vf_vm_advsimd_sleef(vor_vm_vo32_vm_advsimd_sleef(visinf_vo_vf_advsimd_sleef(d), vreinterpret_vm_vf_advsimd_sleef(r))); + + return r; +} + + typedef struct { + vfloat2_advsimd_sleef a, b; + } df2_advsimd_sleef; + +static df2_advsimd_sleef df2setab_df2_vf2_vf2_advsimd_sleef(vfloat2_advsimd_sleef a, vfloat2_advsimd_sleef b) { + df2_advsimd_sleef r = { a, b }; + return r; +} +static vfloat2_advsimd_sleef df2geta_vf2_df2_advsimd_sleef(df2_advsimd_sleef d) { return d.a; } +static vfloat2_advsimd_sleef df2getb_vf2_df2_advsimd_sleef(df2_advsimd_sleef d) { return d.b; } + +static SLEEF_CONST df2_advsimd_sleef gammafk_advsimd_sleef(vfloat_advsimd_sleef a) { + vfloat2_advsimd_sleef clc = vcast_vf2_f_f_advsimd_sleef(0, 0), clln = vcast_vf2_f_f_advsimd_sleef(1, 0), clld = vcast_vf2_f_f_advsimd_sleef(1, 0); + vfloat2_advsimd_sleef x, y, z; + vfloat_advsimd_sleef t, u; + + vopmask_advsimd_sleef otiny = vlt_vo_vf_vf_advsimd_sleef(vabs_vf_vf_advsimd_sleef(a), vcast_vf_f_advsimd_sleef(1e-30f)), oref = vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0.5)); + + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(otiny, vcast_vf2_f_f_advsimd_sleef(0, 0), + vsel_vf2_vo_vf2_vf2_advsimd_sleef(oref, dfadd2_vf2_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), vneg_vf_vf_advsimd_sleef(a)), + vcast_vf2_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)))); + + vopmask_advsimd_sleef o0 = vand_vo_vo_vo_advsimd_sleef(vle_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(0.5), vf2getx_vf_vf2_advsimd_sleef(x)), vle_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(1.2))); + vopmask_advsimd_sleef o2 = vle_vo_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2.3), vf2getx_vf_vf2_advsimd_sleef(x)); + + y = dfnormalize_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1)), x)); + y = dfnormalize_vf2_vf2_advsimd_sleef(dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2)), y)); + + vopmask_advsimd_sleef o = vand_vo_vo_vo_advsimd_sleef(o2, vle_vo_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vcast_vf_f_advsimd_sleef(7))); + clln = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, y, clln); + + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o, dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(3)), x); + t = vsel_vf_vo_vf_vf_advsimd_sleef(o2, vrec_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x)), vf2getx_vf_vf2_advsimd_sleef(dfnormalize_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(x, vsel_vf_vo_f_f_advsimd_sleef(o0, -1, -2))))); + + u = vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, +0.000839498720672087279971000786, +0.9435157776e+0f, +0.1102489550e-3f); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, -5.17179090826059219329394422e-05, +0.8670063615e+0f, +0.8160019934e-4f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, -0.000592166437353693882857342347, +0.4826702476e+0f, +0.1528468856e-3f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.8855129778e-1f, -0.2355068718e-3f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, +0.000784039221720066627493314301, +0.1013825238e+0f, +0.4962242092e-3f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, -0.000229472093621399176949318732, -0.1493408978e+0f, -0.1193488017e-2f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, -0.002681327160493827160473958490, +0.1697509140e+0f, +0.2891599433e-2f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, +0.003472222222222222222175164840, -0.2072454542e+0f, -0.7385451812e-2f)); + u = vmla_vf_vf_vf_vf_advsimd_sleef(u, t, vsel_vf_vo_vo_f_f_f_advsimd_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705872357e+0f, +0.2058077045e-1f)); + + y = dfmul_vf2_vf2_vf2_advsimd_sleef(dfadd2_vf2_vf2_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(-0.5)), logk2f_advsimd_sleef(x)); + y = dfadd2_vf2_vf2_vf2_advsimd_sleef(y, dfneg_vf2_vf2_advsimd_sleef(x)); + y = dfadd2_vf2_vf2_vf2_advsimd_sleef(y, vcast_vf2_d_advsimd_sleef(0.91893853320467278056)); + + z = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf_vf_advsimd_sleef (u, t), vsel_vf_vo_f_f_advsimd_sleef(o0, -0.400686534596170958447352690395e+0f, -0.673523028297382446749257758235e-1f)); + z = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(z, t), vsel_vf_vo_f_f_advsimd_sleef(o0, +0.822466960142643054450325495997e+0f, +0.322467033928981157743538726901e+0f)); + z = dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf2_vf_advsimd_sleef(z, t), vsel_vf_vo_f_f_advsimd_sleef(o0, -0.577215665946766039837398973297e+0f, +0.422784335087484338986941629852e+0f)); + z = dfmul_vf2_vf2_vf_advsimd_sleef(z, t); + + clc = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o2, y, z); + + clld = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o2, dfadd2_vf2_vf2_vf_advsimd_sleef(dfmul_vf2_vf_vf_advsimd_sleef(u, t), vcast_vf_f_advsimd_sleef(1)), clld); + + y = clln; + + clc = vsel_vf2_vo_vf2_vf2_advsimd_sleef(otiny, vcast_vf2_d_advsimd_sleef(41.58883083359671856503), + vsel_vf2_vo_vf2_vf2_advsimd_sleef(oref, dfadd2_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_d_advsimd_sleef(1.1447298858494001639), dfneg_vf2_vf2_advsimd_sleef(clc)), clc)); + clln = vsel_vf2_vo_vf2_vf2_advsimd_sleef(otiny, vcast_vf2_f_f_advsimd_sleef(1, 0), vsel_vf2_vo_vf2_vf2_advsimd_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo32_advsimd_sleef(vnot_vo32_vo32_advsimd_sleef(oref))) { + t = vsub_vf_vf_vf_advsimd_sleef(a, vmul_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(INT64_C(1) << 12), vcast_vf_vi2_advsimd_sleef(vtruncate_vi2_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(1.0 / (INT64_C(1) << 12))))))); + x = dfmul_vf2_vf2_vf2_advsimd_sleef(clld, sinpifk_advsimd_sleef(t)); + } + + clld = vsel_vf2_vo_vf2_vf2_advsimd_sleef(otiny, vcast_vf2_vf_vf_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef((INT64_C(1) << 30)*(float)(INT64_C(1) << 30))), vcast_vf_f_advsimd_sleef(0)), + vsel_vf2_vo_vf2_vf2_advsimd_sleef(oref, x, y)); + + return df2setab_df2_vf2_vf2_advsimd_sleef(clc, dfdiv_vf2_vf2_vf2_advsimd_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_tgammaf4_u10advsimd(vfloat_advsimd_sleef a) { + df2_advsimd_sleef d = gammafk_advsimd_sleef(a); + vfloat2_advsimd_sleef y = dfmul_vf2_vf2_vf2_advsimd_sleef(expk2f_advsimd_sleef(df2geta_vf2_df2_advsimd_sleef(d)), df2getb_vf2_df2_advsimd_sleef(d)); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(y)); + vopmask_advsimd_sleef o; + + o = vor_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(-__builtin_inff())), + vand_vo_vo_vo_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), visint_vo_vf_advsimd_sleef(a))), + vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(visnumber_vo_vf_advsimd_sleef(a), vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0))), visnan_vo_vf_advsimd_sleef(r))); + r = vsel_vf_vo_vf_vf_advsimd_sleef(o, vcast_vf_f_advsimd_sleef(__builtin_nanf("")), r); + + o = vand_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(__builtin_inff())), visnumber_vo_vf_advsimd_sleef(a)), + vge_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(-0x1p-126))), + vor_vo_vo_vo_advsimd_sleef(vor_vo_vo_vo_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), vgt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(36))), visnan_vo_vf_advsimd_sleef(r))); + r = vsel_vf_vo_vf_vf_advsimd_sleef(o, vmulsign_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(__builtin_inff()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_lgammaf4_u10advsimd(vfloat_advsimd_sleef a) { + df2_advsimd_sleef d = gammafk_advsimd_sleef(a); + vfloat2_advsimd_sleef y = dfadd2_vf2_vf2_vf2_advsimd_sleef(df2geta_vf2_df2_advsimd_sleef(d), logk2f_advsimd_sleef(dfabs_vf2_vf2_advsimd_sleef(df2getb_vf2_df2_advsimd_sleef(d)))); + vfloat_advsimd_sleef r = vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(y), vf2gety_vf_vf2_advsimd_sleef(y)); + vopmask_advsimd_sleef o; + + o = vor_vo_vo_vo_advsimd_sleef(visinf_vo_vf_advsimd_sleef(a), + vor_vo_vo_vo_advsimd_sleef(vand_vo_vo_vo_advsimd_sleef(vle_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), visint_vo_vf_advsimd_sleef(a)), + vand_vo_vo_vo_advsimd_sleef(visnumber_vo_vf_advsimd_sleef(a), visnan_vo_vf_advsimd_sleef(r)))); + r = vsel_vf_vo_vf_vf_advsimd_sleef(o, vcast_vf_f_advsimd_sleef(__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef dfmla_vf2_vf_vf2_vf2_advsimd_sleef(vfloat_advsimd_sleef x, vfloat2_advsimd_sleef y, vfloat2_advsimd_sleef z) { + return dfadd_vf2_vf2_vf2_advsimd_sleef(z, dfmul_vf2_vf2_vf_advsimd_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef poly2df_b_advsimd_sleef(vfloat_advsimd_sleef x, vfloat2_advsimd_sleef c1, vfloat2_advsimd_sleef c0) { return dfmla_vf2_vf_vf2_vf2_advsimd_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef poly2df_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef c1, vfloat2_advsimd_sleef c0) { return dfmla_vf2_vf_vf2_vf2_advsimd_sleef(x, vcast_vf2_vf_vf_advsimd_sleef(c1, vcast_vf_f_advsimd_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_advsimd_sleef poly4df_advsimd_sleef(vfloat_advsimd_sleef x, vfloat_advsimd_sleef c3, vfloat2_advsimd_sleef c2, vfloat2_advsimd_sleef c1, vfloat2_advsimd_sleef c0) { + return dfmla_vf2_vf_vf2_vf2_advsimd_sleef(vmul_vf_vf_vf_advsimd_sleef(x, x), poly2df_advsimd_sleef(x, c3, c2), poly2df_b_advsimd_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_erff4_u10advsimd(vfloat_advsimd_sleef a) { + vfloat_advsimd_sleef t, x = vabs_vf_vf_advsimd_sleef(a); + vfloat2_advsimd_sleef t2; + vfloat_advsimd_sleef x2 = vmul_vf_vf_vf_advsimd_sleef(x, x), x4 = vmul_vf_vf_vf_advsimd_sleef(x2, x2); + vopmask_advsimd_sleef o25 = vle_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo32_advsimd_sleef(o25)), 1)) { + + t = vmla_vf_vf_vf_vf_advsimd_sleef((x4), (vmla_vf_vf_vf_vf_advsimd_sleef((x), (vcast_vf_f_advsimd_sleef(-0.4360447008e-6)), (vcast_vf_f_advsimd_sleef(+0.6867515367e-5)))), (vmla_vf_vf_vf_vf_advsimd_sleef((x2), (vmla_vf_vf_vf_vf_advsimd_sleef((x), (vcast_vf_f_advsimd_sleef(-0.3045156700e-4)), (vcast_vf_f_advsimd_sleef(+0.9808536561e-4)))), (vmla_vf_vf_vf_vf_advsimd_sleef((x), (vcast_vf_f_advsimd_sleef(+0.2395523916e-3)), (vcast_vf_f_advsimd_sleef(+0.1459901541e-3))))))) + + ; + t2 = poly4df_advsimd_sleef(x, t, + vcast_vf2_f_f_advsimd_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_advsimd_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_advsimd_sleef(0.070523701608180999756, -3.6616309318707365163e-09)); + t2 = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), dfmul_vf2_vf2_vf_advsimd_sleef(t2, x)); + t2 = dfsqu_vf2_vf2_advsimd_sleef(t2); + t2 = dfsqu_vf2_vf2_advsimd_sleef(t2); + t2 = dfsqu_vf2_vf2_advsimd_sleef(t2); + t2 = dfsqu_vf2_vf2_advsimd_sleef(t2); + t2 = dfrec_vf2_vf2_advsimd_sleef(t2); + } else { + + t = vmla_vf_vf_vf_vf_advsimd_sleef((x4), (vmla_vf_vf_vf_vf_advsimd_sleef((x), ((vsel_vf_vo_f_f_advsimd_sleef(o25, -0.4360447008e-6, -0.1130012848e-6))), ((vsel_vf_vo_f_f_advsimd_sleef(o25, +0.6867515367e-5, +0.4115272986e-5))))), (vmla_vf_vf_vf_vf_advsimd_sleef((x2), (vmla_vf_vf_vf_vf_advsimd_sleef((x), ((vsel_vf_vo_f_f_advsimd_sleef(o25, -0.3045156700e-4, -0.6928304356e-4))), ((vsel_vf_vo_f_f_advsimd_sleef(o25, +0.9808536561e-4, +0.7172692567e-3))))), (vmla_vf_vf_vf_vf_advsimd_sleef((x), ((vsel_vf_vo_f_f_advsimd_sleef(o25, +0.2395523916e-3, -0.5131045356e-2))), ((vsel_vf_vo_f_f_advsimd_sleef(o25, +0.1459901541e-3, +0.2708637156e-1)))))))) + + ; + t2 = poly4df_advsimd_sleef(x, t, + vsel_vf2_vo_vf2_vf2_advsimd_sleef(o25, vcast_vf2_f_f_advsimd_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_advsimd_sleef(-0.11064319312572479248, 3.7050452777225283007e-09)), + vsel_vf2_vo_vf2_vf2_advsimd_sleef(o25, vcast_vf2_f_f_advsimd_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_advsimd_sleef(-0.63192230463027954102, -2.0200432585073177859e-08)), + vsel_vf2_vo_vf2_vf2_advsimd_sleef(o25, vcast_vf2_f_f_advsimd_sleef(0.070523701608180999756, -3.6616309318707365163e-09), + vcast_vf2_f_f_advsimd_sleef(-1.1296638250350952148, 2.5515120196453259252e-08))); + t2 = dfmul_vf2_vf2_vf_advsimd_sleef(t2, x); + vfloat2_advsimd_sleef s2 = dfadd_vf2_vf_vf2_advsimd_sleef(vcast_vf_f_advsimd_sleef(1), t2); + s2 = dfsqu_vf2_vf2_advsimd_sleef(s2); + s2 = dfsqu_vf2_vf2_advsimd_sleef(s2); + s2 = dfsqu_vf2_vf2_advsimd_sleef(s2); + s2 = dfsqu_vf2_vf2_advsimd_sleef(s2); + s2 = dfrec_vf2_vf2_advsimd_sleef(s2); + t2 = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o25, s2, vcast_vf2_vf_vf_advsimd_sleef(expkf_advsimd_sleef(t2), vcast_vf_f_advsimd_sleef(0))); + } + + t2 = dfadd2_vf2_vf2_vf_advsimd_sleef(t2, vcast_vf_f_advsimd_sleef(-1)); + t2 = vsel_vf2_vo_vf2_vf2_advsimd_sleef(vlt_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(1e-4)), dfmul_vf2_vf2_vf_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(-1.1283792257308959961, 5.8635383422197591097e-08), x), t2); + + vfloat_advsimd_sleef z = vneg_vf_vf_advsimd_sleef(vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(t2), vf2gety_vf_vf2_advsimd_sleef(t2))); + z = vsel_vf_vo_vf_vf_advsimd_sleef(vge_vo_vf_vf_advsimd_sleef(x, vcast_vf_f_advsimd_sleef(6)), vcast_vf_f_advsimd_sleef(1), z); + z = vsel_vf_vo_vf_vf_advsimd_sleef(visinf_vo_vf_advsimd_sleef(a), vcast_vf_f_advsimd_sleef(1), z); + z = vsel_vf_vo_vf_vf_advsimd_sleef(veq_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), vcast_vf_f_advsimd_sleef(0), z); + z = vmulsign_vf_vf_vf_advsimd_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vfloat_advsimd_sleef Sleef_erfcf4_u15advsimd(vfloat_advsimd_sleef a) { + vfloat_advsimd_sleef s = a, r = vcast_vf_f_advsimd_sleef(0), t; + vfloat2_advsimd_sleef u, d, x; + a = vabs_vf_vf_advsimd_sleef(a); + vopmask_advsimd_sleef o0 = vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(1.0)); + vopmask_advsimd_sleef o1 = vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(2.2)); + vopmask_advsimd_sleef o2 = vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(4.3)); + vopmask_advsimd_sleef o3 = vlt_vo_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(10.1)); + + u = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, vcast_vf2_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)), dfdiv_vf2_vf2_vf2_advsimd_sleef(vcast_vf2_f_f_advsimd_sleef(1, 0), vcast_vf2_vf_vf_advsimd_sleef(a, vcast_vf_f_advsimd_sleef(0)))); + + t = vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(o0, o1, o2, -0.8638041618e-4f, -0.6236977242e-5f, -0.3869504035e+0f, +0.1115344167e+1f); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(o0, o1, o2, +0.6000166177e-3f, +0.5749821503e-4f, +0.1288077235e+1f, -0.9454904199e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(o0, o1, o2, -0.1665703603e-2f, +0.6002851478e-5f, -0.1816803217e+1f, -0.3667259514e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(o0, o1, o2, +0.1795156277e-3f, -0.2851036377e-2f, +0.1249150872e+1f, +0.7155663371e+0f)); + t = vmla_vf_vf_vf_vf_advsimd_sleef(t, vf2getx_vf_vf2_advsimd_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_advsimd_sleef(o0, o1, o2, +0.1914106123e-1f, +0.2260518074e-1f, -0.1328857988e+0f, -0.1262947265e-1f)); + + d = dfmul_vf2_vf2_vf_advsimd_sleef(u, t); + d = dfadd2_vf2_vf2_vf2_advsimd_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.102775359343930288081655368891e+0, -0.105247583459338632253369014063e+0, -0.482365310333045318680618892669e+0, -0.498961546254537647970305302739e+0)); + d = dfmul_vf2_vf2_vf2_advsimd_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_advsimd_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.636619483208481931303752546439e+0, -0.635609463574589034216723775292e+0, -0.134450203224533979217859332703e-2, -0.471199543422848492080722832666e-4)); + d = dfmul_vf2_vf2_vf2_advsimd_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_advsimd_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_advsimd_sleef(o0, o1, o2, -0.112837917790537404939545770596e+1, -0.112855987376668622084547028949e+1, -0.572319781150472949561786101080e+0, -0.572364030327966044425932623525e+0)); + + x = dfmul_vf2_vf2_vf_advsimd_sleef(vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, d, vcast_vf2_vf_vf_advsimd_sleef(vneg_vf_vf_advsimd_sleef(a), vcast_vf_f_advsimd_sleef(0))), a); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, x, dfadd2_vf2_vf2_vf2_advsimd_sleef(x, d)); + + x = expk2f_advsimd_sleef(x); + x = vsel_vf2_vo_vf2_vf2_advsimd_sleef(o1, x, dfmul_vf2_vf2_vf2_advsimd_sleef(x, u)); + + r = vsel_vf_vo_vf_vf_advsimd_sleef(o3, vadd_vf_vf_vf_advsimd_sleef(vf2getx_vf_vf2_advsimd_sleef(x), vf2gety_vf_vf2_advsimd_sleef(x)), vcast_vf_f_advsimd_sleef(0)); + r = vsel_vf_vo_vf_vf_advsimd_sleef(vsignbit_vo_vf_advsimd_sleef(s), vsub_vf_vf_vf_advsimd_sleef(vcast_vf_f_advsimd_sleef(2), r), r); + r = vsel_vf_vo_vf_vf_advsimd_sleef(visnan_vo_vf_advsimd_sleef(s), vcast_vf_f_advsimd_sleef(__builtin_nanf("")), r); + return r; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_rvvm1.h b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_rvvm1.h new file mode 100644 index 0000000000000..a68f41d734d4b --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_rvvm1.h @@ -0,0 +1,7073 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF 3.6.1 + +#ifndef SLEEF_ALWAYS_INLINE +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_ALWAYS_INLINE inline __forceinline +#else +#define SLEEF_ALWAYS_INLINE inline +#endif +#endif + +#ifndef SLEEF_INLINE +#define SLEEF_INLINE static inline +#endif + +#ifndef SLEEF_CONST +#define SLEEF_CONST +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#define SLEEFINLINE_RVVM1_H_INCLUDED + +#ifndef __SLEEF_REMPITAB__ +#define __SLEEF_REMPITAB__ +static const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, +}; + +static const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, +}; +#endif // #ifndef __SLEEF_REMPITAB__ + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const double Sleef_rempitabdp[]; + +static SLEEF_ALWAYS_INLINE vfloat64m1x4_t __riscv_vcreate_v_f64m1x4(vfloat64m1_t x, vfloat64m1_t y, vfloat64m1_t z, vfloat64m1_t w) { + vfloat64m1x4_t unused; + return __riscv_vset(__riscv_vset(__riscv_vset(__riscv_vset(unused, 0, x), 1, y), 2, z), 3, w); +} +static SLEEF_ALWAYS_INLINE vfloat64m2x4_t __riscv_vcreate_v_f64m2x4(vfloat64m2_t x, vfloat64m2_t y, vfloat64m2_t z, vfloat64m2_t w) { + vfloat64m2x4_t unused; + return __riscv_vset(__riscv_vset(__riscv_vset(__riscv_vset(unused, 0, x), 1, y), 2, z), 3, w); +} + +typedef vuint32m1_t rvv_vmask32; +typedef vuint64m1_t vmask_rvvm1_sleef; +typedef vbool32_t rvv_sp_vopmask_rvvm1_sleef; +typedef vbool64_t rvv_dp_vopmask_rvvm1_sleef; + +typedef vint32mf2_t vint_rvvm1_sleef; +typedef vint64m1_t vint64_rvvm1_sleef; +typedef vuint64m1_t vuint64_rvvm1_sleef; +typedef vfloat64m1_t vdouble_rvvm1_sleef; +typedef vfloat64m2_t vdouble2_rvvm1_sleef; +typedef vfloat64m4_t vdouble3_rvvm1_sleef; +typedef vfloat64m4_t dd2_rvvm1_sleef; +typedef vuint64m2_t vquad_rvvm1_sleef; +typedef vint32m2_t di_t_rvvm1_sleef; +typedef vint32m4_t ddi_t_rvvm1_sleef; +typedef vfloat32m1_t vfloat_rvvm1_sleef; +typedef vfloat32m2_t vfloat2_rvvm1_sleef; +typedef vfloat32m4_t df2_rvvm1_sleef; +typedef vint32m1_t vint2_rvvm1_sleef; +typedef vint32m2_t fi_t_rvvm1_sleef; +typedef vint32m4_t dfi_t_rvvm1_sleef; +typedef vuint64m1_t rvv_dp_vuint2; + +typedef vfloat64m1x4_t tdx_rvvm1_sleef; +typedef vfloat64m1x4_t tdi_t_rvvm1_sleef; + +typedef vquad_rvvm1_sleef vargquad_rvvm1_sleef; + +static SLEEF_ALWAYS_INLINE int vavailability_i_rvvm1_sleef(int name) { + + return (__riscv_vsetvlmax_e64m1() >= __riscv_vsetvlmax_e64m1()) ? 3 : 0; +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef figetd_vf_di_rvvm1_sleef(fi_t_rvvm1_sleef d) { + return __riscv_vreinterpret_f32m1(__riscv_vget_i32m1(d, 0)); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef figeti_vi2_di_rvvm1_sleef(fi_t_rvvm1_sleef d) { + return __riscv_vget_i32m1(d, 1); +} +static SLEEF_ALWAYS_INLINE fi_t_rvvm1_sleef fisetdi_fi_vf_vi2_rvvm1_sleef(vfloat_rvvm1_sleef d, vint2_rvvm1_sleef i) { + vint2_rvvm1_sleef vdi = __riscv_vreinterpret_i32m1(d); + return __riscv_vset(__riscv_vlmul_ext_v_i32m1_i32m2(vdi), 1, i); +} +static SLEEF_ALWAYS_INLINE vfloat2_rvvm1_sleef dfigetdf_vf2_dfi_rvvm1_sleef(dfi_t_rvvm1_sleef d) { + return __riscv_vreinterpret_f32m2(__riscv_vget_i32m2(d, 0)); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef dfigeti_vi2_dfi_rvvm1_sleef(dfi_t_rvvm1_sleef d) { + return __riscv_vget_i32m1(d, 2); +} +static SLEEF_ALWAYS_INLINE dfi_t_rvvm1_sleef dfisetdfi_dfi_vf2_vi2_rvvm1_sleef(vfloat2_rvvm1_sleef v, vint2_rvvm1_sleef i) { + fi_t_rvvm1_sleef vi = __riscv_vreinterpret_i32m2(v); + fi_t_rvvm1_sleef ix = __riscv_vmv_v(__riscv_vlmul_ext_v_i32m1_i32m2(i), __riscv_vsetvlmax_e32m1()); + return __riscv_vset(__riscv_vlmul_ext_v_i32m2_i32m4(vi), 1, ix); +} +static SLEEF_ALWAYS_INLINE dfi_t_rvvm1_sleef dfisetdf_dfi_dfi_vf2_rvvm1_sleef(dfi_t_rvvm1_sleef dfi_rvvm1_sleef, vfloat2_rvvm1_sleef v) { + return __riscv_vset(dfi_rvvm1_sleef, 0, __riscv_vreinterpret_i32m2(v)); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vf2getx_vf_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef v) { + return __riscv_vget_f32m1(v, 0); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vf2gety_vf_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef v) { + return __riscv_vget_f32m1(v, 1); +} +static SLEEF_ALWAYS_INLINE vfloat2_rvvm1_sleef vf2setxy_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vset(__riscv_vlmul_ext_v_f32m1_f32m2(x), 1, y); +} +static SLEEF_ALWAYS_INLINE vfloat2_rvvm1_sleef vf2setx_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef v, vfloat_rvvm1_sleef d) { + return __riscv_vset(v, 0, d); +} +static SLEEF_ALWAYS_INLINE vfloat2_rvvm1_sleef vf2sety_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef v, vfloat_rvvm1_sleef d) { + return __riscv_vset(v, 1, d); +} + +static df2_rvvm1_sleef df2setab_df2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef a, vfloat2_rvvm1_sleef b) { + return __riscv_vset(__riscv_vlmul_ext_v_f32m2_f32m4(a), 1, b); +} +static vfloat2_rvvm1_sleef df2geta_vf2_df2_rvvm1_sleef(df2_rvvm1_sleef d) { return __riscv_vget_f32m2(d, 0); } +static vfloat2_rvvm1_sleef df2getb_vf2_df2_rvvm1_sleef(df2_rvvm1_sleef d) { return __riscv_vget_f32m2(d, 1); } +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vreinterpret_vi2_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + return __riscv_vreinterpret_i32m1(vf); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vreinterpret_vf_vi2_rvvm1_sleef(vint2_rvvm1_sleef vi) { + return __riscv_vreinterpret_f32m1(vi); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vcast_vf_f_rvvm1_sleef(float f) { + return __riscv_vfmv_v_f_f32m1(f, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vrint_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef vd_rvvm1_sleef) { + return __riscv_vfcvt_f_x_v_f32m1(__riscv_vfcvt_x_f_v_i32m1_rm(vd_rvvm1_sleef, __RISCV_FRM_RNE, (__riscv_vsetvlmax_e32m1())), (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vcast_vf_vi2_rvvm1_sleef(vint2_rvvm1_sleef vi) { + return __riscv_vfcvt_f(vi, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vcast_vi2_i_rvvm1_sleef(int i) { + return __riscv_vmv_v_x_i32m1(i, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vrint_vi2_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + return __riscv_vfcvt_x_f_v_i32m1_rm(vf, __RISCV_FRM_RNE, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vtruncate_vi2_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + return __riscv_vfcvt_rtz_x(vf, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vtruncate_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + return vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(vf)); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vload_vf_p_rvvm1_sleef(const float *ptr) { + return __riscv_vle32_v_f32m1(ptr, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vloadu_vf_p_rvvm1_sleef(const float *ptr) { + return __riscv_vle32_v_f32m1(ptr, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE void vstore_v_p_vf_rvvm1_sleef(float *ptr, vfloat_rvvm1_sleef v) { + __riscv_vse32(ptr, v, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vf_rvvm1_sleef(float *ptr, vfloat_rvvm1_sleef v) { + __riscv_vse32(ptr, v, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi2_rvvm1_sleef(int32_t *ptr, vint2_rvvm1_sleef v) { + __riscv_vse32(ptr, v, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vgather_vf_p_vi2_rvvm1_sleef(const float *ptr, vint2_rvvm1_sleef vi2) { + return __riscv_vluxei32(ptr, __riscv_vmul(__riscv_vreinterpret_u32m1(vi2), sizeof(float), (__riscv_vsetvlmax_e32m1())), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vadd_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfadd(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsub_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfsub(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmul_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfmul(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vdiv_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfdiv(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmax_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfmax(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmin_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfmin(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vrec_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return __riscv_vfdiv(vcast_vf_f_rvvm1_sleef(1.0f), d, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsqrt_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return __riscv_vfsqrt(d, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmla_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfmadd(x, y, z, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmlanp_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfnmsub(x, y, z, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmlapn_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfmsub(x, y, z, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vfma_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfmadd(x, y, z, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vfmanp_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfnmsub(x, y, z, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vfmapn_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + return __riscv_vfmsub(x, y, z, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmulsign_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfsgnjx(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vcopysign_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vfsgnj(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsign_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef f) { + return __riscv_vfsgnj(__riscv_vfmv_v_f_f32m1(1.0f, (__riscv_vsetvlmax_e32m1())), f, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vorsign_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vint2_rvvm1_sleef xi = __riscv_vreinterpret_i32m1(x); + vint2_rvvm1_sleef yi = __riscv_vreinterpret_i32m1(y); + vint2_rvvm1_sleef xioryi = __riscv_vor(xi, yi, (__riscv_vsetvlmax_e32m1())); + vfloat_rvvm1_sleef xory = __riscv_vreinterpret_f32m1(xioryi); + return __riscv_vfsgnj(x, xory, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vabs_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef f) { + return __riscv_vfabs(f, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vneg_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef f) { + return __riscv_vfneg(f, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vadd_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vadd(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vsub_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vsub(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vneg_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x) { + return __riscv_vneg(x, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vand_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vand(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vandnot_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vand(__riscv_vnot(x, (__riscv_vsetvlmax_e32m1())), y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vor_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vor(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vxor_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vxor(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vsll_vi2_vi2_i_rvvm1_sleef(vint2_rvvm1_sleef x, int c) { + return __riscv_vsll(x, c, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vsra_vi2_vi2_i_rvvm1_sleef(vint2_rvvm1_sleef x, int c) { + return __riscv_vsra(x, c, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vsrl_vi2_vi2_i_rvvm1_sleef(vint2_rvvm1_sleef x, int c) { + return __riscv_vreinterpret_i32m1(__riscv_vsrl(__riscv_vreinterpret_u32m1(x), c, (__riscv_vsetvlmax_e32m1()))); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vreinterpret_vf_vm_rvvm1_sleef(vmask_rvvm1_sleef vm) { + return __riscv_vreinterpret_f32m1(__riscv_vreinterpret_u32m1(vm)); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vreinterpret_vm_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + return __riscv_vreinterpret_u64m1(__riscv_vreinterpret_u32m1(vf)); +} + +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo32_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef g) { + return __riscv_vcpop(g, (__riscv_vsetvlmax_e32m1())) == (__riscv_vsetvlmax_e32m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + rvv_vmask32 y32 = __riscv_vreinterpret_u32m1(y); + return __riscv_vreinterpret_u64m1(__riscv_vmerge(y32, -1, x, (__riscv_vsetvlmax_e32m1()))); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vand_vm_vo32_vm_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + rvv_vmask32 y32 = __riscv_vreinterpret_u32m1(y); + return __riscv_vreinterpret_u64m1(__riscv_vmerge(y32, 0, __riscv_vmnot(x, (__riscv_vsetvlmax_e32m1())), (__riscv_vsetvlmax_e32m1()))); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vandnot_vm_vo32_vm_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + rvv_vmask32 y32 = __riscv_vreinterpret_u32m1(y); + return __riscv_vreinterpret_u64m1(__riscv_vmerge(y32, 0, x, (__riscv_vsetvlmax_e32m1()))); +} + +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef rvv_sp_vand_vo_vo_vo(rvv_sp_vopmask_rvvm1_sleef x, rvv_sp_vopmask_rvvm1_sleef y) { + return __riscv_vmand(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef rvv_sp_vandnot_vo_vo_vo(rvv_sp_vopmask_rvvm1_sleef x, rvv_sp_vopmask_rvvm1_sleef y) { + return __riscv_vmandn(y, x, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef rvv_sp_vor_vo_vo_vo(rvv_sp_vopmask_rvvm1_sleef x, rvv_sp_vopmask_rvvm1_sleef y) { + return __riscv_vmor(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef rvv_sp_vxor_vo_vo_vo(rvv_sp_vopmask_rvvm1_sleef x, rvv_sp_vopmask_rvvm1_sleef y) { + return __riscv_vmxor(x, y, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef veq_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmfeq(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vneq_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmfne(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vgt_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmfgt(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vge_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmfge(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vlt_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmflt(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vle_vo_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmfle(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef visnan_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return __riscv_vmfne(d, d, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef visinf_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return __riscv_vmfeq(__riscv_vfabs(d, (__riscv_vsetvlmax_e32m1())), __builtin_inff(), (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vispinf_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return __riscv_vmfeq(d, __builtin_inff(), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef mask, vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + return __riscv_vmerge(y, x, mask, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsel_vf_vo_f_f_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef mask, float v1, float v0) { + return __riscv_vfmerge(vcast_vf_f_rvvm1_sleef(v0), v1, mask, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsel_vf_vo_vo_f_f_f_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef o0, rvv_sp_vopmask_rvvm1_sleef o1, float d0, float d1, float d2) { + return __riscv_vfmerge(__riscv_vfmerge(vcast_vf_f_rvvm1_sleef(d2), d1, o1, (__riscv_vsetvlmax_e32m1())), d0, o0, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef o0, rvv_sp_vopmask_rvvm1_sleef o1, rvv_sp_vopmask_rvvm1_sleef o2, float d0, float d1, float d2, float d3) { + return __riscv_vfmerge(__riscv_vfmerge(__riscv_vfmerge(vcast_vf_f_rvvm1_sleef(d3), d2, o2, (__riscv_vsetvlmax_e32m1())), d1, o1, (__riscv_vsetvlmax_e32m1())), d0, o0, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef veq_vo_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vmseq(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vgt_vo_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vmsgt(x, y, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vgt_vi2_vi2_vi2_rvvm1_sleef(vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + vint2_rvvm1_sleef zero = vcast_vi2_i_rvvm1_sleef(0); + return __riscv_vmerge(zero, -1, __riscv_vmsgt(x, y, (__riscv_vsetvlmax_e32m1())), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vsel_vi2_vo_vi2_vi2_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef m, vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vmerge(y, x, m, (__riscv_vsetvlmax_e32m1())); +} +static SLEEF_ALWAYS_INLINE vint2_rvvm1_sleef vand_vi2_vo_vi2_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, (__riscv_vsetvlmax_e32m1())), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE const vdouble_rvvm1_sleef vd2getx_vd_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef v) { + return __riscv_vget_f64m1(v, 0); +} +static SLEEF_ALWAYS_INLINE const vdouble_rvvm1_sleef vd2gety_vd_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef v) { + return __riscv_vget_f64m1(v, 1); +} +static SLEEF_ALWAYS_INLINE const vdouble2_rvvm1_sleef vd2setxy_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vset(__riscv_vlmul_ext_v_f64m1_f64m2(x), 1, y); +} +static SLEEF_ALWAYS_INLINE const vdouble2_rvvm1_sleef vd2setx_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef v, vdouble_rvvm1_sleef d) { + return __riscv_vset(v, 0, d); +} +static SLEEF_ALWAYS_INLINE const vdouble2_rvvm1_sleef vd2sety_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef v, vdouble_rvvm1_sleef d) { + return __riscv_vset(v, 1, d); +} + +static dd2_rvvm1_sleef dd2setab_dd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef a, vdouble2_rvvm1_sleef b) { + return __riscv_vset(__riscv_vlmul_ext_v_f64m2_f64m4(a), 1, b); +} +static vdouble2_rvvm1_sleef dd2geta_vd2_dd2_rvvm1_sleef(dd2_rvvm1_sleef d) { return __riscv_vget_f64m2(d, 0); } +static vdouble2_rvvm1_sleef dd2getb_vd2_dd2_rvvm1_sleef(dd2_rvvm1_sleef d) { return __riscv_vget_f64m2(d, 1); } + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vd3getx_vd_vd3_rvvm1_sleef(vdouble3_rvvm1_sleef v) { return __riscv_vget_f64m1(v, 0); } +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vd3gety_vd_vd3_rvvm1_sleef(vdouble3_rvvm1_sleef v) { return __riscv_vget_f64m1(v, 1); } +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vd3getz_vd_vd3_rvvm1_sleef(vdouble3_rvvm1_sleef v) { return __riscv_vget_f64m1(v, 2); } +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef vd3setxyz_vd3_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vset(__riscv_vlmul_ext_v_f64m2_f64m4(__riscv_vset(__riscv_vlmul_ext_v_f64m1_f64m2(x), 1, y)), 1, __riscv_vmv_v(__riscv_vlmul_ext_v_f64m1_f64m2(z), __riscv_vsetvlmax_e64m1())); +} +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef vd3setx_vd3_vd3_vd_rvvm1_sleef(vdouble3_rvvm1_sleef v, vdouble_rvvm1_sleef d) { return __riscv_vset(v, 0, d); } +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef vd3sety_vd3_vd3_vd_rvvm1_sleef(vdouble3_rvvm1_sleef v, vdouble_rvvm1_sleef d) { return __riscv_vset(v, 1, d); } +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef vd3setz_vd3_vd3_vd_rvvm1_sleef(vdouble3_rvvm1_sleef v, vdouble_rvvm1_sleef d) { return __riscv_vset(v, 2, d); } + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef digetd_vd_di_rvvm1_sleef(di_t_rvvm1_sleef d) { + vint2_rvvm1_sleef vi = __riscv_vget_i32m1(d, 0); + return __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(vi)); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef digeti_vi_di_rvvm1_sleef(di_t_rvvm1_sleef d) { + vint2_rvvm1_sleef vi = __riscv_vget_i32m1(d, 1); + return __riscv_vlmul_trunc_i32mf2(vi); +} +static SLEEF_ALWAYS_INLINE di_t_rvvm1_sleef disetdi_di_vd_vi_rvvm1_sleef(vdouble_rvvm1_sleef d, vint_rvvm1_sleef i) { + vint2_rvvm1_sleef vd_rvvm1_sleef = __riscv_vreinterpret_i32m1(__riscv_vreinterpret_i64m1(d)); + vint2_rvvm1_sleef vi = __riscv_vmv_v(__riscv_vlmul_ext_v_i32mf2_i32m1(i), __riscv_vsetvlmax_e32mf2()); + return __riscv_vset(__riscv_vlmul_ext_v_i32m1_i32m2(vd_rvvm1_sleef), 1, vi); +} + +static SLEEF_ALWAYS_INLINE vdouble2_rvvm1_sleef ddigetdd_vd2_ddi_rvvm1_sleef(ddi_t_rvvm1_sleef d) { + return __riscv_vget_f64m2(__riscv_vreinterpret_f64m4(__riscv_vreinterpret_v_i32m4_i64m4(d)), 0); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef ddigeti_vi_ddi_rvvm1_sleef(ddi_t_rvvm1_sleef d) { + vint2_rvvm1_sleef vi2 = __riscv_vget_i32m1(d, 2); + return __riscv_vlmul_trunc_i32mf2(vi2); +} +static SLEEF_ALWAYS_INLINE ddi_t_rvvm1_sleef ddisetddi_ddi_vd2_vi_rvvm1_sleef(vdouble2_rvvm1_sleef v, vint_rvvm1_sleef i) { + di_t_rvvm1_sleef vdi = __riscv_vreinterpret_i32m2(__riscv_vreinterpret_i64m2(v)); + return __riscv_vset(__riscv_vlmul_ext_v_i32m2_i32m4(vdi), 1, __riscv_vmv_v(__riscv_vlmul_ext_v_i32mf2_i32m2(i), __riscv_vsetvlmax_e32mf2())); +} +static SLEEF_ALWAYS_INLINE ddi_t_rvvm1_sleef ddisetdd_ddi_ddi_vd2_rvvm1_sleef(ddi_t_rvvm1_sleef ddi_rvvm1_sleef, vdouble2_rvvm1_sleef v) { + di_t_rvvm1_sleef vdi = __riscv_vreinterpret_i32m2(__riscv_vreinterpret_i64m2(v)); + return __riscv_vset(ddi_rvvm1_sleef, 0, vdi); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vcast_vd_d_rvvm1_sleef(double d) { + return __riscv_vfmv_v_f_f64m1(d, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vcast_vd_vi_rvvm1_sleef(vint_rvvm1_sleef i) { + return __riscv_vfwcvt_f(i, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vcast_vi_i_rvvm1_sleef(int32_t i) { + return __riscv_vmv_v_x_i32mf2(i, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vrint_vi_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + return __riscv_vfncvt_x_f_w_i32mf2_rm(vd_rvvm1_sleef, __RISCV_FRM_RNE, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vrint_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + return __riscv_vfcvt_f_x_v_f64m1(__riscv_vfcvt_x_f_v_i64m1_rm(vd_rvvm1_sleef, __RISCV_FRM_RNE, __riscv_vsetvlmax_e64m1()), __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vtruncate_vi_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + return __riscv_vfncvt_rtz_x(vd_rvvm1_sleef, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vtruncate_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + return vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vd_rvvm1_sleef)); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vload_vd_p_rvvm1_sleef(const double *ptr) { + return __riscv_vle64_v_f64m1(ptr, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vloadu_vd_p_rvvm1_sleef(const double *ptr) { + return __riscv_vle64_v_f64m1(ptr, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vloadu_vi_p_rvvm1_sleef(int32_t *p) { + return __riscv_vle32_v_i32mf2(p, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE void vstore_v_p_vd_rvvm1_sleef(double *ptr, vdouble_rvvm1_sleef v) { + __riscv_vse64(ptr, v, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vd_rvvm1_sleef(double *ptr, vdouble_rvvm1_sleef v) { + __riscv_vse64(ptr, v, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi_rvvm1_sleef(int32_t *ptr, vint_rvvm1_sleef v) { + __riscv_vse32(ptr, v, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vgather_vd_p_vi_rvvm1_sleef(const double *ptr, vint_rvvm1_sleef vi) { + return __riscv_vluxei64(ptr, __riscv_vwmulu(__riscv_vreinterpret_u32mf2(vi), sizeof(double), __riscv_vsetvlmax_e64m1()), __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vadd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfadd(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsub_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfsub(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vrec_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vfdiv(vcast_vd_d_rvvm1_sleef(1.0), d, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vabs_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vfabs(d, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsqrt_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vfsqrt(d, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmul_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfmul(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vdiv_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfdiv(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmax_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfmax(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmin_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfmin(x, y, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmla_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfmadd(x, y, z, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmlapn_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfmsub(x, y, z, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmlanp_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfnmsac(z, x, y, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vfma_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfmadd(x, y, z, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vfmanp_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfnmsub(x, y, z, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vfmapn_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vfmsub(x, y, z, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmulsign_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfsgnjx(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vcopysign_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfsgnj(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vorsign_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vfsgnj(x, __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(__riscv_vor(__riscv_vreinterpret_u64m1(x), __riscv_vreinterpret_u64m1(y), __riscv_vsetvlmax_e64m1()))), __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vneg_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vfneg(d, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vadd_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vadd(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vsub_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vsub(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vneg_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x) { + return __riscv_vneg(x, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vand_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vand(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vandnot_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vand(__riscv_vnot(x, __riscv_vsetvlmax_e64m1()), y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vor_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vxor_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vxor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vsll_vi_vi_i_rvvm1_sleef(vint_rvvm1_sleef x, int c) { + return __riscv_vsll(x, c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vsra_vi_vi_i_rvvm1_sleef(vint_rvvm1_sleef x, int c) { + return __riscv_vsra(x, c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vsrl_vi_vi_i_rvvm1_sleef(vint_rvvm1_sleef x, int c) { + return __riscv_vreinterpret_i32mf2(__riscv_vsrl(__riscv_vreinterpret_u32mf2(x), c, __riscv_vsetvlmax_e64m1())); +} + +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vcast_vm_i64_rvvm1_sleef(int64_t c) { + return __riscv_vmv_v_x_u64m1(c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vcast_vm_u64_rvvm1_sleef(uint64_t c) { + return __riscv_vmv_v_x_u64m1(c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vcast_vm_i_i_rvvm1_sleef(int64_t h, int64_t l) { + return __riscv_vmv_v_x_u64m1((((uint64_t)h) << 32) | (uint32_t) l, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vcast_vm_vi_rvvm1_sleef(vint_rvvm1_sleef vi) { + return __riscv_vreinterpret_u64m1(__riscv_vwcvt_x(vi, __riscv_vsetvlmax_e64m1())); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vcastu_vm_vi_rvvm1_sleef(vint_rvvm1_sleef vi) { + return __riscv_vsll(__riscv_vreinterpret_u64m1(__riscv_vwcvt_x(vi, __riscv_vsetvlmax_e64m1())), 32, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vcastu_vi_vm_rvvm1_sleef(vmask_rvvm1_sleef vm) { + return __riscv_vreinterpret_i32mf2(__riscv_vnsrl(vm, 32, __riscv_vsetvlmax_e64m1())); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vcast_vi_vm_rvvm1_sleef(vmask_rvvm1_sleef vm) { + return __riscv_vreinterpret_i32mf2(__riscv_vncvt_x(vm, __riscv_vsetvlmax_e64m1())); +} + +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vand_vm_vo64_vm_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, __riscv_vsetvlmax_e64m1()), __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vand_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vand(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vor_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vxor_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vxor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vandnot_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vand(__riscv_vnot(x, __riscv_vsetvlmax_e64m1()), y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vandnot_vm_vo64_vm_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmerge(y, 0, x, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vsll64_vm_vm_i(vmask_rvvm1_sleef mask, int64_t c) { + return __riscv_vsll(mask, c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vsub64_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vsub(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vsrl64_vm_vm_i(vmask_rvvm1_sleef mask, int64_t c) { + return __riscv_vsrl(mask, c, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vadd64_vm_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vadd(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmerge(y, -1, x, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vsel_vm_vo64_vm_vm_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef mask, vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmerge(y, x, mask, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vneg64_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef mask) { + return __riscv_vreinterpret_u64m1(__riscv_vneg(__riscv_vreinterpret_i64m1(mask), __riscv_vsetvlmax_e64m1())); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vreinterpret_vd_vm_rvvm1_sleef(vmask_rvvm1_sleef vm) { + return __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(vm)); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vreinterpret_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + return __riscv_vreinterpret_u64m1(vd_rvvm1_sleef); +} + +static SLEEF_ALWAYS_INLINE const vmask_rvvm1_sleef vqgetx_vm_vq_rvvm1_sleef(vquad_rvvm1_sleef v) { return __riscv_vget_u64m1(v, 0); } +static SLEEF_ALWAYS_INLINE const vmask_rvvm1_sleef vqgety_vm_vq_rvvm1_sleef(vquad_rvvm1_sleef v) { return __riscv_vget_u64m1(v, 1); } +static SLEEF_ALWAYS_INLINE vquad_rvvm1_sleef vqsetxy_vq_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vset(__riscv_vlmul_ext_v_u64m1_u64m2(x), 1, y); +} +static SLEEF_ALWAYS_INLINE vquad_rvvm1_sleef vqsetx_vq_vq_vm_rvvm1_sleef(vquad_rvvm1_sleef v, vmask_rvvm1_sleef x) { return __riscv_vset(v, 0, x); } +static SLEEF_ALWAYS_INLINE vquad_rvvm1_sleef vqsety_vq_vq_vm_rvvm1_sleef(vquad_rvvm1_sleef v, vmask_rvvm1_sleef y) { return __riscv_vset(v, 1, y); } + +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vcast_vo64_vo32_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef vo) { + return vo; +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vcast_vo32_vo64_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef vo) { + return vo; +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef rvv_dp_vand_vo_vo_vo(rvv_dp_vopmask_rvvm1_sleef x, rvv_dp_vopmask_rvvm1_sleef y) { + return __riscv_vmand(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef rvv_dp_vandnot_vo_vo_vo(rvv_dp_vopmask_rvvm1_sleef x, rvv_dp_vopmask_rvvm1_sleef y) { + return __riscv_vmandn(y, x, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef rvv_dp_vor_vo_vo_vo(rvv_dp_vopmask_rvvm1_sleef x, rvv_dp_vopmask_rvvm1_sleef y) { + return __riscv_vmor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef rvv_dp_vxor_vo_vo_vo(rvv_dp_vopmask_rvvm1_sleef x, rvv_dp_vopmask_rvvm1_sleef y) { + return __riscv_vmxor(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef veq64_vo_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmseq(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vgt64_vo_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + return __riscv_vmsgt(__riscv_vreinterpret_i64m1(x), __riscv_vreinterpret_i64m1(y), __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef visinf_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vmfeq(__riscv_vfabs(d, __riscv_vsetvlmax_e64m1()), __builtin_inf(), __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vispinf_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vmfeq(d, __builtin_inf(), __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef veq_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmfeq(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vneq_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmfne(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vlt_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmflt(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vle_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmfle(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vgt_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmfgt(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vge_vo_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmfge(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef visnan_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return __riscv_vmfne(d, d, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef mask, vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + return __riscv_vmerge(y, x, mask, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsel_vd_vo_d_d_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef mask, double v0, double v1) { + return __riscv_vfmerge(vcast_vd_d_rvvm1_sleef(v1), v0, mask, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsel_vd_vo_vo_d_d_d_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef o0, rvv_dp_vopmask_rvvm1_sleef o1, double d0, double d1, double d2) { + return __riscv_vfmerge(__riscv_vfmerge(vcast_vd_d_rvvm1_sleef(d2), d1, o1, __riscv_vsetvlmax_e64m1()), d0, o0, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef o0, rvv_dp_vopmask_rvvm1_sleef o1, rvv_dp_vopmask_rvvm1_sleef o2, double d0, double d1, double d2, double d3) { + return __riscv_vfmerge(__riscv_vfmerge(__riscv_vfmerge(vcast_vd_d_rvvm1_sleef(d3), d2, o2, __riscv_vsetvlmax_e64m1()), d1, o1, __riscv_vsetvlmax_e64m1()), d0, o0, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo64_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef g) { + return __riscv_vcpop(g, __riscv_vsetvlmax_e64m1()) == __riscv_vsetvlmax_e64m1(); +} + +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef veq_vo_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vmseq(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vgt_vo_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vmsgt(x, y, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vgt_vi_vi_vi_rvvm1_sleef(vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + vint_rvvm1_sleef zero = vcast_vi_i_rvvm1_sleef(0); + return __riscv_vmerge(zero, -1, __riscv_vmsgt(x, y, __riscv_vsetvlmax_e64m1()), __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vsel_vi_vo_vi_vi_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef m, vint_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vmerge(y, x, m, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vandnot_vi_vo_vi_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef mask, vint_rvvm1_sleef vi) { + return __riscv_vmerge(vi, 0, mask, __riscv_vsetvlmax_e64m1()); +} +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef vand_vi_vo_vi_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef x, vint_rvvm1_sleef y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, __riscv_vsetvlmax_e64m1()), __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vposneg_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef mask = __riscv_vreinterpret_b64(__riscv_vmv_v_x_u8m1(0x55, __riscv_vsetvlmax_e8m1())); + vdouble_rvvm1_sleef nd = __riscv_vfneg(d, __riscv_vsetvlmax_e64m1()); + return __riscv_vmerge(nd, d, mask, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vnegpos_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef mask = __riscv_vreinterpret_b64(__riscv_vmv_v_x_u8m1(0xaa, __riscv_vsetvlmax_e8m1())); + vdouble_rvvm1_sleef nd = __riscv_vfneg(d, __riscv_vsetvlmax_e64m1()); + return __riscv_vmerge(nd, d, mask, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vposneg_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef mask = __riscv_vreinterpret_b32(__riscv_vmv_v_x_u8m1(0x55, __riscv_vsetvlmax_e8m1())); + vfloat_rvvm1_sleef nd = __riscv_vfneg(d, (__riscv_vsetvlmax_e32m1())); + return __riscv_vmerge(nd, d, mask, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vnegpos_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef mask = __riscv_vreinterpret_b32(__riscv_vmv_v_x_u8m1(0xaa, __riscv_vsetvlmax_e8m1())); + vfloat_rvvm1_sleef nd = __riscv_vfneg(d, (__riscv_vsetvlmax_e32m1())); + return __riscv_vmerge(nd, d, mask, (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vsubadd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { return vadd_vd_vd_vd_rvvm1_sleef(x, vnegpos_vd_vd_rvvm1_sleef(y)); } +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vsubadd_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d0, vfloat_rvvm1_sleef d1) { return vadd_vf_vf_vf_rvvm1_sleef(d0, vnegpos_vf_vf_rvvm1_sleef(d1)); } +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vmlsubadd_vd_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { return vfma_vd_vd_vd_vd_rvvm1_sleef(x, y, vnegpos_vd_vd_rvvm1_sleef(z)); } +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vmlsubadd_vf_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { return vfma_vf_vf_vf_vf_rvvm1_sleef(x, y, vnegpos_vf_vf_rvvm1_sleef(z)); } + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vrev21_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + rvv_dp_vuint2 id = __riscv_vid_v_u64m1(__riscv_vsetvlmax_e64m1()); + id = __riscv_vxor(id, 1, __riscv_vsetvlmax_e64m1()); + return __riscv_vrgather(vd_rvvm1_sleef, id, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vrev21_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + vint2_rvvm1_sleef id = __riscv_vreinterpret_i32m1(__riscv_vid_v_u32m1((__riscv_vsetvlmax_e32m1()))); + id = __riscv_vxor(id, 1, (__riscv_vsetvlmax_e32m1())); + return __riscv_vrgather(vf, __riscv_vreinterpret_u32m1(id), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vreva2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef vd_rvvm1_sleef) { + rvv_dp_vuint2 id = __riscv_vid_v_u64m1(__riscv_vsetvlmax_e64m1()); + id = __riscv_vxor(id, __riscv_vsetvlmax_e64m1() - 2, __riscv_vsetvlmax_e64m1()); + return __riscv_vrgather(vd_rvvm1_sleef, id, __riscv_vsetvlmax_e64m1()); +} + +static SLEEF_ALWAYS_INLINE vfloat_rvvm1_sleef vreva2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef vf) { + vint2_rvvm1_sleef id = __riscv_vreinterpret_i32m1(__riscv_vid_v_u32m1((__riscv_vsetvlmax_e32m1()))); + id = __riscv_vxor(id, (__riscv_vsetvlmax_e32m1()) - 2, (__riscv_vsetvlmax_e32m1())); + return __riscv_vrgather(vf, __riscv_vreinterpret_u32m1(id), (__riscv_vsetvlmax_e32m1())); +} + +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vd_rvvm1_sleef(double *ptr, int offset, int step, vdouble_rvvm1_sleef v) { + + ptr += offset * 2; + for (int i = 0; i < __riscv_vsetvlmax_e64m1(); i += 2) { + + vdouble_rvvm1_sleef vv = __riscv_vslidedown(v, i, 2); + __riscv_vse64(ptr, vv, 2); + ptr += step * 2; + } +} + +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vf_rvvm1_sleef(float *ptr, int offset, int step, vfloat_rvvm1_sleef v) { + + ptr += offset * 2; + for (int i = 0; i < (__riscv_vsetvlmax_e32m1()); i += 2) { + vfloat_rvvm1_sleef vv = __riscv_vslidedown(v, i, 2); + __riscv_vse32(ptr, vv, 2); + ptr += step * 2; + } +} + +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef tdxgete_vm_tdx_rvvm1_sleef(tdx_rvvm1_sleef t) { + return __riscv_vreinterpret_u64m1(__riscv_vget_f64m1(t, 0)); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdxgetd3x_vd_tdx_rvvm1_sleef(tdx_rvvm1_sleef t) { + return __riscv_vget_f64m1(t, 1); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdxgetd3y_vd_tdx_rvvm1_sleef(tdx_rvvm1_sleef t) { + return __riscv_vget_f64m1(t, 2); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdxgetd3z_vd_tdx_rvvm1_sleef(tdx_rvvm1_sleef t) { + return __riscv_vget_f64m1(t, 3); +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsete_tdx_tdx_vm_rvvm1_sleef(tdx_rvvm1_sleef t, vmask_rvvm1_sleef e) { + return __riscv_vset(t, 0, __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(e))); +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsetx_tdx_tdx_vd_rvvm1_sleef(tdx_rvvm1_sleef t, vdouble_rvvm1_sleef x) { + return __riscv_vset(t, 1, x); +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsety_tdx_tdx_vd_rvvm1_sleef(tdx_rvvm1_sleef t, vdouble_rvvm1_sleef y) { + return __riscv_vset(t, 2, y); +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsetz_tdx_tdx_vd_rvvm1_sleef(tdx_rvvm1_sleef t, vdouble_rvvm1_sleef z) { + return __riscv_vset(t, 3, z); +} + +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef tdxgetd3_vd3_tdx_rvvm1_sleef(tdx_rvvm1_sleef t) { + return vd3setxyz_vd3_vd_vd_vd_rvvm1_sleef(tdxgetd3x_vd_tdx_rvvm1_sleef(t), tdxgetd3y_vd_tdx_rvvm1_sleef(t), tdxgetd3z_vd_tdx_rvvm1_sleef(t)); +} + +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsetxyz_tdx_tdx_vd_vd_vd_rvvm1_sleef(tdx_rvvm1_sleef t, vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + t = tdxsetx_tdx_tdx_vd_rvvm1_sleef(t, x); + t = tdxsety_tdx_tdx_vd_rvvm1_sleef(t, y); + t = tdxsetz_tdx_tdx_vd_rvvm1_sleef(t, z); + return t; +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsetd3_tdx_tdx_vd3_rvvm1_sleef(tdx_rvvm1_sleef t, vdouble3_rvvm1_sleef d3) { + return tdxsetxyz_tdx_tdx_vd_vd_vd_rvvm1_sleef(t, vd3getx_vd_vd3_rvvm1_sleef(d3), vd3gety_vd_vd3_rvvm1_sleef(d3), vd3getz_vd_vd3_rvvm1_sleef(d3)); +} + +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxseted3_tdx_vm_vd3_rvvm1_sleef(vmask_rvvm1_sleef e, vdouble3_rvvm1_sleef d3) { + return __riscv_vcreate_v_f64m1x4(__riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(e)), + vd3getx_vd_vd3_rvvm1_sleef(d3), vd3gety_vd_vd3_rvvm1_sleef(d3), vd3getz_vd_vd3_rvvm1_sleef(d3)); +} +static SLEEF_ALWAYS_INLINE tdx_rvvm1_sleef tdxsetexyz_tdx_vm_vd_vd_vd_rvvm1_sleef(vmask_rvvm1_sleef e, vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + return __riscv_vcreate_v_f64m1x4(__riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(e)), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdigetx_vd_tdi_rvvm1_sleef(tdi_t_rvvm1_sleef d) { + return __riscv_vget_f64m1(d, 0); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdigety_vd_tdi(tdi_t_rvvm1_sleef d) { + return __riscv_vget_f64m1(d, 1); +} +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef tdigetz_vd_tdi(tdi_t_rvvm1_sleef d) { + return __riscv_vget_f64m1(d, 2); +} + +static SLEEF_ALWAYS_INLINE vint_rvvm1_sleef tdigeti_vi_tdi_rvvm1_sleef(tdi_t_rvvm1_sleef d) { + vdouble_rvvm1_sleef vd_rvvm1_sleef = __riscv_vget_f64m1(d, 3); + vint2_rvvm1_sleef vi2 = __riscv_vreinterpret_i32m1(__riscv_vreinterpret_i64m1(vd_rvvm1_sleef)); + vint_rvvm1_sleef vi = __riscv_vlmul_trunc_i32mf2(vi2); + return vi; +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdisetx_tdi_tdi_vd(tdi_t_rvvm1_sleef t, vdouble_rvvm1_sleef x) { + return __riscv_vset(t, 0, x); +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdisety_tdi_tdi_vd(tdi_t_rvvm1_sleef t, vdouble_rvvm1_sleef y) { + return __riscv_vset(t, 1, y); +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdisetz_tdi_tdi_vd(tdi_t_rvvm1_sleef t, vdouble_rvvm1_sleef z) { + return __riscv_vset(t, 2, z); +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdiseti_tdi_tdi_vi(tdi_t_rvvm1_sleef t, vint_rvvm1_sleef i) { + vint2_rvvm1_sleef vi2 = __riscv_vmv_v(__riscv_vlmul_ext_v_i32mf2_i32m1(i), __riscv_vsetvlmax_e32mf2()); + vdouble_rvvm1_sleef vd_rvvm1_sleef = __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(vi2)); + return __riscv_vset(t, 3, vd_rvvm1_sleef); +} + +static SLEEF_ALWAYS_INLINE vdouble3_rvvm1_sleef tdigettd_vd3_tdi_rvvm1_sleef(tdi_t_rvvm1_sleef d) { + return vd3setxyz_vd3_vd_vd_vd_rvvm1_sleef(tdigetx_vd_tdi_rvvm1_sleef(d), tdigety_vd_tdi(d), tdigetz_vd_tdi(d)); +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdisettd_tdi_tdi_vd3(tdi_t_rvvm1_sleef tdi, vdouble3_rvvm1_sleef v) { + tdi = tdisetx_tdi_tdi_vd(tdi, vd3getx_vd_vd3_rvvm1_sleef(v)); + tdi = tdisety_tdi_tdi_vd(tdi, vd3gety_vd_vd3_rvvm1_sleef(v)); + tdi = tdisetz_tdi_tdi_vd(tdi, vd3getz_vd_vd3_rvvm1_sleef(v)); + return tdi; +} +static SLEEF_ALWAYS_INLINE tdi_t_rvvm1_sleef tdisettdi_tdi_vd3_vi_rvvm1_sleef(vdouble3_rvvm1_sleef v, vint_rvvm1_sleef i) { + tdi_t_rvvm1_sleef ret = __riscv_vcreate_v_f64m1x4(vd3getx_vd_vd3_rvvm1_sleef(v), vd3gety_vd_vd3_rvvm1_sleef(v), vd3getz_vd_vd3_rvvm1_sleef(v), vd3getz_vd_vd3_rvvm1_sleef(v)); + return tdiseti_tdi_tdi_vi(ret, i); +} + +static SLEEF_ALWAYS_INLINE rvv_dp_vopmask_rvvm1_sleef vcast_vo_i_rvvm1_sleef(int i) { + return __riscv_vreinterpret_b64(__riscv_vmv_v_x_u32m1(i, (__riscv_vsetvlmax_e32m1()))); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vreinterpret_vm_vi64_rvvm1_sleef(vint64_rvvm1_sleef v) { + return __riscv_vreinterpret_u64m1(v); +} +static SLEEF_ALWAYS_INLINE vint64_rvvm1_sleef vreinterpret_vi64_vm_rvvm1_sleef(vmask_rvvm1_sleef m) { + return __riscv_vreinterpret_i64m1(m); +} +static SLEEF_ALWAYS_INLINE vmask_rvvm1_sleef vreinterpret_vm_vu64_rvvm1_sleef(vuint64_rvvm1_sleef v) { + return v; +} +static SLEEF_ALWAYS_INLINE vuint64_rvvm1_sleef vreinterpret_vu64_vm_rvvm1_sleef(vmask_rvvm1_sleef m) { + return m; +} +static SLEEF_ALWAYS_INLINE int vtestallzeros_i_vo64_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef g) { + return __riscv_vcpop(g, __riscv_vsetvlmax_e64m1()) == 0; +} + +static SLEEF_ALWAYS_INLINE void vstream_v_p_vd_rvvm1_sleef(double *ptr, vdouble_rvvm1_sleef v) { vstore_v_p_vd_rvvm1_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstream_v_p_vf_rvvm1_sleef(float *ptr, vfloat_rvvm1_sleef v) { vstore_v_p_vf_rvvm1_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vd_rvvm1_sleef(double *ptr, int offset, int step, vdouble_rvvm1_sleef v) { vscatter2_v_p_i_i_vd_rvvm1_sleef(ptr, offset, step, v); } +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vf_rvvm1_sleef(float *ptr, int offset, int step, vfloat_rvvm1_sleef v) { vscatter2_v_p_i_i_vf_rvvm1_sleef(ptr, offset, step, v); } + +static double vcast_d_vd_rvvm1_sleef(vdouble_rvvm1_sleef v) { + return __riscv_vfmv_f(v); +} + +static float vcast_f_vf_rvvm1_sleef(vfloat_rvvm1_sleef v) { + return __riscv_vfmv_f(v); +} + +static int vcast_i_vi(vint_rvvm1_sleef v) { + return __riscv_vmv_x(v); +} + +static int vcast_i_vi2(vint2_rvvm1_sleef v) { + return __riscv_vmv_x(v); +} + +static vquad_rvvm1_sleef loadu_vq_p_rvvm1_sleef(const int32_t *ptr) { + + return __riscv_vreinterpret_u64m2(__riscv_vreinterpret_u32m2(__riscv_vle32_v_i32m2(ptr, (__riscv_vsetvlmax_e32m1()) * 2))); +} + +static SLEEF_ALWAYS_INLINE vquad_rvvm1_sleef cast_vq_aq_rvvm1_sleef(vargquad_rvvm1_sleef aq) { return aq; } +static SLEEF_ALWAYS_INLINE vargquad_rvvm1_sleef cast_aq_vq_rvvm1_sleef(vquad_rvvm1_sleef vq) { return vq; } + +static SLEEF_ALWAYS_INLINE void vprefetch_v_p_rvvm1_sleef(const void *ptr) {} + +typedef struct { + double x, y; +} double2_rvvm1_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST double2_rvvm1_sleef dd_rvvm1_sleef(double h, double l) { + double2_rvvm1_sleef ret = { h, l }; + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vupper_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return vreinterpret_vd_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vcast_vm_i_i_rvvm1_sleef(0xffffffff, 0xf8000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef vcast_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef h, vdouble_rvvm1_sleef l) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef vcast_vd2_d_d_rvvm1_sleef(double h, double l) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(h), vcast_vd_d_rvvm1_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef vcast_vd2_d2_rvvm1_sleef(double2_rvvm1_sleef dd_rvvm1_sleef) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(dd_rvvm1_sleef.x), vcast_vd_d_rvvm1_sleef(dd_rvvm1_sleef.y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef vsel_vd2_vo_vd2_vd2_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef m, vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(m, vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)), + vsel_vd_vo_vd_vd_rvvm1_sleef(m, vd2gety_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef vsel_vd2_vo_d_d_d_d_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef o, double x1, double y1, double x0, double y0) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_d_d_rvvm1_sleef(o, x1, x0), + vsel_vd_vo_d_d_rvvm1_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vadd_vd_3vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2) { + return vadd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vadd_vd_4vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3) { + return vadd_vd_3vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vadd_vd_5vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3, vdouble_rvvm1_sleef v4) { + return vadd_vd_4vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vadd_vd_6vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3, vdouble_rvvm1_sleef v4, vdouble_rvvm1_sleef v5) { + return vadd_vd_5vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vadd_vd_7vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3, vdouble_rvvm1_sleef v4, vdouble_rvvm1_sleef v5, vdouble_rvvm1_sleef v6) { + return vadd_vd_6vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vsub_vd_3vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2) { + return vsub_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vsub_vd_4vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3) { + return vsub_vd_3vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vsub_vd_5vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3, vdouble_rvvm1_sleef v4) { + return vsub_vd_4vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vsub_vd_6vd_rvvm1_sleef(vdouble_rvvm1_sleef v0, vdouble_rvvm1_sleef v1, vdouble_rvvm1_sleef v2, vdouble_rvvm1_sleef v3, vdouble_rvvm1_sleef v4, vdouble_rvvm1_sleef v5) { + return vsub_vd_5vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddneg_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x) { + return vcast_vd2_vd_vd_rvvm1_sleef(vneg_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)), vneg_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddabs_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x) { + return vcast_vd2_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)), + vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x)), + vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)), + vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddnormalize_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef t) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), vd2gety_vd_vd2_rvvm1_sleef(t)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), s), vd2gety_vd_vd2_rvvm1_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddscale_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef d, vdouble_rvvm1_sleef s) { + return vd2setxy_vd2_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), s), vmul_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddscale_vd2_vd2_d_rvvm1_sleef(vdouble2_rvvm1_sleef d, double s) { return ddscale_vd2_vd2_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(s)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(x, y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd2_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(x, y); + vdouble_rvvm1_sleef v = vsub_vd_vd_vd_rvvm1_sleef(s, x); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, vsub_vd_vd_vd_rvvm1_sleef(s, v)), vsub_vd_vd_vd_rvvm1_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_3vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), s), y, vd2gety_vd_vd2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsub_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), s), y), vd2gety_vd_vd2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd2_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), y); + vdouble_rvvm1_sleef v = vsub_vd_vd_vd_rvvm1_sleef(s, vd2getx_vd_vd2_rvvm1_sleef(x)); + vdouble_rvvm1_sleef w = vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vsub_vd_vd_vd_rvvm1_sleef(s, v)), vsub_vd_vd_vd_rvvm1_sleef(y, v)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(w, vd2gety_vd_vd2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd_vd2_vd_vd2_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(x, vd2getx_vd_vd2_rvvm1_sleef(y)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_3vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, s), vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd2_vd2_vd_vd2_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(x, vd2getx_vd_vd2_rvvm1_sleef(y)); + vdouble_rvvm1_sleef v = vsub_vd_vd_vd_rvvm1_sleef(s, x); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, vsub_vd_vd_vd_rvvm1_sleef(s, v)), + vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), v)), vd2gety_vd_vd2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_4vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), s), vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddadd2_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)); + vdouble_rvvm1_sleef v = vsub_vd_vd_vd_rvvm1_sleef(s, vd2getx_vd_vd2_rvvm1_sleef(x)); + vdouble_rvvm1_sleef t = vadd_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vsub_vd_vd_vd_rvvm1_sleef(s, v)), vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), v)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vadd_vd_vd_vd_rvvm1_sleef(t, vadd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsub_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + + vdouble_rvvm1_sleef s = vsub_vd_vd_vd_rvvm1_sleef(x, y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vsub_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsub_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + + vdouble_rvvm1_sleef s = vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)); + vdouble_rvvm1_sleef t = vsub_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), s); + t = vsub_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(y)); + t = vadd_vd_vd_vd_rvvm1_sleef(t, vd2gety_vd_vd2_rvvm1_sleef(x)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vsub_vd_vd_vd_rvvm1_sleef(t, vd2gety_vd_vd2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef dddiv_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef n, vdouble2_rvvm1_sleef d) { + vdouble_rvvm1_sleef t = vrec_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d)); + vdouble_rvvm1_sleef s = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(n), t); + vdouble_rvvm1_sleef u = vfmapn_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(n), s); + vdouble_rvvm1_sleef v = vfmanp_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(d), t, vfmanp_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), t, vcast_vd_d_rvvm1_sleef(1))); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vfma_vd_vd_vd_vd_rvvm1_sleef(s, v, vfma_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddmul_vd2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vmul_vd_vd_vd_rvvm1_sleef(x, y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vfmapn_vd_vd_vd_vd_rvvm1_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsqu_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x) { + vdouble_rvvm1_sleef s = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vfma_vd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)), vd2gety_vd_vd2_rvvm1_sleef(x), vfmapn_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddmul_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vfma_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(y), vfma_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y), vfmapn_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef ddmul_vd_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y) { + return vfma_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y), vfma_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y), vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef ddsqu_vd_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x) { + return vfma_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x), vadd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)), vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddmul_vd2_vd2_vd_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef s = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), y); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vfma_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x), y, vfmapn_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddrec_vd2_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef s = vrec_vd_vd_rvvm1_sleef(d); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(s, vfmanp_vd_vd_vd_vd_rvvm1_sleef(d, s, vcast_vd_d_rvvm1_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddrec_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef d) { + vdouble_rvvm1_sleef s = vrec_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d)); + return vd2setxy_vd2_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(s, vfmanp_vd_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(d), s, vfmanp_vd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), s, vcast_vd_d_rvvm1_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsqrt_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef d) { + vdouble_rvvm1_sleef t = vsqrt_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d))); + return ddscale_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, ddmul_vd2_vd_vd_rvvm1_sleef(t, t)), ddrec_vd2_vd_rvvm1_sleef(t)), vcast_vd_d_rvvm1_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddsqrt_vd2_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef t = vsqrt_vd_vd_rvvm1_sleef(d); + return ddscale_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd2_rvvm1_sleef(d, ddmul_vd2_vd_vd_rvvm1_sleef(t, t)), ddrec_vd2_vd_rvvm1_sleef(t)), vcast_vd_d_rvvm1_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddmla_vd2_vd2_vd2_vd2_rvvm1_sleef(vdouble2_rvvm1_sleef x, vdouble2_rvvm1_sleef y, vdouble2_rvvm1_sleef z) { + return ddadd_vd2_vd2_vd2_rvvm1_sleef(z, ddmul_vd2_vd2_vd2_rvvm1_sleef(x, y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef visnegzero_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return veq64_vo_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef visnumber_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + return rvv_dp_vandnot_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), veq_vo_vd_vd_rvvm1_sleef(x, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef visnonfinite_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + return veq64_vo_vm_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(x), vcast_vm_i64_rvvm1_sleef(INT64_C(0x7ff0000000000000))), vcast_vm_i64_rvvm1_sleef(INT64_C(0x7ff0000000000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vsignbit_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef vsignbit_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return veq64_vo_vm_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vclearlsb_vd_vd_i_rvvm1_sleef(vdouble_rvvm1_sleef d, int n) { + return vreinterpret_vd_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vcast_vm_u64_rvvm1_sleef((~UINT64_C(0)) << n))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vtoward0_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef t = vreinterpret_vd_vm_rvvm1_sleef(vadd64_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(x), vcast_vm_i64_rvvm1_sleef(-1))); + return vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vsign_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1.0), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vtruncate2_vd_vd_rvvm1_sleef_rvvm1_sleef(vdouble_rvvm1_sleef x) { + + vdouble_rvvm1_sleef fr = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 31), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + return vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), vge_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, fr), x)); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vfloor2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef fr = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 31), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + fr = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(0)), vadd_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(1.0)), fr); + return vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), vge_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vceil2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef fr = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 31), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + fr = vsel_vd_vo_vd_vd_rvvm1_sleef(vle_vo_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(0)), fr, vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(1.0))); + return vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), vge_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vround2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef x = vadd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.5)); + vdouble_rvvm1_sleef fr = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 31), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vand_vo_vo_vo(vle_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), veq_vo_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(0))), vsub_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0)), x); + fr = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(0)), vadd_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_d_rvvm1_sleef(1.0)), fr); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.49999999999999994449)), vcast_vd_d_rvvm1_sleef(0), x); + return vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), vge_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52))), d, vcopysign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, fr), d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vrint2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef c = vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52), d); + return vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), + d, vorsign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(d, c), c), d)); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef visint_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + return veq_vo_vd_vd_rvvm1_sleef(vrint2_vd_vd_rvvm1_sleef(d), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef visodd_vo_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef x = vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.5)); + return vneq_vo_vd_vd_rvvm1_sleef(vrint2_vd_vd_rvvm1_sleef(x), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_rvvm1_sleef vilogbk_vi_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2.037035976334486E90), d), d); + vint_rvvm1_sleef q = vcastu_vi_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d)); + q = vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef((int)(((1U << 12) - 1) << 20))); + q = vsrl_vi_vi_i_rvvm1_sleef(q, 20); + q = vsub_vi_vi_vi_rvvm1_sleef(q, vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vcast_vi_i_rvvm1_sleef(300 + 0x3ff), vcast_vi_i_rvvm1_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_rvvm1_sleef vilogb2k_vi_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vint_rvvm1_sleef q = vcastu_vi_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d)); + q = vsrl_vi_vi_i_rvvm1_sleef(q, 20); + q = vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(0x7ff)); + q = vsub_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(0x3ff)); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vilogb2k_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vmask_rvvm1_sleef m = vreinterpret_vm_vd_rvvm1_sleef(d); + m = vsrl64_vm_vm_i(m, 20 + 32); + m = vand_vm_vm_vm_rvvm1_sleef(m, vcast_vm_i64_rvvm1_sleef(0x7ff)); + m = vsub64_vm_vm_vm_rvvm1_sleef(m, vcast_vm_i64_rvvm1_sleef(0x3ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vilogb3k_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vmask_rvvm1_sleef m = vreinterpret_vm_vd_rvvm1_sleef(d); + m = vsrl64_vm_vm_i(m, 20 + 32); + m = vand_vm_vm_vm_rvvm1_sleef(m, vcast_vm_i64_rvvm1_sleef(0x7ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vpow2i_vd_vi_rvvm1_sleef(vint_rvvm1_sleef q) { + q = vadd_vi_vi_vi_rvvm1_sleef(vcast_vi_i_rvvm1_sleef(0x3ff), q); + vmask_rvvm1_sleef r = vcastu_vm_vi_rvvm1_sleef(vsll_vi_vi_i_rvvm1_sleef(q, 20)); + return vreinterpret_vd_vm_rvvm1_sleef(r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vpow2i_vd_vm_rvvm1_sleef(vmask_rvvm1_sleef q) { + q = vadd64_vm_vm_vm_rvvm1_sleef(vcast_vm_i64_rvvm1_sleef(0x3ff), q); + return vreinterpret_vd_vm_rvvm1_sleef(vsll64_vm_vm_i(q, 52)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp_vd_vd_vi_rvvm1_sleef(vdouble_rvvm1_sleef x, vint_rvvm1_sleef q) { + vint_rvvm1_sleef m = vsra_vi_vi_i_rvvm1_sleef(q, 31); + m = vsll_vi_vi_i_rvvm1_sleef(vsub_vi_vi_vi_rvvm1_sleef(vsra_vi_vi_i_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(m, q), 9), m), 7); + q = vsub_vi_vi_vi_rvvm1_sleef(q, vsll_vi_vi_i_rvvm1_sleef(m, 2)); + m = vadd_vi_vi_vi_rvvm1_sleef(vcast_vi_i_rvvm1_sleef(0x3ff), m); + m = vandnot_vi_vo_vi_rvvm1_sleef(vgt_vo_vi_vi_rvvm1_sleef(vcast_vi_i_rvvm1_sleef(0), m), m); + m = vsel_vi_vo_vi_vi_rvvm1_sleef(vgt_vo_vi_vi_rvvm1_sleef(m, vcast_vi_i_rvvm1_sleef(0x7ff)), vcast_vi_i_rvvm1_sleef(0x7ff), m); + vmask_rvvm1_sleef r = vcastu_vm_vi_rvvm1_sleef(vsll_vi_vi_i_rvvm1_sleef(m, 20)); + vdouble_rvvm1_sleef y = vreinterpret_vd_vm_rvvm1_sleef(r); + return vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, y), y), y), y), vpow2i_vd_vi_rvvm1_sleef(q)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp2_vd_vd_vi_rvvm1_sleef(vdouble_rvvm1_sleef d, vint_rvvm1_sleef e) { + return vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vi_rvvm1_sleef(vsra_vi_vi_i_rvvm1_sleef(e, 1))), vpow2i_vd_vi_rvvm1_sleef(vsub_vi_vi_vi_rvvm1_sleef(e, vsra_vi_vi_i_rvvm1_sleef(e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp3_vd_vd_vi_rvvm1_sleef(vdouble_rvvm1_sleef d, vint_rvvm1_sleef q) { + return vreinterpret_vd_vm_rvvm1_sleef(vadd64_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vcastu_vm_vi_rvvm1_sleef(vsll_vi_vi_i_rvvm1_sleef(q, 20)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp1_vd_vd_vm_rvvm1_sleef(vdouble_rvvm1_sleef d, vmask_rvvm1_sleef e) { + vmask_rvvm1_sleef m = vsrl64_vm_vm_i(e, 2); + e = vsub64_vm_vm_vm_rvvm1_sleef(vsub64_vm_vm_vm_rvvm1_sleef(vsub64_vm_vm_vm_rvvm1_sleef(e, m), m), m); + d = vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vm_rvvm1_sleef(m)); + d = vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vm_rvvm1_sleef(m)); + d = vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vm_rvvm1_sleef(m)); + d = vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vm_rvvm1_sleef(e)); + return d; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp2_vd_vd_vm_rvvm1_sleef(vdouble_rvvm1_sleef d, vmask_rvvm1_sleef e) { + return vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vpow2i_vd_vm_rvvm1_sleef(vsrl64_vm_vm_i(e, 1))), vpow2i_vd_vm_rvvm1_sleef(vsub64_vm_vm_vm_rvvm1_sleef(e, vsrl64_vm_vm_i(e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vldexp3_vd_vd_vm_rvvm1_sleef(vdouble_rvvm1_sleef d, vmask_rvvm1_sleef q) { + return vreinterpret_vd_vm_rvvm1_sleef(vadd64_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vsll64_vm_vm_i(q, 52))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vcast_vd_vm_rvvm1_sleef(vmask_rvvm1_sleef m) { return vcast_vd_vi_rvvm1_sleef(vcast_vi_vm_rvvm1_sleef(m)); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vtruncate_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { return vcast_vm_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(d)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef vlt64_vo_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { return vgt64_vo_vm_vm_rvvm1_sleef(y, x); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef vnot_vo64_vo64_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef x) { + return rvv_dp_vxor_vo_vo_vo(x, veq64_vo_vm_vm_rvvm1_sleef(vcast_vm_i64_rvvm1_sleef(0), vcast_vm_i64_rvvm1_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_dp_vopmask_rvvm1_sleef vugt64_vo_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { + x = vxor_vm_vm_vm_rvvm1_sleef(vcast_vm_u64_rvvm1_sleef(UINT64_C(0x8000000000000000)), x); + y = vxor_vm_vm_vm_rvvm1_sleef(vcast_vm_u64_rvvm1_sleef(UINT64_C(0x8000000000000000)), y); + return vgt64_vo_vm_vm_rvvm1_sleef(x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vilogbk_vm_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2.037035976334486E90), d), d); + vmask_rvvm1_sleef q = vreinterpret_vm_vd_rvvm1_sleef(d); + q = vsrl64_vm_vm_i(q, 20 + 32); + q = vand_vm_vm_vm_rvvm1_sleef(q, vcast_vm_i64_rvvm1_sleef(0x7ff)); + q = vsub64_vm_vm_vm_rvvm1_sleef(q, vsel_vm_vo64_vm_vm_rvvm1_sleef(o, vcast_vm_i64_rvvm1_sleef(300 + 0x3ff), vcast_vm_i64_rvvm1_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_rvvm1_sleef sel_vq_vo_vq_vq_rvvm1_sleef(rvv_dp_vopmask_rvvm1_sleef o, vquad_rvvm1_sleef x, vquad_rvvm1_sleef y) { + return vqsetxy_vq_vm_vm_rvvm1_sleef(vsel_vm_vo64_vm_vm_rvvm1_sleef(o, vqgetx_vm_vq_rvvm1_sleef(x), vqgetx_vm_vq_rvvm1_sleef(y)), vsel_vm_vo64_vm_vm_rvvm1_sleef(o, vqgety_vm_vq_rvvm1_sleef(x), vqgety_vm_vq_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_rvvm1_sleef add128_vq_vq_vq_rvvm1_sleef(vquad_rvvm1_sleef x, vquad_rvvm1_sleef y) { + vquad_rvvm1_sleef r = vqsetxy_vq_vm_vm_rvvm1_sleef(vadd64_vm_vm_vm_rvvm1_sleef(vqgetx_vm_vq_rvvm1_sleef(x), vqgetx_vm_vq_rvvm1_sleef(y)), vadd64_vm_vm_vm_rvvm1_sleef(vqgety_vm_vq_rvvm1_sleef(x), vqgety_vm_vq_rvvm1_sleef(y))); + r = vqsety_vq_vq_vm_rvvm1_sleef(r, vadd64_vm_vm_vm_rvvm1_sleef(vqgety_vm_vq_rvvm1_sleef(r), vand_vm_vo64_vm_rvvm1_sleef(vugt64_vo_vm_vm_rvvm1_sleef(vqgetx_vm_vq_rvvm1_sleef(x), vqgetx_vm_vq_rvvm1_sleef(r)), vcast_vm_i64_rvvm1_sleef(1)))); + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_rvvm1_sleef imdvq_vq_vm_vm_rvvm1_sleef(vmask_rvvm1_sleef x, vmask_rvvm1_sleef y) { vquad_rvvm1_sleef r = vqsetxy_vq_vm_vm_rvvm1_sleef(x, y); return r; } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST di_t_rvvm1_sleef rempisub_rvvm1_sleef(vdouble_rvvm1_sleef x) { + + vdouble_rvvm1_sleef c = vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52), x); + vdouble_rvvm1_sleef rint4x = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(4), x)), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), + vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(4), x), + vorsign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(4), x, c), c), x)); + vdouble_rvvm1_sleef rintx = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), + x, vorsign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(x, c), c), x)); + return disetdi_di_vd_vi_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.25), rint4x, x), + vtruncate_vi_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-4), rintx, rint4x))); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_rvvm1_sleef vsel_vi_vd_vd_vi_vi_rvvm1_sleef(vdouble_rvvm1_sleef d0, vdouble_rvvm1_sleef d1, vint_rvvm1_sleef x, vint_rvvm1_sleef y) { return vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d0, d1)), x, y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_rvvm1_sleef vsel_vi_vd_vi_rvvm1_sleef(vdouble_rvvm1_sleef d, vint_rvvm1_sleef x) { return vand_vi_vo_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vsignbit_vo_vd_rvvm1_sleef(d)), x); } + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_ldexpdx_rvvm1(vdouble_rvvm1_sleef x, vint_rvvm1_sleef q) { return vldexp_vd_vd_vi_rvvm1_sleef(x, q); } + +SLEEF_INLINE SLEEF_CONST vint_rvvm1_sleef Sleef_ilogbdx_rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef e = vcast_vd_vi_rvvm1_sleef(vilogbk_vi_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d))); + e = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vd_vo_vd_vd_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(2147483647), e); + return vrint_vi_vd_rvvm1_sleef(e); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST ddi_t_rvvm1_sleef rempi_rvvm1_sleef(vdouble_rvvm1_sleef a) { + vdouble2_rvvm1_sleef x, y; + vint_rvvm1_sleef ex = vilogb2k_vi_vd_rvvm1_sleef(a); + + ex = vsub_vi_vi_vi_rvvm1_sleef(ex, vcast_vi_i_rvvm1_sleef(55)); + vint_rvvm1_sleef q = vand_vi_vo_vi_rvvm1_sleef(vgt_vo_vi_vi_rvvm1_sleef(ex, vcast_vi_i_rvvm1_sleef(700-55)), vcast_vi_i_rvvm1_sleef(-64)); + a = vldexp3_vd_vd_vi_rvvm1_sleef(a, q); + ex = vandnot_vi_vi_vi_rvvm1_sleef(vsra_vi_vi_i_rvvm1_sleef(ex, 31), ex); + ex = vsll_vi_vi_i_rvvm1_sleef(ex, 2); + x = ddmul_vd2_vd_vd_rvvm1_sleef(a, vgather_vd_p_vi_rvvm1_sleef(Sleef_rempitabdp, ex)); + di_t_rvvm1_sleef di = rempisub_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)); + q = digeti_vi_di_rvvm1_sleef(di); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, digetd_vd_di_rvvm1_sleef(di)); + x = ddnormalize_vd2_vd2_rvvm1_sleef(x); + y = ddmul_vd2_vd_vd_rvvm1_sleef(a, vgather_vd_p_vi_rvvm1_sleef(Sleef_rempitabdp+1, ex)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(x, y); + di = rempisub_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)); + q = vadd_vi_vi_vi_rvvm1_sleef(q, digeti_vi_di_rvvm1_sleef(di)); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, digetd_vd_di_rvvm1_sleef(di)); + x = ddnormalize_vd2_vd2_rvvm1_sleef(x); + y = vcast_vd2_vd_vd_rvvm1_sleef(vgather_vd_p_vi_rvvm1_sleef(Sleef_rempitabdp+2, ex), vgather_vd_p_vi_rvvm1_sleef(Sleef_rempitabdp+3, ex)); + y = ddmul_vd2_vd2_vd_rvvm1_sleef(y, a); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(x, y); + x = ddnormalize_vd2_vd2_rvvm1_sleef(x); + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(x, vcast_vd2_d_d_rvvm1_sleef(3.141592653589793116*2, 1.2246467991473532072e-16*2)); + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(a), vcast_vd_d_rvvm1_sleef(0.7)); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, vsel_vd_vo_vd_vd_rvvm1_sleef(o, a, vd2getx_vd_vd2_rvvm1_sleef(x))); + x = vd2sety_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x))))); + return ddisetddi_ddi_vd2_vi_rvvm1_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sindx_u35rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u, s, r = d; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmlapn_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24), d); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(3)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0))), vcast_vi_i_rvvm1_sleef(2), vcast_vi_i_rvvm1_sleef(1))); + ql = vsra_vi_vi_i_rvvm1_sleef(ql, 2); + rvv_dp_vopmask_rvvm1_sleef o = veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1)); + vdouble2_rvvm1_sleef x = vcast_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)))); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef), x); + ddi_rvvm1_sleef = ddisetdd_ddi_ddi_vd2_rvvm1_sleef(ddi_rvvm1_sleef, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(o), x, ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + d = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vd2gety_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + d = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(r), visnan_vo_vd_rvvm1_sleef(r)), vreinterpret_vm_vd_rvvm1_sleef(d))); + } + + s = vmul_vd_vd_vd_rvvm1_sleef(d, d); + + d = vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1))), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(d))); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_rvvm1_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_rvvm1_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_rvvm1_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-0.000198412698412696162806809)), (vcast_vd_d_rvvm1_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(u, d)), d); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sindx_u10rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u; + vdouble2_rvvm1_sleef s, t, x; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + const vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef (u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + const vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmlapn_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef (u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24))); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(3)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0))), vcast_vi_i_rvvm1_sleef(2), vcast_vi_i_rvvm1_sleef(1))); + ql = vsra_vi_vi_i_rvvm1_sleef(ql, 2); + rvv_dp_vopmask_rvvm1_sleef o = veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1)); + vdouble2_rvvm1_sleef x = vcast_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)))); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef), x); + ddi_rvvm1_sleef = ddisetdd_ddi_ddi_vd2_rvvm1_sleef(ddi_rvvm1_sleef, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(o), x, ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + s = ddnormalize_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)); + s = vd2setx_vd2_vd2_vd_rvvm1_sleef(s, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_rvvm1_sleef(s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2getx_vd_vd2_rvvm1_sleef(s)), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_rvvm1_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_rvvm1_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_rvvm1_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_rvvm1_sleef(t, x); + + u = vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1))), + vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(u))); + u = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_cosdx_u35rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u, s, r = d; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), + vrint_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724), vcast_vd_d_rvvm1_sleef(-0.5))), + vcast_vd_d_rvvm1_sleef(1)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_rvvm1_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-(1 << 23)), vcast_vd_d_rvvm1_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vcast_vi_i_rvvm1_sleef(1)); + vdouble_rvvm1_sleef dql = vcast_vd_vi_rvvm1_sleef(ql); + + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24 * 0.5), d); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(3)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0))), vcast_vi_i_rvvm1_sleef(8), vcast_vi_i_rvvm1_sleef(7))); + ql = vsra_vi_vi_i_rvvm1_sleef(ql, 1); + rvv_dp_vopmask_rvvm1_sleef o = veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(0)); + vdouble_rvvm1_sleef y = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(0), vcast_vd_d_rvvm1_sleef(-1)); + vdouble2_rvvm1_sleef x = vcast_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef), x); + ddi_rvvm1_sleef = ddisetdd_ddi_ddi_vd2_rvvm1_sleef(ddi_rvvm1_sleef, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(o), x, ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + d = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vd2gety_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + d = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(r), visnan_vo_vd_rvvm1_sleef(r)), vreinterpret_vm_vd_rvvm1_sleef(d))); + } + + s = vmul_vd_vd_vd_rvvm1_sleef(d, d); + + d = vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(0))), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(d))); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_rvvm1_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_rvvm1_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_rvvm1_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(-0.000198412698412696162806809)), (vcast_vd_d_rvvm1_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_cosdx_u10rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u; + vdouble2_rvvm1_sleef s, t, x; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724), vcast_vd_d_rvvm1_sleef(-0.5))); + dql = vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), dql, vcast_vd_d_rvvm1_sleef(1)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + s = ddadd2_vd2_vd_vd_rvvm1_sleef(d, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116*0.5))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_rvvm1_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-(1 << 23)), vcast_vd_d_rvvm1_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vcast_vi_i_rvvm1_sleef(1)); + const vdouble_rvvm1_sleef dql = vcast_vd_vi_rvvm1_sleef(ql); + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd2_vd2_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(3)); + ql = vadd_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, ql), vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0))), vcast_vi_i_rvvm1_sleef(8), vcast_vi_i_rvvm1_sleef(7))); + ql = vsra_vi_vi_i_rvvm1_sleef(ql, 1); + rvv_dp_vopmask_rvvm1_sleef o = veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef), vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(0)); + vdouble_rvvm1_sleef y = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(0), vcast_vd_d_rvvm1_sleef(-1)); + vdouble2_rvvm1_sleef x = vcast_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef), x); + ddi_rvvm1_sleef = ddisetdd_ddi_ddi_vd2_rvvm1_sleef(ddi_rvvm1_sleef, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(o), x, ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + s = ddnormalize_vd2_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)); + s = vd2setx_vd2_vd2_vd_rvvm1_sleef(s, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_rvvm1_sleef(s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2getx_vd_vd2_rvvm1_sleef(s)), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_rvvm1_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_rvvm1_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_rvvm1_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_rvvm1_sleef(t, x); + + u = vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(0))), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; + +} + +SLEEF_INLINE vdouble2_rvvm1_sleef Sleef_sincosdx_u35rvvm1(vdouble_rvvm1_sleef d) { + + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, t, rx, ry, s; + vdouble2_rvvm1_sleef r; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), s); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), s); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24 * 0.5), s); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + s = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vd2gety_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + s = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)), vreinterpret_vm_vd_rvvm1_sleef(s))); + } + + t = s; + + s = vmul_vd_vd_vd_rvvm1_sleef(s, s); + + u = vcast_vd_d_rvvm1_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.166666666666666130709393)); + + rx = vmla_vd_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(u, s), t, t); + rx = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-0.0), rx); + + u = vcast_vd_d_rvvm1_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.5)); + + ry = vmla_vd_vd_vd_vd_rvvm1_sleef(s, u, vcast_vd_d_rvvm1_sleef(1)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(0))); + r = vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(o, rx, ry), vsel_vd_vo_vd_vd_rvvm1_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_rvvm1_sleef Sleef_sincosdx_u10rvvm1(vdouble_rvvm1_sleef d) { + + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, rx, ry; + vdouble2_rvvm1_sleef r, s, t, x; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + const vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef (u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + const vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + s = ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + o = rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)); + s = vd2setxy_vd2_vd_vd_rvvm1_sleef(vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s)))), + vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(s))))); + } + + t = s; + + s = vd2setx_vd2_vd2_vd_rvvm1_sleef(s, ddsqu_vd_vd2_rvvm1_sleef(s)); + + u = vcast_vd_d_rvvm1_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-0.166666666666666130709393)); + + u = vmul_vd_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2getx_vd_vd2_rvvm1_sleef(t))); + + x = ddadd_vd2_vd2_vd_rvvm1_sleef(t, u); + rx = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + rx = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-0.0), rx); + + u = vcast_vd_d_rvvm1_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(-0.5)); + + x = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), ddmul_vd2_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), u)); + ry = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(0))); + r = vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(o, rx, ry), vsel_vd_vo_vd_vd_rvvm1_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_rvvm1_sleef Sleef_sincospidx_u05rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, s, t, rx, ry; + vdouble2_rvvm1_sleef r, x, s2; + + u = vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(4.0)); + vint_rvvm1_sleef q = vtruncate_vi_vd_rvvm1_sleef(u); + q = vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vxor_vi_vi_vi_rvvm1_sleef(vsrl_vi_vi_i_rvvm1_sleef(q, 31), vcast_vi_i_rvvm1_sleef(1))), vcast_vi_i_rvvm1_sleef(~1)); + s = vsub_vd_vd_vd_rvvm1_sleef(u, vcast_vd_vi_rvvm1_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_rvvm1_sleef(s, s); + s2 = ddmul_vd2_vd_vd_rvvm1_sleef(t, t); + + u = vcast_vd_d_rvvm1_sleef(-2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(6.94821830580179461327784e-12)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(3.13361688966868392878422e-07)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-3.6576204182161551920361e-05)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(0.00249039457019271850274356)); + x = ddadd2_vd2_vd_vd2_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(u, s), vcast_vd2_d_d_rvvm1_sleef(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s2, x), vcast_vd2_d_d_rvvm1_sleef(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd_rvvm1_sleef(x, t); + rx = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + rx = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-0.0), rx); + + u = vcast_vd_d_rvvm1_sleef(9.94480387626843774090208e-16); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-3.89796226062932799164047e-13)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1.15011582539996035266901e-10)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-2.4611369501044697495359e-08)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(3.59086044859052754005062e-06)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.000325991886927389905997954)); + x = ddadd2_vd2_vd_vd2_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(u, s), vcast_vd2_d_d_rvvm1_sleef(0.0158543442438155018914259, -1.04693272280631521908845e-18)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s2, x), vcast_vd2_d_d_rvvm1_sleef(-0.308425137534042437259529, -1.95698492133633550338345e-17)); + + x = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(x, s2), vcast_vd_d_rvvm1_sleef(1)); + ry = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(0))); + r = vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(o, rx, ry), vsel_vd_vo_vd_vd_rvvm1_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + o = vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vsel_vd_vo_vd_vd_rvvm1_sleef(o, vcast_vd_d_rvvm1_sleef(1), vd2gety_vd_vd2_rvvm1_sleef(r))); + + o = visinf_vo_vd_rvvm1_sleef(d); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + return r; +} + +SLEEF_INLINE vdouble2_rvvm1_sleef Sleef_sincospidx_u35rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, s, t, rx, ry; + vdouble2_rvvm1_sleef r; + + u = vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(4.0)); + vint_rvvm1_sleef q = vtruncate_vi_vd_rvvm1_sleef(u); + q = vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vxor_vi_vi_vi_rvvm1_sleef(vsrl_vi_vi_i_rvvm1_sleef(q, 31), vcast_vi_i_rvvm1_sleef(1))), vcast_vi_i_rvvm1_sleef(~1)); + s = vsub_vd_vd_vd_rvvm1_sleef(u, vcast_vd_vi_rvvm1_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_rvvm1_sleef(s, s); + + u = vcast_vd_d_rvvm1_sleef(+0.6880638894766060136e-11); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.1757159564542310199e-8)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.3133616327257867311e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.3657620416388486452e-4)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.2490394570189932103e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.8074551218828056320e-1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.7853981633974482790e+0)); + + rx = vmul_vd_vd_vd_rvvm1_sleef(u, t); + + u = vcast_vd_d_rvvm1_sleef(-0.3860141213683794352e-12); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1150057888029681415e-9)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.2461136493006663553e-7)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.3590860446623516713e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.3259918869269435942e-3)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1585434424381541169e-1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(-0.3084251375340424373e+0)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1)); + + ry = u; + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(0))); + r = vd2setxy_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(o, rx, ry), vsel_vd_vo_vd_vd_rvvm1_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + o = vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + o = visinf_vo_vd_rvvm1_sleef(d); + r = vd2setx_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r))))); + r = vd2sety_vd2_vd2_vd_rvvm1_sleef(r, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble2_rvvm1_sleef Sleef_modfdx_rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef fr = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 31), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + fr = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), vcast_vd_d_rvvm1_sleef(0), fr); + + vdouble2_rvvm1_sleef ret; + + ret = vd2setxy_vd2_vd_vd_rvvm1_sleef(vcopysign_vd_vd_vd_rvvm1_sleef(fr, x), vcopysign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(x, fr), x)); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef sinpik_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, s, t; + vdouble2_rvvm1_sleef x, s2; + + u = vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(4.0)); + vint_rvvm1_sleef q = vtruncate_vi_vd_rvvm1_sleef(u); + q = vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vxor_vi_vi_vi_rvvm1_sleef(vsrl_vi_vi_i_rvvm1_sleef(q, 31), vcast_vi_i_rvvm1_sleef(1))), vcast_vi_i_rvvm1_sleef(~1)); + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))); + + s = vsub_vd_vd_vd_rvvm1_sleef(u, vcast_vd_vi_rvvm1_sleef(q)); + t = s; + s = vmul_vd_vd_vd_rvvm1_sleef(s, s); + s2 = ddmul_vd2_vd_vd_rvvm1_sleef(t, t); + + u = vsel_vd_vo_d_d_rvvm1_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(u, s), + vsel_vd2_vo_d_d_d_d_rvvm1_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_rvvm1_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(x, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, s2, vcast_vd2_vd_vd_rvvm1_sleef(t, vcast_vd_d_rvvm1_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1)), x); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x))))); + x = vd2sety_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sinpidx_u05rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x = sinpik_rvvm1_sleef(d); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-0.0), r); + r = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+9/4)), vreinterpret_vm_vd_rvvm1_sleef(r))); + r = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef cospik_rvvm1_sleef(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o; + vdouble_rvvm1_sleef u, s, t; + vdouble2_rvvm1_sleef x, s2; + + u = vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(4.0)); + vint_rvvm1_sleef q = vtruncate_vi_vd_rvvm1_sleef(u); + q = vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vxor_vi_vi_vi_rvvm1_sleef(vsrl_vi_vi_i_rvvm1_sleef(q, 31), vcast_vi_i_rvvm1_sleef(1))), vcast_vi_i_rvvm1_sleef(~1)); + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(0))); + + s = vsub_vd_vd_vd_rvvm1_sleef(u, vcast_vd_vi_rvvm1_sleef(q)); + t = s; + s = vmul_vd_vd_vd_rvvm1_sleef(s, s); + s2 = ddmul_vd2_vd_vd_rvvm1_sleef(t, t); + + u = vsel_vd_vo_d_d_rvvm1_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vsel_vd_vo_d_d_rvvm1_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(u, s), + vsel_vd2_vo_d_d_d_d_rvvm1_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_rvvm1_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(x, vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, s2, vcast_vd2_vd_vd_rvvm1_sleef(t, vcast_vd_d_rvvm1_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1)), x); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(4)), vcast_vi_i_rvvm1_sleef(4))); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x))))); + x = vd2sety_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_cospidx_u05rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x = cospik_rvvm1_sleef(d); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+9/4)), vcast_vd_d_rvvm1_sleef(1), r); + r = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(r))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_tandx_u35rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u, s, x, y; + rvv_dp_vopmask_rvvm1_sleef o; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116 * 0.5), d); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16 * 0.5), x); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+6)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), x); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24 * 0.5), x); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + x = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef)), vd2gety_vd_vd2_rvvm1_sleef(ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef))); + x = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(x))); + x = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)), vreinterpret_vm_vd_rvvm1_sleef(x))); + } + + x = vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0.5)); + s = vmul_vd_vd_vd_rvvm1_sleef(x, x); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_rvvm1_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_rvvm1_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_rvvm1_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_rvvm1_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.3333333333333343695e+0)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(u, x), x); + + y = vmla_vd_vd_vd_vd_rvvm1_sleef(u, u, vcast_vd_d_rvvm1_sleef(-1)); + x = vmul_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-2)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1))); + u = vdiv_vd_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(o, vneg_vd_vd_rvvm1_sleef(y), x), + vsel_vd_vo_vd_vd_rvvm1_sleef(o, x, y)); + u = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_tandx_u10rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef u; + vdouble2_rvvm1_sleef s, t, x, y; + rvv_dp_vopmask_rvvm1_sleef o; + vint_rvvm1_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(15)))), 1)) { + vdouble_rvvm1_sleef dql = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef (u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1e+14)))), 1)) { + vdouble_rvvm1_sleef dqh = vtruncate_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(1 << 24)); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.63661977236758138243, -3.9357353350364971764e-17), d), + vsub_vd_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), + vcast_vd_d_rvvm1_sleef(-0.5), vcast_vd_d_rvvm1_sleef(0.5)), dqh)); + const vdouble_rvvm1_sleef dql = vtruncate_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s))); + ql = vrint_vi_vd_rvvm1_sleef(dql); + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1415926218032836914*0.5 ))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-3.1786509424591713469e-08*0.5 ))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dqh, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dql, vcast_vd_d_rvvm1_sleef(-1.2246467864107188502e-16*0.5 ))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(dqh, dql), vcast_vd_d_rvvm1_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_rvvm1_sleef ddi_rvvm1_sleef = rempi_rvvm1_sleef(d); + ql = ddigeti_vi_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + s = ddigetdd_vd2_ddi_rvvm1_sleef(ddi_rvvm1_sleef); + o = rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(d), visnan_vo_vd_rvvm1_sleef(d)); + s = vd2setx_vd2_vd2_vd_rvvm1_sleef(s, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s))))); + s = vd2sety_vd2_vd2_vd_rvvm1_sleef(s, vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(o, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(s))))); + } + + t = ddscale_vd2_vd2_vd_rvvm1_sleef(s, vcast_vd_d_rvvm1_sleef(0.5)); + s = ddsqu_vd2_vd2_rvvm1_sleef(t); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2getx_vd_vd2_rvvm1_sleef(s)), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_rvvm1_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_rvvm1_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_rvvm1_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_rvvm1_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(+0.3333333333333343695e+0)); + x = ddadd_vd2_vd2_vd2_rvvm1_sleef(t, ddmul_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s, t), u)); + + y = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), ddsqu_vd2_vd2_rvvm1_sleef(x)); + x = ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(-2)); + + o = vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(ql, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1))); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddneg_vd2_vd2_rvvm1_sleef(y), x), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, x, y)); + + u = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), d, u); + + return u; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef atan2k_rvvm1_sleef(vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef s, t, u; + vint_rvvm1_sleef q; + rvv_dp_vopmask_rvvm1_sleef p; + + q = vsel_vi_vd_vi_rvvm1_sleef(x, vcast_vi_i_rvvm1_sleef(-2)); + x = vabs_vd_vd_rvvm1_sleef(x); + + q = vsel_vi_vd_vd_vi_vi_rvvm1_sleef(x, y, vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(1)), q); + p = vlt_vo_vd_vd_rvvm1_sleef(x, y); + s = vsel_vd_vo_vd_vd_rvvm1_sleef(p, vneg_vd_vd_rvvm1_sleef(x), y); + t = vmax_vd_vd_vd_rvvm1_sleef(x, y); + + s = vdiv_vd_vd_vd_rvvm1_sleef(s, t); + t = vmul_vd_vd_vd_rvvm1_sleef(s, s); + + vdouble_rvvm1_sleef t2 = vmul_vd_vd_vd_rvvm1_sleef(t, t), t4 = vmul_vd_vd_vd_rvvm1_sleef(t2, t2), t8 = vmul_vd_vd_vd_rvvm1_sleef(t4, t4), t16 = vmul_vd_vd_vd_rvvm1_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((t16), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vcast_vd_d_rvvm1_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.000209850076645816976906797)), (vcast_vd_d_rvvm1_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t8), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.00370026744188713119232403)), (vcast_vd_d_rvvm1_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.016599329773529201970117)), (vcast_vd_d_rvvm1_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0337852580001353069993897)), (vcast_vd_d_rvvm1_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0466667150077840625632675)), (vcast_vd_d_rvvm1_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0587666392926673580854313)), (vcast_vd_d_rvvm1_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0769219538311769618355029)), (vcast_vd_d_rvvm1_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.111111105648261418443745)), (vcast_vd_d_rvvm1_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.199999999996591265594148)), (vcast_vd_d_rvvm1_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(t, u), s); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(q), vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef atan2k_u1_rvvm1_sleef(vdouble2_rvvm1_sleef y, vdouble2_rvvm1_sleef x) { + vdouble_rvvm1_sleef u; + vdouble2_rvvm1_sleef s, t; + vint_rvvm1_sleef q; + rvv_dp_vopmask_rvvm1_sleef p; + + q = vsel_vi_vd_vi_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vcast_vi_i_rvvm1_sleef(-2)); + p = vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(0)); + vmask_rvvm1_sleef b = vand_vm_vo64_vm_rvvm1_sleef(p, vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))); + x = vd2setx_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(b, vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x))))); + x = vd2sety_vd2_vd2_vd_rvvm1_sleef(x, vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(b, vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(x))))); + + q = vsel_vi_vd_vd_vi_vi_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y), vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(1)), q); + p = vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(y)); + s = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(p, ddneg_vd2_vd2_rvvm1_sleef(x), y); + t = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(p, y, x); + + s = dddiv_vd2_vd2_vd2_rvvm1_sleef(s, t); + t = ddsqu_vd2_vd2_rvvm1_sleef(s); + t = ddnormalize_vd2_vd2_rvvm1_sleef(t); + + vdouble_rvvm1_sleef t2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), vd2getx_vd_vd2_rvvm1_sleef(t)), t4 = vmul_vd_vd_vd_rvvm1_sleef(t2, t2), t8 = vmul_vd_vd_vd_rvvm1_sleef(t4, t4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((t8), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(1.06298484191448746607415e-05)), (vcast_vd_d_rvvm1_sleef(-0.000125620649967286867384336)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.00070557664296393412389774)), (vcast_vd_d_rvvm1_sleef(-0.00251865614498713360352999)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.00646262899036991172313504)), (vcast_vd_d_rvvm1_sleef(-0.0128281333663399031014274)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.0208024799924145797902497)), (vcast_vd_d_rvvm1_sleef(-0.0289002344784740315686289)))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.0359785005035104590853656)), (vcast_vd_d_rvvm1_sleef(-0.041848579703592507506027)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.0470843011653283988193763)), (vcast_vd_d_rvvm1_sleef(-0.0524914210588448421068719)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.0587946590969581003860434)), (vcast_vd_d_rvvm1_sleef(-0.0666620884778795497194182)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(t)), (vcast_vd_d_rvvm1_sleef(0.0769225330296203768654095)), (vcast_vd_d_rvvm1_sleef(-0.0909090442773387574781907))))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(t), vcast_vd_d_rvvm1_sleef(0.111111108376896236538123)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(t), vcast_vd_d_rvvm1_sleef(-0.142857142756268568062339)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(t), vcast_vd_d_rvvm1_sleef(0.199999999997977351284817)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(t), vcast_vd_d_rvvm1_sleef(-0.333333333333317605173818)); + + t = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddmul_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(s, t), u)); + + t = ddadd_vd2_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(1.570796326794896557998982, 6.12323399573676603586882e-17), vcast_vd_vi_rvvm1_sleef(q)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef visinf2_vd_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d, vdouble_rvvm1_sleef m) { + return vreinterpret_vd_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vor_vm_vm_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(d), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_atan2dx_u35rvvm1(vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef r = atan2k_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(y), x); + + r = vmulsign_vd_vd_vd_rvvm1_sleef(r, x); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0))), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_rvvm1_sleef(x, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(y), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_rvvm1_sleef(x, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0.0)), vreinterpret_vd_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vsignbit_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vreinterpret_vm_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_atan2dx_u10rvvm1(vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef x) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(5.5626846462680083984e-309)); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 53)), x); + y = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 53)), y); + + vdouble2_rvvm1_sleef d = atan2k_u1_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(y), vcast_vd_d_rvvm1_sleef(0)), vcast_vd2_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0))); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)); + + r = vmulsign_vd_vd_vd_rvvm1_sleef(r, x); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0))), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_rvvm1_sleef(x, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(y), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_rvvm1_sleef(x, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0.0)), vreinterpret_vd_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vsignbit_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vreinterpret_vm_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_asindx_u35rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0.5)); + vdouble_rvvm1_sleef x2 = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, d), vmul_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vabs_vd_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5))); + vdouble_rvvm1_sleef x = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vabs_vd_vd_rvvm1_sleef(d), vsqrt_vd_vd_rvvm1_sleef(x2)), u; + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_rvvm1_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_rvvm1_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_rvvm1_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_rvvm1_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_rvvm1_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_rvvm1_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(x, x2), x); + + vdouble_rvvm1_sleef r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, u, vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-2), vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2))); + return vmulsign_vd_vd_vd_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_asindx_u10rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0.5)); + vdouble_rvvm1_sleef x2 = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, d), vmul_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vabs_vd_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5))), u; + vdouble2_rvvm1_sleef x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, vcast_vd2_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0)), ddsqrt_vd2_vd_rvvm1_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1.0)), vcast_vd2_d_d_rvvm1_sleef(0, 0), x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_rvvm1_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_rvvm1_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_rvvm1_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_rvvm1_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_rvvm1_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_rvvm1_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x))); + + vdouble2_rvvm1_sleef y = ddsub_vd2_vd2_vd_rvvm1_sleef(ddsub_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(3.141592653589793116/4, 1.2246467991473532072e-16/4), x), u); + + vdouble_rvvm1_sleef r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vadd_vd_vd_vd_rvvm1_sleef(u, vd2getx_vd_vd2_rvvm1_sleef(x)), + vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(2))); + return vmulsign_vd_vd_vd_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_acosdx_u35rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0.5)); + vdouble_rvvm1_sleef x2 = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, d), + vmul_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vabs_vd_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5))), u; + vdouble_rvvm1_sleef x = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vabs_vd_vd_rvvm1_sleef(d), vsqrt_vd_vd_rvvm1_sleef(x2)); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1.0)), vcast_vd_d_rvvm1_sleef(0), x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_rvvm1_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_rvvm1_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_rvvm1_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_rvvm1_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_rvvm1_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_rvvm1_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(x2, x)); + + vdouble_rvvm1_sleef y = vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), vadd_vd_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(x, d), vmulsign_vd_vd_vd_rvvm1_sleef(u, d))); + x = vadd_vd_vd_vd_rvvm1_sleef(x, u); + vdouble_rvvm1_sleef r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, y, vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + return vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vandnot_vo_vo_vo(o, vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0))), + vd2getx_vd_vd2_rvvm1_sleef(ddadd_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(3.141592653589793116, 1.2246467991473532072e-16), + vneg_vd_vd_rvvm1_sleef(r))), r); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_acosdx_u10rvvm1(vdouble_rvvm1_sleef d) { + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0.5)); + vdouble_rvvm1_sleef x2 = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, d), vmul_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vabs_vd_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5))), u; + vdouble2_rvvm1_sleef x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, vcast_vd2_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0)), ddsqrt_vd2_vd_rvvm1_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1.0)), vcast_vd2_d_d_rvvm1_sleef(0, 0), x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_rvvm1_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_rvvm1_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_rvvm1_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_rvvm1_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_rvvm1_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_rvvm1_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_rvvm1_sleef(u, vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x))); + + vdouble2_rvvm1_sleef y = ddsub_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(3.141592653589793116/2, 1.2246467991473532072e-16/2), + ddadd_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), d), vmulsign_vd_vd_vd_rvvm1_sleef(u, d))); + x = ddadd_vd2_vd2_vd_rvvm1_sleef(x, u); + + y = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, y, ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + + y = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(rvv_dp_vandnot_vo_vo_vo(o, vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0))), + ddsub_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(3.141592653589793116, 1.2246467991473532072e-16), y), y); + + return vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_atandx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef d2 = atan2k_u1_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(0)), vcast_vd2_d_d_rvvm1_sleef(1, 0)); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d2), vd2gety_vd_vd2_rvvm1_sleef(d2)); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1.570796326794896557998982), r); + return vmulsign_vd_vd_vd_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_atandx_u35rvvm1(vdouble_rvvm1_sleef s) { + vdouble_rvvm1_sleef t, u; + vint_rvvm1_sleef q; + + q = vsel_vi_vd_vi_rvvm1_sleef(s, vcast_vi_i_rvvm1_sleef(2)); + s = vabs_vd_vd_rvvm1_sleef(s); + + q = vsel_vi_vd_vd_vi_vi_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), s, vadd_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(1)), q); + s = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), s), vrec_vd_vd_rvvm1_sleef(s), s); + + t = vmul_vd_vd_vd_rvvm1_sleef(s, s); + + vdouble_rvvm1_sleef t2 = vmul_vd_vd_vd_rvvm1_sleef(t, t), t4 = vmul_vd_vd_vd_rvvm1_sleef(t2, t2), t8 = vmul_vd_vd_vd_rvvm1_sleef(t4, t4), t16 = vmul_vd_vd_vd_rvvm1_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((t16), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vcast_vd_d_rvvm1_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.000209850076645816976906797)), (vcast_vd_d_rvvm1_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t8), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.00370026744188713119232403)), (vcast_vd_d_rvvm1_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.016599329773529201970117)), (vcast_vd_d_rvvm1_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0337852580001353069993897)), (vcast_vd_d_rvvm1_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0466667150077840625632675)), (vcast_vd_d_rvvm1_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t4), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0587666392926673580854313)), (vcast_vd_d_rvvm1_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.0769219538311769618355029)), (vcast_vd_d_rvvm1_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t2), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.111111105648261418443745)), (vcast_vd_d_rvvm1_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((t), (vcast_vd_d_rvvm1_sleef(0.199999999996591265594148)), (vcast_vd_d_rvvm1_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(t, u), s); + + t = vsel_vd_vo_vd_vd_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(1)), vcast_vi_i_rvvm1_sleef(1))), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3.141592653589793238462643383279502884/2), t), t); + t = vreinterpret_vd_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo64_vm_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(2)), vcast_vi_i_rvvm1_sleef(2))), vreinterpret_vm_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-0.0))), vreinterpret_vm_vd_rvvm1_sleef(t))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_logdx_u35rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef x, x2; + vdouble_rvvm1_sleef t, m; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = vdiv_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(1)), vadd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), m)); + x2 = vmul_vd_vd_vd_rvvm1_sleef(x, x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x3 = vmul_vd_vd_vd_rvvm1_sleef(x, x2); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(0.153487338491425068243146)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.152519917006351951593857)), (vcast_vd_d_rvvm1_sleef(0.181863266251982985677316)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.222221366518767365905163)), (vcast_vd_d_rvvm1_sleef(0.285714294746548025383248)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.399999999950799600689777)), (vcast_vd_d_rvvm1_sleef(0.6666666666667778740063))))))) + + ; + + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2), vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.693147180559945286226764), vcast_vd_vi_rvvm1_sleef(e))); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x3, t, x); + + x = vsel_vd_vo_vd_vd_rvvm1_sleef(vispinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), x); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_expdx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.2081276378237164457e-8)), (vcast_vd_d_rvvm1_sleef(+0.2511210703042288022e-7)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.2755762628169491192e-6)), (vcast_vd_d_rvvm1_sleef(+0.2755723402025388239e-5)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.2480158687479686264e-4)), (vcast_vd_d_rvvm1_sleef(+0.1984126989855865850e-3)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1388888888914497797e-2)), (vcast_vd_d_rvvm1_sleef(+0.8333333333314938210e-2)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.4166666666666602598e-1)), (vcast_vd_d_rvvm1_sleef(+0.1666666666666669072e+0))))))))) + + ; + u = vfma_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.5000000000000000000e+0)); + u = vfma_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1000000000000000000e+1)); + u = vfma_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1000000000000000000e+1)); + + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(709.78271114955742909217217426)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-1000)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef expm1k_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(2.08860621107283687536341e-09)), (vcast_vd_d_rvvm1_sleef(2.51112930892876518610661e-08)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(2.75573911234900471893338e-07)), (vcast_vd_d_rvvm1_sleef(2.75572362911928827629423e-06)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(2.4801587159235472998791e-05)), (vcast_vd_d_rvvm1_sleef(0.000198412698960509205564975)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(0.00138888888889774492207962)), (vcast_vd_d_rvvm1_sleef(0.00833333333331652721664984)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(0.0416666666666665047591422)), (vcast_vd_d_rvvm1_sleef(0.166666666666666851703837))))))))) + + ; + + u = vadd_vd_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(s2, vcast_vd_d_rvvm1_sleef(0.5), vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(s2, s), u)), s); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(q, vcast_vi_i_rvvm1_sleef(0))), u, + vsub_vd_vd_vd_rvvm1_sleef(vldexp2_vd_vd_vi_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(1)), q), vcast_vd_d_rvvm1_sleef(1))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef logk_rvvm1_sleef(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x, x2, s; + vdouble_rvvm1_sleef t, m; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), m), ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), m)); + x2 = ddsqu_vd2_vd2_rvvm1_sleef(x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x2), vd2getx_vd_vd2_rvvm1_sleef(x2)), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vcast_vd_d_rvvm1_sleef(0.116255524079935043668677)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.103239680901072952701192)), (vcast_vd_d_rvvm1_sleef(0.117754809412463995466069)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.13332981086846273921509)), (vcast_vd_d_rvvm1_sleef(0.153846227114512262845736)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.181818180850050775676507)), (vcast_vd_d_rvvm1_sleef(0.222222222230083560345903)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.285714285714249172087875)), (vcast_vd_d_rvvm1_sleef(0.400000000000000077715612))))))))) + + ; + + vdouble2_rvvm1_sleef c = vcast_vd2_d_d_rvvm1_sleef(0.666666666666666629659233, 3.80554962542412056336616e-17); + + s = ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_rvvm1_sleef(e)); + + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddmul_vd2_vd2_vd2_rvvm1_sleef(x, c)); + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddmul_vd2_vd2_vd_rvvm1_sleef(x, t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_logdx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x; + vdouble_rvvm1_sleef t, m, x2; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), m), ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), m)); + x2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.1525629051003428716e+0)), (vcast_vd_d_rvvm1_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.2222214519839380009e+0)), (vcast_vd_d_rvvm1_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.3999999999635251990e+0)), (vcast_vd_d_rvvm1_sleef(0.6666666666667333541e+0))))))) + + ; + + vdouble2_rvvm1_sleef s = ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_rvvm1_sleef(e)); + + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x)), t)); + + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vispinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef expk_rvvm1_sleef(vdouble2_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_rvvm1_sleef dq = vrint_vd_vd_rvvm1_sleef(u); + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(dq); + vdouble2_rvvm1_sleef s, t; + + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(d, vmul_vd_vd_vd_rvvm1_sleef(dq, vcast_vd_d_rvvm1_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dq, vcast_vd_d_rvvm1_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + s = ddnormalize_vd2_vd2_rvvm1_sleef(s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2getx_vd_vd2_rvvm1_sleef(s)), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.51069683420950419527139e-08)), (vcast_vd_d_rvvm1_sleef(2.76286166770270649116855e-07)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(2.75572496725023574143864e-06)), (vcast_vd_d_rvvm1_sleef(2.48014973989819794114153e-05)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(0.000198412698809069797676111)), (vcast_vd_d_rvvm1_sleef(0.0013888888939977128960529)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(0.00833333333332371417601081)), (vcast_vd_d_rvvm1_sleef(0.0416666666665409524128449)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(0.166666666666666740681535)), (vcast_vd_d_rvvm1_sleef(0.500000000000000999200722))))))))) + + ; + + t = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), s); + t = ddadd_vd2_vd2_vd2_rvvm1_sleef(t, ddmul_vd2_vd2_vd_rvvm1_sleef(ddsqu_vd2_vd2_rvvm1_sleef(s), u)); + + u = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), vd2gety_vd_vd2_rvvm1_sleef(t)); + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-1000)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_powdx_u10rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + + rvv_dp_vopmask_rvvm1_sleef yisint = visint_vo_vd_rvvm1_sleef(y); + rvv_dp_vopmask_rvvm1_sleef yisodd = rvv_dp_vand_vo_vo_vo(visodd_vo_vd_rvvm1_sleef(y), yisint); + + vdouble2_rvvm1_sleef d = ddmul_vd2_vd2_vd_rvvm1_sleef(logk_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x)), y); + vdouble_rvvm1_sleef result = expk_rvvm1_sleef(d); + result = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(709.78271114955742909217217426)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), result); + + result = vmul_vd_vd_vd_rvvm1_sleef(result, + vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), + vcast_vd_d_rvvm1_sleef(1), + vsel_vd_vo_vd_vd_rvvm1_sleef(yisint, vsel_vd_vo_vd_vd_rvvm1_sleef(yisodd, vcast_vd_d_rvvm1_sleef(-1.0), vcast_vd_d_rvvm1_sleef(1)), vcast_vd_d_rvvm1_sleef(__builtin_nan(""))))); + + vdouble_rvvm1_sleef efx = vmulsign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(1)), y); + + result = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(y), + vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(efx, vcast_vd_d_rvvm1_sleef(0.0)), + vreinterpret_vm_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(efx, vcast_vd_d_rvvm1_sleef(0.0)), + vcast_vd_d_rvvm1_sleef(1.0), + vcast_vd_d_rvvm1_sleef(__builtin_inf()))))), + result); + + result = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0.0))), + vmulsign_vd_vd_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vxor_vo_vo_vo(vsignbit_vo_vd_rvvm1_sleef(y), veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0.0))), + vcast_vd_d_rvvm1_sleef(0), vcast_vd_d_rvvm1_sleef(__builtin_inf())), + vsel_vd_vo_vd_vd_rvvm1_sleef(yisodd, x, vcast_vd_d_rvvm1_sleef(1))), result); + + result = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vreinterpret_vm_vd_rvvm1_sleef(result))); + + result = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0)), veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1))), vcast_vd_d_rvvm1_sleef(1), result); + + return result; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef expk2_rvvm1_sleef(vdouble2_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_rvvm1_sleef dq = vrint_vd_vd_rvvm1_sleef(u); + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(dq); + vdouble2_rvvm1_sleef s, t; + + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(d, vmul_vd_vd_vd_rvvm1_sleef(dq, vcast_vd_d_rvvm1_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(dq, vcast_vd_d_rvvm1_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + vdouble2_rvvm1_sleef s2 = ddsqu_vd2_vd2_rvvm1_sleef(s), s4 = ddsqu_vd2_vd2_rvvm1_sleef(s2); + vdouble_rvvm1_sleef s8 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s4), vd2getx_vd_vd2_rvvm1_sleef(s4)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.1602472219709932072e-9)), (vcast_vd_d_rvvm1_sleef(+0.2092255183563157007e-8)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s4)), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s2)), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.2505230023782644465e-7)), (vcast_vd_d_rvvm1_sleef(+0.2755724800902135303e-6)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.2755731892386044373e-5)), (vcast_vd_d_rvvm1_sleef(+0.2480158735605815065e-4)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s2)), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.1984126984148071858e-3)), (vcast_vd_d_rvvm1_sleef(+0.1388888888886763255e-2)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(s)), (vcast_vd_d_rvvm1_sleef(+0.8333333333333347095e-2)), (vcast_vd_d_rvvm1_sleef(+0.4166666666666669905e-1))))))))) + + ; + + t = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), ddmul_vd2_vd2_vd_rvvm1_sleef(s, vcast_vd_d_rvvm1_sleef(+0.1666666666666666574e+0))); + t = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1.0), ddmul_vd2_vd2_vd2_rvvm1_sleef(t, s)); + t = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1.0), ddmul_vd2_vd2_vd2_rvvm1_sleef(t, s)); + t = ddadd_vd2_vd2_vd2_rvvm1_sleef(t, ddmul_vd2_vd2_vd_rvvm1_sleef(s4, u)); + + t = vd2setx_vd2_vd2_vd_rvvm1_sleef(t, vldexp2_vd_vd_vi_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), q)); + t = vd2sety_vd2_vd2_vd_rvvm1_sleef(t, vldexp2_vd_vd_vi_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(t), q)); + + t = vd2setx_vd2_vd2_vd_rvvm1_sleef(t, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-1000)), vreinterpret_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t))))); + t = vd2sety_vd2_vd2_vd_rvvm1_sleef(t, vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-1000)), vreinterpret_vm_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sinhdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef y = vabs_vd_vd_rvvm1_sleef(x); + vdouble2_rvvm1_sleef d = expk2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0))); + d = ddsub_vd2_vd2_vd2_rvvm1_sleef(d, ddrec_vd2_vd2_rvvm1_sleef(d)); + y = vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(710)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_rvvm1_sleef(y, x); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_coshdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef y = vabs_vd_vd_rvvm1_sleef(x); + vdouble2_rvvm1_sleef d = expk2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0))); + d = ddadd_vd2_vd2_vd2_rvvm1_sleef(d, ddrec_vd2_vd2_rvvm1_sleef(d)); + y = vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(710)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_tanhdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef y = vabs_vd_vd_rvvm1_sleef(x); + vdouble2_rvvm1_sleef d = expk2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0))); + vdouble2_rvvm1_sleef e = ddrec_vd2_vd2_rvvm1_sleef(d); + d = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, ddneg_vd2_vd2_rvvm1_sleef(e)), ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, e)); + y = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(18.714973875)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(1.0), y); + y = vmulsign_vd_vd_vd_rvvm1_sleef(y, x); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sinhdx_u35rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef e = expm1k_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x)); + + vdouble_rvvm1_sleef y = vdiv_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(e, vcast_vd_d_rvvm1_sleef(2)), vadd_vd_vd_vd_rvvm1_sleef(e, vcast_vd_d_rvvm1_sleef(1))); + y = vmul_vd_vd_vd_rvvm1_sleef(y, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(709)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_rvvm1_sleef(y, x); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_coshdx_u35rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef e = Sleef_expdx_u10rvvm1(vabs_vd_vd_rvvm1_sleef(x)); + vdouble_rvvm1_sleef y = vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), e, vdiv_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(709)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_tanhdx_u35rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef d = expm1k_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), vabs_vd_vd_rvvm1_sleef(x))); + vdouble_rvvm1_sleef y = vdiv_vd_vd_vd_rvvm1_sleef(d, vadd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), d)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(18.714973875)), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(1.0), y); + y = vmulsign_vd_vd_vd_rvvm1_sleef(y, x); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef logk2_rvvm1_sleef(vdouble2_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x, x2, m, s; + vdouble_rvvm1_sleef t; + vint_rvvm1_sleef e; + + e = vilogbk_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1.0/0.75))); + + m = vd2setxy_vd2_vd_vd_rvvm1_sleef(vldexp2_vd_vd_vi_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vneg_vi_vi_rvvm1_sleef(e)), + vldexp2_vd_vd_vi_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(d), vneg_vi_vi_rvvm1_sleef(e))); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(-1)), ddadd2_vd2_vd2_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(1))); + x2 = ddsqu_vd2_vd2_rvvm1_sleef(x); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x2), vd2getx_vd_vd2_rvvm1_sleef(x2)), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(0.13860436390467167910856)), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.131699838841615374240845)), (vcast_vd_d_rvvm1_sleef(0.153914168346271945653214)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.181816523941564611721589)), (vcast_vd_d_rvvm1_sleef(0.22222224632662035403996)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((vd2getx_vd_vd2_rvvm1_sleef(x2)), (vcast_vd_d_rvvm1_sleef(0.285714285511134091777308)), (vcast_vd_d_rvvm1_sleef(0.400000000000914013309483))))))) + + ; + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(x2), vcast_vd_d_rvvm1_sleef(0.666666666666664853302393)); + + s = ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_rvvm1_sleef(e)); + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddmul_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_asinhdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef y = vabs_vd_vd_rvvm1_sleef(x); + rvv_dp_vopmask_rvvm1_sleef o = vgt_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(1)); + vdouble2_rvvm1_sleef d; + + d = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddrec_vd2_vd_rvvm1_sleef(x), vcast_vd2_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0))); + d = ddsqrt_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(ddsqu_vd2_vd2_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(1))); + d = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddmul_vd2_vd2_vd_rvvm1_sleef(d, y), d); + + d = logk2_rvvm1_sleef(ddnormalize_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(d, x))); + y = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_rvvm1_sleef(y)), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(__builtin_inf()), x), y); + + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + y = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_acoshdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble2_rvvm1_sleef d = logk2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddsqrt_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1))), ddsqrt_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(-1)))), x)); + vdouble_rvvm1_sleef y = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)); + + y = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_rvvm1_sleef(y)), + vcast_vd_d_rvvm1_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0)), vreinterpret_vm_vd_rvvm1_sleef(y))); + + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0)), vreinterpret_vm_vd_rvvm1_sleef(y))); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_atanhdx_u10rvvm1(vdouble_rvvm1_sleef x) { + vdouble_rvvm1_sleef y = vabs_vd_vd_rvvm1_sleef(x); + vdouble2_rvvm1_sleef d = logk2_rvvm1_sleef(dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), y), ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vneg_vd_vd_rvvm1_sleef(y)))); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(1.0)), vreinterpret_vm_vd_rvvm1_sleef(vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(1.0)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), vmul_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(0.5)))))); + + y = vmulsign_vd_vd_vd_rvvm1_sleef(y, x); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vreinterpret_vm_vd_rvvm1_sleef(y))); + y = vreinterpret_vd_vm_rvvm1_sleef(vor_vm_vo64_vm_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(x), vreinterpret_vm_vd_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_cbrtdx_u35rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef x, y, q = vcast_vd_d_rvvm1_sleef(1.0); + vint_rvvm1_sleef e, qu, re; + vdouble_rvvm1_sleef t; + + e = vadd_vi_vi_vi_rvvm1_sleef(vilogbk_vi_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d)), vcast_vi_i_rvvm1_sleef(1)); + d = vldexp2_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + + t = vadd_vd_vd_vd_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(e), vcast_vd_d_rvvm1_sleef(6144)); + qu = vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(t, vcast_vd_d_rvvm1_sleef(1.0/3.0))); + re = vtruncate_vi_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(t, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(qu), vcast_vd_d_rvvm1_sleef(3)))); + + q = vsel_vd_vo_vd_vd_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(re, vcast_vi_i_rvvm1_sleef(1))), vcast_vd_d_rvvm1_sleef(1.2599210498948731647672106), q); + q = vsel_vd_vo_vd_vd_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(re, vcast_vi_i_rvvm1_sleef(2))), vcast_vd_d_rvvm1_sleef(1.5874010519681994747517056), q); + q = vldexp2_vd_vd_vi_rvvm1_sleef(q, vsub_vi_vi_vi_rvvm1_sleef(qu, vcast_vi_i_rvvm1_sleef(2048))); + + q = vmulsign_vd_vd_vd_rvvm1_sleef(q, d); + + d = vabs_vd_vd_rvvm1_sleef(d); + + x = vcast_vd_d_rvvm1_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_rvvm1_sleef(x, x); y = vmul_vd_vd_vd_rvvm1_sleef(y, y); x = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vmlapn_vd_vd_vd_vd_rvvm1_sleef(d, y, x), vcast_vd_d_rvvm1_sleef(1.0 / 3.0))); + y = vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, x), x); + y = vmul_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(y, vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2.0 / 3.0), y), vmla_vd_vd_vd_vd_rvvm1_sleef(y, x, vcast_vd_d_rvvm1_sleef(-1.0)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_cbrtdx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef x, y, z, t; + vdouble2_rvvm1_sleef q2 = vcast_vd2_d_d_rvvm1_sleef(1, 0), u, v; + vint_rvvm1_sleef e, qu, re; + + e = vadd_vi_vi_vi_rvvm1_sleef(vilogbk_vi_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d)), vcast_vi_i_rvvm1_sleef(1)); + d = vldexp2_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + + t = vadd_vd_vd_vd_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(e), vcast_vd_d_rvvm1_sleef(6144)); + qu = vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(t, vcast_vd_d_rvvm1_sleef(1.0/3.0))); + re = vtruncate_vi_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(t, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(qu), vcast_vd_d_rvvm1_sleef(3)))); + + q2 = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(re, vcast_vi_i_rvvm1_sleef(1))), vcast_vd2_d_d_rvvm1_sleef(1.2599210498948731907, -2.5899333753005069177e-17), q2); + q2 = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(vcast_vo64_vo32_rvvm1_sleef(veq_vo_vi_vi_rvvm1_sleef(re, vcast_vi_i_rvvm1_sleef(2))), vcast_vd2_d_d_rvvm1_sleef(1.5874010519681995834, -1.0869008194197822986e-16), q2); + + q2 = vd2setxy_vd2_vd_vd_rvvm1_sleef(vmulsign_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(q2), d), vmulsign_vd_vd_vd_rvvm1_sleef(vd2gety_vd_vd2_rvvm1_sleef(q2), d)); + d = vabs_vd_vd_rvvm1_sleef(d); + + x = vcast_vd_d_rvvm1_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_rvvm1_sleef(x, d, vcast_vd_d_rvvm1_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_rvvm1_sleef(x, x); y = vmul_vd_vd_vd_rvvm1_sleef(y, y); x = vsub_vd_vd_vd_rvvm1_sleef(x, vmul_vd_vd_vd_rvvm1_sleef(vmlapn_vd_vd_vd_vd_rvvm1_sleef(d, y, x), vcast_vd_d_rvvm1_sleef(1.0 / 3.0))); + + z = x; + + u = ddmul_vd2_vd_vd_rvvm1_sleef(x, x); + u = ddmul_vd2_vd2_vd2_rvvm1_sleef(u, u); + u = ddmul_vd2_vd2_vd_rvvm1_sleef(u, d); + u = ddadd2_vd2_vd2_vd_rvvm1_sleef(u, vneg_vd_vd_rvvm1_sleef(x)); + y = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(u), vd2gety_vd_vd2_rvvm1_sleef(u)); + + y = vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-2.0 / 3.0), y), z); + v = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd_vd_rvvm1_sleef(z, z), y); + v = ddmul_vd2_vd2_vd_rvvm1_sleef(v, d); + v = ddmul_vd2_vd2_vd2_rvvm1_sleef(v, q2); + z = vldexp2_vd_vd_vi_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(v), vd2gety_vd_vd2_rvvm1_sleef(v)), vsub_vi_vi_vi_rvvm1_sleef(qu, vcast_vi_i_rvvm1_sleef(2048))); + + z = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(d), vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(__builtin_inf()), vd2getx_vd_vd2_rvvm1_sleef(q2)), z); + z = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vreinterpret_vd_vm_rvvm1_sleef(vsignbit_vm_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(q2))), z); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_exp2dx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(d), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vsub_vd_vd_vd_rvvm1_sleef(d, u); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_rvvm1_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_rvvm1_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_rvvm1_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_rvvm1_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_rvvm1_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.6931471805599452862e+0)); + + u = vfma_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1)); + + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vge_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1024)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-2000)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_exp2dx_u35rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(d), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vsub_vd_vd_vd_rvvm1_sleef(d, u); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_rvvm1_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_rvvm1_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_rvvm1_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_rvvm1_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_rvvm1_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.6931471805599452862e+0)); + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1)); + + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vge_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1024)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-2000)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_exp10dx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-1.4205023227266099418e-13), s); + + u = vcast_vd_d_rvvm1_sleef(+0.2411463498334267652e-3); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1157488415217187375e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.5013975546789733659e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1959762320720533080e-1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.6808936399446784138e-1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.2069958494722676234e+0)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.5393829292058536229e+0)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.1171255148908541655e+1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.2034678592293432953e+1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.2650949055239205876e+1)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(+0.2302585092994045901e+1)); + + u = vfma_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1)); + + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(308.25471555991671)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-350)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_exp10dx_u35rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef u = vrint_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_rvvm1_sleef q = vrint_vi_vd_rvvm1_sleef(u); + + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_rvvm1_sleef(u, vcast_vd_d_rvvm1_sleef(-1.4205023227266099418e-13), s); + + vdouble_rvvm1_sleef s2 = vmul_vd_vd_vd_rvvm1_sleef(s, s), s4 = vmul_vd_vd_vd_rvvm1_sleef(s2, s2), s8 = vmul_vd_vd_vd_rvvm1_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_rvvm1_sleef((s8), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vcast_vd_d_rvvm1_sleef(+0.2411463498334267652e-3)), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1157488415217187375e-2)), (vcast_vd_d_rvvm1_sleef(+0.5013975546789733659e-2)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s4), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1959762320720533080e-1)), (vcast_vd_d_rvvm1_sleef(+0.6808936399446784138e-1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.2069958494722676234e+0)), (vcast_vd_d_rvvm1_sleef(+0.5393829292058536229e+0)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s2), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.1171255148908541655e+1)), (vcast_vd_d_rvvm1_sleef(+0.2034678592293432953e+1)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((s), (vcast_vd_d_rvvm1_sleef(+0.2650949055239205876e+1)), (vcast_vd_d_rvvm1_sleef(+0.2302585092994045901e+1))))))))) + + ; + + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, s, vcast_vd_d_rvvm1_sleef(1)); + + u = vldexp2_vd_vd_vi_rvvm1_sleef(u, q); + + u = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(308.25471555991671)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_rvvm1_sleef(vandnot_vm_vo64_vm_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-350)), vreinterpret_vm_vd_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_expm1dx_u10rvvm1(vdouble_rvvm1_sleef a) { + vdouble2_rvvm1_sleef d = ddadd2_vd2_vd2_vd_rvvm1_sleef(expk2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0))), vcast_vd_d_rvvm1_sleef(-1.0)); + vdouble_rvvm1_sleef x = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(d), vd2gety_vd_vd2_rvvm1_sleef(d)); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(709.782712893383996732223)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(-36.736800569677101399113302437)), vcast_vd_d_rvvm1_sleef(-1), x); + x = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(a), vcast_vd_d_rvvm1_sleef(-0.0), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_log10dx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x; + vdouble_rvvm1_sleef t, m, x2; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), m), ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), m)); + x2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(+0.6653725819576758460e-1)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.6625722782820833712e-1)), (vcast_vd_d_rvvm1_sleef(+0.7898105214313944078e-1)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.9650955035715275132e-1)), (vcast_vd_d_rvvm1_sleef(+0.1240841409721444993e+0)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.1737177927454605086e+0)), (vcast_vd_d_rvvm1_sleef(+0.2895296546021972617e+0))))))) + + ; + + vdouble2_rvvm1_sleef s = ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.30102999566398119802, -2.803728127785170339e-18), vcast_vd_vi_rvvm1_sleef(e)); + + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddmul_vd2_vd2_vd2_rvvm1_sleef(x, vcast_vd2_d_d_rvvm1_sleef(0.86858896380650363334, 1.1430059694096389311e-17))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x)), t)); + + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vispinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_log2dx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x; + vdouble_rvvm1_sleef t, m, x2; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), m), ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), m)); + x2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(+0.2211941750456081490e+0)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.2200768693152277689e+0)), (vcast_vd_d_rvvm1_sleef(+0.2623708057488514656e+0)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.3205977477944495502e+0)), (vcast_vd_d_rvvm1_sleef(+0.4121985945485324709e+0)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(+0.5770780162997058982e+0)), (vcast_vd_d_rvvm1_sleef(+0.96179669392608091449))))))) + + ; + + vdouble2_rvvm1_sleef s = ddadd2_vd2_vd_vd2_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(e), + ddmul_vd2_vd2_vd2_rvvm1_sleef(x, vcast_vd2_d_d_rvvm1_sleef(2.885390081777926774, 6.0561604995516736434e-18))); + + s = ddadd2_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x)), t)); + + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vispinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_log2dx_u35rvvm1(vdouble_rvvm1_sleef d) { + vdouble_rvvm1_sleef m, t, x, x2; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_rvvm1_sleef(d, vneg_vi_vi_rvvm1_sleef(e)); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + + x = vdiv_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(1)), vadd_vd_vd_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(1))); + x2 = vmul_vd_vd_vd_rvvm1_sleef(x, x); + + t = vcast_vd_d_rvvm1_sleef(+0.2211941750456081490e+0); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.2200768693152277689e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.2623708057488514656e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.3205977477944495502e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.4121985945485324709e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.5770780162997058982e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, x2, vcast_vd_d_rvvm1_sleef(+0.96179669392608091449 )); + + vdouble2_rvvm1_sleef s = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_vi_rvvm1_sleef(e), + ddmul_vd2_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2.885390081777926774))); + + vdouble_rvvm1_sleef r = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vmul_vd_vd_vd_rvvm1_sleef(x, x2), vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s))); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vispinf_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_log1pdx_u10rvvm1(vdouble_rvvm1_sleef d) { + vdouble2_rvvm1_sleef x; + vdouble_rvvm1_sleef t, m, x2; + + vdouble_rvvm1_sleef dp1 = vadd_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1)); + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(dp1, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + dp1 = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(dp1, vcast_vd_d_rvvm1_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), dp1); + vint_rvvm1_sleef e = vilogb2k_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(dp1, vcast_vd_d_rvvm1_sleef(1.0/0.75))); + t = vldexp3_vd_vd_vi_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vneg_vi_vi_rvvm1_sleef(e)); + m = vmla_vd_vd_vd_vd_rvvm1_sleef(d, t, vsub_vd_vd_vd_rvvm1_sleef(t, vcast_vd_d_rvvm1_sleef(1))); + e = vsel_vi_vo_vi_vi_rvvm1_sleef(vcast_vo32_vo64_rvvm1_sleef(o), vsub_vi_vi_vi_rvvm1_sleef(e, vcast_vi_i_rvvm1_sleef(64)), e); + vdouble2_rvvm1_sleef s = ddmul_vd2_vd2_vd_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_rvvm1_sleef(e)); + + x = dddiv_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(m, vcast_vd_d_rvvm1_sleef(0)), ddadd_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), m)); + x2 = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2getx_vd_vd2_rvvm1_sleef(x)); + + vdouble_rvvm1_sleef x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2), x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.1525629051003428716e+0)), (vcast_vd_d_rvvm1_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.2222214519839380009e+0)), (vcast_vd_d_rvvm1_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vcast_vd_d_rvvm1_sleef(0.3999999999635251990e+0)), (vcast_vd_d_rvvm1_sleef(0.6666666666667333541e+0))))))) + + ; + + s = ddadd_vd2_vd2_vd2_rvvm1_sleef(s, ddscale_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2))); + s = ddadd_vd2_vd2_vd_rvvm1_sleef(s, vmul_vd_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x2, vd2getx_vd_vd2_rvvm1_sleef(x)), t)); + + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(s), vd2gety_vd_vd2_rvvm1_sleef(s)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1e+307)), vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-1)), visnan_vo_vd_rvvm1_sleef(d)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(-1)), vcast_vd_d_rvvm1_sleef(-__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visnegzero_vo_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(-0.0), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fabsdx_rvvm1(vdouble_rvvm1_sleef x) { return vabs_vd_vd_rvvm1_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_copysigndx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { return vcopysign_vd_vd_vd_rvvm1_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fmaxdx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + + return vsel_vd_vo_vd_vd_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(y), x, vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fmindx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + + return vsel_vd_vo_vd_vd_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(y), x, vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fdimdx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef ret = vsub_vd_vd_vd_rvvm1_sleef(x, y); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(ret, vcast_vd_d_rvvm1_sleef(0)), veq_vo_vd_vd_rvvm1_sleef(x, y)), vcast_vd_d_rvvm1_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_truncdx_rvvm1(vdouble_rvvm1_sleef x) { return vtruncate2_vd_vd_rvvm1_sleef_rvvm1_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_floordx_rvvm1(vdouble_rvvm1_sleef x) { return vfloor2_vd_vd_rvvm1_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_ceildx_rvvm1(vdouble_rvvm1_sleef x) { return vceil2_vd_vd_rvvm1_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_rounddx_rvvm1(vdouble_rvvm1_sleef x) { return vround2_vd_vd_rvvm1_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_rintdx_rvvm1(vdouble_rvvm1_sleef x) { return vrint2_vd_vd_rvvm1_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_nextafterdx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + x = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0), y), x); + vmask_rvvm1_sleef xi2 = vreinterpret_vm_vd_rvvm1_sleef(x); + rvv_dp_vopmask_rvvm1_sleef c = rvv_dp_vxor_vo_vo_vo(vsignbit_vo_vd_rvvm1_sleef(x), vge_vo_vd_vd_rvvm1_sleef(y, x)); + + xi2 = vsel_vm_vo64_vm_vm_rvvm1_sleef(c, vneg64_vm_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(xi2, vcast_vm_i_i_rvvm1_sleef((int)(1U << 31), 0))), xi2); + + xi2 = vsel_vm_vo64_vm_vm_rvvm1_sleef(vneq_vo_vd_vd_rvvm1_sleef(x, y), vsub64_vm_vm_vm_rvvm1_sleef(xi2, vcast_vm_i_i_rvvm1_sleef(0, 1)), xi2); + + xi2 = vsel_vm_vo64_vm_vm_rvvm1_sleef(c, vneg64_vm_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(xi2, vcast_vm_i_i_rvvm1_sleef((int)(1U << 31), 0))), xi2); + + vdouble_rvvm1_sleef ret = vreinterpret_vd_vm_rvvm1_sleef(xi2); + + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vand_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(ret, vcast_vd_d_rvvm1_sleef(0)), vneq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0))), + vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0), x), ret); + + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vand_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(0))), y, ret); + + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_frfrexpdx_rvvm1(vdouble_rvvm1_sleef x) { + x = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(0x1p-1022)), vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 63)), x); + + vmask_rvvm1_sleef xm = vreinterpret_vm_vd_rvvm1_sleef(x); + xm = vand_vm_vm_vm_rvvm1_sleef(xm, vcast_vm_i64_rvvm1_sleef(~INT64_C(0x7ff0000000000000))); + xm = vor_vm_vm_vm_rvvm1_sleef (xm, vcast_vm_i64_rvvm1_sleef( INT64_C(0x3fe0000000000000))); + + vdouble_rvvm1_sleef ret = vreinterpret_vd_vm_rvvm1_sleef(xm); + + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(x), vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(__builtin_inf()), x), ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint_rvvm1_sleef Sleef_expfrexpdx_rvvm1(vdouble_rvvm1_sleef x) { + x = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(0x1p-1022)), vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 63)), x); + + vint_rvvm1_sleef ret = vcastu_vi_vm_rvvm1_sleef(vreinterpret_vm_vd_rvvm1_sleef(x)); + ret = vsub_vi_vi_vi_rvvm1_sleef(vand_vi_vi_vi_rvvm1_sleef(vsrl_vi_vi_i_rvvm1_sleef(ret, 20), vcast_vi_i_rvvm1_sleef(0x7ff)), vcast_vi_i_rvvm1_sleef(0x3fe)); + + ret = vsel_vi_vo_vi_vi_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(0)), visnan_vo_vd_rvvm1_sleef(x)), visinf_vo_vd_rvvm1_sleef(x)), vcast_vi_i_rvvm1_sleef(0), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fmadx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y, vdouble_rvvm1_sleef z) { + + return vfma_vd_vd_vd_vd_rvvm1_sleef(x, y, z); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sqrtdx_u05rvvm1(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef q, w, x, y, z; + + d = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), d); + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(8.636168555094445E-78)); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.157920892373162E77)), d); + q = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vcast_vd_d_rvvm1_sleef(2.9387358770557188E-39), vcast_vd_d_rvvm1_sleef(1)); + + y = vreinterpret_vd_vm_rvvm1_sleef(vsub64_vm_vm_vm_rvvm1_sleef(vcast_vm_i_i_rvvm1_sleef(0x5fe6ec85, 0xe7de30da), vsrl64_vm_vm_i(vreinterpret_vm_vd_rvvm1_sleef(d), 1))); + + x = vmul_vd_vd_vd_rvvm1_sleef(d, y); w = vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), y); + y = vfmanp_vd_vd_vd_vd_rvvm1_sleef(x, w, vcast_vd_d_rvvm1_sleef(0.5)); + x = vfma_vd_vd_vd_vd_rvvm1_sleef(x, y, x); w = vfma_vd_vd_vd_vd_rvvm1_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_rvvm1_sleef(x, w, vcast_vd_d_rvvm1_sleef(0.5)); + x = vfma_vd_vd_vd_vd_rvvm1_sleef(x, y, x); w = vfma_vd_vd_vd_vd_rvvm1_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_rvvm1_sleef(x, w, vcast_vd_d_rvvm1_sleef(0.5)); + x = vfma_vd_vd_vd_vd_rvvm1_sleef(x, y, x); w = vfma_vd_vd_vd_vd_rvvm1_sleef(w, y, w); + + y = vfmanp_vd_vd_vd_vd_rvvm1_sleef(x, w, vcast_vd_d_rvvm1_sleef(1.5)); w = vadd_vd_vd_vd_rvvm1_sleef(w, w); + w = vmul_vd_vd_vd_rvvm1_sleef(w, y); + x = vmul_vd_vd_vd_rvvm1_sleef(w, d); + y = vfmapn_vd_vd_vd_vd_rvvm1_sleef(w, d, x); z = vfmanp_vd_vd_vd_vd_rvvm1_sleef(w, x, vcast_vd_d_rvvm1_sleef(1)); + + z = vfmanp_vd_vd_vd_vd_rvvm1_sleef(w, y, z); w = vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), x); + w = vfma_vd_vd_vd_vd_rvvm1_sleef(w, z, y); + w = vadd_vd_vd_vd_rvvm1_sleef(w, x); + + w = vmul_vd_vd_vd_rvvm1_sleef(w, q); + + w = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), + veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(__builtin_inf()))), d, w); + + w = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sqrtdx_rvvm1(vdouble_rvvm1_sleef d) { + + return Sleef_sqrtdx_u05rvvm1(d); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_sqrtdx_u35rvvm1(vdouble_rvvm1_sleef d) { return Sleef_sqrtdx_u05rvvm1(d); } + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_hypotdx_u05rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + x = vabs_vd_vd_rvvm1_sleef(x); + y = vabs_vd_vd_rvvm1_sleef(y); + vdouble_rvvm1_sleef min = vmin_vd_vd_vd_rvvm1_sleef(x, y), n = min; + vdouble_rvvm1_sleef max = vmax_vd_vd_vd_rvvm1_sleef(x, y), d = max; + + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(max, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), d); + + vdouble2_rvvm1_sleef t = dddiv_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(0)), vcast_vd2_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0))); + t = ddmul_vd2_vd2_vd_rvvm1_sleef(ddsqrt_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(ddsqu_vd2_vd2_rvvm1_sleef(t), vcast_vd_d_rvvm1_sleef(1))), max); + vdouble_rvvm1_sleef ret = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t), vd2gety_vd_vd2_rvvm1_sleef(t)); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(ret), vcast_vd_d_rvvm1_sleef(__builtin_inf()), ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(min, vcast_vd_d_rvvm1_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(__builtin_inf())), veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(__builtin_inf()))), vcast_vd_d_rvvm1_sleef(__builtin_inf()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_hypotdx_u35rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + x = vabs_vd_vd_rvvm1_sleef(x); + y = vabs_vd_vd_rvvm1_sleef(y); + vdouble_rvvm1_sleef min = vmin_vd_vd_vd_rvvm1_sleef(x, y); + vdouble_rvvm1_sleef max = vmax_vd_vd_vd_rvvm1_sleef(x, y); + + vdouble_rvvm1_sleef t = vdiv_vd_vd_vd_rvvm1_sleef(min, max); + vdouble_rvvm1_sleef ret = vmul_vd_vd_vd_rvvm1_sleef(max, vsqrt_vd_vd_rvvm1_sleef(vmla_vd_vd_vd_vd_rvvm1_sleef(t, t, vcast_vd_d_rvvm1_sleef(1)))); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(min, vcast_vd_d_rvvm1_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(visnan_vo_vd_rvvm1_sleef(x), visnan_vo_vd_rvvm1_sleef(y)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(__builtin_inf())), veq_vo_vd_vd_rvvm1_sleef(y, vcast_vd_d_rvvm1_sleef(__builtin_inf()))), vcast_vd_d_rvvm1_sleef(__builtin_inf()), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_rvvm1_sleef vptrunc_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef x) { + + vdouble_rvvm1_sleef fr = vmla_vd_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-(double)(INT64_C(1) << 31)), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 31))))), x); + fr = vsub_vd_vd_vd_rvvm1_sleef(fr, vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(fr))); + return vsel_vd_vo_vd_vd_rvvm1_sleef(vge_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), x, vsub_vd_vd_vd_rvvm1_sleef(x, fr)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_fmoddx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef n = vabs_vd_vd_rvvm1_sleef(x), d = vabs_vd_vd_rvvm1_sleef(y), s = vcast_vd_d_rvvm1_sleef(1), q; + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(s , vcast_vd_d_rvvm1_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble2_rvvm1_sleef r = vcast_vd2_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(0)); + vdouble_rvvm1_sleef rd = vtoward0_vd_vd_rvvm1_sleef(vrec_vd_vd_rvvm1_sleef(d)); + + for(int i=0;i<21;i++) { + q = vptrunc_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vtoward0_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r)), rd)); + + q = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vand_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(3), d), vd2getx_vd_vd2_rvvm1_sleef(r)), + vge_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), d)), + vcast_vd_d_rvvm1_sleef(2), q); + q = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vand_vo_vo_vo(vgt_vo_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(d, d), vd2getx_vd_vd2_rvvm1_sleef(r)), + vge_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), d)), + vcast_vd_d_rvvm1_sleef(1), q); + r = ddnormalize_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd2_rvvm1_sleef(r, ddmul_vd2_vd_vd_rvvm1_sleef(q, vneg_vd_vd_rvvm1_sleef(d)))); + if (vtestallones_i_vo64_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), d))) break; + } + + vdouble_rvvm1_sleef ret = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), s); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), vd2gety_vd_vd2_rvvm1_sleef(r)), d), vcast_vd_d_rvvm1_sleef(0), ret); + + ret = vmulsign_vd_vd_vd_rvvm1_sleef(ret, x); + + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(n, d), x, ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE vdouble_rvvm1_sleef vrintk2_vd_vd_rvvm1_sleef(vdouble_rvvm1_sleef d) { + + vdouble_rvvm1_sleef c = vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52), d); + return vsel_vd_vo_vd_vd_rvvm1_sleef(vgt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(d), vcast_vd_d_rvvm1_sleef(INT64_C(1) << 52)), + d, vorsign_vd_vd_vd_rvvm1_sleef(vsub_vd_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(d, c), c), d)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_remainderdx_rvvm1(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef y) { + vdouble_rvvm1_sleef n = vabs_vd_vd_rvvm1_sleef(x), d = vabs_vd_vd_rvvm1_sleef(y), s = vcast_vd_d_rvvm1_sleef(1), q; + rvv_dp_vopmask_rvvm1_sleef o = vlt_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0x1p-1022*2)); + n = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmul_vd_vd_vd_rvvm1_sleef(s , vcast_vd_d_rvvm1_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble_rvvm1_sleef rd = vrec_vd_vd_rvvm1_sleef(d); + vdouble2_rvvm1_sleef r = vcast_vd2_vd_vd_rvvm1_sleef(n, vcast_vd_d_rvvm1_sleef(0)); + rvv_dp_vopmask_rvvm1_sleef qisodd = vneq_vo_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0), vcast_vd_d_rvvm1_sleef(0)); + + for(int i=0;i<21;i++) { + q = vrintk2_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), rd)); + + q = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r)), vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(1.5))), vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1.0), vd2getx_vd_vd2_rvvm1_sleef(r)), q); + q = vsel_vd_vo_vd_vd_rvvm1_sleef(rvv_dp_vor_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r)), vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.5))), + rvv_dp_vandnot_vo_vo_vo(qisodd, veq_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r)), vmul_vd_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0.5))))), + vcast_vd_d_rvvm1_sleef(0.0), q); + if (vtestallones_i_vo64_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(q, vcast_vd_d_rvvm1_sleef(0)))) break; + q = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(q, vneg_vd_vd_rvvm1_sleef(d))), vadd_vd_vd_vd_rvvm1_sleef(q, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(-1), vd2getx_vd_vd2_rvvm1_sleef(r))), q); + qisodd = rvv_dp_vxor_vo_vo_vo(qisodd, visodd_vo_vd_rvvm1_sleef(q)); + r = ddnormalize_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd2_rvvm1_sleef(r, ddmul_vd2_vd_vd_rvvm1_sleef(q, vneg_vd_vd_rvvm1_sleef(d)))); + } + + vdouble_rvvm1_sleef ret = vmul_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(r), s); + ret = vmulsign_vd_vd_vd_rvvm1_sleef(ret, x); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(y), vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), x), ret); + ret = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(d, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), ret); + return ret; +} + +static SLEEF_CONST dd2_rvvm1_sleef gammak_rvvm1_sleef(vdouble_rvvm1_sleef a) { + vdouble2_rvvm1_sleef clc = vcast_vd2_d_d_rvvm1_sleef(0, 0), clln = vcast_vd2_d_d_rvvm1_sleef(1, 0), clld = vcast_vd2_d_d_rvvm1_sleef(1, 0); + vdouble2_rvvm1_sleef x, y, z; + vdouble_rvvm1_sleef t, u; + + rvv_dp_vopmask_rvvm1_sleef otiny = vlt_vo_vd_vd_rvvm1_sleef(vabs_vd_vd_rvvm1_sleef(a), vcast_vd_d_rvvm1_sleef(1e-306)), oref = vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0.5)); + + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(otiny, vcast_vd2_d_d_rvvm1_sleef(0, 0), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(oref, ddadd2_vd2_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), vneg_vd_vd_rvvm1_sleef(a)), + vcast_vd2_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)))); + + rvv_dp_vopmask_rvvm1_sleef o0 = rvv_dp_vand_vo_vo_vo(vle_vo_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(0.5), vd2getx_vd_vd2_rvvm1_sleef(x)), vle_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(1.1))); + rvv_dp_vopmask_rvvm1_sleef o2 = vle_vo_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2.3), vd2getx_vd_vd2_rvvm1_sleef(x)); + + y = ddnormalize_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1)), x)); + y = ddnormalize_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2)), y)); + y = ddnormalize_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(3)), y)); + y = ddnormalize_vd2_vd2_rvvm1_sleef(ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(4)), y)); + + rvv_dp_vopmask_rvvm1_sleef o = rvv_dp_vand_vo_vo_vo(o2, vle_vo_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vcast_vd_d_rvvm1_sleef(7))); + clln = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, y, clln); + + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o, ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(5)), x); + + t = vsel_vd_vo_vd_vd_rvvm1_sleef(o2, vrec_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x)), vd2getx_vd_vd2_rvvm1_sleef(ddnormalize_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vsel_vd_vo_d_d_rvvm1_sleef(o0, -1, -2))))); + + u = vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -156.801412704022726379848862, +0.2947916772827614196e+2, +0.7074816000864609279e-7); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +1.120804464289911606838558160000, +0.1281459691827820109e+3, +0.4009244333008730443e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +13.39798545514258921833306020000, +0.2617544025784515043e+3, +0.1040114641628246946e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.116546276599463200848033357000, +0.3287022855685790432e+3, +0.1508349150733329167e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -1.391801093265337481495562410000, +0.2818145867730348186e+3, +0.1288143074933901020e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.015056113040026424412918973400, +0.1728670414673559605e+3, +0.4744167749884993937e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.179540117061234856098844714000, +0.7748735764030416817e+2, -0.6554816306542489902e-7)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.002481743600264997730942489280, +0.2512856643080930752e+2, -0.3189252471452599844e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.029527880945699120504851034100, +0.5766792106140076868e+1, +0.1358883821470355377e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.000540164767892604515196325186, +0.7270275473996180571e+0, -0.4343931277157336040e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.006403362833808069794787256200, +0.8396709124579147809e-1, +0.9724785897406779555e-6)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.000162516262783915816896611252, -0.8211558669746804595e-1, -0.2036886057225966011e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.001914438498565477526465972390, +0.6828831828341884458e-1, +0.4373363141819725815e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +7.20489541602001055898311517e-05, -0.7712481339961671511e-1, -0.9439951268304008677e-5)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.000839498720672087279971000786, +0.8337492023017314957e-1, +0.2050727030376389804e-4)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -5.17179090826059219329394422e-05, -0.9094964931456242518e-1, -0.4492620183431184018e-4)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.000592166437353693882857342347, +0.1000996313575929358e+0, +0.9945751236071875931e-4)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.1113342861544207724e+0, -0.2231547599034983196e-3)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.000784039221720066627493314301, +0.1255096673213020875e+0, +0.5096695247101967622e-3)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.000229472093621399176949318732, -0.1440498967843054368e+0, -0.1192753911667886971e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, -0.002681327160493827160473958490, +0.1695571770041949811e+0, +0.2890510330742210310e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.003472222222222222222175164840, -0.2073855510284092762e+0, -0.7385551028674461858e-2)); + u = vmla_vd_vd_vd_vd_rvvm1_sleef(u, t, vsel_vd_vo_vo_d_d_d_rvvm1_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705808084277815939e+0, +0.2058080842778455335e-1)); + + y = ddmul_vd2_vd2_vd2_rvvm1_sleef(ddadd2_vd2_vd2_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(-0.5)), logk2_rvvm1_sleef(x)); + y = ddadd2_vd2_vd2_vd2_rvvm1_sleef(y, ddneg_vd2_vd2_rvvm1_sleef(x)); + y = ddadd2_vd2_vd2_vd2_rvvm1_sleef(y, vcast_vd2_d_d_rvvm1_sleef(0.91893853320467278056, -3.8782941580672414498e-17)); + + z = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd_vd_rvvm1_sleef (u, t), vsel_vd_vo_d_d_rvvm1_sleef(o0, -0.4006856343865314862e+0, -0.6735230105319810201e-1)); + z = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd_rvvm1_sleef(z, t), vsel_vd_vo_d_d_rvvm1_sleef(o0, +0.8224670334241132030e+0, +0.3224670334241132030e+0)); + z = ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd2_vd_rvvm1_sleef(z, t), vsel_vd_vo_d_d_rvvm1_sleef(o0, -0.5772156649015328655e+0, +0.4227843350984671345e+0)); + z = ddmul_vd2_vd2_vd_rvvm1_sleef(z, t); + + clc = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o2, y, z); + + clld = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o2, ddadd2_vd2_vd2_vd_rvvm1_sleef(ddmul_vd2_vd_vd_rvvm1_sleef(u, t), vcast_vd_d_rvvm1_sleef(1)), clld); + + y = clln; + + clc = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(otiny, vcast_vd2_d_d_rvvm1_sleef(83.1776616671934334590333, 3.67103459631568507221878e-15), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(oref, ddadd2_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(1.1447298858494001639, 1.026595116270782638e-17), ddneg_vd2_vd2_rvvm1_sleef(clc)), clc)); + clln = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(otiny, vcast_vd2_d_d_rvvm1_sleef(1, 0), vsel_vd2_vo_vd2_vd2_rvvm1_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo64_rvvm1_sleef(vnot_vo64_vo64_rvvm1_sleef(oref))) { + t = vsub_vd_vd_vd_rvvm1_sleef(a, vmul_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(INT64_C(1) << 28), vcast_vd_vi_rvvm1_sleef(vtruncate_vi_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(1.0 / (INT64_C(1) << 28))))))); + x = ddmul_vd2_vd2_vd2_rvvm1_sleef(clld, sinpik_rvvm1_sleef(t)); + } + + clld = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(otiny, vcast_vd2_vd_vd_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef((INT64_C(1) << 60)*(double)(INT64_C(1) << 60))), vcast_vd_d_rvvm1_sleef(0)), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(oref, x, y)); + + return dd2setab_dd2_vd2_vd2_rvvm1_sleef(clc, dddiv_vd2_vd2_vd2_rvvm1_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_tgammadx_u10rvvm1(vdouble_rvvm1_sleef a) { + dd2_rvvm1_sleef d = gammak_rvvm1_sleef(a); + vdouble2_rvvm1_sleef y = ddmul_vd2_vd2_vd2_rvvm1_sleef(expk2_rvvm1_sleef(dd2geta_vd2_dd2_rvvm1_sleef(d)), dd2getb_vd2_dd2_rvvm1_sleef(d)); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(y)); + rvv_dp_vopmask_rvvm1_sleef o; + + o = rvv_dp_vor_vo_vo_vo(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(-__builtin_inf())), + rvv_dp_vand_vo_vo_vo(vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)), visint_vo_vd_rvvm1_sleef(a))), + rvv_dp_vand_vo_vo_vo(rvv_dp_vand_vo_vo_vo(visnumber_vo_vd_rvvm1_sleef(a), vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0))), visnan_vo_vd_rvvm1_sleef(r))); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + + o = rvv_dp_vand_vo_vo_vo(rvv_dp_vand_vo_vo_vo(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(__builtin_inf())), visnumber_vo_vd_rvvm1_sleef(a)), + vge_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(-0x1p-1022))), + rvv_dp_vor_vo_vo_vo(rvv_dp_vor_vo_vo_vo(veq_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)), vgt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(200))), visnan_vo_vd_rvvm1_sleef(r))); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vmulsign_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(__builtin_inf()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_lgammadx_u10rvvm1(vdouble_rvvm1_sleef a) { + dd2_rvvm1_sleef d = gammak_rvvm1_sleef(a); + vdouble2_rvvm1_sleef y = ddadd2_vd2_vd2_vd2_rvvm1_sleef(dd2geta_vd2_dd2_rvvm1_sleef(d), logk2_rvvm1_sleef(ddabs_vd2_vd2_rvvm1_sleef(dd2getb_vd2_dd2_rvvm1_sleef(d)))); + vdouble_rvvm1_sleef r = vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(y), vd2gety_vd_vd2_rvvm1_sleef(y)); + rvv_dp_vopmask_rvvm1_sleef o; + + o = rvv_dp_vor_vo_vo_vo(visinf_vo_vd_rvvm1_sleef(a), + rvv_dp_vor_vo_vo_vo(rvv_dp_vand_vo_vo_vo(vle_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)), visint_vo_vd_rvvm1_sleef(a)), + rvv_dp_vand_vo_vo_vo(visnumber_vo_vd_rvvm1_sleef(a), visnan_vo_vd_rvvm1_sleef(r)))); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(o, vcast_vd_d_rvvm1_sleef(__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef ddmla_vd2_vd_vd2_vd2_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble2_rvvm1_sleef y, vdouble2_rvvm1_sleef z) { + return ddadd_vd2_vd2_vd2_rvvm1_sleef(z, ddmul_vd2_vd2_vd_rvvm1_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef poly2dd_b_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble2_rvvm1_sleef c1, vdouble2_rvvm1_sleef c0) { return ddmla_vd2_vd_vd2_vd2_rvvm1_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef poly2dd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef c1, vdouble2_rvvm1_sleef c0) { return ddmla_vd2_vd_vd2_vd2_rvvm1_sleef(x, vcast_vd2_vd_vd_rvvm1_sleef(c1, vcast_vd_d_rvvm1_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_rvvm1_sleef poly4dd_rvvm1_sleef(vdouble_rvvm1_sleef x, vdouble_rvvm1_sleef c3, vdouble2_rvvm1_sleef c2, vdouble2_rvvm1_sleef c1, vdouble2_rvvm1_sleef c0) { + return ddmla_vd2_vd_vd2_vd2_rvvm1_sleef(vmul_vd_vd_vd_rvvm1_sleef(x, x), poly2dd_rvvm1_sleef(x, c3, c2), poly2dd_b_rvvm1_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_erfdx_u10rvvm1(vdouble_rvvm1_sleef a) { + vdouble_rvvm1_sleef t, x = vabs_vd_vd_rvvm1_sleef(a); + vdouble2_rvvm1_sleef t2; + vdouble_rvvm1_sleef x2 = vmul_vd_vd_vd_rvvm1_sleef(x, x), x4 = vmul_vd_vd_vd_rvvm1_sleef(x2, x2); + vdouble_rvvm1_sleef x8 = vmul_vd_vd_vd_rvvm1_sleef(x4, x4), x16 = vmul_vd_vd_vd_rvvm1_sleef(x8, x8); + rvv_dp_vopmask_rvvm1_sleef o25 = vle_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo64_rvvm1_sleef(o25)), 1)) { + + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vcast_vd_d_rvvm1_sleef(-0.2083271002525222097e-14)), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.7151909970790897009e-13)), (vcast_vd_d_rvvm1_sleef(-0.1162238220110999364e-11)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.1186474230821585259e-10)), (vcast_vd_d_rvvm1_sleef(-0.8499973178354613440e-10)))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.4507647462598841629e-9)), (vcast_vd_d_rvvm1_sleef(-0.1808044474288848915e-8)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.5435081826716212389e-8)), (vcast_vd_d_rvvm1_sleef(-0.1143939895758628484e-7)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.1215442362680889243e-7)), (vcast_vd_d_rvvm1_sleef(+0.1669878756181250355e-7)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(-0.9808074602255194288e-7)), (vcast_vd_d_rvvm1_sleef(+0.1389000557865837204e-6)))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.2945514529987331866e-6)), (vcast_vd_d_rvvm1_sleef(-0.1842918273003998283e-5)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.3417987836115362136e-5)), (vcast_vd_d_rvvm1_sleef(+0.3860236356493129101e-5)))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(-0.3309403072749947546e-4)), (vcast_vd_d_rvvm1_sleef(+0.1060862922597579532e-3)))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), (vcast_vd_d_rvvm1_sleef(+0.2323253155213076174e-3)), (vcast_vd_d_rvvm1_sleef(+0.1490149719145544729e-3))))))))))) + + ; + t2 = poly4dd_rvvm1_sleef(x, t, + vcast_vd2_d_d_rvvm1_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_rvvm1_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_rvvm1_sleef(0.07052369794346953491, 9.5846628070792092842e-19)); + t2 = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), ddmul_vd2_vd2_vd_rvvm1_sleef(t2, x)); + t2 = ddsqu_vd2_vd2_rvvm1_sleef(t2); + t2 = ddsqu_vd2_vd2_rvvm1_sleef(t2); + t2 = ddsqu_vd2_vd2_rvvm1_sleef(t2); + t2 = ddsqu_vd2_vd2_rvvm1_sleef(t2); + t2 = ddrec_vd2_vd2_rvvm1_sleef(t2); + } else { + + t = vmla_vd_vd_vd_vd_rvvm1_sleef((x16), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.2083271002525222097e-14, -0.4024015130752621932e-18))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.7151909970790897009e-13, +0.3847193332817048172e-16))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.1162238220110999364e-11, -0.1749316241455644088e-14))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1186474230821585259e-10, +0.5029618322872872715e-13))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.8499973178354613440e-10, -0.1025221466851463164e-11))))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x8), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.4507647462598841629e-9, +0.1573695559331945583e-10))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.1808044474288848915e-8, -0.1884658558040203709e-9))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.5435081826716212389e-8, +0.1798167853032159309e-8))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.1143939895758628484e-7, -0.1380745342355033142e-7))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1215442362680889243e-7, +0.8525705726469103499e-7))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1669878756181250355e-7, -0.4160448058101303405e-6))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.9808074602255194288e-7, +0.1517272660008588485e-5))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1389000557865837204e-6, -0.3341634127317201697e-5))))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x4), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.2945514529987331866e-6, -0.2515023395879724513e-5))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.1842918273003998283e-5, +0.6539731269664907554e-4))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.3417987836115362136e-5, -0.3551065097428388658e-3))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.3860236356493129101e-5, +0.1210736097958368864e-2))))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x2), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, -0.3309403072749947546e-4, -0.2605566912579998680e-2))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1060862922597579532e-3, +0.1252823202436093193e-2))))), (vmla_vd_vd_vd_vd_rvvm1_sleef((x), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.2323253155213076174e-3, +0.1820191395263313222e-1))), ((vsel_vd_vo_d_d_rvvm1_sleef(o25, +0.1490149719145544729e-3, -0.1021557155453465954e+0)))))))))))) + + ; + t2 = poly4dd_rvvm1_sleef(x, t, + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o25, vcast_vd2_d_d_rvvm1_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_rvvm1_sleef(-0.63691044383641748361, -2.4249477526539431839e-17)), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o25, vcast_vd2_d_d_rvvm1_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_rvvm1_sleef(-1.1282926061803961737, -6.2970338860410996505e-17)), + vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o25, vcast_vd2_d_d_rvvm1_sleef(0.07052369794346953491, 9.5846628070792092842e-19), + vcast_vd2_d_d_rvvm1_sleef(-1.2261313785184804967e-05, -5.5329707514490107044e-22))); + vdouble2_rvvm1_sleef s2 = ddadd_vd2_vd_vd2_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(1), ddmul_vd2_vd2_vd_rvvm1_sleef(t2, x)); + s2 = ddsqu_vd2_vd2_rvvm1_sleef(s2); + s2 = ddsqu_vd2_vd2_rvvm1_sleef(s2); + s2 = ddsqu_vd2_vd2_rvvm1_sleef(s2); + s2 = ddsqu_vd2_vd2_rvvm1_sleef(s2); + s2 = ddrec_vd2_vd2_rvvm1_sleef(s2); + t2 = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o25, s2, vcast_vd2_vd_vd_rvvm1_sleef(expk_rvvm1_sleef(t2), vcast_vd_d_rvvm1_sleef(0))); + } + + t2 = ddadd2_vd2_vd2_vd_rvvm1_sleef(t2, vcast_vd_d_rvvm1_sleef(-1)); + + vdouble_rvvm1_sleef z = vneg_vd_vd_rvvm1_sleef(vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(t2), vd2gety_vd_vd2_rvvm1_sleef(t2))); + z = vsel_vd_vo_vd_vd_rvvm1_sleef(vlt_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1e-8)), vmul_vd_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(1.12837916709551262756245475959)), z); + z = vsel_vd_vo_vd_vd_rvvm1_sleef(vge_vo_vd_vd_rvvm1_sleef(x, vcast_vd_d_rvvm1_sleef(6)), vcast_vd_d_rvvm1_sleef(1), z); + z = vsel_vd_vo_vd_vd_rvvm1_sleef(visinf_vo_vd_rvvm1_sleef(a), vcast_vd_d_rvvm1_sleef(1), z); + z = vsel_vd_vo_vd_vd_rvvm1_sleef(veq_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)), vcast_vd_d_rvvm1_sleef(0), z); + z = vmulsign_vd_vd_vd_rvvm1_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_rvvm1_sleef Sleef_erfcdx_u15rvvm1(vdouble_rvvm1_sleef a) { + vdouble_rvvm1_sleef s = a, r = vcast_vd_d_rvvm1_sleef(0), t; + vdouble2_rvvm1_sleef u, d, x; + a = vabs_vd_vd_rvvm1_sleef(a); + rvv_dp_vopmask_rvvm1_sleef o0 = vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(1.0)); + rvv_dp_vopmask_rvvm1_sleef o1 = vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(2.2)); + rvv_dp_vopmask_rvvm1_sleef o2 = vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(4.2)); + rvv_dp_vopmask_rvvm1_sleef o3 = vlt_vo_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(27.3)); + + u = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o0, ddmul_vd2_vd_vd_rvvm1_sleef(a, a), vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o1, vcast_vd2_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0)), dddiv_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(1, 0), vcast_vd2_vd_vd_rvvm1_sleef(a, vcast_vd_d_rvvm1_sleef(0))))); + + t = vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.6801072401395386139e-20, +0.3438010341362585303e-12, -0.5757819536420710449e+2, +0.2334249729638701319e+5); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.2161766247570055669e-18, -0.1237021188160598264e-10, +0.4669289654498104483e+3, -0.4695661044933107769e+5)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.4695919173301595670e-17, +0.2117985839877627852e-09, -0.1796329879461355858e+4, +0.3173403108748643353e+5)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.9049140419888007122e-16, -0.2290560929177369506e-08, +0.4355892193699575728e+4, +0.3242982786959573787e+4)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.1634018903557410728e-14, +0.1748931621698149538e-07, -0.7456258884965764992e+4, -0.2014717999760347811e+5)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.2783485786333451745e-13, -0.9956602606623249195e-07, +0.9553977358167021521e+4, +0.1554006970967118286e+5)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.4463221276786415752e-12, +0.4330010240640327080e-06, -0.9470019905444229153e+4, -0.6150874190563554293e+4)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.6711366622850136563e-11, -0.1435050600991763331e-05, +0.7387344321849855078e+4, +0.1240047765634815732e+4)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.9422759050232662223e-10, +0.3460139479650695662e-05, -0.4557713054166382790e+4, -0.8210325475752699731e+2)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.1229055530100229098e-08, -0.4988908180632898173e-05, +0.2207866967354055305e+4, +0.3242443880839930870e+2)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.1480719281585086512e-07, -0.1308775976326352012e-05, -0.8217975658621754746e+3, -0.2923418863833160586e+2)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.1636584469123399803e-06, +0.2825086540850310103e-04, +0.2268659483507917400e+3, +0.3457461732814383071e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.1646211436588923575e-05, -0.6393913713069986071e-04, -0.4633361260318560682e+2, +0.5489730155952392998e+1)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.1492565035840623511e-04, -0.2566436514695078926e-04, +0.9557380123733945965e+1, +0.1559934132251294134e-2)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.1205533298178967851e-03, +0.5895792375659440364e-03, -0.2958429331939661289e+1, -0.1541741566831520638e+1)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.8548327023450850081e-03, -0.1695715579163588598e-02, +0.1670329508092765480e+0, +0.2823152230558364186e-5)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, +0.5223977625442187932e-02, +0.2089116434918055149e-03, +0.6096615680115419211e+0, +0.6249999184195342838e+0)); + t = vmla_vd_vd_vd_vd_rvvm1_sleef(t, vd2getx_vd_vd2_rvvm1_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.2686617064513125222e-01, +0.1912855949584917753e-01, +0.1059212443193543585e-2, +0.1741749416408701288e-8)); + + d = ddmul_vd2_vd2_vd_rvvm1_sleef(u, t); + d = ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, vcast_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, 0.11283791670955126141, -0.10277263343147646779, -0.50005180473999022439, -0.5000000000258444377), + vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -4.0175691625932118483e-18, -6.2338714083404900225e-18, 2.6362140569041995803e-17, -4.0074044712386992281e-17))); + d = ddmul_vd2_vd2_vd2_rvvm1_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, vcast_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.37612638903183753802, -0.63661976742916359662, 1.601106273924963368e-06, 2.3761973137523364792e-13), + vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, 1.3391897206042552387e-17, 7.6321019159085724662e-18, 1.1974001857764476775e-23, -1.1670076950531026582e-29))); + d = ddmul_vd2_vd2_vd2_rvvm1_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_rvvm1_sleef(d, vcast_vd2_vd_vd_rvvm1_sleef(vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, 1.1283791670955125586, -1.1283791674717296161, -0.57236496645145429341, -0.57236494292470108114), + vsel_vd_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, 1.5335459613165822674e-17, 8.0896847755965377194e-17, 3.0704553245872027258e-17, -2.3984352208056898003e-17))); + + x = ddmul_vd2_vd2_vd_rvvm1_sleef(vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o1, d, vcast_vd2_vd_vd_rvvm1_sleef(vneg_vd_vd_rvvm1_sleef(a), vcast_vd_d_rvvm1_sleef(0))), a); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o1, x, ddadd2_vd2_vd2_vd2_rvvm1_sleef(x, d)); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o0, ddsub_vd2_vd2_vd2_rvvm1_sleef(vcast_vd2_d_d_rvvm1_sleef(1, 0), x), expk2_rvvm1_sleef(x)); + x = vsel_vd2_vo_vd2_vd2_rvvm1_sleef(o1, x, ddmul_vd2_vd2_vd2_rvvm1_sleef(x, u)); + + r = vsel_vd_vo_vd_vd_rvvm1_sleef(o3, vadd_vd_vd_vd_rvvm1_sleef(vd2getx_vd_vd2_rvvm1_sleef(x), vd2gety_vd_vd2_rvvm1_sleef(x)), vcast_vd_d_rvvm1_sleef(0)); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(vsignbit_vo_vd_rvvm1_sleef(s), vsub_vd_vd_vd_rvvm1_sleef(vcast_vd_d_rvvm1_sleef(2), r), r); + r = vsel_vd_vo_vd_vd_rvvm1_sleef(visnan_vo_vd_rvvm1_sleef(s), vcast_vd_d_rvvm1_sleef(__builtin_nan("")), r); + return r; +} + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const float Sleef_rempitabsp[]; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vupper_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return vreinterpret_vf_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), vcast_vi2_i_rvvm1_sleef(0xfffff000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vcast_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef h, vfloat_rvvm1_sleef l) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vcast_vf2_f_f_rvvm1_sleef(float h, float l) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(h), vcast_vf_f_rvvm1_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vcast_vf2_d_rvvm1_sleef(double d) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(d - (float)d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vsel_vf2_vo_vf2_vf2_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef m, vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(m, vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)), vsel_vf_vo_vf_vf_rvvm1_sleef(m, vf2gety_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vsel_vf2_vo_f_f_f_f_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef o, float x1, float y1, float x0, float y0) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_f_f_rvvm1_sleef(o, x1, x0), vsel_vf_vo_f_f_rvvm1_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vsel_vf2_vo_vo_d_d_d_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef o0, rvv_sp_vopmask_rvvm1_sleef o1, double d0, double d1, double d2) { + return vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o0, vcast_vf2_d_rvvm1_sleef(d0), vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, vcast_vf2_d_rvvm1_sleef(d1), vcast_vf2_d_rvvm1_sleef(d2))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vsel_vf2_vo_vo_vo_d_d_d_d_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef o0, rvv_sp_vopmask_rvvm1_sleef o1, rvv_sp_vopmask_rvvm1_sleef o2, double d0, double d1, double d2, double d3) { + return vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o0, vcast_vf2_d_rvvm1_sleef(d0), vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, vcast_vf2_d_rvvm1_sleef(d1), vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o2, vcast_vf2_d_rvvm1_sleef(d2), vcast_vf2_d_rvvm1_sleef(d3)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef vabs_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x) { + return vcast_vf2_vf_vf_rvvm1_sleef(vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0)), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)))), + vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0)), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vadd_vf_3vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2) { + return vadd_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vadd_vf_4vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3) { + return vadd_vf_3vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vadd_vf_5vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3, vfloat_rvvm1_sleef v4) { + return vadd_vf_4vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vadd_vf_6vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3, vfloat_rvvm1_sleef v4, vfloat_rvvm1_sleef v5) { + return vadd_vf_5vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vadd_vf_7vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3, vfloat_rvvm1_sleef v4, vfloat_rvvm1_sleef v5, vfloat_rvvm1_sleef v6) { + return vadd_vf_6vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vsub_vf_3vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2) { + return vsub_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vsub_vf_4vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3) { + return vsub_vf_3vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vsub_vf_5vf_rvvm1_sleef(vfloat_rvvm1_sleef v0, vfloat_rvvm1_sleef v1, vfloat_rvvm1_sleef v2, vfloat_rvvm1_sleef v3, vfloat_rvvm1_sleef v4) { + return vsub_vf_4vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfneg_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x) { + return vcast_vf2_vf_vf_rvvm1_sleef(vneg_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)), vneg_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfabs_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x) { + return vcast_vf2_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)), + vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x)), vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfnormalize_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef t) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t), vf2gety_vf_vf2_rvvm1_sleef(t)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t), s), vf2gety_vf_vf2_rvvm1_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfscale_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef d, vfloat_rvvm1_sleef s) { + return vf2setxy_vf2_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), s), vmul_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(x, y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd2_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(x, y); + vfloat_rvvm1_sleef v = vsub_vf_vf_vf_rvvm1_sleef(s, x); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, vsub_vf_vf_vf_rvvm1_sleef(s, v)), vsub_vf_vf_vf_rvvm1_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd2_vf2_vf_vf2_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(x, vf2getx_vf_vf2_rvvm1_sleef(y)); + vfloat_rvvm1_sleef v = vsub_vf_vf_vf_rvvm1_sleef(s, x); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, vsub_vf_vf_vf_rvvm1_sleef(s, v)), vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), v)), vf2gety_vf_vf2_rvvm1_sleef(y))); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_3vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), s), y, vf2gety_vf_vf2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsub_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), s), y), vf2gety_vf_vf2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd2_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), y); + vfloat_rvvm1_sleef v = vsub_vf_vf_vf_rvvm1_sleef(s, vf2getx_vf_vf2_rvvm1_sleef(x)); + vfloat_rvvm1_sleef t = vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vsub_vf_vf_vf_rvvm1_sleef(s, v)), vsub_vf_vf_vf_rvvm1_sleef(y, v)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(t, vf2gety_vf_vf2_rvvm1_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd_vf2_vf_vf2_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(x, vf2getx_vf_vf2_rvvm1_sleef(y)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_3vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, s), vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd_vf2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_4vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), s), vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfadd2_vf2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)); + vfloat_rvvm1_sleef v = vsub_vf_vf_vf_rvvm1_sleef(s, vf2getx_vf_vf2_rvvm1_sleef(x)); + vfloat_rvvm1_sleef t = vadd_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vsub_vf_vf_vf_rvvm1_sleef(s, v)), vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), v)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vadd_vf_vf_vf_rvvm1_sleef(t, vadd_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsub_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + + vfloat_rvvm1_sleef s = vsub_vf_vf_vf_rvvm1_sleef(x, y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vsub_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsub_vf2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + + vfloat_rvvm1_sleef s = vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)); + vfloat_rvvm1_sleef t = vsub_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), s); + t = vsub_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(y)); + t = vadd_vf_vf_vf_rvvm1_sleef(t, vf2gety_vf_vf2_rvvm1_sleef(x)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vsub_vf_vf_vf_rvvm1_sleef(t, vf2gety_vf_vf2_rvvm1_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfdiv_vf2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef n, vfloat2_rvvm1_sleef d) { + vfloat_rvvm1_sleef t = vrec_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d)); + vfloat_rvvm1_sleef s = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(n), t); + vfloat_rvvm1_sleef u = vfmapn_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(n), s); + vfloat_rvvm1_sleef v = vfmanp_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(d), t, vfmanp_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), t, vcast_vf_f_rvvm1_sleef(1))); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vfma_vf_vf_vf_vf_rvvm1_sleef(s, v, vfma_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfmul_vf2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vmul_vf_vf_vf_rvvm1_sleef(x, y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vfmapn_vf_vf_vf_vf_rvvm1_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsqu_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x) { + vfloat_rvvm1_sleef s = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vfma_vf_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)), vf2gety_vf_vf2_rvvm1_sleef(x), vfmapn_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef dfsqu_vf_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x) { + return vfma_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x), vadd_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)), vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfmul_vf2_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vfma_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(y), vfma_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y), vfmapn_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef dfmul_vf_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat2_rvvm1_sleef y) { + return vfma_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y), vfma_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y), vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfmul_vf2_vf2_vf_rvvm1_sleef(vfloat2_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef s = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), y); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vfma_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x), y, vfmapn_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfrec_vf2_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef s = vrec_vf_vf_rvvm1_sleef(d); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(s, vfmanp_vf_vf_vf_vf_rvvm1_sleef(d, s, vcast_vf_f_rvvm1_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfrec_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef d) { + vfloat_rvvm1_sleef s = vrec_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d)); + return vf2setxy_vf2_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(s, vfmanp_vf_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(d), s, vfmanp_vf_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), s, vcast_vf_f_rvvm1_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsqrt_vf2_vf2_rvvm1_sleef(vfloat2_rvvm1_sleef d) { + + vfloat_rvvm1_sleef t = vsqrt_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d))); + return dfscale_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf2_rvvm1_sleef(d, dfmul_vf2_vf_vf_rvvm1_sleef(t, t)), dfrec_vf2_vf_rvvm1_sleef(t)), vcast_vf_f_rvvm1_sleef(0.5)); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfsqrt_vf2_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef t = vsqrt_vf_vf_rvvm1_sleef(d); + return dfscale_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf2_rvvm1_sleef(d, dfmul_vf2_vf_vf_rvvm1_sleef(t, t)), dfrec_vf2_vf_rvvm1_sleef(t)), vcast_vf_f_rvvm1_sleef(0.5f)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_sp_vopmask_rvvm1_sleef visnegzero_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return veq_vo_vi2_vi2_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), vreinterpret_vi2_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE rvv_sp_vopmask_rvvm1_sleef vnot_vo32_vo32_rvvm1_sleef(rvv_sp_vopmask_rvvm1_sleef x) { + return rvv_sp_vxor_vo_vo_vo(x, veq_vo_vi2_vi2_rvvm1_sleef(vcast_vi2_i_rvvm1_sleef(0), vcast_vi2_i_rvvm1_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_rvvm1_sleef vsignbit_vm_vf_rvvm1_sleef(vfloat_rvvm1_sleef f) { + return vand_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(f), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_sp_vopmask_rvvm1_sleef vsignbit_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + return veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), vcast_vi2_i_rvvm1_sleef(0x80000000)), vcast_vi2_i_rvvm1_sleef(0x80000000)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_rvvm1_sleef vsel_vi2_vf_vf_vi2_vi2_rvvm1_sleef(vfloat_rvvm1_sleef f0, vfloat_rvvm1_sleef f1, vint2_rvvm1_sleef x, vint2_rvvm1_sleef y) { + return vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(f0, f1), x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_rvvm1_sleef vsel_vi2_vf_vi2_rvvm1_sleef(vfloat_rvvm1_sleef d, vint2_rvvm1_sleef x) { + return vand_vi2_vo_vi2_rvvm1_sleef(vsignbit_vo_vf_rvvm1_sleef(d), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_sp_vopmask_rvvm1_sleef visint_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef y) { return veq_vo_vf_vf_rvvm1_sleef(vtruncate_vf_vf_rvvm1_sleef(y), y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST rvv_sp_vopmask_rvvm1_sleef visnumber_vo_vf_rvvm1_sleef(vfloat_rvvm1_sleef x) { return vnot_vo32_vo32_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(x))); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_rvvm1_sleef vilogbk_vi2_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(5.421010862427522E-20f)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.8446744073709552E19f), d), d); + vint2_rvvm1_sleef q = vand_vi2_vi2_vi2_rvvm1_sleef(vsrl_vi2_vi2_i_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), 23), vcast_vi2_i_rvvm1_sleef(0xff)); + q = vsub_vi2_vi2_vi2_rvvm1_sleef(q, vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vcast_vi2_i_rvvm1_sleef(64 + 0x7f), vcast_vi2_i_rvvm1_sleef(0x7f))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_rvvm1_sleef vilogb2k_vi2_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q = vreinterpret_vi2_vf_rvvm1_sleef(d); + q = vsrl_vi2_vi2_i_rvvm1_sleef(q, 23); + q = vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(0xff)); + q = vsub_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(0x7f)); + return q; +} + +SLEEF_INLINE SLEEF_CONST vint2_rvvm1_sleef Sleef_ilogbfx_rvvm1(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef e = vilogbk_vi2_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.0f)), vcast_vi2_i_rvvm1_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(d), vcast_vi2_i_rvvm1_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vcast_vi2_i_rvvm1_sleef(2147483647), e); + return e; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vpow2i_vf_vi2_rvvm1_sleef(vint2_rvvm1_sleef q) { + return vreinterpret_vf_vi2_rvvm1_sleef(vsll_vi2_vi2_i_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(0x7f)), 23)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vldexp_vf_vf_vi2_rvvm1_sleef(vfloat_rvvm1_sleef x, vint2_rvvm1_sleef q) { + vfloat_rvvm1_sleef u; + vint2_rvvm1_sleef m = vsra_vi2_vi2_i_rvvm1_sleef(q, 31); + m = vsll_vi2_vi2_i_rvvm1_sleef(vsub_vi2_vi2_vi2_rvvm1_sleef(vsra_vi2_vi2_i_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(m, q), 6), m), 4); + q = vsub_vi2_vi2_vi2_rvvm1_sleef(q, vsll_vi2_vi2_i_rvvm1_sleef(m, 2)); + m = vadd_vi2_vi2_vi2_rvvm1_sleef(m, vcast_vi2_i_rvvm1_sleef(0x7f)); + m = vand_vi2_vi2_vi2_rvvm1_sleef(vgt_vi2_vi2_vi2_rvvm1_sleef(m, vcast_vi2_i_rvvm1_sleef(0)), m); + vint2_rvvm1_sleef n = vgt_vi2_vi2_vi2_rvvm1_sleef(m, vcast_vi2_i_rvvm1_sleef(0xff)); + m = vor_vi2_vi2_vi2_rvvm1_sleef(vandnot_vi2_vi2_vi2_rvvm1_sleef(n, m), vand_vi2_vi2_vi2_rvvm1_sleef(n, vcast_vi2_i_rvvm1_sleef(0xff))); + u = vreinterpret_vf_vi2_rvvm1_sleef(vsll_vi2_vi2_i_rvvm1_sleef(m, 23)); + x = vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x, u), u), u), u); + u = vreinterpret_vf_vi2_rvvm1_sleef(vsll_vi2_vi2_i_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(0x7f)), 23)); + return vmul_vf_vf_vf_rvvm1_sleef(x, u); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vldexp2_vf_vf_vi2_rvvm1_sleef(vfloat_rvvm1_sleef d, vint2_rvvm1_sleef e) { + return vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vpow2i_vf_vi2_rvvm1_sleef(vsra_vi2_vi2_i_rvvm1_sleef(e, 1))), vpow2i_vf_vi2_rvvm1_sleef(vsub_vi2_vi2_vi2_rvvm1_sleef(e, vsra_vi2_vi2_i_rvvm1_sleef(e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vldexp3_vf_vf_vi2_rvvm1_sleef(vfloat_rvvm1_sleef d, vint2_rvvm1_sleef q) { + return vreinterpret_vf_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), vsll_vi2_vi2_i_rvvm1_sleef(q, 23))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_ldexpfx_rvvm1(vfloat_rvvm1_sleef x, vint2_rvvm1_sleef q) { return vldexp_vf_vf_vi2_rvvm1_sleef(x, q); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST fi_t_rvvm1_sleef rempisubf_rvvm1_sleef(vfloat_rvvm1_sleef x) { + + vfloat_rvvm1_sleef c = vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1 << 23), x); + vfloat_rvvm1_sleef rint4x = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(4), x)), vcast_vf_f_rvvm1_sleef(1 << 23)), + vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(4), x), + vorsign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(4), x, c), c), x)); + vfloat_rvvm1_sleef rintx = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(1 << 23)), + x, vorsign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(x, c), c), x)); + return fisetdi_fi_vf_vi2_rvvm1_sleef(vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.25), rint4x, x), + vtruncate_vi2_vf_rvvm1_sleef(vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-4), rintx, rint4x))); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST dfi_t_rvvm1_sleef rempif_rvvm1_sleef(vfloat_rvvm1_sleef a) { + vfloat2_rvvm1_sleef x, y; + vint2_rvvm1_sleef ex = vilogb2k_vi2_vf_rvvm1_sleef(a); + + ex = vsub_vi2_vi2_vi2_rvvm1_sleef(ex, vcast_vi2_i_rvvm1_sleef(25)); + vint2_rvvm1_sleef q = vand_vi2_vo_vi2_rvvm1_sleef(vgt_vo_vi2_vi2_rvvm1_sleef(ex, vcast_vi2_i_rvvm1_sleef(90-25)), vcast_vi2_i_rvvm1_sleef(-64)); + a = vldexp3_vf_vf_vi2_rvvm1_sleef(a, q); + ex = vandnot_vi2_vi2_vi2_rvvm1_sleef(vsra_vi2_vi2_i_rvvm1_sleef(ex, 31), ex); + ex = vsll_vi2_vi2_i_rvvm1_sleef(ex, 2); + x = dfmul_vf2_vf_vf_rvvm1_sleef(a, vgather_vf_p_vi2_rvvm1_sleef(Sleef_rempitabsp, ex)); + fi_t_rvvm1_sleef di = rempisubf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)); + q = figeti_vi2_di_rvvm1_sleef(di); + x = vf2setx_vf2_vf2_vf_rvvm1_sleef(x, figetd_vf_di_rvvm1_sleef(di)); + x = dfnormalize_vf2_vf2_rvvm1_sleef(x); + y = dfmul_vf2_vf_vf_rvvm1_sleef(a, vgather_vf_p_vi2_rvvm1_sleef(Sleef_rempitabsp+1, ex)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(x, y); + di = rempisubf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(q, figeti_vi2_di_rvvm1_sleef(di)); + x = vf2setx_vf2_vf2_vf_rvvm1_sleef(x, figetd_vf_di_rvvm1_sleef(di)); + x = dfnormalize_vf2_vf2_rvvm1_sleef(x); + y = vcast_vf2_vf_vf_rvvm1_sleef(vgather_vf_p_vi2_rvvm1_sleef(Sleef_rempitabsp+2, ex), vgather_vf_p_vi2_rvvm1_sleef(Sleef_rempitabsp+3, ex)); + y = dfmul_vf2_vf2_vf_rvvm1_sleef(y, a); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(x, y); + x = dfnormalize_vf2_vf2_rvvm1_sleef(x); + x = dfmul_vf2_vf2_vf2_rvvm1_sleef(x, vcast_vf2_f_f_rvvm1_sleef(3.1415927410125732422f*2, -8.7422776573475857731e-08f*2)); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(a), vcast_vf_f_rvvm1_sleef(0.7f)), vcast_vf2_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), x); + return dfisetdfi_dfi_vf2_vi2_rvvm1_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sinfx_u35rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_rvvm1_sleef(q); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(39000)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_rvvm1_sleef(q); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.140625f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.0009670257568359375f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-6.2771141529083251953e-07f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.2154201256553420762e-10f), d); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(3)); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vi2_i_rvvm1_sleef(2), vcast_vi2_i_rvvm1_sleef(1))); + q = vsra_vi2_vi2_i_rvvm1_sleef(q, 2); + rvv_sp_vopmask_rvvm1_sleef o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)); + vfloat2_rvvm1_sleef x = vcast_vf2_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)))); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), x); + dfi_rvvm1_sleef = dfisetdf_dfi_dfi_vf2_rvvm1_sleef(dfi_rvvm1_sleef, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, x, dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + d = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vf2gety_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + + d = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(r), visnan_vo_vf_rvvm1_sleef(r)), vreinterpret_vm_vf_rvvm1_sleef(d))); + } + + s = vmul_vf_vf_vf_rvvm1_sleef(d, d); + + d = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(d))); + + u = vcast_vf_f_rvvm1_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, d)), d); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_cosfx_u35rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_rvvm1_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vcast_vi2_i_rvvm1_sleef(1)); + + u = vcast_vf_vi2_rvvm1_sleef(q); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(39000)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_rvvm1_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vcast_vi2_i_rvvm1_sleef(1)); + + u = vcast_vf_vi2_rvvm1_sleef(q); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.140625f*0.5f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.0009670257568359375f*0.5f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-6.2771141529083251953e-07f*0.5f), d); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.2154201256553420762e-10f*0.5f), d); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(3)); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vi2_i_rvvm1_sleef(8), vcast_vi2_i_rvvm1_sleef(7))); + q = vsra_vi2_vi2_i_rvvm1_sleef(q, 1); + rvv_sp_vopmask_rvvm1_sleef o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(0)); + vfloat_rvvm1_sleef y = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(0), vcast_vf_f_rvvm1_sleef(-1)); + vfloat2_rvvm1_sleef x = vcast_vf2_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), x); + dfi_rvvm1_sleef = dfisetdf_dfi_dfi_vf2_rvvm1_sleef(dfi_rvvm1_sleef, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, x, dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + d = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vf2gety_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + + d = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(r), visnan_vo_vf_rvvm1_sleef(r)), vreinterpret_vm_vf_rvvm1_sleef(d))); + } + + s = vmul_vf_vf_vf_rvvm1_sleef(d, d); + + d = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(0)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(d))); + + u = vcast_vf_f_rvvm1_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_tanfx_u35rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, x; + + x = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f*0.5f)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_rvvm1_sleef(q); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f), x); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f), x); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f), x); + } else if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(39000)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_rvvm1_sleef(q); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.140625f*0.5f), x); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.0009670257568359375f*0.5f), x); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-6.2771141529083251953e-07f*0.5f), x); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.2154201256553420762e-10f*0.5f), x); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + x = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vf2gety_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + x = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)), vreinterpret_vm_vf_rvvm1_sleef(x))); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), d, x); + } + + s = vmul_vf_vf_vf_rvvm1_sleef(x, x); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)); + x = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(x))); + + vfloat_rvvm1_sleef s2 = vmul_vf_vf_vf_rvvm1_sleef(s, s), s4 = vmul_vf_vf_vf_rvvm1_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_rvvm1_sleef((s4), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.00927245803177356719970703f)), (vcast_vf_f_rvvm1_sleef(0.00331984995864331722259521f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((s2), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.0242998078465461730957031f)), (vcast_vf_f_rvvm1_sleef(0.0534495301544666290283203f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.133383005857467651367188f)), (vcast_vf_f_rvvm1_sleef(0.333331853151321411132812f))))))) + + ; + + u = vmla_vf_vf_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, x), x); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vrec_vf_vf_rvvm1_sleef(u), u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sinfx_u10rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, v; + vfloat2_rvvm1_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_rvvm1_sleef(u); + v = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f), d); + s = dfadd2_vf2_vf_vf_rvvm1_sleef(v, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f))); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(3)); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vi2_i_rvvm1_sleef(2), vcast_vi2_i_rvvm1_sleef(1))); + q = vsra_vi2_vi2_i_rvvm1_sleef(q, 2); + rvv_sp_vopmask_rvvm1_sleef o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)); + vfloat2_rvvm1_sleef x = vcast_vf2_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)))); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), x); + dfi_rvvm1_sleef = dfisetdf_dfi_dfi_vf2_rvvm1_sleef(dfi_rvvm1_sleef, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, x, dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + s = dfnormalize_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)); + + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_rvvm1_sleef(s); + + u = vcast_vf_f_rvvm1_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_rvvm1_sleef(t, x); + + u = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(u))); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_cosfx_u10rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u; + vfloat2_rvvm1_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + vfloat_rvvm1_sleef dq = vmla_vf_vf_vf_vf_rvvm1_sleef(vrint_vf_vf_rvvm1_sleef(vmla_vf_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.318309886183790671537767526745028724), vcast_vf_f_rvvm1_sleef(-0.5f))), + vcast_vf_f_rvvm1_sleef(2), vcast_vf_f_rvvm1_sleef(1)); + q = vrint_vi2_vf_rvvm1_sleef(dq); + s = dfadd2_vf2_vf_vf_rvvm1_sleef (d, vmul_vf_vf_vf_rvvm1_sleef(dq, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f))); + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(dq, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(dq, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(3)); + q = vadd_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, q), vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vi2_i_rvvm1_sleef(8), vcast_vi2_i_rvvm1_sleef(7))); + q = vsra_vi2_vi2_i_rvvm1_sleef(q, 1); + rvv_sp_vopmask_rvvm1_sleef o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(0)); + vfloat_rvvm1_sleef y = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(0), vcast_vf_f_rvvm1_sleef(-1)); + vfloat2_rvvm1_sleef x = vcast_vf2_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef), x); + dfi_rvvm1_sleef = dfisetdf_dfi_dfi_vf2_rvvm1_sleef(dfi_rvvm1_sleef, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, x, dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + s = dfnormalize_vf2_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)); + + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_rvvm1_sleef(s); + + u = vcast_vf_f_rvvm1_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_rvvm1_sleef(t, x); + + u = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(0)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fastsinfx_u3500rvvm1(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, s, t = d; + + s = vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724)); + u = vrint_vf_vf_rvvm1_sleef(s); + q = vrint_vi2_vf_rvvm1_sleef(s); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-(float)3.141592653589793238462643383279502884), d); + + s = vmul_vf_vf_vf_rvvm1_sleef(d, d); + + u = vcast_vf_f_rvvm1_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(u))); + + rvv_sp_vopmask_rvvm1_sleef g = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(g)), 1)) return vsel_vf_vo_vf_vf_rvvm1_sleef(g, u, Sleef_sinfx_u35rvvm1(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fastcosfx_u3500rvvm1(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, s, t = d; + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.318309886183790671537767526745028724), vcast_vf_f_rvvm1_sleef(-0.5f)); + u = vrint_vf_vf_rvvm1_sleef(s); + q = vrint_vi2_vf_rvvm1_sleef(s); + d = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-(float)3.141592653589793238462643383279502884), vsub_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)3.141592653589793238462643383279502884 * 0.5f))); + + s = vmul_vf_vf_vf_rvvm1_sleef(d, d); + + u = vcast_vf_f_rvvm1_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(0)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(u))); + + rvv_sp_vopmask_rvvm1_sleef g = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(g)), 1)) return vsel_vf_vo_vf_vf_rvvm1_sleef(g, u, Sleef_cosfx_u35rvvm1(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_rvvm1_sleef Sleef_sincosfx_u35rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, t, rx, ry; + vfloat2_rvvm1_sleef r; + + s = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_rvvm1_sleef(q); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f), s); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f), s); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f), s); + } else if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(39000)))), 1)) { + q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_rvvm1_sleef(q); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.140625f*0.5f), s); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.0009670257568359375f*0.5f), s); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-6.2771141529083251953e-07f*0.5f), s); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.2154201256553420762e-10f*0.5f), s); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + s = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef)), vf2gety_vf_vf2_rvvm1_sleef(dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef))); + s = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)), vreinterpret_vm_vf_rvvm1_sleef(s))); + } + + t = s; + + s = vmul_vf_vf_vf_rvvm1_sleef(s, s); + + u = vcast_vf_f_rvvm1_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.166666537523269653320312f)); + + rx = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(u, s), t, t); + rx = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-0.0f), rx); + + u = vcast_vf_f_rvvm1_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.5)); + + ry = vmla_vf_vf_vf_vf_rvvm1_sleef(s, u, vcast_vf_f_rvvm1_sleef(1)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(0)); + r = vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(o, rx, ry), vsel_vf_vo_vf_vf_rvvm1_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_rvvm1_sleef Sleef_sincosfx_u10rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, v, rx, ry; + vfloat2_rvvm1_sleef r, s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_rvvm1_sleef(u); + v = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_rvvm1_sleef(v, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + s = dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + o = rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)); + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s))))); + } + + t = s; + + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, dfsqu_vf_vf2_rvvm1_sleef(s)); + + u = vcast_vf_f_rvvm1_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-0.166666537523269653320312f)); + + u = vmul_vf_vf_vf_rvvm1_sleef(u, vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), vf2getx_vf_vf2_rvvm1_sleef(t))); + + x = dfadd_vf2_vf2_vf_rvvm1_sleef(t, u); + rx = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + rx = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-0.0f), rx); + + u = vcast_vf_f_rvvm1_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-0.5)); + + x = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), u)); + ry = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(0)); + r = vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(o, rx, ry), vsel_vf_vo_vf_vf_rvvm1_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_rvvm1_sleef Sleef_sincospifx_u05rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, t, rx, ry; + vfloat2_rvvm1_sleef r, x, s2; + + u = vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(4)); + vint2_rvvm1_sleef q = vtruncate_vi2_vf_rvvm1_sleef(u); + q = vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vxor_vi2_vi2_vi2_rvvm1_sleef(vsrl_vi2_vi2_i_rvvm1_sleef(q, 31), vcast_vi2_i_rvvm1_sleef(1))), vcast_vi2_i_rvvm1_sleef(~1)); + s = vsub_vf_vf_vf_rvvm1_sleef(u, vcast_vf_vi2_rvvm1_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_rvvm1_sleef(s, s); + s2 = dfmul_vf2_vf_vf_rvvm1_sleef(t, t); + + u = vcast_vf_f_rvvm1_sleef(+0.3093842054e-6); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.3657307388e-4)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2490393585e-2)); + x = dfadd2_vf2_vf_vf2_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(u, s), vcast_vf2_f_f_rvvm1_sleef(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(s2, x), vcast_vf2_f_f_rvvm1_sleef(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf_rvvm1_sleef(x, t); + rx = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + rx = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-0.0f), rx); + + u = vcast_vf_f_rvvm1_sleef(-0.2430611801e-7); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.3590577080e-5)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.3259917721e-3)); + x = dfadd2_vf2_vf_vf2_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(u, s), vcast_vf2_f_f_rvvm1_sleef(0.015854343771934509277, 4.4940051354032242811e-10)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(s2, x), vcast_vf2_f_f_rvvm1_sleef(-0.30842512845993041992, -9.0728339030733922277e-09)); + + x = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(x, s2), vcast_vf_f_rvvm1_sleef(1)); + ry = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(0)); + r = vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(o, rx, ry), vsel_vf_vo_vf_vf_rvvm1_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + o = vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + o = visinf_vo_vf_rvvm1_sleef(d); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_rvvm1_sleef Sleef_sincospifx_u35rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, t, rx, ry; + vfloat2_rvvm1_sleef r; + + u = vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(4)); + vint2_rvvm1_sleef q = vtruncate_vi2_vf_rvvm1_sleef(u); + q = vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vxor_vi2_vi2_vi2_rvvm1_sleef(vsrl_vi2_vi2_i_rvvm1_sleef(q, 31), vcast_vi2_i_rvvm1_sleef(1))), vcast_vi2_i_rvvm1_sleef(~1)); + s = vsub_vf_vf_vf_rvvm1_sleef(u, vcast_vf_vi2_rvvm1_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_rvvm1_sleef(s, s); + + u = vcast_vf_f_rvvm1_sleef(-0.3600925265e-4); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2490088111e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.8074551076e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.7853981853e+0)); + + rx = vmul_vf_vf_vf_rvvm1_sleef(u, t); + + u = vcast_vf_f_rvvm1_sleef(+0.3539815225e-5); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.3259574005e-3)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1585431583e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(-0.3084251285e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(1)); + + ry = u; + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(0)); + r = vf2setxy_vf2_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(o, rx, ry), vsel_vf_vo_vf_vf_rvvm1_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + o = vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + o = visinf_vo_vf_rvvm1_sleef(d); + r = vf2setx_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r))))); + r = vf2sety_vf2_vf2_vf_rvvm1_sleef(r, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(r))))); + + return r; +} + +SLEEF_INLINE vfloat2_rvvm1_sleef Sleef_modffx_rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + fr = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23)), vcast_vf_f_rvvm1_sleef(0), fr); + + vfloat2_rvvm1_sleef ret; + + ret = vf2setxy_vf2_vf_vf_rvvm1_sleef(vcopysign_vf_vf_vf_rvvm1_sleef(fr, x), vcopysign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, fr), x)); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_tanfx_u10rvvm1(vfloat_rvvm1_sleef d) { + + vint2_rvvm1_sleef q; + vfloat_rvvm1_sleef u, v; + vfloat2_rvvm1_sleef s, t, x; + rvv_sp_vopmask_rvvm1_sleef o; + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_rvvm1_sleef(u); + v = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_rvvm1_sleef(v, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_rvvm1_sleef dfi_rvvm1_sleef = rempif_rvvm1_sleef(d); + q = dfigeti_vi2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + s = dfigetdf_vf2_dfi_rvvm1_sleef(dfi_rvvm1_sleef); + o = rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), visnan_vo_vf_rvvm1_sleef(d)); + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s))))); + s = vf2sety_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(s))))); + } + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)); + vmask_rvvm1_sleef n = vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))); + + s = vf2setx_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s)), n))); + s = vf2sety_vf2_vf2_vf_rvvm1_sleef(s, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(s)), n))); + + t = s; + s = dfsqu_vf2_vf2_rvvm1_sleef(s); + s = dfnormalize_vf2_vf2_rvvm1_sleef(s); + + u = vcast_vf_f_rvvm1_sleef(0.00446636462584137916564941f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(-8.3920182078145444393158e-05f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.0109639242291450500488281f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.0212360303848981857299805f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.0540687143802642822265625f)); + + x = dfadd_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.133325666189193725585938f), vmul_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s))); + x = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.33333361148834228515625f), dfmul_vf2_vf2_vf2_rvvm1_sleef(s, x)), s)); + x = dfmul_vf2_vf2_vf2_rvvm1_sleef(t, x); + + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfrec_vf2_vf2_rvvm1_sleef(x), x); + + u = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_atanfx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef s, t, u; + vint2_rvvm1_sleef q; + + q = vsel_vi2_vf_vi2_rvvm1_sleef(d, vcast_vi2_i_rvvm1_sleef(2)); + s = vabs_vf_vf_rvvm1_sleef(d); + + q = vsel_vi2_vf_vf_vi2_vi2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), s, vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), q); + s = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), s), vrec_vf_vf_rvvm1_sleef(s), s); + + t = vmul_vf_vf_vf_rvvm1_sleef(s, s); + + vfloat_rvvm1_sleef t2 = vmul_vf_vf_vf_rvvm1_sleef(t, t), t4 = vmul_vf_vf_vf_rvvm1_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_rvvm1_sleef((t4), (vmla_vf_vf_vf_vf_rvvm1_sleef((t2), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.00282363896258175373077393f)), (vcast_vf_f_rvvm1_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.0425049886107444763183594f)), (vcast_vf_f_rvvm1_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t2), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.106347933411598205566406f)), (vcast_vf_f_rvvm1_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.199926957488059997558594f)), (vcast_vf_f_rvvm1_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(t, u), s); + + t = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/2)), t), t); + + t = vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0f))), vreinterpret_vm_vf_rvvm1_sleef(t))); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef atan2kf_rvvm1_sleef(vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef s, t, u; + vint2_rvvm1_sleef q; + rvv_sp_vopmask_rvvm1_sleef p; + + q = vsel_vi2_vf_vi2_rvvm1_sleef(x, vcast_vi2_i_rvvm1_sleef(-2)); + x = vabs_vf_vf_rvvm1_sleef(x); + + q = vsel_vi2_vf_vf_vi2_vi2_rvvm1_sleef(x, y, vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), q); + p = vlt_vo_vf_vf_rvvm1_sleef(x, y); + s = vsel_vf_vo_vf_vf_rvvm1_sleef(p, vneg_vf_vf_rvvm1_sleef(x), y); + t = vmax_vf_vf_vf_rvvm1_sleef(x, y); + + s = vdiv_vf_vf_vf_rvvm1_sleef(s, t); + t = vmul_vf_vf_vf_rvvm1_sleef(s, s); + + vfloat_rvvm1_sleef t2 = vmul_vf_vf_vf_rvvm1_sleef(t, t), t4 = vmul_vf_vf_vf_rvvm1_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_rvvm1_sleef((t4), (vmla_vf_vf_vf_vf_rvvm1_sleef((t2), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.00282363896258175373077393f)), (vcast_vf_f_rvvm1_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.0425049886107444763183594f)), (vcast_vf_f_rvvm1_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t2), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.106347933411598205566406f)), (vcast_vf_f_rvvm1_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((t), (vcast_vf_f_rvvm1_sleef(0.199926957488059997558594f)), (vcast_vf_f_rvvm1_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(t, u), s); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/2)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef visinf2_vf_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d, vfloat_rvvm1_sleef m) { + return vreinterpret_vf_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vor_vm_vm_vm_rvvm1_sleef(vsignbit_vm_vf_rvvm1_sleef(d), vreinterpret_vm_vf_rvvm1_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_atan2fx_u35rvvm1(vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef r = atan2kf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), x); + + r = vmulsign_vf_vf_vf_rvvm1_sleef(r, x); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0.0f))), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_rvvm1_sleef(x, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/2)), x))), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(y), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_rvvm1_sleef(x, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)(3.141592653589793238462643383279502884/4)), x))), r); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0.0f)), vreinterpret_vf_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(vsignbit_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vreinterpret_vm_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_asinfx_u35rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0.5f)); + vfloat_rvvm1_sleef x2 = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, d), vmul_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vabs_vf_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5f))); + vfloat_rvvm1_sleef x = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vabs_vf_vf_rvvm1_sleef(d), vsqrt_vf_vf_rvvm1_sleef(x2)), u; + + u = vcast_vf_f_rvvm1_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.1666677296e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vmul_vf_vf_vf_rvvm1_sleef(x, x2), x); + + vfloat_rvvm1_sleef r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, u, vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-2), vcast_vf_f_rvvm1_sleef(((float)3.141592653589793238462643383279502884)/2))); + return vmulsign_vf_vf_vf_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_acosfx_u35rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0.5f)); + vfloat_rvvm1_sleef x2 = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, d), + vmul_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vabs_vf_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5f))), u; + vfloat_rvvm1_sleef x = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vabs_vf_vf_rvvm1_sleef(d), vsqrt_vf_vf_rvvm1_sleef(x2)); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1.0f)), vcast_vf_f_rvvm1_sleef(0), x); + + u = vcast_vf_f_rvvm1_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_rvvm1_sleef(u, vmul_vf_vf_vf_rvvm1_sleef(x2, x)); + + vfloat_rvvm1_sleef y = vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.1415926535897932f/2), vadd_vf_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(x, d), vmulsign_vf_vf_vf_rvvm1_sleef(u, d))); + x = vadd_vf_vf_vf_rvvm1_sleef(x, u); + vfloat_rvvm1_sleef r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, y, vmul_vf_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + return vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vandnot_vo_vo_vo(o, vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0))), + vf2getx_vf_vf2_rvvm1_sleef(dfadd_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(3.1415927410125732422f,-8.7422776573475857731e-08f), + vneg_vf_vf_rvvm1_sleef(r))), r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef atan2kf_u1_rvvm1_sleef(vfloat2_rvvm1_sleef y, vfloat2_rvvm1_sleef x) { + vfloat_rvvm1_sleef u; + vfloat2_rvvm1_sleef s, t; + vint2_rvvm1_sleef q; + rvv_sp_vopmask_rvvm1_sleef p; + vmask_rvvm1_sleef r; + + q = vsel_vi2_vf_vf_vi2_vi2_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(0), vcast_vi2_i_rvvm1_sleef(-2), vcast_vi2_i_rvvm1_sleef(0)); + p = vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(0)); + r = vand_vm_vo32_vm_rvvm1_sleef(p, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))); + x = vf2setx_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)), r))); + x = vf2sety_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x)), r))); + + q = vsel_vi2_vf_vf_vi2_vi2_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y), vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(1)), q); + p = vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(y)); + s = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(p, dfneg_vf2_vf2_rvvm1_sleef(x), y); + t = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(p, y, x); + + s = dfdiv_vf2_vf2_vf2_rvvm1_sleef(s, t); + t = dfsqu_vf2_vf2_rvvm1_sleef(s); + t = dfnormalize_vf2_vf2_rvvm1_sleef(t); + + u = vcast_vf_f_rvvm1_sleef(-0.00176397908944636583328247f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(0.0107900900766253471374512f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(-0.0309564601629972457885742f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(0.0577365085482597351074219f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(-0.0838950723409652709960938f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(0.109463557600975036621094f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(-0.142626821994781494140625f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(0.199983194470405578613281f)); + + t = dfmul_vf2_vf2_vf2_rvvm1_sleef(t, dfadd_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.333332866430282592773438f), vmul_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(t)))); + t = dfmul_vf2_vf2_vf2_rvvm1_sleef(s, dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), t)); + t = dfadd_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(1.5707963705062866211f, -4.3711388286737928865e-08f), vcast_vf_vi2_rvvm1_sleef(q)), t); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_atan2fx_u10rvvm1(vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef x) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(2.9387372783541830947e-39f)); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1 << 24)), x); + y = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(1 << 24)), y); + + vfloat2_rvvm1_sleef d = atan2kf_u1_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), vcast_vf_f_rvvm1_sleef(0)), vcast_vf2_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0))); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)); + + r = vmulsign_vf_vf_vf_rvvm1_sleef(r, x); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0))), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_rvvm1_sleef(x, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(y), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_rvvm1_sleef(x, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0.0f)), vreinterpret_vf_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(vsignbit_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vreinterpret_vm_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_asinfx_u10rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0.5f)); + vfloat_rvvm1_sleef x2 = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, d), vmul_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vabs_vf_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5f))), u; + vfloat2_rvvm1_sleef x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, vcast_vf2_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0)), dfsqrt_vf2_vf_rvvm1_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1.0f)), vcast_vf2_f_f_rvvm1_sleef(0, 0), x); + + u = vcast_vf_f_rvvm1_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_rvvm1_sleef(u, vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x))); + + vfloat2_rvvm1_sleef y = dfsub_vf2_vf2_vf_rvvm1_sleef(dfsub_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(3.1415927410125732422f/4,-8.7422776573475857731e-08f/4), x), u); + + vfloat_rvvm1_sleef r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vadd_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(x)), + vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(2))); + return vmulsign_vf_vf_vf_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_acosfx_u10rvvm1(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0.5f)); + vfloat_rvvm1_sleef x2 = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, d), vmul_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vabs_vf_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5f))), u; + vfloat2_rvvm1_sleef x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, vcast_vf2_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0)), dfsqrt_vf2_vf_rvvm1_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1.0f)), vcast_vf2_f_f_rvvm1_sleef(0, 0), x); + + u = vcast_vf_f_rvvm1_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, x2, vcast_vf_f_rvvm1_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_rvvm1_sleef(u, vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x))); + + vfloat2_rvvm1_sleef y = dfsub_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(3.1415927410125732422f/2, -8.7422776573475857731e-08f/2), + dfadd_vf2_vf_vf_rvvm1_sleef(vmulsign_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), d), vmulsign_vf_vf_vf_rvvm1_sleef(u, d))); + x = dfadd_vf2_vf2_vf_rvvm1_sleef(x, u); + + y = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, y, dfscale_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + + y = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(rvv_sp_vandnot_vo_vo_vo(o, vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0))), + dfsub_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(3.1415927410125732422f, -8.7422776573475857731e-08f), y), y); + + return vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_atanfx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef d2 = atan2kf_u1_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(0)), vcast_vf2_f_f_rvvm1_sleef(1, 0)); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d2), vf2gety_vf_vf2_rvvm1_sleef(d2)); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1.570796326794896557998982), r); + return vmulsign_vf_vf_vf_rvvm1_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_logfx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef x, x2, t, m; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = vdiv_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(1.0f)), vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(x, x); + + t = vcast_vf_f_rvvm1_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, t, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.693147180559945286226764f), vcast_vf_vi2_rvvm1_sleef(e))); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(vispinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), visnan_vo_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), x); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(-__builtin_inff()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_expfx_u10rvvm1(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_rvvm1_sleef s, u; + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_rvvm1_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.5)); + + u = vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, s), u, s)); + + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-104)), vreinterpret_vm_vf_rvvm1_sleef(u))); + u = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(100), d), vcast_vf_f_rvvm1_sleef(__builtin_inff()), u); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef expm1fk_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_rvvm1_sleef s, u; + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-1.428606765330187045e-06f), s); + + vfloat_rvvm1_sleef s2 = vmul_vf_vf_vf_rvvm1_sleef(s, s), s4 = vmul_vf_vf_vf_rvvm1_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_rvvm1_sleef((s4), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.000198527617612853646278381)), (vcast_vf_f_rvvm1_sleef(0.00139304355252534151077271)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((s2), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.00833336077630519866943359)), (vcast_vf_f_rvvm1_sleef(0.0416664853692054748535156)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((s), (vcast_vf_f_rvvm1_sleef(0.166666671633720397949219)), (vcast_vf_f_rvvm1_sleef(0.5))))))) + + ; + + u = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, s), u, s); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(0)), u, + vsub_vf_vf_vf_rvvm1_sleef(vldexp2_vf_vf_vi2_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(1)), q), vcast_vf_f_rvvm1_sleef(1))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sqrtfx_u35rvvm1(vfloat_rvvm1_sleef d) { return vsqrt_vf_vf_rvvm1_sleef(d); } + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_cbrtfx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef x, y, q = vcast_vf_f_rvvm1_sleef(1.0), t; + vint2_rvvm1_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_rvvm1_sleef(vilogbk_vi2_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d)), vcast_vi2_i_rvvm1_sleef(1)); + d = vldexp2_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + + t = vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(e), vcast_vf_f_rvvm1_sleef(6144)); + qu = vtruncate_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(t, vcast_vf_f_rvvm1_sleef(1.0f/3.0f))); + re = vtruncate_vi2_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(t, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(qu), vcast_vf_f_rvvm1_sleef(3)))); + + q = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(re, vcast_vi2_i_rvvm1_sleef(1)), vcast_vf_f_rvvm1_sleef(1.2599210498948731647672106f), q); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(re, vcast_vi2_i_rvvm1_sleef(2)), vcast_vf_f_rvvm1_sleef(1.5874010519681994747517056f), q); + q = vldexp2_vf_vf_vi2_rvvm1_sleef(q, vsub_vi2_vi2_vi2_rvvm1_sleef(qu, vcast_vi2_i_rvvm1_sleef(2048))); + + q = vmulsign_vf_vf_vf_rvvm1_sleef(q, d); + d = vabs_vf_vf_rvvm1_sleef(d); + + x = vcast_vf_f_rvvm1_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, x), x); + y = vmul_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(y, vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2.0f / 3.0f), y), vmla_vf_vf_vf_vf_rvvm1_sleef(y, x, vcast_vf_f_rvvm1_sleef(-1.0f)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_cbrtfx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef x, y, z, t; + vfloat2_rvvm1_sleef q2 = vcast_vf2_f_f_rvvm1_sleef(1, 0), u, v; + vint2_rvvm1_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_rvvm1_sleef(vilogbk_vi2_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d)), vcast_vi2_i_rvvm1_sleef(1)); + d = vldexp2_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + + t = vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(e), vcast_vf_f_rvvm1_sleef(6144)); + qu = vtruncate_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(t, vcast_vf_f_rvvm1_sleef(1.0/3.0))); + re = vtruncate_vi2_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(t, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(qu), vcast_vf_f_rvvm1_sleef(3)))); + + q2 = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(re, vcast_vi2_i_rvvm1_sleef(1)), vcast_vf2_f_f_rvvm1_sleef(1.2599210739135742188f, -2.4018701694217270415e-08), q2); + q2 = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(veq_vo_vi2_vi2_rvvm1_sleef(re, vcast_vi2_i_rvvm1_sleef(2)), vcast_vf2_f_f_rvvm1_sleef(1.5874010324478149414f, 1.9520385308169352356e-08), q2); + + q2 = vf2setx_vf2_vf2_vf_rvvm1_sleef(q2, vmulsign_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(q2), d)); + q2 = vf2sety_vf2_vf2_vf_rvvm1_sleef(q2, vmulsign_vf_vf_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(q2), d)); + d = vabs_vf_vf_rvvm1_sleef(d); + + x = vcast_vf_f_rvvm1_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, d, vcast_vf_f_rvvm1_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_rvvm1_sleef(x, x); y = vmul_vf_vf_vf_rvvm1_sleef(y, y); x = vsub_vf_vf_vf_rvvm1_sleef(x, vmul_vf_vf_vf_rvvm1_sleef(vmlanp_vf_vf_vf_vf_rvvm1_sleef(d, y, x), vcast_vf_f_rvvm1_sleef(-1.0 / 3.0))); + + z = x; + + u = dfmul_vf2_vf_vf_rvvm1_sleef(x, x); + u = dfmul_vf2_vf2_vf2_rvvm1_sleef(u, u); + u = dfmul_vf2_vf2_vf_rvvm1_sleef(u, d); + u = dfadd2_vf2_vf2_vf_rvvm1_sleef(u, vneg_vf_vf_rvvm1_sleef(x)); + y = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(u), vf2gety_vf_vf2_rvvm1_sleef(u)); + + y = vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-2.0 / 3.0), y), z); + v = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf_vf_rvvm1_sleef(z, z), y); + v = dfmul_vf2_vf2_vf_rvvm1_sleef(v, d); + v = dfmul_vf2_vf2_vf2_rvvm1_sleef(v, q2); + z = vldexp2_vf_vf_vi2_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(v), vf2gety_vf_vf2_rvvm1_sleef(v)), vsub_vi2_vi2_vi2_rvvm1_sleef(qu, vcast_vi2_i_rvvm1_sleef(2048))); + + z = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(__builtin_inff()), vf2getx_vf_vf2_rvvm1_sleef(q2)), z); + z = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vreinterpret_vf_vm_rvvm1_sleef(vsignbit_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(q2))), z); + + return z; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef logkf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x, x2; + vfloat_rvvm1_sleef t, m; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), m), dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), m)); + x2 = dfsqu_vf2_vf2_rvvm1_sleef(x); + + t = vcast_vf_f_rvvm1_sleef(0.240320354700088500976562); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(x2), vcast_vf_f_rvvm1_sleef(0.285112679004669189453125)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(x2), vcast_vf_f_rvvm1_sleef(0.400007992982864379882812)); + vfloat2_rvvm1_sleef c = vcast_vf2_f_f_rvvm1_sleef(0.66666662693023681640625f, 3.69183861259614332084311e-09f); + + vfloat2_rvvm1_sleef s = dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_rvvm1_sleef(e)); + + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfscale_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfmul_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(x2, x), + dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(x2, t), c))); + return s; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef logk3f_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef x, x2, t, m; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = vdiv_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(1.0f)), vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(x, x); + + t = vcast_vf_f_rvvm1_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_rvvm1_sleef(x, t, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.693147180559945286226764f), vcast_vf_vi2_rvvm1_sleef(e))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_logfx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x; + vfloat_rvvm1_sleef t, m, x2; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + vfloat2_rvvm1_sleef s = dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_rvvm1_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), m), dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)); + + t = vcast_vf_f_rvvm1_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfscale_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x)), t)); + + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), vf2gety_vf_vf2_rvvm1_sleef(s)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vispinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), visnan_vo_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(-__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef expkf_rvvm1_sleef(vfloat2_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + vfloat2_rvvm1_sleef s, t; + + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(d, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-1.428606765330187045e-06f))); + + s = dfnormalize_vf2_vf2_rvvm1_sleef(s); + + u = vcast_vf_f_rvvm1_sleef(0.00136324646882712841033936f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.00836596917361021041870117f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.0416710823774337768554688f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.166665524244308471679688f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(0.499999850988388061523438f)); + + t = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfmul_vf2_vf2_vf_rvvm1_sleef(dfsqu_vf2_vf2_rvvm1_sleef(s), u)); + + t = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), t); + u = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t), vf2gety_vf_vf2_rvvm1_sleef(t)); + u = vldexp_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-104)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef expk3f_rvvm1_sleef(vfloat_rvvm1_sleef d) { + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_rvvm1_sleef s, u; + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_rvvm1_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(0.5)); + + u = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(s, s), u, vadd_vf_vf_vf_rvvm1_sleef(s, vcast_vf_f_rvvm1_sleef(1.0f))); + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-104)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_powfx_u10rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + + rvv_sp_vopmask_rvvm1_sleef yisint = rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(vtruncate_vf_vf_rvvm1_sleef(y), y), vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), vcast_vf_f_rvvm1_sleef(1 << 24))); + rvv_sp_vopmask_rvvm1_sleef yisodd = rvv_sp_vand_vo_vo_vo(rvv_sp_vand_vo_vo_vo(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(y), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), yisint), + vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), vcast_vf_f_rvvm1_sleef(1 << 24))); + + vfloat_rvvm1_sleef result = expkf_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(logkf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x)), y)); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(result), vcast_vf_f_rvvm1_sleef(__builtin_inff()), result); + + result = vmul_vf_vf_vf_rvvm1_sleef(result, + vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), + vcast_vf_f_rvvm1_sleef(1), + vsel_vf_vo_vf_vf_rvvm1_sleef(yisint, vsel_vf_vo_vf_vf_rvvm1_sleef(yisodd, vcast_vf_f_rvvm1_sleef(-1.0f), vcast_vf_f_rvvm1_sleef(1)), vcast_vf_f_rvvm1_sleef(__builtin_nanf(""))))); + + vfloat_rvvm1_sleef efx = vmulsign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(1)), y); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(y), + vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(efx, vcast_vf_f_rvvm1_sleef(0.0f)), + vreinterpret_vm_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(efx, vcast_vf_f_rvvm1_sleef(0.0f)), + vcast_vf_f_rvvm1_sleef(1.0f), + vcast_vf_f_rvvm1_sleef(__builtin_inff()))))), + result); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0.0))), + vmulsign_vf_vf_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vxor_vo_vo_vo(vsignbit_vo_vf_rvvm1_sleef(y), veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0.0f))), + vcast_vf_f_rvvm1_sleef(0), vcast_vf_f_rvvm1_sleef(__builtin_inff())), + vsel_vf_vo_vf_vf_rvvm1_sleef(yisodd, x, vcast_vf_f_rvvm1_sleef(1))), result); + + result = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vreinterpret_vm_vf_rvvm1_sleef(result))); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0)), veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1))), vcast_vf_f_rvvm1_sleef(1), result); + + return result; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fastpowfx_u3500rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef result = expk3f_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(logk3f_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x)), y)); + rvv_sp_vopmask_rvvm1_sleef yisint = rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(vtruncate_vf_vf_rvvm1_sleef(y), y), vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), vcast_vf_f_rvvm1_sleef(1 << 24))); + rvv_sp_vopmask_rvvm1_sleef yisodd = rvv_sp_vand_vo_vo_vo(rvv_sp_vand_vo_vo_vo(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(y), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), yisint), + vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(y), vcast_vf_f_rvvm1_sleef(1 << 24))); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(vsignbit_vo_vf_rvvm1_sleef(x), yisodd), vneg_vf_vf_rvvm1_sleef(result), result); + + result = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(0), result); + result = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(1), result); + + return result; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef expk2f_rvvm1_sleef(vfloat2_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + vfloat2_rvvm1_sleef s, t; + + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(d, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(-1.428606765330187045e-06f))); + + u = vcast_vf_f_rvvm1_sleef(+0.1980960224e-3f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(+0.1394256484e-2f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(+0.8333456703e-2f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vf2getx_vf_vf2_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(+0.4166637361e-1f)); + + t = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(s, u), vcast_vf_f_rvvm1_sleef(+0.166666659414234244790680580464e+0f)); + t = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(s, t), vcast_vf_f_rvvm1_sleef(0.5)); + t = dfadd2_vf2_vf2_vf2_rvvm1_sleef(s, dfmul_vf2_vf2_vf2_rvvm1_sleef(dfsqu_vf2_vf2_rvvm1_sleef(s), t)); + + t = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), t); + + t = vf2setx_vf2_vf2_vf_rvvm1_sleef(t, vldexp2_vf_vf_vi2_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t), q)); + t = vf2sety_vf2_vf2_vf_rvvm1_sleef(t, vldexp2_vf_vf_vi2_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(t), q)); + + t = vf2setx_vf2_vf2_vf_rvvm1_sleef(t, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-104)), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t))))); + t = vf2sety_vf2_vf2_vf_rvvm1_sleef(t, vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-104)), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sinhfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef y = vabs_vf_vf_rvvm1_sleef(x); + vfloat2_rvvm1_sleef d = expk2f_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0))); + d = dfsub_vf2_vf2_vf2_rvvm1_sleef(d, dfrec_vf2_vf2_rvvm1_sleef(d)); + y = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(89)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_rvvm1_sleef(y, x); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_coshfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef y = vabs_vf_vf_rvvm1_sleef(x); + vfloat2_rvvm1_sleef d = expk2f_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0))); + d = dfadd_vf2_vf2_vf2_rvvm1_sleef(d, dfrec_vf2_vf2_rvvm1_sleef(d)); + y = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(89)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_tanhfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef y = vabs_vf_vf_rvvm1_sleef(x); + vfloat2_rvvm1_sleef d = expk2f_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0))); + vfloat2_rvvm1_sleef e = dfrec_vf2_vf2_rvvm1_sleef(d); + d = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd_vf2_vf2_vf2_rvvm1_sleef(d, dfneg_vf2_vf2_rvvm1_sleef(e)), dfadd_vf2_vf2_vf2_rvvm1_sleef(d, e)); + y = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(8.664339742f)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_rvvm1_sleef(y, x); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sinhfx_u35rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef e = expm1fk_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x)); + vfloat_rvvm1_sleef y = vdiv_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(e, vcast_vf_f_rvvm1_sleef(2)), vadd_vf_vf_vf_rvvm1_sleef(e, vcast_vf_f_rvvm1_sleef(1))); + y = vmul_vf_vf_vf_rvvm1_sleef(y, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5f), e)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(88)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_rvvm1_sleef(y, x); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_coshfx_u35rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef e = Sleef_expfx_u10rvvm1(vabs_vf_vf_rvvm1_sleef(x)); + vfloat_rvvm1_sleef y = vmla_vf_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5f), e, vdiv_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5), e)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(88)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_tanhfx_u35rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef d = expm1fk_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2), vabs_vf_vf_rvvm1_sleef(x))); + vfloat_rvvm1_sleef y = vdiv_vf_vf_vf_rvvm1_sleef(d, vadd_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2), d)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(8.664339742f)), + visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_rvvm1_sleef(y, x); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef logk2f_rvvm1_sleef(vfloat2_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x, x2, m, s; + vfloat_rvvm1_sleef t; + vint2_rvvm1_sleef e; + + e = vilogbk_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + + m = dfscale_vf2_vf2_vf_rvvm1_sleef(d, vpow2i_vf_vi2_rvvm1_sleef(vneg_vi2_vi2_rvvm1_sleef(e))); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(-1)), dfadd2_vf2_vf2_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(1))); + x2 = dfsqu_vf2_vf2_rvvm1_sleef(x); + + t = vcast_vf_f_rvvm1_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(x2), vcast_vf_f_rvvm1_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(x2), vcast_vf_f_rvvm1_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(x2), vcast_vf_f_rvvm1_sleef(0.666666686534881591796875f)); + + s = dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.69314718246459960938f), vcast_vf_f_rvvm1_sleef(-1.904654323148236017e-09f)), vcast_vf_vi2_rvvm1_sleef(e)); + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfscale_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfmul_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_asinhfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef y = vabs_vf_vf_rvvm1_sleef(x); + rvv_sp_vopmask_rvvm1_sleef o = vgt_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(1)); + vfloat2_rvvm1_sleef d; + + d = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfrec_vf2_vf_rvvm1_sleef(x), vcast_vf2_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0))); + d = dfsqrt_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(dfsqu_vf2_vf2_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1))); + d = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfmul_vf2_vf2_vf_rvvm1_sleef(d, y), d); + + d = logk2f_rvvm1_sleef(dfnormalize_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(d, x))); + y = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(18446743523953729536.0)), + visnan_vo_vf_rvvm1_sleef(y)), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(__builtin_inff()), x), y); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + y = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_acoshfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat2_rvvm1_sleef d = logk2f_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(dfsqrt_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1))), dfsqrt_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(-1)))), x)); + vfloat_rvvm1_sleef y = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)); + + y = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(18446743523953729536.0)), + visnan_vo_vf_rvvm1_sleef(y)), + vcast_vf_f_rvvm1_sleef(__builtin_inff()), y); + + y = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1.0f)), vreinterpret_vm_vf_rvvm1_sleef(y))); + + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1.0f)), vreinterpret_vm_vf_rvvm1_sleef(y))); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_atanhfx_u10rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef y = vabs_vf_vf_rvvm1_sleef(x); + vfloat2_rvvm1_sleef d = logk2f_rvvm1_sleef(dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), y), dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vneg_vf_vf_rvvm1_sleef(y)))); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(1.0)), vreinterpret_vm_vf_rvvm1_sleef(vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(1.0)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(0.5)))))); + + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vreinterpret_vm_vf_rvvm1_sleef(y))); + y = vmulsign_vf_vf_vf_rvvm1_sleef(y, x); + y = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(x), vreinterpret_vm_vf_rvvm1_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_exp2fx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vrint_vf_vf_rvvm1_sleef(d), s; + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + + s = vsub_vf_vf_vf_rvvm1_sleef(d, u); + + u = vcast_vf_f_rvvm1_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.6931471825e+0)); + + u = vfma_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(1)); + + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(vge_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(128)), vcast_vf_f_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-150)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_exp2fx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vrint_vf_vf_rvvm1_sleef(d), s; + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + + s = vsub_vf_vf_vf_rvvm1_sleef(d, u); + + u = vcast_vf_f_rvvm1_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.6931471825e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(vge_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(128)), vcast_vf_f_rvvm1_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-150)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_exp10fx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vrint_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_rvvm1_sleef(+0.6802555919e-1); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2078080326e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.5393903852e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1171245337e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2034678698e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2650949001e+1)); + vfloat2_rvvm1_sleef x = dfadd_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(2.3025851249694824219, -3.1705172516493593157e-08), vmul_vf_vf_vf_rvvm1_sleef(u, s)); + u = vf2getx_vf_vf2_rvvm1_sleef(dfnormalize_vf2_vf2_rvvm1_sleef(dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf2_vf_rvvm1_sleef(x, s)))); + + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(38.5318394191036238941387f)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-50)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_exp10fx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef u = vrint_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_rvvm1_sleef q = vrint_vi2_vf_rvvm1_sleef(u); + + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_rvvm1_sleef(u, vcast_vf_f_rvvm1_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_rvvm1_sleef(+0.2064004987e+0); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.5417877436e+0)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1171286821e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2034656048e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2650948763e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.2302585125e+1)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vcast_vf_f_rvvm1_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_rvvm1_sleef(u, q); + + u = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(38.5318394191036238941387f)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-50)), vreinterpret_vm_vf_rvvm1_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_expm1fx_u10rvvm1(vfloat_rvvm1_sleef a) { + vfloat2_rvvm1_sleef d = dfadd2_vf2_vf2_vf_rvvm1_sleef(expk2f_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0))), vcast_vf_f_rvvm1_sleef(-1.0)); + vfloat_rvvm1_sleef x = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(d), vf2gety_vf_vf2_rvvm1_sleef(d)); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(88.72283172607421875f)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(-16.635532333438687426013570f)), vcast_vf_f_rvvm1_sleef(-1), x); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(a), vcast_vf_f_rvvm1_sleef(-0.0f), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_log10fx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x; + vfloat_rvvm1_sleef t, m, x2; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), m), dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)); + + t = vcast_vf_f_rvvm1_sleef(+0.1314289868e+0); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef( +0.1735493541e+0)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef( +0.2895309627e+0)); + + vfloat2_rvvm1_sleef s = dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(0.30103001, -1.432098889e-08), vcast_vf_vi2_rvvm1_sleef(e)); + + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfmul_vf2_vf2_vf2_rvvm1_sleef(x, vcast_vf2_f_f_rvvm1_sleef(0.868588984, -2.170757285e-08))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x)), t)); + + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), vf2gety_vf_vf2_rvvm1_sleef(s)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vispinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), visnan_vo_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_log2fx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x; + vfloat_rvvm1_sleef t, m, x2; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), m), dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)); + + t = vcast_vf_f_rvvm1_sleef(+0.4374550283e+0f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.5764790177e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.9618012905120f)); + + vfloat2_rvvm1_sleef s = dfadd2_vf2_vf_vf2_rvvm1_sleef(vcast_vf_vi2_rvvm1_sleef(e), + dfmul_vf2_vf2_vf2_rvvm1_sleef(x, vcast_vf2_f_f_rvvm1_sleef(2.8853900432586669922, 3.2734474483568488616e-08))); + + s = dfadd2_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x)), t)); + + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), vf2gety_vf_vf2_rvvm1_sleef(s)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vispinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), visnan_vo_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_log2fx_u35rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef m, t, x, x2; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_rvvm1_sleef(d, vneg_vi2_vi2_rvvm1_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + + x = vdiv_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(1)), vadd_vf_vf_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(1))); + x2 = vmul_vf_vf_vf_rvvm1_sleef(x, x); + + t = vcast_vf_f_rvvm1_sleef(+0.4374088347e+0); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.5764843822e+0)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.9618024230e+0)); + + vfloat_rvvm1_sleef r = vmla_vf_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x2, x), t, + vmla_vf_vf_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(+0.2885390043e+1), vcast_vf_vi2_rvvm1_sleef(e))); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vispinf_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), visnan_vo_vf_rvvm1_sleef(d)), vcast_vf_f_rvvm1_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_log1pfx_u10rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x; + vfloat_rvvm1_sleef t, m, x2; + + vfloat_rvvm1_sleef dp1 = vadd_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1)); + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(dp1, vcast_vf_f_rvvm1_sleef(0x1p-126)); + dp1 = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(dp1, vcast_vf_f_rvvm1_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), dp1); + vint2_rvvm1_sleef e = vilogb2k_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(dp1, vcast_vf_f_rvvm1_sleef(1.0f/0.75f))); + t = vldexp3_vf_vf_vi2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vneg_vi2_vi2_rvvm1_sleef(e)); + m = vmla_vf_vf_vf_vf_rvvm1_sleef(d, t, vsub_vf_vf_vf_rvvm1_sleef(t, vcast_vf_f_rvvm1_sleef(1))); + e = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(o, vsub_vi2_vi2_vi2_rvvm1_sleef(e, vcast_vi2_i_rvvm1_sleef(64)), e); + vfloat2_rvvm1_sleef s = dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_rvvm1_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(m, vcast_vf_f_rvvm1_sleef(0)), dfadd_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2), m)); + x2 = vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2getx_vf_vf2_rvvm1_sleef(x)); + + t = vcast_vf_f_rvvm1_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, x2, vcast_vf_f_rvvm1_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_rvvm1_sleef(s, dfscale_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2))); + s = dfadd_vf2_vf2_vf_rvvm1_sleef(s, vmul_vf_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x2, vf2getx_vf_vf2_rvvm1_sleef(x)), t)); + + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(s), vf2gety_vf_vf2_rvvm1_sleef(s)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1e+38)), vcast_vf_f_rvvm1_sleef(__builtin_inff()), r); + r = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), d), vreinterpret_vm_vf_rvvm1_sleef(r))); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(-1)), vcast_vf_f_rvvm1_sleef(-__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-0.0f), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fabsfx_rvvm1(vfloat_rvvm1_sleef x) { return vabs_vf_vf_rvvm1_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_copysignfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { return vcopysign_vf_vf_vf_rvvm1_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fmaxfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + + return vsel_vf_vo_vf_vf_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(y), x, vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fminfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + + return vsel_vf_vo_vf_vf_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(y), x, vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fdimfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef ret = vsub_vf_vf_vf_rvvm1_sleef(x, y); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(ret, vcast_vf_f_rvvm1_sleef(0)), veq_vo_vf_vf_rvvm1_sleef(x, y)), vcast_vf_f_rvvm1_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_truncfx_rvvm1(vfloat_rvvm1_sleef x) { + + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + return vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), vge_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, fr), x)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_floorfx_rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + fr = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(0)), vadd_vf_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(1.0f)), fr); + return vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), vge_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_ceilfx_rvvm1(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + fr = vsel_vf_vo_vf_vf_rvvm1_sleef(vle_vo_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(0)), fr, vsub_vf_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(1.0f))); + return vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(x), vge_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_roundfx_rvvm1(vfloat_rvvm1_sleef d) { + vfloat_rvvm1_sleef x = vadd_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.5f)); + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(vle_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), veq_vo_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(0))), vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1.0f)), x); + fr = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(0)), vadd_vf_vf_vf_rvvm1_sleef(fr, vcast_vf_f_rvvm1_sleef(1.0f)), fr); + x = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.4999999701976776123f)), vcast_vf_f_rvvm1_sleef(0), x); + return vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(d), vge_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23))), d, vcopysign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(x, fr), d)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_rintfx_rvvm1(vfloat_rvvm1_sleef d) { + + vfloat_rvvm1_sleef c = vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1 << 23), d); + return vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1 << 23)), + d, vorsign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(d, c), c), d)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fmafx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y, vfloat_rvvm1_sleef z) { + + return vfma_vf_vf_vf_vf_rvvm1_sleef(x, y, z); + +} + +SLEEF_INLINE vfloat_rvvm1_sleef Sleef_sqrtfx_u05rvvm1(vfloat_rvvm1_sleef d) { + + vfloat_rvvm1_sleef q, w, x, y, z; + + d = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), d); + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(5.2939559203393770e-23f)); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.8889465931478580e+22f)), d); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vcast_vf_f_rvvm1_sleef(7.2759576141834260e-12f), vcast_vf_f_rvvm1_sleef(1.0f)); + + y = vreinterpret_vf_vi2_rvvm1_sleef(vsub_vi2_vi2_vi2_rvvm1_sleef(vcast_vi2_i_rvvm1_sleef(0x5f3759df), vsrl_vi2_vi2_i_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(d), 1))); + + x = vmul_vf_vf_vf_rvvm1_sleef(d, y); w = vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5), y); + y = vfmanp_vf_vf_vf_vf_rvvm1_sleef(x, w, vcast_vf_f_rvvm1_sleef(0.5)); + x = vfma_vf_vf_vf_vf_rvvm1_sleef(x, y, x); w = vfma_vf_vf_vf_vf_rvvm1_sleef(w, y, w); + y = vfmanp_vf_vf_vf_vf_rvvm1_sleef(x, w, vcast_vf_f_rvvm1_sleef(0.5)); + x = vfma_vf_vf_vf_vf_rvvm1_sleef(x, y, x); w = vfma_vf_vf_vf_vf_rvvm1_sleef(w, y, w); + + y = vfmanp_vf_vf_vf_vf_rvvm1_sleef(x, w, vcast_vf_f_rvvm1_sleef(1.5)); w = vadd_vf_vf_vf_rvvm1_sleef(w, w); + w = vmul_vf_vf_vf_rvvm1_sleef(w, y); + x = vmul_vf_vf_vf_rvvm1_sleef(w, d); + y = vfmapn_vf_vf_vf_vf_rvvm1_sleef(w, d, x); z = vfmanp_vf_vf_vf_vf_rvvm1_sleef(w, x, vcast_vf_f_rvvm1_sleef(1)); + + z = vfmanp_vf_vf_vf_vf_rvvm1_sleef(w, y, z); w = vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5), x); + w = vfma_vf_vf_vf_vf_rvvm1_sleef(w, z, y); + w = vadd_vf_vf_vf_rvvm1_sleef(w, x); + + w = vmul_vf_vf_vf_rvvm1_sleef(w, q); + + w = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), + veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(__builtin_inff()))), d, w); + + w = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sqrtfx_rvvm1(vfloat_rvvm1_sleef d) { + + return Sleef_sqrtfx_u05rvvm1(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_hypotfx_u05rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + x = vabs_vf_vf_rvvm1_sleef(x); + y = vabs_vf_vf_rvvm1_sleef(y); + vfloat_rvvm1_sleef min = vmin_vf_vf_vf_rvvm1_sleef(x, y), n = min; + vfloat_rvvm1_sleef max = vmax_vf_vf_vf_rvvm1_sleef(x, y), d = max; + + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(max, vcast_vf_f_rvvm1_sleef(0x1p-126)); + n = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(n, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 24)), n); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 24)), d); + + vfloat2_rvvm1_sleef t = dfdiv_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_vf_vf_rvvm1_sleef(n, vcast_vf_f_rvvm1_sleef(0)), vcast_vf2_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0))); + t = dfmul_vf2_vf2_vf_rvvm1_sleef(dfsqrt_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(dfsqu_vf2_vf2_rvvm1_sleef(t), vcast_vf_f_rvvm1_sleef(1))), max); + vfloat_rvvm1_sleef ret = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t), vf2gety_vf_vf2_rvvm1_sleef(t)); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(ret), vcast_vf_f_rvvm1_sleef(__builtin_inff()), ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(min, vcast_vf_f_rvvm1_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(__builtin_inff())), veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(__builtin_inff()))), vcast_vf_f_rvvm1_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_hypotfx_u35rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + x = vabs_vf_vf_rvvm1_sleef(x); + y = vabs_vf_vf_rvvm1_sleef(y); + vfloat_rvvm1_sleef min = vmin_vf_vf_vf_rvvm1_sleef(x, y); + vfloat_rvvm1_sleef max = vmax_vf_vf_vf_rvvm1_sleef(x, y); + + vfloat_rvvm1_sleef t = vdiv_vf_vf_vf_rvvm1_sleef(min, max); + vfloat_rvvm1_sleef ret = vmul_vf_vf_vf_rvvm1_sleef(max, vsqrt_vf_vf_rvvm1_sleef(vmla_vf_vf_vf_vf_rvvm1_sleef(t, t, vcast_vf_f_rvvm1_sleef(1)))); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(min, vcast_vf_f_rvvm1_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(__builtin_inff())), veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(__builtin_inff()))), vcast_vf_f_rvvm1_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_nextafterfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + x = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0), y), x); + vint2_rvvm1_sleef xi2 = vreinterpret_vi2_vf_rvvm1_sleef(x); + rvv_sp_vopmask_rvvm1_sleef c = rvv_sp_vxor_vo_vo_vo(vsignbit_vo_vf_rvvm1_sleef(x), vge_vo_vf_vf_rvvm1_sleef(y, x)); + + xi2 = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(c, vsub_vi2_vi2_vi2_rvvm1_sleef(vcast_vi2_i_rvvm1_sleef(0), vxor_vi2_vi2_vi2_rvvm1_sleef(xi2, vcast_vi2_i_rvvm1_sleef((int)(1U << 31)))), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(vneq_vo_vf_vf_rvvm1_sleef(x, y), vsub_vi2_vi2_vi2_rvvm1_sleef(xi2, vcast_vi2_i_rvvm1_sleef(1)), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_rvvm1_sleef(c, vsub_vi2_vi2_vi2_rvvm1_sleef(vcast_vi2_i_rvvm1_sleef(0), vxor_vi2_vi2_vi2_rvvm1_sleef(xi2, vcast_vi2_i_rvvm1_sleef((int)(1U << 31)))), xi2); + + vfloat_rvvm1_sleef ret = vreinterpret_vf_vi2_rvvm1_sleef(xi2); + + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(ret, vcast_vf_f_rvvm1_sleef(0)), vneq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0))), + vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0), x), ret); + + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), veq_vo_vf_vf_rvvm1_sleef(y, vcast_vf_f_rvvm1_sleef(0))), y, ret); + + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(visnan_vo_vf_rvvm1_sleef(x), visnan_vo_vf_rvvm1_sleef(y)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_frfrexpfx_rvvm1(vfloat_rvvm1_sleef x) { + x = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(0x1p-126)), vmul_vf_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 30)), x); + + vmask_rvvm1_sleef xm = vreinterpret_vm_vf_rvvm1_sleef(x); + xm = vand_vm_vm_vm_rvvm1_sleef(xm, vcast_vm_i_i_rvvm1_sleef(~0x7f800000U, ~0x7f800000U)); + xm = vor_vm_vm_vm_rvvm1_sleef (xm, vcast_vm_i_i_rvvm1_sleef( 0x3f000000U, 0x3f000000U)); + + vfloat_rvvm1_sleef ret = vreinterpret_vf_vm_rvvm1_sleef(xm); + + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(x), vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(__builtin_inff()), x), ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint2_rvvm1_sleef Sleef_expfrexpfx_rvvm1(vfloat_rvvm1_sleef x) { + + return vcast_vi2_i_rvvm1_sleef(0); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vtoward0_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x) { + vfloat_rvvm1_sleef t = vreinterpret_vf_vi2_rvvm1_sleef(vsub_vi2_vi2_vi2_rvvm1_sleef(vreinterpret_vi2_vf_rvvm1_sleef(x), vcast_vi2_i_rvvm1_sleef(1))); + return vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vptrunc_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef x) { + + vfloat_rvvm1_sleef fr = vsub_vf_vf_vf_rvvm1_sleef(x, vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(x))); + return vsel_vf_vo_vf_vf_rvvm1_sleef(vge_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(INT64_C(1) << 23)), x, vsub_vf_vf_vf_rvvm1_sleef(x, fr)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_fmodfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef nu = vabs_vf_vf_rvvm1_sleef(x), de = vabs_vf_vf_rvvm1_sleef(y), s = vcast_vf_f_rvvm1_sleef(1), q; + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(de, vcast_vf_f_rvvm1_sleef(0x1p-126)); + nu = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(nu, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 25)), nu); + de = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(de, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 25)), de); + s = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(s , vcast_vf_f_rvvm1_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat_rvvm1_sleef rde = vtoward0_vf_vf_rvvm1_sleef(vrec_vf_vf_rvvm1_sleef(de)); + + vfloat2_rvvm1_sleef r = vcast_vf2_vf_vf_rvvm1_sleef(nu, vcast_vf_f_rvvm1_sleef(0)); + + for(int i=0;i<8;i++) { + q = vptrunc_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vtoward0_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r)), rde)); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(3), de), vf2getx_vf_vf2_rvvm1_sleef(r)), + vge_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), de)), + vcast_vf_f_rvvm1_sleef(2), q); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vand_vo_vo_vo(vgt_vo_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2), de), vf2getx_vf_vf2_rvvm1_sleef(r)), + vge_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), de)), + vcast_vf_f_rvvm1_sleef(1), q); + r = dfnormalize_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf2_rvvm1_sleef(r, dfmul_vf2_vf_vf_rvvm1_sleef(vptrunc_vf_vf_rvvm1_sleef(q), vneg_vf_vf_rvvm1_sleef(de)))); + if (vtestallones_i_vo32_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), de))) break; + } + + vfloat_rvvm1_sleef ret = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), vf2gety_vf_vf2_rvvm1_sleef(r)), s); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), vf2gety_vf_vf2_rvvm1_sleef(r)), de), vcast_vf_f_rvvm1_sleef(0), ret); + + ret = vmulsign_vf_vf_vf_rvvm1_sleef(ret, x); + + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(nu, de), x, ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(de, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_rvvm1_sleef vrintfk2_vf_vf_rvvm1_sleef(vfloat_rvvm1_sleef d) { + + vfloat_rvvm1_sleef c = vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1 << 23), d); + return vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(1 << 23)), + d, vorsign_vf_vf_vf_rvvm1_sleef(vsub_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(d, c), c), d)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_remainderfx_rvvm1(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef y) { + vfloat_rvvm1_sleef n = vabs_vf_vf_rvvm1_sleef(x), d = vabs_vf_vf_rvvm1_sleef(y), s = vcast_vf_f_rvvm1_sleef(1), q; + rvv_sp_vopmask_rvvm1_sleef o = vlt_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0x1p-126*2)); + n = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(n, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 25)), n); + d = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(UINT64_C(1) << 25)), d); + s = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmul_vf_vf_vf_rvvm1_sleef(s , vcast_vf_f_rvvm1_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat2_rvvm1_sleef r = vcast_vf2_vf_vf_rvvm1_sleef(n, vcast_vf_f_rvvm1_sleef(0)); + vfloat_rvvm1_sleef rd = vrec_vf_vf_rvvm1_sleef(d); + rvv_sp_vopmask_rvvm1_sleef qisodd = vneq_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0), vcast_vf_f_rvvm1_sleef(0)); + + for(int i=0;i<8;i++) { + q = vrintfk2_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), rd)); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r)), vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(1.5f))), vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1.0f), vf2getx_vf_vf2_rvvm1_sleef(r)), q); + q = vsel_vf_vo_vf_vf_rvvm1_sleef(rvv_sp_vor_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r)), vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.5f))), + rvv_sp_vandnot_vo_vo_vo(qisodd, veq_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r)), vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0.5f))))), + vcast_vf_f_rvvm1_sleef(0.0), q); + if (vtestallones_i_vo32_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(q, vcast_vf_f_rvvm1_sleef(0)))) break; + q = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(q, vneg_vf_vf_rvvm1_sleef(d))), vadd_vf_vf_vf_rvvm1_sleef(q, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-1), vf2getx_vf_vf2_rvvm1_sleef(r))), q); + qisodd = rvv_sp_vxor_vo_vo_vo(qisodd, rvv_sp_vand_vo_vo_vo(veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(q), vcast_vi2_i_rvvm1_sleef(1)), vcast_vi2_i_rvvm1_sleef(1)), + vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(q), vcast_vf_f_rvvm1_sleef(1 << 24)))); + r = dfnormalize_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf2_rvvm1_sleef(r, dfmul_vf2_vf_vf_rvvm1_sleef(q, vneg_vf_vf_rvvm1_sleef(d)))); + } + + vfloat_rvvm1_sleef ret = vmul_vf_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(r), vf2gety_vf_vf2_rvvm1_sleef(r)), s); + ret = vmulsign_vf_vf_vf_rvvm1_sleef(ret, x); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(y), vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), x), ret); + ret = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), ret); + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef sinpifk_rvvm1_sleef(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, t; + vfloat2_rvvm1_sleef x, s2; + + u = vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(4.0)); + vint2_rvvm1_sleef q = vtruncate_vi2_vf_rvvm1_sleef(u); + q = vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vxor_vi2_vi2_vi2_rvvm1_sleef(vsrl_vi2_vi2_i_rvvm1_sleef(q, 31), vcast_vi2_i_rvvm1_sleef(1))), vcast_vi2_i_rvvm1_sleef(~1)); + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(2)); + + s = vsub_vf_vf_vf_rvvm1_sleef(u, vcast_vf_vi2_rvvm1_sleef(q)); + t = s; + s = vmul_vf_vf_vf_rvvm1_sleef(s, s); + s2 = dfmul_vf2_vf_vf_rvvm1_sleef(t, t); + + u = vsel_vf_vo_f_f_rvvm1_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vsel_vf_vo_f_f_rvvm1_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vsel_vf_vo_f_f_rvvm1_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(u, s), + vsel_vf2_vo_f_f_f_f_rvvm1_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_rvvm1_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_rvvm1_sleef(x, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, s2, vcast_vf2_vf_vf_rvvm1_sleef(t, vcast_vf_f_rvvm1_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1)), x); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + x = vf2setx_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x))))); + x = vf2sety_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_sinpifx_u05rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x = sinpifk_rvvm1_sleef(d); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visnegzero_vo_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(-0.0), r); + r = vreinterpret_vf_vm_rvvm1_sleef(vandnot_vm_vo32_vm_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(8e+6f)), vreinterpret_vm_vf_rvvm1_sleef(r))); + r = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vreinterpret_vm_vf_rvvm1_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef cospifk_rvvm1_sleef(vfloat_rvvm1_sleef d) { + rvv_sp_vopmask_rvvm1_sleef o; + vfloat_rvvm1_sleef u, s, t; + vfloat2_rvvm1_sleef x, s2; + + u = vmul_vf_vf_vf_rvvm1_sleef(d, vcast_vf_f_rvvm1_sleef(4.0)); + vint2_rvvm1_sleef q = vtruncate_vi2_vf_rvvm1_sleef(u); + q = vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vxor_vi2_vi2_vi2_rvvm1_sleef(vsrl_vi2_vi2_i_rvvm1_sleef(q, 31), vcast_vi2_i_rvvm1_sleef(1))), vcast_vi2_i_rvvm1_sleef(~1)); + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(0)); + + s = vsub_vf_vf_vf_rvvm1_sleef(u, vcast_vf_vi2_rvvm1_sleef(q)); + t = s; + s = vmul_vf_vf_vf_rvvm1_sleef(s, s); + s2 = dfmul_vf2_vf_vf_rvvm1_sleef(t, t); + + u = vsel_vf_vo_f_f_rvvm1_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vsel_vf_vo_f_f_rvvm1_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, s, vsel_vf_vo_f_f_rvvm1_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(u, s), + vsel_vf2_vo_f_f_f_f_rvvm1_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_rvvm1_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_rvvm1_sleef(x, vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, s2, vcast_vf2_vf_vf_rvvm1_sleef(t, vcast_vf_f_rvvm1_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1)), x); + + o = veq_vo_vi2_vi2_rvvm1_sleef(vand_vi2_vi2_vi2_rvvm1_sleef(vadd_vi2_vi2_vi2_rvvm1_sleef(q, vcast_vi2_i_rvvm1_sleef(2)), vcast_vi2_i_rvvm1_sleef(4)), vcast_vi2_i_rvvm1_sleef(4)); + x = vf2setx_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x))))); + x = vf2sety_vf2_vf2_vf_rvvm1_sleef(x, vreinterpret_vf_vm_rvvm1_sleef(vxor_vm_vm_vm_rvvm1_sleef(vand_vm_vo32_vm_rvvm1_sleef(o, vreinterpret_vm_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(-0.0))), vreinterpret_vm_vf_rvvm1_sleef(vf2gety_vf_vf2_rvvm1_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_cospifx_u05rvvm1(vfloat_rvvm1_sleef d) { + vfloat2_rvvm1_sleef x = cospifk_rvvm1_sleef(d); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vgt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(d), vcast_vf_f_rvvm1_sleef(8e+6f)), vcast_vf_f_rvvm1_sleef(1), r); + r = vreinterpret_vf_vm_rvvm1_sleef(vor_vm_vo32_vm_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(d), vreinterpret_vm_vf_rvvm1_sleef(r))); + + return r; +} + +static SLEEF_CONST df2_rvvm1_sleef gammafk_rvvm1_sleef(vfloat_rvvm1_sleef a) { + vfloat2_rvvm1_sleef clc = vcast_vf2_f_f_rvvm1_sleef(0, 0), clln = vcast_vf2_f_f_rvvm1_sleef(1, 0), clld = vcast_vf2_f_f_rvvm1_sleef(1, 0); + vfloat2_rvvm1_sleef x, y, z; + vfloat_rvvm1_sleef t, u; + + rvv_sp_vopmask_rvvm1_sleef otiny = vlt_vo_vf_vf_rvvm1_sleef(vabs_vf_vf_rvvm1_sleef(a), vcast_vf_f_rvvm1_sleef(1e-30f)), oref = vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0.5)); + + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(otiny, vcast_vf2_f_f_rvvm1_sleef(0, 0), + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(oref, dfadd2_vf2_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), vneg_vf_vf_rvvm1_sleef(a)), + vcast_vf2_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)))); + + rvv_sp_vopmask_rvvm1_sleef o0 = rvv_sp_vand_vo_vo_vo(vle_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(0.5), vf2getx_vf_vf2_rvvm1_sleef(x)), vle_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(1.2))); + rvv_sp_vopmask_rvvm1_sleef o2 = vle_vo_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2.3), vf2getx_vf_vf2_rvvm1_sleef(x)); + + y = dfnormalize_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1)), x)); + y = dfnormalize_vf2_vf2_rvvm1_sleef(dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2)), y)); + + rvv_sp_vopmask_rvvm1_sleef o = rvv_sp_vand_vo_vo_vo(o2, vle_vo_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vcast_vf_f_rvvm1_sleef(7))); + clln = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, y, clln); + + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o, dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(3)), x); + t = vsel_vf_vo_vf_vf_rvvm1_sleef(o2, vrec_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x)), vf2getx_vf_vf2_rvvm1_sleef(dfnormalize_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vsel_vf_vo_f_f_rvvm1_sleef(o0, -1, -2))))); + + u = vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, +0.000839498720672087279971000786, +0.9435157776e+0f, +0.1102489550e-3f); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, -5.17179090826059219329394422e-05, +0.8670063615e+0f, +0.8160019934e-4f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, -0.000592166437353693882857342347, +0.4826702476e+0f, +0.1528468856e-3f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.8855129778e-1f, -0.2355068718e-3f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, +0.000784039221720066627493314301, +0.1013825238e+0f, +0.4962242092e-3f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, -0.000229472093621399176949318732, -0.1493408978e+0f, -0.1193488017e-2f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, -0.002681327160493827160473958490, +0.1697509140e+0f, +0.2891599433e-2f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, +0.003472222222222222222175164840, -0.2072454542e+0f, -0.7385451812e-2f)); + u = vmla_vf_vf_vf_vf_rvvm1_sleef(u, t, vsel_vf_vo_vo_f_f_f_rvvm1_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705872357e+0f, +0.2058077045e-1f)); + + y = dfmul_vf2_vf2_vf2_rvvm1_sleef(dfadd2_vf2_vf2_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(-0.5)), logk2f_rvvm1_sleef(x)); + y = dfadd2_vf2_vf2_vf2_rvvm1_sleef(y, dfneg_vf2_vf2_rvvm1_sleef(x)); + y = dfadd2_vf2_vf2_vf2_rvvm1_sleef(y, vcast_vf2_d_rvvm1_sleef(0.91893853320467278056)); + + z = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf_vf_rvvm1_sleef (u, t), vsel_vf_vo_f_f_rvvm1_sleef(o0, -0.400686534596170958447352690395e+0f, -0.673523028297382446749257758235e-1f)); + z = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(z, t), vsel_vf_vo_f_f_rvvm1_sleef(o0, +0.822466960142643054450325495997e+0f, +0.322467033928981157743538726901e+0f)); + z = dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf2_vf_rvvm1_sleef(z, t), vsel_vf_vo_f_f_rvvm1_sleef(o0, -0.577215665946766039837398973297e+0f, +0.422784335087484338986941629852e+0f)); + z = dfmul_vf2_vf2_vf_rvvm1_sleef(z, t); + + clc = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o2, y, z); + + clld = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o2, dfadd2_vf2_vf2_vf_rvvm1_sleef(dfmul_vf2_vf_vf_rvvm1_sleef(u, t), vcast_vf_f_rvvm1_sleef(1)), clld); + + y = clln; + + clc = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(otiny, vcast_vf2_d_rvvm1_sleef(41.58883083359671856503), + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(oref, dfadd2_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_d_rvvm1_sleef(1.1447298858494001639), dfneg_vf2_vf2_rvvm1_sleef(clc)), clc)); + clln = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(otiny, vcast_vf2_f_f_rvvm1_sleef(1, 0), vsel_vf2_vo_vf2_vf2_rvvm1_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo32_rvvm1_sleef(vnot_vo32_vo32_rvvm1_sleef(oref))) { + t = vsub_vf_vf_vf_rvvm1_sleef(a, vmul_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(INT64_C(1) << 12), vcast_vf_vi2_rvvm1_sleef(vtruncate_vi2_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(1.0 / (INT64_C(1) << 12))))))); + x = dfmul_vf2_vf2_vf2_rvvm1_sleef(clld, sinpifk_rvvm1_sleef(t)); + } + + clld = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(otiny, vcast_vf2_vf_vf_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef((INT64_C(1) << 30)*(float)(INT64_C(1) << 30))), vcast_vf_f_rvvm1_sleef(0)), + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(oref, x, y)); + + return df2setab_df2_vf2_vf2_rvvm1_sleef(clc, dfdiv_vf2_vf2_vf2_rvvm1_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_tgammafx_u10rvvm1(vfloat_rvvm1_sleef a) { + df2_rvvm1_sleef d = gammafk_rvvm1_sleef(a); + vfloat2_rvvm1_sleef y = dfmul_vf2_vf2_vf2_rvvm1_sleef(expk2f_rvvm1_sleef(df2geta_vf2_df2_rvvm1_sleef(d)), df2getb_vf2_df2_rvvm1_sleef(d)); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(y)); + rvv_sp_vopmask_rvvm1_sleef o; + + o = rvv_sp_vor_vo_vo_vo(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(-__builtin_inff())), + rvv_sp_vand_vo_vo_vo(vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), visint_vo_vf_rvvm1_sleef(a))), + rvv_sp_vand_vo_vo_vo(rvv_sp_vand_vo_vo_vo(visnumber_vo_vf_rvvm1_sleef(a), vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0))), visnan_vo_vf_rvvm1_sleef(r))); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), r); + + o = rvv_sp_vand_vo_vo_vo(rvv_sp_vand_vo_vo_vo(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(__builtin_inff())), visnumber_vo_vf_rvvm1_sleef(a)), + vge_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(-0x1p-126))), + rvv_sp_vor_vo_vo_vo(rvv_sp_vor_vo_vo_vo(veq_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), vgt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(36))), visnan_vo_vf_rvvm1_sleef(r))); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vmulsign_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(__builtin_inff()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_lgammafx_u10rvvm1(vfloat_rvvm1_sleef a) { + df2_rvvm1_sleef d = gammafk_rvvm1_sleef(a); + vfloat2_rvvm1_sleef y = dfadd2_vf2_vf2_vf2_rvvm1_sleef(df2geta_vf2_df2_rvvm1_sleef(d), logk2f_rvvm1_sleef(dfabs_vf2_vf2_rvvm1_sleef(df2getb_vf2_df2_rvvm1_sleef(d)))); + vfloat_rvvm1_sleef r = vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(y), vf2gety_vf_vf2_rvvm1_sleef(y)); + rvv_sp_vopmask_rvvm1_sleef o; + + o = rvv_sp_vor_vo_vo_vo(visinf_vo_vf_rvvm1_sleef(a), + rvv_sp_vor_vo_vo_vo(rvv_sp_vand_vo_vo_vo(vle_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), visint_vo_vf_rvvm1_sleef(a)), + rvv_sp_vand_vo_vo_vo(visnumber_vo_vf_rvvm1_sleef(a), visnan_vo_vf_rvvm1_sleef(r)))); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(o, vcast_vf_f_rvvm1_sleef(__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef dfmla_vf2_vf_vf2_vf2_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat2_rvvm1_sleef y, vfloat2_rvvm1_sleef z) { + return dfadd_vf2_vf2_vf2_rvvm1_sleef(z, dfmul_vf2_vf2_vf_rvvm1_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef poly2df_b_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat2_rvvm1_sleef c1, vfloat2_rvvm1_sleef c0) { return dfmla_vf2_vf_vf2_vf2_rvvm1_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef poly2df_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef c1, vfloat2_rvvm1_sleef c0) { return dfmla_vf2_vf_vf2_vf2_rvvm1_sleef(x, vcast_vf2_vf_vf_rvvm1_sleef(c1, vcast_vf_f_rvvm1_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_rvvm1_sleef poly4df_rvvm1_sleef(vfloat_rvvm1_sleef x, vfloat_rvvm1_sleef c3, vfloat2_rvvm1_sleef c2, vfloat2_rvvm1_sleef c1, vfloat2_rvvm1_sleef c0) { + return dfmla_vf2_vf_vf2_vf2_rvvm1_sleef(vmul_vf_vf_vf_rvvm1_sleef(x, x), poly2df_rvvm1_sleef(x, c3, c2), poly2df_b_rvvm1_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_erffx_u10rvvm1(vfloat_rvvm1_sleef a) { + vfloat_rvvm1_sleef t, x = vabs_vf_vf_rvvm1_sleef(a); + vfloat2_rvvm1_sleef t2; + vfloat_rvvm1_sleef x2 = vmul_vf_vf_vf_rvvm1_sleef(x, x), x4 = vmul_vf_vf_vf_rvvm1_sleef(x2, x2); + rvv_sp_vopmask_rvvm1_sleef o25 = vle_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo32_rvvm1_sleef(o25)), 1)) { + + t = vmla_vf_vf_vf_vf_rvvm1_sleef((x4), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), (vcast_vf_f_rvvm1_sleef(-0.4360447008e-6)), (vcast_vf_f_rvvm1_sleef(+0.6867515367e-5)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((x2), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), (vcast_vf_f_rvvm1_sleef(-0.3045156700e-4)), (vcast_vf_f_rvvm1_sleef(+0.9808536561e-4)))), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), (vcast_vf_f_rvvm1_sleef(+0.2395523916e-3)), (vcast_vf_f_rvvm1_sleef(+0.1459901541e-3))))))) + + ; + t2 = poly4df_rvvm1_sleef(x, t, + vcast_vf2_f_f_rvvm1_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_rvvm1_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_rvvm1_sleef(0.070523701608180999756, -3.6616309318707365163e-09)); + t2 = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), dfmul_vf2_vf2_vf_rvvm1_sleef(t2, x)); + t2 = dfsqu_vf2_vf2_rvvm1_sleef(t2); + t2 = dfsqu_vf2_vf2_rvvm1_sleef(t2); + t2 = dfsqu_vf2_vf2_rvvm1_sleef(t2); + t2 = dfsqu_vf2_vf2_rvvm1_sleef(t2); + t2 = dfrec_vf2_vf2_rvvm1_sleef(t2); + } else { + + t = vmla_vf_vf_vf_vf_rvvm1_sleef((x4), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, -0.4360447008e-6, -0.1130012848e-6))), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, +0.6867515367e-5, +0.4115272986e-5))))), (vmla_vf_vf_vf_vf_rvvm1_sleef((x2), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, -0.3045156700e-4, -0.6928304356e-4))), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, +0.9808536561e-4, +0.7172692567e-3))))), (vmla_vf_vf_vf_vf_rvvm1_sleef((x), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, +0.2395523916e-3, -0.5131045356e-2))), ((vsel_vf_vo_f_f_rvvm1_sleef(o25, +0.1459901541e-3, +0.2708637156e-1)))))))) + + ; + t2 = poly4df_rvvm1_sleef(x, t, + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o25, vcast_vf2_f_f_rvvm1_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_rvvm1_sleef(-0.11064319312572479248, 3.7050452777225283007e-09)), + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o25, vcast_vf2_f_f_rvvm1_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_rvvm1_sleef(-0.63192230463027954102, -2.0200432585073177859e-08)), + vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o25, vcast_vf2_f_f_rvvm1_sleef(0.070523701608180999756, -3.6616309318707365163e-09), + vcast_vf2_f_f_rvvm1_sleef(-1.1296638250350952148, 2.5515120196453259252e-08))); + t2 = dfmul_vf2_vf2_vf_rvvm1_sleef(t2, x); + vfloat2_rvvm1_sleef s2 = dfadd_vf2_vf_vf2_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(1), t2); + s2 = dfsqu_vf2_vf2_rvvm1_sleef(s2); + s2 = dfsqu_vf2_vf2_rvvm1_sleef(s2); + s2 = dfsqu_vf2_vf2_rvvm1_sleef(s2); + s2 = dfsqu_vf2_vf2_rvvm1_sleef(s2); + s2 = dfrec_vf2_vf2_rvvm1_sleef(s2); + t2 = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o25, s2, vcast_vf2_vf_vf_rvvm1_sleef(expkf_rvvm1_sleef(t2), vcast_vf_f_rvvm1_sleef(0))); + } + + t2 = dfadd2_vf2_vf2_vf_rvvm1_sleef(t2, vcast_vf_f_rvvm1_sleef(-1)); + t2 = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(vlt_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(1e-4)), dfmul_vf2_vf2_vf_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(-1.1283792257308959961, 5.8635383422197591097e-08), x), t2); + + vfloat_rvvm1_sleef z = vneg_vf_vf_rvvm1_sleef(vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(t2), vf2gety_vf_vf2_rvvm1_sleef(t2))); + z = vsel_vf_vo_vf_vf_rvvm1_sleef(vge_vo_vf_vf_rvvm1_sleef(x, vcast_vf_f_rvvm1_sleef(6)), vcast_vf_f_rvvm1_sleef(1), z); + z = vsel_vf_vo_vf_vf_rvvm1_sleef(visinf_vo_vf_rvvm1_sleef(a), vcast_vf_f_rvvm1_sleef(1), z); + z = vsel_vf_vo_vf_vf_rvvm1_sleef(veq_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), vcast_vf_f_rvvm1_sleef(0), z); + z = vmulsign_vf_vf_vf_rvvm1_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vfloat_rvvm1_sleef Sleef_erfcfx_u15rvvm1(vfloat_rvvm1_sleef a) { + vfloat_rvvm1_sleef s = a, r = vcast_vf_f_rvvm1_sleef(0), t; + vfloat2_rvvm1_sleef u, d, x; + a = vabs_vf_vf_rvvm1_sleef(a); + rvv_sp_vopmask_rvvm1_sleef o0 = vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(1.0)); + rvv_sp_vopmask_rvvm1_sleef o1 = vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(2.2)); + rvv_sp_vopmask_rvvm1_sleef o2 = vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(4.3)); + rvv_sp_vopmask_rvvm1_sleef o3 = vlt_vo_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(10.1)); + + u = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, vcast_vf2_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)), dfdiv_vf2_vf2_vf2_rvvm1_sleef(vcast_vf2_f_f_rvvm1_sleef(1, 0), vcast_vf2_vf_vf_rvvm1_sleef(a, vcast_vf_f_rvvm1_sleef(0)))); + + t = vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(o0, o1, o2, -0.8638041618e-4f, -0.6236977242e-5f, -0.3869504035e+0f, +0.1115344167e+1f); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(o0, o1, o2, +0.6000166177e-3f, +0.5749821503e-4f, +0.1288077235e+1f, -0.9454904199e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(o0, o1, o2, -0.1665703603e-2f, +0.6002851478e-5f, -0.1816803217e+1f, -0.3667259514e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(o0, o1, o2, +0.1795156277e-3f, -0.2851036377e-2f, +0.1249150872e+1f, +0.7155663371e+0f)); + t = vmla_vf_vf_vf_vf_rvvm1_sleef(t, vf2getx_vf_vf2_rvvm1_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_rvvm1_sleef(o0, o1, o2, +0.1914106123e-1f, +0.2260518074e-1f, -0.1328857988e+0f, -0.1262947265e-1f)); + + d = dfmul_vf2_vf2_vf_rvvm1_sleef(u, t); + d = dfadd2_vf2_vf2_vf2_rvvm1_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.102775359343930288081655368891e+0, -0.105247583459338632253369014063e+0, -0.482365310333045318680618892669e+0, -0.498961546254537647970305302739e+0)); + d = dfmul_vf2_vf2_vf2_rvvm1_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_rvvm1_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.636619483208481931303752546439e+0, -0.635609463574589034216723775292e+0, -0.134450203224533979217859332703e-2, -0.471199543422848492080722832666e-4)); + d = dfmul_vf2_vf2_vf2_rvvm1_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_rvvm1_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_rvvm1_sleef(o0, o1, o2, -0.112837917790537404939545770596e+1, -0.112855987376668622084547028949e+1, -0.572319781150472949561786101080e+0, -0.572364030327966044425932623525e+0)); + + x = dfmul_vf2_vf2_vf_rvvm1_sleef(vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, d, vcast_vf2_vf_vf_rvvm1_sleef(vneg_vf_vf_rvvm1_sleef(a), vcast_vf_f_rvvm1_sleef(0))), a); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, x, dfadd2_vf2_vf2_vf2_rvvm1_sleef(x, d)); + + x = expk2f_rvvm1_sleef(x); + x = vsel_vf2_vo_vf2_vf2_rvvm1_sleef(o1, x, dfmul_vf2_vf2_vf2_rvvm1_sleef(x, u)); + + r = vsel_vf_vo_vf_vf_rvvm1_sleef(o3, vadd_vf_vf_vf_rvvm1_sleef(vf2getx_vf_vf2_rvvm1_sleef(x), vf2gety_vf_vf2_rvvm1_sleef(x)), vcast_vf_f_rvvm1_sleef(0)); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(vsignbit_vo_vf_rvvm1_sleef(s), vsub_vf_vf_vf_rvvm1_sleef(vcast_vf_f_rvvm1_sleef(2), r), r); + r = vsel_vf_vo_vf_vf_rvvm1_sleef(visnan_vo_vf_rvvm1_sleef(s), vcast_vf_f_rvvm1_sleef(__builtin_nanf("")), r); + return r; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_sve.h b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_sve.h new file mode 100644 index 0000000000000..d4b15d0f21866 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/generated/sleefinline_sve.h @@ -0,0 +1,6945 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF 3.6.1 + +#ifndef SLEEF_ALWAYS_INLINE +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_ALWAYS_INLINE inline __forceinline +#else +#define SLEEF_ALWAYS_INLINE inline +#endif +#endif + +#ifndef SLEEF_INLINE +#define SLEEF_INLINE static inline +#endif + +#ifndef SLEEF_CONST +#define SLEEF_CONST +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#define SLEEFINLINE_SVE_H_INCLUDED + +#ifndef __SLEEF_REMPITAB__ +#define __SLEEF_REMPITAB__ +static const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, +}; + +static const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, +}; +#endif // #ifndef __SLEEF_REMPITAB__ + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const double Sleef_rempitabdp[]; + +static SLEEF_ALWAYS_INLINE int vavailability_i_sve_sleef(int name) { return 3; } + +typedef svint32_t vmask_sve_sleef; +typedef svbool_t vopmask_sve_sleef; + +typedef svfloat32_t vfloat_sve_sleef; +typedef svint32_t vint2_sve_sleef; + +typedef svfloat64_t vdouble_sve_sleef; +typedef svint32_t vint_sve_sleef; + +typedef svint64_t vint64_sve_sleef; +typedef svuint64_t vuint64_sve_sleef; + +typedef svfloat64x2_t vdouble2_sve_sleef; +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vd2getx_vd_vd2_sve_sleef(vdouble2_sve_sleef v) { return svget2_f64(v, 0); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vd2gety_vd_vd2_sve_sleef(vdouble2_sve_sleef v) { return svget2_f64(v, 1); } +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef vd2setxy_vd2_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { return svcreate2_f64(x, y); } +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef vd2setx_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef v, vdouble_sve_sleef d) { return svset2_f64(v, 0, d); } +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef vd2sety_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef v, vdouble_sve_sleef d) { return svset2_f64(v, 1, d); } + +typedef svfloat32x2_t vfloat2_sve_sleef; +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vf2getx_vf_vf2_sve_sleef(vfloat2_sve_sleef v) { return svget2_f32(v, 0); } +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vf2gety_vf_vf2_sve_sleef(vfloat2_sve_sleef v) { return svget2_f32(v, 1); } +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef vf2setxy_vf2_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { return svcreate2_f32(x, y); } +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef vf2setx_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef v, vfloat_sve_sleef d) { return svset2_f32(v, 0, d); } +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef vf2sety_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef v, vfloat_sve_sleef d) { return svset2_f32(v, 1, d); } + +typedef svint32x2_t vquad_sve_sleef; +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vqgetx_vm_vq_sve_sleef(vquad_sve_sleef v) { return svget2_s32(v, 0); } +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vqgety_vm_vq_sve_sleef(vquad_sve_sleef v) { return svget2_s32(v, 1); } +static SLEEF_ALWAYS_INLINE vquad_sve_sleef vqsetxy_vq_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { return svcreate2_s32(x, y); } +static SLEEF_ALWAYS_INLINE vquad_sve_sleef vqsetx_vq_vq_vm_sve_sleef(vquad_sve_sleef v, vmask_sve_sleef x) { return svset2_s32(v, 0, x); } +static SLEEF_ALWAYS_INLINE vquad_sve_sleef vqsety_vq_vq_vm_sve_sleef(vquad_sve_sleef v, vmask_sve_sleef y) { return svset2_s32(v, 1, y); } + +typedef vquad_sve_sleef vargquad_sve_sleef; + +typedef svfloat64x2_t di_t_sve_sleef; + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef digetd_vd_di_sve_sleef(di_t_sve_sleef d) { return svget2_f64(d, 0); } +static SLEEF_ALWAYS_INLINE vint_sve_sleef digeti_vi_di_sve_sleef(di_t_sve_sleef d) { return svreinterpret_s32_f64(svget2_f64(d, 1)); } +static SLEEF_ALWAYS_INLINE di_t_sve_sleef disetdi_di_vd_vi_sve_sleef(vdouble_sve_sleef d, vint_sve_sleef i) { + return svcreate2_f64(d, svreinterpret_f64_s32(i)); +} + +typedef svfloat32x2_t fi_t_sve_sleef; + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef figetd_vf_di_sve_sleef(fi_t_sve_sleef d) { return svget2_f32(d, 0); } +static SLEEF_ALWAYS_INLINE vint2_sve_sleef figeti_vi2_di_sve_sleef(fi_t_sve_sleef d) { return svreinterpret_s32_f32(svget2_f32(d, 1)); } +static SLEEF_ALWAYS_INLINE fi_t_sve_sleef fisetdi_fi_vf_vi2_sve_sleef(vfloat_sve_sleef d, vint2_sve_sleef i) { + return svcreate2_f32(d, svreinterpret_f32_s32(i)); +} + +typedef svfloat64x3_t ddi_t_sve_sleef; + +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef ddigetdd_vd2_ddi_sve_sleef(ddi_t_sve_sleef d) { + return svcreate2_f64(svget3_f64(d, 0), svget3_f64(d, 1)); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef ddigeti_vi_ddi_sve_sleef(ddi_t_sve_sleef d) { return svreinterpret_s32_f64(svget3_f64(d, 2)); } +static SLEEF_ALWAYS_INLINE ddi_t_sve_sleef ddisetddi_ddi_vd2_vi_sve_sleef(vdouble2_sve_sleef v, vint_sve_sleef i) { + return svcreate3_f64(svget2_f64(v, 0), svget2_f64(v, 1), + svreinterpret_f64_s32(i)); +} +static SLEEF_ALWAYS_INLINE ddi_t_sve_sleef ddisetdd_ddi_ddi_vd2_sve_sleef(ddi_t_sve_sleef ddi_sve_sleef, vdouble2_sve_sleef v) { + return svcreate3_f64(svget2_f64(v, 0), svget2_f64(v, 1), svget3_f64(ddi_sve_sleef, 2)); +} + +typedef svfloat32x3_t dfi_t_sve_sleef; + +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef dfigetdf_vf2_dfi_sve_sleef(dfi_t_sve_sleef d) { + return svcreate2_f32(svget3_f32(d, 0), svget3_f32(d, 1)); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef dfigeti_vi2_dfi_sve_sleef(dfi_t_sve_sleef d) { return svreinterpret_s32_f32(svget3_f32(d, 2)); } +static SLEEF_ALWAYS_INLINE dfi_t_sve_sleef dfisetdfi_dfi_vf2_vi2_sve_sleef(vfloat2_sve_sleef v, vint2_sve_sleef i) { + return svcreate3_f32(svget2_f32(v, 0), svget2_f32(v, 1), + svreinterpret_f32_s32(i)); +} +static SLEEF_ALWAYS_INLINE dfi_t_sve_sleef dfisetdf_dfi_dfi_vf2_sve_sleef(dfi_t_sve_sleef dfi_sve_sleef, vfloat2_sve_sleef v) { + return svcreate3_f32(svget2_f32(v, 0), svget2_f32(v, 1), svget3_f32(dfi_sve_sleef, 2)); +} + +typedef svfloat64x4_t dd2_sve_sleef; + +static SLEEF_ALWAYS_INLINE dd2_sve_sleef dd2setab_dd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef a, vdouble2_sve_sleef b) { + return svcreate4_f64(svget2_f64(a, 0), svget2_f64(a, 1), + svget2_f64(b, 0), svget2_f64(b, 1)); +} +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef dd2geta_vd2_dd2_sve_sleef(dd2_sve_sleef d) { + return svcreate2_f64(svget4_f64(d, 0), svget4_f64(d, 1)); +} +static SLEEF_ALWAYS_INLINE vdouble2_sve_sleef dd2getb_vd2_dd2_sve_sleef(dd2_sve_sleef d) { + return svcreate2_f64(svget4_f64(d, 2), svget4_f64(d, 3)); +} + +typedef svfloat32x4_t df2_sve_sleef; + +static SLEEF_ALWAYS_INLINE df2_sve_sleef df2setab_df2_vf2_vf2_sve_sleef(vfloat2_sve_sleef a, vfloat2_sve_sleef b) { + return svcreate4_f32(svget2_f32(a, 0), svget2_f32(a, 1), + svget2_f32(b, 0), svget2_f32(b, 1)); +} +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef df2geta_vf2_df2_sve_sleef(df2_sve_sleef d) { + return svcreate2_f32(svget4_f32(d, 0), svget4_f32(d, 1)); +} +static SLEEF_ALWAYS_INLINE vfloat2_sve_sleef df2getb_vf2_df2_sve_sleef(df2_sve_sleef d) { + return svcreate2_f32(svget4_f32(d, 2), svget4_f32(d, 3)); +} + +typedef svfloat64x3_t vdouble3_sve_sleef; + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vd3getx_vd_vd3_sve_sleef(vdouble3_sve_sleef v) { return svget3_f64(v, 0); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vd3gety_vd_vd3_sve_sleef(vdouble3_sve_sleef v) { return svget3_f64(v, 1); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vd3getz_vd_vd3_sve_sleef(vdouble3_sve_sleef v) { return svget3_f64(v, 2); } +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef vd3setxyz_vd3_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { return svcreate3_f64(x, y, z); } +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef vd3setx_vd3_vd3_vd_sve_sleef(vdouble3_sve_sleef v, vdouble_sve_sleef d) { return svset3_f64(v, 0, d); } +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef vd3sety_vd3_vd3_vd_sve_sleef(vdouble3_sve_sleef v, vdouble_sve_sleef d) { return svset3_f64(v, 1, d); } +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef vd3setz_vd3_vd3_vd_sve_sleef(vdouble3_sve_sleef v, vdouble_sve_sleef d) { return svset3_f64(v, 2, d); } + +typedef svfloat64x4_t tdx_sve_sleef; + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef tdxgete_vm_tdx_sve_sleef(tdx_sve_sleef t) { + return svreinterpret_s32_f64(svget4_f64(t, 0)); +} +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef tdxgetd3_vd3_tdx_sve_sleef(tdx_sve_sleef t) { + return svcreate3_f64(svget4_f64(t, 1), svget4_f64(t, 2), svget4_f64(t, 3)); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef tdxgetd3x_vd_tdx_sve_sleef(tdx_sve_sleef t) { return svget4_f64(t, 1); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef tdxgetd3y_vd_tdx_sve_sleef(tdx_sve_sleef t) { return svget4_f64(t, 2); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef tdxgetd3z_vd_tdx_sve_sleef(tdx_sve_sleef t) { return svget4_f64(t, 3); } +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsete_tdx_tdx_vm_sve_sleef(tdx_sve_sleef t, vmask_sve_sleef e) { + return svset4_f64(t, 0, svreinterpret_f64_s32(e)); +} +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsetd3_tdx_tdx_vd3_sve_sleef(tdx_sve_sleef t, vdouble3_sve_sleef d3) { + return svcreate4_f64(svget4_f64(t, 0), svget3_f64(d3, 0), svget3_f64(d3, 1), svget3_f64(d3, 2)); +} +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsetx_tdx_tdx_vd_sve_sleef(tdx_sve_sleef t, vdouble_sve_sleef x) { return svset4_f64(t, 1, x); } +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsety_tdx_tdx_vd_sve_sleef(tdx_sve_sleef t, vdouble_sve_sleef y) { return svset4_f64(t, 2, y); } +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsetz_tdx_tdx_vd_sve_sleef(tdx_sve_sleef t, vdouble_sve_sleef z) { return svset4_f64(t, 3, z); } +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsetxyz_tdx_tdx_vd_vd_vd_sve_sleef(tdx_sve_sleef t, vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { + return svcreate4_f64(svget4_f64(t, 0), x, y, z); +} + +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxseted3_tdx_vm_vd3_sve_sleef(vmask_sve_sleef e, vdouble3_sve_sleef d3) { + return svcreate4_f64(svreinterpret_f64_s32(e), svget3_f64(d3, 0), svget3_f64(d3, 1), svget3_f64(d3, 2)); +} +static SLEEF_ALWAYS_INLINE tdx_sve_sleef tdxsetexyz_tdx_vm_vd_vd_vd_sve_sleef(vmask_sve_sleef e, vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { + return svcreate4_f64(svreinterpret_f64_s32(e), x, y, z); +} + +typedef svfloat64x4_t tdi_t_sve_sleef; + +static SLEEF_ALWAYS_INLINE vdouble3_sve_sleef tdigettd_vd3_tdi_sve_sleef(tdi_t_sve_sleef d) { + return svcreate3_f64(svget4_f64(d, 0), svget4_f64(d, 1), svget4_f64(d, 2)); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef tdigetx_vd_tdi_sve_sleef(tdi_t_sve_sleef d) { return svget4_f64(d, 0); } +static SLEEF_ALWAYS_INLINE vint_sve_sleef tdigeti_vi_tdi_sve_sleef(tdi_t_sve_sleef d) { return svreinterpret_s32_f64(svget4_f64(d, 3)); } +static SLEEF_ALWAYS_INLINE tdi_t_sve_sleef tdisettdi_tdi_vd3_vi_sve_sleef(vdouble3_sve_sleef v, vint_sve_sleef i) { + return svcreate4_f64(svget3_f64(v, 0), svget3_f64(v, 1), svget3_f64(v, 2), + svreinterpret_f64_s32(i)); +} +static SLEEF_ALWAYS_INLINE tdi_t_sve_sleef tdisettd_tdi_tdi_vd3(tdi_t_sve_sleef tdi, vdouble3_sve_sleef v) { + return svcreate4_f64(svget3_f64(v, 0), svget3_f64(v, 1), svget3_f64(v, 2), svget4_f64(tdi, 3)); +} + +static SLEEF_ALWAYS_INLINE void vprefetch_v_p_sve_sleef(const void *ptr) {} + +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo32_sve_sleef(vopmask_sve_sleef g) { + svbool_t pg = svptrue_b32(); + return (svcntp_b32(pg, g) == svcntw()); +} + +static SLEEF_ALWAYS_INLINE int vtestallones_i_vo64_sve_sleef(vopmask_sve_sleef g) { + svbool_t pg = svptrue_b64(); + return (svcntp_b64(pg, g) == svcntd()); +} + +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi2_sve_sleef(int32_t *p, vint2_sve_sleef v) { svst1_s32(svptrue_b8(), p, v); } + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vload_vf_p_sve_sleef(const float *ptr) { + return svld1_f32(svptrue_b8(), ptr); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vloadu_vf_p_sve_sleef(const float *ptr) { + return svld1_f32(svptrue_b8(), ptr); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vf_sve_sleef(float *ptr, vfloat_sve_sleef v) { + svst1_f32(svptrue_b8(), ptr, v); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vand_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svand_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vandnot_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svbic_s32_x(svptrue_b8(), y, x); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vor_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svorr_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vxor_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return sveor_s32_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vadd64_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svreinterpret_s32_s64( + svadd_s64_x(svptrue_b8(), svreinterpret_s64_s32(x), + svreinterpret_s64_s32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vreinterpret_vm_vf_sve_sleef(vfloat_sve_sleef vf) { + return svreinterpret_s32_f32(vf); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vreinterpret_vf_vm_sve_sleef(vmask_sve_sleef vm) { + return svreinterpret_f32_s32(vm); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vreinterpret_vf_vi2_sve_sleef(vint2_sve_sleef vm) { + return svreinterpret_f32_s32(vm); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vreinterpret_vi2_vf_sve_sleef(vfloat_sve_sleef vf) { + return svreinterpret_s32_f32(vf); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vcast_vi2_vm_sve_sleef(vmask_sve_sleef vm) { return vm; } +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vcast_vm_vi2_sve_sleef(vint2_sve_sleef vi) { return vi; } + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vsel_vi2_vm_vi2_vi2(vmask_sve_sleef m, vint2_sve_sleef x, vint2_sve_sleef y) { + return svsel_s32(svcmpeq_s32(svptrue_b8(), m, svdup_n_s32(0xffffffff)), x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vcast_vf_f_sve_sleef(float f) { return svdup_n_f32(f); } + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vadd_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svadd_f32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsub_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svsub_f32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmul_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svmul_f32_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vabs_vf_vf_sve_sleef(vfloat_sve_sleef f) { return svabs_f32_x(svptrue_b8(), f); } +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vneg_vf_vf_sve_sleef(vfloat_sve_sleef f) { return svneg_f32_x(svptrue_b8(), f); } + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmax_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svmax_f32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmin_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svmin_f32_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vtruncate_vi2_vf_sve_sleef(vfloat_sve_sleef vf) { + return svcvt_s32_f32_x(svptrue_b8(), vf); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vcast_vf_vi2_sve_sleef(vint2_sve_sleef vi) { + return svcvt_f32_s32_x(svptrue_b8(), vi); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vcast_vi2_i_sve_sleef(int i) { return svdup_n_s32(i); } +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vrint_vi2_vf_sve_sleef(vfloat_sve_sleef d) { + return svcvt_s32_f32_x(svptrue_b8(), svrintn_f32_x(svptrue_b8(), d)); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmla_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, vfloat_sve_sleef z) { + return svmad_f32_x(svptrue_b8(), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmlanp_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, vfloat_sve_sleef z) { + return svmsb_f32_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmlapn_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, vfloat_sve_sleef z) { + return svnmsb_f32_x(svptrue_b8(), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vfma_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, + vfloat_sve_sleef z) { + return svmad_f32_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vfmanp_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, + vfloat_sve_sleef z) { + return svmsb_f32_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vfmapn_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, + vfloat_sve_sleef z) { + return svnmsb_f32_x(svptrue_b8(), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsel_vf_vo_vf_vf_sve_sleef(vopmask_sve_sleef mask, vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svsel_f32(mask, x, y); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vdiv_vf_vf_vf_sve_sleef(vfloat_sve_sleef n, vfloat_sve_sleef d) { + + return svdiv_f32_x(svptrue_b8(), n, d); + +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vrec_vf_vf_sve_sleef(vfloat_sve_sleef d) { + + return svdivr_n_f32_x(svptrue_b8(), d, 1.0f); + +} +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsqrt_vf_vf_sve_sleef(vfloat_sve_sleef d) { + + return svsqrt_f32_x(svptrue_b8(), d); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vsel_vf_vo_f_f_sve_sleef(vopmask_sve_sleef o, float v1, float v0) { + return vsel_vf_vo_vf_vf_sve_sleef(o, vcast_vf_f_sve_sleef(v1), vcast_vf_f_sve_sleef(v0)); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsel_vf_vo_vo_f_f_f_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf_sve_sleef(o0, vcast_vf_f_sve_sleef(d0), vsel_vf_vo_f_f_sve_sleef(o1, d1, d2)); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, vopmask_sve_sleef o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf_sve_sleef(o0, vcast_vf_f_sve_sleef(d0), vsel_vf_vo_vf_vf_sve_sleef(o1, vcast_vf_f_sve_sleef(d1), vsel_vf_vo_f_f_sve_sleef(o2, d2, d3))); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vtruncate_vf_vf_sve_sleef(vfloat_sve_sleef vd_sve_sleef) { + return svrintz_f32_x(svptrue_b8(), vd_sve_sleef); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vrint_vf_vf_sve_sleef(vfloat_sve_sleef vf) { + return svrintn_f32_x(svptrue_b32(), vf); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vadd_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svadd_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vsub_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svsub_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vneg_vi2_vi2_sve_sleef(vint2_sve_sleef e) { return svneg_s32_x(svptrue_b8(), e); } + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vand_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svand_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vandnot_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svbic_s32_x(svptrue_b8(), y, x); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vor_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svorr_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vxor_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return sveor_s32_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vgt_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svsel_s32(svcmpgt_s32(svptrue_b8(), x, y), svdup_n_s32(0xffffffff), svdup_n_s32(0x0)); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vsel_vi2_vo_vi2_vi2_sve_sleef(vopmask_sve_sleef m, vint2_sve_sleef x, vint2_sve_sleef y) { + return svsel_s32(m, x, y); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef veq_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmpeq_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vneq_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmpne_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vlt_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmplt_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vle_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmple_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vgt_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmpgt_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vge_vo_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return svcmpge_f32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visinf_vo_vf_sve_sleef(vfloat_sve_sleef d) { + return svcmpeq_n_f32(svptrue_b8(), vabs_vf_vf_sve_sleef(d), __builtin_inff()); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vispinf_vo_vf_sve_sleef(vfloat_sve_sleef d) { + return svcmpeq_n_f32(svptrue_b8(), d, __builtin_inff()); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visminf_vo_vf_sve_sleef(vfloat_sve_sleef d) { + return svcmpeq_n_f32(svptrue_b8(), d, -__builtin_inff()); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visnan_vo_vf_sve_sleef(vfloat_sve_sleef d) { return vneq_vo_vf_vf_sve_sleef(d, d); } + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef veq_vo_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svcmpeq_s32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vgt_vo_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svcmpgt_s32(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vand_vo_vo_vo_sve_sleef(vopmask_sve_sleef x, vopmask_sve_sleef y) { + return svand_b_z(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vandnot_vo_vo_vo_sve_sleef(vopmask_sve_sleef x, vopmask_sve_sleef y) { + return svbic_b_z(svptrue_b8(), y, x); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vor_vo_vo_vo_sve_sleef(vopmask_sve_sleef x, vopmask_sve_sleef y) { + return svorr_b_z(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vxor_vo_vo_vo_sve_sleef(vopmask_sve_sleef x, vopmask_sve_sleef y) { + return sveor_b_z(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vand_vi2_vo_vi2_sve_sleef(vopmask_sve_sleef x, vint2_sve_sleef y) { + + return svand_s32_z(x, y, y); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vand_vm_vo32_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + return svsel_s32(x, y, svdup_n_s32(0x0)); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vandnot_vm_vo32_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + return svsel_s32(x, svdup_n_s32(0x0), y); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vor_vm_vo32_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + return svsel_s32(x, svdup_n_s32(0xffffffff), y); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vcast_vm_i_i_sve_sleef(int i0, int i1) { + return svreinterpret_s32_u64( + svdup_n_u64((0xffffffff & (uint64_t)i1) | (((uint64_t)i0) << 32))); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vcast_vm_i64_sve_sleef(int64_t i) { + return svreinterpret_s32_u64(svdup_n_u64((uint64_t)i)); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vcast_vm_u64_sve_sleef(uint64_t i) { + return svreinterpret_s32_u64(svdup_n_u64(i)); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vload_vd_p_sve_sleef(const double *ptr) { + return svld1_f64(svptrue_b8(), ptr); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vloadu_vd_p_sve_sleef(const double *ptr) { + return svld1_f64(svptrue_b8(), ptr); +} +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vd_sve_sleef(double *ptr, vdouble_sve_sleef v) { + svst1_f64(svptrue_b8(), ptr, v); +} + +static SLEEF_ALWAYS_INLINE void vstoreu_v_p_vi_sve_sleef(int *ptr, vint_sve_sleef v) { + svst1w_s64(svptrue_b8(), ptr, svreinterpret_s64_s32(v)); +} +static vint_sve_sleef vloadu_vi_p_sve_sleef(int32_t *p) { + return svreinterpret_s32_s64(svld1uw_s64(svptrue_b8(), (uint32_t *)p)); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vreinterpret_vd_vm_sve_sleef(vmask_sve_sleef vm) { + return svreinterpret_f64_s32(vm); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vreinterpret_vm_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svreinterpret_s32_f64(vd_sve_sleef); +} +static SLEEF_ALWAYS_INLINE vint2_sve_sleef vcastu_vm_vi_sve_sleef(vint_sve_sleef x) { + return svreinterpret_s32_s64( + svlsl_n_s64_x(svptrue_b8(), svreinterpret_s64_s32(x), 32)); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vcastu_vi_vm_sve_sleef(vint2_sve_sleef x) { + return svreinterpret_s32_u64( + svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(x), 32)); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vcast_vd_vi_sve_sleef(vint_sve_sleef vi) { + return svcvt_f64_s32_x(svptrue_b8(), vi); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vcast_vd_d_sve_sleef(double d) { return svdup_n_f64(d); } + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsel_vd_vo_vd_vd_sve_sleef(vopmask_sve_sleef o, vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svsel_f64(o, x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsel_vd_vo_d_d_sve_sleef(vopmask_sve_sleef o, double v1, double v0) { + return vsel_vd_vo_vd_vd_sve_sleef(o, vcast_vd_d_sve_sleef(v1), vcast_vd_d_sve_sleef(v0)); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsel_vd_vo_vo_d_d_d_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd_sve_sleef(o0, vcast_vd_d_sve_sleef(d0), vsel_vd_vo_d_d_sve_sleef(o1, d1, d2)); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, vopmask_sve_sleef o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd_sve_sleef(o0, vcast_vd_d_sve_sleef(d0), vsel_vd_vo_vd_vd_sve_sleef(o1, vcast_vd_d_sve_sleef(d1), vsel_vd_vo_d_d_sve_sleef(o2, d2, d3))); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vsel_vi_vo_vi_vi_sve_sleef(vopmask_sve_sleef o, vint_sve_sleef x, vint_sve_sleef y) { + return svsel_s32(o, x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vtruncate_vd_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svrintz_f64_x(svptrue_b8(), vd_sve_sleef); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vtruncate_vi_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcvt_s32_f64_x(svptrue_b8(), vd_sve_sleef); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vrint_vi_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcvt_s32_f64_x(svptrue_b8(), svrintn_f64_x(svptrue_b8(), vd_sve_sleef)); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vrint_vd_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svrintn_f64_x(svptrue_b8(), vd_sve_sleef); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vadd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svadd_f64_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsub_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svsub_f64_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vneg_vd_vd_sve_sleef(vdouble_sve_sleef x) { return svneg_f64_x(svptrue_b8(), x); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmul_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svmul_f64_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vabs_vd_vd_sve_sleef(vdouble_sve_sleef x) { return svabs_f64_x(svptrue_b8(), x); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmax_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svmax_f64_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmin_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svmin_f64_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmla_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, + vdouble_sve_sleef z) { + return svmad_f64_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmlapn_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, + vdouble_sve_sleef z) { + return svnmsb_f64_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmlanp_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { + return svmsb_f64_x(svptrue_b8(), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vfma_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, + vdouble_sve_sleef z) { + return svmad_f64_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vfmanp_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, + vdouble_sve_sleef z) { + return svmsb_f64_x(svptrue_b8(), x, y, z); +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vfmapn_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, + vdouble_sve_sleef z) { + return svnmsb_f64_x(svptrue_b8(), x, y, z); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vdiv_vd_vd_vd_sve_sleef(vdouble_sve_sleef n, vdouble_sve_sleef d) { + + return svdiv_f64_x(svptrue_b8(), n, d); + +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vrec_vd_vd_sve_sleef(vdouble_sve_sleef d) { + + return svdivr_n_f64_x(svptrue_b8(), d, 1.0); + +} +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsqrt_vd_vd_sve_sleef(vdouble_sve_sleef d) { + + return svsqrt_f64_x(svptrue_b8(), d); + +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vlt_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmplt_f64(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef veq_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmpeq_f64(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vgt_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmpgt_f64(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vge_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmpge_f64(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vneq_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmpne_f64(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vle_vo_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return svcmple_f64(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visnan_vo_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcmpne_f64(svptrue_b8(), vd_sve_sleef, vd_sve_sleef); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visinf_vo_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcmpeq_n_f64(svptrue_b8(), svabs_f64_x(svptrue_b8(), vd_sve_sleef), __builtin_inf()); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vispinf_vo_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcmpeq_n_f64(svptrue_b8(), vd_sve_sleef, __builtin_inf()); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef visminf_vo_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + return svcmpeq_n_f64(svptrue_b8(), vd_sve_sleef, -__builtin_inf()); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef veq64_vo_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svcmpeq_s64(svptrue_b8(), svreinterpret_s64_s32(x), svreinterpret_s64_s32(y)); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vcast_vo32_vo64_sve_sleef(vopmask_sve_sleef o) { return o; } +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vcast_vo64_vo32_sve_sleef(vopmask_sve_sleef o) { return o; } +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vcast_vo_i_sve_sleef(int i) { return svcmpne_s32(svptrue_b8(), svdup_n_s32(i), svdup_n_s32(0)); } + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vand_vi_vo_vi_sve_sleef(vopmask_sve_sleef x, vint_sve_sleef y) { + + return svand_s32_z(x, y, y); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vandnot_vi_vo_vi_sve_sleef(vopmask_sve_sleef x, vint_sve_sleef y) { + return svsel_s32(x, svdup_n_s32(0x0), y); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vsrl_vi_vi_i_sve_sleef(vint_sve_sleef x, int c) { + return svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(x), c)); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vand_vi_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svand_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vandnot_vi_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svbic_s32_x(svptrue_b8(), y, x); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vxor_vi_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return sveor_s32_x(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vadd_vi_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svadd_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vsub_vi_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svsub_s32_x(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vint_sve_sleef vneg_vi_vi_sve_sleef(vint_sve_sleef x) { return svneg_s32_x(svptrue_b8(), x); } + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vgt_vo_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svcmpgt_s32(svptrue_b8(), x, y); +} +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef veq_vo_vi_vi_sve_sleef(vint_sve_sleef x, vint_sve_sleef y) { + return svcmpeq_s32(svptrue_b8(), x, y); +} + +static SLEEF_ALWAYS_INLINE vint_sve_sleef vcast_vi_i_sve_sleef(int i) { return svdup_n_s32(i); } + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vand_vm_vo64_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + + return svreinterpret_s32_s64( + svand_s64_z(x, svreinterpret_s64_s32(y), svreinterpret_s64_s32(y))); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vandnot_vm_vo64_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + return svreinterpret_s32_s64(svsel_s64( + x, svreinterpret_s64_s32(svdup_n_s32(0x0)), svreinterpret_s64_s32(y))); +} +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vor_vm_vo64_vm_sve_sleef(vopmask_sve_sleef x, vmask_sve_sleef y) { + return svreinterpret_s32_s64(svsel_s64( + x, svreinterpret_s64_s32(svdup_n_s32(0xffffffff)), svreinterpret_s64_s32(y))); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vrev21_vf_vf_sve_sleef(vfloat_sve_sleef vf) { + return svreinterpret_f32_u64(svrevw_u64_x(svptrue_b8(), svreinterpret_u64_f32(vf))); +} + +static SLEEF_ALWAYS_INLINE vint2_sve_sleef veq_vi2_vi2_vi2_sve_sleef(vint2_sve_sleef x, vint2_sve_sleef y) { + return svsel_s32(svcmpeq_s32(svptrue_b8(), x, y), svdup_n_s32(0xffffffff), svdup_n_s32(0x0)); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vgather_vd_p_vi_sve_sleef(const double *ptr, vint_sve_sleef vi) { + return svld1_gather_s64index_f64(svptrue_b8(), ptr, svreinterpret_s64_s32(vi)); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vgather_vf_p_vi2_sve_sleef(const float *ptr, vint2_sve_sleef vi2) { + return svld1_gather_s32index_f32(svptrue_b8(), ptr, vi2); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vposneg_vd_vd_sve_sleef(vdouble_sve_sleef d) { + return svneg_f64_m(d, svdupq_n_b64(0, 1), d); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vnegpos_vd_vd_sve_sleef(vdouble_sve_sleef d) { + return svneg_f64_m(d, svdupq_n_b64(1, 0), d); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vposneg_vf_vf_sve_sleef(vfloat_sve_sleef d) { + return svneg_f32_m(d, svdupq_n_b32(0, 1, 0, 1), d); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vnegpos_vf_vf_sve_sleef(vfloat_sve_sleef d) { + return svneg_f32_m(d, svdupq_n_b32(1, 0, 1, 0), d); +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vsubadd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { return vadd_vd_vd_vd_sve_sleef(x, vnegpos_vd_vd_sve_sleef(y)); } +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vsubadd_vf_vf_vf_sve_sleef(vfloat_sve_sleef d0, vfloat_sve_sleef d1) { return vadd_vf_vf_vf_sve_sleef(d0, vnegpos_vf_vf_sve_sleef(d1)); } +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vmlsubadd_vd_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { return vfma_vd_vd_vd_vd_sve_sleef(x, y, vnegpos_vd_vd_sve_sleef(z)); } +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vmlsubadd_vf_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y, vfloat_sve_sleef z) { return vfma_vf_vf_vf_vf_sve_sleef(x, y, vnegpos_vf_vf_sve_sleef(z)); } + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vrev21_vd_vd_sve_sleef(vdouble_sve_sleef x) { return svzip1_f64(svuzp2_f64(x, x), svuzp1_f64(x, x)); } + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vreva2_vd_vd_sve_sleef(vdouble_sve_sleef vd_sve_sleef) { + svint64_t x = svindex_s64(((svcntd())-1), -1); + x = svzip1_s64(svuzp2_s64(x, x), svuzp1_s64(x, x)); + return svtbl_f64(vd_sve_sleef, svreinterpret_u64_s64(x)); +} + +static SLEEF_ALWAYS_INLINE vfloat_sve_sleef vreva2_vf_vf_sve_sleef(vfloat_sve_sleef vf) { + svint32_t x = svindex_s32(((svcntw())-1), -1); + x = svzip1_s32(svuzp2_s32(x, x), svuzp1_s32(x, x)); + return svtbl_f32(vf, svreinterpret_u32_s32(x)); +} + +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vd_sve_sleef(double *ptr, int offset, int step, vdouble_sve_sleef v) { + svst1_scatter_u64index_f64(svptrue_b8(), ptr + offset*2, svzip1_u64(svindex_u64(0, step*2), svindex_u64(1, step*2)), v); +} + +static SLEEF_ALWAYS_INLINE void vscatter2_v_p_i_i_vf_sve_sleef(float *ptr, int offset, int step, vfloat_sve_sleef v) { + svst1_scatter_u32index_f32(svptrue_b8(), ptr + offset*2, svzip1_u32(svindex_u32(0, step*2), svindex_u32(1, step*2)), v); +} + +static SLEEF_ALWAYS_INLINE void vstore_v_p_vd_sve_sleef(double *ptr, vdouble_sve_sleef v) { vstoreu_v_p_vd_sve_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstream_v_p_vd_sve_sleef(double *ptr, vdouble_sve_sleef v) { vstore_v_p_vd_sve_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstore_v_p_vf_sve_sleef(float *ptr, vfloat_sve_sleef v) { vstoreu_v_p_vf_sve_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vstream_v_p_vf_sve_sleef(float *ptr, vfloat_sve_sleef v) { vstore_v_p_vf_sve_sleef(ptr, v); } +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vd_sve_sleef(double *ptr, int offset, int step, vdouble_sve_sleef v) { vscatter2_v_p_i_i_vd_sve_sleef(ptr, offset, step, v); } +static SLEEF_ALWAYS_INLINE void vsscatter2_v_p_i_i_vf_sve_sleef(float *ptr, int offset, int step, vfloat_sve_sleef v) { vscatter2_v_p_i_i_vf_sve_sleef(ptr, offset, step, v); } + +static double vcast_d_vd_sve_sleef(vdouble_sve_sleef v) { + double a[svcntd()]; + vstoreu_v_p_vd_sve_sleef(a, v); + return a[0]; +} + +static float vcast_f_vf_sve_sleef(vfloat_sve_sleef v) { + float a[svcntw()]; + vstoreu_v_p_vf_sve_sleef(a, v); + return a[0]; +} + +static int vcast_i_vi(vint_sve_sleef v) { + int a[svcntw()]; + vstoreu_v_p_vi_sve_sleef(a, v); + return a[0]; +} + +static int vcast_i_vi2(vint2_sve_sleef v) { + int a[svcntw()]; + vstoreu_v_p_vi2_sve_sleef(a, v); + return a[0]; +} + +static vquad_sve_sleef loadu_vq_p_sve_sleef(const int32_t *ptr) { + int32_t a[svcntw()*2]; + memcpy(a, ptr, svcntw()*8); + return svld2_s32(svptrue_b8(), a); +} + +static SLEEF_ALWAYS_INLINE vquad_sve_sleef cast_vq_aq_sve_sleef(vargquad_sve_sleef aq) { return aq; } +static SLEEF_ALWAYS_INLINE vargquad_sve_sleef cast_aq_vq_sve_sleef(vquad_sve_sleef vq) { return vq; } + +static SLEEF_ALWAYS_INLINE int vtestallzeros_i_vo64_sve_sleef(vopmask_sve_sleef g) { + return svcntp_b64(svptrue_b64(), g) == 0; +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vsel_vm_vo64_vm_vm_sve_sleef(vopmask_sve_sleef o, vmask_sve_sleef x, vmask_sve_sleef y) { + return svreinterpret_s32_s64(svsel_s64(o, svreinterpret_s64_s32(x), svreinterpret_s64_s32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vsub64_vm_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svreinterpret_s32_s64( + svsub_s64_x(svptrue_b8(), svreinterpret_s64_s32(x), + svreinterpret_s64_s32(y))); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vneg64_vm_vm_sve_sleef(vmask_sve_sleef x) { + return svreinterpret_s32_s64(svneg_s64_x(svptrue_b8(), svreinterpret_s64_s32(x))); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vgt64_vo_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + return svcmpgt_s64(svptrue_b8(), svreinterpret_s64_s32(x), svreinterpret_s64_s32(y)); +} + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vcast_vm_vi_sve_sleef(vint_sve_sleef vi) { return svreinterpret_s32_s64(svextw_s64_z(svptrue_b8(), svreinterpret_s64_s32(vi))); } +static SLEEF_ALWAYS_INLINE vint_sve_sleef vcast_vi_vm_sve_sleef(vmask_sve_sleef vm) { return vand_vm_vm_vm_sve_sleef(vm, vcast_vm_i_i_sve_sleef(0, 0xffffffff)); } + +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vreinterpret_vm_vi64_sve_sleef(vint64_sve_sleef v) { return svreinterpret_s32_s64(v); } +static SLEEF_ALWAYS_INLINE vint64_sve_sleef vreinterpret_vi64_vm_sve_sleef(vmask_sve_sleef m) { return svreinterpret_s64_s32(m); } +static SLEEF_ALWAYS_INLINE vmask_sve_sleef vreinterpret_vm_vu64_sve_sleef(vuint64_sve_sleef v) { return svreinterpret_s32_u64(v); } +static SLEEF_ALWAYS_INLINE vuint64_sve_sleef vreinterpret_vu64_vm_sve_sleef(vmask_sve_sleef m) { return svreinterpret_u64_s32(m); } + +typedef struct { + double x, y; +} double2_sve_sleef; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST double2_sve_sleef dd_sve_sleef(double h, double l) { + double2_sve_sleef ret = { h, l }; + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vupper_vd_vd_sve_sleef(vdouble_sve_sleef d) { + return vreinterpret_vd_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vcast_vm_i_i_sve_sleef(0xffffffff, 0xf8000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef vcast_vd2_vd_vd_sve_sleef(vdouble_sve_sleef h, vdouble_sve_sleef l) { + return vd2setxy_vd2_vd_vd_sve_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef vcast_vd2_d_d_sve_sleef(double h, double l) { + return vd2setxy_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(h), vcast_vd_d_sve_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef vcast_vd2_d2_sve_sleef(double2_sve_sleef dd_sve_sleef) { + return vd2setxy_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(dd_sve_sleef.x), vcast_vd_d_sve_sleef(dd_sve_sleef.y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef vsel_vd2_vo_vd2_vd2_sve_sleef(vopmask_sve_sleef m, vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + return vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(m, vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)), + vsel_vd_vo_vd_vd_sve_sleef(m, vd2gety_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef vsel_vd2_vo_d_d_d_d_sve_sleef(vopmask_sve_sleef o, double x1, double y1, double x0, double y0) { + return vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_d_d_sve_sleef(o, x1, x0), + vsel_vd_vo_d_d_sve_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vadd_vd_3vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2) { + return vadd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vadd_vd_4vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3) { + return vadd_vd_3vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vadd_vd_5vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3, vdouble_sve_sleef v4) { + return vadd_vd_4vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vadd_vd_6vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3, vdouble_sve_sleef v4, vdouble_sve_sleef v5) { + return vadd_vd_5vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vadd_vd_7vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3, vdouble_sve_sleef v4, vdouble_sve_sleef v5, vdouble_sve_sleef v6) { + return vadd_vd_6vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsub_vd_3vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2) { + return vsub_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsub_vd_4vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3) { + return vsub_vd_3vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsub_vd_5vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3, vdouble_sve_sleef v4) { + return vsub_vd_4vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsub_vd_6vd_sve_sleef(vdouble_sve_sleef v0, vdouble_sve_sleef v1, vdouble_sve_sleef v2, vdouble_sve_sleef v3, vdouble_sve_sleef v4, vdouble_sve_sleef v5) { + return vsub_vd_5vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddneg_vd2_vd2_sve_sleef(vdouble2_sve_sleef x) { + return vcast_vd2_vd_vd_sve_sleef(vneg_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)), vneg_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddabs_vd2_vd2_sve_sleef(vdouble2_sve_sleef x) { + return vcast_vd2_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)), + vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x)), + vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)), + vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddnormalize_vd2_vd2_sve_sleef(vdouble2_sve_sleef t) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), vd2gety_vd_vd2_sve_sleef(t)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), s), vd2gety_vd_vd2_sve_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddscale_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef d, vdouble_sve_sleef s) { + return vd2setxy_vd2_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), s), vmul_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddscale_vd2_vd2_d_sve_sleef(vdouble2_sve_sleef d, double s) { return ddscale_vd2_vd2_vd_sve_sleef(d, vcast_vd_d_sve_sleef(s)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd_vd2_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(x, y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd2_vd2_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(x, y); + vdouble_sve_sleef v = vsub_vd_vd_vd_sve_sleef(s, x); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, vsub_vd_vd_vd_sve_sleef(s, v)), vsub_vd_vd_vd_sve_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_3vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), s), y, vd2gety_vd_vd2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsub_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), s), y), vd2gety_vd_vd2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd2_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), y); + vdouble_sve_sleef v = vsub_vd_vd_vd_sve_sleef(s, vd2getx_vd_vd2_sve_sleef(x)); + vdouble_sve_sleef w = vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vsub_vd_vd_vd_sve_sleef(s, v)), vsub_vd_vd_vd_sve_sleef(y, v)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(w, vd2gety_vd_vd2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd_vd2_vd_vd2_sve_sleef(vdouble_sve_sleef x, vdouble2_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(x, vd2getx_vd_vd2_sve_sleef(y)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_3vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, s), vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd2_vd2_vd_vd2_sve_sleef(vdouble_sve_sleef x, vdouble2_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(x, vd2getx_vd_vd2_sve_sleef(y)); + vdouble_sve_sleef v = vsub_vd_vd_vd_sve_sleef(s, x); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, vsub_vd_vd_vd_sve_sleef(s, v)), + vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), v)), vd2gety_vd_vd2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_4vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), s), vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddadd2_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + vdouble_sve_sleef s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)); + vdouble_sve_sleef v = vsub_vd_vd_vd_sve_sleef(s, vd2getx_vd_vd2_sve_sleef(x)); + vdouble_sve_sleef t = vadd_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vsub_vd_vd_vd_sve_sleef(s, v)), vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), v)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vadd_vd_vd_vd_sve_sleef(t, vadd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsub_vd2_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + + vdouble_sve_sleef s = vsub_vd_vd_vd_sve_sleef(x, y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vsub_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsub_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + + vdouble_sve_sleef s = vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)); + vdouble_sve_sleef t = vsub_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), s); + t = vsub_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(y)); + t = vadd_vd_vd_vd_sve_sleef(t, vd2gety_vd_vd2_sve_sleef(x)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vsub_vd_vd_vd_sve_sleef(t, vd2gety_vd_vd2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef dddiv_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef n, vdouble2_sve_sleef d) { + vdouble_sve_sleef t = vrec_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d)); + vdouble_sve_sleef s = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(n), t); + vdouble_sve_sleef u = vfmapn_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(n), s); + vdouble_sve_sleef v = vfmanp_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(d), t, vfmanp_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), t, vcast_vd_d_sve_sleef(1))); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vfma_vd_vd_vd_vd_sve_sleef(s, v, vfma_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddmul_vd2_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vmul_vd_vd_vd_sve_sleef(x, y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vfmapn_vd_vd_vd_vd_sve_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsqu_vd2_vd2_sve_sleef(vdouble2_sve_sleef x) { + vdouble_sve_sleef s = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vfma_vd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)), vd2gety_vd_vd2_sve_sleef(x), vfmapn_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddmul_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + vdouble_sve_sleef s = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vfma_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(y), vfma_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y), vfmapn_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef ddmul_vd_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y) { + return vfma_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y), vfma_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y), vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef ddsqu_vd_vd2_sve_sleef(vdouble2_sve_sleef x) { + return vfma_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x), vadd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)), vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddmul_vd2_vd2_vd_sve_sleef(vdouble2_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef s = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), y); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vfma_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x), y, vfmapn_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddrec_vd2_vd_sve_sleef(vdouble_sve_sleef d) { + vdouble_sve_sleef s = vrec_vd_vd_sve_sleef(d); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(s, vfmanp_vd_vd_vd_vd_sve_sleef(d, s, vcast_vd_d_sve_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddrec_vd2_vd2_sve_sleef(vdouble2_sve_sleef d) { + vdouble_sve_sleef s = vrec_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d)); + return vd2setxy_vd2_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(s, vfmanp_vd_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(d), s, vfmanp_vd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), s, vcast_vd_d_sve_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsqrt_vd2_vd2_sve_sleef(vdouble2_sve_sleef d) { + vdouble_sve_sleef t = vsqrt_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d))); + return ddscale_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd2_sve_sleef(d, ddmul_vd2_vd_vd_sve_sleef(t, t)), ddrec_vd2_vd_sve_sleef(t)), vcast_vd_d_sve_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddsqrt_vd2_vd_sve_sleef(vdouble_sve_sleef d) { + vdouble_sve_sleef t = vsqrt_vd_vd_sve_sleef(d); + return ddscale_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd2_sve_sleef(d, ddmul_vd2_vd_vd_sve_sleef(t, t)), ddrec_vd2_vd_sve_sleef(t)), vcast_vd_d_sve_sleef(0.5)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddmla_vd2_vd2_vd2_vd2_sve_sleef(vdouble2_sve_sleef x, vdouble2_sve_sleef y, vdouble2_sve_sleef z) { + return ddadd_vd2_vd2_vd2_sve_sleef(z, ddmul_vd2_vd2_vd2_sve_sleef(x, y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visnegzero_vo_vd_sve_sleef(vdouble_sve_sleef d) { + return veq64_vo_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visnumber_vo_vd_sve_sleef(vdouble_sve_sleef x) { + return vandnot_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), veq_vo_vd_vd_sve_sleef(x, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visnonfinite_vo_vd_sve_sleef(vdouble_sve_sleef x) { + return veq64_vo_vm_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(x), vcast_vm_i64_sve_sleef(INT64_C(0x7ff0000000000000))), vcast_vm_i64_sve_sleef(INT64_C(0x7ff0000000000000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vsignbit_vm_vd_sve_sleef(vdouble_sve_sleef d) { + return vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef vsignbit_vo_vd_sve_sleef(vdouble_sve_sleef d) { + return veq64_vo_vm_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vclearlsb_vd_vd_i_sve_sleef(vdouble_sve_sleef d, int n) { + return vreinterpret_vd_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vcast_vm_u64_sve_sleef((~UINT64_C(0)) << n))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vtoward0_vd_vd_sve_sleef(vdouble_sve_sleef x) { + vdouble_sve_sleef t = vreinterpret_vd_vm_sve_sleef(vadd64_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(x), vcast_vm_i64_sve_sleef(-1))); + return vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vmulsign_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(x), vsignbit_vm_vd_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vsign_vd_vd_sve_sleef(vdouble_sve_sleef d) { + return vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1.0), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vorsign_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return vreinterpret_vd_vm_sve_sleef(vor_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(x), vsignbit_vm_vd_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vcopysign_vd_vd_vd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef y) { + return vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vandnot_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0)), vreinterpret_vm_vd_sve_sleef(x)), + vand_vm_vm_vm_sve_sleef (vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0)), vreinterpret_vm_vd_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vtruncate2_vd_vd_sve_sleef_sve_sleef(vdouble_sve_sleef x) { + + return vtruncate_vd_vd_sve_sleef(x); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vfloor2_vd_vd_sve_sleef(vdouble_sve_sleef x) { + vdouble_sve_sleef fr = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(INT64_C(1) << 31), vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_sve_sleef(fr, vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(fr))); + fr = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(0)), vadd_vd_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(1.0)), fr); + return vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), vge_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vceil2_vd_vd_sve_sleef(vdouble_sve_sleef x) { + vdouble_sve_sleef fr = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(INT64_C(1) << 31), vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_sve_sleef(fr, vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(fr))); + fr = vsel_vd_vo_vd_vd_sve_sleef(vle_vo_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(0)), fr, vsub_vd_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(1.0))); + return vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), vge_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(INT64_C(1) << 52))), x, vcopysign_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, fr), x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vround2_vd_vd_sve_sleef(vdouble_sve_sleef d) { + vdouble_sve_sleef x = vadd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.5)); + vdouble_sve_sleef fr = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(INT64_C(1) << 31), vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_sve_sleef(fr, vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(fr))); + x = vsel_vd_vo_vd_vd_sve_sleef(vand_vo_vo_vo_sve_sleef(vle_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), veq_vo_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(0))), vsub_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0)), x); + fr = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(0)), vadd_vd_vd_vd_sve_sleef(fr, vcast_vd_d_sve_sleef(1.0)), fr); + x = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.49999999999999994449)), vcast_vd_d_sve_sleef(0), x); + return vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), vge_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(INT64_C(1) << 52))), d, vcopysign_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, fr), d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vrint2_vd_vd_sve_sleef(vdouble_sve_sleef d) { + + return vrint_vd_vd_sve_sleef(d); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visint_vo_vd_sve_sleef(vdouble_sve_sleef d) { + return veq_vo_vd_vd_sve_sleef(vrint2_vd_vd_sve_sleef(d), d); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visodd_vo_vd_sve_sleef(vdouble_sve_sleef d) { + vdouble_sve_sleef x = vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.5)); + return vneq_vo_vd_vd_sve_sleef(vrint2_vd_vd_sve_sleef(x), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_sve_sleef vilogbk_vi_vd_sve_sleef(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2.037035976334486E90), d), d); + vint_sve_sleef q = vcastu_vi_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d)); + q = vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef((int)(((1U << 12) - 1) << 20))); + q = vsrl_vi_vi_i_sve_sleef(q, 20); + q = vsub_vi_vi_vi_sve_sleef(q, vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vcast_vi_i_sve_sleef(300 + 0x3ff), vcast_vi_i_sve_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_sve_sleef vilogb2k_vi_vd_sve_sleef(vdouble_sve_sleef d) { + vint_sve_sleef q = vcastu_vi_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d)); + q = vsrl_vi_vi_i_sve_sleef(q, 20); + q = vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(0x7ff)); + q = vsub_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(0x3ff)); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vilogb2k_vm_vd_sve_sleef(vdouble_sve_sleef d) { + vmask_sve_sleef m = vreinterpret_vm_vd_sve_sleef(d); + m = svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(m), 20 + 32)); + m = vand_vm_vm_vm_sve_sleef(m, vcast_vm_i64_sve_sleef(0x7ff)); + m = vsub64_vm_vm_vm_sve_sleef(m, vcast_vm_i64_sve_sleef(0x3ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vilogb3k_vm_vd_sve_sleef(vdouble_sve_sleef d) { + vmask_sve_sleef m = vreinterpret_vm_vd_sve_sleef(d); + m = svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(m), 20 + 32)); + m = vand_vm_vm_vm_sve_sleef(m, vcast_vm_i64_sve_sleef(0x7ff)); + return m; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vpow2i_vd_vi_sve_sleef(vint_sve_sleef q) { + q = vadd_vi_vi_vi_sve_sleef(vcast_vi_i_sve_sleef(0x3ff), q); + vmask_sve_sleef r = vcastu_vm_vi_sve_sleef(svlsl_n_s32_x(svptrue_b8(), q, 20)); + return vreinterpret_vd_vm_sve_sleef(r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vpow2i_vd_vm_sve_sleef(vmask_sve_sleef q) { + q = vadd64_vm_vm_vm_sve_sleef(vcast_vm_i64_sve_sleef(0x3ff), q); + return vreinterpret_vd_vm_sve_sleef(svreinterpret_s32_u64(svlsl_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(q), 52))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp_vd_vd_vi_sve_sleef(vdouble_sve_sleef x, vint_sve_sleef q) { + vint_sve_sleef m = svasr_n_s32_x(svptrue_b8(), q, 31); + m = svlsl_n_s32_x(svptrue_b8(), vsub_vi_vi_vi_sve_sleef(svasr_n_s32_x(svptrue_b8(), vadd_vi_vi_vi_sve_sleef(m, q), 9), m), 7); + q = vsub_vi_vi_vi_sve_sleef(q, svlsl_n_s32_x(svptrue_b8(), m, 2)); + m = vadd_vi_vi_vi_sve_sleef(vcast_vi_i_sve_sleef(0x3ff), m); + m = vandnot_vi_vo_vi_sve_sleef(vgt_vo_vi_vi_sve_sleef(vcast_vi_i_sve_sleef(0), m), m); + m = vsel_vi_vo_vi_vi_sve_sleef(vgt_vo_vi_vi_sve_sleef(m, vcast_vi_i_sve_sleef(0x7ff)), vcast_vi_i_sve_sleef(0x7ff), m); + vmask_sve_sleef r = vcastu_vm_vi_sve_sleef(svlsl_n_s32_x(svptrue_b8(), m, 20)); + vdouble_sve_sleef y = vreinterpret_vd_vm_sve_sleef(r); + return vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, y), y), y), y), vpow2i_vd_vi_sve_sleef(q)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp2_vd_vd_vi_sve_sleef(vdouble_sve_sleef d, vint_sve_sleef e) { + return vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vi_sve_sleef(svasr_n_s32_x(svptrue_b8(), e, 1))), vpow2i_vd_vi_sve_sleef(vsub_vi_vi_vi_sve_sleef(e, svasr_n_s32_x(svptrue_b8(), e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp3_vd_vd_vi_sve_sleef(vdouble_sve_sleef d, vint_sve_sleef q) { + return vreinterpret_vd_vm_sve_sleef(vadd64_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vcastu_vm_vi_sve_sleef(svlsl_n_s32_x(svptrue_b8(), q, 20)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp1_vd_vd_vm_sve_sleef(vdouble_sve_sleef d, vmask_sve_sleef e) { + vmask_sve_sleef m = svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(e), 2)); + e = vsub64_vm_vm_vm_sve_sleef(vsub64_vm_vm_vm_sve_sleef(vsub64_vm_vm_vm_sve_sleef(e, m), m), m); + d = vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vm_sve_sleef(m)); + d = vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vm_sve_sleef(m)); + d = vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vm_sve_sleef(m)); + d = vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vm_sve_sleef(e)); + return d; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp2_vd_vd_vm_sve_sleef(vdouble_sve_sleef d, vmask_sve_sleef e) { + return vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vpow2i_vd_vm_sve_sleef(svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(e), 1)))), vpow2i_vd_vm_sve_sleef(vsub64_vm_vm_vm_sve_sleef(e, svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(e), 1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vldexp3_vd_vd_vm_sve_sleef(vdouble_sve_sleef d, vmask_sve_sleef q) { + return vreinterpret_vd_vm_sve_sleef(vadd64_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), svreinterpret_s32_u64(svlsl_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(q), 52)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vcast_vd_vm_sve_sleef(vmask_sve_sleef m) { return vcast_vd_vi_sve_sleef(vcast_vi_vm_sve_sleef(m)); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vtruncate_vm_vd_sve_sleef(vdouble_sve_sleef d) { return vcast_vm_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(d)); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef vlt64_vo_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { return vgt64_vo_vm_vm_sve_sleef(y, x); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef vnot_vo64_vo64_sve_sleef(vopmask_sve_sleef x) { + return vxor_vo_vo_vo_sve_sleef(x, veq64_vo_vm_vm_sve_sleef(vcast_vm_i64_sve_sleef(0), vcast_vm_i64_sve_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef vugt64_vo_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { + x = vxor_vm_vm_vm_sve_sleef(vcast_vm_u64_sve_sleef(UINT64_C(0x8000000000000000)), x); + y = vxor_vm_vm_vm_sve_sleef(vcast_vm_u64_sve_sleef(UINT64_C(0x8000000000000000)), y); + return vgt64_vo_vm_vm_sve_sleef(x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vilogbk_vm_vd_sve_sleef(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(4.9090934652977266E-91)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2.037035976334486E90), d), d); + vmask_sve_sleef q = vreinterpret_vm_vd_sve_sleef(d); + q = svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(q), 20 + 32)); + q = vand_vm_vm_vm_sve_sleef(q, vcast_vm_i64_sve_sleef(0x7ff)); + q = vsub64_vm_vm_vm_sve_sleef(q, vsel_vm_vo64_vm_vm_sve_sleef(o, vcast_vm_i64_sve_sleef(300 + 0x3ff), vcast_vm_i64_sve_sleef(0x3ff))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_sve_sleef sel_vq_vo_vq_vq_sve_sleef(vopmask_sve_sleef o, vquad_sve_sleef x, vquad_sve_sleef y) { + return vqsetxy_vq_vm_vm_sve_sleef(vsel_vm_vo64_vm_vm_sve_sleef(o, vqgetx_vm_vq_sve_sleef(x), vqgetx_vm_vq_sve_sleef(y)), vsel_vm_vo64_vm_vm_sve_sleef(o, vqgety_vm_vq_sve_sleef(x), vqgety_vm_vq_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_sve_sleef add128_vq_vq_vq_sve_sleef(vquad_sve_sleef x, vquad_sve_sleef y) { + vquad_sve_sleef r = vqsetxy_vq_vm_vm_sve_sleef(vadd64_vm_vm_vm_sve_sleef(vqgetx_vm_vq_sve_sleef(x), vqgetx_vm_vq_sve_sleef(y)), vadd64_vm_vm_vm_sve_sleef(vqgety_vm_vq_sve_sleef(x), vqgety_vm_vq_sve_sleef(y))); + r = vqsety_vq_vq_vm_sve_sleef(r, vadd64_vm_vm_vm_sve_sleef(vqgety_vm_vq_sve_sleef(r), vand_vm_vo64_vm_sve_sleef(vugt64_vo_vm_vm_sve_sleef(vqgetx_vm_vq_sve_sleef(x), vqgetx_vm_vq_sve_sleef(r)), vcast_vm_i64_sve_sleef(1)))); + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vquad_sve_sleef imdvq_vq_vm_vm_sve_sleef(vmask_sve_sleef x, vmask_sve_sleef y) { vquad_sve_sleef r = vqsetxy_vq_vm_vm_sve_sleef(x, y); return r; } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST di_t_sve_sleef rempisub_sve_sleef(vdouble_sve_sleef x) { + + vdouble_sve_sleef y = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(4))); + vint_sve_sleef vi = vtruncate_vi_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(y, vmul_vd_vd_vd_sve_sleef(vrint_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(4)))); + return disetdi_di_vd_vi_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0.25))), vi); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_sve_sleef vsel_vi_vd_vd_vi_vi_sve_sleef(vdouble_sve_sleef d0, vdouble_sve_sleef d1, vint_sve_sleef x, vint_sve_sleef y) { return vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(d0, d1)), x, y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint_sve_sleef vsel_vi_vd_vi_sve_sleef(vdouble_sve_sleef d, vint_sve_sleef x) { return vand_vi_vo_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vsignbit_vo_vd_sve_sleef(d)), x); } + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_ldexpdx_sve(vdouble_sve_sleef x, vint_sve_sleef q) { return vldexp_vd_vd_vi_sve_sleef(x, q); } + +SLEEF_INLINE SLEEF_CONST vint_sve_sleef Sleef_ilogbdx_sve(vdouble_sve_sleef d) { + vdouble_sve_sleef e = vcast_vd_vi_sve_sleef(vilogbk_vi_vd_sve_sleef(vabs_vd_vd_sve_sleef(d))); + e = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vd_vo_vd_vd_sve_sleef(visnan_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(2147483647), e); + return vrint_vi_vd_sve_sleef(e); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST ddi_t_sve_sleef rempi_sve_sleef(vdouble_sve_sleef a) { + vdouble2_sve_sleef x, y; + vint_sve_sleef ex = vilogb2k_vi_vd_sve_sleef(a); + + ex = vsub_vi_vi_vi_sve_sleef(ex, vcast_vi_i_sve_sleef(55)); + vint_sve_sleef q = vand_vi_vo_vi_sve_sleef(vgt_vo_vi_vi_sve_sleef(ex, vcast_vi_i_sve_sleef(700-55)), vcast_vi_i_sve_sleef(-64)); + a = vldexp3_vd_vd_vi_sve_sleef(a, q); + ex = vandnot_vi_vi_vi_sve_sleef(svasr_n_s32_x(svptrue_b8(), ex, 31), ex); + ex = svlsl_n_s32_x(svptrue_b8(), ex, 2); + x = ddmul_vd2_vd_vd_sve_sleef(a, vgather_vd_p_vi_sve_sleef(Sleef_rempitabdp, ex)); + di_t_sve_sleef di = rempisub_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)); + q = digeti_vi_di_sve_sleef(di); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, digetd_vd_di_sve_sleef(di)); + x = ddnormalize_vd2_vd2_sve_sleef(x); + y = ddmul_vd2_vd_vd_sve_sleef(a, vgather_vd_p_vi_sve_sleef(Sleef_rempitabdp+1, ex)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(x, y); + di = rempisub_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)); + q = vadd_vi_vi_vi_sve_sleef(q, digeti_vi_di_sve_sleef(di)); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, digetd_vd_di_sve_sleef(di)); + x = ddnormalize_vd2_vd2_sve_sleef(x); + y = vcast_vd2_vd_vd_sve_sleef(vgather_vd_p_vi_sve_sleef(Sleef_rempitabdp+2, ex), vgather_vd_p_vi_sve_sleef(Sleef_rempitabdp+3, ex)); + y = ddmul_vd2_vd2_vd_sve_sleef(y, a); + x = ddadd2_vd2_vd2_vd2_sve_sleef(x, y); + x = ddnormalize_vd2_vd2_sve_sleef(x); + x = ddmul_vd2_vd2_vd2_sve_sleef(x, vcast_vd2_d_d_sve_sleef(3.141592653589793116*2, 1.2246467991473532072e-16*2)); + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(a), vcast_vd_d_sve_sleef(0.7)); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, vsel_vd_vo_vd_vd_sve_sleef(o, a, vd2getx_vd_vd2_sve_sleef(x))); + x = vd2sety_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x))))); + return ddisetddi_ddi_vd2_vi_sve_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sindx_u35sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u, s, r = d; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmlapn_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_sve_sleef(dql); + + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16), d); + d = vmla_vd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24), d); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(3)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0))), vcast_vi_i_sve_sleef(2), vcast_vi_i_sve_sleef(1))); + ql = svasr_n_s32_x(svptrue_b8(), ql, 2); + vopmask_sve_sleef o = veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1)); + vdouble2_sve_sleef x = vcast_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)))); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef), x); + ddi_sve_sleef = ddisetdd_ddi_ddi_vd2_sve_sleef(ddi_sve_sleef, vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(o), x, ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + d = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vd2gety_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + d = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(r), visnan_vo_vd_sve_sleef(r)), vreinterpret_vm_vd_sve_sleef(d))); + } + + s = vmul_vd_vd_vd_sve_sleef(d, d); + + d = vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1))), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(d))); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_sve_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_sve_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_sve_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-0.000198412698412696162806809)), (vcast_vd_d_sve_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(u, d)), d); + + u = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sindx_u10sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u; + vdouble2_sve_sleef s, t, x; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + const vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + u = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116), d); + s = ddadd_vd2_vd_vd_sve_sleef (u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + const vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmlapn_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724), dqh)); + ql = vrint_vi_vd_sve_sleef(dql); + + u = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914), d); + s = ddadd_vd2_vd_vd_sve_sleef (u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24))); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(3)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0))), vcast_vi_i_sve_sleef(2), vcast_vi_i_sve_sleef(1))); + ql = svasr_n_s32_x(svptrue_b8(), ql, 2); + vopmask_sve_sleef o = veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1)); + vdouble2_sve_sleef x = vcast_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)))); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef), x); + ddi_sve_sleef = ddisetdd_ddi_ddi_vd2_sve_sleef(ddi_sve_sleef, vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(o), x, ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + s = ddnormalize_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)); + s = vd2setx_vd2_vd2_vd_sve_sleef(s, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_sve_sleef(s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2getx_vd_vd2_sve_sleef(s)), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_sve_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_sve_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_sve_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), ddmul_vd2_vd2_vd2_sve_sleef(ddadd_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_sve_sleef(t, x); + + u = vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1))), + vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(u))); + u = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_cosdx_u35sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u, s, r = d; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vmla_vd_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), + vrint_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724), vcast_vd_d_sve_sleef(-0.5))), + vcast_vd_d_sve_sleef(1)); + ql = vrint_vi_vd_sve_sleef(dql); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), d); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_sve_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-(1 << 23)), vcast_vd_d_sve_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vcast_vi_i_sve_sleef(1)); + vdouble_sve_sleef dql = vcast_vd_vi_sve_sleef(ql); + + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), d); + d = vmla_vd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24 * 0.5), d); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(3)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0))), vcast_vi_i_sve_sleef(8), vcast_vi_i_sve_sleef(7))); + ql = svasr_n_s32_x(svptrue_b8(), ql, 1); + vopmask_sve_sleef o = veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(0)); + vdouble_sve_sleef y = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(0), vcast_vd_d_sve_sleef(-1)); + vdouble2_sve_sleef x = vcast_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef), x); + ddi_sve_sleef = ddisetdd_ddi_ddi_vd2_sve_sleef(ddi_sve_sleef, vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(o), x, ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + d = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vd2gety_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + d = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(r), visnan_vo_vd_sve_sleef(r)), vreinterpret_vm_vd_sve_sleef(d))); + } + + s = vmul_vd_vd_vd_sve_sleef(d, d); + + d = vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(0))), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(d))); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-7.97255955009037868891952e-18)), (vcast_vd_d_sve_sleef(2.81009972710863200091251e-15)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-7.64712219118158833288484e-13)), (vcast_vd_d_sve_sleef(1.60590430605664501629054e-10)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-2.50521083763502045810755e-08)), (vcast_vd_d_sve_sleef(2.75573192239198747630416e-06)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(-0.000198412698412696162806809)), (vcast_vd_d_sve_sleef(0.00833333333333332974823815))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_cosdx_u10sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u; + vdouble2_sve_sleef s, t, x; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724), vcast_vd_d_sve_sleef(-0.5))); + dql = vmla_vd_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), dql, vcast_vd_d_sve_sleef(1)); + ql = vrint_vi_vd_sve_sleef(dql); + s = ddadd2_vd2_vd_vd_sve_sleef(d, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116*0.5))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724 / (1 << 23)), vcast_vd_d_sve_sleef(-0.318309886183790671537767526745028724 / (1 << 24)))); + ql = vrint_vi_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.318309886183790671537767526745028724)), + vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-(1 << 23)), vcast_vd_d_sve_sleef(-0.5)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vcast_vi_i_sve_sleef(1)); + const vdouble_sve_sleef dql = vcast_vd_vi_sve_sleef(ql); + + u = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd2_vd2_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(3)); + ql = vadd_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, ql), vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0))), vcast_vi_i_sve_sleef(8), vcast_vi_i_sve_sleef(7))); + ql = svasr_n_s32_x(svptrue_b8(), ql, 1); + vopmask_sve_sleef o = veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef), vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(0)); + vdouble_sve_sleef y = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(0), vcast_vd_d_sve_sleef(-1)); + vdouble2_sve_sleef x = vcast_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef), x); + ddi_sve_sleef = ddisetdd_ddi_ddi_vd2_sve_sleef(ddi_sve_sleef, vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(o), x, ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + s = ddnormalize_vd2_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)); + s = vd2setx_vd2_vd2_vd_sve_sleef(s, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s))))); + } + + t = s; + s = ddsqu_vd2_vd2_sve_sleef(s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2getx_vd_vd2_sve_sleef(s)), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.72052416138529567917983e-15)), (vcast_vd_d_sve_sleef(-7.6429259411395447190023e-13)))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(1.60589370117277896211623e-10)), (vcast_vd_d_sve_sleef(-2.5052106814843123359368e-08)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.75573192104428224777379e-06)), (vcast_vd_d_sve_sleef(-0.000198412698412046454654947))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), ddmul_vd2_vd2_vd2_sve_sleef(ddadd_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.166666666666666657414808), vmul_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s))), s)); + u = ddmul_vd_vd2_vd2_sve_sleef(t, x); + + u = vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(0))), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(u))); + + return u; + +} + +SLEEF_INLINE vdouble2_sve_sleef Sleef_sincosdx_u35sve(vdouble_sve_sleef d) { + + vopmask_sve_sleef o; + vdouble_sve_sleef u, t, rx, ry, s; + vdouble2_sve_sleef r; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + s = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), d); + s = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), s); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_sve_sleef(dql); + + s = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + s = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), s); + s = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), s); + s = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), s); + s = vmla_vd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24 * 0.5), s); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef); + s = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vd2gety_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + s = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)), vreinterpret_vm_vd_sve_sleef(s))); + } + + t = s; + + s = vmul_vd_vd_vd_sve_sleef(s, s); + + u = vcast_vd_d_sve_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.166666666666666130709393)); + + rx = vmla_vd_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(u, s), t, t); + rx = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(-0.0), rx); + + u = vcast_vd_d_sve_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.5)); + + ry = vmla_vd_vd_vd_vd_sve_sleef(s, u, vcast_vd_d_sve_sleef(1)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(0))); + r = vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(o, rx, ry), vsel_vd_vo_vd_vd_sve_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_sve_sleef Sleef_sincosdx_u10sve(vdouble_sve_sleef d) { + + vopmask_sve_sleef o; + vdouble_sve_sleef u, rx, ry; + vdouble2_sve_sleef r, s, t, x; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + const vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + u = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_sve_sleef (u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + const vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_sve_sleef(dql); + + u = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef); + s = ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef); + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)); + s = vd2setxy_vd2_vd_vd_sve_sleef(vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s)))), + vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(s))))); + } + + t = s; + + s = vd2setx_vd2_vd2_vd_sve_sleef(s, ddsqu_vd_vd2_sve_sleef(s)); + + u = vcast_vd_d_sve_sleef(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-0.166666666666666130709393)); + + u = vmul_vd_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2getx_vd_vd2_sve_sleef(t))); + + x = ddadd_vd2_vd2_vd_sve_sleef(t, u); + rx = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + rx = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(-0.0), rx); + + u = vcast_vd_d_sve_sleef(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(-0.5)); + + x = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), ddmul_vd2_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), u)); + ry = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(0))); + r = vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(o, rx, ry), vsel_vd_vo_vd_vd_sve_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + return r; + +} + +SLEEF_INLINE vdouble2_sve_sleef Sleef_sincospidx_u05sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o; + vdouble_sve_sleef u, s, t, rx, ry; + vdouble2_sve_sleef r, x, s2; + + u = vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(4.0)); + vint_sve_sleef q = vtruncate_vi_vd_sve_sleef(u); + q = vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vxor_vi_vi_vi_sve_sleef(vsrl_vi_vi_i_sve_sleef(q, 31), vcast_vi_i_sve_sleef(1))), vcast_vi_i_sve_sleef(~1)); + s = vsub_vd_vd_vd_sve_sleef(u, vcast_vd_vi_sve_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_sve_sleef(s, s); + s2 = ddmul_vd2_vd_vd_sve_sleef(t, t); + + u = vcast_vd_d_sve_sleef(-2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(6.94821830580179461327784e-12)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(3.13361688966868392878422e-07)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-3.6576204182161551920361e-05)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(0.00249039457019271850274356)); + x = ddadd2_vd2_vd_vd2_sve_sleef(vmul_vd_vd_vd_sve_sleef(u, s), vcast_vd2_d_d_sve_sleef(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s2, x), vcast_vd2_d_d_sve_sleef(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd_sve_sleef(x, t); + rx = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + rx = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(-0.0), rx); + + u = vcast_vd_d_sve_sleef(9.94480387626843774090208e-16); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-3.89796226062932799164047e-13)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1.15011582539996035266901e-10)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-2.4611369501044697495359e-08)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(3.59086044859052754005062e-06)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.000325991886927389905997954)); + x = ddadd2_vd2_vd_vd2_sve_sleef(vmul_vd_vd_vd_sve_sleef(u, s), vcast_vd2_d_d_sve_sleef(0.0158543442438155018914259, -1.04693272280631521908845e-18)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s2, x), vcast_vd2_d_d_sve_sleef(-0.308425137534042437259529, -1.95698492133633550338345e-17)); + + x = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(x, s2), vcast_vd_d_sve_sleef(1)); + ry = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(0))); + r = vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(o, rx, ry), vsel_vd_vo_vd_vd_sve_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + o = vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vsel_vd_vo_vd_vd_sve_sleef(o, vcast_vd_d_sve_sleef(1), vd2gety_vd_vd2_sve_sleef(r))); + + o = visinf_vo_vd_sve_sleef(d); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + return r; +} + +SLEEF_INLINE vdouble2_sve_sleef Sleef_sincospidx_u35sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o; + vdouble_sve_sleef u, s, t, rx, ry; + vdouble2_sve_sleef r; + + u = vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(4.0)); + vint_sve_sleef q = vtruncate_vi_vd_sve_sleef(u); + q = vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vxor_vi_vi_vi_sve_sleef(vsrl_vi_vi_i_sve_sleef(q, 31), vcast_vi_i_sve_sleef(1))), vcast_vi_i_sve_sleef(~1)); + s = vsub_vd_vd_vd_sve_sleef(u, vcast_vd_vi_sve_sleef(q)); + + t = s; + s = vmul_vd_vd_vd_sve_sleef(s, s); + + u = vcast_vd_d_sve_sleef(+0.6880638894766060136e-11); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.1757159564542310199e-8)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.3133616327257867311e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.3657620416388486452e-4)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.2490394570189932103e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.8074551218828056320e-1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.7853981633974482790e+0)); + + rx = vmul_vd_vd_vd_sve_sleef(u, t); + + u = vcast_vd_d_sve_sleef(-0.3860141213683794352e-12); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1150057888029681415e-9)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.2461136493006663553e-7)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.3590860446623516713e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.3259918869269435942e-3)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1585434424381541169e-1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(-0.3084251375340424373e+0)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1)); + + ry = u; + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(0))); + r = vd2setxy_vd2_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(o, rx, ry), vsel_vd_vo_vd_vd_sve_sleef(o, ry, rx)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + o = vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+9/4)); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + o = visinf_vo_vd_sve_sleef(d); + r = vd2setx_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r))))); + r = vd2sety_vd2_vd2_vd_sve_sleef(r, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble2_sve_sleef Sleef_modfdx_sve(vdouble_sve_sleef x) { + vdouble_sve_sleef fr = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(INT64_C(1) << 31), vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd_sve_sleef(fr, vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(fr))); + fr = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(INT64_C(1) << 52)), vcast_vd_d_sve_sleef(0), fr); + + vdouble2_sve_sleef ret; + + ret = vd2setxy_vd2_vd_vd_sve_sleef(vcopysign_vd_vd_vd_sve_sleef(fr, x), vcopysign_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(x, fr), x)); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef sinpik_sve_sleef(vdouble_sve_sleef d) { + vopmask_sve_sleef o; + vdouble_sve_sleef u, s, t; + vdouble2_sve_sleef x, s2; + + u = vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(4.0)); + vint_sve_sleef q = vtruncate_vi_vd_sve_sleef(u); + q = vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vxor_vi_vi_vi_sve_sleef(vsrl_vi_vi_i_sve_sleef(q, 31), vcast_vi_i_sve_sleef(1))), vcast_vi_i_sve_sleef(~1)); + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))); + + s = vsub_vd_vd_vd_sve_sleef(u, vcast_vd_vi_sve_sleef(q)); + t = s; + s = vmul_vd_vd_vd_sve_sleef(s, s); + s2 = ddmul_vd2_vd_vd_sve_sleef(t, t); + + u = vsel_vd_vo_d_d_sve_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_sve_sleef(vmul_vd_vd_vd_sve_sleef(u, s), + vsel_vd2_vo_d_d_d_d_sve_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_sve_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_sve_sleef(x, vsel_vd2_vo_vd2_vd2_sve_sleef(o, s2, vcast_vd2_vd_vd_sve_sleef(t, vcast_vd_d_sve_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1)), x); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x))))); + x = vd2sety_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sinpidx_u05sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x = sinpik_sve_sleef(d); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + r = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(-0.0), r); + r = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+9/4)), vreinterpret_vm_vd_sve_sleef(r))); + r = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visinf_vo_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef cospik_sve_sleef(vdouble_sve_sleef d) { + vopmask_sve_sleef o; + vdouble_sve_sleef u, s, t; + vdouble2_sve_sleef x, s2; + + u = vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(4.0)); + vint_sve_sleef q = vtruncate_vi_vd_sve_sleef(u); + q = vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vxor_vi_vi_vi_sve_sleef(vsrl_vi_vi_i_sve_sleef(q, 31), vcast_vi_i_sve_sleef(1))), vcast_vi_i_sve_sleef(~1)); + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(0))); + + s = vsub_vd_vd_vd_sve_sleef(u, vcast_vd_vi_sve_sleef(q)); + t = s; + s = vmul_vd_vd_vd_sve_sleef(s, s); + s2 = ddmul_vd2_vd_vd_sve_sleef(t, t); + + u = vsel_vd_vo_d_d_sve_sleef(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vsel_vd_vo_d_d_sve_sleef(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2_sve_sleef(vmul_vd_vd_vd_sve_sleef(u, s), + vsel_vd2_vo_d_d_d_d_sve_sleef(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s2, x), + vsel_vd2_vo_d_d_d_d_sve_sleef(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2_sve_sleef(x, vsel_vd2_vo_vd2_vd2_sve_sleef(o, s2, vcast_vd2_vd_vd_sve_sleef(t, vcast_vd_d_sve_sleef(0)))); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1)), x); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(4)), vcast_vi_i_sve_sleef(4))); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x))))); + x = vd2sety_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_cospidx_u05sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x = cospik_sve_sleef(d); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + r = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+9/4)), vcast_vd_d_sve_sleef(1), r); + r = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visinf_vo_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(r))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_tandx_u35sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u, s, x, y; + vopmask_sve_sleef o; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + x = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116 * 0.5), d); + x = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16 * 0.5), x); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+6)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724)), dqh)); + ql = vrint_vi_vd_sve_sleef(dql); + + x = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + x = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), x); + x = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08 * 0.5), x); + x = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16 * 0.5), x); + x = vmla_vd_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24 * 0.5), x); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef); + x = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef)), vd2gety_vd_vd2_sve_sleef(ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef))); + x = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visinf_vo_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(x))); + x = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)), vreinterpret_vm_vd_sve_sleef(x))); + } + + x = vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0.5)); + s = vmul_vd_vd_vd_sve_sleef(x, x); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_sve_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_sve_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_sve_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_sve_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.3333333333333343695e+0)); + u = vmla_vd_vd_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(u, x), x); + + y = vmla_vd_vd_vd_vd_sve_sleef(u, u, vcast_vd_d_sve_sleef(-1)); + x = vmul_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-2)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1))); + u = vdiv_vd_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(o, vneg_vd_vd_sve_sleef(y), x), + vsel_vd_vo_vd_vd_sve_sleef(o, x, y)); + u = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_tandx_u10sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef u; + vdouble2_sve_sleef s, t, x, y; + vopmask_sve_sleef o; + vint_sve_sleef ql; + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(15)))), 1)) { + vdouble_sve_sleef dql = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2 * 0.318309886183790671537767526745028724))); + ql = vrint_vi_vd_sve_sleef(dql); + u = vmla_vd_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.141592653589793116*0.5), d); + s = ddadd_vd2_vd_vd_sve_sleef (u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467991473532072e-16*0.5))); + } else if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1e+14)))), 1)) { + vdouble_sve_sleef dqh = vtruncate_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(2*0.318309886183790671537767526745028724 / (1 << 24)))); + dqh = vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(1 << 24)); + s = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.63661977236758138243, -3.9357353350364971764e-17), d), + vsub_vd_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), + vcast_vd_d_sve_sleef(-0.5), vcast_vd_d_sve_sleef(0.5)), dqh)); + const vdouble_sve_sleef dql = vtruncate_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s))); + ql = vrint_vi_vd_sve_sleef(dql); + + u = vmla_vd_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1415926218032836914 * 0.5), d); + s = ddadd_vd2_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1415926218032836914*0.5 ))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-3.1786509424591713469e-08*0.5 ))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dqh, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dql, vcast_vd_d_sve_sleef(-1.2246467864107188502e-16*0.5 ))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(dqh, dql), vcast_vd_d_sve_sleef(-1.2736634327021899816e-24*0.5))); + } else { + ddi_t_sve_sleef ddi_sve_sleef = rempi_sve_sleef(d); + ql = ddigeti_vi_ddi_sve_sleef(ddi_sve_sleef); + s = ddigetdd_vd2_ddi_sve_sleef(ddi_sve_sleef); + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(d), visnan_vo_vd_sve_sleef(d)); + s = vd2setx_vd2_vd2_vd_sve_sleef(s, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s))))); + s = vd2sety_vd2_vd2_vd_sve_sleef(s, vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(o, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(s))))); + } + + t = ddscale_vd2_vd2_vd_sve_sleef(s, vcast_vd_d_sve_sleef(0.5)); + s = ddsqu_vd2_vd2_sve_sleef(t); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2getx_vd_vd2_sve_sleef(s)), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2); + u = vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.3245098826639276316e-3)), (vcast_vd_d_sve_sleef(+0.5619219738114323735e-3)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.1460781502402784494e-2)), (vcast_vd_d_sve_sleef(+0.3591611540792499519e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.8863268409563113126e-2)), (vcast_vd_d_sve_sleef(+0.2186948728185535498e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.5396825399517272970e-1)), (vcast_vd_d_sve_sleef(+0.1333333333330500581e+0))))))) + + ; + + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(s), vcast_vd_d_sve_sleef(+0.3333333333333343695e+0)); + x = ddadd_vd2_vd2_vd2_sve_sleef(t, ddmul_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s, t), u)); + + y = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(-1), ddsqu_vd2_vd2_sve_sleef(x)); + x = ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(-2)); + + o = vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(ql, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1))); + + x = dddiv_vd2_vd2_vd2_sve_sleef(vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddneg_vd2_vd2_sve_sleef(y), x), + vsel_vd2_vo_vd2_vd2_sve_sleef(o, x, y)); + + u = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)); + + u = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), d, u); + + return u; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef atan2k_sve_sleef(vdouble_sve_sleef y, vdouble_sve_sleef x) { + vdouble_sve_sleef s, t, u; + vint_sve_sleef q; + vopmask_sve_sleef p; + + q = vsel_vi_vd_vi_sve_sleef(x, vcast_vi_i_sve_sleef(-2)); + x = vabs_vd_vd_sve_sleef(x); + + q = vsel_vi_vd_vd_vi_vi_sve_sleef(x, y, vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(1)), q); + p = vlt_vo_vd_vd_sve_sleef(x, y); + s = vsel_vd_vo_vd_vd_sve_sleef(p, vneg_vd_vd_sve_sleef(x), y); + t = vmax_vd_vd_vd_sve_sleef(x, y); + + s = vdiv_vd_vd_vd_sve_sleef(s, t); + t = vmul_vd_vd_vd_sve_sleef(s, s); + + vdouble_sve_sleef t2 = vmul_vd_vd_vd_sve_sleef(t, t), t4 = vmul_vd_vd_vd_sve_sleef(t2, t2), t8 = vmul_vd_vd_vd_sve_sleef(t4, t4), t16 = vmul_vd_vd_vd_sve_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_sve_sleef((t16), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vcast_vd_d_sve_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.000209850076645816976906797)), (vcast_vd_d_sve_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_sve_sleef((t8), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.00370026744188713119232403)), (vcast_vd_d_sve_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.016599329773529201970117)), (vcast_vd_d_sve_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0337852580001353069993897)), (vcast_vd_d_sve_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0466667150077840625632675)), (vcast_vd_d_sve_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0587666392926673580854313)), (vcast_vd_d_sve_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0769219538311769618355029)), (vcast_vd_d_sve_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.111111105648261418443745)), (vcast_vd_d_sve_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.199999999996591265594148)), (vcast_vd_d_sve_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(t, u), s); + t = vmla_vd_vd_vd_vd_sve_sleef(vcast_vd_vi_sve_sleef(q), vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef atan2k_u1_sve_sleef(vdouble2_sve_sleef y, vdouble2_sve_sleef x) { + vdouble_sve_sleef u; + vdouble2_sve_sleef s, t; + vint_sve_sleef q; + vopmask_sve_sleef p; + + q = vsel_vi_vd_vi_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vcast_vi_i_sve_sleef(-2)); + p = vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vcast_vd_d_sve_sleef(0)); + vmask_sve_sleef b = vand_vm_vo64_vm_sve_sleef(p, vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))); + x = vd2setx_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(b, vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x))))); + x = vd2sety_vd2_vd2_vd_sve_sleef(x, vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(b, vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(x))))); + + q = vsel_vi_vd_vd_vi_vi_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y), vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(1)), q); + p = vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(y)); + s = vsel_vd2_vo_vd2_vd2_sve_sleef(p, ddneg_vd2_vd2_sve_sleef(x), y); + t = vsel_vd2_vo_vd2_vd2_sve_sleef(p, y, x); + + s = dddiv_vd2_vd2_vd2_sve_sleef(s, t); + t = ddsqu_vd2_vd2_sve_sleef(s); + t = ddnormalize_vd2_vd2_sve_sleef(t); + + vdouble_sve_sleef t2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), vd2getx_vd_vd2_sve_sleef(t)), t4 = vmul_vd_vd_vd_sve_sleef(t2, t2), t8 = vmul_vd_vd_vd_sve_sleef(t4, t4); + u = vmla_vd_vd_vd_vd_sve_sleef((t8), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(1.06298484191448746607415e-05)), (vcast_vd_d_sve_sleef(-0.000125620649967286867384336)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.00070557664296393412389774)), (vcast_vd_d_sve_sleef(-0.00251865614498713360352999)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.00646262899036991172313504)), (vcast_vd_d_sve_sleef(-0.0128281333663399031014274)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.0208024799924145797902497)), (vcast_vd_d_sve_sleef(-0.0289002344784740315686289)))))))), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.0359785005035104590853656)), (vcast_vd_d_sve_sleef(-0.041848579703592507506027)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.0470843011653283988193763)), (vcast_vd_d_sve_sleef(-0.0524914210588448421068719)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.0587946590969581003860434)), (vcast_vd_d_sve_sleef(-0.0666620884778795497194182)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(t)), (vcast_vd_d_sve_sleef(0.0769225330296203768654095)), (vcast_vd_d_sve_sleef(-0.0909090442773387574781907))))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(t), vcast_vd_d_sve_sleef(0.111111108376896236538123)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(t), vcast_vd_d_sve_sleef(-0.142857142756268568062339)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(t), vcast_vd_d_sve_sleef(0.199999999997977351284817)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(t), vcast_vd_d_sve_sleef(-0.333333333333317605173818)); + + t = ddadd_vd2_vd2_vd2_sve_sleef(s, ddmul_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(s, t), u)); + + t = ddadd_vd2_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(1.570796326794896557998982, 6.12323399573676603586882e-17), vcast_vd_vi_sve_sleef(q)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef visinf2_vd_vd_vd_sve_sleef(vdouble_sve_sleef d, vdouble_sve_sleef m) { + return vreinterpret_vd_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(visinf_vo_vd_sve_sleef(d), vor_vm_vm_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(d), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_atan2dx_u35sve(vdouble_sve_sleef y, vdouble_sve_sleef x) { + vdouble_sve_sleef r = atan2k_sve_sleef(vabs_vd_vd_sve_sleef(y), x); + + r = vmulsign_vd_vd_vd_sve_sleef(r, x); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0))), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_sve_sleef(x, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(y), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_sve_sleef(x, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0.0)), vreinterpret_vd_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vsignbit_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vreinterpret_vm_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_atan2dx_u10sve(vdouble_sve_sleef y, vdouble_sve_sleef x) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(5.5626846462680083984e-309)); + x = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(UINT64_C(1) << 53)), x); + y = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(UINT64_C(1) << 53)), y); + + vdouble2_sve_sleef d = atan2k_u1_sve_sleef(vcast_vd2_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(y), vcast_vd_d_sve_sleef(0)), vcast_vd2_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0))); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)); + + r = vmulsign_vd_vd_vd_sve_sleef(r, x); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0))), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_sve_sleef(x, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(y), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vd_vd_vd_sve_sleef(x, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0.0)), vreinterpret_vd_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vsignbit_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vreinterpret_vm_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_asindx_u35sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0.5)); + vdouble_sve_sleef x2 = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, d), vmul_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vabs_vd_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5))); + vdouble_sve_sleef x = vsel_vd_vo_vd_vd_sve_sleef(o, vabs_vd_vd_sve_sleef(d), vsqrt_vd_vd_sve_sleef(x2)), u; + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_sve_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_sve_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_sve_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_sve_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_sve_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_sve_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmla_vd_vd_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(x, x2), x); + + vdouble_sve_sleef r = vsel_vd_vo_vd_vd_sve_sleef(o, u, vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-2), vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2))); + return vmulsign_vd_vd_vd_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_asindx_u10sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0.5)); + vdouble_sve_sleef x2 = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, d), vmul_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vabs_vd_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5))), u; + vdouble2_sve_sleef x = vsel_vd2_vo_vd2_vd2_sve_sleef(o, vcast_vd2_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0)), ddsqrt_vd2_vd_sve_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(veq_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1.0)), vcast_vd2_d_d_sve_sleef(0, 0), x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_sve_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_sve_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_sve_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_sve_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_sve_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_sve_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x))); + + vdouble2_sve_sleef y = ddsub_vd2_vd2_vd_sve_sleef(ddsub_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(3.141592653589793116/4, 1.2246467991473532072e-16/4), x), u); + + vdouble_sve_sleef r = vsel_vd_vo_vd_vd_sve_sleef(o, vadd_vd_vd_vd_sve_sleef(u, vd2getx_vd_vd2_sve_sleef(x)), + vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(y)), vcast_vd_d_sve_sleef(2))); + return vmulsign_vd_vd_vd_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_acosdx_u35sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0.5)); + vdouble_sve_sleef x2 = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, d), + vmul_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vabs_vd_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5))), u; + vdouble_sve_sleef x = vsel_vd_vo_vd_vd_sve_sleef(o, vabs_vd_vd_sve_sleef(d), vsqrt_vd_vd_sve_sleef(x2)); + x = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1.0)), vcast_vd_d_sve_sleef(0), x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_sve_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_sve_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_sve_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_sve_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_sve_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_sve_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(x2, x)); + + vdouble_sve_sleef y = vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), vadd_vd_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(x, d), vmulsign_vd_vd_vd_sve_sleef(u, d))); + x = vadd_vd_vd_vd_sve_sleef(x, u); + vdouble_sve_sleef r = vsel_vd_vo_vd_vd_sve_sleef(o, y, vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + return vsel_vd_vo_vd_vd_sve_sleef(vandnot_vo_vo_vo_sve_sleef(o, vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0))), + vd2getx_vd_vd2_sve_sleef(ddadd_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(3.141592653589793116, 1.2246467991473532072e-16), + vneg_vd_vd_sve_sleef(r))), r); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_acosdx_u10sve(vdouble_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0.5)); + vdouble_sve_sleef x2 = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, d), vmul_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vabs_vd_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5))), u; + vdouble2_sve_sleef x = vsel_vd2_vo_vd2_vd2_sve_sleef(o, vcast_vd2_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0)), ddsqrt_vd2_vd_sve_sleef(x2)); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(veq_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1.0)), vcast_vd2_d_d_sve_sleef(0, 0), x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + u = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3161587650653934628e-1)), (vcast_vd_d_sve_sleef(-0.1581918243329996643e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1929045477267910674e-1)), (vcast_vd_d_sve_sleef(+0.6606077476277170610e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1215360525577377331e-1)), (vcast_vd_d_sve_sleef(+0.1388715184501609218e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1735956991223614604e-1)), (vcast_vd_d_sve_sleef(+0.2237176181932048341e-1)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3038195928038132237e-1)), (vcast_vd_d_sve_sleef(+0.4464285681377102438e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.7500000000378581611e-1)), (vcast_vd_d_sve_sleef(+0.1666666666666497543e+0))))))))) + + ; + + u = vmul_vd_vd_vd_sve_sleef(u, vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x))); + + vdouble2_sve_sleef y = ddsub_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(3.141592653589793116/2, 1.2246467991473532072e-16/2), + ddadd_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), d), vmulsign_vd_vd_vd_sve_sleef(u, d))); + x = ddadd_vd2_vd2_vd_sve_sleef(x, u); + + y = vsel_vd2_vo_vd2_vd2_sve_sleef(o, y, ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + + y = vsel_vd2_vo_vd2_vd2_sve_sleef(vandnot_vo_vo_vo_sve_sleef(o, vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0))), + ddsub_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(3.141592653589793116, 1.2246467991473532072e-16), y), y); + + return vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_atandx_u10sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef d2 = atan2k_u1_sve_sleef(vcast_vd2_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(d), vcast_vd_d_sve_sleef(0)), vcast_vd2_d_d_sve_sleef(1, 0)); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d2), vd2gety_vd_vd2_sve_sleef(d2)); + r = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(1.570796326794896557998982), r); + return vmulsign_vd_vd_vd_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_atandx_u35sve(vdouble_sve_sleef s) { + vdouble_sve_sleef t, u; + vint_sve_sleef q; + + q = vsel_vi_vd_vi_sve_sleef(s, vcast_vi_i_sve_sleef(2)); + s = vabs_vd_vd_sve_sleef(s); + + q = vsel_vi_vd_vd_vi_vi_sve_sleef(vcast_vd_d_sve_sleef(1), s, vadd_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(1)), q); + s = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), s), vrec_vd_vd_sve_sleef(s), s); + + t = vmul_vd_vd_vd_sve_sleef(s, s); + + vdouble_sve_sleef t2 = vmul_vd_vd_vd_sve_sleef(t, t), t4 = vmul_vd_vd_vd_sve_sleef(t2, t2), t8 = vmul_vd_vd_vd_sve_sleef(t4, t4), t16 = vmul_vd_vd_vd_sve_sleef(t8, t8); + u = vmla_vd_vd_vd_vd_sve_sleef((t16), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vcast_vd_d_sve_sleef(-1.88796008463073496563746e-05)), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.000209850076645816976906797)), (vcast_vd_d_sve_sleef(-0.00110611831486672482563471)))))), (vmla_vd_vd_vd_vd_sve_sleef((t8), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.00370026744188713119232403)), (vcast_vd_d_sve_sleef(-0.00889896195887655491740809)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.016599329773529201970117)), (vcast_vd_d_sve_sleef(-0.0254517624932312641616861)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0337852580001353069993897)), (vcast_vd_d_sve_sleef(-0.0407629191276836500001934)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0466667150077840625632675)), (vcast_vd_d_sve_sleef(-0.0523674852303482457616113)))))))), (vmla_vd_vd_vd_vd_sve_sleef((t4), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0587666392926673580854313)), (vcast_vd_d_sve_sleef(-0.0666573579361080525984562)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.0769219538311769618355029)), (vcast_vd_d_sve_sleef(-0.090908995008245008229153)))))), (vmla_vd_vd_vd_vd_sve_sleef((t2), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.111111105648261418443745)), (vcast_vd_d_sve_sleef(-0.14285714266771329383765)))), (vmla_vd_vd_vd_vd_sve_sleef((t), (vcast_vd_d_sve_sleef(0.199999999996591265594148)), (vcast_vd_d_sve_sleef(-0.333333333333311110369124))))))))))) + + ; + + t = vmla_vd_vd_vd_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(t, u), s); + + t = vsel_vd_vo_vd_vd_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(1)), vcast_vi_i_sve_sleef(1))), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3.141592653589793238462643383279502884/2), t), t); + t = vreinterpret_vd_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo64_vm_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(2)), vcast_vi_i_sve_sleef(2))), vreinterpret_vm_vd_sve_sleef(vcast_vd_d_sve_sleef(-0.0))), vreinterpret_vm_vd_sve_sleef(t))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_logdx_u35sve(vdouble_sve_sleef d) { + vdouble_sve_sleef x, x2; + vdouble_sve_sleef t, m; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = vdiv_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(m, vcast_vd_d_sve_sleef(1)), vadd_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), m)); + x2 = vmul_vd_vd_vd_sve_sleef(x, x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x3 = vmul_vd_vd_vd_sve_sleef(x, x2); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(0.153487338491425068243146)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.152519917006351951593857)), (vcast_vd_d_sve_sleef(0.181863266251982985677316)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.222221366518767365905163)), (vcast_vd_d_sve_sleef(0.285714294746548025383248)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.399999999950799600689777)), (vcast_vd_d_sve_sleef(0.6666666666667778740063))))))) + + ; + + x = vmla_vd_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2), vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.693147180559945286226764), vcast_vd_vi_sve_sleef(e))); + x = vmla_vd_vd_vd_vd_sve_sleef(x3, t, x); + + x = vsel_vd_vo_vd_vd_sve_sleef(vispinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), x); + x = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(-__builtin_inf()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_expdx_u10sve(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.2081276378237164457e-8)), (vcast_vd_d_sve_sleef(+0.2511210703042288022e-7)))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.2755762628169491192e-6)), (vcast_vd_d_sve_sleef(+0.2755723402025388239e-5)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.2480158687479686264e-4)), (vcast_vd_d_sve_sleef(+0.1984126989855865850e-3)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1388888888914497797e-2)), (vcast_vd_d_sve_sleef(+0.8333333333314938210e-2)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.4166666666666602598e-1)), (vcast_vd_d_sve_sleef(+0.1666666666666669072e+0))))))))) + + ; + u = vfma_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.5000000000000000000e+0)); + u = vfma_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1000000000000000000e+1)); + u = vfma_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1000000000000000000e+1)); + + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(709.78271114955742909217217426)), vcast_vd_d_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-1000)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef expm1k_sve_sleef(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931))), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-.69314718055966295651160180568695068359375), d); + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-.28235290563031577122588448175013436025525412068e-12), s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(2.08860621107283687536341e-09)), (vcast_vd_d_sve_sleef(2.51112930892876518610661e-08)))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(2.75573911234900471893338e-07)), (vcast_vd_d_sve_sleef(2.75572362911928827629423e-06)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(2.4801587159235472998791e-05)), (vcast_vd_d_sve_sleef(0.000198412698960509205564975)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(0.00138888888889774492207962)), (vcast_vd_d_sve_sleef(0.00833333333331652721664984)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(0.0416666666666665047591422)), (vcast_vd_d_sve_sleef(0.166666666666666851703837))))))))) + + ; + + u = vadd_vd_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(s2, vcast_vd_d_sve_sleef(0.5), vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(s2, s), u)), s); + + u = vsel_vd_vo_vd_vd_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(q, vcast_vi_i_sve_sleef(0))), u, + vsub_vd_vd_vd_sve_sleef(vldexp2_vd_vd_vi_sve_sleef(vadd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(1)), q), vcast_vd_d_sve_sleef(1))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef logk_sve_sleef(vdouble_sve_sleef d) { + vdouble2_sve_sleef x, x2, s; + vdouble_sve_sleef t, m; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1), m), ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), m)); + x2 = ddsqu_vd2_vd2_sve_sleef(x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x2), vd2getx_vd_vd2_sve_sleef(x2)), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + t = vmla_vd_vd_vd_vd_sve_sleef((x16), (vcast_vd_d_sve_sleef(0.116255524079935043668677)), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.103239680901072952701192)), (vcast_vd_d_sve_sleef(0.117754809412463995466069)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.13332981086846273921509)), (vcast_vd_d_sve_sleef(0.153846227114512262845736)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.181818180850050775676507)), (vcast_vd_d_sve_sleef(0.222222222230083560345903)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.285714285714249172087875)), (vcast_vd_d_sve_sleef(0.400000000000000077715612))))))))) + + ; + + vdouble2_sve_sleef c = vcast_vd2_d_d_sve_sleef(0.666666666666666629659233, 3.80554962542412056336616e-17); + + s = ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_sve_sleef(e)); + + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + x = ddmul_vd2_vd2_vd2_sve_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddmul_vd2_vd2_vd2_sve_sleef(x, c)); + x = ddmul_vd2_vd2_vd2_sve_sleef(x2, x); + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddmul_vd2_vd2_vd_sve_sleef(x, t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_logdx_u10sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x; + vdouble_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1), m), ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), m)); + x2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.1525629051003428716e+0)), (vcast_vd_d_sve_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.2222214519839380009e+0)), (vcast_vd_d_sve_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.3999999999635251990e+0)), (vcast_vd_d_sve_sleef(0.6666666666667333541e+0))))))) + + ; + + vdouble2_sve_sleef s = ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_sve_sleef(e)); + + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x)), t)); + + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s)); + + r = vsel_vd_vo_vd_vd_sve_sleef(vispinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(-__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef expk_sve_sleef(vdouble2_sve_sleef d) { + vdouble_sve_sleef u = vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)), vcast_vd_d_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_sve_sleef dq = vrint_vd_vd_sve_sleef(u); + vint_sve_sleef q = vrint_vi_vd_sve_sleef(dq); + vdouble2_sve_sleef s, t; + + s = ddadd2_vd2_vd2_vd_sve_sleef(d, vmul_vd_vd_vd_sve_sleef(dq, vcast_vd_d_sve_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dq, vcast_vd_d_sve_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + s = ddnormalize_vd2_vd2_sve_sleef(s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2getx_vd_vd2_sve_sleef(s)), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.51069683420950419527139e-08)), (vcast_vd_d_sve_sleef(2.76286166770270649116855e-07)))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(2.75572496725023574143864e-06)), (vcast_vd_d_sve_sleef(2.48014973989819794114153e-05)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(0.000198412698809069797676111)), (vcast_vd_d_sve_sleef(0.0013888888939977128960529)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(0.00833333333332371417601081)), (vcast_vd_d_sve_sleef(0.0416666666665409524128449)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(0.166666666666666740681535)), (vcast_vd_d_sve_sleef(0.500000000000000999200722))))))))) + + ; + + t = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), s); + t = ddadd_vd2_vd2_vd2_sve_sleef(t, ddmul_vd2_vd2_vd_sve_sleef(ddsqu_vd2_vd2_sve_sleef(s), u)); + + u = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), vd2gety_vd_vd2_sve_sleef(t)); + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(-1000)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_powdx_u10sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + + vopmask_sve_sleef yisint = visint_vo_vd_sve_sleef(y); + vopmask_sve_sleef yisodd = vand_vo_vo_vo_sve_sleef(visodd_vo_vd_sve_sleef(y), yisint); + + vdouble2_sve_sleef d = ddmul_vd2_vd2_vd_sve_sleef(logk_sve_sleef(vabs_vd_vd_sve_sleef(x)), y); + vdouble_sve_sleef result = expk_sve_sleef(d); + result = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(709.78271114955742909217217426)), vcast_vd_d_sve_sleef(__builtin_inf()), result); + + result = vmul_vd_vd_vd_sve_sleef(result, + vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), + vcast_vd_d_sve_sleef(1), + vsel_vd_vo_vd_vd_sve_sleef(yisint, vsel_vd_vo_vd_vd_sve_sleef(yisodd, vcast_vd_d_sve_sleef(-1.0), vcast_vd_d_sve_sleef(1)), vcast_vd_d_sve_sleef(__builtin_nan(""))))); + + vdouble_sve_sleef efx = vmulsign_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(1)), y); + + result = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(y), + vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(efx, vcast_vd_d_sve_sleef(0.0)), + vreinterpret_vm_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(efx, vcast_vd_d_sve_sleef(0.0)), + vcast_vd_d_sve_sleef(1.0), + vcast_vd_d_sve_sleef(__builtin_inf()))))), + result); + + result = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0.0))), + vmulsign_vd_vd_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(vxor_vo_vo_vo_sve_sleef(vsignbit_vo_vd_sve_sleef(y), veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0.0))), + vcast_vd_d_sve_sleef(0), vcast_vd_d_sve_sleef(__builtin_inf())), + vsel_vd_vo_vd_vd_sve_sleef(yisodd, x, vcast_vd_d_sve_sleef(1))), result); + + result = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vreinterpret_vm_vd_sve_sleef(result))); + + result = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0)), veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1))), vcast_vd_d_sve_sleef(1), result); + + return result; + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef expk2_sve_sleef(vdouble2_sve_sleef d) { + vdouble_sve_sleef u = vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)), vcast_vd_d_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931)); + vdouble_sve_sleef dq = vrint_vd_vd_sve_sleef(u); + vint_sve_sleef q = vrint_vi_vd_sve_sleef(dq); + vdouble2_sve_sleef s, t; + + s = ddadd2_vd2_vd2_vd_sve_sleef(d, vmul_vd_vd_vd_sve_sleef(dq, vcast_vd_d_sve_sleef(-.69314718055966295651160180568695068359375))); + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(dq, vcast_vd_d_sve_sleef(-.28235290563031577122588448175013436025525412068e-12))); + + vdouble2_sve_sleef s2 = ddsqu_vd2_vd2_sve_sleef(s), s4 = ddsqu_vd2_vd2_sve_sleef(s2); + vdouble_sve_sleef s8 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s4), vd2getx_vd_vd2_sve_sleef(s4)); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.1602472219709932072e-9)), (vcast_vd_d_sve_sleef(+0.2092255183563157007e-8)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s4)), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s2)), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.2505230023782644465e-7)), (vcast_vd_d_sve_sleef(+0.2755724800902135303e-6)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.2755731892386044373e-5)), (vcast_vd_d_sve_sleef(+0.2480158735605815065e-4)))))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s2)), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.1984126984148071858e-3)), (vcast_vd_d_sve_sleef(+0.1388888888886763255e-2)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(s)), (vcast_vd_d_sve_sleef(+0.8333333333333347095e-2)), (vcast_vd_d_sve_sleef(+0.4166666666666669905e-1))))))))) + + ; + + t = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(0.5), ddmul_vd2_vd2_vd_sve_sleef(s, vcast_vd_d_sve_sleef(+0.1666666666666666574e+0))); + t = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1.0), ddmul_vd2_vd2_vd2_sve_sleef(t, s)); + t = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1.0), ddmul_vd2_vd2_vd2_sve_sleef(t, s)); + t = ddadd_vd2_vd2_vd2_sve_sleef(t, ddmul_vd2_vd2_vd_sve_sleef(s4, u)); + + t = vd2setx_vd2_vd2_vd_sve_sleef(t, vldexp2_vd_vd_vi_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), q)); + t = vd2sety_vd2_vd2_vd_sve_sleef(t, vldexp2_vd_vd_vi_sve_sleef(vd2gety_vd_vd2_sve_sleef(t), q)); + + t = vd2setx_vd2_vd2_vd_sve_sleef(t, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(-1000)), vreinterpret_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t))))); + t = vd2sety_vd2_vd2_vd_sve_sleef(t, vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(-1000)), vreinterpret_vm_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sinhdx_u10sve(vdouble_sve_sleef x) { + vdouble_sve_sleef y = vabs_vd_vd_sve_sleef(x); + vdouble2_sve_sleef d = expk2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0))); + d = ddsub_vd2_vd2_vd2_sve_sleef(d, ddrec_vd2_vd2_sve_sleef(d)); + y = vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(710)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_sve_sleef(y, x); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_coshdx_u10sve(vdouble_sve_sleef x) { + vdouble_sve_sleef y = vabs_vd_vd_sve_sleef(x); + vdouble2_sve_sleef d = expk2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0))); + d = ddadd_vd2_vd2_vd2_sve_sleef(d, ddrec_vd2_vd2_sve_sleef(d)); + y = vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(710)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_tanhdx_u10sve(vdouble_sve_sleef x) { + vdouble_sve_sleef y = vabs_vd_vd_sve_sleef(x); + vdouble2_sve_sleef d = expk2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0))); + vdouble2_sve_sleef e = ddrec_vd2_vd2_sve_sleef(d); + d = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd2_sve_sleef(d, ddneg_vd2_vd2_sve_sleef(e)), ddadd2_vd2_vd2_vd2_sve_sleef(d, e)); + y = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(18.714973875)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(1.0), y); + y = vmulsign_vd_vd_vd_sve_sleef(y, x); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sinhdx_u35sve(vdouble_sve_sleef x) { + vdouble_sve_sleef e = expm1k_sve_sleef(vabs_vd_vd_sve_sleef(x)); + + vdouble_sve_sleef y = vdiv_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(e, vcast_vd_d_sve_sleef(2)), vadd_vd_vd_vd_sve_sleef(e, vcast_vd_d_sve_sleef(1))); + y = vmul_vd_vd_vd_sve_sleef(y, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(709)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_inf()), y); + y = vmulsign_vd_vd_vd_sve_sleef(y, x); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_coshdx_u35sve(vdouble_sve_sleef x) { + vdouble_sve_sleef e = Sleef_expdx_u10sve(vabs_vd_vd_sve_sleef(x)); + vdouble_sve_sleef y = vmla_vd_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), e, vdiv_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), e)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(709)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_tanhdx_u35sve(vdouble_sve_sleef x) { + vdouble_sve_sleef d = expm1k_sve_sleef(vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), vabs_vd_vd_sve_sleef(x))); + vdouble_sve_sleef y = vdiv_vd_vd_vd_sve_sleef(d, vadd_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), d)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(18.714973875)), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(1.0), y); + y = vmulsign_vd_vd_vd_sve_sleef(y, x); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef logk2_sve_sleef(vdouble2_sve_sleef d) { + vdouble2_sve_sleef x, x2, m, s; + vdouble_sve_sleef t; + vint_sve_sleef e; + + e = vilogbk_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(1.0/0.75))); + + m = vd2setxy_vd2_vd_vd_sve_sleef(vldexp2_vd_vd_vi_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vneg_vi_vi_sve_sleef(e)), + vldexp2_vd_vd_vi_sve_sleef(vd2gety_vd_vd2_sve_sleef(d), vneg_vi_vi_sve_sleef(e))); + + x = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(m, vcast_vd_d_sve_sleef(-1)), ddadd2_vd2_vd2_vd_sve_sleef(m, vcast_vd_d_sve_sleef(1))); + x2 = ddsqu_vd2_vd2_sve_sleef(x); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x2), vd2getx_vd_vd2_sve_sleef(x2)), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(0.13860436390467167910856)), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.131699838841615374240845)), (vcast_vd_d_sve_sleef(0.153914168346271945653214)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.181816523941564611721589)), (vcast_vd_d_sve_sleef(0.22222224632662035403996)))), (vmla_vd_vd_vd_vd_sve_sleef((vd2getx_vd_vd2_sve_sleef(x2)), (vcast_vd_d_sve_sleef(0.285714285511134091777308)), (vcast_vd_d_sve_sleef(0.400000000000914013309483))))))) + + ; + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(x2), vcast_vd_d_sve_sleef(0.666666666666664853302393)); + + s = ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_sve_sleef(e)); + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddmul_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_asinhdx_u10sve(vdouble_sve_sleef x) { + vdouble_sve_sleef y = vabs_vd_vd_sve_sleef(x); + vopmask_sve_sleef o = vgt_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(1)); + vdouble2_sve_sleef d; + + d = vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddrec_vd2_vd_sve_sleef(x), vcast_vd2_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0))); + d = ddsqrt_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(ddsqu_vd2_vd2_sve_sleef(d), vcast_vd_d_sve_sleef(1))); + d = vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddmul_vd2_vd2_vd_sve_sleef(d, y), d); + + d = logk2_sve_sleef(ddnormalize_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(d, x))); + y = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_sve_sleef(y)), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(__builtin_inf()), x), y); + + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + y = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(x), vcast_vd_d_sve_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_acoshdx_u10sve(vdouble_sve_sleef x) { + vdouble2_sve_sleef d = logk2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddsqrt_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1))), ddsqrt_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(-1)))), x)); + vdouble_sve_sleef y = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)); + + y = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(1.3407807929942596355e+154)), + visnan_vo_vd_sve_sleef(y)), + vcast_vd_d_sve_sleef(__builtin_inf()), y); + y = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0)), vreinterpret_vm_vd_sve_sleef(y))); + + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.0)), vreinterpret_vm_vd_sve_sleef(y))); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_atanhdx_u10sve(vdouble_sve_sleef x) { + vdouble_sve_sleef y = vabs_vd_vd_sve_sleef(x); + vdouble2_sve_sleef d = logk2_sve_sleef(dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), y), ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vneg_vd_vd_sve_sleef(y)))); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vgt_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(1.0)), vreinterpret_vm_vd_sve_sleef(vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(1.0)), vcast_vd_d_sve_sleef(__builtin_inf()), vmul_vd_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)), vcast_vd_d_sve_sleef(0.5)))))); + + y = vmulsign_vd_vd_vd_sve_sleef(y, x); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vreinterpret_vm_vd_sve_sleef(y))); + y = vreinterpret_vd_vm_sve_sleef(vor_vm_vo64_vm_sve_sleef(visnan_vo_vd_sve_sleef(x), vreinterpret_vm_vd_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_cbrtdx_u35sve(vdouble_sve_sleef d) { + vdouble_sve_sleef x, y, q = vcast_vd_d_sve_sleef(1.0); + vint_sve_sleef e, qu, re; + vdouble_sve_sleef t; + + e = vadd_vi_vi_vi_sve_sleef(vilogbk_vi_vd_sve_sleef(vabs_vd_vd_sve_sleef(d)), vcast_vi_i_sve_sleef(1)); + d = vldexp2_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + + t = vadd_vd_vd_vd_sve_sleef(vcast_vd_vi_sve_sleef(e), vcast_vd_d_sve_sleef(6144)); + qu = vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(t, vcast_vd_d_sve_sleef(1.0/3.0))); + re = vtruncate_vi_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(t, vmul_vd_vd_vd_sve_sleef(vcast_vd_vi_sve_sleef(qu), vcast_vd_d_sve_sleef(3)))); + + q = vsel_vd_vo_vd_vd_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(re, vcast_vi_i_sve_sleef(1))), vcast_vd_d_sve_sleef(1.2599210498948731647672106), q); + q = vsel_vd_vo_vd_vd_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(re, vcast_vi_i_sve_sleef(2))), vcast_vd_d_sve_sleef(1.5874010519681994747517056), q); + q = vldexp2_vd_vd_vi_sve_sleef(q, vsub_vi_vi_vi_sve_sleef(qu, vcast_vi_i_sve_sleef(2048))); + + q = vmulsign_vd_vd_vd_sve_sleef(q, d); + + d = vabs_vd_vd_sve_sleef(d); + + x = vcast_vd_d_sve_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_sve_sleef(x, x); y = vmul_vd_vd_vd_sve_sleef(y, y); x = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vmlapn_vd_vd_vd_vd_sve_sleef(d, y, x), vcast_vd_d_sve_sleef(1.0 / 3.0))); + y = vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, x), x); + y = vmul_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(y, vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2.0 / 3.0), y), vmla_vd_vd_vd_vd_sve_sleef(y, x, vcast_vd_d_sve_sleef(-1.0)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_cbrtdx_u10sve(vdouble_sve_sleef d) { + vdouble_sve_sleef x, y, z, t; + vdouble2_sve_sleef q2 = vcast_vd2_d_d_sve_sleef(1, 0), u, v; + vint_sve_sleef e, qu, re; + + e = vadd_vi_vi_vi_sve_sleef(vilogbk_vi_vd_sve_sleef(vabs_vd_vd_sve_sleef(d)), vcast_vi_i_sve_sleef(1)); + d = vldexp2_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + + t = vadd_vd_vd_vd_sve_sleef(vcast_vd_vi_sve_sleef(e), vcast_vd_d_sve_sleef(6144)); + qu = vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(t, vcast_vd_d_sve_sleef(1.0/3.0))); + re = vtruncate_vi_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(t, vmul_vd_vd_vd_sve_sleef(vcast_vd_vi_sve_sleef(qu), vcast_vd_d_sve_sleef(3)))); + + q2 = vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(re, vcast_vi_i_sve_sleef(1))), vcast_vd2_d_d_sve_sleef(1.2599210498948731907, -2.5899333753005069177e-17), q2); + q2 = vsel_vd2_vo_vd2_vd2_sve_sleef(vcast_vo64_vo32_sve_sleef(veq_vo_vi_vi_sve_sleef(re, vcast_vi_i_sve_sleef(2))), vcast_vd2_d_d_sve_sleef(1.5874010519681995834, -1.0869008194197822986e-16), q2); + + q2 = vd2setxy_vd2_vd_vd_sve_sleef(vmulsign_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(q2), d), vmulsign_vd_vd_vd_sve_sleef(vd2gety_vd_vd2_sve_sleef(q2), d)); + d = vabs_vd_vd_sve_sleef(d); + + x = vcast_vd_d_sve_sleef(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd_sve_sleef(x, d, vcast_vd_d_sve_sleef(2.2307275302496609725722)); + + y = vmul_vd_vd_vd_sve_sleef(x, x); y = vmul_vd_vd_vd_sve_sleef(y, y); x = vsub_vd_vd_vd_sve_sleef(x, vmul_vd_vd_vd_sve_sleef(vmlapn_vd_vd_vd_vd_sve_sleef(d, y, x), vcast_vd_d_sve_sleef(1.0 / 3.0))); + + z = x; + + u = ddmul_vd2_vd_vd_sve_sleef(x, x); + u = ddmul_vd2_vd2_vd2_sve_sleef(u, u); + u = ddmul_vd2_vd2_vd_sve_sleef(u, d); + u = ddadd2_vd2_vd2_vd_sve_sleef(u, vneg_vd_vd_sve_sleef(x)); + y = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(u), vd2gety_vd_vd2_sve_sleef(u)); + + y = vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-2.0 / 3.0), y), z); + v = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd_vd_sve_sleef(z, z), y); + v = ddmul_vd2_vd2_vd_sve_sleef(v, d); + v = ddmul_vd2_vd2_vd2_sve_sleef(v, q2); + z = vldexp2_vd_vd_vi_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(v), vd2gety_vd_vd2_sve_sleef(v)), vsub_vi_vi_vi_sve_sleef(qu, vcast_vi_i_sve_sleef(2048))); + + z = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(d), vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(__builtin_inf()), vd2getx_vd_vd2_sve_sleef(q2)), z); + z = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vreinterpret_vd_vm_sve_sleef(vsignbit_vm_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(q2))), z); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_exp2dx_u10sve(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(d), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vsub_vd_vd_vd_sve_sleef(d, u); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_sve_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_sve_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_sve_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_sve_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_sve_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.6931471805599452862e+0)); + + u = vfma_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1)); + + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vsel_vd_vo_vd_vd_sve_sleef(vge_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1024)), vcast_vd_d_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-2000)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_exp2dx_u35sve(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(d), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vsub_vd_vd_vd_sve_sleef(d, u); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.4434359082926529454e-9)), (vcast_vd_d_sve_sleef(+0.7073164598085707425e-8)))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1017819260921760451e-6)), (vcast_vd_d_sve_sleef(+0.1321543872511327615e-5)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1525273353517584730e-4)), (vcast_vd_d_sve_sleef(+0.1540353045101147808e-3)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1333355814670499073e-2)), (vcast_vd_d_sve_sleef(+0.9618129107597600536e-2)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.5550410866482046596e-1)), (vcast_vd_d_sve_sleef(+0.2402265069591012214e+0))))))))) + + ; + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.6931471805599452862e+0)); + + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1)); + + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vsel_vd_vo_vd_vd_sve_sleef(vge_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1024)), vcast_vd_d_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-2000)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_exp10dx_u10sve(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-1.4205023227266099418e-13), s); + + u = vcast_vd_d_sve_sleef(+0.2411463498334267652e-3); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1157488415217187375e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.5013975546789733659e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1959762320720533080e-1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.6808936399446784138e-1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.2069958494722676234e+0)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.5393829292058536229e+0)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.1171255148908541655e+1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.2034678592293432953e+1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.2650949055239205876e+1)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(+0.2302585092994045901e+1)); + + u = vfma_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1)); + + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(308.25471555991671)), vcast_vd_d_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-350)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_exp10dx_u35sve(vdouble_sve_sleef d) { + vdouble_sve_sleef u = vrint_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint_sve_sleef q = vrint_vi_vd_sve_sleef(u); + + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-0.30102999566383914498), d); + s = vmla_vd_vd_vd_vd_sve_sleef(u, vcast_vd_d_sve_sleef(-1.4205023227266099418e-13), s); + + vdouble_sve_sleef s2 = vmul_vd_vd_vd_sve_sleef(s, s), s4 = vmul_vd_vd_vd_sve_sleef(s2, s2), s8 = vmul_vd_vd_vd_sve_sleef(s4, s4); + u = vmla_vd_vd_vd_vd_sve_sleef((s8), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vcast_vd_d_sve_sleef(+0.2411463498334267652e-3)), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1157488415217187375e-2)), (vcast_vd_d_sve_sleef(+0.5013975546789733659e-2)))))), (vmla_vd_vd_vd_vd_sve_sleef((s4), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1959762320720533080e-1)), (vcast_vd_d_sve_sleef(+0.6808936399446784138e-1)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.2069958494722676234e+0)), (vcast_vd_d_sve_sleef(+0.5393829292058536229e+0)))))), (vmla_vd_vd_vd_vd_sve_sleef((s2), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.1171255148908541655e+1)), (vcast_vd_d_sve_sleef(+0.2034678592293432953e+1)))), (vmla_vd_vd_vd_vd_sve_sleef((s), (vcast_vd_d_sve_sleef(+0.2650949055239205876e+1)), (vcast_vd_d_sve_sleef(+0.2302585092994045901e+1))))))))) + + ; + + u = vmla_vd_vd_vd_vd_sve_sleef(u, s, vcast_vd_d_sve_sleef(1)); + + u = vldexp2_vd_vd_vi_sve_sleef(u, q); + + u = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(308.25471555991671)), vcast_vd_d_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vd_vm_sve_sleef(vandnot_vm_vo64_vm_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-350)), vreinterpret_vm_vd_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_expm1dx_u10sve(vdouble_sve_sleef a) { + vdouble2_sve_sleef d = ddadd2_vd2_vd2_vd_sve_sleef(expk2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0))), vcast_vd_d_sve_sleef(-1.0)); + vdouble_sve_sleef x = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(d), vd2gety_vd_vd2_sve_sleef(d)); + x = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(709.782712893383996732223)), vcast_vd_d_sve_sleef(__builtin_inf()), x); + x = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(-36.736800569677101399113302437)), vcast_vd_d_sve_sleef(-1), x); + x = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(a), vcast_vd_d_sve_sleef(-0.0), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_log10dx_u10sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x; + vdouble_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1), m), ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), m)); + x2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(+0.6653725819576758460e-1)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.6625722782820833712e-1)), (vcast_vd_d_sve_sleef(+0.7898105214313944078e-1)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.9650955035715275132e-1)), (vcast_vd_d_sve_sleef(+0.1240841409721444993e+0)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.1737177927454605086e+0)), (vcast_vd_d_sve_sleef(+0.2895296546021972617e+0))))))) + + ; + + vdouble2_sve_sleef s = ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.30102999566398119802, -2.803728127785170339e-18), vcast_vd_vi_sve_sleef(e)); + + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddmul_vd2_vd2_vd2_sve_sleef(x, vcast_vd2_d_d_sve_sleef(0.86858896380650363334, 1.1430059694096389311e-17))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x)), t)); + + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s)); + + r = vsel_vd_vo_vd_vd_sve_sleef(vispinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_log2dx_u10sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x; + vdouble_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = dddiv_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1), m), ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), m)); + x2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(+0.2211941750456081490e+0)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.2200768693152277689e+0)), (vcast_vd_d_sve_sleef(+0.2623708057488514656e+0)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.3205977477944495502e+0)), (vcast_vd_d_sve_sleef(+0.4121985945485324709e+0)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(+0.5770780162997058982e+0)), (vcast_vd_d_sve_sleef(+0.96179669392608091449))))))) + + ; + + vdouble2_sve_sleef s = ddadd2_vd2_vd_vd2_sve_sleef(vcast_vd_vi_sve_sleef(e), + ddmul_vd2_vd2_vd2_sve_sleef(x, vcast_vd2_d_d_sve_sleef(2.885390081777926774, 6.0561604995516736434e-18))); + + s = ddadd2_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x)), t)); + + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s)); + + r = vsel_vd_vo_vd_vd_sve_sleef(vispinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_log2dx_u35sve(vdouble_sve_sleef d) { + vdouble_sve_sleef m, t, x, x2; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.0/0.75))); + m = vldexp3_vd_vd_vi_sve_sleef(d, vneg_vi_vi_sve_sleef(e)); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + + x = vdiv_vd_vd_vd_sve_sleef(vsub_vd_vd_vd_sve_sleef(m, vcast_vd_d_sve_sleef(1)), vadd_vd_vd_vd_sve_sleef(m, vcast_vd_d_sve_sleef(1))); + x2 = vmul_vd_vd_vd_sve_sleef(x, x); + + t = vcast_vd_d_sve_sleef(+0.2211941750456081490e+0); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.2200768693152277689e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.2623708057488514656e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.3205977477944495502e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.4121985945485324709e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.5770780162997058982e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, x2, vcast_vd_d_sve_sleef(+0.96179669392608091449 )); + + vdouble2_sve_sleef s = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_vi_sve_sleef(e), + ddmul_vd2_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2.885390081777926774))); + + vdouble_sve_sleef r = vmla_vd_vd_vd_vd_sve_sleef(t, vmul_vd_vd_vd_sve_sleef(x, x2), vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s))); + + r = vsel_vd_vo_vd_vd_sve_sleef(vispinf_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_log1pdx_u10sve(vdouble_sve_sleef d) { + vdouble2_sve_sleef x; + vdouble_sve_sleef t, m, x2; + + vdouble_sve_sleef dp1 = vadd_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1)); + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(dp1, vcast_vd_d_sve_sleef(0x1p-1022)); + dp1 = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(dp1, vcast_vd_d_sve_sleef((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), dp1); + vint_sve_sleef e = vilogb2k_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(dp1, vcast_vd_d_sve_sleef(1.0/0.75))); + t = vldexp3_vd_vd_vi_sve_sleef(vcast_vd_d_sve_sleef(1), vneg_vi_vi_sve_sleef(e)); + m = vmla_vd_vd_vd_vd_sve_sleef(d, t, vsub_vd_vd_vd_sve_sleef(t, vcast_vd_d_sve_sleef(1))); + e = vsel_vi_vo_vi_vi_sve_sleef(vcast_vo32_vo64_sve_sleef(o), vsub_vi_vi_vi_sve_sleef(e, vcast_vi_i_sve_sleef(64)), e); + vdouble2_sve_sleef s = ddmul_vd2_vd2_vd_sve_sleef(vcast_vd2_d_d_sve_sleef(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi_sve_sleef(e)); + + x = dddiv_vd2_vd2_vd2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(m, vcast_vd_d_sve_sleef(0)), ddadd_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), m)); + x2 = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2getx_vd_vd2_sve_sleef(x)); + + vdouble_sve_sleef x4 = vmul_vd_vd_vd_sve_sleef(x2, x2), x8 = vmul_vd_vd_vd_sve_sleef(x4, x4); + t = vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(0.1532076988502701353e+0)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.1525629051003428716e+0)), (vcast_vd_d_sve_sleef(0.1818605932937785996e+0)))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.2222214519839380009e+0)), (vcast_vd_d_sve_sleef(0.2857142932794299317e+0)))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vcast_vd_d_sve_sleef(0.3999999999635251990e+0)), (vcast_vd_d_sve_sleef(0.6666666666667333541e+0))))))) + + ; + + s = ddadd_vd2_vd2_vd2_sve_sleef(s, ddscale_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2))); + s = ddadd_vd2_vd2_vd_sve_sleef(s, vmul_vd_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(x2, vd2getx_vd_vd2_sve_sleef(x)), t)); + + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(s), vd2gety_vd_vd2_sve_sleef(s)); + + r = vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1e+307)), vcast_vd_d_sve_sleef(__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-1)), visnan_vo_vd_sve_sleef(d)), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + r = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(-1)), vcast_vd_d_sve_sleef(-__builtin_inf()), r); + r = vsel_vd_vo_vd_vd_sve_sleef(visnegzero_vo_vd_sve_sleef(d), vcast_vd_d_sve_sleef(-0.0), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fabsdx_sve(vdouble_sve_sleef x) { return vabs_vd_vd_sve_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_copysigndx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { return vcopysign_vd_vd_vd_sve_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fmaxdx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + + return vsel_vd_vo_vd_vd_sve_sleef(visnan_vo_vd_sve_sleef(y), x, vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fmindx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + + return vsel_vd_vo_vd_vd_sve_sleef(visnan_vo_vd_sve_sleef(y), x, vsel_vd_vo_vd_vd_sve_sleef(vgt_vo_vd_vd_sve_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fdimdx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef ret = vsub_vd_vd_vd_sve_sleef(x, y); + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(ret, vcast_vd_d_sve_sleef(0)), veq_vo_vd_vd_sve_sleef(x, y)), vcast_vd_d_sve_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_truncdx_sve(vdouble_sve_sleef x) { return vtruncate2_vd_vd_sve_sleef_sve_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_floordx_sve(vdouble_sve_sleef x) { return vfloor2_vd_vd_sve_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_ceildx_sve(vdouble_sve_sleef x) { return vceil2_vd_vd_sve_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_rounddx_sve(vdouble_sve_sleef x) { return vround2_vd_vd_sve_sleef(x); } +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_rintdx_sve(vdouble_sve_sleef x) { return vrint2_vd_vd_sve_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_nextafterdx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + x = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0), y), x); + vmask_sve_sleef xi2 = vreinterpret_vm_vd_sve_sleef(x); + vopmask_sve_sleef c = vxor_vo_vo_vo_sve_sleef(vsignbit_vo_vd_sve_sleef(x), vge_vo_vd_vd_sve_sleef(y, x)); + + xi2 = vsel_vm_vo64_vm_vm_sve_sleef(c, vneg64_vm_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(xi2, vcast_vm_i_i_sve_sleef((int)(1U << 31), 0))), xi2); + + xi2 = vsel_vm_vo64_vm_vm_sve_sleef(vneq_vo_vd_vd_sve_sleef(x, y), vsub64_vm_vm_vm_sve_sleef(xi2, vcast_vm_i_i_sve_sleef(0, 1)), xi2); + + xi2 = vsel_vm_vo64_vm_vm_sve_sleef(c, vneg64_vm_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(xi2, vcast_vm_i_i_sve_sleef((int)(1U << 31), 0))), xi2); + + vdouble_sve_sleef ret = vreinterpret_vd_vm_sve_sleef(xi2); + + ret = vsel_vd_vo_vd_vd_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(ret, vcast_vd_d_sve_sleef(0)), vneq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0))), + vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0), x), ret); + + ret = vsel_vd_vo_vd_vd_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(0))), y, ret); + + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_nan("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_frfrexpdx_sve(vdouble_sve_sleef x) { + x = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(0x1p-1022)), vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(UINT64_C(1) << 63)), x); + + vmask_sve_sleef xm = vreinterpret_vm_vd_sve_sleef(x); + xm = vand_vm_vm_vm_sve_sleef(xm, vcast_vm_i64_sve_sleef(~INT64_C(0x7ff0000000000000))); + xm = vor_vm_vm_vm_sve_sleef (xm, vcast_vm_i64_sve_sleef( INT64_C(0x3fe0000000000000))); + + vdouble_sve_sleef ret = vreinterpret_vd_vm_sve_sleef(xm); + + ret = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(x), vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(__builtin_inf()), x), ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint_sve_sleef Sleef_expfrexpdx_sve(vdouble_sve_sleef x) { + x = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(x), vcast_vd_d_sve_sleef(0x1p-1022)), vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(UINT64_C(1) << 63)), x); + + vint_sve_sleef ret = vcastu_vi_vm_sve_sleef(vreinterpret_vm_vd_sve_sleef(x)); + ret = vsub_vi_vi_vi_sve_sleef(vand_vi_vi_vi_sve_sleef(vsrl_vi_vi_i_sve_sleef(ret, 20), vcast_vi_i_sve_sleef(0x7ff)), vcast_vi_i_sve_sleef(0x3fe)); + + ret = vsel_vi_vo_vi_vi_sve_sleef(vor_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(0)), visnan_vo_vd_sve_sleef(x)), visinf_vo_vd_sve_sleef(x)), vcast_vi_i_sve_sleef(0), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fmadx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y, vdouble_sve_sleef z) { + + return vfma_vd_vd_vd_vd_sve_sleef(x, y, z); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sqrtdx_u05sve(vdouble_sve_sleef d) { + + vdouble_sve_sleef q, w, x, y, z; + + d = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(__builtin_nan("")), d); + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(8.636168555094445E-78)); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.157920892373162E77)), d); + q = vsel_vd_vo_vd_vd_sve_sleef(o, vcast_vd_d_sve_sleef(2.9387358770557188E-39), vcast_vd_d_sve_sleef(1)); + + y = vreinterpret_vd_vm_sve_sleef(vsub64_vm_vm_vm_sve_sleef(vcast_vm_i_i_sve_sleef(0x5fe6ec85, 0xe7de30da), svreinterpret_s32_u64(svlsr_n_u64_x(svptrue_b8(), svreinterpret_u64_s32(vreinterpret_vm_vd_sve_sleef(d)), 1)))); + + x = vmul_vd_vd_vd_sve_sleef(d, y); w = vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), y); + y = vfmanp_vd_vd_vd_vd_sve_sleef(x, w, vcast_vd_d_sve_sleef(0.5)); + x = vfma_vd_vd_vd_vd_sve_sleef(x, y, x); w = vfma_vd_vd_vd_vd_sve_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_sve_sleef(x, w, vcast_vd_d_sve_sleef(0.5)); + x = vfma_vd_vd_vd_vd_sve_sleef(x, y, x); w = vfma_vd_vd_vd_vd_sve_sleef(w, y, w); + y = vfmanp_vd_vd_vd_vd_sve_sleef(x, w, vcast_vd_d_sve_sleef(0.5)); + x = vfma_vd_vd_vd_vd_sve_sleef(x, y, x); w = vfma_vd_vd_vd_vd_sve_sleef(w, y, w); + + y = vfmanp_vd_vd_vd_vd_sve_sleef(x, w, vcast_vd_d_sve_sleef(1.5)); w = vadd_vd_vd_vd_sve_sleef(w, w); + w = vmul_vd_vd_vd_sve_sleef(w, y); + x = vmul_vd_vd_vd_sve_sleef(w, d); + y = vfmapn_vd_vd_vd_vd_sve_sleef(w, d, x); z = vfmanp_vd_vd_vd_vd_sve_sleef(w, x, vcast_vd_d_sve_sleef(1)); + + z = vfmanp_vd_vd_vd_vd_sve_sleef(w, y, z); w = vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), x); + w = vfma_vd_vd_vd_vd_sve_sleef(w, z, y); + w = vadd_vd_vd_vd_sve_sleef(w, x); + + w = vmul_vd_vd_vd_sve_sleef(w, q); + + w = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), + veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(__builtin_inf()))), d, w); + + w = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(__builtin_nan("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sqrtdx_sve(vdouble_sve_sleef d) { + + return vsqrt_vd_vd_sve_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_sqrtdx_u35sve(vdouble_sve_sleef d) { return Sleef_sqrtdx_u05sve(d); } + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_hypotdx_u05sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + x = vabs_vd_vd_sve_sleef(x); + y = vabs_vd_vd_sve_sleef(y); + vdouble_sve_sleef min = vmin_vd_vd_vd_sve_sleef(x, y), n = min; + vdouble_sve_sleef max = vmax_vd_vd_vd_sve_sleef(x, y), d = max; + + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(max, vcast_vd_d_sve_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), d); + + vdouble2_sve_sleef t = dddiv_vd2_vd2_vd2_sve_sleef(vcast_vd2_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(0)), vcast_vd2_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0))); + t = ddmul_vd2_vd2_vd_sve_sleef(ddsqrt_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(ddsqu_vd2_vd2_sve_sleef(t), vcast_vd_d_sve_sleef(1))), max); + vdouble_sve_sleef ret = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t), vd2gety_vd_vd2_sve_sleef(t)); + ret = vsel_vd_vo_vd_vd_sve_sleef(visnan_vo_vd_sve_sleef(ret), vcast_vd_d_sve_sleef(__builtin_inf()), ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(min, vcast_vd_d_sve_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(__builtin_inf())), veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(__builtin_inf()))), vcast_vd_d_sve_sleef(__builtin_inf()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_hypotdx_u35sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + x = vabs_vd_vd_sve_sleef(x); + y = vabs_vd_vd_sve_sleef(y); + vdouble_sve_sleef min = vmin_vd_vd_vd_sve_sleef(x, y); + vdouble_sve_sleef max = vmax_vd_vd_vd_sve_sleef(x, y); + + vdouble_sve_sleef t = vdiv_vd_vd_vd_sve_sleef(min, max); + vdouble_sve_sleef ret = vmul_vd_vd_vd_sve_sleef(max, vsqrt_vd_vd_sve_sleef(vmla_vd_vd_vd_vd_sve_sleef(t, t, vcast_vd_d_sve_sleef(1)))); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(min, vcast_vd_d_sve_sleef(0)), max, ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vd_sve_sleef(x), visnan_vo_vd_sve_sleef(y)), vcast_vd_d_sve_sleef(__builtin_nan("")), ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(__builtin_inf())), veq_vo_vd_vd_sve_sleef(y, vcast_vd_d_sve_sleef(__builtin_inf()))), vcast_vd_d_sve_sleef(__builtin_inf()), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble_sve_sleef vptrunc_vd_vd_sve_sleef(vdouble_sve_sleef x) { + + return vtruncate_vd_vd_sve_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_fmoddx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef n = vabs_vd_vd_sve_sleef(x), d = vabs_vd_vd_sve_sleef(y), s = vcast_vd_d_sve_sleef(1), q; + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022)); + n = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(s , vcast_vd_d_sve_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble2_sve_sleef r = vcast_vd2_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(0)); + vdouble_sve_sleef rd = vtoward0_vd_vd_sve_sleef(vrec_vd_vd_sve_sleef(d)); + + for(int i=0;i<21;i++) { + q = vptrunc_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vtoward0_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r)), rd)); + + q = vsel_vd_vo_vd_vd_sve_sleef(vand_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(3), d), vd2getx_vd_vd2_sve_sleef(r)), + vge_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), d)), + vcast_vd_d_sve_sleef(2), q); + q = vsel_vd_vo_vd_vd_sve_sleef(vand_vo_vo_vo_sve_sleef(vgt_vo_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(d, d), vd2getx_vd_vd2_sve_sleef(r)), + vge_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), d)), + vcast_vd_d_sve_sleef(1), q); + r = ddnormalize_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd2_sve_sleef(r, ddmul_vd2_vd_vd_sve_sleef(q, vneg_vd_vd_sve_sleef(d)))); + if (vtestallones_i_vo64_sve_sleef(vlt_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), d))) break; + } + + vdouble_sve_sleef ret = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), s); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), vd2gety_vd_vd2_sve_sleef(r)), d), vcast_vd_d_sve_sleef(0), ret); + + ret = vmulsign_vd_vd_vd_sve_sleef(ret, x); + + ret = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(n, d), x, ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(__builtin_nan("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE vdouble_sve_sleef vrintk2_vd_vd_sve_sleef(vdouble_sve_sleef d) { + + return vrint_vd_vd_sve_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_remainderdx_sve(vdouble_sve_sleef x, vdouble_sve_sleef y) { + vdouble_sve_sleef n = vabs_vd_vd_sve_sleef(x), d = vabs_vd_vd_sve_sleef(y), s = vcast_vd_d_sve_sleef(1), q; + vopmask_sve_sleef o = vlt_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0x1p-1022*2)); + n = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd_sve_sleef(o, vmul_vd_vd_vd_sve_sleef(s , vcast_vd_d_sve_sleef(1.0 / (UINT64_C(1) << 54))), s); + vdouble_sve_sleef rd = vrec_vd_vd_sve_sleef(d); + vdouble2_sve_sleef r = vcast_vd2_vd_vd_sve_sleef(n, vcast_vd_d_sve_sleef(0)); + vopmask_sve_sleef qisodd = vneq_vo_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0), vcast_vd_d_sve_sleef(0)); + + for(int i=0;i<21;i++) { + q = vrintk2_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), rd)); + + q = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r)), vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(1.5))), vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1.0), vd2getx_vd_vd2_sve_sleef(r)), q); + q = vsel_vd_vo_vd_vd_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r)), vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.5))), + vandnot_vo_vo_vo_sve_sleef(qisodd, veq_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r)), vmul_vd_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0.5))))), + vcast_vd_d_sve_sleef(0.0), q); + if (vtestallones_i_vo64_sve_sleef(veq_vo_vd_vd_sve_sleef(q, vcast_vd_d_sve_sleef(0)))) break; + q = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(q, vneg_vd_vd_sve_sleef(d))), vadd_vd_vd_vd_sve_sleef(q, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(-1), vd2getx_vd_vd2_sve_sleef(r))), q); + qisodd = vxor_vo_vo_vo_sve_sleef(qisodd, visodd_vo_vd_sve_sleef(q)); + r = ddnormalize_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd2_sve_sleef(r, ddmul_vd2_vd_vd_sve_sleef(q, vneg_vd_vd_sve_sleef(d)))); + } + + vdouble_sve_sleef ret = vmul_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(r), s); + ret = vmulsign_vd_vd_vd_sve_sleef(ret, x); + ret = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(y), vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(x), vcast_vd_d_sve_sleef(__builtin_nan("")), x), ret); + ret = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(d, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(__builtin_nan("")), ret); + return ret; +} + +static SLEEF_CONST dd2_sve_sleef gammak_sve_sleef(vdouble_sve_sleef a) { + vdouble2_sve_sleef clc = vcast_vd2_d_d_sve_sleef(0, 0), clln = vcast_vd2_d_d_sve_sleef(1, 0), clld = vcast_vd2_d_d_sve_sleef(1, 0); + vdouble2_sve_sleef x, y, z; + vdouble_sve_sleef t, u; + + vopmask_sve_sleef otiny = vlt_vo_vd_vd_sve_sleef(vabs_vd_vd_sve_sleef(a), vcast_vd_d_sve_sleef(1e-306)), oref = vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0.5)); + + x = vsel_vd2_vo_vd2_vd2_sve_sleef(otiny, vcast_vd2_d_d_sve_sleef(0, 0), + vsel_vd2_vo_vd2_vd2_sve_sleef(oref, ddadd2_vd2_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(1), vneg_vd_vd_sve_sleef(a)), + vcast_vd2_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)))); + + vopmask_sve_sleef o0 = vand_vo_vo_vo_sve_sleef(vle_vo_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(0.5), vd2getx_vd_vd2_sve_sleef(x)), vle_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vcast_vd_d_sve_sleef(1.1))); + vopmask_sve_sleef o2 = vle_vo_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2.3), vd2getx_vd_vd2_sve_sleef(x)); + + y = ddnormalize_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1)), x)); + y = ddnormalize_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2)), y)); + y = ddnormalize_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(3)), y)); + y = ddnormalize_vd2_vd2_sve_sleef(ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(4)), y)); + + vopmask_sve_sleef o = vand_vo_vo_vo_sve_sleef(o2, vle_vo_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vcast_vd_d_sve_sleef(7))); + clln = vsel_vd2_vo_vd2_vd2_sve_sleef(o, y, clln); + + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o, ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(5)), x); + + t = vsel_vd_vo_vd_vd_sve_sleef(o2, vrec_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x)), vd2getx_vd_vd2_sve_sleef(ddnormalize_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vsel_vd_vo_d_d_sve_sleef(o0, -1, -2))))); + + u = vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -156.801412704022726379848862, +0.2947916772827614196e+2, +0.7074816000864609279e-7); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +1.120804464289911606838558160000, +0.1281459691827820109e+3, +0.4009244333008730443e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +13.39798545514258921833306020000, +0.2617544025784515043e+3, +0.1040114641628246946e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.116546276599463200848033357000, +0.3287022855685790432e+3, +0.1508349150733329167e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -1.391801093265337481495562410000, +0.2818145867730348186e+3, +0.1288143074933901020e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.015056113040026424412918973400, +0.1728670414673559605e+3, +0.4744167749884993937e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.179540117061234856098844714000, +0.7748735764030416817e+2, -0.6554816306542489902e-7)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.002481743600264997730942489280, +0.2512856643080930752e+2, -0.3189252471452599844e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.029527880945699120504851034100, +0.5766792106140076868e+1, +0.1358883821470355377e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.000540164767892604515196325186, +0.7270275473996180571e+0, -0.4343931277157336040e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.006403362833808069794787256200, +0.8396709124579147809e-1, +0.9724785897406779555e-6)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.000162516262783915816896611252, -0.8211558669746804595e-1, -0.2036886057225966011e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.001914438498565477526465972390, +0.6828831828341884458e-1, +0.4373363141819725815e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +7.20489541602001055898311517e-05, -0.7712481339961671511e-1, -0.9439951268304008677e-5)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.000839498720672087279971000786, +0.8337492023017314957e-1, +0.2050727030376389804e-4)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -5.17179090826059219329394422e-05, -0.9094964931456242518e-1, -0.4492620183431184018e-4)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.000592166437353693882857342347, +0.1000996313575929358e+0, +0.9945751236071875931e-4)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.1113342861544207724e+0, -0.2231547599034983196e-3)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.000784039221720066627493314301, +0.1255096673213020875e+0, +0.5096695247101967622e-3)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.000229472093621399176949318732, -0.1440498967843054368e+0, -0.1192753911667886971e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, -0.002681327160493827160473958490, +0.1695571770041949811e+0, +0.2890510330742210310e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.003472222222222222222175164840, -0.2073855510284092762e+0, -0.7385551028674461858e-2)); + u = vmla_vd_vd_vd_vd_sve_sleef(u, t, vsel_vd_vo_vo_d_d_d_sve_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705808084277815939e+0, +0.2058080842778455335e-1)); + + y = ddmul_vd2_vd2_vd2_sve_sleef(ddadd2_vd2_vd2_vd_sve_sleef(x, vcast_vd_d_sve_sleef(-0.5)), logk2_sve_sleef(x)); + y = ddadd2_vd2_vd2_vd2_sve_sleef(y, ddneg_vd2_vd2_sve_sleef(x)); + y = ddadd2_vd2_vd2_vd2_sve_sleef(y, vcast_vd2_d_d_sve_sleef(0.91893853320467278056, -3.8782941580672414498e-17)); + + z = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd_vd_sve_sleef (u, t), vsel_vd_vo_d_d_sve_sleef(o0, -0.4006856343865314862e+0, -0.6735230105319810201e-1)); + z = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd_sve_sleef(z, t), vsel_vd_vo_d_d_sve_sleef(o0, +0.8224670334241132030e+0, +0.3224670334241132030e+0)); + z = ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd2_vd_sve_sleef(z, t), vsel_vd_vo_d_d_sve_sleef(o0, -0.5772156649015328655e+0, +0.4227843350984671345e+0)); + z = ddmul_vd2_vd2_vd_sve_sleef(z, t); + + clc = vsel_vd2_vo_vd2_vd2_sve_sleef(o2, y, z); + + clld = vsel_vd2_vo_vd2_vd2_sve_sleef(o2, ddadd2_vd2_vd2_vd_sve_sleef(ddmul_vd2_vd_vd_sve_sleef(u, t), vcast_vd_d_sve_sleef(1)), clld); + + y = clln; + + clc = vsel_vd2_vo_vd2_vd2_sve_sleef(otiny, vcast_vd2_d_d_sve_sleef(83.1776616671934334590333, 3.67103459631568507221878e-15), + vsel_vd2_vo_vd2_vd2_sve_sleef(oref, ddadd2_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(1.1447298858494001639, 1.026595116270782638e-17), ddneg_vd2_vd2_sve_sleef(clc)), clc)); + clln = vsel_vd2_vo_vd2_vd2_sve_sleef(otiny, vcast_vd2_d_d_sve_sleef(1, 0), vsel_vd2_vo_vd2_vd2_sve_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo64_sve_sleef(vnot_vo64_vo64_sve_sleef(oref))) { + t = vsub_vd_vd_vd_sve_sleef(a, vmul_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(INT64_C(1) << 28), vcast_vd_vi_sve_sleef(vtruncate_vi_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(1.0 / (INT64_C(1) << 28))))))); + x = ddmul_vd2_vd2_vd2_sve_sleef(clld, sinpik_sve_sleef(t)); + } + + clld = vsel_vd2_vo_vd2_vd2_sve_sleef(otiny, vcast_vd2_vd_vd_sve_sleef(vmul_vd_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef((INT64_C(1) << 60)*(double)(INT64_C(1) << 60))), vcast_vd_d_sve_sleef(0)), + vsel_vd2_vo_vd2_vd2_sve_sleef(oref, x, y)); + + return dd2setab_dd2_vd2_vd2_sve_sleef(clc, dddiv_vd2_vd2_vd2_sve_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_tgammadx_u10sve(vdouble_sve_sleef a) { + dd2_sve_sleef d = gammak_sve_sleef(a); + vdouble2_sve_sleef y = ddmul_vd2_vd2_vd2_sve_sleef(expk2_sve_sleef(dd2geta_vd2_dd2_sve_sleef(d)), dd2getb_vd2_dd2_sve_sleef(d)); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(y)); + vopmask_sve_sleef o; + + o = vor_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(-__builtin_inf())), + vand_vo_vo_vo_sve_sleef(vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)), visint_vo_vd_sve_sleef(a))), + vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(visnumber_vo_vd_sve_sleef(a), vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0))), visnan_vo_vd_sve_sleef(r))); + r = vsel_vd_vo_vd_vd_sve_sleef(o, vcast_vd_d_sve_sleef(__builtin_nan("")), r); + + o = vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(__builtin_inf())), visnumber_vo_vd_sve_sleef(a)), + vge_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(-0x1p-1022))), + vor_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)), vgt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(200))), visnan_vo_vd_sve_sleef(r))); + r = vsel_vd_vo_vd_vd_sve_sleef(o, vmulsign_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(__builtin_inf()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_lgammadx_u10sve(vdouble_sve_sleef a) { + dd2_sve_sleef d = gammak_sve_sleef(a); + vdouble2_sve_sleef y = ddadd2_vd2_vd2_vd2_sve_sleef(dd2geta_vd2_dd2_sve_sleef(d), logk2_sve_sleef(ddabs_vd2_vd2_sve_sleef(dd2getb_vd2_dd2_sve_sleef(d)))); + vdouble_sve_sleef r = vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(y), vd2gety_vd_vd2_sve_sleef(y)); + vopmask_sve_sleef o; + + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vd_sve_sleef(a), + vor_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(vle_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)), visint_vo_vd_sve_sleef(a)), + vand_vo_vo_vo_sve_sleef(visnumber_vo_vd_sve_sleef(a), visnan_vo_vd_sve_sleef(r)))); + r = vsel_vd_vo_vd_vd_sve_sleef(o, vcast_vd_d_sve_sleef(__builtin_inf()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef ddmla_vd2_vd_vd2_vd2_sve_sleef(vdouble_sve_sleef x, vdouble2_sve_sleef y, vdouble2_sve_sleef z) { + return ddadd_vd2_vd2_vd2_sve_sleef(z, ddmul_vd2_vd2_vd_sve_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef poly2dd_b_sve_sleef(vdouble_sve_sleef x, vdouble2_sve_sleef c1, vdouble2_sve_sleef c0) { return ddmla_vd2_vd_vd2_vd2_sve_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef poly2dd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef c1, vdouble2_sve_sleef c0) { return ddmla_vd2_vd_vd2_vd2_sve_sleef(x, vcast_vd2_vd_vd_sve_sleef(c1, vcast_vd_d_sve_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vdouble2_sve_sleef poly4dd_sve_sleef(vdouble_sve_sleef x, vdouble_sve_sleef c3, vdouble2_sve_sleef c2, vdouble2_sve_sleef c1, vdouble2_sve_sleef c0) { + return ddmla_vd2_vd_vd2_vd2_sve_sleef(vmul_vd_vd_vd_sve_sleef(x, x), poly2dd_sve_sleef(x, c3, c2), poly2dd_b_sve_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_erfdx_u10sve(vdouble_sve_sleef a) { + vdouble_sve_sleef t, x = vabs_vd_vd_sve_sleef(a); + vdouble2_sve_sleef t2; + vdouble_sve_sleef x2 = vmul_vd_vd_vd_sve_sleef(x, x), x4 = vmul_vd_vd_vd_sve_sleef(x2, x2); + vdouble_sve_sleef x8 = vmul_vd_vd_vd_sve_sleef(x4, x4), x16 = vmul_vd_vd_vd_sve_sleef(x8, x8); + vopmask_sve_sleef o25 = vle_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo64_sve_sleef(o25)), 1)) { + + t = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vcast_vd_d_sve_sleef(-0.2083271002525222097e-14)), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.7151909970790897009e-13)), (vcast_vd_d_sve_sleef(-0.1162238220110999364e-11)))), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.1186474230821585259e-10)), (vcast_vd_d_sve_sleef(-0.8499973178354613440e-10)))))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.4507647462598841629e-9)), (vcast_vd_d_sve_sleef(-0.1808044474288848915e-8)))), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.5435081826716212389e-8)), (vcast_vd_d_sve_sleef(-0.1143939895758628484e-7)))))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.1215442362680889243e-7)), (vcast_vd_d_sve_sleef(+0.1669878756181250355e-7)))), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(-0.9808074602255194288e-7)), (vcast_vd_d_sve_sleef(+0.1389000557865837204e-6)))))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.2945514529987331866e-6)), (vcast_vd_d_sve_sleef(-0.1842918273003998283e-5)))), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.3417987836115362136e-5)), (vcast_vd_d_sve_sleef(+0.3860236356493129101e-5)))))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(-0.3309403072749947546e-4)), (vcast_vd_d_sve_sleef(+0.1060862922597579532e-3)))), (vmla_vd_vd_vd_vd_sve_sleef((x), (vcast_vd_d_sve_sleef(+0.2323253155213076174e-3)), (vcast_vd_d_sve_sleef(+0.1490149719145544729e-3))))))))))) + + ; + t2 = poly4dd_sve_sleef(x, t, + vcast_vd2_d_d_sve_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_sve_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_sve_sleef(0.07052369794346953491, 9.5846628070792092842e-19)); + t2 = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), ddmul_vd2_vd2_vd_sve_sleef(t2, x)); + t2 = ddsqu_vd2_vd2_sve_sleef(t2); + t2 = ddsqu_vd2_vd2_sve_sleef(t2); + t2 = ddsqu_vd2_vd2_sve_sleef(t2); + t2 = ddsqu_vd2_vd2_sve_sleef(t2); + t2 = ddrec_vd2_vd2_sve_sleef(t2); + } else { + + t = vmla_vd_vd_vd_vd_sve_sleef((x16), (vmla_vd_vd_vd_vd_sve_sleef((x4), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.2083271002525222097e-14, -0.4024015130752621932e-18))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.7151909970790897009e-13, +0.3847193332817048172e-16))), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.1162238220110999364e-11, -0.1749316241455644088e-14))))), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1186474230821585259e-10, +0.5029618322872872715e-13))), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.8499973178354613440e-10, -0.1025221466851463164e-11))))))))), (vmla_vd_vd_vd_vd_sve_sleef((x8), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.4507647462598841629e-9, +0.1573695559331945583e-10))), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.1808044474288848915e-8, -0.1884658558040203709e-9))))), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.5435081826716212389e-8, +0.1798167853032159309e-8))), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.1143939895758628484e-7, -0.1380745342355033142e-7))))))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1215442362680889243e-7, +0.8525705726469103499e-7))), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1669878756181250355e-7, -0.4160448058101303405e-6))))), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.9808074602255194288e-7, +0.1517272660008588485e-5))), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1389000557865837204e-6, -0.3341634127317201697e-5))))))))), (vmla_vd_vd_vd_vd_sve_sleef((x4), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.2945514529987331866e-6, -0.2515023395879724513e-5))), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.1842918273003998283e-5, +0.6539731269664907554e-4))))), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.3417987836115362136e-5, -0.3551065097428388658e-3))), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.3860236356493129101e-5, +0.1210736097958368864e-2))))))), (vmla_vd_vd_vd_vd_sve_sleef((x2), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, -0.3309403072749947546e-4, -0.2605566912579998680e-2))), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1060862922597579532e-3, +0.1252823202436093193e-2))))), (vmla_vd_vd_vd_vd_sve_sleef((x), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.2323253155213076174e-3, +0.1820191395263313222e-1))), ((vsel_vd_vo_d_d_sve_sleef(o25, +0.1490149719145544729e-3, -0.1021557155453465954e+0)))))))))))) + + ; + t2 = poly4dd_sve_sleef(x, t, + vsel_vd2_vo_vd2_vd2_sve_sleef(o25, vcast_vd2_d_d_sve_sleef(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d_sve_sleef(-0.63691044383641748361, -2.4249477526539431839e-17)), + vsel_vd2_vo_vd2_vd2_sve_sleef(o25, vcast_vd2_d_d_sve_sleef(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d_sve_sleef(-1.1282926061803961737, -6.2970338860410996505e-17)), + vsel_vd2_vo_vd2_vd2_sve_sleef(o25, vcast_vd2_d_d_sve_sleef(0.07052369794346953491, 9.5846628070792092842e-19), + vcast_vd2_d_d_sve_sleef(-1.2261313785184804967e-05, -5.5329707514490107044e-22))); + vdouble2_sve_sleef s2 = ddadd_vd2_vd_vd2_sve_sleef(vcast_vd_d_sve_sleef(1), ddmul_vd2_vd2_vd_sve_sleef(t2, x)); + s2 = ddsqu_vd2_vd2_sve_sleef(s2); + s2 = ddsqu_vd2_vd2_sve_sleef(s2); + s2 = ddsqu_vd2_vd2_sve_sleef(s2); + s2 = ddsqu_vd2_vd2_sve_sleef(s2); + s2 = ddrec_vd2_vd2_sve_sleef(s2); + t2 = vsel_vd2_vo_vd2_vd2_sve_sleef(o25, s2, vcast_vd2_vd_vd_sve_sleef(expk_sve_sleef(t2), vcast_vd_d_sve_sleef(0))); + } + + t2 = ddadd2_vd2_vd2_vd_sve_sleef(t2, vcast_vd_d_sve_sleef(-1)); + + vdouble_sve_sleef z = vneg_vd_vd_sve_sleef(vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(t2), vd2gety_vd_vd2_sve_sleef(t2))); + z = vsel_vd_vo_vd_vd_sve_sleef(vlt_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1e-8)), vmul_vd_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(1.12837916709551262756245475959)), z); + z = vsel_vd_vo_vd_vd_sve_sleef(vge_vo_vd_vd_sve_sleef(x, vcast_vd_d_sve_sleef(6)), vcast_vd_d_sve_sleef(1), z); + z = vsel_vd_vo_vd_vd_sve_sleef(visinf_vo_vd_sve_sleef(a), vcast_vd_d_sve_sleef(1), z); + z = vsel_vd_vo_vd_vd_sve_sleef(veq_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)), vcast_vd_d_sve_sleef(0), z); + z = vmulsign_vd_vd_vd_sve_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vdouble_sve_sleef Sleef_erfcdx_u15sve(vdouble_sve_sleef a) { + vdouble_sve_sleef s = a, r = vcast_vd_d_sve_sleef(0), t; + vdouble2_sve_sleef u, d, x; + a = vabs_vd_vd_sve_sleef(a); + vopmask_sve_sleef o0 = vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(1.0)); + vopmask_sve_sleef o1 = vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(2.2)); + vopmask_sve_sleef o2 = vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(4.2)); + vopmask_sve_sleef o3 = vlt_vo_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(27.3)); + + u = vsel_vd2_vo_vd2_vd2_sve_sleef(o0, ddmul_vd2_vd_vd_sve_sleef(a, a), vsel_vd2_vo_vd2_vd2_sve_sleef(o1, vcast_vd2_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0)), dddiv_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(1, 0), vcast_vd2_vd_vd_sve_sleef(a, vcast_vd_d_sve_sleef(0))))); + + t = vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.6801072401395386139e-20, +0.3438010341362585303e-12, -0.5757819536420710449e+2, +0.2334249729638701319e+5); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.2161766247570055669e-18, -0.1237021188160598264e-10, +0.4669289654498104483e+3, -0.4695661044933107769e+5)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.4695919173301595670e-17, +0.2117985839877627852e-09, -0.1796329879461355858e+4, +0.3173403108748643353e+5)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.9049140419888007122e-16, -0.2290560929177369506e-08, +0.4355892193699575728e+4, +0.3242982786959573787e+4)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.1634018903557410728e-14, +0.1748931621698149538e-07, -0.7456258884965764992e+4, -0.2014717999760347811e+5)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.2783485786333451745e-13, -0.9956602606623249195e-07, +0.9553977358167021521e+4, +0.1554006970967118286e+5)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.4463221276786415752e-12, +0.4330010240640327080e-06, -0.9470019905444229153e+4, -0.6150874190563554293e+4)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.6711366622850136563e-11, -0.1435050600991763331e-05, +0.7387344321849855078e+4, +0.1240047765634815732e+4)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.9422759050232662223e-10, +0.3460139479650695662e-05, -0.4557713054166382790e+4, -0.8210325475752699731e+2)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.1229055530100229098e-08, -0.4988908180632898173e-05, +0.2207866967354055305e+4, +0.3242443880839930870e+2)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.1480719281585086512e-07, -0.1308775976326352012e-05, -0.8217975658621754746e+3, -0.2923418863833160586e+2)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.1636584469123399803e-06, +0.2825086540850310103e-04, +0.2268659483507917400e+3, +0.3457461732814383071e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.1646211436588923575e-05, -0.6393913713069986071e-04, -0.4633361260318560682e+2, +0.5489730155952392998e+1)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.1492565035840623511e-04, -0.2566436514695078926e-04, +0.9557380123733945965e+1, +0.1559934132251294134e-2)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.1205533298178967851e-03, +0.5895792375659440364e-03, -0.2958429331939661289e+1, -0.1541741566831520638e+1)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.8548327023450850081e-03, -0.1695715579163588598e-02, +0.1670329508092765480e+0, +0.2823152230558364186e-5)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, +0.5223977625442187932e-02, +0.2089116434918055149e-03, +0.6096615680115419211e+0, +0.6249999184195342838e+0)); + t = vmla_vd_vd_vd_vd_sve_sleef(t, vd2getx_vd_vd2_sve_sleef(u), vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.2686617064513125222e-01, +0.1912855949584917753e-01, +0.1059212443193543585e-2, +0.1741749416408701288e-8)); + + d = ddmul_vd2_vd2_vd_sve_sleef(u, t); + d = ddadd2_vd2_vd2_vd2_sve_sleef(d, vcast_vd2_vd_vd_sve_sleef(vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, 0.11283791670955126141, -0.10277263343147646779, -0.50005180473999022439, -0.5000000000258444377), + vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -4.0175691625932118483e-18, -6.2338714083404900225e-18, 2.6362140569041995803e-17, -4.0074044712386992281e-17))); + d = ddmul_vd2_vd2_vd2_sve_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_sve_sleef(d, vcast_vd2_vd_vd_sve_sleef(vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.37612638903183753802, -0.63661976742916359662, 1.601106273924963368e-06, 2.3761973137523364792e-13), + vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, 1.3391897206042552387e-17, 7.6321019159085724662e-18, 1.1974001857764476775e-23, -1.1670076950531026582e-29))); + d = ddmul_vd2_vd2_vd2_sve_sleef(d, u); + d = ddadd2_vd2_vd2_vd2_sve_sleef(d, vcast_vd2_vd_vd_sve_sleef(vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, 1.1283791670955125586, -1.1283791674717296161, -0.57236496645145429341, -0.57236494292470108114), + vsel_vd_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, 1.5335459613165822674e-17, 8.0896847755965377194e-17, 3.0704553245872027258e-17, -2.3984352208056898003e-17))); + + x = ddmul_vd2_vd2_vd_sve_sleef(vsel_vd2_vo_vd2_vd2_sve_sleef(o1, d, vcast_vd2_vd_vd_sve_sleef(vneg_vd_vd_sve_sleef(a), vcast_vd_d_sve_sleef(0))), a); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o1, x, ddadd2_vd2_vd2_vd2_sve_sleef(x, d)); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o0, ddsub_vd2_vd2_vd2_sve_sleef(vcast_vd2_d_d_sve_sleef(1, 0), x), expk2_sve_sleef(x)); + x = vsel_vd2_vo_vd2_vd2_sve_sleef(o1, x, ddmul_vd2_vd2_vd2_sve_sleef(x, u)); + + r = vsel_vd_vo_vd_vd_sve_sleef(o3, vadd_vd_vd_vd_sve_sleef(vd2getx_vd_vd2_sve_sleef(x), vd2gety_vd_vd2_sve_sleef(x)), vcast_vd_d_sve_sleef(0)); + r = vsel_vd_vo_vd_vd_sve_sleef(vsignbit_vo_vd_sve_sleef(s), vsub_vd_vd_vd_sve_sleef(vcast_vd_d_sve_sleef(2), r), r); + r = vsel_vd_vo_vd_vd_sve_sleef(visnan_vo_vd_sve_sleef(s), vcast_vd_d_sve_sleef(__builtin_nan("")), r); + return r; +} + +#if !defined(__NVCC__) && ((defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8)) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__NVCC__) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +extern const float Sleef_rempitabsp[]; + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vupper_vf_vf_sve_sleef(vfloat_sve_sleef d) { + return vreinterpret_vf_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vreinterpret_vi2_vf_sve_sleef(d), vcast_vi2_i_sve_sleef(0xfffff000))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vcast_vf2_vf_vf_sve_sleef(vfloat_sve_sleef h, vfloat_sve_sleef l) { + return vf2setxy_vf2_vf_vf_sve_sleef(h, l); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vcast_vf2_f_f_sve_sleef(float h, float l) { + return vf2setxy_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(h), vcast_vf_f_sve_sleef(l)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vcast_vf2_d_sve_sleef(double d) { + return vf2setxy_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(d), vcast_vf_f_sve_sleef(d - (float)d)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vsel_vf2_vo_vf2_vf2_sve_sleef(vopmask_sve_sleef m, vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + return vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(m, vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)), vsel_vf_vo_vf_vf_sve_sleef(m, vf2gety_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vsel_vf2_vo_f_f_f_f_sve_sleef(vopmask_sve_sleef o, float x1, float y1, float x0, float y0) { + return vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_f_f_sve_sleef(o, x1, x0), vsel_vf_vo_f_f_sve_sleef(o, y1, y0)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vsel_vf2_vo_vo_d_d_d_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, double d0, double d1, double d2) { + return vsel_vf2_vo_vf2_vf2_sve_sleef(o0, vcast_vf2_d_sve_sleef(d0), vsel_vf2_vo_vf2_vf2_sve_sleef(o1, vcast_vf2_d_sve_sleef(d1), vcast_vf2_d_sve_sleef(d2))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vsel_vf2_vo_vo_vo_d_d_d_d_sve_sleef(vopmask_sve_sleef o0, vopmask_sve_sleef o1, vopmask_sve_sleef o2, double d0, double d1, double d2, double d3) { + return vsel_vf2_vo_vf2_vf2_sve_sleef(o0, vcast_vf2_d_sve_sleef(d0), vsel_vf2_vo_vf2_vf2_sve_sleef(o1, vcast_vf2_d_sve_sleef(d1), vsel_vf2_vo_vf2_vf2_sve_sleef(o2, vcast_vf2_d_sve_sleef(d2), vcast_vf2_d_sve_sleef(d3)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef vabs_vf2_vf2_sve_sleef(vfloat2_sve_sleef x) { + return vcast_vf2_vf_vf_sve_sleef(vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0)), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)))), + vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0)), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vadd_vf_3vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2) { + return vadd_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vadd_vf_4vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3) { + return vadd_vf_3vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vadd_vf_5vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3, vfloat_sve_sleef v4) { + return vadd_vf_4vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vadd_vf_6vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3, vfloat_sve_sleef v4, vfloat_sve_sleef v5) { + return vadd_vf_5vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(v0, v1), v2, v3, v4, v5); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vadd_vf_7vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3, vfloat_sve_sleef v4, vfloat_sve_sleef v5, vfloat_sve_sleef v6) { + return vadd_vf_6vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(v0, v1), v2, v3, v4, v5, v6); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vsub_vf_3vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2) { + return vsub_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(v0, v1), v2); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vsub_vf_4vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3) { + return vsub_vf_3vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(v0, v1), v2, v3); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vsub_vf_5vf_sve_sleef(vfloat_sve_sleef v0, vfloat_sve_sleef v1, vfloat_sve_sleef v2, vfloat_sve_sleef v3, vfloat_sve_sleef v4) { + return vsub_vf_4vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(v0, v1), v2, v3, v4); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfneg_vf2_vf2_sve_sleef(vfloat2_sve_sleef x) { + return vcast_vf2_vf_vf_sve_sleef(vneg_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)), vneg_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfabs_vf2_vf2_sve_sleef(vfloat2_sve_sleef x) { + return vcast_vf2_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)), + vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x)), vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f)))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfnormalize_vf2_vf2_sve_sleef(vfloat2_sve_sleef t) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t), vf2gety_vf_vf2_sve_sleef(t)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t), s), vf2gety_vf_vf2_sve_sleef(t))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfscale_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef d, vfloat_sve_sleef s) { + return vf2setxy_vf2_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), s), vmul_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(d), s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd_vf2_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(x, y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd2_vf2_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(x, y); + vfloat_sve_sleef v = vsub_vf_vf_vf_sve_sleef(s, x); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, vsub_vf_vf_vf_sve_sleef(s, v)), vsub_vf_vf_vf_sve_sleef(y, v))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd2_vf2_vf_vf2_sve_sleef(vfloat_sve_sleef x, vfloat2_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(x, vf2getx_vf_vf2_sve_sleef(y)); + vfloat_sve_sleef v = vsub_vf_vf_vf_sve_sleef(s, x); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, vsub_vf_vf_vf_sve_sleef(s, v)), vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), v)), vf2gety_vf_vf2_sve_sleef(y))); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_3vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), s), y, vf2gety_vf_vf2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsub_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), s), y), vf2gety_vf_vf2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd2_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), y); + vfloat_sve_sleef v = vsub_vf_vf_vf_sve_sleef(s, vf2getx_vf_vf2_sve_sleef(x)); + vfloat_sve_sleef t = vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vsub_vf_vf_vf_sve_sleef(s, v)), vsub_vf_vf_vf_sve_sleef(y, v)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(t, vf2gety_vf_vf2_sve_sleef(x))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd_vf2_vf_vf2_sve_sleef(vfloat_sve_sleef x, vfloat2_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(x, vf2getx_vf_vf2_sve_sleef(y)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_3vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, s), vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd_vf2_vf2_vf2_sve_sleef(vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_4vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), s), vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfadd2_vf2_vf2_vf2_sve_sleef(vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + vfloat_sve_sleef s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)); + vfloat_sve_sleef v = vsub_vf_vf_vf_sve_sleef(s, vf2getx_vf_vf2_sve_sleef(x)); + vfloat_sve_sleef t = vadd_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vsub_vf_vf_vf_sve_sleef(s, v)), vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), v)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vadd_vf_vf_vf_sve_sleef(t, vadd_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsub_vf2_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + + vfloat_sve_sleef s = vsub_vf_vf_vf_sve_sleef(x, y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vsub_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, s), y)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsub_vf2_vf2_vf2_sve_sleef(vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + + vfloat_sve_sleef s = vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)); + vfloat_sve_sleef t = vsub_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), s); + t = vsub_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(y)); + t = vadd_vf_vf_vf_sve_sleef(t, vf2gety_vf_vf2_sve_sleef(x)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vsub_vf_vf_vf_sve_sleef(t, vf2gety_vf_vf2_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfdiv_vf2_vf2_vf2_sve_sleef(vfloat2_sve_sleef n, vfloat2_sve_sleef d) { + vfloat_sve_sleef t = vrec_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d)); + vfloat_sve_sleef s = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(n), t); + vfloat_sve_sleef u = vfmapn_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(n), s); + vfloat_sve_sleef v = vfmanp_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(d), t, vfmanp_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), t, vcast_vf_f_sve_sleef(1))); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vfma_vf_vf_vf_vf_sve_sleef(s, v, vfma_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(n), t, u))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfmul_vf2_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vmul_vf_vf_vf_sve_sleef(x, y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vfmapn_vf_vf_vf_vf_sve_sleef(x, y, s)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsqu_vf2_vf2_sve_sleef(vfloat2_sve_sleef x) { + vfloat_sve_sleef s = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vfma_vf_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)), vf2gety_vf_vf2_sve_sleef(x), vfmapn_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x), s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef dfsqu_vf_vf2_sve_sleef(vfloat2_sve_sleef x) { + return vfma_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x), vadd_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)), vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfmul_vf2_vf2_vf2_sve_sleef(vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + vfloat_sve_sleef s = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vfma_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(y), vfma_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y), vfmapn_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y), s)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef dfmul_vf_vf2_vf2_sve_sleef(vfloat2_sve_sleef x, vfloat2_sve_sleef y) { + return vfma_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y), vfma_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y), vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfmul_vf2_vf2_vf_sve_sleef(vfloat2_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef s = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), y); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vfma_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x), y, vfmapn_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), y, s))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfrec_vf2_vf_sve_sleef(vfloat_sve_sleef d) { + vfloat_sve_sleef s = vrec_vf_vf_sve_sleef(d); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(s, vfmanp_vf_vf_vf_vf_sve_sleef(d, s, vcast_vf_f_sve_sleef(1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfrec_vf2_vf2_sve_sleef(vfloat2_sve_sleef d) { + vfloat_sve_sleef s = vrec_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d)); + return vf2setxy_vf2_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(s, vfmanp_vf_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(d), s, vfmanp_vf_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), s, vcast_vf_f_sve_sleef(1))))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsqrt_vf2_vf2_sve_sleef(vfloat2_sve_sleef d) { + + vfloat_sve_sleef t = vsqrt_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d))); + return dfscale_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf2_sve_sleef(d, dfmul_vf2_vf_vf_sve_sleef(t, t)), dfrec_vf2_vf_sve_sleef(t)), vcast_vf_f_sve_sleef(0.5)); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfsqrt_vf2_vf_sve_sleef(vfloat_sve_sleef d) { + vfloat_sve_sleef t = vsqrt_vf_vf_sve_sleef(d); + return dfscale_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf2_sve_sleef(d, dfmul_vf2_vf_vf_sve_sleef(t, t)), dfrec_vf2_vf_sve_sleef(t)), vcast_vf_f_sve_sleef(0.5f)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visnegzero_vo_vf_sve_sleef(vfloat_sve_sleef d) { + return veq_vo_vi2_vi2_sve_sleef(vreinterpret_vi2_vf_sve_sleef(d), vreinterpret_vi2_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))); +} + +static SLEEF_ALWAYS_INLINE vopmask_sve_sleef vnot_vo32_vo32_sve_sleef(vopmask_sve_sleef x) { + return vxor_vo_vo_vo_sve_sleef(x, veq_vo_vi2_vi2_sve_sleef(vcast_vi2_i_sve_sleef(0), vcast_vi2_i_sve_sleef(0))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vmask_sve_sleef vsignbit_vm_vf_sve_sleef(vfloat_sve_sleef f) { + return vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(f), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vmulsign_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(x), vsignbit_vm_vf_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vcopysign_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vandnot_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f)), vreinterpret_vm_vf_sve_sleef(x)), + vand_vm_vm_vm_sve_sleef (vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f)), vreinterpret_vm_vf_sve_sleef(y)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vsign_vf_vf_sve_sleef(vfloat_sve_sleef f) { + return vreinterpret_vf_vm_sve_sleef(vor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f)), vand_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f)), vreinterpret_vm_vf_sve_sleef(f)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef vsignbit_vo_vf_sve_sleef(vfloat_sve_sleef d) { + return veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vreinterpret_vi2_vf_sve_sleef(d), vcast_vi2_i_sve_sleef(0x80000000)), vcast_vi2_i_sve_sleef(0x80000000)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_sve_sleef vsel_vi2_vf_vf_vi2_vi2_sve_sleef(vfloat_sve_sleef f0, vfloat_sve_sleef f1, vint2_sve_sleef x, vint2_sve_sleef y) { + return vsel_vi2_vo_vi2_vi2_sve_sleef(vlt_vo_vf_vf_sve_sleef(f0, f1), x, y); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_sve_sleef vsel_vi2_vf_vi2_sve_sleef(vfloat_sve_sleef d, vint2_sve_sleef x) { + return vand_vi2_vo_vi2_sve_sleef(vsignbit_vo_vf_sve_sleef(d), x); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visint_vo_vf_sve_sleef(vfloat_sve_sleef y) { return veq_vo_vf_vf_sve_sleef(vtruncate_vf_vf_sve_sleef(y), y); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vopmask_sve_sleef visnumber_vo_vf_sve_sleef(vfloat_sve_sleef x) { return vnot_vo32_vo32_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(x))); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_sve_sleef vilogbk_vi2_vf_sve_sleef(vfloat_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(5.421010862427522E-20f)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.8446744073709552E19f), d), d); + vint2_sve_sleef q = vand_vi2_vi2_vi2_sve_sleef(svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(vreinterpret_vi2_vf_sve_sleef(d)), 23)), vcast_vi2_i_sve_sleef(0xff)); + q = vsub_vi2_vi2_vi2_sve_sleef(q, vsel_vi2_vo_vi2_vi2_sve_sleef(o, vcast_vi2_i_sve_sleef(64 + 0x7f), vcast_vi2_i_sve_sleef(0x7f))); + return q; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vint2_sve_sleef vilogb2k_vi2_vf_sve_sleef(vfloat_sve_sleef d) { + vint2_sve_sleef q = vreinterpret_vi2_vf_sve_sleef(d); + q = svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(q), 23)); + q = vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(0xff)); + q = vsub_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(0x7f)); + return q; +} + +SLEEF_INLINE SLEEF_CONST vint2_sve_sleef Sleef_ilogbfx_sve(vfloat_sve_sleef d) { + vint2_sve_sleef e = vilogbk_vi2_vf_sve_sleef(vabs_vf_vf_sve_sleef(d)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.0f)), vcast_vi2_i_sve_sleef(SLEEF_FP_ILOGB0), e); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(visnan_vo_vf_sve_sleef(d), vcast_vi2_i_sve_sleef(SLEEF_FP_ILOGBNAN), e); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(visinf_vo_vf_sve_sleef(d), vcast_vi2_i_sve_sleef(2147483647), e); + return e; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vpow2i_vf_vi2_sve_sleef(vint2_sve_sleef q) { + return vreinterpret_vf_vi2_sve_sleef(svlsl_n_s32_x(svptrue_b8(), vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(0x7f)), 23)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vldexp_vf_vf_vi2_sve_sleef(vfloat_sve_sleef x, vint2_sve_sleef q) { + vfloat_sve_sleef u; + vint2_sve_sleef m = svasr_n_s32_x(svptrue_b8(), q, 31); + m = svlsl_n_s32_x(svptrue_b8(), vsub_vi2_vi2_vi2_sve_sleef(svasr_n_s32_x(svptrue_b8(), vadd_vi2_vi2_vi2_sve_sleef(m, q), 6), m), 4); + q = vsub_vi2_vi2_vi2_sve_sleef(q, svlsl_n_s32_x(svptrue_b8(), m, 2)); + m = vadd_vi2_vi2_vi2_sve_sleef(m, vcast_vi2_i_sve_sleef(0x7f)); + m = vand_vi2_vi2_vi2_sve_sleef(vgt_vi2_vi2_vi2_sve_sleef(m, vcast_vi2_i_sve_sleef(0)), m); + vint2_sve_sleef n = vgt_vi2_vi2_vi2_sve_sleef(m, vcast_vi2_i_sve_sleef(0xff)); + m = vor_vi2_vi2_vi2_sve_sleef(vandnot_vi2_vi2_vi2_sve_sleef(n, m), vand_vi2_vi2_vi2_sve_sleef(n, vcast_vi2_i_sve_sleef(0xff))); + u = vreinterpret_vf_vi2_sve_sleef(svlsl_n_s32_x(svptrue_b8(), m, 23)); + x = vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x, u), u), u), u); + u = vreinterpret_vf_vi2_sve_sleef(svlsl_n_s32_x(svptrue_b8(), vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(0x7f)), 23)); + return vmul_vf_vf_vf_sve_sleef(x, u); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vldexp2_vf_vf_vi2_sve_sleef(vfloat_sve_sleef d, vint2_sve_sleef e) { + return vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vpow2i_vf_vi2_sve_sleef(svasr_n_s32_x(svptrue_b8(), e, 1))), vpow2i_vf_vi2_sve_sleef(vsub_vi2_vi2_vi2_sve_sleef(e, svasr_n_s32_x(svptrue_b8(), e, 1)))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vldexp3_vf_vf_vi2_sve_sleef(vfloat_sve_sleef d, vint2_sve_sleef q) { + return vreinterpret_vf_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(vreinterpret_vi2_vf_sve_sleef(d), svlsl_n_s32_x(svptrue_b8(), q, 23))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_ldexpfx_sve(vfloat_sve_sleef x, vint2_sve_sleef q) { return vldexp_vf_vf_vi2_sve_sleef(x, q); } + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vorsign_vf_vf_vf_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef y) { + return vreinterpret_vf_vm_sve_sleef(vor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(x), vsignbit_vm_vf_sve_sleef(y))); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST fi_t_sve_sleef rempisubf_sve_sleef(vfloat_sve_sleef x) { + + vfloat_sve_sleef y = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(4))); + vint2_sve_sleef vi = vtruncate_vi2_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(y, vmul_vf_vf_vf_sve_sleef(vrint_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(4)))); + return fisetdi_fi_vf_vi2_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, vmul_vf_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0.25))), vi); + +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST dfi_t_sve_sleef rempif_sve_sleef(vfloat_sve_sleef a) { + vfloat2_sve_sleef x, y; + vint2_sve_sleef ex = vilogb2k_vi2_vf_sve_sleef(a); + + ex = vsub_vi2_vi2_vi2_sve_sleef(ex, vcast_vi2_i_sve_sleef(25)); + vint2_sve_sleef q = vand_vi2_vo_vi2_sve_sleef(vgt_vo_vi2_vi2_sve_sleef(ex, vcast_vi2_i_sve_sleef(90-25)), vcast_vi2_i_sve_sleef(-64)); + a = vldexp3_vf_vf_vi2_sve_sleef(a, q); + ex = vandnot_vi2_vi2_vi2_sve_sleef(svasr_n_s32_x(svptrue_b8(), ex, 31), ex); + ex = svlsl_n_s32_x(svptrue_b8(), ex, 2); + x = dfmul_vf2_vf_vf_sve_sleef(a, vgather_vf_p_vi2_sve_sleef(Sleef_rempitabsp, ex)); + fi_t_sve_sleef di = rempisubf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)); + q = figeti_vi2_di_sve_sleef(di); + x = vf2setx_vf2_vf2_vf_sve_sleef(x, figetd_vf_di_sve_sleef(di)); + x = dfnormalize_vf2_vf2_sve_sleef(x); + y = dfmul_vf2_vf_vf_sve_sleef(a, vgather_vf_p_vi2_sve_sleef(Sleef_rempitabsp+1, ex)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(x, y); + di = rempisubf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)); + q = vadd_vi2_vi2_vi2_sve_sleef(q, figeti_vi2_di_sve_sleef(di)); + x = vf2setx_vf2_vf2_vf_sve_sleef(x, figetd_vf_di_sve_sleef(di)); + x = dfnormalize_vf2_vf2_sve_sleef(x); + y = vcast_vf2_vf_vf_sve_sleef(vgather_vf_p_vi2_sve_sleef(Sleef_rempitabsp+2, ex), vgather_vf_p_vi2_sve_sleef(Sleef_rempitabsp+3, ex)); + y = dfmul_vf2_vf2_vf_sve_sleef(y, a); + x = dfadd2_vf2_vf2_vf2_sve_sleef(x, y); + x = dfnormalize_vf2_vf2_sve_sleef(x); + x = dfmul_vf2_vf2_vf2_sve_sleef(x, vcast_vf2_f_f_sve_sleef(3.1415927410125732422f*2, -8.7422776573475857731e-08f*2)); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(a), vcast_vf_f_sve_sleef(0.7f)), vcast_vf2_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), x); + return dfisetdfi_dfi_vf2_vi2_sve_sleef(x, q); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sinfx_u35sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vfloat_sve_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_sve_sleef(q); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(39000)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724))); + u = vcast_vf_vi2_sve_sleef(q); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.140625f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.0009670257568359375f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-6.2771141529083251953e-07f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.2154201256553420762e-10f), d); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(3)); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vsel_vi2_vo_vi2_vi2_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vi2_i_sve_sleef(2), vcast_vi2_i_sve_sleef(1))); + q = svasr_n_s32_x(svptrue_b8(), q, 2); + vopmask_sve_sleef o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)); + vfloat2_sve_sleef x = vcast_vf2_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)))); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef), x); + dfi_sve_sleef = dfisetdf_dfi_dfi_vf2_sve_sleef(dfi_sve_sleef, vsel_vf2_vo_vf2_vf2_sve_sleef(o, x, dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + d = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vf2gety_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + + d = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(r), visnan_vo_vf_sve_sleef(r)), vreinterpret_vm_vf_sve_sleef(d))); + } + + s = vmul_vf_vf_vf_sve_sleef(d, d); + + d = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(d))); + + u = vcast_vf_f_sve_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, d)), d); + + u = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(r), r, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_cosfx_u35sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vfloat_sve_sleef u, s, r = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_sve_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vcast_vi2_i_sve_sleef(1)); + + u = vcast_vf_vi2_sve_sleef(q); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f), d); + } else if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(39000)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724)), vcast_vf_f_sve_sleef(0.5f))); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vcast_vi2_i_sve_sleef(1)); + + u = vcast_vf_vi2_sve_sleef(q); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.140625f*0.5f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.0009670257568359375f*0.5f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-6.2771141529083251953e-07f*0.5f), d); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.2154201256553420762e-10f*0.5f), d); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(3)); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vsel_vi2_vo_vi2_vi2_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vi2_i_sve_sleef(8), vcast_vi2_i_sve_sleef(7))); + q = svasr_n_s32_x(svptrue_b8(), q, 1); + vopmask_sve_sleef o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(0)); + vfloat_sve_sleef y = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(0), vcast_vf_f_sve_sleef(-1)); + vfloat2_sve_sleef x = vcast_vf2_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef), x); + dfi_sve_sleef = dfisetdf_dfi_dfi_vf2_sve_sleef(dfi_sve_sleef, vsel_vf2_vo_vf2_vf2_sve_sleef(o, x, dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + d = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vf2gety_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + + d = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(r), visnan_vo_vf_sve_sleef(r)), vreinterpret_vm_vf_sve_sleef(d))); + } + + s = vmul_vf_vf_vf_sve_sleef(d, d); + + d = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(0)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(d))); + + u = vcast_vf_f_sve_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, d)), d); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_tanfx_u35sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, x; + + x = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f*0.5f)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_sve_sleef(q); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f), x); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f), x); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f), x); + } else if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(39000)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(2 * 0.318309886183790671537767526745028724)))); + u = vcast_vf_vi2_sve_sleef(q); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.140625f*0.5f), x); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.0009670257568359375f*0.5f), x); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-6.2771141529083251953e-07f*0.5f), x); + x = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.2154201256553420762e-10f*0.5f), x); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef); + x = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vf2gety_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + x = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)), vreinterpret_vm_vf_sve_sleef(x))); + x = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), d, x); + } + + s = vmul_vf_vf_vf_sve_sleef(x, x); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)); + x = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(x))); + + vfloat_sve_sleef s2 = vmul_vf_vf_vf_sve_sleef(s, s), s4 = vmul_vf_vf_vf_sve_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_sve_sleef((s4), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.00927245803177356719970703f)), (vcast_vf_f_sve_sleef(0.00331984995864331722259521f)))), (vmla_vf_vf_vf_vf_sve_sleef((s2), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.0242998078465461730957031f)), (vcast_vf_f_sve_sleef(0.0534495301544666290283203f)))), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.133383005857467651367188f)), (vcast_vf_f_sve_sleef(0.333331853151321411132812f))))))) + + ; + + u = vmla_vf_vf_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, x), x); + + u = vsel_vf_vo_vf_vf_sve_sleef(o, vrec_vf_vf_sve_sleef(u), u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sinfx_u10sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vfloat_sve_sleef u, v; + vfloat2_sve_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_sve_sleef(u); + v = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f), d); + s = dfadd2_vf2_vf_vf_sve_sleef(v, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f))); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(3)); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vsel_vi2_vo_vi2_vi2_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vi2_i_sve_sleef(2), vcast_vi2_i_sve_sleef(1))); + q = svasr_n_s32_x(svptrue_b8(), q, 2); + vopmask_sve_sleef o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)); + vfloat2_sve_sleef x = vcast_vf2_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.1415927410125732422f*-0.5), vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)))); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef), x); + dfi_sve_sleef = dfisetdf_dfi_dfi_vf2_sve_sleef(dfi_sve_sleef, vsel_vf2_vo_vf2_vf2_sve_sleef(o, x, dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + s = dfnormalize_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)); + + s = vf2setx_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_sve_sleef(s); + + u = vcast_vf_f_sve_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf2_vf2_sve_sleef(dfadd_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_sve_sleef(t, x); + + u = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(u))); + + u = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_cosfx_u10sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vfloat_sve_sleef u; + vfloat2_sve_sleef s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + vfloat_sve_sleef dq = vmla_vf_vf_vf_vf_sve_sleef(vrint_vf_vf_sve_sleef(vmla_vf_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.318309886183790671537767526745028724), vcast_vf_f_sve_sleef(-0.5f))), + vcast_vf_f_sve_sleef(2), vcast_vf_f_sve_sleef(1)); + q = vrint_vi2_vf_sve_sleef(dq); + s = dfadd2_vf2_vf_vf_sve_sleef (d, vmul_vf_vf_vf_sve_sleef(dq, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f))); + s = dfadd2_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(dq, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd2_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(dq, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(3)); + q = vadd_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, q), vsel_vi2_vo_vi2_vi2_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vi2_i_sve_sleef(8), vcast_vi2_i_sve_sleef(7))); + q = svasr_n_s32_x(svptrue_b8(), q, 1); + vopmask_sve_sleef o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(0)); + vfloat_sve_sleef y = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(0), vcast_vf_f_sve_sleef(-1)); + vfloat2_sve_sleef x = vcast_vf2_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef), x); + dfi_sve_sleef = dfisetdf_dfi_dfi_vf2_sve_sleef(dfi_sve_sleef, vsel_vf2_vo_vf2_vf2_sve_sleef(o, x, dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + s = dfnormalize_vf2_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)); + + s = vf2setx_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s))))); + + } + + t = s; + s = dfsqu_vf2_vf2_sve_sleef(s); + + u = vcast_vf_f_sve_sleef(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf2_vf2_sve_sleef(dfadd_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.166666597127914428710938f), vmul_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s))), s)); + + u = dfmul_vf_vf2_vf2_sve_sleef(t, x); + + u = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(0)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(u))); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fastsinfx_u3500sve(vfloat_sve_sleef d) { + vint2_sve_sleef q; + vfloat_sve_sleef u, s, t = d; + + s = vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724)); + u = vrint_vf_vf_sve_sleef(s); + q = vrint_vi2_vf_sve_sleef(s); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-(float)3.141592653589793238462643383279502884), d); + + s = vmul_vf_vf_vf_sve_sleef(d, d); + + u = vcast_vf_f_sve_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(u))); + + vopmask_sve_sleef g = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(t), vcast_vf_f_sve_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(g)), 1)) return vsel_vf_vo_vf_vf_sve_sleef(g, u, Sleef_sinfx_u35sve(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fastcosfx_u3500sve(vfloat_sve_sleef d) { + vint2_sve_sleef q; + vfloat_sve_sleef u, s, t = d; + + s = vmla_vf_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.318309886183790671537767526745028724), vcast_vf_f_sve_sleef(-0.5f)); + u = vrint_vf_vf_sve_sleef(s); + q = vrint_vi2_vf_sve_sleef(s); + d = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-(float)3.141592653589793238462643383279502884), vsub_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)3.141592653589793238462643383279502884 * 0.5f))); + + s = vmul_vf_vf_vf_sve_sleef(d, d); + + u = vcast_vf_f_sve_sleef(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, d), u, d); + + u = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(0)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(u))); + + vopmask_sve_sleef g = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(t), vcast_vf_f_sve_sleef(30.0f)); + if (!__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(g)), 1)) return vsel_vf_vo_vf_vf_sve_sleef(g, u, Sleef_cosfx_u35sve(t)); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_sve_sleef Sleef_sincosfx_u35sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, t, rx, ry; + vfloat2_sve_sleef r; + + s = d; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_sve_sleef(q); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f), s); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f), s); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f), s); + } else if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(39000)))), 1)) { + q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)0.636619772367581343075535053490057448))); + u = vcast_vf_vi2_sve_sleef(q); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.140625f*0.5f), s); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.0009670257568359375f*0.5f), s); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-6.2771141529083251953e-07f*0.5f), s); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.2154201256553420762e-10f*0.5f), s); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef); + s = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef)), vf2gety_vf_vf2_sve_sleef(dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef))); + s = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)), vreinterpret_vm_vf_sve_sleef(s))); + } + + t = s; + + s = vmul_vf_vf_vf_sve_sleef(s, s); + + u = vcast_vf_f_sve_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.166666537523269653320312f)); + + rx = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(u, s), t, t); + rx = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(-0.0f), rx); + + u = vcast_vf_f_sve_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.5)); + + ry = vmla_vf_vf_vf_vf_sve_sleef(s, u, vcast_vf_f_sve_sleef(1)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(0)); + r = vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(o, rx, ry), vsel_vf_vo_vf_vf_sve_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_sve_sleef Sleef_sincosfx_u10sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vopmask_sve_sleef o; + vfloat_sve_sleef u, v, rx, ry; + vfloat2_sve_sleef r, s, t, x; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_sve_sleef(u); + v = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_sve_sleef(v, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef); + s = dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef); + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)); + s = vf2setx_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s))))); + } + + t = s; + + s = vf2setx_vf2_vf2_vf_sve_sleef(s, dfsqu_vf_vf2_sve_sleef(s)); + + u = vcast_vf_f_sve_sleef(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-0.166666537523269653320312f)); + + u = vmul_vf_vf_vf_sve_sleef(u, vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), vf2getx_vf_vf2_sve_sleef(t))); + + x = dfadd_vf2_vf2_vf_sve_sleef(t, u); + rx = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + rx = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(-0.0f), rx); + + u = vcast_vf_f_sve_sleef(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-0.5)); + + x = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), u)); + ry = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(0)); + r = vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(o, rx, ry), vsel_vf_vo_vf_vf_sve_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + return r; + +} + +SLEEF_INLINE SLEEF_CONST vfloat2_sve_sleef Sleef_sincospifx_u05sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, t, rx, ry; + vfloat2_sve_sleef r, x, s2; + + u = vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(4)); + vint2_sve_sleef q = vtruncate_vi2_vf_sve_sleef(u); + q = vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vxor_vi2_vi2_vi2_sve_sleef(svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(q), 31)), vcast_vi2_i_sve_sleef(1))), vcast_vi2_i_sve_sleef(~1)); + s = vsub_vf_vf_vf_sve_sleef(u, vcast_vf_vi2_sve_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_sve_sleef(s, s); + s2 = dfmul_vf2_vf_vf_sve_sleef(t, t); + + u = vcast_vf_f_sve_sleef(+0.3093842054e-6); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.3657307388e-4)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2490393585e-2)); + x = dfadd2_vf2_vf_vf2_sve_sleef(vmul_vf_vf_vf_sve_sleef(u, s), vcast_vf2_f_f_sve_sleef(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(s2, x), vcast_vf2_f_f_sve_sleef(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf_sve_sleef(x, t); + rx = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + rx = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(-0.0f), rx); + + u = vcast_vf_f_sve_sleef(-0.2430611801e-7); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.3590577080e-5)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.3259917721e-3)); + x = dfadd2_vf2_vf_vf2_sve_sleef(vmul_vf_vf_vf_sve_sleef(u, s), vcast_vf2_f_f_sve_sleef(0.015854343771934509277, 4.4940051354032242811e-10)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(s2, x), vcast_vf2_f_f_sve_sleef(-0.30842512845993041992, -9.0728339030733922277e-09)); + + x = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(x, s2), vcast_vf_f_sve_sleef(1)); + ry = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(0)); + r = vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(o, rx, ry), vsel_vf_vo_vf_vf_sve_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + o = vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + o = visinf_vo_vf_sve_sleef(d); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat2_sve_sleef Sleef_sincospifx_u35sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, t, rx, ry; + vfloat2_sve_sleef r; + + u = vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(4)); + vint2_sve_sleef q = vtruncate_vi2_vf_sve_sleef(u); + q = vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vxor_vi2_vi2_vi2_sve_sleef(svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(q), 31)), vcast_vi2_i_sve_sleef(1))), vcast_vi2_i_sve_sleef(~1)); + s = vsub_vf_vf_vf_sve_sleef(u, vcast_vf_vi2_sve_sleef(q)); + + t = s; + s = vmul_vf_vf_vf_sve_sleef(s, s); + + u = vcast_vf_f_sve_sleef(-0.3600925265e-4); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2490088111e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.8074551076e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.7853981853e+0)); + + rx = vmul_vf_vf_vf_sve_sleef(u, t); + + u = vcast_vf_f_sve_sleef(+0.3539815225e-5); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.3259574005e-3)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1585431583e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(-0.3084251285e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(1)); + + ry = u; + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(0)); + r = vf2setxy_vf2_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(o, rx, ry), vsel_vf_vo_vf_vf_sve_sleef(o, ry, rx)); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + o = vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1e+7f)); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + o = visinf_vo_vf_sve_sleef(d); + r = vf2setx_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r))))); + r = vf2sety_vf2_vf2_vf_sve_sleef(r, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(r))))); + + return r; +} + +SLEEF_INLINE vfloat2_sve_sleef Sleef_modffx_sve(vfloat_sve_sleef x) { + vfloat_sve_sleef fr = vsub_vf_vf_vf_sve_sleef(x, vcast_vf_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(x))); + fr = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(INT64_C(1) << 23)), vcast_vf_f_sve_sleef(0), fr); + + vfloat2_sve_sleef ret; + + ret = vf2setxy_vf2_vf_vf_sve_sleef(vcopysign_vf_vf_vf_sve_sleef(fr, x), vcopysign_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, fr), x)); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_tanfx_u10sve(vfloat_sve_sleef d) { + + vint2_sve_sleef q; + vfloat_sve_sleef u, v; + vfloat2_sve_sleef s, t, x; + vopmask_sve_sleef o; + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(125.0f)))), 1)) { + u = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(2 * 0.318309886183790671537767526745028724))); + q = vrint_vi2_vf_sve_sleef(u); + v = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-3.1414794921875f*0.5f), d); + s = dfadd2_vf2_vf_vf_sve_sleef(v, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.00011315941810607910156f*0.5f))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-1.9841872589410058936e-09f*0.5f))); + } else { + dfi_t_sve_sleef dfi_sve_sleef = rempif_sve_sleef(d); + q = dfigeti_vi2_dfi_sve_sleef(dfi_sve_sleef); + s = dfigetdf_vf2_dfi_sve_sleef(dfi_sve_sleef); + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), visnan_vo_vf_sve_sleef(d)); + s = vf2setx_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s))))); + s = vf2sety_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(s))))); + } + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)); + vmask_sve_sleef n = vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))); + + s = vf2setx_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s)), n))); + s = vf2sety_vf2_vf2_vf_sve_sleef(s, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(s)), n))); + + t = s; + s = dfsqu_vf2_vf2_sve_sleef(s); + s = dfnormalize_vf2_vf2_sve_sleef(s); + + u = vcast_vf_f_sve_sleef(0.00446636462584137916564941f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(-8.3920182078145444393158e-05f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.0109639242291450500488281f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.0212360303848981857299805f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.0540687143802642822265625f)); + + x = dfadd_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.133325666189193725585938f), vmul_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s))); + x = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf2_vf2_sve_sleef(dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(0.33333361148834228515625f), dfmul_vf2_vf2_vf2_sve_sleef(s, x)), s)); + x = dfmul_vf2_vf2_vf2_sve_sleef(t, x); + + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfrec_vf2_vf2_sve_sleef(x), x); + + u = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + u = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), d, u); + + return u; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_atanfx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef s, t, u; + vint2_sve_sleef q; + + q = vsel_vi2_vf_vi2_sve_sleef(d, vcast_vi2_i_sve_sleef(2)); + s = vabs_vf_vf_sve_sleef(d); + + q = vsel_vi2_vf_vf_vi2_vi2_sve_sleef(vcast_vf_f_sve_sleef(1.0f), s, vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), q); + s = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f), s), vrec_vf_vf_sve_sleef(s), s); + + t = vmul_vf_vf_vf_sve_sleef(s, s); + + vfloat_sve_sleef t2 = vmul_vf_vf_vf_sve_sleef(t, t), t4 = vmul_vf_vf_vf_sve_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_sve_sleef((t4), (vmla_vf_vf_vf_vf_sve_sleef((t2), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.00282363896258175373077393f)), (vcast_vf_f_sve_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.0425049886107444763183594f)), (vcast_vf_f_sve_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_sve_sleef((t2), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.106347933411598205566406f)), (vcast_vf_f_sve_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.199926957488059997558594f)), (vcast_vf_f_sve_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(t, u), s); + + t = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/2)), t), t); + + t = vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0f))), vreinterpret_vm_vf_sve_sleef(t))); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef atan2kf_sve_sleef(vfloat_sve_sleef y, vfloat_sve_sleef x) { + vfloat_sve_sleef s, t, u; + vint2_sve_sleef q; + vopmask_sve_sleef p; + + q = vsel_vi2_vf_vi2_sve_sleef(x, vcast_vi2_i_sve_sleef(-2)); + x = vabs_vf_vf_sve_sleef(x); + + q = vsel_vi2_vf_vf_vi2_vi2_sve_sleef(x, y, vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), q); + p = vlt_vo_vf_vf_sve_sleef(x, y); + s = vsel_vf_vo_vf_vf_sve_sleef(p, vneg_vf_vf_sve_sleef(x), y); + t = vmax_vf_vf_vf_sve_sleef(x, y); + + s = vdiv_vf_vf_vf_sve_sleef(s, t); + t = vmul_vf_vf_vf_sve_sleef(s, s); + + vfloat_sve_sleef t2 = vmul_vf_vf_vf_sve_sleef(t, t), t4 = vmul_vf_vf_vf_sve_sleef(t2, t2); + u = vmla_vf_vf_vf_vf_sve_sleef((t4), (vmla_vf_vf_vf_vf_sve_sleef((t2), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.00282363896258175373077393f)), (vcast_vf_f_sve_sleef(-0.0159569028764963150024414f)))), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.0425049886107444763183594f)), (vcast_vf_f_sve_sleef(-0.0748900920152664184570312f)))))), (vmla_vf_vf_vf_vf_sve_sleef((t2), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.106347933411598205566406f)), (vcast_vf_f_sve_sleef(-0.142027363181114196777344f)))), (vmla_vf_vf_vf_vf_sve_sleef((t), (vcast_vf_f_sve_sleef(0.199926957488059997558594f)), (vcast_vf_f_sve_sleef(-0.333331018686294555664062f))))))) + + ; + + t = vmla_vf_vf_vf_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(t, u), s); + t = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/2)), t); + + return t; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef visinf2_vf_vf_vf_sve_sleef(vfloat_sve_sleef d, vfloat_sve_sleef m) { + return vreinterpret_vf_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(visinf_vo_vf_sve_sleef(d), vor_vm_vm_vm_sve_sleef(vsignbit_vm_vf_sve_sleef(d), vreinterpret_vm_vf_sve_sleef(m)))); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_atan2fx_u35sve(vfloat_sve_sleef y, vfloat_sve_sleef x) { + vfloat_sve_sleef r = atan2kf_sve_sleef(vabs_vf_vf_sve_sleef(y), x); + + r = vmulsign_vf_vf_vf_sve_sleef(r, x); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0.0f))), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_sve_sleef(x, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/2)), x))), r); + r = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(y), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/2)), visinf2_vf_vf_vf_sve_sleef(x, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef((float)(3.141592653589793238462643383279502884/4)), x))), r); + + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0.0f)), vreinterpret_vf_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(vsignbit_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vreinterpret_vm_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_asinfx_u35sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0.5f)); + vfloat_sve_sleef x2 = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, d), vmul_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vabs_vf_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5f))); + vfloat_sve_sleef x = vsel_vf_vo_vf_vf_sve_sleef(o, vabs_vf_vf_sve_sleef(d), vsqrt_vf_vf_sve_sleef(x2)), u; + + u = vcast_vf_f_sve_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.1666677296e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vmul_vf_vf_vf_sve_sleef(x, x2), x); + + vfloat_sve_sleef r = vsel_vf_vo_vf_vf_sve_sleef(o, u, vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-2), vcast_vf_f_sve_sleef(((float)3.141592653589793238462643383279502884)/2))); + return vmulsign_vf_vf_vf_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_acosfx_u35sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0.5f)); + vfloat_sve_sleef x2 = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, d), + vmul_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vabs_vf_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5f))), u; + vfloat_sve_sleef x = vsel_vf_vo_vf_vf_sve_sleef(o, vabs_vf_vf_sve_sleef(d), vsqrt_vf_vf_sve_sleef(x2)); + x = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1.0f)), vcast_vf_f_sve_sleef(0), x); + + u = vcast_vf_f_sve_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_sve_sleef(u, vmul_vf_vf_vf_sve_sleef(x2, x)); + + vfloat_sve_sleef y = vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.1415926535897932f/2), vadd_vf_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(x, d), vmulsign_vf_vf_vf_sve_sleef(u, d))); + x = vadd_vf_vf_vf_sve_sleef(x, u); + vfloat_sve_sleef r = vsel_vf_vo_vf_vf_sve_sleef(o, y, vmul_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + return vsel_vf_vo_vf_vf_sve_sleef(vandnot_vo_vo_vo_sve_sleef(o, vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0))), + vf2getx_vf_vf2_sve_sleef(dfadd_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(3.1415927410125732422f,-8.7422776573475857731e-08f), + vneg_vf_vf_sve_sleef(r))), r); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef atan2kf_u1_sve_sleef(vfloat2_sve_sleef y, vfloat2_sve_sleef x) { + vfloat_sve_sleef u; + vfloat2_sve_sleef s, t; + vint2_sve_sleef q; + vopmask_sve_sleef p; + vmask_sve_sleef r; + + q = vsel_vi2_vf_vf_vi2_vi2_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vcast_vf_f_sve_sleef(0), vcast_vi2_i_sve_sleef(-2), vcast_vi2_i_sve_sleef(0)); + p = vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vcast_vf_f_sve_sleef(0)); + r = vand_vm_vo32_vm_sve_sleef(p, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))); + x = vf2setx_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)), r))); + x = vf2sety_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x)), r))); + + q = vsel_vi2_vf_vf_vi2_vi2_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y), vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(1)), q); + p = vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(y)); + s = vsel_vf2_vo_vf2_vf2_sve_sleef(p, dfneg_vf2_vf2_sve_sleef(x), y); + t = vsel_vf2_vo_vf2_vf2_sve_sleef(p, y, x); + + s = dfdiv_vf2_vf2_vf2_sve_sleef(s, t); + t = dfsqu_vf2_vf2_sve_sleef(s); + t = dfnormalize_vf2_vf2_sve_sleef(t); + + u = vcast_vf_f_sve_sleef(-0.00176397908944636583328247f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(0.0107900900766253471374512f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(-0.0309564601629972457885742f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(0.0577365085482597351074219f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(-0.0838950723409652709960938f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(0.109463557600975036621094f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(-0.142626821994781494140625f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(0.199983194470405578613281f)); + + t = dfmul_vf2_vf2_vf2_sve_sleef(t, dfadd_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.333332866430282592773438f), vmul_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(t)))); + t = dfmul_vf2_vf2_vf2_sve_sleef(s, dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), t)); + t = dfadd_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(1.5707963705062866211f, -4.3711388286737928865e-08f), vcast_vf_vi2_sve_sleef(q)), t); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_atan2fx_u10sve(vfloat_sve_sleef y, vfloat_sve_sleef x) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(2.9387372783541830947e-39f)); + x = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1 << 24)), x); + y = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(1 << 24)), y); + + vfloat2_sve_sleef d = atan2kf_u1_sve_sleef(vcast_vf2_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(y), vcast_vf_f_sve_sleef(0)), vcast_vf2_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0))); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)); + + r = vmulsign_vf_vf_vf_sve_sleef(r, x); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0))), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_sve_sleef(x, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.141592653589793238462643383279502884/2), x))), r); + r = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(y), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.141592653589793238462643383279502884/2), visinf2_vf_vf_vf_sve_sleef(x, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3.141592653589793238462643383279502884/4), x))), r); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0.0f)), vreinterpret_vf_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(vsignbit_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef((float)3.141592653589793238462643383279502884)))), r); + + r = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vreinterpret_vm_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(r, y)))); + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_asinfx_u10sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0.5f)); + vfloat_sve_sleef x2 = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, d), vmul_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vabs_vf_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5f))), u; + vfloat2_sve_sleef x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, vcast_vf2_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0)), dfsqrt_vf2_vf_sve_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(veq_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1.0f)), vcast_vf2_f_f_sve_sleef(0, 0), x); + + u = vcast_vf_f_sve_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_sve_sleef(u, vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x))); + + vfloat2_sve_sleef y = dfsub_vf2_vf2_vf_sve_sleef(dfsub_vf2_vf2_vf2_sve_sleef(vcast_vf2_f_f_sve_sleef(3.1415927410125732422f/4,-8.7422776573475857731e-08f/4), x), u); + + vfloat_sve_sleef r = vsel_vf_vo_vf_vf_sve_sleef(o, vadd_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(x)), + vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(y)), vcast_vf_f_sve_sleef(2))); + return vmulsign_vf_vf_vf_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_acosfx_u10sve(vfloat_sve_sleef d) { + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0.5f)); + vfloat_sve_sleef x2 = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, d), vmul_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vabs_vf_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5f))), u; + vfloat2_sve_sleef x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, vcast_vf2_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0)), dfsqrt_vf2_vf_sve_sleef(x2)); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(veq_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1.0f)), vcast_vf2_f_f_sve_sleef(0, 0), x); + + u = vcast_vf_f_sve_sleef(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, x2, vcast_vf_f_sve_sleef(+0.1666677296e+0)); + u = vmul_vf_vf_vf_sve_sleef(u, vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x))); + + vfloat2_sve_sleef y = dfsub_vf2_vf2_vf2_sve_sleef(vcast_vf2_f_f_sve_sleef(3.1415927410125732422f/2, -8.7422776573475857731e-08f/2), + dfadd_vf2_vf_vf_sve_sleef(vmulsign_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), d), vmulsign_vf_vf_vf_sve_sleef(u, d))); + x = dfadd_vf2_vf2_vf_sve_sleef(x, u); + + y = vsel_vf2_vo_vf2_vf2_sve_sleef(o, y, dfscale_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + + y = vsel_vf2_vo_vf2_vf2_sve_sleef(vandnot_vo_vo_vo_sve_sleef(o, vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0))), + dfsub_vf2_vf2_vf2_sve_sleef(vcast_vf2_f_f_sve_sleef(3.1415927410125732422f, -8.7422776573475857731e-08f), y), y); + + return vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(y)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_atanfx_u10sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef d2 = atan2kf_u1_sve_sleef(vcast_vf2_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(0)), vcast_vf2_f_f_sve_sleef(1, 0)); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d2), vf2gety_vf_vf2_sve_sleef(d2)); + r = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(1.570796326794896557998982), r); + return vmulsign_vf_vf_vf_sve_sleef(r, d); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_logfx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef x, x2, t, m; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = vdiv_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(m, vcast_vf_f_sve_sleef(1.0f)), vadd_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_sve_sleef(x, x); + + t = vcast_vf_f_sve_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_sve_sleef(x, t, vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.693147180559945286226764f), vcast_vf_vi2_sve_sleef(e))); + x = vsel_vf_vo_vf_vf_sve_sleef(vispinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), visnan_vo_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(__builtin_nanf("")), x); + x = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(-__builtin_inff()), x); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_expfx_u10sve(vfloat_sve_sleef d) { + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_sve_sleef s, u; + + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_sve_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.5)); + + u = vadd_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f), vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, s), u, s)); + + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-104)), vreinterpret_vm_vf_sve_sleef(u))); + u = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(100), d), vcast_vf_f_sve_sleef(__builtin_inff()), u); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef expm1fk_sve_sleef(vfloat_sve_sleef d) { + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_sve_sleef s, u; + + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-1.428606765330187045e-06f), s); + + vfloat_sve_sleef s2 = vmul_vf_vf_vf_sve_sleef(s, s), s4 = vmul_vf_vf_vf_sve_sleef(s2, s2); + u = vmla_vf_vf_vf_vf_sve_sleef((s4), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.000198527617612853646278381)), (vcast_vf_f_sve_sleef(0.00139304355252534151077271)))), (vmla_vf_vf_vf_vf_sve_sleef((s2), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.00833336077630519866943359)), (vcast_vf_f_sve_sleef(0.0416664853692054748535156)))), (vmla_vf_vf_vf_vf_sve_sleef((s), (vcast_vf_f_sve_sleef(0.166666671633720397949219)), (vcast_vf_f_sve_sleef(0.5))))))) + + ; + + u = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, s), u, s); + + u = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(0)), u, + vsub_vf_vf_vf_sve_sleef(vldexp2_vf_vf_vi2_sve_sleef(vadd_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(1)), q), vcast_vf_f_sve_sleef(1))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sqrtfx_u35sve(vfloat_sve_sleef d) { return vsqrt_vf_vf_sve_sleef(d); } + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_cbrtfx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef x, y, q = vcast_vf_f_sve_sleef(1.0), t; + vint2_sve_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_sve_sleef(vilogbk_vi2_vf_sve_sleef(vabs_vf_vf_sve_sleef(d)), vcast_vi2_i_sve_sleef(1)); + d = vldexp2_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + + t = vadd_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(e), vcast_vf_f_sve_sleef(6144)); + qu = vtruncate_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(t, vcast_vf_f_sve_sleef(1.0f/3.0f))); + re = vtruncate_vi2_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(t, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(qu), vcast_vf_f_sve_sleef(3)))); + + q = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vi2_vi2_sve_sleef(re, vcast_vi2_i_sve_sleef(1)), vcast_vf_f_sve_sleef(1.2599210498948731647672106f), q); + q = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vi2_vi2_sve_sleef(re, vcast_vi2_i_sve_sleef(2)), vcast_vf_f_sve_sleef(1.5874010519681994747517056f), q); + q = vldexp2_vf_vf_vi2_sve_sleef(q, vsub_vi2_vi2_vi2_sve_sleef(qu, vcast_vi2_i_sve_sleef(2048))); + + q = vmulsign_vf_vf_vf_sve_sleef(q, d); + d = vabs_vf_vf_sve_sleef(d); + + x = vcast_vf_f_sve_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, x), x); + y = vmul_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(y, vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2.0f / 3.0f), y), vmla_vf_vf_vf_vf_sve_sleef(y, x, vcast_vf_f_sve_sleef(-1.0f)))), q); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_cbrtfx_u10sve(vfloat_sve_sleef d) { + vfloat_sve_sleef x, y, z, t; + vfloat2_sve_sleef q2 = vcast_vf2_f_f_sve_sleef(1, 0), u, v; + vint2_sve_sleef e, qu, re; + + e = vadd_vi2_vi2_vi2_sve_sleef(vilogbk_vi2_vf_sve_sleef(vabs_vf_vf_sve_sleef(d)), vcast_vi2_i_sve_sleef(1)); + d = vldexp2_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + + t = vadd_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(e), vcast_vf_f_sve_sleef(6144)); + qu = vtruncate_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(t, vcast_vf_f_sve_sleef(1.0/3.0))); + re = vtruncate_vi2_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(t, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(qu), vcast_vf_f_sve_sleef(3)))); + + q2 = vsel_vf2_vo_vf2_vf2_sve_sleef(veq_vo_vi2_vi2_sve_sleef(re, vcast_vi2_i_sve_sleef(1)), vcast_vf2_f_f_sve_sleef(1.2599210739135742188f, -2.4018701694217270415e-08), q2); + q2 = vsel_vf2_vo_vf2_vf2_sve_sleef(veq_vo_vi2_vi2_sve_sleef(re, vcast_vi2_i_sve_sleef(2)), vcast_vf2_f_f_sve_sleef(1.5874010324478149414f, 1.9520385308169352356e-08), q2); + + q2 = vf2setx_vf2_vf2_vf_sve_sleef(q2, vmulsign_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(q2), d)); + q2 = vf2sety_vf2_vf2_vf_sve_sleef(q2, vmulsign_vf_vf_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(q2), d)); + d = vabs_vf_vf_sve_sleef(d); + + x = vcast_vf_f_sve_sleef(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf_sve_sleef(x, d, vcast_vf_f_sve_sleef(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf_sve_sleef(x, x); y = vmul_vf_vf_vf_sve_sleef(y, y); x = vsub_vf_vf_vf_sve_sleef(x, vmul_vf_vf_vf_sve_sleef(vmlanp_vf_vf_vf_vf_sve_sleef(d, y, x), vcast_vf_f_sve_sleef(-1.0 / 3.0))); + + z = x; + + u = dfmul_vf2_vf_vf_sve_sleef(x, x); + u = dfmul_vf2_vf2_vf2_sve_sleef(u, u); + u = dfmul_vf2_vf2_vf_sve_sleef(u, d); + u = dfadd2_vf2_vf2_vf_sve_sleef(u, vneg_vf_vf_sve_sleef(x)); + y = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(u), vf2gety_vf_vf2_sve_sleef(u)); + + y = vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-2.0 / 3.0), y), z); + v = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf_vf_sve_sleef(z, z), y); + v = dfmul_vf2_vf2_vf_sve_sleef(v, d); + v = dfmul_vf2_vf2_vf2_sve_sleef(v, q2); + z = vldexp2_vf_vf_vi2_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(v), vf2gety_vf_vf2_sve_sleef(v)), vsub_vi2_vi2_vi2_sve_sleef(qu, vcast_vi2_i_sve_sleef(2048))); + + z = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(d), vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(__builtin_inff()), vf2getx_vf_vf2_sve_sleef(q2)), z); + z = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vreinterpret_vf_vm_sve_sleef(vsignbit_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(q2))), z); + + return z; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef logkf_sve_sleef(vfloat_sve_sleef d) { + vfloat2_sve_sleef x, x2; + vfloat_sve_sleef t, m; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), m), dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), m)); + x2 = dfsqu_vf2_vf2_sve_sleef(x); + + t = vcast_vf_f_sve_sleef(0.240320354700088500976562); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(x2), vcast_vf_f_sve_sleef(0.285112679004669189453125)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(x2), vcast_vf_f_sve_sleef(0.400007992982864379882812)); + vfloat2_sve_sleef c = vcast_vf2_f_f_sve_sleef(0.66666662693023681640625f, 3.69183861259614332084311e-09f); + + vfloat2_sve_sleef s = dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_sve_sleef(e)); + + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfscale_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfmul_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(x2, x), + dfadd2_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(x2, t), c))); + return s; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef logk3f_sve_sleef(vfloat_sve_sleef d) { + vfloat_sve_sleef x, x2, t, m; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = vdiv_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(m, vcast_vf_f_sve_sleef(1.0f)), vadd_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f), m)); + x2 = vmul_vf_vf_vf_sve_sleef(x, x); + + t = vcast_vf_f_sve_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(2.0f)); + + x = vmla_vf_vf_vf_vf_sve_sleef(x, t, vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.693147180559945286226764f), vcast_vf_vi2_sve_sleef(e))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_logfx_u10sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x; + vfloat_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + vfloat2_sve_sleef s = dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_sve_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), m), dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), m)); + x2 = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)); + + t = vcast_vf_f_sve_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfscale_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x)), t)); + + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), vf2gety_vf_vf2_sve_sleef(s)); + + r = vsel_vf_vo_vf_vf_sve_sleef(vispinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), visnan_vo_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(__builtin_nanf("")), r); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(-__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef expkf_sve_sleef(vfloat2_sve_sleef d) { + vfloat_sve_sleef u = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)), vcast_vf_f_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + vfloat2_sve_sleef s, t; + + s = dfadd2_vf2_vf2_vf_sve_sleef(d, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-1.428606765330187045e-06f))); + + s = dfnormalize_vf2_vf2_sve_sleef(s); + + u = vcast_vf_f_sve_sleef(0.00136324646882712841033936f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.00836596917361021041870117f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.0416710823774337768554688f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.166665524244308471679688f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(0.499999850988388061523438f)); + + t = dfadd_vf2_vf2_vf2_sve_sleef(s, dfmul_vf2_vf2_vf_sve_sleef(dfsqu_vf2_vf2_sve_sleef(s), u)); + + t = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), t); + u = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t), vf2gety_vf_vf2_sve_sleef(t)); + u = vldexp_vf_vf_vi2_sve_sleef(u, q); + + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vcast_vf_f_sve_sleef(-104)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef expk3f_sve_sleef(vfloat_sve_sleef d) { + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f))); + vfloat_sve_sleef s, u; + + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-0.693145751953125f), d); + s = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-1.428606765330187045e-06f), s); + + u = vcast_vf_f_sve_sleef(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(0.5)); + + u = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(s, s), u, vadd_vf_vf_vf_sve_sleef(s, vcast_vf_f_sve_sleef(1.0f))); + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-104)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_powfx_u10sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + + vopmask_sve_sleef yisint = vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(vtruncate_vf_vf_sve_sleef(y), y), vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(y), vcast_vf_f_sve_sleef(1 << 24))); + vopmask_sve_sleef yisodd = vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(y), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), yisint), + vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(y), vcast_vf_f_sve_sleef(1 << 24))); + + vfloat_sve_sleef result = expkf_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(logkf_sve_sleef(vabs_vf_vf_sve_sleef(x)), y)); + + result = vsel_vf_vo_vf_vf_sve_sleef(visnan_vo_vf_sve_sleef(result), vcast_vf_f_sve_sleef(__builtin_inff()), result); + + result = vmul_vf_vf_vf_sve_sleef(result, + vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), + vcast_vf_f_sve_sleef(1), + vsel_vf_vo_vf_vf_sve_sleef(yisint, vsel_vf_vo_vf_vf_sve_sleef(yisodd, vcast_vf_f_sve_sleef(-1.0f), vcast_vf_f_sve_sleef(1)), vcast_vf_f_sve_sleef(__builtin_nanf(""))))); + + vfloat_sve_sleef efx = vmulsign_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(1)), y); + + result = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(y), + vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(efx, vcast_vf_f_sve_sleef(0.0f)), + vreinterpret_vm_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(efx, vcast_vf_f_sve_sleef(0.0f)), + vcast_vf_f_sve_sleef(1.0f), + vcast_vf_f_sve_sleef(__builtin_inff()))))), + result); + + result = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0.0))), + vmulsign_vf_vf_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(vxor_vo_vo_vo_sve_sleef(vsignbit_vo_vf_sve_sleef(y), veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0.0f))), + vcast_vf_f_sve_sleef(0), vcast_vf_f_sve_sleef(__builtin_inff())), + vsel_vf_vo_vf_vf_sve_sleef(yisodd, x, vcast_vf_f_sve_sleef(1))), result); + + result = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vreinterpret_vm_vf_sve_sleef(result))); + + result = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0)), veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1))), vcast_vf_f_sve_sleef(1), result); + + return result; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fastpowfx_u3500sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef result = expk3f_sve_sleef(vmul_vf_vf_vf_sve_sleef(logk3f_sve_sleef(vabs_vf_vf_sve_sleef(x)), y)); + vopmask_sve_sleef yisint = vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(vtruncate_vf_vf_sve_sleef(y), y), vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(y), vcast_vf_f_sve_sleef(1 << 24))); + vopmask_sve_sleef yisodd = vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(y), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), yisint), + vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(y), vcast_vf_f_sve_sleef(1 << 24))); + + result = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(vsignbit_vo_vf_sve_sleef(x), yisodd), vneg_vf_vf_sve_sleef(result), result); + + result = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(0), result); + result = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(1), result); + + return result; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef expk2f_sve_sleef(vfloat2_sve_sleef d) { + vfloat_sve_sleef u = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)), vcast_vf_f_sve_sleef(1.442695040888963407359924681001892137426645954152985934135449406931f)); + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + vfloat2_sve_sleef s, t; + + s = dfadd2_vf2_vf2_vf_sve_sleef(d, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-0.693145751953125f))); + s = dfadd2_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vcast_vf_vi2_sve_sleef(q), vcast_vf_f_sve_sleef(-1.428606765330187045e-06f))); + + u = vcast_vf_f_sve_sleef(+0.1980960224e-3f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(+0.1394256484e-2f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(+0.8333456703e-2f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, vf2getx_vf_vf2_sve_sleef(s), vcast_vf_f_sve_sleef(+0.4166637361e-1f)); + + t = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(s, u), vcast_vf_f_sve_sleef(+0.166666659414234244790680580464e+0f)); + t = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(s, t), vcast_vf_f_sve_sleef(0.5)); + t = dfadd2_vf2_vf2_vf2_sve_sleef(s, dfmul_vf2_vf2_vf2_sve_sleef(dfsqu_vf2_vf2_sve_sleef(s), t)); + + t = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), t); + + t = vf2setx_vf2_vf2_vf_sve_sleef(t, vldexp2_vf_vf_vi2_sve_sleef(vf2getx_vf_vf2_sve_sleef(t), q)); + t = vf2sety_vf2_vf2_vf_sve_sleef(t, vldexp2_vf_vf_vi2_sve_sleef(vf2gety_vf_vf2_sve_sleef(t), q)); + + t = vf2setx_vf2_vf2_vf_sve_sleef(t, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vcast_vf_f_sve_sleef(-104)), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t))))); + t = vf2sety_vf2_vf2_vf_sve_sleef(t, vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vcast_vf_f_sve_sleef(-104)), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(t))))); + + return t; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sinhfx_u10sve(vfloat_sve_sleef x) { + vfloat_sve_sleef y = vabs_vf_vf_sve_sleef(x); + vfloat2_sve_sleef d = expk2f_sve_sleef(vcast_vf2_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0))); + d = dfsub_vf2_vf2_vf2_sve_sleef(d, dfrec_vf2_vf2_sve_sleef(d)); + y = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(89)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_sve_sleef(y, x); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_coshfx_u10sve(vfloat_sve_sleef x) { + vfloat_sve_sleef y = vabs_vf_vf_sve_sleef(x); + vfloat2_sve_sleef d = expk2f_sve_sleef(vcast_vf2_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0))); + d = dfadd_vf2_vf2_vf2_sve_sleef(d, dfrec_vf2_vf2_sve_sleef(d)); + y = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(89)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_tanhfx_u10sve(vfloat_sve_sleef x) { + vfloat_sve_sleef y = vabs_vf_vf_sve_sleef(x); + vfloat2_sve_sleef d = expk2f_sve_sleef(vcast_vf2_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0))); + vfloat2_sve_sleef e = dfrec_vf2_vf2_sve_sleef(d); + d = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd_vf2_vf2_vf2_sve_sleef(d, dfneg_vf2_vf2_sve_sleef(e)), dfadd_vf2_vf2_vf2_sve_sleef(d, e)); + y = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(8.664339742f)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_sve_sleef(y, x); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sinhfx_u35sve(vfloat_sve_sleef x) { + vfloat_sve_sleef e = expm1fk_sve_sleef(vabs_vf_vf_sve_sleef(x)); + vfloat_sve_sleef y = vdiv_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(e, vcast_vf_f_sve_sleef(2)), vadd_vf_vf_vf_sve_sleef(e, vcast_vf_f_sve_sleef(1))); + y = vmul_vf_vf_vf_sve_sleef(y, vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5f), e)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(88)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_inff()), y); + y = vmulsign_vf_vf_vf_sve_sleef(y, x); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_coshfx_u35sve(vfloat_sve_sleef x) { + vfloat_sve_sleef e = Sleef_expfx_u10sve(vabs_vf_vf_sve_sleef(x)); + vfloat_sve_sleef y = vmla_vf_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5f), e, vdiv_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5), e)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(88)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_inff()), y); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_tanhfx_u35sve(vfloat_sve_sleef x) { + vfloat_sve_sleef d = expm1fk_sve_sleef(vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2), vabs_vf_vf_sve_sleef(x))); + vfloat_sve_sleef y = vdiv_vf_vf_vf_sve_sleef(d, vadd_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2), d)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(8.664339742f)), + visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(1.0f), y); + y = vmulsign_vf_vf_vf_sve_sleef(y, x); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef logk2f_sve_sleef(vfloat2_sve_sleef d) { + vfloat2_sve_sleef x, x2, m, s; + vfloat_sve_sleef t; + vint2_sve_sleef e; + + e = vilogbk_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vcast_vf_f_sve_sleef(1.0f/0.75f))); + + m = dfscale_vf2_vf2_vf_sve_sleef(d, vpow2i_vf_vi2_sve_sleef(vneg_vi2_vi2_sve_sleef(e))); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(m, vcast_vf_f_sve_sleef(-1)), dfadd2_vf2_vf2_vf_sve_sleef(m, vcast_vf_f_sve_sleef(1))); + x2 = dfsqu_vf2_vf2_sve_sleef(x); + + t = vcast_vf_f_sve_sleef(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(x2), vcast_vf_f_sve_sleef(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(x2), vcast_vf_f_sve_sleef(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(x2), vcast_vf_f_sve_sleef(0.666666686534881591796875f)); + + s = dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.69314718246459960938f), vcast_vf_f_sve_sleef(-1.904654323148236017e-09f)), vcast_vf_vi2_sve_sleef(e)); + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfscale_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfmul_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(x2, x), t)); + + return s; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_asinhfx_u10sve(vfloat_sve_sleef x) { + vfloat_sve_sleef y = vabs_vf_vf_sve_sleef(x); + vopmask_sve_sleef o = vgt_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(1)); + vfloat2_sve_sleef d; + + d = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfrec_vf2_vf_sve_sleef(x), vcast_vf2_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0))); + d = dfsqrt_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(dfsqu_vf2_vf2_sve_sleef(d), vcast_vf_f_sve_sleef(1))); + d = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfmul_vf2_vf2_vf_sve_sleef(d, y), d); + + d = logk2f_sve_sleef(dfnormalize_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(d, x))); + y = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(18446743523953729536.0)), + visnan_vo_vf_sve_sleef(y)), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(__builtin_inff()), x), y); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + y = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(x), vcast_vf_f_sve_sleef(-0.0), y); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_acoshfx_u10sve(vfloat_sve_sleef x) { + vfloat2_sve_sleef d = logk2f_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(dfsqrt_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1))), dfsqrt_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(-1)))), x)); + vfloat_sve_sleef y = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)); + + y = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(18446743523953729536.0)), + visnan_vo_vf_sve_sleef(y)), + vcast_vf_f_sve_sleef(__builtin_inff()), y); + + y = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1.0f)), vreinterpret_vm_vf_sve_sleef(y))); + + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1.0f)), vreinterpret_vm_vf_sve_sleef(y))); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_atanhfx_u10sve(vfloat_sve_sleef x) { + vfloat_sve_sleef y = vabs_vf_vf_sve_sleef(x); + vfloat2_sve_sleef d = logk2f_sve_sleef(dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), y), dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vneg_vf_vf_sve_sleef(y)))); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vgt_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(1.0)), vreinterpret_vm_vf_sve_sleef(vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(1.0)), vcast_vf_f_sve_sleef(__builtin_inff()), vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)), vcast_vf_f_sve_sleef(0.5)))))); + + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vreinterpret_vm_vf_sve_sleef(y))); + y = vmulsign_vf_vf_vf_sve_sleef(y, x); + y = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visnan_vo_vf_sve_sleef(x), vreinterpret_vm_vf_sve_sleef(y))); + + return y; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_exp2fx_u10sve(vfloat_sve_sleef d) { + vfloat_sve_sleef u = vrint_vf_vf_sve_sleef(d), s; + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + + s = vsub_vf_vf_vf_sve_sleef(d, u); + + u = vcast_vf_f_sve_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.6931471825e+0)); + + u = vfma_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(1)); + + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vsel_vf_vo_vf_vf_sve_sleef(vge_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(128)), vcast_vf_f_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-150)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_exp2fx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef u = vrint_vf_vf_sve_sleef(d), s; + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + + s = vsub_vf_vf_vf_sve_sleef(d, u); + + u = vcast_vf_f_sve_sleef(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.6931471825e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vsel_vf_vo_vf_vf_sve_sleef(vge_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(128)), vcast_vf_f_sve_sleef(__builtin_inf()), u); + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-150)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_exp10fx_u10sve(vfloat_sve_sleef d) { + vfloat_sve_sleef u = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_sve_sleef(+0.6802555919e-1); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2078080326e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.5393903852e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1171245337e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2034678698e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2650949001e+1)); + vfloat2_sve_sleef x = dfadd_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(2.3025851249694824219, -3.1705172516493593157e-08), vmul_vf_vf_vf_sve_sleef(u, s)); + u = vf2getx_vf_vf2_sve_sleef(dfnormalize_vf2_vf2_sve_sleef(dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf2_vf_sve_sleef(x, s)))); + + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(38.5318394191036238941387f)), vcast_vf_f_sve_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-50)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_exp10fx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef u = vrint_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(3.3219280948873623478703194294893901758648313930))), s; + vint2_sve_sleef q = vrint_vi2_vf_sve_sleef(u); + + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-0.3010253906f), d); + s = vmla_vf_vf_vf_vf_sve_sleef(u, vcast_vf_f_sve_sleef(-4.605038981e-06f), s); + + u = vcast_vf_f_sve_sleef(+0.2064004987e+0); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.5417877436e+0)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1171286821e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2034656048e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2650948763e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.2302585125e+1)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vcast_vf_f_sve_sleef(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2_sve_sleef(u, q); + + u = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(38.5318394191036238941387f)), vcast_vf_f_sve_sleef(__builtin_inff()), u); + u = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-50)), vreinterpret_vm_vf_sve_sleef(u))); + + return u; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_expm1fx_u10sve(vfloat_sve_sleef a) { + vfloat2_sve_sleef d = dfadd2_vf2_vf2_vf_sve_sleef(expk2f_sve_sleef(vcast_vf2_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0))), vcast_vf_f_sve_sleef(-1.0)); + vfloat_sve_sleef x = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(d), vf2gety_vf_vf2_sve_sleef(d)); + x = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(88.72283172607421875f)), vcast_vf_f_sve_sleef(__builtin_inff()), x); + x = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(-16.635532333438687426013570f)), vcast_vf_f_sve_sleef(-1), x); + x = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(a), vcast_vf_f_sve_sleef(-0.0f), x); + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_log10fx_u10sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x; + vfloat_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), m), dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), m)); + x2 = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)); + + t = vcast_vf_f_sve_sleef(+0.1314289868e+0); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef( +0.1735493541e+0)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef( +0.2895309627e+0)); + + vfloat2_sve_sleef s = dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(0.30103001, -1.432098889e-08), vcast_vf_vi2_sve_sleef(e)); + + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfmul_vf2_vf2_vf2_sve_sleef(x, vcast_vf2_f_f_sve_sleef(0.868588984, -2.170757285e-08))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x)), t)); + + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), vf2gety_vf_vf2_sve_sleef(s)); + + r = vsel_vf_vo_vf_vf_sve_sleef(vispinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), visnan_vo_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_log2fx_u10sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x; + vfloat_sve_sleef t, m, x2; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), m), dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), m)); + x2 = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)); + + t = vcast_vf_f_sve_sleef(+0.4374550283e+0f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.5764790177e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.9618012905120f)); + + vfloat2_sve_sleef s = dfadd2_vf2_vf_vf2_sve_sleef(vcast_vf_vi2_sve_sleef(e), + dfmul_vf2_vf2_vf2_sve_sleef(x, vcast_vf2_f_f_sve_sleef(2.8853900432586669922, 3.2734474483568488616e-08))); + + s = dfadd2_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x)), t)); + + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), vf2gety_vf_vf2_sve_sleef(s)); + + r = vsel_vf_vo_vf_vf_sve_sleef(vispinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), visnan_vo_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_log2fx_u35sve(vfloat_sve_sleef d) { + vfloat_sve_sleef m, t, x, x2; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.0/0.75))); + m = vldexp3_vf_vf_vi2_sve_sleef(d, vneg_vi2_vi2_sve_sleef(e)); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + + x = vdiv_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(m, vcast_vf_f_sve_sleef(1)), vadd_vf_vf_vf_sve_sleef(m, vcast_vf_f_sve_sleef(1))); + x2 = vmul_vf_vf_vf_sve_sleef(x, x); + + t = vcast_vf_f_sve_sleef(+0.4374088347e+0); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.5764843822e+0)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.9618024230e+0)); + + vfloat_sve_sleef r = vmla_vf_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x2, x), t, + vmla_vf_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(+0.2885390043e+1), vcast_vf_vi2_sve_sleef(e))); + + r = vsel_vf_vo_vf_vf_sve_sleef(vispinf_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(__builtin_inf()), r); + r = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), visnan_vo_vf_sve_sleef(d)), vcast_vf_f_sve_sleef(__builtin_nan("")), r); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(-__builtin_inf()), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_log1pfx_u10sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x; + vfloat_sve_sleef t, m, x2; + + vfloat_sve_sleef dp1 = vadd_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1)); + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(dp1, vcast_vf_f_sve_sleef(0x1p-126)); + dp1 = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(dp1, vcast_vf_f_sve_sleef((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), dp1); + vint2_sve_sleef e = vilogb2k_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(dp1, vcast_vf_f_sve_sleef(1.0f/0.75f))); + t = vldexp3_vf_vf_vi2_sve_sleef(vcast_vf_f_sve_sleef(1), vneg_vi2_vi2_sve_sleef(e)); + m = vmla_vf_vf_vf_vf_sve_sleef(d, t, vsub_vf_vf_vf_sve_sleef(t, vcast_vf_f_sve_sleef(1))); + e = vsel_vi2_vo_vi2_vi2_sve_sleef(o, vsub_vi2_vi2_vi2_sve_sleef(e, vcast_vi2_i_sve_sleef(64)), e); + vfloat2_sve_sleef s = dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2_sve_sleef(e)); + + x = dfdiv_vf2_vf2_vf2_sve_sleef(vcast_vf2_vf_vf_sve_sleef(m, vcast_vf_f_sve_sleef(0)), dfadd_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2), m)); + x2 = vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2getx_vf_vf2_sve_sleef(x)); + + t = vcast_vf_f_sve_sleef(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, x2, vcast_vf_f_sve_sleef(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2_sve_sleef(s, dfscale_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2))); + s = dfadd_vf2_vf2_vf_sve_sleef(s, vmul_vf_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(x2, vf2getx_vf_vf2_sve_sleef(x)), t)); + + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(s), vf2gety_vf_vf2_sve_sleef(s)); + + r = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1e+38)), vcast_vf_f_sve_sleef(__builtin_inff()), r); + r = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(vgt_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), d), vreinterpret_vm_vf_sve_sleef(r))); + r = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(-1)), vcast_vf_f_sve_sleef(-__builtin_inff()), r); + r = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(-0.0f), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fabsfx_sve(vfloat_sve_sleef x) { return vabs_vf_vf_sve_sleef(x); } + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_copysignfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { return vcopysign_vf_vf_vf_sve_sleef(x, y); } + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fmaxfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + + return vsel_vf_vo_vf_vf_sve_sleef(visnan_vo_vf_sve_sleef(y), x, vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(x, y), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fminfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + + return vsel_vf_vo_vf_vf_sve_sleef(visnan_vo_vf_sve_sleef(y), x, vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(y, x), x, y)); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fdimfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef ret = vsub_vf_vf_vf_sve_sleef(x, y); + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(ret, vcast_vf_f_sve_sleef(0)), veq_vo_vf_vf_sve_sleef(x, y)), vcast_vf_f_sve_sleef(0), ret); + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_truncfx_sve(vfloat_sve_sleef x) { + + return vtruncate_vf_vf_sve_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_floorfx_sve(vfloat_sve_sleef x) { + vfloat_sve_sleef fr = vsub_vf_vf_vf_sve_sleef(x, vcast_vf_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(x))); + fr = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(0)), vadd_vf_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(1.0f)), fr); + return vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), vge_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_ceilfx_sve(vfloat_sve_sleef x) { + vfloat_sve_sleef fr = vsub_vf_vf_vf_sve_sleef(x, vcast_vf_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(x))); + fr = vsel_vf_vo_vf_vf_sve_sleef(vle_vo_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(0)), fr, vsub_vf_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(1.0f))); + return vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(x), vge_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, fr), x)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_roundfx_sve(vfloat_sve_sleef d) { + vfloat_sve_sleef x = vadd_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.5f)); + vfloat_sve_sleef fr = vsub_vf_vf_vf_sve_sleef(x, vcast_vf_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(x))); + x = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(vle_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), veq_vo_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(0))), vsub_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1.0f)), x); + fr = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(0)), vadd_vf_vf_vf_sve_sleef(fr, vcast_vf_f_sve_sleef(1.0f)), fr); + x = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.4999999701976776123f)), vcast_vf_f_sve_sleef(0), x); + return vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(d), vge_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(INT64_C(1) << 23))), d, vcopysign_vf_vf_vf_sve_sleef(vsub_vf_vf_vf_sve_sleef(x, fr), d)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_rintfx_sve(vfloat_sve_sleef d) { + + return vrint_vf_vf_sve_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fmafx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y, vfloat_sve_sleef z) { + + return vfma_vf_vf_vf_vf_sve_sleef(x, y, z); + +} + +SLEEF_INLINE vfloat_sve_sleef Sleef_sqrtfx_u05sve(vfloat_sve_sleef d) { + + vfloat_sve_sleef q, w, x, y, z; + + d = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(__builtin_nanf("")), d); + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(5.2939559203393770e-23f)); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.8889465931478580e+22f)), d); + q = vsel_vf_vo_vf_vf_sve_sleef(o, vcast_vf_f_sve_sleef(7.2759576141834260e-12f), vcast_vf_f_sve_sleef(1.0f)); + + y = vreinterpret_vf_vi2_sve_sleef(vsub_vi2_vi2_vi2_sve_sleef(vcast_vi2_i_sve_sleef(0x5f3759df), svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(vreinterpret_vi2_vf_sve_sleef(d)), 1)))); + + x = vmul_vf_vf_vf_sve_sleef(d, y); w = vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5), y); + y = vfmanp_vf_vf_vf_vf_sve_sleef(x, w, vcast_vf_f_sve_sleef(0.5)); + x = vfma_vf_vf_vf_vf_sve_sleef(x, y, x); w = vfma_vf_vf_vf_vf_sve_sleef(w, y, w); + y = vfmanp_vf_vf_vf_vf_sve_sleef(x, w, vcast_vf_f_sve_sleef(0.5)); + x = vfma_vf_vf_vf_vf_sve_sleef(x, y, x); w = vfma_vf_vf_vf_vf_sve_sleef(w, y, w); + + y = vfmanp_vf_vf_vf_vf_sve_sleef(x, w, vcast_vf_f_sve_sleef(1.5)); w = vadd_vf_vf_vf_sve_sleef(w, w); + w = vmul_vf_vf_vf_sve_sleef(w, y); + x = vmul_vf_vf_vf_sve_sleef(w, d); + y = vfmapn_vf_vf_vf_vf_sve_sleef(w, d, x); z = vfmanp_vf_vf_vf_vf_sve_sleef(w, x, vcast_vf_f_sve_sleef(1)); + + z = vfmanp_vf_vf_vf_vf_sve_sleef(w, y, z); w = vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5), x); + w = vfma_vf_vf_vf_vf_sve_sleef(w, z, y); + w = vadd_vf_vf_vf_sve_sleef(w, x); + + w = vmul_vf_vf_vf_sve_sleef(w, q); + + w = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), + veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(__builtin_inff()))), d, w); + + w = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(__builtin_nanf("")), w); + + return w; + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sqrtfx_sve(vfloat_sve_sleef d) { + + return vsqrt_vf_vf_sve_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_hypotfx_u05sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + x = vabs_vf_vf_sve_sleef(x); + y = vabs_vf_vf_sve_sleef(y); + vfloat_sve_sleef min = vmin_vf_vf_vf_sve_sleef(x, y), n = min; + vfloat_sve_sleef max = vmax_vf_vf_vf_sve_sleef(x, y), d = max; + + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(max, vcast_vf_f_sve_sleef(0x1p-126)); + n = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(n, vcast_vf_f_sve_sleef(UINT64_C(1) << 24)), n); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(UINT64_C(1) << 24)), d); + + vfloat2_sve_sleef t = dfdiv_vf2_vf2_vf2_sve_sleef(vcast_vf2_vf_vf_sve_sleef(n, vcast_vf_f_sve_sleef(0)), vcast_vf2_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0))); + t = dfmul_vf2_vf2_vf_sve_sleef(dfsqrt_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(dfsqu_vf2_vf2_sve_sleef(t), vcast_vf_f_sve_sleef(1))), max); + vfloat_sve_sleef ret = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t), vf2gety_vf_vf2_sve_sleef(t)); + ret = vsel_vf_vo_vf_vf_sve_sleef(visnan_vo_vf_sve_sleef(ret), vcast_vf_f_sve_sleef(__builtin_inff()), ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(min, vcast_vf_f_sve_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(__builtin_inff())), veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(__builtin_inff()))), vcast_vf_f_sve_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_hypotfx_u35sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + x = vabs_vf_vf_sve_sleef(x); + y = vabs_vf_vf_sve_sleef(y); + vfloat_sve_sleef min = vmin_vf_vf_vf_sve_sleef(x, y); + vfloat_sve_sleef max = vmax_vf_vf_vf_sve_sleef(x, y); + + vfloat_sve_sleef t = vdiv_vf_vf_vf_sve_sleef(min, max); + vfloat_sve_sleef ret = vmul_vf_vf_vf_sve_sleef(max, vsqrt_vf_vf_sve_sleef(vmla_vf_vf_vf_vf_sve_sleef(t, t, vcast_vf_f_sve_sleef(1)))); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(min, vcast_vf_f_sve_sleef(0)), max, ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_nanf("")), ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(__builtin_inff())), veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(__builtin_inff()))), vcast_vf_f_sve_sleef(__builtin_inff()), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_nextafterfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + x = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0), y), x); + vint2_sve_sleef xi2 = vreinterpret_vi2_vf_sve_sleef(x); + vopmask_sve_sleef c = vxor_vo_vo_vo_sve_sleef(vsignbit_vo_vf_sve_sleef(x), vge_vo_vf_vf_sve_sleef(y, x)); + + xi2 = vsel_vi2_vo_vi2_vi2_sve_sleef(c, vsub_vi2_vi2_vi2_sve_sleef(vcast_vi2_i_sve_sleef(0), vxor_vi2_vi2_vi2_sve_sleef(xi2, vcast_vi2_i_sve_sleef((int)(1U << 31)))), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_sve_sleef(vneq_vo_vf_vf_sve_sleef(x, y), vsub_vi2_vi2_vi2_sve_sleef(xi2, vcast_vi2_i_sve_sleef(1)), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2_sve_sleef(c, vsub_vi2_vi2_vi2_sve_sleef(vcast_vi2_i_sve_sleef(0), vxor_vi2_vi2_vi2_sve_sleef(xi2, vcast_vi2_i_sve_sleef((int)(1U << 31)))), xi2); + + vfloat_sve_sleef ret = vreinterpret_vf_vi2_sve_sleef(xi2); + + ret = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(ret, vcast_vf_f_sve_sleef(0)), vneq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0))), + vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0), x), ret); + + ret = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), veq_vo_vf_vf_sve_sleef(y, vcast_vf_f_sve_sleef(0))), y, ret); + + ret = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(visnan_vo_vf_sve_sleef(x), visnan_vo_vf_sve_sleef(y)), vcast_vf_f_sve_sleef(__builtin_nanf("")), ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_frfrexpfx_sve(vfloat_sve_sleef x) { + x = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(x), vcast_vf_f_sve_sleef(0x1p-126)), vmul_vf_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(UINT64_C(1) << 30)), x); + + vmask_sve_sleef xm = vreinterpret_vm_vf_sve_sleef(x); + xm = vand_vm_vm_vm_sve_sleef(xm, vcast_vm_i_i_sve_sleef(~0x7f800000U, ~0x7f800000U)); + xm = vor_vm_vm_vm_sve_sleef (xm, vcast_vm_i_i_sve_sleef( 0x3f000000U, 0x3f000000U)); + + vfloat_sve_sleef ret = vreinterpret_vf_vm_sve_sleef(xm); + + ret = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(x), vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(__builtin_inff()), x), ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), x, ret); + + return ret; +} + +SLEEF_INLINE SLEEF_CONST vint2_sve_sleef Sleef_expfrexpfx_sve(vfloat_sve_sleef x) { + + return vcast_vi2_i_sve_sleef(0); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vtoward0_vf_vf_sve_sleef(vfloat_sve_sleef x) { + vfloat_sve_sleef t = vreinterpret_vf_vi2_sve_sleef(vsub_vi2_vi2_vi2_sve_sleef(vreinterpret_vi2_vf_sve_sleef(x), vcast_vi2_i_sve_sleef(1))); + return vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(0), t); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vptrunc_vf_vf_sve_sleef(vfloat_sve_sleef x) { + + return vtruncate_vf_vf_sve_sleef(x); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_fmodfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef nu = vabs_vf_vf_sve_sleef(x), de = vabs_vf_vf_sve_sleef(y), s = vcast_vf_f_sve_sleef(1), q; + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(de, vcast_vf_f_sve_sleef(0x1p-126)); + nu = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(nu, vcast_vf_f_sve_sleef(UINT64_C(1) << 25)), nu); + de = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(de, vcast_vf_f_sve_sleef(UINT64_C(1) << 25)), de); + s = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(s , vcast_vf_f_sve_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat_sve_sleef rde = vtoward0_vf_vf_sve_sleef(vrec_vf_vf_sve_sleef(de)); + + vfloat2_sve_sleef r = vcast_vf2_vf_vf_sve_sleef(nu, vcast_vf_f_sve_sleef(0)); + + for(int i=0;i<8;i++) { + q = vptrunc_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vtoward0_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r)), rde)); + q = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(3), de), vf2getx_vf_vf2_sve_sleef(r)), + vge_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), de)), + vcast_vf_f_sve_sleef(2), q); + q = vsel_vf_vo_vf_vf_sve_sleef(vand_vo_vo_vo_sve_sleef(vgt_vo_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2), de), vf2getx_vf_vf2_sve_sleef(r)), + vge_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), de)), + vcast_vf_f_sve_sleef(1), q); + r = dfnormalize_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf2_sve_sleef(r, dfmul_vf2_vf_vf_sve_sleef(vptrunc_vf_vf_sve_sleef(q), vneg_vf_vf_sve_sleef(de)))); + if (vtestallones_i_vo32_sve_sleef(vlt_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), de))) break; + } + + vfloat_sve_sleef ret = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), vf2gety_vf_vf2_sve_sleef(r)), s); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), vf2gety_vf_vf2_sve_sleef(r)), de), vcast_vf_f_sve_sleef(0), ret); + + ret = vmulsign_vf_vf_vf_sve_sleef(ret, x); + + ret = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(nu, de), x, ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(de, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(__builtin_nanf("")), ret); + + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat_sve_sleef vrintfk2_vf_vf_sve_sleef(vfloat_sve_sleef d) { + + return vrint_vf_vf_sve_sleef(d); + +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_remainderfx_sve(vfloat_sve_sleef x, vfloat_sve_sleef y) { + vfloat_sve_sleef n = vabs_vf_vf_sve_sleef(x), d = vabs_vf_vf_sve_sleef(y), s = vcast_vf_f_sve_sleef(1), q; + vopmask_sve_sleef o = vlt_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0x1p-126*2)); + n = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(n, vcast_vf_f_sve_sleef(UINT64_C(1) << 25)), n); + d = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(UINT64_C(1) << 25)), d); + s = vsel_vf_vo_vf_vf_sve_sleef(o, vmul_vf_vf_vf_sve_sleef(s , vcast_vf_f_sve_sleef(1.0f / (UINT64_C(1) << 25))), s); + vfloat2_sve_sleef r = vcast_vf2_vf_vf_sve_sleef(n, vcast_vf_f_sve_sleef(0)); + vfloat_sve_sleef rd = vrec_vf_vf_sve_sleef(d); + vopmask_sve_sleef qisodd = vneq_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0), vcast_vf_f_sve_sleef(0)); + + for(int i=0;i<8;i++) { + q = vrintfk2_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), rd)); + q = vsel_vf_vo_vf_vf_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r)), vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(1.5f))), vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1.0f), vf2getx_vf_vf2_sve_sleef(r)), q); + q = vsel_vf_vo_vf_vf_sve_sleef(vor_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r)), vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.5f))), + vandnot_vo_vo_vo_sve_sleef(qisodd, veq_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r)), vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0.5f))))), + vcast_vf_f_sve_sleef(0.0), q); + if (vtestallones_i_vo32_sve_sleef(veq_vo_vf_vf_sve_sleef(q, vcast_vf_f_sve_sleef(0)))) break; + q = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(q, vneg_vf_vf_sve_sleef(d))), vadd_vf_vf_vf_sve_sleef(q, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(-1), vf2getx_vf_vf2_sve_sleef(r))), q); + qisodd = vxor_vo_vo_vo_sve_sleef(qisodd, vand_vo_vo_vo_sve_sleef(veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(q), vcast_vi2_i_sve_sleef(1)), vcast_vi2_i_sve_sleef(1)), + vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(q), vcast_vf_f_sve_sleef(1 << 24)))); + r = dfnormalize_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf2_sve_sleef(r, dfmul_vf2_vf_vf_sve_sleef(q, vneg_vf_vf_sve_sleef(d)))); + } + + vfloat_sve_sleef ret = vmul_vf_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(r), vf2gety_vf_vf2_sve_sleef(r)), s); + ret = vmulsign_vf_vf_vf_sve_sleef(ret, x); + ret = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(y), vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(x), vcast_vf_f_sve_sleef(__builtin_nanf("")), x), ret); + ret = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(__builtin_nanf("")), ret); + return ret; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef sinpifk_sve_sleef(vfloat_sve_sleef d) { + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, t; + vfloat2_sve_sleef x, s2; + + u = vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(4.0)); + vint2_sve_sleef q = vtruncate_vi2_vf_sve_sleef(u); + q = vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vxor_vi2_vi2_vi2_sve_sleef(svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(q), 31)), vcast_vi2_i_sve_sleef(1))), vcast_vi2_i_sve_sleef(~1)); + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(2)); + + s = vsub_vf_vf_vf_sve_sleef(u, vcast_vf_vi2_sve_sleef(q)); + t = s; + s = vmul_vf_vf_vf_sve_sleef(s, s); + s2 = dfmul_vf2_vf_vf_sve_sleef(t, t); + + u = vsel_vf_vo_f_f_sve_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vsel_vf_vo_f_f_sve_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vsel_vf_vo_f_f_sve_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_sve_sleef(vmul_vf_vf_vf_sve_sleef(u, s), + vsel_vf2_vo_f_f_f_f_sve_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_sve_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_sve_sleef(x, vsel_vf2_vo_vf2_vf2_sve_sleef(o, s2, vcast_vf2_vf_vf_sve_sleef(t, vcast_vf_f_sve_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1)), x); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + x = vf2setx_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x))))); + x = vf2sety_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_sinpifx_u05sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x = sinpifk_sve_sleef(d); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + r = vsel_vf_vo_vf_vf_sve_sleef(visnegzero_vo_vf_sve_sleef(d), vcast_vf_f_sve_sleef(-0.0), r); + r = vreinterpret_vf_vm_sve_sleef(vandnot_vm_vo32_vm_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(8e+6f)), vreinterpret_vm_vf_sve_sleef(r))); + r = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visinf_vo_vf_sve_sleef(d), vreinterpret_vm_vf_sve_sleef(r))); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef cospifk_sve_sleef(vfloat_sve_sleef d) { + vopmask_sve_sleef o; + vfloat_sve_sleef u, s, t; + vfloat2_sve_sleef x, s2; + + u = vmul_vf_vf_vf_sve_sleef(d, vcast_vf_f_sve_sleef(4.0)); + vint2_sve_sleef q = vtruncate_vi2_vf_sve_sleef(u); + q = vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vxor_vi2_vi2_vi2_sve_sleef(svreinterpret_s32_u32(svlsr_n_u32_x(svptrue_b8(), svreinterpret_u32_s32(q), 31)), vcast_vi2_i_sve_sleef(1))), vcast_vi2_i_sve_sleef(~1)); + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(0)); + + s = vsub_vf_vf_vf_sve_sleef(u, vcast_vf_vi2_sve_sleef(q)); + t = s; + s = vmul_vf_vf_vf_sve_sleef(s, s); + s2 = dfmul_vf2_vf_vf_sve_sleef(t, t); + + u = vsel_vf_vo_f_f_sve_sleef(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vsel_vf_vo_f_f_sve_sleef(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, s, vsel_vf_vo_f_f_sve_sleef(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2_sve_sleef(vmul_vf_vf_vf_sve_sleef(u, s), + vsel_vf2_vo_f_f_f_f_sve_sleef(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(s2, x), + vsel_vf2_vo_f_f_f_f_sve_sleef(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2_sve_sleef(x, vsel_vf2_vo_vf2_vf2_sve_sleef(o, s2, vcast_vf2_vf_vf_sve_sleef(t, vcast_vf_f_sve_sleef(0)))); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1)), x); + + o = veq_vo_vi2_vi2_sve_sleef(vand_vi2_vi2_vi2_sve_sleef(vadd_vi2_vi2_vi2_sve_sleef(q, vcast_vi2_i_sve_sleef(2)), vcast_vi2_i_sve_sleef(4)), vcast_vi2_i_sve_sleef(4)); + x = vf2setx_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x))))); + x = vf2sety_vf2_vf2_vf_sve_sleef(x, vreinterpret_vf_vm_sve_sleef(vxor_vm_vm_vm_sve_sleef(vand_vm_vo32_vm_sve_sleef(o, vreinterpret_vm_vf_sve_sleef(vcast_vf_f_sve_sleef(-0.0))), vreinterpret_vm_vf_sve_sleef(vf2gety_vf_vf2_sve_sleef(x))))); + + return x; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_cospifx_u05sve(vfloat_sve_sleef d) { + vfloat2_sve_sleef x = cospifk_sve_sleef(d); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)); + + r = vsel_vf_vo_vf_vf_sve_sleef(vgt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(d), vcast_vf_f_sve_sleef(8e+6f)), vcast_vf_f_sve_sleef(1), r); + r = vreinterpret_vf_vm_sve_sleef(vor_vm_vo32_vm_sve_sleef(visinf_vo_vf_sve_sleef(d), vreinterpret_vm_vf_sve_sleef(r))); + + return r; +} + +static SLEEF_CONST df2_sve_sleef gammafk_sve_sleef(vfloat_sve_sleef a) { + vfloat2_sve_sleef clc = vcast_vf2_f_f_sve_sleef(0, 0), clln = vcast_vf2_f_f_sve_sleef(1, 0), clld = vcast_vf2_f_f_sve_sleef(1, 0); + vfloat2_sve_sleef x, y, z; + vfloat_sve_sleef t, u; + + vopmask_sve_sleef otiny = vlt_vo_vf_vf_sve_sleef(vabs_vf_vf_sve_sleef(a), vcast_vf_f_sve_sleef(1e-30f)), oref = vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0.5)); + + x = vsel_vf2_vo_vf2_vf2_sve_sleef(otiny, vcast_vf2_f_f_sve_sleef(0, 0), + vsel_vf2_vo_vf2_vf2_sve_sleef(oref, dfadd2_vf2_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(1), vneg_vf_vf_sve_sleef(a)), + vcast_vf2_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)))); + + vopmask_sve_sleef o0 = vand_vo_vo_vo_sve_sleef(vle_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(0.5), vf2getx_vf_vf2_sve_sleef(x)), vle_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vcast_vf_f_sve_sleef(1.2))); + vopmask_sve_sleef o2 = vle_vo_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2.3), vf2getx_vf_vf2_sve_sleef(x)); + + y = dfnormalize_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1)), x)); + y = dfnormalize_vf2_vf2_sve_sleef(dfmul_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2)), y)); + + vopmask_sve_sleef o = vand_vo_vo_vo_sve_sleef(o2, vle_vo_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vcast_vf_f_sve_sleef(7))); + clln = vsel_vf2_vo_vf2_vf2_sve_sleef(o, y, clln); + + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o, dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(3)), x); + t = vsel_vf_vo_vf_vf_sve_sleef(o2, vrec_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x)), vf2getx_vf_vf2_sve_sleef(dfnormalize_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(x, vsel_vf_vo_f_f_sve_sleef(o0, -1, -2))))); + + u = vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, +0.000839498720672087279971000786, +0.9435157776e+0f, +0.1102489550e-3f); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, -5.17179090826059219329394422e-05, +0.8670063615e+0f, +0.8160019934e-4f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, -0.000592166437353693882857342347, +0.4826702476e+0f, +0.1528468856e-3f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, +6.97281375836585777403743539e-05, -0.8855129778e-1f, -0.2355068718e-3f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, +0.000784039221720066627493314301, +0.1013825238e+0f, +0.4962242092e-3f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, -0.000229472093621399176949318732, -0.1493408978e+0f, -0.1193488017e-2f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, -0.002681327160493827160473958490, +0.1697509140e+0f, +0.2891599433e-2f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, +0.003472222222222222222175164840, -0.2072454542e+0f, -0.7385451812e-2f)); + u = vmla_vf_vf_vf_vf_sve_sleef(u, t, vsel_vf_vo_vo_f_f_f_sve_sleef(o2, o0, +0.083333333333333333335592087900, +0.2705872357e+0f, +0.2058077045e-1f)); + + y = dfmul_vf2_vf2_vf2_sve_sleef(dfadd2_vf2_vf2_vf_sve_sleef(x, vcast_vf_f_sve_sleef(-0.5)), logk2f_sve_sleef(x)); + y = dfadd2_vf2_vf2_vf2_sve_sleef(y, dfneg_vf2_vf2_sve_sleef(x)); + y = dfadd2_vf2_vf2_vf2_sve_sleef(y, vcast_vf2_d_sve_sleef(0.91893853320467278056)); + + z = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf_vf_sve_sleef (u, t), vsel_vf_vo_f_f_sve_sleef(o0, -0.400686534596170958447352690395e+0f, -0.673523028297382446749257758235e-1f)); + z = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(z, t), vsel_vf_vo_f_f_sve_sleef(o0, +0.822466960142643054450325495997e+0f, +0.322467033928981157743538726901e+0f)); + z = dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf2_vf_sve_sleef(z, t), vsel_vf_vo_f_f_sve_sleef(o0, -0.577215665946766039837398973297e+0f, +0.422784335087484338986941629852e+0f)); + z = dfmul_vf2_vf2_vf_sve_sleef(z, t); + + clc = vsel_vf2_vo_vf2_vf2_sve_sleef(o2, y, z); + + clld = vsel_vf2_vo_vf2_vf2_sve_sleef(o2, dfadd2_vf2_vf2_vf_sve_sleef(dfmul_vf2_vf_vf_sve_sleef(u, t), vcast_vf_f_sve_sleef(1)), clld); + + y = clln; + + clc = vsel_vf2_vo_vf2_vf2_sve_sleef(otiny, vcast_vf2_d_sve_sleef(41.58883083359671856503), + vsel_vf2_vo_vf2_vf2_sve_sleef(oref, dfadd2_vf2_vf2_vf2_sve_sleef(vcast_vf2_d_sve_sleef(1.1447298858494001639), dfneg_vf2_vf2_sve_sleef(clc)), clc)); + clln = vsel_vf2_vo_vf2_vf2_sve_sleef(otiny, vcast_vf2_f_f_sve_sleef(1, 0), vsel_vf2_vo_vf2_vf2_sve_sleef(oref, clln, clld)); + + if (!vtestallones_i_vo32_sve_sleef(vnot_vo32_vo32_sve_sleef(oref))) { + t = vsub_vf_vf_vf_sve_sleef(a, vmul_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(INT64_C(1) << 12), vcast_vf_vi2_sve_sleef(vtruncate_vi2_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(1.0 / (INT64_C(1) << 12))))))); + x = dfmul_vf2_vf2_vf2_sve_sleef(clld, sinpifk_sve_sleef(t)); + } + + clld = vsel_vf2_vo_vf2_vf2_sve_sleef(otiny, vcast_vf2_vf_vf_sve_sleef(vmul_vf_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef((INT64_C(1) << 30)*(float)(INT64_C(1) << 30))), vcast_vf_f_sve_sleef(0)), + vsel_vf2_vo_vf2_vf2_sve_sleef(oref, x, y)); + + return df2setab_df2_vf2_vf2_sve_sleef(clc, dfdiv_vf2_vf2_vf2_sve_sleef(clln, clld)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_tgammafx_u10sve(vfloat_sve_sleef a) { + df2_sve_sleef d = gammafk_sve_sleef(a); + vfloat2_sve_sleef y = dfmul_vf2_vf2_vf2_sve_sleef(expk2f_sve_sleef(df2geta_vf2_df2_sve_sleef(d)), df2getb_vf2_df2_sve_sleef(d)); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(y)); + vopmask_sve_sleef o; + + o = vor_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(-__builtin_inff())), + vand_vo_vo_vo_sve_sleef(vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), visint_vo_vf_sve_sleef(a))), + vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(visnumber_vo_vf_sve_sleef(a), vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0))), visnan_vo_vf_sve_sleef(r))); + r = vsel_vf_vo_vf_vf_sve_sleef(o, vcast_vf_f_sve_sleef(__builtin_nanf("")), r); + + o = vand_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(__builtin_inff())), visnumber_vo_vf_sve_sleef(a)), + vge_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(-0x1p-126))), + vor_vo_vo_vo_sve_sleef(vor_vo_vo_vo_sve_sleef(veq_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), vgt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(36))), visnan_vo_vf_sve_sleef(r))); + r = vsel_vf_vo_vf_vf_sve_sleef(o, vmulsign_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(__builtin_inff()), a), r); + + return r; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_lgammafx_u10sve(vfloat_sve_sleef a) { + df2_sve_sleef d = gammafk_sve_sleef(a); + vfloat2_sve_sleef y = dfadd2_vf2_vf2_vf2_sve_sleef(df2geta_vf2_df2_sve_sleef(d), logk2f_sve_sleef(dfabs_vf2_vf2_sve_sleef(df2getb_vf2_df2_sve_sleef(d)))); + vfloat_sve_sleef r = vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(y), vf2gety_vf_vf2_sve_sleef(y)); + vopmask_sve_sleef o; + + o = vor_vo_vo_vo_sve_sleef(visinf_vo_vf_sve_sleef(a), + vor_vo_vo_vo_sve_sleef(vand_vo_vo_vo_sve_sleef(vle_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), visint_vo_vf_sve_sleef(a)), + vand_vo_vo_vo_sve_sleef(visnumber_vo_vf_sve_sleef(a), visnan_vo_vf_sve_sleef(r)))); + r = vsel_vf_vo_vf_vf_sve_sleef(o, vcast_vf_f_sve_sleef(__builtin_inff()), r); + + return r; +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef dfmla_vf2_vf_vf2_vf2_sve_sleef(vfloat_sve_sleef x, vfloat2_sve_sleef y, vfloat2_sve_sleef z) { + return dfadd_vf2_vf2_vf2_sve_sleef(z, dfmul_vf2_vf2_vf_sve_sleef(y, x)); +} + +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef poly2df_b_sve_sleef(vfloat_sve_sleef x, vfloat2_sve_sleef c1, vfloat2_sve_sleef c0) { return dfmla_vf2_vf_vf2_vf2_sve_sleef(x, c1, c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef poly2df_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef c1, vfloat2_sve_sleef c0) { return dfmla_vf2_vf_vf2_vf2_sve_sleef(x, vcast_vf2_vf_vf_sve_sleef(c1, vcast_vf_f_sve_sleef(0)), c0); } +static SLEEF_ALWAYS_INLINE SLEEF_CONST vfloat2_sve_sleef poly4df_sve_sleef(vfloat_sve_sleef x, vfloat_sve_sleef c3, vfloat2_sve_sleef c2, vfloat2_sve_sleef c1, vfloat2_sve_sleef c0) { + return dfmla_vf2_vf_vf2_vf2_sve_sleef(vmul_vf_vf_vf_sve_sleef(x, x), poly2df_sve_sleef(x, c3, c2), poly2df_b_sve_sleef(x, c1, c0)); +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_erffx_u10sve(vfloat_sve_sleef a) { + vfloat_sve_sleef t, x = vabs_vf_vf_sve_sleef(a); + vfloat2_sve_sleef t2; + vfloat_sve_sleef x2 = vmul_vf_vf_vf_sve_sleef(x, x), x4 = vmul_vf_vf_vf_sve_sleef(x2, x2); + vopmask_sve_sleef o25 = vle_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(2.5)); + + if (__builtin_expect(!!(vtestallones_i_vo32_sve_sleef(o25)), 1)) { + + t = vmla_vf_vf_vf_vf_sve_sleef((x4), (vmla_vf_vf_vf_vf_sve_sleef((x), (vcast_vf_f_sve_sleef(-0.4360447008e-6)), (vcast_vf_f_sve_sleef(+0.6867515367e-5)))), (vmla_vf_vf_vf_vf_sve_sleef((x2), (vmla_vf_vf_vf_vf_sve_sleef((x), (vcast_vf_f_sve_sleef(-0.3045156700e-4)), (vcast_vf_f_sve_sleef(+0.9808536561e-4)))), (vmla_vf_vf_vf_vf_sve_sleef((x), (vcast_vf_f_sve_sleef(+0.2395523916e-3)), (vcast_vf_f_sve_sleef(+0.1459901541e-3))))))) + + ; + t2 = poly4df_sve_sleef(x, t, + vcast_vf2_f_f_sve_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_sve_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_sve_sleef(0.070523701608180999756, -3.6616309318707365163e-09)); + t2 = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), dfmul_vf2_vf2_vf_sve_sleef(t2, x)); + t2 = dfsqu_vf2_vf2_sve_sleef(t2); + t2 = dfsqu_vf2_vf2_sve_sleef(t2); + t2 = dfsqu_vf2_vf2_sve_sleef(t2); + t2 = dfsqu_vf2_vf2_sve_sleef(t2); + t2 = dfrec_vf2_vf2_sve_sleef(t2); + } else { + + t = vmla_vf_vf_vf_vf_sve_sleef((x4), (vmla_vf_vf_vf_vf_sve_sleef((x), ((vsel_vf_vo_f_f_sve_sleef(o25, -0.4360447008e-6, -0.1130012848e-6))), ((vsel_vf_vo_f_f_sve_sleef(o25, +0.6867515367e-5, +0.4115272986e-5))))), (vmla_vf_vf_vf_vf_sve_sleef((x2), (vmla_vf_vf_vf_vf_sve_sleef((x), ((vsel_vf_vo_f_f_sve_sleef(o25, -0.3045156700e-4, -0.6928304356e-4))), ((vsel_vf_vo_f_f_sve_sleef(o25, +0.9808536561e-4, +0.7172692567e-3))))), (vmla_vf_vf_vf_vf_sve_sleef((x), ((vsel_vf_vo_f_f_sve_sleef(o25, +0.2395523916e-3, -0.5131045356e-2))), ((vsel_vf_vo_f_f_sve_sleef(o25, +0.1459901541e-3, +0.2708637156e-1)))))))) + + ; + t2 = poly4df_sve_sleef(x, t, + vsel_vf2_vo_vf2_vf2_sve_sleef(o25, vcast_vf2_f_f_sve_sleef(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f_sve_sleef(-0.11064319312572479248, 3.7050452777225283007e-09)), + vsel_vf2_vo_vf2_vf2_sve_sleef(o25, vcast_vf2_f_f_sve_sleef(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f_sve_sleef(-0.63192230463027954102, -2.0200432585073177859e-08)), + vsel_vf2_vo_vf2_vf2_sve_sleef(o25, vcast_vf2_f_f_sve_sleef(0.070523701608180999756, -3.6616309318707365163e-09), + vcast_vf2_f_f_sve_sleef(-1.1296638250350952148, 2.5515120196453259252e-08))); + t2 = dfmul_vf2_vf2_vf_sve_sleef(t2, x); + vfloat2_sve_sleef s2 = dfadd_vf2_vf_vf2_sve_sleef(vcast_vf_f_sve_sleef(1), t2); + s2 = dfsqu_vf2_vf2_sve_sleef(s2); + s2 = dfsqu_vf2_vf2_sve_sleef(s2); + s2 = dfsqu_vf2_vf2_sve_sleef(s2); + s2 = dfsqu_vf2_vf2_sve_sleef(s2); + s2 = dfrec_vf2_vf2_sve_sleef(s2); + t2 = vsel_vf2_vo_vf2_vf2_sve_sleef(o25, s2, vcast_vf2_vf_vf_sve_sleef(expkf_sve_sleef(t2), vcast_vf_f_sve_sleef(0))); + } + + t2 = dfadd2_vf2_vf2_vf_sve_sleef(t2, vcast_vf_f_sve_sleef(-1)); + t2 = vsel_vf2_vo_vf2_vf2_sve_sleef(vlt_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(1e-4)), dfmul_vf2_vf2_vf_sve_sleef(vcast_vf2_f_f_sve_sleef(-1.1283792257308959961, 5.8635383422197591097e-08), x), t2); + + vfloat_sve_sleef z = vneg_vf_vf_sve_sleef(vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(t2), vf2gety_vf_vf2_sve_sleef(t2))); + z = vsel_vf_vo_vf_vf_sve_sleef(vge_vo_vf_vf_sve_sleef(x, vcast_vf_f_sve_sleef(6)), vcast_vf_f_sve_sleef(1), z); + z = vsel_vf_vo_vf_vf_sve_sleef(visinf_vo_vf_sve_sleef(a), vcast_vf_f_sve_sleef(1), z); + z = vsel_vf_vo_vf_vf_sve_sleef(veq_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), vcast_vf_f_sve_sleef(0), z); + z = vmulsign_vf_vf_vf_sve_sleef(z, a); + + return z; +} + +SLEEF_INLINE SLEEF_CONST vfloat_sve_sleef Sleef_erfcfx_u15sve(vfloat_sve_sleef a) { + vfloat_sve_sleef s = a, r = vcast_vf_f_sve_sleef(0), t; + vfloat2_sve_sleef u, d, x; + a = vabs_vf_vf_sve_sleef(a); + vopmask_sve_sleef o0 = vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(1.0)); + vopmask_sve_sleef o1 = vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(2.2)); + vopmask_sve_sleef o2 = vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(4.3)); + vopmask_sve_sleef o3 = vlt_vo_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(10.1)); + + u = vsel_vf2_vo_vf2_vf2_sve_sleef(o1, vcast_vf2_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)), dfdiv_vf2_vf2_vf2_sve_sleef(vcast_vf2_f_f_sve_sleef(1, 0), vcast_vf2_vf_vf_sve_sleef(a, vcast_vf_f_sve_sleef(0)))); + + t = vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(o0, o1, o2, -0.8638041618e-4f, -0.6236977242e-5f, -0.3869504035e+0f, +0.1115344167e+1f); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(o0, o1, o2, +0.6000166177e-3f, +0.5749821503e-4f, +0.1288077235e+1f, -0.9454904199e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(o0, o1, o2, -0.1665703603e-2f, +0.6002851478e-5f, -0.1816803217e+1f, -0.3667259514e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(o0, o1, o2, +0.1795156277e-3f, -0.2851036377e-2f, +0.1249150872e+1f, +0.7155663371e+0f)); + t = vmla_vf_vf_vf_vf_sve_sleef(t, vf2getx_vf_vf2_sve_sleef(u), vsel_vf_vo_vo_vo_f_f_f_f_sve_sleef(o0, o1, o2, +0.1914106123e-1f, +0.2260518074e-1f, -0.1328857988e+0f, -0.1262947265e-1f)); + + d = dfmul_vf2_vf2_vf_sve_sleef(u, t); + d = dfadd2_vf2_vf2_vf2_sve_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.102775359343930288081655368891e+0, -0.105247583459338632253369014063e+0, -0.482365310333045318680618892669e+0, -0.498961546254537647970305302739e+0)); + d = dfmul_vf2_vf2_vf2_sve_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_sve_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.636619483208481931303752546439e+0, -0.635609463574589034216723775292e+0, -0.134450203224533979217859332703e-2, -0.471199543422848492080722832666e-4)); + d = dfmul_vf2_vf2_vf2_sve_sleef(d, u); + d = dfadd2_vf2_vf2_vf2_sve_sleef(d, vsel_vf2_vo_vo_vo_d_d_d_d_sve_sleef(o0, o1, o2, -0.112837917790537404939545770596e+1, -0.112855987376668622084547028949e+1, -0.572319781150472949561786101080e+0, -0.572364030327966044425932623525e+0)); + + x = dfmul_vf2_vf2_vf_sve_sleef(vsel_vf2_vo_vf2_vf2_sve_sleef(o1, d, vcast_vf2_vf_vf_sve_sleef(vneg_vf_vf_sve_sleef(a), vcast_vf_f_sve_sleef(0))), a); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o1, x, dfadd2_vf2_vf2_vf2_sve_sleef(x, d)); + + x = expk2f_sve_sleef(x); + x = vsel_vf2_vo_vf2_vf2_sve_sleef(o1, x, dfmul_vf2_vf2_vf2_sve_sleef(x, u)); + + r = vsel_vf_vo_vf_vf_sve_sleef(o3, vadd_vf_vf_vf_sve_sleef(vf2getx_vf_vf2_sve_sleef(x), vf2gety_vf_vf2_sve_sleef(x)), vcast_vf_f_sve_sleef(0)); + r = vsel_vf_vo_vf_vf_sve_sleef(vsignbit_vo_vf_sve_sleef(s), vsub_vf_vf_vf_sve_sleef(vcast_vf_f_sve_sleef(2), r), r); + r = vsel_vf_vo_vf_vf_sve_sleef(visnan_vo_vf_sve_sleef(s), vcast_vf_f_sve_sleef(__builtin_nanf("")), r); + return r; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/CHANGELOG.md b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CHANGELOG.md new file mode 100644 index 0000000000000..750955336f593 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CHANGELOG.md @@ -0,0 +1,255 @@ +## 3.6.1 - 2024-06-10 + +This patch release provides important bug fixes, including a fix +for API compatibility with 3.5 (#534). +The support and test for some features is still limited, as +documented in [README](./README.md), however significant progress +was made in order to test on Linux, macOS and Windows. + +### Added +- Add support for RISC-V in DFT, QUAD and inline headers (#503, + #522). +- Add GHA workflow to run CI tests on Windows x86 (#540) and macOS + x86/aarch64 (#543). And update test matrix. +- Add GHA workflows to run examples in CI (#550). + +### Changed +- Cleanup/Improve support for RISC-V in LIBM (#520, #521). +- Update supported environment in documentation (#529, #549), + including website and test matrix from README. + +### Fixed +- Major fix and cleanup of CMakeLists.txt (#531). +- Fix compatibility issue after removal of quad and long double + sincospi (#545). Restores functions that are missing in 3.6. +- Various bug fixes (#528, #533, #536, #537). + +## 3.6 - 2024-02-14 + +This release follows a long period of inactivity. The library is now +being actively maintained. However, the support and test for some +features is currently limited, as documented in [README](./README.md). + +### Added +- Add documentation for the quad precision math library +- Enable generation of inline header file for CUDA (PR #337) +- Add support for System/390 z15 support (PR #343) +- Add support for POWER 9 (PR #360) +- Add quad-precision functions (PR #375, #377, #380, #381, #382, #383, + #385, #386, #387) +- Add preliminary support for iOS and Android (PR #388, #389) +- Add OpenMP pragmas to the function declarations in sleef.h to enable + auto-vectorization by GCC (PR #404, #406) +- Add new public CI test infrastructure using GitHub Actions (PR #476) +- Add support for RISC-V in libm (PR #477) + +### Removed +- Remove old CI scripts based on Travis/Jenkins/Appveyor (PR #502) + +### Changed +- Optimise error functions (PR #370) +- Update CMake package config (PR #412) +- Update documentation and move doc/website to main repository (PR #504, + #513) +- Add SLEEF_ prefix to user-facing CMake options (PR #509) +- Disable SVE on Darwin (PR #512) + +### Fixed +- Fix parallel builds with GNU make (PR #491) +- Various bug fixes (PR #492, #499, #508) + +## 3.5.1 - 2020-09-15 +### Changed +- Fixed a bug in handling compiler options + +## 3.5 - 2020-09-01 +- IBM System/390 support is added. +- The library can be built with Clang on Windows. +- Static libraries with LTO can be generated. +- Alternative division and sqrt methods can be chosen with AArch64. +- Header files for inlining the whole SLEEF functions can be generated. +- IEEE remainder function is added. +- GCC-10 can now build SLEEF with SVE support. + +## 3.4.1 - 2019-10-01 +### Changed +- Fixed accuracy problem with tan_u35, atan_u10, log2f_u35 and exp10f_u10. + https://github.com/shibatch/sleef/pull/260 + https://github.com/shibatch/sleef/pull/265 + https://github.com/shibatch/sleef/pull/267 +- SVE intrinsics that are not supported in newer ACLE are replaced. + https://github.com/shibatch/sleef/pull/268 +- FMA4 detection problem is fixed. + https://github.com/shibatch/sleef/pull/262 +- Compilation problem under Windows with MinGW is fixed. + https://github.com/shibatch/sleef/pull/266 + +## 3.4 - 2019-04-28 +### Added +- Faster and low precision functions are added. + https://github.com/shibatch/sleef/pull/229 +- Functions that return consistent results across platforms are + added + https://github.com/shibatch/sleef/pull/216 + https://github.com/shibatch/sleef/pull/224 +- Quad precision math library(libsleefquad) is added + https://github.com/shibatch/sleef/pull/235 + https://github.com/shibatch/sleef/pull/237 + https://github.com/shibatch/sleef/pull/240 +- AArch64 Vector Procedure Call Standard (AAVPCS) support. +### Changed +- Many functions are now faster +- Testers are now faster + +## 3.3.1 - 2018-08-20 +### Added +- FreeBSD support is added +### Changed +- i386 build problem is fixed +- Trigonometric functions now evaluate correctly with full FP + domain. + https://github.com/shibatch/sleef/pull/210 + +## 3.3 - 2018-07-06 +### Added +- SVE target support is added to libsleef. + https://github.com/shibatch/sleef/pull/180 +- SVE target support is added to DFT. With this patch, DFT operations + can be carried out using 256, 512, 1024 and 2048-bit wide vectors + according to runtime availability of vector registers and operators. + https://github.com/shibatch/sleef/pull/182 +- 3.5-ULP versions of sinh, cosh, tanh, sinhf, coshf, tanhf, and the + corresponding testing functionalities are added. + https://github.com/shibatch/sleef/pull/192 +- Power VSX target support is added to libsleef. + https://github.com/shibatch/sleef/pull/195 +- Payne-Hanek like argument reduction is added to libsleef. + https://github.com/shibatch/sleef/pull/197 + +## 3.2 - 2018-02-26 +### Added +- The whole build system of the project migrated from makefiles to + cmake. In particualr this includes `libsleef`, `libsleefgnuabi`, + `libdft` and all the tests. +- Benchmarks that compare `libsleef` vs `SVML` on X86 Linux are + available in the project tree under src/libm-benchmarks directory. +- Extensive upstream testing via Travis CI and Appveyor, on the + following systems: + * OS: Windows / Linux / OSX. + * Compilers: gcc / clang / MSVC. + * Targets: X86 (SSE/AVX/AVX2/AVX512F), AArch64 (Advanced SIMD), ARM + (NEON). Emulators like QEMU or SDE can be used to run the tests. +- Added the following new vector functions (with relative testing): + * `log2` +- New compatibility tests have been added to check that + `libsleefgnuabi` exports the GNUABI symbols correctly. +- The library can be compiled to an LLVM bitcode object. +- Added masked interface to the library to support AVX512F masked + vectorization. + +### Changed +- Use native instructions if available for `sqrt`. +- Fixed fmax and fmin behavior on AArch64: + https://github.com/shibatch/sleef/pull/140 +- Speed improvements for `asin`, `acos`, `fmod` and `log`. Computation + speed of other functions are also improved by general optimization. + https://github.com/shibatch/sleef/pull/97 +- Removed `libm` dependency. + +### Removed +- Makefile build system + +## 3.1 - 2017-07-19 +- Added AArch64 support +- Implemented the remaining C99 math functions : lgamma, tgamma, + erf, erfc, fabs, copysign, fmax, fmin, fdim, trunc, floor, ceil, + round, rint, modf, ldexp, nextafter, frexp, hypot, and fmod. +- Added dispatcher for x86 functions +- Improved reduction of trigonometric functions +- Added support for 32-bit x86, Cygwin, etc. +- Improved tester + +## 3.0 - 2017-02-07 +- New API is defined +- Functions for DFT are added +- sincospi functions are added +- gencoef now supports single, extended and quad precision in addition to double precision +- Linux, Windows and Mac OS X are supported +- GCC, Clang, Intel Compiler, Microsoft Visual C++ are supported +- The library can be compiled as DLLs +- Files needed for creating a debian package are now included + +## 2.120 - 2017-01-30 +- Relicensed to Boost Software License Version 1.0 + +## 2.110 - 2016-12-11 +- The valid range of argument is extended for trig functions +- Specification of each functions regarding to the domain and accuracy is added +- A coefficient generation tool is added +- New testing tools are introduced +- Following functions returned incorrect values when the argument is very large or small : exp, pow, asinh, acosh +- SIMD xsin and xcos returned values more than 1 when FMA is enabled +- Pure C cbrt returned incorrect values when the argument is negative +- tan_u1 returned values with more than 1 ulp of error on rare occasions +- Removed support for Java language(because no one seems using this) + +## 2.100 - 2016-12-04 +- Added support for AVX-512F and Clang Extended Vectors. + +## 2.90 - 2016-11-27 +- Added ilogbf. All the reported bugs(listed below) are fixed. +- Log function returned incorrect values when the argument is very small. +- Signs of returned values were incorrect when the argument is signed zero. +- Tester incorrectly counted ULP in some cases. +- ilogb function returned incorrect values in some cases. + +## 2.80 - 2013-05-18 +- Added support for ARM NEON. Added higher accuracy single + precision functions : sinf_u1, cosf_u1, sincosf_u1, tanf_u1, asinf_u1, + acosf_u1, atanf_u1, atan2f_u1, logf_u1, and cbrtf_u1. + +## 2.70 - 2013-04-30 +- Added higher accuracy functions : sin_u1, cos_u1, sincos_u1, + tan_u1, asin_u1, acos_u1, atan_u1, atan2_u1, log_u1, and + cbrt_u1. These functions evaluate the corresponding function with at + most 1 ulp of error. + +## 2.60 - 2013-03-26 +- Added the remaining single precision functions : powf, sinhf, + coshf, tanhf, exp2f, exp10f, log10f, log1pf. Added support for FMA4 + (for AMD Bulldozer). Added more test cases. Fixed minor bugs (which + degraded accuracy in some rare cases). + +## 2.50 - 2013-03-12 +- Added support for AVX2. SLEEF now compiles with ICC. + +## 2.40 - 2013-03-07 +- Fixed incorrect denormal/nonnumber handling in ldexp, ldexpf, + sinf and cosf. Removed support for Go language. + +## 2.31 - 2012-07-05 +- Added sincosf. + +## 2.30 - 2012-01-20 +- Added single precision functions : sinf, cosf, tanf, asinf, + acosf, atanf, logf, expf, atan2f and cbrtf. + +## 2.20 - 2012-01-09 +- Added exp2, exp10, expm1, log10, log1p, and cbrt. + +## 2.10 - 2012-01-05 +- asin() and acos() are back. +- Added ilogb() and ldexp(). +- Added hyperbolic functions. +- Eliminated dependency on frexp, ldexp, fabs, isnan and isinf. + +## 2.00 - 2011-12-30 +- All of the algorithm has been updated. +- Both accuracy and speed are improved since version 1.10. +- Denormal number handling is also improved. + +## 1.10 - 2010-06-22 +- AVX support is added. Accuracy tester is added. + +## 1.00 - 2010-05-15 +- Initial release diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CMakeLists.txt new file mode 100644 index 0000000000000..a37f1ac104651 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CMakeLists.txt @@ -0,0 +1,339 @@ +cmake_minimum_required(VERSION 3.18) +project(SLEEF VERSION 3.6.1 LANGUAGES C) + +set(SLEEF_SOVERSION ${SLEEF_VERSION_MAJOR}) + +# Options + +option(SLEEF_BUILD_STATIC_TEST_BINS "Build statically linked test executables" OFF) +option(SLEEF_ENABLE_LTO "Enable LTO on GCC or ThinLTO on clang" OFF) +option(SLEEF_BUILD_LIBM "libsleef will be built." ON) +option(SLEEF_BUILD_DFT "libsleefdft will be built." OFF) +option(SLEEF_BUILD_QUAD "libsleefquad will be built." OFF) +option(SLEEF_BUILD_GNUABI_LIBS "libsleefgnuabi will be built." ON) +option(SLEEF_BUILD_SCALAR_LIB "libsleefscalar will be built." OFF) +option(SLEEF_BUILD_TESTS "Tests will be built." ON) +option(SLEEF_BUILD_INLINE_HEADERS "Build header for inlining whole SLEEF functions" OFF) + +option(SLEEF_TEST_ALL_IUT "Perform tests on implementations with all vector extensions" OFF) +option(SLEEF_SHOW_CONFIG "Show SLEEF configuration status messages." ON) +option(SLEEF_SHOW_ERROR_LOG "Show cmake error log." OFF) +option(SLEEF_ASAN "Enable address sanitizing on all targets." OFF) + +option(SLEEF_ENFORCE_TESTER "Build fails if tester is not available" OFF) +option(SLEEF_ENFORCE_TESTER3 "Build fails if tester3 is not built" OFF) + +option(SLEEF_ENABLE_ALTDIV "Enable alternative division method (aarch64 only)" OFF) +option(SLEEF_ENABLE_ALTSQRT "Enable alternative sqrt method (aarch64 only)" OFF) + +option(SLEEF_DISABLE_FFTW "Disable testing the DFT library with FFTW" OFF) +option(SLEEF_DISABLE_MPFR "Disable testing with the MPFR library" OFF) +option(SLEEF_DISABLE_SSL "Disable testing with the SSL library" OFF) + +option(SLEEF_ENABLE_CUDA "Enable CUDA" OFF) +option(SLEEF_ENABLE_CXX "Enable C++" OFF) + +# + +if (DEFINED SLEEF_BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ${SLEEF_BUILD_SHARED_LIBS}) +endif () + +if (SLEEF_SHOW_CONFIG) + # Normalize the value of BUILD_SHARED_LIBS so that it displays nicely + # in the configuration display + if (BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON) + else () + set(BUILD_SHARED_LIBS OFF) + endif () +endif () + +# Function used to generate safe command arguments for add_custom_command +function(command_arguments PROPNAME) + set(quoted_args "") + foreach(arg ${ARGN}) + list(APPEND quoted_args "\"${arg}\"" ) + endforeach() + set(${PROPNAME} ${quoted_args} PARENT_SCOPE) +endfunction() + +# Helper function for concatenating several files +function(sleef_concat_files) + cmake_parse_arguments(concat_required "" "OUTPUT" "SOURCES" ${ARGN}) + if("${concat_required_OUTPUT}" STREQUAL "") + message(FATAL_ERROR "Must pass OUTPUT to sleef_concat_files") + endif() + + if(NOT concat_required_SOURCES) + message(FATAL_ERROR "sleef_concat_files not passed any SOURCES") + endif() + + add_custom_command( + OUTPUT ${concat_required_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E cat ${concat_required_SOURCES} > ${concat_required_OUTPUT} + DEPENDS ${concat_required_SOURCES} + COMMAND_EXPAND_LISTS) +endfunction() + +# Settings + +set(SLEEF_ALL_SUPPORTED_EXTENSIONS + AVX512FNOFMA AVX512F AVX2 AVX2128 FMA4 AVX SSE4 SSE2 # x86 + SVENOFMA SVE ADVSIMDNOFMA ADVSIMD # Aarch64 + NEON32 NEON32VFPV4 # Aarch32 + VSX VSXNOFMA VSX3 VSX3NOFMA # PPC64 + VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z + RVVM1NOFMA RVVM1 RVVM2NOFMA RVVM2 # RISC-V Vectors + PUREC_SCALAR PURECFMA_SCALAR # Generic type + CACHE STRING "List of SIMD architectures supported by libsleef." + ) + +set(SLEEF_SUPPORTED_LIBM_EXTENSIONS + AVX512FNOFMA AVX512F AVX2 AVX2128 FMA4 AVX SSE4 SSE2 # x86 + SVENOFMA SVE ADVSIMDNOFMA ADVSIMD # Aarch64 + NEON32 NEON32VFPV4 # Aarch32 + VSX VSXNOFMA VSX3 VSX3NOFMA # PPC64 + VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z + RVVM1NOFMA RVVM1 RVVM2NOFMA RVVM2 # RISC-V Vectors + PUREC_SCALAR PURECFMA_SCALAR # Generic type + CACHE STRING "List of SIMD architectures supported by libsleef." + ) +set(SLEEF_SUPPORTED_GNUABI_EXTENSIONS + SSE2 AVX AVX2 AVX512F ADVSIMD SVE + CACHE STRING "List of SIMD architectures supported by libsleef for GNU ABI." +) + +set(SLEEF_SUPPORTED_QUAD_EXTENSIONS + PUREC_SCALAR PURECFMA_SCALAR SSE2 AVX2128 AVX2 AVX512F ADVSIMD SVE VSX VSX3 VXE VXE2 RVVM1 RVVM2) + +# MKMASKED_PARAMS + +command_arguments(MKMASKED_PARAMS_GNUABI_AVX512F_dp avx512f e 8) +command_arguments(MKMASKED_PARAMS_GNUABI_AVX512F_sp avx512f e -16) + +command_arguments(MKMASKED_PARAMS_GNUABI_SVE_dp sve s 2) +command_arguments(MKMASKED_PARAMS_GNUABI_SVE_sp sve s -4) + +# + +set(COSTOVERRIDE_AVX512F 10) +set(COSTOVERRIDE_AVX512FNOFMA 10) +set(COSTOVERRIDE_AVX2 2) +set(COSTOVERRIDE_AVX 2) +set(COSTOVERRIDE_NEON32 2) +set(COSTOVERRIDE_NEON32VFPV4 2) +set(COSTOVERRIDE_SVE 10) +set(COSTOVERRIDE_SVENOFMA 10) +set(COSTOVERRIDE_RVVM1 10) +set(COSTOVERRIDE_RVVM1NOFMA 10) +set(COSTOVERRIDE_RVVM2 20) +set(COSTOVERRIDE_RVVM2NOFMA 20) + +# + +enable_testing() + +if (SLEEF_ENABLE_CXX) + enable_language(CXX) +endif() + +if (SLEEF_ENABLE_CUDA) + enable_language(CUDA) +endif() + +# For specifying installation directories +include(GNUInstallDirs) + +if(NOT DEFINED sleef_SOURCE_DIR) + set(sleef_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +endif() + +if(NOT DEFINED sleef_BINARY_DIR) + set(sleef_BINARY_DIR ${CMAKE_BINARY_DIR}) +endif() + +# Sanity check for in-source builds which we do not want to happen +if(sleef_SOURCE_DIR STREQUAL sleef_BINARY_DIR) + message(FATAL_ERROR "SLEEF does not allow in-source builds. +You can refer to docs/build-with-cmake.md for instructions on how provide a \ +separate build directory. Note: Please remove autogenerated file \ +`CMakeCache.txt` and directory `CMakeFiles` in the current directory.") +endif() + +if(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS) + message(FATAL_ERROR "SLEEF_ENABLE_LTO and BUILD_SHARED_LIBS cannot be specified at the same time") +endif(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS) + +if(SLEEF_ENABLE_LTO) + include(CheckIPOSupported) + check_ipo_supported(RESULT supported OUTPUT error) +endif() + +# Set output directories for the library files +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) + +foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${CONFIG} CONFIG) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG} ${PROJECT_BINARY_DIR}/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG} ${PROJECT_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} ${PROJECT_BINARY_DIR}/bin) +endforeach(CONFIG CMAKE_CONFIGURATION_TYPES) + +# Path for finding cmake modules +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) +set(SLEEF_SCRIPT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Scripts CACHE PATH + "Path for finding sleef specific cmake scripts") + +if (CMAKE_C_COMPILER_ID MATCHES "Clang" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + message(STATUS "Building with Clang on Windows") + set(SLEEF_CLANG_ON_WINDOWS TRUE) +endif() + +# sleef-config.h.in passes cmake settings to the source code +include(Configure.cmake) +configure_file( + ${PROJECT_SOURCE_DIR}/sleef-config.h.in + ${PROJECT_BINARY_DIR}/include/sleef-config.h @ONLY) + +# We like to have a documented index of all targets in the project. The +# variables listed below carry the names of the targets defined throughout +# the project. + +# Generates object file (shared library) `libsleef` +# Defined in src/libm/CMakeLists.txt via command add_library +set(TARGET_LIBSLEEF "sleef") +set(TARGET_LIBSLEEFGNUABI "sleefgnuabi") +# Generates the sleef.h headers and all the rename headers +# Defined in src/libm/CMakeLists.txt via custom commands and a custom target +set(TARGET_HEADERS "headers") +set(TARGET_INLINE_HEADERS "inline_headers") +set(TARGET_QINLINE_HEADERS "quad_inline_headers") +set(TARGET_LIBINLINE "sleefinline") +# Generates executable files for running the test suite +# Defined in src/libm-tester/CMakeLists.txt via command add_executable +set(TARGET_TESTER "tester") +set(TARGET_IUT "iut") +# The target to generate LLVM bitcode only, available when SLEEF_ENABLE_LLVM_BITCODE is passed to cmake +set(TARGET_LLVM_BITCODE "llvm-bitcode") +# Generates the helper executable file mkrename needed to write the sleef header +set(TARGET_MKRENAME "mkrename") +set(TARGET_MKRENAME_GNUABI "mkrename_gnuabi") +set(TARGET_MKMASKED_GNUABI "mkmasked_gnuabi") +# Generates the helper executable file mkdisp needed to write the sleef header +set(TARGET_MKDISP "mkdisp") +set(TARGET_MKALIAS "mkalias") +# Generates static library common +# Defined in src/common/CMakeLists.txt via command add_library +set(TARGET_LIBCOMMON_OBJ "common") +set(TARGET_LIBARRAYMAP_OBJ "arraymap") + +# Function used to add an executable that is executed on host +function(add_host_executable TARGETNAME) + if (NOT CMAKE_CROSSCOMPILING) + add_executable(${TARGETNAME} ${ARGN}) + # Ensure that Darwin host executable is built as universal binary + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$") + target_compile_options(${TARGETNAME} PRIVATE -arch "${CMAKE_HOST_SYSTEM_PROCESSOR}") + target_link_options(${TARGETNAME} PRIVATE -arch "${CMAKE_HOST_SYSTEM_PROCESSOR}") + endif() + else() + add_executable(${TARGETNAME} IMPORTED GLOBAL) + set_property(TARGET ${TARGETNAME} PROPERTY IMPORTED_LOCATION ${NATIVE_BUILD_DIR}/bin/${TARGETNAME}) + endif() +endfunction() + +function(host_target_AAVPCS_definitions TARGETNAME) + if (NOT CMAKE_CROSSCOMPILING) + target_compile_definitions(${TARGETNAME} PRIVATE ENABLE_AAVPCS=1) + endif() +endfunction() + +# Generates object file (shared library) `libsleefdft` +# Defined in src/dft/CMakeLists.txt via command add_library +set(TARGET_LIBDFT "sleefdft") + +# Check subdirectories +add_subdirectory("src") + +# Install the CMake package config +include(CMakePackageConfigHelpers) + +write_basic_package_version_file( + sleefConfigVersion.cmake + COMPATIBILITY SameMajorVersion +) + +set( + SLEEF_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sleef" + CACHE STRING "CMake package config location relative to the install prefix" +) + +mark_as_advanced(SLEEF_INSTALL_CMAKEDIR) + +install( + FILES + "${PROJECT_SOURCE_DIR}/sleefConfig.cmake" + "${PROJECT_BINARY_DIR}/sleefConfigVersion.cmake" + DESTINATION "${SLEEF_INSTALL_CMAKEDIR}" + COMPONENT sleef_Development +) + +install( + EXPORT sleefTargets + NAMESPACE sleef:: + DESTINATION "${SLEEF_INSTALL_CMAKEDIR}" + COMPONENT sleef_Development +) + +# Extra messages at configuration time. By default is active, it can be +# turned off by invoking cmake with "-DSLEEF_SHOW_CONFIG=OFF". +if(SLEEF_SHOW_CONFIG) + message(STATUS "Configuring build for ${PROJECT_NAME}-v${SLEEF_VERSION}") + message(" Target system: ${CMAKE_SYSTEM}") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$") + message(" Target processor: ${CMAKE_OSX_ARCHITECTURES}") + else() + message(" Target processor: ${CMAKE_SYSTEM_PROCESSOR}") + endif() + message(" Host system: ${CMAKE_HOST_SYSTEM}") + message(" Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}") + message(" Detected C compiler: ${CMAKE_C_COMPILER_ID} @ ${CMAKE_C_COMPILER}") + message(" CMake: ${CMAKE_VERSION}") + message(" Make program: ${CMAKE_MAKE_PROGRAM}") + if(CMAKE_CROSSCOMPILING) + message(" Crosscompiling SLEEF.") + message(" Native build dir: ${NATIVE_BUILD_DIR}") + endif(CMAKE_CROSSCOMPILING) + message(STATUS "Using option `${SLEEF_C_FLAGS}` to compile libsleef") + message(STATUS "Building shared libs : " ${BUILD_SHARED_LIBS}) + message(STATUS "Building static test bins: " ${SLEEF_BUILD_STATIC_TEST_BINS}) + message(STATUS "MPFR : " ${LIB_MPFR}) + if (MPFR_INCLUDE_DIR) + message(STATUS "MPFR header file in " ${MPFR_INCLUDE_DIR}) + endif() + message(STATUS "GMP : " ${LIBGMP}) + message(STATUS "RT : " ${LIBRT}) + message(STATUS "FFTW3 : " ${LIBFFTW3}) + message(STATUS "OPENSSL : " ${OPENSSL_VERSION}) + message(STATUS "SDE : " ${SDE_COMMAND}) + if (SLEEF_BUILD_INLINE_HEADERS) + message(STATUS "SED : " ${SED_COMMAND}) + endif() + message(STATUS "COMPILER_SUPPORTS_OPENMP : " ${COMPILER_SUPPORTS_OPENMP}) + if(ENABLE_GNUABI) + message(STATUS "A version of SLEEF compatible with libm and libmvec in GNU libc will be produced (${TARGET_LIBSLEEFGNUABI}.so)") + endif() + if (COMPILER_SUPPORTS_SVE) + message(STATUS "Building SLEEF with VLA SVE support") + if (ARMIE_COMMAND) + message(STATUS "Arm Instruction Emulator found at ${ARMIE_COMMAND}") + message(STATUS "SVE testing is done with ${SVE_VECTOR_BITS}-bits vectors.") + endif() + endif() + if(FORCE_AAVPCS) + message(STATUS "Building SLEEF with AArch64 Vector PCS support") + endif() +endif(SLEEF_SHOW_CONFIG) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/CONTRIBUTORS.md b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CONTRIBUTORS.md new file mode 100644 index 0000000000000..c0f269418f384 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/CONTRIBUTORS.md @@ -0,0 +1,27 @@ +# List of contributors + +These lists are not exhaustive and only provide most relevant contact information. +For an exhausitive list of contributors please refer to the +[GitHub contributors section for SLEEF](https://github.com/shibatch/sleef/graphs/contributors). + +## Maintainers + +| Name | Affiliation | Github profile | +| -------------------- | ----------------------- | ---------------------------------- | +| Pierre Blanchard | Arm Ltd. | https://github.com/blapie | +| Joana Cruz | Arm Ltd. | https://github.com/joanaxcruz | +| Joe Ramsay | Arm Ltd. | https://github.com/joeramsay | +| Naoki Shibata | Nara Institute of Science and Technology | https://github.com/shibatch | + +## Contributors + +| Name | Affiliation | Github profile | +| -------------------- | ----------------------- | ---------------------------------- | +| Anonymous | | https://github.com/friendlyanon | +| Diana Bite | Former Arm Ltd. | https://github.com/diaena | +| Ludovic Henry | Rivos Inc. | https://github.com/luhenry | +| Martin Krastev | Chaos Group | https://github.com/blu | +| Jilayne Lovejoy | Former Arm Inc. | https://github.com/jlovejoy | +| Kerry McLaughlin | Arm Ltd. | https://github.com/kmclaughlin-arm | +| Alexandre Mutel | Unity Technologies | https://github.com/xoofx | +| Francesco Petrogalli | Former Arm Ltd. | https://github.com/fpetrogalli-arm | diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/Configure.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/Configure.cmake new file mode 100644 index 0000000000000..d78fc0bccaa7a --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/Configure.cmake @@ -0,0 +1,860 @@ +include(CheckCCompilerFlag) +include(CheckCSourceCompiles) +include(CheckTypeSize) +include(CheckLanguage) + +# + +if (SLEEF_BUILD_STATIC_TEST_BINS) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(BUILD_SHARED_LIBS OFF) + set(CMAKE_EXE_LINKER_FLAGS "-static") +endif() + +set(OPENSSL_EXTRA_LIBRARIES "" CACHE STRING "Extra libraries for openssl") +if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL) + if (SLEEF_BUILD_STATIC_TEST_BINS) + set(OPENSSL_USE_STATIC_LIBS TRUE) + endif() + find_package(OpenSSL) + if (OPENSSL_FOUND) + set(SLEEF_OPENSSL_FOUND TRUE) + set(SLEEF_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES}) + # Work around for tester3 sig segv, when linking versions of openssl (1.1.1) statically. + # This is a known issue https://github.com/openssl/openssl/issues/13872. + if (SLEEF_BUILD_STATIC_TEST_BINS) + string(REGEX REPLACE + "-lpthread" "-Wl,--whole-archive -lpthread -Wl,--no-whole-archive" + SLEEF_OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}") + endif() + set(SLEEF_OPENSSL_VERSION ${OPENSSL_VERSION}) + set(SLEEF_OPENSSL_LIBRARIES ${SLEEF_OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES}) + set(SLEEF_OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}) + endif() +else() + # find_package cannot find OpenSSL when cross-compiling + find_library(LIBSSL ssl) + find_library(LIBCRYPTO crypto) + if (LIBSSL AND LIBCRYPTO) + set(SLEEF_OPENSSL_FOUND TRUE) + set(SLEEF_OPENSSL_LIBRARIES ${LIBSSL} ${LIBCRYPTO} ${OPENSSL_EXTRA_LIBRARIES}) + set(SLEEF_OPENSSL_VERSION ${LIBSSL}) + endif() +endif() + +if (SLEEF_ENFORCE_TESTER3 AND NOT SLEEF_OPENSSL_FOUND) + message(FATAL_ERROR "SLEEF_ENFORCE_TESTER3 is specified and OpenSSL not found") +endif() + +# Some toolchains require explicit linking of the libraries following. +find_library(LIB_MPFR mpfr) +find_library(LIBM m) +find_library(LIBGMP gmp) +find_library(LIBRT rt) +find_library(LIBFFTW3 fftw3) + +if (LIB_MPFR) + find_path(MPFR_INCLUDE_DIR + NAMES mpfr.h + ONLY_CMAKE_FIND_ROOT_PATH) +endif(LIB_MPFR) + +if (LIBFFTW3) + find_path(FFTW3_INCLUDE_DIR + NAMES fftw3.h + ONLY_CMAKE_FIND_ROOT_PATH) +endif(LIBFFTW3) + +if (NOT LIBM) + set(LIBM "") +endif() + +if (NOT LIBRT) + set(LIBRT "") +endif() + +if (SLEEF_DISABLE_MPFR) + set(LIB_MPFR "") +endif() + +if (SLEEF_DISABLE_SSL) + set(SLEEF_OPENSSL_FOUND FALSE) +endif() + +# Force set default build type if none was specified +# Note: some sleef code requires the optimisation flags turned on +if(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'Release' (required for full support).") + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "RelWithDebInfo" "MinSizeRel") +endif() + +# Sanitizers +if(SLEEF_ASAN) + # Add address sanitizing to all targets + add_compile_options(-fno-omit-frame-pointer -fsanitize=address) + add_link_options(-fno-omit-frame-pointer -fsanitize=address) +endif() + +# TARGET PROCESSOR DETECTION +set(SLEEF_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}") +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$") + set(SLEEF_TARGET_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}") +endif() + +# PLATFORM DETECTION +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(SLEEF_ARCH_32BIT ON CACHE INTERNAL "True for 32-bit architecture.") +endif() + +if(SLEEF_TARGET_PROCESSOR MATCHES "(x86|AMD64|amd64|^i.86$)") + set(SLEEF_ARCH_X86 ON CACHE INTERNAL "True for x86 architecture.") + + set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-mavx2;-mfma") +elseif(SLEEF_TARGET_PROCESSOR MATCHES "aarch64|arm64") + set(SLEEF_ARCH_AARCH64 ON CACHE INTERNAL "True for Aarch64 architecture.") + # Aarch64 requires support for advsimdfma4 + set(COMPILER_SUPPORTS_ADVSIMD 1) + set(COMPILER_SUPPORTS_ADVSIMDNOFMA 1) + +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + set(SLEEF_ARCH_AARCH32 ON CACHE INTERNAL "True for Aarch32 architecture.") + set(COMPILER_SUPPORTS_NEON32 1) + set(COMPILER_SUPPORTS_NEON32VFPV4 1) + + set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-mfpu=vfpv4") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") + set(SLEEF_ARCH_PPC64 ON CACHE INTERNAL "True for PPC64 architecture.") + + set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-mvsx") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x") + set(SLEEF_ARCH_S390X ON CACHE INTERNAL "True for IBM Z architecture.") + + set(CLANG_FLAGS_ENABLE_PUREC_SCALAR "-march=z14;-mzvector") + set(CLANG_FLAGS_ENABLE_PURECFMA_SCALAR "-march=z14;-mzvector") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") + set(SLEEF_ARCH_RISCV64 ON CACHE INTERNAL "True for RISCV64 architecture.") +endif() + +set(COMPILER_SUPPORTS_PUREC_SCALAR 1) +set(COMPILER_SUPPORTS_PURECFMA_SCALAR 1) + +# Compiler feature detection + +# Detect CLANG executable path (on both Windows and Linux/OSX) +if(NOT CLANG_EXE_PATH) + # If the current compiler used by CMAKE is already clang, use this one directly + if(CMAKE_C_COMPILER MATCHES "clang") + set(CLANG_EXE_PATH ${CMAKE_C_COMPILER}) + else() + # Else we may find clang on the path? + find_program(CLANG_EXE_PATH NAMES clang "clang-11" "clang-10" "clang-9" "clang-8" "clang-7" "clang-6.0" "clang-5.0" "clang-4.0" "clang-3.9") + endif() +endif() + +# Allow to define the Gcc/Clang here +# As we might compile the lib with MSVC, but generates bitcode with CLANG +# Intel vector extensions. +set(CLANG_FLAGS_ENABLE_SSE2 "-msse2") +set(CLANG_FLAGS_ENABLE_SSE4 "-msse4.1") +set(CLANG_FLAGS_ENABLE_AVX "-mavx") +set(CLANG_FLAGS_ENABLE_FMA4 "-mfma4") +set(CLANG_FLAGS_ENABLE_AVX2 "-mavx2;-mfma") +set(CLANG_FLAGS_ENABLE_AVX2128 "-mavx2;-mfma") +set(CLANG_FLAGS_ENABLE_AVX512F "-mavx512f") +set(CLANG_FLAGS_ENABLE_AVX512FNOFMA "-mavx512f") +set(CLANG_FLAGS_ENABLE_NEON32 "--target=arm-linux-gnueabihf;-mcpu=cortex-a8") +set(CLANG_FLAGS_ENABLE_NEON32VFPV4 "-march=armv7-a;-mfpu=neon-vfpv4") +# Arm AArch64 vector extensions. +set(CLANG_FLAGS_ENABLE_SVE "-march=armv8-a+sve") +set(CLANG_FLAGS_ENABLE_SVENOFMA "-march=armv8-a+sve") +# PPC64 +set(CLANG_FLAGS_ENABLE_VSX "-mcpu=power8") +set(CLANG_FLAGS_ENABLE_VSXNOFMA "-mcpu=power8") +set(CLANG_FLAGS_ENABLE_VSX3 "-mcpu=power9") +set(CLANG_FLAGS_ENABLE_VSX3NOFMA "-mcpu=power9") +# IBM z +set(CLANG_FLAGS_ENABLE_VXE "-march=z14;-mzvector") +set(CLANG_FLAGS_ENABLE_VXENOFMA "-march=z14;-mzvector") +set(CLANG_FLAGS_ENABLE_VXE2 "-march=z15;-mzvector") +set(CLANG_FLAGS_ENABLE_VXE2NOFMA "-march=z15;-mzvector") +# RISC-V +set(CLANG_FLAGS_ENABLE_RVVM1 "-march=rv64gcv_zba_zbb_zbs") +set(CLANG_FLAGS_ENABLE_RVVM1NOFMA "-march=rv64gcv_zba_zbb_zbs") +set(CLANG_FLAGS_ENABLE_RVVM2 "-march=rv64gcv_zba_zbb_zbs") +set(CLANG_FLAGS_ENABLE_RVVM2NOFMA "-march=rv64gcv_zba_zbb_zbs") + +set(FLAGS_OTHERS "") + +# All variables storing compiler flags should be prefixed with FLAGS_ +if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)") + # Always compile sleef with -ffp-contract. + set(FLAGS_STRICTMATH "-ffp-contract=off") + set(FLAGS_FASTMATH "-ffast-math") + set(FLAGS_NOSTRICTALIASING "-fno-strict-aliasing") + + if (SLEEF_ARCH_X86 AND SLEEF_ARCH_32BIT) + string(CONCAT FLAGS_STRICTMATH ${FLAGS_STRICTMATH} " -msse2 -mfpmath=sse") + string(CONCAT FLAGS_FASTMATH ${FLAGS_FASTMATH} " -msse2 -mfpmath=sse") + endif() + + # Without the options below, gcc generates calls to libm + string(CONCAT FLAGS_OTHERS "-fno-math-errno -fno-trapping-math") + + # Intel vector extensions. + foreach(SIMD ${SLEEF_ALL_SUPPORTED_EXTENSIONS}) + set(FLAGS_ENABLE_${SIMD} ${CLANG_FLAGS_ENABLE_${SIMD}}) + endforeach() + + # Warning flags. + set(FLAGS_WALL "-Wall -Wno-unused-function -Wno-attributes -Wno-unused-result") + if(CMAKE_C_COMPILER_ID MATCHES "GNU") + # The following compiler option is needed to suppress the warning + # "AVX vector return without AVX enabled changes the ABI" at + # src/arch/helpervecext.h:88 + string(CONCAT FLAGS_WALL ${FLAGS_WALL} " -Wno-psabi") + set(FLAGS_ENABLE_NEON32 "-mfpu=neon") + endif(CMAKE_C_COMPILER_ID MATCHES "GNU") + + if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND SLEEF_ENABLE_LTO) + if (NOT SLEEF_LLVM_AR_COMMAND) + find_program(SLEEF_LLVM_AR_COMMAND "llvm-ar") + endif() + if (SLEEF_LLVM_AR_COMMAND) + SET(CMAKE_AR ${SLEEF_LLVM_AR_COMMAND}) + SET(CMAKE_C_ARCHIVE_CREATE " rcs ") + SET(CMAKE_C_ARCHIVE_FINISH "true") + endif(SLEEF_LLVM_AR_COMMAND) + string(CONCAT FLAGS_OTHERS "-flto=thin") + endif(CMAKE_C_COMPILER_ID MATCHES "Clang" AND SLEEF_ENABLE_LTO) + + # Flags for generating inline headers + set(FLAG_PREPROCESS "-E") + set(FLAG_PRESERVE_COMMENTS "-C") + set(FLAG_INCLUDE "-I") + set(FLAG_DEFINE "-D") + + if (SLEEF_CLANG_ON_WINDOWS) + # The following line is required to prevent clang from displaying + # many warnings. Clang on Windows references MSVC header files, + # which have deprecation and security attributes for many + # functions. + + string(CONCAT FLAGS_WALL ${FLAGS_WALL} " -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -Wno-deprecated-declarations") + endif() +elseif(MSVC) + # Intel vector extensions. + if (CMAKE_CL_64) + set(FLAGS_ENABLE_SSE2 /D__SSE2__) + set(FLAGS_ENABLE_SSE4 /D__SSE2__ /D__SSE3__ /D__SSE4_1__) + else() + set(FLAGS_ENABLE_SSE2 /D__SSE2__ /arch:SSE2) + set(FLAGS_ENABLE_SSE4 /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /arch:SSE2) + endif() + set(FLAGS_ENABLE_AVX /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /arch:AVX) + set(FLAGS_ENABLE_FMA4 /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /D__FMA4__ /arch:AVX2) + set(FLAGS_ENABLE_AVX2 /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /arch:AVX2) + set(FLAGS_ENABLE_AVX2128 /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /arch:AVX2) + set(FLAGS_ENABLE_AVX512F /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /D__AVX512F__ /arch:AVX2) + set(FLAGS_ENABLE_AVX512FNOFMA /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /D__AVX512F__ /arch:AVX2) + set(FLAGS_ENABLE_PURECFMA_SCALAR /D__SSE2__ /D__SSE3__ /D__SSE4_1__ /D__AVX__ /D__AVX2__ /arch:AVX2) + set(FLAGS_WALL "/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE") + + set(FLAGS_NO_ERRNO "") + + set(FLAG_PREPROCESS "/E") + set(FLAG_PRESERVE_COMMENTS "/C") + set(FLAG_INCLUDE "/I") + set(FLAG_DEFINE "/D") +elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") + set(FLAGS_ENABLE_SSE2 "-msse2") + set(FLAGS_ENABLE_SSE4 "-msse4.1") + set(FLAGS_ENABLE_AVX "-mavx") + set(FLAGS_ENABLE_AVX2 "-march=core-avx2") + set(FLAGS_ENABLE_AVX2128 "-march=core-avx2") + set(FLAGS_ENABLE_AVX512F "-xCOMMON-AVX512") + set(FLAGS_ENABLE_AVX512FNOFMA "-xCOMMON-AVX512") + set(FLAGS_ENABLE_PURECFMA_SCALAR "-march=core-avx2;-fno-strict-aliasing") + set(FLAGS_ENABLE_FMA4 "-msse2") # This is a dummy flag + if(CMAKE_C_COMPILER_ID MATCHES "IntelLLVM") + set(FLAGS_STRICTMATH "-fp-model strict -Qoption,cpp,--extended_float_types") + set(FLAGS_FASTMATH "-fp-model fast -Qoption,cpp,--extended_float_types") + else() + set(FLAGS_STRICTMATH "-fp-model strict -Qoption,cpp,--extended_float_type") + set(FLAGS_FASTMATH "-fp-model fast=2 -Qoption,cpp,--extended_float_type") + endif() + set(FLAGS_NOSTRICTALIASING "-fno-strict-aliasing") + set(FLAGS_WALL "-fmax-errors=3 -Wall -Wno-unused -Wno-attributes") + + set(FLAGS_NO_ERRNO "") + + set(FLAG_PREPROCESS "-E") + set(FLAG_PRESERVE_COMMENTS "-C") + set(FLAG_INCLUDE "-I") + set(FLAG_DEFINE "-D") +endif() + +set(SLEEF_C_FLAGS "${FLAGS_WALL} ${FLAGS_STRICTMATH} ${FLAGS_OTHERS}") +if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 6.99) + set(DFT_C_FLAGS "${FLAGS_WALL} ${FLAGS_NOSTRICTALIASING} ${FLAGS_OTHERS}") +else() + set(DFT_C_FLAGS "${FLAGS_WALL} ${FLAGS_NOSTRICTALIASING} ${FLAGS_FASTMATH} ${FLAGS_OTHERS}") +endif() + +if(CMAKE_C_COMPILER_ID MATCHES "GNU") + set(FLAGS_ENABLE_SVE "${FLAGS_ENABLE_SVE};-fno-tree-vrp") +endif() + +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$" AND CMAKE_C_COMPILER_ID MATCHES "GNU") + set(SLEEF_C_FLAGS "${SLEEF_C_FLAGS} -msse2 -mfpmath=sse") + set(DFT_C_FLAGS "${DFT_C_FLAGS} -msse2 -mfpmath=sse -m128bit-long-double") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$" AND CMAKE_C_COMPILER_ID MATCHES "Clang") + set(SLEEF_C_FLAGS "${SLEEF_C_FLAGS} -msse2 -mfpmath=sse") + set(DFT_C_FLAGS "${DFT_C_FLAGS} -msse2 -mfpmath=sse") +endif() + +if(CYGWIN OR MINGW) + set(SLEEF_C_FLAGS "${SLEEF_C_FLAGS} -fno-asynchronous-unwind-tables") + set(DFT_C_FLAGS "${DFT_C_FLAGS} -fno-asynchronous-unwind-tables") +endif() + +if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" AND CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 10.2) + set(SLEEF_C_FLAGS "${SLEEF_C_FLAGS} -fno-shrink-wrap -fno-tree-vrp") + set(DFT_C_FLAGS "${DFT_C_FLAGS} -fno-shrink-wrap -fno-tree-vrp") +endif() + +# FEATURE DETECTION + +# Long double + +option(SLEEF_DISABLE_LONG_DOUBLE "Disable long double" OFF) +option(SLEEF_ENFORCE_LONG_DOUBLE "Build fails if long double is not supported by the compiler" OFF) + +if(NOT SLEEF_DISABLE_LONG_DOUBLE) + CHECK_TYPE_SIZE("long double" LD_SIZE) + if(LD_SIZE GREATER "9") + # This is needed to check since internal compiler error occurs with gcc 4.x + CHECK_C_SOURCE_COMPILES(" + typedef long double vlongdouble __attribute__((vector_size(sizeof(long double)*2))); + vlongdouble vcast_vl_l(long double d) { return (vlongdouble) { d, d }; } + int main() { vlongdouble vld = vcast_vl_l(0); + }" COMPILER_SUPPORTS_LONG_DOUBLE) + endif() +else() + message(STATUS "Support for long double disabled by CMake option") +endif() + +if (SLEEF_ENFORCE_LONG_DOUBLE AND NOT COMPILER_SUPPORTS_LONG_DOUBLE) + message(FATAL_ERROR "SLEEF_ENFORCE_LONG_DOUBLE is specified and that feature is disabled or not supported by the compiler") +endif() + +# float128 + +option(SLEEF_DISABLE_FLOAT128 "Disable float128" OFF) +option(SLEEF_ENFORCE_FLOAT128 "Build fails if float128 is not supported by the compiler" OFF) + +if(NOT SLEEF_DISABLE_FLOAT128) + CHECK_C_SOURCE_COMPILES(" + int main() { __float128 r = 1; + }" COMPILER_SUPPORTS_FLOAT128) +else() + message(STATUS "Support for float128 disabled by CMake option") +endif() + +if (SLEEF_ENFORCE_FLOAT128 AND NOT COMPILER_SUPPORTS_FLOAT128) + message(FATAL_ERROR "SLEEF_ENFORCE_FLOAT128 is specified and that feature is disabled or not supported by the compiler") +endif() + +if(COMPILER_SUPPORTS_FLOAT128) + CHECK_C_SOURCE_COMPILES(" + #include + int main() { __float128 r = 1; + }" COMPILER_SUPPORTS_QUADMATH) +endif() + +# SSE2 + +option(SLEEF_DISABLE_SSE2 "Disable SSE2" OFF) +option(SLEEF_ENFORCE_SSE2 "Build fails if SSE2 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_SSE2) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE2}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + int main() { + __m128d r = _mm_mul_pd(_mm_set1_pd(1), _mm_set1_pd(2)); }" + COMPILER_SUPPORTS_SSE2) +endif() + +if (SLEEF_ENFORCE_SSE2 AND NOT COMPILER_SUPPORTS_SSE2) + message(FATAL_ERROR "SLEEF_ENFORCE_SSE2 is specified and that feature is disabled or not supported by the compiler") +endif() + +# SSE 4.1 + +option(SLEEF_DISABLE_SSE4 "Disable SSE4" OFF) +option(SLEEF_ENFORCE_SSE4 "Build fails if SSE4 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_SSE4) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE4}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + int main() { + __m128d r = _mm_floor_sd(_mm_set1_pd(1), _mm_set1_pd(2)); }" + COMPILER_SUPPORTS_SSE4) +endif() + +if (SLEEF_ENFORCE_SSE4 AND NOT COMPILER_SUPPORTS_SSE4) + message(FATAL_ERROR "SLEEF_ENFORCE_SSE4 is specified and that feature is disabled or not supported by the compiler") +endif() + +# AVX + +option(SLEEF_ENFORCE_AVX "Disable AVX" OFF) +option(SLEEF_ENFORCE_AVX "Build fails if AVX is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + int main() { + __m256d r = _mm256_add_pd(_mm256_set1_pd(1), _mm256_set1_pd(2)); + }" COMPILER_SUPPORTS_AVX) +endif() + +if (SLEEF_ENFORCE_AVX AND NOT COMPILER_SUPPORTS_AVX) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX is specified and that feature is disabled or not supported by the compiler") +endif() + +# FMA4 + +option(SLEEF_DISABLE_FMA4 "Disable FMA4" OFF) +option(SLEEF_ENFORCE_FMA4 "Build fails if FMA4 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_FMA4) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_FMA4}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + int main() { + __m256d r = _mm256_macc_pd(_mm256_set1_pd(1), _mm256_set1_pd(2), _mm256_set1_pd(3)); }" + COMPILER_SUPPORTS_FMA4) +endif() + +if (SLEEF_ENFORCE_FMA4 AND NOT COMPILER_SUPPORTS_FMA4) + message(FATAL_ERROR "SLEEF_ENFORCE_FMA4 is specified and that feature is disabled or not supported by the compiler") +endif() + +# AVX2 + +option(SLEEF_DISABLE_AVX2 "Disable AVX2" OFF) +option(SLEEF_ENFORCE_AVX2 "Build fails if AVX2 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX2) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX2}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + int main() { + __m256i r = _mm256_abs_epi32(_mm256_set1_epi32(1)); }" + COMPILER_SUPPORTS_AVX2) + + # AVX2 implies AVX2128 + if(COMPILER_SUPPORTS_AVX2) + set(COMPILER_SUPPORTS_AVX2128 1) + endif() +endif() + +if (SLEEF_ENFORCE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX2 is specified and that feature is disabled or not supported by the compiler") +endif() + +# AVX512F + +option(SLEEF_DISABLE_AVX512F "Disable AVX512F" OFF) +option(SLEEF_ENFORCE_AVX512F "Build fails if AVX512F is not supported by the compiler" OFF) + +if(SLEEF_ARCH_X86 AND NOT SLEEF_DISABLE_AVX512F) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX512F}") + CHECK_C_SOURCE_COMPILES(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + __m512 addConstant(__m512 arg) { + return _mm512_add_ps(arg, _mm512_set1_ps(1.f)); + } + int main() { + __m512i a = _mm512_set1_epi32(1); + __m256i ymm = _mm512_extracti64x4_epi64(a, 0); + __mmask16 m = _mm512_cmp_epi32_mask(a, a, _MM_CMPINT_EQ); + __m512i r = _mm512_andnot_si512(a, a); }" + COMPILER_SUPPORTS_AVX512F) + + if (COMPILER_SUPPORTS_AVX512F) + set(COMPILER_SUPPORTS_AVX512FNOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_AVX512F AND NOT COMPILER_SUPPORTS_AVX512F) + message(FATAL_ERROR "SLEEF_ENFORCE_AVX512F is specified and that feature is disabled or not supported by the compiler") +endif() + +# SVE + +option(SLEEF_DISABLE_SVE "Disable SVE" OFF) +option(SLEEF_ENFORCE_SVE "Build fails if SVE is not supported by the compiler" OFF) + +# Darwin does not support SVE yet (see issue #474), +# therefore we disable SVE on Darwin systems. +if(SLEEF_ARCH_AARCH64 AND NOT SLEEF_DISABLE_SVE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SVE}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + svint32_t r = svdup_n_s32(1); }" + COMPILER_SUPPORTS_SVE) + + if(COMPILER_SUPPORTS_SVE) + set(COMPILER_SUPPORTS_SVENOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_SVE AND NOT COMPILER_SUPPORTS_SVE) + message(FATAL_ERROR "SLEEF_ENFORCE_SVE is specified and that feature is disabled or not supported by the compiler") +endif() + +# VSX + +option(SLEEF_DISABLE_VSX "Disable VSX" OFF) +option(SLEEF_ENFORCE_VSX "Build fails if VSX is not supported by the compiler" OFF) + +if(SLEEF_ARCH_PPC64 AND NOT SLEEF_DISABLE_VSX) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VSX}") + CHECK_C_SOURCE_COMPILES(" + #include + #ifndef __LITTLE_ENDIAN__ + #error \"Only VSX(ISA2.07) little-endian mode is supported \" + #endif + int main() { + vector double d; + vector unsigned char p = { + 4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11 + }; + d = vec_perm(d, d, p); + }" + COMPILER_SUPPORTS_VSX) + + if (COMPILER_SUPPORTS_VSX) + set(COMPILER_SUPPORTS_VSXNOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_VSX AND NOT COMPILER_SUPPORTS_VSX) + message(FATAL_ERROR "SLEEF_ENFORCE_VSX is specified and that feature is disabled or not supported by the compiler") +endif() + +# VSX3 + +option(SLEEF_DISABLE_VSX3 "Disable VSX3" OFF) +option(SLEEF_ENFORCE_VSX3 "Build fails if VSX3 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_PPC64 AND NOT SLEEF_DISABLE_VSX3) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VSX3}") + CHECK_C_SOURCE_COMPILES(" + #include + #ifndef __LITTLE_ENDIAN__ + #error \"Only VSX3 little-endian mode is supported \" + #endif + int main() { + static vector double d; + static vector unsigned long long a, b; + + d = vec_insert_exp(a, b); + }" + COMPILER_SUPPORTS_VSX3) + + if (COMPILER_SUPPORTS_VSX3) + set(COMPILER_SUPPORTS_VSX3NOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_VSX3 AND NOT COMPILER_SUPPORTS_VSX3) + message(FATAL_ERROR "SLEEF_ENFORCE_VSX3 is specified and that feature is disabled or not supported by the compiler") +endif() + +# IBM Z + +option(SLEEF_DISABLE_VXE "Disable VXE" OFF) +option(SLEEF_ENFORCE_VXE "Build fails if VXE is not supported by the compiler" OFF) + +if(SLEEF_ARCH_S390X AND NOT SLEEF_DISABLE_VXE) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VXE}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + __vector float d; + d = vec_sqrt(d); + }" + COMPILER_SUPPORTS_VXE) + + if(COMPILER_SUPPORTS_VXE) + set(COMPILER_SUPPORTS_VXENOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_VXE AND NOT COMPILER_SUPPORTS_VXE) + message(FATAL_ERROR "SLEEF_ENFORCE_VXE is specified and that feature is disabled or not supported by the compiler") +endif() + +# + +option(SLEEF_DISABLE_VXE2 "Disable VXE2" OFF) +option(SLEEF_ENFORCE_VXE2 "Build fails if VXE2 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_S390X AND NOT SLEEF_DISABLE_VXE2) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VXE2}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + __vector float d; + d = vec_sqrt(d); + }" + COMPILER_SUPPORTS_VXE2) + + if(COMPILER_SUPPORTS_VXE2) + set(COMPILER_SUPPORTS_VXE2NOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_VXE2 AND NOT COMPILER_SUPPORTS_VXE2) + message(FATAL_ERROR "SLEEF_ENFORCE_VXE2 is specified and that feature is disabled or not supported by the compiler") +endif() + +# RVVM1 + +option(SLEEF_DISABLE_RVVM1 "Disable RVVM1" OFF) +option(SLEEF_ENFORCE_RVVM1 "Build fails if RVVM1 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_RISCV64 AND NOT SLEEF_DISABLE_RVVM1) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_RVVM1}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + vint32m1_t r = __riscv_vmv_v_x_i32m1(1, __riscv_vlenb() * 8 / 32); }" + COMPILER_SUPPORTS_RVVM1) + + if(COMPILER_SUPPORTS_RVVM1) + set(COMPILER_SUPPORTS_RVVM1NOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_RVVM1 AND NOT COMPILER_SUPPORTS_RVVM1) + message(FATAL_ERROR "SLEEF_ENFORCE_RVVM1 is specified and that feature is disabled or not supported by the compiler") +endif() + +# RVVM2 + +option(SLEEF_DISABLE_RVVM2 "Disable RVVM2" OFF) +option(SLEEF_ENFORCE_RVVM2 "Build fails if RVVM2 is not supported by the compiler" OFF) + +if(SLEEF_ARCH_RISCV64 AND NOT SLEEF_DISABLE_RVVM2) + string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_RVVM2}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + vint32m2_t r = __riscv_vmv_v_x_i32m2(1, 2 * __riscv_vlenb() * 8 / 32); }" + COMPILER_SUPPORTS_RVVM2) + + if(COMPILER_SUPPORTS_RVVM2) + set(COMPILER_SUPPORTS_RVVM2NOFMA 1) + endif() +endif() + +if (SLEEF_ENFORCE_RVVM2 AND NOT COMPILER_SUPPORTS_RVVM2) + message(FATAL_ERROR "SLEEF_ENFORCE_RVVM2 is specified and that feature is disabled or not supported by the compiler") +endif() + +# CUDA + +option(SLEEF_ENFORCE_CUDA "Build fails if CUDA is not supported" OFF) + +if (SLEEF_ENFORCE_CUDA AND NOT CMAKE_CUDA_COMPILER) + message(FATAL_ERROR "SLEEF_ENFORCE_CUDA is specified and that feature is disabled or not supported by the compiler") +endif() + +# OpenMP + +option(SLEEF_DISABLE_OPENMP "Disable OPENMP" OFF) +option(SLEEF_ENFORCE_OPENMP "Build fails if OPENMP is not supported by the compiler" OFF) + +if(NOT SLEEF_DISABLE_OPENMP) + find_package(OpenMP) + # Check if compilation with OpenMP really succeeds + # It might not succeed even though find_package(OpenMP) succeeds. + if(OPENMP_FOUND) + set (CMAKE_REQUIRED_FLAGS "${OpenMP_C_FLAGS}") + CHECK_C_SOURCE_COMPILES(" + #include + int main() { + int i; + #pragma omp parallel for + for(i=0;i < 10;i++) { putchar(0); } + }" + COMPILER_SUPPORTS_OPENMP) + + CHECK_C_SOURCE_COMPILES(" + #pragma omp declare simd notinbranch + double func(double x) { return x + 1; } + double a[1024]; + int main() { + #pragma omp parallel for simd + for (int i = 0; i < 1024; i++) a[i] = func(a[i]); + } + " + COMPILER_SUPPORTS_OMP_SIMD) + endif(OPENMP_FOUND) +else() + message(STATUS "Support for OpenMP disabled by CMake option") +endif() + +if (SLEEF_ENFORCE_OPENMP AND NOT COMPILER_SUPPORTS_OPENMP) + message(FATAL_ERROR "SLEEF_ENFORCE_OPENMP is specified and that feature is disabled or not supported by the compiler") +endif() + +# Weak aliases + +CHECK_C_SOURCE_COMPILES(" +#if defined(__CYGWIN__) +#define EXPORT __stdcall __declspec(dllexport) +#else +#define EXPORT +#endif + EXPORT int f(int a) { + return a + 2; + } + EXPORT int g(int a) __attribute__((weak, alias(\"f\"))); + int main(void) { + return g(2); + }" + COMPILER_SUPPORTS_WEAK_ALIASES) +if (COMPILER_SUPPORTS_WEAK_ALIASES AND + NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND + NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND + NOT SLEEF_CLANG_ON_WINDOWS AND + NOT MINGW AND SLEEF_BUILD_GNUABI_LIBS) + set(ENABLE_GNUABI ${COMPILER_SUPPORTS_WEAK_ALIASES}) +endif() + +# Built-in math functions + +CHECK_C_SOURCE_COMPILES(" + int main(void) { + double a = __builtin_sqrt (2); + float b = __builtin_sqrtf(2); + }" + COMPILER_SUPPORTS_BUILTIN_MATH) + +# SYS_getrandom + +CHECK_C_SOURCE_COMPILES(" +#define _GNU_SOURCE +#include +#include +#include + int main(void) { + int i; + syscall(SYS_getrandom, &i, sizeof(i), 0); + }" + COMPILER_SUPPORTS_SYS_GETRANDOM) + +# + +# Reset used flags +set(CMAKE_REQUIRED_FLAGS) +set(CMAKE_REQUIRED_LIBRARIES) + +# Save the default C flags +set(ORG_CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) + +## + +# Check if sde64 command is available + +find_program(SDE_COMMAND sde64) +if (NOT SDE_COMMAND) + find_program(SDE_COMMAND sde) +endif() + +# Check if armie command is available + +find_program(ARMIE_COMMAND armie) +if (NOT SVE_VECTOR_BITS) + set(SVE_VECTOR_BITS 128) +endif() + +# + +find_program(FILECHECK_COMMAND NAMES FileCheck FileCheck-11 FileCheck-10 FileCheck-9) + +# + +find_program(SED_COMMAND sed) + +## + +if(SLEEF_SHOW_ERROR_LOG) + if (EXISTS ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeError.log) + file(READ ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeError.log FILE_CONTENT) + message("") + message("") + message("====== Content of CMakeError.log ======") + message("") + message("${FILE_CONTENT}") + message("") + message("======== End of CMakeError.log ========") + message("") + message("") + endif() +endif(SLEEF_SHOW_ERROR_LOG) + +if (MSVC OR SLEEF_CLANG_ON_WINDOWS) + set(COMPILER_SUPPORTS_OPENMP FALSE) # At this time, OpenMP is not supported on MSVC +endif() + +## + +# Set common definitions + +if (NOT BUILD_SHARED_LIBS) + set(COMMON_TARGET_DEFINITIONS SLEEF_STATIC_LIBS=1) + set(SLEEF_STATIC_LIBS 1) +endif() + +if (COMPILER_SUPPORTS_WEAK_ALIASES) + set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} ENABLE_ALIAS=1) +endif() + +if (COMPILER_SUPPORTS_SYS_GETRANDOM) + set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} ENABLE_SYS_getrandom=1) +endif() diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/LICENSE.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/LICENSE.txt new file mode 100644 index 0000000000000..36b7cd93cdfba --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/LICENSE.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/README.md b/src/jdk.incubator.vector/linux/native/libsleef/upstream/README.md new file mode 100644 index 0000000000000..5ba06531d8987 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/README.md @@ -0,0 +1,221 @@ +# SLEEF + +![Github Actions](https://github.com/shibatch/sleef/actions/workflows/build_and_test.yml/badge.svg?event=push&branch=master) +[![DOI:10.1109/TPDS.2019.2960333](http://img.shields.io/badge/DOI-10.1109/TPDS.2019.2960333-blue.svg)](https://ieeexplore.ieee.org/document/8936472) +[![License](https://img.shields.io/badge/License-Boost_1.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt) +![CMake](https://img.shields.io/badge/cmake-v3.18+-yellow.svg) +[![Spack](https://img.shields.io/spack/v/sleef)](https://spack.readthedocs.io/en/v0.16.2/package_list.html#sleef) +[![SourceForge Downloads](https://img.shields.io/sourceforge/dt/sleef)](https://sourceforge.net/projects/sleef/) + +SLEEF is a library that implements vectorized versions of C standard math functions. This library also includes DFT subroutines. + +- **Web Page:** [https://sleef.org/][webpage_url] +- **Sources:** [https://github.com/shibatch/sleef][repo_url] + +## Supported environment + +### Test matrix + +The following table summarises currently supported vector extensions, compilers and OS-es. + +:green_circle: : Tested extensively in CI. + +:yellow_circle: : Tested partially in CI. + +:x: : Currently failing some tests in CI. + +:white_circle: : Not tested in CI. Might have passed tests in previous CI framework. + +[This issue](https://github.com/shibatch/sleef/issues/481) tracks progress on improving test coverage. +Compilation of SLEEF on previously supported environments might still be safe, we just cannot verify it yet. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          OS/Compiler
          LinuxmacOSWindows
          Arch.Vector Extensionsgccllvmiccgccllvmgccllvm-gnullvm-msvcmsvc
          x86_64SSE2, SSE4,
          AVX, AVX2, AVX512F
          :green_circle::green_circle::white_circle::white_circle::green_circle::white_circle::yellow_circle::white_circle::white_circle:
          x86 32bit
          (i386)
          SSE:white_circle::white_circle::white_circle:N/A:white_circle::white_circle::white_circle::white_circle:
          AArch64
          (arm)
          Neon, SVE:green_circle::green_circle:N/AN/A:green_circle:N/A:white_circle::white_circle::white_circle:
          AArch32
          (armhf)
          NEON:green_circle::green_circle:N/AN/AN/A
          PowerPC
          (ppc64el)
          VSX, VSX3:green_circle::green_circle:N/AN/AN/A
          IBM/Z
          (s390x)
          VXE, VXE2:green_circle::green_circle:N/AN/AN/A
          RISC-V
          (riscv64)
          RVV1, RVV2N/A (14+):green_circle:N/AN/AN/A
          + +### Component support + +The above table is valid for libm in single, double and quadruple precision, as well as fast Discrete Fourier Transform (DFT). + +Generation of inline headers is also supported for most vector extensions. + +LTO is not tested in CI yet, except on Windows. + +### Compiler support + +Results are displayed for gcc 11 and llvm 17, the compiler versions used in CI tests with GitHub Actions. + +Older versions should be supported too, while newer ones are either not tested or have known issues. + +Some compiler versions simply do not support certain vector extensions, for instance SVE is only supported for gcc version 9 onwards. + +Similarly, the RISC-V interface in SLEEF is based on version 1.0 of the intrinsics, which is only supported from llvm version 17 and gcc version 14 onwards. + +Toolchain files provide some information on supported compiler versions. + +### OS support + +Only Linux distributions and macOS are fully tested in CI and thus officially supported. + +Building SLEEF for Windows on x86 machines was officially supported ( :white_circle: ), as of 3.5.1, +however it is only partially tested due to [known limitations of the test suite with MinGW or MSYS2](https://github.com/shibatch/sleef/issues/544). +As a result tests for Windows on x86 only include DFT for now (other tests are disabled in build system), +but all components are built. + +Support for iOS and Android is only preliminary on AArch64. + +SVE is not supported on Darwin-based system and therefore automatically disabled by SLEEF on Darwin. + +### More on supported environment + +Refer to our web page for [more on supported environment][supported_env_url]. + +## Install SLEEF dependencies + +The library itself does not have any additional dependency. + +However some tests require: + +- libssl and libcrypto, that can be provided by installing openssl. +- libm, libgmp and libmpfr +- libfftw. + +These tests can be disabled if necessary. + +## How to build SLEEF + +We recommend relying on CMake as much as possible in the build process to ensure portability. +**CMake 3.18+** is the minimum required. + +1. Check out the source code from our GitHub repository + +``` +git clone https://github.com/shibatch/sleef +``` + +2. Make a separate directory to create an out-of-source build + +``` +cd sleef && mkdir build +``` + +3. Run cmake to configure the project + +``` +cmake -S . -B build +``` + +By default this will generate shared libraries. In order to generate static libraries, pass option `-DBUILD_SHARED_LIBS=OFF`. + +For more verbose output add option `-DSLEEF_SHOW_CONFIG=ON`. + +4. Run make to build the project + +``` +cmake --build build -j --clean-first +``` + +5. Run tests using ctests + +``` +ctest --test-dir build -j +``` + +For more detailed build instructions please refer to the [dedicated section on CMake](./docs/build-with-cmake.md) or to [our web page][build_info_url]. + +## Install SLEEF + +### From source + +Assuming following instructions were followed. + +6. Install to specified directory `` + +``` +cmake --install build --prefix= +``` + +### Using Spack + +SLEEF can also be directly installed using Spack. + +``` +spack install sleef@master +``` + +### Uninstall + +In order to uninstall SLEEF library and headers run + +``` +sudo xargs rm -v < build/install_manifest.txt +``` + +## License + +The software is distributed under the Boost Software License, Version 1.0. +See accompanying file [LICENSE.txt](./LICENSE.txt) or copy at [http://www.boost.org/LICENSE_1_0.txt][license_url]. +Contributions to this project are accepted under the same license. + +Copyright © 2010-2024 SLEEF Project, Naoki Shibata and contributors.
          + + + + +[webpage_url]: https://sleef.org/ +[build_info_url]: https://sleef.org/compile.xhtml +[supported_env_url]: https://sleef.org/index.xhtml#environment +[repo_url]: https://github.com/shibatch/sleef +[repo_license_url]: https://github.com/shibatch/sleef/blob/main/LICENSE.txt +[license_url]: http://www.boost.org/LICENSE_1_0.txt diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/include/sleefdft.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/include/sleefdft.h new file mode 100644 index 0000000000000..447131cd16d75 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/include/sleefdft.h @@ -0,0 +1,71 @@ +#ifndef __SLEEFDFT_H__ +#define __SLEEFDFT_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +#define SLEEF_MODE_FORWARD (0 << 0) +#define SLEEF_MODE_BACKWARD (1 << 0) + +#define SLEEF_MODE_COMPLEX (0 << 1) +#define SLEEF_MODE_REAL (1 << 1) + +#define SLEEF_MODE_ALT (1 << 2) +#define SLEEF_MODE_FFTWCOMPAT (1 << 3) + +#define SLEEF_MODE_DEBUG (1 << 10) +#define SLEEF_MODE_VERBOSE (1 << 11) +#define SLEEF_MODE_NO_MT (1 << 12) + +#define SLEEF_MODE_ESTIMATE (1 << 20) +#define SLEEF_MODE_MEASURE (2 << 20) + +#if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#ifdef IMPORT_IS_EXPORT +#define IMPORT __declspec(dllexport) +#else // #ifdef IMPORT_IS_EXPORT +#define IMPORT __declspec(dllimport) +#if (defined(_MSC_VER)) +#pragma comment(lib,"sleefdft.lib") +#endif // #if (defined(_MSC_VER)) +#endif // #ifdef IMPORT_IS_EXPORT +#else // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#define IMPORT +#endif // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) + +IMPORT struct SleefDFT *SleefDFT_double_init1d(uint32_t n, const double *in, double *out, uint64_t mode); +IMPORT struct SleefDFT *SleefDFT_double_init2d(uint32_t n, uint32_t m, const double *in, double *out, uint64_t mode); +IMPORT void SleefDFT_double_execute(struct SleefDFT *ptr, const double *in, double *out); + +IMPORT struct SleefDFT *SleefDFT_float_init1d(uint32_t n, const float *in, float *out, uint64_t mode); +IMPORT struct SleefDFT *SleefDFT_float_init2d(uint32_t n, uint32_t m, const float *in, float *out, uint64_t mode); +IMPORT void SleefDFT_float_execute(struct SleefDFT *ptr, const float *in, float *out); + +IMPORT void SleefDFT_dispose(struct SleefDFT *ptr); + +IMPORT void SleefDFT_setPath(struct SleefDFT *ptr, char *pathStr); + +// + +IMPORT void SleefDFT_setPlanFilePath(const char *path, const char *arch, uint64_t mode); + +#define SLEEF_PLAN_AUTOMATIC 0 +#define SLEEF_PLAN_READONLY (1 << 0) +#define SLEEF_PLAN_RESET (1 << 1) +#define SLEEF_PLAN_BUILDALLPLAN (1 << 2) +#define SLEEF_PLAN_NOLOCK (1 << 3) +#define SLEEF_PLAN_MEASURE (1 << 29) +#define SLEEF_PLAN_REFERTOENVVAR (1 << 30) + +#undef IMPORT + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef __SLEEFDFT_H__ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleef-config.h.in b/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleef-config.h.in new file mode 100644 index 0000000000000..53faefcf57d6a --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleef-config.h.in @@ -0,0 +1,11 @@ +// Configuration of @PROJECT_NAME@ ///////////////////////////////////////////// + +#ifndef SLEEF_CONFIG_H +#define SLEEF_CONFIG_H + +#define SLEEF_VERSION_MAJOR @SLEEF_VERSION_MAJOR@ +#define SLEEF_VERSION_MINOR @SLEEF_VERSION_MINOR@ + +#cmakedefine SLEEF_STATIC_LIBS + +#endif // SLEEF_CONFIG_H diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleefConfig.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleefConfig.cmake new file mode 100644 index 0000000000000..6e423f216162e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/sleefConfig.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/sleefTargets.cmake") diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/CMakeLists.txt new file mode 100644 index 0000000000000..0e60e5368dea1 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/CMakeLists.txt @@ -0,0 +1,22 @@ +include_directories("common") +include_directories("arch") + +add_subdirectory("libm") +if (SLEEF_BUILD_TESTS AND NOT MINGW) + add_subdirectory("libm-tester") +endif() +add_subdirectory("common") + +if (SLEEF_BUILD_DFT) + add_subdirectory("dft") + if (SLEEF_BUILD_TESTS) + add_subdirectory("dft-tester") + endif() +endif() + +if (SLEEF_BUILD_QUAD) + add_subdirectory("quad") + if (SLEEF_BUILD_TESTS AND NOT MINGW) + add_subdirectory("quad-tester") + endif() +endif() diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperadvsimd.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperadvsimd.h new file mode 100644 index 0000000000000..48908734135f5 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperadvsimd.h @@ -0,0 +1,837 @@ +/*********************************************************************/ +/* Copyright ARM Ltd. 2010 - 2024. */ +/* Distributed under the Boost Software License, Version 1.0. */ +/* (See accompanying file LICENSE.txt or copy at */ +/* http://www.boost.org/LICENSE_1_0.txt) */ +/*********************************************************************/ + +#if !defined(__ARM_NEON) && !defined(SLEEF_GENHEADER) +#error Please specify advsimd flags. +#endif + +#if !defined(SLEEF_GENHEADER) +#include +#include + +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 1 +//@#define LOG2VECTLENDP 1 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP 2 +//@#define LOG2VECTLENSP 2 +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#if CONFIG == 1 +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#endif + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#define ISANAME "AArch64 AdvSIMD" + +// Mask definition +typedef uint32x4_t vmask; +typedef uint32x4_t vopmask; + +// Single precision definitions +typedef float32x4_t vfloat; +typedef int32x4_t vint2; + +// Double precision definitions +typedef float64x2_t vdouble; +typedef int32x2_t vint; + +typedef int64x2_t vint64; +typedef uint64x2_t vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +#define DFTPRIORITY 10 + +static INLINE int vavailability_i(int name) { return 3; } +static INLINE void vprefetch_v_p(const void *ptr) { } + +static INLINE VECTOR_CC int vtestallones_i_vo32(vopmask g) { + uint32x2_t x0 = vand_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmin_u32(x0, x0); + return vget_lane_u32(x1, 0); +} + +static INLINE VECTOR_CC int vtestallones_i_vo64(vopmask g) { + uint32x2_t x0 = vand_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmin_u32(x0, x0); + return vget_lane_u32(x1, 0); +} + +// Vector load / store +static INLINE VECTOR_CC vdouble vload_vd_p(const double *ptr) { return vld1q_f64(ptr); } +static INLINE VECTOR_CC vdouble vloadu_vd_p(const double *ptr) { return vld1q_f64(ptr); } +static INLINE VECTOR_CC void vstore_v_p_vd(double *ptr, vdouble v) { vst1q_f64(ptr, v); } +static INLINE VECTOR_CC void vstoreu_v_p_vd(double *ptr, vdouble v) { vst1q_f64(ptr, v); } +static INLINE VECTOR_CC vfloat vload_vf_p(const float *ptr) { return vld1q_f32(ptr); } +static INLINE VECTOR_CC vfloat vloadu_vf_p(const float *ptr) { return vld1q_f32(ptr); } +static INLINE VECTOR_CC void vstore_v_p_vf(float *ptr, vfloat v) { vst1q_f32(ptr, v); } +static INLINE VECTOR_CC void vstoreu_v_p_vf(float *ptr, vfloat v) { vst1q_f32(ptr, v); } +static INLINE VECTOR_CC vint2 vloadu_vi2_p(int32_t *p) { return vld1q_s32(p); } +static INLINE VECTOR_CC void vstoreu_v_p_vi2(int32_t *p, vint2 v) { vst1q_s32(p, v); } +static INLINE VECTOR_CC vint vloadu_vi_p(int32_t *p) { return vld1_s32(p); } +static INLINE VECTOR_CC void vstoreu_v_p_vi(int32_t *p, vint v) { vst1_s32(p, v); } + +static INLINE VECTOR_CC vdouble vgather_vd_p_vi(const double *ptr, vint vi) { + return ((vdouble) { ptr[vget_lane_s32(vi, 0)], ptr[vget_lane_s32(vi, 1)]} ); +} + +static INLINE VECTOR_CC vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { + return ((vfloat) { + ptr[vgetq_lane_s32(vi2, 0)], + ptr[vgetq_lane_s32(vi2, 1)], + ptr[vgetq_lane_s32(vi2, 2)], + ptr[vgetq_lane_s32(vi2, 3)] + }); +} + +// Basic logical operations for mask +static INLINE VECTOR_CC vmask vand_vm_vm_vm(vmask x, vmask y) { return vandq_u32(x, y); } +static INLINE VECTOR_CC vmask vandnot_vm_vm_vm(vmask x, vmask y) { + return vbicq_u32(y, x); +} +static INLINE VECTOR_CC vmask vor_vm_vm_vm(vmask x, vmask y) { return vorrq_u32(x, y); } +static INLINE VECTOR_CC vmask vxor_vm_vm_vm(vmask x, vmask y) { return veorq_u32(x, y); } + +// Mask <--> single precision reinterpret +static INLINE VECTOR_CC vmask vreinterpret_vm_vf(vfloat vf) { + return vreinterpretq_u32_f32(vf); +} +static INLINE VECTOR_CC vfloat vreinterpret_vf_vm(vmask vm) { + return vreinterpretq_f32_u32(vm); +} +static INLINE VECTOR_CC vint2 vcast_vi2_vm(vmask vm) { return vreinterpretq_s32_u32(vm); } +static INLINE VECTOR_CC vmask vcast_vm_vi2(vint2 vi) { return vreinterpretq_u32_s32(vi); } + +// Mask <--> double precision reinterpret +static INLINE VECTOR_CC vmask vreinterpret_vm_vd(vdouble vd) { + return vreinterpretq_u32_f64(vd); +} +static INLINE VECTOR_CC vdouble vreinterpret_vd_vm(vmask vm) { + return vreinterpretq_f64_u32(vm); +} +static INLINE VECTOR_CC vfloat vreinterpret_vf_vi2(vint2 vm) { + return vreinterpretq_f32_s32(vm); +} +static INLINE VECTOR_CC vint2 vreinterpret_vi2_vf(vfloat vf) { + return vreinterpretq_s32_f32(vf); +} + +/****************************************/ +/* Single precision FP operations */ +/****************************************/ +// Broadcast +static INLINE VECTOR_CC vfloat vcast_vf_f(float f) { return vdupq_n_f32(f); } + +// Add, Sub, Mul +static INLINE VECTOR_CC vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { + return vaddq_f32(x, y); +} +static INLINE VECTOR_CC vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { + return vsubq_f32(x, y); +} +static INLINE VECTOR_CC vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { + return vmulq_f32(x, y); +} + +// |x|, -x +static INLINE VECTOR_CC vfloat vabs_vf_vf(vfloat f) { return vabsq_f32(f); } +static INLINE VECTOR_CC vfloat vneg_vf_vf(vfloat f) { return vnegq_f32(f); } + +#if CONFIG == 1 +// Multiply accumulate: z = z + x * y +static INLINE VECTOR_CC vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return vfmaq_f32(z, x, y); +} +// Multiply subtract: z = z - x * y +static INLINE VECTOR_CC vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return vfmsq_f32(z, x, y); +} +// Multiply subtract: z = x * y - z +static INLINE VECTOR_CC vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return vneg_vf_vf(vfmsq_f32(z, x, y)); +} +#else +static INLINE VECTOR_CC vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE VECTOR_CC vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE VECTOR_CC vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#endif + +static INLINE VECTOR_CC vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // z + x * y + return vfmaq_f32(z, x, y); +} + +static INLINE VECTOR_CC vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // z - x * y + return vfmsq_f32(z, x, y); +} + +static INLINE VECTOR_CC vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // x * y - z + return vfma_vf_vf_vf_vf(x, y, vneg_vf_vf(z)); +} + +// Reciprocal 1/x, Division, Square root +static INLINE VECTOR_CC vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { +#ifndef SLEEF_ENABLE_ALTDIV + return vdivq_f32(n, d); +#else + // Finite numbers (including denormal) only, gives mostly correctly rounded result + float32x4_t t, u, x, y; + uint32x4_t i0, i1; + i0 = vandq_u32(vreinterpretq_u32_f32(n), vdupq_n_u32(0x7c000000)); + i1 = vandq_u32(vreinterpretq_u32_f32(d), vdupq_n_u32(0x7c000000)); + i0 = vsubq_u32(vdupq_n_u32(0x7d000000), vshrq_n_u32(vaddq_u32(i0, i1), 1)); + t = vreinterpretq_f32_u32(i0); + y = vmulq_f32(d, t); + x = vmulq_f32(n, t); + t = vrecpeq_f32(y); + t = vmulq_f32(t, vrecpsq_f32(y, t)); + t = vmulq_f32(t, vrecpsq_f32(y, t)); + u = vmulq_f32(x, t); + u = vfmaq_f32(u, vfmsq_f32(x, y, u), t); + return u; +#endif +} +static INLINE VECTOR_CC vfloat vrec_vf_vf(vfloat d) { +#ifndef SLEEF_ENABLE_ALTDIV + return vdiv_vf_vf_vf(vcast_vf_f(1.0f), d); +#else + return vbslq_f32(vceqq_f32(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)), + vcast_vf_f(0), vdiv_vf_vf_vf(vcast_vf_f(1.0f), d)); +#endif +} + +static INLINE VECTOR_CC vfloat vsqrt_vf_vf(vfloat d) { +#ifndef SLEEF_ENABLE_ALTSQRT + return vsqrtq_f32(d); +#else + // Gives correctly rounded result for all input range + vfloat w, x, y, z; + + y = vrsqrteq_f32(d); + x = vmul_vf_vf_vf(d, y); w = vmul_vf_vf_vf(vcast_vf_f(0.5), y); + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(0.5)); + x = vfma_vf_vf_vf_vf(x, y, x); w = vfma_vf_vf_vf_vf(w, y, w); + + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(1.5)); w = vadd_vf_vf_vf(w, w); + w = vmul_vf_vf_vf(w, y); + x = vmul_vf_vf_vf(w, d); + y = vfmapn_vf_vf_vf_vf(w, d, x); z = vfmanp_vf_vf_vf_vf(w, x, vcast_vf_f(1)); + z = vfmanp_vf_vf_vf_vf(w, y, z); w = vmul_vf_vf_vf(vcast_vf_f(0.5), x); + w = vfma_vf_vf_vf_vf(w, z, y); + w = vadd_vf_vf_vf(w, x); + + return vbslq_f32(vorrq_u32(vceqq_f32(d, vcast_vf_f(0)), + vceqq_f32(d, vcast_vf_f(SLEEF_INFINITYf))), d, w); +#endif +} + +// max, min +static INLINE VECTOR_CC vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { + return vmaxq_f32(x, y); +} +static INLINE VECTOR_CC vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { + return vminq_f32(x, y); +} + +// Comparisons +static INLINE VECTOR_CC vmask veq_vm_vf_vf(vfloat x, vfloat y) { return vceqq_f32(x, y); } +static INLINE VECTOR_CC vmask vneq_vm_vf_vf(vfloat x, vfloat y) { + return vmvnq_u32(vceqq_f32(x, y)); +} +static INLINE VECTOR_CC vmask vlt_vm_vf_vf(vfloat x, vfloat y) { return vcltq_f32(x, y); } +static INLINE VECTOR_CC vmask vle_vm_vf_vf(vfloat x, vfloat y) { return vcleq_f32(x, y); } +static INLINE VECTOR_CC vmask vgt_vm_vf_vf(vfloat x, vfloat y) { return vcgtq_f32(x, y); } +static INLINE VECTOR_CC vmask vge_vm_vf_vf(vfloat x, vfloat y) { return vcgeq_f32(x, y); } + +// Conditional select +static INLINE VECTOR_CC vfloat vsel_vf_vm_vf_vf(vmask mask, vfloat x, vfloat y) { + return vbslq_f32(mask, x, y); +} + +// int <--> float conversions +static INLINE VECTOR_CC vint2 vtruncate_vi2_vf(vfloat vf) { return vcvtq_s32_f32(vf); } +static INLINE VECTOR_CC vfloat vcast_vf_vi2(vint2 vi) { return vcvtq_f32_s32(vi); } +static INLINE VECTOR_CC vint2 vcast_vi2_i(int i) { return vdupq_n_s32(i); } +static INLINE VECTOR_CC vint2 vrint_vi2_vf(vfloat d) { + return vcvtq_s32_f32(vrndnq_f32(d)); +} + +/***************************************/ +/* Single precision integer operations */ +/***************************************/ + +// Add, Sub, Neg (-x) +static INLINE VECTOR_CC vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { + return vaddq_s32(x, y); +} +static INLINE VECTOR_CC vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { + return vsubq_s32(x, y); +} +static INLINE VECTOR_CC vint2 vneg_vi2_vi2(vint2 e) { return vnegq_s32(e); } + +// Logical operations +static INLINE VECTOR_CC vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { + return vandq_s32(x, y); +} +static INLINE VECTOR_CC vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { + return vbicq_s32(y, x); +} +static INLINE VECTOR_CC vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { + return vorrq_s32(x, y); +} +static INLINE VECTOR_CC vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { + return veorq_s32(x, y); +} + +// Shifts +#define vsll_vi2_vi2_i(x, c) vshlq_n_s32(x, c) +//@#define vsll_vi2_vi2_i(x, c) vshlq_n_s32(x, c) +#define vsrl_vi2_vi2_i(x, c) \ + vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(x), c)) +//@#define vsrl_vi2_vi2_i(x, c) vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(x), c)) + +#define vsra_vi2_vi2_i(x, c) vshrq_n_s32(x, c) +//@#define vsra_vi2_vi2_i(x, c) vshrq_n_s32(x, c) +#define vsra_vi_vi_i(x, c) vshr_n_s32(x, c) +//@#define vsra_vi_vi_i(x, c) vshr_n_s32(x, c) +#define vsll_vi_vi_i(x, c) vshl_n_s32(x, c) +//@#define vsll_vi_vi_i(x, c) vshl_n_s32(x, c) +#define vsrl_vi_vi_i(x, c) \ + vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(x), c)) +//@#define vsrl_vi_vi_i(x, c) vreinterpret_s32_u32(vshr_n_u32(vreinterpret_u32_s32(x), c)) + +// Comparison returning masks +static INLINE VECTOR_CC vmask veq_vm_vi2_vi2(vint2 x, vint2 y) { return vceqq_s32(x, y); } +static INLINE VECTOR_CC vmask vgt_vm_vi2_vi2(vint2 x, vint2 y) { return vcgeq_s32(x, y); } +// Comparison returning integers +static INLINE VECTOR_CC vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { + return vreinterpretq_s32_u32(vcgtq_s32(x, y)); +} +static INLINE VECTOR_CC vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { + return vreinterpretq_s32_u32(vceqq_s32(x, y)); +} + +// Conditional select +static INLINE VECTOR_CC vint2 vsel_vi2_vm_vi2_vi2(vmask m, vint2 x, vint2 y) { + return vbslq_s32(m, x, y); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +/****************************************/ +/* Double precision FP operations */ +/****************************************/ +// Broadcast +static INLINE VECTOR_CC vdouble vcast_vd_d(double f) { return vdupq_n_f64(f); } + +// Add, Sub, Mul +static INLINE VECTOR_CC vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { + return vaddq_f64(x, y); +} +static INLINE VECTOR_CC vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { + return vsubq_f64(x, y); +} +static INLINE VECTOR_CC vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { + return vmulq_f64(x, y); +} + +// |x|, -x +static INLINE VECTOR_CC vdouble vabs_vd_vd(vdouble f) { return vabsq_f64(f); } +static INLINE VECTOR_CC vdouble vneg_vd_vd(vdouble f) { return vnegq_f64(f); } + +// max, min +static INLINE VECTOR_CC vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { + return vmaxq_f64(x, y); +} +static INLINE VECTOR_CC vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { + return vminq_f64(x, y); +} + +#if CONFIG == 1 +// Multiply accumulate: z = z + x * y +static INLINE VECTOR_CC vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return vfmaq_f64(z, x, y); +} + +static INLINE VECTOR_CC vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return vfmsq_f64(z, x, y); +} + +//[z = x * y - z] +static INLINE VECTOR_CC vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return vneg_vd_vd(vfmsq_f64(z, x, y)); +} +#else +static INLINE VECTOR_CC vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE VECTOR_CC vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +#endif + +static INLINE VECTOR_CC vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { // z + x * y + return vfmaq_f64(z, x, y); +} + +static INLINE VECTOR_CC vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { // z - x * y + return vfmsq_f64(z, x, y); +} + +static INLINE VECTOR_CC vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { // x * y - z + return vfma_vd_vd_vd_vd(x, y, vneg_vd_vd(z)); +} + +// Reciprocal 1/x, Division, Square root +static INLINE VECTOR_CC vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { +#ifndef SLEEF_ENABLE_ALTDIV + return vdivq_f64(n, d); +#else + // Finite numbers (including denormal) only, gives mostly correctly rounded result + float64x2_t t, u, x, y; + uint64x2_t i0, i1; + i0 = vandq_u64(vreinterpretq_u64_f64(n), vdupq_n_u64(0x7fc0000000000000L)); + i1 = vandq_u64(vreinterpretq_u64_f64(d), vdupq_n_u64(0x7fc0000000000000L)); + i0 = vsubq_u64(vdupq_n_u64(0x7fd0000000000000L), vshrq_n_u64(vaddq_u64(i0, i1), 1)); + t = vreinterpretq_f64_u64(i0); + y = vmulq_f64(d, t); + x = vmulq_f64(n, t); + t = vrecpeq_f64(y); + t = vmulq_f64(t, vrecpsq_f64(y, t)); + t = vmulq_f64(t, vrecpsq_f64(y, t)); + t = vmulq_f64(t, vrecpsq_f64(y, t)); + u = vmulq_f64(x, t); + u = vfmaq_f64(u, vfmsq_f64(x, y, u), t); + return u; +#endif +} +static INLINE VECTOR_CC vdouble vrec_vd_vd(vdouble d) { +#ifndef SLEEF_ENABLE_ALTDIV + return vdiv_vd_vd_vd(vcast_vd_d(1.0f), d); +#else + return vbslq_f64(vceqq_f64(vabs_vd_vd(d), vcast_vd_d(SLEEF_INFINITY)), + vcast_vd_d(0), vdiv_vd_vd_vd(vcast_vd_d(1.0f), d)); +#endif +} + +static INLINE VECTOR_CC vdouble vsqrt_vd_vd(vdouble d) { +#ifndef SLEEF_ENABLE_ALTSQRT + return vsqrtq_f64(d); +#else + // Gives correctly rounded result for all input range + vdouble w, x, y, z; + + y = vrsqrteq_f64(d); + x = vmul_vd_vd_vd(d, y); w = vmul_vd_vd_vd(vcast_vd_d(0.5), y); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(1.5)); w = vadd_vd_vd_vd(w, w); + w = vmul_vd_vd_vd(w, y); + x = vmul_vd_vd_vd(w, d); + y = vfmapn_vd_vd_vd_vd(w, d, x); z = vfmanp_vd_vd_vd_vd(w, x, vcast_vd_d(1)); + z = vfmanp_vd_vd_vd_vd(w, y, z); w = vmul_vd_vd_vd(vcast_vd_d(0.5), x); + w = vfma_vd_vd_vd_vd(w, z, y); + w = vadd_vd_vd_vd(w, x); + + return vbslq_f64(vorrq_u64(vceqq_f64(d, vcast_vd_d(0)), + vceqq_f64(d, vcast_vd_d(SLEEF_INFINITY))), d, w); +#endif +} + +/* Comparisons */ +static INLINE VECTOR_CC vopmask veq_vo_vd_vd(vdouble x, vdouble y) { + return vreinterpretq_u32_u64(vceqq_f64(x, y)); +} +static INLINE VECTOR_CC vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { + return vmvnq_u32(vreinterpretq_u32_u64(vceqq_f64(x, y))); +} +static INLINE VECTOR_CC vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { + return vreinterpretq_u32_u64(vcltq_f64(x, y)); +} +static INLINE VECTOR_CC vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { + return vreinterpretq_u32_u64(vcgtq_f64(x, y)); +} +static INLINE VECTOR_CC vopmask vle_vo_vd_vd(vdouble x, vdouble y) { + return vreinterpretq_u32_u64(vcleq_f64(x, y)); +} +static INLINE VECTOR_CC vopmask vge_vo_vd_vd(vdouble x, vdouble y) { + return vreinterpretq_u32_u64(vcgeq_f64(x, y)); +} + +// Conditional select +static INLINE VECTOR_CC vdouble vsel_vd_vo_vd_vd(vopmask mask, vdouble x, vdouble y) { + return vbslq_f64(vreinterpretq_u64_u32(mask), x, y); +} + +#if 1 +static INLINE CONST VECTOR_CC vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE VECTOR_CC vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE VECTOR_CC vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} +#else +// This implementation is slower on the current CPU models (as of May 2017.) +// I(Naoki Shibata) expect that on future CPU models with hardware similar to Super Shuffle Engine, this implementation will be faster. +static INLINE CONST VECTOR_CC vdouble vsel_vd_vo_d_d(vopmask o, double d0, double d1) { + uint8x16_t idx = vbslq_u8(vreinterpretq_u8_u32(o), (uint8x16_t) { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7 }, + (uint8x16_t) { 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15 }); + + uint8x16_t tab = (uint8x16_t) (float64x2_t) { d0, d1 }; + return (vdouble) vqtbl1q_u8(tab, idx); +} + +static INLINE VECTOR_CC vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + uint8x16_t idx = vbslq_u8(vreinterpretq_u8_u32(o0), (uint8x16_t) { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7 }, + vbslq_u8(vreinterpretq_u8_u32(o1), (uint8x16_t) { 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15 }, + vbslq_u8(vreinterpretq_u8_u32(o2), (uint8x16_t) { 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23 }, + (uint8x16_t) { 24, 25, 26, 27, 28, 29, 30, 31, 24, 25, 26, 27, 28, 29, 30, 31 }))); + + uint8x16x2_t tab = { { (uint8x16_t) (float64x2_t) { d0, d1 }, (uint8x16_t) (float64x2_t) { d2, d3 } } }; + return (vdouble) vqtbl2q_u8(tab, idx); +} + +static INLINE VECTOR_CC vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o1, d0, d1, d2, d2); +} +#endif + +static INLINE VECTOR_CC vdouble vrint_vd_vd(vdouble d) { return vrndnq_f64(d); } +static INLINE VECTOR_CC vfloat vrint_vf_vf(vfloat d) { return vrndnq_f32(d); } + +/****************************************/ +/* int <--> float conversions */ +/****************************************/ +static INLINE VECTOR_CC vint vtruncate_vi_vd(vdouble vf) { + return vmovn_s64(vcvtq_s64_f64(vf)); +} +static INLINE VECTOR_CC vdouble vcast_vd_vi(vint vi) { + return vcvtq_f64_s64(vmovl_s32(vi)); +} +static INLINE VECTOR_CC vint vcast_vi_i(int i) { return vdup_n_s32(i); } +static INLINE VECTOR_CC vint vrint_vi_vd(vdouble d) { + return vqmovn_s64(vcvtq_s64_f64(vrndnq_f64(d))); +} + +/***************************************/ +/* Integer operations */ +/***************************************/ + +// Add, Sub, Neg (-x) +static INLINE VECTOR_CC vint vadd_vi_vi_vi(vint x, vint y) { return vadd_s32(x, y); } +static INLINE VECTOR_CC vint vsub_vi_vi_vi(vint x, vint y) { return vsub_s32(x, y); } +static INLINE VECTOR_CC vint vneg_vi_vi(vint e) { return vneg_s32(e); } + +// Logical operations +static INLINE VECTOR_CC vint vand_vi_vi_vi(vint x, vint y) { return vand_s32(x, y); } +static INLINE VECTOR_CC vint vandnot_vi_vi_vi(vint x, vint y) { return vbic_s32(y, x); } +static INLINE VECTOR_CC vint vor_vi_vi_vi(vint x, vint y) { return vorr_s32(x, y); } +static INLINE VECTOR_CC vint vxor_vi_vi_vi(vint x, vint y) { return veor_s32(x, y); } + +// Comparison returning masks +static INLINE VECTOR_CC vopmask veq_vo_vi_vi(vint x, vint y) { + return vcombine_u32(vceq_s32(x, y), vdup_n_u32(0)); +} + +// Conditional select +static INLINE VECTOR_CC vint vsel_vi_vm_vi_vi(vmask m, vint x, vint y) { + return vbsl_s32(vget_low_u32(m), x, y); +} + +/***************************************/ +/* Predicates */ +/***************************************/ +static INLINE VECTOR_CC vopmask visinf_vo_vd(vdouble d) { + const float64x2_t inf = vdupq_n_f64(SLEEF_INFINITY); + const float64x2_t neg_inf = vdupq_n_f64(-SLEEF_INFINITY); + uint64x2_t cmp = vorrq_u64(vceqq_f64(d, inf), vceqq_f64(d, neg_inf)); + return vreinterpretq_u32_u64(cmp); +} + +static INLINE VECTOR_CC vopmask visnan_vo_vd(vdouble d) { + return vmvnq_u32(vreinterpretq_u32_u64(vceqq_f64(d, d))); +} + +static INLINE VECTOR_CC vopmask vispinf_vo_vd(vdouble d) { + return vreinterpretq_u32_u64(vceqq_f64(d, vdupq_n_f64(SLEEF_INFINITY))); +} + +static INLINE VECTOR_CC vopmask visminf_vo_vd(vdouble d) { + return vreinterpretq_u32_u64(vceqq_f64(d, vdupq_n_f64(-SLEEF_INFINITY))); +} + +static INLINE VECTOR_CC vfloat vsel_vf_vo_vf_vf(vopmask mask, vfloat x, vfloat y) { + return vbslq_f32(mask, x, y); +} + +static INLINE CONST VECTOR_CC vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE VECTOR_CC vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE VECTOR_CC vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE VECTOR_CC vopmask veq_vo_vf_vf(vfloat x, vfloat y) { + return vceqq_f32(x, y); +} +static INLINE VECTOR_CC vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { + return vmvnq_u32(vceqq_f32(x, y)); +} +static INLINE VECTOR_CC vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { + return vcltq_f32(x, y); +} +static INLINE VECTOR_CC vopmask vle_vo_vf_vf(vfloat x, vfloat y) { + return vcleq_f32(x, y); +} +static INLINE VECTOR_CC vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { + return vcgtq_f32(x, y); +} +static INLINE VECTOR_CC vopmask vge_vo_vf_vf(vfloat x, vfloat y) { + return vcgeq_f32(x, y); +} + +static INLINE VECTOR_CC vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { + return vceqq_s32(x, y); +} +static INLINE VECTOR_CC vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { + return vcgtq_s32(x, y); +} +static INLINE VECTOR_CC vopmask vgt_vo_vi_vi(vint x, vint y) { + return vcombine_u32(vcgt_s32(x, y), vdup_n_u32(0)); +} +static INLINE VECTOR_CC vopmask visinf_vo_vf(vfloat d) { + return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); +} +static INLINE VECTOR_CC vopmask vispinf_vo_vf(vfloat d) { + return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); +} +static INLINE VECTOR_CC vopmask visminf_vo_vf(vfloat d) { + return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); +} +static INLINE VECTOR_CC vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +static INLINE VECTOR_CC vopmask vcast_vo32_vo64(vopmask m) { + return vuzpq_u32(m, m).val[0]; +} +static INLINE VECTOR_CC vopmask vcast_vo64_vo32(vopmask m) { + return vzipq_u32(m, m).val[0]; +} +static INLINE VECTOR_CC vopmask vcast_vo_i(int i) { + return vreinterpretq_u32_u64(vdupq_n_u64((uint64_t)(i ? -1 : 0))); +} + +static INLINE VECTOR_CC vopmask vand_vo_vo_vo(vopmask x, vopmask y) { + return vandq_u32(x, y); +} +static INLINE VECTOR_CC vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { + return vbicq_u32(y, x); +} +static INLINE VECTOR_CC vopmask vor_vo_vo_vo(vopmask x, vopmask y) { + return vorrq_u32(x, y); +} +static INLINE VECTOR_CC vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { + return veorq_u32(x, y); +} + +static INLINE VECTOR_CC vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return vbslq_s32(m, x, y); +} +static INLINE VECTOR_CC vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { + return vandq_s32(vreinterpretq_s32_u32(x), y); +} +static INLINE VECTOR_CC vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { + return vbicq_s32(y, vreinterpretq_s32_u32(x)); +} +static INLINE VECTOR_CC vint vandnot_vi_vo_vi(vopmask x, vint y) { + return vbic_s32(y, vget_low_s32(vreinterpretq_s32_u32(x))); +} +static INLINE VECTOR_CC vmask vand_vm_vo32_vm(vopmask x, vmask y) { + return vandq_u32(x, y); +} +static INLINE VECTOR_CC vmask vand_vm_vo64_vm(vopmask x, vmask y) { + return vandq_u32(x, y); +} +static INLINE VECTOR_CC vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { + return vbicq_u32(y, x); +} +static INLINE VECTOR_CC vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { + return vbicq_u32(y, x); +} +static INLINE VECTOR_CC vmask vor_vm_vo32_vm(vopmask x, vmask y) { + return vorrq_u32(x, y); +} +static INLINE VECTOR_CC vmask vor_vm_vo64_vm(vopmask x, vmask y) { + return vorrq_u32(x, y); +} +static INLINE VECTOR_CC vmask vxor_vm_vo32_vm(vopmask x, vmask y) { + return veorq_u32(x, y); +} + +static INLINE VECTOR_CC vfloat vtruncate_vf_vf(vfloat vd) { return vrndq_f32(vd); } + +static INLINE VECTOR_CC vmask vcast_vm_i_i(int i0, int i1) { + return vreinterpretq_u32_u64(vdupq_n_u64((0xffffffff & (uint64_t)i1) | (((uint64_t)i0) << 32))); +} + +static INLINE vmask vcast_vm_i64(int64_t i) { + return vreinterpretq_u32_u64(vdupq_n_u64((uint64_t)i)); +} +static INLINE vmask vcast_vm_u64(uint64_t i) { + return vreinterpretq_u32_u64(vdupq_n_u64(i)); +} + +static INLINE VECTOR_CC vopmask veq64_vo_vm_vm(vmask x, vmask y) { + return vreinterpretq_u32_u64(vceqq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static INLINE VECTOR_CC vmask vadd64_vm_vm_vm(vmask x, vmask y) { + return vreinterpretq_u32_s64(vaddq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static INLINE VECTOR_CC vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { + return vbsl_s32(vget_low_u32(m), x, y); +} + +// Logical operations +static INLINE VECTOR_CC vint vand_vi_vo_vi(vopmask x, vint y) { + return vand_s32(vreinterpret_s32_u32(vget_low_u32(x)), y); +} + +static INLINE VECTOR_CC vmask vcastu_vm_vi(vint vi) { + return vrev64q_u32(vreinterpretq_u32_u64(vmovl_u32(vreinterpret_u32_s32(vi)))); +} +static INLINE VECTOR_CC vint vcastu_vi_vm(vmask vi2) { + return vreinterpret_s32_u32(vmovn_u64(vreinterpretq_u64_u32(vrev64q_u32(vi2)))); +} +static INLINE VECTOR_CC vdouble vtruncate_vd_vd(vdouble vd) { return vrndq_f64(vd); } + +// + +#define PNMASK ((vdouble) { +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE VECTOR_CC vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE VECTOR_CC vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE VECTOR_CC vfloat vposneg_vf_vf(vfloat d) { return (vfloat)vxor_vm_vm_vm((vmask)d, (vmask)PNMASKf); } +static INLINE VECTOR_CC vfloat vnegpos_vf_vf(vfloat d) { return (vfloat)vxor_vm_vm_vm((vmask)d, (vmask)NPMASKf); } + +static INLINE VECTOR_CC vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE VECTOR_CC vfloat vsubadd_vf_vf_vf(vfloat d0, vfloat d1) { return vadd_vf_vf_vf(d0, vnegpos_vf_vf(d1)); } +static INLINE VECTOR_CC vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsubadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE VECTOR_CC vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsubadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } + +static INLINE VECTOR_CC vdouble vrev21_vd_vd(vdouble d0) { return (float64x2_t)vcombine_u64(vget_high_u64((uint64x2_t)d0), vget_low_u64((uint64x2_t)d0)); } +static INLINE VECTOR_CC vdouble vreva2_vd_vd(vdouble vd) { return vd; } + +static INLINE VECTOR_CC void vstream_v_p_vd(double *ptr, vdouble v) { vstore_v_p_vd(ptr, v); } +static INLINE VECTOR_CC void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vstore_v_p_vd((double *)(&ptr[2*offset]), v); } +static INLINE VECTOR_CC void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vstore_v_p_vd((double *)(&ptr[2*offset]), v); } + +static INLINE VECTOR_CC vfloat vrev21_vf_vf(vfloat d0) { return vrev64q_f32(d0); } +static INLINE VECTOR_CC vfloat vreva2_vf_vf(vfloat d0) { return vcombine_f32(vget_high_f32(d0), vget_low_f32(d0)); } + +static INLINE VECTOR_CC void vstream_v_p_vf(float *ptr, vfloat v) { vstore_v_p_vf(ptr, v); } + +static INLINE VECTOR_CC void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} + +static INLINE VECTOR_CC void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + uint32x2_t x0 = vorr_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmax_u32(x0, x0); + return ~vget_lane_u32(x1, 0); +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask m, vmask x, vmask y) { return vbslq_u32(m, x, y); } + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + return vreinterpretq_u32_s64(vsubq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +static INLINE vmask vneg64_vm_vm(vmask x) { + return vreinterpretq_u32_s64(vnegq_s64(vreinterpretq_s64_u32(x))); +} + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + return vreinterpretq_u32_u64(vcgtq_s64(vreinterpretq_s64_u32(x), vreinterpretq_s64_u32(y))); +} + +#define vsll64_vm_vm_i(x, c) vreinterpretq_u32_u64(vshlq_n_u64(vreinterpretq_u64_u32(x), c)) +//@#define vsll64_vm_vm_i(x, c) vreinterpretq_u32_u64(vshlq_n_u64(vreinterpretq_u64_u32(x), c)) +#define vsrl64_vm_vm_i(x, c) vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(x), c)) +//@#define vsrl64_vm_vm_i(x, c) vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(x), c)) + +static INLINE vmask vcast_vm_vi(vint vi) { + vmask m = vreinterpretq_u32_u64(vmovl_u32(vreinterpret_u32_s32(vi))); + return vor_vm_vm_vm(vcastu_vm_vi(vreinterpret_s32_u32(vget_low_u32(vgt_vo_vi_vi(vcast_vi_i(0), vi)))), m); +} +static INLINE vint vcast_vi_vm(vmask vm) { return vreinterpret_s32_u32(vmovn_u64(vreinterpretq_u64_u32(vm))); } + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return vreinterpretq_u32_s64(v); } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return vreinterpretq_s64_u32(m); } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return vreinterpretq_u32_u64(v); } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return vreinterpretq_u64_u32(m); } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx.h new file mode 100644 index 0000000000000..1b6da17e84d2e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx.h @@ -0,0 +1,638 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 1 + +#if !defined(__AVX__) && !defined(SLEEF_GENHEADER) +#error Please specify -mavx. +#endif + +#elif CONFIG == 4 + +#if (!defined(__AVX__) || !defined(__FMA4__)) && !defined(SLEEF_GENHEADER) +#error Please specify -mavx and -mfma4. +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 2 +//@#define LOG2VECTLENDP 2 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if !defined(SLEEF_GENHEADER) +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __m256i vmask; +typedef __m256i vopmask; + +typedef __m256d vdouble; +typedef __m128i vint; + +typedef __m256 vfloat; +typedef struct { __m128i x, y; } vint2; + +typedef __m256i vint64; +typedef __m256i vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +#ifndef __SLEEF_H__ +void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +static INLINE int cpuSupportsAVX() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 28)) != 0; +} + +static INLINE int cpuSupportsFMA4() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 0x80000001, 0); + return (reg[2] & (1 << 16)) != 0; +} + +#if CONFIG == 4 && defined(__AVX__) && defined(__FMA4__) +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX() && cpuSupportsFMA4(); + return d ? 3 : 0; +} + +#define ENABLE_FMA_DP +#define ENABLE_FMA_SP + +#define ISANAME "AVX + AMD FMA4" +#define DFTPRIORITY 21 +#else +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX(); + return d ? 3 : 0; +} + +#define ISANAME "AVX" +#define DFTPRIORITY 20 +#endif + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { _mm_prefetch(ptr, _MM_HINT_T0); } + +static INLINE int vtestallones_i_vo32(vopmask g) { + return _mm_test_all_ones(_mm_and_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))); +} + +static INLINE int vtestallones_i_vo64(vopmask g) { + return _mm_test_all_ones(_mm_and_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))); +} + +// + +static INLINE vdouble vcast_vd_d(double d) { return _mm256_set1_pd(d); } +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return _mm256_castpd_si256(vd); } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return _mm256_castsi256_pd(vm); } + +// + +static vint2 vloadu_vi2_p(int32_t *p) { + vint2 r; + r.x = _mm_loadu_si128((__m128i *) p ); + r.y = _mm_loadu_si128((__m128i *)(p + 4)); + return r; +} + +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { + _mm_storeu_si128((__m128i *) p , v.x); + _mm_storeu_si128((__m128i *)(p + 4), v.y); +} + +static vint vloadu_vi_p(int32_t *p) { return _mm_loadu_si128((__m128i *)p); } +static void vstoreu_v_p_vi(int32_t *p, vint v) { _mm_storeu_si128((__m128i *)p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vcast_vo32_vo64(vopmask o) { + return _mm256_castsi128_si256(_mm256_cvtpd_epi32(_mm256_and_pd(vreinterpret_vd_vm(o), _mm256_set1_pd(-1.0)))); +} + +static INLINE vopmask vcast_vo64_vo32(vopmask o) { + return vreinterpret_vm_vd(_mm256_cmp_pd(_mm256_cvtepi32_pd(_mm256_castsi256_si128(o)), _mm256_set1_pd(-1.0), _CMP_EQ_OQ)); +} + +static INLINE vopmask vcast_vo_i(int i) { return _mm256_set1_epi64x(i ? -1 : 0); } + +// + +static INLINE vint vrint_vi_vd(vdouble vd) { return _mm256_cvtpd_epi32(vd); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return _mm256_cvttpd_epi32(vd); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return _mm256_round_pd(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return _mm256_round_pd(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return _mm256_round_ps(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { return _mm256_round_ps(vf, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vdouble vcast_vd_vi(vint vi) { return _mm256_cvtepi32_pd(vi); } +static INLINE vint vcast_vi_i(int i) { return _mm_set1_epi32(i); } + +static INLINE vmask vcastu_vm_vi(vint vi) { + __m256i m = _mm256_castsi128_si256(_mm_and_si128(_mm_shuffle_epi32(vi, 0x40), _mm_set_epi32(-1, 0, -1, 0))); + return _mm256_insertf128_si256(m, _mm_and_si128(_mm_shuffle_epi32(vi, 0xc8), _mm_set_epi32(-1, 0, -1, 0)), 1); +} + +static INLINE vint vcastu_vi_vm(vmask vi) { + return _mm_or_si128(_mm_and_si128(_mm_shuffle_epi32(_mm256_castsi256_si128(vi) , 0x0d), _mm_set_epi32( 0, 0, -1, -1)), + _mm_and_si128(_mm_shuffle_epi32(_mm256_extractf128_si256(vi, 1), 0xd0), _mm_set_epi32(-1, -1, 0, 0))); +} + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { + return _mm256_set_epi32(i0, i1, i0, i1, i0, i1, i0, i1); +} + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { + return vreinterpret_vm_vd(_mm256_cmp_pd(vreinterpret_vd_vm(vxor_vm_vm_vm(vxor_vm_vm_vm(x, y), vreinterpret_vm_vd(_mm256_set1_pd(1.0)))), _mm256_set1_pd(1.0), _CMP_EQ_OQ)); +} + +static INLINE vmask vcast_vm_i64(int64_t i) { return _mm256_set1_epi64x(i); } +static INLINE vmask vcast_vm_u64(uint64_t i) { return _mm256_set1_epi64x((uint64_t)i); } + +// + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return _mm256_add_pd(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return _mm256_sub_pd(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return _mm256_mul_pd(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return _mm256_div_pd(x, y); } +static INLINE vdouble vrec_vd_vd(vdouble x) { return _mm256_div_pd(_mm256_set1_pd(1), x); } +static INLINE vdouble vsqrt_vd_vd(vdouble x) { return _mm256_sqrt_pd(x); } +static INLINE vdouble vabs_vd_vd(vdouble d) { return _mm256_andnot_pd(_mm256_set1_pd(-0.0), d); } +static INLINE vdouble vneg_vd_vd(vdouble d) { return _mm256_xor_pd(_mm256_set1_pd(-0.0), d); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return _mm256_max_pd(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return _mm256_min_pd(x, y); } + +#if CONFIG == 1 +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(z, vmul_vd_vd_vd(x, y)); } +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_macc_pd(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_msub_pd(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_nmacc_pd(x, y, z); } +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_macc_pd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_macc_pd(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_msub_pd(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_nmacc_pd(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_nmsub_pd(x, y, z); } +#endif + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_GE_OQ)); } + +// + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return _mm_add_epi32(x, y); } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return _mm_sub_epi32(x, y); } +static INLINE vint vneg_vi_vi(vint e) { return vsub_vi_vi_vi(vcast_vi_i(0), e); } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return _mm_andnot_si128(x, y); } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return _mm_or_si128(x, y); } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return _mm_xor_si128(x, y); } + +static INLINE vint vandnot_vi_vo_vi(vopmask m, vint y) { return _mm_andnot_si128(_mm256_castsi256_si128(m), y); } +static INLINE vint vand_vi_vo_vi(vopmask m, vint y) { return _mm_and_si128(_mm256_castsi256_si128(m), y); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return _mm_slli_epi32(x, c); } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return _mm_srli_epi32(x, c); } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return _mm_srai_epi32(x, c); } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return _mm256_castsi128_si256(_mm_cmpeq_epi32(x, y)); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return _mm256_castsi128_si256(_mm_cmpgt_epi32(x, y)); } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask o, vint x, vint y) { return _mm_blendv_epi8(y, x, _mm256_castsi256_si128(o)); } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) { return _mm256_blendv_pd(y, x, _mm256_castsi256_pd(o)); } + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(vabs_vd_vd(d), _mm256_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask vispinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, _mm256_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visminf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, _mm256_set1_pd(-SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visnan_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, d, _CMP_NEQ_UQ)); +} + +static INLINE vdouble vload_vd_p(const double *ptr) { return _mm256_load_pd(ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return _mm256_loadu_pd(ptr); } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { _mm256_store_pd(ptr, v); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { _mm256_storeu_pd(ptr, v); } + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { + int a[VECTLENDP]; + vstoreu_v_p_vi(a, vi); + return _mm256_set_pd(ptr[a[3]], ptr[a[2]], ptr[a[1]], ptr[a[0]]); +} + +#if defined(_MSC_VER) +// This function is needed when debugging on MSVC. +static INLINE double vcast_d_vd(vdouble v) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + return a[0]; +} +#endif + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { + vint2 r; + r.x = _mm256_castsi256_si128(vm); + r.y = _mm256_extractf128_si256(vm, 1); + return r; +} + +static INLINE vmask vcast_vm_vi2(vint2 vi) { + vmask m = _mm256_castsi128_si256(vi.x); + m = _mm256_insertf128_si256(m, vi.y, 1); + return m; +} + +static INLINE vint2 vrint_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm256_cvtps_epi32(vf)); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm256_cvttps_epi32(vf)); } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return _mm256_cvtepi32_ps(vcast_vm_vi2(vi)); } +static INLINE vfloat vcast_vf_f(float f) { return _mm256_set1_ps(f); } +static INLINE vint2 vcast_vi2_i(int i) { vint2 r; r.x = r.y = _mm_set1_epi32(i); return r; } +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return _mm256_castps_si256(vf); } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return _mm256_castsi256_ps(vm); } + +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { return vreinterpret_vf_vm(vcast_vm_vi2(vi)); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return vcast_vi2_vm(vreinterpret_vm_vf(vf)); } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return _mm256_add_ps(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return _mm256_sub_ps(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return _mm256_mul_ps(x, y); } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return _mm256_div_ps(x, y); } +static INLINE vfloat vrec_vf_vf(vfloat x) { return vdiv_vf_vf_vf(vcast_vf_f(1.0f), x); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return _mm256_sqrt_ps(x); } +static INLINE vfloat vabs_vf_vf(vfloat f) { return vreinterpret_vf_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f))); } +static INLINE vfloat vneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(d))); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return _mm256_max_ps(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return _mm256_min_ps(x, y); } + +#if CONFIG == 1 +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_macc_ps(x, y, z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_nmacc_ps(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_msub_ps(x, y, z); } +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_macc_ps(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_macc_ps(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_msub_ps(x, y, z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_nmacc_ps(x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_nmsub_ps(x, y, z); } +#endif + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_GE_OQ)); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_add_epi32(x.x, y.x), _mm_add_epi32(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_sub_epi32(x.x, y.x), _mm_sub_epi32(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vneg_vi2_vi2(vint2 e) { + vint2 vi = { _mm_sub_epi32(_mm_set1_epi32(0), e.x), _mm_sub_epi32(_mm_set1_epi32(0), e.y) }; + return vi; +} + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_and_si128(x.x, y.x), _mm_and_si128(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_andnot_si128(x.x, y.x), _mm_andnot_si128(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_or_si128(x.x, y.x), _mm_or_si128(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 vi = { _mm_xor_si128(x.x, y.x), _mm_xor_si128(x.y, y.y) }; + return vi; +} + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return vand_vi2_vi2_vi2(vcast_vi2_vm(x), y); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return vandnot_vi2_vi2_vi2(vcast_vi2_vm(x), y); } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { + vint2 vi = { _mm_slli_epi32(x.x, c), _mm_slli_epi32(x.y, c) }; + return vi; +} + +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { + vint2 vi = { _mm_srli_epi32(x.x, c), _mm_srli_epi32(x.y, c) }; + return vi; +} + +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { + vint2 vi = { _mm_srai_epi32(x.x, c), _mm_srai_epi32(x.y, c) }; + return vi; +} + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { + vint2 r; + r.x = _mm_cmpeq_epi32(x.x, y.x); + r.y = _mm_cmpeq_epi32(x.y, y.y); + return vcast_vm_vi2(r); +} + +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { + vint2 r; + r.x = _mm_cmpgt_epi32(x.x, y.x); + r.y = _mm_cmpgt_epi32(x.y, y.y); + return vcast_vm_vi2(r); +} + +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 r; + r.x = _mm_cmpeq_epi32(x.x, y.x); + r.y = _mm_cmpeq_epi32(x.y, y.y); + return r; +} + +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 r; + r.x = _mm_cmpgt_epi32(x.x, y.x); + r.y = _mm_cmpgt_epi32(x.y, y.y); + return r; +} + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + vint2 n = vcast_vi2_vm(m); + vint2 r = { _mm_blendv_epi8(y.x, x.x, n.x), _mm_blendv_epi8(y.y, x.y, n.y) }; + return r; +} + +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { + vint2 ix = vcast_vi2_vm(x), iy = vcast_vi2_vm(y), iz; + iz.x = _mm_add_epi64(ix.x, iy.x); + iz.y = _mm_add_epi64(ix.y, iy.y); + return vcast_vm_vi2(iz); +} + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) { return _mm256_blendv_ps(y, x, _mm256_castsi256_ps(o)); } + +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +// + +static INLINE vfloat vload_vf_p(const float *ptr) { return _mm256_load_ps(ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return _mm256_loadu_ps(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { _mm256_store_ps(ptr, v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { _mm256_storeu_ps(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { + int a[VECTLENSP]; + vstoreu_v_p_vi2(a, vi2); + return _mm256_set_ps(ptr[a[7]], ptr[a[6]], ptr[a[5]], ptr[a[4]], + ptr[a[3]], ptr[a[2]], ptr[a[1]], ptr[a[0]]); +} + +#ifdef _MSC_VER +// This function is needed when debugging on MSVC. +static INLINE float vcast_f_vf(vfloat v) { + float a[VECTLENSP]; + vstoreu_v_p_vf(a, v); + return a[0]; +} +#endif +// + +#define PNMASK ((vdouble) { +0.0, -0.0, +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0, -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE vfloat vposneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(PNMASKf))); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(NPMASKf))); } + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return _mm256_addsub_pd(x, y); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return _mm256_addsub_ps(x, y); } + +#if CONFIG == 1 +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsubadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsubadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#else +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vmla_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmla_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } +#endif + + +static INLINE vdouble vrev21_vd_vd(vdouble d0) { return _mm256_shuffle_pd(d0, d0, (0 << 3) | (1 << 2) | (0 << 1) | (1 << 0)); } +static INLINE vdouble vreva2_vd_vd(vdouble d0) { d0 = _mm256_permute2f128_pd(d0, d0, 1); return _mm256_shuffle_pd(d0, d0, (1 << 3) | (0 << 2) | (1 << 1) | (0 << 0)); } + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { _mm256_stream_pd(ptr, v); } +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_store_pd(&ptr[(offset + step * 0)*2], _mm256_extractf128_pd(v, 0)); + _mm_store_pd(&ptr[(offset + step * 1)*2], _mm256_extractf128_pd(v, 1)); +} + +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_stream_pd(&ptr[(offset + step * 0)*2], _mm256_extractf128_pd(v, 0)); + _mm_stream_pd(&ptr[(offset + step * 1)*2], _mm256_extractf128_pd(v, 1)); +} + +// + +static INLINE vfloat vrev21_vf_vf(vfloat d0) { return _mm256_shuffle_ps(d0, d0, (2 << 6) | (3 << 4) | (0 << 2) | (1 << 0)); } +static INLINE vfloat vreva2_vf_vf(vfloat d0) { d0 = _mm256_permute2f128_ps(d0, d0, 1); return _mm256_shuffle_ps(d0, d0, (1 << 6) | (0 << 4) | (3 << 2) | (2 << 0)); } + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { _mm256_stream_ps(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 0)))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 0)))); + _mm_storel_pd((double *)(ptr+(offset + step * 2)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 1)))); + _mm_storeh_pd((double *)(ptr+(offset + step * 3)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 1)))); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + return _mm_movemask_epi8(_mm_or_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))) == 0; +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { + return vreinterpret_vm_vd(_mm256_blendv_pd(vreinterpret_vd_vm(y), vreinterpret_vd_vm(x), vreinterpret_vd_vm(o))); +} + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + __m128i xh = _mm256_extractf128_si256(x, 1), xl = _mm256_extractf128_si256(x, 0); + __m128i yh = _mm256_extractf128_si256(y, 1), yl = _mm256_extractf128_si256(y, 0); + vmask r = _mm256_castsi128_si256(_mm_sub_epi64(xl, yl)); + return _mm256_insertf128_si256(r, _mm_sub_epi64(xh, yh), 1); +} + +static INLINE vmask vneg64_vm_vm(vmask x) { return vsub64_vm_vm_vm(vcast_vm_i_i(0, 0), x); } +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + __m128i xh = _mm256_extractf128_si256(x, 1), xl = _mm256_extractf128_si256(x, 0); + __m128i yh = _mm256_extractf128_si256(y, 1), yl = _mm256_extractf128_si256(y, 0); + vmask r = _mm256_castsi128_si256(_mm_cmpgt_epi64(xl, yl)); + return _mm256_insertf128_si256(r, _mm_cmpgt_epi64(xh, yh), 1); +} + +#define vsll64_vm_vm_i(x, c) \ + _mm256_insertf128_si256(_mm256_castsi128_si256(_mm_slli_epi64(_mm256_extractf128_si256(x, 0), c)), \ + _mm_slli_epi64(_mm256_extractf128_si256(x, 1), c), 1) +#define vsrl64_vm_vm_i(x, c) \ + _mm256_insertf128_si256(_mm256_castsi128_si256(_mm_srli_epi64(_mm256_extractf128_si256(x, 0), c)), \ + _mm_srli_epi64(_mm256_extractf128_si256(x, 1), c), 1) + +//@#define vsll64_vm_vm_i(x, c) _mm256_insertf128_si256(_mm256_castsi128_si256(_mm_slli_epi64(_mm256_extractf128_si256(x, 0), c)), _mm_slli_epi64(_mm256_extractf128_si256(x, 1), c), 1) +//@#define vsrl64_vm_vm_i(x, c) _mm256_insertf128_si256(_mm256_castsi128_si256(_mm_srli_epi64(_mm256_extractf128_si256(x, 0), c)), _mm_srli_epi64(_mm256_extractf128_si256(x, 1), c), 1) + +static INLINE vmask vcast_vm_vi(vint vi) { + vint vi0 = _mm_and_si128(_mm_shuffle_epi32(vi, (1 << 4) | (1 << 6)), _mm_set_epi32(0, -1, 0, -1)); + vint vi1 = _mm_and_si128(_mm_shuffle_epi32(vi, (2 << 0) | (2 << 2) | (3 << 4) | (3 << 6)), _mm_set_epi32(0, -1, 0, -1)); + vmask m = _mm256_insertf128_si256(_mm256_castsi128_si256(vi0), vi1, 1); + return vor_vm_vm_vm(vcastu_vm_vi(vand_vi_vo_vi(vgt_vo_vi_vi(vcast_vi_i(0), vi), vcast_vi_i(-1))), m); +} +static INLINE vint vcast_vi_vm(vmask vm) { + return _mm_or_si128(_mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(_mm256_castsi256_si128(vm)), _mm_set1_ps(0), 0x08)), + _mm_castps_si128(_mm_shuffle_ps(_mm_set1_ps(0), _mm_castsi128_ps(_mm256_extractf128_si256(vm, 1)), 0x80))); +} + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2.h new file mode 100644 index 0000000000000..4c0c5422170b1 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2.h @@ -0,0 +1,485 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 1 + +#if !defined(__AVX2__) && !defined(SLEEF_GENHEADER) +#error Please specify -mavx2. +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 2 +//@#define LOG2VECTLENDP 2 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if !defined(SLEEF_GENHEADER) +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __m256i vmask; +typedef __m256i vopmask; + +typedef __m256d vdouble; +typedef __m128i vint; + +typedef __m256 vfloat; +typedef __m256i vint2; + +typedef __m256i vint64; +typedef __m256i vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +#ifndef __SLEEF_H__ +void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +static INLINE int cpuSupportsAVX2() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 7, 0); + return (reg[1] & (1 << 5)) != 0; +} + +static INLINE int cpuSupportsFMA() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 12)) != 0; +} + +#if CONFIG == 1 && defined(__AVX2__) +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX2() && cpuSupportsFMA(); + return d ? 3 : 0; +} +#define ISANAME "AVX2" +#define DFTPRIORITY 25 +#endif + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { _mm_prefetch(ptr, _MM_HINT_T0); } + +static INLINE int vtestallones_i_vo32(vopmask g) { + return _mm_test_all_ones(_mm_and_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))); +} + +static INLINE int vtestallones_i_vo64(vopmask g) { + return _mm_test_all_ones(_mm_and_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))); +} + +// + +static INLINE vdouble vcast_vd_d(double d) { return _mm256_set1_pd(d); } +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return _mm256_castpd_si256(vd); } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return _mm256_castsi256_pd(vm); } + +// + +static vint2 vloadu_vi2_p(int32_t *p) { return _mm256_loadu_si256((__m256i const *)p); } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { _mm256_storeu_si256((__m256i *)p, v); } +static vint vloadu_vi_p(int32_t *p) { return _mm_loadu_si128((__m128i *)p); } +static void vstoreu_v_p_vi(int32_t *p, vint v) { _mm_storeu_si128((__m128i *)p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm256_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vcast_vo32_vo64(vopmask o) { + return _mm256_permutevar8x32_epi32(o, _mm256_set_epi32(0, 0, 0, 0, 6, 4, 2, 0)); +} + +static INLINE vopmask vcast_vo64_vo32(vopmask o) { + return _mm256_permutevar8x32_epi32(o, _mm256_set_epi32(3, 3, 2, 2, 1, 1, 0, 0)); +} + +static INLINE vopmask vcast_vo_i(int i) { return _mm256_set1_epi64x(i ? -1 : 0); } + +// + +static INLINE vint vrint_vi_vd(vdouble vd) { return _mm256_cvtpd_epi32(vd); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return _mm256_cvttpd_epi32(vd); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return _mm256_round_pd(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return _mm256_round_ps(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return _mm256_round_pd(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { return _mm256_round_ps(vf, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vdouble vcast_vd_vi(vint vi) { return _mm256_cvtepi32_pd(vi); } +static INLINE vint vcast_vi_i(int i) { return _mm_set1_epi32(i); } + +static INLINE vmask vcastu_vm_vi(vint vi) { + return _mm256_slli_epi64(_mm256_cvtepi32_epi64(vi), 32); +} + +static INLINE vint vcastu_vi_vm(vmask vi) { + return _mm_or_si128(_mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(_mm256_castsi256_si128(vi)), _mm_set1_ps(0), 0x0d)), + _mm_castps_si128(_mm_shuffle_ps(_mm_set1_ps(0), _mm_castsi128_ps(_mm256_extractf128_si256(vi, 1)), 0xd0))); +} + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { + return _mm256_set_epi32(i0, i1, i0, i1, i0, i1, i0, i1); +} + +static INLINE vmask vcast_vm_i64(int64_t i) { return _mm256_set1_epi64x(i); } +static INLINE vmask vcast_vm_u64(uint64_t i) { return _mm256_set1_epi64x((uint64_t)i); } + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { return _mm256_cmpeq_epi64(x, y); } +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { return _mm256_add_epi64(x, y); } + +// + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return _mm256_add_pd(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return _mm256_sub_pd(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return _mm256_mul_pd(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return _mm256_div_pd(x, y); } +static INLINE vdouble vrec_vd_vd(vdouble x) { return _mm256_div_pd(_mm256_set1_pd(1), x); } +static INLINE vdouble vsqrt_vd_vd(vdouble x) { return _mm256_sqrt_pd(x); } +static INLINE vdouble vabs_vd_vd(vdouble d) { return _mm256_andnot_pd(_mm256_set1_pd(-0.0), d); } +static INLINE vdouble vneg_vd_vd(vdouble d) { return _mm256_xor_pd(_mm256_set1_pd(-0.0), d); } +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fmadd_pd(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fmsub_pd(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fnmadd_pd(x, y, z); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return _mm256_max_pd(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return _mm256_min_pd(x, y); } + +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fmsub_pd(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fnmadd_pd(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm256_fnmsub_pd(x, y, z); } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm256_cmp_pd(x, y, _CMP_GE_OQ)); } + +// + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return _mm_add_epi32(x, y); } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return _mm_sub_epi32(x, y); } +static INLINE vint vneg_vi_vi(vint e) { return vsub_vi_vi_vi(vcast_vi_i(0), e); } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return _mm_andnot_si128(x, y); } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return _mm_or_si128(x, y); } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return _mm_xor_si128(x, y); } + +static INLINE vint vandnot_vi_vo_vi(vopmask m, vint y) { return _mm_andnot_si128(_mm256_castsi256_si128(m), y); } +static INLINE vint vand_vi_vo_vi(vopmask m, vint y) { return _mm_and_si128(_mm256_castsi256_si128(m), y); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return _mm_slli_epi32(x, c); } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return _mm_srli_epi32(x, c); } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return _mm_srai_epi32(x, c); } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return _mm256_castsi128_si256(_mm_cmpeq_epi32(x, y)); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return _mm256_castsi128_si256(_mm_cmpgt_epi32(x, y)); } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { return _mm_blendv_epi8(y, x, _mm256_castsi256_si128(m)); } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) { return _mm256_blendv_pd(y, x, _mm256_castsi256_pd(o)); } +static INLINE vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { return _mm256_permutevar_pd(_mm256_set_pd(v1, v0, v1, v0), o); } + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + __m256i v = _mm256_castpd_si256(vsel_vd_vo_vd_vd(o0, _mm256_castsi256_pd(_mm256_set_epi32(1, 0, 1, 0, 1, 0, 1, 0)), + vsel_vd_vo_vd_vd(o1, _mm256_castsi256_pd(_mm256_set_epi32(3, 2, 3, 2, 3, 2, 3, 2)), + vsel_vd_vo_vd_vd(o2, _mm256_castsi256_pd(_mm256_set_epi32(5, 4, 5, 4, 5, 4, 5, 4)), + _mm256_castsi256_pd(_mm256_set_epi32(7, 6, 7, 6, 7, 6, 7, 6)))))); + return _mm256_castsi256_pd(_mm256_permutevar8x32_epi32(_mm256_castpd_si256(_mm256_set_pd(d3, d2, d1, d0)), v)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o1, d0, d1, d2, d2); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(vabs_vd_vd(d), _mm256_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask vispinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, _mm256_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visminf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, _mm256_set1_pd(-SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visnan_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm256_cmp_pd(d, d, _CMP_NEQ_UQ)); +} + +#if defined(_MSC_VER) +// This function is needed when debugging on MSVC. +static INLINE double vcast_d_vd(vdouble v) { + double s[4]; + _mm256_storeu_pd(s, v); + return s[0]; +} +#endif + +static INLINE vdouble vload_vd_p(const double *ptr) { return _mm256_load_pd(ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return _mm256_loadu_pd(ptr); } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { _mm256_store_pd(ptr, v); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { _mm256_storeu_pd(ptr, v); } + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { return _mm256_i32gather_pd(ptr, vi, 8); } + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return vi; } + +static INLINE vint2 vrint_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm256_cvtps_epi32(vf)); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm256_cvttps_epi32(vf)); } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return _mm256_cvtepi32_ps(vcast_vm_vi2(vi)); } +static INLINE vfloat vcast_vf_f(float f) { return _mm256_set1_ps(f); } +static INLINE vint2 vcast_vi2_i(int i) { return _mm256_set1_epi32(i); } +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return _mm256_castps_si256(vf); } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return _mm256_castsi256_ps(vm); } + +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { return vreinterpret_vf_vm(vcast_vm_vi2(vi)); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return vcast_vi2_vm(vreinterpret_vm_vf(vf)); } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return _mm256_add_ps(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return _mm256_sub_ps(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return _mm256_mul_ps(x, y); } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return _mm256_div_ps(x, y); } +static INLINE vfloat vrec_vf_vf(vfloat x) { return vdiv_vf_vf_vf(vcast_vf_f(1.0f), x); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return _mm256_sqrt_ps(x); } +static INLINE vfloat vabs_vf_vf(vfloat f) { return vreinterpret_vf_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f))); } +static INLINE vfloat vneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(d))); } +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fmadd_ps(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fmsub_ps(x, y, z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fnmadd_ps(x, y, z); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return _mm256_max_ps(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return _mm256_min_ps(x, y); } + +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fmsub_ps(x, y, z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fnmadd_ps(x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm256_fnmsub_ps(x, y, z); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm256_cmp_ps(x, y, _CMP_GE_OQ)); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_add_epi32(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_sub_epi32(x, y); } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return vsub_vi2_vi2_vi2(vcast_vi2_i(0), e); } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_and_si256(x, y); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_andnot_si256(x, y); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_or_si256(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_xor_si256(x, y); } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return vand_vi2_vi2_vi2(vcast_vi2_vm(x), y); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return vandnot_vi2_vi2_vi2(vcast_vi2_vm(x), y); } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { return _mm256_slli_epi32(x, c); } +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { return _mm256_srli_epi32(x, c); } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { return _mm256_srai_epi32(x, c); } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return _mm256_cmpeq_epi32(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return _mm256_cmpgt_epi32(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_cmpeq_epi32(x, y); } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm256_cmpgt_epi32(x, y); } + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return _mm256_blendv_epi8(y, x, m); +} + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) { return _mm256_blendv_ps(y, x, _mm256_castsi256_ps(o)); } + +// At this point, the following three functions are implemented in a generic way, +// but I will try target-specific optimization later on. +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +#ifdef _MSC_VER +// This function is needed when debugging on MSVC. +static INLINE float vcast_f_vf(vfloat v) { + float s[8]; + _mm256_storeu_ps(s, v); + return s[0]; +} +#endif + +static INLINE vfloat vload_vf_p(const float *ptr) { return _mm256_load_ps(ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return _mm256_loadu_ps(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { _mm256_store_ps(ptr, v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { _mm256_storeu_ps(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { return _mm256_i32gather_ps(ptr, vi2, 4); } + +// + +#define PNMASK ((vdouble) { +0.0, -0.0, +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0, -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE vfloat vposneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(PNMASKf))); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(NPMASKf))); } + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return _mm256_addsub_pd(x, y); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return _mm256_addsub_ps(x, y); } + +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vmla_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmla_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } + +static INLINE vdouble vrev21_vd_vd(vdouble d0) { return _mm256_shuffle_pd(d0, d0, (0 << 3) | (1 << 2) | (0 << 1) | (1 << 0)); } +static INLINE vdouble vreva2_vd_vd(vdouble d0) { d0 = _mm256_permute2f128_pd(d0, d0, 1); return _mm256_shuffle_pd(d0, d0, (1 << 3) | (0 << 2) | (1 << 1) | (0 << 0)); } + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { _mm256_stream_pd(ptr, v); } +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_store_pd(&ptr[(offset + step * 0)*2], _mm256_extractf128_pd(v, 0)); + _mm_store_pd(&ptr[(offset + step * 1)*2], _mm256_extractf128_pd(v, 1)); +} + +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_stream_pd(&ptr[(offset + step * 0)*2], _mm256_extractf128_pd(v, 0)); + _mm_stream_pd(&ptr[(offset + step * 1)*2], _mm256_extractf128_pd(v, 1)); +} + +// + +static INLINE vfloat vrev21_vf_vf(vfloat d0) { return _mm256_shuffle_ps(d0, d0, (2 << 6) | (3 << 4) | (0 << 2) | (1 << 0)); } +static INLINE vfloat vreva2_vf_vf(vfloat d0) { d0 = _mm256_permute2f128_ps(d0, d0, 1); return _mm256_shuffle_ps(d0, d0, (1 << 6) | (0 << 4) | (3 << 2) | (2 << 0)); } + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { _mm256_stream_ps(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 0)))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 0)))); + _mm_storel_pd((double *)(ptr+(offset + step * 2)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 1)))); + _mm_storeh_pd((double *)(ptr+(offset + step * 3)*2), _mm_castsi128_pd(_mm_castps_si128(_mm256_extractf128_ps(v, 1)))); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + return _mm_movemask_epi8(_mm_or_si128(_mm256_extractf128_si256(g, 0), _mm256_extractf128_si256(g, 1))) == 0; +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { return _mm256_blendv_epi8(y, x, o); } + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { return _mm256_sub_epi64(x, y); } +static INLINE vmask vneg64_vm_vm(vmask x) { return _mm256_sub_epi64(vcast_vm_i_i(0, 0), x); } +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { return _mm256_cmpgt_epi64(x, y); } // signed compare + +#define vsll64_vm_vm_i(x, c) _mm256_slli_epi64(x, c) +#define vsrl64_vm_vm_i(x, c) _mm256_srli_epi64(x, c) +//@#define vsll64_vm_vm_i(x, c) _mm256_slli_epi64(x, c) +//@#define vsrl64_vm_vm_i(x, c) _mm256_srli_epi64(x, c) + +static INLINE vmask vcast_vm_vi(vint vi) { return _mm256_cvtepi32_epi64(vi); } // signed 32-bit => 64-bit +static INLINE vint vcast_vi_vm(vmask vm) { // signed 32-bit <= 64-bit + return _mm_or_si128(_mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(_mm256_castsi256_si128(vm)), _mm_set1_ps(0), 0x08)), + _mm_castps_si128(_mm_shuffle_ps(_mm_set1_ps(0), _mm_castsi128_ps(_mm256_extractf128_si256(vm, 1)), 0x80))); +} + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2_128.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2_128.h new file mode 100644 index 0000000000000..5233db1bfd79a --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx2_128.h @@ -0,0 +1,463 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 1 + +#if !defined(__AVX2__) && !defined(SLEEF_GENHEADER) +#error Please specify -mavx2. +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 1 +//@#define LOG2VECTLENDP 1 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if !defined(SLEEF_GENHEADER) +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __m128i vmask; +typedef __m128i vopmask; + +typedef __m128d vdouble; +typedef __m128i vint; + +typedef __m128 vfloat; +typedef __m128i vint2; + +typedef __m128i vint64; +typedef __m128i vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +#ifndef __SLEEF_H__ +void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +static INLINE int cpuSupportsAVX2() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 7, 0); + return (reg[1] & (1 << 5)) != 0; +} + +static INLINE int cpuSupportsFMA() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 12)) != 0; +} + +#if CONFIG == 1 && defined(__AVX2__) +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX2() && cpuSupportsFMA(); + return d ? 3 : 0; +} +#define ISANAME "AVX2" +#define DFTPRIORITY 25 +#endif + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { _mm_prefetch(ptr, _MM_HINT_T0); } + +static INLINE int vtestallones_i_vo32(vopmask g) { return _mm_movemask_epi8(g) == 0xFFFF; } +static INLINE int vtestallones_i_vo64(vopmask g) { return _mm_movemask_epi8(g) == 0xFFFF; } + +// + +static INLINE vdouble vcast_vd_d(double d) { return _mm_set1_pd(d); } +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return _mm_castpd_si128(vd); } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return _mm_castsi128_pd(vm); } + +// + +static vint2 vloadu_vi2_p(int32_t *p) { return _mm_loadu_si128((__m128i const *)p); } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { _mm_storeu_si128((__m128i *)p, v); } +static vint vloadu_vi_p(int32_t *p) { return _mm_loadu_si128((__m128i *)p); } +static void vstoreu_v_p_vi(int32_t *p, vint v) { _mm_storeu_si128((__m128i *)p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return vreinterpret_vm_vd(_mm_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return vreinterpret_vm_vd(_mm_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_and_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_andnot_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_or_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return vreinterpret_vm_vd(_mm_xor_pd(vreinterpret_vd_vm(x), vreinterpret_vd_vm(y))); } + +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return _mm_shuffle_epi32(m, 0x08); } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return _mm_shuffle_epi32(m, 0x50); } + +static INLINE vopmask vcast_vo_i(int i) { return _mm_set1_epi64x(i ? -1 : 0); } + +// + +static INLINE vint vrint_vi_vd(vdouble vd) { return _mm_cvtpd_epi32(vd); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return _mm_cvttpd_epi32(vd); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return _mm_round_pd(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return _mm_round_ps(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return _mm_round_pd(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { return _mm_round_ps(vf, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vdouble vcast_vd_vi(vint vi) { return _mm_cvtepi32_pd(vi); } +static INLINE vint vcast_vi_i(int i) { return _mm_set1_epi32(i); } + +static INLINE vmask vcastu_vm_vi(vint vi) { return _mm_and_si128(_mm_shuffle_epi32(vi, 0x73), _mm_set_epi32(-1, 0, -1, 0)); } +static INLINE vint vcastu_vi_vm(vmask vi) { return _mm_shuffle_epi32(vi, 0x0d); } + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { return _mm_set_epi32(i0, i1, i0, i1); } + +static INLINE vmask vcast_vm_i64(int64_t i) { return _mm_set1_epi64x(i); } +static INLINE vmask vcast_vm_u64(uint64_t i) { return _mm_set1_epi64x((uint64_t)i); } + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { return _mm_cmpeq_epi64(x, y); } +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { return _mm_add_epi64(x, y); } + +// + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return _mm_add_pd(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return _mm_sub_pd(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return _mm_mul_pd(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return _mm_div_pd(x, y); } +static INLINE vdouble vrec_vd_vd(vdouble x) { return _mm_div_pd(_mm_set1_pd(1), x); } +static INLINE vdouble vsqrt_vd_vd(vdouble x) { return _mm_sqrt_pd(x); } +static INLINE vdouble vabs_vd_vd(vdouble d) { return _mm_andnot_pd(_mm_set1_pd(-0.0), d); } +static INLINE vdouble vneg_vd_vd(vdouble d) { return _mm_xor_pd(_mm_set1_pd(-0.0), d); } +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fmadd_pd(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fmsub_pd(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fnmadd_pd(x, y, z); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return _mm_max_pd(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return _mm_min_pd(x, y); } + +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fmsub_pd(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fnmadd_pd(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm_fnmsub_pd(x, y, z); } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return vreinterpret_vm_vd(_mm_cmp_pd(x, y, _CMP_GE_OQ)); } + +// + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return _mm_add_epi32(x, y); } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return _mm_sub_epi32(x, y); } +static INLINE vint vneg_vi_vi(vint e) { return vsub_vi_vi_vi(vcast_vi_i(0), e); } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return _mm_andnot_si128(x, y); } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return _mm_or_si128(x, y); } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return _mm_xor_si128(x, y); } + +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { return _mm_andnot_si128(x, y); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return _mm_slli_epi32(x, c); } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return _mm_srli_epi32(x, c); } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return _mm_srai_epi32(x, c); } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { return _mm_blendv_epi8(y, x, m); } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) { return _mm_blendv_pd(y, x, _mm_castsi128_pd(o)); } + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmp_pd(vabs_vd_vd(d), _mm_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask vispinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmp_pd(d, _mm_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visminf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmp_pd(d, _mm_set1_pd(-SLEEF_INFINITY), _CMP_EQ_OQ)); +} + +static INLINE vopmask visnan_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmp_pd(d, d, _CMP_NEQ_UQ)); +} + +static INLINE vdouble vload_vd_p(const double *ptr) { return _mm_load_pd(ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return _mm_loadu_pd(ptr); } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { _mm_store_pd(ptr, v); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { _mm_storeu_pd(ptr, v); } + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { return _mm_i32gather_pd(ptr, vi, 8); } + +#if defined(_MSC_VER) +// This function is needed when debugging on MSVC. +static INLINE double vcast_d_vd(vdouble v) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + return a[0]; +} +#endif + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return vi; } + +static INLINE vint2 vrint_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm_cvtps_epi32(vf)); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm_cvttps_epi32(vf)); } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return _mm_cvtepi32_ps(vcast_vm_vi2(vi)); } +static INLINE vfloat vcast_vf_f(float f) { return _mm_set1_ps(f); } +static INLINE vint2 vcast_vi2_i(int i) { return _mm_set1_epi32(i); } +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return _mm_castps_si128(vf); } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return _mm_castsi128_ps(vm); } + +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { return vreinterpret_vf_vm(vcast_vm_vi2(vi)); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return vcast_vi2_vm(vreinterpret_vm_vf(vf)); } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return _mm_add_ps(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return _mm_sub_ps(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return _mm_mul_ps(x, y); } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return _mm_div_ps(x, y); } +static INLINE vfloat vrec_vf_vf(vfloat x) { return vdiv_vf_vf_vf(vcast_vf_f(1.0f), x); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return _mm_sqrt_ps(x); } +static INLINE vfloat vabs_vf_vf(vfloat f) { return vreinterpret_vf_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f))); } +static INLINE vfloat vneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(d))); } +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fmadd_ps(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fmsub_ps(x, y, z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fnmadd_ps(x, y, z); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return _mm_max_ps(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return _mm_min_ps(x, y); } + +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fmsub_ps(x, y, z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fnmadd_ps(x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm_fnmsub_ps(x, y, z); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_EQ_OQ)); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_NEQ_UQ)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_LT_OQ)); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_LE_OQ)); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_GT_OQ)); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmp_ps(x, y, _CMP_GE_OQ)); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_add_epi32(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_sub_epi32(x, y); } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return vsub_vi2_vi2_vi2(vcast_vi2_i(0), e); } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_and_si128(x, y); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_andnot_si128(x, y); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_or_si128(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_xor_si128(x, y); } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return vand_vi2_vi2_vi2(vcast_vi2_vm(x), y); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return vandnot_vi2_vi2_vi2(vcast_vi2_vm(x), y); } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { return _mm_slli_epi32(x, c); } +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { return _mm_srli_epi32(x, c); } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { return _mm_srai_epi32(x, c); } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpgt_epi32(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return _mm_blendv_epi8(y, x, m); +} + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) { return _mm_blendv_ps(y, x, _mm_castsi128_ps(o)); } + +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +static INLINE vfloat vload_vf_p(const float *ptr) { return _mm_load_ps(ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return _mm_loadu_ps(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { _mm_store_ps(ptr, v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { _mm_storeu_ps(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { return _mm_i32gather_ps(ptr, vi2, 4); } + +#ifdef _MSC_VER +// This function is needed when debugging on MSVC. +static INLINE float vcast_f_vf(vfloat v) { + float a[VECTLENSP]; + vstoreu_v_p_vf(a, v); + return a[0]; +} +#endif + +// + +#define PNMASK ((vdouble) { +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE vfloat vposneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(PNMASKf))); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(NPMASKf))); } + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return _mm_addsub_pd(x, y); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return _mm_addsub_ps(x, y); } + +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vmla_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmla_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } + +static INLINE vdouble vrev21_vd_vd(vdouble d0) { return _mm_shuffle_pd(d0, d0, 1); } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return vd; } + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { _mm_stream_pd(ptr, v); } +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vstore_v_p_vd((double *)(&ptr[2*offset]), v); } +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { _mm_stream_pd((double *)(&ptr[2*offset]), v); } + +// + +static INLINE vfloat vrev21_vf_vf(vfloat d0) { return _mm_shuffle_ps(d0, d0, (2 << 6) | (3 << 4) | (0 << 2) | (1 << 0)); } +static INLINE vfloat vreva2_vf_vf(vfloat d0) { return _mm_shuffle_ps(d0, d0, (1 << 6) | (0 << 4) | (3 << 2) | (2 << 0)); } + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { _mm_stream_ps(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); +} + +// + +static vquad loadu_vq_p(void *p) { + vquad vq = { + vloadu_vi2_p((int32_t *)p), + vloadu_vi2_p((int32_t *)((uint8_t *)p + sizeof(vmask))) + }; + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static void vstoreu_v_p_vq(void *p, vquad vq) { + vstoreu_v_p_vi2((int32_t *)p, vcast_vi2_vm(vq.x)); + vstoreu_v_p_vi2((int32_t *)((uint8_t *)p + sizeof(vmask)), vcast_vi2_vm(vq.y)); +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { return _mm_movemask_epi8(g) == 0; } + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { return _mm_blendv_epi8(y, x, o); } + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { return _mm_sub_epi64(x, y); } +static INLINE vmask vneg64_vm_vm(vmask x) { return _mm_sub_epi64(vcast_vm_i_i(0, 0), x); } +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { return _mm_cmpgt_epi64(x, y); } // signed compare + +#define vsll64_vm_vm_i(x, c) _mm_slli_epi64(x, c) +#define vsrl64_vm_vm_i(x, c) _mm_srli_epi64(x, c) +//@#define vsll64_vm_vm_i(x, c) _mm_slli_epi64(x, c) +//@#define vsrl64_vm_vm_i(x, c) _mm_srli_epi64(x, c) + +static INLINE vmask vcast_vm_vi(vint vi) { + vmask m = _mm_and_si128(_mm_shuffle_epi32(vi, (0 << 6) | (1 << 4) | (0 << 2) | (0 << 0)), _mm_set_epi32(0, -1, 0, -1)); + return vor_vm_vm_vm(vcastu_vm_vi(vgt_vo_vi_vi(vcast_vi_i(0), vi)), m); +} +static INLINE vint vcast_vi_vm(vmask vm) { return _mm_shuffle_epi32(vm, 0x08); } + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx512f.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx512f.h new file mode 100644 index 0000000000000..d59379163de52 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperavx512f.h @@ -0,0 +1,600 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 1 || CONFIG == 2 + +#if !defined(__AVX512F__) && !defined(SLEEF_GENHEADER) +#error Please specify -mavx512f. +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 3 +//@#define LOG2VECTLENDP 3 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#if CONFIG == 1 +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#endif + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if !defined(SLEEF_GENHEADER) +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __m512i vmask; +typedef __mmask16 vopmask; + +typedef __m512d vdouble; +typedef __m256i vint; + +typedef __m512 vfloat; +typedef __m512i vint2; + +typedef __m512i vint64; +typedef __m512i vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +#ifndef __SLEEF_H__ +void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +static INLINE int cpuSupportsAVX512F() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 7, 0); + return (reg[1] & (1 << 16)) != 0; +} + +#if CONFIG == 1 && defined(__AVX512F__) +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX512F(); + return d ? 3 : 0; +} +#define ISANAME "AVX512F" +#define DFTPRIORITY 30 +#endif + +#if CONFIG == 2 && defined(__AVX512F__) +static INLINE int vavailability_i(int name) { + int d = cpuSupportsAVX512F(); + return d ? 3 : 0; +} +#define ISANAME "AVX512FNOFMA" +#define DFTPRIORITY 0 +#endif + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { _mm_prefetch(ptr, _MM_HINT_T0); } + +#ifdef __INTEL_COMPILER +static INLINE int vtestallones_i_vo64(vopmask g) { return _mm512_mask2int(g) == 0xff; } +static INLINE int vtestallones_i_vo32(vopmask g) { return _mm512_mask2int(g) == 0xffff; } +#else +static INLINE int vtestallones_i_vo64(vopmask g) { return g == 0xff; } +static INLINE int vtestallones_i_vo32(vopmask g) { return g == 0xffff; } +#endif + +// + +static vint2 vloadu_vi2_p(int32_t *p) { return _mm512_loadu_si512((__m512i const *)p); } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { _mm512_storeu_si512((__m512i *)p, v); } +static vint vloadu_vi_p(int32_t *p) { return _mm256_loadu_si256((__m256i const *)p); } +static void vstoreu_v_p_vi(int32_t *p, vint v) { _mm256_storeu_si256((__m256i *)p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return _mm512_and_si512(x, y); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return _mm512_andnot_si512(x, y); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return _mm512_or_si512(x, y); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return _mm512_xor_si512(x, y); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return _mm512_kand(x, y); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return _mm512_kandn(x, y); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return _mm512_kor(x, y); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return _mm512_kxor(x, y); } + +static INLINE vmask vand_vm_vo64_vm(vopmask o, vmask m) { return _mm512_mask_and_epi64(_mm512_set1_epi32(0), o, m, m); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask o, vmask m) { return _mm512_mask_and_epi64(m, o, _mm512_set1_epi32(0), _mm512_set1_epi32(0)); } +static INLINE vmask vor_vm_vo64_vm(vopmask o, vmask m) { return _mm512_mask_or_epi64(m, o, _mm512_set1_epi32(-1), _mm512_set1_epi32(-1)); } + +static INLINE vmask vand_vm_vo32_vm(vopmask o, vmask m) { return _mm512_mask_and_epi32(_mm512_set1_epi32(0), o, m, m); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask o, vmask m) { return _mm512_mask_and_epi32(m, o, _mm512_set1_epi32(0), _mm512_set1_epi32(0)); } +static INLINE vmask vor_vm_vo32_vm(vopmask o, vmask m) { return _mm512_mask_or_epi32(m, o, _mm512_set1_epi32(-1), _mm512_set1_epi32(-1)); } + +static INLINE vopmask vcast_vo32_vo64(vopmask o) { return o; } +static INLINE vopmask vcast_vo64_vo32(vopmask o) { return o; } + +static INLINE vopmask vcast_vo_i(int i) { return i ? -1 : 0; } + +// + +static INLINE vint vrint_vi_vd(vdouble vd) { + return _mm512_cvt_roundpd_epi32(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); +} + +static INLINE vint vtruncate_vi_vd(vdouble vd) { + return _mm512_cvt_roundpd_epi32(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); +} + +static INLINE vdouble vcast_vd_vi(vint vi) { return _mm512_cvtepi32_pd(vi); } +static INLINE vint vcast_vi_i(int i) { return _mm256_set1_epi32(i); } + +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { + return _mm512_roundscale_pd(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); +} + +static INLINE vdouble vrint_vd_vd(vdouble vd) { + return _mm512_roundscale_pd(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); +} + +static INLINE vmask vcastu_vm_vi(vint vi) { + return _mm512_maskz_permutexvar_epi32(0xaaaa, _mm512_set_epi32(7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0), _mm512_castsi256_si512(vi)); +} + +static INLINE vint vcastu_vi_vm(vmask vi) { + return _mm512_castsi512_si256(_mm512_maskz_permutexvar_epi32(0x00ff, _mm512_set_epi32(0, 0, 0, 0, 0, 0, 0, 0, 15, 13, 11, 9, 7, 5, 3, 1), vi)); +} + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { return _mm512_set_epi32(i0, i1, i0, i1, i0, i1, i0, i1, i0, i1, i0, i1, i0, i1, i0, i1); } + +static INLINE vmask vcast_vm_i64(int64_t i) { return _mm512_set1_epi64(i); } +static INLINE vmask vcast_vm_u64(uint64_t i) { return _mm512_set1_epi64((uint64_t)i); } + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { return _mm512_cmp_epi64_mask(x, y, _MM_CMPINT_EQ); } +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { return _mm512_add_epi64(x, y); } + +// + +static INLINE vdouble vcast_vd_d(double d) { return _mm512_set1_pd(d); } +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return _mm512_castpd_si512(vd); } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return _mm512_castsi512_pd(vm); } + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return _mm512_add_pd(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return _mm512_sub_pd(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return _mm512_mul_pd(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return _mm512_div_pd(x, y); } +static INLINE vdouble vrec_vd_vd(vdouble x) { return _mm512_div_pd(_mm512_set1_pd(1), x); } +static INLINE vdouble vsqrt_vd_vd(vdouble x) { return _mm512_sqrt_pd(x); } +static INLINE vdouble vabs_vd_vd(vdouble d) { return vreinterpret_vd_vm(_mm512_andnot_si512(vreinterpret_vm_vd(_mm512_set1_pd(-0.0)), vreinterpret_vm_vd(d))); } +static INLINE vdouble vneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(_mm512_xor_si512(vreinterpret_vm_vd(_mm512_set1_pd(-0.0)), vreinterpret_vm_vd(d))); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return _mm512_max_pd(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return _mm512_min_pd(x, y); } + +#if CONFIG == 1 +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmadd_pd(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmsub_pd(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fnmadd_pd(x, y, z); } +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +#endif + +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmadd_pd(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmsub_pd(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fnmadd_pd(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fnmsub_pd(x, y, z); } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_EQ_OQ); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_NEQ_UQ); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_LT_OQ); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_LE_OQ); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_GT_OQ); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return _mm512_cmp_pd_mask(x, y, _CMP_GE_OQ); } + +// + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return _mm256_add_epi32(x, y); } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return _mm256_sub_epi32(x, y); } +static INLINE vint vneg_vi_vi(vint e) { return vsub_vi_vi_vi(vcast_vi_i(0), e); } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return _mm256_and_si256(x, y); } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return _mm256_andnot_si256(x, y); } + +static INLINE vint vandnot_vi_vo_vi(vopmask o, vint y) { + return _mm512_castsi512_si256(_mm512_mask_and_epi32(_mm512_castsi256_si512(y), o, _mm512_set1_epi32(0), _mm512_set1_epi32(0))); +} +static INLINE vint vand_vi_vo_vi(vopmask o, vint y) { + return _mm512_castsi512_si256(_mm512_mask_and_epi32(_mm512_set1_epi32(0), o, _mm512_castsi256_si512(y), _mm512_castsi256_si512(y))); +} + +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return _mm256_or_si256(x, y); } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return _mm256_xor_si256(x, y); } +#define vsll_vi_vi_i(x, c) _mm256_slli_epi32(x, c) +#define vsrl_vi_vi_i(x, c) _mm256_srli_epi32(x, c) +#define vsra_vi_vi_i(x, c) _mm256_srai_epi32(x, c) +//@#define vsll_vi_vi_i(x, c) _mm256_slli_epi32(x, c) +//@#define vsrl_vi_vi_i(x, c) _mm256_srli_epi32(x, c) +//@#define vsra_vi_vi_i(x, c) _mm256_srai_epi32(x, c) + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return _mm256_cmpeq_epi32(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return _mm256_cmpgt_epi32(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { + return _mm512_cmp_epi32_mask(_mm512_castsi256_si512(x), _mm512_castsi256_si512(y), _MM_CMPINT_EQ); +} +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { + return _mm512_cmp_epi32_mask(_mm512_castsi256_si512(y), _mm512_castsi256_si512(x), _MM_CMPINT_LT); +} + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask mask, vdouble x, vdouble y) { + return _mm512_mask_blend_pd(mask, y, x); +} + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +#if 1 +// Probably this is faster +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + __m512i v = _mm512_castpd_si512(vsel_vd_vo_vd_vd(o0, _mm512_castsi512_pd(_mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 0)), + vsel_vd_vo_vd_vd(o1, _mm512_castsi512_pd(_mm512_set_epi64(1, 1, 1, 1, 1, 1, 1, 1)), + vsel_vd_vo_vd_vd(o2, _mm512_castsi512_pd(_mm512_set_epi64(2, 2, 2, 2, 2, 2, 2, 2)), + _mm512_castsi512_pd(_mm512_set_epi64(3, 3, 3, 3, 3, 3, 3, 3)))))); + return _mm512_permutexvar_pd(v, _mm512_castpd256_pd512(_mm256_set_pd(d3, d2, d1, d0))); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o1, d0, d1, d2, d2); +} +#else +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} +#endif + +static INLINE vopmask visinf_vo_vd(vdouble d) { + return _mm512_cmp_pd_mask(vabs_vd_vd(d), _mm512_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ); +} + +static INLINE vopmask vispinf_vo_vd(vdouble d) { + return _mm512_cmp_pd_mask(d, _mm512_set1_pd(SLEEF_INFINITY), _CMP_EQ_OQ); +} + +static INLINE vopmask visminf_vo_vd(vdouble d) { + return _mm512_cmp_pd_mask(d, _mm512_set1_pd(-SLEEF_INFINITY), _CMP_EQ_OQ); +} + +static INLINE vopmask visnan_vo_vd(vdouble d) { + return _mm512_cmp_pd_mask(d, d, _CMP_NEQ_UQ); +} + +static INLINE vint vilogbk_vi_vd(vdouble d) { return vrint_vi_vd(_mm512_getexp_pd(d)); } + +// vilogb2k_vi_vd is similar to vilogbk_vi_vd, but the argument has to +// be a normalized FP value. +static INLINE vint vilogb2k_vi_vd(vdouble d) { return vrint_vi_vd(_mm512_getexp_pd(d)); } + +static INLINE vdouble vgetexp_vd_vd(vdouble d) { return _mm512_getexp_pd(d); } +static INLINE vfloat vgetexp_vf_vf(vfloat d) { return _mm512_getexp_ps(d); } + +static INLINE vdouble vgetmant_vd_vd(vdouble d) { return _mm512_getmant_pd(d, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_nan); } +static INLINE vfloat vgetmant_vf_vf(vfloat d) { return _mm512_getmant_ps(d, _MM_MANT_NORM_p75_1p5, _MM_MANT_SIGN_nan); } + +#define vfixup_vd_vd_vd_vi2_i(a, b, c, imm) _mm512_fixupimm_pd((a), (b), (c), (imm)) +#define vfixup_vf_vf_vf_vi2_i(a, b, c, imm) _mm512_fixupimm_ps((a), (b), (c), (imm)) +//@#define vfixup_vd_vd_vd_vi2_i(a, b, c, imm) _mm512_fixupimm_pd((a), (b), (c), (imm)) +//@#define vfixup_vf_vf_vf_vi2_i(a, b, c, imm) _mm512_fixupimm_ps((a), (b), (c), (imm)) + +#if defined(_MSC_VER) +// This function is needed when debugging on MSVC. +static INLINE double vcast_d_vd(vdouble v) { + double s[VECTLENDP]; + _mm512_storeu_pd(s, v); + return s[0]; +} +#endif + +static INLINE vdouble vload_vd_p(const double *ptr) { return _mm512_load_pd(ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return _mm512_loadu_pd(ptr); } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { _mm512_store_pd(ptr, v); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { _mm512_storeu_pd(ptr, v); } + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { return _mm512_i32gather_pd(vi, ptr, 8); } + +// + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { + return _mm512_castsi512_si256(_mm512_mask_blend_epi32(m, _mm512_castsi256_si512(y), _mm512_castsi256_si512(x))); +} + +// + +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return _mm512_castps_si512(vf); } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return _mm512_castsi512_ps(vm); } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { return _mm512_castsi512_ps(vi); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return _mm512_castps_si512(vf); } + +static INLINE vdouble vreinterpret_vd_vf(vfloat vf) { return _mm512_castps_pd(vf); } +static INLINE vfloat vreinterpret_vf_vd(vdouble vd) { return _mm512_castpd_ps(vd); } + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return vi; } + +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return _mm512_cvtepi32_ps(vcast_vm_vi2(vi)); } +static INLINE vfloat vcast_vf_f(float f) { return _mm512_set1_ps(f); } +static INLINE vint2 vcast_vi2_i(int i) { return _mm512_set1_epi32(i); } +static INLINE vint2 vrint_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm512_cvtps_epi32(vf)); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vcast_vi2_vm(_mm512_cvttps_epi32(vf)); } + +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { + return _mm512_roundscale_ps(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); +} + +static INLINE vfloat vrint_vf_vf(vfloat vd) { + return _mm512_roundscale_ps(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); +} + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return _mm512_add_ps(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return _mm512_sub_ps(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return _mm512_mul_ps(x, y); } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return _mm512_div_ps(x, y); } +static INLINE vfloat vrec_vf_vf(vfloat x) { return vdiv_vf_vf_vf(vcast_vf_f(1.0f), x); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return _mm512_sqrt_ps(x); } +static INLINE vfloat vabs_vf_vf(vfloat f) { return vreinterpret_vf_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f))); } +static INLINE vfloat vneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(d))); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return _mm512_max_ps(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return _mm512_min_ps(x, y); } + +#if CONFIG == 1 +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmadd_ps(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmsub_ps(x, y, z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fnmadd_ps(x, y, z); } +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#endif + +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmadd_ps(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmsub_ps(x, y, z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fnmadd_ps(x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fnmsub_ps(x, y, z); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_EQ_OQ); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_NEQ_UQ); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_LT_OQ); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_LE_OQ); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_GT_OQ); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return _mm512_cmp_ps_mask(x, y, _CMP_GE_OQ); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_add_epi32(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_sub_epi32(x, y); } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return vsub_vi2_vi2_vi2(vcast_vi2_i(0), e); } +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_and_si512(x, y); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_andnot_si512(x, y); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_or_si512(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm512_xor_si512(x, y); } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask o, vint2 m) { + return _mm512_mask_and_epi32(_mm512_set1_epi32(0), o, m, m); +} + +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask o, vint2 m) { + return _mm512_mask_and_epi32(m, o, _mm512_set1_epi32(0), _mm512_set1_epi32(0)); +} + +#define vsll_vi2_vi2_i(x, c) _mm512_slli_epi32(x, c) +#define vsrl_vi2_vi2_i(x, c) _mm512_srli_epi32(x, c) +#define vsra_vi2_vi2_i(x, c) _mm512_srai_epi32(x, c) +//@#define vsll_vi2_vi2_i(x, c) _mm512_slli_epi32(x, c) +//@#define vsrl_vi2_vi2_i(x, c) _mm512_srli_epi32(x, c) +//@#define vsra_vi2_vi2_i(x, c) _mm512_srai_epi32(x, c) +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return _mm512_cmpeq_epi32_mask(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return _mm512_cmpgt_epi32_mask(x, y); } + +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { + __mmask16 m = _mm512_cmp_epi32_mask(x, y, _MM_CMPINT_EQ); + return _mm512_mask_and_epi32(_mm512_set1_epi32(0), m, _mm512_set1_epi32(-1), _mm512_set1_epi32(-1)); +} +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { + __mmask16 m = _mm512_cmp_epi32_mask(y, x, _MM_CMPINT_LT); + return _mm512_mask_and_epi32(_mm512_set1_epi32(0), m, _mm512_set1_epi32(-1), _mm512_set1_epi32(-1)); +} + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return _mm512_mask_blend_epi32(m, y, x); +} + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask m, vfloat x, vfloat y) { + return _mm512_mask_blend_ps(m, y, x); +} + +// At this point, the following three functions are implemented in a generic way, +// but I will try target-specific optimization later on. +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +static INLINE vint2 vilogbk_vi2_vf(vfloat d) { return vrint_vi2_vf(_mm512_getexp_ps(d)); } +static INLINE vint2 vilogb2k_vi2_vf(vfloat d) { return vrint_vi2_vf(_mm512_getexp_ps(d)); } + +#ifdef _MSC_VER +// This function is needed when debugging on MSVC. +static INLINE float vcast_f_vf(vfloat v) { + float s[VECTLENSP]; + _mm512_storeu_ps(s, v); + return s[0]; +} +#endif + +static INLINE vfloat vload_vf_p(const float *ptr) { return _mm512_load_ps(ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return _mm512_loadu_ps(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { _mm512_store_ps(ptr, v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { _mm512_storeu_ps(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { return _mm512_i32gather_ps(vi2, ptr, 4); } + +// + +static INLINE vdouble vposneg_vd_vd(vdouble d) { + return vreinterpret_vd_vm(_mm512_mask_xor_epi32(vreinterpret_vm_vd(d), 0xcccc, vreinterpret_vm_vd(d), vreinterpret_vm_vd(_mm512_set1_pd(-0.0)))); +} +static INLINE vdouble vnegpos_vd_vd(vdouble d) { + return vreinterpret_vd_vm(_mm512_mask_xor_epi32(vreinterpret_vm_vd(d), 0x3333, vreinterpret_vm_vd(d), vreinterpret_vm_vd(_mm512_set1_pd(-0.0)))); +} +static INLINE vfloat vposneg_vf_vf(vfloat d) { + return vreinterpret_vf_vm(_mm512_mask_xor_epi32(vreinterpret_vm_vf(d), 0xaaaa, vreinterpret_vm_vf(d), vreinterpret_vm_vf(_mm512_set1_ps(-0.0f)))); +} +static INLINE vfloat vnegpos_vf_vf(vfloat d) { + return vreinterpret_vf_vm(_mm512_mask_xor_epi32(vreinterpret_vm_vf(d), 0x5555, vreinterpret_vm_vf(d), vreinterpret_vm_vf(_mm512_set1_ps(-0.0f)))); +} + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return vadd_vf_vf_vf(x, vnegpos_vf_vf(y)); } + +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return _mm512_fmaddsub_pd(x, y, z); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return _mm512_fmaddsub_ps(x, y, z); } + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { return _mm512_permute_pd(vd, 0x55); } + +static INLINE vdouble vreva2_vd_vd(vdouble vd) { + return vreinterpret_vd_vm(_mm512_permutexvar_epi32(_mm512_set_epi32(3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12), vreinterpret_vm_vd(vd))); +} + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { _mm512_stream_pd(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_store_pd(&ptr[(offset + step * 0)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 0))); + _mm_store_pd(&ptr[(offset + step * 1)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 1))); + _mm_store_pd(&ptr[(offset + step * 2)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 2))); + _mm_store_pd(&ptr[(offset + step * 3)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 3))); +} + +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + _mm_stream_pd(&ptr[(offset + step * 0)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 0))); + _mm_stream_pd(&ptr[(offset + step * 1)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 1))); + _mm_stream_pd(&ptr[(offset + step * 2)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 2))); + _mm_stream_pd(&ptr[(offset + step * 3)*2], _mm_castps_pd(_mm512_extractf32x4_ps(vreinterpret_vf_vd(v), 3))); +} + +// + +static INLINE vfloat vrev21_vf_vf(vfloat vf) { return _mm512_permute_ps(vf, 0xb1); } + +static INLINE vfloat vreva2_vf_vf(vfloat vf) { + return vreinterpret_vf_vm(_mm512_permutexvar_epi32(_mm512_set_epi32(1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14), vreinterpret_vm_vf(vf))); +} + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { _mm512_stream_ps(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 0))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 0))); + _mm_storel_pd((double *)(ptr+(offset + step * 2)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 1))); + _mm_storeh_pd((double *)(ptr+(offset + step * 3)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 1))); + _mm_storel_pd((double *)(ptr+(offset + step * 4)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 2))); + _mm_storeh_pd((double *)(ptr+(offset + step * 5)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 2))); + _mm_storel_pd((double *)(ptr+(offset + step * 6)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 3))); + _mm_storeh_pd((double *)(ptr+(offset + step * 7)*2), _mm_castps_pd(_mm512_extractf32x4_ps(v, 3))); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +#ifdef __INTEL_COMPILER +static INLINE int vtestallzeros_i_vo64(vopmask g) { return _mm512_mask2int(g) == 0; } +#else +static INLINE int vtestallzeros_i_vo64(vopmask g) { return g == 0; } +#endif + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask m, vmask x, vmask y) { return _mm512_mask_blend_epi64(m, y, x); } + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { return _mm512_sub_epi64(x, y); } +static INLINE vmask vneg64_vm_vm(vmask x) { return _mm512_sub_epi64(vcast_vm_i_i(0, 0), x); } +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { return _mm512_cmp_epi64_mask(y, x, _MM_CMPINT_LT); } // signed compare + +#define vsll64_vm_vm_i(x, c) _mm512_slli_epi64(x, c) +#define vsrl64_vm_vm_i(x, c) _mm512_srli_epi64(x, c) +//@#define vsll64_vm_vm_i(x, c) _mm512_slli_epi64(x, c) +//@#define vsrl64_vm_vm_i(x, c) _mm512_srli_epi64(x, c) + +static INLINE vmask vcast_vm_vi(vint vi) { + return _mm512_cvtepi32_epi64(vi); +} +static INLINE vint vcast_vi_vm(vmask vm) { + return _mm512_cvtepi64_epi32(vm); +} + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperneon32.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperneon32.h new file mode 100644 index 0000000000000..042cad40e1d36 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperneon32.h @@ -0,0 +1,297 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(__ARM_NEON) && !defined(SLEEF_GENHEADER) +#error Please specify -mfpu=neon. +#endif + +#ifdef __aarch64__ +#warning This implementation is for AARCH32. +#endif + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP 2 +//@#define LOG2VECTLENSP 2 +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#if CONFIG == 4 +#define ISANAME "AARCH32 NEON-VFPV4" +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#else +#define ISANAME "AARCH32 NEON" +#endif +#define DFTPRIORITY 10 + +#define ENABLE_RECSQRT_SP +//@#define ENABLE_RECSQRT_SP + +#include +#include + +#include "misc.h" + +typedef uint32x4_t vmask; +typedef uint32x4_t vopmask; + +//typedef int32x4_t vint; + +typedef float32x4_t vfloat; +typedef int32x4_t vint2; + +// + +static INLINE void vprefetch_v_p(const void *ptr) { } + +static INLINE int vtestallones_i_vo32(vopmask g) { + uint32x2_t x0 = vand_u32(vget_low_u32(g), vget_high_u32(g)); + uint32x2_t x1 = vpmin_u32(x0, x0); + return vget_lane_u32(x1, 0); +} + +static vfloat vloaduf(float *p) { return vld1q_f32(p); } +static void vstoreuf(float *p, vfloat v) { vst1q_f32(p, v); } + +static vint2 vloadu_vi2_p(int32_t *p) { return vld1q_s32(p); } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { vst1q_s32(p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return vandq_u32(x, y); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return vbicq_u32(y, x); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return vorrq_u32(x, y); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return veorq_u32(x, y); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return vandq_u32(x, y); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return vbicq_u32(y, x); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return vorrq_u32(x, y); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return veorq_u32(x, y); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return vandq_u32(x, y); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return vbicq_u32(y, x); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return vorrq_u32(x, y); } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return veorq_u32(x, y); } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return vandq_u32(x, y); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return vbicq_u32(y, x); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return vorrq_u32(x, y); } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return veorq_u32(x, y); } + +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return vuzpq_u32(m, m).val[0]; } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return vzipq_u32(m, m).val[0]; } + +// + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { return (vmask)vdupq_n_u64((uint64_t)i0 | (((uint64_t)i1) << 32)); } +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { + uint32x4_t t = vceqq_u32(x, y); + return vandq_u32(t, vrev64q_u32(t)); +} + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return (vint2)vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return (vmask)vi; } +static INLINE vint2 vrint_vi2_vf(vfloat d) { + return vcvtq_s32_f32(vaddq_f32(d, (float32x4_t)vorrq_u32(vandq_u32((uint32x4_t)d, (uint32x4_t)vdupq_n_f32(-0.0f)), (uint32x4_t)vdupq_n_f32(0.5f)))); +} +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vcvtq_s32_f32(vf); } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return vcvtq_f32_s32(vi); } + +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { return vcast_vf_vi2(vtruncate_vi2_vf(vd)); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return vcast_vf_vi2(vrint_vi2_vf(vd)); } + +static INLINE vfloat vcast_vf_f(float f) { return vdupq_n_f32(f); } +static INLINE vint2 vcast_vi2_i(int i) { return vdupq_n_s32(i); } +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return (vmask)vf; } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return (vfloat)vm; } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vm) { return (vfloat)vm; } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return (vint2)vf; } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return vaddq_f32(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return vsubq_f32(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return vmulq_f32(x, y); } + +static INLINE vfloat vabs_vf_vf(vfloat f) { return vabsq_f32(f); } +static INLINE vfloat vneg_vf_vf(vfloat f) { return vnegq_f32(f); } +#if CONFIG == 4 +static INLINE vfloat vmla_vf_vf_vf_vf (vfloat x, vfloat y, vfloat z) { return vfmaq_f32(z, x, y); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vfmsq_f32(z, x, y); } +static INLINE vfloat vfma_vf_vf_vf_vf (vfloat x, vfloat y, vfloat z) { return vfmaq_f32(z, x, y); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vfmsq_f32(z, x, y); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vneg_vf_vf(vfmanp_vf_vf_vf_vf(x, y, z)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vneg_vf_vf(vfmanp_vf_vf_vf_vf(x, y, z)); } + +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { + float32x4_t t = vrecpeq_f32(y), u; + t = vmulq_f32(t, vrecpsq_f32(y, t)); + t = vfmaq_f32(t, vfmsq_f32(vdupq_n_f32(1.0f), y, t), t); + u = vmulq_f32(x, t); + return vfmaq_f32(u, vfmsq_f32(x, y, u), t); +} + +static INLINE vfloat vsqrt_vf_vf(vfloat d) { + float32x4_t x = vrsqrteq_f32(d); + x = vmulq_f32(x, vrsqrtsq_f32(d, vmulq_f32(x, x))); + x = vmulq_f32(x, vrsqrtsq_f32(d, vmulq_f32(x, x))); + float32x4_t u = vmulq_f32(x, d); + u = vfmaq_f32(u, vfmsq_f32(d, u, u), vmulq_f32(x, vdupq_n_f32(0.5))); + return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(u), vceqq_f32(d, vdupq_n_f32(0.0f)))); +} + +static INLINE vfloat vrec_vf_vf(vfloat y) { + float32x4_t t = vrecpeq_f32(y); + t = vmulq_f32(t, vrecpsq_f32(y, t)); + t = vfmaq_f32(t, vfmsq_f32(vdupq_n_f32(1.0f), y, t), t); + return vfmaq_f32(t, vfmsq_f32(vdupq_n_f32(1.0f), y, t), t); +} + +static INLINE vfloat vrecsqrt_vf_vf(vfloat d) { + float32x4_t x = vrsqrteq_f32(d); + x = vmulq_f32(x, vrsqrtsq_f32(d, vmulq_f32(x, x))); + return vfmaq_f32(x, vfmsq_f32(vdupq_n_f32(1), x, vmulq_f32(x, d)), vmulq_f32(x, vdupq_n_f32(0.5))); +} +#else // #if CONFIG == 4 +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmlaq_f32(z, x, y); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmlsq_f32(z, x, y); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vneg_vf_vf(vmlsq_f32(z, x, y)); } + +static INLINE vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { + float32x4_t x = vrecpeq_f32(d); + x = vmulq_f32(x, vrecpsq_f32(d, x)); + float32x4_t t = vmulq_f32(n, x); + return vmlsq_f32(vaddq_f32(t, t), vmulq_f32(t, x), d); +} + +static INLINE vfloat vsqrt_vf_vf(vfloat d) { + float32x4_t x = vrsqrteq_f32(d); + x = vmulq_f32(x, vrsqrtsq_f32(d, vmulq_f32(x, x))); + float32x4_t u = vmulq_f32(x, d); + u = vmlaq_f32(u, vmlsq_f32(d, u, u), vmulq_f32(x, vdupq_n_f32(0.5))); + return vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(u), vceqq_f32(d, vdupq_n_f32(0.0f)))); +} + +static INLINE vfloat vrec_vf_vf(vfloat d) { + float32x4_t x = vrecpeq_f32(d); + x = vmulq_f32(x, vrecpsq_f32(d, x)); + return vmlsq_f32(vaddq_f32(x, x), vmulq_f32(x, x), d); +} + +static INLINE vfloat vrecsqrt_vf_vf(vfloat d) { + float32x4_t x = vrsqrteq_f32(d); + x = vmulq_f32(x, vrsqrtsq_f32(d, vmulq_f32(x, x))); + return vmlaq_f32(x, vmlsq_f32(vdupq_n_f32(1), x, vmulq_f32(x, d)), vmulq_f32(x, vdupq_n_f32(0.5))); +} +#endif // #if CONFIG == 4 +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return vmaxq_f32(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return vminq_f32(x, y); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return vceqq_f32(x, y); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return vmvnq_u32(vceqq_f32(x, y)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return vcltq_f32(x, y); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return vcleq_f32(x, y); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return vcgtq_f32(x, y); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return vcgeq_f32(x, y); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return vaddq_s32(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return vsubq_s32(x, y); } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return vnegq_s32(e); } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return vandq_s32(x, y); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return vbicq_s32(y, x); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return vorrq_s32(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return veorq_s32(x, y); } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return (vint2)vandq_u32(x, (vopmask)y); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return (vint2)vbicq_u32((vopmask)y, x); } + +#define vsll_vi2_vi2_i(x, c) vshlq_n_s32(x, c) +#define vsrl_vi2_vi2_i(x, c) vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(x), c)) +#define vsra_vi2_vi2_i(x, c) vshrq_n_s32(x, c) +//@#define vsll_vi2_vi2_i(x, c) vshlq_n_s32(x, c) +//@#define vsrl_vi2_vi2_i(x, c) vreinterpretq_s32_u32(vshrq_n_u32(vreinterpretq_u32_s32(x), c)) +//@#define vsra_vi2_vi2_i(x, c) vshrq_n_s32(x, c) + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return vceqq_s32(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return vcgtq_s32(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return (vint2)vceqq_s32(x, y); } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return (vint2)vcgtq_s32(x, y); } + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { return (vint2)vbslq_u32(m, (vmask)x, (vmask)y); } + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask mask, vfloat x, vfloat y) { + return (vfloat)vbslq_u32(mask, (vmask)x, (vmask)y); +} + +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +// This function is needed when debugging on MSVC. +static INLINE float vcast_f_vf(vfloat v) { + float p[4]; + vst1q_f32 (p, v); + return p[0]; +} + +static INLINE int vavailability_i(int name) { + if (name != 2) return 0; + return vcast_f_vf(vadd_vf_vf_vf(vcast_vf_f(name), vcast_vf_f(name))) != 0.0; +} + + +static INLINE vfloat vload_vf_p(const float *ptr) { return vld1q_f32(__builtin_assume_aligned(ptr, 16)); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return vld1q_f32(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { vst1q_f32(__builtin_assume_aligned(ptr, 16), v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { vst1q_f32(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { + return ((vfloat) { + ptr[vgetq_lane_s32(vi2, 0)], + ptr[vgetq_lane_s32(vi2, 1)], + ptr[vgetq_lane_s32(vi2, 2)], + ptr[vgetq_lane_s32(vi2, 3)] + }); +} + +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vfloat vposneg_vf_vf(vfloat d) { return (vfloat)vxor_vm_vm_vm((vmask)d, (vmask)PNMASKf); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return (vfloat)vxor_vm_vm_vm((vmask)d, (vmask)NPMASKf); } + +static INLINE vfloat vsubadd_vf_vf_vf(vfloat d0, vfloat d1) { return vadd_vf_vf_vf(d0, vnegpos_vf_vf(d1)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsubadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } + +static INLINE vfloat vrev21_vf_vf(vfloat d0) { return vrev64q_f32(d0); } +static INLINE vfloat vreva2_vf_vf(vfloat d0) { return vcombine_f32(vget_high_f32(d0), vget_low_f32(d0)); } + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { vstore_v_p_vf(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + vst1_f32((float *)(ptr+(offset + step * 0)*2), vget_low_f32(v)); + vst1_f32((float *)(ptr+(offset + step * 1)*2), vget_high_f32(v)); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpower_128.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpower_128.h new file mode 100644 index 0000000000000..f3ac298f94813 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpower_128.h @@ -0,0 +1,873 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 1 || CONFIG == 2 || CONFIG == 3 || CONFIG == 4 + +#ifndef __VSX__ +#error Please specify -mcpu=power8 or -mcpu=power9 +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 1 +//@#define LOG2VECTLENDP 1 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#if CONFIG == 1 || CONFIG == 3 +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#endif + +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING + +#if !defined(SLEEF_GENHEADER) +#include +// undef altivec types since CPP and C99 use them as compiler tokens +// use __vector and __bool instead +#undef vector +#undef bool + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +#if CONFIG == 1 || CONFIG == 2 +#define ISANAME "VSX" +#else +#define ISANAME "VSX-3" +#endif + +#define DFTPRIORITY 25 + +static INLINE int vavailability_i(int name) { return 3; } +static INLINE void vprefetch_v_p(const void *ptr) { } + +/********************************************** + ** Types +***********************************************/ +typedef __vector unsigned int vmask; +// using __bool with typedef may cause ambiguous errors +#define vopmask __vector __bool int +//@#define vopmask __vector __bool int +typedef __vector signed int vint; +typedef __vector signed int vint2; +typedef __vector float vfloat; +typedef __vector double vdouble; + +// internal use types +typedef __vector unsigned int v__u32; +typedef __vector unsigned char v__u8; +typedef __vector signed long long v__i64; +typedef __vector unsigned long long v__u64; +#define v__b64 __vector __bool long long + +typedef __vector long long vint64; +typedef __vector unsigned long long vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +/********************************************** + ** Utilities +***********************************************/ +#define vset__vi(v0, v1) ((vint) {v0, v1, v0, v1}) +#define vset__vi2(...) ((vint2) {__VA_ARGS__}) +#define vset__vm(...) ((vmask) {__VA_ARGS__}) +#define vset__vo(...) ((vopmask) {__VA_ARGS__}) +#define vset__vf(...) ((vfloat) {__VA_ARGS__}) +#define vset__vd(...) ((vdouble) {__VA_ARGS__}) +#define vset__u8(...) ((v__u8) {__VA_ARGS__}) +#define vset__u32(...) ((v__u32) {__VA_ARGS__}) +#define vset__s64(...) ((v__i64) {__VA_ARGS__}) +#define vset__u64(...) ((v__u64) {__VA_ARGS__}) + +#define vsetall__vi(v) vset__vi(v, v) +#define vsetall__vi2(v) vset__vi2(v, v, v, v) +#define vsetall__vm(v) vset__vm(v, v, v, v) +#define vsetall__vo(v) vset__vo(v, v, v, v) +#define vsetall__vf(v) vset__vf(v, v, v, v) +#define vsetall__vd(v) vset__vd(v, v) +#define vsetall__u8(v) vset__u8(v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v) +#define vsetall__u32(v) vset__u32(v, v, v, v) +#define vsetall__s64(v) vset__s64(v, v) +#define vsetall__u64(v) vset__u64(v, v) + +#define vzero__vi() vsetall__vi(0) +#define vzero__vi2() vsetall__vi2(0) +#define vzero__vm() vsetall__vm(0) +#define vzero__vo() vsetall__vo(0) +#define vzero__vf() vsetall__vf(0) +#define vzero__vd() vsetall__vd(0) +#define vzero__u8() vsetall__u8(0) +#define vzero__u32() vsetall__u32(0) +#define vzero__s64() vsetall__s64(0) +#define vzero__u64() vsetall__u64(0) + +//// Swap doubleword elements +#if defined(__clang__) || __GNUC__ >= 7 + static INLINE v__u64 v__swapd_u64(v__u64 v) + { return vec_xxpermdi(v, v, 2); } +#else + static INLINE v__u64 v__swapd_u64(v__u64 v) + { + __asm__ __volatile__("xxswapd %x0,%x1" : "=wa" (v) : "wa" (v)); + return v; + } +#endif + +/********************************************** + ** Memory +***********************************************/ + +////////////// Unaligned memory access ////////////// +/** + * It's not safe to use vector assignment via (cast & dereference) for unaligned memory access + * with almost all clang versions and gcc8 when VSX3 isn't enabled, + * these compilers tends to generate instructions 'lvx/stvx' instead of 'lxvd2x/lxvw4x/stxvd2x/stxvw4x' + * for more information check https://github.com/seiko2plus/vsx_mem_test + * + * TODO: check GCC(9, 10) +*/ +//// load +#if defined(__POWER9_VECTOR__) || (!defined(__clang__) && defined(__GNUC__) && __GNUC__ < 8) +static vint vloadu_vi_p(const int32_t *ptr) +{ return *((vint*)ptr); } +static INLINE vint2 vloadu_vi2_p(const int32_t *ptr) +{ return *((vint2*)ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) +{ return *((vfloat*)ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) +{ return *((vdouble*)ptr); } +#else +static vint vloadu_vi_p(const int32_t *ptr) +{ return vec_vsx_ld(0, ptr); } +static INLINE vint2 vloadu_vi2_p(const int32_t *ptr) +{ return vec_vsx_ld(0, ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) +{ return vec_vsx_ld(0, ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) +{ return vec_vsx_ld(0, ptr); } +#endif + +//// store +#if defined(__POWER9_VECTOR__) || (!defined(__clang__) && defined(__GNUC__) && __GNUC__ < 8) +static void vstoreu_v_p_vi(int32_t *ptr, vint v) +{ *((vint*)ptr) = v; } +static void vstoreu_v_p_vi2(int32_t *ptr, vint2 v) +{ *((vint2*)ptr) = v; } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) +{ *((vfloat*)ptr) = v; } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) +{ *((vdouble*)ptr) = v; } +#else +static void vstoreu_v_p_vi(int32_t *ptr, vint v) +{ vec_vsx_st(v, 0, ptr); } +static void vstoreu_v_p_vi2(int32_t *ptr, vint2 v) +{ vec_vsx_st(v, 0, ptr); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) +{ vec_vsx_st(v, 0, ptr); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) +{ vec_vsx_st(v, 0, ptr); } +#endif + +////////////// aligned memory access ////////////// +//// load +static INLINE vfloat vload_vf_p(const float *ptr) +{ return vec_ld(0, ptr); } +static INLINE vdouble vload_vd_p(const double *ptr) +{ return *((vdouble*)ptr); } + +//// store +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) +{ vec_st(v, 0, ptr); } +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) +{ *((vdouble*)ptr) = v; } + +////////////// non-temporal memory access ////////////// +//// store +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) +{ vstore_v_p_vf(ptr, v); } +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) +{ vstore_v_p_vd(ptr, v); } + +////////////// LUT ////////////// +//// load +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) +{ return vset__vd(ptr[vec_extract(vi, 0)], ptr[vec_extract(vi, 1)]); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) +{ + return vset__vf( + ptr[vec_extract(vi2, 0)], ptr[vec_extract(vi2, 1)], + ptr[vec_extract(vi2, 2)], ptr[vec_extract(vi2, 3)] + ); +} + +//// store +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) +{ + const v__u64 vll = (v__u64)v; + float *ptr_low = ptr + offset*2; + float *ptr_high = ptr + (offset + step)*2; + *((uint64_t*)ptr_low) = vec_extract(vll, 0); + *((uint64_t*)ptr_high) = vec_extract(vll, 1); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) +{ vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) +{ vstore_v_p_vd((double *)(&ptr[2*offset]), v); } + +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) +{ vscatter2_v_p_i_i_vd(ptr, offset, step, v); } + +/********************************************** + ** Misc + **********************************************/ + +// vector with a specific value set to all lanes (Vector Splat) +static INLINE vint vcast_vi_i(int i) +{ return vsetall__vi(i); } +static INLINE vint2 vcast_vi2_i(int i) +{ return vsetall__vi2(i); } +static INLINE vfloat vcast_vf_f(float f) +{ return vsetall__vf(f); } +static INLINE vdouble vcast_vd_d(double d) +{ return vsetall__vd(d); } +// cast +static INLINE vint2 vcast_vi2_vm(vmask vm) +{ return (vint2)vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) +{ return (vmask)vi; } +// get the first element +static INLINE float vcast_f_vf(vfloat v) +{ return vec_extract(v, 0); } +static INLINE double vcast_d_vd(vdouble v) +{ return vec_extract(v, 0); } + +static INLINE vmask vreinterpret_vm_vd(vdouble vd) +{ return (vmask)vd; } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) +{ return (vdouble)vm; } + +static INLINE vmask vreinterpret_vm_vf(vfloat vf) +{ return (vmask)vf; } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) +{ return (vfloat)vm; } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) +{ return (vfloat)vi; } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) +{ return (vint2)vf; } + +// per element select via mask (blend) +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) +{ return vec_sel(y, x, (v__b64)o); } +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) +{ return vec_sel(y, x, o); } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask o, vint x, vint y) +{ return vec_sel(y, x, o); } + +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask o, vint2 x, vint2 y) +{ return vec_sel(y, x, o); } + +static INLINE vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) +{ + return vsel_vf_vo_vf_vf(o, vsetall__vf(v1), vsetall__vf(v0)); +} +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) +{ + return vsel_vf_vo_vf_vf(o0, vsetall__vf(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) +{ + return vsel_vf_vo_vf_vf(o0, vsetall__vf(d0), vsel_vf_vo_vf_vf(o1, vsetall__vf(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) +{ + return vsel_vd_vo_vd_vd(o, vsetall__vd(v1), vsetall__vd(v0)); +} +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) +{ + return vsel_vd_vo_vd_vd(o0, vsetall__vd(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) +{ + return vsel_vd_vo_vd_vd(o0, vsetall__vd(d0), vsel_vd_vo_vd_vd(o1, vsetall__vd(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE int vtestallones_i_vo32(vopmask g) +{ return vec_all_ne((vint2)g, vzero__vi2()); } +static INLINE int vtestallones_i_vo64(vopmask g) +{ return vec_all_ne((v__i64)g, vzero__s64()); } + +/********************************************** + ** Conversions + **********************************************/ + +////////////// Numeric ////////////// +// pack 64-bit mask to 32-bit +static INLINE vopmask vcast_vo32_vo64(vopmask m) +{ return (vopmask)vec_pack((v__u64)m, (v__u64)m); } +// clip 64-bit lanes to lower 32-bit +static INLINE vint vcastu_vi_vi2(vint2 vi2) +{ return vec_mergeo(vi2, vec_splat(vi2, 3)); } +static INLINE vint vcastu_vi_vm(vmask vi2) +{ return vec_mergeo((vint2)vi2, vec_splat((vint2)vi2, 3)); } + + +// expand lower 32-bit mask +static INLINE vopmask vcast_vo64_vo32(vopmask m) +{ return vec_mergeh(m, m); } +// unsigned expand lower 32-bit integer +static INLINE vint2 vcastu_vi2_vi(vint vi) +{ return vec_mergeh(vzero__vi(), vi); } +static INLINE vmask vcastu_vm_vi(vint vi) +{ return (vmask)vec_mergeh(vzero__vi(), vi); } + +static INLINE vopmask vcast_vo_i(int i) { + i = i ? -1 : 0; + return (vopmask) { i, i, i, i }; +} + +// signed int to single-precision +static INLINE vfloat vcast_vf_vi2(vint2 vi) +{ + vfloat ret; +#if defined(__clang__) || __GNUC__ >= 9 + ret = __builtin_convertvector(vi, vfloat); +#else + __asm__ __volatile__("xvcvsxwsp %x0,%x1" : "=wa" (ret) : "wa" (vi)); +#endif + return ret; +} + +// lower signed int to double-precision +static INLINE vdouble vcast_vd_vi(vint vi) +{ + vdouble ret; + vint swap = vec_mergeh(vi, vi); +#if defined(__clang__) || __GNUC__ >= 7 + ret = __builtin_vsx_xvcvsxwdp(swap); +#else + __asm__ __volatile__("xvcvsxwdp %x0,%x1" : "=wa" (ret) : "wa" (swap)); +#endif + return ret; +} + +// zip two scalars +static INLINE vmask vcast_vm_i_i(int l, int h) +{ return (vmask)vec_mergeh(vsetall__vi2(h), vsetall__vi2(l)); } + +static INLINE vmask vcast_vm_i64(int64_t i) { + return (vmask)vsetall__s64(i); +} +static INLINE vmask vcast_vm_u64(uint64_t i) { + return (vmask)vsetall__u64(i); +} + +////////////// Truncation ////////////// + +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) +{ + vint2 ret; +#if defined(__clang__) || __GNUC__ >= 9 + ret = __builtin_convertvector(vf, vint2); +#else + __asm__ __volatile__("xvcvspsxws %x0,%x1" : "=wa" (ret) : "wa" (vf)); +#endif + return ret; +} + +static INLINE vint vtruncate_vi_vd(vdouble vd) +{ + vint ret; +#if defined(__clang__) || __GNUC__ >= 7 + ret = __builtin_vsx_xvcvdpsxws(vd); +#else + __asm__ __volatile__("xvcvdpsxws %x0,%x1" : "=wa" (ret) : "wa" (vd)); +#endif + return vec_mergeo(ret, vec_splat(ret, 3)); +} + +static INLINE vdouble vtruncate_vd_vd(vdouble vd) +{ return vec_trunc(vd); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) +{ return vec_trunc(vf); } + +////////////// Rounding ////////////// + +// towards the nearest even +static INLINE vint vrint_vi_vd(vdouble vd) +{ return vtruncate_vi_vd(vec_rint(vd)); } +static INLINE vint2 vrint_vi2_vf(vfloat vf) +{ return vtruncate_vi2_vf(vec_rint(vf)); } +static INLINE vdouble vrint_vd_vd(vdouble vd) +{ return vec_rint(vd); } +static INLINE vfloat vrint_vf_vf(vfloat vf) +{ return vec_rint(vf); } + +/********************************************** + ** Logical + **********************************************/ + +////////////// And ////////////// +static INLINE vint vand_vi_vi_vi(vint x, vint y) +{ return vec_and(x, y); } +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) +{ return vec_and((vint)x, y); } +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_and(x, y); } +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) +{ return (vint2)vec_and((vint2)x, y); } + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) +{ return vec_and(x, y); } +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) +{ return vec_and((vmask)x, y); } +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) +{ return vec_and((vmask)x, y); } +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) +{ return vec_and(x, y); } + +////////////// Or ////////////// +static INLINE vint vor_vi_vi_vi(vint x, vint y) +{ return vec_or(x, y); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_or(x, y); } + +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) +{ return vec_or(x, y); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) +{ return vec_or((vmask)x, y); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) +{ return vec_or((vmask)x, y); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) +{ return vec_or(x, y); } + +////////////// Xor ////////////// +static INLINE vint vxor_vi_vi_vi(vint x, vint y) +{ return vec_xor(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_xor(x, y); } + +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) +{ return vec_xor(x, y); } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) +{ return vec_xor((vmask)x, y); } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) +{ return vec_xor((vmask)x, y); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) +{ return vec_xor(x, y); } + +////////////// Not ////////////// +static INLINE vopmask vnot_vo_vo(vopmask o) +{ return vec_nor(o, o); } + +////////////// And Not ((~x) & y) ////////////// +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) +{ return vec_andc(y, x); } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) +{ return vec_andc(y, (vint)x); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_andc(y, x); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) +{ return vec_andc(y, x); } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) +{ return vec_andc(y, x); } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) +{ return vec_andc(y, x); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) +{ return vec_andc(y, x); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) +{ return vec_andc(y, (vint2)x); } + +/********************************************** + ** Comparison + **********************************************/ + +////////////// Equal ////////////// +static INLINE vint veq_vi_vi_vi(vint x, vint y) +{ return (vint)vec_cmpeq(x, y); } +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) +{ return vec_cmpeq(x, y); } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) +{ return vec_cmpeq(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) +{ return (vint2)vec_cmpeq(x, y); } + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) +{ return (vopmask)vec_cmpeq((v__u64)x, (v__u64)y); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) +{ return vec_cmpeq(x, y); } +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) +{ return (vopmask)vec_cmpeq(x, y); } + +////////////// Not Equal ////////////// +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) +{ return vnot_vo_vo(vec_cmpeq(x, y)); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) +{ return vnot_vo_vo((vopmask)vec_cmpeq(x, y)); } + +////////////// Less Than ////////////// +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) +{ return vec_cmplt(x, y); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) +{ return (vopmask)vec_cmplt(x, y); } + +////////////// Greater Than ////////////// +static INLINE vint vgt_vi_vi_vi(vint x, vint y) +{ return (vint)vec_cmpgt(x, y); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) +{ return vec_cmpgt(x, y);} + +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) +{ return (vint2)vec_cmpgt(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) +{ return vec_cmpgt(x, y); } + +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) +{ return vec_cmpgt(x, y); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) +{ return (vopmask)vec_cmpgt(x, y); } + +////////////// Less Than Or Equal ////////////// +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) +{ return vec_cmple(x, y); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) +{ return (vopmask)vec_cmple(x, y); } + +////////////// Greater Than Or Equal ////////////// +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) +{ return vec_cmpge(x, y); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) +{ return (vopmask)vec_cmpge(x, y); } + +////////////// Special Cases ////////////// +static INLINE vopmask visinf_vo_vf(vfloat d) +{ return vec_cmpeq(vec_abs(d), vsetall__vf(SLEEF_INFINITYf)); } +static INLINE vopmask visinf_vo_vd(vdouble d) +{ return (vopmask)vec_cmpeq(vec_abs(d), vsetall__vd(SLEEF_INFINITY)); } + +static INLINE vopmask vispinf_vo_vf(vfloat d) +{ return vec_cmpeq(d, vsetall__vf(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vd(vdouble d) +{ return (vopmask)vec_cmpeq(d, vsetall__vd(SLEEF_INFINITY)); } + +static INLINE vopmask visminf_vo_vf(vfloat d) +{ return vec_cmpeq(d, vsetall__vf(-SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vd(vdouble d) +{ return (vopmask)vec_cmpeq(d, vsetall__vd(-SLEEF_INFINITY)); } + +static INLINE vopmask visnan_vo_vf(vfloat d) +{ return vnot_vo_vo(vec_cmpeq(d, d)); } +static INLINE vopmask visnan_vo_vd(vdouble d) +{ return vnot_vo_vo((vopmask)vec_cmpeq(d, d)); } + +/********************************************** + ** Shift + **********************************************/ +////////////// Left ////////////// +static INLINE vint vsll_vi_vi_i(vint x, int c) +{ return vec_sl (x, vsetall__u32(c)); } +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) +{ return vec_sl(x, vsetall__u32(c)); } + +////////////// Right ////////////// +static INLINE vint vsrl_vi_vi_i(vint x, int c) +{ return vec_sr(x, vsetall__u32(c)); } +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) +{ return vec_sr(x, vsetall__u32(c)); } + +////////////// Algebraic Right ////////////// +static INLINE vint vsra_vi_vi_i(vint x, int c) +{ return vec_sra(x, vsetall__u32(c)); } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) +{ return vec_sra(x, vsetall__u32(c)); } + +/********************************************** + ** Reorder + **********************************************/ + +////////////// Reverse ////////////// +// Reverse elements order inside the lower and higher parts +static INLINE vint2 vrev21_vi2_vi2(vint2 vi) +{ return vec_mergee(vec_mergeo(vi, vi), vi); } +static INLINE vfloat vrev21_vf_vf(vfloat vf) +{ return (vfloat)vrev21_vi2_vi2((vint2)vf); } + +// Swap the lower and higher parts +static INLINE vfloat vreva2_vf_vf(vfloat vf) +{ return (vfloat)v__swapd_u64((v__u64)vf); } +static INLINE vdouble vrev21_vd_vd(vdouble vd) +{ return (vdouble)v__swapd_u64((v__u64)vd); } +static INLINE vdouble vreva2_vd_vd(vdouble vd) +{ return vd; } + +/********************************************** + ** Arithmetic + **********************************************/ + +////////////// Negation ////////////// +static INLINE vint vneg_vi_vi(vint e) { +#if defined(__clang__) || __GNUC__ >= 9 + return vec_neg(e); +#else + return vec_sub(vzero__vi(), e); +#endif +} +static INLINE vint2 vneg_vi2_vi2(vint2 e) +{ return vneg_vi_vi(e); } + +static INLINE vfloat vneg_vf_vf(vfloat d) +{ + vfloat ret; +#if defined(__clang__) || __GNUC__ >= 9 + ret = vec_neg(d); +#else + __asm__ __volatile__("xvnegsp %x0,%x1" : "=wa" (ret) : "wa" (d)); +#endif + return ret; +} + +static INLINE vdouble vneg_vd_vd(vdouble d) +{ + vdouble ret; +#if defined(__clang__) || __GNUC__ >= 9 + ret = vec_neg(d); +#else + __asm__ __volatile__("xvnegdp %x0,%x1" : "=wa" (ret) : "wa" (d)); +#endif + return ret; +} + +static INLINE vfloat vposneg_vf_vf(vfloat d) +{ return vec_xor(d, vset__vf(+0.0f, -0.0f, +0.0f, -0.0f)); } +static INLINE vdouble vposneg_vd_vd(vdouble d) +{ return vec_xor(d, vset__vd(+0.0, -0.0)); } + +static INLINE vfloat vnegpos_vf_vf(vfloat d) +{ return vec_xor(d, vset__vf(-0.0f, +0.0f, -0.0f, +0.0f)); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) +{ return vec_xor(d, vset__vd(-0.0, +0.0)); } + +////////////// Addition ////////////// +static INLINE vint vadd_vi_vi_vi(vint x, vint y) +{ return vec_add(x, y); } +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_add(x, y); } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) +{ return vec_add(x, y); } +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) +{ return vec_add(x, y); } + +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) +{ return (vmask)vec_add((v__i64)x, (v__i64)y); } + +////////////// Subtraction ////////////// +static INLINE vint vsub_vi_vi_vi(vint x, vint y) +{ return vec_sub(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) +{ return vec_sub(x, y); } + +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) +{ return vec_sub(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) +{ return vec_sub(x, y); } + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) +{ return vec_add(x, vnegpos_vd_vd(y)); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) +{ return vec_add(x, vnegpos_vf_vf(y)); } + +////////////// Multiplication ////////////// +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) +{ return vec_mul(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) +{ return vec_mul(x, y); } + +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) +{ return vec_div(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) +{ return vec_div(x, y); } + +static INLINE vfloat vrec_vf_vf(vfloat x) +{ return vec_div(vsetall__vf(1.0f), x); } +static INLINE vdouble vrec_vd_vd(vdouble x) +{ return vec_div(vsetall__vd(1.0), x); } + +/********************************************** + ** Math + **********************************************/ + +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) +{ return vec_max(x, y); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) +{ return vec_max(x, y); } + +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) +{ return vec_min(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) +{ return vec_min(x, y); } + +static INLINE vfloat vabs_vf_vf(vfloat f) +{ return vec_abs(f); } +static INLINE vdouble vabs_vd_vd(vdouble d) +{ return vec_abs(d); } + +static INLINE vfloat vsqrt_vf_vf(vfloat f) +{ return vec_sqrt(f); } +static INLINE vdouble vsqrt_vd_vd(vdouble d) +{ return vec_sqrt(d); } + + +/********************************************** + ** FMA3 + **********************************************/ +#if CONFIG == 1 || CONFIG == 3 + +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_madd(x, y, z); } +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_madd(x, y, z); } + +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_msub(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_msub(x, y, z); } + +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_nmsub(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_nmsub(x, y, z); } + +#else + +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_add(vec_mul(x, y), z); } +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_add(vec_mul(x, y), z); } + +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_sub(vec_mul(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_sub(vec_mul(x, y), z); } + +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_sub(z, vec_mul(x, y)); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_sub(z, vec_mul(x, y)); } + +#endif + +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_madd(x, y, z); } +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_madd(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_madd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_madd(x, y, z); } + +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_msub(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_msub(x, y, z); } + +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_nmsub(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_nmsub(x, y, z); } + +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vec_nmadd(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vec_nmadd(x, y, z); } + +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) +{ return vmla_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) +{ return vmla_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + return vec_all_eq((__vector signed long long)g, vzero__s64()); +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { + return (vmask)vec_sel((__vector signed long long)y, (__vector signed long long)x, (v__b64)o); +} + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + return (vmask)vec_sub((__vector signed long long)x, (__vector signed long long)y); +} + +static INLINE vmask vneg64_vm_vm(vmask x) { + return (vmask)vec_sub((__vector signed long long) {0, 0}, (__vector signed long long)x); +} + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + return (vopmask)vec_cmpgt((__vector signed long long)x, (__vector signed long long)y); +} + +#define vsll64_vm_vm_i(x, c) ((vmask)vec_sl((__vector signed long long)x, (__vector unsigned long long)vsetall__vm(c))) +#define vsrl64_vm_vm_i(x, c) ((vmask)vec_sr((__vector signed long long)x, (__vector unsigned long long)vsetall__vm(c))) + +static INLINE vint vcast_vi_vm(vmask vm) { + return (vint) { vm[0], vm[2] }; +} + +static INLINE vmask vcast_vm_vi(vint vi) { + return (vmask) (__vector signed long long) { vi[0], vi[1] }; +} + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return (vmask)v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return (vint64)m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return (vmask)v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return (vuint64)m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpurec.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpurec.h new file mode 100644 index 0000000000000..14142a3633d49 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperpurec.h @@ -0,0 +1,561 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include "misc.h" + +#ifndef CONFIG +#error CONFIG macro not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define ENABLE_SP +//@#define ENABLE_SP + +#define LOG2VECTLENDP CONFIG +//@#define LOG2VECTLENDP CONFIG +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#define DFTPRIORITY LOG2VECTLENDP +#define ISANAME "Pure C Array" + +typedef union { + uint32_t u[VECTLENDP*2]; + uint64_t x[VECTLENDP]; + double d[VECTLENDP]; + float f[VECTLENDP*2]; + int32_t i[VECTLENDP*2]; +} versatileVector; + +typedef versatileVector vmask; +typedef versatileVector vopmask; +typedef versatileVector vdouble; +typedef versatileVector vint; +typedef versatileVector vfloat; +typedef versatileVector vint2; + +typedef union { + uint8_t u[sizeof(long double)*VECTLENDP]; + long double ld[VECTLENDP]; +} longdoubleVector; + +typedef longdoubleVector vmaskl; +typedef longdoubleVector vlongdouble; + +#if defined(Sleef_quad2_DEFINED) && defined(ENABLEFLOAT128) +typedef union { + uint8_t u[sizeof(Sleef_quad)*VECTLENDP]; + Sleef_quad q[VECTLENDP]; +} quadVector; + +typedef quadVector vmaskq; +typedef quadVector vquad; +#endif + +// + +static INLINE int vavailability_i(int name) { return -1; } +static INLINE void vprefetch_v_p(const void *ptr) { } + +static INLINE int vtestallones_i_vo64(vopmask g) { + int ret = 1; for(int i=0;i 0 ? (int)(vd.d[i] + 0.5) : (int)(vd.d[i] - 0.5); return ret; } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return vcast_vd_vi(vtruncate_vi_vd(vd)); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return vcast_vd_vi(vrint_vi_vd(vd)); } +static INLINE vint vcast_vi_i(int j) { vint ret; for(int i=0;i y.d[i] ? x.d[i] : y.d[i]; return ret; } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { vdouble ret; for(int i=0;i y.d[i] ? -1 : 0; return ret; } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { vopmask ret; for(int i=0;i= y.d[i] ? -1 : 0; return ret; } + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { vint ret; for(int i=0;i> c; return ret; } +static INLINE vint vsra_vi_vi_i(vint x, int c) { vint ret; for(int i=0;i> c; return ret; } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { vopmask ret; for(int i=0;i y.i[i] ? -1 : 0; return ret; } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { + union { vopmask vo; vint2 vi2; } cnv; + cnv.vo = m; + return vor_vi_vi_vi(vand_vi_vi_vi(vreinterpretFirstHalf_vi_vi2(cnv.vi2), x), + vandnot_vi_vi_vi(vreinterpretFirstHalf_vi_vi2(cnv.vi2), y)); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { vopmask ret; for(int i=0;i 0 ? (int)(vf.f[i] + 0.5) : (int)(vf.f[i] - 0.5); return ret; } +static INLINE vint2 vcast_vi2_i(int j) { vint2 ret; for(int i=0;i y.f[i] ? x.f[i] : y.f[i]; return ret; } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { vfloat ret; for(int i=0;i y.f[i]) ? -1 : 0); return ret; } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { vopmask ret; for(int i=0;i= y.f[i]) ? -1 : 0); return ret; } + +static INLINE vint vadd_vi2_vi2_vi2(vint x, vint y) { vint ret; for(int i=0;i> c; return ret; } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { vint2 ret; for(int i=0;i> c; return ret; } + +static INLINE vopmask visinf_vo_vf (vfloat d) { vopmask ret; for(int i=0;i y.i[i] ? -1 : 0; return ret; } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { vopmask ret; for(int i=0;i y.i[i] ? -1 : 0; return ret; } + +static INLINE vfloat vsqrt_vf_vf(vfloat x) { vfloat ret; for(int i=0;i +#endif + +#ifndef ENABLE_BUILTIN_MATH + +#if !defined(SLEEF_GENHEADER) +#include +#endif + +#define SQRT sqrt +#define SQRTF sqrtf +#define FMA fma +#define FMAF fmaf +#define RINT rint +#define RINTF rintf +#define TRUNC trunc +#define TRUNCF truncf + +#else + +#define SQRT __builtin_sqrt +#define SQRTF __builtin_sqrtf +#define FMA __builtin_fma +#define FMAF __builtin_fmaf +#define RINT __builtin_rint +#define RINTF __builtin_rintf +#define TRUNC __builtin_trunc +#define TRUNCF __builtin_truncf + +#endif + +#if !defined(SLEEF_GENHEADER) +#include "misc.h" +#endif + +#ifndef CONFIG +#error CONFIG macro not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define ENABLE_SP +//@#define ENABLE_SP + +#if CONFIG == 2 || CONFIG == 3 +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP + +#if defined(__AVX2__) || defined(__aarch64__) || defined(__arm__) || defined(__powerpc64__) || defined(__zarch__) || defined(__riscv) || CONFIG == 3 +#ifndef FP_FAST_FMA +//@#ifndef FP_FAST_FMA +#define FP_FAST_FMA +//@#define FP_FAST_FMA +#endif +//@#endif +#ifndef FP_FAST_FMAF +//@#ifndef FP_FAST_FMAF +#define FP_FAST_FMAF +//@#define FP_FAST_FMAF +#endif +//@#endif +#endif + +#if (!defined(FP_FAST_FMA) || !defined(FP_FAST_FMAF)) && !defined(SLEEF_GENHEADER) +#error FP_FAST_FMA or FP_FAST_FMAF not defined +#endif + +#define ISANAME "Pure C scalar with FMA" + +#else // #if CONFIG == 2 || CONFIG == 3 +#define ISANAME "Pure C scalar" +#endif // #if CONFIG == 2 || CONFIG == 3 + +#define LOG2VECTLENDP 0 +//@#define LOG2VECTLENDP 0 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) +#define LOG2VECTLENSP 0 +//@#define LOG2VECTLENSP 0 +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if defined(__SSE4_1__) || defined(__aarch64__) || CONFIG == 3 +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#endif + +#define DFTPRIORITY LOG2VECTLENDP + +typedef uint64_t vmask; +typedef uint32_t vopmask; +typedef double vdouble; +typedef int32_t vint; +typedef float vfloat; +typedef int32_t vint2; + +typedef int64_t vint64; +typedef uint64_t vuint64; + +typedef Sleef_uint64_2t vquad; + +#if CONFIG != 3 +typedef Sleef_quad vargquad; +#else +typedef Sleef_uint64_2t vargquad; +#endif + +// + +static INLINE int vavailability_i(int name) { return -1; } +static INLINE void vprefetch_v_p(const void *ptr) {} + +static INLINE int vtestallones_i_vo64(vopmask g) { return g; } +static INLINE int vtestallones_i_vo32(vopmask g) { return g; } + +// + +static vint2 vloadu_vi2_p(int32_t *p) { return *p; } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { *p = v; } +static vint vloadu_vi_p(int32_t *p) { return *p; } +static void vstoreu_v_p_vi(int32_t *p, vint v) { *p = v; } + +// + +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return m; } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return m; } +static INLINE vopmask vcast_vo_i(int i) { return i ? -1 : 0; } +static INLINE vmask vcast_vm_i_i(int h, int l) { return (((uint64_t)h) << 32) | (uint32_t)l; } + +static INLINE vmask vcast_vm_i64(int64_t i) { return (int64_t)i; } +static INLINE vmask vcast_vm_u64(uint64_t i) { return i; } + +static INLINE vmask vcastu_vm_vi(vint vi) { return ((uint64_t)vi) << 32; } +static INLINE vint vcastu_vi_vm(vmask vm) { return (int32_t)(vm >> 32); } + +static INLINE vdouble vcast_vd_d(double d) { return d; } + +// + +static INLINE vopmask vand_vo_vo_vo (vopmask x, vopmask y) { return x & y; } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return y & ~x; } +static INLINE vopmask vor_vo_vo_vo (vopmask x, vopmask y) { return x | y; } +static INLINE vopmask vxor_vo_vo_vo (vopmask x, vopmask y) { return x ^ y; } + +static INLINE vmask vand_vm_vm_vm (vmask x, vmask y) { return x & y; } +static INLINE vmask vandnot_vm_vm_vm (vmask x, vmask y) { return y & ~x; } +static INLINE vmask vor_vm_vm_vm (vmask x, vmask y) { return x | y; } +static INLINE vmask vxor_vm_vm_vm (vmask x, vmask y) { return x ^ y; } + +static INLINE vmask vcast_vm_vo(vopmask o) { return (vmask)o | (((vmask)o) << 32); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return vcast_vm_vo(x) & y; } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return y & ~vcast_vm_vo(x); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return vcast_vm_vo(x) | y; } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return vcast_vm_vo(x) ^ y; } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return vcast_vm_vo(x) & y; } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return y & ~vcast_vm_vo(x); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return vcast_vm_vo(x) | y; } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return vcast_vm_vo(x) ^ y; } + +// + +static INLINE vdouble vsel_vd_vo_vd_vd (vopmask o, vdouble x, vdouble y) { return o ? x : y; } +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask o, vint2 x, vint2 y) { return o ? x : y; } + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { return o ? v1 : v0; } + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE vdouble vcast_vd_vi(vint vi) { return vi; } +static INLINE vint vcast_vi_i(int j) { return j; } + +#ifdef FULL_FP_ROUNDING +static INLINE vint vrint_vi_vd(vdouble d) { return (int32_t)RINT(d); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return RINT(vd); } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return TRUNC(vd); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return (int32_t)TRUNC(vd); } +#else +static INLINE vint vrint_vi_vd(vdouble a) { + a += a > 0 ? 0.5 : -0.5; + uint64_t vx; + memcpy(&vx, &a, sizeof(vx)); + vx -= 1 & (int)a; + memcpy(&a, &vx, sizeof(a)); + return a; +} +static INLINE vdouble vrint_vd_vd(vdouble vd) { return vcast_vd_vi(vrint_vi_vd(vd)); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return vd; } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return vcast_vd_vi(vtruncate_vi_vd(vd)); } +#endif + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { return x == y ? ~(uint32_t)0 : 0; } +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { return x + y; } + +// + +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { vmask vm; memcpy(&vm, &vd, sizeof(vm)); return vm; } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { vdouble vd; memcpy(&vd, &vm, sizeof(vd)); return vd; } + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return x + y; } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return x - y; } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return x * y; } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return x / y; } +static INLINE vdouble vrec_vd_vd(vdouble x) { return 1 / x; } + +static INLINE vdouble vabs_vd_vd(vdouble d) { + uint64_t vx; + memcpy(&vx, &d, sizeof(vx)); + vx &= UINT64_C(0x7fffffffffffffff); + memcpy(&d, &vx, sizeof(d)); + return d; +} +static INLINE vdouble vneg_vd_vd(vdouble d) { return -d; } + +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return x > y ? x : y; } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return x < y ? x : y; } + +#ifndef ENABLE_FMA_DP +static INLINE vdouble vmla_vd_vd_vd_vd (vdouble x, vdouble y, vdouble z) { return x * y + z; } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return x * y - z; } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return -x * y + z; } +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(x, y, -z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(-x, y, z); } +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(x, y, -z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(-x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return FMA(-x, y, -z); } +#endif + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return x == y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return x != y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return x < y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return x <= y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return x > y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return x >= y ? ~(uint32_t)0 : 0; } + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return x + y; } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return x - y; } +static INLINE vint vneg_vi_vi (vint x) { return - x; } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return x & y; } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return y & ~x; } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return x | y; } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return x ^ y; } + +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { return x & y; } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { return y & ~x; } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return (uint32_t)x << c; } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return (uint32_t)x >> c; } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return x >> c; } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return x == y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return x > y ? ~(uint32_t)0 : 0; } + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { return m ? x : y; } + +static INLINE vopmask visinf_vo_vd(vdouble d) { return (d == SLEEF_INFINITY || d == -SLEEF_INFINITY) ? ~(uint32_t)0 : 0; } +static INLINE vopmask vispinf_vo_vd(vdouble d) { return d == SLEEF_INFINITY ? ~(uint32_t)0 : 0; } +static INLINE vopmask visminf_vo_vd(vdouble d) { return d == -SLEEF_INFINITY ? ~(uint32_t)0 : 0; } +static INLINE vopmask visnan_vo_vd(vdouble d) { return d != d ? ~(uint32_t)0 : 0; } + +static INLINE vdouble vsqrt_vd_vd(vdouble d) { return SQRT(d); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return SQRTF(x); } + +static INLINE double vcast_d_vd(vdouble v) { return v; } + +static INLINE vdouble vload_vd_p(const double *ptr) { return *ptr; } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return *ptr; } +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { return ptr[vi]; } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { *ptr = v; } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { *ptr = v; } +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { *ptr = v; } + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return (int32_t)vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return (uint32_t)vi; } + +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return (int32_t)vi; } +static INLINE vint2 vcast_vi2_i(int j) { return j; } + +#ifdef FULL_FP_ROUNDING +static INLINE vint2 vrint_vi2_vf(vfloat d) { return (int)RINTF(d); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return RINTF(vd); } +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { return TRUNCF(vd); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return (int32_t)TRUNCF(vf); } +#else +static INLINE vint2 vrint_vi2_vf(vfloat a) { + a += a > 0 ? 0.5f : -0.5f; + uint32_t vu[1]; + memcpy(vu, &a, sizeof(vu)); + vu[0] -= 1 & (int)a; + memcpy(&a, vu, sizeof(a)); + return (int32_t)a; +} +static INLINE vfloat vrint_vf_vf(vfloat vd) { return vcast_vf_vi2(vrint_vi2_vf(vd)); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return vf; } +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { return vcast_vf_vi2(vtruncate_vi2_vf(vd)); } +#endif + +static INLINE vfloat vcast_vf_f(float f) { return f; } +static INLINE vmask vreinterpret_vm_vf(vfloat f) { vfloat vf[2] = { f, 0 }; vmask vm; memcpy(&vm, &vf, sizeof(vm)); return vm; } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { vfloat vf[2]; memcpy(&vf, &vm, sizeof(vf)); return vf[0]; } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { vfloat vf; memcpy(&vf, &vi, sizeof(vf)); return vf; } +static INLINE vint2 vreinterpret_vi2_vf(vfloat f) { vint2 vi2; memcpy(&vi2, &f, sizeof(vi2)); return vi2; } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return x + y; } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return x - y; } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return x * y; } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return x / y; } +static INLINE vfloat vrec_vf_vf (vfloat x) { return 1 / x; } + +static INLINE vfloat vabs_vf_vf(vfloat x) { + int32_t vi[1]; + memcpy(vi, &x, sizeof(vi)); + vi[0] &= 0x7fffffff; + memcpy(&x, vi, sizeof(x)); + return x; +} +static INLINE vfloat vneg_vf_vf(vfloat x) { return -x; } + +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return x > y ? x : y; } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return x < y ? x : y; } + +#ifndef ENABLE_FMA_SP +static INLINE vfloat vmla_vf_vf_vf_vf (vfloat x, vfloat y, vfloat z) { return x * y + z; } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return - x * y + z; } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return x * y - z; } +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(x, y, -z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(-x, y, z); } +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(x, y, -z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(-x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return FMAF(-x, y, -z); } +#endif + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return x == y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return x != y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return x < y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return x <= y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return x > y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return x >= y ? ~(uint32_t)0 : 0; } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return x + y; } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return x - y; } +static INLINE vint2 vneg_vi2_vi2(vint2 x) { return -x; } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return x & y; } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return y & ~x; } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return x | y; } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return x ^ y; } + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) { return o ? x : y; } +static INLINE vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { return o ? v1 : v0; } + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return vcast_vm_vo(x) & y; } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return y & ~vcast_vm_vo(x); } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { + return x << c; +} +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { + return ((uint32_t)x) >> c; +} +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { + return x >> c; +} + +static INLINE vopmask visinf_vo_vf (vfloat d) { return (d == SLEEF_INFINITYf || d == -SLEEF_INFINITYf) ? ~(uint32_t)0 : 0; } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return d == SLEEF_INFINITYf ? ~(uint32_t)0 : 0; } +static INLINE vopmask visminf_vo_vf(vfloat d) { return d == -SLEEF_INFINITYf ? ~(uint32_t)0 : 0; } +static INLINE vopmask visnan_vo_vf (vfloat d) { return d != d ? ~(uint32_t)0 : 0; } + +static INLINE vopmask veq_vo_vi2_vi2 (vint2 x, vint2 y) { return (int32_t)x == (int32_t)y ? ~(uint32_t)0 : 0; } +static INLINE vopmask vgt_vo_vi2_vi2 (vint2 x, vint2 y) { return (int32_t)x > (int32_t)y ? ~(uint32_t)0 : 0; } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return (int32_t)x == (int32_t)y ? ~(uint32_t)0 : 0; } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return (int32_t)x > (int32_t)y ? ~(uint32_t)0 : 0; } + +static INLINE float vcast_f_vf(vfloat v) { return v; } + +static INLINE vfloat vload_vf_p(const float *ptr) { return *ptr; } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return *ptr; } +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi) { return ptr[vi]; } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { *ptr = v; } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { *ptr = v; } +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { *ptr = v; } + +// + +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(8 + (char *)&vq, p, 8); + memcpy((char *)&vq, 8 + p, 8); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(8 + (char *)&vq, (char *)&aq, 8); + memcpy((char *)&vq, 8 + (char *)&aq, 8); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(8 + (char *)&aq, (char *)&vq, 8); + memcpy((char *)&aq, 8 + (char *)&vq, 8); + return aq; +} +#else +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, sizeof(vq)); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, sizeof(vq)); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, sizeof(aq)); + return aq; +} +#endif + +// + +static INLINE int vtestallzeros_i_vo64(vopmask g) { return !g ? ~(uint32_t)0 : 0; } +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { return o ? x : y; } + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { return (int64_t)x - (int64_t)y; } +static INLINE vmask vneg64_vm_vm(vmask x) { return -(int64_t)x; } + +#define vsll64_vm_vm_i(x, c) ((uint64_t)(x) << (c)) +#define vsrl64_vm_vm_i(x, c) ((uint64_t)(x) >> (c)) +//@#define vsll64_vm_vm_i(x, c) ((uint64_t)(x) << (c)) +//@#define vsrl64_vm_vm_i(x, c) ((uint64_t)(x) >> (c)) + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { return (int64_t)x > (int64_t)y ? ~(uint32_t)0 : 0; } + +static INLINE vmask vcast_vm_vi(vint vi) { return vi; } +static INLINE vint vcast_vi_vm(vmask vm) { return vm; } + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperrvv.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperrvv.h new file mode 100644 index 0000000000000..f304434af800c --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helperrvv.h @@ -0,0 +1,1412 @@ +// Copyright Naoki Shibata and contributors 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef HELPERRVV_H +#define HELPERRVV_H + +#if !defined(SLEEF_GENHEADER) +#include +#include "misc.h" + +#if defined(VECTLENDP) || defined(VECTLENSP) +#error VECTLENDP or VECTLENSP already defined +#endif +#endif // #if !defined(SLEEF_GENHEADER) + +#if CONFIG == 1 || CONFIG == 2 +#define ISANAME "RISC-V Vector Extension with Min. VLEN" +#define SLEEF_RVV_VLEN 0 +#elif CONFIG == 7 +// 128-bit vector length +#define ISANAME "RISC-V Vector Extension 128-bit" +#define LOG2VECTLENDP 1 +#define SLEEF_RVV_VLEN ((1 << 7) / 8) +#define DFTPRIORITY 19 +#elif CONFIG == 8 +// 256-bit vector length +#define ISANAME "RISC-V Vector Extension 256-bit" +#define LOG2VECTLENDP 2 +#define SLEEF_RVV_VLEN ((1 << 8) / 8) +#define DFTPRIORITY 20 +#elif CONFIG == 9 +// 512-bit vector length +#define ISANAME "RISC-V Vector Extension 512-bit" +#define LOG2VECTLENDP 3 +#define SLEEF_RVV_VLEN ((1 << 9) / 8) +#define DFTPRIORITY 21 +#elif CONFIG == 10 +// 1024-bit vector length +#define ISANAME "RISC-V Vector Extension 1024-bit" +#define LOG2VECTLENDP 4 +#define SLEEF_RVV_VLEN ((1 << 10) / 8) +#define DFTPRIORITY 22 +#elif CONFIG == 11 +// 2048-bit vector length +#define ISANAME "RISC-V Vector Extension 2048-bit" +#define LOG2VECTLENDP 5 +#define SLEEF_RVV_VLEN ((1 << 11) / 8) +#define DFTPRIORITY 23 +#else +#error CONFIG macro invalid or not defined +#endif + +#define LOG2VECTLENSP (LOG2VECTLENDP+1) + +#define ENABLE_SP +//@#define ENABLE_SP +#define ENABLE_DP +//@#define ENABLE_DP + +#if CONFIG != 2 +#if defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2NOFMA) +#error "RVV NOFMA only supported for CONFIG=2" +#else +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#endif +#endif + +#if __riscv_v_intrinsic < 1000000 && !(defined(__clang_major__) && __clang_major__ >= 18) +// __riscv_vcreate* intrinsics only showed up in v1.0-rc0 of the RVV intrinsics +// spec and have already been implemented in clang-18, but are useful for +// eliminating issues with uninitialised data because they are explicit that +// the whole result has defined values. Here we do our best to offer fallback +// implementations where needed. +// +#define __riscv_vcreate_v_f32m1_f32m2(x, y) __riscv_vset(__riscv_vlmul_ext_v_f32m1_f32m2(x), 1, y) +#define __riscv_vcreate_v_f32m2_f32m4(x, y) __riscv_vset(__riscv_vlmul_ext_v_f32m2_f32m4(x), 1, y) +#define __riscv_vcreate_v_f32m4_f32m8(x, y) __riscv_vset(__riscv_vlmul_ext_v_f32m4_f32m8(x), 1, y) +#define __riscv_vcreate_v_f64m1_f64m2(x, y) __riscv_vset(__riscv_vlmul_ext_v_f64m1_f64m2(x), 1, y) +#define __riscv_vcreate_v_f64m2_f64m4(x, y) __riscv_vset(__riscv_vlmul_ext_v_f64m2_f64m4(x), 1, y) +#define __riscv_vcreate_v_f64m4_f64m8(x, y) __riscv_vset(__riscv_vlmul_ext_v_f64m4_f64m8(x), 1, y) +#define __riscv_vcreate_v_i32m1_i32m2(x, y) __riscv_vset(__riscv_vlmul_ext_v_i32m1_i32m2(x), 1, y) +#define __riscv_vcreate_v_i32m2_i32m4(x, y) __riscv_vset(__riscv_vlmul_ext_v_i32m2_i32m4(x), 1, y) +#define __riscv_vcreate_v_i32m4_i32m8(x, y) __riscv_vset(__riscv_vlmul_ext_v_i32m4_i32m8(x), 1, y) +#define __riscv_vcreate_v_u64m1_u64m2(x, y) __riscv_vset(__riscv_vlmul_ext_v_u64m1_u64m2(x), 1, y) +#define __riscv_vcreate_v_u64m2_u64m4(x, y) __riscv_vset(__riscv_vlmul_ext_v_u64m2_u64m4(x), 1, y) + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" +static INLINE vfloat64m1x4_t __riscv_vcreate_v_f64m1x4(vfloat64m1_t x, vfloat64m1_t y, vfloat64m1_t z, vfloat64m1_t w) { + vfloat64m1x4_t unused; + return __riscv_vset(__riscv_vset(__riscv_vset(__riscv_vset(unused, 0, x), 1, y), 2, z), 3, w); +} +static INLINE vfloat64m2x4_t __riscv_vcreate_v_f64m2x4(vfloat64m2_t x, vfloat64m2_t y, vfloat64m2_t z, vfloat64m2_t w) { + vfloat64m2x4_t unused; + return __riscv_vset(__riscv_vset(__riscv_vset(__riscv_vset(unused, 0, x), 1, y), 2, z), 3, w); +} +#pragma GCC diagnostic pop +#endif + +#ifdef NDEBUG +#define SLEEF_RVV_VEXT(size, from_to, v) __riscv_vlmul_ext_v_##from_to(v) +#else +// In situations where we cast from wider to narrower types and then back again +// we should expect data loss, but it can too easily sneak through undisturbed. +// +// QEMU and some hardware have a feature to automatically wipe partial vectors +// when they get truncated this way, but for pure casts like vlmul_ext we need +// to insert a deliberate move operation to force that to happen. Since it's +// extra work it's only enabled for debug builds. +// +#define SLEEF_RVV_VEXT(size, from_to, v) __riscv_vmv_v(__riscv_vlmul_ext_v_##from_to(v), __riscv_vsetvlmax_##size()) +#endif + +//////////////////////////////////////////////////////////////////////////////// +// RISC-V Vector Types +//////////////////////////////////////////////////////////////////////////////// + +// LMUL-Dependent Type & Macro Definitions: +// +// Some SLEEF types are multi-value structs. RVV vectors have unknown length at +// compile time, so they cannote appear in a struct in Clang. They are instead +// represented as single vectors with "members" packed into the registers of a +// wide-LMUL register group. In the largest cases (ddi_t and ddf_t), this +// requires LMUL=8 if the base type (vfloat or vdouble) has LMUL=2, meaning +// LMUL=2 is currently the widest option for SLEEF function argument types. +#if defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) + +typedef vuint32m1_t rvv_vmask32; +typedef vuint64m1_t vmask; +typedef vbool32_t rvv_sp_vopmask; +typedef vbool64_t rvv_dp_vopmask; + +typedef vint32mf2_t vint; +typedef vint64m1_t vint64; +typedef vuint64m1_t vuint64; +typedef vfloat64m1_t vdouble; +typedef vfloat64m2_t vdouble2; +typedef vfloat64m4_t vdouble3; +typedef vfloat64m4_t dd2; +typedef vuint64m2_t vquad; +typedef vint32m2_t di_t; +typedef vint32m4_t ddi_t; +typedef vfloat32m1_t vfloat; +typedef vfloat32m2_t vfloat2; +typedef vfloat32m4_t df2; +typedef vint32m1_t vint2; +typedef vint32m2_t fi_t; +typedef vint32m4_t dfi_t; +typedef vuint64m1_t rvv_dp_vuint2; + +typedef vfloat64m1x4_t tdx; +typedef vfloat64m1x4_t tdi_t; + +#define SLEEF_RVV_SP_LMUL 1 +#define SLEEF_RVV_DP_LMUL 1 +#define SLEEF_RVV_DP_RUNTIME_VL() __riscv_vsetvlmax_e64m1() +#if SLEEF_RVV_VLEN == 0 +// The configuration didn't provide a constant vector length, meaning it'll +// have to be determined at run-time. RVV offers per-data-width operations for +// this so the result doesn't need to be adjusted and that operation is likely +// to fold into the surrounding code for free. +// +#define VECTLENSP (__riscv_vsetvlmax_e32m1()) +#define VECTLENDP SLEEF_RVV_DP_RUNTIME_VL() +//@#define VECTLENSP __riscv_vsetvlmax_e32m1() +//@#define VECTLENDP __riscv_vsetvlmax_e64m1() +#else +#define VECTLENSP (SLEEF_RVV_SP_LMUL * SLEEF_RVV_VLEN / sizeof(float)) +#define VECTLENDP (SLEEF_RVV_DP_LMUL * SLEEF_RVV_VLEN / sizeof(double)) +//@#define VECTLENSP (SLEEF_RVV_SP_LMUL * SLEEF_RVV_VLEN / sizeof(float)) +//@#define VECTLENDP (SLEEF_RVV_DP_LMUL * SLEEF_RVV_VLEN / sizeof(double)) +#endif +#define SLEEF_RVV_SP_VCAST_VF_F __riscv_vfmv_v_f_f32m1 +#define SLEEF_RVV_SP_VCAST_VI2_I __riscv_vmv_v_x_i32m1 +#define SLEEF_RVV_SP_VREINTERPRET_VF __riscv_vreinterpret_f32m1 +#define SLEEF_RVV_SP_VREINTERPRET_VF2 __riscv_vreinterpret_f32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VM __riscv_vreinterpret_u32m1 +#define SLEEF_RVV_SP_VREINTERPRET_VI2 __riscv_vreinterpret_i32m1 +#define SLEEF_RVV_SP_VREINTERPRET_2VI __riscv_vreinterpret_i32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VU __riscv_vreinterpret_u32m1 +#define SLEEF_RVV_SP_VREINTERPRET_VU2 __riscv_vreinterpret_u32m1 +#define SLEEF_RVV_SP_VREINTERPRET_VOM __riscv_vreinterpret_b32 +#define SLEEF_RVV_SP_VID() __riscv_vid_v_u32m1(VECTLENSP) +#define SLEEF_RVV_SP_VGET_VI2 __riscv_vget_i32m1 +#define SLEEF_RVV_SP_VGET_2VI __riscv_vget_i32m2 +#define SLEEF_RVV_SP_VGET_VF __riscv_vget_f32m1 +#define SLEEF_RVV_SP_VGET_VF2 __riscv_vget_f32m2 +#define SLEEF_RVV_SP_VCREATE_FI __riscv_vcreate_v_i32m1_i32m2 +#define SLEEF_RVV_SP_VCREATE_DFI __riscv_vcreate_v_i32m2_i32m4 +#define SLEEF_RVV_SP_VCREATE_DF2 __riscv_vcreate_v_f32m2_f32m4 +#define SLEEF_RVV_SP_VCREATE_VF2 __riscv_vcreate_v_f32m1_f32m2 +#define SLEEF_RVV_SP_VLMUL_EXT_VI2_TO_FI(v) SLEEF_RVV_VEXT(e32m1, i32m1_i32m2, v) +#define SLEEF_RVV_SP_LOAD_VF __riscv_vle32_v_f32m1 +#define SLEEF_RVV_SP_LOAD_2VI __riscv_vle32_v_i32m2 +#define SLEEF_RVV_SP_VFNCVT_X_F_VI __riscv_vfcvt_x_f_v_i32m1_rm +#define SLEEF_RVV_SP_VFCVT_F_X_VF __riscv_vfcvt_f_x_v_f32m1 +#define SLEEF_RVV_SP_VFCVT_X_F_VF_RM __riscv_vfcvt_x_f_v_i32m1_rm +#define SLEEF_RVV_DP_VCAST_VD_D __riscv_vfmv_v_f_f64m1 +#define SLEEF_RVV_DP_VCAST_VD_VI(x) __riscv_vfwcvt_f(x, VECTLENDP) +#define SLEEF_RVV_DP_VCAST_VI_I __riscv_vmv_v_x_i32mf2 +#define SLEEF_RVV_DP_VCAST_VM_U __riscv_vmv_v_x_u64m1 +#define SLEEF_RVV_DP_VREINTERPRET_VD(v) __riscv_vreinterpret_f64m1(__riscv_vreinterpret_i64m1(v)) +#define SLEEF_RVV_DP_VREINTERPRET_4VD_8VI(x) \ + __riscv_vreinterpret_f64m4(__riscv_vreinterpret_v_i32m4_i64m4(x)) +#define SLEEF_RVV_DP_VREINTERPRET_VM __riscv_vreinterpret_u64m1 +#define SLEEF_RVV_DP_VREINTERPRET_VM_SIGNED __riscv_vreinterpret_i64m1 +#define SLEEF_RVV_DP_VREINTERPRET_VI64 __riscv_vreinterpret_i64m1 +#define SLEEF_RVV_DP_VREINTERPRET_VI __riscv_vreinterpret_i32mf2 +#define SLEEF_RVV_DP_VREINTERPRET_VI2(v) __riscv_vreinterpret_i32m1(__riscv_vreinterpret_i64m1(v)) +#define SLEEF_RVV_DP_VREINTERPRET_4VI(v) __riscv_vreinterpret_i32m2(__riscv_vreinterpret_i64m2(v)) +#define SLEEF_RVV_DP_VREINTERPRET_VU __riscv_vreinterpret_u32mf2 +#define SLEEF_RVV_DP_VREINTERPRET_4VU __riscv_vreinterpret_u32m2 +#define SLEEF_RVV_DP_VREINTERPRET_VQ __riscv_vreinterpret_u64m2 +#define SLEEF_RVV_DP_VREINTERPRET_VOM __riscv_vreinterpret_b64 +#define SLEEF_RVV_DP_VID() __riscv_vid_v_u64m1(VECTLENDP) +#define SLEEF_RVV_DP_VGET_VM __riscv_vget_u64m1 +#define SLEEF_RVV_DP_VGET_VD __riscv_vget_f64m1 +#define SLEEF_RVV_DP_VGET_VD2 __riscv_vget_f64m2 +#define SLEEF_RVV_DP_VGET_4VD __riscv_vget_f64m2 +#define SLEEF_RVV_DP_VGET_VI2 __riscv_vget_i32m1 +#define SLEEF_RVV_DP_VCREATE_DI __riscv_vcreate_v_i32m1_i32m2 +#define SLEEF_RVV_DP_VCREATE_DDI(x, y) __riscv_vcreate_v_i32m2_i32m4(x, SLEEF_RVV_VEXT(e32mf2, i32mf2_i32m2, y)) +#define SLEEF_RVV_DP_VCREATE_TD __riscv_vcreate_v_f64m1x4 +#define SLEEF_RVV_DP_VCREATE_VD2 __riscv_vcreate_v_f64m1_f64m2 +#define SLEEF_RVV_DP_VCREATE_VQ __riscv_vcreate_v_u64m1_u64m2 +#define SLEEF_RVV_DP_VCREATE_3VD(x, y, z) __riscv_vcreate_v_f64m2_f64m4(__riscv_vcreate_v_f64m1_f64m2(x, y), SLEEF_RVV_VEXT(e64m1, f64m1_f64m2, z)) +#define SLEEF_RVV_DP_VCREATE_4VD __riscv_vcreate_v_f64m2_f64m4 +#define SLEEF_RVV_DP_VLMUL_TRUNC_VI2_TO_VI(v) __riscv_vlmul_trunc_i32mf2(v) +#define SLEEF_RVV_DP_VLMUL_EXT_VI_TO_VI2(v) SLEEF_RVV_VEXT(e32mf2, i32mf2_i32m1, v) +#define SLEEF_RVV_DP_LOAD_VD __riscv_vle64_v_f64m1 +#define SLEEF_RVV_DP_LOAD_VI __riscv_vle32_v_i32mf2 +#define SLEEF_RVV_DP_VFNCVT_X_F_VI __riscv_vfncvt_x_f_w_i32mf2_rm +#define SLEEF_RVV_DP_VFCVT_F_X_VD __riscv_vfcvt_f_x_v_f64m1 +#define SLEEF_RVV_DP_VFCVT_X_F_VD_RM __riscv_vfcvt_x_f_v_i64m1_rm + +#elif defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA) + +typedef vuint32m2_t rvv_vmask32; +typedef vuint64m2_t vmask; +typedef vbool16_t rvv_sp_vopmask; +typedef vbool32_t rvv_dp_vopmask; + +typedef vint32m1_t vint; +typedef vint64m2_t vint64; +typedef vuint64m2_t vuint64; +typedef vfloat64m2_t vdouble; +typedef vfloat64m4_t vdouble2; +typedef vfloat64m8_t vdouble3; +typedef vfloat64m8_t dd2; +typedef vuint64m4_t vquad; +typedef vint32m4_t di_t; +typedef vint32m8_t ddi_t; +typedef vfloat32m2_t vfloat; +typedef vfloat32m4_t vfloat2; +typedef vfloat32m8_t df2; +typedef vint32m2_t vint2; +typedef vint32m4_t fi_t; +typedef vint32m8_t dfi_t; +typedef vuint64m2_t rvv_dp_vuint2; + +typedef vfloat64m2x4_t tdx; +typedef vfloat64m2x4_t tdi_t; + +#define SLEEF_RVV_SP_LMUL 2 +#define SLEEF_RVV_DP_LMUL 2 +#define SLEEF_RVV_DP_RUNTIME_VL() __riscv_vsetvlmax_e64m2() +#if SLEEF_RVV_VLEN == 0 +// The configuration didn't provide a constant vector length, meaning it'll +// have to be determined at run-time. RVV offers per-data-width operations for +// this so the result doesn't need to be adjusted and that operation is likely +// to fold into the surrounding code for free. +// +#define VECTLENSP (__riscv_vsetvlmax_e32m2()) +#define VECTLENDP SLEEF_RVV_DP_RUNTIME_VL() +//@#define VECTLENSP __riscv_vsetvlmax_e32m2() +//@#define VECTLENDP __riscv_vsetvlmax_e64m2() +#else +#define VECTLENSP (SLEEF_RVV_SP_LMUL * SLEEF_RVV_VLEN / sizeof(float)) +#define VECTLENDP (SLEEF_RVV_DP_LMUL * SLEEF_RVV_VLEN / sizeof(double)) +//@#define VECTLENSP (SLEEF_RVV_SP_LMUL * SLEEF_RVV_VLEN / sizeof(float)) +//@#define VECTLENDP (SLEEF_RVV_DP_LMUL * SLEEF_RVV_VLEN / sizeof(double)) +#endif +#define SLEEF_RVV_SP_VCAST_VF_F __riscv_vfmv_v_f_f32m2 +#define SLEEF_RVV_SP_VCAST_VI2_I __riscv_vmv_v_x_i32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VF __riscv_vreinterpret_f32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VF2 __riscv_vreinterpret_f32m4 +#define SLEEF_RVV_SP_VREINTERPRET_VM __riscv_vreinterpret_u32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VI2 __riscv_vreinterpret_i32m2 +#define SLEEF_RVV_SP_VREINTERPRET_2VI __riscv_vreinterpret_i32m4 +#define SLEEF_RVV_SP_VREINTERPRET_VU __riscv_vreinterpret_u32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VU2 __riscv_vreinterpret_u32m2 +#define SLEEF_RVV_SP_VREINTERPRET_VOM __riscv_vreinterpret_b16 +#define SLEEF_RVV_SP_VID() __riscv_vid_v_u32m2(VECTLENSP) +#define SLEEF_RVV_SP_VGET_VI2 __riscv_vget_i32m2 +#define SLEEF_RVV_SP_VGET_2VI __riscv_vget_i32m4 +#define SLEEF_RVV_SP_VGET_VF __riscv_vget_f32m2 +#define SLEEF_RVV_SP_VGET_VF2 __riscv_vget_f32m4 +#define SLEEF_RVV_SP_VCREATE_FI __riscv_vcreate_v_i32m2_i32m4 +#define SLEEF_RVV_SP_VCREATE_DFI __riscv_vcreate_v_i32m4_i32m8 +#define SLEEF_RVV_SP_VCREATE_DF2 __riscv_vcreate_v_f32m4_f32m8 +#define SLEEF_RVV_SP_VCREATE_VF2 __riscv_vcreate_v_f32m2_f32m4 +#define SLEEF_RVV_SP_VLMUL_EXT_VI2_TO_FI(v) SLEEF_RVV_VEXT(e32m2, i32m2_i32m4, v) +#define SLEEF_RVV_SP_LOAD_VF __riscv_vle32_v_f32m2 +#define SLEEF_RVV_SP_LOAD_2VI __riscv_vle32_v_i32m4 +#define SLEEF_RVV_SP_VFNCVT_X_F_VI __riscv_vfcvt_x_f_v_i32m2_rm +#define SLEEF_RVV_SP_VFCVT_F_X_VF __riscv_vfcvt_f_x_v_f32m2 +#define SLEEF_RVV_SP_VFCVT_X_F_VF_RM __riscv_vfcvt_x_f_v_i32m2_rm +#define SLEEF_RVV_DP_VCAST_VD_D __riscv_vfmv_v_f_f64m2 +#define SLEEF_RVV_DP_VCAST_VD_VI(x) __riscv_vfwcvt_f(x, VECTLENDP) +#define SLEEF_RVV_DP_VCAST_VI_I __riscv_vmv_v_x_i32m1 +#define SLEEF_RVV_DP_VCAST_VM_U __riscv_vmv_v_x_u64m2 +#define SLEEF_RVV_DP_VREINTERPRET_VD(v) __riscv_vreinterpret_f64m2(__riscv_vreinterpret_i64m2(v)) +#define SLEEF_RVV_DP_VREINTERPRET_4VD_8VI(x) \ + __riscv_vreinterpret_f64m8(__riscv_vreinterpret_v_i32m8_i64m8(x)) +#define SLEEF_RVV_DP_VREINTERPRET_VM __riscv_vreinterpret_u64m2 +#define SLEEF_RVV_DP_VREINTERPRET_VM_SIGNED __riscv_vreinterpret_i64m2 +#define SLEEF_RVV_DP_VREINTERPRET_VI64 __riscv_vreinterpret_i64m2 +#define SLEEF_RVV_DP_VREINTERPRET_VI __riscv_vreinterpret_i32m1 +#define SLEEF_RVV_DP_VREINTERPRET_VI2(v) __riscv_vreinterpret_i32m2(__riscv_vreinterpret_i64m2(v)) +#define SLEEF_RVV_DP_VREINTERPRET_4VI(v) __riscv_vreinterpret_i32m4(__riscv_vreinterpret_i64m4(v)) +#define SLEEF_RVV_DP_VREINTERPRET_VU __riscv_vreinterpret_u32m1 +#define SLEEF_RVV_DP_VREINTERPRET_4VU __riscv_vreinterpret_u32m4 +#define SLEEF_RVV_DP_VREINTERPRET_VQ __riscv_vreinterpret_u64m4 +#define SLEEF_RVV_DP_VREINTERPRET_VOM __riscv_vreinterpret_b32 +#define SLEEF_RVV_DP_VID() __riscv_vid_v_u64m2(VECTLENDP) +#define SLEEF_RVV_DP_VGET_VM __riscv_vget_u64m2 +#define SLEEF_RVV_DP_VGET_VD __riscv_vget_f64m2 +#define SLEEF_RVV_DP_VGET_VD2 __riscv_vget_f64m4 +#define SLEEF_RVV_DP_VGET_4VD __riscv_vget_f64m4 +#define SLEEF_RVV_DP_VGET_VI2 __riscv_vget_i32m2 +#define SLEEF_RVV_DP_VCREATE_DI __riscv_vcreate_v_i32m2_i32m4 +#define SLEEF_RVV_DP_VCREATE_DDI(x, y) __riscv_vcreate_v_i32m4_i32m8(x, SLEEF_RVV_VEXT(e32m1, i32m1_i32m4, y)) +#define SLEEF_RVV_DP_VCREATE_TD __riscv_vcreate_v_f64m2x4 +#define SLEEF_RVV_DP_VCREATE_VD2 __riscv_vcreate_v_f64m2_f64m4 +#define SLEEF_RVV_DP_VCREATE_VQ __riscv_vcreate_v_u64m2_u64m4 +#define SLEEF_RVV_DP_VCREATE_3VD(x, y, z) __riscv_vcreate_v_f64m4_f64m8(__riscv_vcreate_v_f64m2_f64m4(x, y), SLEEF_RVV_VEXT(e64m2, f64m2_f64m4, z)) +#define SLEEF_RVV_DP_VCREATE_4VD __riscv_vcreate_v_f64m4_f64m8 +#define SLEEF_RVV_DP_VLMUL_TRUNC_VI2_TO_VI(v) __riscv_vlmul_trunc_i32m1(v) +#define SLEEF_RVV_DP_VLMUL_EXT_VI_TO_VI2(v) SLEEF_RVV_VEXT(e32m1, i32m1_i32m2, v) +#define SLEEF_RVV_DP_LOAD_VD __riscv_vle64_v_f64m2 +#define SLEEF_RVV_DP_LOAD_VI __riscv_vle32_v_i32m1 +#define SLEEF_RVV_DP_VFNCVT_X_F_VI __riscv_vfncvt_x_f_w_i32m1_rm +#define SLEEF_RVV_DP_VFCVT_F_X_VD __riscv_vfcvt_f_x_v_f64m2 +#define SLEEF_RVV_DP_VFCVT_X_F_VD_RM __riscv_vfcvt_x_f_v_i64m2_rm + +#else +#error "unknown rvv lmul" +#endif // ENABLE_RVVM1 + +typedef vquad vargquad; + +static INLINE int vavailability_i(int name) { + // Note that in some cases VECTLENDP is defined as SLEEF_RVV_DP_RUNTIME_VL(), + // which makes this kind of a redundant operation. It's still preferable to + // issue the instructions, though, because if it's not available then it'll + // raise an illegal instruction exception which is trapped by the caller for + // proper error handling in the expected place. + // + return (SLEEF_RVV_DP_RUNTIME_VL() >= VECTLENDP) ? 3 : 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// Single-Precision Functions +//////////////////////////////////////////////////////////////////////////////// + +/****************************************/ +/* Multi-value and multi-word types */ +/****************************************/ +// fi type +static INLINE vfloat figetd_vf_di(fi_t d) { + return SLEEF_RVV_SP_VREINTERPRET_VF(SLEEF_RVV_SP_VGET_VI2(d, 0)); +} +static INLINE vint2 figeti_vi2_di(fi_t d) { + return SLEEF_RVV_SP_VGET_VI2(d, 1); +} +static INLINE fi_t fisetdi_fi_vf_vi2(vfloat d, vint2 i) { + vint2 vdi = SLEEF_RVV_SP_VREINTERPRET_VI2(d); + return SLEEF_RVV_SP_VCREATE_FI(vdi, i); +} +static INLINE vfloat2 dfigetdf_vf2_dfi(dfi_t d) { + return SLEEF_RVV_SP_VREINTERPRET_VF2(SLEEF_RVV_SP_VGET_2VI(d, 0)); +} +static INLINE vint2 dfigeti_vi2_dfi(dfi_t d) { + return SLEEF_RVV_SP_VGET_VI2(d, 2); +} +static INLINE dfi_t dfisetdfi_dfi_vf2_vi2(vfloat2 v, vint2 i) { + fi_t vi = SLEEF_RVV_SP_VREINTERPRET_2VI(v); + fi_t ix = SLEEF_RVV_SP_VLMUL_EXT_VI2_TO_FI(i); + return SLEEF_RVV_SP_VCREATE_DFI(vi, ix); +} +static INLINE dfi_t dfisetdf_dfi_dfi_vf2(dfi_t dfi, vfloat2 v) { + return __riscv_vset(dfi, 0, SLEEF_RVV_SP_VREINTERPRET_2VI(v)); +} +// vfloat2 type +static INLINE vfloat vf2getx_vf_vf2(vfloat2 v) { + return SLEEF_RVV_SP_VGET_VF(v, 0); +} +static INLINE vfloat vf2gety_vf_vf2(vfloat2 v) { + return SLEEF_RVV_SP_VGET_VF(v, 1); +} +static INLINE vfloat2 vf2setxy_vf2_vf_vf(vfloat x, vfloat y) { + return SLEEF_RVV_SP_VCREATE_VF2(x, y); +} +static INLINE vfloat2 vf2setx_vf2_vf2_vf(vfloat2 v, vfloat d) { + return __riscv_vset(v, 0, d); +} +static INLINE vfloat2 vf2sety_vf2_vf2_vf(vfloat2 v, vfloat d) { + return __riscv_vset(v, 1, d); +} +// df2 type +static df2 df2setab_df2_vf2_vf2(vfloat2 a, vfloat2 b) { + return SLEEF_RVV_SP_VCREATE_DF2(a, b); +} +static vfloat2 df2geta_vf2_df2(df2 d) { return SLEEF_RVV_SP_VGET_VF2(d, 0); } +static vfloat2 df2getb_vf2_df2(df2 d) { return SLEEF_RVV_SP_VGET_VF2(d, 1); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { + return SLEEF_RVV_SP_VREINTERPRET_VI2(vf); +} +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { + return SLEEF_RVV_SP_VREINTERPRET_VF(vi); +} + + +/****************************************/ +/* Type Conversions and Broadcasts */ +/****************************************/ +static INLINE vfloat vcast_vf_f(float f) { + return SLEEF_RVV_SP_VCAST_VF_F(f, VECTLENSP); +} +static INLINE vfloat vrint_vf_vf(vfloat vd) { + return SLEEF_RVV_SP_VFCVT_F_X_VF(SLEEF_RVV_SP_VFCVT_X_F_VF_RM(vd, __RISCV_FRM_RNE, VECTLENSP), VECTLENSP); +} +static INLINE vfloat vcast_vf_vi2(vint2 vi) { + return __riscv_vfcvt_f(vi, VECTLENSP); +} +static INLINE vint2 vcast_vi2_i(int i) { + return SLEEF_RVV_SP_VCAST_VI2_I(i, VECTLENSP); +} +static INLINE vint2 vrint_vi2_vf(vfloat vf) { + return SLEEF_RVV_SP_VFNCVT_X_F_VI(vf, __RISCV_FRM_RNE, VECTLENSP); +} +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { + return __riscv_vfcvt_rtz_x(vf, VECTLENSP); +} +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { + return vcast_vf_vi2(vtruncate_vi2_vf(vf)); +} + + +/****************************************/ +/* Memory Operations */ +/****************************************/ +static INLINE vfloat vload_vf_p(const float *ptr) { + return SLEEF_RVV_SP_LOAD_VF(ptr, VECTLENSP); +} +static INLINE vfloat vloadu_vf_p(const float *ptr) { + return SLEEF_RVV_SP_LOAD_VF(ptr, VECTLENSP); +} +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { + __riscv_vse32(ptr, v, VECTLENSP); +} +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { + __riscv_vse32(ptr, v, VECTLENSP); +} +static INLINE void vstoreu_v_p_vi2(int32_t *ptr, vint2 v) { + __riscv_vse32(ptr, v, VECTLENSP); +} +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { + return __riscv_vluxei32(ptr, __riscv_vmul(SLEEF_RVV_SP_VREINTERPRET_VU(vi2), sizeof(float), VECTLENSP), VECTLENSP); +} + + +/****************************************/ +/* Floating-Point Arithmetic */ +/****************************************/ +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfadd(x, y, VECTLENSP); +} +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfsub(x, y, VECTLENSP); +} +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfmul(x, y, VECTLENSP); +} +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfdiv(x, y, VECTLENSP); +} +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfmax(x, y, VECTLENSP); +} +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfmin(x, y, VECTLENSP); +} +static INLINE vfloat vrec_vf_vf(vfloat d) { + return __riscv_vfdiv(vcast_vf_f(1.0f), d, VECTLENSP); +} +static INLINE vfloat vsqrt_vf_vf(vfloat d) { + return __riscv_vfsqrt(d, VECTLENSP); +} +#if defined(ENABLE_FMA_SP) +// Multiply accumulate: z = z + x * y +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return __riscv_vfmadd(x, y, z, VECTLENSP); +} +// Multiply subtract: z = z - x * y +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return __riscv_vfnmsub(x, y, z, VECTLENSP); +} +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return __riscv_vfmsub(x, y, z, VECTLENSP); +} +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#endif +// fused multiply add / sub +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // (x * y) + z + return __riscv_vfmadd(x, y, z, VECTLENSP); +} +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // -(x * y) + z + return __riscv_vfnmsub(x, y, z, VECTLENSP); +} +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { // (x * y) - z + return __riscv_vfmsub(x, y, z, VECTLENSP); +} +// sign manipulation +static INLINE vfloat vmulsign_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfsgnjx(x, y, VECTLENSP); +} +static INLINE vfloat vcopysign_vf_vf_vf(vfloat x, vfloat y) { + return __riscv_vfsgnj(x, y, VECTLENSP); +} +static INLINE vfloat vsign_vf_vf(vfloat f) { + return __riscv_vfsgnj(SLEEF_RVV_SP_VCAST_VF_F(1.0f, VECTLENSP), f, VECTLENSP); +} +static INLINE vfloat vorsign_vf_vf_vf(vfloat x, vfloat y) { + vint2 xi = SLEEF_RVV_SP_VREINTERPRET_VI2(x); + vint2 yi = SLEEF_RVV_SP_VREINTERPRET_VI2(y); + vint2 xioryi = __riscv_vor(xi, yi, VECTLENSP); + vfloat xory = SLEEF_RVV_SP_VREINTERPRET_VF(xioryi); + return __riscv_vfsgnj(x, xory, VECTLENSP); +} +static INLINE vfloat vabs_vf_vf(vfloat f) { + return __riscv_vfabs(f, VECTLENSP); +} +static INLINE vfloat vneg_vf_vf(vfloat f) { + return __riscv_vfneg(f, VECTLENSP); +} + + +/****************************************/ +/* Integer Arithmetic and Logic */ +/****************************************/ +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vadd(x, y, VECTLENSP); +} +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vsub(x, y, VECTLENSP); +} +static INLINE vint2 vneg_vi2_vi2(vint2 x) { + return __riscv_vneg(x, VECTLENSP); +} +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vand(x, y, VECTLENSP); +} +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vand(__riscv_vnot(x, VECTLENSP), y, VECTLENSP); +} +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vor(x, y, VECTLENSP); +} +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vxor(x, y, VECTLENSP); +} +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { + return __riscv_vsll(x, c, VECTLENSP); +} +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { + return __riscv_vsra(x, c, VECTLENSP); +} +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { + return SLEEF_RVV_SP_VREINTERPRET_VI2(__riscv_vsrl(SLEEF_RVV_SP_VREINTERPRET_VU2(x), c, VECTLENSP)); +} + +/****************************************/ +/* Bitmask Operations */ +/****************************************/ +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { + return SLEEF_RVV_SP_VREINTERPRET_VF(SLEEF_RVV_SP_VREINTERPRET_VM(vm)); +} +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { + return SLEEF_RVV_DP_VREINTERPRET_VM(SLEEF_RVV_SP_VREINTERPRET_VM(vf)); +} + +// These are implementations involving the vopmask type which only work in the +// single-precision case. Unfortunately this has a type conflict with the +// double-precision implemention, and so a temporary rvv_sp_vopmask type is +// used here and then macro-ed back to vopmask at the end of the file if +// needed. +// +static INLINE int vtestallones_i_vo32(rvv_sp_vopmask g) { + return __riscv_vcpop(g, VECTLENSP) == VECTLENSP; +} +static INLINE vmask vor_vm_vo32_vm(rvv_sp_vopmask x, vmask y) { + rvv_vmask32 y32 = SLEEF_RVV_SP_VREINTERPRET_VM(y); + return SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vmerge(y32, -1, x, VECTLENSP)); +} +static INLINE vmask vand_vm_vo32_vm(rvv_sp_vopmask x, vmask y) { + rvv_vmask32 y32 = SLEEF_RVV_SP_VREINTERPRET_VM(y); + return SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vmerge(y32, 0, __riscv_vmnot(x, VECTLENSP), VECTLENSP)); +} +static INLINE vmask vandnot_vm_vo32_vm(rvv_sp_vopmask x, vmask y) { + rvv_vmask32 y32 = SLEEF_RVV_SP_VREINTERPRET_VM(y); + return SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vmerge(y32, 0, x, VECTLENSP)); +} + + +/****************************************/ +/* Logical Mask Operations */ +/****************************************/ +static INLINE rvv_sp_vopmask rvv_sp_vand_vo_vo_vo(rvv_sp_vopmask x, rvv_sp_vopmask y) { + return __riscv_vmand(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask rvv_sp_vandnot_vo_vo_vo(rvv_sp_vopmask x, rvv_sp_vopmask y) { + return __riscv_vmandn(y, x, VECTLENSP); +} +static INLINE rvv_sp_vopmask rvv_sp_vor_vo_vo_vo(rvv_sp_vopmask x, rvv_sp_vopmask y) { + return __riscv_vmor(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask rvv_sp_vxor_vo_vo_vo(rvv_sp_vopmask x, rvv_sp_vopmask y) { + return __riscv_vmxor(x, y, VECTLENSP); +} +// single precision FP comparison +static INLINE rvv_sp_vopmask veq_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmfeq(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmfne(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmfgt(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vge_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmfge(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmflt(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vle_vo_vf_vf(vfloat x, vfloat y) { + return __riscv_vmfle(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask visnan_vo_vf(vfloat d) { + return __riscv_vmfne(d, d, VECTLENSP); +} +static INLINE rvv_sp_vopmask visinf_vo_vf(vfloat d) { + return __riscv_vmfeq(__riscv_vfabs(d, VECTLENSP), SLEEF_INFINITYf, VECTLENSP); +} +static INLINE rvv_sp_vopmask vispinf_vo_vf(vfloat d) { + return __riscv_vmfeq(d, SLEEF_INFINITYf, VECTLENSP); +} +// conditional select +static INLINE vfloat vsel_vf_vo_vf_vf(rvv_sp_vopmask mask, vfloat x, vfloat y) { + return __riscv_vmerge(y, x, mask, VECTLENSP); +} +static INLINE vfloat vsel_vf_vo_f_f(rvv_sp_vopmask mask, float v1, float v0) { + return __riscv_vfmerge(vcast_vf_f(v0), v1, mask, VECTLENSP); +} +static INLINE vfloat vsel_vf_vo_vo_f_f_f(rvv_sp_vopmask o0, rvv_sp_vopmask o1, float d0, float d1, float d2) { + return __riscv_vfmerge(__riscv_vfmerge(vcast_vf_f(d2), d1, o1, VECTLENSP), d0, o0, VECTLENSP); +} +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(rvv_sp_vopmask o0, rvv_sp_vopmask o1, rvv_sp_vopmask o2, float d0, float d1, float d2, float d3) { + return __riscv_vfmerge(__riscv_vfmerge(__riscv_vfmerge(vcast_vf_f(d3), d2, o2, VECTLENSP), d1, o1, VECTLENSP), d0, o0, VECTLENSP); +} +// integer comparison +static INLINE rvv_sp_vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vmseq(x, y, VECTLENSP); +} +static INLINE rvv_sp_vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { + return __riscv_vmsgt(x, y, VECTLENSP); +} +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { + vint2 zero = vcast_vi2_i(0); + return __riscv_vmerge(zero, -1, __riscv_vmsgt(x, y, VECTLENSP), VECTLENSP); +} +// integer conditional select +static INLINE vint2 vsel_vi2_vo_vi2_vi2(rvv_sp_vopmask m, vint2 x, vint2 y) { + return __riscv_vmerge(y, x, m, VECTLENSP); +} +static INLINE vint2 vand_vi2_vo_vi2(rvv_sp_vopmask x, vint2 y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, VECTLENSP), VECTLENSP); +} + + +//////////////////////////////////////////////////////////////////////////////// +// Double-Precision Functions +//////////////////////////////////////////////////////////////////////////////// + +/****************************************/ +/* Multi-value and multi-word types */ +/****************************************/ +// vdouble2 type +static INLINE const vdouble vd2getx_vd_vd2(vdouble2 v) { + return SLEEF_RVV_DP_VGET_VD(v, 0); +} +static INLINE const vdouble vd2gety_vd_vd2(vdouble2 v) { + return SLEEF_RVV_DP_VGET_VD(v, 1); +} +static INLINE const vdouble2 vd2setxy_vd2_vd_vd(vdouble x, vdouble y) { + return SLEEF_RVV_DP_VCREATE_VD2(x, y); +} +static INLINE const vdouble2 vd2setx_vd2_vd2_vd(vdouble2 v, vdouble d) { + return __riscv_vset(v, 0, d); +} +static INLINE const vdouble2 vd2sety_vd2_vd2_vd(vdouble2 v, vdouble d) { + return __riscv_vset(v, 1, d); +} +// dd2 type +static dd2 dd2setab_dd2_vd2_vd2(vdouble2 a, vdouble2 b) { + return SLEEF_RVV_DP_VCREATE_4VD(a, b); +} +static vdouble2 dd2geta_vd2_dd2(dd2 d) { return SLEEF_RVV_DP_VGET_4VD(d, 0); } +static vdouble2 dd2getb_vd2_dd2(dd2 d) { return SLEEF_RVV_DP_VGET_4VD(d, 1); } +// vdouble3 type +static INLINE vdouble vd3getx_vd_vd3(vdouble3 v) { return SLEEF_RVV_DP_VGET_VD(v, 0); } +static INLINE vdouble vd3gety_vd_vd3(vdouble3 v) { return SLEEF_RVV_DP_VGET_VD(v, 1); } +static INLINE vdouble vd3getz_vd_vd3(vdouble3 v) { return SLEEF_RVV_DP_VGET_VD(v, 2); } +static INLINE vdouble3 vd3setxyz_vd3_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return SLEEF_RVV_DP_VCREATE_3VD(x, y, z); +} +static INLINE vdouble3 vd3setx_vd3_vd3_vd(vdouble3 v, vdouble d) { return __riscv_vset(v, 0, d); } +static INLINE vdouble3 vd3sety_vd3_vd3_vd(vdouble3 v, vdouble d) { return __riscv_vset(v, 1, d); } +static INLINE vdouble3 vd3setz_vd3_vd3_vd(vdouble3 v, vdouble d) { return __riscv_vset(v, 2, d); } +// di type +static INLINE vdouble digetd_vd_di(di_t d) { + vint2 vi = SLEEF_RVV_DP_VGET_VI2(d, 0); + return SLEEF_RVV_DP_VREINTERPRET_VD(vi); +} +static INLINE vint digeti_vi_di(di_t d) { + vint2 vi = SLEEF_RVV_DP_VGET_VI2(d, 1); + return SLEEF_RVV_DP_VLMUL_TRUNC_VI2_TO_VI(vi); +} +static INLINE di_t disetdi_di_vd_vi(vdouble d, vint i) { + vint2 vd = SLEEF_RVV_DP_VREINTERPRET_VI2(d); + vint2 vi = SLEEF_RVV_DP_VLMUL_EXT_VI_TO_VI2(i); + return SLEEF_RVV_DP_VCREATE_DI(vd, vi); +} +// ddi type +static INLINE vdouble2 ddigetdd_vd2_ddi(ddi_t d) { + return SLEEF_RVV_DP_VGET_VD2(SLEEF_RVV_DP_VREINTERPRET_4VD_8VI(d), 0); +} +static INLINE vint ddigeti_vi_ddi(ddi_t d) { + vint2 vi2 = SLEEF_RVV_DP_VGET_VI2(d, 2); + return SLEEF_RVV_DP_VLMUL_TRUNC_VI2_TO_VI(vi2); +} +static INLINE ddi_t ddisetddi_ddi_vd2_vi(vdouble2 v, vint i) { + di_t vdi = SLEEF_RVV_DP_VREINTERPRET_4VI(v); + return SLEEF_RVV_DP_VCREATE_DDI(vdi, i); +} +static INLINE ddi_t ddisetdd_ddi_ddi_vd2(ddi_t ddi, vdouble2 v) { + di_t vdi = SLEEF_RVV_DP_VREINTERPRET_4VI(v); + return __riscv_vset(ddi, 0, vdi); +} + +/****************************************/ +/* Type Conversions and Broadcasts */ +/****************************************/ +static INLINE vdouble vcast_vd_d(double d) { + return SLEEF_RVV_DP_VCAST_VD_D(d, VECTLENDP); +} +static INLINE vdouble vcast_vd_vi(vint i) { + return SLEEF_RVV_DP_VCAST_VD_VI(i); +} +static INLINE vint vcast_vi_i(int32_t i) { + return SLEEF_RVV_DP_VCAST_VI_I(i, VECTLENDP); +} +static INLINE vint vrint_vi_vd(vdouble vd) { + return SLEEF_RVV_DP_VFNCVT_X_F_VI(vd, __RISCV_FRM_RNE, VECTLENDP); +} +static INLINE vdouble vrint_vd_vd(vdouble vd) { + return SLEEF_RVV_DP_VFCVT_F_X_VD(SLEEF_RVV_DP_VFCVT_X_F_VD_RM(vd, __RISCV_FRM_RNE, VECTLENDP), VECTLENDP); +} +static INLINE vint vtruncate_vi_vd(vdouble vd) { + return __riscv_vfncvt_rtz_x(vd, VECTLENDP); +} +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { + return vcast_vd_vi(vtruncate_vi_vd(vd)); +} + + +/****************************************/ +/* Memory Operations */ +/****************************************/ +static INLINE vdouble vload_vd_p(const double *ptr) { + return SLEEF_RVV_DP_LOAD_VD(ptr, VECTLENDP); +} +static INLINE vdouble vloadu_vd_p(const double *ptr) { + return SLEEF_RVV_DP_LOAD_VD(ptr, VECTLENDP); +} +static INLINE vint vloadu_vi_p(int32_t *p) { + return SLEEF_RVV_DP_LOAD_VI(p, VECTLENDP); +} +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { + __riscv_vse64(ptr, v, VECTLENDP); +} +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { + __riscv_vse64(ptr, v, VECTLENDP); +} +static INLINE void vstoreu_v_p_vi(int32_t *ptr, vint v) { + __riscv_vse32(ptr, v, VECTLENDP); +} +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { + return __riscv_vluxei64(ptr, __riscv_vwmulu(SLEEF_RVV_DP_VREINTERPRET_VU(vi), sizeof(double), VECTLENDP), VECTLENDP); +} + + +/****************************************/ +/* Floating-Point Arithmetic */ +/****************************************/ +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfadd(x, y, VECTLENDP); +} +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfsub(x, y, VECTLENDP); +} +static INLINE vdouble vrec_vd_vd(vdouble d) { + return __riscv_vfdiv(vcast_vd_d(1.0), d, VECTLENDP); +} +static INLINE vdouble vabs_vd_vd(vdouble d) { + return __riscv_vfabs(d, VECTLENDP); +} +static INLINE vdouble vsqrt_vd_vd(vdouble d) { + return __riscv_vfsqrt(d, VECTLENDP); +} +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfmul(x, y, VECTLENDP); +} +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfdiv(x, y, VECTLENDP); +} +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfmax(x, y, VECTLENDP); +} +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfmin(x, y, VECTLENDP); +} +#if defined(ENABLE_FMA_DP) +// Multiply accumulate: z = z + x * y +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfmadd(x, y, z, VECTLENDP); +} +// Multiply subtract: z = x * y - z +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfmsub(x, y, z, VECTLENDP); +} +// z = z - x * y +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfnmsac(z, x, y, VECTLENDP); +} +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(z, vmul_vd_vd_vd(x, y)); } +#endif +// fused multiply add / sub +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfmadd(x, y, z, VECTLENDP); +} +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfnmsub(x, y, z, VECTLENDP); +} +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return __riscv_vfmsub(x, y, z, VECTLENDP); +} +// sign manipulation +static INLINE vdouble vmulsign_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfsgnjx(x, y, VECTLENDP); +} +static INLINE vdouble vcopysign_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfsgnj(x, y, VECTLENDP); +} +static INLINE vdouble vorsign_vd_vd_vd(vdouble x, vdouble y) { + return __riscv_vfsgnj(x, SLEEF_RVV_DP_VREINTERPRET_VD(__riscv_vor(SLEEF_RVV_DP_VREINTERPRET_VM(x), SLEEF_RVV_DP_VREINTERPRET_VM(y), VECTLENDP)), VECTLENDP); +} +static INLINE vdouble vneg_vd_vd(vdouble d) { + return __riscv_vfneg(d, VECTLENDP); +} + + +/****************************************/ +/* Integer Arithmetic and Logic */ +/****************************************/ +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { + return __riscv_vadd(x, y, VECTLENDP); +} +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { + return __riscv_vsub(x, y, VECTLENDP); +} +static INLINE vint vneg_vi_vi(vint x) { + return __riscv_vneg(x, VECTLENDP); +} +static INLINE vint vand_vi_vi_vi(vint x, vint y) { + return __riscv_vand(x, y, VECTLENDP); +} +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { + return __riscv_vand(__riscv_vnot(x, VECTLENDP), y, VECTLENDP); +} +static INLINE vint vor_vi_vi_vi(vint x, vint y) { + return __riscv_vor(x, y, VECTLENDP); +} +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { + return __riscv_vxor(x, y, VECTLENDP); +} +static INLINE vint vsll_vi_vi_i(vint x, int c) { + return __riscv_vsll(x, c, VECTLENDP); +} +static INLINE vint vsra_vi_vi_i(vint x, int c) { + return __riscv_vsra(x, c, VECTLENDP); +} +static INLINE vint vsrl_vi_vi_i(vint x, int c) { + return SLEEF_RVV_DP_VREINTERPRET_VI(__riscv_vsrl(SLEEF_RVV_DP_VREINTERPRET_VU(x), c, VECTLENDP)); +} + + +/****************************************/ +/* Bitmask Operations */ +/****************************************/ +static INLINE vmask vcast_vm_i64(int64_t c) { + return SLEEF_RVV_DP_VCAST_VM_U(c, VECTLENDP); +} +static INLINE vmask vcast_vm_u64(uint64_t c) { + return SLEEF_RVV_DP_VCAST_VM_U(c, VECTLENDP); +} +static INLINE vmask vcast_vm_i_i(int64_t h, int64_t l) { + return SLEEF_RVV_DP_VCAST_VM_U((((uint64_t)h) << 32) | (uint32_t) l, VECTLENDP); +} +static INLINE vmask vcast_vm_vi(vint vi) { + return SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vwcvt_x(vi, VECTLENDP)); +} +static INLINE vmask vcastu_vm_vi(vint vi) { + return __riscv_vsll(SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vwcvt_x(vi, VECTLENDP)), 32, VECTLENDP); +} +static INLINE vint vcastu_vi_vm(vmask vm) { + return SLEEF_RVV_DP_VREINTERPRET_VI(__riscv_vnsrl(vm, 32, VECTLENDP)); +} +static INLINE vint vcast_vi_vm(vmask vm) { + return SLEEF_RVV_DP_VREINTERPRET_VI(__riscv_vncvt_x(vm, VECTLENDP)); +} + +// These are the complementary case to the earlier comment about +// rvv_sp_vopmask. +// +static INLINE vmask vand_vm_vo64_vm(rvv_dp_vopmask x, vmask y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, VECTLENDP), VECTLENDP); +} +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { + return __riscv_vand(x, y, VECTLENDP); +} +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { + return __riscv_vor(x, y, VECTLENDP); +} +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { + return __riscv_vxor(x, y, VECTLENDP); +} +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { + return __riscv_vand(__riscv_vnot(x, VECTLENDP), y, VECTLENDP); +} +static INLINE vmask vandnot_vm_vo64_vm(rvv_dp_vopmask x, vmask y) { + return __riscv_vmerge(y, 0, x, VECTLENDP); +} +static INLINE vmask vsll64_vm_vm_i(vmask mask, int64_t c) { + return __riscv_vsll(mask, c, VECTLENDP); +} +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + return __riscv_vsub(x, y, VECTLENDP); +} +static INLINE vmask vsrl64_vm_vm_i(vmask mask, int64_t c) { + return __riscv_vsrl(mask, c, VECTLENDP); +} +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { + return __riscv_vadd(x, y, VECTLENDP); +} +static INLINE vmask vor_vm_vo64_vm(rvv_dp_vopmask x, vmask y) { + return __riscv_vmerge(y, -1, x, VECTLENDP); +} +static INLINE vmask vsel_vm_vo64_vm_vm(rvv_dp_vopmask mask, vmask x, vmask y) { + return __riscv_vmerge(y, x, mask, VECTLENDP); +} +static INLINE vmask vneg64_vm_vm(vmask mask) { + return SLEEF_RVV_DP_VREINTERPRET_VM(__riscv_vneg(SLEEF_RVV_DP_VREINTERPRET_VM_SIGNED(mask), VECTLENDP)); +} +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { + return SLEEF_RVV_DP_VREINTERPRET_VD(vm); +} +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { + return SLEEF_RVV_DP_VREINTERPRET_VM(vd); +} + +// vquad type +static INLINE const vmask vqgetx_vm_vq(vquad v) { return SLEEF_RVV_DP_VGET_VM(v, 0); } +static INLINE const vmask vqgety_vm_vq(vquad v) { return SLEEF_RVV_DP_VGET_VM(v, 1); } +static INLINE vquad vqsetxy_vq_vm_vm(vmask x, vmask y) { + return SLEEF_RVV_DP_VCREATE_VQ(x, y); +} +static INLINE vquad vqsetx_vq_vq_vm(vquad v, vmask x) { return __riscv_vset(v, 0, x); } +static INLINE vquad vqsety_vq_vq_vm(vquad v, vmask y) { return __riscv_vset(v, 1, y); } + + +/****************************************/ +/* Logical Mask Operations */ +/****************************************/ +static INLINE rvv_dp_vopmask vcast_vo64_vo32(rvv_dp_vopmask vo) { + return vo; +} +static INLINE rvv_dp_vopmask vcast_vo32_vo64(rvv_dp_vopmask vo) { + return vo; +} +static INLINE rvv_dp_vopmask rvv_dp_vand_vo_vo_vo(rvv_dp_vopmask x, rvv_dp_vopmask y) { + return __riscv_vmand(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask rvv_dp_vandnot_vo_vo_vo(rvv_dp_vopmask x, rvv_dp_vopmask y) { + return __riscv_vmandn(y, x, VECTLENDP); +} +static INLINE rvv_dp_vopmask rvv_dp_vor_vo_vo_vo(rvv_dp_vopmask x, rvv_dp_vopmask y) { + return __riscv_vmor(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask rvv_dp_vxor_vo_vo_vo(rvv_dp_vopmask x, rvv_dp_vopmask y) { + return __riscv_vmxor(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask veq64_vo_vm_vm(vmask x, vmask y) { + return __riscv_vmseq(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + return __riscv_vmsgt(SLEEF_RVV_DP_VREINTERPRET_VM_SIGNED(x), SLEEF_RVV_DP_VREINTERPRET_VM_SIGNED(y), VECTLENDP); +} +// double-precision comparison +static INLINE rvv_dp_vopmask visinf_vo_vd(vdouble d) { + return __riscv_vmfeq(__riscv_vfabs(d, VECTLENDP), SLEEF_INFINITY, VECTLENDP); +} +static INLINE rvv_dp_vopmask vispinf_vo_vd(vdouble d) { + return __riscv_vmfeq(d, SLEEF_INFINITY, VECTLENDP); +} +static INLINE rvv_dp_vopmask veq_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmfeq(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmfne(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmflt(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vle_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmfle(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmfgt(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vge_vo_vd_vd(vdouble x, vdouble y) { + return __riscv_vmfge(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask visnan_vo_vd(vdouble d) { + return __riscv_vmfne(d, d, VECTLENDP); +} +// double-precision conditional select +static INLINE vdouble vsel_vd_vo_vd_vd(rvv_dp_vopmask mask, vdouble x, vdouble y) { + return __riscv_vmerge(y, x, mask, VECTLENDP); +} +static INLINE vdouble vsel_vd_vo_d_d(rvv_dp_vopmask mask, double v0, double v1) { + return __riscv_vfmerge(vcast_vd_d(v1), v0, mask, VECTLENDP); +} +static INLINE vdouble vsel_vd_vo_vo_d_d_d(rvv_dp_vopmask o0, rvv_dp_vopmask o1, double d0, double d1, double d2) { + return __riscv_vfmerge(__riscv_vfmerge(vcast_vd_d(d2), d1, o1, VECTLENDP), d0, o0, VECTLENDP); +} +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(rvv_dp_vopmask o0, rvv_dp_vopmask o1, rvv_dp_vopmask o2, double d0, double d1, double d2, double d3) { + return __riscv_vfmerge(__riscv_vfmerge(__riscv_vfmerge(vcast_vd_d(d3), d2, o2, VECTLENDP), d1, o1, VECTLENDP), d0, o0, VECTLENDP); +} +static INLINE int vtestallones_i_vo64(rvv_dp_vopmask g) { + return __riscv_vcpop(g, VECTLENDP) == VECTLENDP; +} +// integer comparison +static INLINE rvv_dp_vopmask veq_vo_vi_vi(vint x, vint y) { + return __riscv_vmseq(x, y, VECTLENDP); +} +static INLINE rvv_dp_vopmask vgt_vo_vi_vi(vint x, vint y) { + return __riscv_vmsgt(x, y, VECTLENDP); +} +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { + vint zero = vcast_vi_i(0); + return __riscv_vmerge(zero, -1, __riscv_vmsgt(x, y, VECTLENDP), VECTLENDP); +} +// integer conditional select +static INLINE vint vsel_vi_vo_vi_vi(rvv_dp_vopmask m, vint x, vint y) { + return __riscv_vmerge(y, x, m, VECTLENDP); +} +static INLINE vint vandnot_vi_vo_vi(rvv_dp_vopmask mask, vint vi) { + return __riscv_vmerge(vi, 0, mask, VECTLENDP); +} +static INLINE vint vand_vi_vo_vi(rvv_dp_vopmask x, vint y) { + return __riscv_vmerge(y, 0, __riscv_vmnot(x, VECTLENDP), VECTLENDP); +} + +/****************************************/ +/* DFT Operations */ +/****************************************/ + +static INLINE vdouble vposneg_vd_vd(vdouble d) { + rvv_dp_vopmask mask = SLEEF_RVV_DP_VREINTERPRET_VOM(__riscv_vmv_v_x_u8m1(0x55, __riscv_vsetvlmax_e8m1())); + vdouble nd = __riscv_vfneg(d, VECTLENDP); + return __riscv_vmerge(nd, d, mask, VECTLENDP); +} + +static INLINE vdouble vnegpos_vd_vd(vdouble d) { + rvv_dp_vopmask mask = SLEEF_RVV_DP_VREINTERPRET_VOM(__riscv_vmv_v_x_u8m1(0xaa, __riscv_vsetvlmax_e8m1())); + vdouble nd = __riscv_vfneg(d, VECTLENDP); + return __riscv_vmerge(nd, d, mask, VECTLENDP); +} + +static INLINE vfloat vposneg_vf_vf(vfloat d) { + rvv_sp_vopmask mask = SLEEF_RVV_SP_VREINTERPRET_VOM(__riscv_vmv_v_x_u8m1(0x55, __riscv_vsetvlmax_e8m1())); + vfloat nd = __riscv_vfneg(d, VECTLENSP); + return __riscv_vmerge(nd, d, mask, VECTLENSP); +} + +static INLINE vfloat vnegpos_vf_vf(vfloat d) { + rvv_sp_vopmask mask = SLEEF_RVV_SP_VREINTERPRET_VOM(__riscv_vmv_v_x_u8m1(0xaa, __riscv_vsetvlmax_e8m1())); + vfloat nd = __riscv_vfneg(d, VECTLENSP); + return __riscv_vmerge(nd, d, mask, VECTLENSP); +} + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat d0, vfloat d1) { return vadd_vf_vf_vf(d0, vnegpos_vf_vf(d1)); } +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vfma_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vfma_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } + +// + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { + rvv_dp_vuint2 id = SLEEF_RVV_DP_VID(); + id = __riscv_vxor(id, 1, VECTLENDP); + return __riscv_vrgather(vd, id, VECTLENDP); +} + +static INLINE vfloat vrev21_vf_vf(vfloat vf) { + vint2 id = SLEEF_RVV_SP_VREINTERPRET_VI2(SLEEF_RVV_SP_VID()); + id = __riscv_vxor(id, 1, VECTLENSP); + return __riscv_vrgather(vf, SLEEF_RVV_SP_VREINTERPRET_VU2(id), VECTLENSP); +} + +static INLINE vdouble vreva2_vd_vd(vdouble vd) { + rvv_dp_vuint2 id = SLEEF_RVV_DP_VID(); + id = __riscv_vxor(id, VECTLENDP - 2, VECTLENDP); + return __riscv_vrgather(vd, id, VECTLENDP); +} + +static INLINE vfloat vreva2_vf_vf(vfloat vf) { + vint2 id = SLEEF_RVV_SP_VREINTERPRET_VI2(SLEEF_RVV_SP_VID()); + id = __riscv_vxor(id, VECTLENSP - 2, VECTLENSP); + return __riscv_vrgather(vf, SLEEF_RVV_SP_VREINTERPRET_VU2(id), VECTLENSP); +} + +// + +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + // Address generation for this operation turned out to be overly complex when + // you consider that the loop processes 128 bits per iteration and will + // probably only iterate 2 or 4 times. + // + ptr += offset * 2; + for (int i = 0; i < VECTLENDP; i += 2) { + // PROTIP: Avoid modifying `v` within the loop, and just extract the useful + // part directly in each iteration, because we can. This avoids a + // loop-carried dependency. + // + vdouble vv = __riscv_vslidedown(v, i, 2); + __riscv_vse64(ptr, vv, 2); + ptr += step * 2; + } +} + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + // as above re: looping + ptr += offset * 2; + for (int i = 0; i < VECTLENSP; i += 2) { + vfloat vv = __riscv_vslidedown(v, i, 2); + __riscv_vse32(ptr, vv, 2); + ptr += step * 2; + } +} + + +/****************************************/ +/* Quad Operations */ +/****************************************/ + + +static INLINE vmask tdxgete_vm_tdx(tdx t) { + return SLEEF_RVV_DP_VREINTERPRET_VM(SLEEF_RVV_DP_VGET_VD(t, 0)); +} +static INLINE vdouble tdxgetd3x_vd_tdx(tdx t) { + return SLEEF_RVV_DP_VGET_VD(t, 1); +} +static INLINE vdouble tdxgetd3y_vd_tdx(tdx t) { + return SLEEF_RVV_DP_VGET_VD(t, 2); +} +static INLINE vdouble tdxgetd3z_vd_tdx(tdx t) { + return SLEEF_RVV_DP_VGET_VD(t, 3); +} +static INLINE tdx tdxsete_tdx_tdx_vm(tdx t, vmask e) { + return __riscv_vset(t, 0, SLEEF_RVV_DP_VREINTERPRET_VD(e)); +} +static INLINE tdx tdxsetx_tdx_tdx_vd(tdx t, vdouble x) { + return __riscv_vset(t, 1, x); +} +static INLINE tdx tdxsety_tdx_tdx_vd(tdx t, vdouble y) { + return __riscv_vset(t, 2, y); +} +static INLINE tdx tdxsetz_tdx_tdx_vd(tdx t, vdouble z) { + return __riscv_vset(t, 3, z); +} + +static INLINE vdouble3 tdxgetd3_vd3_tdx(tdx t) { + return vd3setxyz_vd3_vd_vd_vd(tdxgetd3x_vd_tdx(t), tdxgetd3y_vd_tdx(t), tdxgetd3z_vd_tdx(t)); +} + +static INLINE tdx tdxsetxyz_tdx_tdx_vd_vd_vd(tdx t, vdouble x, vdouble y, vdouble z) { + t = tdxsetx_tdx_tdx_vd(t, x); + t = tdxsety_tdx_tdx_vd(t, y); + t = tdxsetz_tdx_tdx_vd(t, z); + return t; +} +static INLINE tdx tdxsetd3_tdx_tdx_vd3(tdx t, vdouble3 d3) { + return tdxsetxyz_tdx_tdx_vd_vd_vd(t, vd3getx_vd_vd3(d3), vd3gety_vd_vd3(d3), vd3getz_vd_vd3(d3)); +} + +static INLINE tdx tdxseted3_tdx_vm_vd3(vmask e, vdouble3 d3) { + return SLEEF_RVV_DP_VCREATE_TD(SLEEF_RVV_DP_VREINTERPRET_VD(e), + vd3getx_vd_vd3(d3), vd3gety_vd_vd3(d3), vd3getz_vd_vd3(d3)); +} +static INLINE tdx tdxsetexyz_tdx_vm_vd_vd_vd(vmask e, vdouble x, vdouble y, vdouble z) { + return SLEEF_RVV_DP_VCREATE_TD(SLEEF_RVV_DP_VREINTERPRET_VD(e), x, y, z); +} + +static INLINE vdouble tdigetx_vd_tdi(tdi_t d) { + return SLEEF_RVV_DP_VGET_VD(d, 0); +} +static INLINE vdouble tdigety_vd_tdi(tdi_t d) { + return SLEEF_RVV_DP_VGET_VD(d, 1); +} +static INLINE vdouble tdigetz_vd_tdi(tdi_t d) { + return SLEEF_RVV_DP_VGET_VD(d, 2); +} + +static INLINE vint tdigeti_vi_tdi(tdi_t d) { + vdouble vd = SLEEF_RVV_DP_VGET_VD(d, 3); + vint2 vi2 = SLEEF_RVV_DP_VREINTERPRET_VI2(vd); + vint vi = SLEEF_RVV_DP_VLMUL_TRUNC_VI2_TO_VI(vi2); + return vi; +} +static INLINE tdi_t tdisetx_tdi_tdi_vd(tdi_t t, vdouble x) { + return __riscv_vset(t, 0, x); +} +static INLINE tdi_t tdisety_tdi_tdi_vd(tdi_t t, vdouble y) { + return __riscv_vset(t, 1, y); +} +static INLINE tdi_t tdisetz_tdi_tdi_vd(tdi_t t, vdouble z) { + return __riscv_vset(t, 2, z); +} +static INLINE tdi_t tdiseti_tdi_tdi_vi(tdi_t t, vint i) { + vint2 vi2 = SLEEF_RVV_DP_VLMUL_EXT_VI_TO_VI2(i); + vdouble vd = SLEEF_RVV_DP_VREINTERPRET_VD(vi2); + return __riscv_vset(t, 3, vd); +} + +static INLINE vdouble3 tdigettd_vd3_tdi(tdi_t d) { + return vd3setxyz_vd3_vd_vd_vd(tdigetx_vd_tdi(d), tdigety_vd_tdi(d), tdigetz_vd_tdi(d)); +} +static INLINE tdi_t tdisettd_tdi_tdi_vd3(tdi_t tdi, vdouble3 v) { + tdi = tdisetx_tdi_tdi_vd(tdi, vd3getx_vd_vd3(v)); + tdi = tdisety_tdi_tdi_vd(tdi, vd3gety_vd_vd3(v)); + tdi = tdisetz_tdi_tdi_vd(tdi, vd3getz_vd_vd3(v)); + return tdi; +} +static INLINE tdi_t tdisettdi_tdi_vd3_vi(vdouble3 v, vint i) { + tdi_t ret = SLEEF_RVV_DP_VCREATE_TD(vd3getx_vd_vd3(v), vd3gety_vd_vd3(v), vd3getz_vd_vd3(v), vd3getz_vd_vd3(v)); + return tdiseti_tdi_tdi_vi(ret, i); +} + + +static INLINE rvv_dp_vopmask vcast_vo_i(int i) { + return SLEEF_RVV_DP_VREINTERPRET_VOM(__riscv_vmv_v_x_u32m1(i, VECTLENSP)); +} +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { + return SLEEF_RVV_DP_VREINTERPRET_VM(v); +} +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { + return SLEEF_RVV_DP_VREINTERPRET_VI64(m); +} +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { + return v; +} +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { + return m; +} +static INLINE int vtestallzeros_i_vo64(rvv_dp_vopmask g) { + return __riscv_vcpop(g, VECTLENDP) == 0; +} + + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { vstore_v_p_vd(ptr, v); } +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { vstore_v_p_vf(ptr, v); } +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vscatter2_v_p_i_i_vd(ptr, offset, step, v); } +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +// These functions are for debugging +static double vcast_d_vd(vdouble v) { + return __riscv_vfmv_f(v); +} + +static float vcast_f_vf(vfloat v) { + return __riscv_vfmv_f(v); +} + +static int vcast_i_vi(vint v) { + return __riscv_vmv_x(v); +} + +static int vcast_i_vi2(vint2 v) { + return __riscv_vmv_x(v); +} + +// + +static vquad loadu_vq_p(const int32_t *ptr) { + // We have a lot of vreinterprets, here. It's a side effect of this being a + // corner case, and the intrinsics specification not supporting direct + // casting between arbitrary types. It's necessary to take several + // deliberate steps; first switching signed to unsigned, then changing the + // data width of the lanes. + // + return SLEEF_RVV_DP_VREINTERPRET_VQ(SLEEF_RVV_DP_VREINTERPRET_4VU(SLEEF_RVV_SP_LOAD_2VI(ptr, VECTLENSP * 2))); +} + +static INLINE vquad cast_vq_aq(vargquad aq) { return aq; } +static INLINE vargquad cast_aq_vq(vquad vq) { return vq; } + +static INLINE void vprefetch_v_p(const void *ptr) {} + + +/****************************************/ +/* RVV_SP and RVV_DP reconciliation */ +/****************************************/ + +// About the RISC-V Vector type translations: +// +// Because the single- and double-precision versions of the RVV port have +// conflicting definitions of the vopmask type, they can only +// be defined for at most one precision level in a single translation unit. +// Any functions that use vopmask type are thus given unique names and +// then mapped to the public interface according to the corresponding +// ENABLE_RVV_SP or ENABLE_RVV_DP macro guards. +// +// This is done at the end of the file to avoid unintentional references to +// the public names internally. + +#if defined(ENABLE_RVV_SP) && defined(ENABLE_RVV_DP) +#error Cannot simultaneously define ENABLE_RVV_SP and ENABLE_RVV_DP +#endif + +// Types and functions that conflict with ENABLE_RVV_DP +#ifdef ENABLE_RVV_SP +#define vopmask rvv_sp_vopmask + +#define vand_vo_vo_vo rvv_sp_vand_vo_vo_vo +#define vandnot_vo_vo_vo rvv_sp_vandnot_vo_vo_vo +#define vor_vo_vo_vo rvv_sp_vor_vo_vo_vo +#define vxor_vo_vo_vo rvv_sp_vxor_vo_vo_vo +#endif // ENABLE_RVV_SP + +//@#ifdef ENABLE_RVV_SP +//@#define vopmask rvv_sp_vopmask +// +//@#define vand_vo_vo_vo rvv_sp_vand_vo_vo_vo +//@#define vandnot_vo_vo_vo rvv_sp_vandnot_vo_vo_vo +//@#define vor_vo_vo_vo rvv_sp_vor_vo_vo_vo +//@#define vxor_vo_vo_vo rvv_sp_vxor_vo_vo_vo +//@#endif // ENABLE_RVV_SP + +// Types and functions that conflict with ENABLE_RVV_SP +#ifdef ENABLE_RVV_DP +#define vopmask rvv_dp_vopmask + +#define vand_vo_vo_vo rvv_dp_vand_vo_vo_vo +#define vandnot_vo_vo_vo rvv_dp_vandnot_vo_vo_vo +#define vor_vo_vo_vo rvv_dp_vor_vo_vo_vo +#define vxor_vo_vo_vo rvv_dp_vxor_vo_vo_vo +#endif // ENABLE_RVV_DP + +//@#ifdef ENABLE_RVV_DP +//@#define vopmask rvv_dp_vopmask +// +//@#define vand_vo_vo_vo rvv_dp_vand_vo_vo_vo +//@#define vandnot_vo_vo_vo rvv_dp_vandnot_vo_vo_vo +//@#define vor_vo_vo_vo rvv_dp_vor_vo_vo_vo +//@#define vxor_vo_vo_vo rvv_dp_vxor_vo_vo_vo +//@#endif // ENABLE_RVV_DP + +#endif // HELPERRVV_H diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpers390x_128.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpers390x_128.h new file mode 100644 index 0000000000000..924f4eac14412 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpers390x_128.h @@ -0,0 +1,462 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 140 || CONFIG == 141 || CONFIG == 150 || CONFIG == 151 + +#if !defined(__VX__) && !defined(SLEEF_GENHEADER) +#error This helper is for IBM s390x. +#endif + +#if __ARCH__ < 12 && !defined(SLEEF_GENHEADER) +#error Please specify -march=z14 or higher. +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 1 +//@#define LOG2VECTLENDP 1 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#if CONFIG == 140 || CONFIG == 150 +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#endif + +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING + +#if !defined(SLEEF_GENHEADER) +#ifndef SLEEF_VECINTRIN_H_INCLUDED +#include +#define SLEEF_VECINTRIN_H_INCLUDED +#endif + +#include +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __vector unsigned long long vmask; +typedef __vector unsigned long long vopmask; + +typedef __vector double vdouble; +typedef __vector int vint; + +typedef __vector float vfloat; +typedef __vector int vint2; + +typedef __vector long long vint64; +typedef __vector unsigned long long vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +static INLINE int vavailability_i(int n) { + if (n == 1 || n == 2) { + return vec_max((vdouble) {n, n}, (vdouble) {n, n})[0] != 0; + } + return 0; +} + +#if CONFIG == 140 || CONFIG == 141 +#define ISANAME "VXE" +#else +#define ISANAME "VXE2" +#endif + +#define DFTPRIORITY 14 + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { } + +static vint2 vloadu_vi2_p(int32_t *p) { return (vint2) { p[0], p[1], p[2], p[3] }; } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { p[0] = v[0]; p[1] = v[1]; p[2] = v[2]; p[3] = v[3]; } +static vint vloadu_vi_p(int32_t *p) { return (vint) { p[0], p[1] }; } +static void vstoreu_v_p_vi(int32_t *p, vint v) { p[0] = v[0]; p[1] = v[1]; } + +static INLINE vdouble vload_vd_p(const double *p) { return (vdouble) { p[0], p[1] }; } +static INLINE void vstore_v_p_vd(double *p, vdouble v) { p[0] = v[0]; p[1] = v[1]; } +static INLINE vdouble vloadu_vd_p(const double *p) { return (vdouble) { p[0], p[1] }; } +static INLINE void vstoreu_v_p_vd(double *p, vdouble v) { p[0] = v[0]; p[1] = v[1]; } + +static INLINE vfloat vload_vf_p(const float *p) { return (vfloat) { p[0], p[1], p[2], p[3] }; } +static INLINE void vstore_v_p_vf(float *p, vfloat v) { p[0] = v[0]; p[1] = v[1]; p[2] = v[2]; p[3] = v[3]; } +static INLINE void vscatter2_v_p_i_i_vf(float *p, int offset, int step, vfloat v) { + *(p+(offset + step * 0)*2 + 0) = v[0]; + *(p+(offset + step * 0)*2 + 1) = v[1]; + *(p+(offset + step * 1)*2 + 0) = v[2]; + *(p+(offset + step * 1)*2 + 1) = v[3]; +} + +static INLINE vfloat vloadu_vf_p(const float *p) { return (vfloat) { p[0], p[1], p[2], p[3] }; } +static INLINE void vstoreu_v_p_vf(float *p, vfloat v) { p[0] = v[0]; p[1] = v[1]; p[2] = v[2]; p[3] = v[3]; } + +static INLINE void vscatter2_v_p_i_i_vd(double *p, int offset, int step, vdouble v) { vstore_v_p_vd((double *)(&p[2*offset]), v); } + +static INLINE vdouble vgather_vd_p_vi(const double *p, vint vi) { + return ((vdouble) { p[vi[0]], p[vi[1]] }); +} + +static INLINE vfloat vgather_vf_p_vi2(const float *p, vint2 vi2) { + return ((vfloat) { p[vi2[0]], p[vi2[1]], p[vi2[2]], p[vi2[3]] }); +} + +static INLINE vopmask vcast_vo_i(int i) { return (vopmask) { i ? (long long)-1 : 0, i ? (long long)-1 : 0 }; } +static INLINE vint vcast_vi_i(int i) { return (vint) { i, i }; } +static INLINE vint2 vcast_vi2_i(int i) { return (vint2) { i, i, i, i }; } +static INLINE vfloat vcast_vf_f(float f) { return (vfloat) { f, f, f, f }; } +static INLINE vdouble vcast_vd_d(double d) { return (vdouble) { d, d }; } + +static INLINE vdouble vcast_vd_vi(vint vi) { return (vdouble) { vi[0], vi[1] }; } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return (vfloat) { vi[0], vi[1], vi[2], vi[3] }; } +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return __builtin_s390_vfidb(vd, 4, 5); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return __builtin_s390_vfidb(vd, 4, 4); } + +static INLINE vint vrint_vi_vd(vdouble vd) { + vd = vrint_vd_vd(vd); + return (vint) { vd[0], vd[1] }; +} +static INLINE vint vtruncate_vi_vd(vdouble vd) { return (vint) { vd[0], vd[1] }; } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return (vint) { vf[0], vf[1], vf[2], vf[3] }; } + +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return (vmask)vd; } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return (vdouble)vm; } + +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return (vmask)vf; } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return (vfloat)vm; } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vi) { return (vfloat)vi; } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return (vint2)vf; } + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return x + y; } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return x - y; } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return x * y; } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return x / y; } +static INLINE vdouble vrec_vd_vd(vdouble x) { return 1 / x; } +static INLINE vdouble vneg_vd_vd(vdouble d) { return -d; } + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return x + y; } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return x - y; } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return x * y; } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return x / y; } +static INLINE vfloat vrec_vf_vf(vfloat x) { return 1 / x; } +static INLINE vfloat vneg_vf_vf(vfloat d) { return -d; } + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return x & y; } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return y & ~x; } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return x | y; } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return x ^ y; } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return x & y; } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return y & ~x; } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return x | y; } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return x ^ y; } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return x & y; } +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { return y & ~x; } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return x | y; } +static INLINE vmask vxor_vm_vo64_vm(vopmask x, vmask y) { return x ^ y; } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return x & y; } +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { return y & ~x; } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return x | y; } +static INLINE vmask vxor_vm_vo32_vm(vopmask x, vmask y) { return x ^ y; } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) { return vec_sel(y, x, o); } +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask o, vfloat x, vfloat y) { return vec_sel(y, x, (__vector unsigned int)o); } +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask o, vint2 x, vint2 y) { return vec_sel(y, x, (__vector unsigned int)o); } + +static INLINE int vtestallones_i_vo32(vopmask g) { return vec_all_ne((vint2)g, (vint2 ) { 0, 0, 0, 0 }); } +static INLINE int vtestallones_i_vo64(vopmask g) { return vec_all_ne((__vector unsigned long long)g, (__vector unsigned long long) { 0, 0 }); } + +static INLINE vopmask vcast_vo32_vo64(vopmask g) { return (vopmask)(vint) { g[0] != 0 ? -1 : 0, g[1] != 0 ? -1 : 0, 0, 0 }; } +static INLINE vopmask vcast_vo64_vo32(vopmask g) { return (vopmask) { ((vint)g)[0] != 0 ? 0xffffffffffffffffLL : 0, ((vint)g)[1] != 0 ? 0xffffffffffffffffLL : 0 }; } + +static INLINE vmask vcast_vm_i_i(int h, int l) { return (vmask)(vint){ h, l, h, l }; } +static INLINE vmask vcast_vm_i64(int64_t i) { return (vmask)(vint64){ i, i }; } +static INLINE vmask vcast_vm_u64(uint64_t i) { return (vmask)(vuint64){ i, i }; } + +static INLINE vmask vcastu_vm_vi(vint vi) { return (vmask)(vint2){ vi[0], 0, vi[1], 0 }; } +static INLINE vint vcastu_vi_vm(vmask vi2) { return (vint){ vi2[0] >> 32, vi2[1] >> 32 }; } + +static INLINE vint vreinterpretFirstHalf_vi_vi2(vint2 vi2) { return (vint){ vi2[0], vi2[1] }; } +static INLINE vint2 vreinterpretFirstHalf_vi2_vi(vint vi) { return (vint2){ vi[0], vi[1], 0, 0 }; } + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { return (vdouble) { vd[1], vd[0] }; } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return vd; } +static INLINE vfloat vrev21_vf_vf(vfloat vd) { return (vfloat) { vd[1], vd[0], vd[3], vd[2] }; } +static INLINE vfloat vreva2_vf_vf(vfloat vd) { return (vfloat) { vd[2], vd[3], vd[0], vd[1] }; } + +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { + return (vopmask) { x[0] == y[0] ? 0xffffffffffffffffLL : 0, x[1] == y[1] ? 0xffffffffffffffffLL : 0 }; +} + +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { + return (vmask)((__vector long long)x + (__vector long long)y); +} + +// + +#define PNMASK ((vdouble) { +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE vfloat vposneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(PNMASKf))); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(NPMASKf))); } + +// + +static INLINE vdouble vabs_vd_vd(vdouble d) { return vec_abs(d); } +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } + +#if CONFIG == 140 || CONFIG == 150 +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_madd(x, y, z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_msub(x, y, z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_nmsub(x, y, z); } +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +#endif + +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vmla_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_madd(x, y, z); } +static INLINE vdouble vfmapp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_madd(x, y, z); } +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_msub(x, y, z); } +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_nmsub(x, y, z); } +static INLINE vdouble vfmann_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vec_nmadd(x, y, z); } + +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return vadd_vf_vf_vf(x, vnegpos_vf_vf(y)); } + +#if CONFIG == 140 || CONFIG == 150 +static INLINE vfloat vmla_vf_vf_vf_vf (vfloat x, vfloat y, vfloat z) { return __builtin_s390_vfmasb(x, y, z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vec_nmsub(x, y, z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return __builtin_s390_vfmssb(x, y, z); } +static INLINE vfloat vfma_vf_vf_vf_vf (vfloat x, vfloat y, vfloat z) { return __builtin_s390_vfmasb(x, y, z); } +static INLINE vfloat vfmapp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return __builtin_s390_vfmasb(x, y, z); } +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return __builtin_s390_vfmssb(x, y, z); } +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vec_nmsub(x, y, z); } +static INLINE vfloat vfmann_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vec_nmadd(x, y, z); } +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#endif + +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vmla_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } + +// + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +// + +static INLINE vopmask vnot_vo_vo(vopmask o) { return ~o; } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vec_cmpeq(x, y); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vnot_vo_vo(vec_cmpeq(x, y)); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vec_cmplt(x, y); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vec_cmple(x, y); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vec_cmpgt(x, y); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)vec_cmpge(x, y); } + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return x + y; } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return x - y; } +static INLINE vint vneg_vi_vi(vint e) { return -e; } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return x & y; } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return y & ~x; } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return x | y; } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return x ^ y; } + +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { return vreinterpretFirstHalf_vi_vi2((vint2)x) & y; } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { return vec_andc(y, vreinterpretFirstHalf_vi_vi2((vint2)x)); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return (vint)(((__vector unsigned int)x) << (__vector unsigned int){c, c, c, c}); } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return (vint)(((__vector unsigned int)x) >> (__vector unsigned int){c, c, c, c}); } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return x >> (__vector int){c, c, c, c}; } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return vec_cmpeq(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return vec_cmpgt(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return (vopmask)vreinterpretFirstHalf_vi2_vi(vec_cmpeq(x, y)); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return (vopmask)vreinterpretFirstHalf_vi2_vi(vec_cmpgt(x, y));} + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { + return vor_vi_vi_vi(vand_vi_vi_vi(vreinterpretFirstHalf_vi_vi2((vint2)m), x), + vandnot_vi_vi_vi(vreinterpretFirstHalf_vi_vi2((vint2)m), y)); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { return (vopmask)(vec_cmpeq(vabs_vd_vd(d), vcast_vd_d(SLEEF_INFINITY))); } +static INLINE vopmask vispinf_vo_vd(vdouble d) { return (vopmask)(vec_cmpeq(d, vcast_vd_d(SLEEF_INFINITY))); } +static INLINE vopmask visminf_vo_vd(vdouble d) { return (vopmask)(vec_cmpeq(d, vcast_vd_d(-SLEEF_INFINITY))); } +static INLINE vopmask visnan_vo_vd(vdouble d) { return (vopmask)(vnot_vo_vo(vec_cmpeq(d, d))); } + +static INLINE double vcast_d_vd(vdouble v) { return v[0]; } +static INLINE float vcast_f_vf(vfloat v) { return v[0]; } + +static INLINE void vstream_v_p_vd(double *p, vdouble v) { vstore_v_p_vd(p, v); } +static INLINE void vsscatter2_v_p_i_i_vd(double *p, int offset, int step, vdouble v) { vscatter2_v_p_i_i_vd(p, offset, step, v); } + +// + +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return (vint2)vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return (vmask)vi; } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return x + y; } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return x - y; } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return -e; } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return x & y; } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return y & ~x; } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return x | y; } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return x ^ y; } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return (vint2)x & y; } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return y & ~(vint2)x; } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { return (vint2)(((__vector unsigned int)x) << (__vector unsigned int){c, c, c, c}); } +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { return (vint2)(((__vector unsigned int)x) >> (__vector unsigned int){c, c, c, c}); } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { return x >> (__vector int){c, c, c, c}; } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return (vopmask)vec_cmpeq(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return (vopmask)vec_cmpgt(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return vec_cmpeq(x, y); } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return vec_cmpgt(x, y); } + +static INLINE void vsscatter2_v_p_i_i_vf(float *p, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(p, offset, step, v); } +static INLINE void vstream_v_p_vf(float *p, vfloat v) { vstore_v_p_vf(p, v); } + +// + +static INLINE vdouble vsqrt_vd_vd(vdouble d) { return vec_sqrt(d); } + +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return vec_max(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return vec_min(x, y); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vec_cmpeq(x, y); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vnot_vo_vo(vec_cmpeq(x, y)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vec_cmplt(x, y); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vec_cmple(x, y); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vec_cmpgt(x, y); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)vec_cmpge(x, y); } + +static INLINE vfloat vabs_vf_vf(vfloat f) { return vec_abs(f); } +static INLINE vfloat vrint_vf_vf(vfloat vf) { return __builtin_s390_vfisb(vf, 4, 4); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { return __builtin_s390_vfisb(vf, 4, 5); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return vec_max(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return vec_min(x, y); } + +static INLINE vfloat vsqrt_vf_vf(vfloat d) { return vec_sqrt(d); } + +static INLINE vopmask visinf_vo_vf (vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf (vfloat d) { return vneq_vo_vf_vf(d, d); } + +static INLINE vint2 vrint_vi2_vf(vfloat vf) { + vf = vrint_vf_vf(vf); + return (vint) { vf[0], vf[1], vf[2], vf[3] }; +} + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad m = { aq.y, aq.x }; + return m; +} +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad a = { vq.y, vq.x }; + return a; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + return vec_all_eq((__vector signed long long)g, (__vector signed long long){ 0, 0 }); +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { + return (vmask)vec_sel((__vector signed long long)y, (__vector signed long long)x, (__vector __bool long long)o); +} + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + return (vmask)((__vector signed long long)x - (__vector signed long long)y); +} + +static INLINE vmask vneg64_vm_vm(vmask x) { + return (vmask)((__vector signed long long) {0, 0} - (__vector signed long long)x); +} + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + return (vopmask)vec_cmpgt((__vector signed long long)x, (__vector signed long long)y); +} + +#define vsll64_vm_vm_i(x, c) ((vmask)((__vector unsigned long long)x << (__vector unsigned long long) { c, c })) +#define vsrl64_vm_vm_i(x, c) ((vmask)((__vector unsigned long long)x >> (__vector unsigned long long) { c, c })) + +static INLINE vint vcast_vi_vm(vmask vm) { + return (vint) { vm[0], vm[1] }; +} + +static INLINE vmask vcast_vm_vi(vint vi) { + return (vmask) (__vector signed long long) { vi[0], vi[1] }; +} + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return (vmask)v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return (vint64)m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return (vmask)v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return (vuint64)m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersse2.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersse2.h new file mode 100644 index 0000000000000..833f5f9b8e139 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersse2.h @@ -0,0 +1,517 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if CONFIG == 2 + +#if !defined(__SSE2__) && !defined(SLEEF_GENHEADER) +#error Please specify -msse2. +#endif + +#elif CONFIG == 3 + +#if (!defined(__SSE2__) || !defined(__SSE3__)) && !defined(SLEEF_GENHEADER) +#error Please specify -msse2 and -msse3 +#endif + +#elif CONFIG == 4 + +#if (!defined(__SSE2__) || !defined(__SSE3__) || !defined(__SSE4_1__)) && !defined(SLEEF_GENHEADER) +#error Please specify -msse2, -msse3 and -msse4.1 +#endif + +#else +#error CONFIG macro invalid or not defined +#endif + +#define ENABLE_DP +//@#define ENABLE_DP +#define LOG2VECTLENDP 1 +//@#define LOG2VECTLENDP 1 +#define VECTLENDP (1 << LOG2VECTLENDP) +//@#define VECTLENDP (1 << LOG2VECTLENDP) + +#define ENABLE_SP +//@#define ENABLE_SP +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +//@#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) +//@#define VECTLENSP (1 << LOG2VECTLENSP) + +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +#if !defined(SLEEF_GENHEADER) +#if defined(_MSC_VER) +#include +#else +#include +#endif + +#include +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +typedef __m128i vmask; +typedef __m128i vopmask; + +typedef __m128d vdouble; +typedef __m128i vint; + +typedef __m128 vfloat; +typedef __m128i vint2; + +typedef __m128i vint64; +typedef __m128i vuint64; + +typedef struct { + vmask x, y; +} vquad; + +typedef vquad vargquad; + +// + +#if !defined(SLEEF_GENHEADER) + +#ifndef __SLEEF_H__ +void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +static INLINE int cpuSupportsSSE2() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[3] & (1 << 26)) != 0; +} + +static INLINE int cpuSupportsSSE3() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 0)) != 0; +} + +static INLINE int cpuSupportsSSE4_1() { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 19)) != 0; +} + +#if defined(__SSE2__) && defined(__SSE3__) && defined(__SSE4_1__) +static INLINE int vavailability_i(int name) { + //int d = __builtin_cpu_supports("sse2") && __builtin_cpu_supports("sse3") && __builtin_cpu_supports("sse4.1"); + int d = cpuSupportsSSE2() && cpuSupportsSSE3() && cpuSupportsSSE4_1(); + return d ? 3 : 0; +} +#define ISANAME "SSE4.1" +#define DFTPRIORITY 12 +#elif defined(__SSE2__) && defined(__SSE3__) +static INLINE int vavailability_i(int name) { + //int d = __builtin_cpu_supports("sse2") && __builtin_cpu_supports("sse3"); + int d = cpuSupportsSSE2() && cpuSupportsSSE3(); + return d ? 3 : 0; +} +#define ISANAME "SSE3" +#define DFTPRIORITY 11 +#else +static INLINE int vavailability_i(int name) { + int d = cpuSupportsSSE2(); + return d ? 3 : 0; +} +#define ISANAME "SSE2" +#define DFTPRIORITY 10 +#endif + +#endif // #if !defined(SLEEF_GENHEADER) + +static INLINE void vprefetch_v_p(const void *ptr) { _mm_prefetch(ptr, _MM_HINT_T0); } + +static INLINE int vtestallones_i_vo32(vopmask g) { return _mm_movemask_epi8(g) == 0xFFFF; } +static INLINE int vtestallones_i_vo64(vopmask g) { return _mm_movemask_epi8(g) == 0xFFFF; } + +// + +static vint2 vloadu_vi2_p(int32_t *p) { return _mm_loadu_si128((__m128i *)p); } +static void vstoreu_v_p_vi2(int32_t *p, vint2 v) { _mm_storeu_si128((__m128i *)p, v); } + +static vint vloadu_vi_p(int32_t *p) { return _mm_loadu_si128((__m128i *)p); } +static void vstoreu_v_p_vi(int32_t *p, vint v) { _mm_storeu_si128((__m128i *)p, v); } + +// + +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { return _mm_and_si128(x, y); } +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { return _mm_andnot_si128(x, y); } +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { return _mm_or_si128(x, y); } +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { return _mm_xor_si128(x, y); } + +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { return _mm_and_si128(x, y); } +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { return _mm_andnot_si128(x, y); } +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { return _mm_or_si128(x, y); } +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { return _mm_xor_si128(x, y); } + +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { return _mm_and_si128(x, y); } +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { return _mm_or_si128(x, y); } +static INLINE vmask vandnot_vm_vo64_vm(vmask x, vmask y) { return _mm_andnot_si128(x, y); } +static INLINE vmask vxor_vm_vo64_vm(vmask x, vmask y) { return _mm_xor_si128(x, y); } + +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { return _mm_and_si128(x, y); } +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { return _mm_or_si128(x, y); } +static INLINE vmask vandnot_vm_vo32_vm(vmask x, vmask y) { return _mm_andnot_si128(x, y); } +static INLINE vmask vxor_vm_vo32_vm(vmask x, vmask y) { return _mm_xor_si128(x, y); } + +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return _mm_shuffle_epi32(m, 0x08); } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return _mm_shuffle_epi32(m, 0x50); } + +static INLINE vopmask vcast_vo_i(int i) { return _mm_set1_epi64x(i ? -1 : 0); } + +// + +static INLINE vint vrint_vi_vd(vdouble vd) { return _mm_cvtpd_epi32(vd); } +static INLINE vint vtruncate_vi_vd(vdouble vd) { return _mm_cvttpd_epi32(vd); } +static INLINE vdouble vcast_vd_vi(vint vi) { return _mm_cvtepi32_pd(vi); } +static INLINE vint vcast_vi_i(int i) { return _mm_set_epi32(0, 0, i, i); } +static INLINE vint2 vcastu_vm_vi(vint vi) { return _mm_and_si128(_mm_shuffle_epi32(vi, 0x73), _mm_set_epi32(-1, 0, -1, 0)); } +static INLINE vint vcastu_vi_vm(vint2 vi) { return _mm_shuffle_epi32(vi, 0x0d); } + +#if CONFIG == 4 +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return _mm_round_pd(vd, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return _mm_round_pd(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vfloat vtruncate_vf_vf(vfloat vf) { return _mm_round_ps(vf, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); } +static INLINE vfloat vrint_vf_vf(vfloat vd) { return _mm_round_ps(vd, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC); } +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { return _mm_cmpeq_epi64(x, y); } +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#else +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { return vcast_vd_vi(vtruncate_vi_vd(vd)); } +static INLINE vdouble vrint_vd_vd(vdouble vd) { return vcast_vd_vi(vrint_vi_vd(vd)); } +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { + vmask t = _mm_cmpeq_epi32(x, y); + return vand_vm_vm_vm(t, _mm_shuffle_epi32(t, 0xb1)); +} +#endif + +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { return _mm_add_epi64(x, y); } + +static INLINE vmask vcast_vm_i_i(int i0, int i1) { return _mm_set_epi32(i0, i1, i0, i1); } + +static INLINE vmask vcast_vm_i64(int64_t i) { return _mm_set1_epi64x(i); } +static INLINE vmask vcast_vm_u64(uint64_t i) { return _mm_set1_epi64x((uint64_t)i); } + +// + +static INLINE vdouble vcast_vd_d(double d) { return _mm_set1_pd(d); } +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { return _mm_castpd_si128(vd); } +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { return _mm_castsi128_pd(vm); } + +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { return _mm_add_pd(x, y); } +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { return _mm_sub_pd(x, y); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { return _mm_mul_pd(x, y); } +static INLINE vdouble vdiv_vd_vd_vd(vdouble x, vdouble y) { return _mm_div_pd(x, y); } +static INLINE vdouble vrec_vd_vd(vdouble x) { return _mm_div_pd(_mm_set1_pd(1), x); } +static INLINE vdouble vsqrt_vd_vd(vdouble x) { return _mm_sqrt_pd(x); } +static INLINE vdouble vabs_vd_vd(vdouble d) { return _mm_andnot_pd(_mm_set1_pd(-0.0), d); } +static INLINE vdouble vneg_vd_vd(vdouble d) { return _mm_xor_pd(_mm_set1_pd(-0.0), d); } +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(z, vmul_vd_vd_vd(x, y)); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { return _mm_max_pd(x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return _mm_min_pd(x, y); } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmpeq_pd(x, y)); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmpneq_pd(x, y)); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmplt_pd(x, y)); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmple_pd(x, y)); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmpgt_pd(x, y)); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return _mm_castpd_si128(_mm_cmpge_pd(x, y)); } + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return _mm_add_epi32(x, y); } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return _mm_sub_epi32(x, y); } +static INLINE vint vneg_vi_vi(vint e) { return vsub_vi_vi_vi(vcast_vi_i(0), e); } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return _mm_andnot_si128(x, y); } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return _mm_or_si128(x, y); } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return _mm_xor_si128(x, y); } + +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { return _mm_and_si128(x, y); } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { return _mm_andnot_si128(x, y); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { return _mm_slli_epi32(x, c); } +static INLINE vint vsrl_vi_vi_i(vint x, int c) { return _mm_srli_epi32(x, c); } +static INLINE vint vsra_vi_vi_i(vint x, int c) { return _mm_srai_epi32(x, c); } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return _mm_cmpgt_epi32(x, y); } + +#if CONFIG == 4 +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { return _mm_blendv_epi8(y, x, m); } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask m, vdouble x, vdouble y) { return _mm_blendv_pd(y, x, _mm_castsi128_pd(m)); } +#else +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { return vor_vm_vm_vm(vand_vm_vm_vm(m, x), vandnot_vm_vm_vm(m, y)); } + +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask opmask, vdouble x, vdouble y) { + return _mm_or_pd(_mm_and_pd(_mm_castsi128_pd(opmask), x), _mm_andnot_pd(_mm_castsi128_pd(opmask), y)); +} +#endif + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmpeq_pd(vabs_vd_vd(d), _mm_set1_pd(SLEEF_INFINITY))); +} + +static INLINE vopmask vispinf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmpeq_pd(d, _mm_set1_pd(SLEEF_INFINITY))); +} + +static INLINE vopmask visminf_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmpeq_pd(d, _mm_set1_pd(-SLEEF_INFINITY))); +} + +static INLINE vopmask visnan_vo_vd(vdouble d) { + return vreinterpret_vm_vd(_mm_cmpneq_pd(d, d)); +} + +// + +static INLINE vdouble vload_vd_p(const double *ptr) { return _mm_load_pd(ptr); } +static INLINE vdouble vloadu_vd_p(const double *ptr) { return _mm_loadu_pd(ptr); } + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { _mm_store_pd(ptr, v); } +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { _mm_storeu_pd(ptr, v); } + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { + int a[sizeof(vint)/sizeof(int)]; + vstoreu_v_p_vi(a, vi); + return _mm_set_pd(ptr[a[1]], ptr[a[0]]); +} + +// This function is for debugging +static INLINE double vcast_d_vd(vdouble v) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + return a[0]; +} + +// + +static INLINE vint2 vcast_vi2_vm(vmask vm) { return vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return vi; } +static INLINE vint2 vrint_vi2_vf(vfloat vf) { return _mm_cvtps_epi32(vf); } +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { return _mm_cvttps_epi32(vf); } +static INLINE vfloat vcast_vf_vi2(vint2 vi) { return _mm_cvtepi32_ps(vcast_vm_vi2(vi)); } +static INLINE vfloat vcast_vf_f(float f) { return _mm_set1_ps(f); } +static INLINE vint2 vcast_vi2_i(int i) { return _mm_set1_epi32(i); } +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { return _mm_castps_si128(vf); } +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { return _mm_castsi128_ps(vm); } +static INLINE vfloat vreinterpret_vf_vi2(vint2 vm) { return _mm_castsi128_ps(vm); } +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { return _mm_castps_si128(vf); } + +#if CONFIG != 4 +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { return vcast_vf_vi2(vtruncate_vi2_vf(vd)); } +static INLINE vfloat vrint_vf_vf(vfloat vf) { return vcast_vf_vi2(vrint_vi2_vf(vf)); } +#endif + +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { return _mm_add_ps(x, y); } +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { return _mm_sub_ps(x, y); } +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { return _mm_mul_ps(x, y); } +static INLINE vfloat vdiv_vf_vf_vf(vfloat x, vfloat y) { return _mm_div_ps(x, y); } +static INLINE vfloat vrec_vf_vf(vfloat x) { return vdiv_vf_vf_vf(vcast_vf_f(1.0f), x); } +static INLINE vfloat vsqrt_vf_vf(vfloat x) { return _mm_sqrt_ps(x); } +static INLINE vfloat vabs_vf_vf(vfloat f) { return vreinterpret_vf_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f))); } +static INLINE vfloat vneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(d))); } +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { return _mm_max_ps(x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return _mm_min_ps(x, y); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmpeq_ps(x, y)); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmpneq_ps(x, y)); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmplt_ps(x, y)); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmple_ps(x, y)); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmpgt_ps(x, y)); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return vreinterpret_vm_vf(_mm_cmpge_ps(x, y)); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return vadd_vi_vi_vi(x, y); } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return vsub_vi_vi_vi(x, y); } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return vsub_vi2_vi2_vi2(vcast_vi2_i(0), e); } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return vand_vi_vi_vi(x, y); } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return vandnot_vi_vi_vi(x, y); } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return vor_vi_vi_vi(x, y); } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return vxor_vi_vi_vi(x, y); } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return vand_vi_vo_vi(x, y); } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return vandnot_vi_vo_vi(x, y); } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { return vsll_vi_vi_i(x, c); } +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { return vsrl_vi_vi_i(x, c); } +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { return vsra_vi_vi_i(x, c); } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpgt_epi32(x, y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpeq_epi32(x, y); } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return _mm_cmpgt_epi32(x, y); } + +#if CONFIG == 4 +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { return _mm_blendv_epi8(y, x, m); } + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask m, vfloat x, vfloat y) { return _mm_blendv_ps(y, x, _mm_castsi128_ps(m)); } +#else +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return vor_vi2_vi2_vi2(vand_vi2_vi2_vi2(m, x), vandnot_vi2_vi2_vi2(m, y)); +} + +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask opmask, vfloat x, vfloat y) { + return _mm_or_ps(_mm_and_ps(_mm_castsi128_ps(opmask), x), _mm_andnot_ps(_mm_castsi128_ps(opmask), y)); +} +#endif + +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} + +static INLINE vopmask visinf_vo_vf(vfloat d) { return veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf)); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return veq_vo_vf_vf(d, vcast_vf_f(-SLEEF_INFINITYf)); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +static INLINE vfloat vload_vf_p(const float *ptr) { return _mm_load_ps(ptr); } +static INLINE vfloat vloadu_vf_p(const float *ptr) { return _mm_loadu_ps(ptr); } + +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { _mm_store_ps(ptr, v); } +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { _mm_storeu_ps(ptr, v); } + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi) { + int a[VECTLENSP]; + vstoreu_v_p_vi2(a, vi); + return _mm_set_ps(ptr[a[3]], ptr[a[2]], ptr[a[1]], ptr[a[0]]); +} + +// This function is for debugging +static INLINE float vcast_f_vf(vfloat v) { + float a[VECTLENSP]; + vstoreu_v_p_vf(a, v); + return a[0]; +} + +// + +#define PNMASK ((vdouble) { +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0 }) +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) + +static INLINE vdouble vposneg_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(PNMASK))); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return vreinterpret_vd_vm(vxor_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(NPMASK))); } +static INLINE vfloat vposneg_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(PNMASKf))); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(d), vreinterpret_vm_vf(NPMASKf))); } + +#if CONFIG >= 3 +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return _mm_addsub_pd(x, y); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return _mm_addsub_ps(x, y); } +#else +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return vadd_vf_vf_vf(x, vnegpos_vf_vf(y)); } +#endif +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsubadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsubadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } + +static INLINE vdouble vrev21_vd_vd(vdouble d0) { return _mm_shuffle_pd(d0, d0, 1); } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return vd; } + +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { _mm_stream_pd(ptr, v); } +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vstore_v_p_vd((double *)(&ptr[2*offset]), v); } +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { _mm_stream_pd((double *)(&ptr[2*offset]), v); } + +// + +static INLINE vfloat vrev21_vf_vf(vfloat d0) { return _mm_shuffle_ps(d0, d0, (2 << 6) | (3 << 4) | (0 << 2) | (1 << 0)); } +static INLINE vfloat vreva2_vf_vf(vfloat d0) { return _mm_shuffle_ps(d0, d0, (1 << 6) | (0 << 4) | (3 << 2) | (2 << 0)); } + +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { _mm_stream_ps(ptr, v); } + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); +} + +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + _mm_storel_pd((double *)(ptr+(offset + step * 0)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); + _mm_storeh_pd((double *)(ptr+(offset + step * 1)*2), vreinterpret_vd_vm(vreinterpret_vm_vf(v))); +} + +// + +static vquad loadu_vq_p(void *p) { + vquad vq; + memcpy(&vq, p, VECTLENDP * 16); + return vq; +} + +static INLINE vquad cast_vq_aq(vargquad aq) { + vquad vq; + memcpy(&vq, &aq, VECTLENDP * 16); + return vq; +} + +static INLINE vargquad cast_aq_vq(vquad vq) { + vargquad aq; + memcpy(&aq, &vq, VECTLENDP * 16); + return aq; +} + +static INLINE int vtestallzeros_i_vo64(vopmask g) { return _mm_movemask_epi8(g) == 0; } + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { + return vor_vm_vm_vm(vand_vm_vm_vm(o, x), vandnot_vm_vm_vm(o, y)); +} + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { return _mm_sub_epi64(x, y); } +static INLINE vmask vneg64_vm_vm(vmask x) { return _mm_sub_epi64(vcast_vm_i_i(0, 0), x); } + +#define vsll64_vm_vm_i(x, c) _mm_slli_epi64(x, c) +#define vsrl64_vm_vm_i(x, c) _mm_srli_epi64(x, c) +//@#define vsll64_vm_vm_i(x, c) _mm_slli_epi64(x, c) +//@#define vsrl64_vm_vm_i(x, c) _mm_srli_epi64(x, c) + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + int64_t ax[2], ay[2]; + _mm_storeu_si128((__m128i *)ax, x); + _mm_storeu_si128((__m128i *)ay, y); + return _mm_set_epi64x(ax[1] > ay[1] ? -1 : 0, ax[0] > ay[0] ? -1 : 0); +} + +static INLINE vmask vcast_vm_vi(vint vi) { + vmask m = _mm_and_si128(_mm_shuffle_epi32(vi, (0 << 6) | (1 << 4) | (0 << 2) | (0 << 0)), _mm_set_epi32(0, -1, 0, -1)); + return vor_vm_vm_vm(vcastu_vm_vi(vgt_vo_vi_vi(vcast_vi_i(0), vi)), m); +} +static INLINE vint vcast_vi_vm(vmask vm) { return _mm_shuffle_epi32(vm, 0x08); } + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return v; } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return m; } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return v; } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return m; } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersve.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersve.h new file mode 100644 index 0000000000000..75965dc6d9227 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpersve.h @@ -0,0 +1,1115 @@ +/*********************************************************************/ +/* Copyright ARM Ltd. 2010 - 2024. */ +/* Distributed under the Boost Software License, Version 1.0. */ +/* (See accompanying file LICENSE.txt or copy at */ +/* http://www.boost.org/LICENSE_1_0.txt) */ +/*********************************************************************/ + +#if !defined(__ARM_FEATURE_SVE) && !defined(SLEEF_GENHEADER) +#error Please specify SVE flags. +#endif + +#if !defined(SLEEF_GENHEADER) +#include +#include + +#include "misc.h" +#endif // #if !defined(SLEEF_GENHEADER) + +#if defined(VECTLENDP) || defined(VECTLENSP) +#error VECTLENDP or VECTLENSP already defined +#endif + +#if CONFIG == 1 || CONFIG == 2 +// Vector length agnostic +#define VECTLENSP (svcntw()) +//@#define VECTLENSP (svcntw()) +#define VECTLENDP (svcntd()) +//@#define VECTLENDP (svcntd()) +#define ISANAME "AArch64 SVE" +#define ptrue svptrue_b8() +//@#define ptrue svptrue_b8() +#elif CONFIG == 8 +// 256-bit vector length +#define ISANAME "AArch64 SVE 256-bit" +#define LOG2VECTLENDP 2 +#define ptrue svptrue_pat_b8(SV_VL32) +#define DFTPRIORITY 20 +#elif CONFIG == 9 +// 512-bit vector length +#define ISANAME "AArch64 SVE 512-bit" +#define LOG2VECTLENDP 3 +#define ptrue svptrue_pat_b8(SV_VL64) +#define DFTPRIORITY 21 +#elif CONFIG == 10 +// 1024-bit vector length +#define ISANAME "AArch64 SVE 1024-bit" +#define LOG2VECTLENDP 4 +#define ptrue svptrue_pat_b8(SV_VL128) +#define DFTPRIORITY 22 +#elif CONFIG == 11 +// 2048-bit vector length +#define ISANAME "AArch64 SVE 2048-bit" +#define LOG2VECTLENDP 5 +#define ptrue svptrue_pat_b8(SV_VL256) +#define DFTPRIORITY 23 +#else +#error CONFIG macro invalid or not defined +#endif + +#ifdef LOG2VECTLENDP +// For DFT, VECTLENDP and VECTLENSP are not the size of the available +// vector length, but the size of the partial vectors utilized in the +// computation. The appropriate VECTLENDP and VECTLENSP are chosen by +// the dispatcher according to the value of svcntd(). + +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENDP (1 << LOG2VECTLENDP) +#define VECTLENSP (1 << LOG2VECTLENSP) +static INLINE int vavailability_i(int name) { return svcntd() >= VECTLENDP ? 3 : 0; } +#else +static INLINE int vavailability_i(int name) { return 3; } +#endif + +#define ENABLE_SP +//@#define ENABLE_SP +#define ENABLE_DP +//@#define ENABLE_DP + +#if CONFIG != 2 +#define ENABLE_FMA_SP +//@#define ENABLE_FMA_SP +#define ENABLE_FMA_DP +//@#define ENABLE_FMA_DP +//#define SPLIT_KERNEL // Benchmark comparison is needed to determine whether this option should be enabled. +#endif + +#define FULL_FP_ROUNDING +//@#define FULL_FP_ROUNDING +#define ACCURATE_SQRT +//@#define ACCURATE_SQRT + +// Type definitions + +// Mask definition +typedef svint32_t vmask; +typedef svbool_t vopmask; + +// Single precision definitions +typedef svfloat32_t vfloat; +typedef svint32_t vint2; + +// Double precision definitions +typedef svfloat64_t vdouble; +typedef svint32_t vint; + +typedef svint64_t vint64; +typedef svuint64_t vuint64; + +// Double-double data type with setter/getter functions +typedef svfloat64x2_t vdouble2; +static INLINE vdouble vd2getx_vd_vd2(vdouble2 v) { return svget2_f64(v, 0); } +static INLINE vdouble vd2gety_vd_vd2(vdouble2 v) { return svget2_f64(v, 1); } +static INLINE vdouble2 vd2setxy_vd2_vd_vd(vdouble x, vdouble y) { return svcreate2_f64(x, y); } +static INLINE vdouble2 vd2setx_vd2_vd2_vd(vdouble2 v, vdouble d) { return svset2_f64(v, 0, d); } +static INLINE vdouble2 vd2sety_vd2_vd2_vd(vdouble2 v, vdouble d) { return svset2_f64(v, 1, d); } + +// Double-float data type with setter/getter functions +typedef svfloat32x2_t vfloat2; +static INLINE vfloat vf2getx_vf_vf2(vfloat2 v) { return svget2_f32(v, 0); } +static INLINE vfloat vf2gety_vf_vf2(vfloat2 v) { return svget2_f32(v, 1); } +static INLINE vfloat2 vf2setxy_vf2_vf_vf(vfloat x, vfloat y) { return svcreate2_f32(x, y); } +static INLINE vfloat2 vf2setx_vf2_vf2_vf(vfloat2 v, vfloat d) { return svset2_f32(v, 0, d); } +static INLINE vfloat2 vf2sety_vf2_vf2_vf(vfloat2 v, vfloat d) { return svset2_f32(v, 1, d); } + +typedef svint32x2_t vquad; +static INLINE vmask vqgetx_vm_vq(vquad v) { return svget2_s32(v, 0); } +static INLINE vmask vqgety_vm_vq(vquad v) { return svget2_s32(v, 1); } +static INLINE vquad vqsetxy_vq_vm_vm(vmask x, vmask y) { return svcreate2_s32(x, y); } +static INLINE vquad vqsetx_vq_vq_vm(vquad v, vmask x) { return svset2_s32(v, 0, x); } +static INLINE vquad vqsety_vq_vq_vm(vquad v, vmask y) { return svset2_s32(v, 1, y); } + +typedef vquad vargquad; + +// Auxiliary data types + +typedef svfloat64x2_t di_t; + +static INLINE vdouble digetd_vd_di(di_t d) { return svget2_f64(d, 0); } +static INLINE vint digeti_vi_di(di_t d) { return svreinterpret_s32_f64(svget2_f64(d, 1)); } +static INLINE di_t disetdi_di_vd_vi(vdouble d, vint i) { + return svcreate2_f64(d, svreinterpret_f64_s32(i)); +} + +// + +typedef svfloat32x2_t fi_t; + +static INLINE vfloat figetd_vf_di(fi_t d) { return svget2_f32(d, 0); } +static INLINE vint2 figeti_vi2_di(fi_t d) { return svreinterpret_s32_f32(svget2_f32(d, 1)); } +static INLINE fi_t fisetdi_fi_vf_vi2(vfloat d, vint2 i) { + return svcreate2_f32(d, svreinterpret_f32_s32(i)); +} + +// + +typedef svfloat64x3_t ddi_t; + +static INLINE vdouble2 ddigetdd_vd2_ddi(ddi_t d) { + return svcreate2_f64(svget3_f64(d, 0), svget3_f64(d, 1)); +} +static INLINE vint ddigeti_vi_ddi(ddi_t d) { return svreinterpret_s32_f64(svget3_f64(d, 2)); } +static INLINE ddi_t ddisetddi_ddi_vd2_vi(vdouble2 v, vint i) { + return svcreate3_f64(svget2_f64(v, 0), svget2_f64(v, 1), + svreinterpret_f64_s32(i)); +} +static INLINE ddi_t ddisetdd_ddi_ddi_vd2(ddi_t ddi, vdouble2 v) { + return svcreate3_f64(svget2_f64(v, 0), svget2_f64(v, 1), svget3_f64(ddi, 2)); +} + +// + +typedef svfloat32x3_t dfi_t; + +static INLINE vfloat2 dfigetdf_vf2_dfi(dfi_t d) { + return svcreate2_f32(svget3_f32(d, 0), svget3_f32(d, 1)); +} +static INLINE vint2 dfigeti_vi2_dfi(dfi_t d) { return svreinterpret_s32_f32(svget3_f32(d, 2)); } +static INLINE dfi_t dfisetdfi_dfi_vf2_vi2(vfloat2 v, vint2 i) { + return svcreate3_f32(svget2_f32(v, 0), svget2_f32(v, 1), + svreinterpret_f32_s32(i)); +} +static INLINE dfi_t dfisetdf_dfi_dfi_vf2(dfi_t dfi, vfloat2 v) { + return svcreate3_f32(svget2_f32(v, 0), svget2_f32(v, 1), svget3_f32(dfi, 2)); +} + +// + +typedef svfloat64x4_t dd2; + +static INLINE dd2 dd2setab_dd2_vd2_vd2(vdouble2 a, vdouble2 b) { + return svcreate4_f64(svget2_f64(a, 0), svget2_f64(a, 1), + svget2_f64(b, 0), svget2_f64(b, 1)); +} +static INLINE vdouble2 dd2geta_vd2_dd2(dd2 d) { + return svcreate2_f64(svget4_f64(d, 0), svget4_f64(d, 1)); +} +static INLINE vdouble2 dd2getb_vd2_dd2(dd2 d) { + return svcreate2_f64(svget4_f64(d, 2), svget4_f64(d, 3)); +} + +// + +typedef svfloat32x4_t df2; + +static INLINE df2 df2setab_df2_vf2_vf2(vfloat2 a, vfloat2 b) { + return svcreate4_f32(svget2_f32(a, 0), svget2_f32(a, 1), + svget2_f32(b, 0), svget2_f32(b, 1)); +} +static INLINE vfloat2 df2geta_vf2_df2(df2 d) { + return svcreate2_f32(svget4_f32(d, 0), svget4_f32(d, 1)); +} +static INLINE vfloat2 df2getb_vf2_df2(df2 d) { + return svcreate2_f32(svget4_f32(d, 2), svget4_f32(d, 3)); +} + +// + +typedef svfloat64x3_t vdouble3; + +static INLINE vdouble vd3getx_vd_vd3(vdouble3 v) { return svget3_f64(v, 0); } +static INLINE vdouble vd3gety_vd_vd3(vdouble3 v) { return svget3_f64(v, 1); } +static INLINE vdouble vd3getz_vd_vd3(vdouble3 v) { return svget3_f64(v, 2); } +static INLINE vdouble3 vd3setxyz_vd3_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return svcreate3_f64(x, y, z); } +static INLINE vdouble3 vd3setx_vd3_vd3_vd(vdouble3 v, vdouble d) { return svset3_f64(v, 0, d); } +static INLINE vdouble3 vd3sety_vd3_vd3_vd(vdouble3 v, vdouble d) { return svset3_f64(v, 1, d); } +static INLINE vdouble3 vd3setz_vd3_vd3_vd(vdouble3 v, vdouble d) { return svset3_f64(v, 2, d); } + +// + +typedef svfloat64x4_t tdx; + +static INLINE vmask tdxgete_vm_tdx(tdx t) { + return svreinterpret_s32_f64(svget4_f64(t, 0)); +} +static INLINE vdouble3 tdxgetd3_vd3_tdx(tdx t) { + return svcreate3_f64(svget4_f64(t, 1), svget4_f64(t, 2), svget4_f64(t, 3)); +} +static INLINE vdouble tdxgetd3x_vd_tdx(tdx t) { return svget4_f64(t, 1); } +static INLINE vdouble tdxgetd3y_vd_tdx(tdx t) { return svget4_f64(t, 2); } +static INLINE vdouble tdxgetd3z_vd_tdx(tdx t) { return svget4_f64(t, 3); } +static INLINE tdx tdxsete_tdx_tdx_vm(tdx t, vmask e) { + return svset4_f64(t, 0, svreinterpret_f64_s32(e)); +} +static INLINE tdx tdxsetd3_tdx_tdx_vd3(tdx t, vdouble3 d3) { + return svcreate4_f64(svget4_f64(t, 0), svget3_f64(d3, 0), svget3_f64(d3, 1), svget3_f64(d3, 2)); +} +static INLINE tdx tdxsetx_tdx_tdx_vd(tdx t, vdouble x) { return svset4_f64(t, 1, x); } +static INLINE tdx tdxsety_tdx_tdx_vd(tdx t, vdouble y) { return svset4_f64(t, 2, y); } +static INLINE tdx tdxsetz_tdx_tdx_vd(tdx t, vdouble z) { return svset4_f64(t, 3, z); } +static INLINE tdx tdxsetxyz_tdx_tdx_vd_vd_vd(tdx t, vdouble x, vdouble y, vdouble z) { + return svcreate4_f64(svget4_f64(t, 0), x, y, z); +} + +static INLINE tdx tdxseted3_tdx_vm_vd3(vmask e, vdouble3 d3) { + return svcreate4_f64(svreinterpret_f64_s32(e), svget3_f64(d3, 0), svget3_f64(d3, 1), svget3_f64(d3, 2)); +} +static INLINE tdx tdxsetexyz_tdx_vm_vd_vd_vd(vmask e, vdouble x, vdouble y, vdouble z) { + return svcreate4_f64(svreinterpret_f64_s32(e), x, y, z); +} + +// + +typedef svfloat64x4_t tdi_t; + +static INLINE vdouble3 tdigettd_vd3_tdi(tdi_t d) { + return svcreate3_f64(svget4_f64(d, 0), svget4_f64(d, 1), svget4_f64(d, 2)); +} +static INLINE vdouble tdigetx_vd_tdi(tdi_t d) { return svget4_f64(d, 0); } +static INLINE vint tdigeti_vi_tdi(tdi_t d) { return svreinterpret_s32_f64(svget4_f64(d, 3)); } +static INLINE tdi_t tdisettdi_tdi_vd3_vi(vdouble3 v, vint i) { + return svcreate4_f64(svget3_f64(v, 0), svget3_f64(v, 1), svget3_f64(v, 2), + svreinterpret_f64_s32(i)); +} +static INLINE tdi_t tdisettd_tdi_tdi_vd3(tdi_t tdi, vdouble3 v) { + return svcreate4_f64(svget3_f64(v, 0), svget3_f64(v, 1), svget3_f64(v, 2), svget4_f64(tdi, 3)); +} + +// + +// masking predicates +#define ALL_TRUE_MASK svdup_n_s32(0xffffffff) +#define ALL_FALSE_MASK svdup_n_s32(0x0) +//@#define ALL_TRUE_MASK svdup_n_s32(0xffffffff) +//@#define ALL_FALSE_MASK svdup_n_s32(0x0) + +static INLINE void vprefetch_v_p(const void *ptr) {} + +// +// +// +// Test if all lanes are active +// +// +// +static INLINE int vtestallones_i_vo32(vopmask g) { + svbool_t pg = svptrue_b32(); + return (svcntp_b32(pg, g) == svcntw()); +} + +static INLINE int vtestallones_i_vo64(vopmask g) { + svbool_t pg = svptrue_b64(); + return (svcntp_b64(pg, g) == svcntd()); +} +// +// +// +// +// +// + +// Vector load / store +static INLINE void vstoreu_v_p_vi2(int32_t *p, vint2 v) { svst1_s32(ptrue, p, v); } + +static INLINE vfloat vload_vf_p(const float *ptr) { + return svld1_f32(ptrue, ptr); +} +static INLINE vfloat vloadu_vf_p(const float *ptr) { + return svld1_f32(ptrue, ptr); +} +static INLINE void vstoreu_v_p_vf(float *ptr, vfloat v) { + svst1_f32(ptrue, ptr, v); +} + +// Basic logical operations for mask +static INLINE vmask vand_vm_vm_vm(vmask x, vmask y) { + return svand_s32_x(ptrue, x, y); +} +static INLINE vmask vandnot_vm_vm_vm(vmask x, vmask y) { + return svbic_s32_x(ptrue, y, x); +} +static INLINE vmask vor_vm_vm_vm(vmask x, vmask y) { + return svorr_s32_x(ptrue, x, y); +} +static INLINE vmask vxor_vm_vm_vm(vmask x, vmask y) { + return sveor_s32_x(ptrue, x, y); +} + +static INLINE vmask vadd64_vm_vm_vm(vmask x, vmask y) { + return svreinterpret_s32_s64( + svadd_s64_x(ptrue, svreinterpret_s64_s32(x), + svreinterpret_s64_s32(y))); +} + +// Mask <--> single precision reinterpret +static INLINE vmask vreinterpret_vm_vf(vfloat vf) { + return svreinterpret_s32_f32(vf); +} +static INLINE vfloat vreinterpret_vf_vm(vmask vm) { + return svreinterpret_f32_s32(vm); +} +static INLINE vfloat vreinterpret_vf_vi2(vint2 vm) { + return svreinterpret_f32_s32(vm); +} +static INLINE vint2 vreinterpret_vi2_vf(vfloat vf) { + return svreinterpret_s32_f32(vf); +} +static INLINE vint2 vcast_vi2_vm(vmask vm) { return vm; } +static INLINE vmask vcast_vm_vi2(vint2 vi) { return vi; } + +// Conditional select +static INLINE vint2 vsel_vi2_vm_vi2_vi2(vmask m, vint2 x, vint2 y) { + return svsel_s32(svcmpeq_s32(ptrue, m, ALL_TRUE_MASK), x, y); +} + +/****************************************/ +/* Single precision FP operations */ +/****************************************/ +// Broadcast +static INLINE vfloat vcast_vf_f(float f) { return svdup_n_f32(f); } + +// Add, Sub, Mul +static INLINE vfloat vadd_vf_vf_vf(vfloat x, vfloat y) { + return svadd_f32_x(ptrue, x, y); +} +static INLINE vfloat vsub_vf_vf_vf(vfloat x, vfloat y) { + return svsub_f32_x(ptrue, x, y); +} +static INLINE vfloat vmul_vf_vf_vf(vfloat x, vfloat y) { + return svmul_f32_x(ptrue, x, y); +} + +// |x|, -x +static INLINE vfloat vabs_vf_vf(vfloat f) { return svabs_f32_x(ptrue, f); } +static INLINE vfloat vneg_vf_vf(vfloat f) { return svneg_f32_x(ptrue, f); } + +// max, min +static INLINE vfloat vmax_vf_vf_vf(vfloat x, vfloat y) { + return svmax_f32_x(ptrue, x, y); +} +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { + return svmin_f32_x(ptrue, x, y); +} + +// int <--> float conversions +static INLINE vint2 vtruncate_vi2_vf(vfloat vf) { + return svcvt_s32_f32_x(ptrue, vf); +} +static INLINE vfloat vcast_vf_vi2(vint2 vi) { + return svcvt_f32_s32_x(ptrue, vi); +} +static INLINE vint2 vcast_vi2_i(int i) { return svdup_n_s32(i); } +static INLINE vint2 vrint_vi2_vf(vfloat d) { + return svcvt_s32_f32_x(ptrue, svrintn_f32_x(ptrue, d)); +} + +#if CONFIG == 1 +// Multiply accumulate: z = z + x * y +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return svmad_f32_x(ptrue, x, y, z); +} +// Multiply subtract: z = z - x * y +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return svmsb_f32_x(ptrue, x, y, z); +} +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { + return svnmsb_f32_x(ptrue, x, y, z); +} +#else +static INLINE vfloat vmla_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +static INLINE vfloat vmlanp_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(z, vmul_vf_vf_vf(x, y)); } +static INLINE vfloat vmlapn_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsub_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } +#endif + +// fused multiply add / sub +static INLINE vfloat vfma_vf_vf_vf_vf(vfloat x, vfloat y, + vfloat z) { // z + x * y + return svmad_f32_x(ptrue, x, y, z); +} +static INLINE vfloat vfmanp_vf_vf_vf_vf(vfloat x, vfloat y, + vfloat z) { // z - x * y + return svmsb_f32_x(ptrue, x, y, z); +} +static INLINE vfloat vfmapn_vf_vf_vf_vf(vfloat x, vfloat y, + vfloat z) { // x * y - z + return svnmsb_f32_x(ptrue, x, y, z); +} + +// conditional select +static INLINE vfloat vsel_vf_vo_vf_vf(vopmask mask, vfloat x, vfloat y) { + return svsel_f32(mask, x, y); +} + +// Reciprocal 1/x, Division, Square root +static INLINE vfloat vdiv_vf_vf_vf(vfloat n, vfloat d) { +#ifndef SLEEF_ENABLE_ALTDIV + return svdiv_f32_x(ptrue, n, d); +#else + // Finite numbers (including denormal) only, gives mostly correctly rounded result + vfloat t, u, x, y; + svuint32_t i0, i1; + i0 = svand_u32_x(ptrue, svreinterpret_u32_f32(n), svdup_n_u32(0x7c000000)); + i1 = svand_u32_x(ptrue, svreinterpret_u32_f32(d), svdup_n_u32(0x7c000000)); + i0 = svsub_u32_x(ptrue, svdup_n_u32(0x7d000000), svlsr_n_u32_x(ptrue, svadd_u32_x(ptrue, i0, i1), 1)); + t = svreinterpret_f32_u32(i0); + y = svmul_f32_x(ptrue, d, t); + x = svmul_f32_x(ptrue, n, t); + t = svrecpe_f32(y); + t = svmul_f32_x(ptrue, t, svrecps_f32(y, t)); + t = svmul_f32_x(ptrue, t, svrecps_f32(y, t)); + u = svmul_f32_x(ptrue, x, t); + u = svmad_f32_x(ptrue, svmsb_f32_x(ptrue, y, u, x), t, u); + return u; +#endif +} +static INLINE vfloat vrec_vf_vf(vfloat d) { +#ifndef SLEEF_ENABLE_ALTDIV + return svdivr_n_f32_x(ptrue, d, 1.0f); +#else + return vsel_vf_vo_vf_vf(svcmpeq_f32(ptrue, vabs_vf_vf(d), vcast_vf_f(SLEEF_INFINITYf)), + vcast_vf_f(0), vdiv_vf_vf_vf(vcast_vf_f(1.0f), d)); +#endif +} +static INLINE vfloat vsqrt_vf_vf(vfloat d) { +#ifndef SLEEF_ENABLE_ALTSQRT + return svsqrt_f32_x(ptrue, d); +#else + // Gives correctly rounded result for all input range + vfloat w, x, y, z; + + y = svrsqrte_f32(d); + x = vmul_vf_vf_vf(d, y); w = vmul_vf_vf_vf(vcast_vf_f(0.5), y); + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(0.5)); + x = vfma_vf_vf_vf_vf(x, y, x); w = vfma_vf_vf_vf_vf(w, y, w); + + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(1.5)); w = vadd_vf_vf_vf(w, w); + w = vmul_vf_vf_vf(w, y); + x = vmul_vf_vf_vf(w, d); + y = vfmapn_vf_vf_vf_vf(w, d, x); z = vfmanp_vf_vf_vf_vf(w, x, vcast_vf_f(1)); + z = vfmanp_vf_vf_vf_vf(w, y, z); w = vmul_vf_vf_vf(vcast_vf_f(0.5), x); + w = vfma_vf_vf_vf_vf(w, z, y); + w = vadd_vf_vf_vf(w, x); + + return svsel_f32(svorr_b_z(ptrue, svcmpeq_f32(ptrue, d, vcast_vf_f(0)), + svcmpeq_f32(ptrue, d, vcast_vf_f(SLEEF_INFINITYf))), d, w); +#endif +} +// +// +// +// +// +// +static INLINE CONST vfloat vsel_vf_vo_f_f(vopmask o, float v1, float v0) { + return vsel_vf_vo_vf_vf(o, vcast_vf_f(v1), vcast_vf_f(v0)); +} + +static INLINE vfloat vsel_vf_vo_vo_f_f_f(vopmask o0, vopmask o1, float d0, float d1, float d2) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_f_f(o1, d1, d2)); +} + +static INLINE vfloat vsel_vf_vo_vo_vo_f_f_f_f(vopmask o0, vopmask o1, vopmask o2, float d0, float d1, float d2, float d3) { + return vsel_vf_vo_vf_vf(o0, vcast_vf_f(d0), vsel_vf_vo_vf_vf(o1, vcast_vf_f(d1), vsel_vf_vo_f_f(o2, d2, d3))); +} +// +// +// +// +// +// + +// truncate +static INLINE vfloat vtruncate_vf_vf(vfloat vd) { + return svrintz_f32_x(ptrue, vd); +} + +// +// +// +// Round float +// +// +// +static INLINE vfloat vrint_vf_vf(vfloat vf) { + return svrintn_f32_x(svptrue_b32(), vf); +} +// +// +// +// +// +// + +/***************************************/ +/* Single precision integer operations */ +/***************************************/ + +// Add, Sub, Neg (-x) +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { + return svadd_s32_x(ptrue, x, y); +} +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { + return svsub_s32_x(ptrue, x, y); +} +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return svneg_s32_x(ptrue, e); } + +// Logical operations +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { + return svand_s32_x(ptrue, x, y); +} +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { + return svbic_s32_x(ptrue, y, x); +} +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { + return svorr_s32_x(ptrue, x, y); +} +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { + return sveor_s32_x(ptrue, x, y); +} + +// Shifts +#define vsll_vi2_vi2_i(x, c) svlsl_n_s32_x(ptrue, x, c) +//@#define vsll_vi2_vi2_i(x, c) svlsl_n_s32_x(ptrue, x, c) +#define vsrl_vi2_vi2_i(x, c) \ + svreinterpret_s32_u32(svlsr_n_u32_x(ptrue, svreinterpret_u32_s32(x), c)) +//@#define vsrl_vi2_vi2_i(x, c) svreinterpret_s32_u32(svlsr_n_u32_x(ptrue, svreinterpret_u32_s32(x), c)) +#define vsra_vi2_vi2_i(x, c) svasr_n_s32_x(ptrue, x, c) +//@#define vsra_vi2_vi2_i(x, c) svasr_n_s32_x(ptrue, x, c) + +// Comparison returning integers +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { + return svsel_s32(svcmpgt_s32(ptrue, x, y), ALL_TRUE_MASK, ALL_FALSE_MASK); +} + +// conditional select +static INLINE vint2 vsel_vi2_vo_vi2_vi2(vopmask m, vint2 x, vint2 y) { + return svsel_s32(m, x, y); +} + +/****************************************/ +/* opmask operations */ +/****************************************/ +// single precision FP +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { + return svcmpeq_f32(ptrue, x, y); +} +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { + return svcmpne_f32(ptrue, x, y); +} +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { + return svcmplt_f32(ptrue, x, y); +} +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { + return svcmple_f32(ptrue, x, y); +} +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { + return svcmpgt_f32(ptrue, x, y); +} +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { + return svcmpge_f32(ptrue, x, y); +} +static INLINE vopmask visinf_vo_vf(vfloat d) { + return svcmpeq_n_f32(ptrue, vabs_vf_vf(d), SLEEF_INFINITYf); +} +static INLINE vopmask vispinf_vo_vf(vfloat d) { + return svcmpeq_n_f32(ptrue, d, SLEEF_INFINITYf); +} +static INLINE vopmask visminf_vo_vf(vfloat d) { + return svcmpeq_n_f32(ptrue, d, -SLEEF_INFINITYf); +} +static INLINE vopmask visnan_vo_vf(vfloat d) { return vneq_vo_vf_vf(d, d); } + +// integers +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { + return svcmpeq_s32(ptrue, x, y); +} +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { + return svcmpgt_s32(ptrue, x, y); +} + +// logical opmask +static INLINE vopmask vand_vo_vo_vo(vopmask x, vopmask y) { + return svand_b_z(ptrue, x, y); +} +static INLINE vopmask vandnot_vo_vo_vo(vopmask x, vopmask y) { + return svbic_b_z(ptrue, y, x); +} +static INLINE vopmask vor_vo_vo_vo(vopmask x, vopmask y) { + return svorr_b_z(ptrue, x, y); +} +static INLINE vopmask vxor_vo_vo_vo(vopmask x, vopmask y) { + return sveor_b_z(ptrue, x, y); +} + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { + // This needs to be zeroing to prevent asinf and atanf denormal test + // failing. + return svand_s32_z(x, y, y); +} + +// bitmask logical operations +static INLINE vmask vand_vm_vo32_vm(vopmask x, vmask y) { + return svsel_s32(x, y, ALL_FALSE_MASK); +} +static INLINE vmask vandnot_vm_vo32_vm(vopmask x, vmask y) { + return svsel_s32(x, ALL_FALSE_MASK, y); +} +static INLINE vmask vor_vm_vo32_vm(vopmask x, vmask y) { + return svsel_s32(x, ALL_TRUE_MASK, y); +} + +// broadcast bitmask +static INLINE vmask vcast_vm_i_i(int i0, int i1) { + return svreinterpret_s32_u64( + svdup_n_u64((0xffffffff & (uint64_t)i1) | (((uint64_t)i0) << 32))); +} + +static INLINE vmask vcast_vm_i64(int64_t i) { + return svreinterpret_s32_u64(svdup_n_u64((uint64_t)i)); +} +static INLINE vmask vcast_vm_u64(uint64_t i) { + return svreinterpret_s32_u64(svdup_n_u64(i)); +} + +/*********************************/ +/* SVE for double precision math */ +/*********************************/ + +// Vector load/store +static INLINE vdouble vload_vd_p(const double *ptr) { + return svld1_f64(ptrue, ptr); +} +static INLINE vdouble vloadu_vd_p(const double *ptr) { + return svld1_f64(ptrue, ptr); +} +static INLINE void vstoreu_v_p_vd(double *ptr, vdouble v) { + svst1_f64(ptrue, ptr, v); +} + +static INLINE void vstoreu_v_p_vi(int *ptr, vint v) { + svst1w_s64(ptrue, ptr, svreinterpret_s64_s32(v)); +} +static vint vloadu_vi_p(int32_t *p) { + return svreinterpret_s32_s64(svld1uw_s64(ptrue, (uint32_t *)p)); +} + +// Reinterpret +static INLINE vdouble vreinterpret_vd_vm(vmask vm) { + return svreinterpret_f64_s32(vm); +} +static INLINE vmask vreinterpret_vm_vd(vdouble vd) { + return svreinterpret_s32_f64(vd); +} +static INLINE vint2 vcastu_vm_vi(vint x) { + return svreinterpret_s32_s64( + svlsl_n_s64_x(ptrue, svreinterpret_s64_s32(x), 32)); +} +static INLINE vint vcastu_vi_vm(vint2 x) { + return svreinterpret_s32_u64( + svlsr_n_u64_x(ptrue, svreinterpret_u64_s32(x), 32)); +} +static INLINE vdouble vcast_vd_vi(vint vi) { + return svcvt_f64_s32_x(ptrue, vi); +} + +// Splat +static INLINE vdouble vcast_vd_d(double d) { return svdup_n_f64(d); } + +// Conditional select +static INLINE vdouble vsel_vd_vo_vd_vd(vopmask o, vdouble x, vdouble y) { + return svsel_f64(o, x, y); +} + +static INLINE CONST vdouble vsel_vd_vo_d_d(vopmask o, double v1, double v0) { + return vsel_vd_vo_vd_vd(o, vcast_vd_d(v1), vcast_vd_d(v0)); +} + +static INLINE vdouble vsel_vd_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_d_d(o1, d1, d2)); +} + +static INLINE vdouble vsel_vd_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vd_vo_vd_vd(o0, vcast_vd_d(d0), vsel_vd_vo_vd_vd(o1, vcast_vd_d(d1), vsel_vd_vo_d_d(o2, d2, d3))); +} + +static INLINE vint vsel_vi_vo_vi_vi(vopmask o, vint x, vint y) { + return svsel_s32(o, x, y); +} +// truncate +static INLINE vdouble vtruncate_vd_vd(vdouble vd) { + return svrintz_f64_x(ptrue, vd); +} +static INLINE vint vtruncate_vi_vd(vdouble vd) { + return svcvt_s32_f64_x(ptrue, vd); +} +static INLINE vint vrint_vi_vd(vdouble vd) { + return svcvt_s32_f64_x(ptrue, svrintn_f64_x(ptrue, vd)); +} +static INLINE vdouble vrint_vd_vd(vdouble vd) { + return svrintn_f64_x(ptrue, vd); +} + +// FP math operations +static INLINE vdouble vadd_vd_vd_vd(vdouble x, vdouble y) { + return svadd_f64_x(ptrue, x, y); +} +static INLINE vdouble vsub_vd_vd_vd(vdouble x, vdouble y) { + return svsub_f64_x(ptrue, x, y); +} +static INLINE vdouble vneg_vd_vd(vdouble x) { return svneg_f64_x(ptrue, x); } +static INLINE vdouble vmul_vd_vd_vd(vdouble x, vdouble y) { + return svmul_f64_x(ptrue, x, y); +} +static INLINE vdouble vabs_vd_vd(vdouble x) { return svabs_f64_x(ptrue, x); } +static INLINE vdouble vmax_vd_vd_vd(vdouble x, vdouble y) { + return svmax_f64_x(ptrue, x, y); +} +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { + return svmin_f64_x(ptrue, x, y); +} + +#if CONFIG == 1 +// Multiply accumulate / subtract +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, + vdouble z) { // z = x*y + z + return svmad_f64_x(ptrue, x, y, z); +} +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, + vdouble z) { // z = x * y - z + return svnmsb_f64_x(ptrue, x, y, z); +} +static INLINE vdouble vmlanp_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + return svmsb_f64_x(ptrue, x, y, z); +} +#else +static INLINE vdouble vmla_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +static INLINE vdouble vmlapn_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsub_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } +#endif + +static INLINE vdouble vfma_vd_vd_vd_vd(vdouble x, vdouble y, + vdouble z) { // z + x * y + return svmad_f64_x(ptrue, x, y, z); +} +static INLINE vdouble vfmanp_vd_vd_vd_vd(vdouble x, vdouble y, + vdouble z) { // z - x * y + return svmsb_f64_x(ptrue, x, y, z); +} +static INLINE vdouble vfmapn_vd_vd_vd_vd(vdouble x, vdouble y, + vdouble z) { // x * y - z + return svnmsb_f64_x(ptrue, x, y, z); +} + +// Reciprocal 1/x, Division, Square root +static INLINE vdouble vdiv_vd_vd_vd(vdouble n, vdouble d) { +#ifndef SLEEF_ENABLE_ALTDIV + return svdiv_f64_x(ptrue, n, d); +#else + // Finite numbers (including denormal) only, gives mostly correctly rounded result + vdouble t, u, x, y; + svuint64_t i0, i1; + i0 = svand_u64_x(ptrue, svreinterpret_u64_f64(n), svdup_n_u64(0x7fc0000000000000L)); + i1 = svand_u64_x(ptrue, svreinterpret_u64_f64(d), svdup_n_u64(0x7fc0000000000000L)); + i0 = svsub_u64_x(ptrue, svdup_n_u64(0x7fd0000000000000L), svlsr_n_u64_x(ptrue, svadd_u64_x(ptrue, i0, i1), 1)); + t = svreinterpret_f64_u64(i0); + y = svmul_f64_x(ptrue, d, t); + x = svmul_f64_x(ptrue, n, t); + t = svrecpe_f64(y); + t = svmul_f64_x(ptrue, t, svrecps_f64(y, t)); + t = svmul_f64_x(ptrue, t, svrecps_f64(y, t)); + t = svmul_f64_x(ptrue, t, svrecps_f64(y, t)); + u = svmul_f64_x(ptrue, x, t); + u = svmad_f64_x(ptrue, svmsb_f64_x(ptrue, y, u, x), t, u); + return u; +#endif +} +static INLINE vdouble vrec_vd_vd(vdouble d) { +#ifndef SLEEF_ENABLE_ALTDIV + return svdivr_n_f64_x(ptrue, d, 1.0); +#else + return vsel_vd_vo_vd_vd(svcmpeq_f64(ptrue, vabs_vd_vd(d), vcast_vd_d(SLEEF_INFINITY)), + vcast_vd_d(0), vdiv_vd_vd_vd(vcast_vd_d(1.0f), d)); +#endif +} +static INLINE vdouble vsqrt_vd_vd(vdouble d) { +#ifndef SLEEF_ENABLE_ALTSQRT + return svsqrt_f64_x(ptrue, d); +#else + // Gives correctly rounded result for all input range + vdouble w, x, y, z; + + y = svrsqrte_f64(d); + x = vmul_vd_vd_vd(d, y); w = vmul_vd_vd_vd(vcast_vd_d(0.5), y); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(1.5)); w = vadd_vd_vd_vd(w, w); + w = vmul_vd_vd_vd(w, y); + x = vmul_vd_vd_vd(w, d); + y = vfmapn_vd_vd_vd_vd(w, d, x); z = vfmanp_vd_vd_vd_vd(w, x, vcast_vd_d(1)); + z = vfmanp_vd_vd_vd_vd(w, y, z); w = vmul_vd_vd_vd(vcast_vd_d(0.5), x); + w = vfma_vd_vd_vd_vd(w, z, y); + w = vadd_vd_vd_vd(w, x); + + return svsel_f64(svorr_b_z(ptrue, svcmpeq_f64(ptrue, d, vcast_vd_d(0)), + svcmpeq_f64(ptrue, d, vcast_vd_d(SLEEF_INFINITY))), d, w); +#endif +} + +// Float comparison +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { + return svcmplt_f64(ptrue, x, y); +} +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { + return svcmpeq_f64(ptrue, x, y); +} +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { + return svcmpgt_f64(ptrue, x, y); +} +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { + return svcmpge_f64(ptrue, x, y); +} +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { + return svcmpne_f64(ptrue, x, y); +} +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { + return svcmple_f64(ptrue, x, y); +} + +// predicates +static INLINE vopmask visnan_vo_vd(vdouble vd) { + return svcmpne_f64(ptrue, vd, vd); +} +static INLINE vopmask visinf_vo_vd(vdouble vd) { + return svcmpeq_n_f64(ptrue, svabs_f64_x(ptrue, vd), SLEEF_INFINITY); +} +static INLINE vopmask vispinf_vo_vd(vdouble vd) { + return svcmpeq_n_f64(ptrue, vd, SLEEF_INFINITY); +} +static INLINE vopmask visminf_vo_vd(vdouble vd) { + return svcmpeq_n_f64(ptrue, vd, -SLEEF_INFINITY); +} + +// Comparing bit masks +static INLINE vopmask veq64_vo_vm_vm(vmask x, vmask y) { + return svcmpeq_s64(ptrue, svreinterpret_s64_s32(x), svreinterpret_s64_s32(y)); +} + +// pure predicate operations +static INLINE vopmask vcast_vo32_vo64(vopmask o) { return o; } +static INLINE vopmask vcast_vo64_vo32(vopmask o) { return o; } +static INLINE vopmask vcast_vo_i(int i) { return svcmpne_s32(ptrue, svdup_n_s32(i), svdup_n_s32(0)); } + +// logical integer operations +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { + // This needs to be a zeroing instruction because we need to make + // sure that the inactive elements for the unpacked integers vector + // are zero. + return svand_s32_z(x, y, y); +} + +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { + return svsel_s32(x, ALL_FALSE_MASK, y); +} +#define vsra_vi_vi_i(x, c) svasr_n_s32_x(ptrue, x, c) +//@#define vsra_vi_vi_i(x, c) svasr_n_s32_x(ptrue, x, c) +#define vsll_vi_vi_i(x, c) svlsl_n_s32_x(ptrue, x, c) +//@#define vsll_vi_vi_i(x, c) svlsl_n_s32_x(ptrue, x, c) + +static INLINE vint vsrl_vi_vi_i(vint x, int c) { + return svreinterpret_s32_u32(svlsr_n_u32_x(ptrue, svreinterpret_u32_s32(x), c)); +} + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { + return svand_s32_x(ptrue, x, y); +} +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { + return svbic_s32_x(ptrue, y, x); +} +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { + return sveor_s32_x(ptrue, x, y); +} + +// integer math +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { + return svadd_s32_x(ptrue, x, y); +} +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { + return svsub_s32_x(ptrue, x, y); +} +static INLINE vint vneg_vi_vi(vint x) { return svneg_s32_x(ptrue, x); } + +// integer comparison +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { + return svcmpgt_s32(ptrue, x, y); +} +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { + return svcmpeq_s32(ptrue, x, y); +} + +// Splat +static INLINE vint vcast_vi_i(int i) { return svdup_n_s32(i); } + +// bitmask logical operations +static INLINE vmask vand_vm_vo64_vm(vopmask x, vmask y) { + // This needs to be a zeroing instruction because we need to make + // sure that the inactive elements for the unpacked integers vector + // are zero. + return svreinterpret_s32_s64( + svand_s64_z(x, svreinterpret_s64_s32(y), svreinterpret_s64_s32(y))); +} +static INLINE vmask vandnot_vm_vo64_vm(vopmask x, vmask y) { + return svreinterpret_s32_s64(svsel_s64( + x, svreinterpret_s64_s32(ALL_FALSE_MASK), svreinterpret_s64_s32(y))); +} +static INLINE vmask vor_vm_vo64_vm(vopmask x, vmask y) { + return svreinterpret_s32_s64(svsel_s64( + x, svreinterpret_s64_s32(ALL_TRUE_MASK), svreinterpret_s64_s32(y))); +} + +static INLINE vfloat vrev21_vf_vf(vfloat vf) { + return svreinterpret_f32_u64(svrevw_u64_x(ptrue, svreinterpret_u64_f32(vf))); +} + +// Comparison returning integer +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { + return svsel_s32(svcmpeq_s32(ptrue, x, y), ALL_TRUE_MASK, ALL_FALSE_MASK); +} + +// Gather + +static INLINE vdouble vgather_vd_p_vi(const double *ptr, vint vi) { + return svld1_gather_s64index_f64(ptrue, ptr, svreinterpret_s64_s32(vi)); +} + +static INLINE vfloat vgather_vf_p_vi2(const float *ptr, vint2 vi2) { + return svld1_gather_s32index_f32(ptrue, ptr, vi2); +} + +// Operations for DFT + +static INLINE vdouble vposneg_vd_vd(vdouble d) { + return svneg_f64_m(d, svdupq_n_b64(0, 1), d); +} + +static INLINE vdouble vnegpos_vd_vd(vdouble d) { + return svneg_f64_m(d, svdupq_n_b64(1, 0), d); +} + +static INLINE vfloat vposneg_vf_vf(vfloat d) { + return svneg_f32_m(d, svdupq_n_b32(0, 1, 0, 1), d); +} + +static INLINE vfloat vnegpos_vf_vf(vfloat d) { + return svneg_f32_m(d, svdupq_n_b32(1, 0, 1, 0), d); +} + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE vfloat vsubadd_vf_vf_vf(vfloat d0, vfloat d1) { return vadd_vf_vf_vf(d0, vnegpos_vf_vf(d1)); } +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vfma_vd_vd_vd_vd(x, y, vnegpos_vd_vd(z)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vfma_vf_vf_vf_vf(x, y, vnegpos_vf_vf(z)); } + +// + +static INLINE vdouble vrev21_vd_vd(vdouble x) { return svzip1_f64(svuzp2_f64(x, x), svuzp1_f64(x, x)); } + +static INLINE vdouble vreva2_vd_vd(vdouble vd) { + svint64_t x = svindex_s64((VECTLENDP-1), -1); + x = svzip1_s64(svuzp2_s64(x, x), svuzp1_s64(x, x)); + return svtbl_f64(vd, svreinterpret_u64_s64(x)); +} + +static INLINE vfloat vreva2_vf_vf(vfloat vf) { + svint32_t x = svindex_s32((VECTLENSP-1), -1); + x = svzip1_s32(svuzp2_s32(x, x), svuzp1_s32(x, x)); + return svtbl_f32(vf, svreinterpret_u32_s32(x)); +} + +// + +static INLINE void vscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { + svst1_scatter_u64index_f64(ptrue, ptr + offset*2, svzip1_u64(svindex_u64(0, step*2), svindex_u64(1, step*2)), v); +} + +static INLINE void vscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { + svst1_scatter_u32index_f32(ptrue, ptr + offset*2, svzip1_u32(svindex_u32(0, step*2), svindex_u32(1, step*2)), v); +} + +static INLINE void vstore_v_p_vd(double *ptr, vdouble v) { vstoreu_v_p_vd(ptr, v); } +static INLINE void vstream_v_p_vd(double *ptr, vdouble v) { vstore_v_p_vd(ptr, v); } +static INLINE void vstore_v_p_vf(float *ptr, vfloat v) { vstoreu_v_p_vf(ptr, v); } +static INLINE void vstream_v_p_vf(float *ptr, vfloat v) { vstore_v_p_vf(ptr, v); } +static INLINE void vsscatter2_v_p_i_i_vd(double *ptr, int offset, int step, vdouble v) { vscatter2_v_p_i_i_vd(ptr, offset, step, v); } +static INLINE void vsscatter2_v_p_i_i_vf(float *ptr, int offset, int step, vfloat v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +// These functions are for debugging +static double vcast_d_vd(vdouble v) { + double a[svcntd()]; + vstoreu_v_p_vd(a, v); + return a[0]; +} + +static float vcast_f_vf(vfloat v) { + float a[svcntw()]; + vstoreu_v_p_vf(a, v); + return a[0]; +} + +static int vcast_i_vi(vint v) { + int a[svcntw()]; + vstoreu_v_p_vi(a, v); + return a[0]; +} + +static int vcast_i_vi2(vint2 v) { + int a[svcntw()]; + vstoreu_v_p_vi2(a, v); + return a[0]; +} + +// + +static vquad loadu_vq_p(const int32_t *ptr) { + int32_t a[svcntw()*2]; + memcpy(a, ptr, svcntw()*8); + return svld2_s32(ptrue, a); +} + +static INLINE vquad cast_vq_aq(vargquad aq) { return aq; } +static INLINE vargquad cast_aq_vq(vquad vq) { return vq; } + +static INLINE int vtestallzeros_i_vo64(vopmask g) { + return svcntp_b64(svptrue_b64(), g) == 0; +} + +static INLINE vmask vsel_vm_vo64_vm_vm(vopmask o, vmask x, vmask y) { + return svreinterpret_s32_s64(svsel_s64(o, svreinterpret_s64_s32(x), svreinterpret_s64_s32(y))); +} + +static INLINE vmask vsub64_vm_vm_vm(vmask x, vmask y) { + return svreinterpret_s32_s64( + svsub_s64_x(ptrue, svreinterpret_s64_s32(x), + svreinterpret_s64_s32(y))); +} + +static INLINE vmask vneg64_vm_vm(vmask x) { + return svreinterpret_s32_s64(svneg_s64_x(ptrue, svreinterpret_s64_s32(x))); +} + +static INLINE vopmask vgt64_vo_vm_vm(vmask x, vmask y) { + return svcmpgt_s64(ptrue, svreinterpret_s64_s32(x), svreinterpret_s64_s32(y)); +} + +#define vsll64_vm_vm_i(x, c) svreinterpret_s32_u64(svlsl_n_u64_x(ptrue, svreinterpret_u64_s32(x), c)) +//@#define vsll64_vm_vm_i(x, c) svreinterpret_s32_u64(svlsl_n_u64_x(ptrue, svreinterpret_u64_s32(x), c)) +#define vsrl64_vm_vm_i(x, c) svreinterpret_s32_u64(svlsr_n_u64_x(ptrue, svreinterpret_u64_s32(x), c)) +//@#define vsrl64_vm_vm_i(x, c) svreinterpret_s32_u64(svlsr_n_u64_x(ptrue, svreinterpret_u64_s32(x), c)) + +static INLINE vmask vcast_vm_vi(vint vi) { return svreinterpret_s32_s64(svextw_s64_z(ptrue, svreinterpret_s64_s32(vi))); } +static INLINE vint vcast_vi_vm(vmask vm) { return vand_vm_vm_vm(vm, vcast_vm_i_i(0, 0xffffffff)); } + +static INLINE vmask vreinterpret_vm_vi64(vint64 v) { return svreinterpret_s32_s64(v); } +static INLINE vint64 vreinterpret_vi64_vm(vmask m) { return svreinterpret_s64_s32(m); } +static INLINE vmask vreinterpret_vm_vu64(vuint64 v) { return svreinterpret_s32_u64(v); } +static INLINE vuint64 vreinterpret_vu64_vm(vmask m) { return svreinterpret_u64_s32(m); } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpervecext.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpervecext.h new file mode 100644 index 0000000000000..3f079317f0b63 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/arch/helpervecext.h @@ -0,0 +1,871 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include "misc.h" + +#ifndef CONFIG +#error CONFIG macro not defined +#endif + +#define ENABLE_DP +#define ENABLE_SP + +#define LOG2VECTLENDP CONFIG +#define VECTLENDP (1 << LOG2VECTLENDP) +#define LOG2VECTLENSP (LOG2VECTLENDP+1) +#define VECTLENSP (1 << LOG2VECTLENSP) + +#define DFTPRIORITY LOG2VECTLENDP + +#if defined(__clang__) +#define ISANAME "Clang Vector Extension" + +typedef uint32_t vmask __attribute__((ext_vector_type(VECTLENDP*2))); +typedef uint32_t vopmask __attribute__((ext_vector_type(VECTLENDP*2))); + +typedef double vdouble __attribute__((ext_vector_type(VECTLENDP))); +typedef int32_t vint __attribute__((ext_vector_type(VECTLENDP))); + +typedef float vfloat __attribute__((ext_vector_type(VECTLENDP*2))); +typedef int32_t vint2 __attribute__((ext_vector_type(VECTLENDP*2))); + +#ifdef ENABLE_LONGDOUBLE +typedef uint8_t vmaskl __attribute__((ext_vector_type(sizeof(long double)*VECTLENDP))); +typedef long double vlongdouble __attribute__((ext_vector_type(VECTLENDP))); +#endif + +#if defined(Sleef_quad2_DEFINED) && defined(ENABLEFLOAT128) +typedef uint8_t vmaskq __attribute__((ext_vector_type(sizeof(Sleef_quad)*VECTLENDP))); +#ifdef ENABLE_LONGDOUBLE +typedef Sleef_quad vquad __attribute__((ext_vector_type(VECTLENDP))); +#endif +#endif +#elif defined(__GNUC__) +#define ISANAME "GCC Vector Extension" + +typedef uint32_t vmask __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP*2))); +typedef uint32_t vopmask __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP*2))); + +typedef double vdouble __attribute__((vector_size(sizeof(double)*VECTLENDP))); +typedef int32_t vint __attribute__((vector_size(sizeof(int32_t)*VECTLENDP))); + +typedef float vfloat __attribute__((vector_size(sizeof(float)*VECTLENDP*2))); +typedef int32_t vint2 __attribute__((vector_size(sizeof(int32_t)*VECTLENDP*2))); + +#ifdef ENABLE_LONGDOUBLE +typedef uint8_t vmaskl __attribute__((vector_size(sizeof(long double)*VECTLENDP))); +typedef long double vlongdouble __attribute__((vector_size(sizeof(long double)*VECTLENDP))); +#endif + +#if defined(Sleef_quad2_DEFINED) && defined(ENABLEFLOAT128) +typedef uint8_t vmaskq __attribute__((vector_size(sizeof(Sleef_quad)*VECTLENDP))); +typedef Sleef_quad vquad __attribute__((vector_size(sizeof(Sleef_quad)*VECTLENDP))); +#endif +#endif + +// + +#if VECTLENDP == 2 +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return (vopmask){ m[1], m[3], 0, 0 }; } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return (vopmask){ m[0], m[0], m[1], m[1] }; } + +static INLINE vint vcast_vi_i(int i) { return (vint) { i, i }; } +static INLINE vint2 vcast_vi2_i(int i) { return (vint2) { i, i, i, i }; } +static INLINE vfloat vcast_vf_f(float f) { return (vfloat) { f, f, f, f }; } +static INLINE vdouble vcast_vd_d(double d) { return (vdouble) { d, d }; } +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vcast_vl_l(long double d) { return (vlongdouble) { d, d }; } +#endif +#if defined(Sleef_quad2_DEFINED) && defined(ENABLEFLOAT128) +static INLINE vquad vcast_vq_q(Sleef_quad d) { return (vquad) { d, d }; } +#endif + +static INLINE vmask vcast_vm_i_i(int h, int l) { return (vmask){ l, h, l, h }; } +static INLINE vint2 vcastu_vi2_vi(vint vi) { return (vint2){ 0, vi[0], 0, vi[1] }; } +static INLINE vint vcastu_vi_vi2(vint2 vi2) { return (vint){ vi2[1], vi2[3] }; } + +static INLINE vint vreinterpretFirstHalf_vi_vi2(vint2 vi2) { return (vint){ vi2[0], vi2[1] }; } +static INLINE vint2 vreinterpretFirstHalf_vi2_vi(vint vi) { return (vint2){ vi[0], vi[1], 0, 0 }; } + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { return (vdouble) { vd[1], vd[0] }; } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return vd; } +static INLINE vfloat vrev21_vf_vf(vfloat vd) { return (vfloat) { vd[1], vd[0], vd[3], vd[2] }; } +static INLINE vfloat vreva2_vf_vf(vfloat vd) { return (vfloat) { vd[2], vd[3], vd[0], vd[1] }; } +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vrev21_vl_vl(vlongdouble vd) { return (vlongdouble) { vd[1], vd[0] }; } +static INLINE vlongdouble vreva2_vl_vl(vlongdouble vd) { return vd; } +static INLINE vlongdouble vposneg_vl_vl(vlongdouble vd) { return (vlongdouble) { +vd[0], -vd[1] }; } +static INLINE vlongdouble vnegpos_vl_vl(vlongdouble vd) { return (vlongdouble) { -vd[0], +vd[1] }; } +#endif + +#if defined(Sleef_quad2_DEFINED) && defined(ENABLEFLOAT128) +static INLINE vquad vrev21_vq_vq(vquad vd) { return (vquad) { vd[1], vd[0] }; } +static INLINE vquad vreva2_vq_vq(vquad vd) { return vd; } +static INLINE vquad vposneg_vq_vq(vquad vd) { return (vquad) { +vd[0], -vd[1] }; } +static INLINE vquad vnegpos_vq_vq(vquad vd) { return (vquad) { -vd[0], +vd[1] }; } +#endif + +#define PNMASK ((vdouble) { +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0 }) +static INLINE vdouble vposneg_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)PNMASK); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)NPMASK); } + +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f }) +static INLINE vfloat vposneg_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)PNMASKf); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)NPMASKf); } +#elif VECTLENDP == 4 +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return (vopmask){ m[1], m[3], m[5], m[7], 0, 0, 0, 0 }; } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return (vopmask){ m[0], m[0], m[1], m[1], m[2], m[2], m[3], m[3] }; } + +static INLINE vint vcast_vi_i(int i) { return (vint) { i, i, i, i }; } +static INLINE vint2 vcast_vi2_i(int i) { return (vint2) { i, i, i, i, i, i, i, i }; } +static INLINE vfloat vcast_vf_f(float f) { return (vfloat) { f, f, f, f, f, f, f, f }; } +static INLINE vdouble vcast_vd_d(double d) { return (vdouble) { d, d, d, d }; } +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vcast_vl_l(long double d) { return (vlongdouble) { d, d, d, d }; } +#endif + +static INLINE vmask vcast_vm_i_i(int h, int l) { return (vmask){ l, h, l, h, l, h, l, h }; } +static INLINE vint2 vcastu_vi2_vi(vint vi) { return (vint2){ 0, vi[0], 0, vi[1], 0, vi[2], 0, vi[3] }; } +static INLINE vint vcastu_vi_vi2(vint2 vi2) { return (vint){ vi2[1], vi2[3], vi2[5], vi2[7] }; } + +static INLINE vint vreinterpretFirstHalf_vi_vi2(vint2 vi2) { return (vint){ vi2[0], vi2[1], vi2[2], vi2[3] }; } +static INLINE vint2 vreinterpretFirstHalf_vi2_vi(vint vi) { return (vint2){ vi[0], vi[1], vi[2], vi[3], 0, 0, 0, 0 }; } + +#define PNMASK ((vdouble) { +0.0, -0.0, +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0, -0.0, +0.0 }) +static INLINE vdouble vposneg_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)PNMASK); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)NPMASK); } + +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f }) +static INLINE vfloat vposneg_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)PNMASKf); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)NPMASKf); } + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { return (vdouble) { vd[1], vd[0], vd[3], vd[2] }; } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return (vdouble) { vd[2], vd[3], vd[0], vd[1] }; } +static INLINE vfloat vrev21_vf_vf(vfloat vd) { return (vfloat) { vd[1], vd[0], vd[3], vd[2], vd[5], vd[4], vd[7], vd[6] }; } +static INLINE vfloat vreva2_vf_vf(vfloat vd) { return (vfloat) { vd[6], vd[7], vd[4], vd[5], vd[2], vd[3], vd[0], vd[1] }; } +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vrev21_vl_vl(vlongdouble vd) { return (vlongdouble) { vd[1], vd[0], vd[3], vd[2] }; } +static INLINE vlongdouble vreva2_vl_vl(vlongdouble vd) { return (vlongdouble) { vd[2], vd[3], vd[0], vd[1] }; } +static INLINE vlongdouble vposneg_vl_vl(vlongdouble vd) { return (vlongdouble) { +vd[0], -vd[1], +vd[2], -vd[3] }; } +static INLINE vlongdouble vnegpos_vl_vl(vlongdouble vd) { return (vlongdouble) { -vd[0], +vd[1], -vd[2], +vd[3] }; } +#endif +#elif VECTLENDP == 8 +static INLINE vopmask vcast_vo32_vo64(vopmask m) { return (vopmask){ m[1], m[3], m[5], m[7], m[9], m[11], m[13], m[15], 0, 0, 0, 0, 0, 0, 0, 0 }; } +static INLINE vopmask vcast_vo64_vo32(vopmask m) { return (vopmask){ m[0], m[0], m[1], m[1], m[2], m[2], m[3], m[3], m[4], m[4], m[5], m[5], m[6], m[6], m[7], m[7] }; } + +static INLINE vint vcast_vi_i(int i) { return (vint) { i, i, i, i, i, i, i, i }; } +static INLINE vint2 vcast_vi2_i(int i) { return (vint2) { i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i }; } +static INLINE vfloat vcast_vf_f(float f) { return (vfloat) { f, f, f, f, f, f, f, f, f, f, f, f, f, f, f, f }; } +static INLINE vdouble vcast_vd_d(double d) { return (vdouble) { d, d, d, d, d, d, d, d }; } +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vcast_vl_l(long double d) { return (vlongdouble) { d, d, d, d, d, d, d, d }; } +#endif + +static INLINE vmask vcast_vm_i_i(int h, int l) { return (vmask){ l, h, l, h, l, h, l, h, l, h, l, h, l, h, l, h }; } +static INLINE vint2 vcastu_vi2_vi(vint vi) { return (vint2){ 0, vi[0], 0, vi[1], 0, vi[2], 0, vi[3], 0, vi[4], 0, vi[5], 0, vi[6], 0, vi[7] }; } +static INLINE vint vcastu_vi_vi2(vint2 vi2) { return (vint){ vi2[1], vi2[3], vi2[5], vi2[7], vi2[9], vi2[11], vi2[13], vi2[15] }; } + +static INLINE vint vreinterpretFirstHalf_vi_vi2(vint2 vi2) { return (vint){ vi2[0], vi2[1], vi2[2], vi2[3], vi2[4], vi2[5], vi2[6], vi2[7] }; } +static INLINE vint2 vreinterpretFirstHalf_vi2_vi(vint vi) { return (vint2){ vi[0], vi[1], vi[2], vi[3], vi[4], vi[5], vi[6], vi[7], 0, 0, 0, 0, 0, 0, 0, 0 }; } + +#define PNMASK ((vdouble) { +0.0, -0.0, +0.0, -0.0, +0.0, -0.0, +0.0, -0.0 }) +#define NPMASK ((vdouble) { -0.0, +0.0, -0.0, +0.0, -0.0, +0.0, -0.0, +0.0 }) +static INLINE vdouble vposneg_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)PNMASK); } +static INLINE vdouble vnegpos_vd_vd(vdouble d) { return (vdouble)((vmask)d ^ (vmask)NPMASK); } + +#define PNMASKf ((vfloat) { +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f }) +#define NPMASKf ((vfloat) { -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f }) +static INLINE vfloat vposneg_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)PNMASKf); } +static INLINE vfloat vnegpos_vf_vf(vfloat d) { return (vfloat)((vmask)d ^ (vmask)NPMASKf); } + +static INLINE vdouble vrev21_vd_vd(vdouble vd) { return (vdouble) { vd[1], vd[0], vd[3], vd[2], vd[5], vd[4], vd[7], vd[6] }; } +static INLINE vdouble vreva2_vd_vd(vdouble vd) { return (vdouble) { vd[6], vd[7], vd[4], vd[5], vd[2], vd[3], vd[0], vd[1] }; } +static INLINE vfloat vrev21_vf_vf(vfloat vd) { + return (vfloat) { + vd[1], vd[0], vd[3], vd[2], vd[5], vd[4], vd[7], vd[6], + vd[9], vd[8], vd[11], vd[10], vd[13], vd[12], vd[15], vd[14] }; +} +static INLINE vfloat vreva2_vf_vf(vfloat vd) { + return (vfloat) { + vd[14], vd[15], vd[12], vd[13], vd[10], vd[11], vd[8], vd[9], + vd[6], vd[7], vd[4], vd[5], vd[2], vd[3], vd[0], vd[1]}; +} +#ifdef ENABLE_LONGDOUBLE +static INLINE vlongdouble vrev21_vl_vl(vlongdouble vd) { return (vlongdouble) { vd[1], vd[0], vd[3], vd[2], vd[5], vd[4], vd[7], vd[6] }; } +static INLINE vlongdouble vreva2_vl_vl(vlongdouble vd) { return (vlongdouble) { vd[6], vd[7], vd[4], vd[5], vd[2], vd[3], vd[0], vd[1] }; } +static INLINE vlongdouble vposneg_vl_vl(vlongdouble vd) { return (vlongdouble) { +vd[0], -vd[1], +vd[2], -vd[3], +vd[4], -vd[5], +vd[6], -vd[7] }; } +static INLINE vlongdouble vnegpos_vl_vl(vlongdouble vd) { return (vlongdouble) { -vd[0], +vd[1], -vd[2], +vd[3], -vd[4], +vd[5], -vd[6], +vd[7] }; } +#endif +#else +static INLINE vint vcast_vi_i(int k) { + vint ret; + for(int i=0;i y), x, y); } +static INLINE vdouble vmin_vd_vd_vd(vdouble x, vdouble y) { return vsel_vd_vo_vd_vd((vopmask)(x < y), x, y); } + +static INLINE vdouble vsubadd_vd_vd_vd(vdouble x, vdouble y) { return vadd_vd_vd_vd(x, vnegpos_vd_vd(y)); } +static INLINE vdouble vmlsubadd_vd_vd_vd_vd(vdouble x, vdouble y, vdouble z) { return vsubadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z); } + +static INLINE vopmask veq_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x == y); } +static INLINE vopmask vneq_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x != y); } +static INLINE vopmask vlt_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x < y); } +static INLINE vopmask vle_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x <= y); } +static INLINE vopmask vgt_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x > y); } +static INLINE vopmask vge_vo_vd_vd(vdouble x, vdouble y) { return (vopmask)(x >= y); } + +static INLINE vint vadd_vi_vi_vi(vint x, vint y) { return x + y; } +static INLINE vint vsub_vi_vi_vi(vint x, vint y) { return x - y; } +static INLINE vint vneg_vi_vi(vint e) { return -e; } + +static INLINE vint vand_vi_vi_vi(vint x, vint y) { return x & y; } +static INLINE vint vandnot_vi_vi_vi(vint x, vint y) { return y & ~x; } +static INLINE vint vor_vi_vi_vi(vint x, vint y) { return x | y; } +static INLINE vint vxor_vi_vi_vi(vint x, vint y) { return x ^ y; } + +static INLINE vint vand_vi_vo_vi(vopmask x, vint y) { return vreinterpretFirstHalf_vi_vi2((vint2)x) & y; } +static INLINE vint vandnot_vi_vo_vi(vopmask x, vint y) { return y & ~vreinterpretFirstHalf_vi_vi2((vint2)x); } + +static INLINE vint vsll_vi_vi_i(vint x, int c) { +#if defined(__clang__) + typedef uint32_t vu __attribute__((ext_vector_type(VECTLENDP))); +#else + typedef uint32_t vu __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP))); +#endif + return (vint)(((vu)x) << c); +} + +static INLINE vint vsrl_vi_vi_i(vint x, int c) { +#if defined(__clang__) + typedef uint32_t vu __attribute__((ext_vector_type(VECTLENDP))); +#else + typedef uint32_t vu __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP))); +#endif + return (vint)(((vu)x) >> c); +} + +static INLINE vint vsra_vi_vi_i(vint x, int c) { return x >> c; } + +static INLINE vint veq_vi_vi_vi(vint x, vint y) { return x == y; } +static INLINE vint vgt_vi_vi_vi(vint x, vint y) { return x > y; } + +static INLINE vopmask veq_vo_vi_vi(vint x, vint y) { return (vopmask)vreinterpretFirstHalf_vi2_vi(x == y); } +static INLINE vopmask vgt_vo_vi_vi(vint x, vint y) { return (vopmask)vreinterpretFirstHalf_vi2_vi(x > y);} + +static INLINE vint vsel_vi_vo_vi_vi(vopmask m, vint x, vint y) { + return vor_vi_vi_vi(vand_vi_vi_vi(vreinterpretFirstHalf_vi_vi2((vint2)m), x), + vandnot_vi_vi_vi(vreinterpretFirstHalf_vi_vi2((vint2)m), y)); +} + +static INLINE vopmask visinf_vo_vd(vdouble d) { return (vopmask)(vabs_vd_vd(d) == SLEEF_INFINITY); } +static INLINE vopmask vispinf_vo_vd(vdouble d) { return (vopmask)(d == SLEEF_INFINITY); } +static INLINE vopmask visminf_vo_vd(vdouble d) { return (vopmask)(d == -SLEEF_INFINITY); } +static INLINE vopmask visnan_vo_vd(vdouble d) { return (vopmask)(d != d); } + +static INLINE vdouble vsqrt_vd_vd(vdouble d) { +#if defined(__clang__) + typedef int64_t vi64 __attribute__((ext_vector_type(VECTLENDP))); +#else + typedef int64_t vi64 __attribute__((vector_size(sizeof(int64_t)*VECTLENDP))); +#endif + + vdouble q = vcast_vd_d(1); + + vopmask o = (vopmask)(d < 8.636168555094445E-78); + d = (vdouble)((o & (vmask)(d * 1.157920892373162E77)) | (~o & (vmask)d)); + + q = (vdouble)((o & (vmask)vcast_vd_d(2.9387358770557188E-39)) | (~o & (vmask)vcast_vd_d(1))); + + q = (vdouble)vor_vm_vm_vm(vlt_vo_vd_vd(d, vcast_vd_d(0)), (vmask)q); + + vdouble x = (vdouble)(0x5fe6ec85e7de30daLL - ((vi64)(d + 1e-320) >> 1)); + x = x * ( 3 - d * x * x); + x = x * ( 12 - d * x * x); + x = x * (768 - d * x * x); + x *= 1.0 / (1 << 13); + x = (d - (d * x) * (d * x)) * (x * 0.5) + d * x; + + return x * q; +} + +static INLINE double vcast_d_vd(vdouble v) { return v[0]; } +static INLINE float vcast_f_vf(vfloat v) { return v[0]; } + +static INLINE vdouble vload_vd_p(const double *ptr) { return *(vdouble *)ptr; } +static INLINE vdouble vloadu_vd_p(const double *ptr) { + vdouble vd; + for(int i=0;i y), x, y); } +static INLINE vfloat vmin_vf_vf_vf(vfloat x, vfloat y) { return vsel_vf_vo_vf_vf((vopmask)(x < y), x, y); } + +static INLINE vfloat vsubadd_vf_vf_vf(vfloat x, vfloat y) { return vadd_vf_vf_vf(x, vnegpos_vf_vf(y)); } +static INLINE vfloat vmlsubadd_vf_vf_vf_vf(vfloat x, vfloat y, vfloat z) { return vsubadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z); } + +static INLINE vopmask veq_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x == y); } +static INLINE vopmask vneq_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x != y); } +static INLINE vopmask vlt_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x < y); } +static INLINE vopmask vle_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x <= y); } +static INLINE vopmask vgt_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x > y); } +static INLINE vopmask vge_vo_vf_vf(vfloat x, vfloat y) { return (vopmask)(x >= y); } + +static INLINE vint2 vadd_vi2_vi2_vi2(vint2 x, vint2 y) { return x + y; } +static INLINE vint2 vsub_vi2_vi2_vi2(vint2 x, vint2 y) { return x - y; } +static INLINE vint2 vneg_vi2_vi2(vint2 e) { return -e; } + +static INLINE vint2 vand_vi2_vi2_vi2(vint2 x, vint2 y) { return x & y; } +static INLINE vint2 vandnot_vi2_vi2_vi2(vint2 x, vint2 y) { return y & ~x; } +static INLINE vint2 vor_vi2_vi2_vi2(vint2 x, vint2 y) { return x | y; } +static INLINE vint2 vxor_vi2_vi2_vi2(vint2 x, vint2 y) { return x ^ y; } + +static INLINE vint2 vand_vi2_vo_vi2(vopmask x, vint2 y) { return (vint2)x & y; } +static INLINE vint2 vandnot_vi2_vo_vi2(vopmask x, vint2 y) { return y & ~(vint2)x; } + +static INLINE vint2 vsll_vi2_vi2_i(vint2 x, int c) { +#if defined(__clang__) + typedef uint32_t vu __attribute__((ext_vector_type(VECTLENDP*2))); +#else + typedef uint32_t vu __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP*2))); +#endif + return (vint2)(((vu)x) << c); +} +static INLINE vint2 vsrl_vi2_vi2_i(vint2 x, int c) { +#if defined(__clang__) + typedef uint32_t vu __attribute__((ext_vector_type(VECTLENDP*2))); +#else + typedef uint32_t vu __attribute__((vector_size(sizeof(uint32_t)*VECTLENDP*2))); +#endif + return (vint2)(((vu)x) >> c); +} +static INLINE vint2 vsra_vi2_vi2_i(vint2 x, int c) { return x >> c; } + +static INLINE vopmask veq_vo_vi2_vi2(vint2 x, vint2 y) { return (vopmask)(x == y); } +static INLINE vopmask vgt_vo_vi2_vi2(vint2 x, vint2 y) { return (vopmask)(x > y); } +static INLINE vint2 veq_vi2_vi2_vi2(vint2 x, vint2 y) { return x == y; } +static INLINE vint2 vgt_vi2_vi2_vi2(vint2 x, vint2 y) { return x > y; } + +static INLINE vopmask visinf_vo_vf(vfloat d) { return (vopmask)(vabs_vf_vf(d) == SLEEF_INFINITYf); } +static INLINE vopmask vispinf_vo_vf(vfloat d) { return (vopmask)(d == SLEEF_INFINITYf); } +static INLINE vopmask visminf_vo_vf(vfloat d) { return (vopmask)(d == -SLEEF_INFINITYf); } +static INLINE vopmask visnan_vo_vf(vfloat d) { return (vopmask)(d != d); } + +static INLINE vfloat vsqrt_vf_vf(vfloat d) { + vfloat q = vcast_vf_f(1); + + vopmask o = (vopmask)(d < 5.4210108624275221700372640043497e-20f); // 2^-64 + d = (vfloat)((o & (vmask)(d * vcast_vf_f(18446744073709551616.0f))) | (~o & (vmask)d)); // 2^64 + q = (vfloat)((o & (vmask)vcast_vf_f(0.00000000023283064365386962890625f)) | (~o & (vmask)vcast_vf_f(1))); // 2^-32 + q = (vfloat)vor_vm_vm_vm(vlt_vo_vf_vf(d, vcast_vf_f(0)), (vmask)q); + + vfloat x = (vfloat)(0x5f330de2 - (((vint2)d) >> 1)); + x = x * ( 3.0f - d * x * x); + x = x * (12.0f - d * x * x); + x *= 0.0625f; + x = (d - (d * x) * (d * x)) * (x * 0.5) + d * x; + + return x * q; +} + +static INLINE vfloat vload_vf_p(const float *ptr) { return *(vfloat *)ptr; } +static INLINE vfloat vloadu_vf_p(const float *ptr) { + vfloat vf; + for(int i=0;i +#include +#include +#include +#include + +#define N 1000 + +FILE *cygopen(const char *path, const char *mode) { +#if defined(__MINGW64__) || defined(__MINGW32__) + FILE *fp = fopen(path, mode); + if (fp != NULL) return fp; + + char *buf = malloc(strlen(path) + N + 1); + snprintf(buf, strlen(path) + N, "cygpath -m '%s'", path); + + FILE *pfp = popen(buf, "r"); + + if (pfp == NULL || fgets(buf, N, pfp) == NULL) { + if (pfp != NULL) pclose(pfp); + free(buf); + return NULL; + } + + pclose(pfp); + + int len = strlen(buf); + if (0 < len && len < N && buf[len-1] == '\n') buf[len-1] = '\0'; + + fp = fopen(buf, mode); + + free(buf); + + return fp; +#else + return fopen(path, mode); +#endif +} + +int nkeywords = 0, nalloc = 0; +char **keywords = NULL, *suffix = NULL; + +int nIgnore = 0; +char **ignore = NULL; + +void insert(char *buf) { + for(int i=0;i\n", argv[0]); + fprintf(stderr, "Print the file on the standard output\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "%s [ ... ]\n", argv[0]); + fprintf(stderr, "Add the suffix to keywords\n"); + exit(-1); + } + + char buf[N]; + + if (argc == 2) { + FILE *fp = cygopen(argv[1], "r"); + if (fp == NULL) { + fprintf(stderr, "Cannot open %s\n", argv[1]); + exit(-1); + } + + while(fgets(buf, N, fp) != NULL) { + fputs(buf, stdout); + } + fclose(fp); + exit(0); + } + + FILE *fp = cygopen(argv[2], "r"); + if (fp == NULL) { + fprintf(stderr, "Cannot open %s\n", argv[2]); + exit(-1); + } + + while(fgets(buf, N, fp) != NULL) { + if (strlen(buf) >= 1) buf[strlen(buf)-1] = '\0'; + keywords[nkeywords] = malloc(sizeof(char) * (strlen(buf) + 1)); + strcpy(keywords[nkeywords], buf); + nkeywords++; + if (nkeywords >= nalloc) { + nalloc *= 2; + keywords = realloc(keywords, sizeof(char *) * nalloc); + } + } + + fclose(fp); + + nIgnore = argc - 4; + ignore = argv + 4; + + suffix = argv[3]; + + fp = cygopen(argv[1], "r"); + if (fp == NULL) { + fprintf(stderr, "Cannot open %s\n", argv[1]); + exit(-1); + } + + doit(fp); + + fclose(fp); + + exit(0); +} + +// cat sleef*inline*.h | egrep -o '[a-zA-Z_][0-9a-zA-Z_]*' | sort | uniq > cand.txt diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.c new file mode 100644 index 0000000000000..3e31df5ffeca9 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.c @@ -0,0 +1,347 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +// + +#if !(defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER)) +#include +#include +#include + +static void FLOCK(FILE *fp) { flock(fileno(fp), LOCK_EX); } +static void FUNLOCK(FILE *fp) { flock(fileno(fp), LOCK_UN); } +static void FTRUNCATE(FILE *fp, off_t z) { + if (ftruncate(fileno(fp), z)) + ; +} +static FILE *OPENTMPFILE() { return tmpfile(); } +static void CLOSETMPFILE(FILE *fp) { fclose(fp); } +#else +#include +#include + +static void FLOCK(FILE *fp) { } +static void FUNLOCK(FILE *fp) { } +static void FTRUNCATE(FILE *fp, long z) { + fseek(fp, 0, SEEK_SET); + SetEndOfFile((HANDLE)_get_osfhandle(_fileno(fp))); +} +static FILE *OPENTMPFILE() { return fopen("tmpfile.txt", "w+"); } +static void CLOSETMPFILE(FILE *fp) { + fclose(fp); + remove("tmpfile.txt"); +} +#endif + +// + +#define MAGIC_ARRAYMAPNODE 0xf73130fa +#define MAGIC_ARRAYMAP 0x8693bd21 +#define LOGNBUCKETS 8 +#define NBUCKETS (1 << LOGNBUCKETS) + +static int hash(uint64_t key) { + return (key ^ (key >> LOGNBUCKETS) ^ (key >> (LOGNBUCKETS*2)) ^ (key >> (LOGNBUCKETS*3))) & (NBUCKETS-1); +} + +static void String_trim(char *str) { + char *dst = str, *src = str, *pterm = src; + + while(*src != '\0' && isspace((int)*src)) src++; + + for(;*src != '\0';src++) { + *dst++ = *src; + if (!isspace((int)*src)) pterm = dst; + } + + *pterm = '\0'; +} + +typedef struct ArrayMapNode { + uint32_t magic; + uint64_t key; + void *value; +} ArrayMapNode; + +typedef struct ArrayMap { + uint32_t magic; + ArrayMapNode *array[NBUCKETS]; + int size[NBUCKETS], capacity[NBUCKETS], totalSize; +} ArrayMap; + +ArrayMap *initArrayMap() { + ArrayMap *thiz = (ArrayMap *)calloc(1, sizeof(ArrayMap)); + thiz->magic = MAGIC_ARRAYMAP; + + for(int i=0;icapacity[i] = 8; + thiz->array[i] = (ArrayMapNode *)malloc(thiz->capacity[i] * sizeof(ArrayMapNode)); + thiz->size[i] = 0; + } + + thiz->totalSize = 0; + return thiz; +} + +void ArrayMap_dispose(ArrayMap *thiz) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + + for(int j=0;jsize[j];i++) { + assert(thiz->array[j][i].magic == MAGIC_ARRAYMAPNODE); + thiz->array[j][i].magic = 0; + } + free(thiz->array[j]); + } + + thiz->magic = 0; + free(thiz); +} + +int ArrayMap_size(ArrayMap *thiz) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + return thiz->totalSize; +} + +uint64_t *ArrayMap_keyArray(ArrayMap *thiz) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + uint64_t *a = (uint64_t *)malloc(sizeof(uint64_t) * thiz->totalSize); + int p = 0; + for(int j=0;jsize[j];i++) { + assert(thiz->array[j][i].magic == MAGIC_ARRAYMAPNODE); + a[p++] = thiz->array[j][i].key; + } + } + return a; +} + +void **ArrayMap_valueArray(ArrayMap *thiz) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + void **a = (void **)malloc(sizeof(void *) * thiz->totalSize); + int p = 0; + for(int j=0;jsize[j];i++) { + assert(thiz->array[j][i].magic == MAGIC_ARRAYMAPNODE); + a[p++] = thiz->array[j][i].value; + } + } + return a; +} + +void *ArrayMap_remove(ArrayMap *thiz, uint64_t key) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + + int h = hash(key); + for(int i=0;isize[h];i++) { + assert(thiz->array[h][i].magic == MAGIC_ARRAYMAPNODE); + if (thiz->array[h][i].key == key) { + void *old = thiz->array[h][i].value; + thiz->array[h][i].key = thiz->array[h][thiz->size[h]-1].key; + thiz->array[h][i].value = thiz->array[h][thiz->size[h]-1].value; + thiz->array[h][thiz->size[h]-1].magic = 0; + thiz->size[h]--; + thiz->totalSize--; + return old; + } + } + + return NULL; +} + +void *ArrayMap_put(ArrayMap *thiz, uint64_t key, void *value) { + if (value == NULL) return ArrayMap_remove(thiz, key); + + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + + int h = hash(key); + for(int i=0;isize[h];i++) { + assert(thiz->array[h][i].magic == MAGIC_ARRAYMAPNODE); + if (thiz->array[h][i].key == key) { + void *old = thiz->array[h][i].value; + thiz->array[h][i].value = value; + return old; + } + } + + if (thiz->size[h] >= thiz->capacity[h]) { + thiz->capacity[h] *= 2; + thiz->array[h] = (ArrayMapNode *)realloc(thiz->array[h], thiz->capacity[h] * sizeof(ArrayMapNode)); + } + + ArrayMapNode *n = &(thiz->array[h][thiz->size[h]++]); + n->magic = MAGIC_ARRAYMAPNODE; + n->key = key; + n->value = value; + + thiz->totalSize++; + + return NULL; +} + +void *ArrayMap_get(ArrayMap *thiz, uint64_t key) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + + int h = hash(key); + for(int i=0;isize[h];i++) { + assert(thiz->array[h][i].magic == MAGIC_ARRAYMAPNODE); + if (thiz->array[h][i].key == key) { + return thiz->array[h][i].value; + } + } + + return NULL; +} + +#define LINELEN (1024*1024) + +ArrayMap *ArrayMap_load(const char *fn, const char *prefix, const char *idstr, int doLock) { + const int idstrlen = (int)strlen(idstr); + int prefixLen = (int)strlen(prefix) + 3; + + if (prefixLen >= LINELEN-10 || idstrlen >= LINELEN-10) return NULL; + + FILE *fp = fopen(fn, "r"); + if (fp == NULL) return NULL; + + if (doLock) FLOCK(fp); + + ArrayMap *thiz = initArrayMap(); + + char *prefix2 = malloc(prefixLen+10); + strcpy(prefix2, prefix); + String_trim(prefix2); + for(char *p = prefix2;*p != '\0';p++) { + if (*p == ':') *p = ';'; + if (*p == ' ') *p = '_'; + } + strcat(prefix2, " : "); + prefixLen = (int)strlen(prefix2); + + char *line = malloc(sizeof(char) * (LINELEN+10)); + line[idstrlen] = '\0'; + + if (fread(line, sizeof(char), idstrlen, fp) != idstrlen || + strcmp(idstr, line) != 0) { + if (doLock) FUNLOCK(fp); + fclose(fp); + free(prefix2); + free(line); + return NULL; + } + + for(;;) { + line[LINELEN] = '\0'; + if (fgets(line, LINELEN, fp) == NULL) break; + if (strncmp(line, prefix2, prefixLen) != 0) continue; + + uint64_t key; + char *value = malloc(sizeof(char) * LINELEN); + + if (sscanf(line + prefixLen, "%" SCNx64 " : %s\n", &key, value) == 2) { + ArrayMap_put(thiz, (uint64_t)key, (void *)value); + } else { + free(value); + } + } + + if (doLock) FUNLOCK(fp); + fclose(fp); + + free(prefix2); + free(line); + + return thiz; +} + +int ArrayMap_save(ArrayMap *thiz, const char *fn, const char *prefix, const char *idstr) { + assert(thiz != NULL && thiz->magic == MAGIC_ARRAYMAP); + + const int idstrlen = (int)strlen(idstr); + int prefixLen = (int)strlen(prefix) + 3; + + if (prefixLen >= LINELEN-10 || idstrlen >= LINELEN-10) return -1; + + // Generate prefix2 + + char *prefix2 = malloc(prefixLen+10); + strcpy(prefix2, prefix); + String_trim(prefix2); + for(char *p = prefix2;*p != '\0';p++) { + if (*p == ':') *p = ';'; + if (*p == ' ') *p = '_'; + } + strcat(prefix2, " : "); + prefixLen = (int)strlen(prefix2); + + // + + FILE *fp = fopen(fn, "a+"); + if (fp == NULL) return -1; + + FLOCK(fp); + fseek(fp, 0, SEEK_SET); + + // Copy the file specified by fn to tmpfile + + FILE *tmpfp = OPENTMPFILE(); + if (tmpfp == NULL) { + FUNLOCK(fp); + fclose(fp); + return -1; + } + + char *line = malloc(sizeof(char) * (LINELEN+10)); + line[idstrlen] = '\0'; + + if (fread(line, sizeof(char), idstrlen, fp) == idstrlen && strcmp(idstr, line) == 0) { + for(;;) { + line[LINELEN] = '\0'; + if (fgets(line, LINELEN, fp) == NULL) break; + if (strncmp(line, prefix2, prefixLen) != 0) fputs(line, tmpfp); + } + } + + // Write the contents in the map into tmpfile + + uint64_t *keys = ArrayMap_keyArray(thiz); + int s = ArrayMap_size(thiz); + + for(int i=0;i= LINELEN-10) continue; + fprintf(tmpfp, "%s %" PRIx64 " : %s\n", prefix2, keys[i], value); + } + + free(keys); + + fseek(fp, 0, SEEK_SET); + FTRUNCATE(fp, 0); + fwrite(idstr, sizeof(char), strlen(idstr), fp); + + fseek(tmpfp, 0, SEEK_SET); + + for(;;) { + size_t s = fread(line, 1, LINELEN, tmpfp); + if (s == 0) break; + fwrite(line, 1, s, fp); + } + + FUNLOCK(fp); + fclose(fp); + + CLOSETMPFILE(tmpfp); + free(prefix2); + free(line); + return 0; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.h new file mode 100644 index 0000000000000..9d05abe783ae4 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/arraymap.h @@ -0,0 +1,21 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __ARRAYMAP_H__ +#define __ARRAYMAP_H__ +typedef struct ArrayMap ArrayMap; + +ArrayMap *initArrayMap(); +void ArrayMap_dispose(ArrayMap *thiz); +int ArrayMap_size(ArrayMap *thiz); +void *ArrayMap_remove(ArrayMap *thiz, uint64_t key); +void *ArrayMap_put(ArrayMap *thiz, uint64_t key, void *value); +void *ArrayMap_get(ArrayMap *thiz, uint64_t key); + +uint64_t *ArrayMap_keyArray(ArrayMap *thiz); +void **ArrayMap_valueArray(ArrayMap *thiz); +int ArrayMap_save(ArrayMap *thiz, const char *fn, const char *prefix, const char *idstr); +ArrayMap *ArrayMap_load(const char *fn, const char *prefix, const char *idstr, int doLock); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.c new file mode 100644 index 0000000000000..6ebcc3f4ffbad --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.c @@ -0,0 +1,98 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) +#include + +EXPORT void *Sleef_malloc(size_t z) { return _aligned_malloc(z, 256); } +EXPORT void Sleef_free(void *ptr) { _aligned_free(ptr); } + +EXPORT uint64_t Sleef_currentTimeMicros() { + struct __timeb64 t; + _ftime64(&t); + return t.time * INT64_C(1000000) + t.millitm*1000; +} +#elif defined(__APPLE__) +#include + +EXPORT void *Sleef_malloc(size_t z) { void *ptr = NULL; posix_memalign(&ptr, 256, z); return ptr; } +EXPORT void Sleef_free(void *ptr) { free(ptr); } + +EXPORT uint64_t Sleef_currentTimeMicros() { + struct timeval time; + gettimeofday(&time, NULL); + return (uint64_t)((time.tv_sec * INT64_C(1000000)) + time.tv_usec); +} +#else // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) +#include +#include +#if defined(__FreeBSD__) || defined(__OpenBSD__) +#include +#else +#include +#endif + +EXPORT void *Sleef_malloc(size_t z) { void *ptr = NULL; posix_memalign(&ptr, 4096, z); return ptr; } +EXPORT void Sleef_free(void *ptr) { free(ptr); } + +EXPORT uint64_t Sleef_currentTimeMicros() { + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return (uint64_t)tp.tv_sec * INT64_C(1000000) + ((uint64_t)tp.tv_nsec/1000); +} +#endif // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) + +#ifdef _MSC_VER +#include +EXPORT void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx) { + __cpuidex(out, eax, ecx); +} +#else +#if defined(__x86_64__) || defined(__i386__) +EXPORT void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx) { + uint32_t a, b, c, d; + __asm__ __volatile__ ("cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (eax), "c"(ecx)); + out[0] = a; out[1] = b; out[2] = c; out[3] = d; +} +#endif +#endif + +#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) +static char x86BrandString[256]; + +EXPORT char *Sleef_getCpuIdString() { + union { + int32_t info[4]; + uint8_t str[16]; + } u; + int i,j; + char *p; + + p = x86BrandString; + + for(i=0;i<3;i++) { + Sleef_x86CpuID(u.info, i + 0x80000002, 0); + + for(j=0;j<16;j++) { + *p++ = u.str[j]; + } + } + + *p++ = '\n'; + + return x86BrandString; +} +#else +EXPORT char *Sleef_getCpuIdString() { + return "Unknown architecture"; +} +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.h new file mode 100644 index 0000000000000..ff278e0792a66 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/common.h @@ -0,0 +1,9 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __COMMON_H__ +#define __COMMON_H__ +char *Sleef_getCpuIdString(); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/commonfuncs.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/commonfuncs.h new file mode 100644 index 0000000000000..494b7b87c7ae3 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/commonfuncs.h @@ -0,0 +1,438 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +typedef struct { + vdouble x, y, z; +} vdouble3; + +static INLINE CONST VECTOR_CC vdouble vd3getx_vd_vd3(vdouble3 v) { return v.x; } +static INLINE CONST VECTOR_CC vdouble vd3gety_vd_vd3(vdouble3 v) { return v.y; } +static INLINE CONST VECTOR_CC vdouble vd3getz_vd_vd3(vdouble3 v) { return v.z; } +static INLINE CONST VECTOR_CC vdouble3 vd3setxyz_vd3_vd_vd_vd(vdouble x, vdouble y, vdouble z) { + vdouble3 v = { x, y, z }; + return v; +} +static INLINE CONST VECTOR_CC vdouble3 vd3setx_vd3_vd3_vd(vdouble3 v, vdouble d) { v.x = d; return v; } +static INLINE CONST VECTOR_CC vdouble3 vd3sety_vd3_vd3_vd(vdouble3 v, vdouble d) { v.y = d; return v; } +static INLINE CONST VECTOR_CC vdouble3 vd3setz_vd3_vd3_vd(vdouble3 v, vdouble d) { v.z = d; return v; } + +// + +typedef struct { + vdouble2 a, b; +} dd2; + +static dd2 dd2setab_dd2_vd2_vd2(vdouble2 a, vdouble2 b) { + dd2 r = { a, b }; + return r; +} +static vdouble2 dd2geta_vd2_dd2(dd2 d) { return d.a; } +static vdouble2 dd2getb_vd2_dd2(dd2 d) { return d.b; } + +// + +typedef struct { + vmask e; + vdouble3 d3; +} tdx; + +static INLINE CONST VECTOR_CC vmask tdxgete_vm_tdx(tdx t) { return t.e; } +static INLINE CONST VECTOR_CC vdouble3 tdxgetd3_vd3_tdx(tdx t) { return t.d3; } +static INLINE CONST VECTOR_CC vdouble tdxgetd3x_vd_tdx(tdx t) { return t.d3.x; } +static INLINE CONST VECTOR_CC vdouble tdxgetd3y_vd_tdx(tdx t) { return t.d3.y; } +static INLINE CONST VECTOR_CC vdouble tdxgetd3z_vd_tdx(tdx t) { return t.d3.z; } +static INLINE CONST VECTOR_CC tdx tdxsete_tdx_tdx_vm(tdx t, vmask e) { t.e = e; return t; } +static INLINE CONST VECTOR_CC tdx tdxsetd3_tdx_tdx_vd3(tdx t, vdouble3 d3) { t.d3 = d3; return t; } +static INLINE CONST VECTOR_CC tdx tdxsetx_tdx_tdx_vd(tdx t, vdouble x) { t.d3.x = x; return t; } +static INLINE CONST VECTOR_CC tdx tdxsety_tdx_tdx_vd(tdx t, vdouble y) { t.d3.y = y; return t; } +static INLINE CONST VECTOR_CC tdx tdxsetz_tdx_tdx_vd(tdx t, vdouble z) { t.d3.z = z; return t; } +static INLINE CONST VECTOR_CC tdx tdxsetxyz_tdx_tdx_vd_vd_vd(tdx t, vdouble x, vdouble y, vdouble z) { + t.d3 = (vdouble3) { x, y, z }; + return t; +} + +static INLINE CONST VECTOR_CC tdx tdxseted3_tdx_vm_vd3(vmask e, vdouble3 d3) { return (tdx) { e, d3 }; } +static INLINE CONST VECTOR_CC tdx tdxsetexyz_tdx_vm_vd_vd_vd(vmask e, vdouble x, vdouble y, vdouble z) { + return (tdx) { e, (vdouble3) { x, y, z } }; +} + +static INLINE CONST VECTOR_CC vmask vqgetx_vm_vq(vquad v) { return v.x; } +static INLINE CONST VECTOR_CC vmask vqgety_vm_vq(vquad v) { return v.y; } +static INLINE CONST VECTOR_CC vquad vqsetxy_vq_vm_vm(vmask x, vmask y) { return (vquad) { x, y }; } +static INLINE CONST VECTOR_CC vquad vqsetx_vq_vq_vm(vquad v, vmask x) { v.x = x; return v; } +static INLINE CONST VECTOR_CC vquad vqsety_vq_vq_vm(vquad v, vmask y) { v.y = y; return v; } + +// + +typedef struct { + vdouble d; + vint i; +} di_t; + +static INLINE CONST VECTOR_CC vdouble digetd_vd_di(di_t d) { return d.d; } +static INLINE CONST VECTOR_CC vint digeti_vi_di(di_t d) { return d.i; } +static INLINE CONST VECTOR_CC di_t disetdi_di_vd_vi(vdouble d, vint i) { + di_t r = { d, i }; + return r; +} + +// + +typedef struct { + vdouble2 dd; + vint i; +} ddi_t; + +static INLINE CONST VECTOR_CC vdouble2 ddigetdd_vd2_ddi(ddi_t d) { return d.dd; } +static INLINE CONST VECTOR_CC vint ddigeti_vi_ddi(ddi_t d) { return d.i; } +static INLINE CONST VECTOR_CC ddi_t ddisetddi_ddi_vd2_vi(vdouble2 v, vint i) { + ddi_t r = { v, i }; + return r; +} +static INLINE CONST VECTOR_CC ddi_t ddisetdd_ddi_ddi_vd2(ddi_t ddi, vdouble2 v) { + ddi.dd = v; + return ddi; +} + +// + +typedef struct { + vdouble3 td; + vint i; +} tdi_t; + +static INLINE CONST VECTOR_CC vdouble3 tdigettd_vd3_tdi(tdi_t d) { return d.td; } +static INLINE CONST VECTOR_CC vdouble tdigetx_vd_tdi(tdi_t d) { return d.td.x; } +static INLINE CONST VECTOR_CC vint tdigeti_vi_tdi(tdi_t d) { return d.i; } +static INLINE CONST VECTOR_CC tdi_t tdisettdi_tdi_vd3_vi(vdouble3 v, vint i) { + tdi_t r = { v, i }; + return r; +} +#endif + +#if defined(ENABLE_MAIN) +// Functions for debugging +#include +#include + +static void printvmask(char *mes, vmask g) { + uint64_t u[VECTLENDP]; + vstoreu_v_p_vd((double *)u, vreinterpret_vd_vm(g)); + printf("%s ", mes); + for(int i=0;i= |y| + + vdouble s = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + return vd2setxy_vd2_vd_vd(s, vadd_vd_4vd(vsub_vd_vd_vd(vd2getx_vd_vd2(x), s), vd2getx_vd_vd2(y), vd2gety_vd_vd2(x), vd2gety_vd_vd2(y))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddadd2_vd2_vd2_vd2(vdouble2 x, vdouble2 y) { + vdouble s = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + vdouble v = vsub_vd_vd_vd(s, vd2getx_vd_vd2(x)); + vdouble t = vadd_vd_vd_vd(vsub_vd_vd_vd(vd2getx_vd_vd2(x), vsub_vd_vd_vd(s, v)), vsub_vd_vd_vd(vd2getx_vd_vd2(y), v)); + return vd2setxy_vd2_vd_vd(s, vadd_vd_vd_vd(t, vadd_vd_vd_vd(vd2gety_vd_vd2(x), vd2gety_vd_vd2(y)))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddsub_vd2_vd_vd(vdouble x, vdouble y) { + // |x| >= |y| + + vdouble s = vsub_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(s, vsub_vd_vd_vd(vsub_vd_vd_vd(x, s), y)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddsub_vd2_vd2_vd2(vdouble2 x, vdouble2 y) { + // |x| >= |y| + + vdouble s = vsub_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + vdouble t = vsub_vd_vd_vd(vd2getx_vd_vd2(x), s); + t = vsub_vd_vd_vd(t, vd2getx_vd_vd2(y)); + t = vadd_vd_vd_vd(t, vd2gety_vd_vd2(x)); + return vd2setxy_vd2_vd_vd(s, vsub_vd_vd_vd(t, vd2gety_vd_vd2(y))); +} + +#ifdef ENABLE_FMA_DP +static INLINE CONST VECTOR_CC vdouble2 dddiv_vd2_vd2_vd2(vdouble2 n, vdouble2 d) { + vdouble t = vrec_vd_vd(vd2getx_vd_vd2(d)); + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(n), t); + vdouble u = vfmapn_vd_vd_vd_vd(t, vd2getx_vd_vd2(n), s); + vdouble v = vfmanp_vd_vd_vd_vd(vd2gety_vd_vd2(d), t, vfmanp_vd_vd_vd_vd(vd2getx_vd_vd2(d), t, vcast_vd_d(1))); + return vd2setxy_vd2_vd_vd(s, vfma_vd_vd_vd_vd(s, v, vfma_vd_vd_vd_vd(vd2gety_vd_vd2(n), t, u))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd_vd(vdouble x, vdouble y) { + vdouble s = vmul_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(s, vfmapn_vd_vd_vd_vd(x, y, s)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddsqu_vd2_vd2(vdouble2 x) { + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + return vd2setxy_vd2_vd_vd(s, vfma_vd_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)), vd2gety_vd_vd2(x), vfmapn_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x), s))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd2_vd2(vdouble2 x, vdouble2 y) { + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + return vd2setxy_vd2_vd_vd(s, vfma_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(y), vfma_vd_vd_vd_vd(vd2gety_vd_vd2(x), vd2getx_vd_vd2(y), vfmapn_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y), s)))); +} + +static INLINE CONST VECTOR_CC vdouble ddmul_vd_vd2_vd2(vdouble2 x, vdouble2 y) { + return vfma_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y), vfma_vd_vd_vd_vd(vd2gety_vd_vd2(x), vd2getx_vd_vd2(y), vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(y)))); +} + +static INLINE CONST VECTOR_CC vdouble ddsqu_vd_vd2(vdouble2 x) { + return vfma_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x), vadd_vd_vd_vd(vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)), vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd2_vd(vdouble2 x, vdouble y) { + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), y); + return vd2setxy_vd2_vd_vd(s, vfma_vd_vd_vd_vd(vd2gety_vd_vd2(x), y, vfmapn_vd_vd_vd_vd(vd2getx_vd_vd2(x), y, s))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddrec_vd2_vd(vdouble d) { + vdouble s = vrec_vd_vd(d); + return vd2setxy_vd2_vd_vd(s, vmul_vd_vd_vd(s, vfmanp_vd_vd_vd_vd(d, s, vcast_vd_d(1)))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddrec_vd2_vd2(vdouble2 d) { + vdouble s = vrec_vd_vd(vd2getx_vd_vd2(d)); + return vd2setxy_vd2_vd_vd(s, vmul_vd_vd_vd(s, vfmanp_vd_vd_vd_vd(vd2gety_vd_vd2(d), s, vfmanp_vd_vd_vd_vd(vd2getx_vd_vd2(d), s, vcast_vd_d(1))))); +} +#else // #ifdef ENABLE_FMA_DP +static INLINE CONST VECTOR_CC vdouble2 dddiv_vd2_vd2_vd2(vdouble2 n, vdouble2 d) { + vdouble t = vrec_vd_vd(vd2getx_vd_vd2(d)); + vdouble dh = vupper_vd_vd(vd2getx_vd_vd2(d)), dl = vsub_vd_vd_vd(vd2getx_vd_vd2(d), dh); + vdouble th = vupper_vd_vd(t ), tl = vsub_vd_vd_vd(t , th); + vdouble nhh = vupper_vd_vd(vd2getx_vd_vd2(n)), nhl = vsub_vd_vd_vd(vd2getx_vd_vd2(n), nhh); + + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(n), t); + + vdouble u = vadd_vd_5vd(vsub_vd_vd_vd(vmul_vd_vd_vd(nhh, th), s), vmul_vd_vd_vd(nhh, tl), vmul_vd_vd_vd(nhl, th), vmul_vd_vd_vd(nhl, tl), + vmul_vd_vd_vd(s, vsub_vd_5vd(vcast_vd_d(1), vmul_vd_vd_vd(dh, th), vmul_vd_vd_vd(dh, tl), vmul_vd_vd_vd(dl, th), vmul_vd_vd_vd(dl, tl)))); + + return vd2setxy_vd2_vd_vd(s, vmla_vd_vd_vd_vd(t, vsub_vd_vd_vd(vd2gety_vd_vd2(n), vmul_vd_vd_vd(s, vd2gety_vd_vd2(d))), u)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd_vd(vdouble x, vdouble y) { + vdouble xh = vupper_vd_vd(x), xl = vsub_vd_vd_vd(x, xh); + vdouble yh = vupper_vd_vd(y), yl = vsub_vd_vd_vd(y, yh); + + vdouble s = vmul_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(s, vadd_vd_5vd(vmul_vd_vd_vd(xh, yh), vneg_vd_vd(s), vmul_vd_vd_vd(xl, yh), vmul_vd_vd_vd(xh, yl), vmul_vd_vd_vd(xl, yl))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd2_vd(vdouble2 x, vdouble y) { + vdouble xh = vupper_vd_vd(vd2getx_vd_vd2(x)), xl = vsub_vd_vd_vd(vd2getx_vd_vd2(x), xh); + vdouble yh = vupper_vd_vd(y ), yl = vsub_vd_vd_vd(y , yh); + + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), y); + return vd2setxy_vd2_vd_vd(s, vadd_vd_6vd(vmul_vd_vd_vd(xh, yh), vneg_vd_vd(s), vmul_vd_vd_vd(xl, yh), vmul_vd_vd_vd(xh, yl), vmul_vd_vd_vd(xl, yl), vmul_vd_vd_vd(vd2gety_vd_vd2(x), y))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmul_vd2_vd2_vd2(vdouble2 x, vdouble2 y) { + vdouble xh = vupper_vd_vd(vd2getx_vd_vd2(x)), xl = vsub_vd_vd_vd(vd2getx_vd_vd2(x), xh); + vdouble yh = vupper_vd_vd(vd2getx_vd_vd2(y)), yl = vsub_vd_vd_vd(vd2getx_vd_vd2(y), yh); + + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + return vd2setxy_vd2_vd_vd(s, vadd_vd_7vd(vmul_vd_vd_vd(xh, yh), vneg_vd_vd(s), vmul_vd_vd_vd(xl, yh), vmul_vd_vd_vd(xh, yl), vmul_vd_vd_vd(xl, yl), vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(y)), vmul_vd_vd_vd(vd2gety_vd_vd2(x), vd2getx_vd_vd2(y)))); +} + +static INLINE CONST VECTOR_CC vdouble ddmul_vd_vd2_vd2(vdouble2 x, vdouble2 y) { + vdouble xh = vupper_vd_vd(vd2getx_vd_vd2(x)), xl = vsub_vd_vd_vd(vd2getx_vd_vd2(x), xh); + vdouble yh = vupper_vd_vd(vd2getx_vd_vd2(y)), yl = vsub_vd_vd_vd(vd2getx_vd_vd2(y), yh); + + return vadd_vd_6vd(vmul_vd_vd_vd(vd2gety_vd_vd2(x), yh), vmul_vd_vd_vd(xh, vd2gety_vd_vd2(y)), vmul_vd_vd_vd(xl, yl), vmul_vd_vd_vd(xh, yl), vmul_vd_vd_vd(xl, yh), vmul_vd_vd_vd(xh, yh)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddsqu_vd2_vd2(vdouble2 x) { + vdouble xh = vupper_vd_vd(vd2getx_vd_vd2(x)), xl = vsub_vd_vd_vd(vd2getx_vd_vd2(x), xh); + + vdouble s = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + return vd2setxy_vd2_vd_vd(s, vadd_vd_5vd(vmul_vd_vd_vd(xh, xh), vneg_vd_vd(s), vmul_vd_vd_vd(vadd_vd_vd_vd(xh, xh), xl), vmul_vd_vd_vd(xl, xl), vmul_vd_vd_vd(vd2getx_vd_vd2(x), vadd_vd_vd_vd(vd2gety_vd_vd2(x), vd2gety_vd_vd2(x))))); +} + +static INLINE CONST VECTOR_CC vdouble ddsqu_vd_vd2(vdouble2 x) { + vdouble xh = vupper_vd_vd(vd2getx_vd_vd2(x)), xl = vsub_vd_vd_vd(vd2getx_vd_vd2(x), xh); + + return vadd_vd_5vd(vmul_vd_vd_vd(xh, vd2gety_vd_vd2(x)), vmul_vd_vd_vd(xh, vd2gety_vd_vd2(x)), vmul_vd_vd_vd(xl, xl), vadd_vd_vd_vd(vmul_vd_vd_vd(xh, xl), vmul_vd_vd_vd(xh, xl)), vmul_vd_vd_vd(xh, xh)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddrec_vd2_vd(vdouble d) { + vdouble t = vrec_vd_vd(d); + vdouble dh = vupper_vd_vd(d), dl = vsub_vd_vd_vd(d, dh); + vdouble th = vupper_vd_vd(t), tl = vsub_vd_vd_vd(t, th); + + return vd2setxy_vd2_vd_vd(t, vmul_vd_vd_vd(t, vsub_vd_5vd(vcast_vd_d(1), vmul_vd_vd_vd(dh, th), vmul_vd_vd_vd(dh, tl), vmul_vd_vd_vd(dl, th), vmul_vd_vd_vd(dl, tl)))); +} + +static INLINE CONST VECTOR_CC vdouble2 ddrec_vd2_vd2(vdouble2 d) { + vdouble t = vrec_vd_vd(vd2getx_vd_vd2(d)); + vdouble dh = vupper_vd_vd(vd2getx_vd_vd2(d)), dl = vsub_vd_vd_vd(vd2getx_vd_vd2(d), dh); + vdouble th = vupper_vd_vd(t ), tl = vsub_vd_vd_vd(t , th); + + return vd2setxy_vd2_vd_vd(t, vmul_vd_vd_vd(t, vsub_vd_6vd(vcast_vd_d(1), vmul_vd_vd_vd(dh, th), vmul_vd_vd_vd(dh, tl), vmul_vd_vd_vd(dl, th), vmul_vd_vd_vd(dl, tl), vmul_vd_vd_vd(vd2gety_vd_vd2(d), t)))); +} +#endif // #ifdef ENABLE_FMA_DP + +static INLINE CONST VECTOR_CC vdouble2 ddsqrt_vd2_vd2(vdouble2 d) { + vdouble t = vsqrt_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d))); + return ddscale_vd2_vd2_vd(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd2(d, ddmul_vd2_vd_vd(t, t)), ddrec_vd2_vd(t)), vcast_vd_d(0.5)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddsqrt_vd2_vd(vdouble d) { + vdouble t = vsqrt_vd_vd(d); + return ddscale_vd2_vd2_vd(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd_vd2(d, ddmul_vd2_vd_vd(t, t)), ddrec_vd2_vd(t)), vcast_vd_d(0.5)); +} + +static INLINE CONST VECTOR_CC vdouble2 ddmla_vd2_vd2_vd2_vd2(vdouble2 x, vdouble2 y, vdouble2 z) { + return ddadd_vd2_vd2_vd2(z, ddmul_vd2_vd2_vd2(x, y)); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/df.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/df.h new file mode 100644 index 0000000000000..b5a6462d58e27 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/df.h @@ -0,0 +1,369 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +#if !defined(SLEEF_ENABLE_CUDA) +typedef struct { + vfloat x, y; +} vfloat2; +#else +typedef float2 vfloat2; +#endif + +static INLINE CONST VECTOR_CC vfloat vf2getx_vf_vf2(vfloat2 v) { return v.x; } +static INLINE CONST VECTOR_CC vfloat vf2gety_vf_vf2(vfloat2 v) { return v.y; } +static INLINE CONST VECTOR_CC vfloat2 vf2setxy_vf2_vf_vf(vfloat x, vfloat y) { vfloat2 v; v.x = x; v.y = y; return v; } +static INLINE CONST VECTOR_CC vfloat2 vf2setx_vf2_vf2_vf(vfloat2 v, vfloat d) { v.x = d; return v; } +static INLINE CONST VECTOR_CC vfloat2 vf2sety_vf2_vf2_vf(vfloat2 v, vfloat d) { v.y = d; return v; } +#endif + +static INLINE CONST VECTOR_CC vfloat vupper_vf_vf(vfloat d) { + return vreinterpret_vf_vi2(vand_vi2_vi2_vi2(vreinterpret_vi2_vf(d), vcast_vi2_i(0xfffff000))); +} + +static INLINE CONST VECTOR_CC vfloat2 vcast_vf2_vf_vf(vfloat h, vfloat l) { + return vf2setxy_vf2_vf_vf(h, l); +} + +static INLINE CONST VECTOR_CC vfloat2 vcast_vf2_f_f(float h, float l) { + return vf2setxy_vf2_vf_vf(vcast_vf_f(h), vcast_vf_f(l)); +} + +static INLINE CONST VECTOR_CC vfloat2 vcast_vf2_d(double d) { + return vf2setxy_vf2_vf_vf(vcast_vf_f(d), vcast_vf_f(d - (float)d)); +} + +static INLINE CONST VECTOR_CC vfloat2 vsel_vf2_vo_vf2_vf2(vopmask m, vfloat2 x, vfloat2 y) { + return vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(m, vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)), vsel_vf_vo_vf_vf(m, vf2gety_vf_vf2(x), vf2gety_vf_vf2(y))); +} + +static INLINE CONST VECTOR_CC vfloat2 vsel_vf2_vo_f_f_f_f(vopmask o, float x1, float y1, float x0, float y0) { + return vf2setxy_vf2_vf_vf(vsel_vf_vo_f_f(o, x1, x0), vsel_vf_vo_f_f(o, y1, y0)); +} + +static INLINE CONST VECTOR_CC vfloat2 vsel_vf2_vo_vo_d_d_d(vopmask o0, vopmask o1, double d0, double d1, double d2) { + return vsel_vf2_vo_vf2_vf2(o0, vcast_vf2_d(d0), vsel_vf2_vo_vf2_vf2(o1, vcast_vf2_d(d1), vcast_vf2_d(d2))); +} + +static INLINE CONST VECTOR_CC vfloat2 vsel_vf2_vo_vo_vo_d_d_d_d(vopmask o0, vopmask o1, vopmask o2, double d0, double d1, double d2, double d3) { + return vsel_vf2_vo_vf2_vf2(o0, vcast_vf2_d(d0), vsel_vf2_vo_vf2_vf2(o1, vcast_vf2_d(d1), vsel_vf2_vo_vf2_vf2(o2, vcast_vf2_d(d2), vcast_vf2_d(d3)))); +} + +static INLINE CONST VECTOR_CC vfloat2 vabs_vf2_vf2(vfloat2 x) { + return vcast_vf2_vf_vf(vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0)), vreinterpret_vm_vf(vf2getx_vf_vf2(x))), vreinterpret_vm_vf(vf2getx_vf_vf2(x)))), + vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0)), vreinterpret_vm_vf(vf2getx_vf_vf2(x))), vreinterpret_vm_vf(vf2gety_vf_vf2(x))))); +} + +static INLINE CONST VECTOR_CC vfloat vadd_vf_3vf(vfloat v0, vfloat v1, vfloat v2) { + return vadd_vf_vf_vf(vadd_vf_vf_vf(v0, v1), v2); +} + +static INLINE CONST VECTOR_CC vfloat vadd_vf_4vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3) { + return vadd_vf_3vf(vadd_vf_vf_vf(v0, v1), v2, v3); +} + +static INLINE CONST VECTOR_CC vfloat vadd_vf_5vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3, vfloat v4) { + return vadd_vf_4vf(vadd_vf_vf_vf(v0, v1), v2, v3, v4); +} + +static INLINE CONST VECTOR_CC vfloat vadd_vf_6vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3, vfloat v4, vfloat v5) { + return vadd_vf_5vf(vadd_vf_vf_vf(v0, v1), v2, v3, v4, v5); +} + +static INLINE CONST VECTOR_CC vfloat vadd_vf_7vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3, vfloat v4, vfloat v5, vfloat v6) { + return vadd_vf_6vf(vadd_vf_vf_vf(v0, v1), v2, v3, v4, v5, v6); +} + +static INLINE CONST VECTOR_CC vfloat vsub_vf_3vf(vfloat v0, vfloat v1, vfloat v2) { + return vsub_vf_vf_vf(vsub_vf_vf_vf(v0, v1), v2); +} + +static INLINE CONST VECTOR_CC vfloat vsub_vf_4vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3) { + return vsub_vf_3vf(vsub_vf_vf_vf(v0, v1), v2, v3); +} + +static INLINE CONST VECTOR_CC vfloat vsub_vf_5vf(vfloat v0, vfloat v1, vfloat v2, vfloat v3, vfloat v4) { + return vsub_vf_4vf(vsub_vf_vf_vf(v0, v1), v2, v3, v4); +} + +// + +static INLINE CONST VECTOR_CC vfloat2 dfneg_vf2_vf2(vfloat2 x) { + return vcast_vf2_vf_vf(vneg_vf_vf(vf2getx_vf_vf2(x)), vneg_vf_vf(vf2gety_vf_vf2(x))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfabs_vf2_vf2(vfloat2 x) { + return vcast_vf2_vf_vf(vabs_vf_vf(vf2getx_vf_vf2(x)), + vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2gety_vf_vf2(x)), vand_vm_vm_vm(vreinterpret_vm_vf(vf2getx_vf_vf2(x)), vreinterpret_vm_vf(vcast_vf_f(-0.0f)))))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfnormalize_vf2_vf2(vfloat2 t) { + vfloat s = vadd_vf_vf_vf(vf2getx_vf_vf2(t), vf2gety_vf_vf2(t)); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(vsub_vf_vf_vf(vf2getx_vf_vf2(t), s), vf2gety_vf_vf2(t))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfscale_vf2_vf2_vf(vfloat2 d, vfloat s) { + return vf2setxy_vf2_vf_vf(vmul_vf_vf_vf(vf2getx_vf_vf2(d), s), vmul_vf_vf_vf(vf2gety_vf_vf2(d), s)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd_vf2_vf_vf(vfloat x, vfloat y) { + vfloat s = vadd_vf_vf_vf(x, y); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(vsub_vf_vf_vf(x, s), y)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd2_vf2_vf_vf(vfloat x, vfloat y) { + vfloat s = vadd_vf_vf_vf(x, y); + vfloat v = vsub_vf_vf_vf(s, x); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(vsub_vf_vf_vf(x, vsub_vf_vf_vf(s, v)), vsub_vf_vf_vf(y, v))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd2_vf2_vf_vf2(vfloat x, vfloat2 y) { + vfloat s = vadd_vf_vf_vf(x, vf2getx_vf_vf2(y)); + vfloat v = vsub_vf_vf_vf(s, x); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(vadd_vf_vf_vf(vsub_vf_vf_vf(x, vsub_vf_vf_vf(s, v)), vsub_vf_vf_vf(vf2getx_vf_vf2(y), v)), vf2gety_vf_vf2(y))); + +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd_vf2_vf2_vf(vfloat2 x, vfloat y) { + vfloat s = vadd_vf_vf_vf(vf2getx_vf_vf2(x), y); + return vf2setxy_vf2_vf_vf(s, vadd_vf_3vf(vsub_vf_vf_vf(vf2getx_vf_vf2(x), s), y, vf2gety_vf_vf2(x))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfsub_vf2_vf2_vf(vfloat2 x, vfloat y) { + vfloat s = vsub_vf_vf_vf(vf2getx_vf_vf2(x), y); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(vsub_vf_vf_vf(vsub_vf_vf_vf(vf2getx_vf_vf2(x), s), y), vf2gety_vf_vf2(x))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd2_vf2_vf2_vf(vfloat2 x, vfloat y) { + vfloat s = vadd_vf_vf_vf(vf2getx_vf_vf2(x), y); + vfloat v = vsub_vf_vf_vf(s, vf2getx_vf_vf2(x)); + vfloat t = vadd_vf_vf_vf(vsub_vf_vf_vf(vf2getx_vf_vf2(x), vsub_vf_vf_vf(s, v)), vsub_vf_vf_vf(y, v)); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(t, vf2gety_vf_vf2(x))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd_vf2_vf_vf2(vfloat x, vfloat2 y) { + vfloat s = vadd_vf_vf_vf(x, vf2getx_vf_vf2(y)); + return vf2setxy_vf2_vf_vf(s, vadd_vf_3vf(vsub_vf_vf_vf(x, s), vf2getx_vf_vf2(y), vf2gety_vf_vf2(y))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd_vf2_vf2_vf2(vfloat2 x, vfloat2 y) { + // |x| >= |y| + + vfloat s = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)); + return vf2setxy_vf2_vf_vf(s, vadd_vf_4vf(vsub_vf_vf_vf(vf2getx_vf_vf2(x), s), vf2getx_vf_vf2(y), vf2gety_vf_vf2(x), vf2gety_vf_vf2(y))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfadd2_vf2_vf2_vf2(vfloat2 x, vfloat2 y) { + vfloat s = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)); + vfloat v = vsub_vf_vf_vf(s, vf2getx_vf_vf2(x)); + vfloat t = vadd_vf_vf_vf(vsub_vf_vf_vf(vf2getx_vf_vf2(x), vsub_vf_vf_vf(s, v)), vsub_vf_vf_vf(vf2getx_vf_vf2(y), v)); + return vf2setxy_vf2_vf_vf(s, vadd_vf_vf_vf(t, vadd_vf_vf_vf(vf2gety_vf_vf2(x), vf2gety_vf_vf2(y)))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfsub_vf2_vf_vf(vfloat x, vfloat y) { + // |x| >= |y| + + vfloat s = vsub_vf_vf_vf(x, y); + return vf2setxy_vf2_vf_vf(s, vsub_vf_vf_vf(vsub_vf_vf_vf(x, s), y)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfsub_vf2_vf2_vf2(vfloat2 x, vfloat2 y) { + // |x| >= |y| + + vfloat s = vsub_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)); + vfloat t = vsub_vf_vf_vf(vf2getx_vf_vf2(x), s); + t = vsub_vf_vf_vf(t, vf2getx_vf_vf2(y)); + t = vadd_vf_vf_vf(t, vf2gety_vf_vf2(x)); + return vf2setxy_vf2_vf_vf(s, vsub_vf_vf_vf(t, vf2gety_vf_vf2(y))); +} + +#ifdef ENABLE_FMA_SP +static INLINE CONST VECTOR_CC vfloat2 dfdiv_vf2_vf2_vf2(vfloat2 n, vfloat2 d) { + vfloat t = vrec_vf_vf(vf2getx_vf_vf2(d)); + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(n), t); + vfloat u = vfmapn_vf_vf_vf_vf(t, vf2getx_vf_vf2(n), s); + vfloat v = vfmanp_vf_vf_vf_vf(vf2gety_vf_vf2(d), t, vfmanp_vf_vf_vf_vf(vf2getx_vf_vf2(d), t, vcast_vf_f(1))); + return vf2setxy_vf2_vf_vf(s, vfma_vf_vf_vf_vf(s, v, vfma_vf_vf_vf_vf(vf2gety_vf_vf2(n), t, u))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf_vf(vfloat x, vfloat y) { + vfloat s = vmul_vf_vf_vf(x, y); + return vf2setxy_vf2_vf_vf(s, vfmapn_vf_vf_vf_vf(x, y, s)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfsqu_vf2_vf2(vfloat2 x) { + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)); + return vf2setxy_vf2_vf_vf(s, vfma_vf_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)), vf2gety_vf_vf2(x), vfmapn_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x), s))); +} + +static INLINE CONST VECTOR_CC vfloat dfsqu_vf_vf2(vfloat2 x) { + return vfma_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x), vadd_vf_vf_vf(vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)), vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf2_vf2(vfloat2 x, vfloat2 y) { + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)); + return vf2setxy_vf2_vf_vf(s, vfma_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(y), vfma_vf_vf_vf_vf(vf2gety_vf_vf2(x), vf2getx_vf_vf2(y), vfmapn_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y), s)))); +} + +static INLINE CONST VECTOR_CC vfloat dfmul_vf_vf2_vf2(vfloat2 x, vfloat2 y) { + return vfma_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y), vfma_vf_vf_vf_vf(vf2gety_vf_vf2(x), vf2getx_vf_vf2(y), vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(y)))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf2_vf(vfloat2 x, vfloat y) { + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), y); + return vf2setxy_vf2_vf_vf(s, vfma_vf_vf_vf_vf(vf2gety_vf_vf2(x), y, vfmapn_vf_vf_vf_vf(vf2getx_vf_vf2(x), y, s))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfrec_vf2_vf(vfloat d) { + vfloat s = vrec_vf_vf(d); + return vf2setxy_vf2_vf_vf(s, vmul_vf_vf_vf(s, vfmanp_vf_vf_vf_vf(d, s, vcast_vf_f(1)))); +} + +static INLINE CONST VECTOR_CC vfloat2 dfrec_vf2_vf2(vfloat2 d) { + vfloat s = vrec_vf_vf(vf2getx_vf_vf2(d)); + return vf2setxy_vf2_vf_vf(s, vmul_vf_vf_vf(s, vfmanp_vf_vf_vf_vf(vf2gety_vf_vf2(d), s, vfmanp_vf_vf_vf_vf(vf2getx_vf_vf2(d), s, vcast_vf_f(1))))); +} +#else +static INLINE CONST VECTOR_CC vfloat2 dfdiv_vf2_vf2_vf2(vfloat2 n, vfloat2 d) { + vfloat t = vrec_vf_vf(vf2getx_vf_vf2(d)); + vfloat dh = vupper_vf_vf(vf2getx_vf_vf2(d)), dl = vsub_vf_vf_vf(vf2getx_vf_vf2(d), dh); + vfloat th = vupper_vf_vf(t ), tl = vsub_vf_vf_vf(t , th); + vfloat nhh = vupper_vf_vf(vf2getx_vf_vf2(n)), nhl = vsub_vf_vf_vf(vf2getx_vf_vf2(n), nhh); + + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(n), t); + + vfloat u, w; + w = vcast_vf_f(-1); + w = vmla_vf_vf_vf_vf(dh, th, w); + w = vmla_vf_vf_vf_vf(dh, tl, w); + w = vmla_vf_vf_vf_vf(dl, th, w); + w = vmla_vf_vf_vf_vf(dl, tl, w); + w = vneg_vf_vf(w); + + u = vmla_vf_vf_vf_vf(nhh, th, vneg_vf_vf(s)); + u = vmla_vf_vf_vf_vf(nhh, tl, u); + u = vmla_vf_vf_vf_vf(nhl, th, u); + u = vmla_vf_vf_vf_vf(nhl, tl, u); + u = vmla_vf_vf_vf_vf(s, w, u); + + return vf2setxy_vf2_vf_vf(s, vmla_vf_vf_vf_vf(t, vsub_vf_vf_vf(vf2gety_vf_vf2(n), vmul_vf_vf_vf(s, vf2gety_vf_vf2(d))), u)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf_vf(vfloat x, vfloat y) { + vfloat xh = vupper_vf_vf(x), xl = vsub_vf_vf_vf(x, xh); + vfloat yh = vupper_vf_vf(y), yl = vsub_vf_vf_vf(y, yh); + + vfloat s = vmul_vf_vf_vf(x, y), t; + + t = vmla_vf_vf_vf_vf(xh, yh, vneg_vf_vf(s)); + t = vmla_vf_vf_vf_vf(xl, yh, t); + t = vmla_vf_vf_vf_vf(xh, yl, t); + t = vmla_vf_vf_vf_vf(xl, yl, t); + + return vf2setxy_vf2_vf_vf(s, t); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf2_vf(vfloat2 x, vfloat y) { + vfloat xh = vupper_vf_vf(vf2getx_vf_vf2(x)), xl = vsub_vf_vf_vf(vf2getx_vf_vf2(x), xh); + vfloat yh = vupper_vf_vf(y ), yl = vsub_vf_vf_vf(y , yh); + + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), y), t; + + t = vmla_vf_vf_vf_vf(xh, yh, vneg_vf_vf(s)); + t = vmla_vf_vf_vf_vf(xl, yh, t); + t = vmla_vf_vf_vf_vf(xh, yl, t); + t = vmla_vf_vf_vf_vf(xl, yl, t); + t = vmla_vf_vf_vf_vf(vf2gety_vf_vf2(x), y, t); + + return vf2setxy_vf2_vf_vf(s, t); +} + +static INLINE CONST VECTOR_CC vfloat2 dfmul_vf2_vf2_vf2(vfloat2 x, vfloat2 y) { + vfloat xh = vupper_vf_vf(vf2getx_vf_vf2(x)), xl = vsub_vf_vf_vf(vf2getx_vf_vf2(x), xh); + vfloat yh = vupper_vf_vf(vf2getx_vf_vf2(y)), yl = vsub_vf_vf_vf(vf2getx_vf_vf2(y), yh); + + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)), t; + + t = vmla_vf_vf_vf_vf(xh, yh, vneg_vf_vf(s)); + t = vmla_vf_vf_vf_vf(xl, yh, t); + t = vmla_vf_vf_vf_vf(xh, yl, t); + t = vmla_vf_vf_vf_vf(xl, yl, t); + t = vmla_vf_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(y), t); + t = vmla_vf_vf_vf_vf(vf2gety_vf_vf2(x), vf2getx_vf_vf2(y), t); + + return vf2setxy_vf2_vf_vf(s, t); +} + +static INLINE CONST VECTOR_CC vfloat dfmul_vf_vf2_vf2(vfloat2 x, vfloat2 y) { + vfloat xh = vupper_vf_vf(vf2getx_vf_vf2(x)), xl = vsub_vf_vf_vf(vf2getx_vf_vf2(x), xh); + vfloat yh = vupper_vf_vf(vf2getx_vf_vf2(y)), yl = vsub_vf_vf_vf(vf2getx_vf_vf2(y), yh); + + return vadd_vf_6vf(vmul_vf_vf_vf(vf2gety_vf_vf2(x), yh), vmul_vf_vf_vf(xh, vf2gety_vf_vf2(y)), vmul_vf_vf_vf(xl, yl), vmul_vf_vf_vf(xh, yl), vmul_vf_vf_vf(xl, yh), vmul_vf_vf_vf(xh, yh)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfsqu_vf2_vf2(vfloat2 x) { + vfloat xh = vupper_vf_vf(vf2getx_vf_vf2(x)), xl = vsub_vf_vf_vf(vf2getx_vf_vf2(x), xh); + + vfloat s = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)), t; + + t = vmla_vf_vf_vf_vf(xh, xh, vneg_vf_vf(s)); + t = vmla_vf_vf_vf_vf(vadd_vf_vf_vf(xh, xh), xl, t); + t = vmla_vf_vf_vf_vf(xl, xl, t); + t = vmla_vf_vf_vf_vf(vf2getx_vf_vf2(x), vadd_vf_vf_vf(vf2gety_vf_vf2(x), vf2gety_vf_vf2(x)), t); + + return vf2setxy_vf2_vf_vf(s, t); +} + +static INLINE CONST VECTOR_CC vfloat dfsqu_vf_vf2(vfloat2 x) { + vfloat xh = vupper_vf_vf(vf2getx_vf_vf2(x)), xl = vsub_vf_vf_vf(vf2getx_vf_vf2(x), xh); + + return vadd_vf_5vf(vmul_vf_vf_vf(xh, vf2gety_vf_vf2(x)), vmul_vf_vf_vf(xh, vf2gety_vf_vf2(x)), vmul_vf_vf_vf(xl, xl), vadd_vf_vf_vf(vmul_vf_vf_vf(xh, xl), vmul_vf_vf_vf(xh, xl)), vmul_vf_vf_vf(xh, xh)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfrec_vf2_vf(vfloat d) { + vfloat t = vrec_vf_vf(d); + vfloat dh = vupper_vf_vf(d), dl = vsub_vf_vf_vf(d, dh); + vfloat th = vupper_vf_vf(t), tl = vsub_vf_vf_vf(t, th); + + vfloat u = vcast_vf_f(-1); + u = vmla_vf_vf_vf_vf(dh, th, u); + u = vmla_vf_vf_vf_vf(dh, tl, u); + u = vmla_vf_vf_vf_vf(dl, th, u); + u = vmla_vf_vf_vf_vf(dl, tl, u); + + return vf2setxy_vf2_vf_vf(t, vmul_vf_vf_vf(vneg_vf_vf(t), u)); +} + +static INLINE CONST VECTOR_CC vfloat2 dfrec_vf2_vf2(vfloat2 d) { + vfloat t = vrec_vf_vf(vf2getx_vf_vf2(d)); + vfloat dh = vupper_vf_vf(vf2getx_vf_vf2(d)), dl = vsub_vf_vf_vf(vf2getx_vf_vf2(d), dh); + vfloat th = vupper_vf_vf(t ), tl = vsub_vf_vf_vf(t , th); + + vfloat u = vcast_vf_f(-1); + u = vmla_vf_vf_vf_vf(dh, th, u); + u = vmla_vf_vf_vf_vf(dh, tl, u); + u = vmla_vf_vf_vf_vf(dl, th, u); + u = vmla_vf_vf_vf_vf(dl, tl, u); + u = vmla_vf_vf_vf_vf(vf2gety_vf_vf2(d), t, u); + + return vf2setxy_vf2_vf_vf(t, vmul_vf_vf_vf(vneg_vf_vf(t), u)); +} +#endif + +static INLINE CONST VECTOR_CC vfloat2 dfsqrt_vf2_vf2(vfloat2 d) { +#ifdef ENABLE_RECSQRT_SP + vfloat x = vrecsqrt_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d))); + vfloat2 r = dfmul_vf2_vf2_vf(d, x); + return dfscale_vf2_vf2_vf(dfmul_vf2_vf2_vf2(r, dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf(r, x), vcast_vf_f(-3.0))), vcast_vf_f(-0.5)); +#else + vfloat t = vsqrt_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d))); + return dfscale_vf2_vf2_vf(dfmul_vf2_vf2_vf2(dfadd2_vf2_vf2_vf2(d, dfmul_vf2_vf_vf(t, t)), dfrec_vf2_vf(t)), vcast_vf_f(0.5)); +#endif +} + +static INLINE CONST VECTOR_CC vfloat2 dfsqrt_vf2_vf(vfloat d) { + vfloat t = vsqrt_vf_vf(d); + return dfscale_vf2_vf2_vf(dfmul_vf2_vf2_vf2(dfadd2_vf2_vf_vf2(d, dfmul_vf2_vf_vf(t, t)), dfrec_vf2_vf(t)), vcast_vf_f(0.5f)); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/estrin.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/estrin.h new file mode 100644 index 0000000000000..1953ac6a6f2ce --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/estrin.h @@ -0,0 +1,40 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// These are macros for evaluating polynomials using Estrin's method + +#define POLY2(x, c1, c0) MLA(x, C2V(c1), C2V(c0)) +#define POLY3(x, x2, c2, c1, c0) MLA(x2, C2V(c2), MLA(x, C2V(c1), C2V(c0))) +#define POLY4(x, x2, c3, c2, c1, c0) MLA(x2, MLA(x, C2V(c3), C2V(c2)), MLA(x, C2V(c1), C2V(c0))) +#define POLY5(x, x2, x4, c4, c3, c2, c1, c0) MLA(x4, C2V(c4), POLY4(x, x2, c3, c2, c1, c0)) +#define POLY6(x, x2, x4, c5, c4, c3, c2, c1, c0) MLA(x4, POLY2(x, c5, c4), POLY4(x, x2, c3, c2, c1, c0)) +#define POLY7(x, x2, x4, c6, c5, c4, c3, c2, c1, c0) MLA(x4, POLY3(x, x2, c6, c5, c4), POLY4(x, x2, c3, c2, c1, c0)) +#define POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0) MLA(x4, POLY4(x, x2, c7, c6, c5, c4), POLY4(x, x2, c3, c2, c1, c0)) +#define POLY9(x, x2, x4, x8, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, C2V(c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY10(x, x2, x4, x8, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY2(x, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY11(x, x2, x4, x8, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY3(x, x2, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY12(x, x2, x4, x8, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY4(x, x2, cb, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY13(x, x2, x4, x8, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY5(x, x2, x4, cc, cb, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY14(x, x2, x4, x8, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY6(x, x2, x4, cd, cc, cb, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY15(x, x2, x4, x8, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY7(x, x2, x4, ce, cd, cc, cb, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x8, POLY8(x, x2, x4, cf, ce, cd, cc, cb, ca, c9, c8), POLY8(x, x2, x4, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY17(x, x2, x4, x8, x16, d0, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x16, C2V(d0), POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY18(x, x2, x4, x8, x16, d1, d0, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x16, POLY2(x, d1, d0), POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY19(x, x2, x4, x8, x16, d2, d1, d0, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x16, POLY3(x, x2, d2, d1, d0), POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY20(x, x2, x4, x8, x16, d3, d2, d1, d0, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x16, POLY4(x, x2, d3, d2, d1, d0), POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)) +#define POLY21(x, x2, x4, x8, x16, d4, d3, d2, d1, d0, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)\ + MLA(x16, POLY5(x, x2, x4, d4, d3, d2, d1, d0), POLY16(x, x2, x4, x8, cf, ce, cd, cc, cb, ca, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/f128util.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/f128util.h new file mode 100644 index 0000000000000..d9cef1510ee7b --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/f128util.h @@ -0,0 +1,92 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +static __float128 mpfr_get_f128(mpfr_t m, mpfr_rnd_t rnd) { + if (isnan(mpfr_get_d(m, GMP_RNDN))) return __builtin_nan(""); + + mpfr_t frr, frd; + mpfr_inits(frr, frd, NULL); + + mpfr_exp_t e; + mpfr_frexp(&e, frr, m, GMP_RNDN); + + double d0 = mpfr_get_d(frr, GMP_RNDN); + mpfr_set_d(frd, d0, GMP_RNDN); + mpfr_sub(frr, frr, frd, GMP_RNDN); + + double d1 = mpfr_get_d(frr, GMP_RNDN); + mpfr_set_d(frd, d1, GMP_RNDN); + mpfr_sub(frr, frr, frd, GMP_RNDN); + + double d2 = mpfr_get_d(frr, GMP_RNDN); + + mpfr_clears(frr, frd, NULL); + return ldexpq((__float128)d2 + (__float128)d1 + (__float128)d0, e); +} + +static void mpfr_set_f128(mpfr_t frx, __float128 f, mpfr_rnd_t rnd) { + char s[128]; + quadmath_snprintf(s, 120, "%.50Qg", f); + mpfr_set_str(frx, s, 10, rnd); +} + +static void printf128(__float128 f) { + char s[128]; + quadmath_snprintf(s, 120, "%.50Qg", f); + printf("%s", s); +} + +static char frstr[16][1000]; +static int frstrcnt = 0; + +static char *toBC(double d) { + union { + double d; + uint64_t u64; + int64_t i64; + } cnv; + + cnv.d = d; + + int64_t l = cnv.i64; + int e = (int)((l >> 52) & ~(-1L << 11)); + int s = (int)(l >> 63); + l = d == 0 ? 0 : ((l & ~((-1L) << 52)) | (1L << 52)); + + char *ptr = frstr[(frstrcnt++) & 15]; + + sprintf(ptr, "%s%lld*2^%d", s != 0 ? "-" : "", (long long int)l, (e-0x3ff-52)); + return ptr; +} + +static char *toBCq(__float128 d) { + union { + __float128 d; + __uint128_t u128; + } cnv; + + cnv.d = d; + + __uint128_t m = cnv.u128; + int e = (int)((m >> 112) & ~(-1L << 15)); + int s = (int)(m >> 127); + m = d == 0 ? 0 : ((m & ((((__uint128_t)1) << 112)-1)) | ((__uint128_t)1 << 112)); + + uint64_t h = m / UINT64_C(10000000000000000000); + uint64_t l = m % UINT64_C(10000000000000000000); + + char *ptr = frstr[(frstrcnt++) & 15]; + + sprintf(ptr, "%s%" PRIu64 "%019" PRIu64 "*2^%d", s != 0 ? "-" : "", h, l, (e-0x3fff-112)); + + return ptr; +} + +static int xisnanq(Sleef_quad x) { return x != x; } +static int xisinfq(Sleef_quad x) { return x == (Sleef_quad)__builtin_inf() || x == -(Sleef_quad)__builtin_inf(); } +static int xisfiniteq(Sleef_quad x) { return !xisnanq(x) && !isinfq(x); } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/keywords.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/keywords.txt new file mode 100644 index 0000000000000..659fa5e103486 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/keywords.txt @@ -0,0 +1,683 @@ +double2 +double3 +float2 +atan2k +atan2kf +atan2kf_u1 +atan2k_u1 +cospik +cospifk +dd +dd2 +dd2geta_vd2_dd2 +dd2getb_vd2_dd2 +dd2setab_dd2_vd2_vd2 +ddabs_vd2_vd2 +ddadd2_vd2_vd2_vd +ddadd2_vd2_vd2_vd2 +ddadd2_vd2_vd_vd +ddadd2_vd2_vd_vd2 +ddadd_vd2_vd2_vd +ddadd_vd2_vd2_vd2 +ddadd_vd2_vd_vd +ddadd_vd2_vd_vd2 +dddiv_vd2_vd2_vd2 +ddi +ddi_t +ddigetdd_vd2_ddi +ddigeti_vi_ddi +ddisetdd_ddi_ddi_vd2 +ddisetddi_ddi_vd2_vi +ddmla_vd2_vd2_vd2_vd2 +ddmla_vd2_vd_vd2_vd2 +ddmul_vd2_vd2_vd +ddmul_vd2_vd2_vd2 +ddmul_vd2_vd_vd +ddmul_vd_vd2_vd2 +ddneg_vd2_vd2 +ddnormalize_vd2_vd2 +ddrec_vd2_vd +ddrec_vd2_vd2 +ddscale_vd2_vd2_d +ddscale_vd2_vd2_vd +ddsqrt_vd2_vd +ddsqrt_vd2_vd2 +ddsqu_vd2_vd2 +ddsqu_vd_vd2 +ddsub_vd2_vd2_vd +ddsub_vd2_vd2_vd2 +ddsub_vd2_vd_vd +df +df2 +df2geta_vf2_df2 +df2getb_vf2_df2 +df2setab_df2_vf2_vf2 +dfabs_vf2_vf2 +dfadd2_vf2_vf2_vf +dfadd2_vf2_vf2_vf2 +dfadd2_vf2_vf_vf +dfadd2_vf2_vf_vf2 +dfadd_vf2_vf2_vf +dfadd_vf2_vf2_vf2 +dfadd_vf2_vf_vf +dfadd_vf2_vf_vf2 +dfdiv_vf2_vf2_vf2 +dfi +dfi_t +dfigetdf_vf2_dfi +dfigeti_vi2_dfi +dfisetdf_dfi_dfi_vf2 +dfisetdfi_dfi_vf2_vi2 +dfmla_vf2_vf_vf2_vf2 +dfmul_vf2_vf2_vf +dfmul_vf2_vf2_vf2 +dfmul_vf2_vf_vf +dfmul_vf_vf2_vf2 +dfneg_vf2_vf2 +dfnormalize_vf2_vf2 +dfrec_vf2_vf +dfrec_vf2_vf2 +dfscale_vf2_vf2_vf +dfsqrt_vf2_vf +dfsqrt_vf2_vf2 +dfsqu_vf2_vf2 +dfsqu_vf_vf2 +dfsub_vf2_vf2_vf +dfsub_vf2_vf2_vf2 +dfsub_vf2_vf_vf +di_t +digetd_vd_di +digeti_vi_di +disetdi_di_vd_vi +expk +expk2 +expk2f +expk3f +expkf +expm1fk +expm1k +fi_t +figetd_vf_di +figeti_vi2_di +fisetdi_fi_vf_vi2 +gammafk +gammak +imdvq_vq_vm_vm +logk +logk2 +logk2f +logk3f +logkf +poly2dd +poly2dd_b +poly2df +poly2df_b +poly4dd +poly4df +pragma +rempi +rempif +rempisub +rempisubf +sinpifk +sinpik +td +tdi_t +tdigeti_vi_tdi +tdigettd_vd3_tdi +tdigetx_vd_tdi +tdisettdi_tdi_vd3_vi +tdx +tdxgetd3_vd3_tdx +tdxgetd3x_vd_tdx +tdxgetd3y_vd_tdx +tdxgetd3z_vd_tdx +tdxgete_vm_tdx +tdxsetd3_tdx_tdx_vd3 +tdxsete_tdx_tdx_vm +tdxseted3_tdx_vm_vd3 +tdxsetexyz_tdx_vm_vd_vd_vd +tdxsetx_tdx_tdx_vd +tdxsetxyz_tdx_tdx_vd_vd_vd +tdxsety_tdx_tdx_vd +tdxsetz_tdx_tdx_vd +vabs_vd_vd +vabs_vf2_vf2 +vabs_vf_vf +add128_vq_vq_vq +vadd64_vm_vm_vm +vadd_vd_3vd +vadd_vd_4vd +vadd_vd_5vd +vadd_vd_6vd +vadd_vd_7vd +vadd_vd_vd_vd +vadd_vf_3vf +vadd_vf_4vf +vadd_vf_5vf +vadd_vf_6vf +vadd_vf_7vf +vadd_vf_vf_vf +vadd_vi2_vi2_vi2 +vadd_vi_vi_vi +vand_vi2_vi2_vi2 +vand_vi2_vo_vi2 +vand_vi_vi_vi +vand_vi_vo_vi +vand_vm_vm_vm +vand_vm_vo32_vm +vand_vm_vo64_vm +vand_vo_vo_vo +vandnot_vi2_vi2_vi2 +vandnot_vi2_vo_vi2 +vandnot_vi_vi_vi +vandnot_vi_vo_vi +vandnot_vm_vm_vm +vandnot_vm_vo32_vm +vandnot_vm_vo64_vm +vandnot_vo_vo_vo +vargquad +vavailability_i +cast_aq_vq +vcast_d_vd +vcast_f_vf +vcast_vd2_d2 +vcast_vd2_d_d +vcast_vd2_vd_vd +vcast_vd_d +vcast_vd_vi +vcast_vd_vm +vcast_vf2_d +vcast_vf2_f_f +vcast_vf2_vf_vf +vcast_vf_f +vcast_vf_vi2 +vcast_vi2_i +vcast_vi2_i_i +vcast_vi2_vm +vcast_vi_i +vcast_vi_vm +vcast_vm_i64 +vcast_vm_i_i +vcast_vm_u64 +vcast_vm_vi +vcast_vm_vi2 +vcast_vm_vo +vcast_vo_i +vcast_vo32_vo64 +vcast_vo64_vo32 +cast_vq_aq +vclearlsb_vd_vd_i +vcopysign_vd_vd_vd +vcopysign_vf_vf_vf +vd +vd2getx_vd_vd2 +vd2gety_vd_vd2 +vd2setx_vd2_vd2_vd +vd2setxy_vd2_vd_vd +vd2sety_vd2_vd2_vd +vd3getx_vd_vd3 +vd3gety_vd_vd3 +vd3getz_vd_vd3 +vd3setx_vd3_vd3_vd +vd3setxyz_vd3_vd_vd_vd +vd3sety_vd3_vd3_vd +vd3setz_vd3_vd3_vd +vdiv_vd_vd_vd +vdiv_vf_vf_vf +vdouble +vdouble2 +vdouble3 +veq64_vo_vm_vm +veq_vi2_vi2_vi2 +veq_vi_vi_vi +veq_vo_vd_vd +veq_vo_vf_vf +veq_vo_vi2_vi2 +veq_vo_vi_vi +versatileVector +vf2getx_vf_vf2 +vf2gety_vf_vf2 +vf2setx_vf2_vf2_vf +vf2setxy_vf2_vf_vf +vf2sety_vf2_vf2_vf +vfloat +vfloat2 +vfma_vd_vd_vd_vd +vfma_vf_vf_vf_vf +vfmann_vd_vd_vd_vd +vfmann_vf_vf_vf_vf +vfmanp_vd_vd_vd_vd +vfmanp_vf_vf_vf_vf +vfmapn_vd_vd_vd_vd +vfmapn_vf_vf_vf_vf +vfmapp_vd_vd_vd_vd +vfmapp_vf_vf_vf_vf +vgather_vd_p_vi +vgather_vf_p_vi2 +vge_vo_vd_vd +vge_vo_vf_vf +vgetexp_vd_vd +vgetexp_vf_vf +vgetmant_vd_vd +vgetmant_vf_vf +vgt64_vo_vm_vm +vgt_vi2_vi2_vi2 +vgt_vi_vi_vi +vgt_vo_vd_vd +vgt_vo_vf_vf +vgt_vo_vi2_vi2 +vgt_vo_vi_vi +vilogb2k_vi2_vf +vilogb2k_vi_vd +vilogb2k_vm_vd +vilogb3k_vm_vd +vilogbk_vi2_vf +vilogbk_vi_vd +vilogbk_vm_vd +vint +vint2 +vint64 +visinf2_vd_vd_vd +visinf2_vf_vf_vf +visinf_vo_vd +visinf_vo_vf +visint_vo_vd +visint_vo_vf +visminf_vo_vd +visminf_vo_vf +visnan_vo_vd +visnan_vo_vf +visnegzero_vo_vd +visnegzero_vo_vf +visnonfinite_vo_vd +visnumber_vo_vd +visnumber_vo_vf +visodd_vo_vd +vispinf_vo_vd +vispinf_vo_vf +vldexp1_vd_vd_vm +vldexp2_vd_vd_vi +vldexp2_vd_vd_vm +vldexp2_vf_vf_vi2 +vldexp3_vd_vd_vi +vldexp3_vd_vd_vm +vldexp3_vf_vf_vi2 +vldexp_vd_vd_vi +vldexp_vf_vf_vi2 +vle_vo_vd_vd +vle_vo_vf_vf +vload_vd_p +vload_vf_p +vloadu_vd_p +vloadu_vf_p +vloadu_vi2_p +vloadu_vi_p +loadu_vq_p +vlt64_vo_vm_vm +vlt_vo_vd_vd +vlt_vo_vf_vf +vmask +vmax_vd_vd_vd +vmax_vf_vf_vf +vmin_vd_vd_vd +vmin_vf_vf_vf +vmla_vd_vd_vd_vd +vmla_vf_vf_vf_vf +vmlanp_vd_vd_vd_vd +vmlanp_vf_vf_vf_vf +vmlapn_vd_vd_vd_vd +vmlapn_vf_vf_vf_vf +vmlsubadd_vd_vd_vd_vd +vmlsubadd_vf_vf_vf_vf +vmul_vd_vd_vd +vmul_vf_vf_vf +vmulsign_vd_vd_vd +vmulsign_vf_vf_vf +vneg64_vm_vm +vneg_vd_vd +vneg_vf_vf +vneg_vi2_vi2 +vneg_vi_vi +vnegpos_vd_vd +vnegpos_vf_vf +vneq_vo_vd_vd +vneq_vo_vf_vf +vnot_vo32_vo32 +vnot_vo64_vo64 +vopmask +vor_vi2_vi2_vi2 +vor_vi_vi_vi +vor_vm_vm_vm +vor_vm_vo32_vm +vor_vm_vo64_vm +vor_vo_vo_vo +vorsign_vd_vd_vd +vorsign_vf_vf_vf +vposneg_vd_vd +vposneg_vf_vf +vpow2i_vd_vi +vpow2i_vd_vm +vpow2i_vf_vi2 +vprefetch_v_p +vptrunc_vd_vd +vptrunc_vf_vf +vqgetx_vm_vq +vqgety_vm_vq +vqsetx_vq_vq_vm +vqsetxy_vq_vm_vm +vqsety_vq_vq_vm +vquad +vrec_vd_vd +vrec_vf_vf +vreinterpret_vd_vf +vreinterpret_vd_vm +vreinterpret_vf_vd +vreinterpret_vf_vi2 +vreinterpret_vf_vm +vreinterpret_vi2_vf +vreinterpret_vi64_vm +vreinterpret_vm_vd +vreinterpret_vm_vf +vreinterpret_vm_vi64 +vreinterpret_vm_vu64 +vreinterpret_vu64_vm +vrev21_vd_vd +vrev21_vf_vf +vreva2_vd_vd +vreva2_vf_vf +vrint_vd_vd +vrint2_vd_vd +vrint_vf_vf +vrint_vi2_vf +vrint_vi_vd +vrintfk2_vf_vf +vrintk2_vd_vd +vscatter2_v_p_i_i_vd +vscatter2_v_p_i_i_vf +vsel_vd2_vo_d_d_d_d +vsel_vd2_vo_vd2_vd2 +vsel_vd_vo_d_d +vsel_vd_vo_vd_vd +vsel_vd_vo_vo_d_d_d +vsel_vd_vo_vo_vo_d_d_d_d +vsel_vf2_vo_f_f_f_f +vsel_vf2_vo_vf2_vf2 +vsel_vf2_vo_vo_d_d_d +vsel_vf2_vo_vo_vo_d_d_d_d +vsel_vf_vo_f_f +vsel_vf_vo_vf_vf +vsel_vf_vo_vo_f_f_f +vsel_vf_vo_vo_vo_f_f_f_f +vsel_vi2_vf_vf_vi2_vi2 +vsel_vi2_vf_vi2 +vsel_vi2_vo_vi2_vi2 +vsel_vi_vd_vd_vi_vi +vsel_vi_vd_vi +vsel_vi_vo_vi_vi +vsel_vm_vo64_vm_vm +sel_vq_vo_vq_vq +vsign_vd_vd +vsign_vf_vf +vsignbit_vm_vd +vsignbit_vm_vf +vsignbit_vo_vd +vsignbit_vo_vf +vsll_vi2_vi2_i +vsll_vi_vi_i +vsqrt_vd_vd +vsqrt_vf_vf +vsra_vi2_vi2_i +vsra_vi_vi_i +vsrl_vi2_vi2_i +vsrl_vi_vi_i +vsscatter2_v_p_i_i_vd +vsscatter2_v_p_i_i_vf +vstore_v_p_vd +vstore_v_p_vf +vstoreu_v_p_vd +vstoreu_v_p_vf +vstoreu_v_p_vi +vstoreu_v_p_vi2 +storeu_v_p_vq +vstream_v_p_vd +vstream_v_p_vf +vsub64_vm_vm_vm +vsub_vd_3vd +vsub_vd_4vd +vsub_vd_5vd +vsub_vd_6vd +vsub_vd_vd_vd +vsub_vf_3vf +vsub_vf_4vf +vsub_vf_5vf +vsub_vf_vf_vf +vsub_vi2_vi2_vi2 +vsub_vi_vi_vi +vsubadd_vd_vd_vd +vsubadd_vf_vf_vf +vtestallones_i_vo32 +vtestallones_i_vo64 +vtestallzeros_i_vo64 +vtoward0_vd_vd +vtoward0_vf_vf +vtruncate_vd_vd +vtruncate2_vd_vd +vtruncate_vf_vf +vtruncate_vi2_vf +vtruncate_vi_vd +vtruncate_vm_vd +vugt64_vo_vm_vm +vuint64 +vupper_vd_vd +vupper_vf_vf +vxor_vi2_vi2_vi2 +vxor_vi_vi_vi +vxor_vm_vm_vm +vxor_vm_vo32_vm +vxor_vm_vo64_vm +vxor_vo_vo_vo +# +abs_tdx_tdx +abs_vd3_vd3 +acos_tdx_tdx +acosh_tdx_tdx +add2_vd3_vd2_vd3 +add2_vd3_vd3_vd3 +add2_vd3_vd_vd3 +add_tdx_tdx_tdx +add_vd3_vd2_vd3 +add_vd3_vd_vd3 +asin_tdx_tdx +asinh_tdx_tdx +atan2_tdx_tdx_tdx +atan_tdx_tdx +atanh_tdx_tdx +cast_tdx_d +cast_tdx_d_d_d +cast_tdx_vd +cast_tdx_vd3 +cast_tdx_vq +cast_vd3_d3 +cast_vd3_d_d_d +cast_vd3_tdx +cast_vd3_vd_vd_vd +cast_vd_tdx +cast_vq_tdx +cmp_vm_tdx_tdx +cmpcnv_vq_vq +cos_tdx_tdx +cosh_tdx_tdx +div2_vd3_vd3_vd3 +div_tdx_tdx_tdx +div_vd3_vd3_vd3 +eq_vo_tdx_tdx +exp10_tdx_tdx +exp10i +exp10tab +exp2_tdx_tdx +exp_tdx_tdx +expm1_tdx_tdx +fastcast_tdx_vd3 +fastcast_tdx_vq +fastcast_vq_tdx +ge_vo_tdx_tdx +gt_vo_tdx_tdx +ilogb_vm_tdx +isinf_vo_vq +isint_vo_tdx +isminf_vo_vq +isnan_vo_tdx +isnan_vo_vq +isnonfinite_vo_vq +isnonfinite_vo_vq_vq +isnonfinite_vo_vq_vq_vq +isodd_vo_tdx +ispinf_vo_vq +iszero_vo_tdx +iszero_vo_vq +le_vo_tdx_tdx +log10_tdx_tdx +log1p_tdx_tdx +log2_tdx_tdx +log_tdx_tdx +logk_tdx_tdx +lt_vo_tdx_tdx +mla_vd3_vd3_vd3_vd3 +modf_tdx_tdx_ptdx +mul2_vd3_vd3_vd3 +mul_tdx_tdx_tdx +mul_vd3_vd2_vd2 +mul_vd3_vd2_vd3 +mul_vd3_vd3_vd +mul_vd3_vd3_vd2 +mul_vd3_vd3_vd3 +mulsign_tdx_tdx_vd +mulsign_vd3_vd3_vd +mulsign_vq_vq_vq +neg_tdx_tdx +neg_vd3_vd3 +neq_vo_tdx_tdx +normalize_vd3_vd3 +poly10dd +poly10dd_b +poly11dd +poly11dd_b +poly12dd +poly12dd_b +poly13dd +poly13dd_b +poly14dd +poly14dd_b +poly15dd +poly15dd_b +poly16dd +poly16dd_b +poly17dd +poly17dd_b +poly18dd +poly18dd_b +poly19dd +poly19dd_b +poly20dd +poly20dd_b +poly21dd +poly21dd_b +poly22dd +poly22dd_b +poly23dd +poly23dd_b +poly24dd +poly24dd_b +poly25dd +poly25dd_b +poly26dd +poly26dd_b +poly27dd +poly27dd_b +poly2d +poly2td +poly2td_b +poly3d +poly3dd +poly3dd_b +poly3td +poly3td_b +poly4d +poly4dd_b +poly4td +poly4td_b +poly5d +poly5dd +poly5dd_b +poly5td +poly5td_b +poly6d +poly6dd +poly6dd_b +poly6td +poly6td_b +poly7d +poly7dd +poly7dd_b +poly7td +poly7td_b +poly8d +poly8dd +poly8dd_b +poly8td +poly8td_b +poly9dd +poly9dd_b +pow_tdx_tdx_tdx +quickrenormalize_vd3_vd3 +quicktwosum_vd2_vd_vd +rec_vd3_vd2 +rec_vd3_vd3 +rempio2q +scale_vd3_vd3_d +scale_vd3_vd3_vd +scaleadd2_vd3_vd3_vd3_vd +scalesub2_vd3_vd3_vd3_vd +sel_tdx_vo_tdx_tdx +sel_vd3_vo_vd3_vd3 +signbit_vo_tdx +sin_tdx_tdx +sinh_tdx_tdx +slowcast_vq_tdx +snprintquad +snprintquadhex +sqrt_tdx_tdx +sqrt_vd3_vd3 +squ_vd3_vd3 +sub2_vd3_vd3_vd3 +sub_tdx_tdx_tdx +tan_tdx_tdx +tanh_tdx_tdx +twoprod_vd2_vd_vd +twosub_vd2_vd_vd +twosubx_vd2_vd_vd_vd +twosum_vd2_vd_vd +twosumx_vd2_vd_vd_vd +vtruncate2_vd_vd +vfloor2_vd_vd +vceil2_vd_vd +vround2_vd_vd +isinf_vo_tdx +trunc_tdx_tdx +rint_tdx_tdx +fmod_tdx_tdx_tdx +remainder_tdx_tdx_tdx +cbrt_tdx_tdx +frexp_tdx_tdx_pvi +fma_tdx_tdx_tdx_tdx +hypot_tdx_tdx_tdx +ilogb_vi_tdx +ldexp_tdx_tdx_vi +Sleef_rempitabsp +Sleef_rempitabdp +Sleef_rempitabqp +vcastu_vm_vi +vcastu_vi_vm +rvv_sp_vopmask +rvv_dp_vopmask diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/main_checkfeature.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/main_checkfeature.c new file mode 100644 index 0000000000000..b5d7b9a07f3a1 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/main_checkfeature.c @@ -0,0 +1,50 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +static jmp_buf sigjmp; +#define SETJMP(x) setjmp(x) +#define LONGJMP longjmp +#else +static sigjmp_buf sigjmp; +#define SETJMP(x) sigsetjmp(x, 1) +#define LONGJMP siglongjmp +#endif + +int main2(int argc, char **argv); +int check_feature(double, float); + +static void sighandler(int signum) { + LONGJMP(sigjmp, 1); +} + +int detectFeature() { + signal(SIGILL, sighandler); + + if (SETJMP(sigjmp) == 0) { + int r = check_feature(1.0, 1.0f); + signal(SIGILL, SIG_DFL); + return r; + } else { + signal(SIGILL, SIG_DFL); + return 0; + } +} + +int main(int argc, char **argv) { + if (!detectFeature()) { + printf("0\n"); + fclose(stdout); + exit(0); + } + + return main2(argc, argv); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/misc.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/misc.h new file mode 100644 index 0000000000000..472cae68bd571 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/misc.h @@ -0,0 +1,332 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// + +#ifndef __MISC_H__ +#define __MISC_H__ + +#if !defined(SLEEF_GENHEADER) +#include +#include +#endif + +#ifndef M_PI +#define M_PI 3.141592653589793238462643383279502884 +#endif + +#ifndef M_PIl +#define M_PIl 3.141592653589793238462643383279502884L +#endif + +#ifndef M_1_PI +#define M_1_PI 0.318309886183790671537767526745028724 +#endif + +#ifndef M_1_PIl +#define M_1_PIl 0.318309886183790671537767526745028724L +#endif + +#ifndef M_2_PI +#define M_2_PI 0.636619772367581343075535053490057448 +#endif + +#ifndef M_2_PIl +#define M_2_PIl 0.636619772367581343075535053490057448L +#endif + +#if !defined(SLEEF_GENHEADER) + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#endif + +#define SLEEF_SNAN (((union { long long int i; double d; }) { .i = INT64_C(0x7ff0000000000001) }).d) +#define SLEEF_SNANf (((union { long int i; float f; }) { .i = 0xff800001 }).f) + +#define SLEEF_FLT_MIN 0x1p-126 +#define SLEEF_DBL_MIN 0x1p-1022 +#define SLEEF_INT_MAX 2147483647 +#define SLEEF_DBL_DENORM_MIN 4.9406564584124654e-324 +#define SLEEF_FLT_DENORM_MIN 1.40129846e-45F + +// + +/* + PI_A to PI_D are constants that satisfy the following two conditions. + + * For PI_A, PI_B and PI_C, the last 28 bits are zero. + * PI_A + PI_B + PI_C + PI_D is close to PI as much as possible. + + The argument of a trig function is multiplied by 1/PI, and the + integral part is divided into two parts, each has at most 28 + bits. So, the maximum argument that could be correctly reduced + should be 2^(28*2-1) PI = 1.1e+17. However, due to internal + double precision calculation, the actual maximum argument that can + be correctly reduced is around 2^47. + */ + +#define PI_A 3.1415926218032836914 +#define PI_B 3.1786509424591713469e-08 +#define PI_C 1.2246467864107188502e-16 +#define PI_D 1.2736634327021899816e-24 +#define TRIGRANGEMAX 1e+14 + +/* + PI_A2 and PI_B2 are constants that satisfy the following two conditions. + + * The last 3 bits of PI_A2 are zero. + * PI_A2 + PI_B2 is close to PI as much as possible. + + The argument of a trig function is multiplied by 1/PI, and the + integral part is multiplied by PI_A2. So, the maximum argument that + could be correctly reduced should be 2^(3-1) PI = 12.6. By testing, + we confirmed that it correctly reduces the argument up to around 15. + */ + +#define PI_A2 3.141592653589793116 +#define PI_B2 1.2246467991473532072e-16 +#define TRIGRANGEMAX2 15 + +#define M_2_PI_H 0.63661977236758138243 +#define M_2_PI_L -3.9357353350364971764e-17 + +#define SQRT_DBL_MAX 1.3407807929942596355e+154 + +#define TRIGRANGEMAX3 1e+9 + +#define M_4_PI 1.273239544735162542821171882678754627704620361328125 + +#define L2U .69314718055966295651160180568695068359375 +#define L2L .28235290563031577122588448175013436025525412068e-12 +#define R_LN2 1.442695040888963407359924681001892137426645954152985934135449406931 + +#define L10U 0.30102999566383914498 // log 2 / log 10 +#define L10L 1.4205023227266099418e-13 +#define LOG10_2 3.3219280948873623478703194294893901758648313930 + +#define L10Uf 0.3010253906f +#define L10Lf 4.605038981e-06f + +// + +#define PI_Af 3.140625f +#define PI_Bf 0.0009670257568359375f +#define PI_Cf 6.2771141529083251953e-07f +#define PI_Df 1.2154201256553420762e-10f +#define TRIGRANGEMAXf 39000 + +#define PI_A2f 3.1414794921875f +#define PI_B2f 0.00011315941810607910156f +#define PI_C2f 1.9841872589410058936e-09f +#define TRIGRANGEMAX2f 125.0f + +#define TRIGRANGEMAX4f 8e+6f + +#define SQRT_FLT_MAX 18446743523953729536.0 + +#define L2Uf 0.693145751953125f +#define L2Lf 1.428606765330187045e-06f + +#define R_LN2f 1.442695040888963407359924681001892137426645954152985934135449406931f +#ifndef M_PIf +# define M_PIf ((float)M_PI) +#endif + +// + +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + +#ifndef ABS +#define ABS(x) ((x) < 0 ? -(x) : (x)) +#endif + +#define stringify(s) stringify_(s) +#define stringify_(s) #s + +#if !defined(SLEEF_GENHEADER) +typedef long double longdouble; +#endif + +#if !defined(Sleef_double2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_double2_DEFINED +typedef struct { + double x, y; +} Sleef_double2; +#endif + +#if !defined(Sleef_float2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_float2_DEFINED +typedef struct { + float x, y; +} Sleef_float2; +#endif + +#if !defined(Sleef_longdouble2_DEFINED) && !defined(SLEEF_GENHEADER) +#define Sleef_longdouble2_DEFINED +typedef struct { + long double x, y; +} Sleef_longdouble2; +#endif + +#if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#define LIKELY(condition) __builtin_expect(!!(condition), 1) +#define UNLIKELY(condition) __builtin_expect(!!(condition), 0) +#define RESTRICT __restrict__ + +#ifndef __arm__ +#define ALIGNED(x) __attribute__((aligned(x))) +#else +#define ALIGNED(x) +#endif + +#if defined(SLEEF_GENHEADER) + +#define INLINE SLEEF_ALWAYS_INLINE +#define EXPORT SLEEF_INLINE +#define CONST SLEEF_CONST +#define NOEXPORT + +#else // #if defined(SLEEF_GENHEADER) + +#define CONST __attribute__((const)) +#define INLINE __attribute__((always_inline)) + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) +#ifndef SLEEF_STATIC_LIBS +#define EXPORT __stdcall __declspec(dllexport) +#define NOEXPORT +#else // #ifndef SLEEF_STATIC_LIBS +#define EXPORT +#define NOEXPORT +#endif // #ifndef SLEEF_STATIC_LIBS +#else // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) +#define EXPORT __attribute__((visibility("default"))) +#define NOEXPORT __attribute__ ((visibility ("hidden"))) +#endif // #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) + +#endif // #if defined(SLEEF_GENHEADER) + +#define SLEEF_NAN __builtin_nan("") +#define SLEEF_NANf __builtin_nanf("") +#define SLEEF_NANl __builtin_nanl("") +#define SLEEF_INFINITY __builtin_inf() +#define SLEEF_INFINITYf __builtin_inff() +#define SLEEF_INFINITYl __builtin_infl() + +#if defined(__INTEL_COMPILER) || defined (__clang__) +#define SLEEF_INFINITYq __builtin_inf() +#define SLEEF_NANq __builtin_nan("") +#else +#define SLEEF_INFINITYq __builtin_infq() +#define SLEEF_NANq (SLEEF_INFINITYq - SLEEF_INFINITYq) +#endif + +#elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#if defined(SLEEF_GENHEADER) + +#define INLINE SLEEF_ALWAYS_INLINE +#define CONST SLEEF_CONST +#define EXPORT SLEEF_INLINE +#define NOEXPORT + +#else // #if defined(SLEEF_GENHEADER) + +#define INLINE __forceinline +#define CONST +#ifndef SLEEF_STATIC_LIBS +#define EXPORT __declspec(dllexport) +#define NOEXPORT +#else +#define EXPORT +#define NOEXPORT +#endif + +#endif // #if defined(SLEEF_GENHEADER) + +#define RESTRICT +#define ALIGNED(x) +#define LIKELY(condition) (condition) +#define UNLIKELY(condition) (condition) + +#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) && !defined(SLEEF_GENHEADER) +#include +#endif + +#define SLEEF_INFINITY (1e+300 * 1e+300) +#define SLEEF_NAN (SLEEF_INFINITY - SLEEF_INFINITY) +#define SLEEF_INFINITYf ((float)SLEEF_INFINITY) +#define SLEEF_NANf ((float)SLEEF_NAN) +#define SLEEF_INFINITYl ((long double)SLEEF_INFINITY) +#define SLEEF_NANl ((long double)SLEEF_NAN) + +#if (defined(_M_AMD64) || defined(_M_X64)) +#ifndef __SSE2__ +#define __SSE2__ +#define __SSE3__ +#define __SSE4_1__ +#endif +#elif _M_IX86_FP == 2 +#ifndef __SSE2__ +#define __SSE2__ +#define __SSE3__ +#define __SSE4_1__ +#endif +#elif _M_IX86_FP == 1 +#ifndef __SSE__ +#define __SSE__ +#endif +#endif + +#endif // #elif defined(_MSC_VER) // #if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) + +#if !defined(__linux__) +#define isinff(x) ((x) == SLEEF_INFINITYf || (x) == -SLEEF_INFINITYf) +#define isinfl(x) ((x) == SLEEF_INFINITYl || (x) == -SLEEF_INFINITYl) +#define isnanf(x) ((x) != (x)) +#define isnanl(x) ((x) != (x)) +#endif + +#endif // #ifndef __MISC_H__ + +#ifdef ENABLE_AAVPCS +#define VECTOR_CC __attribute__((aarch64_vector_pcs)) +#else +#define VECTOR_CC +#endif + +// + +#if defined (__GNUC__) && !defined(__INTEL_COMPILER) +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wattribute-alias" +#pragma GCC diagnostic ignored "-Wlto-type-mismatch" +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif +#endif + +#if defined(_MSC_VER) +#pragma warning(disable:4101) // warning C4101: 'v': unreferenced local variable +#pragma warning(disable:4116) // warning C4116: unnamed type definition in parentheses +#pragma warning(disable:4244) // warning C4244: 'function': conversion from 'vopmask' to '__mmask8', possible loss of data +#pragma warning(disable:4267) // warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data +#pragma warning(disable:4305) // warning C4305: 'function': truncation from 'double' to 'float' +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/quaddef.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/quaddef.h new file mode 100644 index 0000000000000..f9762d24f3834 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/common/quaddef.h @@ -0,0 +1,99 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(SLEEF_GENHEADER) + +#if (defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) || defined(ENABLEFLOAT128) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +#if !defined(Sleef_quad1_DEFINED) +#define Sleef_quad1_DEFINED +typedef union { + struct { + Sleef_quad x; + }; + Sleef_quad s[1]; +} Sleef_quad1; +#endif + +#if !defined(Sleef_quad2_DEFINED) +#define Sleef_quad2_DEFINED +typedef union { + struct { + Sleef_quad x, y; + }; + Sleef_quad s[2]; +} Sleef_quad2; +#endif + +#if !defined(Sleef_quad4_DEFINED) +#define Sleef_quad4_DEFINED +typedef union { + struct { + Sleef_quad x, y, z, w; + }; + Sleef_quad s[4]; +} Sleef_quad4; +#endif + +#if !defined(Sleef_quad8_DEFINED) +#define Sleef_quad8_DEFINED +typedef union { + Sleef_quad s[8]; +} Sleef_quad8; +#endif + +#if defined(__ARM_FEATURE_SVE) && !defined(Sleef_quadx_DEFINED) +#define Sleef_quadx_DEFINED +typedef union { + Sleef_quad s[32]; +} Sleef_quadx; +#endif + + +#else // #if !defined(SLEEF_GENHEADER) + +SLEEFSHARPif !defined(SLEEFXXX__NVCC__) && ((defined(SLEEFXXX__SIZEOF_FLOAT128__) && SLEEFXXX__SIZEOF_FLOAT128__ == 16) || (defined(SLEEFXXX__linux__) && defined(SLEEFXXX__GNUC__) && (defined(SLEEFXXX__i386__) || defined(SLEEFXXX__x86_64__))) || (defined(SLEEFXXX__PPC64__) && defined(SLEEFXXX__GNUC__) && !defined(SLEEFXXX__clang__) && SLEEFXXX__GNUC__ >= 8)) +SLEEFSHARPdefine SLEEFXXXSLEEF_FLOAT128_IS_IEEEQP +SLEEFSHARPendif + +SLEEFSHARPif !defined(SLEEFXXXSLEEF_FLOAT128_IS_IEEEQP) && !defined(SLEEFXXX__NVCC__) && defined(SLEEFXXX__SIZEOF_LONG_DOUBLE__) && SLEEFXXX__SIZEOF_LONG_DOUBLE__ == 16 && (defined(SLEEFXXX__aarch64__) || defined(SLEEFXXX__zarch__)) +SLEEFSHARPdefine SLEEFXXXSLEEF_LONGDOUBLE_IS_IEEEQP +SLEEFSHARPendif + +SLEEFSHARPif !defined(SLEEFXXXSleef_quad_DEFINED) +SLEEFSHARPdefine SLEEFXXXSleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +SLEEFSHARPif defined(SLEEFXXXSLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +SLEEFSHARPdefine SLEEFXXXSLEEF_QUAD_C(x) (x ## Q) +SLEEFSHARPelif defined(SLEEFXXXSLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +SLEEFSHARPdefine SLEEFXXXSLEEF_QUAD_C(x) (x ## L) +SLEEFSHARPelse +typedef Sleef_uint64_2t Sleef_quad; +SLEEFSHARPendif +SLEEFSHARPendif + +#endif // #if !defined(SLEEF_GENHEADER) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/CMakeLists.txt new file mode 100644 index 0000000000000..6cbcdea18cd1c --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/CMakeLists.txt @@ -0,0 +1,201 @@ +# Compiler properties + +set(CMAKE_C_FLAGS "${ORG_CMAKE_C_FLAGS} ${DFT_C_FLAGS}") + +set(COMMON_TARGET_PROPERTIES + C_STANDARD 99 # -std=gnu99 + ) + +# + +function(add_test_dft TESTNAME) + if (ARMIE_COMMAND) + add_test(NAME ${TESTNAME} COMMAND ${ARMIE_COMMAND} -msve-vector-bits=${SVE_VECTOR_BITS} ${ARGN}) + elseif (NOT EMULATOR AND NOT SDE_COMMAND) + add_test(NAME ${TESTNAME} COMMAND ${ARGN}) + elseif(NOT EMULATOR) + add_test(NAME ${TESTNAME} COMMAND ${SDE_COMMAND} "--" ${ARGN}) + else() + add_test(NAME ${TESTNAME} COMMAND ${EMULATOR} ${ARGN}) + endif() + set_tests_properties(${TESTNAME} PROPERTIES COST 0.1) +endfunction() + +# Include directories + +include_directories(${PROJECT_SOURCE_DIR}/include) # sleefdft.h +include_directories(${sleef_BINARY_DIR}/include) # sleef.h +if (FFTW3_INCLUDE_DIR) + include_directories(${FFTW3_INCLUDE_DIR}) # fftw3.h +endif() + +# Link directories + +link_directories(${sleef_BINARY_DIR}/lib) # libsleef, libsleefdft + +# Link libraries + +set(COMMON_LINK_LIBRARIES ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + +if (COMPILER_SUPPORTS_OPENMP) + set(COMMON_LINK_LIBRARIES ${COMMON_LINK_LIBRARIES} ${OpenMP_C_FLAGS}) +endif() + +if((NOT MSVC) AND NOT SLEEF_CLANG_ON_WINDOWS) + # Target executable naivetestdp + set(TARGET_NAIVETESTDP "naivetestdp") + add_executable(${TARGET_NAIVETESTDP} naivetest.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_NAIVETESTDP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_NAIVETESTDP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=1) + target_link_libraries(${TARGET_NAIVETESTDP} ${COMMON_LINK_LIBRARIES}) + set_target_properties(${TARGET_NAIVETESTDP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Target executable naivetestsp + set(TARGET_NAIVETESTSP "naivetestsp") + add_executable(${TARGET_NAIVETESTSP} naivetest.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_NAIVETESTSP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_NAIVETESTSP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=2) + target_link_libraries(${TARGET_NAIVETESTSP} ${COMMON_LINK_LIBRARIES}) + set_target_properties(${TARGET_NAIVETESTSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Test naivetestdp + add_test_dft(${TARGET_NAIVETESTDP}_1 $ 1) + add_test_dft(${TARGET_NAIVETESTDP}_2 $ 2) + add_test_dft(${TARGET_NAIVETESTDP}_3 $ 3) + add_test_dft(${TARGET_NAIVETESTDP}_4 $ 4) + add_test_dft(${TARGET_NAIVETESTDP}_5 $ 5) + add_test_dft(${TARGET_NAIVETESTDP}_10 $ 10) + + # Test naivetestsp + add_test_dft(${TARGET_NAIVETESTSP}_1 $ 1) + add_test_dft(${TARGET_NAIVETESTSP}_2 $ 2) + add_test_dft(${TARGET_NAIVETESTSP}_3 $ 3) + add_test_dft(${TARGET_NAIVETESTSP}_4 $ 4) + add_test_dft(${TARGET_NAIVETESTSP}_5 $ 5) + add_test_dft(${TARGET_NAIVETESTSP}_10 $ 10) +endif() + +# Target executable roundtriptest1ddp +set(TARGET_ROUNDTRIPTEST1DDP "roundtriptest1ddp") +add_executable(${TARGET_ROUNDTRIPTEST1DDP} roundtriptest1d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) +add_dependencies(${TARGET_ROUNDTRIPTEST1DDP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) +target_compile_definitions(${TARGET_ROUNDTRIPTEST1DDP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=1) +target_link_libraries(${TARGET_ROUNDTRIPTEST1DDP} ${COMMON_LINK_LIBRARIES}) +set_target_properties(${TARGET_ROUNDTRIPTEST1DDP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +# Target executable roundtriptest1dsp +set(TARGET_ROUNDTRIPTEST1DSP "roundtriptest1dsp") +add_executable(${TARGET_ROUNDTRIPTEST1DSP} roundtriptest1d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) +add_dependencies(${TARGET_ROUNDTRIPTEST1DSP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) +target_compile_definitions(${TARGET_ROUNDTRIPTEST1DSP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=2) +target_link_libraries(${TARGET_ROUNDTRIPTEST1DSP} ${COMMON_LINK_LIBRARIES}) +set_target_properties(${TARGET_ROUNDTRIPTEST1DSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +# Target executable roundtriptest2ddp +set(TARGET_ROUNDTRIPTEST2DDP "roundtriptest2ddp") +add_executable(${TARGET_ROUNDTRIPTEST2DDP} roundtriptest2d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) +add_dependencies(${TARGET_ROUNDTRIPTEST2DDP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) +target_compile_definitions(${TARGET_ROUNDTRIPTEST2DDP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=1) +target_link_libraries(${TARGET_ROUNDTRIPTEST2DDP} ${COMMON_LINK_LIBRARIES}) +set_target_properties(${TARGET_ROUNDTRIPTEST2DDP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +# Target executable roundtriptest2dsp +set(TARGET_ROUNDTRIPTEST2DSP "roundtriptest2dsp") +add_executable(${TARGET_ROUNDTRIPTEST2DSP} roundtriptest2d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) +add_dependencies(${TARGET_ROUNDTRIPTEST2DSP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) +target_compile_definitions(${TARGET_ROUNDTRIPTEST2DSP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=2) +target_link_libraries(${TARGET_ROUNDTRIPTEST2DSP} ${COMMON_LINK_LIBRARIES}) +set_target_properties(${TARGET_ROUNDTRIPTEST2DSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +if (LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) + # Target executable fftwtest1ddp + set(TARGET_FFTWTEST1DDP "fftwtest1ddp") + add_executable(${TARGET_FFTWTEST1DDP} fftwtest1d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_FFTWTEST1DDP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_FFTWTEST1DDP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=1) + target_link_libraries(${TARGET_FFTWTEST1DDP} ${COMMON_LINK_LIBRARIES} ${LIBFFTW3}) + set_target_properties(${TARGET_FFTWTEST1DDP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Target executable fftwtest1dsp + set(TARGET_FFTWTEST1DSP "fftwtest1dsp") + add_executable(${TARGET_FFTWTEST1DSP} fftwtest1d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_FFTWTEST1DSP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_FFTWTEST1DSP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=2) + target_link_libraries(${TARGET_FFTWTEST1DSP} ${COMMON_LINK_LIBRARIES} ${LIBFFTW3}) + set_target_properties(${TARGET_FFTWTEST1DSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Target executable fftwtest2ddp + set(TARGET_FFTWTEST2DDP "fftwtest2ddp") + add_executable(${TARGET_FFTWTEST2DDP} fftwtest2d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_FFTWTEST2DDP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_FFTWTEST2DDP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=1) + target_link_libraries(${TARGET_FFTWTEST2DDP} ${COMMON_LINK_LIBRARIES} ${LIBFFTW3}) + set_target_properties(${TARGET_FFTWTEST2DDP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Target executable fftwtest2dsp + set(TARGET_FFTWTEST2DSP "fftwtest2dsp") + add_executable(${TARGET_FFTWTEST2DSP} fftwtest2d.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h) + add_dependencies(${TARGET_FFTWTEST2DSP} ${TARGET_HEADERS} ${TARGET_LIBSLEEF} ${TARGET_LIBDFT}) + target_compile_definitions(${TARGET_FFTWTEST2DSP} PRIVATE ${COMMON_TARGET_DEFINITIONS} BASETYPEID=2) + target_link_libraries(${TARGET_FFTWTEST2DSP} ${COMMON_LINK_LIBRARIES} ${LIBFFTW3}) + set_target_properties(${TARGET_FFTWTEST2DSP} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Test fftwtest1ddp + add_test_dft(${TARGET_FFTWTEST1DDP}_12 $ 12) + add_test_dft(${TARGET_FFTWTEST1DDP}_16 $ 16) + + # Test fftwtest1dsp + add_test_dft(${TARGET_FFTWTEST1DSP}_12 $ 12) + add_test_dft(${TARGET_FFTWTEST1DSP}_16 $ 16) + + # Test fftwtest2ddp + add_test_dft(${TARGET_FFTWTEST2DDP}_2_2 $ 2 2) + add_test_dft(${TARGET_FFTWTEST2DDP}_4_4 $ 4 4) + add_test_dft(${TARGET_FFTWTEST2DDP}_8_8 $ 8 8) + add_test_dft(${TARGET_FFTWTEST2DDP}_10_10 $ 10 10) + add_test_dft(${TARGET_FFTWTEST2DDP}_5_15 $ 5 15) + + # Test fftwtest2dsp + add_test_dft(${TARGET_FFTWTEST2DSP}_2_2 $ 2 2) + add_test_dft(${TARGET_FFTWTEST2DSP}_4_4 $ 4 4) + add_test_dft(${TARGET_FFTWTEST2DSP}_8_8 $ 8 8) + add_test_dft(${TARGET_FFTWTEST2DSP}_10_10 $ 10 10) + add_test_dft(${TARGET_FFTWTEST2DSP}_5_15 $ 5 15) +else(LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) + if(MSVC OR SLEEF_CLANG_ON_WINDOWS) + # Test roundtriptestdp + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_1 $ 1 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_2 $ 2 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_3 $ 3 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_4 $ 4 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_5 $ 5 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_10 $ 10 10) + + # Test roundtriptestsp + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_1 $ 1 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_2 $ 2 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_3 $ 3 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_4 $ 4 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_5 $ 5 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_10 $ 10 10) + endif() + + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_12 $ 12 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_16 $ 16 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_12 $ 12 10) + add_test_dft(${TARGET_ROUNDTRIPTEST1DSP}_16 $ 16 10) + + # Test roundtriptest2ddp + add_test_dft(${TARGET_ROUNDTRIPTEST2DDP}_2_2 $ 2 2 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DDP}_4_4 $ 4 4 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DDP}_8_8 $ 8 8 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DDP}_10_10 $ 10 10 2) + add_test_dft(${TARGET_ROUNDTRIPTEST2DDP}_5_15 $ 5 15 2) + + # Test roundtriptest2dsp + add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_2_2 $ 2 2 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_4_4 $ 4 4 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_8_8 $ 8 8 10) + add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_10_10 $ 10 10 2) + add_test_dft(${TARGET_ROUNDTRIPTEST2DSP}_5_15 $ 5 15 2) +endif(LIBFFTW3 AND NOT SLEEF_DISABLE_FFTW) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/bench1d.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/bench1d.c new file mode 100644 index 0000000000000..a30dbcf296b39 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/bench1d.c @@ -0,0 +1,116 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE 700 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USEFFTW +#include +#include +#else +#include "sleef.h" +#include "sleefdft.h" +#endif + +typedef double real; + +static uint64_t gettime() { + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return (uint64_t)tp.tv_sec * 1000000000 + ((uint64_t)tp.tv_nsec); +} + +#define REPEAT 8 + +int main(int argc, char **argv) { + if (argc == 1) { + fprintf(stderr, "%s \n", argv[0]); + exit(-1); + } + + int backward = 0; + + int log2n = atoi(argv[1]); + if (log2n < 0) { + backward = 1; + log2n = -log2n; + } + + const int n = 1 << log2n; + const int64_t niter = (int)(100000000000.0 / n / log2n); + + printf("Number of iterations = %lld\n", (long long int)niter); + +#ifdef USEFFTW + fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n); + fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n); + +#if 0 + int fftw_init_threads(void); + fftw_plan_with_nthreads(omp_get_max_threads()); +#endif + + fftw_plan w = fftw_plan_dft_1d(n, in, out, backward ? FFTW_BACKWARD : FFTW_FORWARD, FFTW_MEASURE); + //fftw_plan w = fftw_plan_dft_1d(n, in, out, backward ? FFTW_BACKWARD : FFTW_FORWARD, FFTW_PATIENT); + + for(int i=0;i= 3) mode = SLEEF_MODE_VERBOSE | SLEEF_MODE_ESTIMATE; + + if (backward) mode |= SLEEF_MODE_BACKWARD; + struct SleefDFT *p = SleefDFT_double_init1d(n, in, out, mode); + + if (argc >= 3) SleefDFT_setPath(p, argv[2]); + + for(int i=0;i +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +#include + +#ifndef MODE +#define MODE SLEEF_MODE_DEBUG +#endif + +#if BASETYPEID == 1 +#define THRES 1e-30 +#define SleefDFT_init1d SleefDFT_double_init1d +#define SleefDFT_execute SleefDFT_double_execute +typedef double real; +#elif BASETYPEID == 2 +#define THRES 1e-13 +#define SleefDFT_init1d SleefDFT_float_init1d +#define SleefDFT_execute SleefDFT_float_execute +typedef float real; +#else +#error BASETYPEID not set +#endif + +static double squ(double x) { return x * x; } + +// complex forward +double check_cf(int n) { + fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n); + fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n); + fftw_plan w = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE); + + real *sx = (real *)Sleef_malloc(n*2*sizeof(real)); + real *sy = (real *)Sleef_malloc(n*2*sizeof(real)); + struct SleefDFT *p = SleefDFT_init1d(n, sx, sy, MODE); + + for(int i=0;i\n", argv[0]); + exit(-1); + } + + const int n = 1 << atoi(argv[1]); + + srand((unsigned int)time(NULL)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + // + + int success = 1; + double e; + + e = check_cf(n); + success = success && e < THRES; + printf("complex forward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + e = check_cb(n); + success = success && e < THRES; + printf("complex backward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + e = check_rf(n); + success = success && e < THRES; + printf("real forward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + e = check_rb(n); + success = success && e < THRES; + printf("real backward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + + exit(success ? 0 : -1); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/fftwtest2d.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/fftwtest2d.c new file mode 100644 index 0000000000000..6c3872d35ab27 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/fftwtest2d.c @@ -0,0 +1,143 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +#include + +#ifndef MODE +#define MODE SLEEF_MODE_DEBUG +#endif + +#if BASETYPEID == 1 +#define THRES 1e-30 +#define SleefDFT_init2d SleefDFT_double_init2d +#define SleefDFT_execute SleefDFT_double_execute +typedef double real; +#elif BASETYPEID == 2 +#define THRES 1e-13 +#define SleefDFT_init2d SleefDFT_float_init2d +#define SleefDFT_execute SleefDFT_float_execute +typedef float real; +#else +#error BASETYPEID not set +#endif + +static double squ(double x) { return x * x; } + +// complex forward +double check_cf(int n, int m) { + fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n * m); + fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n * m); + fftw_plan w = fftw_plan_dft_2d(n, m, in, out, FFTW_FORWARD, FFTW_ESTIMATE); + + real *sx = (real *)Sleef_malloc(n*m*2*sizeof(real)); + real *sy = (real *)Sleef_malloc(n*m*2*sizeof(real)); + struct SleefDFT *p = SleefDFT_init2d(n, m, sx, sy, MODE); + + for(int i=0;i \n", argv[0]); + exit(-1); + } + + const int n = 1 << atoi(argv[1]); + const int m = 1 << atoi(argv[2]); + + srand((unsigned int)time(NULL)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + // + + int success = 1; + double e; + + e = check_cf(n, m); + success = success && e < THRES; + printf("complex forward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + e = check_cb(n, m); + success = success && e < THRES; + printf("complex backward : %s (%g)\n", e < THRES ? "OK" : "NG", e); + + exit(success ? 0 : -1); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/measuredft.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/measuredft.c new file mode 100644 index 0000000000000..c8ffa6ee8f2a4 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/measuredft.c @@ -0,0 +1,175 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define _DEFAULT_SOURCE +#define _XOPEN_SOURCE 700 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +static uint64_t gettime() { + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return (uint64_t)tp.tv_sec * 1000000000 + ((uint64_t)tp.tv_nsec); +} + +int mode[] = { SLEEF_MODE_MEASURE | SLEEF_MODE_NO_MT, SLEEF_MODE_MEASURE}; + +#define ENABLE_SP +//#define ROUNDTRIP +#define REPEAT 2 +//#define ENABLE_SLEEP +//#define WARMUP + +int main(int argc, char **argv) { + int start = 1, end = 18; + if (argc > 1) start = atoi(argv[1]); + if (argc > 2) end = atoi(argv[2]); + + double *din = (double *)Sleef_malloc((1 << 18)*2 * sizeof(double)); + double *dout = (double *)Sleef_malloc((1 << 18)*2 * sizeof(double)); + float *sin = (float *)Sleef_malloc((1 << 18)*2 * sizeof(float)); + float *sout = (float *)Sleef_malloc((1 << 18)*2 * sizeof(float)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + for(int log2n=start;log2n<=end;log2n++) { + const int n = 1 << log2n; + int64_t niter = (int64_t)(1000000000.0 / REPEAT / n / log2n); + + printf("%d ", n); + + for(int m=0;m<2;m++) { +#ifdef ENABLE_SLEEP + sleep(1); +#endif + + struct SleefDFT *pf = SleefDFT_double_init1d(n, NULL, NULL, mode[m]); +#ifdef ROUNDTRIP + struct SleefDFT *pb = SleefDFT_double_init1d(n, NULL, NULL, mode[m] | SLEEF_MODE_BACKWARD); +#endif + + for(int i=0;i +#include +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" +#include "misc.h" + +#ifndef MODE +#define MODE SLEEF_MODE_DEBUG +#endif + +#define THRES 1e-4 + +#if BASETYPEID == 1 +#define SleefDFT_init SleefDFT_double_init1d +#define SleefDFT_execute SleefDFT_double_execute +typedef double real; + +typedef double complex cmpl; + +cmpl omega(double n, double kn) { + return cexp((-2 * M_PIl * _Complex_I / n) * kn); +} +#elif BASETYPEID == 2 +#define SleefDFT_init SleefDFT_float_init1d +#define SleefDFT_execute SleefDFT_float_execute +typedef float real; + +typedef double complex cmpl; + +cmpl omega(double n, double kn) { + return cexp((-2 * M_PIl * _Complex_I / n) * kn); +} +#elif BASETYPEID == 3 +#define SleefDFT_init SleefDFT_longdouble_init1d +#define SleefDFT_execute SleefDFT_longdouble_execute +typedef double real; + +typedef double complex cmpl; + +cmpl omega(double n, double kn) { + return cexp((-2 * M_PIl * _Complex_I / n) * kn); +} +#elif BASETYPEID == 4 +#include + +#define SleefDFT_init SleefDFT_quad_init1d +#define SleefDFT_execute SleefDFT_quad_execute +typedef Sleef_quad real; + +typedef double complex cmpl; + +cmpl omega(double n, double kn) { + return cexp((-2 * M_PIl * _Complex_I / n) * kn); +} +#else +#error No BASETYPEID specified +#endif + +void forward(cmpl *ts, cmpl *fs, int len) { + int k, n; + + for(k=0;k THRES) || + (fabs(sy[(i*2+1)] - cimag(fs[i])) > THRES)) { + success = 0; + } + + double t; + t = (sy[(i*2+0)] - creal(fs[i])); + rmsn += t*t; + t = (sy[(i*2+1)] - cimag(fs[i])); + rmsn += t*t; + rmsd += creal(fs[i]) * creal(fs[i]) + cimag(fs[i]) * cimag(fs[i]); + } + + // + + free(fs); + free(ts); + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +// complex backward +int check_cb(int n) { + int i; + + real *sx = (real *)Sleef_malloc(sizeof(real)*n*2); + real *sy = (real *)Sleef_malloc(sizeof(real)*n*2); + + cmpl *ts = (cmpl *)malloc(sizeof(cmpl)*n); + cmpl *fs = (cmpl *)malloc(sizeof(cmpl)*n); + + // + + for(i=0;i THRES) || + (fabs(sy[(i*2+1)] - cimag(ts[i])) > THRES)) { + success = 0; + } + } + + // + + free(fs); + free(ts); + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +// real forward +int check_rf(int n) { + int i; + + real *sx = (real *)Sleef_malloc(n * sizeof(real)); + real *sy = (real *)Sleef_malloc((n/2+1)*sizeof(real)*2); + + cmpl *ts = (cmpl *)malloc(sizeof(cmpl)*n); + cmpl *fs = (cmpl *)malloc(sizeof(cmpl)*n); + + // + + for(i=0;i THRES) success = 0; + if (fabs(sy[(2*i+1)] - cimag(fs[i])) > THRES) success = 0; + } + + // + + free(fs); + free(ts); + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +// real backward +int check_rb(int n) { + int i; + + cmpl *ts = (cmpl *)malloc(sizeof(cmpl)*n); + cmpl *fs = (cmpl *)malloc(sizeof(cmpl)*n); + + // + + for(i=0;i THRES) { + success = 0; + } + + if ((fabs(sy[i] - creal(ts[i])) > THRES)) { + success = 0; + } + } + + // + + free(fs); + free(ts); + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +int check_arf(int n) { + int i; + + real *sx = (real *)Sleef_malloc(n * sizeof(real)); + real *sy = (real *)Sleef_malloc(n * sizeof(real)); + + cmpl *ts = (cmpl *)malloc(sizeof(cmpl)*n); + cmpl *fs = (cmpl *)malloc(sizeof(cmpl)*n); + + // + + for(i=0;i THRES) success = 0; + if (fabs(sy[(2*0+1)] - creal(fs[n/2])) > THRES) success = 0; + } else { + if (fabs(sy[(2*i+0)] - creal(fs[i])) > THRES) success = 0; + if (fabs(sy[(2*i+1)] - cimag(fs[i])) > THRES) success = 0; + } + } + + // + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +int check_arb(int n) { + int i; + + real *sx = (real *)Sleef_malloc(n * sizeof(real)); + real *sy = (real *)Sleef_malloc(n * sizeof(real)); + + cmpl *ts = (cmpl *)malloc(sizeof(cmpl)*n); + cmpl *fs = (cmpl *)malloc(sizeof(cmpl)*n); + + // + + for(i=0;i THRES) { + success = 0; + } + + if ((fabs(sy[i]*2 - creal(ts[i])) > THRES)) { + success = 0; + } + } + + // + + free(fs); + free(ts); + + Sleef_free(sx); + Sleef_free(sy); + SleefDFT_dispose(p); + + // + + return success; +} + +int main(int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "%s \n", argv[0]); + exit(-1); + } + + const int n = 1 << atoi(argv[1]); + + srand((unsigned int)time(NULL)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + // + + int success = 1; + + printf("complex forward : %s\n", (success &= check_cf(n)) ? "OK" : "NG"); + printf("complex backward : %s\n", (success &= check_cb(n)) ? "OK" : "NG"); + printf("real forward : %s\n", (success &= check_rf(n)) ? "OK" : "NG"); + printf("real backward : %s\n", (success &= check_rb(n)) ? "OK" : "NG"); + printf("real alt forward : %s\n", (success &= check_arf(n)) ? "OK" : "NG"); + printf("real alt backward : %s\n", (success &= check_arb(n)) ? "OK" : "NG"); + + exit(!success); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest1d.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest1d.c new file mode 100644 index 0000000000000..fd7503109c55f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest1d.c @@ -0,0 +1,174 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +#ifndef MODE +#define MODE (SLEEF_MODE_DEBUG | SLEEF_MODE_VERBOSE) +#endif + +#if BASETYPEID == 1 +#define THRES 1e-30 +#define SleefDFT_init SleefDFT_double_init1d +#define SleefDFT_execute SleefDFT_double_execute +typedef double real; +#elif BASETYPEID == 2 +#define THRES 1e-13 +#define SleefDFT_init SleefDFT_float_init1d +#define SleefDFT_execute SleefDFT_float_execute +typedef float real; +#else +#error BASETYPEID not set +#endif + +static double squ(double x) { return x * x; } + +// complex transforms +double check_c(int n) { + struct SleefDFT *p; + + real *sx = (real *)Sleef_malloc(n*2 * sizeof(real)); + real *sy = (real *)Sleef_malloc(n*2 * sizeof(real)); + real *sz = (real *)Sleef_malloc(n*2 * sizeof(real)); + + for(int i=0;i []\n", argv[0]); + exit(-1); + } + + const int n = 1 << atoi(argv[1]); + const int nloop = argc >= 3 ? atoi(argv[2]) : 1; + + srand((unsigned int)time(NULL)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + // + + int success = 1; + double e; + + for(int i=0;(nloop < 0 || i < nloop) && success;i++) { + e = check_c(n); + success = success && e < THRES; + printf("complex : %s (%g)\n", e < THRES ? "OK" : "NG", e); + e = check_r(n); + success = success && e < THRES; + printf("real : %s (%g)\n", e < THRES ? "OK" : "NG", e); + } + + exit(!success); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest2d.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest2d.c new file mode 100644 index 0000000000000..c2d287e873f2a --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/roundtriptest2d.c @@ -0,0 +1,118 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +#ifndef MODE +#define MODE (SLEEF_MODE_DEBUG | SLEEF_MODE_VERBOSE) +#endif + +#if BASETYPEID == 1 +#define THRES 1e-30 +#define SleefDFT_init2d SleefDFT_double_init2d +#define SleefDFT_execute SleefDFT_double_execute +typedef double real; +#elif BASETYPEID == 2 +#define THRES 1e-13 +#define SleefDFT_init2d SleefDFT_float_init2d +#define SleefDFT_execute SleefDFT_float_execute +typedef float real; +#else +#error BASETYPEID not set +#endif + +static double squ(double x) { return x * x; } + +// complex transforms +double check_c(int n, int m) { + struct SleefDFT *p; + + real *sx = (real *)Sleef_malloc(n*m*2 * sizeof(real)); + real *sy = (real *)Sleef_malloc(n*m*2 * sizeof(real)); + real *sz = (real *)Sleef_malloc(n*m*2 * sizeof(real)); + + for(int i=0;i []\n", argv[0]); + exit(-1); + } + + const int n = 1 << atoi(argv[1]); + const int m = 1 << atoi(argv[2]); + const int nloop = argc >= 4 ? atoi(argv[3]) : 1; + + srand((unsigned int)time(NULL)); + + SleefDFT_setPlanFilePath(NULL, NULL, SLEEF_PLAN_RESET | SLEEF_PLAN_READONLY); + + // + + int success = 1; + double e; + + for(int i=0;(nloop < 0 || i < nloop) && success;i++) { + e = check_c(n, m); + success = success && e < THRES; + printf("complex : %s (%g)\n", e < THRES ? "OK" : "NG", e); + } + + exit(!success); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/tutorial.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/tutorial.c new file mode 100644 index 0000000000000..e699e6af236cc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft-tester/tutorial.c @@ -0,0 +1,80 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// gcc tutorial.c -lsleef -lsleefdft -lm +#include +#include +#include +#include +#include + +#include "sleef.h" +#include "sleefdft.h" + +#define THRES 1e-4 + +typedef double complex cmpl; + +cmpl omega(double n, double kn) { + return cexp((-2 * M_PI * _Complex_I / n) * kn); +} + +void forward(cmpl *ts, cmpl *fs, int len) { + for(int k=0;k THRES) || + (fabs(sy[(i*2+1)] - cimag(fs[i])) > THRES)) { + success = 0; + } + } + + printf("%s\n", success ? "OK" : "NG"); + + free(fs); free(ts); + Sleef_free(sy); Sleef_free(sx); + + SleefDFT_dispose(p); + + exit(success); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/CMakeLists.txt new file mode 100644 index 0000000000000..c1a452d71035c --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/CMakeLists.txt @@ -0,0 +1,425 @@ + +# Options + +if (COMPILER_SUPPORTS_SVE) + set(SLEEFDFT_MAXBUTWIDTH 6 CACHE STRING "Log_2 (Maximum butterfly length) of butterflies") +else() + set(SLEEFDFT_MAXBUTWIDTH 4 CACHE STRING "Log_2 (Maximum butterfly length) of butterflies") +endif() + +if (SLEEFDFT_MAXBUTWIDTH GREATER 7) + message(FATAL_ERROR "SLEEFDFT_MAXBUTWIDTH has to be smaller than 8." ) +endif() + +option(SLEEFDFT_ENABLE_STREAM "Streaming instructions are utilized in DFT." OFF) + +# Settings + +# Constants definition + +set(LISTSHORTTYPENAME "dp" "sp") +set(LISTLONGTYPENAME "double" "float") +set(LISTTYPEID "1" "2") + +set(MACRODEF_vecextdp BASETYPEID=1 ENABLE_VECEXT CONFIG=1) +set(CFLAGS_vecextdp ${FLAGS_ENABLE_VECEXT}) +set(MACRODEF_vecextsp BASETYPEID=2 ENABLE_VECEXT CONFIG=1) +set(CFLAGS_vecextsp ${FLAGS_ENABLE_VECEXT}) +set(MACRODEF_vecextld BASETYPEID=3 ENABLE_VECEXT CONFIG=1) +set(CFLAGS_vecextld ${FLAGS_ENABLE_VECEXT}) +set(MACRODEF_vecextqp BASETYPEID=4 ENABLE_VECEXT CONFIG=1) +set(CFLAGS_vecextqp ${FLAGS_ENABLE_VECEXT}) +set(MACRODEF_purecdp BASETYPEID=1 ENABLE_PUREC CONFIG=1) +set(CFLAGS_purecdp ${FLAGS_ENABLE_PUREC}) +set(MACRODEF_purecsp BASETYPEID=2 ENABLE_PUREC CONFIG=1) +set(CFLAGS_purecsp ${FLAGS_ENABLE_PUREC}) +set(MACRODEF_purecld BASETYPEID=3 ENABLE_PUREC CONFIG=1) +set(CFLAGS_purecld ${FLAGS_ENABLE_PUREC}) +set(MACRODEF_purecqp BASETYPEID=4 ENABLE_PUREC CONFIG=1) +set(CFLAGS_purecqp ${FLAGS_ENABLE_PUREC}) +set(MACRODEF_sse2dp BASETYPEID=1 ENABLE_SSE2 CONFIG=4) +set(CFLAGS_sse2dp ${FLAGS_ENABLE_SSE4}) +set(MACRODEF_sse2sp BASETYPEID=2 ENABLE_SSE2 CONFIG=4) +set(CFLAGS_sse2sp ${FLAGS_ENABLE_SSE4}) +set(MACRODEF_avxdp BASETYPEID=1 ENABLE_AVX CONFIG=1) +set(CFLAGS_avxdp ${FLAGS_ENABLE_AVX}) +set(MACRODEF_avxsp BASETYPEID=2 ENABLE_AVX CONFIG=1) +set(CFLAGS_avxsp ${FLAGS_ENABLE_AVX}) +set(MACRODEF_avx2dp BASETYPEID=1 ENABLE_AVX2 CONFIG=1) +set(CFLAGS_avx2dp ${FLAGS_ENABLE_AVX2}) +set(MACRODEF_avx2sp BASETYPEID=2 ENABLE_AVX2 CONFIG=1) +set(CFLAGS_avx2sp ${FLAGS_ENABLE_AVX2}) +set(MACRODEF_avx512fdp BASETYPEID=1 ENABLE_AVX512F CONFIG=1) +set(CFLAGS_avx512fdp ${FLAGS_ENABLE_AVX512F}) +set(MACRODEF_avx512fsp BASETYPEID=2 ENABLE_AVX512F CONFIG=1) +set(CFLAGS_avx512fsp ${FLAGS_ENABLE_AVX512F}) +set(MACRODEF_advsimddp BASETYPEID=1 ENABLE_ADVSIMD CONFIG=1) +set(CFLAGS_advsimddp ${FLAGS_ENABLE_ADVSIMD}) +set(MACRODEF_advsimdsp BASETYPEID=2 ENABLE_ADVSIMD CONFIG=1) +set(CFLAGS_advsimdsp ${FLAGS_ENABLE_ADVSIMD}) +set(MACRODEF_neon32sp BASETYPEID=2 ENABLE_NEON32 CONFIG=1) +set(CFLAGS_neon32sp ${FLAGS_ENABLE_NEON32}) +set(MACRODEF_sve256dp BASETYPEID=1 ENABLE_SVE CONFIG=8) +set(CFLAGS_sve256dp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve256sp BASETYPEID=2 ENABLE_SVE CONFIG=8) +set(CFLAGS_sve256sp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve512dp BASETYPEID=1 ENABLE_SVE CONFIG=9) +set(CFLAGS_sve512dp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve512sp BASETYPEID=2 ENABLE_SVE CONFIG=9) +set(CFLAGS_sve512sp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve1024dp BASETYPEID=1 ENABLE_SVE CONFIG=10) +set(CFLAGS_sve1024dp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve1024sp BASETYPEID=2 ENABLE_SVE CONFIG=10) +set(CFLAGS_sve1024sp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve2048dp BASETYPEID=1 ENABLE_SVE CONFIG=11) +set(CFLAGS_sve2048dp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_sve2048sp BASETYPEID=2 ENABLE_SVE CONFIG=11) +set(CFLAGS_sve2048sp ${FLAGS_ENABLE_SVE}) +set(MACRODEF_rvvm1128dp BASETYPEID=1 ENABLE_RVVM1 CONFIG=7) +set(CFLAGS_rvvm1128dp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm1128sp BASETYPEID=2 ENABLE_RVVM1 CONFIG=7) +set(CFLAGS_rvvm1128sp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm1256dp BASETYPEID=1 ENABLE_RVVM1 CONFIG=8) +set(CFLAGS_rvvm1256dp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm1256sp BASETYPEID=2 ENABLE_RVVM1 CONFIG=8) +set(CFLAGS_rvvm1256sp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm1512dp BASETYPEID=1 ENABLE_RVVM1 CONFIG=9) +set(CFLAGS_rvvm1512dp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm1512sp BASETYPEID=2 ENABLE_RVVM1 CONFIG=9) +set(CFLAGS_rvvm1512sp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm11024dp BASETYPEID=1 ENABLE_RVVM1 CONFIG=10) +set(CFLAGS_rvvm11024dp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm11024sp BASETYPEID=2 ENABLE_RVVM1 CONFIG=10) +set(CFLAGS_rvvm11024sp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm12048dp BASETYPEID=1 ENABLE_RVVM1 CONFIG=11) +set(CFLAGS_rvvm12048dp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm12048sp BASETYPEID=2 ENABLE_RVVM1 CONFIG=11) +set(CFLAGS_rvvm12048sp ${FLAGS_ENABLE_RVVM1}) +set(MACRODEF_rvvm2128dp BASETYPEID=1 ENABLE_RVVM2 CONFIG=7) +set(CFLAGS_rvvm2128dp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm2128sp BASETYPEID=2 ENABLE_RVVM2 CONFIG=7) +set(CFLAGS_rvvm2128sp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm2256dp BASETYPEID=1 ENABLE_RVVM2 CONFIG=8) +set(CFLAGS_rvvm2256dp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm2256sp BASETYPEID=2 ENABLE_RVVM2 CONFIG=8) +set(CFLAGS_rvvm2256sp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm2512dp BASETYPEID=1 ENABLE_RVVM2 CONFIG=9) +set(CFLAGS_rvvm2512dp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm2512sp BASETYPEID=2 ENABLE_RVVM2 CONFIG=9) +set(CFLAGS_rvvm2512sp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm21024dp BASETYPEID=1 ENABLE_RVVM2 CONFIG=10) +set(CFLAGS_rvvm21024dp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm21024sp BASETYPEID=2 ENABLE_RVVM2 CONFIG=10) +set(CFLAGS_rvvm21024sp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm22048dp BASETYPEID=1 ENABLE_RVVM2 CONFIG=11) +set(CFLAGS_rvvm22048dp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_rvvm22048sp BASETYPEID=2 ENABLE_RVVM2 CONFIG=11) +set(CFLAGS_rvvm22048sp ${FLAGS_ENABLE_RVVM2}) +set(MACRODEF_vsxdp BASETYPEID=1 ENABLE_VSX CONFIG=1) +set(CFLAGS_vsxdp ${FLAGS_ENABLE_VSX}) +set(MACRODEF_vsxsp BASETYPEID=2 ENABLE_VSX CONFIG=1) +set(CFLAGS_vsxsp ${FLAGS_ENABLE_VSX}) +set(MACRODEF_vsx3dp BASETYPEID=1 ENABLE_VSX3 CONFIG=1) +set(CFLAGS_vsx3dp ${FLAGS_ENABLE_VSX3}) +set(MACRODEF_vsx3sp BASETYPEID=2 ENABLE_VSX3 CONFIG=1) +set(CFLAGS_vsx3sp ${FLAGS_ENABLE_VSX3}) +set(MACRODEF_vxedp BASETYPEID=1 ENABLE_VXE CONFIG=140) +set(CFLAGS_vxedp ${FLAGS_ENABLE_VXE}) +set(MACRODEF_vxesp BASETYPEID=2 ENABLE_VXE CONFIG=140) +set(CFLAGS_vxesp ${FLAGS_ENABLE_VXE}) +set(MACRODEF_vxe2dp BASETYPEID=1 ENABLE_VXE2 CONFIG=150) +set(CFLAGS_vxe2dp ${FLAGS_ENABLE_VXE2}) +set(MACRODEF_vxe2sp BASETYPEID=2 ENABLE_VXE2 CONFIG=150) +set(CFLAGS_vxe2sp ${FLAGS_ENABLE_VXE2}) + +# List all available scalar data types + +set(ISALIST_SP purecsp) +set(ISALIST_DP purecdp) + +set(LIST_SUPPORTED_FPTYPE 0 1) +if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)") + set(ISALIST_SP vecextsp) + set(ISALIST_DP vecextdp) +endif(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)") + +# List all available vector data types + +if (COMPILER_SUPPORTS_SSE4) + set(ISALIST_SP ${ISALIST_SP} sse2sp) + set(ISALIST_DP ${ISALIST_DP} sse2dp) +endif(COMPILER_SUPPORTS_SSE4) + +if (COMPILER_SUPPORTS_AVX) + set(ISALIST_SP ${ISALIST_SP} avxsp) + set(ISALIST_DP ${ISALIST_DP} avxdp) +endif(COMPILER_SUPPORTS_AVX) + +if (COMPILER_SUPPORTS_AVX2) + set(ISALIST_SP ${ISALIST_SP} avx2sp) + set(ISALIST_DP ${ISALIST_DP} avx2dp) +endif(COMPILER_SUPPORTS_AVX2) + +if (COMPILER_SUPPORTS_AVX512F) + set(ISALIST_SP ${ISALIST_SP} avx512fsp) + set(ISALIST_DP ${ISALIST_DP} avx512fdp) +endif(COMPILER_SUPPORTS_AVX512F) + +if (COMPILER_SUPPORTS_ADVSIMD) + set(ISALIST_SP ${ISALIST_SP} advsimdsp) + set(ISALIST_DP ${ISALIST_DP} advsimddp) +endif(COMPILER_SUPPORTS_ADVSIMD) + +if (COMPILER_SUPPORTS_SVE) + set(ISALIST_SP ${ISALIST_SP} sve256sp sve512sp sve1024sp sve2048sp) + set(ISALIST_DP ${ISALIST_DP} sve256dp sve512dp sve1024dp sve2048dp) +endif(COMPILER_SUPPORTS_SVE) + +if (COMPILER_SUPPORTS_NEON32) + set(ISALIST_SP ${ISALIST_SP} neon32sp) +endif(COMPILER_SUPPORTS_NEON32) + +if (COMPILER_SUPPORTS_RVVM1) + set(ISALIST_SP ${ISALIST_SP} rvvm1128sp rvvm1256sp rvvm1512sp rvvm11024sp rvvm12048sp) + set(ISALIST_DP ${ISALIST_DP} rvvm1128dp rvvm1256dp rvvm1512dp rvvm11024dp rvvm12048dp) +endif(COMPILER_SUPPORTS_RVVM1) + +if (COMPILER_SUPPORTS_RVVM2) + set(ISALIST_SP ${ISALIST_SP} rvvm2128sp rvvm2256sp rvvm2512sp rvvm21024sp rvvm22048sp) + set(ISALIST_DP ${ISALIST_DP} rvvm2128dp rvvm2256dp rvvm2512dp rvvm21024dp rvvm22048dp) +endif(COMPILER_SUPPORTS_RVVM2) + +if (COMPILER_SUPPORTS_VSX) + set(ISALIST_SP ${ISALIST_SP} vsxsp) + set(ISALIST_DP ${ISALIST_DP} vsxdp) +endif(COMPILER_SUPPORTS_VSX) + +if (COMPILER_SUPPORTS_VSX3) + set(ISALIST_SP ${ISALIST_SP} vsx3sp) + set(ISALIST_DP ${ISALIST_DP} vsx3dp) +endif(COMPILER_SUPPORTS_VSX3) + +if (COMPILER_SUPPORTS_VXE) + set(ISALIST_SP ${ISALIST_SP} vxesp) + set(ISALIST_DP ${ISALIST_DP} vxedp) +endif(COMPILER_SUPPORTS_VXE) + +if (COMPILER_SUPPORTS_VXE2) + set(ISALIST_SP ${ISALIST_SP} vxe2sp) + set(ISALIST_DP ${ISALIST_DP} vxe2dp) +endif(COMPILER_SUPPORTS_VXE2) + +if(SLEEFDFT_ENABLE_STREAM) + set(NLIST 0 1 2 3) +else() + set(NLIST 0 2) +endif() + +# + +# Compiler properties + +set(CMAKE_C_FLAGS "${ORG_CMAKE_C_FLAGS} ${DFT_C_FLAGS}") +set(COMMON_TARGET_PROPERTIES + C_STANDARD 99 # -std=gnu99 + ) + +if (BUILD_SHARED_LIBS) + list(APPEND COMMON_TARGET_PROPERTIES POSITION_INDEPENDENT_CODE ON) # -fPIC +endif() + +set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} MAXBUTWIDTH=${SLEEFDFT_MAXBUTWIDTH}) + +if (SLEEFDFT_ENABLE_STREAM) + set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} ENABLE_STREAM=1) +else() + set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} ENABLE_STREAM=0) +endif() + +if(COMPILER_SUPPORTS_OPENMP) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") +endif(COMPILER_SUPPORTS_OPENMP) + + +# Include directories + +include_directories(${PROJECT_SOURCE_DIR}/include) +include_directories(${PROJECT_BINARY_DIR}/include) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +# Target mkunroll + +set(TARGET_MKUNROLL "mkunroll") +add_host_executable(${TARGET_MKUNROLL} mkunroll.c) +set_target_properties(${TARGET_MKUNROLL} PROPERTIES ${COMMON_TARGET_PROPERTIES}) +if (NOT CMAKE_CROSSCOMPILING) + target_compile_definitions(${TARGET_MKUNROLL} PRIVATE ${COMMON_TARGET_DEFINITIONS}) +endif() + +# Target mkdispatch + +set(TARGET_MKDISPATCH "mkdispatch") +add_host_executable(${TARGET_MKDISPATCH} mkdispatch.c) +set_target_properties(${TARGET_MKDISPATCH} PROPERTIES ${COMMON_TARGET_PROPERTIES}) +if (NOT CMAKE_CROSSCOMPILING) + target_compile_definitions(${TARGET_MKDISPATCH} PRIVATE ${COMMON_TARGET_DEFINITIONS}) +endif() + +# Target dispatchparam.h + +add_custom_command(OUTPUT dispatchparam.h + COMMENT "Generating dispatchparam.h" + COMMAND $ paramonly ${SLEEFDFT_MAXBUTWIDTH} ${ISALIST_DP} > ${CMAKE_CURRENT_BINARY_DIR}/dispatchparam.h + DEPENDS ${TARGET_MKDISPATCH} + ) +add_custom_target(dispatchparam.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dispatchparam.h) + +# Target dispatch*.h + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + string(TOUPPER ${ST} CST) # CST is "DP" + list(GET LISTLONGTYPENAME ${T} LT) # LT is "double" + list(GET LISTTYPEID ${T} ID) # ID is 1 + + string(CONCAT S "dispatch" ${ST} ".h") # S is dispatchdp.h + add_custom_command(OUTPUT ${S} + COMMENT "Generating ${S}" + COMMAND $ ${LT} ${SLEEFDFT_MAXBUTWIDTH} ${ISALIST_${CST}} > ${S} + DEPENDS ${TARGET_MKDISPATCH} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + + string(CONCAT G ${S} "_generated") # G is dispatchdp.h_generated + add_custom_target(${G} SOURCES ${S}) +endforeach() + +# Target dftcommon.o + +add_library(dftcommon_obj OBJECT dftcommon.c dftcommon.h ${CMAKE_CURRENT_BINARY_DIR}/dispatchparam.h ${sleef_BINARY_DIR}/include/sleef.h) +add_dependencies(dftcommon_obj ${TARGET_HEADERS} dispatchparam.h_generated) +set_source_files_properties(${sleef_BINARY_DIR}/include/sleef.h PROPERTIES GENERATED TRUE) +set_target_properties(dftcommon_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) +target_compile_definitions(dftcommon_obj PRIVATE ${COMMON_TARGET_DEFINITIONS}) + +# Target dft*.o + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + + string(CONCAT G "dft" ${ST} "_obj") # G is "dftdp_obj" + string(CONCAT S "dispatch" ${ST} ".h") # S is "dispatchdp.h" + add_library(${G} OBJECT dft.c dftcommon.h ${S}) + string(CONCAT SG ${S} "_generated") # SG is "dispatchdp.h_generated" + add_dependencies(${G} ${SG} ${TARGET_HEADERS}) + set_target_properties(${G} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + list(GET LISTTYPEID ${T} ID) # ID is 1 + target_compile_definitions(${G} PRIVATE BASETYPEID=${ID} ${COMMON_TARGET_DEFINITIONS}) +endforeach() + +# Copy unroll0.org to ${CMAKE_CURRENT_BINARY_DIR} + +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/unroll0.org + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/unroll0.org ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/unroll0.org) +add_custom_target(unroll0.org.copied DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/unroll0.org) + +# Target unroll*.c + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + string(TOUPPER ${ST} CST) # CST is "DP" + list(GET LISTLONGTYPENAME ${T} LT) # LT is "double" + + foreach(E ${ISALIST_${CST}}) # E is "sse2dp" + foreach(N ${NLIST}) + string(CONCAT UC unroll_ ${N} _ ${E} ".c") # UC is "unroll_0_sse2dp.c" + set(UNROLL_TARGET_${CST} ${UNROLL_TARGET_${CST}} ${UC}) + endforeach() + endforeach() + message(STATUS "Unroll target for ${CST} : ${UNROLL_TARGET_${CST}}") + + if(UNROLL_TARGET_${CST}) + add_custom_command(OUTPUT ${UNROLL_TARGET_${CST}} + COMMENT "Generating ${UNROLL_TARGET_${CST}}" + COMMAND $ ${LT} ${ISALIST_${CST}} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${TARGET_MKUNROLL} unroll0.org.copied + ) + add_custom_target(unroll_target_${ST} DEPENDS ${UNROLL_TARGET_${CST}}) + endif() +endforeach() + +# Target unroll*.o + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + string(TOUPPER ${ST} CST) # CST is "DP" + list(GET LISTLONGTYPENAME ${T} LT) # LT is "double" + + foreach(E ${ISALIST_${CST}}) # E is "sse2dp" + foreach(N ${NLIST}) + string(CONCAT U unroll_ ${N} _ ${E}) # U is "unroll_0_sse2dp" + string(CONCAT UG ${U} "_obj") # UG is "unroll_0_sse2dp_obj" + string(CONCAT UC ${U} ".c") # UC is "unroll_0_sse2dp.c" + add_library(${UG} OBJECT ${UC}) + set_target_properties(${UG} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_include_directories(${UG} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_compile_definitions(${UG} PRIVATE ${COMMON_TARGET_DEFINITIONS} ${MACRODEF_${E}}) + target_compile_options(${UG} PRIVATE ${CFLAGS_${E}}) + add_dependencies(${UG} ${TARGET_HEADERS} unroll_target_${ST}) + endforeach() + endforeach() +endforeach() + +# Target libdft + +add_library(${TARGET_LIBDFT} $ $) +target_link_libraries(${TARGET_LIBDFT} ${TARGET_LIBSLEEF} ${LIBM}) + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + + string(CONCAT G "dft" ${ST} "_obj") # G is "dftdp_obj" + target_sources(${TARGET_LIBDFT} PRIVATE $) +endforeach() + +foreach(T ${LIST_SUPPORTED_FPTYPE}) + list(GET LISTSHORTTYPENAME ${T} ST) # ST is "dp", for example + string(TOUPPER ${ST} CST) # CST is "DP" + + foreach(E ${ISALIST_${CST}}) # E is "sse2dp" + foreach(N ${NLIST}) + string(CONCAT UG unroll_ ${N} _ ${E} "_obj") # U is "unroll_0_sse2dp_obj" + target_sources(${TARGET_LIBDFT} PRIVATE $) + endforeach() + endforeach() +endforeach() + +set_target_properties(${TARGET_LIBDFT} PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${PROJECT_SOURCE_DIR}/include/sleefdft.h + ${COMMON_TARGET_PROPERTIES} + ) + +# Install +install( + TARGETS ${TARGET_LIBDFT} + EXPORT sleefTargets + PUBLIC_HEADER # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT sleef_Development + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime + NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + RUNTIME # + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT sleef_Runtime + INCLUDES # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dft.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dft.c new file mode 100644 index 0000000000000..bc47589a12ceb --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dft.c @@ -0,0 +1,1441 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "sleef.h" + +#include "misc.h" +#include "common.h" +#include "arraymap.h" +#include "dftcommon.h" + +#ifdef _OPENMP +#include +#endif + +#if BASETYPEID == 1 +typedef double real; +typedef Sleef_double2 sc_t; +#define BASETYPESTRING "double" +#define MAGIC 0x27182818 +#define MAGIC2D 0x17320508 +#define INIT SleefDFT_double_init1d +#define EXECUTE SleefDFT_double_execute +#define INIT2D SleefDFT_double_init2d +#define CTBL ctbl_double +#define REALSUB0 realSub0_double +#define REALSUB1 realSub1_double +#define GETINT getInt_double +#define GETPTR getPtr_double +#define DFTF dftf_double +#define DFTB dftb_double +#define TBUTF tbutf_double +#define TBUTB tbutb_double +#define BUTF butf_double +#define BUTB butb_double +#define SINCOSPI Sleef_sincospi_u05 +#include "dispatchdp.h" +#elif BASETYPEID == 2 +typedef float real; +typedef Sleef_float2 sc_t; +#define BASETYPESTRING "float" +#define MAGIC 0x31415926 +#define MAGIC2D 0x22360679 +#define INIT SleefDFT_float_init1d +#define EXECUTE SleefDFT_float_execute +#define INIT2D SleefDFT_float_init2d +#define CTBL ctbl_float +#define REALSUB0 realSub0_float +#define REALSUB1 realSub1_float +#define GETINT getInt_float +#define GETPTR getPtr_float +#define DFTF dftf_float +#define DFTB dftb_float +#define TBUTF tbutf_float +#define TBUTB tbutb_float +#define BUTF butf_float +#define BUTB butb_float +#define SINCOSPI Sleef_sincospif_u05 +#include "dispatchsp.h" +#else +#error No BASETYPEID specified +#endif + +#define IMPORT_IS_EXPORT +#include "sleefdft.h" + +// + +real CTBL[] = { + 0.7071067811865475243818940365159164684883L, -0.7071067811865475243818940365159164684883L, + 0.9238795325112867561014214079495587839119L, -0.382683432365089771723257530688933059082L, + 0.382683432365089771723257530688933059082L, -0.9238795325112867561014214079495587839119L, +#if MAXBUTWIDTH >= 5 + 0.9807852804032304491190993878113602022495L, -0.1950903220161282678433729148581576851029L, + 0.5555702330196022247573058028269343822103L, -0.8314696123025452370808655033762590846891L, + 0.8314696123025452370808655033762590846891L, -0.5555702330196022247573058028269343822103L, + 0.1950903220161282678433729148581576851029L, -0.9807852804032304491190993878113602022495L, +#endif +#if MAXBUTWIDTH >= 6 + 0.9951847266721968862310254699821143731242L, -0.09801714032956060199569840382660679267701L, + 0.6343932841636454982026105398063009488396L, -0.7730104533627369607965383602188325085081L, + 0.881921264348355029715105513066220055407L, -0.4713967368259976485449225247492677226546L, + 0.2902846772544623676448431737195932100803L, -0.9569403357322088649310892760624369657307L, + 0.9569403357322088649310892760624369657307L, -0.2902846772544623676448431737195932100803L, + 0.4713967368259976485449225247492677226546L, -0.881921264348355029715105513066220055407L, + 0.7730104533627369607965383602188325085081L, -0.6343932841636454982026105398063009488396L, + 0.09801714032956060199569840382660679267701L, -0.9951847266721968862310254699821143731242L, +#endif +#if MAXBUTWIDTH >= 7 + 0.9987954562051723927007702841240899260811L, -0.04906767432741801425355085940205324135377L, + 0.6715589548470184006194634573905233310143L, -0.7409511253549590911932944126139233276263L, + 0.9039892931234433315823215138173907234886L, -0.427555093430282094315230886905077056781L, + 0.336889853392220050702686798271834334173L, -0.9415440651830207783906830087961026265475L, + 0.9700312531945439926159106824865574481009L, -0.2429801799032638899447731489766866275204L, + 0.5141027441932217266072797923204262815489L, -0.8577286100002720698929313536407192941624L, + 0.8032075314806449097991200569701675249235L, -0.5956993044924333434615715265891822127742L, + 0.1467304744553617516588479505190711904561L, -0.9891765099647809734561415551112872890371L, + 0.9891765099647809734561415551112872890371L, -0.1467304744553617516588479505190711904561L, + 0.5956993044924333434615715265891822127742L, -0.8032075314806449097991200569701675249235L, + 0.8577286100002720698929313536407192941624L, -0.5141027441932217266072797923204262815489L, + 0.2429801799032638899447731489766866275204L, -0.9700312531945439926159106824865574481009L, + 0.9415440651830207783906830087961026265475L, -0.336889853392220050702686798271834334173L, + 0.427555093430282094315230886905077056781L, -0.9039892931234433315823215138173907234886L, + 0.7409511253549590911932944126139233276263L, -0.6715589548470184006194634573905233310143L, + 0.04906767432741801425355085940205324135377L, -0.9987954562051723927007702841240899260811L, +#endif +}; + +#ifndef ENABLE_STREAM +#error ENABLE_STREAM not defined +#endif + +static const int constK[] = { 0, 2, 6, 14, 38, 94, 230, 542, 1254 }; + +extern const char *configStr[]; + +extern int planFilePathSet; + +// Utility functions + +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +static jmp_buf sigjmp; +#define SETJMP(x) setjmp(x) +#define LONGJMP longjmp +#else +static sigjmp_buf sigjmp; +#define SETJMP(x) sigsetjmp(x, 1) +#define LONGJMP siglongjmp +#endif + +static void sighandler(int signum) { LONGJMP(sigjmp, 1); } + +static int checkISAAvailability(int isa) { + signal(SIGILL, sighandler); + + if (SETJMP(sigjmp) == 0) { + int ret = GETINT[isa] != NULL && (*GETINT[isa])(BASETYPEID); + signal(SIGILL, SIG_DFL); + return ret; + } + + signal(SIGILL, SIG_DFL); + return 0; +} + +#ifdef _OPENMP +static int omp_thread_count() { + int n = 0; +#pragma omp parallel reduction(+:n) + n += 1; + return n; +} +#endif + +static void startAllThreads(const int nth) { +#ifdef _OPENMP + volatile int8_t *state = calloc(nth, 1); + int th=0; +#pragma omp parallel for + for(th=0;thlog2len; + if (level == N) { + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + void (*func)(real *, const real *, const int) = DFTF[config][p->isa][N]; + (*func)(d, s, log2len-N); + } else { + void (*func)(real *, const real *, const int) = DFTB[config][p->isa][N]; + (*func)(d, s, log2len-N); + } + } else if (level == log2len) { + assert(p->vecwidth <= (1 << N)); + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + void (*func)(real *, uint32_t *, const real *, const int, const real *, const int) = TBUTF[config][p->isa][N]; + (*func)(d, p->perm[level], s, log2len-N, p->tbl[N][level], K); + } else { + void (*func)(real *, uint32_t *, const real *, const int, const real *, const int) = TBUTB[config][p->isa][N]; + (*func)(d, p->perm[level], s, log2len-N, p->tbl[N][level], K); + } + } else { + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + void (*func)(real *, uint32_t *, const int, const real *, const int, const real *, const int) = BUTF[config][p->isa][N]; + (*func)(d, p->perm[level], log2len-level, s, log2len-N, p->tbl[N][level], K); + } else { + void (*func)(real *, uint32_t *, const int, const real *, const int, const real *, const int) = BUTB[config][p->isa][N]; + (*func)(d, p->perm[level], log2len-level, s, log2len-N, p->tbl[N][level], K); + } + } +} + +// Transposer + +#if defined(__GNUC__) && __GNUC__ < 5 +// This is another workaround of a bug in gcc-4 +#define LOG2BS 3 +#else +#define LOG2BS 4 +#endif + +#define BS (1 << LOG2BS) +#define TRANSPOSE_BLOCK(y2) do { \ + for(int x2=y2+1;x2= N-1) return cnt; + const int level = levelorg - levelinc; + if (bot - top > 4) { + const int bl = 1 << (N - levelinc); + const int w = bl/4; + for(int j=0;j<(bot-top)/bl;j++) { + for(int i=0;i> 1) | ((k & 0x55555555) << 1)); + r = (((r & 0xcccccccc) >> 2) | ((r & 0x33333333) << 2)); + r = (((r & 0xf0f0f0f0) >> 4) | ((r & 0x0f0f0f0f) << 4)); + r = (((r & 0xff00ff00) >> 8) | ((r & 0x00ff00ff) << 8)); + r = ((r >> 16) | (r << 16)) >> (32-nbits); + + return (((r << s) | (k & ~(-1 << s))) & ~(-1 << d)) | + ((((k >> s) | (r & (-1 << (nbits-s)))) << d) & ~(-1 << nbits)); +} + +static real **makeTable(int sign, int vecwidth, int log2len, const int N, const int K) { + if (log2len < N) return NULL; + + int *p = (int *)malloc(sizeof(int)*((N+1)<bestTime = tm; + for(uint32_t j = 0;j < p->log2len+1;j++) { + p->bestPathConfig[j] = pathConfig[j]; + p->bestPath[j] = path[j]; + } + return nTrial; + } + + if (level < 1) return nTrial-1; + + for(int i=0;i<10;i++) { + int N; + + do { + N = 1 + rand() % MAXBUTWIDTH; + } while(p->tm[0][level*(MAXBUTWIDTH+1)+N] >= 1ULL << 60); + + if (p->vecwidth > (1 << N) || N == p->log2len) continue; + + path[level] = N; + for(;;) { + pathConfig[level] = rand() % CONFIGMAX; +#if ENABLE_STREAM == 0 + pathConfig[level] &= ~1; +#endif + if ((p->mode2 & SLEEF_MODE2_MT1D) == 0 && (pathConfig[level] & CONFIG_MT) != 0) continue; + break; + } + for(int j = level-1;j >= 0;j--) path[j] = 0; + nTrial = searchForRandomPathRecurse(p, level - N, path, pathConfig, 0, nTrial); + if (nTrial <= 0) break; + if (p->bestTime < 1ULL << 60) break; + } + + return nTrial - 1; +} + +// Planner + +#define NSHORTESTPATHS 15 +#define MAXPATHLEN (MAXLOG2LEN+1) +#define POSMAX (CONFIGMAX * MAXLOG2LEN * (MAXBUTWIDTH+1)) + +static int cln2pos(int config, int level, int N) { return (config * MAXLOG2LEN + level) * MAXBUTWIDTH + N; } +static int pos2config(int pos) { return pos == -1 ? -1 : ((pos - 1) / (MAXBUTWIDTH * MAXLOG2LEN)); } +static int pos2level(int pos) { return pos == -1 ? -1 : (((pos - 1) / MAXBUTWIDTH) % MAXLOG2LEN); } +static int pos2N(int pos) { return pos == -1 ? -1 : ((pos - 1) % MAXBUTWIDTH + 1); } + +typedef struct { + SleefDFT *p; + + int countu[POSMAX]; + int path[NSHORTESTPATHS][MAXPATHLEN]; + int pathLen[NSHORTESTPATHS]; + uint64_t cost[NSHORTESTPATHS]; + int nPaths; + + int *heap; + int *heapLen; + uint64_t *heapCost; + int heapSize, nPathsInHeap; +} ks_t; + +static ks_t *ksInit(SleefDFT *p) { + ks_t *q = calloc(1, sizeof(ks_t)); + q->p = p; + q->heapSize = 10; + q->heap = calloc(q->heapSize, sizeof(int)*MAXPATHLEN); + q->heapCost = calloc(q->heapSize, sizeof(uint64_t)); + q->heapLen = calloc(q->heapSize, sizeof(int)); + return q; +} + +static void ksDispose(ks_t *q) { + free(q->heapCost); + free(q->heapLen); + free(q->heap); + free(q); +} + +// returns the number of paths in the heap +static int ksSize(ks_t *q) { return q->nPathsInHeap; } + +// adds a path to the heap +static void ksAddPath(ks_t *q, int *path, int pathLen, uint64_t cost) { + assert(pathLen <= MAXPATHLEN); + + if (q->nPathsInHeap == q->heapSize) { + q->heapSize *= 2; + q->heap = realloc(q->heap, q->heapSize * sizeof(int)*MAXPATHLEN); + q->heapCost = realloc(q->heapCost, q->heapSize * sizeof(uint64_t)); + q->heapLen = realloc(q->heapLen, q->heapSize * sizeof(int)); + } + + for(int i=0;iheap[q->nPathsInHeap * MAXPATHLEN + i] = path[i]; + q->heapLen[q->nPathsInHeap] = pathLen; + q->heapCost[q->nPathsInHeap] = cost; + q->nPathsInHeap++; +} + +// returns the cost of n-th paths in the heap +static uint64_t ksCost(ks_t *q, int n) { + assert(0 <= n && n < q->nPathsInHeap); + return q->heapCost[n]; +} + +// copies the n-th paths in the heap to path, returns its length +static int ksGetPath(ks_t *q, int *path, int n) { + assert(0 <= n && n < q->nPathsInHeap); + int len = q->heapLen[n]; + for(int i=0;iheap[n * MAXPATHLEN + i]; + return len; +} + +// removes the n-th paths in the heap +static void ksRemove(ks_t *q, int n) { + assert(0 <= n && n < q->nPathsInHeap); + + for(int i=n;inPathsInHeap-1;i++) { + int len = q->heapLen[i+1]; + assert(len < MAXPATHLEN); + for(int j=0;jheap[i * MAXPATHLEN + j] = q->heap[(i+1) * MAXPATHLEN + j]; + q->heapLen[i] = q->heapLen[i+1]; + q->heapCost[i] = q->heapCost[i+1]; + } + q->nPathsInHeap--; +} + +// returns the countu value at pos +static int ksCountu(ks_t *q, int pos) { + assert(0 <= pos && pos < POSMAX); + return q->countu[pos]; +} + +// set the countu value at pos to n +static void ksSetCountu(ks_t *q, int pos, int n) { + assert(0 <= pos && pos < POSMAX); + q->countu[pos] = n; +} + +// adds a path as one of the best k paths, returns the number best paths +static int ksAddBestPath(ks_t *q, int *path, int pathLen, uint64_t cost) { + assert(pathLen <= MAXPATHLEN); + assert(q->nPaths < NSHORTESTPATHS); + for(int i=0;ipath[q->nPaths][i] = path[i]; + q->pathLen[q->nPaths] = pathLen; + q->cost[q->nPaths] = cost; + q->nPaths++; + return q->nPaths; +} + +// returns if pos is a destination +static int ksIsDest(ks_t *q, int pos) { return pos2level(pos) == 0; } + +// returns n-th adjacent nodes at pos. +static int ksAdjacent(ks_t *q, int pos, int n) { + if (pos != -1 && pos2level(pos) == 0) return -1; + + int NMAX = MIN(MIN(q->p->log2len, MAXBUTWIDTH+1), q->p->log2len - q->p->log2vecwidth + 1); + + if (pos == -1) { + int N = n / 2 + MAX(q->p->log2vecwidth, 1); + if (N >= NMAX) return -1; + return cln2pos((n & 1) * CONFIG_MT, q->p->log2len, N); + } + + int config = (pos2config(pos) & CONFIG_MT); + int N = n + 1; + int level = pos2level(pos) - pos2N(pos); + + if (level < 0 || N >= NMAX) return -1; + if (level == 0) return n == 0 ? cln2pos(0, 0, 0) : -1; + + return cln2pos(config, level, N); +} + +static uint64_t ksAdjacentCost(ks_t *q, int pos, int n) { + int nxpos = ksAdjacent(q, pos, n); + if (nxpos == -1) return 0; + int config = pos2config(nxpos), level = pos2level(nxpos), N = pos2N(nxpos); + uint64_t ret0 = q->p->tm[config | 0][level*(MAXBUTWIDTH+1) + N]; + uint64_t ret1 = q->p->tm[config | 1][level*(MAXBUTWIDTH+1) + N]; + return MIN(ret0, ret1); +} + +static void searchForBestPath(SleefDFT *p) { + ks_t *q = ksInit(p); + + for(int i=0;;i++) { + int v = ksAdjacent(q, -1, i); + if (v == -1) break; + uint64_t c = ksAdjacentCost(q, -1, i); + int path[1] = { v }; + ksAddPath(q, path, 1, c); + } + + while(ksSize(q) != 0) { + uint64_t bestCost = 1ULL << 60; + int bestPathNum = -1; + + for(int i=0;i= NSHORTESTPATHS) continue; + ksSetCountu(q, lastPos, ksCountu(q, lastPos)+1); + + if (ksIsDest(q, lastPos)) { + if (ksAddBestPath(q, path, pathLen, cost) >= NSHORTESTPATHS) break; + continue; + } + + for(int i=0;;i++) { + int v = ksAdjacent(q, lastPos, i); + if (v == -1) break; + assert(0 <= pos2N(v) && pos2N(v) <= q->p->log2len); + uint64_t c = ksAdjacentCost(q, lastPos, i); + path[pathLen] = v; + ksAddPath(q, path, pathLen+1, cost + c); + } + } + + for(int j = p->log2len;j >= 0;j--) p->bestPath[j] = 0; + + if (((p->mode & SLEEF_MODE_MEASURE) != 0 || (planFilePathSet && (p->mode & SLEEF_MODE_MEASUREBITS) == 0))) { + uint64_t besttm = 1ULL << 62; + int bestPath = -1; + const int niter = 1 + 5000000 / ((1 << p->log2len) + 1); + + real *s2 = NULL, *d2 = NULL; + const real *s = p->in == NULL ? (s2 = (real *)memset(Sleef_malloc((2 << p->log2len) * sizeof(real)), 0, sizeof(real) * (2 << p->log2len))) : p->in; + real *d = p->out == NULL ? (d2 = (real *)memset(Sleef_malloc((2 << p->log2len) * sizeof(real)), 0, sizeof(real) * (2 << p->log2len))) : p->out; + +#ifdef _OPENMP + const int tn = omp_get_thread_num(); +#else + const int tn = 0; +#endif + + real *t[] = { p->x1[tn], p->x0[tn], d }; + + for(int mt=0;mt<2;mt++) { + for(int i=q->nPaths-1;i>=0;i--) { + if (((pos2config(q->path[i][0]) & CONFIG_MT) != 0) != mt) continue; + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) { + for(int j=0;jpathLen[i];j++) { + int N = pos2N(q->path[i][j]); + int level = pos2level(q->path[i][j]); + int config = pos2config(q->path[i][j]) & ~1; + uint64_t t0 = q->p->tm[config | 0][level*(MAXBUTWIDTH+1) + N]; + uint64_t t1 = q->p->tm[config | 1][level*(MAXBUTWIDTH+1) + N]; + config = t0 < t1 ? config : (config | 1); + + if (N != 0) printf("%d(%s) ", N, configStr[config]); + } + } + + if (mt) startAllThreads(p->nThread); + + uint64_t tm0 = Sleef_currentTimeMicros(); + for(int k=0;kpathLen & 1) == 1) nb = -1; + for(int level = p->log2len, j=0;level >= 1;j++) { + assert(pos2level(q->path[i][j]) == level); + int N = pos2N(q->path[i][j]); + int config = pos2config(q->path[i][j]) & ~1; + uint64_t t0 = q->p->tm[config | 0][level*(MAXBUTWIDTH+1) + N]; + uint64_t t1 = q->p->tm[config | 1][level*(MAXBUTWIDTH+1) + N]; + config = t0 < t1 ? config : (config | 1); + dispatch(p, N, t[nb+1], lb, level, config); + level -= N; + lb = t[nb+1]; + nb = (nb + 1) & 1; + } + } + uint64_t tm1 = Sleef_currentTimeMicros(); + for(int k=0;kpathLen & 1) == 1) nb = -1; + for(int level = p->log2len, j=0;level >= 1;j++) { + assert(pos2level(q->path[i][j]) == level); + int N = pos2N(q->path[i][j]); + int config = pos2config(q->path[i][j]) & ~1; + uint64_t t0 = q->p->tm[config | 0][level*(MAXBUTWIDTH+1) + N]; + uint64_t t1 = q->p->tm[config | 1][level*(MAXBUTWIDTH+1) + N]; + config = t0 < t1 ? config : (config | 1); + dispatch(p, N, t[nb+1], lb, level, config); + level -= N; + lb = t[nb+1]; + nb = (nb + 1) & 1; + } + } + uint64_t tm2 = Sleef_currentTimeMicros(); + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf(" : %lld %lld\n", (long long int)(tm1 - tm0), (long long int)(tm2 - tm1)); + if ((tm1 - tm0) < besttm) { + bestPath = i; + besttm = tm1 - tm0; + } + if ((tm2 - tm1) < besttm) { + bestPath = i; + besttm = tm2 - tm1; + } + } + } + + for(int level = p->log2len, j=0;level >= 1;j++) { + assert(pos2level(q->path[bestPath][j]) == level); + int N = pos2N(q->path[bestPath][j]); + + int config = pos2config(q->path[bestPath][j]) & ~1; + uint64_t t0 = q->p->tm[config | 0][level*(MAXBUTWIDTH+1) + N]; + uint64_t t1 = q->p->tm[config | 1][level*(MAXBUTWIDTH+1) + N]; + config = t0 < t1 ? config : (config | 1); + + p->bestPath[level] = N; + p->bestPathConfig[level] = config; + level -= N; + } + + if (d2 != NULL) Sleef_free(d2); + if (s2 != NULL) Sleef_free(s2); + } else { + for(int level = p->log2len, j=0;level >= 1;j++) { + int bestPath = 0; + assert(pos2level(q->path[bestPath][j]) == level); + int N = pos2N(q->path[bestPath][j]); + int config = pos2config(q->path[bestPath][j]); + p->bestPath[level] = N; + p->bestPathConfig[level] = config; + level -= N; + } + } + + ksDispose(q); +} + +// + +static uint64_t estimate(int log2len, int level, int N, int config) { + uint64_t ret = N * 1000 + ABS(N-3) * 1000; + if (log2len >= 14 && (config & CONFIG_MT) != 0) ret /= 2; + return ret; +} + +static void measureBut(SleefDFT *p) { + if (p->x0 == NULL) return; + + // + +#ifdef _OPENMP + const int tn = omp_get_thread_num(); +#else + const int tn = 0; +#endif + + real *s = (real *)memset(p->x0[tn], 0, sizeof(real) * (2 << p->log2len)); + real *d = (real *)memset(p->x1[tn], 0, sizeof(real) * (2 << p->log2len)); + + const int niter = 1 + 100000 / ((1 << p->log2len) + 1); + +#define MEASURE_REPEAT 4 + + for(int rep=1;rep<=MEASURE_REPEAT;rep++) { + for(int config=0;configmode2 & SLEEF_MODE2_MT1D) == 0 && (config & CONFIG_MT) != 0) continue; + for(uint32_t level = p->log2len;level >= 1;level--) { + for(uint32_t N=1;N<=MAXBUTWIDTH;N++) { + if (level < N || p->log2len <= N) continue; + if (level == N) { + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + + uint64_t tm = Sleef_currentTimeMicros(); + for(int i=0;itm[config][level*(MAXBUTWIDTH+1)+N] = MIN(p->tm[config][level*(MAXBUTWIDTH+1)+N], tm); + } else if (level == p->log2len) { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > (1 << N)) continue; + if ((config & CONFIG_MT) != 0) { + int i1=0; +#ifdef _OPENMP +#pragma omp parallel for +#endif + for(i1=0;i1 < (1 << (p->log2len-N-p->log2vecwidth));i1++) { + int i0 = i1 << p->log2vecwidth; + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + } else { + for(int i0=0, i1=0;i0 < (1 << (p->log2len-N));i0+=p->vecwidth, i1++) { + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + } + + uint64_t tm = Sleef_currentTimeMicros(); + for(int i=0;itm[config][level*(MAXBUTWIDTH+1)+N] = MIN(p->tm[config][level*(MAXBUTWIDTH+1)+N], tm); + } else { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > 2 && p->log2len <= N+2) continue; + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + if ((config & CONFIG_MT) != 0) { + int i1=0; +#ifdef _OPENMP +#pragma omp parallel for +#endif + for(i1=0;i1 < (1 << (p->log2len-N-p->log2vecwidth));i1++) { + int i0 = i1 << p->log2vecwidth; + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + } else { + for(int i0=0, i1=0;i0 < (1 << (p->log2len-N));i0+=p->vecwidth, i1++) { + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + } + + uint64_t tm = Sleef_currentTimeMicros(); + for(int i=0;itm[config][level*(MAXBUTWIDTH+1)+N] = MIN(p->tm[config][level*(MAXBUTWIDTH+1)+N], tm); + } + } + } + } + } + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) { + for(uint32_t level = p->log2len;level >= 1;level--) { + for(uint32_t N=1;N<=MAXBUTWIDTH;N++) { + if (level < N || p->log2len <= N) continue; + if (level == N) { + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + printf("bot %d, %d, %d, ", p->log2len, level, N); + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] == 1ULL << 60) { + printf("N/A, "); + } else { + printf("%lld, ", (long long int)p->tm[config][level*(MAXBUTWIDTH+1)+N]); + } + } + printf("\n"); + } else if (level == p->log2len) { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > (1 << N)) continue; + printf("top %d, %d, %d, ", p->log2len, level, N); + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] == 1ULL << 60) { + printf("N/A, "); + } else { + printf("%lld, ", (long long int)p->tm[config][level*(MAXBUTWIDTH+1)+N]); + } + } + printf("\n"); + } else { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > 2 && p->log2len <= N+2) continue; + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + printf("mid %d, %d, %d, ", p->log2len, level, N); + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] == 1ULL << 60) { + printf("N/A, "); + } else { + printf("%lld, ", (long long int)p->tm[config][level*(MAXBUTWIDTH+1)+N]); + } + } + printf("\n"); + } + } + } + } +} + +static void estimateBut(SleefDFT *p) { + for(uint32_t level = p->log2len;level >= 1;level--) { + for(uint32_t N=1;N<=MAXBUTWIDTH;N++) { + if (level < N || p->log2len <= N) continue; + if (level == N) { + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] = estimate(p->log2len, level, N, config); + } + } else if (level == p->log2len) { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > (1 << N)) continue; + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] = estimate(p->log2len, level, N, config); + } + } else { + if (p->tbl[N] == NULL || p->tbl[N][level] == NULL) continue; + if (p->vecwidth > 2 && p->log2len <= N+2) continue; + if ((int)p->log2len - (int)level < p->log2vecwidth) continue; + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] = estimate(p->log2len, level, N, config); + } + } + } + } +} + +static int measure(SleefDFT *p, int randomize) { + if (p->log2len == 1) { + p->bestTime = 1ULL << 60; + + p->pathLen = 1; + p->bestPath[1] = 1; + + return 1; + } + + if (PlanManager_loadMeasurementResultsP(p, (p->mode & SLEEF_MODE_NO_MT) != 0 ? 1 : 0)) { + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) { + printf("Path(loaded) : "); + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) printf("%d(%s) ", p->bestPath[j], configStr[p->bestPathConfig[j]]); + printf("\n"); + } + + return 1; + } + + int toBeSaved = 0; + + for(uint32_t level = p->log2len;level >= 1;level--) { + for(uint32_t N=1;N<=MAXBUTWIDTH;N++) { + for(int config=0;configtm[config][level*(MAXBUTWIDTH+1)+N] = 1ULL << 60; + } + } + } + + if (((p->mode & SLEEF_MODE_MEASURE) != 0 || (planFilePathSet && (p->mode & SLEEF_MODE_MEASUREBITS) == 0)) && !randomize) { + measureBut(p); + toBeSaved = 1; + } else { + estimateBut(p); + } + + int executable = 0; + for(int i=1;i<=MAXBUTWIDTH && !executable;i++) { + if (p->tm[0][p->log2len*(MAXBUTWIDTH+1)+i] < (1ULL << 60)) executable = 1; + } + + if (!executable) return 0; + + p->bestTime = 1ULL << 60; + + p->bestPath[p->log2len] = 0; + + if (!randomize) { + searchForBestPath(p); + } else { + int path[MAXLOG2LEN+1]; + int pathConfig[MAXLOG2LEN+1]; + for(int j = p->log2len;j >= 0;j--) path[j] = pathConfig[j] = 0; + + int nTrial = 100000; + do { + nTrial = searchForRandomPathRecurse(p, p->log2len, path, pathConfig, 0, nTrial); + } while(p->bestTime == 1ULL << 60 && nTrial >= 0); + } + + if (p->bestPath[p->log2len] == 0) return 0; + + p->pathLen = 0; + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) p->pathLen++; + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) { + printf("Path"); + if (randomize) printf("(random) :"); + else if (toBeSaved) printf("(measured) :"); + else printf("(estimated) :"); + + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) printf("%d(%s) ", p->bestPath[j], configStr[p->bestPathConfig[j]]); + printf("\n"); + } + + if (toBeSaved) { + PlanManager_saveMeasurementResultsP(p, (p->mode & SLEEF_MODE_NO_MT) != 0 ? 1 : 0); + } + + return 1; +} + +static void measureTranspose(SleefDFT *p) { + if (PlanManager_loadMeasurementResultsT(p)) { + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose NoMT(loaded): %lld\n", (long long int)p->tmNoMT); + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose MT(loaded): %lld\n", (long long int)p->tmMT); + return; + } + + if ((p->mode & SLEEF_MODE_MEASURE) == 0 && (!planFilePathSet || (p->mode & SLEEF_MODE_MEASUREBITS) != 0)) { + if (p->log2hlen + p->log2vlen >= 14) { + p->tmNoMT = 20; + p->tmMT = 10; + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose : selected MT(estimated)\n"); + } else { + p->tmNoMT = 10; + p->tmMT = 20; + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose : selected NoMT(estimated)\n"); + } + return; + } + + real *tBuf2 = (real *)Sleef_malloc(sizeof(real)*2*p->hlen*p->vlen); + + const int niter = 1 + 5000000 / (p->hlen * p->vlen + 1); + uint64_t tm; + + tm = Sleef_currentTimeMicros(); + for(int i=0;itBuf, p->log2hlen, p->log2vlen); + transpose(tBuf2, p->tBuf, p->log2vlen, p->log2hlen); + } + p->tmNoMT = Sleef_currentTimeMicros() - tm + 1; + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose NoMT(measured): %lld\n", (long long int)p->tmNoMT); + +#ifdef _OPENMP + tm = Sleef_currentTimeMicros(); + for(int i=0;itBuf, p->log2hlen, p->log2vlen); + transposeMT(tBuf2, p->tBuf, p->log2vlen, p->log2hlen); + } + p->tmMT = Sleef_currentTimeMicros() - tm + 1; + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("transpose MT(measured): %lld\n", (long long int)p->tmMT); +#else + p->tmMT = p->tmNoMT*2; +#endif + + Sleef_free(tBuf2); + + PlanManager_saveMeasurementResultsT(p); +} + +// Implementation of SleefDFT_*_init1d + +EXPORT SleefDFT *INIT(uint32_t n, const real *in, real *out, uint64_t mode) { + SleefDFT *p = (SleefDFT *)calloc(1, sizeof(SleefDFT)); + p->magic = MAGIC; + p->baseTypeID = BASETYPEID; + p->in = (const void *)in; + p->out = (void *)out; + + // Mode + + p->mode = mode; + + if ((p->mode & SLEEF_MODE_NO_MT) == 0) { + p->mode2 |= SLEEF_MODE2_MT1D; + } + + if ((mode & SLEEF_MODE_REAL) != 0) n /= 2; + p->log2len = ilog2(n); + + if (p->log2len <= 1) return p; + + if ((mode & SLEEF_MODE_ALT) != 0) p->mode = mode = mode ^ SLEEF_MODE_BACKWARD; + +#ifdef _OPENMP + p->nThread = omp_thread_count(); +#else + p->nThread = 1; + p->mode2 &= ~SLEEF_MODE2_MT1D; +#endif + + // ISA availability + + int bestPriority = -1; + p->isa = -1; + + for(int i=0;i= (uint32_t)((*GETINT[i])(GETINT_VECWIDTH) * (*GETINT[i])(GETINT_VECWIDTH))) { + bestPriority = (*GETINT[i])(GETINT_DFTPRIORITY); + p->isa = i; + } + } + + if (p->isa == -1) { + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("ISA not available\n"); + p->magic = 0; + free(p); + return NULL; + } + + // Tables + + p->perm = (uint32_t **)calloc(sizeof(uint32_t *), p->log2len+1); + for(int level = p->log2len;level >= 1;level--) { + p->perm[level] = (uint32_t *)Sleef_malloc(sizeof(uint32_t) * ((1 << p->log2len) + 8)); + } + + p->x0 = malloc(sizeof(real *) * p->nThread); + p->x1 = malloc(sizeof(real *) * p->nThread); + + for(int i=0;inThread;i++) { + p->x0[i] = (real *)Sleef_malloc(sizeof(real) * 2 * n); + p->x1[i] = (real *)Sleef_malloc(sizeof(real) * 2 * n); + } + + if ((mode & SLEEF_MODE_REAL) != 0) { + p->rtCoef0 = (real *)Sleef_malloc(sizeof(real) * n); + p->rtCoef1 = (real *)Sleef_malloc(sizeof(real) * n); + + if ((mode & SLEEF_MODE_BACKWARD) == 0) { + for(uint32_t i=0;irtCoef0)[i*2+0] = ((real *)p->rtCoef0)[i*2+1] = (real)0.5 - (real)0.5 * sc.x; + ((real *)p->rtCoef1)[i*2+0] = ((real *)p->rtCoef1)[i*2+1] = (real)0.5*sc.y; + } + } else { + for(uint32_t i=0;irtCoef0)[i*2+0] = ((real *)p->rtCoef0)[i*2+1] = (real)0.5 + (real)0.5 * sc.x; + ((real *)p->rtCoef1)[i*2+0] = ((real *)p->rtCoef1)[i*2+1] = (real)0.5*sc.y; + } + } + } + + // Measure + + int sign = (mode & SLEEF_MODE_BACKWARD) != 0 ? -1 : 1; + + p->vecwidth = (*GETINT[p->isa])(GETINT_VECWIDTH); + p->log2vecwidth = ilog2(p->vecwidth); + + for(int i=1;i<=MAXBUTWIDTH;i++) { + ((real ***)p->tbl)[i] = makeTable(sign, p->vecwidth, p->log2len, i, constK[i]); + } + + if (!measure(p, (mode & SLEEF_MODE_DEBUG))) { + // Fall back to the first ISA + freeTables(p); + p->isa = 0; + + p->vecwidth = (*GETINT[p->isa])(GETINT_VECWIDTH); + p->log2vecwidth = ilog2(p->vecwidth); + + for(int i=1;i<=MAXBUTWIDTH;i++) { + ((real ***)p->tbl)[i] = makeTable(sign, p->vecwidth, p->log2len, i, constK[i]); + } + + for(int level = p->log2len;level >= 1;) { + int N = ABS(p->bestPath[level]); + if (level == N) { level -= N; continue; } + + int i1 = 0; + for(int i0=0;i0 < (1 << (p->log2len-N));i0+=p->vecwidth, i1++) { + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + for(;i1 < (1 << p->log2len) + 8;i1++) p->perm[level][i1] = 0; + + level -= N; + } + + if (!measure(p, (mode & SLEEF_MODE_DEBUG))) { + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("Suitable ISA not found. This should not happen.\n"); + return NULL; + } + } + + for(int level = p->log2len;level >= 1;) { + int N = ABS(p->bestPath[level]); + if (level == N) { level -= N; continue; } + + int i1 = 0; + for(int i0=0;i0 < (1 << (p->log2len-N));i0+=p->vecwidth, i1++) { + p->perm[level][i1] = 2*perm(p->log2len, i0, p->log2len-level, p->log2len-(level-N)); + } + for(;i1 < (1 << p->log2len) + 8;i1++) p->perm[level][i1] = 0; + + level -= N; + } + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("ISA : %s %d bit %s\n", (char *)(*GETPTR[p->isa])(0), (int)(GETINT[p->isa](GETINT_VECWIDTH) * sizeof(real) * 16), BASETYPESTRING); + + return p; +} + +// Implementation of SleefDFT_*_init2d + +EXPORT SleefDFT *INIT2D(uint32_t vlen, uint32_t hlen, const real *in, real *out, uint64_t mode) { + SleefDFT *p = (SleefDFT *)calloc(1, sizeof(SleefDFT)); + p->magic = MAGIC2D; + p->mode = mode; + p->baseTypeID = BASETYPEID; + p->in = in; + p->out = out; + p->hlen = hlen; + p->log2hlen = ilog2(hlen); + p->vlen = vlen; + p->log2vlen = ilog2(vlen); + + uint64_t mode1D = mode; + mode1D |= SLEEF_MODE_NO_MT; + + if ((mode & SLEEF_MODE_NO_MT) == 0) p->mode3 |= SLEEF_MODE3_MT2D; + + p->instH = p->instV = INIT(hlen, NULL, NULL, mode1D); + if (hlen != vlen) p->instV = INIT(vlen, NULL, NULL, mode1D); + + p->tBuf = (void *)Sleef_malloc(sizeof(real)*2*hlen*vlen); + + measureTranspose(p); + + return p; +} + +// Implementation of SleefDFT_*_execute + +EXPORT void EXECUTE(SleefDFT *p, const real *s0, real *d0) { + assert(p != NULL && (p->magic == MAGIC || p->magic == MAGIC2D)); + + const real *s = s0 == NULL ? p->in : s0; + real *d = d0 == NULL ? p->out : d0; + + if (p->magic == MAGIC2D) { + // S -> T -> D -> T -> D + + real *tBuf = (real *)(p->tBuf); + +#ifdef _OPENMP + if ((p->mode3 & SLEEF_MODE3_MT2D) != 0 && + (((p->mode & SLEEF_MODE_DEBUG) == 0 && p->tmMT < p->tmNoMT) || + ((p->mode & SLEEF_MODE_DEBUG) != 0 && (rand() & 1)))) + { + int y=0; +#pragma omp parallel for + for(y=0;yvlen;y++) { + EXECUTE(p->instH, &s[p->hlen*2*y], &tBuf[p->hlen*2*y]); + } + + transposeMT(d, tBuf, p->log2vlen, p->log2hlen); + +#pragma omp parallel for + for(y=0;yhlen;y++) { + EXECUTE(p->instV, &d[p->vlen*2*y], &tBuf[p->vlen*2*y]); + } + + transposeMT(d, tBuf, p->log2hlen, p->log2vlen); + } else +#endif + { + for(int y=0;yvlen;y++) { + EXECUTE(p->instH, &s[p->hlen*2*y], &tBuf[p->hlen*2*y]); + } + + transpose(d, tBuf, p->log2vlen, p->log2hlen); + + for(int y=0;yhlen;y++) { + EXECUTE(p->instV, &d[p->vlen*2*y], &tBuf[p->vlen*2*y]); + } + + transpose(d, tBuf, p->log2hlen, p->log2vlen); + } + + return; + } + + if (p->log2len <= 1) { + if ((p->mode & SLEEF_MODE_REAL) == 0) { + real r0 = s[0] + s[2]; + real r1 = s[1] + s[3]; + real r2 = s[0] - s[2]; + real r3 = s[1] - s[3]; + d[0] = r0; d[1] = r1; d[2] = r2; d[3] = r3; + } else { + if ((p->mode & SLEEF_MODE_ALT) == 0) { + if (p->log2len == 1) { + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + real r0 = s[0] + s[2] + (s[1] + s[3]); + real r1 = s[0] + s[2] - (s[1] + s[3]); + real r2 = s[0] - s[2]; + real r3 = s[3] - s[1]; + d[0] = r0; d[1] = 0; d[2] = r2; d[3] = r3; d[4] = r1; d[5] = 0; + } else { + real r0 = (s[0] + s[4])*(real)0.5 + s[2]; + real r1 = (s[0] - s[4])*(real)0.5 - s[3]; + real r2 = (s[0] + s[4])*(real)0.5 - s[2]; + real r3 = (s[0] - s[4])*(real)0.5 + s[3]; + d[0] = r0*2; d[1] = r1*2; d[2] = r2*2; d[3] = r3*2; + } + } else { + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + real r0 = s[0] + s[1]; + real r1 = s[0] - s[1]; + d[0] = r0; d[1] = 0; d[2] = r1; d[3] = 0; + } else { + real r0 = s[0] + s[2]; + real r1 = s[0] - s[2]; + d[0] = r0; d[1] = r1; + } + } + } else { + if (p->log2len == 1) { + if ((p->mode & SLEEF_MODE_BACKWARD) == 0) { + real r0 = s[0] + s[2] + (s[1] + s[3]); + real r1 = s[0] + s[2] - (s[1] + s[3]); + real r2 = s[0] - s[2]; + real r3 = s[1] - s[3]; + d[0] = r0; d[1] = r1; d[2] = r2; d[3] = r3; + } else { + real r0 = (s[0] + s[1])*(real)0.5 + s[2]; + real r1 = (s[0] - s[1])*(real)0.5 + s[3]; + real r2 = (s[0] + s[1])*(real)0.5 - s[2]; + real r3 = (s[0] - s[1])*(real)0.5 - s[3]; + d[0] = r0; d[1] = r1; d[2] = r2; d[3] = r3; + } + } else { + real c = ((p->mode & SLEEF_MODE_BACKWARD) != 0) ? (real)0.5 : (real)1.0; + real r0 = s[0] + s[1]; + real r1 = s[0] - s[1]; + d[0] = r0 * c; d[1] = r1 * c; + } + } + } + return; + } + + // + +#ifdef _OPENMP + const int tn = omp_get_thread_num(); + real *t[] = { p->x1[tn], p->x0[tn], d }; +#else + real *t[] = { p->x1[0], p->x0[0], d }; +#endif + + const real *lb = s; + int nb = 0; + + if ((p->mode & SLEEF_MODE_REAL) != 0 && (p->pathLen & 1) == 0 && + ((p->mode & SLEEF_MODE_BACKWARD) != 0) != ((p->mode & SLEEF_MODE_ALT) != 0)) nb = -1; + if ((p->mode & SLEEF_MODE_REAL) == 0 && (p->pathLen & 1) == 1) nb = -1; + + if ((p->mode & SLEEF_MODE_REAL) != 0 && + ((p->mode & SLEEF_MODE_BACKWARD) != 0) != ((p->mode & SLEEF_MODE_ALT) != 0)) { + (*REALSUB1[p->isa])(t[nb+1], s, p->log2len, p->rtCoef0, p->rtCoef1, (p->mode & SLEEF_MODE_ALT) == 0); + if ((p-> mode & SLEEF_MODE_ALT) == 0) t[nb+1][(1 << p->log2len)+1] = -s[(1 << p->log2len)+1] * 2; + lb = t[nb+1]; + nb = (nb + 1) & 1; + } + + for(int level = p->log2len;level >= 1;) { + int N = ABS(p->bestPath[level]), config = p->bestPathConfig[level]; + dispatch(p, N, t[nb+1], lb, level, config); + level -= N; + lb = t[nb+1]; + nb = (nb + 1) & 1; + } + + if ((p->mode & SLEEF_MODE_REAL) != 0 && + ((p->mode & SLEEF_MODE_BACKWARD) == 0) != ((p->mode & SLEEF_MODE_ALT) != 0)) { + (*REALSUB0[p->isa])(d, lb, p->log2len, p->rtCoef0, p->rtCoef1); + if ((p->mode & SLEEF_MODE_ALT) == 0) { + d[(1 << p->log2len)+1] = -d[(1 << p->log2len)+1]; + d[(2 << p->log2len)+0] = d[1]; + d[(2 << p->log2len)+1] = 0; + d[1] = 0; + } + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.c new file mode 100644 index 0000000000000..184af8f20272d --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.c @@ -0,0 +1,423 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef _OPENMP +#include +#endif + +#include "misc.h" +#include "sleef.h" + +#define IMPORT_IS_EXPORT +#include "sleefdft.h" +#include "dispatchparam.h" +#include "dftcommon.h" +#include "common.h" +#include "arraymap.h" + +#define MAGIC_FLOAT 0x31415926 +#define MAGIC_DOUBLE 0x27182818 + +#define MAGIC2D_FLOAT 0x22360679 +#define MAGIC2D_DOUBLE 0x17320508 + +const char *configStr[] = { "ST", "ST stream", "MT", "MT stream" }; + +static int parsePathStr(char *p, int *path, int *config, int pathLenMax, int log2len) { + int pathLen = 0, l2l = 0; + + for(;;) { + while(*p == ' ') p++; + if (*p == '\0') break; + if (!isdigit((int)*p)) return -1; + + pathLen++; + if (pathLen >= pathLenMax) return -2; + + int n = 0; + while(isdigit((int)*p)) n = n * 10 + *p++ - '0'; + + if (n > MAXBUTWIDTH) return -6; + path[pathLen-1] = n; + l2l += n; + config[pathLen-1] = 0; + + if (*p != '(') continue; + + int c; + for(c=3;c>=0;c--) if (strncmp(p+1, configStr[c], strlen(configStr[c])) == 0) break; + if (c == -1) return -3; + p += strlen(configStr[c]) + 1; + if (*p != ')') return -4; + p++; + + config[pathLen-1] = c; + } + + if (l2l != log2len) return -5; + + return pathLen; +} + +EXPORT void SleefDFT_setPath(SleefDFT *p, char *pathStr) { + assert(p != NULL && (p->magic == MAGIC_FLOAT || p->magic == MAGIC_DOUBLE)); + + int path[32], config[32]; + int pathLen = parsePathStr(pathStr, path, config, 31, p->log2len); + + if (pathLen < 0) { + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) printf("Error %d in parsing path string : %s\n", pathLen, pathStr); + return; + } + + for(uint32_t j = 0;j <= p->log2len;j++) p->bestPath[j] = 0; + + for(int level = p->log2len, j=0;level > 0 && j < pathLen;) { + p->bestPath[level] = path[j]; + p->bestPathConfig[level] = config[j]; + level -= path[j]; + j++; + } + + p->pathLen = 0; + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) p->pathLen++; + + if ((p->mode & SLEEF_MODE_VERBOSE) != 0) { + printf("Set path : "); + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) printf("%d(%s) ", p->bestPath[j], configStr[p->bestPathConfig[j]]); + printf("\n"); + } +} + +void freeTables(SleefDFT *p) { + for(int N=1;N<=MAXBUTWIDTH;N++) { + for(uint32_t level=N;level<=p->log2len;level++) { + Sleef_free(p->tbl[N][level]); + } + free(p->tbl[N]); + p->tbl[N] = NULL; + } +} + +EXPORT void SleefDFT_dispose(SleefDFT *p) { + if (p != NULL && (p->magic == MAGIC2D_FLOAT || p->magic == MAGIC2D_DOUBLE)) { + Sleef_free(p->tBuf); + SleefDFT_dispose(p->instH); + if (p->hlen != p->vlen) SleefDFT_dispose(p->instV); + + p->magic = 0; + free(p); + return; + } + + assert(p != NULL && (p->magic == MAGIC_FLOAT || p->magic == MAGIC_DOUBLE)); + + if (p->log2len <= 1) { + p->magic = 0; + free(p); + return; + } + + if ((p->mode & SLEEF_MODE_REAL) != 0) { + Sleef_free(p->rtCoef1); + Sleef_free(p->rtCoef0); + p->rtCoef0 = p->rtCoef1 = NULL; + } + + for(int level = p->log2len;level >= 1;level--) { + Sleef_free(p->perm[level]); + } + free(p->perm); + p->perm = NULL; + + freeTables(p); + + p->magic = 0; + free(p); +} + +uint32_t ilog2(uint32_t q) { + static const uint32_t tab[] = {0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4}; + uint32_t r = 0,qq; + + if (q & 0xffff0000) r = 16; + + q >>= r; + qq = q | (q >> 1); + qq |= (qq >> 2); + qq = ((qq & 0x10) >> 4) | ((qq & 0x100) >> 7) | ((qq & 0x1000) >> 10); + + return r + tab[qq] * 4 + tab[q >> (tab[qq] * 4)] - 1; +} + +// + +char *dftPlanFilePath = NULL; +char *archID = NULL; +uint64_t planMode = SLEEF_PLAN_REFERTOENVVAR; +ArrayMap *planMap = NULL; +int planFilePathSet = 0, planFileLoaded = 0; +#ifdef _OPENMP +omp_lock_t planMapLock; +int planMapLockInitialized = 0; +#endif + +static void initPlanMapLock() { +#ifdef _OPENMP +#pragma omp critical + { + if (!planMapLockInitialized) { + planMapLockInitialized = 1; + omp_init_lock(&planMapLock); + } + } +#endif +} + +static void planMap_clear() { + if (planMap != NULL) ArrayMap_dispose(planMap); + planMap = NULL; +} + +EXPORT void SleefDFT_setPlanFilePath(const char *path, const char *arch, uint64_t mode) { + initPlanMapLock(); + + if ((mode & SLEEF_PLAN_RESET) != 0) { + planMap_clear(); + planFileLoaded = 0; + planFilePathSet = 0; + } + + if (dftPlanFilePath != NULL) free(dftPlanFilePath); + if (path != NULL) { + dftPlanFilePath = malloc(strlen(path)+10); + strcpy(dftPlanFilePath, path); + } else { + dftPlanFilePath = NULL; + } + + if (archID != NULL) free(archID); + if (arch == NULL) arch = Sleef_getCpuIdString(); + archID = malloc(strlen(arch)+10); + strcpy(archID, arch); + + planMode = mode; + planFilePathSet = 1; +} + +static void loadPlanFromFile() { + if (planFilePathSet == 0 && (planMode & SLEEF_PLAN_REFERTOENVVAR) != 0) { + char *s = getenv(ENVVAR); + if (s != NULL) SleefDFT_setPlanFilePath(s, NULL, planMode); + } + + if (planMap != NULL) ArrayMap_dispose(planMap); + + if (dftPlanFilePath != NULL && (planMode & SLEEF_PLAN_RESET) == 0) { + planMap = ArrayMap_load(dftPlanFilePath, archID, PLANFILEID, (planMode & SLEEF_PLAN_NOLOCK) == 0); + } + + if (planMap == NULL) planMap = initArrayMap(); + + planFileLoaded = 1; +} + +static void savePlanToFile() { + assert(planFileLoaded); + if ((planMode & SLEEF_PLAN_READONLY) == 0 && dftPlanFilePath != NULL) { + ArrayMap_save(planMap, dftPlanFilePath, archID, PLANFILEID); + } +} + +#define CATBIT 8 +#define BASETYPEIDBIT 2 +#define LOG2LENBIT 8 +#define DIRBIT 1 + +#define BUTSTATBIT 16 + +static uint64_t keyButStat(int baseTypeID, int log2len, int dir, int butStat) { + dir = (dir & SLEEF_MODE_BACKWARD) == 0; + int cat = 0; + uint64_t k = 0; + k = (k << BUTSTATBIT) | (butStat & ~(~(uint64_t)0 << BUTSTATBIT)); + k = (k << LOG2LENBIT) | (log2len & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << DIRBIT) | (dir & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << BASETYPEIDBIT) | (baseTypeID & ~(~(uint64_t)0 << BASETYPEIDBIT)); + k = (k << CATBIT) | (cat & ~(~(uint64_t)0 << CATBIT)); + return k; +} + +#define LEVELBIT LOG2LENBIT +#define BUTCONFIGBIT 8 +#define TRANSCONFIGBIT 8 + +static uint64_t keyTrans(int baseTypeID, int hlen, int vlen, int transConfig) { + int max = MAX(hlen, vlen), min = MIN(hlen, vlen); + int cat = 2; + uint64_t k = 0; + k = (k << TRANSCONFIGBIT) | (transConfig & ~(~(uint64_t)0 << TRANSCONFIGBIT)); + k = (k << LOG2LENBIT) | (max & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << LOG2LENBIT) | (min & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << BASETYPEIDBIT) | (baseTypeID & ~(~(uint64_t)0 << BASETYPEIDBIT)); + k = (k << CATBIT) | (cat & ~(~(uint64_t)0 << CATBIT)); + return k; +} + +static uint64_t keyPath(int baseTypeID, int log2len, int dir, int level, int config) { + dir = (dir & SLEEF_MODE_BACKWARD) == 0; + int cat = 3; + uint64_t k = 0; + k = (k << BUTCONFIGBIT) | (config & ~(~(uint64_t)0 << BUTCONFIGBIT)); + k = (k << LEVELBIT) | (level & ~(~(uint64_t)0 << LEVELBIT)); + k = (k << LOG2LENBIT) | (log2len & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << DIRBIT) | (dir & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << BASETYPEIDBIT) | (baseTypeID & ~(~(uint64_t)0 << BASETYPEIDBIT)); + k = (k << CATBIT) | (cat & ~(~(uint64_t)0 << CATBIT)); + return k; +} + +static uint64_t keyPathConfig(int baseTypeID, int log2len, int dir, int level, int config) { + dir = (dir & SLEEF_MODE_BACKWARD) == 0; + int cat = 4; + uint64_t k = 0; + k = (k << BUTCONFIGBIT) | (config & ~(~(uint64_t)0 << BUTCONFIGBIT)); + k = (k << LEVELBIT) | (level & ~(~(uint64_t)0 << LEVELBIT)); + k = (k << LOG2LENBIT) | (log2len & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << DIRBIT) | (dir & ~(~(uint64_t)0 << LOG2LENBIT)); + k = (k << BASETYPEIDBIT) | (baseTypeID & ~(~(uint64_t)0 << BASETYPEIDBIT)); + k = (k << CATBIT) | (cat & ~(~(uint64_t)0 << CATBIT)); + return k; +} + +static uint64_t planMap_getU64(uint64_t key) { + char *s = ArrayMap_get(planMap, key); + if (s == NULL) return 0; + uint64_t ret; + if (sscanf(s, "%" SCNx64, &ret) != 1) return 0; + return ret; +} + +static void planMap_putU64(uint64_t key, uint64_t value) { + char *s = malloc(100); + sprintf(s, "%" PRIx64, value); + s = ArrayMap_put(planMap, key, s); + if (s != NULL) free(s); +} + +int PlanManager_loadMeasurementResultsP(SleefDFT *p, int pathCat) { + assert(p != NULL && (p->magic == MAGIC_FLOAT || p->magic == MAGIC_DOUBLE)); + + initPlanMapLock(); + +#ifdef _OPENMP + omp_set_lock(&planMapLock); +#endif + if (!planFileLoaded) loadPlanFromFile(); + + int stat = planMap_getU64(keyButStat(p->baseTypeID, p->log2len, p->mode, pathCat+10)); + if (stat == 0) { +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif + return 0; + } + + int ret = 1; + + for(int j = p->log2len;j >= 0;j--) { + p->bestPath[j] = planMap_getU64(keyPath(p->baseTypeID, p->log2len, p->mode, j, pathCat)); + p->bestPathConfig[j] = planMap_getU64(keyPathConfig(p->baseTypeID, p->log2len, p->mode, j, pathCat)); + if (p->bestPath[j] > MAXBUTWIDTH) ret = 0; + } + + p->pathLen = 0; + for(int j = p->log2len;j >= 0;j--) if (p->bestPath[j] != 0) p->pathLen++; + +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif + return ret; +} + +void PlanManager_saveMeasurementResultsP(SleefDFT *p, int pathCat) { + assert(p != NULL && (p->magic == MAGIC_FLOAT || p->magic == MAGIC_DOUBLE)); + + initPlanMapLock(); + +#ifdef _OPENMP + omp_set_lock(&planMapLock); +#endif + if (!planFileLoaded) loadPlanFromFile(); + + if (planMap_getU64(keyButStat(p->baseTypeID, p->log2len, p->mode, pathCat+10)) != 0) { +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif + return; + } + + for(int j = p->log2len;j >= 0;j--) { + planMap_putU64(keyPath(p->baseTypeID, p->log2len, p->mode, j, pathCat), p->bestPath[j]); + planMap_putU64(keyPathConfig(p->baseTypeID, p->log2len, p->mode, j, pathCat), p->bestPathConfig[j]); + } + + planMap_putU64(keyButStat(p->baseTypeID, p->log2len, p->mode, pathCat+10), 1); + + if ((planMode & SLEEF_PLAN_READONLY) == 0) savePlanToFile(); + +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif +} + +int PlanManager_loadMeasurementResultsT(SleefDFT *p) { + assert(p != NULL && (p->magic == MAGIC2D_FLOAT || p->magic == MAGIC2D_DOUBLE)); + + initPlanMapLock(); + +#ifdef _OPENMP + omp_set_lock(&planMapLock); +#endif + if (!planFileLoaded) loadPlanFromFile(); + + p->tmNoMT = planMap_getU64(keyTrans(p->baseTypeID, p->log2hlen, p->log2vlen, 0)); + p->tmMT = planMap_getU64(keyTrans(p->baseTypeID, p->log2hlen, p->log2vlen, 1)); + +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif + return p->tmNoMT != 0; +} + +void PlanManager_saveMeasurementResultsT(SleefDFT *p) { + assert(p != NULL && (p->magic == MAGIC2D_FLOAT || p->magic == MAGIC2D_DOUBLE)); + + initPlanMapLock(); + +#ifdef _OPENMP + omp_set_lock(&planMapLock); +#endif + if (!planFileLoaded) loadPlanFromFile(); + + planMap_putU64(keyTrans(p->baseTypeID, p->log2hlen, p->log2vlen, 0), p->tmNoMT); + planMap_putU64(keyTrans(p->baseTypeID, p->log2hlen, p->log2vlen, 1), p->tmMT ); + + if ((planMode & SLEEF_PLAN_READONLY) == 0) savePlanToFile(); + +#ifdef _OPENMP + omp_unset_lock(&planMapLock); +#endif +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.h new file mode 100644 index 0000000000000..54a461d7d9277 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/dftcommon.h @@ -0,0 +1,69 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define CONFIGMAX 4 +#define CONFIG_STREAM 1 +#define CONFIG_MT 2 + +#define MAXLOG2LEN 32 + +typedef struct SleefDFT { + uint32_t magic; + uint64_t mode, mode2, mode3; + int baseTypeID; + const void *in; + void *out; + + union { + struct { + uint32_t log2len; + + void **tbl[MAXBUTWIDTH+1]; + void *rtCoef0, *rtCoef1; + uint32_t **perm; + + void **x0, **x1; + + int isa; + int planMode; + + int vecwidth, log2vecwidth; + int nThread; + + uint64_t tm[CONFIGMAX][(MAXBUTWIDTH+1)*32]; + uint64_t bestTime; + int16_t bestPath[32], bestPathConfig[32], pathLen; + }; + + struct { + int32_t hlen, vlen; + int32_t log2hlen, log2vlen; + uint64_t tmNoMT, tmMT; + struct SleefDFT *instH, *instV; + void *tBuf; + }; + }; +} SleefDFT; + +#define SLEEF_MODE2_MT1D (1 << 0) +#define SLEEF_MODE3_MT2D (1 << 0) + +#define PLANFILEID "SLEEFDFT0\n" +#define ENVVAR "SLEEFDFTPLAN" + +#define SLEEF_MODE_MEASUREBITS (3 << 20) + +void freeTables(SleefDFT *p); +uint32_t ilog2(uint32_t q); + +//int PlanManager_loadMeasurementResultsB(SleefDFT *p); +//void PlanManager_saveMeasurementResultsB(SleefDFT *p, int butStat); +int PlanManager_loadMeasurementResultsT(SleefDFT *p); +void PlanManager_saveMeasurementResultsT(SleefDFT *p); +int PlanManager_loadMeasurementResultsP(SleefDFT *p, int pathCat); +void PlanManager_saveMeasurementResultsP(SleefDFT *p, int pathCat); + +#define GETINT_VECWIDTH 100 +#define GETINT_DFTPRIORITY 101 diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/mkdispatch.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/mkdispatch.c new file mode 100644 index 0000000000000..76d6b72e835eb --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/dft/mkdispatch.c @@ -0,0 +1,193 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#ifndef ENABLE_STREAM +#error ENABLE_STREAM not defined +#endif + +int main(int argc, char **argv) { + if (argc < 3) { + fprintf(stderr, "Usage : %s ...\n", argv[0]); + exit(-1); + } + + const char *basetype = argv[1]; + const int maxbutwidth = atoi(argv[2]); + const int isastart = 3; + const int isamax = argc - isastart; + +#if ENABLE_STREAM == 1 + const int enable_stream = 1; +#else + const int enable_stream = 0; +#endif + + printf("#define MAXBUTWIDTH %d\n", maxbutwidth); + printf("\n"); + + if (strcmp(basetype, "paramonly") == 0) exit(0); + + printf("#define ISAMAX %d\n", isamax); + printf("#define CONFIGMAX 4\n"); + + for(int k=isastart;k +#include +#include +#include + +#define CONFIGMAX 4 + +char *replaceAll(const char *in, const char *pat, const char *replace) { + const int replaceLen = (int)strlen(replace); + const int patLen = (int)strlen(pat); + + char *str = malloc(strlen(in)+1); + strcpy(str, in); + + for(;;) { + char *p = strstr(str, pat); + if (p == NULL) return str; + + int replace_pos = (int)(p - str); + int tail_len = (int)strlen(p + patLen); + + char *newstr = malloc(strlen(str) + (replaceLen - patLen) + 1); + + memcpy(newstr, str, replace_pos); + memcpy(newstr + replace_pos, replace, replaceLen); + memcpy(newstr + replace_pos + replaceLen, str + replace_pos + patLen, tail_len+1); + + free(str); + str = newstr; + } + + return str; +} + +#define LEN 1024 +char line[LEN+10]; + +int main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Usage : %s ...\n", argv[0]); + exit(-1); + } + + const char *baseType = argv[1]; + const int isastart = 2; + + for(int config=0;config> outShift); + + store(out, (0 << outShift), plus(load(in, (0 << inShift)), load(in, (1 << inShift)))); + real2 v4 = minus(load(in, (0 << inShift)), load(in, (1 << inShift))); + store(out, (1 << outShift), ctimesminusplus(v4, tbl[0 + tbloffset], ctimes(reverse(v4), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void but2b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + store(out, (0 << outShift), plus(load(in, (0 << inShift)), load(in, (1 << inShift)))); + real2 v4 = minus(load(in, (0 << inShift)), load(in, (1 << inShift))); + store(out, (1 << outShift), ctimesminusplus(v4, tbl[0 + tbloffset], ctimes(reverse(v4), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void tbut2f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + scatter(out, 0, 2, plus(load(in, (0 << inShift)), load(in, (1 << inShift)))); + real2 v4 = minus(load(in, (0 << inShift)), load(in, (1 << inShift))); + scatter(out, 1, 2, timesminusplus(v4, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v4), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void tbut2b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + scatter(out, 0, 2, plus(load(in, (0 << inShift)), load(in, (1 << inShift)))); + real2 v4 = minus(load(in, (0 << inShift)), load(in, (1 << inShift))); + scatter(out, 1, 2, timesminusplus(v4, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v4), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void dft4f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v3 = load(in, 1 << shift); + real2 v5 = load(in, 3 << shift); + real2 v7 = reverse(minus(v3, v5)); + real2 v13 = plus(v3, v5); + real2 v4 = load(in, 2 << shift); + real2 v2 = load(in, 0 << shift); + real2 v8 = minus(v4, v2); + real2 v12 = plus(v2, v4); + store(out, 3 << shift, minus(uminusplus(v7), v8)); + store(out, 1 << shift, minus(uplusminus(v7), v8)); + store(out, 2 << shift, minus(v12, v13)); + store(out, 0 << shift, plus(v12, v13)); + } +} + +ALIGNED(8192) void dft4b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v3 = load(in, 1 << shift); + real2 v5 = load(in, 3 << shift); + real2 v13 = plus(v3, v5); + real2 v7 = reverse(minus(v5, v3)); + real2 v4 = load(in, 2 << shift); + real2 v2 = load(in, 0 << shift); + real2 v8 = minus(v4, v2); + store(out, 3 << shift, minus(uminusplus(v7), v8)); + store(out, 1 << shift, minus(uplusminus(v7), v8)); + real2 v12 = plus(v2, v4); + store(out, 2 << shift, minus(v12, v13)); + store(out, 0 << shift, plus(v12, v13)); + } +} + +ALIGNED(8192) void but4f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v5 = load(in, 3 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v7 = reverse(minus(v3, v5)); + real2 v13 = plus(v3, v5); + real2 v2 = load(in, 0 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v8 = minus(v4, v2); + real2 v12 = plus(v2, v4); + store(out, 0 << outShift, plus(v12, v13)); + real2 v26 = minus(v12, v13); + store(out, 2 << outShift, ctimesminusplus(v26, tbl[0 + tbloffset], ctimes(reverse(v26), tbl[1 + tbloffset]))); + real2 v11 = minusplus(uminus(v7), v8); + real2 v9 = minusplus(v7, v8); + store(out, 1 << outShift, ctimesminusplus(reverse(v9), tbl[2 + tbloffset], ctimes(v9, tbl[3 + tbloffset]))); + store(out, 3 << outShift, ctimesminusplus(reverse(v11), tbl[4 + tbloffset], ctimes(v11, tbl[5 + tbloffset]))); + } +} + +ALIGNED(8192) void but4b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v5 = load(in, 3 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v7 = reverse(minus(v5, v3)); + real2 v13 = plus(v3, v5); + real2 v2 = load(in, 0 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v8 = minus(v4, v2); + real2 v12 = plus(v2, v4); + store(out, 0 << outShift, plus(v12, v13)); + real2 v26 = minus(v12, v13); + store(out, 2 << outShift, ctimesminusplus(v26, tbl[0 + tbloffset], ctimes(reverse(v26), tbl[1 + tbloffset]))); + real2 v11 = minusplus(uminus(v7), v8); + real2 v9 = minusplus(v7, v8); + store(out, 1 << outShift, ctimesminusplus(reverse(v9), tbl[2 + tbloffset], ctimes(v9, tbl[3 + tbloffset]))); + store(out, 3 << outShift, ctimesminusplus(reverse(v11), tbl[4 + tbloffset], ctimes(v11, tbl[5 + tbloffset]))); + } +} + +ALIGNED(8192) void tbut4f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v5 = load(in, 3 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v7 = reverse(minus(v3, v5)); + real2 v13 = plus(v3, v5); + real2 v2 = load(in, 0 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v8 = minus(v4, v2); + real2 v12 = plus(v2, v4); + scatter(out, 0, 4, plus(v12, v13)); + real2 v26 = minus(v12, v13); + scatter(out, 2, 4, timesminusplus(v26, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v26), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v11 = minusplus(uminus(v7), v8); + real2 v9 = minusplus(v7, v8); + scatter(out, 1, 4, timesminusplus(reverse(v9), load(tbl, 2 * VECWIDTH + tbloffset), times(v9, load(tbl, 3 * VECWIDTH + tbloffset)))); + scatter(out, 3, 4, timesminusplus(reverse(v11), load(tbl, 4 * VECWIDTH + tbloffset), times(v11, load(tbl, 5 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void tbut4b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v5 = load(in, 3 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v7 = reverse(minus(v5, v3)); + real2 v13 = plus(v3, v5); + real2 v2 = load(in, 0 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v8 = minus(v4, v2); + real2 v12 = plus(v2, v4); + scatter(out, 0, 4, plus(v12, v13)); + real2 v26 = minus(v12, v13); + scatter(out, 2, 4, timesminusplus(v26, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v26), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v11 = minusplus(uminus(v7), v8); + real2 v9 = minusplus(v7, v8); + scatter(out, 1, 4, timesminusplus(reverse(v9), load(tbl, 2 * VECWIDTH + tbloffset), times(v9, load(tbl, 3 * VECWIDTH + tbloffset)))); + scatter(out, 3, 4, timesminusplus(reverse(v11), load(tbl, 4 * VECWIDTH + tbloffset), times(v11, load(tbl, 5 * VECWIDTH + tbloffset)))); + } +} + +#if MAXBUTWIDTH >= 3 +ALIGNED(8192) void dft8f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v9 = load(in, 7 << shift); + real2 v5 = load(in, 3 << shift); + real2 v33 = plus(v5, v9); + real2 v27 = reverse(minus(v5, v9)); + real2 v3 = load(in, 1 << shift); + real2 v7 = load(in, 5 << shift); + real2 v32 = plus(v3, v7); + real2 v28 = minus(v7, v3); + real2 v45 = reverse(minus(v32, v33)); + real2 v51 = plus(v32, v33); + real2 v29 = minusplus(v27, v28); + real2 v31 = minusplus(uminus(v27), v28); + real2 v43 = ctimesminusplus(reverse(v31), ctbl[1], ctimes(v31, ctbl[0])); + real2 v6 = load(in, 4 << shift); + real2 v2 = load(in, 0 << shift); + real2 v12 = minus(v6, v2); + real2 v16 = plus(v2, v6); + real2 v8 = load(in, 6 << shift); + real2 v4 = load(in, 2 << shift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v4, v8)); + real2 v46 = minus(v17, v16); + store(out, 2 << shift, minus(uplusminus(v45), v46)); + store(out, 6 << shift, minus(uminusplus(v45), v46)); + real2 v50 = plus(v16, v17); + store(out, 4 << shift, minus(v50, v51)); + store(out, 0 << shift, plus(v50, v51)); + real2 v25 = minus(uminusplus(v11), v12); + store(out, 3 << shift, plus(v25, v43)); + store(out, 7 << shift, minus(v25, v43)); + real2 v21 = minus(uplusminus(v11), v12); + real2 v38 = ctimesminusplus(reverse(v29), ctbl[1], ctimes(v29, ctbl[1])); + store(out, 1 << shift, plus(v21, v38)); + store(out, 5 << shift, minus(v21, v38)); + } +} + +ALIGNED(8192) void dft8b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v8 = load(in, 6 << shift); + real2 v4 = load(in, 2 << shift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v8, v4)); + real2 v2 = load(in, 0 << shift); + real2 v6 = load(in, 4 << shift); + real2 v16 = plus(v2, v6); + real2 v12 = minus(v6, v2); + real2 v50 = plus(v16, v17); + real2 v46 = minus(v17, v16); + real2 v21 = minus(uplusminus(v11), v12); + real2 v25 = minus(uminusplus(v11), v12); + real2 v3 = load(in, 1 << shift); + real2 v7 = load(in, 5 << shift); + real2 v28 = minus(v7, v3); + real2 v32 = plus(v3, v7); + real2 v5 = load(in, 3 << shift); + real2 v9 = load(in, 7 << shift); + real2 v33 = plus(v5, v9); + real2 v27 = reverse(minus(v9, v5)); + real2 v45 = reverse(minus(v33, v32)); + real2 v51 = plus(v32, v33); + store(out, 0 << shift, plus(v50, v51)); + store(out, 4 << shift, minus(v50, v51)); + store(out, 2 << shift, minus(uplusminus(v45), v46)); + store(out, 6 << shift, minus(uminusplus(v45), v46)); + real2 v31 = minusplus(uminus(v27), v28); + real2 v29 = minusplus(v27, v28); + real2 v43 = ctimesminusplus(reverse(v31), ctbl[0], ctimes(v31, ctbl[0])); + store(out, 7 << shift, minus(v25, v43)); + store(out, 3 << shift, plus(v25, v43)); + real2 v39 = ctimesminusplus(reverse(v29), ctbl[0], ctimes(v29, ctbl[1])); + store(out, 1 << shift, plus(v21, v39)); + store(out, 5 << shift, minus(v21, v39)); + } +} + +ALIGNED(8192) void but8f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v9 = load(in, 7 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v37 = plus(v5, v9); + real2 v31 = reverse(minus(v5, v9)); + real2 v7 = load(in, 5 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v36 = plus(v3, v7); + real2 v32 = minus(v7, v3); + real2 v57 = plus(v36, v37); + real2 v51 = reverse(minus(v36, v37)); + real2 v35 = minusplus(uminus(v31), v32); + real2 v33 = minusplus(v31, v32); + real2 v43 = ctimesminusplus(reverse(v33), tbl[6 + tbloffset], ctimes(v33, tbl[7 + tbloffset])); + real2 v6 = load(in, 4 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v16 = plus(v2, v6); + real2 v12 = minus(v6, v2); + real2 v8 = load(in, 6 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v4, v8)); + real2 v52 = minus(v17, v16); + real2 v56 = plus(v16, v17); + store(out, 0 << outShift, plus(v56, v57)); + real2 v70 = minus(v56, v57); + store(out, 4 << outShift, ctimesminusplus(v70, tbl[0 + tbloffset], ctimes(reverse(v70), tbl[1 + tbloffset]))); + real2 v53 = minusplus(v51, v52); + store(out, 2 << outShift, ctimesminusplus(reverse(v53), tbl[10 + tbloffset], ctimes(v53, tbl[11 + tbloffset]))); + real2 v55 = minusplus(uminus(v51), v52); + store(out, 6 << outShift, ctimesminusplus(reverse(v55), tbl[12 + tbloffset], ctimes(v55, tbl[13 + tbloffset]))); + real2 v15 = minusplus(uminus(v11), v12); + real2 v13 = minusplus(v11, v12); + real2 v23 = ctimesminusplus(reverse(v13), tbl[2 + tbloffset], ctimes(v13, tbl[3 + tbloffset])); + store(out, 1 << outShift, plus(v23, v43)); + real2 v78 = minus(v23, v43); + store(out, 5 << outShift, ctimesminusplus(v78, tbl[0 + tbloffset], ctimes(reverse(v78), tbl[1 + tbloffset]))); + real2 v49 = ctimesminusplus(reverse(v35), tbl[8 + tbloffset], ctimes(v35, tbl[9 + tbloffset])); + real2 v29 = ctimesminusplus(reverse(v15), tbl[4 + tbloffset], ctimes(v15, tbl[5 + tbloffset])); + store(out, 3 << outShift, plus(v29, v49)); + real2 v84 = minus(v29, v49); + store(out, 7 << outShift, ctimesminusplus(v84, tbl[0 + tbloffset], ctimes(reverse(v84), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void but8b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v9 = load(in, 7 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v37 = plus(v5, v9); + real2 v31 = reverse(minus(v9, v5)); + real2 v7 = load(in, 5 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v36 = plus(v3, v7); + real2 v32 = minus(v7, v3); + real2 v57 = plus(v36, v37); + real2 v51 = reverse(minus(v37, v36)); + real2 v35 = minusplus(uminus(v31), v32); + real2 v33 = minusplus(v31, v32); + real2 v43 = ctimesminusplus(reverse(v33), tbl[6 + tbloffset], ctimes(v33, tbl[7 + tbloffset])); + real2 v6 = load(in, 4 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v16 = plus(v2, v6); + real2 v12 = minus(v6, v2); + real2 v8 = load(in, 6 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v8, v4)); + real2 v52 = minus(v17, v16); + real2 v56 = plus(v16, v17); + store(out, 0 << outShift, plus(v56, v57)); + real2 v70 = minus(v56, v57); + store(out, 4 << outShift, ctimesminusplus(v70, tbl[0 + tbloffset], ctimes(reverse(v70), tbl[1 + tbloffset]))); + real2 v53 = minusplus(v51, v52); + store(out, 2 << outShift, ctimesminusplus(reverse(v53), tbl[10 + tbloffset], ctimes(v53, tbl[11 + tbloffset]))); + real2 v55 = minusplus(uminus(v51), v52); + store(out, 6 << outShift, ctimesminusplus(reverse(v55), tbl[12 + tbloffset], ctimes(v55, tbl[13 + tbloffset]))); + real2 v15 = minusplus(uminus(v11), v12); + real2 v13 = minusplus(v11, v12); + real2 v23 = ctimesminusplus(reverse(v13), tbl[2 + tbloffset], ctimes(v13, tbl[3 + tbloffset])); + store(out, 1 << outShift, plus(v23, v43)); + real2 v78 = minus(v23, v43); + store(out, 5 << outShift, ctimesminusplus(v78, tbl[0 + tbloffset], ctimes(reverse(v78), tbl[1 + tbloffset]))); + real2 v49 = ctimesminusplus(reverse(v35), tbl[8 + tbloffset], ctimes(v35, tbl[9 + tbloffset])); + real2 v29 = ctimesminusplus(reverse(v15), tbl[4 + tbloffset], ctimes(v15, tbl[5 + tbloffset])); + store(out, 3 << outShift, plus(v29, v49)); + real2 v84 = minus(v29, v49); + store(out, 7 << outShift, ctimesminusplus(v84, tbl[0 + tbloffset], ctimes(reverse(v84), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void tbut8f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v9 = load(in, 7 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v37 = plus(v5, v9); + real2 v31 = reverse(minus(v5, v9)); + real2 v7 = load(in, 5 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v36 = plus(v3, v7); + real2 v32 = minus(v7, v3); + real2 v57 = plus(v36, v37); + real2 v51 = reverse(minus(v36, v37)); + real2 v35 = minusplus(uminus(v31), v32); + real2 v33 = minusplus(v31, v32); + real2 v43 = timesminusplus(reverse(v33), load(tbl, 6 * VECWIDTH + tbloffset), times(v33, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v6 = load(in, 4 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v16 = plus(v2, v6); + real2 v12 = minus(v6, v2); + real2 v8 = load(in, 6 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v4, v8)); + real2 v52 = minus(v17, v16); + real2 v56 = plus(v16, v17); + scatter(out, 0, 8, plus(v56, v57)); + real2 v70 = minus(v56, v57); + scatter(out, 4, 8, timesminusplus(v70, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v70), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v53 = minusplus(v51, v52); + scatter(out, 2, 8, timesminusplus(reverse(v53), load(tbl, 10 * VECWIDTH + tbloffset), times(v53, load(tbl, 11 * VECWIDTH + tbloffset)))); + real2 v55 = minusplus(uminus(v51), v52); + scatter(out, 6, 8, timesminusplus(reverse(v55), load(tbl, 12 * VECWIDTH + tbloffset), times(v55, load(tbl, 13 * VECWIDTH + tbloffset)))); + real2 v15 = minusplus(uminus(v11), v12); + real2 v13 = minusplus(v11, v12); + real2 v23 = timesminusplus(reverse(v13), load(tbl, 2 * VECWIDTH + tbloffset), times(v13, load(tbl, 3 * VECWIDTH + tbloffset))); + scatter(out, 1, 8, plus(v23, v43)); + real2 v78 = minus(v23, v43); + scatter(out, 5, 8, timesminusplus(v78, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v78), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v49 = timesminusplus(reverse(v35), load(tbl, 8 * VECWIDTH + tbloffset), times(v35, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v29 = timesminusplus(reverse(v15), load(tbl, 4 * VECWIDTH + tbloffset), times(v15, load(tbl, 5 * VECWIDTH + tbloffset))); + scatter(out, 3, 8, plus(v29, v49)); + real2 v84 = minus(v29, v49); + scatter(out, 7, 8, timesminusplus(v84, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v84), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void tbut8b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v9 = load(in, 7 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v37 = plus(v5, v9); + real2 v31 = reverse(minus(v9, v5)); + real2 v7 = load(in, 5 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v36 = plus(v3, v7); + real2 v32 = minus(v7, v3); + real2 v57 = plus(v36, v37); + real2 v51 = reverse(minus(v37, v36)); + real2 v35 = minusplus(uminus(v31), v32); + real2 v33 = minusplus(v31, v32); + real2 v43 = timesminusplus(reverse(v33), load(tbl, 6 * VECWIDTH + tbloffset), times(v33, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v6 = load(in, 4 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v16 = plus(v2, v6); + real2 v12 = minus(v6, v2); + real2 v8 = load(in, 6 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v17 = plus(v4, v8); + real2 v11 = reverse(minus(v8, v4)); + real2 v52 = minus(v17, v16); + real2 v56 = plus(v16, v17); + scatter(out, 0, 8, plus(v56, v57)); + real2 v70 = minus(v56, v57); + scatter(out, 4, 8, timesminusplus(v70, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v70), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v53 = minusplus(v51, v52); + scatter(out, 2, 8, timesminusplus(reverse(v53), load(tbl, 10 * VECWIDTH + tbloffset), times(v53, load(tbl, 11 * VECWIDTH + tbloffset)))); + real2 v55 = minusplus(uminus(v51), v52); + scatter(out, 6, 8, timesminusplus(reverse(v55), load(tbl, 12 * VECWIDTH + tbloffset), times(v55, load(tbl, 13 * VECWIDTH + tbloffset)))); + real2 v15 = minusplus(uminus(v11), v12); + real2 v13 = minusplus(v11, v12); + real2 v23 = timesminusplus(reverse(v13), load(tbl, 2 * VECWIDTH + tbloffset), times(v13, load(tbl, 3 * VECWIDTH + tbloffset))); + scatter(out, 1, 8, plus(v23, v43)); + real2 v78 = minus(v23, v43); + scatter(out, 5, 8, timesminusplus(v78, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v78), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v49 = timesminusplus(reverse(v35), load(tbl, 8 * VECWIDTH + tbloffset), times(v35, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v29 = timesminusplus(reverse(v15), load(tbl, 4 * VECWIDTH + tbloffset), times(v15, load(tbl, 5 * VECWIDTH + tbloffset))); + scatter(out, 3, 8, plus(v29, v49)); + real2 v84 = minus(v29, v49); + scatter(out, 7, 8, timesminusplus(v84, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v84), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} +#endif + +#if MAXBUTWIDTH >= 4 +ALIGNED(8192) void dft16f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v11 = load(in, 9 << shift); + real2 v3 = load(in, 1 << shift); + real2 v40 = plus(v3, v11); + real2 v36 = minus(v11, v3); + real2 v15 = load(in, 13 << shift); + real2 v7 = load(in, 5 << shift); + real2 v35 = reverse(minus(v7, v15)); + real2 v41 = plus(v7, v15); + real2 v106 = minus(v41, v40); + real2 v110 = plus(v40, v41); + real2 v37 = minusplus(v35, v36); + real2 v39 = minusplus(uminus(v35), v36); + real2 v51 = ctimesminusplus(reverse(v39), ctbl[5], ctimes(v39, ctbl[3])); + real2 v47 = ctimesminusplus(reverse(v37), ctbl[3], ctimes(v37, ctbl[5])); + real2 v13 = load(in, 11 << shift); + real2 v5 = load(in, 3 << shift); + real2 v72 = minus(v13, v5); + real2 v76 = plus(v5, v13); + real2 v17 = load(in, 15 << shift); + real2 v9 = load(in, 7 << shift); + real2 v77 = plus(v9, v17); + real2 v71 = reverse(minus(v9, v17)); + real2 v105 = reverse(minus(v76, v77)); + real2 v111 = plus(v76, v77); + real2 v107 = minusplus(v105, v106); + real2 v109 = minusplus(uminus(v105), v106); + real2 v121 = reverse(minus(v110, v111)); + real2 v127 = plus(v110, v111); + real2 v119 = ctimesminusplus(reverse(v109), ctbl[1], ctimes(v109, ctbl[0])); + real2 v115 = ctimesminusplus(reverse(v107), ctbl[1], ctimes(v107, ctbl[1])); + real2 v8 = load(in, 6 << shift); + real2 v16 = load(in, 14 << shift); + real2 v53 = reverse(minus(v8, v16)); + real2 v59 = plus(v8, v16); + real2 v4 = load(in, 2 << shift); + real2 v12 = load(in, 10 << shift); + real2 v54 = minus(v12, v4); + real2 v58 = plus(v4, v12); + real2 v95 = plus(v58, v59); + real2 v89 = reverse(minus(v58, v59)); + real2 v2 = load(in, 0 << shift); + real2 v10 = load(in, 8 << shift); + real2 v24 = plus(v2, v10); + real2 v20 = minus(v10, v2); + real2 v6 = load(in, 4 << shift); + real2 v14 = load(in, 12 << shift); + real2 v19 = reverse(minus(v6, v14)); + real2 v25 = plus(v6, v14); + real2 v94 = plus(v24, v25); + real2 v90 = minus(v25, v24); + real2 v103 = minus(uminusplus(v89), v90); + real2 v99 = minus(uplusminus(v89), v90); + store(out, 2 << shift, plus(v99, v115)); + store(out, 10 << shift, minus(v99, v115)); + store(out, 6 << shift, plus(v103, v119)); + store(out, 14 << shift, minus(v103, v119)); + real2 v122 = minus(v95, v94); + store(out, 12 << shift, minus(uminusplus(v121), v122)); + store(out, 4 << shift, minus(uplusminus(v121), v122)); + real2 v126 = plus(v94, v95); + store(out, 8 << shift, minus(v126, v127)); + store(out, 0 << shift, plus(v126, v127)); + real2 v57 = minusplus(uminus(v53), v54); + real2 v55 = minusplus(v53, v54); + real2 v64 = ctimesminusplus(reverse(v55), ctbl[1], ctimes(v55, ctbl[1])); + real2 v75 = minusplus(uminus(v71), v72); + real2 v73 = minusplus(v71, v72); + real2 v81 = ctimesminusplus(reverse(v73), ctbl[5], ctimes(v73, ctbl[3])); + real2 v29 = minus(uplusminus(v19), v20); + real2 v33 = minus(uminusplus(v19), v20); + real2 v151 = plus(v29, v64); + real2 v147 = minus(v64, v29); + real2 v152 = plus(v47, v81); + real2 v146 = reverse(minus(v47, v81)); + store(out, 13 << shift, minus(uminusplus(v146), v147)); + store(out, 5 << shift, minus(uplusminus(v146), v147)); + store(out, 9 << shift, minus(v151, v152)); + store(out, 1 << shift, plus(v151, v152)); + real2 v69 = ctimesminusplus(reverse(v57), ctbl[1], ctimes(v57, ctbl[0])); + real2 v87 = ctimesminusplus(reverse(v75), ctbl[4], ctimes(v75, ctbl[2])); + real2 v171 = plus(v51, v87); + real2 v165 = reverse(minus(v51, v87)); + real2 v170 = plus(v33, v69); + real2 v166 = minus(v69, v33); + store(out, 7 << shift, minus(uplusminus(v165), v166)); + store(out, 15 << shift, minus(uminusplus(v165), v166)); + store(out, 11 << shift, minus(v170, v171)); + store(out, 3 << shift, plus(v170, v171)); + } +} + +ALIGNED(8192) void dft16b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v9 = load(in, 7 << shift); + real2 v17 = load(in, 15 << shift); + real2 v79 = plus(v9, v17); + real2 v73 = reverse(minus(v17, v9)); + real2 v13 = load(in, 11 << shift); + real2 v5 = load(in, 3 << shift); + real2 v78 = plus(v5, v13); + real2 v74 = minus(v13, v5); + real2 v105 = reverse(minus(v79, v78)); + real2 v111 = plus(v78, v79); + real2 v75 = minusplus(v73, v74); + real2 v77 = minusplus(uminus(v73), v74); + real2 v83 = ctimesminusplus(reverse(v75), ctbl[2], ctimes(v75, ctbl[3])); + real2 v7 = load(in, 5 << shift); + real2 v15 = load(in, 13 << shift); + real2 v41 = plus(v7, v15); + real2 v35 = reverse(minus(v15, v7)); + real2 v11 = load(in, 9 << shift); + real2 v3 = load(in, 1 << shift); + real2 v40 = plus(v3, v11); + real2 v36 = minus(v11, v3); + real2 v110 = plus(v40, v41); + real2 v106 = minus(v41, v40); + real2 v121 = reverse(minus(v111, v110)); + real2 v127 = plus(v110, v111); + real2 v109 = minusplus(uminus(v105), v106); + real2 v107 = minusplus(v105, v106); + real2 v119 = ctimesminusplus(reverse(v109), ctbl[0], ctimes(v109, ctbl[0])); + real2 v115 = ctimesminusplus(reverse(v107), ctbl[0], ctimes(v107, ctbl[1])); + real2 v16 = load(in, 14 << shift); + real2 v8 = load(in, 6 << shift); + real2 v55 = reverse(minus(v16, v8)); + real2 v61 = plus(v8, v16); + real2 v12 = load(in, 10 << shift); + real2 v4 = load(in, 2 << shift); + real2 v56 = minus(v12, v4); + real2 v60 = plus(v4, v12); + real2 v89 = reverse(minus(v61, v60)); + real2 v95 = plus(v60, v61); + real2 v14 = load(in, 12 << shift); + real2 v6 = load(in, 4 << shift); + real2 v19 = reverse(minus(v14, v6)); + real2 v25 = plus(v6, v14); + real2 v2 = load(in, 0 << shift); + real2 v10 = load(in, 8 << shift); + real2 v24 = plus(v2, v10); + real2 v20 = minus(v10, v2); + real2 v90 = minus(v25, v24); + real2 v94 = plus(v24, v25); + real2 v103 = minus(uminusplus(v89), v90); + store(out, 6 << shift, plus(v103, v119)); + store(out, 14 << shift, minus(v103, v119)); + real2 v99 = minus(uplusminus(v89), v90); + store(out, 10 << shift, minus(v99, v115)); + store(out, 2 << shift, plus(v99, v115)); + real2 v126 = plus(v94, v95); + store(out, 8 << shift, minus(v126, v127)); + store(out, 0 << shift, plus(v126, v127)); + real2 v122 = minus(v95, v94); + store(out, 12 << shift, minus(uminusplus(v121), v122)); + store(out, 4 << shift, minus(uplusminus(v121), v122)); + real2 v33 = minus(uminusplus(v19), v20); + real2 v29 = minus(uplusminus(v19), v20); + real2 v59 = minusplus(uminus(v55), v56); + real2 v57 = minusplus(v55, v56); + real2 v67 = ctimesminusplus(reverse(v57), ctbl[0], ctimes(v57, ctbl[1])); + real2 v39 = minusplus(uminus(v35), v36); + real2 v37 = minusplus(v35, v36); + real2 v47 = ctimesminusplus(reverse(v37), ctbl[4], ctimes(v37, ctbl[5])); + real2 v146 = reverse(minus(v83, v47)); + real2 v152 = plus(v47, v83); + real2 v147 = minus(v67, v29); + real2 v151 = plus(v29, v67); + store(out, 9 << shift, minus(v151, v152)); + store(out, 1 << shift, plus(v151, v152)); + store(out, 5 << shift, minus(uplusminus(v146), v147)); + store(out, 13 << shift, minus(uminusplus(v146), v147)); + real2 v53 = ctimesminusplus(reverse(v39), ctbl[2], ctimes(v39, ctbl[3])); + real2 v71 = ctimesminusplus(reverse(v59), ctbl[0], ctimes(v59, ctbl[0])); + real2 v166 = minus(v71, v33); + real2 v170 = plus(v33, v71); + real2 v87 = ctimesminusplus(reverse(v77), ctbl[3], ctimes(v77, ctbl[2])); + real2 v165 = reverse(minus(v87, v53)); + store(out, 15 << shift, minus(uminusplus(v165), v166)); + store(out, 7 << shift, minus(uplusminus(v165), v166)); + real2 v171 = plus(v53, v87); + store(out, 3 << shift, plus(v170, v171)); + store(out, 11 << shift, minus(v170, v171)); + } +} + +ALIGNED(8192) void but16f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v15 = load(in, 13 << inShift); + real2 v7 = load(in, 5 << inShift); + real2 v45 = plus(v7, v15); + real2 v39 = reverse(minus(v7, v15)); + real2 v3 = load(in, 1 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v40 = minus(v11, v3); + real2 v44 = plus(v3, v11); + real2 v124 = plus(v44, v45); + real2 v120 = minus(v45, v44); + real2 v41 = minusplus(v39, v40); + real2 v43 = minusplus(uminus(v39), v40); + real2 v57 = ctimesminusplus(reverse(v43), tbl[8 + tbloffset], ctimes(v43, tbl[9 + tbloffset])); + real2 v13 = load(in, 11 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v84 = plus(v5, v13); + real2 v80 = minus(v13, v5); + real2 v17 = load(in, 15 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v85 = plus(v9, v17); + real2 v79 = reverse(minus(v9, v17)); + real2 v119 = reverse(minus(v84, v85)); + real2 v125 = plus(v84, v85); + real2 v145 = plus(v124, v125); + real2 v139 = reverse(minus(v124, v125)); + real2 v121 = minusplus(v119, v120); + real2 v123 = minusplus(uminus(v119), v120); + real2 v137 = ctimesminusplus(reverse(v123), tbl[24 + tbloffset], ctimes(v123, tbl[25 + tbloffset])); + real2 v131 = ctimesminusplus(reverse(v121), tbl[22 + tbloffset], ctimes(v121, tbl[23 + tbloffset])); + real2 v4 = load(in, 2 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v64 = plus(v4, v12); + real2 v60 = minus(v12, v4); + real2 v8 = load(in, 6 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v65 = plus(v8, v16); + real2 v59 = reverse(minus(v8, v16)); + real2 v99 = reverse(minus(v64, v65)); + real2 v105 = plus(v64, v65); + real2 v14 = load(in, 12 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v25 = plus(v6, v14); + real2 v19 = reverse(minus(v6, v14)); + real2 v10 = load(in, 8 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v20 = minus(v10, v2); + real2 v24 = plus(v2, v10); + real2 v104 = plus(v24, v25); + real2 v100 = minus(v25, v24); + real2 v140 = minus(v105, v104); + real2 v144 = plus(v104, v105); + store(out, 0 << outShift, plus(v144, v145)); + real2 v158 = minus(v144, v145); + store(out, 8 << outShift, ctimesminusplus(v158, tbl[0 + tbloffset], ctimes(reverse(v158), tbl[1 + tbloffset]))); + real2 v143 = minusplus(uminus(v139), v140); + store(out, 12 << outShift, ctimesminusplus(reverse(v143), tbl[28 + tbloffset], ctimes(v143, tbl[29 + tbloffset]))); + real2 v141 = minusplus(v139, v140); + store(out, 4 << outShift, ctimesminusplus(reverse(v141), tbl[26 + tbloffset], ctimes(v141, tbl[27 + tbloffset]))); + real2 v101 = minusplus(v99, v100); + real2 v103 = minusplus(uminus(v99), v100); + real2 v117 = ctimesminusplus(reverse(v103), tbl[20 + tbloffset], ctimes(v103, tbl[21 + tbloffset])); + store(out, 6 << outShift, plus(v117, v137)); + real2 v172 = minus(v117, v137); + store(out, 14 << outShift, ctimesminusplus(v172, tbl[0 + tbloffset], ctimes(reverse(v172), tbl[1 + tbloffset]))); + real2 v111 = ctimesminusplus(reverse(v101), tbl[18 + tbloffset], ctimes(v101, tbl[19 + tbloffset])); + store(out, 2 << outShift, plus(v111, v131)); + real2 v166 = minus(v111, v131); + store(out, 10 << outShift, ctimesminusplus(v166, tbl[0 + tbloffset], ctimes(reverse(v166), tbl[1 + tbloffset]))); + real2 v23 = minusplus(uminus(v19), v20); + real2 v21 = minusplus(v19, v20); + real2 v81 = minusplus(v79, v80); + real2 v83 = minusplus(uminus(v79), v80); + real2 v97 = ctimesminusplus(reverse(v83), tbl[16 + tbloffset], ctimes(v83, tbl[17 + tbloffset])); + real2 v211 = plus(v57, v97); + real2 v205 = reverse(minus(v57, v97)); + real2 v61 = minusplus(v59, v60); + real2 v63 = minusplus(uminus(v59), v60); + real2 v77 = ctimesminusplus(reverse(v63), tbl[12 + tbloffset], ctimes(v63, tbl[13 + tbloffset])); + real2 v37 = ctimesminusplus(reverse(v23), tbl[4 + tbloffset], ctimes(v23, tbl[5 + tbloffset])); + real2 v210 = plus(v37, v77); + real2 v206 = minus(v77, v37); + store(out, 3 << outShift, plus(v210, v211)); + real2 v224 = minus(v210, v211); + store(out, 11 << outShift, ctimesminusplus(v224, tbl[0 + tbloffset], ctimes(reverse(v224), tbl[1 + tbloffset]))); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + store(out, 15 << outShift, ctimesminusplus(reverse(v209), tbl[36 + tbloffset], ctimes(v209, tbl[37 + tbloffset]))); + store(out, 7 << outShift, ctimesminusplus(reverse(v207), tbl[34 + tbloffset], ctimes(v207, tbl[35 + tbloffset]))); + real2 v71 = ctimesminusplus(reverse(v61), tbl[10 + tbloffset], ctimes(v61, tbl[11 + tbloffset])); + real2 v51 = ctimesminusplus(reverse(v41), tbl[6 + tbloffset], ctimes(v41, tbl[7 + tbloffset])); + real2 v91 = ctimesminusplus(reverse(v81), tbl[14 + tbloffset], ctimes(v81, tbl[15 + tbloffset])); + real2 v185 = plus(v51, v91); + real2 v179 = reverse(minus(v51, v91)); + real2 v31 = ctimesminusplus(reverse(v21), tbl[2 + tbloffset], ctimes(v21, tbl[3 + tbloffset])); + real2 v184 = plus(v31, v71); + real2 v180 = minus(v71, v31); + store(out, 1 << outShift, plus(v184, v185)); + real2 v198 = minus(v184, v185); + store(out, 9 << outShift, ctimesminusplus(v198, tbl[0 + tbloffset], ctimes(reverse(v198), tbl[1 + tbloffset]))); + real2 v181 = minusplus(v179, v180); + store(out, 5 << outShift, ctimesminusplus(reverse(v181), tbl[30 + tbloffset], ctimes(v181, tbl[31 + tbloffset]))); + real2 v183 = minusplus(uminus(v179), v180); + store(out, 13 << outShift, ctimesminusplus(reverse(v183), tbl[32 + tbloffset], ctimes(v183, tbl[33 + tbloffset]))); + } +} + +ALIGNED(8192) void but16b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v15 = load(in, 13 << inShift); + real2 v7 = load(in, 5 << inShift); + real2 v45 = plus(v7, v15); + real2 v39 = reverse(minus(v15, v7)); + real2 v3 = load(in, 1 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v40 = minus(v11, v3); + real2 v44 = plus(v3, v11); + real2 v124 = plus(v44, v45); + real2 v120 = minus(v45, v44); + real2 v41 = minusplus(v39, v40); + real2 v43 = minusplus(uminus(v39), v40); + real2 v57 = ctimesminusplus(reverse(v43), tbl[8 + tbloffset], ctimes(v43, tbl[9 + tbloffset])); + real2 v13 = load(in, 11 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v84 = plus(v5, v13); + real2 v80 = minus(v13, v5); + real2 v17 = load(in, 15 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v85 = plus(v9, v17); + real2 v79 = reverse(minus(v17, v9)); + real2 v119 = reverse(minus(v85, v84)); + real2 v125 = plus(v84, v85); + real2 v145 = plus(v124, v125); + real2 v139 = reverse(minus(v125, v124)); + real2 v121 = minusplus(v119, v120); + real2 v123 = minusplus(uminus(v119), v120); + real2 v137 = ctimesminusplus(reverse(v123), tbl[24 + tbloffset], ctimes(v123, tbl[25 + tbloffset])); + real2 v131 = ctimesminusplus(reverse(v121), tbl[22 + tbloffset], ctimes(v121, tbl[23 + tbloffset])); + real2 v4 = load(in, 2 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v64 = plus(v4, v12); + real2 v60 = minus(v12, v4); + real2 v8 = load(in, 6 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v65 = plus(v8, v16); + real2 v59 = reverse(minus(v16, v8)); + real2 v99 = reverse(minus(v65, v64)); + real2 v105 = plus(v64, v65); + real2 v14 = load(in, 12 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v25 = plus(v6, v14); + real2 v19 = reverse(minus(v14, v6)); + real2 v10 = load(in, 8 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v20 = minus(v10, v2); + real2 v24 = plus(v2, v10); + real2 v104 = plus(v24, v25); + real2 v100 = minus(v25, v24); + real2 v140 = minus(v105, v104); + real2 v144 = plus(v104, v105); + store(out, 0 << outShift, plus(v144, v145)); + real2 v158 = minus(v144, v145); + store(out, 8 << outShift, ctimesminusplus(v158, tbl[0 + tbloffset], ctimes(reverse(v158), tbl[1 + tbloffset]))); + real2 v143 = minusplus(uminus(v139), v140); + store(out, 12 << outShift, ctimesminusplus(reverse(v143), tbl[28 + tbloffset], ctimes(v143, tbl[29 + tbloffset]))); + real2 v141 = minusplus(v139, v140); + store(out, 4 << outShift, ctimesminusplus(reverse(v141), tbl[26 + tbloffset], ctimes(v141, tbl[27 + tbloffset]))); + real2 v101 = minusplus(v99, v100); + real2 v103 = minusplus(uminus(v99), v100); + real2 v117 = ctimesminusplus(reverse(v103), tbl[20 + tbloffset], ctimes(v103, tbl[21 + tbloffset])); + store(out, 6 << outShift, plus(v117, v137)); + real2 v172 = minus(v117, v137); + store(out, 14 << outShift, ctimesminusplus(v172, tbl[0 + tbloffset], ctimes(reverse(v172), tbl[1 + tbloffset]))); + real2 v111 = ctimesminusplus(reverse(v101), tbl[18 + tbloffset], ctimes(v101, tbl[19 + tbloffset])); + store(out, 2 << outShift, plus(v111, v131)); + real2 v166 = minus(v111, v131); + store(out, 10 << outShift, ctimesminusplus(v166, tbl[0 + tbloffset], ctimes(reverse(v166), tbl[1 + tbloffset]))); + real2 v23 = minusplus(uminus(v19), v20); + real2 v21 = minusplus(v19, v20); + real2 v81 = minusplus(v79, v80); + real2 v83 = minusplus(uminus(v79), v80); + real2 v97 = ctimesminusplus(reverse(v83), tbl[16 + tbloffset], ctimes(v83, tbl[17 + tbloffset])); + real2 v211 = plus(v57, v97); + real2 v205 = reverse(minus(v97, v57)); + real2 v61 = minusplus(v59, v60); + real2 v63 = minusplus(uminus(v59), v60); + real2 v77 = ctimesminusplus(reverse(v63), tbl[12 + tbloffset], ctimes(v63, tbl[13 + tbloffset])); + real2 v37 = ctimesminusplus(reverse(v23), tbl[4 + tbloffset], ctimes(v23, tbl[5 + tbloffset])); + real2 v210 = plus(v37, v77); + real2 v206 = minus(v77, v37); + store(out, 3 << outShift, plus(v210, v211)); + real2 v224 = minus(v210, v211); + store(out, 11 << outShift, ctimesminusplus(v224, tbl[0 + tbloffset], ctimes(reverse(v224), tbl[1 + tbloffset]))); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + store(out, 15 << outShift, ctimesminusplus(reverse(v209), tbl[36 + tbloffset], ctimes(v209, tbl[37 + tbloffset]))); + store(out, 7 << outShift, ctimesminusplus(reverse(v207), tbl[34 + tbloffset], ctimes(v207, tbl[35 + tbloffset]))); + real2 v71 = ctimesminusplus(reverse(v61), tbl[10 + tbloffset], ctimes(v61, tbl[11 + tbloffset])); + real2 v51 = ctimesminusplus(reverse(v41), tbl[6 + tbloffset], ctimes(v41, tbl[7 + tbloffset])); + real2 v91 = ctimesminusplus(reverse(v81), tbl[14 + tbloffset], ctimes(v81, tbl[15 + tbloffset])); + real2 v185 = plus(v51, v91); + real2 v179 = reverse(minus(v91, v51)); + real2 v31 = ctimesminusplus(reverse(v21), tbl[2 + tbloffset], ctimes(v21, tbl[3 + tbloffset])); + real2 v184 = plus(v31, v71); + real2 v180 = minus(v71, v31); + store(out, 1 << outShift, plus(v184, v185)); + real2 v198 = minus(v184, v185); + store(out, 9 << outShift, ctimesminusplus(v198, tbl[0 + tbloffset], ctimes(reverse(v198), tbl[1 + tbloffset]))); + real2 v181 = minusplus(v179, v180); + store(out, 5 << outShift, ctimesminusplus(reverse(v181), tbl[30 + tbloffset], ctimes(v181, tbl[31 + tbloffset]))); + real2 v183 = minusplus(uminus(v179), v180); + store(out, 13 << outShift, ctimesminusplus(reverse(v183), tbl[32 + tbloffset], ctimes(v183, tbl[33 + tbloffset]))); + } +} + +ALIGNED(8192) void tbut16f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v15 = load(in, 13 << inShift); + real2 v7 = load(in, 5 << inShift); + real2 v45 = plus(v7, v15); + real2 v39 = reverse(minus(v7, v15)); + real2 v3 = load(in, 1 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v40 = minus(v11, v3); + real2 v44 = plus(v3, v11); + real2 v124 = plus(v44, v45); + real2 v120 = minus(v45, v44); + real2 v41 = minusplus(v39, v40); + real2 v43 = minusplus(uminus(v39), v40); + real2 v57 = timesminusplus(reverse(v43), load(tbl, 8 * VECWIDTH + tbloffset), times(v43, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v13 = load(in, 11 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v84 = plus(v5, v13); + real2 v80 = minus(v13, v5); + real2 v17 = load(in, 15 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v85 = plus(v9, v17); + real2 v79 = reverse(minus(v9, v17)); + real2 v119 = reverse(minus(v84, v85)); + real2 v125 = plus(v84, v85); + real2 v145 = plus(v124, v125); + real2 v139 = reverse(minus(v124, v125)); + real2 v121 = minusplus(v119, v120); + real2 v123 = minusplus(uminus(v119), v120); + real2 v137 = timesminusplus(reverse(v123), load(tbl, 24 * VECWIDTH + tbloffset), times(v123, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v131 = timesminusplus(reverse(v121), load(tbl, 22 * VECWIDTH + tbloffset), times(v121, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v4 = load(in, 2 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v64 = plus(v4, v12); + real2 v60 = minus(v12, v4); + real2 v8 = load(in, 6 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v65 = plus(v8, v16); + real2 v59 = reverse(minus(v8, v16)); + real2 v99 = reverse(minus(v64, v65)); + real2 v105 = plus(v64, v65); + real2 v14 = load(in, 12 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v25 = plus(v6, v14); + real2 v19 = reverse(minus(v6, v14)); + real2 v10 = load(in, 8 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v20 = minus(v10, v2); + real2 v24 = plus(v2, v10); + real2 v104 = plus(v24, v25); + real2 v100 = minus(v25, v24); + real2 v140 = minus(v105, v104); + real2 v144 = plus(v104, v105); + scatter(out, 0, 16, plus(v144, v145)); + real2 v158 = minus(v144, v145); + scatter(out, 8, 16, timesminusplus(v158, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v158), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v143 = minusplus(uminus(v139), v140); + scatter(out, 12, 16, timesminusplus(reverse(v143), load(tbl, 28 * VECWIDTH + tbloffset), times(v143, load(tbl, 29 * VECWIDTH + tbloffset)))); + real2 v141 = minusplus(v139, v140); + scatter(out, 4, 16, timesminusplus(reverse(v141), load(tbl, 26 * VECWIDTH + tbloffset), times(v141, load(tbl, 27 * VECWIDTH + tbloffset)))); + real2 v101 = minusplus(v99, v100); + real2 v103 = minusplus(uminus(v99), v100); + real2 v117 = timesminusplus(reverse(v103), load(tbl, 20 * VECWIDTH + tbloffset), times(v103, load(tbl, 21 * VECWIDTH + tbloffset))); + scatter(out, 6, 16, plus(v117, v137)); + real2 v172 = minus(v117, v137); + scatter(out, 14, 16, timesminusplus(v172, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v172), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v111 = timesminusplus(reverse(v101), load(tbl, 18 * VECWIDTH + tbloffset), times(v101, load(tbl, 19 * VECWIDTH + tbloffset))); + scatter(out, 2, 16, plus(v111, v131)); + real2 v166 = minus(v111, v131); + scatter(out, 10, 16, timesminusplus(v166, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v166), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v23 = minusplus(uminus(v19), v20); + real2 v21 = minusplus(v19, v20); + real2 v81 = minusplus(v79, v80); + real2 v83 = minusplus(uminus(v79), v80); + real2 v97 = timesminusplus(reverse(v83), load(tbl, 16 * VECWIDTH + tbloffset), times(v83, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v211 = plus(v57, v97); + real2 v205 = reverse(minus(v57, v97)); + real2 v61 = minusplus(v59, v60); + real2 v63 = minusplus(uminus(v59), v60); + real2 v77 = timesminusplus(reverse(v63), load(tbl, 12 * VECWIDTH + tbloffset), times(v63, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v37 = timesminusplus(reverse(v23), load(tbl, 4 * VECWIDTH + tbloffset), times(v23, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v210 = plus(v37, v77); + real2 v206 = minus(v77, v37); + scatter(out, 3, 16, plus(v210, v211)); + real2 v224 = minus(v210, v211); + scatter(out, 11, 16, timesminusplus(v224, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v224), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + scatter(out, 15, 16, timesminusplus(reverse(v209), load(tbl, 36 * VECWIDTH + tbloffset), times(v209, load(tbl, 37 * VECWIDTH + tbloffset)))); + scatter(out, 7, 16, timesminusplus(reverse(v207), load(tbl, 34 * VECWIDTH + tbloffset), times(v207, load(tbl, 35 * VECWIDTH + tbloffset)))); + real2 v71 = timesminusplus(reverse(v61), load(tbl, 10 * VECWIDTH + tbloffset), times(v61, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v51 = timesminusplus(reverse(v41), load(tbl, 6 * VECWIDTH + tbloffset), times(v41, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v91 = timesminusplus(reverse(v81), load(tbl, 14 * VECWIDTH + tbloffset), times(v81, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v185 = plus(v51, v91); + real2 v179 = reverse(minus(v51, v91)); + real2 v31 = timesminusplus(reverse(v21), load(tbl, 2 * VECWIDTH + tbloffset), times(v21, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v184 = plus(v31, v71); + real2 v180 = minus(v71, v31); + scatter(out, 1, 16, plus(v184, v185)); + real2 v198 = minus(v184, v185); + scatter(out, 9, 16, timesminusplus(v198, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v198), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v181 = minusplus(v179, v180); + scatter(out, 5, 16, timesminusplus(reverse(v181), load(tbl, 30 * VECWIDTH + tbloffset), times(v181, load(tbl, 31 * VECWIDTH + tbloffset)))); + real2 v183 = minusplus(uminus(v179), v180); + scatter(out, 13, 16, timesminusplus(reverse(v183), load(tbl, 32 * VECWIDTH + tbloffset), times(v183, load(tbl, 33 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void tbut16b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v15 = load(in, 13 << inShift); + real2 v7 = load(in, 5 << inShift); + real2 v45 = plus(v7, v15); + real2 v39 = reverse(minus(v15, v7)); + real2 v3 = load(in, 1 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v40 = minus(v11, v3); + real2 v44 = plus(v3, v11); + real2 v124 = plus(v44, v45); + real2 v120 = minus(v45, v44); + real2 v41 = minusplus(v39, v40); + real2 v43 = minusplus(uminus(v39), v40); + real2 v57 = timesminusplus(reverse(v43), load(tbl, 8 * VECWIDTH + tbloffset), times(v43, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v13 = load(in, 11 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v84 = plus(v5, v13); + real2 v80 = minus(v13, v5); + real2 v17 = load(in, 15 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v85 = plus(v9, v17); + real2 v79 = reverse(minus(v17, v9)); + real2 v119 = reverse(minus(v85, v84)); + real2 v125 = plus(v84, v85); + real2 v145 = plus(v124, v125); + real2 v139 = reverse(minus(v125, v124)); + real2 v121 = minusplus(v119, v120); + real2 v123 = minusplus(uminus(v119), v120); + real2 v137 = timesminusplus(reverse(v123), load(tbl, 24 * VECWIDTH + tbloffset), times(v123, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v131 = timesminusplus(reverse(v121), load(tbl, 22 * VECWIDTH + tbloffset), times(v121, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v4 = load(in, 2 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v64 = plus(v4, v12); + real2 v60 = minus(v12, v4); + real2 v8 = load(in, 6 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v65 = plus(v8, v16); + real2 v59 = reverse(minus(v16, v8)); + real2 v99 = reverse(minus(v65, v64)); + real2 v105 = plus(v64, v65); + real2 v14 = load(in, 12 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v25 = plus(v6, v14); + real2 v19 = reverse(minus(v14, v6)); + real2 v10 = load(in, 8 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v20 = minus(v10, v2); + real2 v24 = plus(v2, v10); + real2 v104 = plus(v24, v25); + real2 v100 = minus(v25, v24); + real2 v140 = minus(v105, v104); + real2 v144 = plus(v104, v105); + scatter(out, 0, 16, plus(v144, v145)); + real2 v158 = minus(v144, v145); + scatter(out, 8, 16, timesminusplus(v158, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v158), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v143 = minusplus(uminus(v139), v140); + scatter(out, 12, 16, timesminusplus(reverse(v143), load(tbl, 28 * VECWIDTH + tbloffset), times(v143, load(tbl, 29 * VECWIDTH + tbloffset)))); + real2 v141 = minusplus(v139, v140); + scatter(out, 4, 16, timesminusplus(reverse(v141), load(tbl, 26 * VECWIDTH + tbloffset), times(v141, load(tbl, 27 * VECWIDTH + tbloffset)))); + real2 v101 = minusplus(v99, v100); + real2 v103 = minusplus(uminus(v99), v100); + real2 v117 = timesminusplus(reverse(v103), load(tbl, 20 * VECWIDTH + tbloffset), times(v103, load(tbl, 21 * VECWIDTH + tbloffset))); + scatter(out, 6, 16, plus(v117, v137)); + real2 v172 = minus(v117, v137); + scatter(out, 14, 16, timesminusplus(v172, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v172), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v111 = timesminusplus(reverse(v101), load(tbl, 18 * VECWIDTH + tbloffset), times(v101, load(tbl, 19 * VECWIDTH + tbloffset))); + scatter(out, 2, 16, plus(v111, v131)); + real2 v166 = minus(v111, v131); + scatter(out, 10, 16, timesminusplus(v166, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v166), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v23 = minusplus(uminus(v19), v20); + real2 v21 = minusplus(v19, v20); + real2 v81 = minusplus(v79, v80); + real2 v83 = minusplus(uminus(v79), v80); + real2 v97 = timesminusplus(reverse(v83), load(tbl, 16 * VECWIDTH + tbloffset), times(v83, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v211 = plus(v57, v97); + real2 v205 = reverse(minus(v97, v57)); + real2 v61 = minusplus(v59, v60); + real2 v63 = minusplus(uminus(v59), v60); + real2 v77 = timesminusplus(reverse(v63), load(tbl, 12 * VECWIDTH + tbloffset), times(v63, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v37 = timesminusplus(reverse(v23), load(tbl, 4 * VECWIDTH + tbloffset), times(v23, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v210 = plus(v37, v77); + real2 v206 = minus(v77, v37); + scatter(out, 3, 16, plus(v210, v211)); + real2 v224 = minus(v210, v211); + scatter(out, 11, 16, timesminusplus(v224, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v224), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + scatter(out, 15, 16, timesminusplus(reverse(v209), load(tbl, 36 * VECWIDTH + tbloffset), times(v209, load(tbl, 37 * VECWIDTH + tbloffset)))); + scatter(out, 7, 16, timesminusplus(reverse(v207), load(tbl, 34 * VECWIDTH + tbloffset), times(v207, load(tbl, 35 * VECWIDTH + tbloffset)))); + real2 v71 = timesminusplus(reverse(v61), load(tbl, 10 * VECWIDTH + tbloffset), times(v61, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v51 = timesminusplus(reverse(v41), load(tbl, 6 * VECWIDTH + tbloffset), times(v41, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v91 = timesminusplus(reverse(v81), load(tbl, 14 * VECWIDTH + tbloffset), times(v81, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v185 = plus(v51, v91); + real2 v179 = reverse(minus(v91, v51)); + real2 v31 = timesminusplus(reverse(v21), load(tbl, 2 * VECWIDTH + tbloffset), times(v21, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v184 = plus(v31, v71); + real2 v180 = minus(v71, v31); + scatter(out, 1, 16, plus(v184, v185)); + real2 v198 = minus(v184, v185); + scatter(out, 9, 16, timesminusplus(v198, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v198), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v181 = minusplus(v179, v180); + scatter(out, 5, 16, timesminusplus(reverse(v181), load(tbl, 30 * VECWIDTH + tbloffset), times(v181, load(tbl, 31 * VECWIDTH + tbloffset)))); + real2 v183 = minusplus(uminus(v179), v180); + scatter(out, 13, 16, timesminusplus(reverse(v183), load(tbl, 32 * VECWIDTH + tbloffset), times(v183, load(tbl, 33 * VECWIDTH + tbloffset)))); + } +} +#endif + +#if MAXBUTWIDTH >= 5 +ALIGNED(8192) void dft32f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v15 = load(in, 13 << shift); + real2 v31 = load(in, 29 << shift); + real2 v124 = reverse(minus(v15, v31)); + real2 v130 = plus(v15, v31); + real2 v23 = load(in, 21 << shift); + real2 v7 = load(in, 5 << shift); + real2 v129 = plus(v7, v23); + real2 v125 = minus(v23, v7); + real2 v193 = reverse(minus(v129, v130)); + real2 v199 = plus(v129, v130); + real2 v126 = minusplus(v124, v125); + real2 v128 = minusplus(uminus(v124), v125); + real2 v139 = ctimesminusplus(reverse(v128), ctbl[7], ctimes(v128, ctbl[6])); + real2 v134 = ctimesminusplus(reverse(v126), ctbl[9], ctimes(v126, ctbl[11])); + real2 v19 = load(in, 17 << shift); + real2 v3 = load(in, 1 << shift); + real2 v52 = minus(v19, v3); + real2 v56 = plus(v3, v19); + real2 v27 = load(in, 25 << shift); + real2 v11 = load(in, 9 << shift); + real2 v51 = reverse(minus(v11, v27)); + real2 v57 = plus(v11, v27); + real2 v194 = minus(v57, v56); + real2 v198 = plus(v56, v57); + real2 v53 = minusplus(v51, v52); + real2 v55 = minusplus(uminus(v51), v52); + real2 v69 = ctimesminusplus(reverse(v55), ctbl[11], ctimes(v55, ctbl[9])); + real2 v262 = plus(v198, v199); + real2 v258 = minus(v199, v198); + real2 v195 = minusplus(v193, v194); + real2 v197 = minusplus(uminus(v193), v194); + real2 v207 = ctimesminusplus(reverse(v197), ctbl[5], ctimes(v197, ctbl[3])); + real2 v414 = plus(v69, v139); + real2 v410 = minus(v139, v69); + real2 v203 = ctimesminusplus(reverse(v195), ctbl[3], ctimes(v195, ctbl[5])); + real2 v17 = load(in, 15 << shift); + real2 v33 = load(in, 31 << shift); + real2 v159 = reverse(minus(v17, v33)); + real2 v165 = plus(v17, v33); + real2 v25 = load(in, 23 << shift); + real2 v9 = load(in, 7 << shift); + real2 v164 = plus(v9, v25); + real2 v160 = minus(v25, v9); + real2 v231 = plus(v164, v165); + real2 v225 = reverse(minus(v164, v165)); + real2 v161 = minusplus(v159, v160); + real2 v163 = minusplus(uminus(v159), v160); + real2 v175 = ctimesminusplus(reverse(v163), ctbl[10], ctimes(v163, ctbl[8])); + real2 v13 = load(in, 11 << shift); + real2 v29 = load(in, 27 << shift); + real2 v95 = plus(v13, v29); + real2 v89 = reverse(minus(v13, v29)); + real2 v21 = load(in, 19 << shift); + real2 v5 = load(in, 3 << shift); + real2 v90 = minus(v21, v5); + real2 v94 = plus(v5, v21); + real2 v226 = minus(v95, v94); + real2 v230 = plus(v94, v95); + real2 v229 = minusplus(uminus(v225), v226); + real2 v227 = minusplus(v225, v226); + real2 v239 = ctimesminusplus(reverse(v229), ctbl[4], ctimes(v229, ctbl[2])); + real2 v257 = reverse(minus(v230, v231)); + real2 v263 = plus(v230, v231); + real2 v235 = ctimesminusplus(reverse(v227), ctbl[5], ctimes(v227, ctbl[3])); + real2 v261 = minusplus(uminus(v257), v258); + real2 v259 = minusplus(v257, v258); + real2 v267 = ctimesminusplus(reverse(v259), ctbl[1], ctimes(v259, ctbl[1])); + real2 v298 = reverse(minus(v203, v235)); + real2 v304 = plus(v203, v235); + real2 v271 = ctimesminusplus(reverse(v261), ctbl[1], ctimes(v261, ctbl[0])); + real2 v279 = plus(v262, v263); + real2 v273 = reverse(minus(v262, v263)); + real2 v317 = reverse(minus(v207, v239)); + real2 v323 = plus(v207, v239); + real2 v8 = load(in, 6 << shift); + real2 v24 = load(in, 22 << shift); + real2 v146 = plus(v8, v24); + real2 v142 = minus(v24, v8); + real2 v28 = load(in, 26 << shift); + real2 v12 = load(in, 10 << shift); + real2 v77 = plus(v12, v28); + real2 v71 = reverse(minus(v12, v28)); + real2 v16 = load(in, 14 << shift); + real2 v32 = load(in, 30 << shift); + real2 v147 = plus(v16, v32); + real2 v141 = reverse(minus(v16, v32)); + real2 v209 = reverse(minus(v146, v147)); + real2 v215 = plus(v146, v147); + real2 v20 = load(in, 18 << shift); + real2 v4 = load(in, 2 << shift); + real2 v72 = minus(v20, v4); + real2 v76 = plus(v4, v20); + real2 v214 = plus(v76, v77); + real2 v210 = minus(v77, v76); + real2 v247 = plus(v214, v215); + real2 v241 = reverse(minus(v214, v215)); + real2 v213 = minusplus(uminus(v209), v210); + real2 v211 = minusplus(v209, v210); + real2 v223 = ctimesminusplus(reverse(v213), ctbl[1], ctimes(v213, ctbl[0])); + real2 v219 = ctimesminusplus(reverse(v211), ctbl[1], ctimes(v211, ctbl[1])); + real2 v26 = load(in, 24 << shift); + real2 v10 = load(in, 8 << shift); + real2 v35 = reverse(minus(v10, v26)); + real2 v41 = plus(v10, v26); + real2 v2 = load(in, 0 << shift); + real2 v18 = load(in, 16 << shift); + real2 v40 = plus(v2, v18); + real2 v36 = minus(v18, v2); + real2 v178 = minus(v41, v40); + real2 v182 = plus(v40, v41); + real2 v6 = load(in, 4 << shift); + real2 v22 = load(in, 20 << shift); + real2 v107 = minus(v22, v6); + real2 v111 = plus(v6, v22); + real2 v14 = load(in, 12 << shift); + real2 v30 = load(in, 28 << shift); + real2 v112 = plus(v14, v30); + real2 v106 = reverse(minus(v14, v30)); + real2 v177 = reverse(minus(v111, v112)); + real2 v183 = plus(v111, v112); + real2 v191 = minus(uminusplus(v177), v178); + real2 v187 = minus(uplusminus(v177), v178); + real2 v322 = plus(v191, v223); + real2 v318 = minus(v223, v191); + store(out, 22 << shift, minus(v322, v323)); + store(out, 6 << shift, plus(v322, v323)); + store(out, 14 << shift, minus(uplusminus(v317), v318)); + store(out, 30 << shift, minus(uminusplus(v317), v318)); + real2 v246 = plus(v182, v183); + real2 v242 = minus(v183, v182); + real2 v274 = minus(v247, v246); + store(out, 24 << shift, minus(uminusplus(v273), v274)); + store(out, 8 << shift, minus(uplusminus(v273), v274)); + real2 v278 = plus(v246, v247); + store(out, 16 << shift, minus(v278, v279)); + store(out, 0 << shift, plus(v278, v279)); + real2 v303 = plus(v187, v219); + store(out, 2 << shift, plus(v303, v304)); + store(out, 18 << shift, minus(v303, v304)); + real2 v299 = minus(v219, v187); + store(out, 26 << shift, minus(uminusplus(v298), v299)); + store(out, 10 << shift, minus(uplusminus(v298), v299)); + real2 v255 = minus(uminusplus(v241), v242); + real2 v251 = minus(uplusminus(v241), v242); + store(out, 20 << shift, minus(v251, v267)); + store(out, 4 << shift, plus(v251, v267)); + store(out, 28 << shift, minus(v255, v271)); + store(out, 12 << shift, plus(v255, v271)); + real2 v75 = minusplus(uminus(v71), v72); + real2 v73 = minusplus(v71, v72); + real2 v143 = minusplus(v141, v142); + real2 v145 = minusplus(uminus(v141), v142); + real2 v157 = ctimesminusplus(reverse(v145), ctbl[4], ctimes(v145, ctbl[2])); + real2 v87 = ctimesminusplus(reverse(v75), ctbl[5], ctimes(v75, ctbl[3])); + real2 v91 = minusplus(v89, v90); + real2 v93 = minusplus(uminus(v89), v90); + real2 v104 = ctimesminusplus(reverse(v93), ctbl[13], ctimes(v93, ctbl[12])); + real2 v399 = plus(v87, v157); + real2 v393 = reverse(minus(v87, v157)); + real2 v110 = minusplus(uminus(v106), v107); + real2 v108 = minusplus(v106, v107); + real2 v415 = plus(v104, v175); + real2 v409 = reverse(minus(v104, v175)); + real2 v411 = minusplus(v409, v410); + real2 v413 = minusplus(uminus(v409), v410); + real2 v49 = minus(uminusplus(v35), v36); + real2 v45 = minus(uplusminus(v35), v36); + real2 v122 = ctimesminusplus(reverse(v110), ctbl[1], ctimes(v110, ctbl[0])); + real2 v423 = ctimesminusplus(reverse(v413), ctbl[1], ctimes(v413, ctbl[0])); + real2 v398 = plus(v49, v122); + real2 v394 = minus(v122, v49); + real2 v407 = minus(uminusplus(v393), v394); + store(out, 15 << shift, plus(v407, v423)); + store(out, 31 << shift, minus(v407, v423)); + real2 v403 = minus(uplusminus(v393), v394); + real2 v419 = ctimesminusplus(reverse(v411), ctbl[1], ctimes(v411, ctbl[1])); + store(out, 7 << shift, plus(v403, v419)); + store(out, 23 << shift, minus(v403, v419)); + real2 v431 = plus(v414, v415); + real2 v425 = reverse(minus(v414, v415)); + real2 v430 = plus(v398, v399); + store(out, 19 << shift, minus(v430, v431)); + store(out, 3 << shift, plus(v430, v431)); + real2 v426 = minus(v399, v398); + store(out, 27 << shift, minus(uminusplus(v425), v426)); + store(out, 11 << shift, minus(uplusminus(v425), v426)); + real2 v63 = ctimesminusplus(reverse(v53), ctbl[7], ctimes(v53, ctbl[13])); + real2 v151 = ctimesminusplus(reverse(v143), ctbl[5], ctimes(v143, ctbl[3])); + real2 v99 = ctimesminusplus(reverse(v91), ctbl[11], ctimes(v91, ctbl[9])); + real2 v169 = ctimesminusplus(reverse(v161), ctbl[13], ctimes(v161, ctbl[7])); + real2 v352 = reverse(minus(v99, v169)); + real2 v358 = plus(v99, v169); + real2 v357 = plus(v63, v134); + real2 v353 = minus(v134, v63); + real2 v117 = ctimesminusplus(reverse(v108), ctbl[1], ctimes(v108, ctbl[1])); + real2 v374 = plus(v357, v358); + real2 v368 = reverse(minus(v357, v358)); + real2 v83 = ctimesminusplus(reverse(v73), ctbl[3], ctimes(v73, ctbl[5])); + real2 v336 = reverse(minus(v83, v151)); + real2 v342 = plus(v83, v151); + real2 v341 = plus(v45, v117); + real2 v337 = minus(v117, v45); + real2 v373 = plus(v341, v342); + real2 v369 = minus(v342, v341); + store(out, 9 << shift, minus(uplusminus(v368), v369)); + store(out, 25 << shift, minus(uminusplus(v368), v369)); + store(out, 17 << shift, minus(v373, v374)); + store(out, 1 << shift, plus(v373, v374)); + real2 v354 = minusplus(v352, v353); + real2 v356 = minusplus(uminus(v352), v353); + real2 v362 = ctimesminusplus(reverse(v354), ctbl[1], ctimes(v354, ctbl[1])); + real2 v346 = minus(uplusminus(v336), v337); + store(out, 21 << shift, minus(v346, v362)); + store(out, 5 << shift, plus(v346, v362)); + real2 v350 = minus(uminusplus(v336), v337); + real2 v366 = ctimesminusplus(reverse(v356), ctbl[1], ctimes(v356, ctbl[0])); + store(out, 29 << shift, minus(v350, v366)); + store(out, 13 << shift, plus(v350, v366)); + } +} + +ALIGNED(8192) void dft32b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + + real2 v6 = load(in, 4 << shift); + real2 v22 = load(in, 20 << shift); + real2 v109 = minus(v22, v6); + real2 v113 = plus(v6, v22); + real2 v14 = load(in, 12 << shift); + real2 v30 = load(in, 28 << shift); + real2 v108 = reverse(minus(v30, v14)); + real2 v114 = plus(v14, v30); + real2 v183 = plus(v113, v114); + real2 v177 = reverse(minus(v114, v113)); + real2 v110 = minusplus(v108, v109); + real2 v112 = minusplus(uminus(v108), v109); + real2 v120 = ctimesminusplus(reverse(v110), ctbl[0], ctimes(v110, ctbl[1])); + real2 v124 = ctimesminusplus(reverse(v112), ctbl[0], ctimes(v112, ctbl[0])); + real2 v10 = load(in, 8 << shift); + real2 v26 = load(in, 24 << shift); + real2 v35 = reverse(minus(v26, v10)); + real2 v41 = plus(v10, v26); + real2 v18 = load(in, 16 << shift); + real2 v2 = load(in, 0 << shift); + real2 v36 = minus(v18, v2); + real2 v40 = plus(v2, v18); + real2 v178 = minus(v41, v40); + real2 v182 = plus(v40, v41); + real2 v45 = minus(uplusminus(v35), v36); + real2 v49 = minus(uminusplus(v35), v36); + real2 v398 = plus(v49, v124); + real2 v394 = minus(v124, v49); + real2 v242 = minus(v183, v182); + real2 v246 = plus(v182, v183); + real2 v341 = plus(v45, v120); + real2 v337 = minus(v120, v45); + real2 v187 = minus(uplusminus(v177), v178); + real2 v191 = minus(uminusplus(v177), v178); + real2 v7 = load(in, 5 << shift); + real2 v23 = load(in, 21 << shift); + real2 v131 = plus(v7, v23); + real2 v127 = minus(v23, v7); + real2 v15 = load(in, 13 << shift); + real2 v31 = load(in, 29 << shift); + real2 v126 = reverse(minus(v31, v15)); + real2 v132 = plus(v15, v31); + real2 v199 = plus(v131, v132); + real2 v193 = reverse(minus(v132, v131)); + real2 v128 = minusplus(v126, v127); + real2 v130 = minusplus(uminus(v126), v127); + real2 v138 = ctimesminusplus(reverse(v128), ctbl[10], ctimes(v128, ctbl[11])); + real2 v21 = load(in, 19 << shift); + real2 v5 = load(in, 3 << shift); + real2 v92 = minus(v21, v5); + real2 v96 = plus(v5, v21); + real2 v29 = load(in, 27 << shift); + real2 v13 = load(in, 11 << shift); + real2 v97 = plus(v13, v29); + real2 v91 = reverse(minus(v29, v13)); + real2 v95 = minusplus(uminus(v91), v92); + real2 v93 = minusplus(v91, v92); + real2 v230 = plus(v96, v97); + real2 v226 = minus(v97, v96); + real2 v17 = load(in, 15 << shift); + real2 v33 = load(in, 31 << shift); + real2 v166 = plus(v17, v33); + real2 v160 = reverse(minus(v33, v17)); + real2 v9 = load(in, 7 << shift); + real2 v25 = load(in, 23 << shift); + real2 v161 = minus(v25, v9); + real2 v165 = plus(v9, v25); + real2 v231 = plus(v165, v166); + real2 v225 = reverse(minus(v166, v165)); + real2 v263 = plus(v230, v231); + real2 v257 = reverse(minus(v231, v230)); + real2 v229 = minusplus(uminus(v225), v226); + real2 v227 = minusplus(v225, v226); + real2 v235 = ctimesminusplus(reverse(v227), ctbl[2], ctimes(v227, ctbl[3])); + real2 v3 = load(in, 1 << shift); + real2 v19 = load(in, 17 << shift); + real2 v52 = minus(v19, v3); + real2 v56 = plus(v3, v19); + real2 v27 = load(in, 25 << shift); + real2 v11 = load(in, 9 << shift); + real2 v51 = reverse(minus(v27, v11)); + real2 v57 = plus(v11, v27); + real2 v198 = plus(v56, v57); + real2 v194 = minus(v57, v56); + real2 v258 = minus(v199, v198); + real2 v262 = plus(v198, v199); + real2 v273 = reverse(minus(v263, v262)); + real2 v279 = plus(v262, v263); + real2 v259 = minusplus(v257, v258); + real2 v261 = minusplus(uminus(v257), v258); + real2 v271 = ctimesminusplus(reverse(v261), ctbl[0], ctimes(v261, ctbl[0])); + real2 v197 = minusplus(uminus(v193), v194); + real2 v195 = minusplus(v193, v194); + real2 v203 = ctimesminusplus(reverse(v195), ctbl[4], ctimes(v195, ctbl[5])); + real2 v298 = reverse(minus(v235, v203)); + real2 v304 = plus(v203, v235); + real2 v267 = ctimesminusplus(reverse(v259), ctbl[0], ctimes(v259, ctbl[1])); + real2 v4 = load(in, 2 << shift); + real2 v20 = load(in, 18 << shift); + real2 v72 = minus(v20, v4); + real2 v76 = plus(v4, v20); + real2 v28 = load(in, 26 << shift); + real2 v12 = load(in, 10 << shift); + real2 v71 = reverse(minus(v28, v12)); + real2 v77 = plus(v12, v28); + real2 v210 = minus(v77, v76); + real2 v214 = plus(v76, v77); + real2 v32 = load(in, 30 << shift); + real2 v16 = load(in, 14 << shift); + real2 v150 = plus(v16, v32); + real2 v144 = reverse(minus(v32, v16)); + real2 v8 = load(in, 6 << shift); + real2 v24 = load(in, 22 << shift); + real2 v149 = plus(v8, v24); + real2 v145 = minus(v24, v8); + real2 v215 = plus(v149, v150); + real2 v209 = reverse(minus(v150, v149)); + real2 v241 = reverse(minus(v215, v214)); + real2 v247 = plus(v214, v215); + real2 v251 = minus(uplusminus(v241), v242); + real2 v255 = minus(uminusplus(v241), v242); + store(out, 12 << shift, plus(v255, v271)); + store(out, 28 << shift, minus(v255, v271)); + store(out, 4 << shift, plus(v251, v267)); + store(out, 20 << shift, minus(v251, v267)); + real2 v278 = plus(v246, v247); + real2 v274 = minus(v247, v246); + store(out, 24 << shift, minus(uminusplus(v273), v274)); + store(out, 8 << shift, minus(uplusminus(v273), v274)); + store(out, 16 << shift, minus(v278, v279)); + store(out, 0 << shift, plus(v278, v279)); + real2 v211 = minusplus(v209, v210); + real2 v213 = minusplus(uminus(v209), v210); + real2 v219 = ctimesminusplus(reverse(v211), ctbl[0], ctimes(v211, ctbl[1])); + real2 v299 = minus(v219, v187); + real2 v303 = plus(v187, v219); + store(out, 2 << shift, plus(v303, v304)); + store(out, 18 << shift, minus(v303, v304)); + store(out, 10 << shift, minus(uplusminus(v298), v299)); + store(out, 26 << shift, minus(uminusplus(v298), v299)); + real2 v223 = ctimesminusplus(reverse(v213), ctbl[0], ctimes(v213, ctbl[0])); + real2 v322 = plus(v191, v223); + real2 v318 = minus(v223, v191); + real2 v239 = ctimesminusplus(reverse(v229), ctbl[3], ctimes(v229, ctbl[2])); + real2 v207 = ctimesminusplus(reverse(v197), ctbl[2], ctimes(v197, ctbl[3])); + real2 v317 = reverse(minus(v239, v207)); + store(out, 30 << shift, minus(uminusplus(v317), v318)); + store(out, 14 << shift, minus(uplusminus(v317), v318)); + real2 v323 = plus(v207, v239); + store(out, 6 << shift, plus(v322, v323)); + store(out, 22 << shift, minus(v322, v323)); + real2 v101 = ctimesminusplus(reverse(v93), ctbl[8], ctimes(v93, ctbl[9])); + real2 v75 = minusplus(uminus(v71), v72); + real2 v73 = minusplus(v71, v72); + real2 v83 = ctimesminusplus(reverse(v73), ctbl[4], ctimes(v73, ctbl[5])); + real2 v162 = minusplus(v160, v161); + real2 v164 = minusplus(uminus(v160), v161); + real2 v55 = minusplus(uminus(v51), v52); + real2 v53 = minusplus(v51, v52); + real2 v171 = ctimesminusplus(reverse(v162), ctbl[6], ctimes(v162, ctbl[7])); + real2 v352 = reverse(minus(v171, v101)); + real2 v358 = plus(v101, v171); + real2 v63 = ctimesminusplus(reverse(v53), ctbl[12], ctimes(v53, ctbl[13])); + real2 v146 = minusplus(v144, v145); + real2 v148 = minusplus(uminus(v144), v145); + real2 v154 = ctimesminusplus(reverse(v146), ctbl[2], ctimes(v146, ctbl[3])); + real2 v342 = plus(v83, v154); + real2 v336 = reverse(minus(v154, v83)); + real2 v373 = plus(v341, v342); + real2 v369 = minus(v342, v341); + real2 v353 = minus(v138, v63); + real2 v357 = plus(v63, v138); + real2 v374 = plus(v357, v358); + store(out, 1 << shift, plus(v373, v374)); + store(out, 17 << shift, minus(v373, v374)); + real2 v368 = reverse(minus(v358, v357)); + store(out, 25 << shift, minus(uminusplus(v368), v369)); + store(out, 9 << shift, minus(uplusminus(v368), v369)); + real2 v346 = minus(uplusminus(v336), v337); + real2 v350 = minus(uminusplus(v336), v337); + real2 v356 = minusplus(uminus(v352), v353); + real2 v354 = minusplus(v352, v353); + real2 v362 = ctimesminusplus(reverse(v354), ctbl[0], ctimes(v354, ctbl[1])); + store(out, 21 << shift, minus(v346, v362)); + store(out, 5 << shift, plus(v346, v362)); + real2 v366 = ctimesminusplus(reverse(v356), ctbl[0], ctimes(v356, ctbl[0])); + store(out, 13 << shift, plus(v350, v366)); + store(out, 29 << shift, minus(v350, v366)); + real2 v89 = ctimesminusplus(reverse(v75), ctbl[2], ctimes(v75, ctbl[3])); + real2 v106 = ctimesminusplus(reverse(v95), ctbl[6], ctimes(v95, ctbl[12])); + real2 v142 = ctimesminusplus(reverse(v130), ctbl[12], ctimes(v130, ctbl[6])); + real2 v158 = ctimesminusplus(reverse(v148), ctbl[3], ctimes(v148, ctbl[2])); + real2 v393 = reverse(minus(v158, v89)); + real2 v399 = plus(v89, v158); + real2 v403 = minus(uplusminus(v393), v394); + real2 v407 = minus(uminusplus(v393), v394); + real2 v175 = ctimesminusplus(reverse(v164), ctbl[9], ctimes(v164, ctbl[8])); + real2 v415 = plus(v106, v175); + real2 v409 = reverse(minus(v175, v106)); + real2 v69 = ctimesminusplus(reverse(v55), ctbl[8], ctimes(v55, ctbl[9])); + real2 v414 = plus(v69, v142); + real2 v410 = minus(v142, v69); + real2 v411 = minusplus(v409, v410); + real2 v413 = minusplus(uminus(v409), v410); + real2 v419 = ctimesminusplus(reverse(v411), ctbl[0], ctimes(v411, ctbl[1])); + store(out, 23 << shift, minus(v403, v419)); + store(out, 7 << shift, plus(v403, v419)); + real2 v423 = ctimesminusplus(reverse(v413), ctbl[0], ctimes(v413, ctbl[0])); + store(out, 15 << shift, plus(v407, v423)); + store(out, 31 << shift, minus(v407, v423)); + real2 v431 = plus(v414, v415); + real2 v425 = reverse(minus(v415, v414)); + real2 v430 = plus(v398, v399); + real2 v426 = minus(v399, v398); + store(out, 27 << shift, minus(uminusplus(v425), v426)); + store(out, 11 << shift, minus(uplusminus(v425), v426)); + store(out, 19 << shift, minus(v430, v431)); + store(out, 3 << shift, plus(v430, v431)); + } +} + +ALIGNED(8192) void but32f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v14 = load(in, 12 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v115 = reverse(minus(v14, v30)); + real2 v121 = plus(v14, v30); + real2 v6 = load(in, 4 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v120 = plus(v6, v22); + real2 v116 = minus(v22, v6); + real2 v201 = plus(v120, v121); + real2 v195 = reverse(minus(v120, v121)); + real2 v119 = minusplus(uminus(v115), v116); + real2 v117 = minusplus(v115, v116); + real2 v133 = ctimesminusplus(reverse(v119), tbl[20 + tbloffset], ctimes(v119, tbl[21 + tbloffset])); + real2 v127 = ctimesminusplus(reverse(v117), tbl[18 + tbloffset], ctimes(v117, tbl[19 + tbloffset])); + real2 v18 = load(in, 16 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v40 = plus(v2, v18); + real2 v36 = minus(v18, v2); + real2 v10 = load(in, 8 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v41 = plus(v10, v26); + real2 v35 = reverse(minus(v10, v26)); + real2 v200 = plus(v40, v41); + real2 v196 = minus(v41, v40); + real2 v37 = minusplus(v35, v36); + real2 v39 = minusplus(uminus(v35), v36); + real2 v53 = ctimesminusplus(reverse(v39), tbl[4 + tbloffset], ctimes(v39, tbl[5 + tbloffset])); + real2 v276 = minus(v201, v200); + real2 v280 = plus(v200, v201); + real2 v47 = ctimesminusplus(reverse(v37), tbl[2 + tbloffset], ctimes(v37, tbl[3 + tbloffset])); + real2 v199 = minusplus(uminus(v195), v196); + real2 v197 = minusplus(v195, v196); + real2 v486 = minus(v133, v53); + real2 v490 = plus(v53, v133); + real2 v213 = ctimesminusplus(reverse(v199), tbl[36 + tbloffset], ctimes(v199, tbl[37 + tbloffset])); + real2 v207 = ctimesminusplus(reverse(v197), tbl[34 + tbloffset], ctimes(v197, tbl[35 + tbloffset])); + real2 v28 = load(in, 26 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v81 = plus(v12, v28); + real2 v75 = reverse(minus(v12, v28)); + real2 v20 = load(in, 18 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v80 = plus(v4, v20); + real2 v76 = minus(v20, v4); + real2 v236 = minus(v81, v80); + real2 v240 = plus(v80, v81); + real2 v77 = minusplus(v75, v76); + real2 v79 = minusplus(uminus(v75), v76); + real2 v93 = ctimesminusplus(reverse(v79), tbl[12 + tbloffset], ctimes(v79, tbl[13 + tbloffset])); + real2 v32 = load(in, 30 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v155 = reverse(minus(v16, v32)); + real2 v161 = plus(v16, v32); + real2 v24 = load(in, 22 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v160 = plus(v8, v24); + real2 v156 = minus(v24, v8); + real2 v235 = reverse(minus(v160, v161)); + real2 v241 = plus(v160, v161); + real2 v157 = minusplus(v155, v156); + real2 v159 = minusplus(uminus(v155), v156); + real2 v173 = ctimesminusplus(reverse(v159), tbl[28 + tbloffset], ctimes(v159, tbl[29 + tbloffset])); + real2 v485 = reverse(minus(v93, v173)); + real2 v491 = plus(v93, v173); + real2 v489 = minusplus(uminus(v485), v486); + real2 v487 = minusplus(v485, v486); + real2 v239 = minusplus(uminus(v235), v236); + real2 v237 = minusplus(v235, v236); + real2 v253 = ctimesminusplus(reverse(v239), tbl[44 + tbloffset], ctimes(v239, tbl[45 + tbloffset])); + real2 v497 = ctimesminusplus(reverse(v487), tbl[82 + tbloffset], ctimes(v487, tbl[83 + tbloffset])); + real2 v530 = plus(v490, v491); + real2 v526 = minus(v491, v490); + real2 v503 = ctimesminusplus(reverse(v489), tbl[84 + tbloffset], ctimes(v489, tbl[85 + tbloffset])); + real2 v247 = ctimesminusplus(reverse(v237), tbl[42 + tbloffset], ctimes(v237, tbl[43 + tbloffset])); + real2 v356 = minus(v247, v207); + real2 v360 = plus(v207, v247); + real2 v386 = plus(v213, v253); + real2 v382 = minus(v253, v213); + real2 v17 = load(in, 15 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v175 = reverse(minus(v17, v33)); + real2 v181 = plus(v17, v33); + real2 v25 = load(in, 23 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v176 = minus(v25, v9); + real2 v180 = plus(v9, v25); + real2 v177 = minusplus(v175, v176); + real2 v179 = minusplus(uminus(v175), v176); + real2 v193 = ctimesminusplus(reverse(v179), tbl[32 + tbloffset], ctimes(v179, tbl[33 + tbloffset])); + real2 v261 = plus(v180, v181); + real2 v255 = reverse(minus(v180, v181)); + real2 v29 = load(in, 27 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v101 = plus(v13, v29); + real2 v95 = reverse(minus(v13, v29)); + real2 v21 = load(in, 19 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v100 = plus(v5, v21); + real2 v96 = minus(v21, v5); + real2 v99 = minusplus(uminus(v95), v96); + real2 v97 = minusplus(v95, v96); + real2 v260 = plus(v100, v101); + real2 v256 = minus(v101, v100); + real2 v259 = minusplus(uminus(v255), v256); + real2 v257 = minusplus(v255, v256); + real2 v273 = ctimesminusplus(reverse(v259), tbl[48 + tbloffset], ctimes(v259, tbl[49 + tbloffset])); + real2 v267 = ctimesminusplus(reverse(v257), tbl[46 + tbloffset], ctimes(v257, tbl[47 + tbloffset])); + real2 v3 = load(in, 1 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v60 = plus(v3, v19); + real2 v56 = minus(v19, v3); + real2 v27 = load(in, 25 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v55 = reverse(minus(v11, v27)); + real2 v61 = plus(v11, v27); + real2 v220 = plus(v60, v61); + real2 v216 = minus(v61, v60); + real2 v7 = load(in, 5 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v136 = minus(v23, v7); + real2 v140 = plus(v7, v23); + real2 v15 = load(in, 13 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v135 = reverse(minus(v15, v31)); + real2 v141 = plus(v15, v31); + real2 v215 = reverse(minus(v140, v141)); + real2 v221 = plus(v140, v141); + real2 v219 = minusplus(uminus(v215), v216); + real2 v217 = minusplus(v215, v216); + real2 v227 = ctimesminusplus(reverse(v217), tbl[38 + tbloffset], ctimes(v217, tbl[39 + tbloffset])); + real2 v355 = reverse(minus(v227, v267)); + real2 v361 = plus(v227, v267); + store(out, 2 << outShift, plus(v360, v361)); + real2 v374 = minus(v360, v361); + store(out, 18 << outShift, ctimesminusplus(v374, tbl[0 + tbloffset], ctimes(reverse(v374), tbl[1 + tbloffset]))); + real2 v357 = minusplus(v355, v356); + store(out, 10 << outShift, ctimesminusplus(reverse(v357), tbl[62 + tbloffset], ctimes(v357, tbl[63 + tbloffset]))); + real2 v359 = minusplus(uminus(v355), v356); + store(out, 26 << outShift, ctimesminusplus(reverse(v359), tbl[64 + tbloffset], ctimes(v359, tbl[65 + tbloffset]))); + real2 v233 = ctimesminusplus(reverse(v219), tbl[40 + tbloffset], ctimes(v219, tbl[41 + tbloffset])); + real2 v381 = reverse(minus(v233, v273)); + real2 v387 = plus(v233, v273); + store(out, 6 << outShift, plus(v386, v387)); + real2 v400 = minus(v386, v387); + store(out, 22 << outShift, ctimesminusplus(v400, tbl[0 + tbloffset], ctimes(reverse(v400), tbl[1 + tbloffset]))); + real2 v383 = minusplus(v381, v382); + real2 v385 = minusplus(uminus(v381), v382); + store(out, 30 << outShift, ctimesminusplus(reverse(v385), tbl[68 + tbloffset], ctimes(v385, tbl[69 + tbloffset]))); + store(out, 14 << outShift, ctimesminusplus(reverse(v383), tbl[66 + tbloffset], ctimes(v383, tbl[67 + tbloffset]))); + real2 v137 = minusplus(v135, v136); + real2 v139 = minusplus(uminus(v135), v136); + real2 v153 = ctimesminusplus(reverse(v139), tbl[24 + tbloffset], ctimes(v139, tbl[25 + tbloffset])); + real2 v113 = ctimesminusplus(reverse(v99), tbl[16 + tbloffset], ctimes(v99, tbl[17 + tbloffset])); + real2 v511 = plus(v113, v193); + real2 v505 = reverse(minus(v113, v193)); + real2 v57 = minusplus(v55, v56); + real2 v59 = minusplus(uminus(v55), v56); + real2 v73 = ctimesminusplus(reverse(v59), tbl[8 + tbloffset], ctimes(v59, tbl[9 + tbloffset])); + real2 v510 = plus(v73, v153); + real2 v506 = minus(v153, v73); + real2 v531 = plus(v510, v511); + real2 v525 = reverse(minus(v510, v511)); + store(out, 3 << outShift, plus(v530, v531)); + real2 v544 = minus(v530, v531); + store(out, 19 << outShift, ctimesminusplus(v544, tbl[0 + tbloffset], ctimes(reverse(v544), tbl[1 + tbloffset]))); + real2 v527 = minusplus(v525, v526); + store(out, 11 << outShift, ctimesminusplus(reverse(v527), tbl[90 + tbloffset], ctimes(v527, tbl[91 + tbloffset]))); + real2 v529 = minusplus(uminus(v525), v526); + store(out, 27 << outShift, ctimesminusplus(reverse(v529), tbl[92 + tbloffset], ctimes(v529, tbl[93 + tbloffset]))); + real2 v509 = minusplus(uminus(v505), v506); + real2 v507 = minusplus(v505, v506); + real2 v523 = ctimesminusplus(reverse(v509), tbl[88 + tbloffset], ctimes(v509, tbl[89 + tbloffset])); + store(out, 15 << outShift, plus(v503, v523)); + real2 v556 = minus(v503, v523); + store(out, 31 << outShift, ctimesminusplus(v556, tbl[0 + tbloffset], ctimes(reverse(v556), tbl[1 + tbloffset]))); + real2 v517 = ctimesminusplus(reverse(v507), tbl[86 + tbloffset], ctimes(v507, tbl[87 + tbloffset])); + store(out, 7 << outShift, plus(v497, v517)); + real2 v550 = minus(v497, v517); + store(out, 23 << outShift, ctimesminusplus(v550, tbl[0 + tbloffset], ctimes(reverse(v550), tbl[1 + tbloffset]))); + real2 v275 = reverse(minus(v240, v241)); + real2 v281 = plus(v240, v241); + real2 v320 = plus(v280, v281); + real2 v316 = minus(v281, v280); + real2 v301 = plus(v260, v261); + real2 v295 = reverse(minus(v260, v261)); + real2 v300 = plus(v220, v221); + real2 v296 = minus(v221, v220); + real2 v315 = reverse(minus(v300, v301)); + real2 v321 = plus(v300, v301); + store(out, 0 << outShift, plus(v320, v321)); + real2 v334 = minus(v320, v321); + store(out, 16 << outShift, ctimesminusplus(v334, tbl[0 + tbloffset], ctimes(reverse(v334), tbl[1 + tbloffset]))); + real2 v319 = minusplus(uminus(v315), v316); + real2 v317 = minusplus(v315, v316); + store(out, 8 << outShift, ctimesminusplus(reverse(v317), tbl[58 + tbloffset], ctimes(v317, tbl[59 + tbloffset]))); + store(out, 24 << outShift, ctimesminusplus(reverse(v319), tbl[60 + tbloffset], ctimes(v319, tbl[61 + tbloffset]))); + real2 v299 = minusplus(uminus(v295), v296); + real2 v297 = minusplus(v295, v296); + real2 v279 = minusplus(uminus(v275), v276); + real2 v277 = minusplus(v275, v276); + real2 v287 = ctimesminusplus(reverse(v277), tbl[50 + tbloffset], ctimes(v277, tbl[51 + tbloffset])); + real2 v307 = ctimesminusplus(reverse(v297), tbl[54 + tbloffset], ctimes(v297, tbl[55 + tbloffset])); + store(out, 4 << outShift, plus(v287, v307)); + real2 v342 = minus(v287, v307); + store(out, 20 << outShift, ctimesminusplus(v342, tbl[0 + tbloffset], ctimes(reverse(v342), tbl[1 + tbloffset]))); + real2 v313 = ctimesminusplus(reverse(v299), tbl[56 + tbloffset], ctimes(v299, tbl[57 + tbloffset])); + real2 v293 = ctimesminusplus(reverse(v279), tbl[52 + tbloffset], ctimes(v279, tbl[53 + tbloffset])); + store(out, 12 << outShift, plus(v293, v313)); + real2 v348 = minus(v293, v313); + store(out, 28 << outShift, ctimesminusplus(v348, tbl[0 + tbloffset], ctimes(reverse(v348), tbl[1 + tbloffset]))); + real2 v87 = ctimesminusplus(reverse(v77), tbl[10 + tbloffset], ctimes(v77, tbl[11 + tbloffset])); + real2 v147 = ctimesminusplus(reverse(v137), tbl[22 + tbloffset], ctimes(v137, tbl[23 + tbloffset])); + real2 v187 = ctimesminusplus(reverse(v177), tbl[30 + tbloffset], ctimes(v177, tbl[31 + tbloffset])); + real2 v167 = ctimesminusplus(reverse(v157), tbl[26 + tbloffset], ctimes(v157, tbl[27 + tbloffset])); + real2 v413 = plus(v87, v167); + real2 v407 = reverse(minus(v87, v167)); + real2 v67 = ctimesminusplus(reverse(v57), tbl[6 + tbloffset], ctimes(v57, tbl[7 + tbloffset])); + real2 v107 = ctimesminusplus(reverse(v97), tbl[14 + tbloffset], ctimes(v97, tbl[15 + tbloffset])); + real2 v427 = reverse(minus(v107, v187)); + real2 v433 = plus(v107, v187); + real2 v432 = plus(v67, v147); + real2 v428 = minus(v147, v67); + real2 v453 = plus(v432, v433); + real2 v447 = reverse(minus(v432, v433)); + real2 v408 = minus(v127, v47); + real2 v412 = plus(v47, v127); + real2 v452 = plus(v412, v413); + real2 v448 = minus(v413, v412); + store(out, 1 << outShift, plus(v452, v453)); + real2 v466 = minus(v452, v453); + store(out, 17 << outShift, ctimesminusplus(v466, tbl[0 + tbloffset], ctimes(reverse(v466), tbl[1 + tbloffset]))); + real2 v451 = minusplus(uminus(v447), v448); + store(out, 25 << outShift, ctimesminusplus(reverse(v451), tbl[80 + tbloffset], ctimes(v451, tbl[81 + tbloffset]))); + real2 v449 = minusplus(v447, v448); + store(out, 9 << outShift, ctimesminusplus(reverse(v449), tbl[78 + tbloffset], ctimes(v449, tbl[79 + tbloffset]))); + real2 v429 = minusplus(v427, v428); + real2 v431 = minusplus(uminus(v427), v428); + real2 v445 = ctimesminusplus(reverse(v431), tbl[76 + tbloffset], ctimes(v431, tbl[77 + tbloffset])); + real2 v409 = minusplus(v407, v408); + real2 v411 = minusplus(uminus(v407), v408); + real2 v425 = ctimesminusplus(reverse(v411), tbl[72 + tbloffset], ctimes(v411, tbl[73 + tbloffset])); + store(out, 13 << outShift, plus(v425, v445)); + real2 v478 = minus(v425, v445); + store(out, 29 << outShift, ctimesminusplus(v478, tbl[0 + tbloffset], ctimes(reverse(v478), tbl[1 + tbloffset]))); + real2 v439 = ctimesminusplus(reverse(v429), tbl[74 + tbloffset], ctimes(v429, tbl[75 + tbloffset])); + real2 v419 = ctimesminusplus(reverse(v409), tbl[70 + tbloffset], ctimes(v409, tbl[71 + tbloffset])); + store(out, 5 << outShift, plus(v419, v439)); + real2 v472 = minus(v419, v439); + store(out, 21 << outShift, ctimesminusplus(v472, tbl[0 + tbloffset], ctimes(reverse(v472), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void but32b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + + real2 v14 = load(in, 12 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v115 = reverse(minus(v30, v14)); + real2 v121 = plus(v14, v30); + real2 v6 = load(in, 4 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v120 = plus(v6, v22); + real2 v116 = minus(v22, v6); + real2 v201 = plus(v120, v121); + real2 v195 = reverse(minus(v121, v120)); + real2 v119 = minusplus(uminus(v115), v116); + real2 v117 = minusplus(v115, v116); + real2 v133 = ctimesminusplus(reverse(v119), tbl[20 + tbloffset], ctimes(v119, tbl[21 + tbloffset])); + real2 v127 = ctimesminusplus(reverse(v117), tbl[18 + tbloffset], ctimes(v117, tbl[19 + tbloffset])); + real2 v18 = load(in, 16 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v40 = plus(v2, v18); + real2 v36 = minus(v18, v2); + real2 v10 = load(in, 8 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v41 = plus(v10, v26); + real2 v35 = reverse(minus(v26, v10)); + real2 v200 = plus(v40, v41); + real2 v196 = minus(v41, v40); + real2 v37 = minusplus(v35, v36); + real2 v39 = minusplus(uminus(v35), v36); + real2 v53 = ctimesminusplus(reverse(v39), tbl[4 + tbloffset], ctimes(v39, tbl[5 + tbloffset])); + real2 v276 = minus(v201, v200); + real2 v280 = plus(v200, v201); + real2 v47 = ctimesminusplus(reverse(v37), tbl[2 + tbloffset], ctimes(v37, tbl[3 + tbloffset])); + real2 v199 = minusplus(uminus(v195), v196); + real2 v197 = minusplus(v195, v196); + real2 v486 = minus(v133, v53); + real2 v490 = plus(v53, v133); + real2 v213 = ctimesminusplus(reverse(v199), tbl[36 + tbloffset], ctimes(v199, tbl[37 + tbloffset])); + real2 v207 = ctimesminusplus(reverse(v197), tbl[34 + tbloffset], ctimes(v197, tbl[35 + tbloffset])); + real2 v28 = load(in, 26 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v81 = plus(v12, v28); + real2 v75 = reverse(minus(v28, v12)); + real2 v20 = load(in, 18 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v80 = plus(v4, v20); + real2 v76 = minus(v20, v4); + real2 v236 = minus(v81, v80); + real2 v240 = plus(v80, v81); + real2 v77 = minusplus(v75, v76); + real2 v79 = minusplus(uminus(v75), v76); + real2 v93 = ctimesminusplus(reverse(v79), tbl[12 + tbloffset], ctimes(v79, tbl[13 + tbloffset])); + real2 v32 = load(in, 30 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v155 = reverse(minus(v32, v16)); + real2 v161 = plus(v16, v32); + real2 v24 = load(in, 22 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v160 = plus(v8, v24); + real2 v156 = minus(v24, v8); + real2 v235 = reverse(minus(v161, v160)); + real2 v241 = plus(v160, v161); + real2 v157 = minusplus(v155, v156); + real2 v159 = minusplus(uminus(v155), v156); + real2 v173 = ctimesminusplus(reverse(v159), tbl[28 + tbloffset], ctimes(v159, tbl[29 + tbloffset])); + real2 v485 = reverse(minus(v173, v93)); + real2 v491 = plus(v93, v173); + real2 v489 = minusplus(uminus(v485), v486); + real2 v487 = minusplus(v485, v486); + real2 v239 = minusplus(uminus(v235), v236); + real2 v237 = minusplus(v235, v236); + real2 v253 = ctimesminusplus(reverse(v239), tbl[44 + tbloffset], ctimes(v239, tbl[45 + tbloffset])); + real2 v497 = ctimesminusplus(reverse(v487), tbl[82 + tbloffset], ctimes(v487, tbl[83 + tbloffset])); + real2 v530 = plus(v490, v491); + real2 v526 = minus(v491, v490); + real2 v503 = ctimesminusplus(reverse(v489), tbl[84 + tbloffset], ctimes(v489, tbl[85 + tbloffset])); + real2 v247 = ctimesminusplus(reverse(v237), tbl[42 + tbloffset], ctimes(v237, tbl[43 + tbloffset])); + real2 v356 = minus(v247, v207); + real2 v360 = plus(v207, v247); + real2 v386 = plus(v213, v253); + real2 v382 = minus(v253, v213); + real2 v17 = load(in, 15 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v175 = reverse(minus(v33, v17)); + real2 v181 = plus(v17, v33); + real2 v25 = load(in, 23 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v176 = minus(v25, v9); + real2 v180 = plus(v9, v25); + real2 v177 = minusplus(v175, v176); + real2 v179 = minusplus(uminus(v175), v176); + real2 v193 = ctimesminusplus(reverse(v179), tbl[32 + tbloffset], ctimes(v179, tbl[33 + tbloffset])); + real2 v261 = plus(v180, v181); + real2 v255 = reverse(minus(v181, v180)); + real2 v29 = load(in, 27 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v101 = plus(v13, v29); + real2 v95 = reverse(minus(v29, v13)); + real2 v21 = load(in, 19 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v100 = plus(v5, v21); + real2 v96 = minus(v21, v5); + real2 v99 = minusplus(uminus(v95), v96); + real2 v97 = minusplus(v95, v96); + real2 v260 = plus(v100, v101); + real2 v256 = minus(v101, v100); + real2 v259 = minusplus(uminus(v255), v256); + real2 v257 = minusplus(v255, v256); + real2 v273 = ctimesminusplus(reverse(v259), tbl[48 + tbloffset], ctimes(v259, tbl[49 + tbloffset])); + real2 v267 = ctimesminusplus(reverse(v257), tbl[46 + tbloffset], ctimes(v257, tbl[47 + tbloffset])); + real2 v3 = load(in, 1 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v60 = plus(v3, v19); + real2 v56 = minus(v19, v3); + real2 v27 = load(in, 25 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v55 = reverse(minus(v27, v11)); + real2 v61 = plus(v11, v27); + real2 v220 = plus(v60, v61); + real2 v216 = minus(v61, v60); + real2 v7 = load(in, 5 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v136 = minus(v23, v7); + real2 v140 = plus(v7, v23); + real2 v15 = load(in, 13 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v135 = reverse(minus(v31, v15)); + real2 v141 = plus(v15, v31); + real2 v215 = reverse(minus(v141, v140)); + real2 v221 = plus(v140, v141); + real2 v219 = minusplus(uminus(v215), v216); + real2 v217 = minusplus(v215, v216); + real2 v227 = ctimesminusplus(reverse(v217), tbl[38 + tbloffset], ctimes(v217, tbl[39 + tbloffset])); + real2 v355 = reverse(minus(v267, v227)); + real2 v361 = plus(v227, v267); + store(out, 2 << outShift, plus(v360, v361)); + real2 v374 = minus(v360, v361); + store(out, 18 << outShift, ctimesminusplus(v374, tbl[0 + tbloffset], ctimes(reverse(v374), tbl[1 + tbloffset]))); + real2 v357 = minusplus(v355, v356); + store(out, 10 << outShift, ctimesminusplus(reverse(v357), tbl[62 + tbloffset], ctimes(v357, tbl[63 + tbloffset]))); + real2 v359 = minusplus(uminus(v355), v356); + store(out, 26 << outShift, ctimesminusplus(reverse(v359), tbl[64 + tbloffset], ctimes(v359, tbl[65 + tbloffset]))); + real2 v233 = ctimesminusplus(reverse(v219), tbl[40 + tbloffset], ctimes(v219, tbl[41 + tbloffset])); + real2 v381 = reverse(minus(v273, v233)); + real2 v387 = plus(v233, v273); + store(out, 6 << outShift, plus(v386, v387)); + real2 v400 = minus(v386, v387); + store(out, 22 << outShift, ctimesminusplus(v400, tbl[0 + tbloffset], ctimes(reverse(v400), tbl[1 + tbloffset]))); + real2 v383 = minusplus(v381, v382); + real2 v385 = minusplus(uminus(v381), v382); + store(out, 30 << outShift, ctimesminusplus(reverse(v385), tbl[68 + tbloffset], ctimes(v385, tbl[69 + tbloffset]))); + store(out, 14 << outShift, ctimesminusplus(reverse(v383), tbl[66 + tbloffset], ctimes(v383, tbl[67 + tbloffset]))); + real2 v137 = minusplus(v135, v136); + real2 v139 = minusplus(uminus(v135), v136); + real2 v153 = ctimesminusplus(reverse(v139), tbl[24 + tbloffset], ctimes(v139, tbl[25 + tbloffset])); + real2 v113 = ctimesminusplus(reverse(v99), tbl[16 + tbloffset], ctimes(v99, tbl[17 + tbloffset])); + real2 v511 = plus(v113, v193); + real2 v505 = reverse(minus(v193, v113)); + real2 v57 = minusplus(v55, v56); + real2 v59 = minusplus(uminus(v55), v56); + real2 v73 = ctimesminusplus(reverse(v59), tbl[8 + tbloffset], ctimes(v59, tbl[9 + tbloffset])); + real2 v510 = plus(v73, v153); + real2 v506 = minus(v153, v73); + real2 v531 = plus(v510, v511); + real2 v525 = reverse(minus(v511, v510)); + store(out, 3 << outShift, plus(v530, v531)); + real2 v544 = minus(v530, v531); + store(out, 19 << outShift, ctimesminusplus(v544, tbl[0 + tbloffset], ctimes(reverse(v544), tbl[1 + tbloffset]))); + real2 v527 = minusplus(v525, v526); + store(out, 11 << outShift, ctimesminusplus(reverse(v527), tbl[90 + tbloffset], ctimes(v527, tbl[91 + tbloffset]))); + real2 v529 = minusplus(uminus(v525), v526); + store(out, 27 << outShift, ctimesminusplus(reverse(v529), tbl[92 + tbloffset], ctimes(v529, tbl[93 + tbloffset]))); + real2 v509 = minusplus(uminus(v505), v506); + real2 v507 = minusplus(v505, v506); + real2 v523 = ctimesminusplus(reverse(v509), tbl[88 + tbloffset], ctimes(v509, tbl[89 + tbloffset])); + store(out, 15 << outShift, plus(v503, v523)); + real2 v556 = minus(v503, v523); + store(out, 31 << outShift, ctimesminusplus(v556, tbl[0 + tbloffset], ctimes(reverse(v556), tbl[1 + tbloffset]))); + real2 v517 = ctimesminusplus(reverse(v507), tbl[86 + tbloffset], ctimes(v507, tbl[87 + tbloffset])); + store(out, 7 << outShift, plus(v497, v517)); + real2 v550 = minus(v497, v517); + store(out, 23 << outShift, ctimesminusplus(v550, tbl[0 + tbloffset], ctimes(reverse(v550), tbl[1 + tbloffset]))); + real2 v275 = reverse(minus(v241, v240)); + real2 v281 = plus(v240, v241); + real2 v320 = plus(v280, v281); + real2 v316 = minus(v281, v280); + real2 v301 = plus(v260, v261); + real2 v295 = reverse(minus(v261, v260)); + real2 v300 = plus(v220, v221); + real2 v296 = minus(v221, v220); + real2 v315 = reverse(minus(v301, v300)); + real2 v321 = plus(v300, v301); + store(out, 0 << outShift, plus(v320, v321)); + real2 v334 = minus(v320, v321); + store(out, 16 << outShift, ctimesminusplus(v334, tbl[0 + tbloffset], ctimes(reverse(v334), tbl[1 + tbloffset]))); + real2 v319 = minusplus(uminus(v315), v316); + real2 v317 = minusplus(v315, v316); + store(out, 8 << outShift, ctimesminusplus(reverse(v317), tbl[58 + tbloffset], ctimes(v317, tbl[59 + tbloffset]))); + store(out, 24 << outShift, ctimesminusplus(reverse(v319), tbl[60 + tbloffset], ctimes(v319, tbl[61 + tbloffset]))); + real2 v299 = minusplus(uminus(v295), v296); + real2 v297 = minusplus(v295, v296); + real2 v279 = minusplus(uminus(v275), v276); + real2 v277 = minusplus(v275, v276); + real2 v287 = ctimesminusplus(reverse(v277), tbl[50 + tbloffset], ctimes(v277, tbl[51 + tbloffset])); + real2 v307 = ctimesminusplus(reverse(v297), tbl[54 + tbloffset], ctimes(v297, tbl[55 + tbloffset])); + store(out, 4 << outShift, plus(v287, v307)); + real2 v342 = minus(v287, v307); + store(out, 20 << outShift, ctimesminusplus(v342, tbl[0 + tbloffset], ctimes(reverse(v342), tbl[1 + tbloffset]))); + real2 v313 = ctimesminusplus(reverse(v299), tbl[56 + tbloffset], ctimes(v299, tbl[57 + tbloffset])); + real2 v293 = ctimesminusplus(reverse(v279), tbl[52 + tbloffset], ctimes(v279, tbl[53 + tbloffset])); + store(out, 12 << outShift, plus(v293, v313)); + real2 v348 = minus(v293, v313); + store(out, 28 << outShift, ctimesminusplus(v348, tbl[0 + tbloffset], ctimes(reverse(v348), tbl[1 + tbloffset]))); + real2 v87 = ctimesminusplus(reverse(v77), tbl[10 + tbloffset], ctimes(v77, tbl[11 + tbloffset])); + real2 v147 = ctimesminusplus(reverse(v137), tbl[22 + tbloffset], ctimes(v137, tbl[23 + tbloffset])); + real2 v187 = ctimesminusplus(reverse(v177), tbl[30 + tbloffset], ctimes(v177, tbl[31 + tbloffset])); + real2 v167 = ctimesminusplus(reverse(v157), tbl[26 + tbloffset], ctimes(v157, tbl[27 + tbloffset])); + real2 v413 = plus(v87, v167); + real2 v407 = reverse(minus(v167, v87)); + real2 v67 = ctimesminusplus(reverse(v57), tbl[6 + tbloffset], ctimes(v57, tbl[7 + tbloffset])); + real2 v107 = ctimesminusplus(reverse(v97), tbl[14 + tbloffset], ctimes(v97, tbl[15 + tbloffset])); + real2 v427 = reverse(minus(v187, v107)); + real2 v433 = plus(v107, v187); + real2 v432 = plus(v67, v147); + real2 v428 = minus(v147, v67); + real2 v453 = plus(v432, v433); + real2 v447 = reverse(minus(v433, v432)); + real2 v408 = minus(v127, v47); + real2 v412 = plus(v47, v127); + real2 v452 = plus(v412, v413); + real2 v448 = minus(v413, v412); + store(out, 1 << outShift, plus(v452, v453)); + real2 v466 = minus(v452, v453); + store(out, 17 << outShift, ctimesminusplus(v466, tbl[0 + tbloffset], ctimes(reverse(v466), tbl[1 + tbloffset]))); + real2 v451 = minusplus(uminus(v447), v448); + store(out, 25 << outShift, ctimesminusplus(reverse(v451), tbl[80 + tbloffset], ctimes(v451, tbl[81 + tbloffset]))); + real2 v449 = minusplus(v447, v448); + store(out, 9 << outShift, ctimesminusplus(reverse(v449), tbl[78 + tbloffset], ctimes(v449, tbl[79 + tbloffset]))); + real2 v429 = minusplus(v427, v428); + real2 v431 = minusplus(uminus(v427), v428); + real2 v445 = ctimesminusplus(reverse(v431), tbl[76 + tbloffset], ctimes(v431, tbl[77 + tbloffset])); + real2 v409 = minusplus(v407, v408); + real2 v411 = minusplus(uminus(v407), v408); + real2 v425 = ctimesminusplus(reverse(v411), tbl[72 + tbloffset], ctimes(v411, tbl[73 + tbloffset])); + store(out, 13 << outShift, plus(v425, v445)); + real2 v478 = minus(v425, v445); + store(out, 29 << outShift, ctimesminusplus(v478, tbl[0 + tbloffset], ctimes(reverse(v478), tbl[1 + tbloffset]))); + real2 v439 = ctimesminusplus(reverse(v429), tbl[74 + tbloffset], ctimes(v429, tbl[75 + tbloffset])); + real2 v419 = ctimesminusplus(reverse(v409), tbl[70 + tbloffset], ctimes(v409, tbl[71 + tbloffset])); + store(out, 5 << outShift, plus(v419, v439)); + real2 v472 = minus(v419, v439); + store(out, 21 << outShift, ctimesminusplus(v472, tbl[0 + tbloffset], ctimes(reverse(v472), tbl[1 + tbloffset]))); + } +} + +ALIGNED(8192) void tbut32f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v14 = load(in, 12 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v115 = reverse(minus(v14, v30)); + real2 v121 = plus(v14, v30); + real2 v6 = load(in, 4 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v120 = plus(v6, v22); + real2 v116 = minus(v22, v6); + real2 v201 = plus(v120, v121); + real2 v195 = reverse(minus(v120, v121)); + real2 v119 = minusplus(uminus(v115), v116); + real2 v117 = minusplus(v115, v116); + real2 v133 = timesminusplus(reverse(v119), load(tbl, 20 * VECWIDTH + tbloffset), times(v119, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v127 = timesminusplus(reverse(v117), load(tbl, 18 * VECWIDTH + tbloffset), times(v117, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v18 = load(in, 16 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v40 = plus(v2, v18); + real2 v36 = minus(v18, v2); + real2 v10 = load(in, 8 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v41 = plus(v10, v26); + real2 v35 = reverse(minus(v10, v26)); + real2 v200 = plus(v40, v41); + real2 v196 = minus(v41, v40); + real2 v37 = minusplus(v35, v36); + real2 v39 = minusplus(uminus(v35), v36); + real2 v53 = timesminusplus(reverse(v39), load(tbl, 4 * VECWIDTH + tbloffset), times(v39, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v276 = minus(v201, v200); + real2 v280 = plus(v200, v201); + real2 v47 = timesminusplus(reverse(v37), load(tbl, 2 * VECWIDTH + tbloffset), times(v37, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v199 = minusplus(uminus(v195), v196); + real2 v197 = minusplus(v195, v196); + real2 v486 = minus(v133, v53); + real2 v490 = plus(v53, v133); + real2 v213 = timesminusplus(reverse(v199), load(tbl, 36 * VECWIDTH + tbloffset), times(v199, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v207 = timesminusplus(reverse(v197), load(tbl, 34 * VECWIDTH + tbloffset), times(v197, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v28 = load(in, 26 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v81 = plus(v12, v28); + real2 v75 = reverse(minus(v12, v28)); + real2 v20 = load(in, 18 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v80 = plus(v4, v20); + real2 v76 = minus(v20, v4); + real2 v236 = minus(v81, v80); + real2 v240 = plus(v80, v81); + real2 v77 = minusplus(v75, v76); + real2 v79 = minusplus(uminus(v75), v76); + real2 v93 = timesminusplus(reverse(v79), load(tbl, 12 * VECWIDTH + tbloffset), times(v79, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v32 = load(in, 30 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v155 = reverse(minus(v16, v32)); + real2 v161 = plus(v16, v32); + real2 v24 = load(in, 22 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v160 = plus(v8, v24); + real2 v156 = minus(v24, v8); + real2 v235 = reverse(minus(v160, v161)); + real2 v241 = plus(v160, v161); + real2 v157 = minusplus(v155, v156); + real2 v159 = minusplus(uminus(v155), v156); + real2 v173 = timesminusplus(reverse(v159), load(tbl, 28 * VECWIDTH + tbloffset), times(v159, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v485 = reverse(minus(v93, v173)); + real2 v491 = plus(v93, v173); + real2 v489 = minusplus(uminus(v485), v486); + real2 v487 = minusplus(v485, v486); + real2 v239 = minusplus(uminus(v235), v236); + real2 v237 = minusplus(v235, v236); + real2 v253 = timesminusplus(reverse(v239), load(tbl, 44 * VECWIDTH + tbloffset), times(v239, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v497 = timesminusplus(reverse(v487), load(tbl, 82 * VECWIDTH + tbloffset), times(v487, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v530 = plus(v490, v491); + real2 v526 = minus(v491, v490); + real2 v503 = timesminusplus(reverse(v489), load(tbl, 84 * VECWIDTH + tbloffset), times(v489, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v247 = timesminusplus(reverse(v237), load(tbl, 42 * VECWIDTH + tbloffset), times(v237, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v356 = minus(v247, v207); + real2 v360 = plus(v207, v247); + real2 v386 = plus(v213, v253); + real2 v382 = minus(v253, v213); + real2 v17 = load(in, 15 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v175 = reverse(minus(v17, v33)); + real2 v181 = plus(v17, v33); + real2 v25 = load(in, 23 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v176 = minus(v25, v9); + real2 v180 = plus(v9, v25); + real2 v177 = minusplus(v175, v176); + real2 v179 = minusplus(uminus(v175), v176); + real2 v193 = timesminusplus(reverse(v179), load(tbl, 32 * VECWIDTH + tbloffset), times(v179, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v261 = plus(v180, v181); + real2 v255 = reverse(minus(v180, v181)); + real2 v29 = load(in, 27 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v101 = plus(v13, v29); + real2 v95 = reverse(minus(v13, v29)); + real2 v21 = load(in, 19 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v100 = plus(v5, v21); + real2 v96 = minus(v21, v5); + real2 v99 = minusplus(uminus(v95), v96); + real2 v97 = minusplus(v95, v96); + real2 v260 = plus(v100, v101); + real2 v256 = minus(v101, v100); + real2 v259 = minusplus(uminus(v255), v256); + real2 v257 = minusplus(v255, v256); + real2 v273 = timesminusplus(reverse(v259), load(tbl, 48 * VECWIDTH + tbloffset), times(v259, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v267 = timesminusplus(reverse(v257), load(tbl, 46 * VECWIDTH + tbloffset), times(v257, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v3 = load(in, 1 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v60 = plus(v3, v19); + real2 v56 = minus(v19, v3); + real2 v27 = load(in, 25 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v55 = reverse(minus(v11, v27)); + real2 v61 = plus(v11, v27); + real2 v220 = plus(v60, v61); + real2 v216 = minus(v61, v60); + real2 v7 = load(in, 5 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v136 = minus(v23, v7); + real2 v140 = plus(v7, v23); + real2 v15 = load(in, 13 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v135 = reverse(minus(v15, v31)); + real2 v141 = plus(v15, v31); + real2 v215 = reverse(minus(v140, v141)); + real2 v221 = plus(v140, v141); + real2 v219 = minusplus(uminus(v215), v216); + real2 v217 = minusplus(v215, v216); + real2 v227 = timesminusplus(reverse(v217), load(tbl, 38 * VECWIDTH + tbloffset), times(v217, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v355 = reverse(minus(v227, v267)); + real2 v361 = plus(v227, v267); + scatter(out, 2, 32, plus(v360, v361)); + real2 v374 = minus(v360, v361); + scatter(out, 18, 32, timesminusplus(v374, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v374), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v357 = minusplus(v355, v356); + scatter(out, 10, 32, timesminusplus(reverse(v357), load(tbl, 62 * VECWIDTH + tbloffset), times(v357, load(tbl, 63 * VECWIDTH + tbloffset)))); + real2 v359 = minusplus(uminus(v355), v356); + scatter(out, 26, 32, timesminusplus(reverse(v359), load(tbl, 64 * VECWIDTH + tbloffset), times(v359, load(tbl, 65 * VECWIDTH + tbloffset)))); + real2 v233 = timesminusplus(reverse(v219), load(tbl, 40 * VECWIDTH + tbloffset), times(v219, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v381 = reverse(minus(v233, v273)); + real2 v387 = plus(v233, v273); + scatter(out, 6, 32, plus(v386, v387)); + real2 v400 = minus(v386, v387); + scatter(out, 22, 32, timesminusplus(v400, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v400), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v383 = minusplus(v381, v382); + real2 v385 = minusplus(uminus(v381), v382); + scatter(out, 30, 32, timesminusplus(reverse(v385), load(tbl, 68 * VECWIDTH + tbloffset), times(v385, load(tbl, 69 * VECWIDTH + tbloffset)))); + scatter(out, 14, 32, timesminusplus(reverse(v383), load(tbl, 66 * VECWIDTH + tbloffset), times(v383, load(tbl, 67 * VECWIDTH + tbloffset)))); + real2 v137 = minusplus(v135, v136); + real2 v139 = minusplus(uminus(v135), v136); + real2 v153 = timesminusplus(reverse(v139), load(tbl, 24 * VECWIDTH + tbloffset), times(v139, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v113 = timesminusplus(reverse(v99), load(tbl, 16 * VECWIDTH + tbloffset), times(v99, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v511 = plus(v113, v193); + real2 v505 = reverse(minus(v113, v193)); + real2 v57 = minusplus(v55, v56); + real2 v59 = minusplus(uminus(v55), v56); + real2 v73 = timesminusplus(reverse(v59), load(tbl, 8 * VECWIDTH + tbloffset), times(v59, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v510 = plus(v73, v153); + real2 v506 = minus(v153, v73); + real2 v531 = plus(v510, v511); + real2 v525 = reverse(minus(v510, v511)); + scatter(out, 3, 32, plus(v530, v531)); + real2 v544 = minus(v530, v531); + scatter(out, 19, 32, timesminusplus(v544, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v544), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v527 = minusplus(v525, v526); + scatter(out, 11, 32, timesminusplus(reverse(v527), load(tbl, 90 * VECWIDTH + tbloffset), times(v527, load(tbl, 91 * VECWIDTH + tbloffset)))); + real2 v529 = minusplus(uminus(v525), v526); + scatter(out, 27, 32, timesminusplus(reverse(v529), load(tbl, 92 * VECWIDTH + tbloffset), times(v529, load(tbl, 93 * VECWIDTH + tbloffset)))); + real2 v509 = minusplus(uminus(v505), v506); + real2 v507 = minusplus(v505, v506); + real2 v523 = timesminusplus(reverse(v509), load(tbl, 88 * VECWIDTH + tbloffset), times(v509, load(tbl, 89 * VECWIDTH + tbloffset))); + scatter(out, 15, 32, plus(v503, v523)); + real2 v556 = minus(v503, v523); + scatter(out, 31, 32, timesminusplus(v556, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v556), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v517 = timesminusplus(reverse(v507), load(tbl, 86 * VECWIDTH + tbloffset), times(v507, load(tbl, 87 * VECWIDTH + tbloffset))); + scatter(out, 7, 32, plus(v497, v517)); + real2 v550 = minus(v497, v517); + scatter(out, 23, 32, timesminusplus(v550, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v550), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v275 = reverse(minus(v240, v241)); + real2 v281 = plus(v240, v241); + real2 v320 = plus(v280, v281); + real2 v316 = minus(v281, v280); + real2 v301 = plus(v260, v261); + real2 v295 = reverse(minus(v260, v261)); + real2 v300 = plus(v220, v221); + real2 v296 = minus(v221, v220); + real2 v315 = reverse(minus(v300, v301)); + real2 v321 = plus(v300, v301); + scatter(out, 0, 32, plus(v320, v321)); + real2 v334 = minus(v320, v321); + scatter(out, 16, 32, timesminusplus(v334, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v334), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v319 = minusplus(uminus(v315), v316); + real2 v317 = minusplus(v315, v316); + scatter(out, 8, 32, timesminusplus(reverse(v317), load(tbl, 58 * VECWIDTH + tbloffset), times(v317, load(tbl, 59 * VECWIDTH + tbloffset)))); + scatter(out, 24, 32, timesminusplus(reverse(v319), load(tbl, 60 * VECWIDTH + tbloffset), times(v319, load(tbl, 61 * VECWIDTH + tbloffset)))); + real2 v299 = minusplus(uminus(v295), v296); + real2 v297 = minusplus(v295, v296); + real2 v279 = minusplus(uminus(v275), v276); + real2 v277 = minusplus(v275, v276); + real2 v287 = timesminusplus(reverse(v277), load(tbl, 50 * VECWIDTH + tbloffset), times(v277, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v307 = timesminusplus(reverse(v297), load(tbl, 54 * VECWIDTH + tbloffset), times(v297, load(tbl, 55 * VECWIDTH + tbloffset))); + scatter(out, 4, 32, plus(v287, v307)); + real2 v342 = minus(v287, v307); + scatter(out, 20, 32, timesminusplus(v342, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v342), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v313 = timesminusplus(reverse(v299), load(tbl, 56 * VECWIDTH + tbloffset), times(v299, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v293 = timesminusplus(reverse(v279), load(tbl, 52 * VECWIDTH + tbloffset), times(v279, load(tbl, 53 * VECWIDTH + tbloffset))); + scatter(out, 12, 32, plus(v293, v313)); + real2 v348 = minus(v293, v313); + scatter(out, 28, 32, timesminusplus(v348, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v348), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v87 = timesminusplus(reverse(v77), load(tbl, 10 * VECWIDTH + tbloffset), times(v77, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v147 = timesminusplus(reverse(v137), load(tbl, 22 * VECWIDTH + tbloffset), times(v137, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v187 = timesminusplus(reverse(v177), load(tbl, 30 * VECWIDTH + tbloffset), times(v177, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v167 = timesminusplus(reverse(v157), load(tbl, 26 * VECWIDTH + tbloffset), times(v157, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v413 = plus(v87, v167); + real2 v407 = reverse(minus(v87, v167)); + real2 v67 = timesminusplus(reverse(v57), load(tbl, 6 * VECWIDTH + tbloffset), times(v57, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v107 = timesminusplus(reverse(v97), load(tbl, 14 * VECWIDTH + tbloffset), times(v97, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v427 = reverse(minus(v107, v187)); + real2 v433 = plus(v107, v187); + real2 v432 = plus(v67, v147); + real2 v428 = minus(v147, v67); + real2 v453 = plus(v432, v433); + real2 v447 = reverse(minus(v432, v433)); + real2 v408 = minus(v127, v47); + real2 v412 = plus(v47, v127); + real2 v452 = plus(v412, v413); + real2 v448 = minus(v413, v412); + scatter(out, 1, 32, plus(v452, v453)); + real2 v466 = minus(v452, v453); + scatter(out, 17, 32, timesminusplus(v466, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v466), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v451 = minusplus(uminus(v447), v448); + scatter(out, 25, 32, timesminusplus(reverse(v451), load(tbl, 80 * VECWIDTH + tbloffset), times(v451, load(tbl, 81 * VECWIDTH + tbloffset)))); + real2 v449 = minusplus(v447, v448); + scatter(out, 9, 32, timesminusplus(reverse(v449), load(tbl, 78 * VECWIDTH + tbloffset), times(v449, load(tbl, 79 * VECWIDTH + tbloffset)))); + real2 v429 = minusplus(v427, v428); + real2 v431 = minusplus(uminus(v427), v428); + real2 v445 = timesminusplus(reverse(v431), load(tbl, 76 * VECWIDTH + tbloffset), times(v431, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v409 = minusplus(v407, v408); + real2 v411 = minusplus(uminus(v407), v408); + real2 v425 = timesminusplus(reverse(v411), load(tbl, 72 * VECWIDTH + tbloffset), times(v411, load(tbl, 73 * VECWIDTH + tbloffset))); + scatter(out, 13, 32, plus(v425, v445)); + real2 v478 = minus(v425, v445); + scatter(out, 29, 32, timesminusplus(v478, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v478), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v439 = timesminusplus(reverse(v429), load(tbl, 74 * VECWIDTH + tbloffset), times(v429, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v419 = timesminusplus(reverse(v409), load(tbl, 70 * VECWIDTH + tbloffset), times(v409, load(tbl, 71 * VECWIDTH + tbloffset))); + scatter(out, 5, 32, plus(v419, v439)); + real2 v472 = minus(v419, v439); + scatter(out, 21, 32, timesminusplus(v472, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v472), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} + +ALIGNED(8192) void tbut32b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + + real2 v14 = load(in, 12 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v115 = reverse(minus(v30, v14)); + real2 v121 = plus(v14, v30); + real2 v6 = load(in, 4 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v120 = plus(v6, v22); + real2 v116 = minus(v22, v6); + real2 v201 = plus(v120, v121); + real2 v195 = reverse(minus(v121, v120)); + real2 v119 = minusplus(uminus(v115), v116); + real2 v117 = minusplus(v115, v116); + real2 v133 = timesminusplus(reverse(v119), load(tbl, 20 * VECWIDTH + tbloffset), times(v119, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v127 = timesminusplus(reverse(v117), load(tbl, 18 * VECWIDTH + tbloffset), times(v117, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v18 = load(in, 16 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v40 = plus(v2, v18); + real2 v36 = minus(v18, v2); + real2 v10 = load(in, 8 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v41 = plus(v10, v26); + real2 v35 = reverse(minus(v26, v10)); + real2 v200 = plus(v40, v41); + real2 v196 = minus(v41, v40); + real2 v37 = minusplus(v35, v36); + real2 v39 = minusplus(uminus(v35), v36); + real2 v53 = timesminusplus(reverse(v39), load(tbl, 4 * VECWIDTH + tbloffset), times(v39, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v276 = minus(v201, v200); + real2 v280 = plus(v200, v201); + real2 v47 = timesminusplus(reverse(v37), load(tbl, 2 * VECWIDTH + tbloffset), times(v37, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v199 = minusplus(uminus(v195), v196); + real2 v197 = minusplus(v195, v196); + real2 v486 = minus(v133, v53); + real2 v490 = plus(v53, v133); + real2 v213 = timesminusplus(reverse(v199), load(tbl, 36 * VECWIDTH + tbloffset), times(v199, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v207 = timesminusplus(reverse(v197), load(tbl, 34 * VECWIDTH + tbloffset), times(v197, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v28 = load(in, 26 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v81 = plus(v12, v28); + real2 v75 = reverse(minus(v28, v12)); + real2 v20 = load(in, 18 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v80 = plus(v4, v20); + real2 v76 = minus(v20, v4); + real2 v236 = minus(v81, v80); + real2 v240 = plus(v80, v81); + real2 v77 = minusplus(v75, v76); + real2 v79 = minusplus(uminus(v75), v76); + real2 v93 = timesminusplus(reverse(v79), load(tbl, 12 * VECWIDTH + tbloffset), times(v79, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v32 = load(in, 30 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v155 = reverse(minus(v32, v16)); + real2 v161 = plus(v16, v32); + real2 v24 = load(in, 22 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v160 = plus(v8, v24); + real2 v156 = minus(v24, v8); + real2 v235 = reverse(minus(v161, v160)); + real2 v241 = plus(v160, v161); + real2 v157 = minusplus(v155, v156); + real2 v159 = minusplus(uminus(v155), v156); + real2 v173 = timesminusplus(reverse(v159), load(tbl, 28 * VECWIDTH + tbloffset), times(v159, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v485 = reverse(minus(v173, v93)); + real2 v491 = plus(v93, v173); + real2 v489 = minusplus(uminus(v485), v486); + real2 v487 = minusplus(v485, v486); + real2 v239 = minusplus(uminus(v235), v236); + real2 v237 = minusplus(v235, v236); + real2 v253 = timesminusplus(reverse(v239), load(tbl, 44 * VECWIDTH + tbloffset), times(v239, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v497 = timesminusplus(reverse(v487), load(tbl, 82 * VECWIDTH + tbloffset), times(v487, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v530 = plus(v490, v491); + real2 v526 = minus(v491, v490); + real2 v503 = timesminusplus(reverse(v489), load(tbl, 84 * VECWIDTH + tbloffset), times(v489, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v247 = timesminusplus(reverse(v237), load(tbl, 42 * VECWIDTH + tbloffset), times(v237, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v356 = minus(v247, v207); + real2 v360 = plus(v207, v247); + real2 v386 = plus(v213, v253); + real2 v382 = minus(v253, v213); + real2 v17 = load(in, 15 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v175 = reverse(minus(v33, v17)); + real2 v181 = plus(v17, v33); + real2 v25 = load(in, 23 << inShift); + real2 v9 = load(in, 7 << inShift); + real2 v176 = minus(v25, v9); + real2 v180 = plus(v9, v25); + real2 v177 = minusplus(v175, v176); + real2 v179 = minusplus(uminus(v175), v176); + real2 v193 = timesminusplus(reverse(v179), load(tbl, 32 * VECWIDTH + tbloffset), times(v179, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v261 = plus(v180, v181); + real2 v255 = reverse(minus(v181, v180)); + real2 v29 = load(in, 27 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v101 = plus(v13, v29); + real2 v95 = reverse(minus(v29, v13)); + real2 v21 = load(in, 19 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v100 = plus(v5, v21); + real2 v96 = minus(v21, v5); + real2 v99 = minusplus(uminus(v95), v96); + real2 v97 = minusplus(v95, v96); + real2 v260 = plus(v100, v101); + real2 v256 = minus(v101, v100); + real2 v259 = minusplus(uminus(v255), v256); + real2 v257 = minusplus(v255, v256); + real2 v273 = timesminusplus(reverse(v259), load(tbl, 48 * VECWIDTH + tbloffset), times(v259, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v267 = timesminusplus(reverse(v257), load(tbl, 46 * VECWIDTH + tbloffset), times(v257, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v3 = load(in, 1 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v60 = plus(v3, v19); + real2 v56 = minus(v19, v3); + real2 v27 = load(in, 25 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v55 = reverse(minus(v27, v11)); + real2 v61 = plus(v11, v27); + real2 v220 = plus(v60, v61); + real2 v216 = minus(v61, v60); + real2 v7 = load(in, 5 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v136 = minus(v23, v7); + real2 v140 = plus(v7, v23); + real2 v15 = load(in, 13 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v135 = reverse(minus(v31, v15)); + real2 v141 = plus(v15, v31); + real2 v215 = reverse(minus(v141, v140)); + real2 v221 = plus(v140, v141); + real2 v219 = minusplus(uminus(v215), v216); + real2 v217 = minusplus(v215, v216); + real2 v227 = timesminusplus(reverse(v217), load(tbl, 38 * VECWIDTH + tbloffset), times(v217, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v355 = reverse(minus(v267, v227)); + real2 v361 = plus(v227, v267); + scatter(out, 2, 32, plus(v360, v361)); + real2 v374 = minus(v360, v361); + scatter(out, 18, 32, timesminusplus(v374, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v374), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v357 = minusplus(v355, v356); + scatter(out, 10, 32, timesminusplus(reverse(v357), load(tbl, 62 * VECWIDTH + tbloffset), times(v357, load(tbl, 63 * VECWIDTH + tbloffset)))); + real2 v359 = minusplus(uminus(v355), v356); + scatter(out, 26, 32, timesminusplus(reverse(v359), load(tbl, 64 * VECWIDTH + tbloffset), times(v359, load(tbl, 65 * VECWIDTH + tbloffset)))); + real2 v233 = timesminusplus(reverse(v219), load(tbl, 40 * VECWIDTH + tbloffset), times(v219, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v381 = reverse(minus(v273, v233)); + real2 v387 = plus(v233, v273); + scatter(out, 6, 32, plus(v386, v387)); + real2 v400 = minus(v386, v387); + scatter(out, 22, 32, timesminusplus(v400, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v400), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v383 = minusplus(v381, v382); + real2 v385 = minusplus(uminus(v381), v382); + scatter(out, 30, 32, timesminusplus(reverse(v385), load(tbl, 68 * VECWIDTH + tbloffset), times(v385, load(tbl, 69 * VECWIDTH + tbloffset)))); + scatter(out, 14, 32, timesminusplus(reverse(v383), load(tbl, 66 * VECWIDTH + tbloffset), times(v383, load(tbl, 67 * VECWIDTH + tbloffset)))); + real2 v137 = minusplus(v135, v136); + real2 v139 = minusplus(uminus(v135), v136); + real2 v153 = timesminusplus(reverse(v139), load(tbl, 24 * VECWIDTH + tbloffset), times(v139, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v113 = timesminusplus(reverse(v99), load(tbl, 16 * VECWIDTH + tbloffset), times(v99, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v511 = plus(v113, v193); + real2 v505 = reverse(minus(v193, v113)); + real2 v57 = minusplus(v55, v56); + real2 v59 = minusplus(uminus(v55), v56); + real2 v73 = timesminusplus(reverse(v59), load(tbl, 8 * VECWIDTH + tbloffset), times(v59, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v510 = plus(v73, v153); + real2 v506 = minus(v153, v73); + real2 v531 = plus(v510, v511); + real2 v525 = reverse(minus(v511, v510)); + scatter(out, 3, 32, plus(v530, v531)); + real2 v544 = minus(v530, v531); + scatter(out, 19, 32, timesminusplus(v544, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v544), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v527 = minusplus(v525, v526); + scatter(out, 11, 32, timesminusplus(reverse(v527), load(tbl, 90 * VECWIDTH + tbloffset), times(v527, load(tbl, 91 * VECWIDTH + tbloffset)))); + real2 v529 = minusplus(uminus(v525), v526); + scatter(out, 27, 32, timesminusplus(reverse(v529), load(tbl, 92 * VECWIDTH + tbloffset), times(v529, load(tbl, 93 * VECWIDTH + tbloffset)))); + real2 v509 = minusplus(uminus(v505), v506); + real2 v507 = minusplus(v505, v506); + real2 v523 = timesminusplus(reverse(v509), load(tbl, 88 * VECWIDTH + tbloffset), times(v509, load(tbl, 89 * VECWIDTH + tbloffset))); + scatter(out, 15, 32, plus(v503, v523)); + real2 v556 = minus(v503, v523); + scatter(out, 31, 32, timesminusplus(v556, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v556), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v517 = timesminusplus(reverse(v507), load(tbl, 86 * VECWIDTH + tbloffset), times(v507, load(tbl, 87 * VECWIDTH + tbloffset))); + scatter(out, 7, 32, plus(v497, v517)); + real2 v550 = minus(v497, v517); + scatter(out, 23, 32, timesminusplus(v550, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v550), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v275 = reverse(minus(v241, v240)); + real2 v281 = plus(v240, v241); + real2 v320 = plus(v280, v281); + real2 v316 = minus(v281, v280); + real2 v301 = plus(v260, v261); + real2 v295 = reverse(minus(v261, v260)); + real2 v300 = plus(v220, v221); + real2 v296 = minus(v221, v220); + real2 v315 = reverse(minus(v301, v300)); + real2 v321 = plus(v300, v301); + scatter(out, 0, 32, plus(v320, v321)); + real2 v334 = minus(v320, v321); + scatter(out, 16, 32, timesminusplus(v334, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v334), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v319 = minusplus(uminus(v315), v316); + real2 v317 = minusplus(v315, v316); + scatter(out, 8, 32, timesminusplus(reverse(v317), load(tbl, 58 * VECWIDTH + tbloffset), times(v317, load(tbl, 59 * VECWIDTH + tbloffset)))); + scatter(out, 24, 32, timesminusplus(reverse(v319), load(tbl, 60 * VECWIDTH + tbloffset), times(v319, load(tbl, 61 * VECWIDTH + tbloffset)))); + real2 v299 = minusplus(uminus(v295), v296); + real2 v297 = minusplus(v295, v296); + real2 v279 = minusplus(uminus(v275), v276); + real2 v277 = minusplus(v275, v276); + real2 v287 = timesminusplus(reverse(v277), load(tbl, 50 * VECWIDTH + tbloffset), times(v277, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v307 = timesminusplus(reverse(v297), load(tbl, 54 * VECWIDTH + tbloffset), times(v297, load(tbl, 55 * VECWIDTH + tbloffset))); + scatter(out, 4, 32, plus(v287, v307)); + real2 v342 = minus(v287, v307); + scatter(out, 20, 32, timesminusplus(v342, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v342), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v313 = timesminusplus(reverse(v299), load(tbl, 56 * VECWIDTH + tbloffset), times(v299, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v293 = timesminusplus(reverse(v279), load(tbl, 52 * VECWIDTH + tbloffset), times(v279, load(tbl, 53 * VECWIDTH + tbloffset))); + scatter(out, 12, 32, plus(v293, v313)); + real2 v348 = minus(v293, v313); + scatter(out, 28, 32, timesminusplus(v348, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v348), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v87 = timesminusplus(reverse(v77), load(tbl, 10 * VECWIDTH + tbloffset), times(v77, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v147 = timesminusplus(reverse(v137), load(tbl, 22 * VECWIDTH + tbloffset), times(v137, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v187 = timesminusplus(reverse(v177), load(tbl, 30 * VECWIDTH + tbloffset), times(v177, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v167 = timesminusplus(reverse(v157), load(tbl, 26 * VECWIDTH + tbloffset), times(v157, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v413 = plus(v87, v167); + real2 v407 = reverse(minus(v167, v87)); + real2 v67 = timesminusplus(reverse(v57), load(tbl, 6 * VECWIDTH + tbloffset), times(v57, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v107 = timesminusplus(reverse(v97), load(tbl, 14 * VECWIDTH + tbloffset), times(v97, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v427 = reverse(minus(v187, v107)); + real2 v433 = plus(v107, v187); + real2 v432 = plus(v67, v147); + real2 v428 = minus(v147, v67); + real2 v453 = plus(v432, v433); + real2 v447 = reverse(minus(v433, v432)); + real2 v408 = minus(v127, v47); + real2 v412 = plus(v47, v127); + real2 v452 = plus(v412, v413); + real2 v448 = minus(v413, v412); + scatter(out, 1, 32, plus(v452, v453)); + real2 v466 = minus(v452, v453); + scatter(out, 17, 32, timesminusplus(v466, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v466), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v451 = minusplus(uminus(v447), v448); + scatter(out, 25, 32, timesminusplus(reverse(v451), load(tbl, 80 * VECWIDTH + tbloffset), times(v451, load(tbl, 81 * VECWIDTH + tbloffset)))); + real2 v449 = minusplus(v447, v448); + scatter(out, 9, 32, timesminusplus(reverse(v449), load(tbl, 78 * VECWIDTH + tbloffset), times(v449, load(tbl, 79 * VECWIDTH + tbloffset)))); + real2 v429 = minusplus(v427, v428); + real2 v431 = minusplus(uminus(v427), v428); + real2 v445 = timesminusplus(reverse(v431), load(tbl, 76 * VECWIDTH + tbloffset), times(v431, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v409 = minusplus(v407, v408); + real2 v411 = minusplus(uminus(v407), v408); + real2 v425 = timesminusplus(reverse(v411), load(tbl, 72 * VECWIDTH + tbloffset), times(v411, load(tbl, 73 * VECWIDTH + tbloffset))); + scatter(out, 13, 32, plus(v425, v445)); + real2 v478 = minus(v425, v445); + scatter(out, 29, 32, timesminusplus(v478, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v478), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v439 = timesminusplus(reverse(v429), load(tbl, 74 * VECWIDTH + tbloffset), times(v429, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v419 = timesminusplus(reverse(v409), load(tbl, 70 * VECWIDTH + tbloffset), times(v409, load(tbl, 71 * VECWIDTH + tbloffset))); + scatter(out, 5, 32, plus(v419, v439)); + real2 v472 = minus(v419, v439); + scatter(out, 21, 32, timesminusplus(v472, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v472), load(tbl, 1 * VECWIDTH + tbloffset)))); + } +} +#endif + +#if MAXBUTWIDTH >= 6 +ALIGNED(8192) void dft64f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + +// Pres : 27834 + real2 v13 = load(in, 11 << shift); + real2 v45 = load(in, 43 << shift); + real2 v268 = plus(v13, v45); + real2 v264 = minus(v45, v13); + real2 v61 = load(in, 59 << shift); + real2 v29 = load(in, 27 << shift); + real2 v269 = plus(v29, v61); + real2 v263 = reverse(minus(v29, v61)); + real2 v401 = reverse(minus(v268, v269)); + real2 v407 = plus(v268, v269); + real2 v267 = minusplus(uminus(v263), v264); + real2 v265 = minusplus(v263, v264); + real2 v279 = ctimesminusplus(reverse(v267), ctbl[28], ctimes(v267, ctbl[14])); + real2 v273 = ctimesminusplus(reverse(v265), ctbl[25], ctimes(v265, ctbl[19])); + real2 v5 = load(in, 3 << shift); + real2 v37 = load(in, 35 << shift); + real2 v124 = minus(v37, v5); + real2 v128 = plus(v5, v37); + real2 v21 = load(in, 19 << shift); + real2 v53 = load(in, 51 << shift); + real2 v129 = plus(v21, v53); + real2 v123 = reverse(minus(v21, v53)); + real2 v402 = minus(v129, v128); + real2 v406 = plus(v128, v129); + real2 v405 = minusplus(uminus(v401), v402); + real2 v403 = minusplus(v401, v402); + real2 v415 = ctimesminusplus(reverse(v405), ctbl[13], ctimes(v405, ctbl[12])); + real2 v411 = ctimesminusplus(reverse(v403), ctbl[11], ctimes(v403, ctbl[9])); + real2 v125 = minusplus(v123, v124); + real2 v127 = minusplus(uminus(v123), v124); + real2 v139 = ctimesminusplus(reverse(v127), ctbl[17], ctimes(v127, ctbl[27])); + real2 v534 = plus(v406, v407); + real2 v530 = minus(v407, v406); + real2 v962 = minus(v279, v139); + real2 v966 = plus(v139, v279); + real2 v133 = ctimesminusplus(reverse(v125), ctbl[23], ctimes(v125, ctbl[21])); + real2 v807 = plus(v133, v273); + real2 v803 = minus(v273, v133); + real2 v65 = load(in, 63 << shift); + real2 v33 = load(in, 31 << shift); + real2 v335 = reverse(minus(v33, v65)); + real2 v341 = plus(v33, v65); + real2 v49 = load(in, 47 << shift); + real2 v17 = load(in, 15 << shift); + real2 v340 = plus(v17, v49); + real2 v336 = minus(v49, v17); + real2 v471 = plus(v340, v341); + real2 v465 = reverse(minus(v340, v341)); + real2 v339 = minusplus(uminus(v335), v336); + real2 v337 = minusplus(v335, v336); + real2 v351 = ctimesminusplus(reverse(v339), ctbl[22], ctimes(v339, ctbl[20])); + real2 v345 = ctimesminusplus(reverse(v337), ctbl[29], ctimes(v337, ctbl[15])); + real2 v9 = load(in, 7 << shift); + real2 v41 = load(in, 39 << shift); + real2 v199 = plus(v9, v41); + real2 v195 = minus(v41, v9); + real2 v57 = load(in, 55 << shift); + real2 v25 = load(in, 23 << shift); + real2 v200 = plus(v25, v57); + real2 v194 = reverse(minus(v25, v57)); + real2 v466 = minus(v200, v199); + real2 v470 = plus(v199, v200); + real2 v535 = plus(v470, v471); + real2 v529 = reverse(minus(v470, v471)); + real2 v469 = minusplus(uminus(v465), v466); + real2 v467 = minusplus(v465, v466); + real2 v531 = minusplus(v529, v530); + real2 v533 = minusplus(uminus(v529), v530); + real2 v543 = ctimesminusplus(reverse(v533), ctbl[4], ctimes(v533, ctbl[2])); + real2 v539 = ctimesminusplus(reverse(v531), ctbl[5], ctimes(v531, ctbl[3])); + real2 v561 = reverse(minus(v534, v535)); + real2 v567 = plus(v534, v535); + real2 v479 = ctimesminusplus(reverse(v469), ctbl[10], ctimes(v469, ctbl[8])); + real2 v719 = plus(v415, v479); + real2 v713 = reverse(minus(v415, v479)); + real2 v475 = ctimesminusplus(reverse(v467), ctbl[13], ctimes(v467, ctbl[7])); + real2 v662 = plus(v411, v475); + real2 v656 = reverse(minus(v411, v475)); + real2 v196 = minusplus(v194, v195); + real2 v198 = minusplus(uminus(v194), v195); + real2 v209 = ctimesminusplus(reverse(v198), ctbl[25], ctimes(v198, ctbl[24])); + real2 v961 = reverse(minus(v209, v351)); + real2 v967 = plus(v209, v351); + real2 v963 = minusplus(v961, v962); + real2 v965 = minusplus(uminus(v961), v962); + real2 v975 = ctimesminusplus(reverse(v965), ctbl[4], ctimes(v965, ctbl[2])); + real2 v971 = ctimesminusplus(reverse(v963), ctbl[5], ctimes(v963, ctbl[3])); + real2 v999 = plus(v966, v967); + real2 v993 = reverse(minus(v966, v967)); + real2 v31 = load(in, 29 << shift); + real2 v63 = load(in, 61 << shift); + real2 v305 = plus(v31, v63); + real2 v299 = reverse(minus(v31, v63)); + real2 v47 = load(in, 45 << shift); + real2 v15 = load(in, 13 << shift); + real2 v300 = minus(v47, v15); + real2 v304 = plus(v15, v47); + real2 v439 = plus(v304, v305); + real2 v433 = reverse(minus(v304, v305)); + real2 v301 = minusplus(v299, v300); + real2 v303 = minusplus(uminus(v299), v300); + real2 v315 = ctimesminusplus(reverse(v303), ctbl[16], ctimes(v303, ctbl[26])); + real2 v7 = load(in, 5 << shift); + real2 v39 = load(in, 37 << shift); + real2 v164 = plus(v7, v39); + real2 v160 = minus(v39, v7); + real2 v23 = load(in, 21 << shift); + real2 v55 = load(in, 53 << shift); + real2 v159 = reverse(minus(v23, v55)); + real2 v165 = plus(v23, v55); + real2 v438 = plus(v164, v165); + real2 v434 = minus(v165, v164); + real2 v163 = minusplus(uminus(v159), v160); + real2 v161 = minusplus(v159, v160); + real2 v175 = ctimesminusplus(reverse(v163), ctbl[29], ctimes(v163, ctbl[15])); + real2 v929 = reverse(minus(v175, v315)); + real2 v935 = plus(v175, v315); + real2 v435 = minusplus(v433, v434); + real2 v437 = minusplus(uminus(v433), v434); + real2 v443 = ctimesminusplus(reverse(v435), ctbl[9], ctimes(v435, ctbl[11])); + real2 v497 = reverse(minus(v438, v439)); + real2 v503 = plus(v438, v439); + real2 v447 = ctimesminusplus(reverse(v437), ctbl[7], ctimes(v437, ctbl[6])); + real2 v11 = load(in, 9 << shift); + real2 v43 = load(in, 41 << shift); + real2 v234 = plus(v11, v43); + real2 v230 = minus(v43, v11); + real2 v27 = load(in, 25 << shift); + real2 v59 = load(in, 57 << shift); + real2 v235 = plus(v27, v59); + real2 v229 = reverse(minus(v27, v59)); + real2 v375 = plus(v234, v235); + real2 v369 = reverse(minus(v234, v235)); + real2 v233 = minusplus(uminus(v229), v230); + real2 v231 = minusplus(v229, v230); + real2 v244 = ctimesminusplus(reverse(v233), ctbl[19], ctimes(v233, ctbl[18])); + real2 v19 = load(in, 17 << shift); + real2 v51 = load(in, 49 << shift); + real2 v89 = plus(v19, v51); + real2 v83 = reverse(minus(v19, v51)); + real2 v3 = load(in, 1 << shift); + real2 v35 = load(in, 33 << shift); + real2 v88 = plus(v3, v35); + real2 v84 = minus(v35, v3); + real2 v370 = minus(v89, v88); + real2 v374 = plus(v88, v89); + real2 v371 = minusplus(v369, v370); + real2 v373 = minusplus(uminus(v369), v370); + real2 v383 = ctimesminusplus(reverse(v373), ctbl[11], ctimes(v373, ctbl[9])); + real2 v714 = minus(v447, v383); + real2 v718 = plus(v383, v447); + real2 v502 = plus(v374, v375); + real2 v498 = minus(v375, v374); + real2 v379 = ctimesminusplus(reverse(v371), ctbl[7], ctimes(v371, ctbl[13])); + real2 v657 = minus(v443, v379); + real2 v661 = plus(v379, v443); + real2 v715 = minusplus(v713, v714); + real2 v717 = minusplus(uminus(v713), v714); + real2 v566 = plus(v502, v503); + real2 v562 = minus(v503, v502); + real2 v499 = minusplus(v497, v498); + real2 v501 = minusplus(uminus(v497), v498); + real2 v511 = ctimesminusplus(reverse(v501), ctbl[5], ctimes(v501, ctbl[3])); + real2 v621 = reverse(minus(v511, v543)); + real2 v627 = plus(v511, v543); + real2 v583 = plus(v566, v567); + real2 v577 = reverse(minus(v566, v567)); + real2 v727 = ctimesminusplus(reverse(v717), ctbl[1], ctimes(v717, ctbl[0])); + real2 v723 = ctimesminusplus(reverse(v715), ctbl[1], ctimes(v715, ctbl[1])); + real2 v507 = ctimesminusplus(reverse(v499), ctbl[3], ctimes(v499, ctbl[5])); + real2 v735 = plus(v718, v719); + real2 v729 = reverse(minus(v718, v719)); + real2 v565 = minusplus(uminus(v561), v562); + real2 v563 = minusplus(v561, v562); + real2 v571 = ctimesminusplus(reverse(v563), ctbl[1], ctimes(v563, ctbl[1])); + real2 v602 = reverse(minus(v507, v539)); + real2 v608 = plus(v507, v539); + real2 v660 = minusplus(uminus(v656), v657); + real2 v658 = minusplus(v656, v657); + real2 v670 = ctimesminusplus(reverse(v660), ctbl[1], ctimes(v660, ctbl[0])); + real2 v666 = ctimesminusplus(reverse(v658), ctbl[1], ctimes(v658, ctbl[1])); + real2 v678 = plus(v661, v662); + real2 v672 = reverse(minus(v661, v662)); + real2 v575 = ctimesminusplus(reverse(v565), ctbl[1], ctimes(v565, ctbl[0])); + real2 v28 = load(in, 26 << shift); + real2 v60 = load(in, 58 << shift); + real2 v252 = plus(v28, v60); + real2 v246 = reverse(minus(v28, v60)); + real2 v44 = load(in, 42 << shift); + real2 v12 = load(in, 10 << shift); + real2 v251 = plus(v12, v44); + real2 v247 = minus(v44, v12); + real2 v391 = plus(v251, v252); + real2 v385 = reverse(minus(v251, v252)); + real2 v20 = load(in, 18 << shift); + real2 v52 = load(in, 50 << shift); + real2 v109 = plus(v20, v52); + real2 v103 = reverse(minus(v20, v52)); + real2 v36 = load(in, 34 << shift); + real2 v4 = load(in, 2 << shift); + real2 v108 = plus(v4, v36); + real2 v104 = minus(v36, v4); + real2 v386 = minus(v109, v108); + real2 v390 = plus(v108, v109); + real2 v514 = minus(v391, v390); + real2 v518 = plus(v390, v391); + real2 v389 = minusplus(uminus(v385), v386); + real2 v387 = minusplus(v385, v386); + real2 v399 = ctimesminusplus(reverse(v389), ctbl[5], ctimes(v389, ctbl[3])); + real2 v8 = load(in, 6 << shift); + real2 v40 = load(in, 38 << shift); + real2 v178 = minus(v40, v8); + real2 v182 = plus(v8, v40); + real2 v24 = load(in, 22 << shift); + real2 v56 = load(in, 54 << shift); + real2 v183 = plus(v24, v56); + real2 v177 = reverse(minus(v24, v56)); + real2 v450 = minus(v183, v182); + real2 v454 = plus(v182, v183); + real2 v16 = load(in, 14 << shift); + real2 v48 = load(in, 46 << shift); + real2 v322 = plus(v16, v48); + real2 v318 = minus(v48, v16); + real2 v32 = load(in, 30 << shift); + real2 v64 = load(in, 62 << shift); + real2 v323 = plus(v32, v64); + real2 v317 = reverse(minus(v32, v64)); + real2 v449 = reverse(minus(v322, v323)); + real2 v455 = plus(v322, v323); + real2 v519 = plus(v454, v455); + real2 v513 = reverse(minus(v454, v455)); + real2 v545 = reverse(minus(v518, v519)); + real2 v551 = plus(v518, v519); + real2 v515 = minusplus(v513, v514); + real2 v517 = minusplus(uminus(v513), v514); + real2 v527 = ctimesminusplus(reverse(v517), ctbl[1], ctimes(v517, ctbl[0])); + real2 v523 = ctimesminusplus(reverse(v515), ctbl[1], ctimes(v515, ctbl[1])); + real2 v14 = load(in, 12 << shift); + real2 v46 = load(in, 44 << shift); + real2 v286 = plus(v14, v46); + real2 v282 = minus(v46, v14); + real2 v62 = load(in, 60 << shift); + real2 v30 = load(in, 28 << shift); + real2 v281 = reverse(minus(v30, v62)); + real2 v287 = plus(v30, v62); + real2 v423 = plus(v286, v287); + real2 v417 = reverse(minus(v286, v287)); + real2 v22 = load(in, 20 << shift); + real2 v54 = load(in, 52 << shift); + real2 v147 = plus(v22, v54); + real2 v141 = reverse(minus(v22, v54)); + real2 v38 = load(in, 36 << shift); + real2 v6 = load(in, 4 << shift); + real2 v146 = plus(v6, v38); + real2 v142 = minus(v38, v6); + real2 v422 = plus(v146, v147); + real2 v418 = minus(v147, v146); + real2 v487 = plus(v422, v423); + real2 v481 = reverse(minus(v422, v423)); + real2 v42 = load(in, 40 << shift); + real2 v10 = load(in, 8 << shift); + real2 v212 = minus(v42, v10); + real2 v216 = plus(v10, v42); + real2 v58 = load(in, 56 << shift); + real2 v26 = load(in, 24 << shift); + real2 v217 = plus(v26, v58); + real2 v211 = reverse(minus(v26, v58)); + real2 v353 = reverse(minus(v216, v217)); + real2 v359 = plus(v216, v217); + real2 v18 = load(in, 16 << shift); + real2 v50 = load(in, 48 << shift); + real2 v73 = plus(v18, v50); + real2 v67 = reverse(minus(v18, v50)); + real2 v2 = load(in, 0 << shift); + real2 v34 = load(in, 32 << shift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v358 = plus(v72, v73); + real2 v354 = minus(v73, v72); + real2 v486 = plus(v358, v359); + real2 v482 = minus(v359, v358); + real2 v491 = minus(uplusminus(v481), v482); + real2 v495 = minus(uminusplus(v481), v482); + real2 v603 = minus(v523, v491); + real2 v607 = plus(v491, v523); + store(out, 4 << shift, plus(v607, v608)); + store(out, 36 << shift, minus(v607, v608)); + store(out, 52 << shift, minus(uminusplus(v602), v603)); + store(out, 20 << shift, minus(uplusminus(v602), v603)); + real2 v622 = minus(v527, v495); + real2 v626 = plus(v495, v527); + store(out, 60 << shift, minus(uminusplus(v621), v622)); + store(out, 28 << shift, minus(uplusminus(v621), v622)); + store(out, 12 << shift, plus(v626, v627)); + store(out, 44 << shift, minus(v626, v627)); + real2 v550 = plus(v486, v487); + real2 v546 = minus(v487, v486); + real2 v559 = minus(uminusplus(v545), v546); + real2 v555 = minus(uplusminus(v545), v546); + store(out, 8 << shift, plus(v555, v571)); + store(out, 40 << shift, minus(v555, v571)); + store(out, 24 << shift, plus(v559, v575)); + store(out, 56 << shift, minus(v559, v575)); + real2 v578 = minus(v551, v550); + store(out, 48 << shift, minus(uminusplus(v577), v578)); + store(out, 16 << shift, minus(uplusminus(v577), v578)); + real2 v582 = plus(v550, v551); + store(out, 0 << shift, plus(v582, v583)); + store(out, 32 << shift, minus(v582, v583)); + real2 v453 = minusplus(uminus(v449), v450); + real2 v451 = minusplus(v449, v450); + real2 v419 = minusplus(v417, v418); + real2 v421 = minusplus(uminus(v417), v418); + real2 v431 = ctimesminusplus(reverse(v421), ctbl[1], ctimes(v421, ctbl[0])); + real2 v463 = ctimesminusplus(reverse(v453), ctbl[4], ctimes(v453, ctbl[2])); + real2 v703 = plus(v399, v463); + real2 v697 = reverse(minus(v399, v463)); + real2 v367 = minus(uminusplus(v353), v354); + real2 v363 = minus(uplusminus(v353), v354); + real2 v702 = plus(v367, v431); + real2 v698 = minus(v431, v367); + real2 v730 = minus(v703, v702); + store(out, 54 << shift, minus(uminusplus(v729), v730)); + store(out, 22 << shift, minus(uplusminus(v729), v730)); + real2 v734 = plus(v702, v703); + store(out, 6 << shift, plus(v734, v735)); + store(out, 38 << shift, minus(v734, v735)); + real2 v707 = minus(uplusminus(v697), v698); + real2 v711 = minus(uminusplus(v697), v698); + store(out, 30 << shift, plus(v711, v727)); + store(out, 62 << shift, minus(v711, v727)); + store(out, 14 << shift, plus(v707, v723)); + store(out, 46 << shift, minus(v707, v723)); + real2 v395 = ctimesminusplus(reverse(v387), ctbl[3], ctimes(v387, ctbl[5])); + real2 v459 = ctimesminusplus(reverse(v451), ctbl[5], ctimes(v451, ctbl[3])); + real2 v640 = reverse(minus(v395, v459)); + real2 v646 = plus(v395, v459); + real2 v427 = ctimesminusplus(reverse(v419), ctbl[1], ctimes(v419, ctbl[1])); + real2 v641 = minus(v427, v363); + real2 v645 = plus(v363, v427); + real2 v654 = minus(uminusplus(v640), v641); + real2 v650 = minus(uplusminus(v640), v641); + store(out, 10 << shift, plus(v650, v666)); + store(out, 42 << shift, minus(v650, v666)); + store(out, 58 << shift, minus(v654, v670)); + store(out, 26 << shift, plus(v654, v670)); + real2 v673 = minus(v646, v645); + store(out, 50 << shift, minus(uminusplus(v672), v673)); + store(out, 18 << shift, minus(uplusminus(v672), v673)); + real2 v677 = plus(v645, v646); + store(out, 2 << shift, plus(v677, v678)); + store(out, 34 << shift, minus(v677, v678)); + real2 v250 = minusplus(uminus(v246), v247); + real2 v248 = minusplus(v246, v247); + real2 v261 = ctimesminusplus(reverse(v250), ctbl[7], ctimes(v250, ctbl[6])); + real2 v145 = minusplus(uminus(v141), v142); + real2 v143 = minusplus(v141, v142); + real2 v283 = minusplus(v281, v282); + real2 v285 = minusplus(uminus(v281), v282); + real2 v297 = ctimesminusplus(reverse(v285), ctbl[4], ctimes(v285, ctbl[2])); + real2 v157 = ctimesminusplus(reverse(v145), ctbl[5], ctimes(v145, ctbl[3])); + real2 v919 = plus(v157, v297); + real2 v913 = reverse(minus(v157, v297)); + real2 v213 = minusplus(v211, v212); + real2 v215 = minusplus(uminus(v211), v212); + real2 v227 = ctimesminusplus(reverse(v215), ctbl[1], ctimes(v215, ctbl[0])); + real2 v81 = minus(uminusplus(v67), v68); + real2 v77 = minus(uplusminus(v67), v68); + real2 v85 = minusplus(v83, v84); + real2 v87 = minusplus(uminus(v83), v84); + real2 v101 = ctimesminusplus(reverse(v87), ctbl[23], ctimes(v87, ctbl[21])); + real2 v934 = plus(v101, v244); + real2 v930 = minus(v244, v101); + real2 v179 = minusplus(v177, v178); + real2 v181 = minusplus(uminus(v177), v178); + real2 v192 = ctimesminusplus(reverse(v181), ctbl[13], ctimes(v181, ctbl[12])); + real2 v918 = plus(v81, v227); + real2 v914 = minus(v227, v81); + real2 v105 = minusplus(v103, v104); + real2 v107 = minusplus(uminus(v103), v104); + real2 v121 = ctimesminusplus(reverse(v107), ctbl[11], ctimes(v107, ctbl[9])); + real2 v946 = minus(v261, v121); + real2 v950 = plus(v121, v261); + real2 v994 = minus(v935, v934); + real2 v998 = plus(v934, v935); + real2 v1009 = reverse(minus(v998, v999)); + real2 v1015 = plus(v998, v999); + real2 v982 = plus(v918, v919); + real2 v978 = minus(v919, v918); + real2 v321 = minusplus(uminus(v317), v318); + real2 v319 = minusplus(v317, v318); + real2 v333 = ctimesminusplus(reverse(v321), ctbl[10], ctimes(v321, ctbl[8])); + real2 v951 = plus(v192, v333); + real2 v945 = reverse(minus(v192, v333)); + real2 v983 = plus(v950, v951); + real2 v977 = reverse(minus(v950, v951)); + real2 v1014 = plus(v982, v983); + real2 v1010 = minus(v983, v982); + store(out, 3 << shift, plus(v1014, v1015)); + store(out, 35 << shift, minus(v1014, v1015)); + store(out, 51 << shift, minus(uminusplus(v1009), v1010)); + store(out, 19 << shift, minus(uplusminus(v1009), v1010)); + real2 v997 = minusplus(uminus(v993), v994); + real2 v995 = minusplus(v993, v994); + real2 v1003 = ctimesminusplus(reverse(v995), ctbl[1], ctimes(v995, ctbl[1])); + real2 v987 = minus(uplusminus(v977), v978); + store(out, 43 << shift, minus(v987, v1003)); + store(out, 11 << shift, plus(v987, v1003)); + real2 v991 = minus(uminusplus(v977), v978); + real2 v1007 = ctimesminusplus(reverse(v997), ctbl[1], ctimes(v997, ctbl[0])); + store(out, 27 << shift, plus(v991, v1007)); + store(out, 59 << shift, minus(v991, v1007)); + real2 v947 = minusplus(v945, v946); + real2 v949 = minusplus(uminus(v945), v946); + real2 v931 = minusplus(v929, v930); + real2 v933 = minusplus(uminus(v929), v930); + real2 v939 = ctimesminusplus(reverse(v931), ctbl[3], ctimes(v931, ctbl[5])); + real2 v1034 = reverse(minus(v939, v971)); + real2 v1040 = plus(v939, v971); + real2 v927 = minus(uminusplus(v913), v914); + real2 v923 = minus(uplusminus(v913), v914); + real2 v955 = ctimesminusplus(reverse(v947), ctbl[1], ctimes(v947, ctbl[1])); + real2 v1035 = minus(v955, v923); + real2 v1039 = plus(v923, v955); + store(out, 39 << shift, minus(v1039, v1040)); + store(out, 7 << shift, plus(v1039, v1040)); + store(out, 23 << shift, minus(uplusminus(v1034), v1035)); + store(out, 55 << shift, minus(uminusplus(v1034), v1035)); + real2 v959 = ctimesminusplus(reverse(v949), ctbl[1], ctimes(v949, ctbl[0])); + real2 v943 = ctimesminusplus(reverse(v933), ctbl[5], ctimes(v933, ctbl[3])); + real2 v1053 = reverse(minus(v943, v975)); + real2 v1059 = plus(v943, v975); + real2 v1058 = plus(v927, v959); + real2 v1054 = minus(v959, v927); + store(out, 63 << shift, minus(uminusplus(v1053), v1054)); + store(out, 31 << shift, minus(uplusminus(v1053), v1054)); + store(out, 47 << shift, minus(v1058, v1059)); + store(out, 15 << shift, plus(v1058, v1059)); + real2 v309 = ctimesminusplus(reverse(v301), ctbl[21], ctimes(v301, ctbl[23])); + real2 v171 = ctimesminusplus(reverse(v161), ctbl[19], ctimes(v161, ctbl[25])); + real2 v776 = plus(v171, v309); + real2 v770 = reverse(minus(v171, v309)); + real2 v256 = ctimesminusplus(reverse(v248), ctbl[9], ctimes(v248, ctbl[11])); + real2 v222 = ctimesminusplus(reverse(v213), ctbl[1], ctimes(v213, ctbl[1])); + real2 v239 = ctimesminusplus(reverse(v231), ctbl[17], ctimes(v231, ctbl[27])); + real2 v204 = ctimesminusplus(reverse(v196), ctbl[27], ctimes(v196, ctbl[17])); + real2 v291 = ctimesminusplus(reverse(v283), ctbl[5], ctimes(v283, ctbl[3])); + real2 v153 = ctimesminusplus(reverse(v143), ctbl[3], ctimes(v143, ctbl[5])); + real2 v760 = plus(v153, v291); + real2 v754 = reverse(minus(v153, v291)); + real2 v187 = ctimesminusplus(reverse(v179), ctbl[11], ctimes(v179, ctbl[9])); + real2 v95 = ctimesminusplus(reverse(v85), ctbl[15], ctimes(v85, ctbl[29])); + real2 v771 = minus(v239, v95); + real2 v775 = plus(v95, v239); + real2 v839 = plus(v775, v776); + real2 v835 = minus(v776, v775); + real2 v115 = ctimesminusplus(reverse(v105), ctbl[7], ctimes(v105, ctbl[13])); + real2 v791 = plus(v115, v256); + real2 v787 = minus(v256, v115); + real2 v327 = ctimesminusplus(reverse(v319), ctbl[13], ctimes(v319, ctbl[7])); + real2 v792 = plus(v187, v327); + real2 v786 = reverse(minus(v187, v327)); + real2 v824 = plus(v791, v792); + real2 v818 = reverse(minus(v791, v792)); + real2 v808 = plus(v204, v345); + real2 v802 = reverse(minus(v204, v345)); + real2 v840 = plus(v807, v808); + real2 v834 = reverse(minus(v807, v808)); + real2 v850 = reverse(minus(v839, v840)); + real2 v856 = plus(v839, v840); + real2 v759 = plus(v77, v222); + real2 v755 = minus(v222, v77); + real2 v823 = plus(v759, v760); + real2 v819 = minus(v760, v759); + real2 v855 = plus(v823, v824); + store(out, 33 << shift, minus(v855, v856)); + store(out, 1 << shift, plus(v855, v856)); + real2 v851 = minus(v824, v823); + store(out, 49 << shift, minus(uminusplus(v850), v851)); + store(out, 17 << shift, minus(uplusminus(v850), v851)); + real2 v836 = minusplus(v834, v835); + real2 v838 = minusplus(uminus(v834), v835); + real2 v844 = ctimesminusplus(reverse(v836), ctbl[1], ctimes(v836, ctbl[1])); + real2 v828 = minus(uplusminus(v818), v819); + store(out, 41 << shift, minus(v828, v844)); + store(out, 9 << shift, plus(v828, v844)); + real2 v832 = minus(uminusplus(v818), v819); + real2 v848 = ctimesminusplus(reverse(v838), ctbl[1], ctimes(v838, ctbl[0])); + store(out, 25 << shift, plus(v832, v848)); + store(out, 57 << shift, minus(v832, v848)); + real2 v774 = minusplus(uminus(v770), v771); + real2 v772 = minusplus(v770, v771); + real2 v790 = minusplus(uminus(v786), v787); + real2 v788 = minusplus(v786, v787); + real2 v796 = ctimesminusplus(reverse(v788), ctbl[1], ctimes(v788, ctbl[1])); + real2 v780 = ctimesminusplus(reverse(v772), ctbl[3], ctimes(v772, ctbl[5])); + real2 v764 = minus(uplusminus(v754), v755); + real2 v768 = minus(uminusplus(v754), v755); + real2 v876 = minus(v796, v764); + real2 v880 = plus(v764, v796); + real2 v806 = minusplus(uminus(v802), v803); + real2 v804 = minusplus(v802, v803); + real2 v812 = ctimesminusplus(reverse(v804), ctbl[5], ctimes(v804, ctbl[3])); + real2 v881 = plus(v780, v812); + real2 v875 = reverse(minus(v780, v812)); + store(out, 21 << shift, minus(uplusminus(v875), v876)); + store(out, 53 << shift, minus(uminusplus(v875), v876)); + store(out, 5 << shift, plus(v880, v881)); + store(out, 37 << shift, minus(v880, v881)); + real2 v800 = ctimesminusplus(reverse(v790), ctbl[1], ctimes(v790, ctbl[0])); + real2 v784 = ctimesminusplus(reverse(v774), ctbl[5], ctimes(v774, ctbl[3])); + real2 v816 = ctimesminusplus(reverse(v806), ctbl[4], ctimes(v806, ctbl[2])); + real2 v900 = plus(v784, v816); + real2 v894 = reverse(minus(v784, v816)); + real2 v899 = plus(v768, v800); + store(out, 45 << shift, minus(v899, v900)); + store(out, 13 << shift, plus(v899, v900)); + real2 v895 = minus(v800, v768); + store(out, 61 << shift, minus(uminusplus(v894), v895)); + store(out, 29 << shift, minus(uplusminus(v894), v895)); +// Pres : 15312 + } +} + +ALIGNED(8192) void dft64b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + +// Pres : 27598 + real2 v27 = load(in, 25 << shift); + real2 v59 = load(in, 57 << shift); + real2 v241 = plus(v27, v59); + real2 v235 = reverse(minus(v59, v27)); + real2 v43 = load(in, 41 << shift); + real2 v11 = load(in, 9 << shift); + real2 v236 = minus(v43, v11); + real2 v240 = plus(v11, v43); + real2 v375 = plus(v240, v241); + real2 v369 = reverse(minus(v241, v240)); + real2 v237 = minusplus(v235, v236); + real2 v239 = minusplus(uminus(v235), v236); + real2 v249 = ctimesminusplus(reverse(v239), ctbl[24], ctimes(v239, ctbl[18])); + real2 v245 = ctimesminusplus(reverse(v237), ctbl[26], ctimes(v237, ctbl[27])); + real2 v3 = load(in, 1 << shift); + real2 v35 = load(in, 33 << shift); + real2 v84 = minus(v35, v3); + real2 v88 = plus(v3, v35); + real2 v51 = load(in, 49 << shift); + real2 v19 = load(in, 17 << shift); + real2 v83 = reverse(minus(v51, v19)); + real2 v89 = plus(v19, v51); + real2 v370 = minus(v89, v88); + real2 v374 = plus(v88, v89); + real2 v85 = minusplus(v83, v84); + real2 v87 = minusplus(uminus(v83), v84); + real2 v101 = ctimesminusplus(reverse(v87), ctbl[20], ctimes(v87, ctbl[21])); + real2 v498 = minus(v375, v374); + real2 v502 = plus(v374, v375); + real2 v934 = plus(v101, v249); + real2 v930 = minus(v249, v101); + real2 v373 = minusplus(uminus(v369), v370); + real2 v371 = minusplus(v369, v370); + real2 v379 = ctimesminusplus(reverse(v371), ctbl[12], ctimes(v371, ctbl[13])); + real2 v383 = ctimesminusplus(reverse(v373), ctbl[8], ctimes(v373, ctbl[9])); + real2 v95 = ctimesminusplus(reverse(v85), ctbl[28], ctimes(v85, ctbl[29])); + real2 v771 = minus(v245, v95); + real2 v775 = plus(v95, v245); + real2 v7 = load(in, 5 << shift); + real2 v39 = load(in, 37 << shift); + real2 v166 = plus(v7, v39); + real2 v162 = minus(v39, v7); + real2 v23 = load(in, 21 << shift); + real2 v55 = load(in, 53 << shift); + real2 v161 = reverse(minus(v55, v23)); + real2 v167 = plus(v23, v55); + real2 v163 = minusplus(v161, v162); + real2 v165 = minusplus(uminus(v161), v162); + real2 v434 = minus(v167, v166); + real2 v438 = plus(v166, v167); + real2 v179 = ctimesminusplus(reverse(v165), ctbl[14], ctimes(v165, ctbl[15])); + real2 v173 = ctimesminusplus(reverse(v163), ctbl[24], ctimes(v163, ctbl[25])); + real2 v15 = load(in, 13 << shift); + real2 v47 = load(in, 45 << shift); + real2 v307 = plus(v15, v47); + real2 v303 = minus(v47, v15); + real2 v63 = load(in, 61 << shift); + real2 v31 = load(in, 29 << shift); + real2 v308 = plus(v31, v63); + real2 v302 = reverse(minus(v63, v31)); + real2 v439 = plus(v307, v308); + real2 v433 = reverse(minus(v308, v307)); + real2 v437 = minusplus(uminus(v433), v434); + real2 v435 = minusplus(v433, v434); + real2 v443 = ctimesminusplus(reverse(v435), ctbl[10], ctimes(v435, ctbl[11])); + real2 v497 = reverse(minus(v439, v438)); + real2 v503 = plus(v438, v439); + real2 v562 = minus(v503, v502); + real2 v566 = plus(v502, v503); + real2 v499 = minusplus(v497, v498); + real2 v501 = minusplus(uminus(v497), v498); + real2 v511 = ctimesminusplus(reverse(v501), ctbl[2], ctimes(v501, ctbl[3])); + real2 v447 = ctimesminusplus(reverse(v437), ctbl[12], ctimes(v437, ctbl[6])); + real2 v507 = ctimesminusplus(reverse(v499), ctbl[4], ctimes(v499, ctbl[5])); + real2 v718 = plus(v383, v447); + real2 v714 = minus(v447, v383); + real2 v306 = minusplus(uminus(v302), v303); + real2 v304 = minusplus(v302, v303); + real2 v318 = ctimesminusplus(reverse(v306), ctbl[27], ctimes(v306, ctbl[26])); + real2 v929 = reverse(minus(v318, v179)); + real2 v935 = plus(v179, v318); + real2 v931 = minusplus(v929, v930); + real2 v933 = minusplus(uminus(v929), v930); + real2 v998 = plus(v934, v935); + real2 v994 = minus(v935, v934); + real2 v661 = plus(v379, v443); + real2 v657 = minus(v443, v379); + real2 v939 = ctimesminusplus(reverse(v931), ctbl[4], ctimes(v931, ctbl[5])); + real2 v943 = ctimesminusplus(reverse(v933), ctbl[2], ctimes(v933, ctbl[3])); + real2 v45 = load(in, 43 << shift); + real2 v13 = load(in, 11 << shift); + real2 v274 = plus(v13, v45); + real2 v270 = minus(v45, v13); + real2 v29 = load(in, 27 << shift); + real2 v61 = load(in, 59 << shift); + real2 v269 = reverse(minus(v61, v29)); + real2 v275 = plus(v29, v61); + real2 v273 = minusplus(uminus(v269), v270); + real2 v271 = minusplus(v269, v270); + real2 v407 = plus(v274, v275); + real2 v401 = reverse(minus(v275, v274)); + real2 v284 = ctimesminusplus(reverse(v273), ctbl[15], ctimes(v273, ctbl[14])); + real2 v5 = load(in, 3 << shift); + real2 v37 = load(in, 35 << shift); + real2 v128 = plus(v5, v37); + real2 v124 = minus(v37, v5); + real2 v53 = load(in, 51 << shift); + real2 v21 = load(in, 19 << shift); + real2 v129 = plus(v21, v53); + real2 v123 = reverse(minus(v53, v21)); + real2 v406 = plus(v128, v129); + real2 v402 = minus(v129, v128); + real2 v405 = minusplus(uminus(v401), v402); + real2 v403 = minusplus(v401, v402); + real2 v415 = ctimesminusplus(reverse(v405), ctbl[6], ctimes(v405, ctbl[12])); + real2 v411 = ctimesminusplus(reverse(v403), ctbl[8], ctimes(v403, ctbl[9])); + real2 v127 = minusplus(uminus(v123), v124); + real2 v125 = minusplus(v123, v124); + real2 v530 = minus(v407, v406); + real2 v534 = plus(v406, v407); + real2 v139 = ctimesminusplus(reverse(v127), ctbl[26], ctimes(v127, ctbl[27])); + real2 v962 = minus(v284, v139); + real2 v966 = plus(v139, v284); + real2 v57 = load(in, 55 << shift); + real2 v25 = load(in, 23 << shift); + real2 v204 = plus(v25, v57); + real2 v198 = reverse(minus(v57, v25)); + real2 v9 = load(in, 7 << shift); + real2 v41 = load(in, 39 << shift); + real2 v199 = minus(v41, v9); + real2 v203 = plus(v9, v41); + real2 v202 = minusplus(uminus(v198), v199); + real2 v200 = minusplus(v198, v199); + real2 v470 = plus(v203, v204); + real2 v466 = minus(v204, v203); + real2 v215 = ctimesminusplus(reverse(v202), ctbl[18], ctimes(v202, ctbl[24])); + real2 v17 = load(in, 15 << shift); + real2 v49 = load(in, 47 << shift); + real2 v338 = minus(v49, v17); + real2 v342 = plus(v17, v49); + real2 v33 = load(in, 31 << shift); + real2 v65 = load(in, 63 << shift); + real2 v337 = reverse(minus(v65, v33)); + real2 v343 = plus(v33, v65); + real2 v341 = minusplus(uminus(v337), v338); + real2 v339 = minusplus(v337, v338); + real2 v351 = ctimesminusplus(reverse(v341), ctbl[21], ctimes(v341, ctbl[20])); + real2 v961 = reverse(minus(v351, v215)); + real2 v967 = plus(v215, v351); + real2 v465 = reverse(minus(v343, v342)); + real2 v471 = plus(v342, v343); + real2 v467 = minusplus(v465, v466); + real2 v469 = minusplus(uminus(v465), v466); + real2 v475 = ctimesminusplus(reverse(v467), ctbl[6], ctimes(v467, ctbl[7])); + real2 v662 = plus(v411, v475); + real2 v656 = reverse(minus(v475, v411)); + real2 v529 = reverse(minus(v471, v470)); + real2 v535 = plus(v470, v471); + real2 v531 = minusplus(v529, v530); + real2 v533 = minusplus(uminus(v529), v530); + real2 v543 = ctimesminusplus(reverse(v533), ctbl[3], ctimes(v533, ctbl[2])); + real2 v561 = reverse(minus(v535, v534)); + real2 v567 = plus(v534, v535); + real2 v565 = minusplus(uminus(v561), v562); + real2 v563 = minusplus(v561, v562); + real2 v571 = ctimesminusplus(reverse(v563), ctbl[0], ctimes(v563, ctbl[1])); + real2 v583 = plus(v566, v567); + real2 v577 = reverse(minus(v567, v566)); + real2 v539 = ctimesminusplus(reverse(v531), ctbl[2], ctimes(v531, ctbl[3])); + real2 v602 = reverse(minus(v539, v507)); + real2 v608 = plus(v507, v539); + real2 v993 = reverse(minus(v967, v966)); + real2 v999 = plus(v966, v967); + real2 v575 = ctimesminusplus(reverse(v565), ctbl[0], ctimes(v565, ctbl[0])); + real2 v1009 = reverse(minus(v999, v998)); + real2 v1015 = plus(v998, v999); + real2 v479 = ctimesminusplus(reverse(v469), ctbl[9], ctimes(v469, ctbl[8])); + real2 v713 = reverse(minus(v479, v415)); + real2 v719 = plus(v415, v479); + real2 v660 = minusplus(uminus(v656), v657); + real2 v658 = minusplus(v656, v657); + real2 v717 = minusplus(uminus(v713), v714); + real2 v715 = minusplus(v713, v714); + real2 v723 = ctimesminusplus(reverse(v715), ctbl[0], ctimes(v715, ctbl[1])); + real2 v666 = ctimesminusplus(reverse(v658), ctbl[0], ctimes(v658, ctbl[1])); + real2 v670 = ctimesminusplus(reverse(v660), ctbl[0], ctimes(v660, ctbl[0])); + real2 v727 = ctimesminusplus(reverse(v717), ctbl[0], ctimes(v717, ctbl[0])); + real2 v735 = plus(v718, v719); + real2 v729 = reverse(minus(v719, v718)); + real2 v621 = reverse(minus(v543, v511)); + real2 v627 = plus(v511, v543); + real2 v672 = reverse(minus(v662, v661)); + real2 v678 = plus(v661, v662); + real2 v28 = load(in, 26 << shift); + real2 v60 = load(in, 58 << shift); + real2 v251 = reverse(minus(v60, v28)); + real2 v257 = plus(v28, v60); + real2 v44 = load(in, 42 << shift); + real2 v12 = load(in, 10 << shift); + real2 v256 = plus(v12, v44); + real2 v252 = minus(v44, v12); + real2 v391 = plus(v256, v257); + real2 v385 = reverse(minus(v257, v256)); + real2 v36 = load(in, 34 << shift); + real2 v4 = load(in, 2 << shift); + real2 v104 = minus(v36, v4); + real2 v108 = plus(v4, v36); + real2 v20 = load(in, 18 << shift); + real2 v52 = load(in, 50 << shift); + real2 v109 = plus(v20, v52); + real2 v103 = reverse(minus(v52, v20)); + real2 v390 = plus(v108, v109); + real2 v386 = minus(v109, v108); + real2 v514 = minus(v391, v390); + real2 v518 = plus(v390, v391); + real2 v387 = minusplus(v385, v386); + real2 v389 = minusplus(uminus(v385), v386); + real2 v399 = ctimesminusplus(reverse(v389), ctbl[2], ctimes(v389, ctbl[3])); + real2 v395 = ctimesminusplus(reverse(v387), ctbl[4], ctimes(v387, ctbl[5])); + real2 v40 = load(in, 38 << shift); + real2 v8 = load(in, 6 << shift); + real2 v182 = minus(v40, v8); + real2 v186 = plus(v8, v40); + real2 v56 = load(in, 54 << shift); + real2 v24 = load(in, 22 << shift); + real2 v187 = plus(v24, v56); + real2 v181 = reverse(minus(v56, v24)); + real2 v454 = plus(v186, v187); + real2 v450 = minus(v187, v186); + real2 v48 = load(in, 46 << shift); + real2 v16 = load(in, 14 << shift); + real2 v325 = plus(v16, v48); + real2 v321 = minus(v48, v16); + real2 v32 = load(in, 30 << shift); + real2 v64 = load(in, 62 << shift); + real2 v326 = plus(v32, v64); + real2 v320 = reverse(minus(v64, v32)); + real2 v455 = plus(v325, v326); + real2 v449 = reverse(minus(v326, v325)); + real2 v513 = reverse(minus(v455, v454)); + real2 v519 = plus(v454, v455); + real2 v515 = minusplus(v513, v514); + real2 v517 = minusplus(uminus(v513), v514); + real2 v551 = plus(v518, v519); + real2 v545 = reverse(minus(v519, v518)); + real2 v523 = ctimesminusplus(reverse(v515), ctbl[0], ctimes(v515, ctbl[1])); + real2 v527 = ctimesminusplus(reverse(v517), ctbl[0], ctimes(v517, ctbl[0])); + real2 v58 = load(in, 56 << shift); + real2 v26 = load(in, 24 << shift); + real2 v217 = reverse(minus(v58, v26)); + real2 v223 = plus(v26, v58); + real2 v50 = load(in, 48 << shift); + real2 v18 = load(in, 16 << shift); + real2 v67 = reverse(minus(v50, v18)); + real2 v73 = plus(v18, v50); + real2 v2 = load(in, 0 << shift); + real2 v34 = load(in, 32 << shift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v354 = minus(v73, v72); + real2 v358 = plus(v72, v73); + real2 v10 = load(in, 8 << shift); + real2 v42 = load(in, 40 << shift); + real2 v222 = plus(v10, v42); + real2 v218 = minus(v42, v10); + real2 v359 = plus(v222, v223); + real2 v353 = reverse(minus(v223, v222)); + real2 v482 = minus(v359, v358); + real2 v486 = plus(v358, v359); + real2 v46 = load(in, 44 << shift); + real2 v14 = load(in, 12 << shift); + real2 v287 = minus(v46, v14); + real2 v291 = plus(v14, v46); + real2 v54 = load(in, 52 << shift); + real2 v22 = load(in, 20 << shift); + real2 v147 = plus(v22, v54); + real2 v141 = reverse(minus(v54, v22)); + real2 v38 = load(in, 36 << shift); + real2 v6 = load(in, 4 << shift); + real2 v142 = minus(v38, v6); + real2 v146 = plus(v6, v38); + real2 v418 = minus(v147, v146); + real2 v422 = plus(v146, v147); + real2 v62 = load(in, 60 << shift); + real2 v30 = load(in, 28 << shift); + real2 v286 = reverse(minus(v62, v30)); + real2 v292 = plus(v30, v62); + real2 v423 = plus(v291, v292); + real2 v417 = reverse(minus(v292, v291)); + real2 v481 = reverse(minus(v423, v422)); + real2 v487 = plus(v422, v423); + real2 v550 = plus(v486, v487); + real2 v546 = minus(v487, v486); + real2 v578 = minus(v551, v550); + store(out, 16 << shift, minus(uplusminus(v577), v578)); + store(out, 48 << shift, minus(uminusplus(v577), v578)); + real2 v582 = plus(v550, v551); + store(out, 0 << shift, plus(v582, v583)); + store(out, 32 << shift, minus(v582, v583)); + real2 v559 = minus(uminusplus(v545), v546); + real2 v555 = minus(uplusminus(v545), v546); + store(out, 40 << shift, minus(v555, v571)); + store(out, 8 << shift, plus(v555, v571)); + store(out, 56 << shift, minus(v559, v575)); + store(out, 24 << shift, plus(v559, v575)); + real2 v495 = minus(uminusplus(v481), v482); + real2 v491 = minus(uplusminus(v481), v482); + real2 v626 = plus(v495, v527); + store(out, 12 << shift, plus(v626, v627)); + store(out, 44 << shift, minus(v626, v627)); + real2 v622 = minus(v527, v495); + store(out, 60 << shift, minus(uminusplus(v621), v622)); + store(out, 28 << shift, minus(uplusminus(v621), v622)); + real2 v607 = plus(v491, v523); + real2 v603 = minus(v523, v491); + store(out, 4 << shift, plus(v607, v608)); + store(out, 36 << shift, minus(v607, v608)); + store(out, 20 << shift, minus(uplusminus(v602), v603)); + store(out, 52 << shift, minus(uminusplus(v602), v603)); + real2 v367 = minus(uminusplus(v353), v354); + real2 v363 = minus(uplusminus(v353), v354); + real2 v421 = minusplus(uminus(v417), v418); + real2 v419 = minusplus(v417, v418); + real2 v431 = ctimesminusplus(reverse(v421), ctbl[0], ctimes(v421, ctbl[0])); + real2 v451 = minusplus(v449, v450); + real2 v453 = minusplus(uminus(v449), v450); + real2 v463 = ctimesminusplus(reverse(v453), ctbl[3], ctimes(v453, ctbl[2])); + real2 v697 = reverse(minus(v463, v399)); + real2 v703 = plus(v399, v463); + real2 v698 = minus(v431, v367); + real2 v702 = plus(v367, v431); + real2 v711 = minus(uminusplus(v697), v698); + store(out, 30 << shift, plus(v711, v727)); + store(out, 62 << shift, minus(v711, v727)); + real2 v707 = minus(uplusminus(v697), v698); + store(out, 46 << shift, minus(v707, v723)); + store(out, 14 << shift, plus(v707, v723)); + real2 v734 = plus(v702, v703); + store(out, 6 << shift, plus(v734, v735)); + store(out, 38 << shift, minus(v734, v735)); + real2 v730 = minus(v703, v702); + store(out, 54 << shift, minus(uminusplus(v729), v730)); + store(out, 22 << shift, minus(uplusminus(v729), v730)); + real2 v459 = ctimesminusplus(reverse(v451), ctbl[2], ctimes(v451, ctbl[3])); + real2 v640 = reverse(minus(v459, v395)); + real2 v646 = plus(v395, v459); + real2 v427 = ctimesminusplus(reverse(v419), ctbl[0], ctimes(v419, ctbl[1])); + real2 v641 = minus(v427, v363); + real2 v645 = plus(v363, v427); + real2 v654 = minus(uminusplus(v640), v641); + real2 v650 = minus(uplusminus(v640), v641); + store(out, 10 << shift, plus(v650, v666)); + store(out, 42 << shift, minus(v650, v666)); + store(out, 26 << shift, plus(v654, v670)); + store(out, 58 << shift, minus(v654, v670)); + real2 v673 = minus(v646, v645); + store(out, 18 << shift, minus(uplusminus(v672), v673)); + store(out, 50 << shift, minus(uminusplus(v672), v673)); + real2 v677 = plus(v645, v646); + store(out, 2 << shift, plus(v677, v678)); + store(out, 34 << shift, minus(v677, v678)); + real2 v105 = minusplus(v103, v104); + real2 v107 = minusplus(uminus(v103), v104); + real2 v253 = minusplus(v251, v252); + real2 v255 = minusplus(uminus(v251), v252); + real2 v267 = ctimesminusplus(reverse(v255), ctbl[12], ctimes(v255, ctbl[6])); + real2 v121 = ctimesminusplus(reverse(v107), ctbl[8], ctimes(v107, ctbl[9])); + real2 v950 = plus(v121, v267); + real2 v946 = minus(v267, v121); + real2 v290 = minusplus(uminus(v286), v287); + real2 v288 = minusplus(v286, v287); + real2 v143 = minusplus(v141, v142); + real2 v145 = minusplus(uminus(v141), v142); + real2 v159 = ctimesminusplus(reverse(v145), ctbl[2], ctimes(v145, ctbl[3])); + real2 v300 = ctimesminusplus(reverse(v290), ctbl[3], ctimes(v290, ctbl[2])); + real2 v919 = plus(v159, v300); + real2 v913 = reverse(minus(v300, v159)); + real2 v219 = minusplus(v217, v218); + real2 v221 = minusplus(uminus(v217), v218); + real2 v185 = minusplus(uminus(v181), v182); + real2 v183 = minusplus(v181, v182); + real2 v196 = ctimesminusplus(reverse(v185), ctbl[6], ctimes(v185, ctbl[12])); + real2 v233 = ctimesminusplus(reverse(v221), ctbl[0], ctimes(v221, ctbl[0])); + real2 v324 = minusplus(uminus(v320), v321); + real2 v322 = minusplus(v320, v321); + real2 v335 = ctimesminusplus(reverse(v324), ctbl[9], ctimes(v324, ctbl[8])); + real2 v945 = reverse(minus(v335, v196)); + real2 v951 = plus(v196, v335); + real2 v977 = reverse(minus(v951, v950)); + real2 v983 = plus(v950, v951); + real2 v77 = minus(uplusminus(v67), v68); + real2 v81 = minus(uminusplus(v67), v68); + real2 v914 = minus(v233, v81); + real2 v918 = plus(v81, v233); + real2 v982 = plus(v918, v919); + real2 v978 = minus(v919, v918); + real2 v1014 = plus(v982, v983); + store(out, 3 << shift, plus(v1014, v1015)); + store(out, 35 << shift, minus(v1014, v1015)); + real2 v1010 = minus(v983, v982); + store(out, 19 << shift, minus(uplusminus(v1009), v1010)); + store(out, 51 << shift, minus(uminusplus(v1009), v1010)); + real2 v995 = minusplus(v993, v994); + real2 v997 = minusplus(uminus(v993), v994); + real2 v1007 = ctimesminusplus(reverse(v997), ctbl[0], ctimes(v997, ctbl[0])); + real2 v987 = minus(uplusminus(v977), v978); + real2 v991 = minus(uminusplus(v977), v978); + store(out, 27 << shift, plus(v991, v1007)); + store(out, 59 << shift, minus(v991, v1007)); + real2 v1003 = ctimesminusplus(reverse(v995), ctbl[0], ctimes(v995, ctbl[1])); + store(out, 43 << shift, minus(v987, v1003)); + store(out, 11 << shift, plus(v987, v1003)); + real2 v965 = minusplus(uminus(v961), v962); + real2 v963 = minusplus(v961, v962); + real2 v975 = ctimesminusplus(reverse(v965), ctbl[3], ctimes(v965, ctbl[2])); + real2 v1059 = plus(v943, v975); + real2 v1053 = reverse(minus(v975, v943)); + real2 v947 = minusplus(v945, v946); + real2 v949 = minusplus(uminus(v945), v946); + real2 v959 = ctimesminusplus(reverse(v949), ctbl[0], ctimes(v949, ctbl[0])); + real2 v927 = minus(uminusplus(v913), v914); + real2 v923 = minus(uplusminus(v913), v914); + real2 v1058 = plus(v927, v959); + store(out, 15 << shift, plus(v1058, v1059)); + store(out, 47 << shift, minus(v1058, v1059)); + real2 v1054 = minus(v959, v927); + store(out, 63 << shift, minus(uminusplus(v1053), v1054)); + store(out, 31 << shift, minus(uplusminus(v1053), v1054)); + real2 v955 = ctimesminusplus(reverse(v947), ctbl[0], ctimes(v947, ctbl[1])); + real2 v971 = ctimesminusplus(reverse(v963), ctbl[2], ctimes(v963, ctbl[3])); + real2 v1034 = reverse(minus(v971, v939)); + real2 v1040 = plus(v939, v971); + real2 v1035 = minus(v955, v923); + store(out, 55 << shift, minus(uminusplus(v1034), v1035)); + store(out, 23 << shift, minus(uplusminus(v1034), v1035)); + real2 v1039 = plus(v923, v955); + store(out, 39 << shift, minus(v1039, v1040)); + store(out, 7 << shift, plus(v1039, v1040)); + real2 v263 = ctimesminusplus(reverse(v253), ctbl[10], ctimes(v253, ctbl[11])); + real2 v191 = ctimesminusplus(reverse(v183), ctbl[8], ctimes(v183, ctbl[9])); + real2 v115 = ctimesminusplus(reverse(v105), ctbl[12], ctimes(v105, ctbl[13])); + real2 v787 = minus(v263, v115); + real2 v791 = plus(v115, v263); + real2 v331 = ctimesminusplus(reverse(v322), ctbl[6], ctimes(v322, ctbl[7])); + real2 v786 = reverse(minus(v331, v191)); + real2 v792 = plus(v191, v331); + real2 v280 = ctimesminusplus(reverse(v271), ctbl[18], ctimes(v271, ctbl[19])); + real2 v133 = ctimesminusplus(reverse(v125), ctbl[20], ctimes(v125, ctbl[21])); + real2 v807 = plus(v133, v280); + real2 v803 = minus(v280, v133); + real2 v210 = ctimesminusplus(reverse(v200), ctbl[16], ctimes(v200, ctbl[17])); + real2 v153 = ctimesminusplus(reverse(v143), ctbl[4], ctimes(v143, ctbl[5])); + real2 v347 = ctimesminusplus(reverse(v339), ctbl[14], ctimes(v339, ctbl[15])); + real2 v808 = plus(v210, v347); + real2 v802 = reverse(minus(v347, v210)); + real2 v314 = ctimesminusplus(reverse(v304), ctbl[22], ctimes(v304, ctbl[23])); + real2 v770 = reverse(minus(v314, v173)); + real2 v776 = plus(v173, v314); + real2 v839 = plus(v775, v776); + real2 v835 = minus(v776, v775); + real2 v818 = reverse(minus(v792, v791)); + real2 v824 = plus(v791, v792); + real2 v840 = plus(v807, v808); + real2 v834 = reverse(minus(v808, v807)); + real2 v856 = plus(v839, v840); + real2 v850 = reverse(minus(v840, v839)); + real2 v229 = ctimesminusplus(reverse(v219), ctbl[0], ctimes(v219, ctbl[1])); + real2 v296 = ctimesminusplus(reverse(v288), ctbl[2], ctimes(v288, ctbl[3])); + real2 v760 = plus(v153, v296); + real2 v754 = reverse(minus(v296, v153)); + real2 v759 = plus(v77, v229); + real2 v755 = minus(v229, v77); + real2 v823 = plus(v759, v760); + real2 v819 = minus(v760, v759); + real2 v855 = plus(v823, v824); + store(out, 33 << shift, minus(v855, v856)); + store(out, 1 << shift, plus(v855, v856)); + real2 v851 = minus(v824, v823); + store(out, 17 << shift, minus(uplusminus(v850), v851)); + store(out, 49 << shift, minus(uminusplus(v850), v851)); + real2 v838 = minusplus(uminus(v834), v835); + real2 v836 = minusplus(v834, v835); + real2 v844 = ctimesminusplus(reverse(v836), ctbl[0], ctimes(v836, ctbl[1])); + real2 v832 = minus(uminusplus(v818), v819); + real2 v828 = minus(uplusminus(v818), v819); + store(out, 41 << shift, minus(v828, v844)); + store(out, 9 << shift, plus(v828, v844)); + real2 v848 = ctimesminusplus(reverse(v838), ctbl[0], ctimes(v838, ctbl[0])); + store(out, 25 << shift, plus(v832, v848)); + store(out, 57 << shift, minus(v832, v848)); + real2 v790 = minusplus(uminus(v786), v787); + real2 v788 = minusplus(v786, v787); + real2 v772 = minusplus(v770, v771); + real2 v774 = minusplus(uminus(v770), v771); + real2 v780 = ctimesminusplus(reverse(v772), ctbl[4], ctimes(v772, ctbl[5])); + real2 v806 = minusplus(uminus(v802), v803); + real2 v804 = minusplus(v802, v803); + real2 v812 = ctimesminusplus(reverse(v804), ctbl[2], ctimes(v804, ctbl[3])); + real2 v875 = reverse(minus(v812, v780)); + real2 v881 = plus(v780, v812); + real2 v796 = ctimesminusplus(reverse(v788), ctbl[0], ctimes(v788, ctbl[1])); + real2 v764 = minus(uplusminus(v754), v755); + real2 v768 = minus(uminusplus(v754), v755); + real2 v880 = plus(v764, v796); + real2 v876 = minus(v796, v764); + store(out, 21 << shift, minus(uplusminus(v875), v876)); + store(out, 53 << shift, minus(uminusplus(v875), v876)); + store(out, 37 << shift, minus(v880, v881)); + store(out, 5 << shift, plus(v880, v881)); + real2 v800 = ctimesminusplus(reverse(v790), ctbl[0], ctimes(v790, ctbl[0])); + real2 v784 = ctimesminusplus(reverse(v774), ctbl[2], ctimes(v774, ctbl[3])); + real2 v816 = ctimesminusplus(reverse(v806), ctbl[3], ctimes(v806, ctbl[2])); + real2 v900 = plus(v784, v816); + real2 v894 = reverse(minus(v816, v784)); + real2 v895 = minus(v800, v768); + real2 v899 = plus(v768, v800); + store(out, 45 << shift, minus(v899, v900)); + store(out, 13 << shift, plus(v899, v900)); + store(out, 61 << shift, minus(uminusplus(v894), v895)); + store(out, 29 << shift, minus(uplusminus(v894), v895)); +// Pres : 15320 + } +} + +ALIGNED(8192) void but64f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + +// Pres : 30254 + real2 v37 = load(in, 35 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v132 = plus(v5, v37); + real2 v128 = minus(v37, v5); + real2 v21 = load(in, 19 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v133 = plus(v21, v53); + real2 v127 = reverse(minus(v21, v53)); + real2 v131 = minusplus(uminus(v127), v128); + real2 v129 = minusplus(v127, v128); + real2 v139 = ctimesminusplus(reverse(v129), tbl[14 + tbloffset], ctimes(v129, tbl[15 + tbloffset])); + real2 v145 = ctimesminusplus(reverse(v131), tbl[16 + tbloffset], ctimes(v131, tbl[17 + tbloffset])); + real2 v448 = minus(v133, v132); + real2 v452 = plus(v132, v133); + real2 v45 = load(in, 43 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v292 = plus(v13, v45); + real2 v288 = minus(v45, v13); + real2 v29 = load(in, 27 << inShift); + real2 v61 = load(in, 59 << inShift); + real2 v293 = plus(v29, v61); + real2 v287 = reverse(minus(v29, v61)); + real2 v291 = minusplus(uminus(v287), v288); + real2 v289 = minusplus(v287, v288); + real2 v299 = ctimesminusplus(reverse(v289), tbl[46 + tbloffset], ctimes(v289, tbl[47 + tbloffset])); + real2 v453 = plus(v292, v293); + real2 v447 = reverse(minus(v292, v293)); + real2 v608 = minus(v453, v452); + real2 v612 = plus(v452, v453); + real2 v980 = plus(v139, v299); + real2 v976 = minus(v299, v139); + real2 v449 = minusplus(v447, v448); + real2 v451 = minusplus(uminus(v447), v448); + real2 v465 = ctimesminusplus(reverse(v451), tbl[80 + tbloffset], ctimes(v451, tbl[81 + tbloffset])); + real2 v305 = ctimesminusplus(reverse(v291), tbl[48 + tbloffset], ctimes(v291, tbl[49 + tbloffset])); + real2 v1186 = minus(v305, v145); + real2 v1190 = plus(v145, v305); + real2 v459 = ctimesminusplus(reverse(v449), tbl[78 + tbloffset], ctimes(v449, tbl[79 + tbloffset])); + real2 v25 = load(in, 23 << inShift); + real2 v57 = load(in, 55 << inShift); + real2 v207 = reverse(minus(v25, v57)); + real2 v213 = plus(v25, v57); + real2 v9 = load(in, 7 << inShift); + real2 v41 = load(in, 39 << inShift); + real2 v212 = plus(v9, v41); + real2 v208 = minus(v41, v9); + real2 v528 = minus(v213, v212); + real2 v532 = plus(v212, v213); + real2 v209 = minusplus(v207, v208); + real2 v211 = minusplus(uminus(v207), v208); + real2 v225 = ctimesminusplus(reverse(v211), tbl[32 + tbloffset], ctimes(v211, tbl[33 + tbloffset])); + real2 v219 = ctimesminusplus(reverse(v209), tbl[30 + tbloffset], ctimes(v209, tbl[31 + tbloffset])); + real2 v17 = load(in, 15 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v368 = minus(v49, v17); + real2 v372 = plus(v17, v49); + real2 v33 = load(in, 31 << inShift); + real2 v65 = load(in, 63 << inShift); + real2 v367 = reverse(minus(v33, v65)); + real2 v373 = plus(v33, v65); + real2 v369 = minusplus(v367, v368); + real2 v371 = minusplus(uminus(v367), v368); + real2 v533 = plus(v372, v373); + real2 v527 = reverse(minus(v372, v373)); + real2 v607 = reverse(minus(v532, v533)); + real2 v613 = plus(v532, v533); + real2 v529 = minusplus(v527, v528); + real2 v531 = minusplus(uminus(v527), v528); + real2 v545 = ctimesminusplus(reverse(v531), tbl[96 + tbloffset], ctimes(v531, tbl[97 + tbloffset])); + real2 v653 = plus(v612, v613); + real2 v647 = reverse(minus(v612, v613)); + real2 v609 = minusplus(v607, v608); + real2 v611 = minusplus(uminus(v607), v608); + real2 v863 = plus(v465, v545); + real2 v857 = reverse(minus(v465, v545)); + real2 v539 = ctimesminusplus(reverse(v529), tbl[94 + tbloffset], ctimes(v529, tbl[95 + tbloffset])); + real2 v385 = ctimesminusplus(reverse(v371), tbl[64 + tbloffset], ctimes(v371, tbl[65 + tbloffset])); + real2 v619 = ctimesminusplus(reverse(v609), tbl[110 + tbloffset], ctimes(v609, tbl[111 + tbloffset])); + real2 v1191 = plus(v225, v385); + real2 v1185 = reverse(minus(v225, v385)); + real2 v779 = reverse(minus(v459, v539)); + real2 v785 = plus(v459, v539); + real2 v625 = ctimesminusplus(reverse(v611), tbl[112 + tbloffset], ctimes(v611, tbl[113 + tbloffset])); + real2 v379 = ctimesminusplus(reverse(v369), tbl[62 + tbloffset], ctimes(v369, tbl[63 + tbloffset])); + real2 v975 = reverse(minus(v219, v379)); + real2 v981 = plus(v219, v379); + real2 v977 = minusplus(v975, v976); + real2 v979 = minusplus(uminus(v975), v976); + real2 v987 = ctimesminusplus(reverse(v977), tbl[170 + tbloffset], ctimes(v977, tbl[171 + tbloffset])); + real2 v993 = ctimesminusplus(reverse(v979), tbl[172 + tbloffset], ctimes(v979, tbl[173 + tbloffset])); + real2 v1015 = reverse(minus(v980, v981)); + real2 v1021 = plus(v980, v981); + real2 v11 = load(in, 9 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v248 = minus(v43, v11); + real2 v252 = plus(v11, v43); + real2 v59 = load(in, 57 << inShift); + real2 v27 = load(in, 25 << inShift); + real2 v253 = plus(v27, v59); + real2 v247 = reverse(minus(v27, v59)); + real2 v413 = plus(v252, v253); + real2 v407 = reverse(minus(v252, v253)); + real2 v249 = minusplus(v247, v248); + real2 v251 = minusplus(uminus(v247), v248); + real2 v259 = ctimesminusplus(reverse(v249), tbl[38 + tbloffset], ctimes(v249, tbl[39 + tbloffset])); + real2 v35 = load(in, 33 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v92 = plus(v3, v35); + real2 v88 = minus(v35, v3); + real2 v51 = load(in, 49 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v87 = reverse(minus(v19, v51)); + real2 v93 = plus(v19, v51); + real2 v412 = plus(v92, v93); + real2 v408 = minus(v93, v92); + real2 v411 = minusplus(uminus(v407), v408); + real2 v409 = minusplus(v407, v408); + real2 v91 = minusplus(uminus(v87), v88); + real2 v89 = minusplus(v87, v88); + real2 v99 = ctimesminusplus(reverse(v89), tbl[6 + tbloffset], ctimes(v89, tbl[7 + tbloffset])); + real2 v425 = ctimesminusplus(reverse(v411), tbl[72 + tbloffset], ctimes(v411, tbl[73 + tbloffset])); + real2 v568 = minus(v413, v412); + real2 v572 = plus(v412, v413); + real2 v940 = plus(v99, v259); + real2 v936 = minus(v259, v99); + real2 v419 = ctimesminusplus(reverse(v409), tbl[70 + tbloffset], ctimes(v409, tbl[71 + tbloffset])); + real2 v47 = load(in, 45 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v332 = plus(v15, v47); + real2 v328 = minus(v47, v15); + real2 v63 = load(in, 61 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v327 = reverse(minus(v31, v63)); + real2 v333 = plus(v31, v63); + real2 v329 = minusplus(v327, v328); + real2 v331 = minusplus(uminus(v327), v328); + real2 v339 = ctimesminusplus(reverse(v329), tbl[54 + tbloffset], ctimes(v329, tbl[55 + tbloffset])); + real2 v487 = reverse(minus(v332, v333)); + real2 v493 = plus(v332, v333); + real2 v7 = load(in, 5 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v172 = plus(v7, v39); + real2 v168 = minus(v39, v7); + real2 v55 = load(in, 53 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v173 = plus(v23, v55); + real2 v167 = reverse(minus(v23, v55)); + real2 v488 = minus(v173, v172); + real2 v492 = plus(v172, v173); + real2 v491 = minusplus(uminus(v487), v488); + real2 v489 = minusplus(v487, v488); + real2 v499 = ctimesminusplus(reverse(v489), tbl[86 + tbloffset], ctimes(v489, tbl[87 + tbloffset])); + real2 v505 = ctimesminusplus(reverse(v491), tbl[88 + tbloffset], ctimes(v491, tbl[89 + tbloffset])); + real2 v567 = reverse(minus(v492, v493)); + real2 v573 = plus(v492, v493); + real2 v571 = minusplus(uminus(v567), v568); + real2 v569 = minusplus(v567, v568); + real2 v579 = ctimesminusplus(reverse(v569), tbl[102 + tbloffset], ctimes(v569, tbl[103 + tbloffset])); + real2 v585 = ctimesminusplus(reverse(v571), tbl[104 + tbloffset], ctimes(v571, tbl[105 + tbloffset])); + real2 v739 = plus(v585, v625); + real2 v733 = reverse(minus(v585, v625)); + real2 v707 = reverse(minus(v579, v619)); + real2 v713 = plus(v579, v619); + real2 v648 = minus(v573, v572); + real2 v652 = plus(v572, v573); + real2 v673 = plus(v652, v653); + real2 v667 = reverse(minus(v652, v653)); + real2 v651 = minusplus(uminus(v647), v648); + real2 v649 = minusplus(v647, v648); + real2 v659 = ctimesminusplus(reverse(v649), tbl[118 + tbloffset], ctimes(v649, tbl[119 + tbloffset])); + real2 v665 = ctimesminusplus(reverse(v651), tbl[120 + tbloffset], ctimes(v651, tbl[121 + tbloffset])); + real2 v780 = minus(v499, v419); + real2 v784 = plus(v419, v499); + real2 v781 = minusplus(v779, v780); + real2 v783 = minusplus(uminus(v779), v780); + real2 v805 = plus(v784, v785); + real2 v799 = reverse(minus(v784, v785)); + real2 v862 = plus(v425, v505); + real2 v858 = minus(v505, v425); + real2 v859 = minusplus(v857, v858); + real2 v861 = minusplus(uminus(v857), v858); + real2 v875 = ctimesminusplus(reverse(v861), tbl[152 + tbloffset], ctimes(v861, tbl[153 + tbloffset])); + real2 v791 = ctimesminusplus(reverse(v781), tbl[138 + tbloffset], ctimes(v781, tbl[139 + tbloffset])); + real2 v797 = ctimesminusplus(reverse(v783), tbl[140 + tbloffset], ctimes(v783, tbl[141 + tbloffset])); + real2 v883 = plus(v862, v863); + real2 v877 = reverse(minus(v862, v863)); + real2 v869 = ctimesminusplus(reverse(v859), tbl[150 + tbloffset], ctimes(v859, tbl[151 + tbloffset])); + real2 v36 = load(in, 34 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v108 = minus(v36, v4); + real2 v112 = plus(v4, v36); + real2 v52 = load(in, 50 << inShift); + real2 v20 = load(in, 18 << inShift); + real2 v113 = plus(v20, v52); + real2 v107 = reverse(minus(v20, v52)); + real2 v428 = minus(v113, v112); + real2 v432 = plus(v112, v113); + real2 v12 = load(in, 10 << inShift); + real2 v44 = load(in, 42 << inShift); + real2 v268 = minus(v44, v12); + real2 v272 = plus(v12, v44); + real2 v28 = load(in, 26 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v267 = reverse(minus(v28, v60)); + real2 v273 = plus(v28, v60); + real2 v427 = reverse(minus(v272, v273)); + real2 v433 = plus(v272, v273); + real2 v431 = minusplus(uminus(v427), v428); + real2 v429 = minusplus(v427, v428); + real2 v439 = ctimesminusplus(reverse(v429), tbl[74 + tbloffset], ctimes(v429, tbl[75 + tbloffset])); + real2 v588 = minus(v433, v432); + real2 v592 = plus(v432, v433); + real2 v40 = load(in, 38 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v188 = minus(v40, v8); + real2 v192 = plus(v8, v40); + real2 v24 = load(in, 22 << inShift); + real2 v56 = load(in, 54 << inShift); + real2 v187 = reverse(minus(v24, v56)); + real2 v193 = plus(v24, v56); + real2 v512 = plus(v192, v193); + real2 v508 = minus(v193, v192); + real2 v32 = load(in, 30 << inShift); + real2 v64 = load(in, 62 << inShift); + real2 v347 = reverse(minus(v32, v64)); + real2 v353 = plus(v32, v64); + real2 v48 = load(in, 46 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v348 = minus(v48, v16); + real2 v352 = plus(v16, v48); + real2 v513 = plus(v352, v353); + real2 v507 = reverse(minus(v352, v353)); + real2 v587 = reverse(minus(v512, v513)); + real2 v593 = plus(v512, v513); + real2 v633 = plus(v592, v593); + real2 v627 = reverse(minus(v592, v593)); + real2 v591 = minusplus(uminus(v587), v588); + real2 v589 = minusplus(v587, v588); + real2 v605 = ctimesminusplus(reverse(v591), tbl[108 + tbloffset], ctimes(v591, tbl[109 + tbloffset])); + real2 v599 = ctimesminusplus(reverse(v589), tbl[106 + tbloffset], ctimes(v589, tbl[107 + tbloffset])); + real2 v46 = load(in, 44 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v312 = plus(v14, v46); + real2 v308 = minus(v46, v14); + real2 v62 = load(in, 60 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v313 = plus(v30, v62); + real2 v307 = reverse(minus(v30, v62)); + real2 v467 = reverse(minus(v312, v313)); + real2 v473 = plus(v312, v313); + real2 v22 = load(in, 20 << inShift); + real2 v54 = load(in, 52 << inShift); + real2 v147 = reverse(minus(v22, v54)); + real2 v153 = plus(v22, v54); + real2 v6 = load(in, 4 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v148 = minus(v38, v6); + real2 v152 = plus(v6, v38); + real2 v472 = plus(v152, v153); + real2 v468 = minus(v153, v152); + real2 v547 = reverse(minus(v472, v473)); + real2 v553 = plus(v472, v473); + real2 v10 = load(in, 8 << inShift); + real2 v42 = load(in, 40 << inShift); + real2 v232 = plus(v10, v42); + real2 v228 = minus(v42, v10); + real2 v58 = load(in, 56 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v233 = plus(v26, v58); + real2 v227 = reverse(minus(v26, v58)); + real2 v393 = plus(v232, v233); + real2 v387 = reverse(minus(v232, v233)); + real2 v2 = load(in, 0 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v18 = load(in, 16 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v73 = plus(v18, v50); + real2 v67 = reverse(minus(v18, v50)); + real2 v388 = minus(v73, v72); + real2 v392 = plus(v72, v73); + real2 v548 = minus(v393, v392); + real2 v552 = plus(v392, v393); + real2 v628 = minus(v553, v552); + real2 v632 = plus(v552, v553); + real2 v672 = plus(v632, v633); + real2 v668 = minus(v633, v632); + store(out, 0 << outShift, plus(v672, v673)); + real2 v686 = minus(v672, v673); + store(out, 32 << outShift, ctimesminusplus(v686, tbl[0 + tbloffset], ctimes(reverse(v686), tbl[1 + tbloffset]))); + real2 v669 = minusplus(v667, v668); + real2 v671 = minusplus(uminus(v667), v668); + store(out, 48 << outShift, ctimesminusplus(reverse(v671), tbl[124 + tbloffset], ctimes(v671, tbl[125 + tbloffset]))); + store(out, 16 << outShift, ctimesminusplus(reverse(v669), tbl[122 + tbloffset], ctimes(v669, tbl[123 + tbloffset]))); + real2 v631 = minusplus(uminus(v627), v628); + real2 v629 = minusplus(v627, v628); + real2 v639 = ctimesminusplus(reverse(v629), tbl[114 + tbloffset], ctimes(v629, tbl[115 + tbloffset])); + store(out, 8 << outShift, plus(v639, v659)); + real2 v694 = minus(v639, v659); + store(out, 40 << outShift, ctimesminusplus(v694, tbl[0 + tbloffset], ctimes(reverse(v694), tbl[1 + tbloffset]))); + real2 v645 = ctimesminusplus(reverse(v631), tbl[116 + tbloffset], ctimes(v631, tbl[117 + tbloffset])); + store(out, 24 << outShift, plus(v645, v665)); + real2 v700 = minus(v645, v665); + store(out, 56 << outShift, ctimesminusplus(v700, tbl[0 + tbloffset], ctimes(reverse(v700), tbl[1 + tbloffset]))); + real2 v549 = minusplus(v547, v548); + real2 v551 = minusplus(uminus(v547), v548); + real2 v559 = ctimesminusplus(reverse(v549), tbl[98 + tbloffset], ctimes(v549, tbl[99 + tbloffset])); + real2 v708 = minus(v599, v559); + real2 v712 = plus(v559, v599); + store(out, 4 << outShift, plus(v712, v713)); + real2 v726 = minus(v712, v713); + store(out, 36 << outShift, ctimesminusplus(v726, tbl[0 + tbloffset], ctimes(reverse(v726), tbl[1 + tbloffset]))); + real2 v711 = minusplus(uminus(v707), v708); + real2 v709 = minusplus(v707, v708); + store(out, 20 << outShift, ctimesminusplus(reverse(v709), tbl[126 + tbloffset], ctimes(v709, tbl[127 + tbloffset]))); + store(out, 52 << outShift, ctimesminusplus(reverse(v711), tbl[128 + tbloffset], ctimes(v711, tbl[129 + tbloffset]))); + real2 v565 = ctimesminusplus(reverse(v551), tbl[100 + tbloffset], ctimes(v551, tbl[101 + tbloffset])); + real2 v738 = plus(v565, v605); + real2 v734 = minus(v605, v565); + store(out, 12 << outShift, plus(v738, v739)); + real2 v752 = minus(v738, v739); + store(out, 44 << outShift, ctimesminusplus(v752, tbl[0 + tbloffset], ctimes(reverse(v752), tbl[1 + tbloffset]))); + real2 v737 = minusplus(uminus(v733), v734); + store(out, 60 << outShift, ctimesminusplus(reverse(v737), tbl[132 + tbloffset], ctimes(v737, tbl[133 + tbloffset]))); + real2 v735 = minusplus(v733, v734); + store(out, 28 << outShift, ctimesminusplus(reverse(v735), tbl[130 + tbloffset], ctimes(v735, tbl[131 + tbloffset]))); + real2 v471 = minusplus(uminus(v467), v468); + real2 v469 = minusplus(v467, v468); + real2 v479 = ctimesminusplus(reverse(v469), tbl[82 + tbloffset], ctimes(v469, tbl[83 + tbloffset])); + real2 v511 = minusplus(uminus(v507), v508); + real2 v509 = minusplus(v507, v508); + real2 v519 = ctimesminusplus(reverse(v509), tbl[90 + tbloffset], ctimes(v509, tbl[91 + tbloffset])); + real2 v765 = plus(v439, v519); + real2 v759 = reverse(minus(v439, v519)); + real2 v389 = minusplus(v387, v388); + real2 v391 = minusplus(uminus(v387), v388); + real2 v399 = ctimesminusplus(reverse(v389), tbl[66 + tbloffset], ctimes(v389, tbl[67 + tbloffset])); + real2 v764 = plus(v399, v479); + real2 v760 = minus(v479, v399); + real2 v804 = plus(v764, v765); + real2 v800 = minus(v765, v764); + store(out, 2 << outShift, plus(v804, v805)); + real2 v818 = minus(v804, v805); + store(out, 34 << outShift, ctimesminusplus(v818, tbl[0 + tbloffset], ctimes(reverse(v818), tbl[1 + tbloffset]))); + real2 v803 = minusplus(uminus(v799), v800); + store(out, 50 << outShift, ctimesminusplus(reverse(v803), tbl[144 + tbloffset], ctimes(v803, tbl[145 + tbloffset]))); + real2 v801 = minusplus(v799, v800); + store(out, 18 << outShift, ctimesminusplus(reverse(v801), tbl[142 + tbloffset], ctimes(v801, tbl[143 + tbloffset]))); + real2 v763 = minusplus(uminus(v759), v760); + real2 v761 = minusplus(v759, v760); + real2 v777 = ctimesminusplus(reverse(v763), tbl[136 + tbloffset], ctimes(v763, tbl[137 + tbloffset])); + store(out, 26 << outShift, plus(v777, v797)); + real2 v830 = minus(v777, v797); + store(out, 58 << outShift, ctimesminusplus(v830, tbl[0 + tbloffset], ctimes(reverse(v830), tbl[1 + tbloffset]))); + real2 v771 = ctimesminusplus(reverse(v761), tbl[134 + tbloffset], ctimes(v761, tbl[135 + tbloffset])); + store(out, 10 << outShift, plus(v771, v791)); + real2 v824 = minus(v771, v791); + store(out, 42 << outShift, ctimesminusplus(v824, tbl[0 + tbloffset], ctimes(reverse(v824), tbl[1 + tbloffset]))); + real2 v445 = ctimesminusplus(reverse(v431), tbl[76 + tbloffset], ctimes(v431, tbl[77 + tbloffset])); + real2 v525 = ctimesminusplus(reverse(v511), tbl[92 + tbloffset], ctimes(v511, tbl[93 + tbloffset])); + real2 v837 = reverse(minus(v445, v525)); + real2 v843 = plus(v445, v525); + real2 v485 = ctimesminusplus(reverse(v471), tbl[84 + tbloffset], ctimes(v471, tbl[85 + tbloffset])); + real2 v405 = ctimesminusplus(reverse(v391), tbl[68 + tbloffset], ctimes(v391, tbl[69 + tbloffset])); + real2 v838 = minus(v485, v405); + real2 v842 = plus(v405, v485); + real2 v878 = minus(v843, v842); + real2 v882 = plus(v842, v843); + store(out, 6 << outShift, plus(v882, v883)); + real2 v896 = minus(v882, v883); + store(out, 38 << outShift, ctimesminusplus(v896, tbl[0 + tbloffset], ctimes(reverse(v896), tbl[1 + tbloffset]))); + real2 v881 = minusplus(uminus(v877), v878); + store(out, 54 << outShift, ctimesminusplus(reverse(v881), tbl[156 + tbloffset], ctimes(v881, tbl[157 + tbloffset]))); + real2 v879 = minusplus(v877, v878); + store(out, 22 << outShift, ctimesminusplus(reverse(v879), tbl[154 + tbloffset], ctimes(v879, tbl[155 + tbloffset]))); + real2 v841 = minusplus(uminus(v837), v838); + real2 v839 = minusplus(v837, v838); + real2 v855 = ctimesminusplus(reverse(v841), tbl[148 + tbloffset], ctimes(v841, tbl[149 + tbloffset])); + store(out, 30 << outShift, plus(v855, v875)); + real2 v908 = minus(v855, v875); + store(out, 62 << outShift, ctimesminusplus(v908, tbl[0 + tbloffset], ctimes(reverse(v908), tbl[1 + tbloffset]))); + real2 v849 = ctimesminusplus(reverse(v839), tbl[146 + tbloffset], ctimes(v839, tbl[147 + tbloffset])); + store(out, 14 << outShift, plus(v849, v869)); + real2 v902 = minus(v849, v869); + store(out, 46 << outShift, ctimesminusplus(v902, tbl[0 + tbloffset], ctimes(reverse(v902), tbl[1 + tbloffset]))); + real2 v151 = minusplus(uminus(v147), v148); + real2 v149 = minusplus(v147, v148); + real2 v311 = minusplus(uminus(v307), v308); + real2 v309 = minusplus(v307, v308); + real2 v109 = minusplus(v107, v108); + real2 v111 = minusplus(uminus(v107), v108); + real2 v119 = ctimesminusplus(reverse(v109), tbl[10 + tbloffset], ctimes(v109, tbl[11 + tbloffset])); + real2 v269 = minusplus(v267, v268); + real2 v271 = minusplus(uminus(v267), v268); + real2 v279 = ctimesminusplus(reverse(v269), tbl[42 + tbloffset], ctimes(v269, tbl[43 + tbloffset])); + real2 v960 = plus(v119, v279); + real2 v956 = minus(v279, v119); + real2 v169 = minusplus(v167, v168); + real2 v171 = minusplus(uminus(v167), v168); + real2 v159 = ctimesminusplus(reverse(v149), tbl[18 + tbloffset], ctimes(v149, tbl[19 + tbloffset])); + real2 v319 = ctimesminusplus(reverse(v309), tbl[50 + tbloffset], ctimes(v309, tbl[51 + tbloffset])); + real2 v921 = plus(v159, v319); + real2 v915 = reverse(minus(v159, v319)); + real2 v351 = minusplus(uminus(v347), v348); + real2 v349 = minusplus(v347, v348); + real2 v359 = ctimesminusplus(reverse(v349), tbl[58 + tbloffset], ctimes(v349, tbl[59 + tbloffset])); + real2 v191 = minusplus(uminus(v187), v188); + real2 v189 = minusplus(v187, v188); + real2 v199 = ctimesminusplus(reverse(v189), tbl[26 + tbloffset], ctimes(v189, tbl[27 + tbloffset])); + real2 v961 = plus(v199, v359); + real2 v955 = reverse(minus(v199, v359)); + real2 v995 = reverse(minus(v960, v961)); + real2 v1001 = plus(v960, v961); + real2 v179 = ctimesminusplus(reverse(v169), tbl[22 + tbloffset], ctimes(v169, tbl[23 + tbloffset])); + real2 v941 = plus(v179, v339); + real2 v935 = reverse(minus(v179, v339)); + real2 v1016 = minus(v941, v940); + real2 v1020 = plus(v940, v941); + real2 v71 = minusplus(uminus(v67), v68); + real2 v69 = minusplus(v67, v68); + real2 v79 = ctimesminusplus(reverse(v69), tbl[2 + tbloffset], ctimes(v69, tbl[3 + tbloffset])); + real2 v1041 = plus(v1020, v1021); + real2 v1035 = reverse(minus(v1020, v1021)); + real2 v229 = minusplus(v227, v228); + real2 v231 = minusplus(uminus(v227), v228); + real2 v239 = ctimesminusplus(reverse(v229), tbl[34 + tbloffset], ctimes(v229, tbl[35 + tbloffset])); + real2 v920 = plus(v79, v239); + real2 v916 = minus(v239, v79); + real2 v996 = minus(v921, v920); + real2 v1000 = plus(v920, v921); + real2 v1040 = plus(v1000, v1001); + real2 v1036 = minus(v1001, v1000); + store(out, 1 << outShift, plus(v1040, v1041)); + real2 v1054 = minus(v1040, v1041); + store(out, 33 << outShift, ctimesminusplus(v1054, tbl[0 + tbloffset], ctimes(reverse(v1054), tbl[1 + tbloffset]))); + real2 v1037 = minusplus(v1035, v1036); + real2 v1039 = minusplus(uminus(v1035), v1036); + store(out, 49 << outShift, ctimesminusplus(reverse(v1039), tbl[184 + tbloffset], ctimes(v1039, tbl[185 + tbloffset]))); + store(out, 17 << outShift, ctimesminusplus(reverse(v1037), tbl[182 + tbloffset], ctimes(v1037, tbl[183 + tbloffset]))); + real2 v1017 = minusplus(v1015, v1016); + real2 v1019 = minusplus(uminus(v1015), v1016); + real2 v1033 = ctimesminusplus(reverse(v1019), tbl[180 + tbloffset], ctimes(v1019, tbl[181 + tbloffset])); + real2 v997 = minusplus(v995, v996); + real2 v999 = minusplus(uminus(v995), v996); + real2 v1013 = ctimesminusplus(reverse(v999), tbl[176 + tbloffset], ctimes(v999, tbl[177 + tbloffset])); + store(out, 25 << outShift, plus(v1013, v1033)); + real2 v1066 = minus(v1013, v1033); + store(out, 57 << outShift, ctimesminusplus(v1066, tbl[0 + tbloffset], ctimes(reverse(v1066), tbl[1 + tbloffset]))); + real2 v1027 = ctimesminusplus(reverse(v1017), tbl[178 + tbloffset], ctimes(v1017, tbl[179 + tbloffset])); + real2 v1007 = ctimesminusplus(reverse(v997), tbl[174 + tbloffset], ctimes(v997, tbl[175 + tbloffset])); + store(out, 9 << outShift, plus(v1007, v1027)); + real2 v1060 = minus(v1007, v1027); + store(out, 41 << outShift, ctimesminusplus(v1060, tbl[0 + tbloffset], ctimes(reverse(v1060), tbl[1 + tbloffset]))); + real2 v937 = minusplus(v935, v936); + real2 v939 = minusplus(uminus(v935), v936); + real2 v959 = minusplus(uminus(v955), v956); + real2 v957 = minusplus(v955, v956); + real2 v967 = ctimesminusplus(reverse(v957), tbl[166 + tbloffset], ctimes(v957, tbl[167 + tbloffset])); + real2 v947 = ctimesminusplus(reverse(v937), tbl[162 + tbloffset], ctimes(v937, tbl[163 + tbloffset])); + real2 v919 = minusplus(uminus(v915), v916); + real2 v917 = minusplus(v915, v916); + real2 v1079 = plus(v947, v987); + real2 v1073 = reverse(minus(v947, v987)); + real2 v927 = ctimesminusplus(reverse(v917), tbl[158 + tbloffset], ctimes(v917, tbl[159 + tbloffset])); + real2 v1074 = minus(v967, v927); + real2 v1078 = plus(v927, v967); + store(out, 5 << outShift, plus(v1078, v1079)); + real2 v1092 = minus(v1078, v1079); + store(out, 37 << outShift, ctimesminusplus(v1092, tbl[0 + tbloffset], ctimes(reverse(v1092), tbl[1 + tbloffset]))); + real2 v1075 = minusplus(v1073, v1074); + store(out, 21 << outShift, ctimesminusplus(reverse(v1075), tbl[186 + tbloffset], ctimes(v1075, tbl[187 + tbloffset]))); + real2 v1077 = minusplus(uminus(v1073), v1074); + store(out, 53 << outShift, ctimesminusplus(reverse(v1077), tbl[188 + tbloffset], ctimes(v1077, tbl[189 + tbloffset]))); + real2 v953 = ctimesminusplus(reverse(v939), tbl[164 + tbloffset], ctimes(v939, tbl[165 + tbloffset])); + real2 v1099 = reverse(minus(v953, v993)); + real2 v1105 = plus(v953, v993); + real2 v973 = ctimesminusplus(reverse(v959), tbl[168 + tbloffset], ctimes(v959, tbl[169 + tbloffset])); + real2 v933 = ctimesminusplus(reverse(v919), tbl[160 + tbloffset], ctimes(v919, tbl[161 + tbloffset])); + real2 v1104 = plus(v933, v973); + real2 v1100 = minus(v973, v933); + store(out, 13 << outShift, plus(v1104, v1105)); + real2 v1118 = minus(v1104, v1105); + store(out, 45 << outShift, ctimesminusplus(v1118, tbl[0 + tbloffset], ctimes(reverse(v1118), tbl[1 + tbloffset]))); + real2 v1101 = minusplus(v1099, v1100); + store(out, 29 << outShift, ctimesminusplus(reverse(v1101), tbl[190 + tbloffset], ctimes(v1101, tbl[191 + tbloffset]))); + real2 v1103 = minusplus(uminus(v1099), v1100); + store(out, 61 << outShift, ctimesminusplus(reverse(v1103), tbl[192 + tbloffset], ctimes(v1103, tbl[193 + tbloffset]))); + real2 v345 = ctimesminusplus(reverse(v331), tbl[56 + tbloffset], ctimes(v331, tbl[57 + tbloffset])); + real2 v325 = ctimesminusplus(reverse(v311), tbl[52 + tbloffset], ctimes(v311, tbl[53 + tbloffset])); + real2 v265 = ctimesminusplus(reverse(v251), tbl[40 + tbloffset], ctimes(v251, tbl[41 + tbloffset])); + real2 v185 = ctimesminusplus(reverse(v171), tbl[24 + tbloffset], ctimes(v171, tbl[25 + tbloffset])); + real2 v165 = ctimesminusplus(reverse(v151), tbl[20 + tbloffset], ctimes(v151, tbl[21 + tbloffset])); + real2 v1131 = plus(v165, v325); + real2 v1125 = reverse(minus(v165, v325)); + real2 v1151 = plus(v185, v345); + real2 v1145 = reverse(minus(v185, v345)); + real2 v105 = ctimesminusplus(reverse(v91), tbl[8 + tbloffset], ctimes(v91, tbl[9 + tbloffset])); + real2 v1150 = plus(v105, v265); + real2 v1146 = minus(v265, v105); + real2 v1226 = minus(v1151, v1150); + real2 v1230 = plus(v1150, v1151); + real2 v1231 = plus(v1190, v1191); + real2 v1225 = reverse(minus(v1190, v1191)); + real2 v1245 = reverse(minus(v1230, v1231)); + real2 v1251 = plus(v1230, v1231); + real2 v365 = ctimesminusplus(reverse(v351), tbl[60 + tbloffset], ctimes(v351, tbl[61 + tbloffset])); + real2 v285 = ctimesminusplus(reverse(v271), tbl[44 + tbloffset], ctimes(v271, tbl[45 + tbloffset])); + real2 v205 = ctimesminusplus(reverse(v191), tbl[28 + tbloffset], ctimes(v191, tbl[29 + tbloffset])); + real2 v1171 = plus(v205, v365); + real2 v1165 = reverse(minus(v205, v365)); + real2 v125 = ctimesminusplus(reverse(v111), tbl[12 + tbloffset], ctimes(v111, tbl[13 + tbloffset])); + real2 v85 = ctimesminusplus(reverse(v71), tbl[4 + tbloffset], ctimes(v71, tbl[5 + tbloffset])); + real2 v245 = ctimesminusplus(reverse(v231), tbl[36 + tbloffset], ctimes(v231, tbl[37 + tbloffset])); + real2 v1126 = minus(v245, v85); + real2 v1130 = plus(v85, v245); + real2 v1210 = plus(v1130, v1131); + real2 v1206 = minus(v1131, v1130); + real2 v1166 = minus(v285, v125); + real2 v1170 = plus(v125, v285); + real2 v1211 = plus(v1170, v1171); + real2 v1205 = reverse(minus(v1170, v1171)); + real2 v1246 = minus(v1211, v1210); + real2 v1250 = plus(v1210, v1211); + store(out, 3 << outShift, plus(v1250, v1251)); + real2 v1264 = minus(v1250, v1251); + store(out, 35 << outShift, ctimesminusplus(v1264, tbl[0 + tbloffset], ctimes(reverse(v1264), tbl[1 + tbloffset]))); + real2 v1247 = minusplus(v1245, v1246); + real2 v1249 = minusplus(uminus(v1245), v1246); + store(out, 19 << outShift, ctimesminusplus(reverse(v1247), tbl[218 + tbloffset], ctimes(v1247, tbl[219 + tbloffset]))); + store(out, 51 << outShift, ctimesminusplus(reverse(v1249), tbl[220 + tbloffset], ctimes(v1249, tbl[221 + tbloffset]))); + real2 v1229 = minusplus(uminus(v1225), v1226); + real2 v1227 = minusplus(v1225, v1226); + real2 v1207 = minusplus(v1205, v1206); + real2 v1209 = minusplus(uminus(v1205), v1206); + real2 v1237 = ctimesminusplus(reverse(v1227), tbl[214 + tbloffset], ctimes(v1227, tbl[215 + tbloffset])); + real2 v1217 = ctimesminusplus(reverse(v1207), tbl[210 + tbloffset], ctimes(v1207, tbl[211 + tbloffset])); + store(out, 11 << outShift, plus(v1217, v1237)); + real2 v1270 = minus(v1217, v1237); + store(out, 43 << outShift, ctimesminusplus(v1270, tbl[0 + tbloffset], ctimes(reverse(v1270), tbl[1 + tbloffset]))); + real2 v1223 = ctimesminusplus(reverse(v1209), tbl[212 + tbloffset], ctimes(v1209, tbl[213 + tbloffset])); + real2 v1243 = ctimesminusplus(reverse(v1229), tbl[216 + tbloffset], ctimes(v1229, tbl[217 + tbloffset])); + store(out, 27 << outShift, plus(v1223, v1243)); + real2 v1276 = minus(v1223, v1243); + store(out, 59 << outShift, ctimesminusplus(v1276, tbl[0 + tbloffset], ctimes(reverse(v1276), tbl[1 + tbloffset]))); + real2 v1189 = minusplus(uminus(v1185), v1186); + real2 v1187 = minusplus(v1185, v1186); + real2 v1129 = minusplus(uminus(v1125), v1126); + real2 v1127 = minusplus(v1125, v1126); + real2 v1147 = minusplus(v1145, v1146); + real2 v1149 = minusplus(uminus(v1145), v1146); + real2 v1167 = minusplus(v1165, v1166); + real2 v1169 = minusplus(uminus(v1165), v1166); + real2 v1143 = ctimesminusplus(reverse(v1129), tbl[196 + tbloffset], ctimes(v1129, tbl[197 + tbloffset])); + real2 v1163 = ctimesminusplus(reverse(v1149), tbl[200 + tbloffset], ctimes(v1149, tbl[201 + tbloffset])); + real2 v1203 = ctimesminusplus(reverse(v1189), tbl[208 + tbloffset], ctimes(v1189, tbl[209 + tbloffset])); + real2 v1315 = plus(v1163, v1203); + real2 v1309 = reverse(minus(v1163, v1203)); + real2 v1183 = ctimesminusplus(reverse(v1169), tbl[204 + tbloffset], ctimes(v1169, tbl[205 + tbloffset])); + real2 v1314 = plus(v1143, v1183); + real2 v1310 = minus(v1183, v1143); + store(out, 15 << outShift, plus(v1314, v1315)); + real2 v1328 = minus(v1314, v1315); + store(out, 47 << outShift, ctimesminusplus(v1328, tbl[0 + tbloffset], ctimes(reverse(v1328), tbl[1 + tbloffset]))); + real2 v1311 = minusplus(v1309, v1310); + store(out, 31 << outShift, ctimesminusplus(reverse(v1311), tbl[226 + tbloffset], ctimes(v1311, tbl[227 + tbloffset]))); + real2 v1313 = minusplus(uminus(v1309), v1310); + store(out, 63 << outShift, ctimesminusplus(reverse(v1313), tbl[228 + tbloffset], ctimes(v1313, tbl[229 + tbloffset]))); + real2 v1177 = ctimesminusplus(reverse(v1167), tbl[202 + tbloffset], ctimes(v1167, tbl[203 + tbloffset])); + real2 v1137 = ctimesminusplus(reverse(v1127), tbl[194 + tbloffset], ctimes(v1127, tbl[195 + tbloffset])); + real2 v1197 = ctimesminusplus(reverse(v1187), tbl[206 + tbloffset], ctimes(v1187, tbl[207 + tbloffset])); + real2 v1157 = ctimesminusplus(reverse(v1147), tbl[198 + tbloffset], ctimes(v1147, tbl[199 + tbloffset])); + real2 v1283 = reverse(minus(v1157, v1197)); + real2 v1289 = plus(v1157, v1197); + real2 v1288 = plus(v1137, v1177); + real2 v1284 = minus(v1177, v1137); + store(out, 7 << outShift, plus(v1288, v1289)); + real2 v1302 = minus(v1288, v1289); + store(out, 39 << outShift, ctimesminusplus(v1302, tbl[0 + tbloffset], ctimes(reverse(v1302), tbl[1 + tbloffset]))); + real2 v1285 = minusplus(v1283, v1284); + real2 v1287 = minusplus(uminus(v1283), v1284); + store(out, 55 << outShift, ctimesminusplus(reverse(v1287), tbl[224 + tbloffset], ctimes(v1287, tbl[225 + tbloffset]))); + store(out, 23 << outShift, ctimesminusplus(reverse(v1285), tbl[222 + tbloffset], ctimes(v1285, tbl[223 + tbloffset]))); +// Pres : 17339 + } +} + +ALIGNED(8192) void but64b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + +// Pres : 30254 + real2 v37 = load(in, 35 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v132 = plus(v5, v37); + real2 v128 = minus(v37, v5); + real2 v21 = load(in, 19 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v133 = plus(v21, v53); + real2 v127 = reverse(minus(v53, v21)); + real2 v131 = minusplus(uminus(v127), v128); + real2 v129 = minusplus(v127, v128); + real2 v139 = ctimesminusplus(reverse(v129), tbl[14 + tbloffset], ctimes(v129, tbl[15 + tbloffset])); + real2 v145 = ctimesminusplus(reverse(v131), tbl[16 + tbloffset], ctimes(v131, tbl[17 + tbloffset])); + real2 v448 = minus(v133, v132); + real2 v452 = plus(v132, v133); + real2 v45 = load(in, 43 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v292 = plus(v13, v45); + real2 v288 = minus(v45, v13); + real2 v29 = load(in, 27 << inShift); + real2 v61 = load(in, 59 << inShift); + real2 v293 = plus(v29, v61); + real2 v287 = reverse(minus(v61, v29)); + real2 v291 = minusplus(uminus(v287), v288); + real2 v289 = minusplus(v287, v288); + real2 v299 = ctimesminusplus(reverse(v289), tbl[46 + tbloffset], ctimes(v289, tbl[47 + tbloffset])); + real2 v453 = plus(v292, v293); + real2 v447 = reverse(minus(v293, v292)); + real2 v608 = minus(v453, v452); + real2 v612 = plus(v452, v453); + real2 v980 = plus(v139, v299); + real2 v976 = minus(v299, v139); + real2 v449 = minusplus(v447, v448); + real2 v451 = minusplus(uminus(v447), v448); + real2 v465 = ctimesminusplus(reverse(v451), tbl[80 + tbloffset], ctimes(v451, tbl[81 + tbloffset])); + real2 v305 = ctimesminusplus(reverse(v291), tbl[48 + tbloffset], ctimes(v291, tbl[49 + tbloffset])); + real2 v1186 = minus(v305, v145); + real2 v1190 = plus(v145, v305); + real2 v459 = ctimesminusplus(reverse(v449), tbl[78 + tbloffset], ctimes(v449, tbl[79 + tbloffset])); + real2 v25 = load(in, 23 << inShift); + real2 v57 = load(in, 55 << inShift); + real2 v207 = reverse(minus(v57, v25)); + real2 v213 = plus(v25, v57); + real2 v9 = load(in, 7 << inShift); + real2 v41 = load(in, 39 << inShift); + real2 v212 = plus(v9, v41); + real2 v208 = minus(v41, v9); + real2 v528 = minus(v213, v212); + real2 v532 = plus(v212, v213); + real2 v209 = minusplus(v207, v208); + real2 v211 = minusplus(uminus(v207), v208); + real2 v225 = ctimesminusplus(reverse(v211), tbl[32 + tbloffset], ctimes(v211, tbl[33 + tbloffset])); + real2 v219 = ctimesminusplus(reverse(v209), tbl[30 + tbloffset], ctimes(v209, tbl[31 + tbloffset])); + real2 v17 = load(in, 15 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v368 = minus(v49, v17); + real2 v372 = plus(v17, v49); + real2 v33 = load(in, 31 << inShift); + real2 v65 = load(in, 63 << inShift); + real2 v367 = reverse(minus(v65, v33)); + real2 v373 = plus(v33, v65); + real2 v369 = minusplus(v367, v368); + real2 v371 = minusplus(uminus(v367), v368); + real2 v533 = plus(v372, v373); + real2 v527 = reverse(minus(v373, v372)); + real2 v607 = reverse(minus(v533, v532)); + real2 v613 = plus(v532, v533); + real2 v529 = minusplus(v527, v528); + real2 v531 = minusplus(uminus(v527), v528); + real2 v545 = ctimesminusplus(reverse(v531), tbl[96 + tbloffset], ctimes(v531, tbl[97 + tbloffset])); + real2 v653 = plus(v612, v613); + real2 v647 = reverse(minus(v613, v612)); + real2 v609 = minusplus(v607, v608); + real2 v611 = minusplus(uminus(v607), v608); + real2 v863 = plus(v465, v545); + real2 v857 = reverse(minus(v545, v465)); + real2 v539 = ctimesminusplus(reverse(v529), tbl[94 + tbloffset], ctimes(v529, tbl[95 + tbloffset])); + real2 v385 = ctimesminusplus(reverse(v371), tbl[64 + tbloffset], ctimes(v371, tbl[65 + tbloffset])); + real2 v619 = ctimesminusplus(reverse(v609), tbl[110 + tbloffset], ctimes(v609, tbl[111 + tbloffset])); + real2 v1191 = plus(v225, v385); + real2 v1185 = reverse(minus(v385, v225)); + real2 v779 = reverse(minus(v539, v459)); + real2 v785 = plus(v459, v539); + real2 v625 = ctimesminusplus(reverse(v611), tbl[112 + tbloffset], ctimes(v611, tbl[113 + tbloffset])); + real2 v379 = ctimesminusplus(reverse(v369), tbl[62 + tbloffset], ctimes(v369, tbl[63 + tbloffset])); + real2 v975 = reverse(minus(v379, v219)); + real2 v981 = plus(v219, v379); + real2 v977 = minusplus(v975, v976); + real2 v979 = minusplus(uminus(v975), v976); + real2 v987 = ctimesminusplus(reverse(v977), tbl[170 + tbloffset], ctimes(v977, tbl[171 + tbloffset])); + real2 v993 = ctimesminusplus(reverse(v979), tbl[172 + tbloffset], ctimes(v979, tbl[173 + tbloffset])); + real2 v1015 = reverse(minus(v981, v980)); + real2 v1021 = plus(v980, v981); + real2 v11 = load(in, 9 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v248 = minus(v43, v11); + real2 v252 = plus(v11, v43); + real2 v59 = load(in, 57 << inShift); + real2 v27 = load(in, 25 << inShift); + real2 v253 = plus(v27, v59); + real2 v247 = reverse(minus(v59, v27)); + real2 v413 = plus(v252, v253); + real2 v407 = reverse(minus(v253, v252)); + real2 v249 = minusplus(v247, v248); + real2 v251 = minusplus(uminus(v247), v248); + real2 v259 = ctimesminusplus(reverse(v249), tbl[38 + tbloffset], ctimes(v249, tbl[39 + tbloffset])); + real2 v35 = load(in, 33 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v92 = plus(v3, v35); + real2 v88 = minus(v35, v3); + real2 v51 = load(in, 49 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v87 = reverse(minus(v51, v19)); + real2 v93 = plus(v19, v51); + real2 v412 = plus(v92, v93); + real2 v408 = minus(v93, v92); + real2 v411 = minusplus(uminus(v407), v408); + real2 v409 = minusplus(v407, v408); + real2 v91 = minusplus(uminus(v87), v88); + real2 v89 = minusplus(v87, v88); + real2 v99 = ctimesminusplus(reverse(v89), tbl[6 + tbloffset], ctimes(v89, tbl[7 + tbloffset])); + real2 v425 = ctimesminusplus(reverse(v411), tbl[72 + tbloffset], ctimes(v411, tbl[73 + tbloffset])); + real2 v568 = minus(v413, v412); + real2 v572 = plus(v412, v413); + real2 v940 = plus(v99, v259); + real2 v936 = minus(v259, v99); + real2 v419 = ctimesminusplus(reverse(v409), tbl[70 + tbloffset], ctimes(v409, tbl[71 + tbloffset])); + real2 v47 = load(in, 45 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v332 = plus(v15, v47); + real2 v328 = minus(v47, v15); + real2 v63 = load(in, 61 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v327 = reverse(minus(v63, v31)); + real2 v333 = plus(v31, v63); + real2 v329 = minusplus(v327, v328); + real2 v331 = minusplus(uminus(v327), v328); + real2 v339 = ctimesminusplus(reverse(v329), tbl[54 + tbloffset], ctimes(v329, tbl[55 + tbloffset])); + real2 v487 = reverse(minus(v333, v332)); + real2 v493 = plus(v332, v333); + real2 v7 = load(in, 5 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v172 = plus(v7, v39); + real2 v168 = minus(v39, v7); + real2 v55 = load(in, 53 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v173 = plus(v23, v55); + real2 v167 = reverse(minus(v55, v23)); + real2 v488 = minus(v173, v172); + real2 v492 = plus(v172, v173); + real2 v491 = minusplus(uminus(v487), v488); + real2 v489 = minusplus(v487, v488); + real2 v499 = ctimesminusplus(reverse(v489), tbl[86 + tbloffset], ctimes(v489, tbl[87 + tbloffset])); + real2 v505 = ctimesminusplus(reverse(v491), tbl[88 + tbloffset], ctimes(v491, tbl[89 + tbloffset])); + real2 v567 = reverse(minus(v493, v492)); + real2 v573 = plus(v492, v493); + real2 v571 = minusplus(uminus(v567), v568); + real2 v569 = minusplus(v567, v568); + real2 v579 = ctimesminusplus(reverse(v569), tbl[102 + tbloffset], ctimes(v569, tbl[103 + tbloffset])); + real2 v585 = ctimesminusplus(reverse(v571), tbl[104 + tbloffset], ctimes(v571, tbl[105 + tbloffset])); + real2 v739 = plus(v585, v625); + real2 v733 = reverse(minus(v625, v585)); + real2 v707 = reverse(minus(v619, v579)); + real2 v713 = plus(v579, v619); + real2 v648 = minus(v573, v572); + real2 v652 = plus(v572, v573); + real2 v673 = plus(v652, v653); + real2 v667 = reverse(minus(v653, v652)); + real2 v651 = minusplus(uminus(v647), v648); + real2 v649 = minusplus(v647, v648); + real2 v659 = ctimesminusplus(reverse(v649), tbl[118 + tbloffset], ctimes(v649, tbl[119 + tbloffset])); + real2 v665 = ctimesminusplus(reverse(v651), tbl[120 + tbloffset], ctimes(v651, tbl[121 + tbloffset])); + real2 v780 = minus(v499, v419); + real2 v784 = plus(v419, v499); + real2 v781 = minusplus(v779, v780); + real2 v783 = minusplus(uminus(v779), v780); + real2 v805 = plus(v784, v785); + real2 v799 = reverse(minus(v785, v784)); + real2 v862 = plus(v425, v505); + real2 v858 = minus(v505, v425); + real2 v859 = minusplus(v857, v858); + real2 v861 = minusplus(uminus(v857), v858); + real2 v875 = ctimesminusplus(reverse(v861), tbl[152 + tbloffset], ctimes(v861, tbl[153 + tbloffset])); + real2 v791 = ctimesminusplus(reverse(v781), tbl[138 + tbloffset], ctimes(v781, tbl[139 + tbloffset])); + real2 v797 = ctimesminusplus(reverse(v783), tbl[140 + tbloffset], ctimes(v783, tbl[141 + tbloffset])); + real2 v883 = plus(v862, v863); + real2 v877 = reverse(minus(v863, v862)); + real2 v869 = ctimesminusplus(reverse(v859), tbl[150 + tbloffset], ctimes(v859, tbl[151 + tbloffset])); + real2 v36 = load(in, 34 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v108 = minus(v36, v4); + real2 v112 = plus(v4, v36); + real2 v52 = load(in, 50 << inShift); + real2 v20 = load(in, 18 << inShift); + real2 v113 = plus(v20, v52); + real2 v107 = reverse(minus(v52, v20)); + real2 v428 = minus(v113, v112); + real2 v432 = plus(v112, v113); + real2 v12 = load(in, 10 << inShift); + real2 v44 = load(in, 42 << inShift); + real2 v268 = minus(v44, v12); + real2 v272 = plus(v12, v44); + real2 v28 = load(in, 26 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v267 = reverse(minus(v60, v28)); + real2 v273 = plus(v28, v60); + real2 v427 = reverse(minus(v273, v272)); + real2 v433 = plus(v272, v273); + real2 v431 = minusplus(uminus(v427), v428); + real2 v429 = minusplus(v427, v428); + real2 v439 = ctimesminusplus(reverse(v429), tbl[74 + tbloffset], ctimes(v429, tbl[75 + tbloffset])); + real2 v588 = minus(v433, v432); + real2 v592 = plus(v432, v433); + real2 v40 = load(in, 38 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v188 = minus(v40, v8); + real2 v192 = plus(v8, v40); + real2 v24 = load(in, 22 << inShift); + real2 v56 = load(in, 54 << inShift); + real2 v187 = reverse(minus(v56, v24)); + real2 v193 = plus(v24, v56); + real2 v512 = plus(v192, v193); + real2 v508 = minus(v193, v192); + real2 v32 = load(in, 30 << inShift); + real2 v64 = load(in, 62 << inShift); + real2 v347 = reverse(minus(v64, v32)); + real2 v353 = plus(v32, v64); + real2 v48 = load(in, 46 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v348 = minus(v48, v16); + real2 v352 = plus(v16, v48); + real2 v513 = plus(v352, v353); + real2 v507 = reverse(minus(v353, v352)); + real2 v587 = reverse(minus(v513, v512)); + real2 v593 = plus(v512, v513); + real2 v633 = plus(v592, v593); + real2 v627 = reverse(minus(v593, v592)); + real2 v591 = minusplus(uminus(v587), v588); + real2 v589 = minusplus(v587, v588); + real2 v605 = ctimesminusplus(reverse(v591), tbl[108 + tbloffset], ctimes(v591, tbl[109 + tbloffset])); + real2 v599 = ctimesminusplus(reverse(v589), tbl[106 + tbloffset], ctimes(v589, tbl[107 + tbloffset])); + real2 v46 = load(in, 44 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v312 = plus(v14, v46); + real2 v308 = minus(v46, v14); + real2 v62 = load(in, 60 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v313 = plus(v30, v62); + real2 v307 = reverse(minus(v62, v30)); + real2 v467 = reverse(minus(v313, v312)); + real2 v473 = plus(v312, v313); + real2 v22 = load(in, 20 << inShift); + real2 v54 = load(in, 52 << inShift); + real2 v147 = reverse(minus(v54, v22)); + real2 v153 = plus(v22, v54); + real2 v6 = load(in, 4 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v148 = minus(v38, v6); + real2 v152 = plus(v6, v38); + real2 v472 = plus(v152, v153); + real2 v468 = minus(v153, v152); + real2 v547 = reverse(minus(v473, v472)); + real2 v553 = plus(v472, v473); + real2 v10 = load(in, 8 << inShift); + real2 v42 = load(in, 40 << inShift); + real2 v232 = plus(v10, v42); + real2 v228 = minus(v42, v10); + real2 v58 = load(in, 56 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v233 = plus(v26, v58); + real2 v227 = reverse(minus(v58, v26)); + real2 v393 = plus(v232, v233); + real2 v387 = reverse(minus(v233, v232)); + real2 v2 = load(in, 0 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v18 = load(in, 16 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v73 = plus(v18, v50); + real2 v67 = reverse(minus(v50, v18)); + real2 v388 = minus(v73, v72); + real2 v392 = plus(v72, v73); + real2 v548 = minus(v393, v392); + real2 v552 = plus(v392, v393); + real2 v628 = minus(v553, v552); + real2 v632 = plus(v552, v553); + real2 v672 = plus(v632, v633); + real2 v668 = minus(v633, v632); + store(out, 0 << outShift, plus(v672, v673)); + real2 v686 = minus(v672, v673); + store(out, 32 << outShift, ctimesminusplus(v686, tbl[0 + tbloffset], ctimes(reverse(v686), tbl[1 + tbloffset]))); + real2 v669 = minusplus(v667, v668); + real2 v671 = minusplus(uminus(v667), v668); + store(out, 48 << outShift, ctimesminusplus(reverse(v671), tbl[124 + tbloffset], ctimes(v671, tbl[125 + tbloffset]))); + store(out, 16 << outShift, ctimesminusplus(reverse(v669), tbl[122 + tbloffset], ctimes(v669, tbl[123 + tbloffset]))); + real2 v631 = minusplus(uminus(v627), v628); + real2 v629 = minusplus(v627, v628); + real2 v639 = ctimesminusplus(reverse(v629), tbl[114 + tbloffset], ctimes(v629, tbl[115 + tbloffset])); + store(out, 8 << outShift, plus(v639, v659)); + real2 v694 = minus(v639, v659); + store(out, 40 << outShift, ctimesminusplus(v694, tbl[0 + tbloffset], ctimes(reverse(v694), tbl[1 + tbloffset]))); + real2 v645 = ctimesminusplus(reverse(v631), tbl[116 + tbloffset], ctimes(v631, tbl[117 + tbloffset])); + store(out, 24 << outShift, plus(v645, v665)); + real2 v700 = minus(v645, v665); + store(out, 56 << outShift, ctimesminusplus(v700, tbl[0 + tbloffset], ctimes(reverse(v700), tbl[1 + tbloffset]))); + real2 v549 = minusplus(v547, v548); + real2 v551 = minusplus(uminus(v547), v548); + real2 v559 = ctimesminusplus(reverse(v549), tbl[98 + tbloffset], ctimes(v549, tbl[99 + tbloffset])); + real2 v708 = minus(v599, v559); + real2 v712 = plus(v559, v599); + store(out, 4 << outShift, plus(v712, v713)); + real2 v726 = minus(v712, v713); + store(out, 36 << outShift, ctimesminusplus(v726, tbl[0 + tbloffset], ctimes(reverse(v726), tbl[1 + tbloffset]))); + real2 v711 = minusplus(uminus(v707), v708); + real2 v709 = minusplus(v707, v708); + store(out, 20 << outShift, ctimesminusplus(reverse(v709), tbl[126 + tbloffset], ctimes(v709, tbl[127 + tbloffset]))); + store(out, 52 << outShift, ctimesminusplus(reverse(v711), tbl[128 + tbloffset], ctimes(v711, tbl[129 + tbloffset]))); + real2 v565 = ctimesminusplus(reverse(v551), tbl[100 + tbloffset], ctimes(v551, tbl[101 + tbloffset])); + real2 v738 = plus(v565, v605); + real2 v734 = minus(v605, v565); + store(out, 12 << outShift, plus(v738, v739)); + real2 v752 = minus(v738, v739); + store(out, 44 << outShift, ctimesminusplus(v752, tbl[0 + tbloffset], ctimes(reverse(v752), tbl[1 + tbloffset]))); + real2 v737 = minusplus(uminus(v733), v734); + store(out, 60 << outShift, ctimesminusplus(reverse(v737), tbl[132 + tbloffset], ctimes(v737, tbl[133 + tbloffset]))); + real2 v735 = minusplus(v733, v734); + store(out, 28 << outShift, ctimesminusplus(reverse(v735), tbl[130 + tbloffset], ctimes(v735, tbl[131 + tbloffset]))); + real2 v471 = minusplus(uminus(v467), v468); + real2 v469 = minusplus(v467, v468); + real2 v479 = ctimesminusplus(reverse(v469), tbl[82 + tbloffset], ctimes(v469, tbl[83 + tbloffset])); + real2 v511 = minusplus(uminus(v507), v508); + real2 v509 = minusplus(v507, v508); + real2 v519 = ctimesminusplus(reverse(v509), tbl[90 + tbloffset], ctimes(v509, tbl[91 + tbloffset])); + real2 v765 = plus(v439, v519); + real2 v759 = reverse(minus(v519, v439)); + real2 v389 = minusplus(v387, v388); + real2 v391 = minusplus(uminus(v387), v388); + real2 v399 = ctimesminusplus(reverse(v389), tbl[66 + tbloffset], ctimes(v389, tbl[67 + tbloffset])); + real2 v764 = plus(v399, v479); + real2 v760 = minus(v479, v399); + real2 v804 = plus(v764, v765); + real2 v800 = minus(v765, v764); + store(out, 2 << outShift, plus(v804, v805)); + real2 v818 = minus(v804, v805); + store(out, 34 << outShift, ctimesminusplus(v818, tbl[0 + tbloffset], ctimes(reverse(v818), tbl[1 + tbloffset]))); + real2 v803 = minusplus(uminus(v799), v800); + store(out, 50 << outShift, ctimesminusplus(reverse(v803), tbl[144 + tbloffset], ctimes(v803, tbl[145 + tbloffset]))); + real2 v801 = minusplus(v799, v800); + store(out, 18 << outShift, ctimesminusplus(reverse(v801), tbl[142 + tbloffset], ctimes(v801, tbl[143 + tbloffset]))); + real2 v763 = minusplus(uminus(v759), v760); + real2 v761 = minusplus(v759, v760); + real2 v777 = ctimesminusplus(reverse(v763), tbl[136 + tbloffset], ctimes(v763, tbl[137 + tbloffset])); + store(out, 26 << outShift, plus(v777, v797)); + real2 v830 = minus(v777, v797); + store(out, 58 << outShift, ctimesminusplus(v830, tbl[0 + tbloffset], ctimes(reverse(v830), tbl[1 + tbloffset]))); + real2 v771 = ctimesminusplus(reverse(v761), tbl[134 + tbloffset], ctimes(v761, tbl[135 + tbloffset])); + store(out, 10 << outShift, plus(v771, v791)); + real2 v824 = minus(v771, v791); + store(out, 42 << outShift, ctimesminusplus(v824, tbl[0 + tbloffset], ctimes(reverse(v824), tbl[1 + tbloffset]))); + real2 v445 = ctimesminusplus(reverse(v431), tbl[76 + tbloffset], ctimes(v431, tbl[77 + tbloffset])); + real2 v525 = ctimesminusplus(reverse(v511), tbl[92 + tbloffset], ctimes(v511, tbl[93 + tbloffset])); + real2 v837 = reverse(minus(v525, v445)); + real2 v843 = plus(v445, v525); + real2 v485 = ctimesminusplus(reverse(v471), tbl[84 + tbloffset], ctimes(v471, tbl[85 + tbloffset])); + real2 v405 = ctimesminusplus(reverse(v391), tbl[68 + tbloffset], ctimes(v391, tbl[69 + tbloffset])); + real2 v838 = minus(v485, v405); + real2 v842 = plus(v405, v485); + real2 v878 = minus(v843, v842); + real2 v882 = plus(v842, v843); + store(out, 6 << outShift, plus(v882, v883)); + real2 v896 = minus(v882, v883); + store(out, 38 << outShift, ctimesminusplus(v896, tbl[0 + tbloffset], ctimes(reverse(v896), tbl[1 + tbloffset]))); + real2 v881 = minusplus(uminus(v877), v878); + store(out, 54 << outShift, ctimesminusplus(reverse(v881), tbl[156 + tbloffset], ctimes(v881, tbl[157 + tbloffset]))); + real2 v879 = minusplus(v877, v878); + store(out, 22 << outShift, ctimesminusplus(reverse(v879), tbl[154 + tbloffset], ctimes(v879, tbl[155 + tbloffset]))); + real2 v841 = minusplus(uminus(v837), v838); + real2 v839 = minusplus(v837, v838); + real2 v855 = ctimesminusplus(reverse(v841), tbl[148 + tbloffset], ctimes(v841, tbl[149 + tbloffset])); + store(out, 30 << outShift, plus(v855, v875)); + real2 v908 = minus(v855, v875); + store(out, 62 << outShift, ctimesminusplus(v908, tbl[0 + tbloffset], ctimes(reverse(v908), tbl[1 + tbloffset]))); + real2 v849 = ctimesminusplus(reverse(v839), tbl[146 + tbloffset], ctimes(v839, tbl[147 + tbloffset])); + store(out, 14 << outShift, plus(v849, v869)); + real2 v902 = minus(v849, v869); + store(out, 46 << outShift, ctimesminusplus(v902, tbl[0 + tbloffset], ctimes(reverse(v902), tbl[1 + tbloffset]))); + real2 v151 = minusplus(uminus(v147), v148); + real2 v149 = minusplus(v147, v148); + real2 v311 = minusplus(uminus(v307), v308); + real2 v309 = minusplus(v307, v308); + real2 v109 = minusplus(v107, v108); + real2 v111 = minusplus(uminus(v107), v108); + real2 v119 = ctimesminusplus(reverse(v109), tbl[10 + tbloffset], ctimes(v109, tbl[11 + tbloffset])); + real2 v269 = minusplus(v267, v268); + real2 v271 = minusplus(uminus(v267), v268); + real2 v279 = ctimesminusplus(reverse(v269), tbl[42 + tbloffset], ctimes(v269, tbl[43 + tbloffset])); + real2 v960 = plus(v119, v279); + real2 v956 = minus(v279, v119); + real2 v169 = minusplus(v167, v168); + real2 v171 = minusplus(uminus(v167), v168); + real2 v159 = ctimesminusplus(reverse(v149), tbl[18 + tbloffset], ctimes(v149, tbl[19 + tbloffset])); + real2 v319 = ctimesminusplus(reverse(v309), tbl[50 + tbloffset], ctimes(v309, tbl[51 + tbloffset])); + real2 v921 = plus(v159, v319); + real2 v915 = reverse(minus(v319, v159)); + real2 v351 = minusplus(uminus(v347), v348); + real2 v349 = minusplus(v347, v348); + real2 v359 = ctimesminusplus(reverse(v349), tbl[58 + tbloffset], ctimes(v349, tbl[59 + tbloffset])); + real2 v191 = minusplus(uminus(v187), v188); + real2 v189 = minusplus(v187, v188); + real2 v199 = ctimesminusplus(reverse(v189), tbl[26 + tbloffset], ctimes(v189, tbl[27 + tbloffset])); + real2 v961 = plus(v199, v359); + real2 v955 = reverse(minus(v359, v199)); + real2 v995 = reverse(minus(v961, v960)); + real2 v1001 = plus(v960, v961); + real2 v179 = ctimesminusplus(reverse(v169), tbl[22 + tbloffset], ctimes(v169, tbl[23 + tbloffset])); + real2 v941 = plus(v179, v339); + real2 v935 = reverse(minus(v339, v179)); + real2 v1016 = minus(v941, v940); + real2 v1020 = plus(v940, v941); + real2 v71 = minusplus(uminus(v67), v68); + real2 v69 = minusplus(v67, v68); + real2 v79 = ctimesminusplus(reverse(v69), tbl[2 + tbloffset], ctimes(v69, tbl[3 + tbloffset])); + real2 v1041 = plus(v1020, v1021); + real2 v1035 = reverse(minus(v1021, v1020)); + real2 v229 = minusplus(v227, v228); + real2 v231 = minusplus(uminus(v227), v228); + real2 v239 = ctimesminusplus(reverse(v229), tbl[34 + tbloffset], ctimes(v229, tbl[35 + tbloffset])); + real2 v920 = plus(v79, v239); + real2 v916 = minus(v239, v79); + real2 v996 = minus(v921, v920); + real2 v1000 = plus(v920, v921); + real2 v1040 = plus(v1000, v1001); + real2 v1036 = minus(v1001, v1000); + store(out, 1 << outShift, plus(v1040, v1041)); + real2 v1054 = minus(v1040, v1041); + store(out, 33 << outShift, ctimesminusplus(v1054, tbl[0 + tbloffset], ctimes(reverse(v1054), tbl[1 + tbloffset]))); + real2 v1037 = minusplus(v1035, v1036); + real2 v1039 = minusplus(uminus(v1035), v1036); + store(out, 49 << outShift, ctimesminusplus(reverse(v1039), tbl[184 + tbloffset], ctimes(v1039, tbl[185 + tbloffset]))); + store(out, 17 << outShift, ctimesminusplus(reverse(v1037), tbl[182 + tbloffset], ctimes(v1037, tbl[183 + tbloffset]))); + real2 v1017 = minusplus(v1015, v1016); + real2 v1019 = minusplus(uminus(v1015), v1016); + real2 v1033 = ctimesminusplus(reverse(v1019), tbl[180 + tbloffset], ctimes(v1019, tbl[181 + tbloffset])); + real2 v997 = minusplus(v995, v996); + real2 v999 = minusplus(uminus(v995), v996); + real2 v1013 = ctimesminusplus(reverse(v999), tbl[176 + tbloffset], ctimes(v999, tbl[177 + tbloffset])); + store(out, 25 << outShift, plus(v1013, v1033)); + real2 v1066 = minus(v1013, v1033); + store(out, 57 << outShift, ctimesminusplus(v1066, tbl[0 + tbloffset], ctimes(reverse(v1066), tbl[1 + tbloffset]))); + real2 v1027 = ctimesminusplus(reverse(v1017), tbl[178 + tbloffset], ctimes(v1017, tbl[179 + tbloffset])); + real2 v1007 = ctimesminusplus(reverse(v997), tbl[174 + tbloffset], ctimes(v997, tbl[175 + tbloffset])); + store(out, 9 << outShift, plus(v1007, v1027)); + real2 v1060 = minus(v1007, v1027); + store(out, 41 << outShift, ctimesminusplus(v1060, tbl[0 + tbloffset], ctimes(reverse(v1060), tbl[1 + tbloffset]))); + real2 v937 = minusplus(v935, v936); + real2 v939 = minusplus(uminus(v935), v936); + real2 v959 = minusplus(uminus(v955), v956); + real2 v957 = minusplus(v955, v956); + real2 v967 = ctimesminusplus(reverse(v957), tbl[166 + tbloffset], ctimes(v957, tbl[167 + tbloffset])); + real2 v947 = ctimesminusplus(reverse(v937), tbl[162 + tbloffset], ctimes(v937, tbl[163 + tbloffset])); + real2 v919 = minusplus(uminus(v915), v916); + real2 v917 = minusplus(v915, v916); + real2 v1079 = plus(v947, v987); + real2 v1073 = reverse(minus(v987, v947)); + real2 v927 = ctimesminusplus(reverse(v917), tbl[158 + tbloffset], ctimes(v917, tbl[159 + tbloffset])); + real2 v1074 = minus(v967, v927); + real2 v1078 = plus(v927, v967); + store(out, 5 << outShift, plus(v1078, v1079)); + real2 v1092 = minus(v1078, v1079); + store(out, 37 << outShift, ctimesminusplus(v1092, tbl[0 + tbloffset], ctimes(reverse(v1092), tbl[1 + tbloffset]))); + real2 v1075 = minusplus(v1073, v1074); + store(out, 21 << outShift, ctimesminusplus(reverse(v1075), tbl[186 + tbloffset], ctimes(v1075, tbl[187 + tbloffset]))); + real2 v1077 = minusplus(uminus(v1073), v1074); + store(out, 53 << outShift, ctimesminusplus(reverse(v1077), tbl[188 + tbloffset], ctimes(v1077, tbl[189 + tbloffset]))); + real2 v953 = ctimesminusplus(reverse(v939), tbl[164 + tbloffset], ctimes(v939, tbl[165 + tbloffset])); + real2 v1099 = reverse(minus(v993, v953)); + real2 v1105 = plus(v953, v993); + real2 v973 = ctimesminusplus(reverse(v959), tbl[168 + tbloffset], ctimes(v959, tbl[169 + tbloffset])); + real2 v933 = ctimesminusplus(reverse(v919), tbl[160 + tbloffset], ctimes(v919, tbl[161 + tbloffset])); + real2 v1104 = plus(v933, v973); + real2 v1100 = minus(v973, v933); + store(out, 13 << outShift, plus(v1104, v1105)); + real2 v1118 = minus(v1104, v1105); + store(out, 45 << outShift, ctimesminusplus(v1118, tbl[0 + tbloffset], ctimes(reverse(v1118), tbl[1 + tbloffset]))); + real2 v1101 = minusplus(v1099, v1100); + store(out, 29 << outShift, ctimesminusplus(reverse(v1101), tbl[190 + tbloffset], ctimes(v1101, tbl[191 + tbloffset]))); + real2 v1103 = minusplus(uminus(v1099), v1100); + store(out, 61 << outShift, ctimesminusplus(reverse(v1103), tbl[192 + tbloffset], ctimes(v1103, tbl[193 + tbloffset]))); + real2 v345 = ctimesminusplus(reverse(v331), tbl[56 + tbloffset], ctimes(v331, tbl[57 + tbloffset])); + real2 v325 = ctimesminusplus(reverse(v311), tbl[52 + tbloffset], ctimes(v311, tbl[53 + tbloffset])); + real2 v265 = ctimesminusplus(reverse(v251), tbl[40 + tbloffset], ctimes(v251, tbl[41 + tbloffset])); + real2 v185 = ctimesminusplus(reverse(v171), tbl[24 + tbloffset], ctimes(v171, tbl[25 + tbloffset])); + real2 v165 = ctimesminusplus(reverse(v151), tbl[20 + tbloffset], ctimes(v151, tbl[21 + tbloffset])); + real2 v1131 = plus(v165, v325); + real2 v1125 = reverse(minus(v325, v165)); + real2 v1151 = plus(v185, v345); + real2 v1145 = reverse(minus(v345, v185)); + real2 v105 = ctimesminusplus(reverse(v91), tbl[8 + tbloffset], ctimes(v91, tbl[9 + tbloffset])); + real2 v1150 = plus(v105, v265); + real2 v1146 = minus(v265, v105); + real2 v1226 = minus(v1151, v1150); + real2 v1230 = plus(v1150, v1151); + real2 v1231 = plus(v1190, v1191); + real2 v1225 = reverse(minus(v1191, v1190)); + real2 v1245 = reverse(minus(v1231, v1230)); + real2 v1251 = plus(v1230, v1231); + real2 v365 = ctimesminusplus(reverse(v351), tbl[60 + tbloffset], ctimes(v351, tbl[61 + tbloffset])); + real2 v285 = ctimesminusplus(reverse(v271), tbl[44 + tbloffset], ctimes(v271, tbl[45 + tbloffset])); + real2 v205 = ctimesminusplus(reverse(v191), tbl[28 + tbloffset], ctimes(v191, tbl[29 + tbloffset])); + real2 v1171 = plus(v205, v365); + real2 v1165 = reverse(minus(v365, v205)); + real2 v125 = ctimesminusplus(reverse(v111), tbl[12 + tbloffset], ctimes(v111, tbl[13 + tbloffset])); + real2 v85 = ctimesminusplus(reverse(v71), tbl[4 + tbloffset], ctimes(v71, tbl[5 + tbloffset])); + real2 v245 = ctimesminusplus(reverse(v231), tbl[36 + tbloffset], ctimes(v231, tbl[37 + tbloffset])); + real2 v1126 = minus(v245, v85); + real2 v1130 = plus(v85, v245); + real2 v1210 = plus(v1130, v1131); + real2 v1206 = minus(v1131, v1130); + real2 v1166 = minus(v285, v125); + real2 v1170 = plus(v125, v285); + real2 v1211 = plus(v1170, v1171); + real2 v1205 = reverse(minus(v1171, v1170)); + real2 v1246 = minus(v1211, v1210); + real2 v1250 = plus(v1210, v1211); + store(out, 3 << outShift, plus(v1250, v1251)); + real2 v1264 = minus(v1250, v1251); + store(out, 35 << outShift, ctimesminusplus(v1264, tbl[0 + tbloffset], ctimes(reverse(v1264), tbl[1 + tbloffset]))); + real2 v1247 = minusplus(v1245, v1246); + real2 v1249 = minusplus(uminus(v1245), v1246); + store(out, 19 << outShift, ctimesminusplus(reverse(v1247), tbl[218 + tbloffset], ctimes(v1247, tbl[219 + tbloffset]))); + store(out, 51 << outShift, ctimesminusplus(reverse(v1249), tbl[220 + tbloffset], ctimes(v1249, tbl[221 + tbloffset]))); + real2 v1229 = minusplus(uminus(v1225), v1226); + real2 v1227 = minusplus(v1225, v1226); + real2 v1207 = minusplus(v1205, v1206); + real2 v1209 = minusplus(uminus(v1205), v1206); + real2 v1237 = ctimesminusplus(reverse(v1227), tbl[214 + tbloffset], ctimes(v1227, tbl[215 + tbloffset])); + real2 v1217 = ctimesminusplus(reverse(v1207), tbl[210 + tbloffset], ctimes(v1207, tbl[211 + tbloffset])); + store(out, 11 << outShift, plus(v1217, v1237)); + real2 v1270 = minus(v1217, v1237); + store(out, 43 << outShift, ctimesminusplus(v1270, tbl[0 + tbloffset], ctimes(reverse(v1270), tbl[1 + tbloffset]))); + real2 v1223 = ctimesminusplus(reverse(v1209), tbl[212 + tbloffset], ctimes(v1209, tbl[213 + tbloffset])); + real2 v1243 = ctimesminusplus(reverse(v1229), tbl[216 + tbloffset], ctimes(v1229, tbl[217 + tbloffset])); + store(out, 27 << outShift, plus(v1223, v1243)); + real2 v1276 = minus(v1223, v1243); + store(out, 59 << outShift, ctimesminusplus(v1276, tbl[0 + tbloffset], ctimes(reverse(v1276), tbl[1 + tbloffset]))); + real2 v1189 = minusplus(uminus(v1185), v1186); + real2 v1187 = minusplus(v1185, v1186); + real2 v1129 = minusplus(uminus(v1125), v1126); + real2 v1127 = minusplus(v1125, v1126); + real2 v1147 = minusplus(v1145, v1146); + real2 v1149 = minusplus(uminus(v1145), v1146); + real2 v1167 = minusplus(v1165, v1166); + real2 v1169 = minusplus(uminus(v1165), v1166); + real2 v1143 = ctimesminusplus(reverse(v1129), tbl[196 + tbloffset], ctimes(v1129, tbl[197 + tbloffset])); + real2 v1163 = ctimesminusplus(reverse(v1149), tbl[200 + tbloffset], ctimes(v1149, tbl[201 + tbloffset])); + real2 v1203 = ctimesminusplus(reverse(v1189), tbl[208 + tbloffset], ctimes(v1189, tbl[209 + tbloffset])); + real2 v1315 = plus(v1163, v1203); + real2 v1309 = reverse(minus(v1203, v1163)); + real2 v1183 = ctimesminusplus(reverse(v1169), tbl[204 + tbloffset], ctimes(v1169, tbl[205 + tbloffset])); + real2 v1314 = plus(v1143, v1183); + real2 v1310 = minus(v1183, v1143); + store(out, 15 << outShift, plus(v1314, v1315)); + real2 v1328 = minus(v1314, v1315); + store(out, 47 << outShift, ctimesminusplus(v1328, tbl[0 + tbloffset], ctimes(reverse(v1328), tbl[1 + tbloffset]))); + real2 v1311 = minusplus(v1309, v1310); + store(out, 31 << outShift, ctimesminusplus(reverse(v1311), tbl[226 + tbloffset], ctimes(v1311, tbl[227 + tbloffset]))); + real2 v1313 = minusplus(uminus(v1309), v1310); + store(out, 63 << outShift, ctimesminusplus(reverse(v1313), tbl[228 + tbloffset], ctimes(v1313, tbl[229 + tbloffset]))); + real2 v1177 = ctimesminusplus(reverse(v1167), tbl[202 + tbloffset], ctimes(v1167, tbl[203 + tbloffset])); + real2 v1137 = ctimesminusplus(reverse(v1127), tbl[194 + tbloffset], ctimes(v1127, tbl[195 + tbloffset])); + real2 v1197 = ctimesminusplus(reverse(v1187), tbl[206 + tbloffset], ctimes(v1187, tbl[207 + tbloffset])); + real2 v1157 = ctimesminusplus(reverse(v1147), tbl[198 + tbloffset], ctimes(v1147, tbl[199 + tbloffset])); + real2 v1283 = reverse(minus(v1197, v1157)); + real2 v1289 = plus(v1157, v1197); + real2 v1288 = plus(v1137, v1177); + real2 v1284 = minus(v1177, v1137); + store(out, 7 << outShift, plus(v1288, v1289)); + real2 v1302 = minus(v1288, v1289); + store(out, 39 << outShift, ctimesminusplus(v1302, tbl[0 + tbloffset], ctimes(reverse(v1302), tbl[1 + tbloffset]))); + real2 v1285 = minusplus(v1283, v1284); + real2 v1287 = minusplus(uminus(v1283), v1284); + store(out, 55 << outShift, ctimesminusplus(reverse(v1287), tbl[224 + tbloffset], ctimes(v1287, tbl[225 + tbloffset]))); + store(out, 23 << outShift, ctimesminusplus(reverse(v1285), tbl[222 + tbloffset], ctimes(v1285, tbl[223 + tbloffset]))); +// Pres : 17339 + } +} + +ALIGNED(8192) void tbut64f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + +// Pres : 30254 + real2 v37 = load(in, 35 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v132 = plus(v5, v37); + real2 v128 = minus(v37, v5); + real2 v21 = load(in, 19 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v133 = plus(v21, v53); + real2 v127 = reverse(minus(v21, v53)); + real2 v131 = minusplus(uminus(v127), v128); + real2 v129 = minusplus(v127, v128); + real2 v139 = timesminusplus(reverse(v129), load(tbl, 14 * VECWIDTH + tbloffset), times(v129, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v145 = timesminusplus(reverse(v131), load(tbl, 16 * VECWIDTH + tbloffset), times(v131, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v448 = minus(v133, v132); + real2 v452 = plus(v132, v133); + real2 v45 = load(in, 43 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v292 = plus(v13, v45); + real2 v288 = minus(v45, v13); + real2 v29 = load(in, 27 << inShift); + real2 v61 = load(in, 59 << inShift); + real2 v293 = plus(v29, v61); + real2 v287 = reverse(minus(v29, v61)); + real2 v291 = minusplus(uminus(v287), v288); + real2 v289 = minusplus(v287, v288); + real2 v299 = timesminusplus(reverse(v289), load(tbl, 46 * VECWIDTH + tbloffset), times(v289, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v453 = plus(v292, v293); + real2 v447 = reverse(minus(v292, v293)); + real2 v608 = minus(v453, v452); + real2 v612 = plus(v452, v453); + real2 v980 = plus(v139, v299); + real2 v976 = minus(v299, v139); + real2 v449 = minusplus(v447, v448); + real2 v451 = minusplus(uminus(v447), v448); + real2 v465 = timesminusplus(reverse(v451), load(tbl, 80 * VECWIDTH + tbloffset), times(v451, load(tbl, 81 * VECWIDTH + tbloffset))); + real2 v305 = timesminusplus(reverse(v291), load(tbl, 48 * VECWIDTH + tbloffset), times(v291, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v1186 = minus(v305, v145); + real2 v1190 = plus(v145, v305); + real2 v459 = timesminusplus(reverse(v449), load(tbl, 78 * VECWIDTH + tbloffset), times(v449, load(tbl, 79 * VECWIDTH + tbloffset))); + real2 v25 = load(in, 23 << inShift); + real2 v57 = load(in, 55 << inShift); + real2 v207 = reverse(minus(v25, v57)); + real2 v213 = plus(v25, v57); + real2 v9 = load(in, 7 << inShift); + real2 v41 = load(in, 39 << inShift); + real2 v212 = plus(v9, v41); + real2 v208 = minus(v41, v9); + real2 v528 = minus(v213, v212); + real2 v532 = plus(v212, v213); + real2 v209 = minusplus(v207, v208); + real2 v211 = minusplus(uminus(v207), v208); + real2 v225 = timesminusplus(reverse(v211), load(tbl, 32 * VECWIDTH + tbloffset), times(v211, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v219 = timesminusplus(reverse(v209), load(tbl, 30 * VECWIDTH + tbloffset), times(v209, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v17 = load(in, 15 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v368 = minus(v49, v17); + real2 v372 = plus(v17, v49); + real2 v33 = load(in, 31 << inShift); + real2 v65 = load(in, 63 << inShift); + real2 v367 = reverse(minus(v33, v65)); + real2 v373 = plus(v33, v65); + real2 v369 = minusplus(v367, v368); + real2 v371 = minusplus(uminus(v367), v368); + real2 v533 = plus(v372, v373); + real2 v527 = reverse(minus(v372, v373)); + real2 v607 = reverse(minus(v532, v533)); + real2 v613 = plus(v532, v533); + real2 v529 = minusplus(v527, v528); + real2 v531 = minusplus(uminus(v527), v528); + real2 v545 = timesminusplus(reverse(v531), load(tbl, 96 * VECWIDTH + tbloffset), times(v531, load(tbl, 97 * VECWIDTH + tbloffset))); + real2 v653 = plus(v612, v613); + real2 v647 = reverse(minus(v612, v613)); + real2 v609 = minusplus(v607, v608); + real2 v611 = minusplus(uminus(v607), v608); + real2 v863 = plus(v465, v545); + real2 v857 = reverse(minus(v465, v545)); + real2 v539 = timesminusplus(reverse(v529), load(tbl, 94 * VECWIDTH + tbloffset), times(v529, load(tbl, 95 * VECWIDTH + tbloffset))); + real2 v385 = timesminusplus(reverse(v371), load(tbl, 64 * VECWIDTH + tbloffset), times(v371, load(tbl, 65 * VECWIDTH + tbloffset))); + real2 v619 = timesminusplus(reverse(v609), load(tbl, 110 * VECWIDTH + tbloffset), times(v609, load(tbl, 111 * VECWIDTH + tbloffset))); + real2 v1191 = plus(v225, v385); + real2 v1185 = reverse(minus(v225, v385)); + real2 v779 = reverse(minus(v459, v539)); + real2 v785 = plus(v459, v539); + real2 v625 = timesminusplus(reverse(v611), load(tbl, 112 * VECWIDTH + tbloffset), times(v611, load(tbl, 113 * VECWIDTH + tbloffset))); + real2 v379 = timesminusplus(reverse(v369), load(tbl, 62 * VECWIDTH + tbloffset), times(v369, load(tbl, 63 * VECWIDTH + tbloffset))); + real2 v975 = reverse(minus(v219, v379)); + real2 v981 = plus(v219, v379); + real2 v977 = minusplus(v975, v976); + real2 v979 = minusplus(uminus(v975), v976); + real2 v987 = timesminusplus(reverse(v977), load(tbl, 170 * VECWIDTH + tbloffset), times(v977, load(tbl, 171 * VECWIDTH + tbloffset))); + real2 v993 = timesminusplus(reverse(v979), load(tbl, 172 * VECWIDTH + tbloffset), times(v979, load(tbl, 173 * VECWIDTH + tbloffset))); + real2 v1015 = reverse(minus(v980, v981)); + real2 v1021 = plus(v980, v981); + real2 v11 = load(in, 9 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v248 = minus(v43, v11); + real2 v252 = plus(v11, v43); + real2 v59 = load(in, 57 << inShift); + real2 v27 = load(in, 25 << inShift); + real2 v253 = plus(v27, v59); + real2 v247 = reverse(minus(v27, v59)); + real2 v413 = plus(v252, v253); + real2 v407 = reverse(minus(v252, v253)); + real2 v249 = minusplus(v247, v248); + real2 v251 = minusplus(uminus(v247), v248); + real2 v259 = timesminusplus(reverse(v249), load(tbl, 38 * VECWIDTH + tbloffset), times(v249, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v35 = load(in, 33 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v92 = plus(v3, v35); + real2 v88 = minus(v35, v3); + real2 v51 = load(in, 49 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v87 = reverse(minus(v19, v51)); + real2 v93 = plus(v19, v51); + real2 v412 = plus(v92, v93); + real2 v408 = minus(v93, v92); + real2 v411 = minusplus(uminus(v407), v408); + real2 v409 = minusplus(v407, v408); + real2 v91 = minusplus(uminus(v87), v88); + real2 v89 = minusplus(v87, v88); + real2 v99 = timesminusplus(reverse(v89), load(tbl, 6 * VECWIDTH + tbloffset), times(v89, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v425 = timesminusplus(reverse(v411), load(tbl, 72 * VECWIDTH + tbloffset), times(v411, load(tbl, 73 * VECWIDTH + tbloffset))); + real2 v568 = minus(v413, v412); + real2 v572 = plus(v412, v413); + real2 v940 = plus(v99, v259); + real2 v936 = minus(v259, v99); + real2 v419 = timesminusplus(reverse(v409), load(tbl, 70 * VECWIDTH + tbloffset), times(v409, load(tbl, 71 * VECWIDTH + tbloffset))); + real2 v47 = load(in, 45 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v332 = plus(v15, v47); + real2 v328 = minus(v47, v15); + real2 v63 = load(in, 61 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v327 = reverse(minus(v31, v63)); + real2 v333 = plus(v31, v63); + real2 v329 = minusplus(v327, v328); + real2 v331 = minusplus(uminus(v327), v328); + real2 v339 = timesminusplus(reverse(v329), load(tbl, 54 * VECWIDTH + tbloffset), times(v329, load(tbl, 55 * VECWIDTH + tbloffset))); + real2 v487 = reverse(minus(v332, v333)); + real2 v493 = plus(v332, v333); + real2 v7 = load(in, 5 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v172 = plus(v7, v39); + real2 v168 = minus(v39, v7); + real2 v55 = load(in, 53 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v173 = plus(v23, v55); + real2 v167 = reverse(minus(v23, v55)); + real2 v488 = minus(v173, v172); + real2 v492 = plus(v172, v173); + real2 v491 = minusplus(uminus(v487), v488); + real2 v489 = minusplus(v487, v488); + real2 v499 = timesminusplus(reverse(v489), load(tbl, 86 * VECWIDTH + tbloffset), times(v489, load(tbl, 87 * VECWIDTH + tbloffset))); + real2 v505 = timesminusplus(reverse(v491), load(tbl, 88 * VECWIDTH + tbloffset), times(v491, load(tbl, 89 * VECWIDTH + tbloffset))); + real2 v567 = reverse(minus(v492, v493)); + real2 v573 = plus(v492, v493); + real2 v571 = minusplus(uminus(v567), v568); + real2 v569 = minusplus(v567, v568); + real2 v579 = timesminusplus(reverse(v569), load(tbl, 102 * VECWIDTH + tbloffset), times(v569, load(tbl, 103 * VECWIDTH + tbloffset))); + real2 v585 = timesminusplus(reverse(v571), load(tbl, 104 * VECWIDTH + tbloffset), times(v571, load(tbl, 105 * VECWIDTH + tbloffset))); + real2 v739 = plus(v585, v625); + real2 v733 = reverse(minus(v585, v625)); + real2 v707 = reverse(minus(v579, v619)); + real2 v713 = plus(v579, v619); + real2 v648 = minus(v573, v572); + real2 v652 = plus(v572, v573); + real2 v673 = plus(v652, v653); + real2 v667 = reverse(minus(v652, v653)); + real2 v651 = minusplus(uminus(v647), v648); + real2 v649 = minusplus(v647, v648); + real2 v659 = timesminusplus(reverse(v649), load(tbl, 118 * VECWIDTH + tbloffset), times(v649, load(tbl, 119 * VECWIDTH + tbloffset))); + real2 v665 = timesminusplus(reverse(v651), load(tbl, 120 * VECWIDTH + tbloffset), times(v651, load(tbl, 121 * VECWIDTH + tbloffset))); + real2 v780 = minus(v499, v419); + real2 v784 = plus(v419, v499); + real2 v781 = minusplus(v779, v780); + real2 v783 = minusplus(uminus(v779), v780); + real2 v805 = plus(v784, v785); + real2 v799 = reverse(minus(v784, v785)); + real2 v862 = plus(v425, v505); + real2 v858 = minus(v505, v425); + real2 v859 = minusplus(v857, v858); + real2 v861 = minusplus(uminus(v857), v858); + real2 v875 = timesminusplus(reverse(v861), load(tbl, 152 * VECWIDTH + tbloffset), times(v861, load(tbl, 153 * VECWIDTH + tbloffset))); + real2 v791 = timesminusplus(reverse(v781), load(tbl, 138 * VECWIDTH + tbloffset), times(v781, load(tbl, 139 * VECWIDTH + tbloffset))); + real2 v797 = timesminusplus(reverse(v783), load(tbl, 140 * VECWIDTH + tbloffset), times(v783, load(tbl, 141 * VECWIDTH + tbloffset))); + real2 v883 = plus(v862, v863); + real2 v877 = reverse(minus(v862, v863)); + real2 v869 = timesminusplus(reverse(v859), load(tbl, 150 * VECWIDTH + tbloffset), times(v859, load(tbl, 151 * VECWIDTH + tbloffset))); + real2 v36 = load(in, 34 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v108 = minus(v36, v4); + real2 v112 = plus(v4, v36); + real2 v52 = load(in, 50 << inShift); + real2 v20 = load(in, 18 << inShift); + real2 v113 = plus(v20, v52); + real2 v107 = reverse(minus(v20, v52)); + real2 v428 = minus(v113, v112); + real2 v432 = plus(v112, v113); + real2 v12 = load(in, 10 << inShift); + real2 v44 = load(in, 42 << inShift); + real2 v268 = minus(v44, v12); + real2 v272 = plus(v12, v44); + real2 v28 = load(in, 26 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v267 = reverse(minus(v28, v60)); + real2 v273 = plus(v28, v60); + real2 v427 = reverse(minus(v272, v273)); + real2 v433 = plus(v272, v273); + real2 v431 = minusplus(uminus(v427), v428); + real2 v429 = minusplus(v427, v428); + real2 v439 = timesminusplus(reverse(v429), load(tbl, 74 * VECWIDTH + tbloffset), times(v429, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v588 = minus(v433, v432); + real2 v592 = plus(v432, v433); + real2 v40 = load(in, 38 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v188 = minus(v40, v8); + real2 v192 = plus(v8, v40); + real2 v24 = load(in, 22 << inShift); + real2 v56 = load(in, 54 << inShift); + real2 v187 = reverse(minus(v24, v56)); + real2 v193 = plus(v24, v56); + real2 v512 = plus(v192, v193); + real2 v508 = minus(v193, v192); + real2 v32 = load(in, 30 << inShift); + real2 v64 = load(in, 62 << inShift); + real2 v347 = reverse(minus(v32, v64)); + real2 v353 = plus(v32, v64); + real2 v48 = load(in, 46 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v348 = minus(v48, v16); + real2 v352 = plus(v16, v48); + real2 v513 = plus(v352, v353); + real2 v507 = reverse(minus(v352, v353)); + real2 v587 = reverse(minus(v512, v513)); + real2 v593 = plus(v512, v513); + real2 v633 = plus(v592, v593); + real2 v627 = reverse(minus(v592, v593)); + real2 v591 = minusplus(uminus(v587), v588); + real2 v589 = minusplus(v587, v588); + real2 v605 = timesminusplus(reverse(v591), load(tbl, 108 * VECWIDTH + tbloffset), times(v591, load(tbl, 109 * VECWIDTH + tbloffset))); + real2 v599 = timesminusplus(reverse(v589), load(tbl, 106 * VECWIDTH + tbloffset), times(v589, load(tbl, 107 * VECWIDTH + tbloffset))); + real2 v46 = load(in, 44 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v312 = plus(v14, v46); + real2 v308 = minus(v46, v14); + real2 v62 = load(in, 60 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v313 = plus(v30, v62); + real2 v307 = reverse(minus(v30, v62)); + real2 v467 = reverse(minus(v312, v313)); + real2 v473 = plus(v312, v313); + real2 v22 = load(in, 20 << inShift); + real2 v54 = load(in, 52 << inShift); + real2 v147 = reverse(minus(v22, v54)); + real2 v153 = plus(v22, v54); + real2 v6 = load(in, 4 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v148 = minus(v38, v6); + real2 v152 = plus(v6, v38); + real2 v472 = plus(v152, v153); + real2 v468 = minus(v153, v152); + real2 v547 = reverse(minus(v472, v473)); + real2 v553 = plus(v472, v473); + real2 v10 = load(in, 8 << inShift); + real2 v42 = load(in, 40 << inShift); + real2 v232 = plus(v10, v42); + real2 v228 = minus(v42, v10); + real2 v58 = load(in, 56 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v233 = plus(v26, v58); + real2 v227 = reverse(minus(v26, v58)); + real2 v393 = plus(v232, v233); + real2 v387 = reverse(minus(v232, v233)); + real2 v2 = load(in, 0 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v18 = load(in, 16 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v73 = plus(v18, v50); + real2 v67 = reverse(minus(v18, v50)); + real2 v388 = minus(v73, v72); + real2 v392 = plus(v72, v73); + real2 v548 = minus(v393, v392); + real2 v552 = plus(v392, v393); + real2 v628 = minus(v553, v552); + real2 v632 = plus(v552, v553); + real2 v672 = plus(v632, v633); + real2 v668 = minus(v633, v632); + scatter(out, 0, 64, plus(v672, v673)); + real2 v686 = minus(v672, v673); + scatter(out, 32, 64, timesminusplus(v686, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v686), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v669 = minusplus(v667, v668); + real2 v671 = minusplus(uminus(v667), v668); + scatter(out, 48, 64, timesminusplus(reverse(v671), load(tbl, 124 * VECWIDTH + tbloffset), times(v671, load(tbl, 125 * VECWIDTH + tbloffset)))); + scatter(out, 16, 64, timesminusplus(reverse(v669), load(tbl, 122 * VECWIDTH + tbloffset), times(v669, load(tbl, 123 * VECWIDTH + tbloffset)))); + real2 v631 = minusplus(uminus(v627), v628); + real2 v629 = minusplus(v627, v628); + real2 v639 = timesminusplus(reverse(v629), load(tbl, 114 * VECWIDTH + tbloffset), times(v629, load(tbl, 115 * VECWIDTH + tbloffset))); + scatter(out, 8, 64, plus(v639, v659)); + real2 v694 = minus(v639, v659); + scatter(out, 40, 64, timesminusplus(v694, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v694), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v645 = timesminusplus(reverse(v631), load(tbl, 116 * VECWIDTH + tbloffset), times(v631, load(tbl, 117 * VECWIDTH + tbloffset))); + scatter(out, 24, 64, plus(v645, v665)); + real2 v700 = minus(v645, v665); + scatter(out, 56, 64, timesminusplus(v700, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v700), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v549 = minusplus(v547, v548); + real2 v551 = minusplus(uminus(v547), v548); + real2 v559 = timesminusplus(reverse(v549), load(tbl, 98 * VECWIDTH + tbloffset), times(v549, load(tbl, 99 * VECWIDTH + tbloffset))); + real2 v708 = minus(v599, v559); + real2 v712 = plus(v559, v599); + scatter(out, 4, 64, plus(v712, v713)); + real2 v726 = minus(v712, v713); + scatter(out, 36, 64, timesminusplus(v726, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v726), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v711 = minusplus(uminus(v707), v708); + real2 v709 = minusplus(v707, v708); + scatter(out, 20, 64, timesminusplus(reverse(v709), load(tbl, 126 * VECWIDTH + tbloffset), times(v709, load(tbl, 127 * VECWIDTH + tbloffset)))); + scatter(out, 52, 64, timesminusplus(reverse(v711), load(tbl, 128 * VECWIDTH + tbloffset), times(v711, load(tbl, 129 * VECWIDTH + tbloffset)))); + real2 v565 = timesminusplus(reverse(v551), load(tbl, 100 * VECWIDTH + tbloffset), times(v551, load(tbl, 101 * VECWIDTH + tbloffset))); + real2 v738 = plus(v565, v605); + real2 v734 = minus(v605, v565); + scatter(out, 12, 64, plus(v738, v739)); + real2 v752 = minus(v738, v739); + scatter(out, 44, 64, timesminusplus(v752, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v752), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v737 = minusplus(uminus(v733), v734); + scatter(out, 60, 64, timesminusplus(reverse(v737), load(tbl, 132 * VECWIDTH + tbloffset), times(v737, load(tbl, 133 * VECWIDTH + tbloffset)))); + real2 v735 = minusplus(v733, v734); + scatter(out, 28, 64, timesminusplus(reverse(v735), load(tbl, 130 * VECWIDTH + tbloffset), times(v735, load(tbl, 131 * VECWIDTH + tbloffset)))); + real2 v471 = minusplus(uminus(v467), v468); + real2 v469 = minusplus(v467, v468); + real2 v479 = timesminusplus(reverse(v469), load(tbl, 82 * VECWIDTH + tbloffset), times(v469, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v511 = minusplus(uminus(v507), v508); + real2 v509 = minusplus(v507, v508); + real2 v519 = timesminusplus(reverse(v509), load(tbl, 90 * VECWIDTH + tbloffset), times(v509, load(tbl, 91 * VECWIDTH + tbloffset))); + real2 v765 = plus(v439, v519); + real2 v759 = reverse(minus(v439, v519)); + real2 v389 = minusplus(v387, v388); + real2 v391 = minusplus(uminus(v387), v388); + real2 v399 = timesminusplus(reverse(v389), load(tbl, 66 * VECWIDTH + tbloffset), times(v389, load(tbl, 67 * VECWIDTH + tbloffset))); + real2 v764 = plus(v399, v479); + real2 v760 = minus(v479, v399); + real2 v804 = plus(v764, v765); + real2 v800 = minus(v765, v764); + scatter(out, 2, 64, plus(v804, v805)); + real2 v818 = minus(v804, v805); + scatter(out, 34, 64, timesminusplus(v818, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v818), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v803 = minusplus(uminus(v799), v800); + scatter(out, 50, 64, timesminusplus(reverse(v803), load(tbl, 144 * VECWIDTH + tbloffset), times(v803, load(tbl, 145 * VECWIDTH + tbloffset)))); + real2 v801 = minusplus(v799, v800); + scatter(out, 18, 64, timesminusplus(reverse(v801), load(tbl, 142 * VECWIDTH + tbloffset), times(v801, load(tbl, 143 * VECWIDTH + tbloffset)))); + real2 v763 = minusplus(uminus(v759), v760); + real2 v761 = minusplus(v759, v760); + real2 v777 = timesminusplus(reverse(v763), load(tbl, 136 * VECWIDTH + tbloffset), times(v763, load(tbl, 137 * VECWIDTH + tbloffset))); + scatter(out, 26, 64, plus(v777, v797)); + real2 v830 = minus(v777, v797); + scatter(out, 58, 64, timesminusplus(v830, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v830), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v771 = timesminusplus(reverse(v761), load(tbl, 134 * VECWIDTH + tbloffset), times(v761, load(tbl, 135 * VECWIDTH + tbloffset))); + scatter(out, 10, 64, plus(v771, v791)); + real2 v824 = minus(v771, v791); + scatter(out, 42, 64, timesminusplus(v824, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v824), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v445 = timesminusplus(reverse(v431), load(tbl, 76 * VECWIDTH + tbloffset), times(v431, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v525 = timesminusplus(reverse(v511), load(tbl, 92 * VECWIDTH + tbloffset), times(v511, load(tbl, 93 * VECWIDTH + tbloffset))); + real2 v837 = reverse(minus(v445, v525)); + real2 v843 = plus(v445, v525); + real2 v485 = timesminusplus(reverse(v471), load(tbl, 84 * VECWIDTH + tbloffset), times(v471, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v405 = timesminusplus(reverse(v391), load(tbl, 68 * VECWIDTH + tbloffset), times(v391, load(tbl, 69 * VECWIDTH + tbloffset))); + real2 v838 = minus(v485, v405); + real2 v842 = plus(v405, v485); + real2 v878 = minus(v843, v842); + real2 v882 = plus(v842, v843); + scatter(out, 6, 64, plus(v882, v883)); + real2 v896 = minus(v882, v883); + scatter(out, 38, 64, timesminusplus(v896, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v896), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v881 = minusplus(uminus(v877), v878); + scatter(out, 54, 64, timesminusplus(reverse(v881), load(tbl, 156 * VECWIDTH + tbloffset), times(v881, load(tbl, 157 * VECWIDTH + tbloffset)))); + real2 v879 = minusplus(v877, v878); + scatter(out, 22, 64, timesminusplus(reverse(v879), load(tbl, 154 * VECWIDTH + tbloffset), times(v879, load(tbl, 155 * VECWIDTH + tbloffset)))); + real2 v841 = minusplus(uminus(v837), v838); + real2 v839 = minusplus(v837, v838); + real2 v855 = timesminusplus(reverse(v841), load(tbl, 148 * VECWIDTH + tbloffset), times(v841, load(tbl, 149 * VECWIDTH + tbloffset))); + scatter(out, 30, 64, plus(v855, v875)); + real2 v908 = minus(v855, v875); + scatter(out, 62, 64, timesminusplus(v908, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v908), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v849 = timesminusplus(reverse(v839), load(tbl, 146 * VECWIDTH + tbloffset), times(v839, load(tbl, 147 * VECWIDTH + tbloffset))); + scatter(out, 14, 64, plus(v849, v869)); + real2 v902 = minus(v849, v869); + scatter(out, 46, 64, timesminusplus(v902, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v902), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v151 = minusplus(uminus(v147), v148); + real2 v149 = minusplus(v147, v148); + real2 v311 = minusplus(uminus(v307), v308); + real2 v309 = minusplus(v307, v308); + real2 v109 = minusplus(v107, v108); + real2 v111 = minusplus(uminus(v107), v108); + real2 v119 = timesminusplus(reverse(v109), load(tbl, 10 * VECWIDTH + tbloffset), times(v109, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v269 = minusplus(v267, v268); + real2 v271 = minusplus(uminus(v267), v268); + real2 v279 = timesminusplus(reverse(v269), load(tbl, 42 * VECWIDTH + tbloffset), times(v269, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v960 = plus(v119, v279); + real2 v956 = minus(v279, v119); + real2 v169 = minusplus(v167, v168); + real2 v171 = minusplus(uminus(v167), v168); + real2 v159 = timesminusplus(reverse(v149), load(tbl, 18 * VECWIDTH + tbloffset), times(v149, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v319 = timesminusplus(reverse(v309), load(tbl, 50 * VECWIDTH + tbloffset), times(v309, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v921 = plus(v159, v319); + real2 v915 = reverse(minus(v159, v319)); + real2 v351 = minusplus(uminus(v347), v348); + real2 v349 = minusplus(v347, v348); + real2 v359 = timesminusplus(reverse(v349), load(tbl, 58 * VECWIDTH + tbloffset), times(v349, load(tbl, 59 * VECWIDTH + tbloffset))); + real2 v191 = minusplus(uminus(v187), v188); + real2 v189 = minusplus(v187, v188); + real2 v199 = timesminusplus(reverse(v189), load(tbl, 26 * VECWIDTH + tbloffset), times(v189, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v961 = plus(v199, v359); + real2 v955 = reverse(minus(v199, v359)); + real2 v995 = reverse(minus(v960, v961)); + real2 v1001 = plus(v960, v961); + real2 v179 = timesminusplus(reverse(v169), load(tbl, 22 * VECWIDTH + tbloffset), times(v169, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v941 = plus(v179, v339); + real2 v935 = reverse(minus(v179, v339)); + real2 v1016 = minus(v941, v940); + real2 v1020 = plus(v940, v941); + real2 v71 = minusplus(uminus(v67), v68); + real2 v69 = minusplus(v67, v68); + real2 v79 = timesminusplus(reverse(v69), load(tbl, 2 * VECWIDTH + tbloffset), times(v69, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v1041 = plus(v1020, v1021); + real2 v1035 = reverse(minus(v1020, v1021)); + real2 v229 = minusplus(v227, v228); + real2 v231 = minusplus(uminus(v227), v228); + real2 v239 = timesminusplus(reverse(v229), load(tbl, 34 * VECWIDTH + tbloffset), times(v229, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v920 = plus(v79, v239); + real2 v916 = minus(v239, v79); + real2 v996 = minus(v921, v920); + real2 v1000 = plus(v920, v921); + real2 v1040 = plus(v1000, v1001); + real2 v1036 = minus(v1001, v1000); + scatter(out, 1, 64, plus(v1040, v1041)); + real2 v1054 = minus(v1040, v1041); + scatter(out, 33, 64, timesminusplus(v1054, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1054), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1037 = minusplus(v1035, v1036); + real2 v1039 = minusplus(uminus(v1035), v1036); + scatter(out, 49, 64, timesminusplus(reverse(v1039), load(tbl, 184 * VECWIDTH + tbloffset), times(v1039, load(tbl, 185 * VECWIDTH + tbloffset)))); + scatter(out, 17, 64, timesminusplus(reverse(v1037), load(tbl, 182 * VECWIDTH + tbloffset), times(v1037, load(tbl, 183 * VECWIDTH + tbloffset)))); + real2 v1017 = minusplus(v1015, v1016); + real2 v1019 = minusplus(uminus(v1015), v1016); + real2 v1033 = timesminusplus(reverse(v1019), load(tbl, 180 * VECWIDTH + tbloffset), times(v1019, load(tbl, 181 * VECWIDTH + tbloffset))); + real2 v997 = minusplus(v995, v996); + real2 v999 = minusplus(uminus(v995), v996); + real2 v1013 = timesminusplus(reverse(v999), load(tbl, 176 * VECWIDTH + tbloffset), times(v999, load(tbl, 177 * VECWIDTH + tbloffset))); + scatter(out, 25, 64, plus(v1013, v1033)); + real2 v1066 = minus(v1013, v1033); + scatter(out, 57, 64, timesminusplus(v1066, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1066), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1027 = timesminusplus(reverse(v1017), load(tbl, 178 * VECWIDTH + tbloffset), times(v1017, load(tbl, 179 * VECWIDTH + tbloffset))); + real2 v1007 = timesminusplus(reverse(v997), load(tbl, 174 * VECWIDTH + tbloffset), times(v997, load(tbl, 175 * VECWIDTH + tbloffset))); + scatter(out, 9, 64, plus(v1007, v1027)); + real2 v1060 = minus(v1007, v1027); + scatter(out, 41, 64, timesminusplus(v1060, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1060), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v937 = minusplus(v935, v936); + real2 v939 = minusplus(uminus(v935), v936); + real2 v959 = minusplus(uminus(v955), v956); + real2 v957 = minusplus(v955, v956); + real2 v967 = timesminusplus(reverse(v957), load(tbl, 166 * VECWIDTH + tbloffset), times(v957, load(tbl, 167 * VECWIDTH + tbloffset))); + real2 v947 = timesminusplus(reverse(v937), load(tbl, 162 * VECWIDTH + tbloffset), times(v937, load(tbl, 163 * VECWIDTH + tbloffset))); + real2 v919 = minusplus(uminus(v915), v916); + real2 v917 = minusplus(v915, v916); + real2 v1079 = plus(v947, v987); + real2 v1073 = reverse(minus(v947, v987)); + real2 v927 = timesminusplus(reverse(v917), load(tbl, 158 * VECWIDTH + tbloffset), times(v917, load(tbl, 159 * VECWIDTH + tbloffset))); + real2 v1074 = minus(v967, v927); + real2 v1078 = plus(v927, v967); + scatter(out, 5, 64, plus(v1078, v1079)); + real2 v1092 = minus(v1078, v1079); + scatter(out, 37, 64, timesminusplus(v1092, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1092), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1075 = minusplus(v1073, v1074); + scatter(out, 21, 64, timesminusplus(reverse(v1075), load(tbl, 186 * VECWIDTH + tbloffset), times(v1075, load(tbl, 187 * VECWIDTH + tbloffset)))); + real2 v1077 = minusplus(uminus(v1073), v1074); + scatter(out, 53, 64, timesminusplus(reverse(v1077), load(tbl, 188 * VECWIDTH + tbloffset), times(v1077, load(tbl, 189 * VECWIDTH + tbloffset)))); + real2 v953 = timesminusplus(reverse(v939), load(tbl, 164 * VECWIDTH + tbloffset), times(v939, load(tbl, 165 * VECWIDTH + tbloffset))); + real2 v1099 = reverse(minus(v953, v993)); + real2 v1105 = plus(v953, v993); + real2 v973 = timesminusplus(reverse(v959), load(tbl, 168 * VECWIDTH + tbloffset), times(v959, load(tbl, 169 * VECWIDTH + tbloffset))); + real2 v933 = timesminusplus(reverse(v919), load(tbl, 160 * VECWIDTH + tbloffset), times(v919, load(tbl, 161 * VECWIDTH + tbloffset))); + real2 v1104 = plus(v933, v973); + real2 v1100 = minus(v973, v933); + scatter(out, 13, 64, plus(v1104, v1105)); + real2 v1118 = minus(v1104, v1105); + scatter(out, 45, 64, timesminusplus(v1118, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1118), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1101 = minusplus(v1099, v1100); + scatter(out, 29, 64, timesminusplus(reverse(v1101), load(tbl, 190 * VECWIDTH + tbloffset), times(v1101, load(tbl, 191 * VECWIDTH + tbloffset)))); + real2 v1103 = minusplus(uminus(v1099), v1100); + scatter(out, 61, 64, timesminusplus(reverse(v1103), load(tbl, 192 * VECWIDTH + tbloffset), times(v1103, load(tbl, 193 * VECWIDTH + tbloffset)))); + real2 v345 = timesminusplus(reverse(v331), load(tbl, 56 * VECWIDTH + tbloffset), times(v331, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v325 = timesminusplus(reverse(v311), load(tbl, 52 * VECWIDTH + tbloffset), times(v311, load(tbl, 53 * VECWIDTH + tbloffset))); + real2 v265 = timesminusplus(reverse(v251), load(tbl, 40 * VECWIDTH + tbloffset), times(v251, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v185 = timesminusplus(reverse(v171), load(tbl, 24 * VECWIDTH + tbloffset), times(v171, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v165 = timesminusplus(reverse(v151), load(tbl, 20 * VECWIDTH + tbloffset), times(v151, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v1131 = plus(v165, v325); + real2 v1125 = reverse(minus(v165, v325)); + real2 v1151 = plus(v185, v345); + real2 v1145 = reverse(minus(v185, v345)); + real2 v105 = timesminusplus(reverse(v91), load(tbl, 8 * VECWIDTH + tbloffset), times(v91, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v1150 = plus(v105, v265); + real2 v1146 = minus(v265, v105); + real2 v1226 = minus(v1151, v1150); + real2 v1230 = plus(v1150, v1151); + real2 v1231 = plus(v1190, v1191); + real2 v1225 = reverse(minus(v1190, v1191)); + real2 v1245 = reverse(minus(v1230, v1231)); + real2 v1251 = plus(v1230, v1231); + real2 v365 = timesminusplus(reverse(v351), load(tbl, 60 * VECWIDTH + tbloffset), times(v351, load(tbl, 61 * VECWIDTH + tbloffset))); + real2 v285 = timesminusplus(reverse(v271), load(tbl, 44 * VECWIDTH + tbloffset), times(v271, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v205 = timesminusplus(reverse(v191), load(tbl, 28 * VECWIDTH + tbloffset), times(v191, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v1171 = plus(v205, v365); + real2 v1165 = reverse(minus(v205, v365)); + real2 v125 = timesminusplus(reverse(v111), load(tbl, 12 * VECWIDTH + tbloffset), times(v111, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v85 = timesminusplus(reverse(v71), load(tbl, 4 * VECWIDTH + tbloffset), times(v71, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v245 = timesminusplus(reverse(v231), load(tbl, 36 * VECWIDTH + tbloffset), times(v231, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v1126 = minus(v245, v85); + real2 v1130 = plus(v85, v245); + real2 v1210 = plus(v1130, v1131); + real2 v1206 = minus(v1131, v1130); + real2 v1166 = minus(v285, v125); + real2 v1170 = plus(v125, v285); + real2 v1211 = plus(v1170, v1171); + real2 v1205 = reverse(minus(v1170, v1171)); + real2 v1246 = minus(v1211, v1210); + real2 v1250 = plus(v1210, v1211); + scatter(out, 3, 64, plus(v1250, v1251)); + real2 v1264 = minus(v1250, v1251); + scatter(out, 35, 64, timesminusplus(v1264, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1264), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1247 = minusplus(v1245, v1246); + real2 v1249 = minusplus(uminus(v1245), v1246); + scatter(out, 19, 64, timesminusplus(reverse(v1247), load(tbl, 218 * VECWIDTH + tbloffset), times(v1247, load(tbl, 219 * VECWIDTH + tbloffset)))); + scatter(out, 51, 64, timesminusplus(reverse(v1249), load(tbl, 220 * VECWIDTH + tbloffset), times(v1249, load(tbl, 221 * VECWIDTH + tbloffset)))); + real2 v1229 = minusplus(uminus(v1225), v1226); + real2 v1227 = minusplus(v1225, v1226); + real2 v1207 = minusplus(v1205, v1206); + real2 v1209 = minusplus(uminus(v1205), v1206); + real2 v1237 = timesminusplus(reverse(v1227), load(tbl, 214 * VECWIDTH + tbloffset), times(v1227, load(tbl, 215 * VECWIDTH + tbloffset))); + real2 v1217 = timesminusplus(reverse(v1207), load(tbl, 210 * VECWIDTH + tbloffset), times(v1207, load(tbl, 211 * VECWIDTH + tbloffset))); + scatter(out, 11, 64, plus(v1217, v1237)); + real2 v1270 = minus(v1217, v1237); + scatter(out, 43, 64, timesminusplus(v1270, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1270), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1223 = timesminusplus(reverse(v1209), load(tbl, 212 * VECWIDTH + tbloffset), times(v1209, load(tbl, 213 * VECWIDTH + tbloffset))); + real2 v1243 = timesminusplus(reverse(v1229), load(tbl, 216 * VECWIDTH + tbloffset), times(v1229, load(tbl, 217 * VECWIDTH + tbloffset))); + scatter(out, 27, 64, plus(v1223, v1243)); + real2 v1276 = minus(v1223, v1243); + scatter(out, 59, 64, timesminusplus(v1276, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1276), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1189 = minusplus(uminus(v1185), v1186); + real2 v1187 = minusplus(v1185, v1186); + real2 v1129 = minusplus(uminus(v1125), v1126); + real2 v1127 = minusplus(v1125, v1126); + real2 v1147 = minusplus(v1145, v1146); + real2 v1149 = minusplus(uminus(v1145), v1146); + real2 v1167 = minusplus(v1165, v1166); + real2 v1169 = minusplus(uminus(v1165), v1166); + real2 v1143 = timesminusplus(reverse(v1129), load(tbl, 196 * VECWIDTH + tbloffset), times(v1129, load(tbl, 197 * VECWIDTH + tbloffset))); + real2 v1163 = timesminusplus(reverse(v1149), load(tbl, 200 * VECWIDTH + tbloffset), times(v1149, load(tbl, 201 * VECWIDTH + tbloffset))); + real2 v1203 = timesminusplus(reverse(v1189), load(tbl, 208 * VECWIDTH + tbloffset), times(v1189, load(tbl, 209 * VECWIDTH + tbloffset))); + real2 v1315 = plus(v1163, v1203); + real2 v1309 = reverse(minus(v1163, v1203)); + real2 v1183 = timesminusplus(reverse(v1169), load(tbl, 204 * VECWIDTH + tbloffset), times(v1169, load(tbl, 205 * VECWIDTH + tbloffset))); + real2 v1314 = plus(v1143, v1183); + real2 v1310 = minus(v1183, v1143); + scatter(out, 15, 64, plus(v1314, v1315)); + real2 v1328 = minus(v1314, v1315); + scatter(out, 47, 64, timesminusplus(v1328, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1328), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1311 = minusplus(v1309, v1310); + scatter(out, 31, 64, timesminusplus(reverse(v1311), load(tbl, 226 * VECWIDTH + tbloffset), times(v1311, load(tbl, 227 * VECWIDTH + tbloffset)))); + real2 v1313 = minusplus(uminus(v1309), v1310); + scatter(out, 63, 64, timesminusplus(reverse(v1313), load(tbl, 228 * VECWIDTH + tbloffset), times(v1313, load(tbl, 229 * VECWIDTH + tbloffset)))); + real2 v1177 = timesminusplus(reverse(v1167), load(tbl, 202 * VECWIDTH + tbloffset), times(v1167, load(tbl, 203 * VECWIDTH + tbloffset))); + real2 v1137 = timesminusplus(reverse(v1127), load(tbl, 194 * VECWIDTH + tbloffset), times(v1127, load(tbl, 195 * VECWIDTH + tbloffset))); + real2 v1197 = timesminusplus(reverse(v1187), load(tbl, 206 * VECWIDTH + tbloffset), times(v1187, load(tbl, 207 * VECWIDTH + tbloffset))); + real2 v1157 = timesminusplus(reverse(v1147), load(tbl, 198 * VECWIDTH + tbloffset), times(v1147, load(tbl, 199 * VECWIDTH + tbloffset))); + real2 v1283 = reverse(minus(v1157, v1197)); + real2 v1289 = plus(v1157, v1197); + real2 v1288 = plus(v1137, v1177); + real2 v1284 = minus(v1177, v1137); + scatter(out, 7, 64, plus(v1288, v1289)); + real2 v1302 = minus(v1288, v1289); + scatter(out, 39, 64, timesminusplus(v1302, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1302), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1285 = minusplus(v1283, v1284); + real2 v1287 = minusplus(uminus(v1283), v1284); + scatter(out, 55, 64, timesminusplus(reverse(v1287), load(tbl, 224 * VECWIDTH + tbloffset), times(v1287, load(tbl, 225 * VECWIDTH + tbloffset)))); + scatter(out, 23, 64, timesminusplus(reverse(v1285), load(tbl, 222 * VECWIDTH + tbloffset), times(v1285, load(tbl, 223 * VECWIDTH + tbloffset)))); +// Pres : 17339 + } +} + +ALIGNED(8192) void tbut64b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + +// Pres : 30254 + real2 v37 = load(in, 35 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v132 = plus(v5, v37); + real2 v128 = minus(v37, v5); + real2 v21 = load(in, 19 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v133 = plus(v21, v53); + real2 v127 = reverse(minus(v53, v21)); + real2 v131 = minusplus(uminus(v127), v128); + real2 v129 = minusplus(v127, v128); + real2 v139 = timesminusplus(reverse(v129), load(tbl, 14 * VECWIDTH + tbloffset), times(v129, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v145 = timesminusplus(reverse(v131), load(tbl, 16 * VECWIDTH + tbloffset), times(v131, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v448 = minus(v133, v132); + real2 v452 = plus(v132, v133); + real2 v45 = load(in, 43 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v292 = plus(v13, v45); + real2 v288 = minus(v45, v13); + real2 v29 = load(in, 27 << inShift); + real2 v61 = load(in, 59 << inShift); + real2 v293 = plus(v29, v61); + real2 v287 = reverse(minus(v61, v29)); + real2 v291 = minusplus(uminus(v287), v288); + real2 v289 = minusplus(v287, v288); + real2 v299 = timesminusplus(reverse(v289), load(tbl, 46 * VECWIDTH + tbloffset), times(v289, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v453 = plus(v292, v293); + real2 v447 = reverse(minus(v293, v292)); + real2 v608 = minus(v453, v452); + real2 v612 = plus(v452, v453); + real2 v980 = plus(v139, v299); + real2 v976 = minus(v299, v139); + real2 v449 = minusplus(v447, v448); + real2 v451 = minusplus(uminus(v447), v448); + real2 v465 = timesminusplus(reverse(v451), load(tbl, 80 * VECWIDTH + tbloffset), times(v451, load(tbl, 81 * VECWIDTH + tbloffset))); + real2 v305 = timesminusplus(reverse(v291), load(tbl, 48 * VECWIDTH + tbloffset), times(v291, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v1186 = minus(v305, v145); + real2 v1190 = plus(v145, v305); + real2 v459 = timesminusplus(reverse(v449), load(tbl, 78 * VECWIDTH + tbloffset), times(v449, load(tbl, 79 * VECWIDTH + tbloffset))); + real2 v25 = load(in, 23 << inShift); + real2 v57 = load(in, 55 << inShift); + real2 v207 = reverse(minus(v57, v25)); + real2 v213 = plus(v25, v57); + real2 v9 = load(in, 7 << inShift); + real2 v41 = load(in, 39 << inShift); + real2 v212 = plus(v9, v41); + real2 v208 = minus(v41, v9); + real2 v528 = minus(v213, v212); + real2 v532 = plus(v212, v213); + real2 v209 = minusplus(v207, v208); + real2 v211 = minusplus(uminus(v207), v208); + real2 v225 = timesminusplus(reverse(v211), load(tbl, 32 * VECWIDTH + tbloffset), times(v211, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v219 = timesminusplus(reverse(v209), load(tbl, 30 * VECWIDTH + tbloffset), times(v209, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v17 = load(in, 15 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v368 = minus(v49, v17); + real2 v372 = plus(v17, v49); + real2 v33 = load(in, 31 << inShift); + real2 v65 = load(in, 63 << inShift); + real2 v367 = reverse(minus(v65, v33)); + real2 v373 = plus(v33, v65); + real2 v369 = minusplus(v367, v368); + real2 v371 = minusplus(uminus(v367), v368); + real2 v533 = plus(v372, v373); + real2 v527 = reverse(minus(v373, v372)); + real2 v607 = reverse(minus(v533, v532)); + real2 v613 = plus(v532, v533); + real2 v529 = minusplus(v527, v528); + real2 v531 = minusplus(uminus(v527), v528); + real2 v545 = timesminusplus(reverse(v531), load(tbl, 96 * VECWIDTH + tbloffset), times(v531, load(tbl, 97 * VECWIDTH + tbloffset))); + real2 v653 = plus(v612, v613); + real2 v647 = reverse(minus(v613, v612)); + real2 v609 = minusplus(v607, v608); + real2 v611 = minusplus(uminus(v607), v608); + real2 v863 = plus(v465, v545); + real2 v857 = reverse(minus(v545, v465)); + real2 v539 = timesminusplus(reverse(v529), load(tbl, 94 * VECWIDTH + tbloffset), times(v529, load(tbl, 95 * VECWIDTH + tbloffset))); + real2 v385 = timesminusplus(reverse(v371), load(tbl, 64 * VECWIDTH + tbloffset), times(v371, load(tbl, 65 * VECWIDTH + tbloffset))); + real2 v619 = timesminusplus(reverse(v609), load(tbl, 110 * VECWIDTH + tbloffset), times(v609, load(tbl, 111 * VECWIDTH + tbloffset))); + real2 v1191 = plus(v225, v385); + real2 v1185 = reverse(minus(v385, v225)); + real2 v779 = reverse(minus(v539, v459)); + real2 v785 = plus(v459, v539); + real2 v625 = timesminusplus(reverse(v611), load(tbl, 112 * VECWIDTH + tbloffset), times(v611, load(tbl, 113 * VECWIDTH + tbloffset))); + real2 v379 = timesminusplus(reverse(v369), load(tbl, 62 * VECWIDTH + tbloffset), times(v369, load(tbl, 63 * VECWIDTH + tbloffset))); + real2 v975 = reverse(minus(v379, v219)); + real2 v981 = plus(v219, v379); + real2 v977 = minusplus(v975, v976); + real2 v979 = minusplus(uminus(v975), v976); + real2 v987 = timesminusplus(reverse(v977), load(tbl, 170 * VECWIDTH + tbloffset), times(v977, load(tbl, 171 * VECWIDTH + tbloffset))); + real2 v993 = timesminusplus(reverse(v979), load(tbl, 172 * VECWIDTH + tbloffset), times(v979, load(tbl, 173 * VECWIDTH + tbloffset))); + real2 v1015 = reverse(minus(v981, v980)); + real2 v1021 = plus(v980, v981); + real2 v11 = load(in, 9 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v248 = minus(v43, v11); + real2 v252 = plus(v11, v43); + real2 v59 = load(in, 57 << inShift); + real2 v27 = load(in, 25 << inShift); + real2 v253 = plus(v27, v59); + real2 v247 = reverse(minus(v59, v27)); + real2 v413 = plus(v252, v253); + real2 v407 = reverse(minus(v253, v252)); + real2 v249 = minusplus(v247, v248); + real2 v251 = minusplus(uminus(v247), v248); + real2 v259 = timesminusplus(reverse(v249), load(tbl, 38 * VECWIDTH + tbloffset), times(v249, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v35 = load(in, 33 << inShift); + real2 v3 = load(in, 1 << inShift); + real2 v92 = plus(v3, v35); + real2 v88 = minus(v35, v3); + real2 v51 = load(in, 49 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v87 = reverse(minus(v51, v19)); + real2 v93 = plus(v19, v51); + real2 v412 = plus(v92, v93); + real2 v408 = minus(v93, v92); + real2 v411 = minusplus(uminus(v407), v408); + real2 v409 = minusplus(v407, v408); + real2 v91 = minusplus(uminus(v87), v88); + real2 v89 = minusplus(v87, v88); + real2 v99 = timesminusplus(reverse(v89), load(tbl, 6 * VECWIDTH + tbloffset), times(v89, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v425 = timesminusplus(reverse(v411), load(tbl, 72 * VECWIDTH + tbloffset), times(v411, load(tbl, 73 * VECWIDTH + tbloffset))); + real2 v568 = minus(v413, v412); + real2 v572 = plus(v412, v413); + real2 v940 = plus(v99, v259); + real2 v936 = minus(v259, v99); + real2 v419 = timesminusplus(reverse(v409), load(tbl, 70 * VECWIDTH + tbloffset), times(v409, load(tbl, 71 * VECWIDTH + tbloffset))); + real2 v47 = load(in, 45 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v332 = plus(v15, v47); + real2 v328 = minus(v47, v15); + real2 v63 = load(in, 61 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v327 = reverse(minus(v63, v31)); + real2 v333 = plus(v31, v63); + real2 v329 = minusplus(v327, v328); + real2 v331 = minusplus(uminus(v327), v328); + real2 v339 = timesminusplus(reverse(v329), load(tbl, 54 * VECWIDTH + tbloffset), times(v329, load(tbl, 55 * VECWIDTH + tbloffset))); + real2 v487 = reverse(minus(v333, v332)); + real2 v493 = plus(v332, v333); + real2 v7 = load(in, 5 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v172 = plus(v7, v39); + real2 v168 = minus(v39, v7); + real2 v55 = load(in, 53 << inShift); + real2 v23 = load(in, 21 << inShift); + real2 v173 = plus(v23, v55); + real2 v167 = reverse(minus(v55, v23)); + real2 v488 = minus(v173, v172); + real2 v492 = plus(v172, v173); + real2 v491 = minusplus(uminus(v487), v488); + real2 v489 = minusplus(v487, v488); + real2 v499 = timesminusplus(reverse(v489), load(tbl, 86 * VECWIDTH + tbloffset), times(v489, load(tbl, 87 * VECWIDTH + tbloffset))); + real2 v505 = timesminusplus(reverse(v491), load(tbl, 88 * VECWIDTH + tbloffset), times(v491, load(tbl, 89 * VECWIDTH + tbloffset))); + real2 v567 = reverse(minus(v493, v492)); + real2 v573 = plus(v492, v493); + real2 v571 = minusplus(uminus(v567), v568); + real2 v569 = minusplus(v567, v568); + real2 v579 = timesminusplus(reverse(v569), load(tbl, 102 * VECWIDTH + tbloffset), times(v569, load(tbl, 103 * VECWIDTH + tbloffset))); + real2 v585 = timesminusplus(reverse(v571), load(tbl, 104 * VECWIDTH + tbloffset), times(v571, load(tbl, 105 * VECWIDTH + tbloffset))); + real2 v739 = plus(v585, v625); + real2 v733 = reverse(minus(v625, v585)); + real2 v707 = reverse(minus(v619, v579)); + real2 v713 = plus(v579, v619); + real2 v648 = minus(v573, v572); + real2 v652 = plus(v572, v573); + real2 v673 = plus(v652, v653); + real2 v667 = reverse(minus(v653, v652)); + real2 v651 = minusplus(uminus(v647), v648); + real2 v649 = minusplus(v647, v648); + real2 v659 = timesminusplus(reverse(v649), load(tbl, 118 * VECWIDTH + tbloffset), times(v649, load(tbl, 119 * VECWIDTH + tbloffset))); + real2 v665 = timesminusplus(reverse(v651), load(tbl, 120 * VECWIDTH + tbloffset), times(v651, load(tbl, 121 * VECWIDTH + tbloffset))); + real2 v780 = minus(v499, v419); + real2 v784 = plus(v419, v499); + real2 v781 = minusplus(v779, v780); + real2 v783 = minusplus(uminus(v779), v780); + real2 v805 = plus(v784, v785); + real2 v799 = reverse(minus(v785, v784)); + real2 v862 = plus(v425, v505); + real2 v858 = minus(v505, v425); + real2 v859 = minusplus(v857, v858); + real2 v861 = minusplus(uminus(v857), v858); + real2 v875 = timesminusplus(reverse(v861), load(tbl, 152 * VECWIDTH + tbloffset), times(v861, load(tbl, 153 * VECWIDTH + tbloffset))); + real2 v791 = timesminusplus(reverse(v781), load(tbl, 138 * VECWIDTH + tbloffset), times(v781, load(tbl, 139 * VECWIDTH + tbloffset))); + real2 v797 = timesminusplus(reverse(v783), load(tbl, 140 * VECWIDTH + tbloffset), times(v783, load(tbl, 141 * VECWIDTH + tbloffset))); + real2 v883 = plus(v862, v863); + real2 v877 = reverse(minus(v863, v862)); + real2 v869 = timesminusplus(reverse(v859), load(tbl, 150 * VECWIDTH + tbloffset), times(v859, load(tbl, 151 * VECWIDTH + tbloffset))); + real2 v36 = load(in, 34 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v108 = minus(v36, v4); + real2 v112 = plus(v4, v36); + real2 v52 = load(in, 50 << inShift); + real2 v20 = load(in, 18 << inShift); + real2 v113 = plus(v20, v52); + real2 v107 = reverse(minus(v52, v20)); + real2 v428 = minus(v113, v112); + real2 v432 = plus(v112, v113); + real2 v12 = load(in, 10 << inShift); + real2 v44 = load(in, 42 << inShift); + real2 v268 = minus(v44, v12); + real2 v272 = plus(v12, v44); + real2 v28 = load(in, 26 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v267 = reverse(minus(v60, v28)); + real2 v273 = plus(v28, v60); + real2 v427 = reverse(minus(v273, v272)); + real2 v433 = plus(v272, v273); + real2 v431 = minusplus(uminus(v427), v428); + real2 v429 = minusplus(v427, v428); + real2 v439 = timesminusplus(reverse(v429), load(tbl, 74 * VECWIDTH + tbloffset), times(v429, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v588 = minus(v433, v432); + real2 v592 = plus(v432, v433); + real2 v40 = load(in, 38 << inShift); + real2 v8 = load(in, 6 << inShift); + real2 v188 = minus(v40, v8); + real2 v192 = plus(v8, v40); + real2 v24 = load(in, 22 << inShift); + real2 v56 = load(in, 54 << inShift); + real2 v187 = reverse(minus(v56, v24)); + real2 v193 = plus(v24, v56); + real2 v512 = plus(v192, v193); + real2 v508 = minus(v193, v192); + real2 v32 = load(in, 30 << inShift); + real2 v64 = load(in, 62 << inShift); + real2 v347 = reverse(minus(v64, v32)); + real2 v353 = plus(v32, v64); + real2 v48 = load(in, 46 << inShift); + real2 v16 = load(in, 14 << inShift); + real2 v348 = minus(v48, v16); + real2 v352 = plus(v16, v48); + real2 v513 = plus(v352, v353); + real2 v507 = reverse(minus(v353, v352)); + real2 v587 = reverse(minus(v513, v512)); + real2 v593 = plus(v512, v513); + real2 v633 = plus(v592, v593); + real2 v627 = reverse(minus(v593, v592)); + real2 v591 = minusplus(uminus(v587), v588); + real2 v589 = minusplus(v587, v588); + real2 v605 = timesminusplus(reverse(v591), load(tbl, 108 * VECWIDTH + tbloffset), times(v591, load(tbl, 109 * VECWIDTH + tbloffset))); + real2 v599 = timesminusplus(reverse(v589), load(tbl, 106 * VECWIDTH + tbloffset), times(v589, load(tbl, 107 * VECWIDTH + tbloffset))); + real2 v46 = load(in, 44 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v312 = plus(v14, v46); + real2 v308 = minus(v46, v14); + real2 v62 = load(in, 60 << inShift); + real2 v30 = load(in, 28 << inShift); + real2 v313 = plus(v30, v62); + real2 v307 = reverse(minus(v62, v30)); + real2 v467 = reverse(minus(v313, v312)); + real2 v473 = plus(v312, v313); + real2 v22 = load(in, 20 << inShift); + real2 v54 = load(in, 52 << inShift); + real2 v147 = reverse(minus(v54, v22)); + real2 v153 = plus(v22, v54); + real2 v6 = load(in, 4 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v148 = minus(v38, v6); + real2 v152 = plus(v6, v38); + real2 v472 = plus(v152, v153); + real2 v468 = minus(v153, v152); + real2 v547 = reverse(minus(v473, v472)); + real2 v553 = plus(v472, v473); + real2 v10 = load(in, 8 << inShift); + real2 v42 = load(in, 40 << inShift); + real2 v232 = plus(v10, v42); + real2 v228 = minus(v42, v10); + real2 v58 = load(in, 56 << inShift); + real2 v26 = load(in, 24 << inShift); + real2 v233 = plus(v26, v58); + real2 v227 = reverse(minus(v58, v26)); + real2 v393 = plus(v232, v233); + real2 v387 = reverse(minus(v233, v232)); + real2 v2 = load(in, 0 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v72 = plus(v2, v34); + real2 v68 = minus(v34, v2); + real2 v18 = load(in, 16 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v73 = plus(v18, v50); + real2 v67 = reverse(minus(v50, v18)); + real2 v388 = minus(v73, v72); + real2 v392 = plus(v72, v73); + real2 v548 = minus(v393, v392); + real2 v552 = plus(v392, v393); + real2 v628 = minus(v553, v552); + real2 v632 = plus(v552, v553); + real2 v672 = plus(v632, v633); + real2 v668 = minus(v633, v632); + scatter(out, 0, 64, plus(v672, v673)); + real2 v686 = minus(v672, v673); + scatter(out, 32, 64, timesminusplus(v686, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v686), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v669 = minusplus(v667, v668); + real2 v671 = minusplus(uminus(v667), v668); + scatter(out, 48, 64, timesminusplus(reverse(v671), load(tbl, 124 * VECWIDTH + tbloffset), times(v671, load(tbl, 125 * VECWIDTH + tbloffset)))); + scatter(out, 16, 64, timesminusplus(reverse(v669), load(tbl, 122 * VECWIDTH + tbloffset), times(v669, load(tbl, 123 * VECWIDTH + tbloffset)))); + real2 v631 = minusplus(uminus(v627), v628); + real2 v629 = minusplus(v627, v628); + real2 v639 = timesminusplus(reverse(v629), load(tbl, 114 * VECWIDTH + tbloffset), times(v629, load(tbl, 115 * VECWIDTH + tbloffset))); + scatter(out, 8, 64, plus(v639, v659)); + real2 v694 = minus(v639, v659); + scatter(out, 40, 64, timesminusplus(v694, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v694), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v645 = timesminusplus(reverse(v631), load(tbl, 116 * VECWIDTH + tbloffset), times(v631, load(tbl, 117 * VECWIDTH + tbloffset))); + scatter(out, 24, 64, plus(v645, v665)); + real2 v700 = minus(v645, v665); + scatter(out, 56, 64, timesminusplus(v700, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v700), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v549 = minusplus(v547, v548); + real2 v551 = minusplus(uminus(v547), v548); + real2 v559 = timesminusplus(reverse(v549), load(tbl, 98 * VECWIDTH + tbloffset), times(v549, load(tbl, 99 * VECWIDTH + tbloffset))); + real2 v708 = minus(v599, v559); + real2 v712 = plus(v559, v599); + scatter(out, 4, 64, plus(v712, v713)); + real2 v726 = minus(v712, v713); + scatter(out, 36, 64, timesminusplus(v726, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v726), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v711 = minusplus(uminus(v707), v708); + real2 v709 = minusplus(v707, v708); + scatter(out, 20, 64, timesminusplus(reverse(v709), load(tbl, 126 * VECWIDTH + tbloffset), times(v709, load(tbl, 127 * VECWIDTH + tbloffset)))); + scatter(out, 52, 64, timesminusplus(reverse(v711), load(tbl, 128 * VECWIDTH + tbloffset), times(v711, load(tbl, 129 * VECWIDTH + tbloffset)))); + real2 v565 = timesminusplus(reverse(v551), load(tbl, 100 * VECWIDTH + tbloffset), times(v551, load(tbl, 101 * VECWIDTH + tbloffset))); + real2 v738 = plus(v565, v605); + real2 v734 = minus(v605, v565); + scatter(out, 12, 64, plus(v738, v739)); + real2 v752 = minus(v738, v739); + scatter(out, 44, 64, timesminusplus(v752, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v752), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v737 = minusplus(uminus(v733), v734); + scatter(out, 60, 64, timesminusplus(reverse(v737), load(tbl, 132 * VECWIDTH + tbloffset), times(v737, load(tbl, 133 * VECWIDTH + tbloffset)))); + real2 v735 = minusplus(v733, v734); + scatter(out, 28, 64, timesminusplus(reverse(v735), load(tbl, 130 * VECWIDTH + tbloffset), times(v735, load(tbl, 131 * VECWIDTH + tbloffset)))); + real2 v471 = minusplus(uminus(v467), v468); + real2 v469 = minusplus(v467, v468); + real2 v479 = timesminusplus(reverse(v469), load(tbl, 82 * VECWIDTH + tbloffset), times(v469, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v511 = minusplus(uminus(v507), v508); + real2 v509 = minusplus(v507, v508); + real2 v519 = timesminusplus(reverse(v509), load(tbl, 90 * VECWIDTH + tbloffset), times(v509, load(tbl, 91 * VECWIDTH + tbloffset))); + real2 v765 = plus(v439, v519); + real2 v759 = reverse(minus(v519, v439)); + real2 v389 = minusplus(v387, v388); + real2 v391 = minusplus(uminus(v387), v388); + real2 v399 = timesminusplus(reverse(v389), load(tbl, 66 * VECWIDTH + tbloffset), times(v389, load(tbl, 67 * VECWIDTH + tbloffset))); + real2 v764 = plus(v399, v479); + real2 v760 = minus(v479, v399); + real2 v804 = plus(v764, v765); + real2 v800 = minus(v765, v764); + scatter(out, 2, 64, plus(v804, v805)); + real2 v818 = minus(v804, v805); + scatter(out, 34, 64, timesminusplus(v818, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v818), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v803 = minusplus(uminus(v799), v800); + scatter(out, 50, 64, timesminusplus(reverse(v803), load(tbl, 144 * VECWIDTH + tbloffset), times(v803, load(tbl, 145 * VECWIDTH + tbloffset)))); + real2 v801 = minusplus(v799, v800); + scatter(out, 18, 64, timesminusplus(reverse(v801), load(tbl, 142 * VECWIDTH + tbloffset), times(v801, load(tbl, 143 * VECWIDTH + tbloffset)))); + real2 v763 = minusplus(uminus(v759), v760); + real2 v761 = minusplus(v759, v760); + real2 v777 = timesminusplus(reverse(v763), load(tbl, 136 * VECWIDTH + tbloffset), times(v763, load(tbl, 137 * VECWIDTH + tbloffset))); + scatter(out, 26, 64, plus(v777, v797)); + real2 v830 = minus(v777, v797); + scatter(out, 58, 64, timesminusplus(v830, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v830), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v771 = timesminusplus(reverse(v761), load(tbl, 134 * VECWIDTH + tbloffset), times(v761, load(tbl, 135 * VECWIDTH + tbloffset))); + scatter(out, 10, 64, plus(v771, v791)); + real2 v824 = minus(v771, v791); + scatter(out, 42, 64, timesminusplus(v824, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v824), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v445 = timesminusplus(reverse(v431), load(tbl, 76 * VECWIDTH + tbloffset), times(v431, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v525 = timesminusplus(reverse(v511), load(tbl, 92 * VECWIDTH + tbloffset), times(v511, load(tbl, 93 * VECWIDTH + tbloffset))); + real2 v837 = reverse(minus(v525, v445)); + real2 v843 = plus(v445, v525); + real2 v485 = timesminusplus(reverse(v471), load(tbl, 84 * VECWIDTH + tbloffset), times(v471, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v405 = timesminusplus(reverse(v391), load(tbl, 68 * VECWIDTH + tbloffset), times(v391, load(tbl, 69 * VECWIDTH + tbloffset))); + real2 v838 = minus(v485, v405); + real2 v842 = plus(v405, v485); + real2 v878 = minus(v843, v842); + real2 v882 = plus(v842, v843); + scatter(out, 6, 64, plus(v882, v883)); + real2 v896 = minus(v882, v883); + scatter(out, 38, 64, timesminusplus(v896, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v896), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v881 = minusplus(uminus(v877), v878); + scatter(out, 54, 64, timesminusplus(reverse(v881), load(tbl, 156 * VECWIDTH + tbloffset), times(v881, load(tbl, 157 * VECWIDTH + tbloffset)))); + real2 v879 = minusplus(v877, v878); + scatter(out, 22, 64, timesminusplus(reverse(v879), load(tbl, 154 * VECWIDTH + tbloffset), times(v879, load(tbl, 155 * VECWIDTH + tbloffset)))); + real2 v841 = minusplus(uminus(v837), v838); + real2 v839 = minusplus(v837, v838); + real2 v855 = timesminusplus(reverse(v841), load(tbl, 148 * VECWIDTH + tbloffset), times(v841, load(tbl, 149 * VECWIDTH + tbloffset))); + scatter(out, 30, 64, plus(v855, v875)); + real2 v908 = minus(v855, v875); + scatter(out, 62, 64, timesminusplus(v908, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v908), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v849 = timesminusplus(reverse(v839), load(tbl, 146 * VECWIDTH + tbloffset), times(v839, load(tbl, 147 * VECWIDTH + tbloffset))); + scatter(out, 14, 64, plus(v849, v869)); + real2 v902 = minus(v849, v869); + scatter(out, 46, 64, timesminusplus(v902, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v902), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v151 = minusplus(uminus(v147), v148); + real2 v149 = minusplus(v147, v148); + real2 v311 = minusplus(uminus(v307), v308); + real2 v309 = minusplus(v307, v308); + real2 v109 = minusplus(v107, v108); + real2 v111 = minusplus(uminus(v107), v108); + real2 v119 = timesminusplus(reverse(v109), load(tbl, 10 * VECWIDTH + tbloffset), times(v109, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v269 = minusplus(v267, v268); + real2 v271 = minusplus(uminus(v267), v268); + real2 v279 = timesminusplus(reverse(v269), load(tbl, 42 * VECWIDTH + tbloffset), times(v269, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v960 = plus(v119, v279); + real2 v956 = minus(v279, v119); + real2 v169 = minusplus(v167, v168); + real2 v171 = minusplus(uminus(v167), v168); + real2 v159 = timesminusplus(reverse(v149), load(tbl, 18 * VECWIDTH + tbloffset), times(v149, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v319 = timesminusplus(reverse(v309), load(tbl, 50 * VECWIDTH + tbloffset), times(v309, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v921 = plus(v159, v319); + real2 v915 = reverse(minus(v319, v159)); + real2 v351 = minusplus(uminus(v347), v348); + real2 v349 = minusplus(v347, v348); + real2 v359 = timesminusplus(reverse(v349), load(tbl, 58 * VECWIDTH + tbloffset), times(v349, load(tbl, 59 * VECWIDTH + tbloffset))); + real2 v191 = minusplus(uminus(v187), v188); + real2 v189 = minusplus(v187, v188); + real2 v199 = timesminusplus(reverse(v189), load(tbl, 26 * VECWIDTH + tbloffset), times(v189, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v961 = plus(v199, v359); + real2 v955 = reverse(minus(v359, v199)); + real2 v995 = reverse(minus(v961, v960)); + real2 v1001 = plus(v960, v961); + real2 v179 = timesminusplus(reverse(v169), load(tbl, 22 * VECWIDTH + tbloffset), times(v169, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v941 = plus(v179, v339); + real2 v935 = reverse(minus(v339, v179)); + real2 v1016 = minus(v941, v940); + real2 v1020 = plus(v940, v941); + real2 v71 = minusplus(uminus(v67), v68); + real2 v69 = minusplus(v67, v68); + real2 v79 = timesminusplus(reverse(v69), load(tbl, 2 * VECWIDTH + tbloffset), times(v69, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v1041 = plus(v1020, v1021); + real2 v1035 = reverse(minus(v1021, v1020)); + real2 v229 = minusplus(v227, v228); + real2 v231 = minusplus(uminus(v227), v228); + real2 v239 = timesminusplus(reverse(v229), load(tbl, 34 * VECWIDTH + tbloffset), times(v229, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v920 = plus(v79, v239); + real2 v916 = minus(v239, v79); + real2 v996 = minus(v921, v920); + real2 v1000 = plus(v920, v921); + real2 v1040 = plus(v1000, v1001); + real2 v1036 = minus(v1001, v1000); + scatter(out, 1, 64, plus(v1040, v1041)); + real2 v1054 = minus(v1040, v1041); + scatter(out, 33, 64, timesminusplus(v1054, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1054), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1037 = minusplus(v1035, v1036); + real2 v1039 = minusplus(uminus(v1035), v1036); + scatter(out, 49, 64, timesminusplus(reverse(v1039), load(tbl, 184 * VECWIDTH + tbloffset), times(v1039, load(tbl, 185 * VECWIDTH + tbloffset)))); + scatter(out, 17, 64, timesminusplus(reverse(v1037), load(tbl, 182 * VECWIDTH + tbloffset), times(v1037, load(tbl, 183 * VECWIDTH + tbloffset)))); + real2 v1017 = minusplus(v1015, v1016); + real2 v1019 = minusplus(uminus(v1015), v1016); + real2 v1033 = timesminusplus(reverse(v1019), load(tbl, 180 * VECWIDTH + tbloffset), times(v1019, load(tbl, 181 * VECWIDTH + tbloffset))); + real2 v997 = minusplus(v995, v996); + real2 v999 = minusplus(uminus(v995), v996); + real2 v1013 = timesminusplus(reverse(v999), load(tbl, 176 * VECWIDTH + tbloffset), times(v999, load(tbl, 177 * VECWIDTH + tbloffset))); + scatter(out, 25, 64, plus(v1013, v1033)); + real2 v1066 = minus(v1013, v1033); + scatter(out, 57, 64, timesminusplus(v1066, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1066), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1027 = timesminusplus(reverse(v1017), load(tbl, 178 * VECWIDTH + tbloffset), times(v1017, load(tbl, 179 * VECWIDTH + tbloffset))); + real2 v1007 = timesminusplus(reverse(v997), load(tbl, 174 * VECWIDTH + tbloffset), times(v997, load(tbl, 175 * VECWIDTH + tbloffset))); + scatter(out, 9, 64, plus(v1007, v1027)); + real2 v1060 = minus(v1007, v1027); + scatter(out, 41, 64, timesminusplus(v1060, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1060), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v937 = minusplus(v935, v936); + real2 v939 = minusplus(uminus(v935), v936); + real2 v959 = minusplus(uminus(v955), v956); + real2 v957 = minusplus(v955, v956); + real2 v967 = timesminusplus(reverse(v957), load(tbl, 166 * VECWIDTH + tbloffset), times(v957, load(tbl, 167 * VECWIDTH + tbloffset))); + real2 v947 = timesminusplus(reverse(v937), load(tbl, 162 * VECWIDTH + tbloffset), times(v937, load(tbl, 163 * VECWIDTH + tbloffset))); + real2 v919 = minusplus(uminus(v915), v916); + real2 v917 = minusplus(v915, v916); + real2 v1079 = plus(v947, v987); + real2 v1073 = reverse(minus(v987, v947)); + real2 v927 = timesminusplus(reverse(v917), load(tbl, 158 * VECWIDTH + tbloffset), times(v917, load(tbl, 159 * VECWIDTH + tbloffset))); + real2 v1074 = minus(v967, v927); + real2 v1078 = plus(v927, v967); + scatter(out, 5, 64, plus(v1078, v1079)); + real2 v1092 = minus(v1078, v1079); + scatter(out, 37, 64, timesminusplus(v1092, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1092), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1075 = minusplus(v1073, v1074); + scatter(out, 21, 64, timesminusplus(reverse(v1075), load(tbl, 186 * VECWIDTH + tbloffset), times(v1075, load(tbl, 187 * VECWIDTH + tbloffset)))); + real2 v1077 = minusplus(uminus(v1073), v1074); + scatter(out, 53, 64, timesminusplus(reverse(v1077), load(tbl, 188 * VECWIDTH + tbloffset), times(v1077, load(tbl, 189 * VECWIDTH + tbloffset)))); + real2 v953 = timesminusplus(reverse(v939), load(tbl, 164 * VECWIDTH + tbloffset), times(v939, load(tbl, 165 * VECWIDTH + tbloffset))); + real2 v1099 = reverse(minus(v993, v953)); + real2 v1105 = plus(v953, v993); + real2 v973 = timesminusplus(reverse(v959), load(tbl, 168 * VECWIDTH + tbloffset), times(v959, load(tbl, 169 * VECWIDTH + tbloffset))); + real2 v933 = timesminusplus(reverse(v919), load(tbl, 160 * VECWIDTH + tbloffset), times(v919, load(tbl, 161 * VECWIDTH + tbloffset))); + real2 v1104 = plus(v933, v973); + real2 v1100 = minus(v973, v933); + scatter(out, 13, 64, plus(v1104, v1105)); + real2 v1118 = minus(v1104, v1105); + scatter(out, 45, 64, timesminusplus(v1118, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1118), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1101 = minusplus(v1099, v1100); + scatter(out, 29, 64, timesminusplus(reverse(v1101), load(tbl, 190 * VECWIDTH + tbloffset), times(v1101, load(tbl, 191 * VECWIDTH + tbloffset)))); + real2 v1103 = minusplus(uminus(v1099), v1100); + scatter(out, 61, 64, timesminusplus(reverse(v1103), load(tbl, 192 * VECWIDTH + tbloffset), times(v1103, load(tbl, 193 * VECWIDTH + tbloffset)))); + real2 v345 = timesminusplus(reverse(v331), load(tbl, 56 * VECWIDTH + tbloffset), times(v331, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v325 = timesminusplus(reverse(v311), load(tbl, 52 * VECWIDTH + tbloffset), times(v311, load(tbl, 53 * VECWIDTH + tbloffset))); + real2 v265 = timesminusplus(reverse(v251), load(tbl, 40 * VECWIDTH + tbloffset), times(v251, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v185 = timesminusplus(reverse(v171), load(tbl, 24 * VECWIDTH + tbloffset), times(v171, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v165 = timesminusplus(reverse(v151), load(tbl, 20 * VECWIDTH + tbloffset), times(v151, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v1131 = plus(v165, v325); + real2 v1125 = reverse(minus(v325, v165)); + real2 v1151 = plus(v185, v345); + real2 v1145 = reverse(minus(v345, v185)); + real2 v105 = timesminusplus(reverse(v91), load(tbl, 8 * VECWIDTH + tbloffset), times(v91, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v1150 = plus(v105, v265); + real2 v1146 = minus(v265, v105); + real2 v1226 = minus(v1151, v1150); + real2 v1230 = plus(v1150, v1151); + real2 v1231 = plus(v1190, v1191); + real2 v1225 = reverse(minus(v1191, v1190)); + real2 v1245 = reverse(minus(v1231, v1230)); + real2 v1251 = plus(v1230, v1231); + real2 v365 = timesminusplus(reverse(v351), load(tbl, 60 * VECWIDTH + tbloffset), times(v351, load(tbl, 61 * VECWIDTH + tbloffset))); + real2 v285 = timesminusplus(reverse(v271), load(tbl, 44 * VECWIDTH + tbloffset), times(v271, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v205 = timesminusplus(reverse(v191), load(tbl, 28 * VECWIDTH + tbloffset), times(v191, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v1171 = plus(v205, v365); + real2 v1165 = reverse(minus(v365, v205)); + real2 v125 = timesminusplus(reverse(v111), load(tbl, 12 * VECWIDTH + tbloffset), times(v111, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v85 = timesminusplus(reverse(v71), load(tbl, 4 * VECWIDTH + tbloffset), times(v71, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v245 = timesminusplus(reverse(v231), load(tbl, 36 * VECWIDTH + tbloffset), times(v231, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v1126 = minus(v245, v85); + real2 v1130 = plus(v85, v245); + real2 v1210 = plus(v1130, v1131); + real2 v1206 = minus(v1131, v1130); + real2 v1166 = minus(v285, v125); + real2 v1170 = plus(v125, v285); + real2 v1211 = plus(v1170, v1171); + real2 v1205 = reverse(minus(v1171, v1170)); + real2 v1246 = minus(v1211, v1210); + real2 v1250 = plus(v1210, v1211); + scatter(out, 3, 64, plus(v1250, v1251)); + real2 v1264 = minus(v1250, v1251); + scatter(out, 35, 64, timesminusplus(v1264, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1264), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1247 = minusplus(v1245, v1246); + real2 v1249 = minusplus(uminus(v1245), v1246); + scatter(out, 19, 64, timesminusplus(reverse(v1247), load(tbl, 218 * VECWIDTH + tbloffset), times(v1247, load(tbl, 219 * VECWIDTH + tbloffset)))); + scatter(out, 51, 64, timesminusplus(reverse(v1249), load(tbl, 220 * VECWIDTH + tbloffset), times(v1249, load(tbl, 221 * VECWIDTH + tbloffset)))); + real2 v1229 = minusplus(uminus(v1225), v1226); + real2 v1227 = minusplus(v1225, v1226); + real2 v1207 = minusplus(v1205, v1206); + real2 v1209 = minusplus(uminus(v1205), v1206); + real2 v1237 = timesminusplus(reverse(v1227), load(tbl, 214 * VECWIDTH + tbloffset), times(v1227, load(tbl, 215 * VECWIDTH + tbloffset))); + real2 v1217 = timesminusplus(reverse(v1207), load(tbl, 210 * VECWIDTH + tbloffset), times(v1207, load(tbl, 211 * VECWIDTH + tbloffset))); + scatter(out, 11, 64, plus(v1217, v1237)); + real2 v1270 = minus(v1217, v1237); + scatter(out, 43, 64, timesminusplus(v1270, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1270), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1223 = timesminusplus(reverse(v1209), load(tbl, 212 * VECWIDTH + tbloffset), times(v1209, load(tbl, 213 * VECWIDTH + tbloffset))); + real2 v1243 = timesminusplus(reverse(v1229), load(tbl, 216 * VECWIDTH + tbloffset), times(v1229, load(tbl, 217 * VECWIDTH + tbloffset))); + scatter(out, 27, 64, plus(v1223, v1243)); + real2 v1276 = minus(v1223, v1243); + scatter(out, 59, 64, timesminusplus(v1276, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1276), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1189 = minusplus(uminus(v1185), v1186); + real2 v1187 = minusplus(v1185, v1186); + real2 v1129 = minusplus(uminus(v1125), v1126); + real2 v1127 = minusplus(v1125, v1126); + real2 v1147 = minusplus(v1145, v1146); + real2 v1149 = minusplus(uminus(v1145), v1146); + real2 v1167 = minusplus(v1165, v1166); + real2 v1169 = minusplus(uminus(v1165), v1166); + real2 v1143 = timesminusplus(reverse(v1129), load(tbl, 196 * VECWIDTH + tbloffset), times(v1129, load(tbl, 197 * VECWIDTH + tbloffset))); + real2 v1163 = timesminusplus(reverse(v1149), load(tbl, 200 * VECWIDTH + tbloffset), times(v1149, load(tbl, 201 * VECWIDTH + tbloffset))); + real2 v1203 = timesminusplus(reverse(v1189), load(tbl, 208 * VECWIDTH + tbloffset), times(v1189, load(tbl, 209 * VECWIDTH + tbloffset))); + real2 v1315 = plus(v1163, v1203); + real2 v1309 = reverse(minus(v1203, v1163)); + real2 v1183 = timesminusplus(reverse(v1169), load(tbl, 204 * VECWIDTH + tbloffset), times(v1169, load(tbl, 205 * VECWIDTH + tbloffset))); + real2 v1314 = plus(v1143, v1183); + real2 v1310 = minus(v1183, v1143); + scatter(out, 15, 64, plus(v1314, v1315)); + real2 v1328 = minus(v1314, v1315); + scatter(out, 47, 64, timesminusplus(v1328, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1328), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1311 = minusplus(v1309, v1310); + scatter(out, 31, 64, timesminusplus(reverse(v1311), load(tbl, 226 * VECWIDTH + tbloffset), times(v1311, load(tbl, 227 * VECWIDTH + tbloffset)))); + real2 v1313 = minusplus(uminus(v1309), v1310); + scatter(out, 63, 64, timesminusplus(reverse(v1313), load(tbl, 228 * VECWIDTH + tbloffset), times(v1313, load(tbl, 229 * VECWIDTH + tbloffset)))); + real2 v1177 = timesminusplus(reverse(v1167), load(tbl, 202 * VECWIDTH + tbloffset), times(v1167, load(tbl, 203 * VECWIDTH + tbloffset))); + real2 v1137 = timesminusplus(reverse(v1127), load(tbl, 194 * VECWIDTH + tbloffset), times(v1127, load(tbl, 195 * VECWIDTH + tbloffset))); + real2 v1197 = timesminusplus(reverse(v1187), load(tbl, 206 * VECWIDTH + tbloffset), times(v1187, load(tbl, 207 * VECWIDTH + tbloffset))); + real2 v1157 = timesminusplus(reverse(v1147), load(tbl, 198 * VECWIDTH + tbloffset), times(v1147, load(tbl, 199 * VECWIDTH + tbloffset))); + real2 v1283 = reverse(minus(v1197, v1157)); + real2 v1289 = plus(v1157, v1197); + real2 v1288 = plus(v1137, v1177); + real2 v1284 = minus(v1177, v1137); + scatter(out, 7, 64, plus(v1288, v1289)); + real2 v1302 = minus(v1288, v1289); + scatter(out, 39, 64, timesminusplus(v1302, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1302), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1285 = minusplus(v1283, v1284); + real2 v1287 = minusplus(uminus(v1283), v1284); + scatter(out, 55, 64, timesminusplus(reverse(v1287), load(tbl, 224 * VECWIDTH + tbloffset), times(v1287, load(tbl, 225 * VECWIDTH + tbloffset)))); + scatter(out, 23, 64, timesminusplus(reverse(v1285), load(tbl, 222 * VECWIDTH + tbloffset), times(v1285, load(tbl, 223 * VECWIDTH + tbloffset)))); +// Pres : 17339 + } +} +#endif + +// + +#if MAXBUTWIDTH >= 7 +ALIGNED(8192) void dft128f_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + +// Pres : 129041 + real2 v109 = load(in, 107 << shift); + real2 v45 = load(in, 43 << shift); + real2 v341 = plus(v45, v109); + real2 v335 = reverse(minus(v45, v109)); + real2 v77 = load(in, 75 << shift); + real2 v13 = load(in, 11 << shift); + real2 v340 = plus(v13, v77); + real2 v336 = minus(v77, v13); + real2 v337 = minusplus(v335, v336); + real2 v339 = minusplus(uminus(v335), v336); + real2 v350 = ctimesminusplus(reverse(v339), ctbl[61], ctimes(v339, ctbl[60])); + real2 v886 = plus(v340, v341); + real2 v882 = minus(v341, v340); + real2 v345 = ctimesminusplus(reverse(v337), ctbl[51], ctimes(v337, ctbl[41])); + real2 v125 = load(in, 123 << shift); + real2 v61 = load(in, 59 << shift); + real2 v621 = plus(v61, v125); + real2 v615 = reverse(minus(v61, v125)); + real2 v29 = load(in, 27 << shift); + real2 v93 = load(in, 91 << shift); + real2 v616 = minus(v93, v29); + real2 v620 = plus(v29, v93); + real2 v887 = plus(v620, v621); + real2 v881 = reverse(minus(v620, v621)); + real2 v1009 = reverse(minus(v886, v887)); + real2 v1015 = plus(v886, v887); + real2 v883 = minusplus(v881, v882); + real2 v885 = minusplus(uminus(v881), v882); + real2 v895 = ctimesminusplus(reverse(v885), ctbl[28], ctimes(v885, ctbl[14])); + real2 v619 = minusplus(uminus(v615), v616); + real2 v617 = minusplus(v615, v616); + real2 v625 = ctimesminusplus(reverse(v617), ctbl[53], ctimes(v617, ctbl[39])); + real2 v891 = ctimesminusplus(reverse(v883), ctbl[25], ctimes(v883, ctbl[19])); + real2 v631 = ctimesminusplus(reverse(v619), ctbl[58], ctimes(v619, ctbl[32])); + real2 v2129 = reverse(minus(v350, v631)); + real2 v2135 = plus(v350, v631); + real2 v1728 = reverse(minus(v345, v625)); + real2 v1734 = plus(v345, v625); + real2 v5 = load(in, 3 << shift); + real2 v69 = load(in, 67 << shift); + real2 v192 = plus(v5, v69); + real2 v188 = minus(v69, v5); + real2 v37 = load(in, 35 << shift); + real2 v101 = load(in, 99 << shift); + real2 v193 = plus(v37, v101); + real2 v187 = reverse(minus(v37, v101)); + real2 v758 = plus(v192, v193); + real2 v754 = minus(v193, v192); + real2 v189 = minusplus(v187, v188); + real2 v191 = minusplus(uminus(v187), v188); + real2 v203 = ctimesminusplus(reverse(v191), ctbl[35], ctimes(v191, ctbl[57])); + real2 v197 = ctimesminusplus(reverse(v189), ctbl[47], ctimes(v189, ctbl[45])); + real2 v53 = load(in, 51 << shift); + real2 v117 = load(in, 115 << shift); + real2 v474 = reverse(minus(v53, v117)); + real2 v480 = plus(v53, v117); + real2 v85 = load(in, 83 << shift); + real2 v21 = load(in, 19 << shift); + real2 v475 = minus(v85, v21); + real2 v479 = plus(v21, v85); + real2 v753 = reverse(minus(v479, v480)); + real2 v759 = plus(v479, v480); + real2 v755 = minusplus(v753, v754); + real2 v757 = minusplus(uminus(v753), v754); + real2 v767 = ctimesminusplus(reverse(v757), ctbl[17], ctimes(v757, ctbl[27])); + real2 v763 = ctimesminusplus(reverse(v755), ctbl[23], ctimes(v755, ctbl[21])); + real2 v1411 = minus(v891, v763); + real2 v1415 = plus(v763, v891); + real2 v1014 = plus(v758, v759); + real2 v1010 = minus(v759, v758); + real2 v1011 = minusplus(v1009, v1010); + real2 v1013 = minusplus(uminus(v1009), v1010); + real2 v1023 = ctimesminusplus(reverse(v1013), ctbl[13], ctimes(v1013, ctbl[12])); + real2 v1570 = minus(v895, v767); + real2 v1574 = plus(v767, v895); + real2 v1142 = plus(v1014, v1015); + real2 v1138 = minus(v1015, v1014); + real2 v478 = minusplus(uminus(v474), v475); + real2 v476 = minusplus(v474, v475); + real2 v484 = ctimesminusplus(reverse(v476), ctbl[49], ctimes(v476, ctbl[43])); + real2 v1733 = plus(v197, v484); + real2 v1729 = minus(v484, v197); + real2 v1861 = plus(v1733, v1734); + real2 v1857 = minus(v1734, v1733); + real2 v1730 = minusplus(v1728, v1729); + real2 v1732 = minusplus(uminus(v1728), v1729); + real2 v1738 = ctimesminusplus(reverse(v1730), ctbl[11], ctimes(v1730, ctbl[9])); + real2 v489 = ctimesminusplus(reverse(v478), ctbl[55], ctimes(v478, ctbl[54])); + real2 v1742 = ctimesminusplus(reverse(v1732), ctbl[13], ctimes(v1732, ctbl[12])); + real2 v1019 = ctimesminusplus(reverse(v1011), ctbl[11], ctimes(v1011, ctbl[9])); + real2 v2134 = plus(v203, v489); + real2 v2130 = minus(v489, v203); + real2 v2262 = plus(v2134, v2135); + real2 v2258 = minus(v2135, v2134); + real2 v105 = load(in, 103 << shift); + real2 v41 = load(in, 39 << shift); + real2 v269 = plus(v41, v105); + real2 v263 = reverse(minus(v41, v105)); + real2 v9 = load(in, 7 << shift); + real2 v73 = load(in, 71 << shift); + real2 v264 = minus(v73, v9); + real2 v268 = plus(v9, v73); + real2 v822 = plus(v268, v269); + real2 v818 = minus(v269, v268); + real2 v265 = minusplus(v263, v264); + real2 v267 = minusplus(uminus(v263), v264); + real2 v275 = ctimesminusplus(reverse(v265), ctbl[55], ctimes(v265, ctbl[37])); + real2 v281 = ctimesminusplus(reverse(v267), ctbl[41], ctimes(v267, ctbl[51])); + real2 v121 = load(in, 119 << shift); + real2 v57 = load(in, 55 << shift); + real2 v549 = plus(v57, v121); + real2 v543 = reverse(minus(v57, v121)); + real2 v25 = load(in, 23 << shift); + real2 v89 = load(in, 87 << shift); + real2 v544 = minus(v89, v25); + real2 v548 = plus(v25, v89); + real2 v817 = reverse(minus(v548, v549)); + real2 v823 = plus(v548, v549); + real2 v819 = minusplus(v817, v818); + real2 v821 = minusplus(uminus(v817), v818); + real2 v547 = minusplus(uminus(v543), v544); + real2 v545 = minusplus(v543, v544); + real2 v553 = ctimesminusplus(reverse(v545), ctbl[57], ctimes(v545, ctbl[35])); + real2 v827 = ctimesminusplus(reverse(v819), ctbl[27], ctimes(v819, ctbl[17])); + real2 v831 = ctimesminusplus(reverse(v821), ctbl[25], ctimes(v821, ctbl[24])); + real2 v559 = ctimesminusplus(reverse(v547), ctbl[52], ctimes(v547, ctbl[38])); + real2 v2198 = plus(v281, v559); + real2 v2194 = minus(v559, v281); + real2 v1793 = minus(v553, v275); + real2 v1797 = plus(v275, v553); + real2 v1078 = plus(v822, v823); + real2 v1074 = minus(v823, v822); + real2 v129 = load(in, 127 << shift); + real2 v65 = load(in, 63 << shift); + real2 v693 = plus(v65, v129); + real2 v687 = reverse(minus(v65, v129)); + real2 v33 = load(in, 31 << shift); + real2 v97 = load(in, 95 << shift); + real2 v692 = plus(v33, v97); + real2 v688 = minus(v97, v33); + real2 v691 = minusplus(uminus(v687), v688); + real2 v689 = minusplus(v687, v688); + real2 v945 = reverse(minus(v692, v693)); + real2 v951 = plus(v692, v693); + real2 v697 = ctimesminusplus(reverse(v689), ctbl[61], ctimes(v689, ctbl[31])); + real2 v703 = ctimesminusplus(reverse(v691), ctbl[46], ctimes(v691, ctbl[44])); + real2 v81 = load(in, 79 << shift); + real2 v17 = load(in, 15 << shift); + real2 v406 = minus(v81, v17); + real2 v410 = plus(v17, v81); + real2 v49 = load(in, 47 << shift); + real2 v113 = load(in, 111 << shift); + real2 v405 = reverse(minus(v49, v113)); + real2 v411 = plus(v49, v113); + real2 v407 = minusplus(v405, v406); + real2 v409 = minusplus(uminus(v405), v406); + real2 v415 = ctimesminusplus(reverse(v407), ctbl[59], ctimes(v407, ctbl[33])); + real2 v1798 = plus(v415, v697); + real2 v1792 = reverse(minus(v415, v697)); + real2 v950 = plus(v410, v411); + real2 v946 = minus(v411, v410); + real2 v949 = minusplus(uminus(v945), v946); + real2 v947 = minusplus(v945, v946); + real2 v1073 = reverse(minus(v950, v951)); + real2 v1079 = plus(v950, v951); + real2 v955 = ctimesminusplus(reverse(v947), ctbl[29], ctimes(v947, ctbl[15])); + real2 v1410 = reverse(minus(v827, v955)); + real2 v1416 = plus(v827, v955); + real2 v1448 = plus(v1415, v1416); + real2 v1442 = reverse(minus(v1415, v1416)); + real2 v1412 = minusplus(v1410, v1411); + real2 v1414 = minusplus(uminus(v1410), v1411); + real2 v1424 = ctimesminusplus(reverse(v1414), ctbl[4], ctimes(v1414, ctbl[2])); + real2 v1077 = minusplus(uminus(v1073), v1074); + real2 v1075 = minusplus(v1073, v1074); + real2 v1087 = ctimesminusplus(reverse(v1077), ctbl[10], ctimes(v1077, ctbl[8])); + real2 v1327 = plus(v1023, v1087); + real2 v1321 = reverse(minus(v1023, v1087)); + real2 v1137 = reverse(minus(v1078, v1079)); + real2 v1143 = plus(v1078, v1079); + real2 v1169 = reverse(minus(v1142, v1143)); + real2 v1175 = plus(v1142, v1143); + real2 v1083 = ctimesminusplus(reverse(v1075), ctbl[13], ctimes(v1075, ctbl[7])); + real2 v1796 = minusplus(uminus(v1792), v1793); + real2 v1794 = minusplus(v1792, v1793); + real2 v1806 = ctimesminusplus(reverse(v1796), ctbl[10], ctimes(v1796, ctbl[8])); + real2 v2046 = plus(v1742, v1806); + real2 v2040 = reverse(minus(v1742, v1806)); + real2 v1270 = plus(v1019, v1083); + real2 v1264 = reverse(minus(v1019, v1083)); + real2 v959 = ctimesminusplus(reverse(v949), ctbl[22], ctimes(v949, ctbl[20])); + real2 v1139 = minusplus(v1137, v1138); + real2 v1141 = minusplus(uminus(v1137), v1138); + real2 v1151 = ctimesminusplus(reverse(v1141), ctbl[4], ctimes(v1141, ctbl[2])); + real2 v1420 = ctimesminusplus(reverse(v1412), ctbl[5], ctimes(v1412, ctbl[3])); + real2 v1569 = reverse(minus(v831, v959)); + real2 v1575 = plus(v831, v959); + real2 v1607 = plus(v1574, v1575); + real2 v1601 = reverse(minus(v1574, v1575)); + real2 v1856 = reverse(minus(v1797, v1798)); + real2 v1862 = plus(v1797, v1798); + real2 v1888 = reverse(minus(v1861, v1862)); + real2 v1894 = plus(v1861, v1862); + real2 v1147 = ctimesminusplus(reverse(v1139), ctbl[5], ctimes(v1139, ctbl[3])); + real2 v1571 = minusplus(v1569, v1570); + real2 v1573 = minusplus(uminus(v1569), v1570); + real2 v1583 = ctimesminusplus(reverse(v1573), ctbl[4], ctimes(v1573, ctbl[2])); + real2 v1858 = minusplus(v1856, v1857); + real2 v1860 = minusplus(uminus(v1856), v1857); + real2 v1870 = ctimesminusplus(reverse(v1860), ctbl[4], ctimes(v1860, ctbl[2])); + real2 v1579 = ctimesminusplus(reverse(v1571), ctbl[5], ctimes(v1571, ctbl[3])); + real2 v1802 = ctimesminusplus(reverse(v1794), ctbl[13], ctimes(v1794, ctbl[7])); + real2 v1989 = plus(v1738, v1802); + real2 v1983 = reverse(minus(v1738, v1802)); + real2 v1866 = ctimesminusplus(reverse(v1858), ctbl[5], ctimes(v1858, ctbl[3])); + real2 v23 = load(in, 21 << shift); + real2 v87 = load(in, 85 << shift); + real2 v513 = plus(v23, v87); + real2 v509 = minus(v87, v23); + real2 v55 = load(in, 53 << shift); + real2 v119 = load(in, 117 << shift); + real2 v514 = plus(v55, v119); + real2 v508 = reverse(minus(v55, v119)); + real2 v791 = plus(v513, v514); + real2 v785 = reverse(minus(v513, v514)); + real2 v512 = minusplus(uminus(v508), v509); + real2 v510 = minusplus(v508, v509); + real2 v518 = ctimesminusplus(reverse(v510), ctbl[41], ctimes(v510, ctbl[51])); + real2 v71 = load(in, 69 << shift); + real2 v7 = load(in, 5 << shift); + real2 v230 = plus(v7, v71); + real2 v226 = minus(v71, v7); + real2 v103 = load(in, 101 << shift); + real2 v39 = load(in, 37 << shift); + real2 v225 = reverse(minus(v39, v103)); + real2 v231 = plus(v39, v103); + real2 v790 = plus(v230, v231); + real2 v786 = minus(v231, v230); + real2 v1042 = minus(v791, v790); + real2 v1046 = plus(v790, v791); + real2 v787 = minusplus(v785, v786); + real2 v789 = minusplus(uminus(v785), v786); + real2 v229 = minusplus(uminus(v225), v226); + real2 v227 = minusplus(v225, v226); + real2 v237 = ctimesminusplus(reverse(v227), ctbl[39], ctimes(v227, ctbl[53])); + real2 v1761 = minus(v518, v237); + real2 v1765 = plus(v237, v518); + real2 v795 = ctimesminusplus(reverse(v787), ctbl[19], ctimes(v787, ctbl[25])); + real2 v799 = ctimesminusplus(reverse(v789), ctbl[29], ctimes(v789, ctbl[15])); + real2 v127 = load(in, 125 << shift); + real2 v63 = load(in, 61 << shift); + real2 v657 = plus(v63, v127); + real2 v651 = reverse(minus(v63, v127)); + real2 v31 = load(in, 29 << shift); + real2 v95 = load(in, 93 << shift); + real2 v652 = minus(v95, v31); + real2 v656 = plus(v31, v95); + real2 v913 = reverse(minus(v656, v657)); + real2 v919 = plus(v656, v657); + real2 v655 = minusplus(uminus(v651), v652); + real2 v653 = minusplus(v651, v652); + real2 v661 = ctimesminusplus(reverse(v653), ctbl[45], ctimes(v653, ctbl[47])); + real2 v111 = load(in, 109 << shift); + real2 v47 = load(in, 45 << shift); + real2 v375 = plus(v47, v111); + real2 v369 = reverse(minus(v47, v111)); + real2 v79 = load(in, 77 << shift); + real2 v15 = load(in, 13 << shift); + real2 v370 = minus(v79, v15); + real2 v374 = plus(v15, v79); + real2 v914 = minus(v375, v374); + real2 v918 = plus(v374, v375); + real2 v371 = minusplus(v369, v370); + real2 v373 = minusplus(uminus(v369), v370); + real2 v915 = minusplus(v913, v914); + real2 v917 = minusplus(uminus(v913), v914); + real2 v927 = ctimesminusplus(reverse(v917), ctbl[16], ctimes(v917, ctbl[26])); + real2 v381 = ctimesminusplus(reverse(v371), ctbl[43], ctimes(v371, ctbl[49])); + real2 v1041 = reverse(minus(v918, v919)); + real2 v1047 = plus(v918, v919); + real2 v1766 = plus(v381, v661); + real2 v1760 = reverse(minus(v381, v661)); + real2 v1762 = minusplus(v1760, v1761); + real2 v1764 = minusplus(uminus(v1760), v1761); + real2 v1824 = reverse(minus(v1765, v1766)); + real2 v1830 = plus(v1765, v1766); + real2 v923 = ctimesminusplus(reverse(v915), ctbl[21], ctimes(v915, ctbl[23])); + real2 v1378 = reverse(minus(v795, v923)); + real2 v1384 = plus(v795, v923); + real2 v1045 = minusplus(uminus(v1041), v1042); + real2 v1043 = minusplus(v1041, v1042); + real2 v1051 = ctimesminusplus(reverse(v1043), ctbl[9], ctimes(v1043, ctbl[11])); + real2 v1537 = reverse(minus(v799, v927)); + real2 v1543 = plus(v799, v927); + real2 v1055 = ctimesminusplus(reverse(v1045), ctbl[7], ctimes(v1045, ctbl[6])); + real2 v1111 = plus(v1046, v1047); + real2 v1105 = reverse(minus(v1046, v1047)); + real2 v115 = load(in, 113 << shift); + real2 v51 = load(in, 49 << shift); + real2 v440 = reverse(minus(v51, v115)); + real2 v446 = plus(v51, v115); + real2 v19 = load(in, 17 << shift); + real2 v83 = load(in, 81 << shift); + real2 v441 = minus(v83, v19); + real2 v445 = plus(v19, v83); + real2 v727 = plus(v445, v446); + real2 v721 = reverse(minus(v445, v446)); + real2 v442 = minusplus(v440, v441); + real2 v444 = minusplus(uminus(v440), v441); + real2 v450 = ctimesminusplus(reverse(v442), ctbl[33], ctimes(v442, ctbl[59])); + real2 v67 = load(in, 65 << shift); + real2 v3 = load(in, 1 << shift); + real2 v148 = minus(v67, v3); + real2 v152 = plus(v3, v67); + real2 v99 = load(in, 97 << shift); + real2 v35 = load(in, 33 << shift); + real2 v147 = reverse(minus(v35, v99)); + real2 v153 = plus(v35, v99); + real2 v726 = plus(v152, v153); + real2 v722 = minus(v153, v152); + real2 v723 = minusplus(v721, v722); + real2 v725 = minusplus(uminus(v721), v722); + real2 v731 = ctimesminusplus(reverse(v723), ctbl[15], ctimes(v723, ctbl[29])); + real2 v735 = ctimesminusplus(reverse(v725), ctbl[23], ctimes(v725, ctbl[21])); + real2 v149 = minusplus(v147, v148); + real2 v151 = minusplus(uminus(v147), v148); + real2 v978 = minus(v727, v726); + real2 v982 = plus(v726, v727); + real2 v159 = ctimesminusplus(reverse(v149), ctbl[31], ctimes(v149, ctbl[61])); + real2 v1701 = plus(v159, v450); + real2 v1697 = minus(v450, v159); + real2 v91 = load(in, 89 << shift); + real2 v27 = load(in, 25 << shift); + real2 v584 = plus(v27, v91); + real2 v580 = minus(v91, v27); + real2 v59 = load(in, 57 << shift); + real2 v123 = load(in, 121 << shift); + real2 v579 = reverse(minus(v59, v123)); + real2 v585 = plus(v59, v123); + real2 v583 = minusplus(uminus(v579), v580); + real2 v581 = minusplus(v579, v580); + real2 v589 = ctimesminusplus(reverse(v581), ctbl[37], ctimes(v581, ctbl[55])); + real2 v855 = plus(v584, v585); + real2 v849 = reverse(minus(v584, v585)); + real2 v11 = load(in, 9 << shift); + real2 v75 = load(in, 73 << shift); + real2 v302 = minus(v75, v11); + real2 v306 = plus(v11, v75); + real2 v107 = load(in, 105 << shift); + real2 v43 = load(in, 41 << shift); + real2 v307 = plus(v43, v107); + real2 v301 = reverse(minus(v43, v107)); + real2 v854 = plus(v306, v307); + real2 v850 = minus(v307, v306); + real2 v851 = minusplus(v849, v850); + real2 v853 = minusplus(uminus(v849), v850); + real2 v863 = ctimesminusplus(reverse(v853), ctbl[19], ctimes(v853, ctbl[18])); + real2 v305 = minusplus(uminus(v301), v302); + real2 v303 = minusplus(v301, v302); + real2 v1538 = minus(v863, v735); + real2 v1542 = plus(v735, v863); + real2 v859 = ctimesminusplus(reverse(v851), ctbl[17], ctimes(v851, ctbl[27])); + real2 v1379 = minus(v859, v731); + real2 v1383 = plus(v731, v859); + real2 v1443 = minus(v1384, v1383); + real2 v1447 = plus(v1383, v1384); + real2 v1446 = minusplus(uminus(v1442), v1443); + real2 v1444 = minusplus(v1442, v1443); + real2 v983 = plus(v854, v855); + real2 v977 = reverse(minus(v854, v855)); + real2 v979 = minusplus(v977, v978); + real2 v981 = minusplus(uminus(v977), v978); + real2 v1456 = ctimesminusplus(reverse(v1446), ctbl[1], ctimes(v1446, ctbl[0])); + real2 v311 = ctimesminusplus(reverse(v303), ctbl[35], ctimes(v303, ctbl[57])); + real2 v1696 = reverse(minus(v311, v589)); + real2 v1702 = plus(v311, v589); + real2 v1452 = ctimesminusplus(reverse(v1444), ctbl[1], ctimes(v1444, ctbl[1])); + real2 v987 = ctimesminusplus(reverse(v979), ctbl[7], ctimes(v979, ctbl[13])); + real2 v1265 = minus(v1051, v987); + real2 v1269 = plus(v987, v1051); + real2 v1266 = minusplus(v1264, v1265); + real2 v1268 = minusplus(uminus(v1264), v1265); + real2 v1278 = ctimesminusplus(reverse(v1268), ctbl[1], ctimes(v1268, ctbl[0])); + real2 v1286 = plus(v1269, v1270); + real2 v1280 = reverse(minus(v1269, v1270)); + real2 v1110 = plus(v982, v983); + real2 v1106 = minus(v983, v982); + real2 v1174 = plus(v1110, v1111); + real2 v1170 = minus(v1111, v1110); + real2 v1185 = reverse(minus(v1174, v1175)); + real2 v1191 = plus(v1174, v1175); + real2 v1171 = minusplus(v1169, v1170); + real2 v1173 = minusplus(uminus(v1169), v1170); + real2 v1179 = ctimesminusplus(reverse(v1171), ctbl[1], ctimes(v1171, ctbl[1])); + real2 v1183 = ctimesminusplus(reverse(v1173), ctbl[1], ctimes(v1173, ctbl[0])); + real2 v991 = ctimesminusplus(reverse(v981), ctbl[11], ctimes(v981, ctbl[9])); + real2 v1322 = minus(v1055, v991); + real2 v1326 = plus(v991, v1055); + real2 v1337 = reverse(minus(v1326, v1327)); + real2 v1343 = plus(v1326, v1327); + real2 v1323 = minusplus(v1321, v1322); + real2 v1325 = minusplus(uminus(v1321), v1322); + real2 v1335 = ctimesminusplus(reverse(v1325), ctbl[1], ctimes(v1325, ctbl[0])); + real2 v1109 = minusplus(uminus(v1105), v1106); + real2 v1107 = minusplus(v1105, v1106); + real2 v1115 = ctimesminusplus(reverse(v1107), ctbl[3], ctimes(v1107, ctbl[5])); + real2 v1274 = ctimesminusplus(reverse(v1266), ctbl[1], ctimes(v1266, ctbl[1])); + real2 v1606 = plus(v1542, v1543); + real2 v1602 = minus(v1543, v1542); + real2 v1216 = plus(v1115, v1147); + real2 v1210 = reverse(minus(v1115, v1147)); + real2 v1331 = ctimesminusplus(reverse(v1323), ctbl[1], ctimes(v1323, ctbl[1])); + real2 v1119 = ctimesminusplus(reverse(v1109), ctbl[5], ctimes(v1109, ctbl[3])); + real2 v1464 = plus(v1447, v1448); + real2 v1458 = reverse(minus(v1447, v1448)); + real2 v1382 = minusplus(uminus(v1378), v1379); + real2 v1380 = minusplus(v1378, v1379); + real2 v1388 = ctimesminusplus(reverse(v1380), ctbl[3], ctimes(v1380, ctbl[5])); + real2 v1392 = ctimesminusplus(reverse(v1382), ctbl[5], ctimes(v1382, ctbl[3])); + real2 v1508 = plus(v1392, v1424); + real2 v1502 = reverse(minus(v1392, v1424)); + real2 v1489 = plus(v1388, v1420); + real2 v1483 = reverse(minus(v1388, v1420)); + real2 v1603 = minusplus(v1601, v1602); + real2 v1605 = minusplus(uminus(v1601), v1602); + real2 v1615 = ctimesminusplus(reverse(v1605), ctbl[1], ctimes(v1605, ctbl[0])); + real2 v1611 = ctimesminusplus(reverse(v1603), ctbl[1], ctimes(v1603, ctbl[1])); + real2 v1617 = reverse(minus(v1606, v1607)); + real2 v1623 = plus(v1606, v1607); + real2 v1541 = minusplus(uminus(v1537), v1538); + real2 v1539 = minusplus(v1537, v1538); + real2 v1547 = ctimesminusplus(reverse(v1539), ctbl[3], ctimes(v1539, ctbl[5])); + real2 v1551 = ctimesminusplus(reverse(v1541), ctbl[5], ctimes(v1541, ctbl[3])); + real2 v1667 = plus(v1551, v1583); + real2 v1661 = reverse(minus(v1551, v1583)); + real2 v1648 = plus(v1547, v1579); + real2 v1642 = reverse(minus(v1547, v1579)); + real2 v1229 = reverse(minus(v1119, v1151)); + real2 v1235 = plus(v1119, v1151); + real2 v76 = load(in, 74 << shift); + real2 v12 = load(in, 10 << shift); + real2 v322 = plus(v12, v76); + real2 v318 = minus(v76, v12); + real2 v44 = load(in, 42 << shift); + real2 v108 = load(in, 106 << shift); + real2 v323 = plus(v44, v108); + real2 v317 = reverse(minus(v44, v108)); + real2 v866 = minus(v323, v322); + real2 v870 = plus(v322, v323); + real2 v92 = load(in, 90 << shift); + real2 v28 = load(in, 26 << shift); + real2 v602 = plus(v28, v92); + real2 v598 = minus(v92, v28); + real2 v60 = load(in, 58 << shift); + real2 v124 = load(in, 122 << shift); + real2 v603 = plus(v60, v124); + real2 v597 = reverse(minus(v60, v124)); + real2 v865 = reverse(minus(v602, v603)); + real2 v871 = plus(v602, v603); + real2 v869 = minusplus(uminus(v865), v866); + real2 v867 = minusplus(v865, v866); + real2 v879 = ctimesminusplus(reverse(v869), ctbl[7], ctimes(v869, ctbl[6])); + real2 v993 = reverse(minus(v870, v871)); + real2 v999 = plus(v870, v871); + real2 v875 = ctimesminusplus(reverse(v867), ctbl[9], ctimes(v867, ctbl[11])); + real2 v100 = load(in, 98 << shift); + real2 v36 = load(in, 34 << shift); + real2 v167 = reverse(minus(v36, v100)); + real2 v173 = plus(v36, v100); + real2 v4 = load(in, 2 << shift); + real2 v68 = load(in, 66 << shift); + real2 v168 = minus(v68, v4); + real2 v172 = plus(v4, v68); + real2 v742 = plus(v172, v173); + real2 v738 = minus(v173, v172); + real2 v84 = load(in, 82 << shift); + real2 v20 = load(in, 18 << shift); + real2 v462 = plus(v20, v84); + real2 v458 = minus(v84, v20); + real2 v116 = load(in, 114 << shift); + real2 v52 = load(in, 50 << shift); + real2 v463 = plus(v52, v116); + real2 v457 = reverse(minus(v52, v116)); + real2 v737 = reverse(minus(v462, v463)); + real2 v743 = plus(v462, v463); + real2 v998 = plus(v742, v743); + real2 v994 = minus(v743, v742); + real2 v739 = minusplus(v737, v738); + real2 v741 = minusplus(uminus(v737), v738); + real2 v995 = minusplus(v993, v994); + real2 v997 = minusplus(uminus(v993), v994); + real2 v1007 = ctimesminusplus(reverse(v997), ctbl[5], ctimes(v997, ctbl[3])); + real2 v747 = ctimesminusplus(reverse(v739), ctbl[7], ctimes(v739, ctbl[13])); + real2 v1395 = minus(v875, v747); + real2 v1399 = plus(v747, v875); + real2 v1003 = ctimesminusplus(reverse(v995), ctbl[3], ctimes(v995, ctbl[5])); + real2 v1122 = minus(v999, v998); + real2 v1126 = plus(v998, v999); + real2 v72 = load(in, 70 << shift); + real2 v8 = load(in, 6 << shift); + real2 v246 = minus(v72, v8); + real2 v250 = plus(v8, v72); + real2 v104 = load(in, 102 << shift); + real2 v40 = load(in, 38 << shift); + real2 v245 = reverse(minus(v40, v104)); + real2 v251 = plus(v40, v104); + real2 v802 = minus(v251, v250); + real2 v806 = plus(v250, v251); + real2 v24 = load(in, 22 << shift); + real2 v88 = load(in, 86 << shift); + real2 v530 = plus(v24, v88); + real2 v526 = minus(v88, v24); + real2 v120 = load(in, 118 << shift); + real2 v56 = load(in, 54 << shift); + real2 v531 = plus(v56, v120); + real2 v525 = reverse(minus(v56, v120)); + real2 v801 = reverse(minus(v530, v531)); + real2 v807 = plus(v530, v531); + real2 v1058 = minus(v807, v806); + real2 v1062 = plus(v806, v807); + real2 v803 = minusplus(v801, v802); + real2 v805 = minusplus(uminus(v801), v802); + real2 v811 = ctimesminusplus(reverse(v803), ctbl[11], ctimes(v803, ctbl[9])); + real2 v128 = load(in, 126 << shift); + real2 v64 = load(in, 62 << shift); + real2 v669 = reverse(minus(v64, v128)); + real2 v675 = plus(v64, v128); + real2 v32 = load(in, 30 << shift); + real2 v96 = load(in, 94 << shift); + real2 v674 = plus(v32, v96); + real2 v670 = minus(v96, v32); + real2 v935 = plus(v674, v675); + real2 v929 = reverse(minus(v674, v675)); + real2 v80 = load(in, 78 << shift); + real2 v16 = load(in, 14 << shift); + real2 v389 = minus(v80, v16); + real2 v393 = plus(v16, v80); + real2 v112 = load(in, 110 << shift); + real2 v48 = load(in, 46 << shift); + real2 v394 = plus(v48, v112); + real2 v388 = reverse(minus(v48, v112)); + real2 v930 = minus(v394, v393); + real2 v934 = plus(v393, v394); + real2 v1063 = plus(v934, v935); + real2 v1057 = reverse(minus(v934, v935)); + real2 v1059 = minusplus(v1057, v1058); + real2 v1061 = minusplus(uminus(v1057), v1058); + real2 v1127 = plus(v1062, v1063); + real2 v1121 = reverse(minus(v1062, v1063)); + real2 v1123 = minusplus(v1121, v1122); + real2 v1125 = minusplus(uminus(v1121), v1122); + real2 v1135 = ctimesminusplus(reverse(v1125), ctbl[1], ctimes(v1125, ctbl[0])); + real2 v1071 = ctimesminusplus(reverse(v1061), ctbl[4], ctimes(v1061, ctbl[2])); + real2 v1311 = plus(v1007, v1071); + real2 v1305 = reverse(minus(v1007, v1071)); + real2 v1131 = ctimesminusplus(reverse(v1123), ctbl[1], ctimes(v1123, ctbl[1])); + real2 v1153 = reverse(minus(v1126, v1127)); + real2 v1159 = plus(v1126, v1127); + real2 v1067 = ctimesminusplus(reverse(v1059), ctbl[5], ctimes(v1059, ctbl[3])); + real2 v1248 = reverse(minus(v1003, v1067)); + real2 v1254 = plus(v1003, v1067); + real2 v94 = load(in, 92 << shift); + real2 v30 = load(in, 28 << shift); + real2 v634 = minus(v94, v30); + real2 v638 = plus(v30, v94); + real2 v126 = load(in, 124 << shift); + real2 v62 = load(in, 60 << shift); + real2 v633 = reverse(minus(v62, v126)); + real2 v639 = plus(v62, v126); + real2 v897 = reverse(minus(v638, v639)); + real2 v903 = plus(v638, v639); + real2 v42 = load(in, 40 << shift); + real2 v106 = load(in, 104 << shift); + real2 v283 = reverse(minus(v42, v106)); + real2 v289 = plus(v42, v106); + real2 v10 = load(in, 8 << shift); + real2 v74 = load(in, 72 << shift); + real2 v284 = minus(v74, v10); + real2 v288 = plus(v10, v74); + real2 v838 = plus(v288, v289); + real2 v834 = minus(v289, v288); + real2 v26 = load(in, 24 << shift); + real2 v90 = load(in, 88 << shift); + real2 v562 = minus(v90, v26); + real2 v566 = plus(v26, v90); + real2 v122 = load(in, 120 << shift); + real2 v58 = load(in, 56 << shift); + real2 v567 = plus(v58, v122); + real2 v561 = reverse(minus(v58, v122)); + real2 v833 = reverse(minus(v566, v567)); + real2 v839 = plus(v566, v567); + real2 v967 = plus(v838, v839); + real2 v961 = reverse(minus(v838, v839)); + real2 v14 = load(in, 12 << shift); + real2 v78 = load(in, 76 << shift); + real2 v353 = minus(v78, v14); + real2 v357 = plus(v14, v78); + real2 v46 = load(in, 44 << shift); + real2 v110 = load(in, 108 << shift); + real2 v358 = plus(v46, v110); + real2 v352 = reverse(minus(v46, v110)); + real2 v898 = minus(v358, v357); + real2 v902 = plus(v357, v358); + real2 v1025 = reverse(minus(v902, v903)); + real2 v1031 = plus(v902, v903); + real2 v114 = load(in, 112 << shift); + real2 v50 = load(in, 48 << shift); + real2 v422 = reverse(minus(v50, v114)); + real2 v428 = plus(v50, v114); + real2 v2 = load(in, 0 << shift); + real2 v66 = load(in, 64 << shift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << shift); + real2 v34 = load(in, 32 << shift); + real2 v137 = plus(v34, v98); + real2 v131 = reverse(minus(v34, v98)); + real2 v706 = minus(v137, v136); + real2 v710 = plus(v136, v137); + real2 v18 = load(in, 16 << shift); + real2 v82 = load(in, 80 << shift); + real2 v427 = plus(v18, v82); + real2 v423 = minus(v82, v18); + real2 v705 = reverse(minus(v427, v428)); + real2 v711 = plus(v427, v428); + real2 v966 = plus(v710, v711); + real2 v962 = minus(v711, v710); + real2 v1090 = minus(v967, v966); + real2 v1094 = plus(v966, v967); + real2 v70 = load(in, 68 << shift); + real2 v6 = load(in, 4 << shift); + real2 v210 = plus(v6, v70); + real2 v206 = minus(v70, v6); + real2 v38 = load(in, 36 << shift); + real2 v102 = load(in, 100 << shift); + real2 v211 = plus(v38, v102); + real2 v205 = reverse(minus(v38, v102)); + real2 v774 = plus(v210, v211); + real2 v770 = minus(v211, v210); + real2 v22 = load(in, 20 << shift); + real2 v86 = load(in, 84 << shift); + real2 v492 = minus(v86, v22); + real2 v496 = plus(v22, v86); + real2 v118 = load(in, 116 << shift); + real2 v54 = load(in, 52 << shift); + real2 v497 = plus(v54, v118); + real2 v491 = reverse(minus(v54, v118)); + real2 v775 = plus(v496, v497); + real2 v769 = reverse(minus(v496, v497)); + real2 v1030 = plus(v774, v775); + real2 v1026 = minus(v775, v774); + real2 v1095 = plus(v1030, v1031); + real2 v1089 = reverse(minus(v1030, v1031)); + real2 v1103 = minus(uminusplus(v1089), v1090); + real2 v1099 = minus(uplusminus(v1089), v1090); + real2 v1230 = minus(v1135, v1103); + store(out, 56 << shift, minus(uplusminus(v1229), v1230)); + store(out, 120 << shift, minus(uminusplus(v1229), v1230)); + real2 v1234 = plus(v1103, v1135); + store(out, 24 << shift, plus(v1234, v1235)); + store(out, 88 << shift, minus(v1234, v1235)); + real2 v1211 = minus(v1131, v1099); + real2 v1215 = plus(v1099, v1131); + store(out, 8 << shift, plus(v1215, v1216)); + store(out, 72 << shift, minus(v1215, v1216)); + store(out, 40 << shift, minus(uplusminus(v1210), v1211)); + store(out, 104 << shift, minus(uminusplus(v1210), v1211)); + real2 v1158 = plus(v1094, v1095); + real2 v1154 = minus(v1095, v1094); + real2 v1186 = minus(v1159, v1158); + store(out, 32 << shift, minus(uplusminus(v1185), v1186)); + store(out, 96 << shift, minus(uminusplus(v1185), v1186)); + real2 v1190 = plus(v1158, v1159); + store(out, 64 << shift, minus(v1190, v1191)); + store(out, 0 << shift, plus(v1190, v1191)); + real2 v1163 = minus(uplusminus(v1153), v1154); + store(out, 16 << shift, plus(v1163, v1179)); + store(out, 80 << shift, minus(v1163, v1179)); + real2 v1167 = minus(uminusplus(v1153), v1154); + store(out, 112 << shift, minus(v1167, v1183)); + store(out, 48 << shift, plus(v1167, v1183)); + real2 v971 = minus(uplusminus(v961), v962); + real2 v975 = minus(uminusplus(v961), v962); + real2 v1027 = minusplus(v1025, v1026); + real2 v1029 = minusplus(uminus(v1025), v1026); + real2 v1039 = ctimesminusplus(reverse(v1029), ctbl[1], ctimes(v1029, ctbl[0])); + real2 v1306 = minus(v1039, v975); + real2 v1310 = plus(v975, v1039); + real2 v1319 = minus(uminusplus(v1305), v1306); + real2 v1315 = minus(uplusminus(v1305), v1306); + store(out, 124 << shift, minus(v1319, v1335)); + store(out, 60 << shift, plus(v1319, v1335)); + store(out, 28 << shift, plus(v1315, v1331)); + store(out, 92 << shift, minus(v1315, v1331)); + real2 v1342 = plus(v1310, v1311); + store(out, 76 << shift, minus(v1342, v1343)); + store(out, 12 << shift, plus(v1342, v1343)); + real2 v1338 = minus(v1311, v1310); + store(out, 44 << shift, minus(uplusminus(v1337), v1338)); + store(out, 108 << shift, minus(uminusplus(v1337), v1338)); + real2 v1035 = ctimesminusplus(reverse(v1027), ctbl[1], ctimes(v1027, ctbl[1])); + real2 v1249 = minus(v1035, v971); + real2 v1253 = plus(v971, v1035); + real2 v1262 = minus(uminusplus(v1248), v1249); + real2 v1258 = minus(uplusminus(v1248), v1249); + store(out, 84 << shift, minus(v1258, v1274)); + store(out, 20 << shift, plus(v1258, v1274)); + store(out, 52 << shift, plus(v1262, v1278)); + store(out, 116 << shift, minus(v1262, v1278)); + real2 v1281 = minus(v1254, v1253); + real2 v1285 = plus(v1253, v1254); + store(out, 68 << shift, minus(v1285, v1286)); + store(out, 4 << shift, plus(v1285, v1286)); + store(out, 100 << shift, minus(uminusplus(v1280), v1281)); + store(out, 36 << shift, minus(uplusminus(v1280), v1281)); + real2 v835 = minusplus(v833, v834); + real2 v837 = minusplus(uminus(v833), v834); + real2 v843 = ctimesminusplus(reverse(v835), ctbl[1], ctimes(v835, ctbl[1])); + real2 v773 = minusplus(uminus(v769), v770); + real2 v771 = minusplus(v769, v770); + real2 v779 = ctimesminusplus(reverse(v771), ctbl[3], ctimes(v771, ctbl[5])); + real2 v901 = minusplus(uminus(v897), v898); + real2 v899 = minusplus(v897, v898); + real2 v907 = ctimesminusplus(reverse(v899), ctbl[5], ctimes(v899, ctbl[3])); + real2 v719 = minus(uminusplus(v705), v706); + real2 v715 = minus(uplusminus(v705), v706); + real2 v933 = minusplus(uminus(v929), v930); + real2 v931 = minusplus(v929, v930); + real2 v939 = ctimesminusplus(reverse(v931), ctbl[13], ctimes(v931, ctbl[7])); + real2 v1394 = reverse(minus(v811, v939)); + real2 v1400 = plus(v811, v939); + real2 v1426 = reverse(minus(v1399, v1400)); + real2 v1432 = plus(v1399, v1400); + real2 v1367 = plus(v715, v843); + real2 v1363 = minus(v843, v715); + real2 v1368 = plus(v779, v907); + real2 v1362 = reverse(minus(v779, v907)); + real2 v1427 = minus(v1368, v1367); + real2 v1431 = plus(v1367, v1368); + real2 v1440 = minus(uminusplus(v1426), v1427); + real2 v1436 = minus(uplusminus(v1426), v1427); + store(out, 18 << shift, plus(v1436, v1452)); + store(out, 82 << shift, minus(v1436, v1452)); + store(out, 114 << shift, minus(v1440, v1456)); + store(out, 50 << shift, plus(v1440, v1456)); + real2 v1459 = minus(v1432, v1431); + store(out, 98 << shift, minus(uminusplus(v1458), v1459)); + store(out, 34 << shift, minus(uplusminus(v1458), v1459)); + real2 v1463 = plus(v1431, v1432); + store(out, 2 << shift, plus(v1463, v1464)); + store(out, 66 << shift, minus(v1463, v1464)); + real2 v1372 = minus(uplusminus(v1362), v1363); + real2 v1376 = minus(uminusplus(v1362), v1363); + real2 v1398 = minusplus(uminus(v1394), v1395); + real2 v1396 = minusplus(v1394, v1395); + real2 v1404 = ctimesminusplus(reverse(v1396), ctbl[1], ctimes(v1396, ctbl[1])); + real2 v1484 = minus(v1404, v1372); + store(out, 106 << shift, minus(uminusplus(v1483), v1484)); + store(out, 42 << shift, minus(uplusminus(v1483), v1484)); + real2 v1488 = plus(v1372, v1404); + store(out, 10 << shift, plus(v1488, v1489)); + store(out, 74 << shift, minus(v1488, v1489)); + real2 v1408 = ctimesminusplus(reverse(v1398), ctbl[1], ctimes(v1398, ctbl[0])); + real2 v1503 = minus(v1408, v1376); + store(out, 122 << shift, minus(uminusplus(v1502), v1503)); + store(out, 58 << shift, minus(uplusminus(v1502), v1503)); + real2 v1507 = plus(v1376, v1408); + store(out, 90 << shift, minus(v1507, v1508)); + store(out, 26 << shift, plus(v1507, v1508)); + real2 v847 = ctimesminusplus(reverse(v837), ctbl[1], ctimes(v837, ctbl[0])); + real2 v911 = ctimesminusplus(reverse(v901), ctbl[4], ctimes(v901, ctbl[2])); + real2 v815 = ctimesminusplus(reverse(v805), ctbl[13], ctimes(v805, ctbl[12])); + real2 v1522 = minus(v847, v719); + real2 v1526 = plus(v719, v847); + real2 v751 = ctimesminusplus(reverse(v741), ctbl[11], ctimes(v741, ctbl[9])); + real2 v1554 = minus(v879, v751); + real2 v1558 = plus(v751, v879); + real2 v943 = ctimesminusplus(reverse(v933), ctbl[10], ctimes(v933, ctbl[8])); + real2 v1553 = reverse(minus(v815, v943)); + real2 v1559 = plus(v815, v943); + real2 v1591 = plus(v1558, v1559); + real2 v1585 = reverse(minus(v1558, v1559)); + real2 v783 = ctimesminusplus(reverse(v773), ctbl[5], ctimes(v773, ctbl[3])); + real2 v1521 = reverse(minus(v783, v911)); + real2 v1527 = plus(v783, v911); + real2 v1586 = minus(v1527, v1526); + real2 v1590 = plus(v1526, v1527); + real2 v1595 = minus(uplusminus(v1585), v1586); + store(out, 22 << shift, plus(v1595, v1611)); + store(out, 86 << shift, minus(v1595, v1611)); + real2 v1599 = minus(uminusplus(v1585), v1586); + store(out, 118 << shift, minus(v1599, v1615)); + store(out, 54 << shift, plus(v1599, v1615)); + real2 v1622 = plus(v1590, v1591); + store(out, 70 << shift, minus(v1622, v1623)); + store(out, 6 << shift, plus(v1622, v1623)); + real2 v1618 = minus(v1591, v1590); + store(out, 102 << shift, minus(uminusplus(v1617), v1618)); + store(out, 38 << shift, minus(uplusminus(v1617), v1618)); + real2 v1557 = minusplus(uminus(v1553), v1554); + real2 v1555 = minusplus(v1553, v1554); + real2 v1563 = ctimesminusplus(reverse(v1555), ctbl[1], ctimes(v1555, ctbl[1])); + real2 v1531 = minus(uplusminus(v1521), v1522); + real2 v1535 = minus(uminusplus(v1521), v1522); + real2 v1643 = minus(v1563, v1531); + store(out, 46 << shift, minus(uplusminus(v1642), v1643)); + store(out, 110 << shift, minus(uminusplus(v1642), v1643)); + real2 v1647 = plus(v1531, v1563); + store(out, 78 << shift, minus(v1647, v1648)); + store(out, 14 << shift, plus(v1647, v1648)); + real2 v1567 = ctimesminusplus(reverse(v1557), ctbl[1], ctimes(v1557, ctbl[0])); + real2 v1666 = plus(v1535, v1567); + real2 v1662 = minus(v1567, v1535); + store(out, 94 << shift, minus(v1666, v1667)); + store(out, 30 << shift, plus(v1666, v1667)); + store(out, 126 << shift, minus(uminusplus(v1661), v1662)); + store(out, 62 << shift, minus(uplusminus(v1661), v1662)); + real2 v426 = minusplus(uminus(v422), v423); + real2 v424 = minusplus(v422, v423); + real2 v433 = ctimesminusplus(reverse(v424), ctbl[1], ctimes(v424, ctbl[1])); + real2 v141 = minus(uplusminus(v131), v132); + real2 v145 = minus(uminusplus(v131), v132); + real2 v1685 = plus(v141, v433); + real2 v1681 = minus(v433, v141); + real2 v247 = minusplus(v245, v246); + real2 v249 = minusplus(uminus(v245), v246); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + real2 v217 = ctimesminusplus(reverse(v207), ctbl[7], ctimes(v207, ctbl[13])); + real2 v321 = minusplus(uminus(v317), v318); + real2 v319 = minusplus(v317, v318); + real2 v565 = minusplus(uminus(v561), v562); + real2 v563 = minusplus(v561, v562); + real2 v285 = minusplus(v283, v284); + real2 v287 = minusplus(uminus(v283), v284); + real2 v295 = ctimesminusplus(reverse(v285), ctbl[3], ctimes(v285, ctbl[5])); + real2 v329 = ctimesminusplus(reverse(v319), ctbl[19], ctimes(v319, ctbl[25])); + real2 v571 = ctimesminusplus(reverse(v563), ctbl[5], ctimes(v563, ctbl[3])); + real2 v1680 = reverse(minus(v295, v571)); + real2 v1686 = plus(v295, v571); + real2 v601 = minusplus(uminus(v597), v598); + real2 v599 = minusplus(v597, v598); + real2 v607 = ctimesminusplus(reverse(v599), ctbl[21], ctimes(v599, ctbl[23])); + real2 v1718 = plus(v329, v607); + real2 v1712 = reverse(minus(v329, v607)); + real2 v527 = minusplus(v525, v526); + real2 v529 = minusplus(uminus(v525), v526); + real2 v461 = minusplus(uminus(v457), v458); + real2 v459 = minusplus(v457, v458); + real2 v467 = ctimesminusplus(reverse(v459), ctbl[17], ctimes(v459, ctbl[27])); + real2 v255 = ctimesminusplus(reverse(v247), ctbl[23], ctimes(v247, ctbl[21])); + real2 v637 = minusplus(uminus(v633), v634); + real2 v635 = minusplus(v633, v634); + real2 v643 = ctimesminusplus(reverse(v635), ctbl[13], ctimes(v635, ctbl[7])); + real2 v1813 = plus(v1685, v1686); + real2 v1809 = minus(v1686, v1685); + real2 v493 = minusplus(v491, v492); + real2 v495 = minusplus(uminus(v491), v492); + real2 v171 = minusplus(uminus(v167), v168); + real2 v169 = minusplus(v167, v168); + real2 v354 = minusplus(v352, v353); + real2 v356 = minusplus(uminus(v352), v353); + real2 v362 = ctimesminusplus(reverse(v354), ctbl[11], ctimes(v354, ctbl[9])); + real2 v179 = ctimesminusplus(reverse(v169), ctbl[15], ctimes(v169, ctbl[29])); + real2 v1717 = plus(v179, v467); + real2 v1713 = minus(v467, v179); + real2 v1841 = minus(v1718, v1717); + real2 v1845 = plus(v1717, v1718); + real2 v501 = ctimesminusplus(reverse(v493), ctbl[9], ctimes(v493, ctbl[11])); + real2 v1745 = minus(v501, v217); + real2 v1749 = plus(v217, v501); + real2 v671 = minusplus(v669, v670); + real2 v673 = minusplus(uminus(v669), v670); + real2 v679 = ctimesminusplus(reverse(v671), ctbl[29], ctimes(v671, ctbl[15])); + real2 v535 = ctimesminusplus(reverse(v527), ctbl[25], ctimes(v527, ctbl[19])); + real2 v1781 = plus(v255, v535); + real2 v1777 = minus(v535, v255); + real2 v1825 = minus(v1702, v1701); + real2 v1829 = plus(v1701, v1702); + real2 v1889 = minus(v1830, v1829); + real2 v1893 = plus(v1829, v1830); + real2 v1910 = plus(v1893, v1894); + real2 v1904 = reverse(minus(v1893, v1894)); + real2 v392 = minusplus(uminus(v388), v389); + real2 v390 = minusplus(v388, v389); + real2 v398 = ctimesminusplus(reverse(v390), ctbl[27], ctimes(v390, ctbl[17])); + real2 v1776 = reverse(minus(v398, v679)); + real2 v1782 = plus(v398, v679); + real2 v1744 = reverse(minus(v362, v643)); + real2 v1750 = plus(v362, v643); + real2 v1808 = reverse(minus(v1749, v1750)); + real2 v1814 = plus(v1749, v1750); + real2 v1873 = minus(v1814, v1813); + real2 v1877 = plus(v1813, v1814); + real2 v1846 = plus(v1781, v1782); + real2 v1840 = reverse(minus(v1781, v1782)); + real2 v1872 = reverse(minus(v1845, v1846)); + real2 v1878 = plus(v1845, v1846); + real2 v1909 = plus(v1877, v1878); + store(out, 1 << shift, plus(v1909, v1910)); + store(out, 65 << shift, minus(v1909, v1910)); + real2 v1905 = minus(v1878, v1877); + store(out, 33 << shift, minus(uplusminus(v1904), v1905)); + store(out, 97 << shift, minus(uminusplus(v1904), v1905)); + real2 v1822 = minus(uminusplus(v1808), v1809); + real2 v1818 = minus(uplusminus(v1808), v1809); + real2 v1826 = minusplus(v1824, v1825); + real2 v1828 = minusplus(uminus(v1824), v1825); + real2 v1838 = ctimesminusplus(reverse(v1828), ctbl[5], ctimes(v1828, ctbl[3])); + real2 v1948 = reverse(minus(v1838, v1870)); + real2 v1954 = plus(v1838, v1870); + real2 v1844 = minusplus(uminus(v1840), v1841); + real2 v1842 = minusplus(v1840, v1841); + real2 v1854 = ctimesminusplus(reverse(v1844), ctbl[1], ctimes(v1844, ctbl[0])); + real2 v1953 = plus(v1822, v1854); + real2 v1949 = minus(v1854, v1822); + store(out, 89 << shift, minus(v1953, v1954)); + store(out, 25 << shift, plus(v1953, v1954)); + store(out, 121 << shift, minus(uminusplus(v1948), v1949)); + store(out, 57 << shift, minus(uplusminus(v1948), v1949)); + real2 v1834 = ctimesminusplus(reverse(v1826), ctbl[3], ctimes(v1826, ctbl[5])); + real2 v1850 = ctimesminusplus(reverse(v1842), ctbl[1], ctimes(v1842, ctbl[1])); + real2 v1929 = reverse(minus(v1834, v1866)); + real2 v1935 = plus(v1834, v1866); + real2 v1934 = plus(v1818, v1850); + real2 v1930 = minus(v1850, v1818); + store(out, 105 << shift, minus(uminusplus(v1929), v1930)); + store(out, 41 << shift, minus(uplusminus(v1929), v1930)); + store(out, 73 << shift, minus(v1934, v1935)); + store(out, 9 << shift, plus(v1934, v1935)); + real2 v1890 = minusplus(v1888, v1889); + real2 v1892 = minusplus(uminus(v1888), v1889); + real2 v1902 = ctimesminusplus(reverse(v1892), ctbl[1], ctimes(v1892, ctbl[0])); + real2 v1886 = minus(uminusplus(v1872), v1873); + store(out, 113 << shift, minus(v1886, v1902)); + store(out, 49 << shift, plus(v1886, v1902)); + real2 v1882 = minus(uplusminus(v1872), v1873); + real2 v1898 = ctimesminusplus(reverse(v1890), ctbl[1], ctimes(v1890, ctbl[1])); + store(out, 17 << shift, plus(v1882, v1898)); + store(out, 81 << shift, minus(v1882, v1898)); + real2 v1700 = minusplus(uminus(v1696), v1697); + real2 v1698 = minusplus(v1696, v1697); + real2 v1690 = minus(uplusminus(v1680), v1681); + real2 v1694 = minus(uminusplus(v1680), v1681); + real2 v1778 = minusplus(v1776, v1777); + real2 v1780 = minusplus(uminus(v1776), v1777); + real2 v1774 = ctimesminusplus(reverse(v1764), ctbl[7], ctimes(v1764, ctbl[6])); + real2 v1710 = ctimesminusplus(reverse(v1700), ctbl[11], ctimes(v1700, ctbl[9])); + real2 v2041 = minus(v1774, v1710); + real2 v2045 = plus(v1710, v1774); + real2 v1714 = minusplus(v1712, v1713); + real2 v1716 = minusplus(uminus(v1712), v1713); + real2 v2042 = minusplus(v2040, v2041); + real2 v2044 = minusplus(uminus(v2040), v2041); + real2 v2054 = ctimesminusplus(reverse(v2044), ctbl[1], ctimes(v2044, ctbl[0])); + real2 v1726 = ctimesminusplus(reverse(v1716), ctbl[5], ctimes(v1716, ctbl[3])); + real2 v1748 = minusplus(uminus(v1744), v1745); + real2 v1746 = minusplus(v1744, v1745); + real2 v1758 = ctimesminusplus(reverse(v1748), ctbl[1], ctimes(v1748, ctbl[0])); + real2 v2029 = plus(v1694, v1758); + real2 v2025 = minus(v1758, v1694); + real2 v1790 = ctimesminusplus(reverse(v1780), ctbl[4], ctimes(v1780, ctbl[2])); + real2 v2024 = reverse(minus(v1726, v1790)); + real2 v2030 = plus(v1726, v1790); + real2 v2038 = minus(uminusplus(v2024), v2025); + store(out, 61 << shift, plus(v2038, v2054)); + store(out, 125 << shift, minus(v2038, v2054)); + real2 v2034 = minus(uplusminus(v2024), v2025); + real2 v2050 = ctimesminusplus(reverse(v2042), ctbl[1], ctimes(v2042, ctbl[1])); + store(out, 93 << shift, minus(v2034, v2050)); + store(out, 29 << shift, plus(v2034, v2050)); + real2 v2056 = reverse(minus(v2045, v2046)); + real2 v2062 = plus(v2045, v2046); + real2 v2061 = plus(v2029, v2030); + store(out, 13 << shift, plus(v2061, v2062)); + store(out, 77 << shift, minus(v2061, v2062)); + real2 v2057 = minus(v2030, v2029); + store(out, 45 << shift, minus(uplusminus(v2056), v2057)); + store(out, 109 << shift, minus(uminusplus(v2056), v2057)); + real2 v1754 = ctimesminusplus(reverse(v1746), ctbl[1], ctimes(v1746, ctbl[1])); + real2 v1722 = ctimesminusplus(reverse(v1714), ctbl[3], ctimes(v1714, ctbl[5])); + real2 v1770 = ctimesminusplus(reverse(v1762), ctbl[9], ctimes(v1762, ctbl[11])); + real2 v1706 = ctimesminusplus(reverse(v1698), ctbl[7], ctimes(v1698, ctbl[13])); + real2 v1988 = plus(v1706, v1770); + real2 v1984 = minus(v1770, v1706); + real2 v1968 = minus(v1754, v1690); + real2 v1972 = plus(v1690, v1754); + real2 v1985 = minusplus(v1983, v1984); + real2 v1987 = minusplus(uminus(v1983), v1984); + real2 v1993 = ctimesminusplus(reverse(v1985), ctbl[1], ctimes(v1985, ctbl[1])); + real2 v1786 = ctimesminusplus(reverse(v1778), ctbl[5], ctimes(v1778, ctbl[3])); + real2 v1967 = reverse(minus(v1722, v1786)); + real2 v1973 = plus(v1722, v1786); + real2 v1977 = minus(uplusminus(v1967), v1968); + real2 v1981 = minus(uminusplus(v1967), v1968); + store(out, 85 << shift, minus(v1977, v1993)); + store(out, 21 << shift, plus(v1977, v1993)); + real2 v1997 = ctimesminusplus(reverse(v1987), ctbl[1], ctimes(v1987, ctbl[0])); + store(out, 117 << shift, minus(v1981, v1997)); + store(out, 53 << shift, plus(v1981, v1997)); + real2 v2004 = plus(v1972, v1973); + real2 v2000 = minus(v1973, v1972); + real2 v1999 = reverse(minus(v1988, v1989)); + real2 v2005 = plus(v1988, v1989); + store(out, 5 << shift, plus(v2004, v2005)); + store(out, 69 << shift, minus(v2004, v2005)); + store(out, 37 << shift, minus(uplusminus(v1999), v2000)); + store(out, 101 << shift, minus(uminusplus(v1999), v2000)); + real2 v333 = ctimesminusplus(reverse(v321), ctbl[29], ctimes(v321, ctbl[15])); + real2 v613 = ctimesminusplus(reverse(v601), ctbl[16], ctimes(v601, ctbl[26])); + real2 v2113 = reverse(minus(v333, v613)); + real2 v2119 = plus(v333, v613); + real2 v595 = ctimesminusplus(reverse(v583), ctbl[40], ctimes(v583, ctbl[50])); + real2 v455 = ctimesminusplus(reverse(v444), ctbl[43], ctimes(v444, ctbl[42])); + real2 v165 = ctimesminusplus(reverse(v151), ctbl[47], ctimes(v151, ctbl[45])); + real2 v2102 = plus(v165, v455); + real2 v2098 = minus(v455, v165); + real2 v315 = ctimesminusplus(reverse(v305), ctbl[53], ctimes(v305, ctbl[39])); + real2 v2097 = reverse(minus(v315, v595)); + real2 v2103 = plus(v315, v595); + real2 v261 = ctimesminusplus(reverse(v249), ctbl[17], ctimes(v249, ctbl[27])); + real2 v299 = ctimesminusplus(reverse(v287), ctbl[5], ctimes(v287, ctbl[3])); + real2 v523 = ctimesminusplus(reverse(v512), ctbl[31], ctimes(v512, ctbl[30])); + real2 v541 = ctimesminusplus(reverse(v529), ctbl[28], ctimes(v529, ctbl[14])); + real2 v2182 = plus(v261, v541); + real2 v2178 = minus(v541, v261); + real2 v243 = ctimesminusplus(reverse(v229), ctbl[59], ctimes(v229, ctbl[33])); + real2 v667 = ctimesminusplus(reverse(v655), ctbl[34], ctimes(v655, ctbl[56])); + real2 v2166 = plus(v243, v523); + real2 v2162 = minus(v523, v243); + real2 v386 = ctimesminusplus(reverse(v373), ctbl[37], ctimes(v373, ctbl[36])); + real2 v2161 = reverse(minus(v386, v667)); + real2 v2167 = plus(v386, v667); + real2 v472 = ctimesminusplus(reverse(v461), ctbl[19], ctimes(v461, ctbl[18])); + real2 v185 = ctimesminusplus(reverse(v171), ctbl[23], ctimes(v171, ctbl[21])); + real2 v2114 = minus(v472, v185); + real2 v2118 = plus(v185, v472); + real2 v420 = ctimesminusplus(reverse(v409), ctbl[49], ctimes(v409, ctbl[48])); + real2 v506 = ctimesminusplus(reverse(v495), ctbl[7], ctimes(v495, ctbl[6])); + real2 v2199 = plus(v420, v703); + real2 v2193 = reverse(minus(v420, v703)); + real2 v649 = ctimesminusplus(reverse(v637), ctbl[10], ctimes(v637, ctbl[8])); + real2 v223 = ctimesminusplus(reverse(v209), ctbl[11], ctimes(v209, ctbl[9])); + real2 v2146 = minus(v506, v223); + real2 v2150 = plus(v223, v506); + real2 v2231 = plus(v2166, v2167); + real2 v2225 = reverse(minus(v2166, v2167)); + real2 v685 = ctimesminusplus(reverse(v673), ctbl[22], ctimes(v673, ctbl[20])); + real2 v2257 = reverse(minus(v2198, v2199)); + real2 v2263 = plus(v2198, v2199); + real2 v2226 = minus(v2103, v2102); + real2 v2230 = plus(v2102, v2103); + real2 v2294 = plus(v2230, v2231); + real2 v2290 = minus(v2231, v2230); + real2 v2246 = plus(v2118, v2119); + real2 v2242 = minus(v2119, v2118); + real2 v577 = ctimesminusplus(reverse(v565), ctbl[4], ctimes(v565, ctbl[2])); + real2 v2081 = reverse(minus(v299, v577)); + real2 v2087 = plus(v299, v577); + real2 v403 = ctimesminusplus(reverse(v392), ctbl[25], ctimes(v392, ctbl[24])); + real2 v2177 = reverse(minus(v403, v685)); + real2 v2183 = plus(v403, v685); + real2 v438 = ctimesminusplus(reverse(v426), ctbl[1], ctimes(v426, ctbl[0])); + real2 v2086 = plus(v145, v438); + real2 v2082 = minus(v438, v145); + real2 v2210 = minus(v2087, v2086); + real2 v2214 = plus(v2086, v2087); + real2 v2247 = plus(v2182, v2183); + real2 v2241 = reverse(minus(v2182, v2183)); + real2 v2279 = plus(v2246, v2247); + real2 v2273 = reverse(minus(v2246, v2247)); + real2 v367 = ctimesminusplus(reverse(v356), ctbl[13], ctimes(v356, ctbl[12])); + real2 v2151 = plus(v367, v649); + real2 v2145 = reverse(minus(v367, v649)); + real2 v2209 = reverse(minus(v2150, v2151)); + real2 v2215 = plus(v2150, v2151); + real2 v2274 = minus(v2215, v2214); + real2 v2278 = plus(v2214, v2215); + real2 v2310 = plus(v2278, v2279); + real2 v2306 = minus(v2279, v2278); + real2 v2295 = plus(v2262, v2263); + real2 v2289 = reverse(minus(v2262, v2263)); + real2 v2311 = plus(v2294, v2295); + store(out, 3 << shift, plus(v2310, v2311)); + store(out, 67 << shift, minus(v2310, v2311)); + real2 v2305 = reverse(minus(v2294, v2295)); + store(out, 35 << shift, minus(uplusminus(v2305), v2306)); + store(out, 99 << shift, minus(uminusplus(v2305), v2306)); + real2 v2287 = minus(uminusplus(v2273), v2274); + real2 v2283 = minus(uplusminus(v2273), v2274); + real2 v2291 = minusplus(v2289, v2290); + real2 v2293 = minusplus(uminus(v2289), v2290); + real2 v2299 = ctimesminusplus(reverse(v2291), ctbl[1], ctimes(v2291, ctbl[1])); + store(out, 19 << shift, plus(v2283, v2299)); + store(out, 83 << shift, minus(v2283, v2299)); + real2 v2303 = ctimesminusplus(reverse(v2293), ctbl[1], ctimes(v2293, ctbl[0])); + store(out, 51 << shift, plus(v2287, v2303)); + store(out, 115 << shift, minus(v2287, v2303)); + real2 v2229 = minusplus(uminus(v2225), v2226); + real2 v2227 = minusplus(v2225, v2226); + real2 v2235 = ctimesminusplus(reverse(v2227), ctbl[3], ctimes(v2227, ctbl[5])); + real2 v2219 = minus(uplusminus(v2209), v2210); + real2 v2223 = minus(uminusplus(v2209), v2210); + real2 v2243 = minusplus(v2241, v2242); + real2 v2245 = minusplus(uminus(v2241), v2242); + real2 v2251 = ctimesminusplus(reverse(v2243), ctbl[1], ctimes(v2243, ctbl[1])); + real2 v2331 = minus(v2251, v2219); + real2 v2335 = plus(v2219, v2251); + real2 v2259 = minusplus(v2257, v2258); + real2 v2261 = minusplus(uminus(v2257), v2258); + real2 v2267 = ctimesminusplus(reverse(v2259), ctbl[5], ctimes(v2259, ctbl[3])); + real2 v2336 = plus(v2235, v2267); + store(out, 75 << shift, minus(v2335, v2336)); + store(out, 11 << shift, plus(v2335, v2336)); + real2 v2330 = reverse(minus(v2235, v2267)); + store(out, 107 << shift, minus(uminusplus(v2330), v2331)); + store(out, 43 << shift, minus(uplusminus(v2330), v2331)); + real2 v2239 = ctimesminusplus(reverse(v2229), ctbl[5], ctimes(v2229, ctbl[3])); + real2 v2271 = ctimesminusplus(reverse(v2261), ctbl[4], ctimes(v2261, ctbl[2])); + real2 v2255 = ctimesminusplus(reverse(v2245), ctbl[1], ctimes(v2245, ctbl[0])); + real2 v2350 = minus(v2255, v2223); + real2 v2354 = plus(v2223, v2255); + real2 v2355 = plus(v2239, v2271); + store(out, 91 << shift, minus(v2354, v2355)); + store(out, 27 << shift, plus(v2354, v2355)); + real2 v2349 = reverse(minus(v2239, v2271)); + store(out, 59 << shift, minus(uplusminus(v2349), v2350)); + store(out, 123 << shift, minus(uminusplus(v2349), v2350)); + real2 v2091 = minus(uplusminus(v2081), v2082); + real2 v2095 = minus(uminusplus(v2081), v2082); + real2 v2181 = minusplus(uminus(v2177), v2178); + real2 v2179 = minusplus(v2177, v2178); + real2 v2101 = minusplus(uminus(v2097), v2098); + real2 v2099 = minusplus(v2097, v2098); + real2 v2165 = minusplus(uminus(v2161), v2162); + real2 v2163 = minusplus(v2161, v2162); + real2 v2147 = minusplus(v2145, v2146); + real2 v2149 = minusplus(uminus(v2145), v2146); + real2 v2155 = ctimesminusplus(reverse(v2147), ctbl[1], ctimes(v2147, ctbl[1])); + real2 v2197 = minusplus(uminus(v2193), v2194); + real2 v2195 = minusplus(v2193, v2194); + real2 v2117 = minusplus(uminus(v2113), v2114); + real2 v2115 = minusplus(v2113, v2114); + real2 v2123 = ctimesminusplus(reverse(v2115), ctbl[3], ctimes(v2115, ctbl[5])); + real2 v2171 = ctimesminusplus(reverse(v2163), ctbl[9], ctimes(v2163, ctbl[11])); + real2 v2107 = ctimesminusplus(reverse(v2099), ctbl[7], ctimes(v2099, ctbl[13])); + real2 v2389 = plus(v2107, v2171); + real2 v2385 = minus(v2171, v2107); + real2 v2187 = ctimesminusplus(reverse(v2179), ctbl[5], ctimes(v2179, ctbl[3])); + real2 v2374 = plus(v2123, v2187); + real2 v2368 = reverse(minus(v2123, v2187)); + real2 v2369 = minus(v2155, v2091); + real2 v2373 = plus(v2091, v2155); + real2 v2405 = plus(v2373, v2374); + real2 v2401 = minus(v2374, v2373); + real2 v2203 = ctimesminusplus(reverse(v2195), ctbl[13], ctimes(v2195, ctbl[7])); + real2 v2131 = minusplus(v2129, v2130); + real2 v2133 = minusplus(uminus(v2129), v2130); + real2 v2139 = ctimesminusplus(reverse(v2131), ctbl[11], ctimes(v2131, ctbl[9])); + real2 v2390 = plus(v2139, v2203); + real2 v2384 = reverse(minus(v2139, v2203)); + real2 v2400 = reverse(minus(v2389, v2390)); + store(out, 103 << shift, minus(uminusplus(v2400), v2401)); + store(out, 39 << shift, minus(uplusminus(v2400), v2401)); + real2 v2406 = plus(v2389, v2390); + store(out, 71 << shift, minus(v2405, v2406)); + store(out, 7 << shift, plus(v2405, v2406)); + real2 v2382 = minus(uminusplus(v2368), v2369); + real2 v2378 = minus(uplusminus(v2368), v2369); + real2 v2388 = minusplus(uminus(v2384), v2385); + real2 v2386 = minusplus(v2384, v2385); + real2 v2398 = ctimesminusplus(reverse(v2388), ctbl[1], ctimes(v2388, ctbl[0])); + store(out, 119 << shift, minus(v2382, v2398)); + store(out, 55 << shift, plus(v2382, v2398)); + real2 v2394 = ctimesminusplus(reverse(v2386), ctbl[1], ctimes(v2386, ctbl[1])); + store(out, 87 << shift, minus(v2378, v2394)); + store(out, 23 << shift, plus(v2378, v2394)); + real2 v2127 = ctimesminusplus(reverse(v2117), ctbl[5], ctimes(v2117, ctbl[3])); + real2 v2175 = ctimesminusplus(reverse(v2165), ctbl[7], ctimes(v2165, ctbl[6])); + real2 v2111 = ctimesminusplus(reverse(v2101), ctbl[11], ctimes(v2101, ctbl[9])); + real2 v2442 = minus(v2175, v2111); + real2 v2446 = plus(v2111, v2175); + real2 v2207 = ctimesminusplus(reverse(v2197), ctbl[10], ctimes(v2197, ctbl[8])); + real2 v2159 = ctimesminusplus(reverse(v2149), ctbl[1], ctimes(v2149, ctbl[0])); + real2 v2430 = plus(v2095, v2159); + real2 v2426 = minus(v2159, v2095); + real2 v2191 = ctimesminusplus(reverse(v2181), ctbl[4], ctimes(v2181, ctbl[2])); + real2 v2143 = ctimesminusplus(reverse(v2133), ctbl[13], ctimes(v2133, ctbl[12])); + real2 v2447 = plus(v2143, v2207); + real2 v2441 = reverse(minus(v2143, v2207)); + real2 v2425 = reverse(minus(v2127, v2191)); + real2 v2431 = plus(v2127, v2191); + real2 v2458 = minus(v2431, v2430); + real2 v2462 = plus(v2430, v2431); + real2 v2457 = reverse(minus(v2446, v2447)); + store(out, 47 << shift, minus(uplusminus(v2457), v2458)); + store(out, 111 << shift, minus(uminusplus(v2457), v2458)); + real2 v2463 = plus(v2446, v2447); + store(out, 79 << shift, minus(v2462, v2463)); + store(out, 15 << shift, plus(v2462, v2463)); + real2 v2435 = minus(uplusminus(v2425), v2426); + real2 v2439 = minus(uminusplus(v2425), v2426); + real2 v2445 = minusplus(uminus(v2441), v2442); + real2 v2443 = minusplus(v2441, v2442); + real2 v2451 = ctimesminusplus(reverse(v2443), ctbl[1], ctimes(v2443, ctbl[1])); + store(out, 31 << shift, plus(v2435, v2451)); + store(out, 95 << shift, minus(v2435, v2451)); + real2 v2455 = ctimesminusplus(reverse(v2445), ctbl[1], ctimes(v2445, ctbl[0])); + store(out, 127 << shift, minus(v2439, v2455)); + store(out, 63 << shift, plus(v2439, v2455)); +// Pres : 68124 + } +} + +ALIGNED(8192) void dft128b_%CONFIG%_%ISA%(real *RESTRICT out0, const real *RESTRICT in0, const int shift) { + const int k = 1 << (shift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + i0*2; + const real *in = in0 + i0*2; + +// Pres : 135650 + real2 v51 = load(in, 49 << shift); + real2 v115 = load(in, 113 << shift); + real2 v456 = plus(v51, v115); + real2 v450 = reverse(minus(v115, v51)); + real2 v83 = load(in, 81 << shift); + real2 v19 = load(in, 17 << shift); + real2 v455 = plus(v19, v83); + real2 v451 = minus(v83, v19); + real2 v721 = reverse(minus(v456, v455)); + real2 v727 = plus(v455, v456); + real2 v452 = minusplus(v450, v451); + real2 v454 = minusplus(uminus(v450), v451); + real2 v462 = ctimesminusplus(reverse(v452), ctbl[58], ctimes(v452, ctbl[59])); + real2 v466 = ctimesminusplus(reverse(v454), ctbl[48], ctimes(v454, ctbl[42])); + real2 v35 = load(in, 33 << shift); + real2 v99 = load(in, 97 << shift); + real2 v147 = reverse(minus(v99, v35)); + real2 v153 = plus(v35, v99); + real2 v3 = load(in, 1 << shift); + real2 v67 = load(in, 65 << shift); + real2 v152 = plus(v3, v67); + real2 v148 = minus(v67, v3); + real2 v722 = minus(v153, v152); + real2 v726 = plus(v152, v153); + real2 v982 = plus(v726, v727); + real2 v978 = minus(v727, v726); + real2 v149 = minusplus(v147, v148); + real2 v151 = minusplus(uminus(v147), v148); + real2 v165 = ctimesminusplus(reverse(v151), ctbl[44], ctimes(v151, ctbl[45])); + real2 v159 = ctimesminusplus(reverse(v149), ctbl[60], ctimes(v149, ctbl[61])); + real2 v723 = minusplus(v721, v722); + real2 v725 = minusplus(uminus(v721), v722); + real2 v2102 = plus(v165, v466); + real2 v2098 = minus(v466, v165); + real2 v731 = ctimesminusplus(reverse(v723), ctbl[28], ctimes(v723, ctbl[29])); + real2 v1697 = minus(v462, v159); + real2 v1701 = plus(v159, v462); + real2 v735 = ctimesminusplus(reverse(v725), ctbl[20], ctimes(v725, ctbl[21])); + real2 v75 = load(in, 73 << shift); + real2 v11 = load(in, 9 << shift); + real2 v304 = minus(v75, v11); + real2 v308 = plus(v11, v75); + real2 v107 = load(in, 105 << shift); + real2 v43 = load(in, 41 << shift); + real2 v309 = plus(v43, v107); + real2 v303 = reverse(minus(v107, v43)); + real2 v854 = plus(v308, v309); + real2 v850 = minus(v309, v308); + real2 v307 = minusplus(uminus(v303), v304); + real2 v305 = minusplus(v303, v304); + real2 v313 = ctimesminusplus(reverse(v305), ctbl[56], ctimes(v305, ctbl[57])); + real2 v319 = ctimesminusplus(reverse(v307), ctbl[38], ctimes(v307, ctbl[39])); + real2 v27 = load(in, 25 << shift); + real2 v91 = load(in, 89 << shift); + real2 v591 = plus(v27, v91); + real2 v587 = minus(v91, v27); + real2 v59 = load(in, 57 << shift); + real2 v123 = load(in, 121 << shift); + real2 v592 = plus(v59, v123); + real2 v586 = reverse(minus(v123, v59)); + real2 v849 = reverse(minus(v592, v591)); + real2 v855 = plus(v591, v592); + real2 v983 = plus(v854, v855); + real2 v977 = reverse(minus(v855, v854)); + real2 v590 = minusplus(uminus(v586), v587); + real2 v588 = minusplus(v586, v587); + real2 v597 = ctimesminusplus(reverse(v588), ctbl[54], ctimes(v588, ctbl[55])); + real2 v1110 = plus(v982, v983); + real2 v1106 = minus(v983, v982); + real2 v853 = minusplus(uminus(v849), v850); + real2 v851 = minusplus(v849, v850); + real2 v859 = ctimesminusplus(reverse(v851), ctbl[26], ctimes(v851, ctbl[27])); + real2 v1702 = plus(v313, v597); + real2 v1696 = reverse(minus(v597, v313)); + real2 v1825 = minus(v1702, v1701); + real2 v1829 = plus(v1701, v1702); + real2 v1700 = minusplus(uminus(v1696), v1697); + real2 v1698 = minusplus(v1696, v1697); + real2 v1710 = ctimesminusplus(reverse(v1700), ctbl[8], ctimes(v1700, ctbl[9])); + real2 v1706 = ctimesminusplus(reverse(v1698), ctbl[12], ctimes(v1698, ctbl[13])); + real2 v1379 = minus(v859, v731); + real2 v1383 = plus(v731, v859); + real2 v863 = ctimesminusplus(reverse(v853), ctbl[24], ctimes(v853, ctbl[18])); + real2 v1538 = minus(v863, v735); + real2 v1542 = plus(v735, v863); + real2 v981 = minusplus(uminus(v977), v978); + real2 v979 = minusplus(v977, v978); + real2 v987 = ctimesminusplus(reverse(v979), ctbl[12], ctimes(v979, ctbl[13])); + real2 v601 = ctimesminusplus(reverse(v590), ctbl[51], ctimes(v590, ctbl[50])); + real2 v991 = ctimesminusplus(reverse(v981), ctbl[8], ctimes(v981, ctbl[9])); + real2 v2103 = plus(v319, v601); + real2 v2097 = reverse(minus(v601, v319)); + real2 v2226 = minus(v2103, v2102); + real2 v2230 = plus(v2102, v2103); + real2 v2101 = minusplus(uminus(v2097), v2098); + real2 v2099 = minusplus(v2097, v2098); + real2 v2107 = ctimesminusplus(reverse(v2099), ctbl[12], ctimes(v2099, ctbl[13])); + real2 v127 = load(in, 125 << shift); + real2 v63 = load(in, 61 << shift); + real2 v660 = plus(v63, v127); + real2 v654 = reverse(minus(v127, v63)); + real2 v31 = load(in, 29 << shift); + real2 v95 = load(in, 93 << shift); + real2 v659 = plus(v31, v95); + real2 v655 = minus(v95, v31); + real2 v913 = reverse(minus(v660, v659)); + real2 v919 = plus(v659, v660); + real2 v658 = minusplus(uminus(v654), v655); + real2 v656 = minusplus(v654, v655); + real2 v666 = ctimesminusplus(reverse(v656), ctbl[46], ctimes(v656, ctbl[47])); + real2 v670 = ctimesminusplus(reverse(v658), ctbl[57], ctimes(v658, ctbl[56])); + real2 v47 = load(in, 45 << shift); + real2 v111 = load(in, 109 << shift); + real2 v377 = reverse(minus(v111, v47)); + real2 v383 = plus(v47, v111); + real2 v15 = load(in, 13 << shift); + real2 v79 = load(in, 77 << shift); + real2 v378 = minus(v79, v15); + real2 v382 = plus(v15, v79); + real2 v379 = minusplus(v377, v378); + real2 v381 = minusplus(uminus(v377), v378); + real2 v394 = ctimesminusplus(reverse(v381), ctbl[54], ctimes(v381, ctbl[36])); + real2 v2167 = plus(v394, v670); + real2 v2161 = reverse(minus(v670, v394)); + real2 v914 = minus(v383, v382); + real2 v918 = plus(v382, v383); + real2 v1047 = plus(v918, v919); + real2 v1041 = reverse(minus(v919, v918)); + real2 v917 = minusplus(uminus(v913), v914); + real2 v915 = minusplus(v913, v914); + real2 v923 = ctimesminusplus(reverse(v915), ctbl[22], ctimes(v915, ctbl[23])); + real2 v389 = ctimesminusplus(reverse(v379), ctbl[48], ctimes(v379, ctbl[49])); + real2 v1760 = reverse(minus(v666, v389)); + real2 v1766 = plus(v389, v666); + real2 v927 = ctimesminusplus(reverse(v917), ctbl[27], ctimes(v917, ctbl[26])); + real2 v87 = load(in, 85 << shift); + real2 v23 = load(in, 21 << shift); + real2 v520 = minus(v87, v23); + real2 v524 = plus(v23, v87); + real2 v55 = load(in, 53 << shift); + real2 v119 = load(in, 117 << shift); + real2 v519 = reverse(minus(v119, v55)); + real2 v525 = plus(v55, v119); + real2 v523 = minusplus(uminus(v519), v520); + real2 v521 = minusplus(v519, v520); + real2 v529 = ctimesminusplus(reverse(v521), ctbl[50], ctimes(v521, ctbl[51])); + real2 v533 = ctimesminusplus(reverse(v523), ctbl[60], ctimes(v523, ctbl[30])); + real2 v791 = plus(v524, v525); + real2 v785 = reverse(minus(v525, v524)); + real2 v39 = load(in, 37 << shift); + real2 v103 = load(in, 101 << shift); + real2 v231 = plus(v39, v103); + real2 v225 = reverse(minus(v103, v39)); + real2 v7 = load(in, 5 << shift); + real2 v71 = load(in, 69 << shift); + real2 v226 = minus(v71, v7); + real2 v230 = plus(v7, v71); + real2 v227 = minusplus(v225, v226); + real2 v229 = minusplus(uminus(v225), v226); + real2 v243 = ctimesminusplus(reverse(v229), ctbl[32], ctimes(v229, ctbl[33])); + real2 v2162 = minus(v533, v243); + real2 v2166 = plus(v243, v533); + real2 v2231 = plus(v2166, v2167); + real2 v2225 = reverse(minus(v2167, v2166)); + real2 v237 = ctimesminusplus(reverse(v227), ctbl[52], ctimes(v227, ctbl[53])); + real2 v1761 = minus(v529, v237); + real2 v1765 = plus(v237, v529); + real2 v1824 = reverse(minus(v1766, v1765)); + real2 v1830 = plus(v1765, v1766); + real2 v790 = plus(v230, v231); + real2 v786 = minus(v231, v230); + real2 v1826 = minusplus(v1824, v1825); + real2 v1828 = minusplus(uminus(v1824), v1825); + real2 v1764 = minusplus(uminus(v1760), v1761); + real2 v1762 = minusplus(v1760, v1761); + real2 v1889 = minus(v1830, v1829); + real2 v1893 = plus(v1829, v1830); + real2 v1838 = ctimesminusplus(reverse(v1828), ctbl[2], ctimes(v1828, ctbl[3])); + real2 v1774 = ctimesminusplus(reverse(v1764), ctbl[12], ctimes(v1764, ctbl[6])); + real2 v2041 = minus(v1774, v1710); + real2 v2045 = plus(v1710, v1774); + real2 v1770 = ctimesminusplus(reverse(v1762), ctbl[10], ctimes(v1762, ctbl[11])); + real2 v1988 = plus(v1706, v1770); + real2 v1984 = minus(v1770, v1706); + real2 v1834 = ctimesminusplus(reverse(v1826), ctbl[4], ctimes(v1826, ctbl[5])); + real2 v787 = minusplus(v785, v786); + real2 v789 = minusplus(uminus(v785), v786); + real2 v799 = ctimesminusplus(reverse(v789), ctbl[14], ctimes(v789, ctbl[15])); + real2 v1046 = plus(v790, v791); + real2 v1042 = minus(v791, v790); + real2 v1043 = minusplus(v1041, v1042); + real2 v1045 = minusplus(uminus(v1041), v1042); + real2 v1537 = reverse(minus(v927, v799)); + real2 v1543 = plus(v799, v927); + real2 v1606 = plus(v1542, v1543); + real2 v1602 = minus(v1543, v1542); + real2 v795 = ctimesminusplus(reverse(v787), ctbl[24], ctimes(v787, ctbl[25])); + real2 v1105 = reverse(minus(v1047, v1046)); + real2 v1111 = plus(v1046, v1047); + real2 v1384 = plus(v795, v923); + real2 v1378 = reverse(minus(v923, v795)); + real2 v1107 = minusplus(v1105, v1106); + real2 v1109 = minusplus(uminus(v1105), v1106); + real2 v1119 = ctimesminusplus(reverse(v1109), ctbl[2], ctimes(v1109, ctbl[3])); + real2 v1382 = minusplus(uminus(v1378), v1379); + real2 v1380 = minusplus(v1378, v1379); + real2 v1388 = ctimesminusplus(reverse(v1380), ctbl[4], ctimes(v1380, ctbl[5])); + real2 v1115 = ctimesminusplus(reverse(v1107), ctbl[4], ctimes(v1107, ctbl[5])); + real2 v1392 = ctimesminusplus(reverse(v1382), ctbl[2], ctimes(v1382, ctbl[3])); + real2 v1443 = minus(v1384, v1383); + real2 v1447 = plus(v1383, v1384); + real2 v1539 = minusplus(v1537, v1538); + real2 v1541 = minusplus(uminus(v1537), v1538); + real2 v1551 = ctimesminusplus(reverse(v1541), ctbl[2], ctimes(v1541, ctbl[3])); + real2 v1547 = ctimesminusplus(reverse(v1539), ctbl[4], ctimes(v1539, ctbl[5])); + real2 v1051 = ctimesminusplus(reverse(v1043), ctbl[10], ctimes(v1043, ctbl[11])); + real2 v2290 = minus(v2231, v2230); + real2 v2294 = plus(v2230, v2231); + real2 v1174 = plus(v1110, v1111); + real2 v1170 = minus(v1111, v1110); + real2 v1265 = minus(v1051, v987); + real2 v1269 = plus(v987, v1051); + real2 v1055 = ctimesminusplus(reverse(v1045), ctbl[12], ctimes(v1045, ctbl[6])); + real2 v1322 = minus(v1055, v991); + real2 v1326 = plus(v991, v1055); + real2 v129 = load(in, 127 << shift); + real2 v65 = load(in, 63 << shift); + real2 v688 = reverse(minus(v129, v65)); + real2 v694 = plus(v65, v129); + real2 v33 = load(in, 31 << shift); + real2 v97 = load(in, 95 << shift); + real2 v689 = minus(v97, v33); + real2 v693 = plus(v33, v97); + real2 v951 = plus(v693, v694); + real2 v945 = reverse(minus(v694, v693)); + real2 v692 = minusplus(uminus(v688), v689); + real2 v690 = minusplus(v688, v689); + real2 v699 = ctimesminusplus(reverse(v690), ctbl[30], ctimes(v690, ctbl[31])); + real2 v17 = load(in, 15 << shift); + real2 v81 = load(in, 79 << shift); + real2 v420 = plus(v17, v81); + real2 v416 = minus(v81, v17); + real2 v113 = load(in, 111 << shift); + real2 v49 = load(in, 47 << shift); + real2 v415 = reverse(minus(v113, v49)); + real2 v421 = plus(v49, v113); + real2 v419 = minusplus(uminus(v415), v416); + real2 v417 = minusplus(v415, v416); + real2 v425 = ctimesminusplus(reverse(v417), ctbl[32], ctimes(v417, ctbl[33])); + real2 v1792 = reverse(minus(v699, v425)); + real2 v1798 = plus(v425, v699); + real2 v950 = plus(v420, v421); + real2 v946 = minus(v421, v420); + real2 v947 = minusplus(v945, v946); + real2 v949 = minusplus(uminus(v945), v946); + real2 v959 = ctimesminusplus(reverse(v949), ctbl[21], ctimes(v949, ctbl[20])); + real2 v955 = ctimesminusplus(reverse(v947), ctbl[14], ctimes(v947, ctbl[15])); + real2 v1079 = plus(v950, v951); + real2 v1073 = reverse(minus(v951, v950)); + real2 v73 = load(in, 71 << shift); + real2 v9 = load(in, 7 << shift); + real2 v268 = plus(v9, v73); + real2 v264 = minus(v73, v9); + real2 v105 = load(in, 103 << shift); + real2 v41 = load(in, 39 << shift); + real2 v269 = plus(v41, v105); + real2 v263 = reverse(minus(v105, v41)); + real2 v818 = minus(v269, v268); + real2 v822 = plus(v268, v269); + real2 v267 = minusplus(uminus(v263), v264); + real2 v265 = minusplus(v263, v264); + real2 v275 = ctimesminusplus(reverse(v265), ctbl[36], ctimes(v265, ctbl[37])); + real2 v89 = load(in, 87 << shift); + real2 v25 = load(in, 23 << shift); + real2 v557 = plus(v25, v89); + real2 v553 = minus(v89, v25); + real2 v121 = load(in, 119 << shift); + real2 v57 = load(in, 55 << shift); + real2 v558 = plus(v57, v121); + real2 v552 = reverse(minus(v121, v57)); + real2 v823 = plus(v557, v558); + real2 v817 = reverse(minus(v558, v557)); + real2 v1078 = plus(v822, v823); + real2 v1074 = minus(v823, v822); + real2 v819 = minusplus(v817, v818); + real2 v821 = minusplus(uminus(v817), v818); + real2 v1077 = minusplus(uminus(v1073), v1074); + real2 v1075 = minusplus(v1073, v1074); + real2 v1083 = ctimesminusplus(reverse(v1075), ctbl[6], ctimes(v1075, ctbl[7])); + real2 v1087 = ctimesminusplus(reverse(v1077), ctbl[9], ctimes(v1077, ctbl[8])); + real2 v556 = minusplus(uminus(v552), v553); + real2 v554 = minusplus(v552, v553); + real2 v564 = ctimesminusplus(reverse(v554), ctbl[34], ctimes(v554, ctbl[35])); + real2 v1793 = minus(v564, v275); + real2 v1797 = plus(v275, v564); + real2 v1862 = plus(v1797, v1798); + real2 v1856 = reverse(minus(v1798, v1797)); + real2 v1794 = minusplus(v1792, v1793); + real2 v1796 = minusplus(uminus(v1792), v1793); + real2 v827 = ctimesminusplus(reverse(v819), ctbl[16], ctimes(v819, ctbl[17])); + real2 v1410 = reverse(minus(v955, v827)); + real2 v1416 = plus(v827, v955); + real2 v1143 = plus(v1078, v1079); + real2 v1137 = reverse(minus(v1079, v1078)); + real2 v831 = ctimesminusplus(reverse(v821), ctbl[18], ctimes(v821, ctbl[24])); + real2 v1575 = plus(v831, v959); + real2 v1569 = reverse(minus(v959, v831)); + real2 v5 = load(in, 3 << shift); + real2 v69 = load(in, 67 << shift); + real2 v188 = minus(v69, v5); + real2 v192 = plus(v5, v69); + real2 v101 = load(in, 99 << shift); + real2 v37 = load(in, 35 << shift); + real2 v193 = plus(v37, v101); + real2 v187 = reverse(minus(v101, v37)); + real2 v754 = minus(v193, v192); + real2 v758 = plus(v192, v193); + real2 v189 = minusplus(v187, v188); + real2 v191 = minusplus(uminus(v187), v188); + real2 v197 = ctimesminusplus(reverse(v189), ctbl[44], ctimes(v189, ctbl[45])); + real2 v21 = load(in, 19 << shift); + real2 v85 = load(in, 83 << shift); + real2 v485 = minus(v85, v21); + real2 v489 = plus(v21, v85); + real2 v53 = load(in, 51 << shift); + real2 v117 = load(in, 115 << shift); + real2 v484 = reverse(minus(v117, v53)); + real2 v490 = plus(v53, v117); + real2 v753 = reverse(minus(v490, v489)); + real2 v759 = plus(v489, v490); + real2 v757 = minusplus(uminus(v753), v754); + real2 v755 = minusplus(v753, v754); + real2 v767 = ctimesminusplus(reverse(v757), ctbl[26], ctimes(v757, ctbl[27])); + real2 v763 = ctimesminusplus(reverse(v755), ctbl[20], ctimes(v755, ctbl[21])); + real2 v486 = minusplus(v484, v485); + real2 v488 = minusplus(uminus(v484), v485); + real2 v495 = ctimesminusplus(reverse(v486), ctbl[42], ctimes(v486, ctbl[43])); + real2 v1729 = minus(v495, v197); + real2 v1733 = plus(v197, v495); + real2 v1014 = plus(v758, v759); + real2 v1010 = minus(v759, v758); + real2 v13 = load(in, 11 << shift); + real2 v77 = load(in, 75 << shift); + real2 v342 = minus(v77, v13); + real2 v346 = plus(v13, v77); + real2 v45 = load(in, 43 << shift); + real2 v109 = load(in, 107 << shift); + real2 v347 = plus(v45, v109); + real2 v341 = reverse(minus(v109, v45)); + real2 v345 = minusplus(uminus(v341), v342); + real2 v343 = minusplus(v341, v342); + real2 v882 = minus(v347, v346); + real2 v886 = plus(v346, v347); + real2 v353 = ctimesminusplus(reverse(v343), ctbl[40], ctimes(v343, ctbl[41])); + real2 v125 = load(in, 123 << shift); + real2 v61 = load(in, 59 << shift); + real2 v621 = reverse(minus(v125, v61)); + real2 v627 = plus(v61, v125); + real2 v93 = load(in, 91 << shift); + real2 v29 = load(in, 27 << shift); + real2 v622 = minus(v93, v29); + real2 v626 = plus(v29, v93); + real2 v887 = plus(v626, v627); + real2 v881 = reverse(minus(v627, v626)); + real2 v885 = minusplus(uminus(v881), v882); + real2 v883 = minusplus(v881, v882); + real2 v891 = ctimesminusplus(reverse(v883), ctbl[18], ctimes(v883, ctbl[19])); + real2 v1009 = reverse(minus(v887, v886)); + real2 v1015 = plus(v886, v887); + real2 v1415 = plus(v763, v891); + real2 v1411 = minus(v891, v763); + real2 v895 = ctimesminusplus(reverse(v885), ctbl[15], ctimes(v885, ctbl[14])); + real2 v1570 = minus(v895, v767); + real2 v1574 = plus(v767, v895); + real2 v1142 = plus(v1014, v1015); + real2 v1138 = minus(v1015, v1014); + real2 v1011 = minusplus(v1009, v1010); + real2 v1013 = minusplus(uminus(v1009), v1010); + real2 v1023 = ctimesminusplus(reverse(v1013), ctbl[6], ctimes(v1013, ctbl[12])); + real2 v1019 = ctimesminusplus(reverse(v1011), ctbl[8], ctimes(v1011, ctbl[9])); + real2 v1321 = reverse(minus(v1087, v1023)); + real2 v1327 = plus(v1023, v1087); + real2 v1414 = minusplus(uminus(v1410), v1411); + real2 v1412 = minusplus(v1410, v1411); + real2 v1424 = ctimesminusplus(reverse(v1414), ctbl[3], ctimes(v1414, ctbl[2])); + real2 v1508 = plus(v1392, v1424); + real2 v1502 = reverse(minus(v1424, v1392)); + real2 v1264 = reverse(minus(v1083, v1019)); + real2 v1270 = plus(v1019, v1083); + real2 v1286 = plus(v1269, v1270); + real2 v1280 = reverse(minus(v1270, v1269)); + real2 v1268 = minusplus(uminus(v1264), v1265); + real2 v1266 = minusplus(v1264, v1265); + real2 v1141 = minusplus(uminus(v1137), v1138); + real2 v1139 = minusplus(v1137, v1138); + real2 v1147 = ctimesminusplus(reverse(v1139), ctbl[2], ctimes(v1139, ctbl[3])); + real2 v1278 = ctimesminusplus(reverse(v1268), ctbl[0], ctimes(v1268, ctbl[0])); + real2 v1151 = ctimesminusplus(reverse(v1141), ctbl[3], ctimes(v1141, ctbl[2])); + real2 v1235 = plus(v1119, v1151); + real2 v1229 = reverse(minus(v1151, v1119)); + real2 v1420 = ctimesminusplus(reverse(v1412), ctbl[2], ctimes(v1412, ctbl[3])); + real2 v1483 = reverse(minus(v1420, v1388)); + real2 v1489 = plus(v1388, v1420); + real2 v1274 = ctimesminusplus(reverse(v1266), ctbl[0], ctimes(v1266, ctbl[1])); + real2 v1607 = plus(v1574, v1575); + real2 v1601 = reverse(minus(v1575, v1574)); + real2 v1605 = minusplus(uminus(v1601), v1602); + real2 v1603 = minusplus(v1601, v1602); + real2 v1175 = plus(v1142, v1143); + real2 v1169 = reverse(minus(v1143, v1142)); + real2 v1171 = minusplus(v1169, v1170); + real2 v1173 = minusplus(uminus(v1169), v1170); + real2 v1179 = ctimesminusplus(reverse(v1171), ctbl[0], ctimes(v1171, ctbl[1])); + real2 v1191 = plus(v1174, v1175); + real2 v1185 = reverse(minus(v1175, v1174)); + real2 v1325 = minusplus(uminus(v1321), v1322); + real2 v1323 = minusplus(v1321, v1322); + real2 v1331 = ctimesminusplus(reverse(v1323), ctbl[0], ctimes(v1323, ctbl[1])); + real2 v1448 = plus(v1415, v1416); + real2 v1442 = reverse(minus(v1416, v1415)); + real2 v1446 = minusplus(uminus(v1442), v1443); + real2 v1444 = minusplus(v1442, v1443); + real2 v1452 = ctimesminusplus(reverse(v1444), ctbl[0], ctimes(v1444, ctbl[1])); + real2 v1464 = plus(v1447, v1448); + real2 v1458 = reverse(minus(v1448, v1447)); + real2 v1335 = ctimesminusplus(reverse(v1325), ctbl[0], ctimes(v1325, ctbl[0])); + real2 v1337 = reverse(minus(v1327, v1326)); + real2 v1343 = plus(v1326, v1327); + real2 v1183 = ctimesminusplus(reverse(v1173), ctbl[0], ctimes(v1173, ctbl[0])); + real2 v1456 = ctimesminusplus(reverse(v1446), ctbl[0], ctimes(v1446, ctbl[0])); + real2 v1210 = reverse(minus(v1147, v1115)); + real2 v1216 = plus(v1115, v1147); + real2 v1623 = plus(v1606, v1607); + real2 v1617 = reverse(minus(v1607, v1606)); + real2 v1571 = minusplus(v1569, v1570); + real2 v1573 = minusplus(uminus(v1569), v1570); + real2 v1583 = ctimesminusplus(reverse(v1573), ctbl[3], ctimes(v1573, ctbl[2])); + real2 v1661 = reverse(minus(v1583, v1551)); + real2 v1667 = plus(v1551, v1583); + real2 v1611 = ctimesminusplus(reverse(v1603), ctbl[0], ctimes(v1603, ctbl[1])); + real2 v1615 = ctimesminusplus(reverse(v1605), ctbl[0], ctimes(v1605, ctbl[0])); + real2 v1579 = ctimesminusplus(reverse(v1571), ctbl[2], ctimes(v1571, ctbl[3])); + real2 v1648 = plus(v1547, v1579); + real2 v1642 = reverse(minus(v1579, v1547)); + real2 v92 = load(in, 90 << shift); + real2 v28 = load(in, 26 << shift); + real2 v604 = minus(v92, v28); + real2 v608 = plus(v28, v92); + real2 v60 = load(in, 58 << shift); + real2 v124 = load(in, 122 << shift); + real2 v603 = reverse(minus(v124, v60)); + real2 v609 = plus(v60, v124); + real2 v871 = plus(v608, v609); + real2 v865 = reverse(minus(v609, v608)); + real2 v76 = load(in, 74 << shift); + real2 v12 = load(in, 10 << shift); + real2 v322 = minus(v76, v12); + real2 v326 = plus(v12, v76); + real2 v108 = load(in, 106 << shift); + real2 v44 = load(in, 42 << shift); + real2 v321 = reverse(minus(v108, v44)); + real2 v327 = plus(v44, v108); + real2 v870 = plus(v326, v327); + real2 v866 = minus(v327, v326); + real2 v993 = reverse(minus(v871, v870)); + real2 v999 = plus(v870, v871); + real2 v869 = minusplus(uminus(v865), v866); + real2 v867 = minusplus(v865, v866); + real2 v875 = ctimesminusplus(reverse(v867), ctbl[10], ctimes(v867, ctbl[11])); + real2 v879 = ctimesminusplus(reverse(v869), ctbl[12], ctimes(v869, ctbl[6])); + real2 v36 = load(in, 34 << shift); + real2 v100 = load(in, 98 << shift); + real2 v167 = reverse(minus(v100, v36)); + real2 v173 = plus(v36, v100); + real2 v68 = load(in, 66 << shift); + real2 v4 = load(in, 2 << shift); + real2 v168 = minus(v68, v4); + real2 v172 = plus(v4, v68); + real2 v742 = plus(v172, v173); + real2 v738 = minus(v173, v172); + real2 v52 = load(in, 50 << shift); + real2 v116 = load(in, 114 << shift); + real2 v468 = reverse(minus(v116, v52)); + real2 v474 = plus(v52, v116); + real2 v84 = load(in, 82 << shift); + real2 v20 = load(in, 18 << shift); + real2 v469 = minus(v84, v20); + real2 v473 = plus(v20, v84); + real2 v743 = plus(v473, v474); + real2 v737 = reverse(minus(v474, v473)); + real2 v739 = minusplus(v737, v738); + real2 v741 = minusplus(uminus(v737), v738); + real2 v747 = ctimesminusplus(reverse(v739), ctbl[12], ctimes(v739, ctbl[13])); + real2 v998 = plus(v742, v743); + real2 v994 = minus(v743, v742); + real2 v1399 = plus(v747, v875); + real2 v1395 = minus(v875, v747); + real2 v1122 = minus(v999, v998); + real2 v1126 = plus(v998, v999); + real2 v997 = minusplus(uminus(v993), v994); + real2 v995 = minusplus(v993, v994); + real2 v1003 = ctimesminusplus(reverse(v995), ctbl[4], ctimes(v995, ctbl[5])); + real2 v1007 = ctimesminusplus(reverse(v997), ctbl[2], ctimes(v997, ctbl[3])); + real2 v80 = load(in, 78 << shift); + real2 v16 = load(in, 14 << shift); + real2 v397 = minus(v80, v16); + real2 v401 = plus(v16, v80); + real2 v48 = load(in, 46 << shift); + real2 v112 = load(in, 110 << shift); + real2 v402 = plus(v48, v112); + real2 v396 = reverse(minus(v112, v48)); + real2 v934 = plus(v401, v402); + real2 v930 = minus(v402, v401); + real2 v96 = load(in, 94 << shift); + real2 v32 = load(in, 30 << shift); + real2 v673 = minus(v96, v32); + real2 v677 = plus(v32, v96); + real2 v64 = load(in, 62 << shift); + real2 v128 = load(in, 126 << shift); + real2 v678 = plus(v64, v128); + real2 v672 = reverse(minus(v128, v64)); + real2 v929 = reverse(minus(v678, v677)); + real2 v935 = plus(v677, v678); + real2 v933 = minusplus(uminus(v929), v930); + real2 v931 = minusplus(v929, v930); + real2 v1057 = reverse(minus(v935, v934)); + real2 v1063 = plus(v934, v935); + real2 v939 = ctimesminusplus(reverse(v931), ctbl[6], ctimes(v931, ctbl[7])); + real2 v104 = load(in, 102 << shift); + real2 v40 = load(in, 38 << shift); + real2 v251 = plus(v40, v104); + real2 v245 = reverse(minus(v104, v40)); + real2 v72 = load(in, 70 << shift); + real2 v8 = load(in, 6 << shift); + real2 v246 = minus(v72, v8); + real2 v250 = plus(v8, v72); + real2 v802 = minus(v251, v250); + real2 v806 = plus(v250, v251); + real2 v88 = load(in, 86 << shift); + real2 v24 = load(in, 22 << shift); + real2 v540 = plus(v24, v88); + real2 v536 = minus(v88, v24); + real2 v120 = load(in, 118 << shift); + real2 v56 = load(in, 54 << shift); + real2 v541 = plus(v56, v120); + real2 v535 = reverse(minus(v120, v56)); + real2 v807 = plus(v540, v541); + real2 v801 = reverse(minus(v541, v540)); + real2 v1062 = plus(v806, v807); + real2 v1058 = minus(v807, v806); + real2 v1059 = minusplus(v1057, v1058); + real2 v1061 = minusplus(uminus(v1057), v1058); + real2 v1127 = plus(v1062, v1063); + real2 v1121 = reverse(minus(v1063, v1062)); + real2 v1071 = ctimesminusplus(reverse(v1061), ctbl[3], ctimes(v1061, ctbl[2])); + real2 v1067 = ctimesminusplus(reverse(v1059), ctbl[2], ctimes(v1059, ctbl[3])); + real2 v1153 = reverse(minus(v1127, v1126)); + real2 v1159 = plus(v1126, v1127); + real2 v1123 = minusplus(v1121, v1122); + real2 v1125 = minusplus(uminus(v1121), v1122); + real2 v1254 = plus(v1003, v1067); + real2 v1248 = reverse(minus(v1067, v1003)); + real2 v1131 = ctimesminusplus(reverse(v1123), ctbl[0], ctimes(v1123, ctbl[1])); + real2 v1305 = reverse(minus(v1071, v1007)); + real2 v1311 = plus(v1007, v1071); + real2 v1135 = ctimesminusplus(reverse(v1125), ctbl[0], ctimes(v1125, ctbl[0])); + real2 v42 = load(in, 40 << shift); + real2 v106 = load(in, 104 << shift); + real2 v283 = reverse(minus(v106, v42)); + real2 v289 = plus(v42, v106); + real2 v10 = load(in, 8 << shift); + real2 v74 = load(in, 72 << shift); + real2 v284 = minus(v74, v10); + real2 v288 = plus(v10, v74); + real2 v838 = plus(v288, v289); + real2 v834 = minus(v289, v288); + real2 v66 = load(in, 64 << shift); + real2 v2 = load(in, 0 << shift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << shift); + real2 v34 = load(in, 32 << shift); + real2 v131 = reverse(minus(v98, v34)); + real2 v137 = plus(v34, v98); + real2 v706 = minus(v137, v136); + real2 v710 = plus(v136, v137); + real2 v122 = load(in, 120 << shift); + real2 v58 = load(in, 56 << shift); + real2 v570 = reverse(minus(v122, v58)); + real2 v576 = plus(v58, v122); + real2 v90 = load(in, 88 << shift); + real2 v26 = load(in, 24 << shift); + real2 v575 = plus(v26, v90); + real2 v571 = minus(v90, v26); + real2 v839 = plus(v575, v576); + real2 v833 = reverse(minus(v576, v575)); + real2 v961 = reverse(minus(v839, v838)); + real2 v967 = plus(v838, v839); + real2 v50 = load(in, 48 << shift); + real2 v114 = load(in, 112 << shift); + real2 v438 = plus(v50, v114); + real2 v432 = reverse(minus(v114, v50)); + real2 v82 = load(in, 80 << shift); + real2 v18 = load(in, 16 << shift); + real2 v433 = minus(v82, v18); + real2 v437 = plus(v18, v82); + real2 v705 = reverse(minus(v438, v437)); + real2 v711 = plus(v437, v438); + real2 v962 = minus(v711, v710); + real2 v966 = plus(v710, v711); + real2 v1094 = plus(v966, v967); + real2 v1090 = minus(v967, v966); + real2 v126 = load(in, 124 << shift); + real2 v62 = load(in, 60 << shift); + real2 v643 = plus(v62, v126); + real2 v637 = reverse(minus(v126, v62)); + real2 v30 = load(in, 28 << shift); + real2 v94 = load(in, 92 << shift); + real2 v638 = minus(v94, v30); + real2 v642 = plus(v30, v94); + real2 v903 = plus(v642, v643); + real2 v897 = reverse(minus(v643, v642)); + real2 v14 = load(in, 12 << shift); + real2 v78 = load(in, 76 << shift); + real2 v361 = minus(v78, v14); + real2 v365 = plus(v14, v78); + real2 v46 = load(in, 44 << shift); + real2 v110 = load(in, 108 << shift); + real2 v360 = reverse(minus(v110, v46)); + real2 v366 = plus(v46, v110); + real2 v898 = minus(v366, v365); + real2 v902 = plus(v365, v366); + real2 v1031 = plus(v902, v903); + real2 v1025 = reverse(minus(v903, v902)); + real2 v102 = load(in, 100 << shift); + real2 v38 = load(in, 36 << shift); + real2 v205 = reverse(minus(v102, v38)); + real2 v211 = plus(v38, v102); + real2 v70 = load(in, 68 << shift); + real2 v6 = load(in, 4 << shift); + real2 v210 = plus(v6, v70); + real2 v206 = minus(v70, v6); + real2 v770 = minus(v211, v210); + real2 v774 = plus(v210, v211); + real2 v86 = load(in, 84 << shift); + real2 v22 = load(in, 20 << shift); + real2 v502 = minus(v86, v22); + real2 v506 = plus(v22, v86); + real2 v118 = load(in, 116 << shift); + real2 v54 = load(in, 52 << shift); + real2 v501 = reverse(minus(v118, v54)); + real2 v507 = plus(v54, v118); + real2 v769 = reverse(minus(v507, v506)); + real2 v775 = plus(v506, v507); + real2 v1030 = plus(v774, v775); + real2 v1026 = minus(v775, v774); + real2 v1089 = reverse(minus(v1031, v1030)); + real2 v1095 = plus(v1030, v1031); + real2 v1099 = minus(uplusminus(v1089), v1090); + real2 v1103 = minus(uminusplus(v1089), v1090); + real2 v1215 = plus(v1099, v1131); + store(out, 72 << shift, minus(v1215, v1216)); + store(out, 8 << shift, plus(v1215, v1216)); + real2 v1211 = minus(v1131, v1099); + store(out, 40 << shift, minus(uplusminus(v1210), v1211)); + store(out, 104 << shift, minus(uminusplus(v1210), v1211)); + real2 v1234 = plus(v1103, v1135); + real2 v1230 = minus(v1135, v1103); + store(out, 120 << shift, minus(uminusplus(v1229), v1230)); + store(out, 56 << shift, minus(uplusminus(v1229), v1230)); + store(out, 24 << shift, plus(v1234, v1235)); + store(out, 88 << shift, minus(v1234, v1235)); + real2 v1154 = minus(v1095, v1094); + real2 v1158 = plus(v1094, v1095); + real2 v1167 = minus(uminusplus(v1153), v1154); + real2 v1163 = minus(uplusminus(v1153), v1154); + store(out, 16 << shift, plus(v1163, v1179)); + store(out, 80 << shift, minus(v1163, v1179)); + store(out, 48 << shift, plus(v1167, v1183)); + store(out, 112 << shift, minus(v1167, v1183)); + real2 v1186 = minus(v1159, v1158); + real2 v1190 = plus(v1158, v1159); + store(out, 0 << shift, plus(v1190, v1191)); + store(out, 64 << shift, minus(v1190, v1191)); + store(out, 32 << shift, minus(uplusminus(v1185), v1186)); + store(out, 96 << shift, minus(uminusplus(v1185), v1186)); + real2 v1027 = minusplus(v1025, v1026); + real2 v1029 = minusplus(uminus(v1025), v1026); + real2 v971 = minus(uplusminus(v961), v962); + real2 v975 = minus(uminusplus(v961), v962); + real2 v1039 = ctimesminusplus(reverse(v1029), ctbl[0], ctimes(v1029, ctbl[0])); + real2 v1310 = plus(v975, v1039); + real2 v1306 = minus(v1039, v975); + real2 v1342 = plus(v1310, v1311); + real2 v1338 = minus(v1311, v1310); + store(out, 12 << shift, plus(v1342, v1343)); + store(out, 76 << shift, minus(v1342, v1343)); + store(out, 108 << shift, minus(uminusplus(v1337), v1338)); + store(out, 44 << shift, minus(uplusminus(v1337), v1338)); + real2 v1315 = minus(uplusminus(v1305), v1306); + store(out, 28 << shift, plus(v1315, v1331)); + store(out, 92 << shift, minus(v1315, v1331)); + real2 v1319 = minus(uminusplus(v1305), v1306); + store(out, 60 << shift, plus(v1319, v1335)); + store(out, 124 << shift, minus(v1319, v1335)); + real2 v1035 = ctimesminusplus(reverse(v1027), ctbl[0], ctimes(v1027, ctbl[1])); + real2 v1253 = plus(v971, v1035); + real2 v1249 = minus(v1035, v971); + real2 v1281 = minus(v1254, v1253); + store(out, 36 << shift, minus(uplusminus(v1280), v1281)); + store(out, 100 << shift, minus(uminusplus(v1280), v1281)); + real2 v1285 = plus(v1253, v1254); + store(out, 68 << shift, minus(v1285, v1286)); + store(out, 4 << shift, plus(v1285, v1286)); + real2 v1262 = minus(uminusplus(v1248), v1249); + store(out, 116 << shift, minus(v1262, v1278)); + store(out, 52 << shift, plus(v1262, v1278)); + real2 v1258 = minus(uplusminus(v1248), v1249); + store(out, 20 << shift, plus(v1258, v1274)); + store(out, 84 << shift, minus(v1258, v1274)); + real2 v901 = minusplus(uminus(v897), v898); + real2 v899 = minusplus(v897, v898); + real2 v805 = minusplus(uminus(v801), v802); + real2 v803 = minusplus(v801, v802); + real2 v811 = ctimesminusplus(reverse(v803), ctbl[8], ctimes(v803, ctbl[9])); + real2 v1400 = plus(v811, v939); + real2 v1394 = reverse(minus(v939, v811)); + real2 v837 = minusplus(uminus(v833), v834); + real2 v835 = minusplus(v833, v834); + real2 v843 = ctimesminusplus(reverse(v835), ctbl[0], ctimes(v835, ctbl[1])); + real2 v773 = minusplus(uminus(v769), v770); + real2 v771 = minusplus(v769, v770); + real2 v1398 = minusplus(uminus(v1394), v1395); + real2 v1396 = minusplus(v1394, v1395); + real2 v907 = ctimesminusplus(reverse(v899), ctbl[2], ctimes(v899, ctbl[3])); + real2 v715 = minus(uplusminus(v705), v706); + real2 v719 = minus(uminusplus(v705), v706); + real2 v1363 = minus(v843, v715); + real2 v1367 = plus(v715, v843); + real2 v1408 = ctimesminusplus(reverse(v1398), ctbl[0], ctimes(v1398, ctbl[0])); + real2 v779 = ctimesminusplus(reverse(v771), ctbl[4], ctimes(v771, ctbl[5])); + real2 v1362 = reverse(minus(v907, v779)); + real2 v1368 = plus(v779, v907); + real2 v1376 = minus(uminusplus(v1362), v1363); + real2 v1372 = minus(uplusminus(v1362), v1363); + real2 v1507 = plus(v1376, v1408); + real2 v1503 = minus(v1408, v1376); + store(out, 122 << shift, minus(uminusplus(v1502), v1503)); + store(out, 58 << shift, minus(uplusminus(v1502), v1503)); + store(out, 90 << shift, minus(v1507, v1508)); + store(out, 26 << shift, plus(v1507, v1508)); + real2 v1404 = ctimesminusplus(reverse(v1396), ctbl[0], ctimes(v1396, ctbl[1])); + real2 v1484 = minus(v1404, v1372); + real2 v1488 = plus(v1372, v1404); + store(out, 10 << shift, plus(v1488, v1489)); + store(out, 74 << shift, minus(v1488, v1489)); + store(out, 106 << shift, minus(uminusplus(v1483), v1484)); + store(out, 42 << shift, minus(uplusminus(v1483), v1484)); + real2 v1426 = reverse(minus(v1400, v1399)); + real2 v1432 = plus(v1399, v1400); + real2 v1431 = plus(v1367, v1368); + real2 v1427 = minus(v1368, v1367); + real2 v1463 = plus(v1431, v1432); + store(out, 66 << shift, minus(v1463, v1464)); + store(out, 2 << shift, plus(v1463, v1464)); + real2 v1459 = minus(v1432, v1431); + store(out, 98 << shift, minus(uminusplus(v1458), v1459)); + store(out, 34 << shift, minus(uplusminus(v1458), v1459)); + real2 v1436 = minus(uplusminus(v1426), v1427); + store(out, 82 << shift, minus(v1436, v1452)); + store(out, 18 << shift, plus(v1436, v1452)); + real2 v1440 = minus(uminusplus(v1426), v1427); + store(out, 50 << shift, plus(v1440, v1456)); + store(out, 114 << shift, minus(v1440, v1456)); + real2 v911 = ctimesminusplus(reverse(v901), ctbl[3], ctimes(v901, ctbl[2])); + real2 v783 = ctimesminusplus(reverse(v773), ctbl[2], ctimes(v773, ctbl[3])); + real2 v1527 = plus(v783, v911); + real2 v1521 = reverse(minus(v911, v783)); + real2 v943 = ctimesminusplus(reverse(v933), ctbl[9], ctimes(v933, ctbl[8])); + real2 v847 = ctimesminusplus(reverse(v837), ctbl[0], ctimes(v837, ctbl[0])); + real2 v1522 = minus(v847, v719); + real2 v1526 = plus(v719, v847); + real2 v1590 = plus(v1526, v1527); + real2 v1586 = minus(v1527, v1526); + real2 v815 = ctimesminusplus(reverse(v805), ctbl[6], ctimes(v805, ctbl[12])); + real2 v1559 = plus(v815, v943); + real2 v1553 = reverse(minus(v943, v815)); + real2 v751 = ctimesminusplus(reverse(v741), ctbl[8], ctimes(v741, ctbl[9])); + real2 v1558 = plus(v751, v879); + real2 v1554 = minus(v879, v751); + real2 v1585 = reverse(minus(v1559, v1558)); + real2 v1591 = plus(v1558, v1559); + real2 v1618 = minus(v1591, v1590); + real2 v1622 = plus(v1590, v1591); + store(out, 70 << shift, minus(v1622, v1623)); + store(out, 6 << shift, plus(v1622, v1623)); + store(out, 102 << shift, minus(uminusplus(v1617), v1618)); + store(out, 38 << shift, minus(uplusminus(v1617), v1618)); + real2 v1599 = minus(uminusplus(v1585), v1586); + real2 v1595 = minus(uplusminus(v1585), v1586); + store(out, 22 << shift, plus(v1595, v1611)); + store(out, 86 << shift, minus(v1595, v1611)); + store(out, 54 << shift, plus(v1599, v1615)); + store(out, 118 << shift, minus(v1599, v1615)); + real2 v1555 = minusplus(v1553, v1554); + real2 v1557 = minusplus(uminus(v1553), v1554); + real2 v1531 = minus(uplusminus(v1521), v1522); + real2 v1535 = minus(uminusplus(v1521), v1522); + real2 v1567 = ctimesminusplus(reverse(v1557), ctbl[0], ctimes(v1557, ctbl[0])); + real2 v1666 = plus(v1535, v1567); + store(out, 94 << shift, minus(v1666, v1667)); + store(out, 30 << shift, plus(v1666, v1667)); + real2 v1662 = minus(v1567, v1535); + store(out, 126 << shift, minus(uminusplus(v1661), v1662)); + store(out, 62 << shift, minus(uplusminus(v1661), v1662)); + real2 v1563 = ctimesminusplus(reverse(v1555), ctbl[0], ctimes(v1555, ctbl[1])); + real2 v1643 = minus(v1563, v1531); + store(out, 46 << shift, minus(uplusminus(v1642), v1643)); + store(out, 110 << shift, minus(uminusplus(v1642), v1643)); + real2 v1647 = plus(v1531, v1563); + store(out, 78 << shift, minus(v1647, v1648)); + store(out, 14 << shift, plus(v1647, v1648)); + real2 v436 = minusplus(uminus(v432), v433); + real2 v434 = minusplus(v432, v433); + real2 v145 = minus(uminusplus(v131), v132); + real2 v141 = minus(uplusminus(v131), v132); + real2 v607 = minusplus(uminus(v603), v604); + real2 v605 = minusplus(v603, v604); + real2 v615 = ctimesminusplus(reverse(v605), ctbl[22], ctimes(v605, ctbl[23])); + real2 v325 = minusplus(uminus(v321), v322); + real2 v323 = minusplus(v321, v322); + real2 v171 = minusplus(uminus(v167), v168); + real2 v169 = minusplus(v167, v168); + real2 v179 = ctimesminusplus(reverse(v169), ctbl[28], ctimes(v169, ctbl[29])); + real2 v333 = ctimesminusplus(reverse(v323), ctbl[24], ctimes(v323, ctbl[25])); + real2 v1718 = plus(v333, v615); + real2 v1712 = reverse(minus(v615, v333)); + real2 v470 = minusplus(v468, v469); + real2 v472 = minusplus(uminus(v468), v469); + real2 v478 = ctimesminusplus(reverse(v470), ctbl[26], ctimes(v470, ctbl[27])); + real2 v1717 = plus(v179, v478); + real2 v1713 = minus(v478, v179); + real2 v1841 = minus(v1718, v1717); + real2 v1845 = plus(v1717, v1718); + real2 v674 = minusplus(v672, v673); + real2 v676 = minusplus(uminus(v672), v673); + real2 v249 = minusplus(uminus(v245), v246); + real2 v247 = minusplus(v245, v246); + real2 v255 = ctimesminusplus(reverse(v247), ctbl[20], ctimes(v247, ctbl[21])); + real2 v398 = minusplus(v396, v397); + real2 v400 = minusplus(uminus(v396), v397); + real2 v408 = ctimesminusplus(reverse(v398), ctbl[16], ctimes(v398, ctbl[17])); + real2 v572 = minusplus(v570, v571); + real2 v574 = minusplus(uminus(v570), v571); + real2 v625 = minusplus(uminus(v621), v622); + real2 v623 = minusplus(v621, v622); + real2 v631 = ctimesminusplus(reverse(v623), ctbl[38], ctimes(v623, ctbl[39])); + real2 v1728 = reverse(minus(v631, v353)); + real2 v1734 = plus(v353, v631); + real2 v1857 = minus(v1734, v1733); + real2 v1861 = plus(v1733, v1734); + real2 v580 = ctimesminusplus(reverse(v572), ctbl[2], ctimes(v572, ctbl[3])); + real2 v537 = minusplus(v535, v536); + real2 v539 = minusplus(uminus(v535), v536); + real2 v546 = ctimesminusplus(reverse(v537), ctbl[18], ctimes(v537, ctbl[19])); + real2 v682 = ctimesminusplus(reverse(v674), ctbl[14], ctimes(v674, ctbl[15])); + real2 v1776 = reverse(minus(v682, v408)); + real2 v1782 = plus(v408, v682); + real2 v641 = minusplus(uminus(v637), v638); + real2 v639 = minusplus(v637, v638); + real2 v287 = minusplus(uminus(v283), v284); + real2 v285 = minusplus(v283, v284); + real2 v295 = ctimesminusplus(reverse(v285), ctbl[4], ctimes(v285, ctbl[5])); + real2 v1680 = reverse(minus(v580, v295)); + real2 v1686 = plus(v295, v580); + real2 v505 = minusplus(uminus(v501), v502); + real2 v503 = minusplus(v501, v502); + real2 v513 = ctimesminusplus(reverse(v503), ctbl[10], ctimes(v503, ctbl[11])); + real2 v444 = ctimesminusplus(reverse(v434), ctbl[0], ctimes(v434, ctbl[1])); + real2 v648 = ctimesminusplus(reverse(v639), ctbl[6], ctimes(v639, ctbl[7])); + real2 v1685 = plus(v141, v444); + real2 v1681 = minus(v444, v141); + real2 v1888 = reverse(minus(v1862, v1861)); + real2 v1894 = plus(v1861, v1862); + real2 v1910 = plus(v1893, v1894); + real2 v1904 = reverse(minus(v1894, v1893)); + real2 v1813 = plus(v1685, v1686); + real2 v1809 = minus(v1686, v1685); + real2 v1777 = minus(v546, v255); + real2 v1781 = plus(v255, v546); + real2 v207 = minusplus(v205, v206); + real2 v209 = minusplus(uminus(v205), v206); + real2 v1840 = reverse(minus(v1782, v1781)); + real2 v1846 = plus(v1781, v1782); + real2 v1878 = plus(v1845, v1846); + real2 v1872 = reverse(minus(v1846, v1845)); + real2 v364 = minusplus(uminus(v360), v361); + real2 v362 = minusplus(v360, v361); + real2 v370 = ctimesminusplus(reverse(v362), ctbl[8], ctimes(v362, ctbl[9])); + real2 v1744 = reverse(minus(v648, v370)); + real2 v1750 = plus(v370, v648); + real2 v217 = ctimesminusplus(reverse(v207), ctbl[12], ctimes(v207, ctbl[13])); + real2 v1749 = plus(v217, v513); + real2 v1745 = minus(v513, v217); + real2 v1814 = plus(v1749, v1750); + real2 v1808 = reverse(minus(v1750, v1749)); + real2 v1877 = plus(v1813, v1814); + real2 v1873 = minus(v1814, v1813); + real2 v1905 = minus(v1878, v1877); + real2 v1909 = plus(v1877, v1878); + store(out, 33 << shift, minus(uplusminus(v1904), v1905)); + store(out, 97 << shift, minus(uminusplus(v1904), v1905)); + store(out, 65 << shift, minus(v1909, v1910)); + store(out, 1 << shift, plus(v1909, v1910)); + real2 v1890 = minusplus(v1888, v1889); + real2 v1892 = minusplus(uminus(v1888), v1889); + real2 v1902 = ctimesminusplus(reverse(v1892), ctbl[0], ctimes(v1892, ctbl[0])); + real2 v1886 = minus(uminusplus(v1872), v1873); + store(out, 49 << shift, plus(v1886, v1902)); + store(out, 113 << shift, minus(v1886, v1902)); + real2 v1882 = minus(uplusminus(v1872), v1873); + real2 v1898 = ctimesminusplus(reverse(v1890), ctbl[0], ctimes(v1890, ctbl[1])); + store(out, 81 << shift, minus(v1882, v1898)); + store(out, 17 << shift, plus(v1882, v1898)); + real2 v1858 = minusplus(v1856, v1857); + real2 v1860 = minusplus(uminus(v1856), v1857); + real2 v1870 = ctimesminusplus(reverse(v1860), ctbl[3], ctimes(v1860, ctbl[2])); + real2 v1948 = reverse(minus(v1870, v1838)); + real2 v1954 = plus(v1838, v1870); + real2 v1822 = minus(uminusplus(v1808), v1809); + real2 v1818 = minus(uplusminus(v1808), v1809); + real2 v1842 = minusplus(v1840, v1841); + real2 v1844 = minusplus(uminus(v1840), v1841); + real2 v1854 = ctimesminusplus(reverse(v1844), ctbl[0], ctimes(v1844, ctbl[0])); + real2 v1949 = minus(v1854, v1822); + store(out, 121 << shift, minus(uminusplus(v1948), v1949)); + store(out, 57 << shift, minus(uplusminus(v1948), v1949)); + real2 v1953 = plus(v1822, v1854); + store(out, 89 << shift, minus(v1953, v1954)); + store(out, 25 << shift, plus(v1953, v1954)); + real2 v1850 = ctimesminusplus(reverse(v1842), ctbl[0], ctimes(v1842, ctbl[1])); + real2 v1866 = ctimesminusplus(reverse(v1858), ctbl[2], ctimes(v1858, ctbl[3])); + real2 v1929 = reverse(minus(v1866, v1834)); + real2 v1935 = plus(v1834, v1866); + real2 v1930 = minus(v1850, v1818); + store(out, 105 << shift, minus(uminusplus(v1929), v1930)); + store(out, 41 << shift, minus(uplusminus(v1929), v1930)); + real2 v1934 = plus(v1818, v1850); + store(out, 73 << shift, minus(v1934, v1935)); + store(out, 9 << shift, plus(v1934, v1935)); + real2 v1690 = minus(uplusminus(v1680), v1681); + real2 v1694 = minus(uminusplus(v1680), v1681); + real2 v1716 = minusplus(uminus(v1712), v1713); + real2 v1714 = minusplus(v1712, v1713); + real2 v1730 = minusplus(v1728, v1729); + real2 v1732 = minusplus(uminus(v1728), v1729); + real2 v1742 = ctimesminusplus(reverse(v1732), ctbl[6], ctimes(v1732, ctbl[12])); + real2 v1726 = ctimesminusplus(reverse(v1716), ctbl[2], ctimes(v1716, ctbl[3])); + real2 v1780 = minusplus(uminus(v1776), v1777); + real2 v1778 = minusplus(v1776, v1777); + real2 v1790 = ctimesminusplus(reverse(v1780), ctbl[3], ctimes(v1780, ctbl[2])); + real2 v2030 = plus(v1726, v1790); + real2 v2024 = reverse(minus(v1790, v1726)); + real2 v1806 = ctimesminusplus(reverse(v1796), ctbl[9], ctimes(v1796, ctbl[8])); + real2 v1746 = minusplus(v1744, v1745); + real2 v1748 = minusplus(uminus(v1744), v1745); + real2 v2040 = reverse(minus(v1806, v1742)); + real2 v2046 = plus(v1742, v1806); + real2 v2062 = plus(v2045, v2046); + real2 v2056 = reverse(minus(v2046, v2045)); + real2 v1758 = ctimesminusplus(reverse(v1748), ctbl[0], ctimes(v1748, ctbl[0])); + real2 v2025 = minus(v1758, v1694); + real2 v2029 = plus(v1694, v1758); + real2 v2057 = minus(v2030, v2029); + store(out, 109 << shift, minus(uminusplus(v2056), v2057)); + store(out, 45 << shift, minus(uplusminus(v2056), v2057)); + real2 v2061 = plus(v2029, v2030); + store(out, 13 << shift, plus(v2061, v2062)); + store(out, 77 << shift, minus(v2061, v2062)); + real2 v2044 = minusplus(uminus(v2040), v2041); + real2 v2042 = minusplus(v2040, v2041); + real2 v2054 = ctimesminusplus(reverse(v2044), ctbl[0], ctimes(v2044, ctbl[0])); + real2 v2038 = minus(uminusplus(v2024), v2025); + real2 v2034 = minus(uplusminus(v2024), v2025); + store(out, 125 << shift, minus(v2038, v2054)); + store(out, 61 << shift, plus(v2038, v2054)); + real2 v2050 = ctimesminusplus(reverse(v2042), ctbl[0], ctimes(v2042, ctbl[1])); + store(out, 29 << shift, plus(v2034, v2050)); + store(out, 93 << shift, minus(v2034, v2050)); + real2 v1738 = ctimesminusplus(reverse(v1730), ctbl[8], ctimes(v1730, ctbl[9])); + real2 v1802 = ctimesminusplus(reverse(v1794), ctbl[6], ctimes(v1794, ctbl[7])); + real2 v1989 = plus(v1738, v1802); + real2 v1983 = reverse(minus(v1802, v1738)); + real2 v1999 = reverse(minus(v1989, v1988)); + real2 v2005 = plus(v1988, v1989); + real2 v1722 = ctimesminusplus(reverse(v1714), ctbl[4], ctimes(v1714, ctbl[5])); + real2 v1786 = ctimesminusplus(reverse(v1778), ctbl[2], ctimes(v1778, ctbl[3])); + real2 v1973 = plus(v1722, v1786); + real2 v1967 = reverse(minus(v1786, v1722)); + real2 v1754 = ctimesminusplus(reverse(v1746), ctbl[0], ctimes(v1746, ctbl[1])); + real2 v1972 = plus(v1690, v1754); + real2 v1968 = minus(v1754, v1690); + real2 v2004 = plus(v1972, v1973); + store(out, 5 << shift, plus(v2004, v2005)); + store(out, 69 << shift, minus(v2004, v2005)); + real2 v2000 = minus(v1973, v1972); + store(out, 37 << shift, minus(uplusminus(v1999), v2000)); + store(out, 101 << shift, minus(uminusplus(v1999), v2000)); + real2 v1985 = minusplus(v1983, v1984); + real2 v1987 = minusplus(uminus(v1983), v1984); + real2 v1993 = ctimesminusplus(reverse(v1985), ctbl[0], ctimes(v1985, ctbl[1])); + real2 v1977 = minus(uplusminus(v1967), v1968); + store(out, 21 << shift, plus(v1977, v1993)); + store(out, 85 << shift, minus(v1977, v1993)); + real2 v1981 = minus(uminusplus(v1967), v1968); + real2 v1997 = ctimesminusplus(reverse(v1987), ctbl[0], ctimes(v1987, ctbl[0])); + store(out, 117 << shift, minus(v1981, v1997)); + store(out, 53 << shift, plus(v1981, v1997)); + real2 v703 = ctimesminusplus(reverse(v692), ctbl[45], ctimes(v692, ctbl[44])); + real2 v261 = ctimesminusplus(reverse(v249), ctbl[26], ctimes(v249, ctbl[27])); + real2 v550 = ctimesminusplus(reverse(v539), ctbl[15], ctimes(v539, ctbl[14])); + real2 v413 = ctimesminusplus(reverse(v400), ctbl[18], ctimes(v400, ctbl[24])); + real2 v2178 = minus(v550, v261); + real2 v2182 = plus(v261, v550); + real2 v686 = ctimesminusplus(reverse(v676), ctbl[21], ctimes(v676, ctbl[20])); + real2 v2183 = plus(v413, v686); + real2 v2177 = reverse(minus(v686, v413)); + real2 v203 = ctimesminusplus(reverse(v191), ctbl[56], ctimes(v191, ctbl[57])); + real2 v281 = ctimesminusplus(reverse(v267), ctbl[50], ctimes(v267, ctbl[51])); + real2 v2247 = plus(v2182, v2183); + real2 v2241 = reverse(minus(v2183, v2182)); + real2 v619 = ctimesminusplus(reverse(v607), ctbl[27], ctimes(v607, ctbl[26])); + real2 v358 = ctimesminusplus(reverse(v345), ctbl[30], ctimes(v345, ctbl[60])); + real2 v499 = ctimesminusplus(reverse(v488), ctbl[36], ctimes(v488, ctbl[54])); + real2 v2130 = minus(v499, v203); + real2 v2134 = plus(v203, v499); + real2 v185 = ctimesminusplus(reverse(v171), ctbl[20], ctimes(v171, ctbl[21])); + real2 v339 = ctimesminusplus(reverse(v325), ctbl[14], ctimes(v325, ctbl[15])); + real2 v2119 = plus(v339, v619); + real2 v2113 = reverse(minus(v619, v339)); + real2 v482 = ctimesminusplus(reverse(v472), ctbl[24], ctimes(v472, ctbl[18])); + real2 v2114 = minus(v482, v185); + real2 v2118 = plus(v185, v482); + real2 v2246 = plus(v2118, v2119); + real2 v2242 = minus(v2119, v2118); + real2 v584 = ctimesminusplus(reverse(v574), ctbl[3], ctimes(v574, ctbl[2])); + real2 v652 = ctimesminusplus(reverse(v641), ctbl[9], ctimes(v641, ctbl[8])); + real2 v568 = ctimesminusplus(reverse(v556), ctbl[39], ctimes(v556, ctbl[38])); + real2 v2194 = minus(v568, v281); + real2 v2198 = plus(v281, v568); + real2 v517 = ctimesminusplus(reverse(v505), ctbl[12], ctimes(v505, ctbl[6])); + real2 v430 = ctimesminusplus(reverse(v419), ctbl[42], ctimes(v419, ctbl[48])); + real2 v2193 = reverse(minus(v703, v430)); + real2 v2199 = plus(v430, v703); + real2 v2273 = reverse(minus(v2247, v2246)); + real2 v2279 = plus(v2246, v2247); + real2 v375 = ctimesminusplus(reverse(v364), ctbl[6], ctimes(v364, ctbl[12])); + real2 v2145 = reverse(minus(v652, v375)); + real2 v2151 = plus(v375, v652); + real2 v2263 = plus(v2198, v2199); + real2 v2257 = reverse(minus(v2199, v2198)); + real2 v448 = ctimesminusplus(reverse(v436), ctbl[0], ctimes(v436, ctbl[0])); + real2 v635 = ctimesminusplus(reverse(v625), ctbl[33], ctimes(v625, ctbl[32])); + real2 v2129 = reverse(minus(v635, v358)); + real2 v2135 = plus(v358, v635); + real2 v2258 = minus(v2135, v2134); + real2 v2262 = plus(v2134, v2135); + real2 v2086 = plus(v145, v448); + real2 v2082 = minus(v448, v145); + real2 v301 = ctimesminusplus(reverse(v287), ctbl[2], ctimes(v287, ctbl[3])); + real2 v223 = ctimesminusplus(reverse(v209), ctbl[8], ctimes(v209, ctbl[9])); + real2 v2150 = plus(v223, v517); + real2 v2146 = minus(v517, v223); + real2 v2081 = reverse(minus(v584, v301)); + real2 v2087 = plus(v301, v584); + real2 v2210 = minus(v2087, v2086); + real2 v2214 = plus(v2086, v2087); + real2 v2215 = plus(v2150, v2151); + real2 v2209 = reverse(minus(v2151, v2150)); + real2 v2289 = reverse(minus(v2263, v2262)); + real2 v2295 = plus(v2262, v2263); + real2 v2311 = plus(v2294, v2295); + real2 v2305 = reverse(minus(v2295, v2294)); + real2 v2274 = minus(v2215, v2214); + real2 v2278 = plus(v2214, v2215); + real2 v2306 = minus(v2279, v2278); + real2 v2310 = plus(v2278, v2279); + store(out, 35 << shift, minus(uplusminus(v2305), v2306)); + store(out, 99 << shift, minus(uminusplus(v2305), v2306)); + store(out, 3 << shift, plus(v2310, v2311)); + store(out, 67 << shift, minus(v2310, v2311)); + real2 v2293 = minusplus(uminus(v2289), v2290); + real2 v2291 = minusplus(v2289, v2290); + real2 v2303 = ctimesminusplus(reverse(v2293), ctbl[0], ctimes(v2293, ctbl[0])); + real2 v2287 = minus(uminusplus(v2273), v2274); + store(out, 51 << shift, plus(v2287, v2303)); + store(out, 115 << shift, minus(v2287, v2303)); + real2 v2283 = minus(uplusminus(v2273), v2274); + real2 v2299 = ctimesminusplus(reverse(v2291), ctbl[0], ctimes(v2291, ctbl[1])); + store(out, 19 << shift, plus(v2283, v2299)); + store(out, 83 << shift, minus(v2283, v2299)); + real2 v2261 = minusplus(uminus(v2257), v2258); + real2 v2259 = minusplus(v2257, v2258); + real2 v2243 = minusplus(v2241, v2242); + real2 v2245 = minusplus(uminus(v2241), v2242); + real2 v2251 = ctimesminusplus(reverse(v2243), ctbl[0], ctimes(v2243, ctbl[1])); + real2 v2267 = ctimesminusplus(reverse(v2259), ctbl[2], ctimes(v2259, ctbl[3])); + real2 v2229 = minusplus(uminus(v2225), v2226); + real2 v2227 = minusplus(v2225, v2226); + real2 v2235 = ctimesminusplus(reverse(v2227), ctbl[4], ctimes(v2227, ctbl[5])); + real2 v2330 = reverse(minus(v2267, v2235)); + real2 v2336 = plus(v2235, v2267); + real2 v2219 = minus(uplusminus(v2209), v2210); + real2 v2223 = minus(uminusplus(v2209), v2210); + real2 v2335 = plus(v2219, v2251); + real2 v2331 = minus(v2251, v2219); + store(out, 43 << shift, minus(uplusminus(v2330), v2331)); + store(out, 107 << shift, minus(uminusplus(v2330), v2331)); + store(out, 75 << shift, minus(v2335, v2336)); + store(out, 11 << shift, plus(v2335, v2336)); + real2 v2239 = ctimesminusplus(reverse(v2229), ctbl[2], ctimes(v2229, ctbl[3])); + real2 v2271 = ctimesminusplus(reverse(v2261), ctbl[3], ctimes(v2261, ctbl[2])); + real2 v2349 = reverse(minus(v2271, v2239)); + real2 v2355 = plus(v2239, v2271); + real2 v2255 = ctimesminusplus(reverse(v2245), ctbl[0], ctimes(v2245, ctbl[0])); + real2 v2350 = minus(v2255, v2223); + store(out, 59 << shift, minus(uplusminus(v2349), v2350)); + store(out, 123 << shift, minus(uminusplus(v2349), v2350)); + real2 v2354 = plus(v2223, v2255); + store(out, 91 << shift, minus(v2354, v2355)); + store(out, 27 << shift, plus(v2354, v2355)); + real2 v2165 = minusplus(uminus(v2161), v2162); + real2 v2163 = minusplus(v2161, v2162); + real2 v2133 = minusplus(uminus(v2129), v2130); + real2 v2131 = minusplus(v2129, v2130); + real2 v2195 = minusplus(v2193, v2194); + real2 v2197 = minusplus(uminus(v2193), v2194); + real2 v2203 = ctimesminusplus(reverse(v2195), ctbl[6], ctimes(v2195, ctbl[7])); + real2 v2171 = ctimesminusplus(reverse(v2163), ctbl[10], ctimes(v2163, ctbl[11])); + real2 v2385 = minus(v2171, v2107); + real2 v2389 = plus(v2107, v2171); + real2 v2139 = ctimesminusplus(reverse(v2131), ctbl[8], ctimes(v2131, ctbl[9])); + real2 v2390 = plus(v2139, v2203); + real2 v2384 = reverse(minus(v2203, v2139)); + real2 v2406 = plus(v2389, v2390); + real2 v2400 = reverse(minus(v2390, v2389)); + real2 v2181 = minusplus(uminus(v2177), v2178); + real2 v2179 = minusplus(v2177, v2178); + real2 v2091 = minus(uplusminus(v2081), v2082); + real2 v2095 = minus(uminusplus(v2081), v2082); + real2 v2117 = minusplus(uminus(v2113), v2114); + real2 v2115 = minusplus(v2113, v2114); + real2 v2123 = ctimesminusplus(reverse(v2115), ctbl[4], ctimes(v2115, ctbl[5])); + real2 v2187 = ctimesminusplus(reverse(v2179), ctbl[2], ctimes(v2179, ctbl[3])); + real2 v2374 = plus(v2123, v2187); + real2 v2368 = reverse(minus(v2187, v2123)); + real2 v2149 = minusplus(uminus(v2145), v2146); + real2 v2147 = minusplus(v2145, v2146); + real2 v2155 = ctimesminusplus(reverse(v2147), ctbl[0], ctimes(v2147, ctbl[1])); + real2 v2373 = plus(v2091, v2155); + real2 v2369 = minus(v2155, v2091); + real2 v2401 = minus(v2374, v2373); + real2 v2405 = plus(v2373, v2374); + store(out, 71 << shift, minus(v2405, v2406)); + store(out, 7 << shift, plus(v2405, v2406)); + store(out, 103 << shift, minus(uminusplus(v2400), v2401)); + store(out, 39 << shift, minus(uplusminus(v2400), v2401)); + real2 v2388 = minusplus(uminus(v2384), v2385); + real2 v2386 = minusplus(v2384, v2385); + real2 v2398 = ctimesminusplus(reverse(v2388), ctbl[0], ctimes(v2388, ctbl[0])); + real2 v2378 = minus(uplusminus(v2368), v2369); + real2 v2382 = minus(uminusplus(v2368), v2369); + store(out, 55 << shift, plus(v2382, v2398)); + store(out, 119 << shift, minus(v2382, v2398)); + real2 v2394 = ctimesminusplus(reverse(v2386), ctbl[0], ctimes(v2386, ctbl[1])); + store(out, 23 << shift, plus(v2378, v2394)); + store(out, 87 << shift, minus(v2378, v2394)); + real2 v2207 = ctimesminusplus(reverse(v2197), ctbl[9], ctimes(v2197, ctbl[8])); + real2 v2111 = ctimesminusplus(reverse(v2101), ctbl[8], ctimes(v2101, ctbl[9])); + real2 v2175 = ctimesminusplus(reverse(v2165), ctbl[12], ctimes(v2165, ctbl[6])); + real2 v2446 = plus(v2111, v2175); + real2 v2442 = minus(v2175, v2111); + real2 v2143 = ctimesminusplus(reverse(v2133), ctbl[6], ctimes(v2133, ctbl[12])); + real2 v2441 = reverse(minus(v2207, v2143)); + real2 v2447 = plus(v2143, v2207); + real2 v2443 = minusplus(v2441, v2442); + real2 v2445 = minusplus(uminus(v2441), v2442); + real2 v2159 = ctimesminusplus(reverse(v2149), ctbl[0], ctimes(v2149, ctbl[0])); + real2 v2455 = ctimesminusplus(reverse(v2445), ctbl[0], ctimes(v2445, ctbl[0])); + real2 v2127 = ctimesminusplus(reverse(v2117), ctbl[2], ctimes(v2117, ctbl[3])); + real2 v2191 = ctimesminusplus(reverse(v2181), ctbl[3], ctimes(v2181, ctbl[2])); + real2 v2431 = plus(v2127, v2191); + real2 v2425 = reverse(minus(v2191, v2127)); + real2 v2426 = minus(v2159, v2095); + real2 v2430 = plus(v2095, v2159); + real2 v2439 = minus(uminusplus(v2425), v2426); + store(out, 127 << shift, minus(v2439, v2455)); + store(out, 63 << shift, plus(v2439, v2455)); + real2 v2435 = minus(uplusminus(v2425), v2426); + real2 v2451 = ctimesminusplus(reverse(v2443), ctbl[0], ctimes(v2443, ctbl[1])); + store(out, 95 << shift, minus(v2435, v2451)); + store(out, 31 << shift, plus(v2435, v2451)); + real2 v2463 = plus(v2446, v2447); + real2 v2457 = reverse(minus(v2447, v2446)); + real2 v2458 = minus(v2431, v2430); + store(out, 47 << shift, minus(uplusminus(v2457), v2458)); + store(out, 111 << shift, minus(uminusplus(v2457), v2458)); + real2 v2462 = plus(v2430, v2431); + store(out, 79 << shift, minus(v2462, v2463)); + store(out, 15 << shift, plus(v2462, v2463)); +// Pres : 68088 + } +} + +ALIGNED(8192) void but128f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + +// Pres : 148586 + real2 v56 = load(in, 54 << inShift); + real2 v120 = load(in, 118 << inShift); + real2 v571 = reverse(minus(v56, v120)); + real2 v577 = plus(v56, v120); + real2 v24 = load(in, 22 << inShift); + real2 v88 = load(in, 86 << inShift); + real2 v576 = plus(v24, v88); + real2 v572 = minus(v88, v24); + real2 v573 = minusplus(v571, v572); + real2 v575 = minusplus(uminus(v571), v572); + real2 v589 = ctimesminusplus(reverse(v575), tbl[92 + tbloffset], ctimes(v575, tbl[93 + tbloffset])); + real2 v583 = ctimesminusplus(reverse(v573), tbl[90 + tbloffset], ctimes(v573, tbl[91 + tbloffset])); + real2 v897 = plus(v576, v577); + real2 v891 = reverse(minus(v576, v577)); + real2 v8 = load(in, 6 << inShift); + real2 v72 = load(in, 70 << inShift); + real2 v252 = minus(v72, v8); + real2 v256 = plus(v8, v72); + real2 v104 = load(in, 102 << inShift); + real2 v40 = load(in, 38 << inShift); + real2 v251 = reverse(minus(v40, v104)); + real2 v257 = plus(v40, v104); + real2 v255 = minusplus(uminus(v251), v252); + real2 v253 = minusplus(v251, v252); + real2 v263 = ctimesminusplus(reverse(v253), tbl[26 + tbloffset], ctimes(v253, tbl[27 + tbloffset])); + real2 v896 = plus(v256, v257); + real2 v892 = minus(v257, v256); + real2 v895 = minusplus(uminus(v891), v892); + real2 v893 = minusplus(v891, v892); + real2 v909 = ctimesminusplus(reverse(v895), tbl[156 + tbloffset], ctimes(v895, tbl[157 + tbloffset])); + real2 v903 = ctimesminusplus(reverse(v893), tbl[154 + tbloffset], ctimes(v893, tbl[155 + tbloffset])); + real2 v269 = ctimesminusplus(reverse(v255), tbl[28 + tbloffset], ctimes(v255, tbl[29 + tbloffset])); + real2 v1216 = plus(v896, v897); + real2 v1212 = minus(v897, v896); + real2 v2160 = minus(v583, v263); + real2 v2164 = plus(v263, v583); + real2 v2686 = minus(v589, v269); + real2 v2690 = plus(v269, v589); + real2 v96 = load(in, 94 << inShift); + real2 v32 = load(in, 30 << inShift); + real2 v736 = plus(v32, v96); + real2 v732 = minus(v96, v32); + real2 v64 = load(in, 62 << inShift); + real2 v128 = load(in, 126 << inShift); + real2 v737 = plus(v64, v128); + real2 v731 = reverse(minus(v64, v128)); + real2 v1057 = plus(v736, v737); + real2 v1051 = reverse(minus(v736, v737)); + real2 v733 = minusplus(v731, v732); + real2 v735 = minusplus(uminus(v731), v732); + real2 v749 = ctimesminusplus(reverse(v735), tbl[124 + tbloffset], ctimes(v735, tbl[125 + tbloffset])); + real2 v743 = ctimesminusplus(reverse(v733), tbl[122 + tbloffset], ctimes(v733, tbl[123 + tbloffset])); + real2 v16 = load(in, 14 << inShift); + real2 v80 = load(in, 78 << inShift); + real2 v412 = minus(v80, v16); + real2 v416 = plus(v16, v80); + real2 v112 = load(in, 110 << inShift); + real2 v48 = load(in, 46 << inShift); + real2 v417 = plus(v48, v112); + real2 v411 = reverse(minus(v48, v112)); + real2 v1056 = plus(v416, v417); + real2 v1052 = minus(v417, v416); + real2 v1055 = minusplus(uminus(v1051), v1052); + real2 v1053 = minusplus(v1051, v1052); + real2 v1063 = ctimesminusplus(reverse(v1053), tbl[186 + tbloffset], ctimes(v1053, tbl[187 + tbloffset])); + real2 v1665 = plus(v903, v1063); + real2 v1659 = reverse(minus(v903, v1063)); + real2 v1069 = ctimesminusplus(reverse(v1055), tbl[188 + tbloffset], ctimes(v1055, tbl[189 + tbloffset])); + real2 v1869 = reverse(minus(v909, v1069)); + real2 v1875 = plus(v909, v1069); + real2 v413 = minusplus(v411, v412); + real2 v415 = minusplus(uminus(v411), v412); + real2 v429 = ctimesminusplus(reverse(v415), tbl[60 + tbloffset], ctimes(v415, tbl[61 + tbloffset])); + real2 v1217 = plus(v1056, v1057); + real2 v1211 = reverse(minus(v1056, v1057)); + real2 v1297 = plus(v1216, v1217); + real2 v1291 = reverse(minus(v1216, v1217)); + real2 v2691 = plus(v429, v749); + real2 v2685 = reverse(minus(v429, v749)); + real2 v2765 = reverse(minus(v2690, v2691)); + real2 v2771 = plus(v2690, v2691); + real2 v2689 = minusplus(uminus(v2685), v2686); + real2 v2687 = minusplus(v2685, v2686); + real2 v2703 = ctimesminusplus(reverse(v2689), tbl[476 + tbloffset], ctimes(v2689, tbl[477 + tbloffset])); + real2 v2697 = ctimesminusplus(reverse(v2687), tbl[474 + tbloffset], ctimes(v2687, tbl[475 + tbloffset])); + real2 v1215 = minusplus(uminus(v1211), v1212); + real2 v1213 = minusplus(v1211, v1212); + real2 v1223 = ctimesminusplus(reverse(v1213), tbl[218 + tbloffset], ctimes(v1213, tbl[219 + tbloffset])); + real2 v1229 = ctimesminusplus(reverse(v1215), tbl[220 + tbloffset], ctimes(v1215, tbl[221 + tbloffset])); + real2 v423 = ctimesminusplus(reverse(v413), tbl[58 + tbloffset], ctimes(v413, tbl[59 + tbloffset])); + real2 v2165 = plus(v423, v743); + real2 v2159 = reverse(minus(v423, v743)); + real2 v2245 = plus(v2164, v2165); + real2 v2239 = reverse(minus(v2164, v2165)); + real2 v44 = load(in, 42 << inShift); + real2 v108 = load(in, 106 << inShift); + real2 v331 = reverse(minus(v44, v108)); + real2 v337 = plus(v44, v108); + real2 v76 = load(in, 74 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v336 = plus(v12, v76); + real2 v332 = minus(v76, v12); + real2 v976 = plus(v336, v337); + real2 v972 = minus(v337, v336); + real2 v335 = minusplus(uminus(v331), v332); + real2 v333 = minusplus(v331, v332); + real2 v343 = ctimesminusplus(reverse(v333), tbl[42 + tbloffset], ctimes(v333, tbl[43 + tbloffset])); + real2 v349 = ctimesminusplus(reverse(v335), tbl[44 + tbloffset], ctimes(v335, tbl[45 + tbloffset])); + real2 v124 = load(in, 122 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v651 = reverse(minus(v60, v124)); + real2 v657 = plus(v60, v124); + real2 v28 = load(in, 26 << inShift); + real2 v92 = load(in, 90 << inShift); + real2 v652 = minus(v92, v28); + real2 v656 = plus(v28, v92); + real2 v977 = plus(v656, v657); + real2 v971 = reverse(minus(v656, v657)); + real2 v973 = minusplus(v971, v972); + real2 v975 = minusplus(uminus(v971), v972); + real2 v983 = ctimesminusplus(reverse(v973), tbl[170 + tbloffset], ctimes(v973, tbl[171 + tbloffset])); + real2 v1131 = reverse(minus(v976, v977)); + real2 v1137 = plus(v976, v977); + real2 v655 = minusplus(uminus(v651), v652); + real2 v653 = minusplus(v651, v652); + real2 v669 = ctimesminusplus(reverse(v655), tbl[108 + tbloffset], ctimes(v655, tbl[109 + tbloffset])); + real2 v663 = ctimesminusplus(reverse(v653), tbl[106 + tbloffset], ctimes(v653, tbl[107 + tbloffset])); + real2 v2079 = reverse(minus(v343, v663)); + real2 v2085 = plus(v343, v663); + real2 v2605 = reverse(minus(v349, v669)); + real2 v2611 = plus(v349, v669); + real2 v989 = ctimesminusplus(reverse(v975), tbl[172 + tbloffset], ctimes(v975, tbl[173 + tbloffset])); + real2 v20 = load(in, 18 << inShift); + real2 v84 = load(in, 82 << inShift); + real2 v496 = plus(v20, v84); + real2 v492 = minus(v84, v20); + real2 v52 = load(in, 50 << inShift); + real2 v116 = load(in, 114 << inShift); + real2 v491 = reverse(minus(v52, v116)); + real2 v497 = plus(v52, v116); + real2 v817 = plus(v496, v497); + real2 v811 = reverse(minus(v496, v497)); + real2 v493 = minusplus(v491, v492); + real2 v495 = minusplus(uminus(v491), v492); + real2 v509 = ctimesminusplus(reverse(v495), tbl[76 + tbloffset], ctimes(v495, tbl[77 + tbloffset])); + real2 v503 = ctimesminusplus(reverse(v493), tbl[74 + tbloffset], ctimes(v493, tbl[75 + tbloffset])); + real2 v36 = load(in, 34 << inShift); + real2 v100 = load(in, 98 << inShift); + real2 v171 = reverse(minus(v36, v100)); + real2 v177 = plus(v36, v100); + real2 v68 = load(in, 66 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v176 = plus(v4, v68); + real2 v172 = minus(v68, v4); + real2 v816 = plus(v176, v177); + real2 v812 = minus(v177, v176); + real2 v1136 = plus(v816, v817); + real2 v1132 = minus(v817, v816); + real2 v1133 = minusplus(v1131, v1132); + real2 v1135 = minusplus(uminus(v1131), v1132); + real2 v1149 = ctimesminusplus(reverse(v1135), tbl[204 + tbloffset], ctimes(v1135, tbl[205 + tbloffset])); + real2 v1296 = plus(v1136, v1137); + real2 v1292 = minus(v1137, v1136); + real2 v1295 = minusplus(uminus(v1291), v1292); + real2 v1293 = minusplus(v1291, v1292); + real2 v1303 = ctimesminusplus(reverse(v1293), tbl[234 + tbloffset], ctimes(v1293, tbl[235 + tbloffset])); + real2 v1331 = reverse(minus(v1296, v1297)); + real2 v1337 = plus(v1296, v1297); + real2 v173 = minusplus(v171, v172); + real2 v175 = minusplus(uminus(v171), v172); + real2 v189 = ctimesminusplus(reverse(v175), tbl[12 + tbloffset], ctimes(v175, tbl[13 + tbloffset])); + real2 v1309 = ctimesminusplus(reverse(v1295), tbl[236 + tbloffset], ctimes(v1295, tbl[237 + tbloffset])); + real2 v815 = minusplus(uminus(v811), v812); + real2 v813 = minusplus(v811, v812); + real2 v1143 = ctimesminusplus(reverse(v1133), tbl[202 + tbloffset], ctimes(v1133, tbl[203 + tbloffset])); + real2 v1541 = reverse(minus(v1149, v1229)); + real2 v1547 = plus(v1149, v1229); + real2 v2610 = plus(v189, v509); + real2 v2606 = minus(v509, v189); + real2 v2770 = plus(v2610, v2611); + real2 v2766 = minus(v2611, v2610); + real2 v823 = ctimesminusplus(reverse(v813), tbl[138 + tbloffset], ctimes(v813, tbl[139 + tbloffset])); + real2 v829 = ctimesminusplus(reverse(v815), tbl[140 + tbloffset], ctimes(v815, tbl[141 + tbloffset])); + real2 v2811 = plus(v2770, v2771); + real2 v2805 = reverse(minus(v2770, v2771)); + real2 v2767 = minusplus(v2765, v2766); + real2 v2769 = minusplus(uminus(v2765), v2766); + real2 v2607 = minusplus(v2605, v2606); + real2 v2609 = minusplus(uminus(v2605), v2606); + real2 v2617 = ctimesminusplus(reverse(v2607), tbl[458 + tbloffset], ctimes(v2607, tbl[459 + tbloffset])); + real2 v2623 = ctimesminusplus(reverse(v2609), tbl[460 + tbloffset], ctimes(v2609, tbl[461 + tbloffset])); + real2 v3013 = reverse(minus(v2623, v2703)); + real2 v3019 = plus(v2623, v2703); + real2 v2783 = ctimesminusplus(reverse(v2769), tbl[492 + tbloffset], ctimes(v2769, tbl[493 + tbloffset])); + real2 v2941 = plus(v2617, v2697); + real2 v2935 = reverse(minus(v2617, v2697)); + real2 v2777 = ctimesminusplus(reverse(v2767), tbl[490 + tbloffset], ctimes(v2767, tbl[491 + tbloffset])); + real2 v1660 = minus(v983, v823); + real2 v1664 = plus(v823, v983); + real2 v1874 = plus(v829, v989); + real2 v1870 = minus(v989, v829); + real2 v1909 = reverse(minus(v1874, v1875)); + real2 v1915 = plus(v1874, v1875); + real2 v1663 = minusplus(uminus(v1659), v1660); + real2 v1661 = minusplus(v1659, v1660); + real2 v1677 = ctimesminusplus(reverse(v1663), tbl[296 + tbloffset], ctimes(v1663, tbl[297 + tbloffset])); + real2 v1873 = minusplus(uminus(v1869), v1870); + real2 v1871 = minusplus(v1869, v1870); + real2 v1887 = ctimesminusplus(reverse(v1873), tbl[332 + tbloffset], ctimes(v1873, tbl[333 + tbloffset])); + real2 v1705 = plus(v1664, v1665); + real2 v1699 = reverse(minus(v1664, v1665)); + real2 v1671 = ctimesminusplus(reverse(v1661), tbl[294 + tbloffset], ctimes(v1661, tbl[295 + tbloffset])); + real2 v1881 = ctimesminusplus(reverse(v1871), tbl[330 + tbloffset], ctimes(v1871, tbl[331 + tbloffset])); + real2 v1469 = plus(v1143, v1223); + real2 v1463 = reverse(minus(v1143, v1223)); + real2 v54 = load(in, 52 << inShift); + real2 v118 = load(in, 116 << inShift); + real2 v537 = plus(v54, v118); + real2 v531 = reverse(minus(v54, v118)); + real2 v86 = load(in, 84 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v536 = plus(v22, v86); + real2 v532 = minus(v86, v22); + real2 v851 = reverse(minus(v536, v537)); + real2 v857 = plus(v536, v537); + real2 v533 = minusplus(v531, v532); + real2 v535 = minusplus(uminus(v531), v532); + real2 v549 = ctimesminusplus(reverse(v535), tbl[84 + tbloffset], ctimes(v535, tbl[85 + tbloffset])); + real2 v102 = load(in, 100 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v217 = plus(v38, v102); + real2 v211 = reverse(minus(v38, v102)); + real2 v70 = load(in, 68 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v216 = plus(v6, v70); + real2 v212 = minus(v70, v6); + real2 v213 = minusplus(v211, v212); + real2 v215 = minusplus(uminus(v211), v212); + real2 v229 = ctimesminusplus(reverse(v215), tbl[20 + tbloffset], ctimes(v215, tbl[21 + tbloffset])); + real2 v2646 = minus(v549, v229); + real2 v2650 = plus(v229, v549); + real2 v856 = plus(v216, v217); + real2 v852 = minus(v217, v216); + real2 v853 = minusplus(v851, v852); + real2 v855 = minusplus(uminus(v851), v852); + real2 v863 = ctimesminusplus(reverse(v853), tbl[146 + tbloffset], ctimes(v853, tbl[147 + tbloffset])); + real2 v869 = ctimesminusplus(reverse(v855), tbl[148 + tbloffset], ctimes(v855, tbl[149 + tbloffset])); + real2 v1176 = plus(v856, v857); + real2 v1172 = minus(v857, v856); + real2 v110 = load(in, 108 << inShift); + real2 v46 = load(in, 44 << inShift); + real2 v377 = plus(v46, v110); + real2 v371 = reverse(minus(v46, v110)); + real2 v78 = load(in, 76 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v372 = minus(v78, v14); + real2 v376 = plus(v14, v78); + real2 v1012 = minus(v377, v376); + real2 v1016 = plus(v376, v377); + real2 v373 = minusplus(v371, v372); + real2 v375 = minusplus(uminus(v371), v372); + real2 v389 = ctimesminusplus(reverse(v375), tbl[52 + tbloffset], ctimes(v375, tbl[53 + tbloffset])); + real2 v30 = load(in, 28 << inShift); + real2 v94 = load(in, 92 << inShift); + real2 v696 = plus(v30, v94); + real2 v692 = minus(v94, v30); + real2 v62 = load(in, 60 << inShift); + real2 v126 = load(in, 124 << inShift); + real2 v697 = plus(v62, v126); + real2 v691 = reverse(minus(v62, v126)); + real2 v1017 = plus(v696, v697); + real2 v1011 = reverse(minus(v696, v697)); + real2 v1171 = reverse(minus(v1016, v1017)); + real2 v1177 = plus(v1016, v1017); + real2 v1013 = minusplus(v1011, v1012); + real2 v1015 = minusplus(uminus(v1011), v1012); + real2 v1175 = minusplus(uminus(v1171), v1172); + real2 v1173 = minusplus(v1171, v1172); + real2 v1183 = ctimesminusplus(reverse(v1173), tbl[210 + tbloffset], ctimes(v1173, tbl[211 + tbloffset])); + real2 v1189 = ctimesminusplus(reverse(v1175), tbl[212 + tbloffset], ctimes(v1175, tbl[213 + tbloffset])); + real2 v1029 = ctimesminusplus(reverse(v1015), tbl[180 + tbloffset], ctimes(v1015, tbl[181 + tbloffset])); + real2 v1023 = ctimesminusplus(reverse(v1013), tbl[178 + tbloffset], ctimes(v1013, tbl[179 + tbloffset])); + real2 v1625 = plus(v863, v1023); + real2 v1619 = reverse(minus(v863, v1023)); + real2 v1835 = plus(v869, v1029); + real2 v1829 = reverse(minus(v869, v1029)); + real2 v693 = minusplus(v691, v692); + real2 v695 = minusplus(uminus(v691), v692); + real2 v709 = ctimesminusplus(reverse(v695), tbl[116 + tbloffset], ctimes(v695, tbl[117 + tbloffset])); + real2 v2645 = reverse(minus(v389, v709)); + real2 v2651 = plus(v389, v709); + real2 v1257 = plus(v1176, v1177); + real2 v1251 = reverse(minus(v1176, v1177)); + real2 v2731 = plus(v2650, v2651); + real2 v2725 = reverse(minus(v2650, v2651)); + real2 v114 = load(in, 112 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v457 = plus(v50, v114); + real2 v451 = reverse(minus(v50, v114)); + real2 v18 = load(in, 16 << inShift); + real2 v82 = load(in, 80 << inShift); + real2 v456 = plus(v18, v82); + real2 v452 = minus(v82, v18); + real2 v771 = reverse(minus(v456, v457)); + real2 v777 = plus(v456, v457); + real2 v453 = minusplus(v451, v452); + real2 v455 = minusplus(uminus(v451), v452); + real2 v469 = ctimesminusplus(reverse(v455), tbl[68 + tbloffset], ctimes(v455, tbl[69 + tbloffset])); + real2 v66 = load(in, 64 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v131 = reverse(minus(v34, v98)); + real2 v137 = plus(v34, v98); + real2 v133 = minusplus(v131, v132); + real2 v135 = minusplus(uminus(v131), v132); + real2 v149 = ctimesminusplus(reverse(v135), tbl[4 + tbloffset], ctimes(v135, tbl[5 + tbloffset])); + real2 v2566 = minus(v469, v149); + real2 v2570 = plus(v149, v469); + real2 v772 = minus(v137, v136); + real2 v776 = plus(v136, v137); + real2 v1092 = minus(v777, v776); + real2 v1096 = plus(v776, v777); + real2 v773 = minusplus(v771, v772); + real2 v775 = minusplus(uminus(v771), v772); + real2 v783 = ctimesminusplus(reverse(v773), tbl[130 + tbloffset], ctimes(v773, tbl[131 + tbloffset])); + real2 v789 = ctimesminusplus(reverse(v775), tbl[132 + tbloffset], ctimes(v775, tbl[133 + tbloffset])); + real2 v74 = load(in, 72 << inShift); + real2 v10 = load(in, 8 << inShift); + real2 v296 = plus(v10, v74); + real2 v292 = minus(v74, v10); + real2 v42 = load(in, 40 << inShift); + real2 v106 = load(in, 104 << inShift); + real2 v291 = reverse(minus(v42, v106)); + real2 v297 = plus(v42, v106); + real2 v293 = minusplus(v291, v292); + real2 v295 = minusplus(uminus(v291), v292); + real2 v309 = ctimesminusplus(reverse(v295), tbl[36 + tbloffset], ctimes(v295, tbl[37 + tbloffset])); + real2 v932 = minus(v297, v296); + real2 v936 = plus(v296, v297); + real2 v122 = load(in, 120 << inShift); + real2 v58 = load(in, 56 << inShift); + real2 v617 = plus(v58, v122); + real2 v611 = reverse(minus(v58, v122)); + real2 v26 = load(in, 24 << inShift); + real2 v90 = load(in, 88 << inShift); + real2 v612 = minus(v90, v26); + real2 v616 = plus(v26, v90); + real2 v937 = plus(v616, v617); + real2 v931 = reverse(minus(v616, v617)); + real2 v1091 = reverse(minus(v936, v937)); + real2 v1097 = plus(v936, v937); + real2 v933 = minusplus(v931, v932); + real2 v935 = minusplus(uminus(v931), v932); + real2 v1093 = minusplus(v1091, v1092); + real2 v1095 = minusplus(uminus(v1091), v1092); + real2 v1103 = ctimesminusplus(reverse(v1093), tbl[194 + tbloffset], ctimes(v1093, tbl[195 + tbloffset])); + real2 v1468 = plus(v1103, v1183); + real2 v1464 = minus(v1183, v1103); + real2 v1508 = plus(v1468, v1469); + real2 v1504 = minus(v1469, v1468); + real2 v1252 = minus(v1097, v1096); + real2 v1256 = plus(v1096, v1097); + real2 v1336 = plus(v1256, v1257); + real2 v1332 = minus(v1257, v1256); + real2 v1335 = minusplus(uminus(v1331), v1332); + real2 v1333 = minusplus(v1331, v1332); + real2 v1343 = ctimesminusplus(reverse(v1333), tbl[242 + tbloffset], ctimes(v1333, tbl[243 + tbloffset])); + real2 v1349 = ctimesminusplus(reverse(v1335), tbl[244 + tbloffset], ctimes(v1335, tbl[245 + tbloffset])); + real2 v1376 = plus(v1336, v1337); + real2 v1372 = minus(v1337, v1336); + real2 v1465 = minusplus(v1463, v1464); + real2 v1467 = minusplus(uminus(v1463), v1464); + real2 v1255 = minusplus(uminus(v1251), v1252); + real2 v1253 = minusplus(v1251, v1252); + real2 v1481 = ctimesminusplus(reverse(v1467), tbl[264 + tbloffset], ctimes(v1467, tbl[265 + tbloffset])); + real2 v1475 = ctimesminusplus(reverse(v1465), tbl[262 + tbloffset], ctimes(v1465, tbl[263 + tbloffset])); + real2 v1109 = ctimesminusplus(reverse(v1095), tbl[196 + tbloffset], ctimes(v1095, tbl[197 + tbloffset])); + real2 v1542 = minus(v1189, v1109); + real2 v1546 = plus(v1109, v1189); + real2 v1545 = minusplus(uminus(v1541), v1542); + real2 v1543 = minusplus(v1541, v1542); + real2 v1553 = ctimesminusplus(reverse(v1543), tbl[274 + tbloffset], ctimes(v1543, tbl[275 + tbloffset])); + real2 v1559 = ctimesminusplus(reverse(v1545), tbl[276 + tbloffset], ctimes(v1545, tbl[277 + tbloffset])); + real2 v1582 = minus(v1547, v1546); + real2 v1586 = plus(v1546, v1547); + real2 v1269 = ctimesminusplus(reverse(v1255), tbl[228 + tbloffset], ctimes(v1255, tbl[229 + tbloffset])); + real2 v1438 = minus(v1309, v1269); + real2 v1442 = plus(v1269, v1309); + real2 v1263 = ctimesminusplus(reverse(v1253), tbl[226 + tbloffset], ctimes(v1253, tbl[227 + tbloffset])); + real2 v943 = ctimesminusplus(reverse(v933), tbl[162 + tbloffset], ctimes(v933, tbl[163 + tbloffset])); + real2 v1624 = plus(v783, v943); + real2 v1620 = minus(v943, v783); + real2 v1623 = minusplus(uminus(v1619), v1620); + real2 v1621 = minusplus(v1619, v1620); + real2 v1700 = minus(v1625, v1624); + real2 v1704 = plus(v1624, v1625); + real2 v1631 = ctimesminusplus(reverse(v1621), tbl[286 + tbloffset], ctimes(v1621, tbl[287 + tbloffset])); + real2 v949 = ctimesminusplus(reverse(v935), tbl[164 + tbloffset], ctimes(v935, tbl[165 + tbloffset])); + real2 v1830 = minus(v949, v789); + real2 v1834 = plus(v789, v949); + real2 v1782 = plus(v1631, v1671); + real2 v1778 = minus(v1671, v1631); + real2 v1910 = minus(v1835, v1834); + real2 v1914 = plus(v1834, v1835); + real2 v1950 = minus(v1915, v1914); + real2 v1954 = plus(v1914, v1915); + real2 v1913 = minusplus(uminus(v1909), v1910); + real2 v1911 = minusplus(v1909, v1910); + real2 v613 = minusplus(v611, v612); + real2 v615 = minusplus(uminus(v611), v612); + real2 v629 = ctimesminusplus(reverse(v615), tbl[100 + tbloffset], ctimes(v615, tbl[101 + tbloffset])); + real2 v1744 = plus(v1704, v1705); + real2 v1740 = minus(v1705, v1704); + real2 v1637 = ctimesminusplus(reverse(v1623), tbl[288 + tbloffset], ctimes(v1623, tbl[289 + tbloffset])); + real2 v1927 = ctimesminusplus(reverse(v1913), tbl[340 + tbloffset], ctimes(v1913, tbl[341 + tbloffset])); + real2 v2571 = plus(v309, v629); + real2 v2565 = reverse(minus(v309, v629)); + real2 v1833 = minusplus(uminus(v1829), v1830); + real2 v1831 = minusplus(v1829, v1830); + real2 v1921 = ctimesminusplus(reverse(v1911), tbl[338 + tbloffset], ctimes(v1911, tbl[339 + tbloffset])); + real2 v1804 = minus(v1677, v1637); + real2 v1808 = plus(v1637, v1677); + real2 v1847 = ctimesminusplus(reverse(v1833), tbl[324 + tbloffset], ctimes(v1833, tbl[325 + tbloffset])); + real2 v2014 = minus(v1887, v1847); + real2 v2018 = plus(v1847, v1887); + real2 v1841 = ctimesminusplus(reverse(v1831), tbl[322 + tbloffset], ctimes(v1831, tbl[323 + tbloffset])); + real2 v1988 = minus(v1881, v1841); + real2 v1992 = plus(v1841, v1881); + real2 v1703 = minusplus(uminus(v1699), v1700); + real2 v1701 = minusplus(v1699, v1700); + real2 v1717 = ctimesminusplus(reverse(v1703), tbl[304 + tbloffset], ctimes(v1703, tbl[305 + tbloffset])); + real2 v1711 = ctimesminusplus(reverse(v1701), tbl[302 + tbloffset], ctimes(v1701, tbl[303 + tbloffset])); + real2 v2730 = plus(v2570, v2571); + real2 v2726 = minus(v2571, v2570); + real2 v1412 = minus(v1303, v1263); + real2 v1416 = plus(v1263, v1303); + real2 v63 = load(in, 61 << inShift); + real2 v127 = load(in, 125 << inShift); + real2 v717 = plus(v63, v127); + real2 v711 = reverse(minus(v63, v127)); + real2 v95 = load(in, 93 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v712 = minus(v95, v31); + real2 v716 = plus(v31, v95); + real2 v1037 = plus(v716, v717); + real2 v1031 = reverse(minus(v716, v717)); + real2 v79 = load(in, 77 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v396 = plus(v15, v79); + real2 v392 = minus(v79, v15); + real2 v111 = load(in, 109 << inShift); + real2 v47 = load(in, 45 << inShift); + real2 v397 = plus(v47, v111); + real2 v391 = reverse(minus(v47, v111)); + real2 v1032 = minus(v397, v396); + real2 v1036 = plus(v396, v397); + real2 v1033 = minusplus(v1031, v1032); + real2 v1035 = minusplus(uminus(v1031), v1032); + real2 v1049 = ctimesminusplus(reverse(v1035), tbl[184 + tbloffset], ctimes(v1035, tbl[185 + tbloffset])); + real2 v1043 = ctimesminusplus(reverse(v1033), tbl[182 + tbloffset], ctimes(v1033, tbl[183 + tbloffset])); + real2 v1197 = plus(v1036, v1037); + real2 v1191 = reverse(minus(v1036, v1037)); + real2 v23 = load(in, 21 << inShift); + real2 v87 = load(in, 85 << inShift); + real2 v556 = plus(v23, v87); + real2 v552 = minus(v87, v23); + real2 v119 = load(in, 117 << inShift); + real2 v55 = load(in, 53 << inShift); + real2 v557 = plus(v55, v119); + real2 v551 = reverse(minus(v55, v119)); + real2 v877 = plus(v556, v557); + real2 v871 = reverse(minus(v556, v557)); + real2 v7 = load(in, 5 << inShift); + real2 v71 = load(in, 69 << inShift); + real2 v232 = minus(v71, v7); + real2 v236 = plus(v7, v71); + real2 v103 = load(in, 101 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v237 = plus(v39, v103); + real2 v231 = reverse(minus(v39, v103)); + real2 v876 = plus(v236, v237); + real2 v872 = minus(v237, v236); + real2 v1192 = minus(v877, v876); + real2 v1196 = plus(v876, v877); + real2 v1271 = reverse(minus(v1196, v1197)); + real2 v1277 = plus(v1196, v1197); + real2 v875 = minusplus(uminus(v871), v872); + real2 v873 = minusplus(v871, v872); + real2 v883 = ctimesminusplus(reverse(v873), tbl[150 + tbloffset], ctimes(v873, tbl[151 + tbloffset])); + real2 v1639 = reverse(minus(v883, v1043)); + real2 v1645 = plus(v883, v1043); + real2 v1195 = minusplus(uminus(v1191), v1192); + real2 v1193 = minusplus(v1191, v1192); + real2 v1209 = ctimesminusplus(reverse(v1195), tbl[216 + tbloffset], ctimes(v1195, tbl[217 + tbloffset])); + real2 v1203 = ctimesminusplus(reverse(v1193), tbl[214 + tbloffset], ctimes(v1193, tbl[215 + tbloffset])); + real2 v83 = load(in, 81 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v476 = plus(v19, v83); + real2 v472 = minus(v83, v19); + real2 v51 = load(in, 49 << inShift); + real2 v115 = load(in, 113 << inShift); + real2 v477 = plus(v51, v115); + real2 v471 = reverse(minus(v51, v115)); + real2 v797 = plus(v476, v477); + real2 v791 = reverse(minus(v476, v477)); + real2 v3 = load(in, 1 << inShift); + real2 v67 = load(in, 65 << inShift); + real2 v156 = plus(v3, v67); + real2 v152 = minus(v67, v3); + real2 v35 = load(in, 33 << inShift); + real2 v99 = load(in, 97 << inShift); + real2 v157 = plus(v35, v99); + real2 v151 = reverse(minus(v35, v99)); + real2 v792 = minus(v157, v156); + real2 v796 = plus(v156, v157); + real2 v793 = minusplus(v791, v792); + real2 v795 = minusplus(uminus(v791), v792); + real2 v803 = ctimesminusplus(reverse(v793), tbl[134 + tbloffset], ctimes(v793, tbl[135 + tbloffset])); + real2 v1112 = minus(v797, v796); + real2 v1116 = plus(v796, v797); + real2 v107 = load(in, 105 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v317 = plus(v43, v107); + real2 v311 = reverse(minus(v43, v107)); + real2 v75 = load(in, 73 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v316 = plus(v11, v75); + real2 v312 = minus(v75, v11); + real2 v956 = plus(v316, v317); + real2 v952 = minus(v317, v316); + real2 v59 = load(in, 57 << inShift); + real2 v123 = load(in, 121 << inShift); + real2 v631 = reverse(minus(v59, v123)); + real2 v637 = plus(v59, v123); + real2 v27 = load(in, 25 << inShift); + real2 v91 = load(in, 89 << inShift); + real2 v636 = plus(v27, v91); + real2 v632 = minus(v91, v27); + real2 v957 = plus(v636, v637); + real2 v951 = reverse(minus(v636, v637)); + real2 v1111 = reverse(minus(v956, v957)); + real2 v1117 = plus(v956, v957); + real2 v1276 = plus(v1116, v1117); + real2 v1272 = minus(v1117, v1116); + real2 v1275 = minusplus(uminus(v1271), v1272); + real2 v1273 = minusplus(v1271, v1272); + real2 v1283 = ctimesminusplus(reverse(v1273), tbl[230 + tbloffset], ctimes(v1273, tbl[231 + tbloffset])); + real2 v1352 = minus(v1277, v1276); + real2 v1356 = plus(v1276, v1277); + real2 v1289 = ctimesminusplus(reverse(v1275), tbl[232 + tbloffset], ctimes(v1275, tbl[233 + tbloffset])); + real2 v1115 = minusplus(uminus(v1111), v1112); + real2 v1113 = minusplus(v1111, v1112); + real2 v1123 = ctimesminusplus(reverse(v1113), tbl[198 + tbloffset], ctimes(v1113, tbl[199 + tbloffset])); + real2 v1129 = ctimesminusplus(reverse(v1115), tbl[200 + tbloffset], ctimes(v1115, tbl[201 + tbloffset])); + real2 v1488 = plus(v1123, v1203); + real2 v1484 = minus(v1203, v1123); + real2 v1566 = plus(v1129, v1209); + real2 v1562 = minus(v1209, v1129); + real2 v85 = load(in, 83 << inShift); + real2 v21 = load(in, 19 << inShift); + real2 v512 = minus(v85, v21); + real2 v516 = plus(v21, v85); + real2 v117 = load(in, 115 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v517 = plus(v53, v117); + real2 v511 = reverse(minus(v53, v117)); + real2 v831 = reverse(minus(v516, v517)); + real2 v837 = plus(v516, v517); + real2 v69 = load(in, 67 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v192 = minus(v69, v5); + real2 v196 = plus(v5, v69); + real2 v37 = load(in, 35 << inShift); + real2 v101 = load(in, 99 << inShift); + real2 v197 = plus(v37, v101); + real2 v191 = reverse(minus(v37, v101)); + real2 v832 = minus(v197, v196); + real2 v836 = plus(v196, v197); + real2 v1152 = minus(v837, v836); + real2 v1156 = plus(v836, v837); + real2 v61 = load(in, 59 << inShift); + real2 v125 = load(in, 123 << inShift); + real2 v677 = plus(v61, v125); + real2 v671 = reverse(minus(v61, v125)); + real2 v29 = load(in, 27 << inShift); + real2 v93 = load(in, 91 << inShift); + real2 v672 = minus(v93, v29); + real2 v676 = plus(v29, v93); + real2 v997 = plus(v676, v677); + real2 v991 = reverse(minus(v676, v677)); + real2 v109 = load(in, 107 << inShift); + real2 v45 = load(in, 43 << inShift); + real2 v357 = plus(v45, v109); + real2 v351 = reverse(minus(v45, v109)); + real2 v77 = load(in, 75 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v352 = minus(v77, v13); + real2 v356 = plus(v13, v77); + real2 v992 = minus(v357, v356); + real2 v996 = plus(v356, v357); + real2 v1157 = plus(v996, v997); + real2 v1151 = reverse(minus(v996, v997)); + real2 v1155 = minusplus(uminus(v1151), v1152); + real2 v1153 = minusplus(v1151, v1152); + real2 v1163 = ctimesminusplus(reverse(v1153), tbl[206 + tbloffset], ctimes(v1153, tbl[207 + tbloffset])); + real2 v1316 = plus(v1156, v1157); + real2 v1312 = minus(v1157, v1156); + real2 v41 = load(in, 39 << inShift); + real2 v105 = load(in, 103 << inShift); + real2 v277 = plus(v41, v105); + real2 v271 = reverse(minus(v41, v105)); + real2 v9 = load(in, 7 << inShift); + real2 v73 = load(in, 71 << inShift); + real2 v276 = plus(v9, v73); + real2 v272 = minus(v73, v9); + real2 v916 = plus(v276, v277); + real2 v912 = minus(v277, v276); + real2 v89 = load(in, 87 << inShift); + real2 v25 = load(in, 23 << inShift); + real2 v592 = minus(v89, v25); + real2 v596 = plus(v25, v89); + real2 v57 = load(in, 55 << inShift); + real2 v121 = load(in, 119 << inShift); + real2 v591 = reverse(minus(v57, v121)); + real2 v597 = plus(v57, v121); + real2 v911 = reverse(minus(v596, v597)); + real2 v917 = plus(v596, v597); + real2 v1236 = plus(v916, v917); + real2 v1232 = minus(v917, v916); + real2 v81 = load(in, 79 << inShift); + real2 v17 = load(in, 15 << inShift); + real2 v432 = minus(v81, v17); + real2 v436 = plus(v17, v81); + real2 v113 = load(in, 111 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v437 = plus(v49, v113); + real2 v431 = reverse(minus(v49, v113)); + real2 v1072 = minus(v437, v436); + real2 v1076 = plus(v436, v437); + real2 v65 = load(in, 63 << inShift); + real2 v129 = load(in, 127 << inShift); + real2 v757 = plus(v65, v129); + real2 v751 = reverse(minus(v65, v129)); + real2 v97 = load(in, 95 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v752 = minus(v97, v33); + real2 v756 = plus(v33, v97); + real2 v1077 = plus(v756, v757); + real2 v1071 = reverse(minus(v756, v757)); + real2 v1231 = reverse(minus(v1076, v1077)); + real2 v1237 = plus(v1076, v1077); + real2 v1317 = plus(v1236, v1237); + real2 v1311 = reverse(minus(v1236, v1237)); + real2 v1351 = reverse(minus(v1316, v1317)); + real2 v1357 = plus(v1316, v1317); + real2 v1371 = reverse(minus(v1356, v1357)); + real2 v1377 = plus(v1356, v1357); + store(out, 0 << outShift, plus(v1376, v1377)); + real2 v1390 = minus(v1376, v1377); + store(out, 64 << outShift, ctimesminusplus(v1390, tbl[0 + tbloffset], ctimes(reverse(v1390), tbl[1 + tbloffset]))); + real2 v1353 = minusplus(v1351, v1352); + real2 v1355 = minusplus(uminus(v1351), v1352); + real2 v1369 = ctimesminusplus(reverse(v1355), tbl[248 + tbloffset], ctimes(v1355, tbl[249 + tbloffset])); + store(out, 48 << outShift, plus(v1349, v1369)); + real2 v1404 = minus(v1349, v1369); + store(out, 112 << outShift, ctimesminusplus(v1404, tbl[0 + tbloffset], ctimes(reverse(v1404), tbl[1 + tbloffset]))); + real2 v1363 = ctimesminusplus(reverse(v1353), tbl[246 + tbloffset], ctimes(v1353, tbl[247 + tbloffset])); + store(out, 16 << outShift, plus(v1343, v1363)); + real2 v1398 = minus(v1343, v1363); + store(out, 80 << outShift, ctimesminusplus(v1398, tbl[0 + tbloffset], ctimes(reverse(v1398), tbl[1 + tbloffset]))); + real2 v1373 = minusplus(v1371, v1372); + real2 v1375 = minusplus(uminus(v1371), v1372); + store(out, 96 << outShift, ctimesminusplus(reverse(v1375), tbl[252 + tbloffset], ctimes(v1375, tbl[253 + tbloffset]))); + store(out, 32 << outShift, ctimesminusplus(reverse(v1373), tbl[250 + tbloffset], ctimes(v1373, tbl[251 + tbloffset]))); + real2 v1313 = minusplus(v1311, v1312); + real2 v1315 = minusplus(uminus(v1311), v1312); + real2 v1323 = ctimesminusplus(reverse(v1313), tbl[238 + tbloffset], ctimes(v1313, tbl[239 + tbloffset])); + real2 v1417 = plus(v1283, v1323); + real2 v1411 = reverse(minus(v1283, v1323)); + store(out, 8 << outShift, plus(v1416, v1417)); + real2 v1430 = minus(v1416, v1417); + store(out, 72 << outShift, ctimesminusplus(v1430, tbl[0 + tbloffset], ctimes(reverse(v1430), tbl[1 + tbloffset]))); + real2 v1413 = minusplus(v1411, v1412); + real2 v1415 = minusplus(uminus(v1411), v1412); + store(out, 104 << outShift, ctimesminusplus(reverse(v1415), tbl[256 + tbloffset], ctimes(v1415, tbl[257 + tbloffset]))); + store(out, 40 << outShift, ctimesminusplus(reverse(v1413), tbl[254 + tbloffset], ctimes(v1413, tbl[255 + tbloffset]))); + real2 v1329 = ctimesminusplus(reverse(v1315), tbl[240 + tbloffset], ctimes(v1315, tbl[241 + tbloffset])); + real2 v1443 = plus(v1289, v1329); + real2 v1437 = reverse(minus(v1289, v1329)); + store(out, 24 << outShift, plus(v1442, v1443)); + real2 v1456 = minus(v1442, v1443); + store(out, 88 << outShift, ctimesminusplus(v1456, tbl[0 + tbloffset], ctimes(reverse(v1456), tbl[1 + tbloffset]))); + real2 v1441 = minusplus(uminus(v1437), v1438); + real2 v1439 = minusplus(v1437, v1438); + store(out, 120 << outShift, ctimesminusplus(reverse(v1441), tbl[260 + tbloffset], ctimes(v1441, tbl[261 + tbloffset]))); + store(out, 56 << outShift, ctimesminusplus(reverse(v1439), tbl[258 + tbloffset], ctimes(v1439, tbl[259 + tbloffset]))); + real2 v1235 = minusplus(uminus(v1231), v1232); + real2 v1233 = minusplus(v1231, v1232); + real2 v1243 = ctimesminusplus(reverse(v1233), tbl[222 + tbloffset], ctimes(v1233, tbl[223 + tbloffset])); + real2 v1489 = plus(v1163, v1243); + real2 v1483 = reverse(minus(v1163, v1243)); + real2 v1509 = plus(v1488, v1489); + real2 v1503 = reverse(minus(v1488, v1489)); + store(out, 4 << outShift, plus(v1508, v1509)); + real2 v1522 = minus(v1508, v1509); + store(out, 68 << outShift, ctimesminusplus(v1522, tbl[0 + tbloffset], ctimes(reverse(v1522), tbl[1 + tbloffset]))); + real2 v1507 = minusplus(uminus(v1503), v1504); + real2 v1505 = minusplus(v1503, v1504); + store(out, 36 << outShift, ctimesminusplus(reverse(v1505), tbl[270 + tbloffset], ctimes(v1505, tbl[271 + tbloffset]))); + store(out, 100 << outShift, ctimesminusplus(reverse(v1507), tbl[272 + tbloffset], ctimes(v1507, tbl[273 + tbloffset]))); + real2 v1485 = minusplus(v1483, v1484); + real2 v1487 = minusplus(uminus(v1483), v1484); + real2 v1501 = ctimesminusplus(reverse(v1487), tbl[268 + tbloffset], ctimes(v1487, tbl[269 + tbloffset])); + store(out, 52 << outShift, plus(v1481, v1501)); + real2 v1534 = minus(v1481, v1501); + store(out, 116 << outShift, ctimesminusplus(v1534, tbl[0 + tbloffset], ctimes(reverse(v1534), tbl[1 + tbloffset]))); + real2 v1495 = ctimesminusplus(reverse(v1485), tbl[266 + tbloffset], ctimes(v1485, tbl[267 + tbloffset])); + store(out, 20 << outShift, plus(v1475, v1495)); + real2 v1528 = minus(v1475, v1495); + store(out, 84 << outShift, ctimesminusplus(v1528, tbl[0 + tbloffset], ctimes(reverse(v1528), tbl[1 + tbloffset]))); + real2 v1249 = ctimesminusplus(reverse(v1235), tbl[224 + tbloffset], ctimes(v1235, tbl[225 + tbloffset])); + real2 v1169 = ctimesminusplus(reverse(v1155), tbl[208 + tbloffset], ctimes(v1155, tbl[209 + tbloffset])); + real2 v1567 = plus(v1169, v1249); + real2 v1561 = reverse(minus(v1169, v1249)); + real2 v1581 = reverse(minus(v1566, v1567)); + real2 v1587 = plus(v1566, v1567); + store(out, 12 << outShift, plus(v1586, v1587)); + real2 v1600 = minus(v1586, v1587); + store(out, 76 << outShift, ctimesminusplus(v1600, tbl[0 + tbloffset], ctimes(reverse(v1600), tbl[1 + tbloffset]))); + real2 v1583 = minusplus(v1581, v1582); + store(out, 44 << outShift, ctimesminusplus(reverse(v1583), tbl[282 + tbloffset], ctimes(v1583, tbl[283 + tbloffset]))); + real2 v1585 = minusplus(uminus(v1581), v1582); + store(out, 108 << outShift, ctimesminusplus(reverse(v1585), tbl[284 + tbloffset], ctimes(v1585, tbl[285 + tbloffset]))); + real2 v1565 = minusplus(uminus(v1561), v1562); + real2 v1563 = minusplus(v1561, v1562); + real2 v1579 = ctimesminusplus(reverse(v1565), tbl[280 + tbloffset], ctimes(v1565, tbl[281 + tbloffset])); + store(out, 60 << outShift, plus(v1559, v1579)); + real2 v1612 = minus(v1559, v1579); + store(out, 124 << outShift, ctimesminusplus(v1612, tbl[0 + tbloffset], ctimes(reverse(v1612), tbl[1 + tbloffset]))); + real2 v1573 = ctimesminusplus(reverse(v1563), tbl[278 + tbloffset], ctimes(v1563, tbl[279 + tbloffset])); + store(out, 28 << outShift, plus(v1553, v1573)); + real2 v1606 = minus(v1553, v1573); + store(out, 92 << outShift, ctimesminusplus(v1606, tbl[0 + tbloffset], ctimes(reverse(v1606), tbl[1 + tbloffset]))); + real2 v833 = minusplus(v831, v832); + real2 v835 = minusplus(uminus(v831), v832); + real2 v955 = minusplus(uminus(v951), v952); + real2 v953 = minusplus(v951, v952); + real2 v963 = ctimesminusplus(reverse(v953), tbl[166 + tbloffset], ctimes(v953, tbl[167 + tbloffset])); + real2 v995 = minusplus(uminus(v991), v992); + real2 v993 = minusplus(v991, v992); + real2 v1003 = ctimesminusplus(reverse(v993), tbl[174 + tbloffset], ctimes(v993, tbl[175 + tbloffset])); + real2 v843 = ctimesminusplus(reverse(v833), tbl[142 + tbloffset], ctimes(v833, tbl[143 + tbloffset])); + real2 v1640 = minus(v963, v803); + real2 v1644 = plus(v803, v963); + real2 v1680 = minus(v1003, v843); + real2 v1684 = plus(v843, v1003); + real2 v1641 = minusplus(v1639, v1640); + real2 v1643 = minusplus(uminus(v1639), v1640); + real2 v1657 = ctimesminusplus(reverse(v1643), tbl[292 + tbloffset], ctimes(v1643, tbl[293 + tbloffset])); + real2 v913 = minusplus(v911, v912); + real2 v915 = minusplus(uminus(v911), v912); + real2 v1073 = minusplus(v1071, v1072); + real2 v1075 = minusplus(uminus(v1071), v1072); + real2 v923 = ctimesminusplus(reverse(v913), tbl[158 + tbloffset], ctimes(v913, tbl[159 + tbloffset])); + real2 v1083 = ctimesminusplus(reverse(v1073), tbl[190 + tbloffset], ctimes(v1073, tbl[191 + tbloffset])); + real2 v1685 = plus(v923, v1083); + real2 v1679 = reverse(minus(v923, v1083)); + real2 v1681 = minusplus(v1679, v1680); + real2 v1683 = minusplus(uminus(v1679), v1680); + real2 v1697 = ctimesminusplus(reverse(v1683), tbl[300 + tbloffset], ctimes(v1683, tbl[301 + tbloffset])); + real2 v1809 = plus(v1657, v1697); + real2 v1803 = reverse(minus(v1657, v1697)); + store(out, 26 << outShift, plus(v1808, v1809)); + real2 v1822 = minus(v1808, v1809); + store(out, 90 << outShift, ctimesminusplus(v1822, tbl[0 + tbloffset], ctimes(reverse(v1822), tbl[1 + tbloffset]))); + real2 v1807 = minusplus(uminus(v1803), v1804); + real2 v1805 = minusplus(v1803, v1804); + store(out, 58 << outShift, ctimesminusplus(reverse(v1805), tbl[318 + tbloffset], ctimes(v1805, tbl[319 + tbloffset]))); + store(out, 122 << outShift, ctimesminusplus(reverse(v1807), tbl[320 + tbloffset], ctimes(v1807, tbl[321 + tbloffset]))); + real2 v1651 = ctimesminusplus(reverse(v1641), tbl[290 + tbloffset], ctimes(v1641, tbl[291 + tbloffset])); + real2 v1691 = ctimesminusplus(reverse(v1681), tbl[298 + tbloffset], ctimes(v1681, tbl[299 + tbloffset])); + real2 v1783 = plus(v1651, v1691); + real2 v1777 = reverse(minus(v1651, v1691)); + real2 v1779 = minusplus(v1777, v1778); + real2 v1781 = minusplus(uminus(v1777), v1778); + store(out, 106 << outShift, ctimesminusplus(reverse(v1781), tbl[316 + tbloffset], ctimes(v1781, tbl[317 + tbloffset]))); + store(out, 42 << outShift, ctimesminusplus(reverse(v1779), tbl[314 + tbloffset], ctimes(v1779, tbl[315 + tbloffset]))); + store(out, 10 << outShift, plus(v1782, v1783)); + real2 v1796 = minus(v1782, v1783); + store(out, 74 << outShift, ctimesminusplus(v1796, tbl[0 + tbloffset], ctimes(reverse(v1796), tbl[1 + tbloffset]))); + real2 v1720 = minus(v1645, v1644); + real2 v1724 = plus(v1644, v1645); + real2 v1719 = reverse(minus(v1684, v1685)); + real2 v1725 = plus(v1684, v1685); + real2 v1745 = plus(v1724, v1725); + real2 v1739 = reverse(minus(v1724, v1725)); + store(out, 2 << outShift, plus(v1744, v1745)); + real2 v1758 = minus(v1744, v1745); + store(out, 66 << outShift, ctimesminusplus(v1758, tbl[0 + tbloffset], ctimes(reverse(v1758), tbl[1 + tbloffset]))); + real2 v1741 = minusplus(v1739, v1740); + real2 v1743 = minusplus(uminus(v1739), v1740); + store(out, 98 << outShift, ctimesminusplus(reverse(v1743), tbl[312 + tbloffset], ctimes(v1743, tbl[313 + tbloffset]))); + store(out, 34 << outShift, ctimesminusplus(reverse(v1741), tbl[310 + tbloffset], ctimes(v1741, tbl[311 + tbloffset]))); + real2 v1723 = minusplus(uminus(v1719), v1720); + real2 v1721 = minusplus(v1719, v1720); + real2 v1737 = ctimesminusplus(reverse(v1723), tbl[308 + tbloffset], ctimes(v1723, tbl[309 + tbloffset])); + store(out, 50 << outShift, plus(v1717, v1737)); + real2 v1770 = minus(v1717, v1737); + store(out, 114 << outShift, ctimesminusplus(v1770, tbl[0 + tbloffset], ctimes(reverse(v1770), tbl[1 + tbloffset]))); + real2 v1731 = ctimesminusplus(reverse(v1721), tbl[306 + tbloffset], ctimes(v1721, tbl[307 + tbloffset])); + store(out, 18 << outShift, plus(v1711, v1731)); + real2 v1764 = minus(v1711, v1731); + store(out, 82 << outShift, ctimesminusplus(v1764, tbl[0 + tbloffset], ctimes(reverse(v1764), tbl[1 + tbloffset]))); + real2 v809 = ctimesminusplus(reverse(v795), tbl[136 + tbloffset], ctimes(v795, tbl[137 + tbloffset])); + real2 v969 = ctimesminusplus(reverse(v955), tbl[168 + tbloffset], ctimes(v955, tbl[169 + tbloffset])); + real2 v1850 = minus(v969, v809); + real2 v1854 = plus(v809, v969); + real2 v849 = ctimesminusplus(reverse(v835), tbl[144 + tbloffset], ctimes(v835, tbl[145 + tbloffset])); + real2 v929 = ctimesminusplus(reverse(v915), tbl[160 + tbloffset], ctimes(v915, tbl[161 + tbloffset])); + real2 v889 = ctimesminusplus(reverse(v875), tbl[152 + tbloffset], ctimes(v875, tbl[153 + tbloffset])); + real2 v1089 = ctimesminusplus(reverse(v1075), tbl[192 + tbloffset], ctimes(v1075, tbl[193 + tbloffset])); + real2 v1009 = ctimesminusplus(reverse(v995), tbl[176 + tbloffset], ctimes(v995, tbl[177 + tbloffset])); + real2 v1890 = minus(v1009, v849); + real2 v1894 = plus(v849, v1009); + real2 v1849 = reverse(minus(v889, v1049)); + real2 v1855 = plus(v889, v1049); + real2 v1930 = minus(v1855, v1854); + real2 v1934 = plus(v1854, v1855); + real2 v1895 = plus(v929, v1089); + real2 v1889 = reverse(minus(v929, v1089)); + real2 v1929 = reverse(minus(v1894, v1895)); + real2 v1935 = plus(v1894, v1895); + real2 v1955 = plus(v1934, v1935); + real2 v1949 = reverse(minus(v1934, v1935)); + store(out, 6 << outShift, plus(v1954, v1955)); + real2 v1968 = minus(v1954, v1955); + store(out, 70 << outShift, ctimesminusplus(v1968, tbl[0 + tbloffset], ctimes(reverse(v1968), tbl[1 + tbloffset]))); + real2 v1951 = minusplus(v1949, v1950); + store(out, 38 << outShift, ctimesminusplus(reverse(v1951), tbl[346 + tbloffset], ctimes(v1951, tbl[347 + tbloffset]))); + real2 v1953 = minusplus(uminus(v1949), v1950); + store(out, 102 << outShift, ctimesminusplus(reverse(v1953), tbl[348 + tbloffset], ctimes(v1953, tbl[349 + tbloffset]))); + real2 v1931 = minusplus(v1929, v1930); + real2 v1933 = minusplus(uminus(v1929), v1930); + real2 v1947 = ctimesminusplus(reverse(v1933), tbl[344 + tbloffset], ctimes(v1933, tbl[345 + tbloffset])); + store(out, 54 << outShift, plus(v1927, v1947)); + real2 v1980 = minus(v1927, v1947); + store(out, 118 << outShift, ctimesminusplus(v1980, tbl[0 + tbloffset], ctimes(reverse(v1980), tbl[1 + tbloffset]))); + real2 v1941 = ctimesminusplus(reverse(v1931), tbl[342 + tbloffset], ctimes(v1931, tbl[343 + tbloffset])); + store(out, 22 << outShift, plus(v1921, v1941)); + real2 v1974 = minus(v1921, v1941); + store(out, 86 << outShift, ctimesminusplus(v1974, tbl[0 + tbloffset], ctimes(reverse(v1974), tbl[1 + tbloffset]))); + real2 v1851 = minusplus(v1849, v1850); + real2 v1853 = minusplus(uminus(v1849), v1850); + real2 v1867 = ctimesminusplus(reverse(v1853), tbl[328 + tbloffset], ctimes(v1853, tbl[329 + tbloffset])); + real2 v1891 = minusplus(v1889, v1890); + real2 v1893 = minusplus(uminus(v1889), v1890); + real2 v1907 = ctimesminusplus(reverse(v1893), tbl[336 + tbloffset], ctimes(v1893, tbl[337 + tbloffset])); + real2 v2019 = plus(v1867, v1907); + real2 v2013 = reverse(minus(v1867, v1907)); + store(out, 30 << outShift, plus(v2018, v2019)); + real2 v2032 = minus(v2018, v2019); + store(out, 94 << outShift, ctimesminusplus(v2032, tbl[0 + tbloffset], ctimes(reverse(v2032), tbl[1 + tbloffset]))); + real2 v2017 = minusplus(uminus(v2013), v2014); + store(out, 126 << outShift, ctimesminusplus(reverse(v2017), tbl[356 + tbloffset], ctimes(v2017, tbl[357 + tbloffset]))); + real2 v2015 = minusplus(v2013, v2014); + store(out, 62 << outShift, ctimesminusplus(reverse(v2015), tbl[354 + tbloffset], ctimes(v2015, tbl[355 + tbloffset]))); + real2 v1861 = ctimesminusplus(reverse(v1851), tbl[326 + tbloffset], ctimes(v1851, tbl[327 + tbloffset])); + real2 v1901 = ctimesminusplus(reverse(v1891), tbl[334 + tbloffset], ctimes(v1891, tbl[335 + tbloffset])); + real2 v1993 = plus(v1861, v1901); + real2 v1987 = reverse(minus(v1861, v1901)); + store(out, 14 << outShift, plus(v1992, v1993)); + real2 v2006 = minus(v1992, v1993); + store(out, 78 << outShift, ctimesminusplus(v2006, tbl[0 + tbloffset], ctimes(reverse(v2006), tbl[1 + tbloffset]))); + real2 v1991 = minusplus(uminus(v1987), v1988); + store(out, 110 << outShift, ctimesminusplus(reverse(v1991), tbl[352 + tbloffset], ctimes(v1991, tbl[353 + tbloffset]))); + real2 v1989 = minusplus(v1987, v1988); + store(out, 46 << outShift, ctimesminusplus(reverse(v1989), tbl[350 + tbloffset], ctimes(v1989, tbl[351 + tbloffset]))); + real2 v593 = minusplus(v591, v592); + real2 v595 = minusplus(uminus(v591), v592); + real2 v473 = minusplus(v471, v472); + real2 v475 = minusplus(uminus(v471), v472); + real2 v555 = minusplus(uminus(v551), v552); + real2 v553 = minusplus(v551, v552); + real2 v609 = ctimesminusplus(reverse(v595), tbl[96 + tbloffset], ctimes(v595, tbl[97 + tbloffset])); + real2 v195 = minusplus(uminus(v191), v192); + real2 v193 = minusplus(v191, v192); + real2 v275 = minusplus(uminus(v271), v272); + real2 v273 = minusplus(v271, v272); + real2 v673 = minusplus(v671, v672); + real2 v675 = minusplus(uminus(v671), v672); + real2 v689 = ctimesminusplus(reverse(v675), tbl[112 + tbloffset], ctimes(v675, tbl[113 + tbloffset])); + real2 v209 = ctimesminusplus(reverse(v195), tbl[16 + tbloffset], ctimes(v195, tbl[17 + tbloffset])); + real2 v289 = ctimesminusplus(reverse(v275), tbl[32 + tbloffset], ctimes(v275, tbl[33 + tbloffset])); + real2 v755 = minusplus(uminus(v751), v752); + real2 v753 = minusplus(v751, v752); + real2 v435 = minusplus(uminus(v431), v432); + real2 v433 = minusplus(v431, v432); + real2 v513 = minusplus(v511, v512); + real2 v515 = minusplus(uminus(v511), v512); + real2 v529 = ctimesminusplus(reverse(v515), tbl[80 + tbloffset], ctimes(v515, tbl[81 + tbloffset])); + real2 v353 = minusplus(v351, v352); + real2 v355 = minusplus(uminus(v351), v352); + real2 v369 = ctimesminusplus(reverse(v355), tbl[48 + tbloffset], ctimes(v355, tbl[49 + tbloffset])); + real2 v2631 = plus(v369, v689); + real2 v2625 = reverse(minus(v369, v689)); + real2 v449 = ctimesminusplus(reverse(v435), tbl[64 + tbloffset], ctimes(v435, tbl[65 + tbloffset])); + real2 v2710 = plus(v289, v609); + real2 v2706 = minus(v609, v289); + real2 v2630 = plus(v209, v529); + real2 v2626 = minus(v529, v209); + real2 v2790 = plus(v2630, v2631); + real2 v2786 = minus(v2631, v2630); + real2 v713 = minusplus(v711, v712); + real2 v715 = minusplus(uminus(v711), v712); + real2 v769 = ctimesminusplus(reverse(v755), tbl[128 + tbloffset], ctimes(v755, tbl[129 + tbloffset])); + real2 v2705 = reverse(minus(v449, v769)); + real2 v2711 = plus(v449, v769); + real2 v313 = minusplus(v311, v312); + real2 v315 = minusplus(uminus(v311), v312); + real2 v393 = minusplus(v391, v392); + real2 v395 = minusplus(uminus(v391), v392); + real2 v409 = ctimesminusplus(reverse(v395), tbl[56 + tbloffset], ctimes(v395, tbl[57 + tbloffset])); + real2 v729 = ctimesminusplus(reverse(v715), tbl[120 + tbloffset], ctimes(v715, tbl[121 + tbloffset])); + real2 v329 = ctimesminusplus(reverse(v315), tbl[40 + tbloffset], ctimes(v315, tbl[41 + tbloffset])); + real2 v489 = ctimesminusplus(reverse(v475), tbl[72 + tbloffset], ctimes(v475, tbl[73 + tbloffset])); + real2 v153 = minusplus(v151, v152); + real2 v155 = minusplus(uminus(v151), v152); + real2 v169 = ctimesminusplus(reverse(v155), tbl[8 + tbloffset], ctimes(v155, tbl[9 + tbloffset])); + real2 v2586 = minus(v489, v169); + real2 v2590 = plus(v169, v489); + real2 v233 = minusplus(v231, v232); + real2 v235 = minusplus(uminus(v231), v232); + real2 v633 = minusplus(v631, v632); + real2 v635 = minusplus(uminus(v631), v632); + real2 v649 = ctimesminusplus(reverse(v635), tbl[104 + tbloffset], ctimes(v635, tbl[105 + tbloffset])); + real2 v249 = ctimesminusplus(reverse(v235), tbl[24 + tbloffset], ctimes(v235, tbl[25 + tbloffset])); + real2 v569 = ctimesminusplus(reverse(v555), tbl[88 + tbloffset], ctimes(v555, tbl[89 + tbloffset])); + real2 v2670 = plus(v249, v569); + real2 v2666 = minus(v569, v249); + real2 v2785 = reverse(minus(v2710, v2711)); + real2 v2791 = plus(v2710, v2711); + real2 v2825 = reverse(minus(v2790, v2791)); + real2 v2831 = plus(v2790, v2791); + real2 v2671 = plus(v409, v729); + real2 v2665 = reverse(minus(v409, v729)); + real2 v2745 = reverse(minus(v2670, v2671)); + real2 v2751 = plus(v2670, v2671); + real2 v2806 = minus(v2731, v2730); + real2 v2810 = plus(v2730, v2731); + real2 v2846 = minus(v2811, v2810); + real2 v2850 = plus(v2810, v2811); + real2 v2591 = plus(v329, v649); + real2 v2585 = reverse(minus(v329, v649)); + real2 v2750 = plus(v2590, v2591); + real2 v2746 = minus(v2591, v2590); + real2 v2830 = plus(v2750, v2751); + real2 v2826 = minus(v2751, v2750); + real2 v2845 = reverse(minus(v2830, v2831)); + real2 v2851 = plus(v2830, v2831); + store(out, 3 << outShift, plus(v2850, v2851)); + real2 v2864 = minus(v2850, v2851); + store(out, 67 << outShift, ctimesminusplus(v2864, tbl[0 + tbloffset], ctimes(reverse(v2864), tbl[1 + tbloffset]))); + real2 v2849 = minusplus(uminus(v2845), v2846); + real2 v2847 = minusplus(v2845, v2846); + store(out, 35 << outShift, ctimesminusplus(reverse(v2847), tbl[506 + tbloffset], ctimes(v2847, tbl[507 + tbloffset]))); + store(out, 99 << outShift, ctimesminusplus(reverse(v2849), tbl[508 + tbloffset], ctimes(v2849, tbl[509 + tbloffset]))); + real2 v2827 = minusplus(v2825, v2826); + real2 v2829 = minusplus(uminus(v2825), v2826); + real2 v2837 = ctimesminusplus(reverse(v2827), tbl[502 + tbloffset], ctimes(v2827, tbl[503 + tbloffset])); + real2 v2809 = minusplus(uminus(v2805), v2806); + real2 v2807 = minusplus(v2805, v2806); + real2 v2817 = ctimesminusplus(reverse(v2807), tbl[498 + tbloffset], ctimes(v2807, tbl[499 + tbloffset])); + store(out, 19 << outShift, plus(v2817, v2837)); + real2 v2870 = minus(v2817, v2837); + store(out, 83 << outShift, ctimesminusplus(v2870, tbl[0 + tbloffset], ctimes(reverse(v2870), tbl[1 + tbloffset]))); + real2 v2823 = ctimesminusplus(reverse(v2809), tbl[500 + tbloffset], ctimes(v2809, tbl[501 + tbloffset])); + real2 v2843 = ctimesminusplus(reverse(v2829), tbl[504 + tbloffset], ctimes(v2829, tbl[505 + tbloffset])); + store(out, 51 << outShift, plus(v2823, v2843)); + real2 v2876 = minus(v2823, v2843); + store(out, 115 << outShift, ctimesminusplus(v2876, tbl[0 + tbloffset], ctimes(reverse(v2876), tbl[1 + tbloffset]))); + real2 v2787 = minusplus(v2785, v2786); + real2 v2789 = minusplus(uminus(v2785), v2786); + real2 v2803 = ctimesminusplus(reverse(v2789), tbl[496 + tbloffset], ctimes(v2789, tbl[497 + tbloffset])); + real2 v2727 = minusplus(v2725, v2726); + real2 v2729 = minusplus(uminus(v2725), v2726); + real2 v2743 = ctimesminusplus(reverse(v2729), tbl[484 + tbloffset], ctimes(v2729, tbl[485 + tbloffset])); + real2 v2914 = plus(v2743, v2783); + real2 v2910 = minus(v2783, v2743); + real2 v2749 = minusplus(uminus(v2745), v2746); + real2 v2747 = minusplus(v2745, v2746); + real2 v2763 = ctimesminusplus(reverse(v2749), tbl[488 + tbloffset], ctimes(v2749, tbl[489 + tbloffset])); + real2 v2909 = reverse(minus(v2763, v2803)); + real2 v2915 = plus(v2763, v2803); + store(out, 27 << outShift, plus(v2914, v2915)); + real2 v2928 = minus(v2914, v2915); + store(out, 91 << outShift, ctimesminusplus(v2928, tbl[0 + tbloffset], ctimes(reverse(v2928), tbl[1 + tbloffset]))); + real2 v2913 = minusplus(uminus(v2909), v2910); + store(out, 123 << outShift, ctimesminusplus(reverse(v2913), tbl[516 + tbloffset], ctimes(v2913, tbl[517 + tbloffset]))); + real2 v2911 = minusplus(v2909, v2910); + store(out, 59 << outShift, ctimesminusplus(reverse(v2911), tbl[514 + tbloffset], ctimes(v2911, tbl[515 + tbloffset]))); + real2 v2737 = ctimesminusplus(reverse(v2727), tbl[482 + tbloffset], ctimes(v2727, tbl[483 + tbloffset])); + real2 v2888 = plus(v2737, v2777); + real2 v2884 = minus(v2777, v2737); + real2 v2797 = ctimesminusplus(reverse(v2787), tbl[494 + tbloffset], ctimes(v2787, tbl[495 + tbloffset])); + real2 v2757 = ctimesminusplus(reverse(v2747), tbl[486 + tbloffset], ctimes(v2747, tbl[487 + tbloffset])); + real2 v2889 = plus(v2757, v2797); + real2 v2883 = reverse(minus(v2757, v2797)); + store(out, 11 << outShift, plus(v2888, v2889)); + real2 v2902 = minus(v2888, v2889); + store(out, 75 << outShift, ctimesminusplus(v2902, tbl[0 + tbloffset], ctimes(reverse(v2902), tbl[1 + tbloffset]))); + real2 v2887 = minusplus(uminus(v2883), v2884); + store(out, 107 << outShift, ctimesminusplus(reverse(v2887), tbl[512 + tbloffset], ctimes(v2887, tbl[513 + tbloffset]))); + real2 v2885 = minusplus(v2883, v2884); + store(out, 43 << outShift, ctimesminusplus(reverse(v2885), tbl[510 + tbloffset], ctimes(v2885, tbl[511 + tbloffset]))); + real2 v2669 = minusplus(uminus(v2665), v2666); + real2 v2667 = minusplus(v2665, v2666); + real2 v2707 = minusplus(v2705, v2706); + real2 v2709 = minusplus(uminus(v2705), v2706); + real2 v2717 = ctimesminusplus(reverse(v2707), tbl[478 + tbloffset], ctimes(v2707, tbl[479 + tbloffset])); + real2 v2627 = minusplus(v2625, v2626); + real2 v2629 = minusplus(uminus(v2625), v2626); + real2 v2637 = ctimesminusplus(reverse(v2627), tbl[462 + tbloffset], ctimes(v2627, tbl[463 + tbloffset])); + real2 v2961 = plus(v2637, v2717); + real2 v2955 = reverse(minus(v2637, v2717)); + real2 v2649 = minusplus(uminus(v2645), v2646); + real2 v2647 = minusplus(v2645, v2646); + real2 v2569 = minusplus(uminus(v2565), v2566); + real2 v2567 = minusplus(v2565, v2566); + real2 v2577 = ctimesminusplus(reverse(v2567), tbl[450 + tbloffset], ctimes(v2567, tbl[451 + tbloffset])); + real2 v2657 = ctimesminusplus(reverse(v2647), tbl[466 + tbloffset], ctimes(v2647, tbl[467 + tbloffset])); + real2 v2936 = minus(v2657, v2577); + real2 v2940 = plus(v2577, v2657); + real2 v2976 = minus(v2941, v2940); + real2 v2980 = plus(v2940, v2941); + real2 v2677 = ctimesminusplus(reverse(v2667), tbl[470 + tbloffset], ctimes(v2667, tbl[471 + tbloffset])); + real2 v2587 = minusplus(v2585, v2586); + real2 v2589 = minusplus(uminus(v2585), v2586); + real2 v2597 = ctimesminusplus(reverse(v2587), tbl[454 + tbloffset], ctimes(v2587, tbl[455 + tbloffset])); + real2 v2956 = minus(v2677, v2597); + real2 v2960 = plus(v2597, v2677); + real2 v2975 = reverse(minus(v2960, v2961)); + real2 v2981 = plus(v2960, v2961); + store(out, 7 << outShift, plus(v2980, v2981)); + real2 v2994 = minus(v2980, v2981); + store(out, 71 << outShift, ctimesminusplus(v2994, tbl[0 + tbloffset], ctimes(reverse(v2994), tbl[1 + tbloffset]))); + real2 v2979 = minusplus(uminus(v2975), v2976); + store(out, 103 << outShift, ctimesminusplus(reverse(v2979), tbl[528 + tbloffset], ctimes(v2979, tbl[529 + tbloffset]))); + real2 v2977 = minusplus(v2975, v2976); + store(out, 39 << outShift, ctimesminusplus(reverse(v2977), tbl[526 + tbloffset], ctimes(v2977, tbl[527 + tbloffset]))); + real2 v2939 = minusplus(uminus(v2935), v2936); + real2 v2937 = minusplus(v2935, v2936); + real2 v2953 = ctimesminusplus(reverse(v2939), tbl[520 + tbloffset], ctimes(v2939, tbl[521 + tbloffset])); + real2 v2957 = minusplus(v2955, v2956); + real2 v2959 = minusplus(uminus(v2955), v2956); + real2 v2973 = ctimesminusplus(reverse(v2959), tbl[524 + tbloffset], ctimes(v2959, tbl[525 + tbloffset])); + store(out, 55 << outShift, plus(v2953, v2973)); + real2 v3006 = minus(v2953, v2973); + store(out, 119 << outShift, ctimesminusplus(v3006, tbl[0 + tbloffset], ctimes(reverse(v3006), tbl[1 + tbloffset]))); + real2 v2947 = ctimesminusplus(reverse(v2937), tbl[518 + tbloffset], ctimes(v2937, tbl[519 + tbloffset])); + real2 v2967 = ctimesminusplus(reverse(v2957), tbl[522 + tbloffset], ctimes(v2957, tbl[523 + tbloffset])); + store(out, 23 << outShift, plus(v2947, v2967)); + real2 v3000 = minus(v2947, v2967); + store(out, 87 << outShift, ctimesminusplus(v3000, tbl[0 + tbloffset], ctimes(reverse(v3000), tbl[1 + tbloffset]))); + real2 v2663 = ctimesminusplus(reverse(v2649), tbl[468 + tbloffset], ctimes(v2649, tbl[469 + tbloffset])); + real2 v2583 = ctimesminusplus(reverse(v2569), tbl[452 + tbloffset], ctimes(v2569, tbl[453 + tbloffset])); + real2 v3014 = minus(v2663, v2583); + real2 v3018 = plus(v2583, v2663); + real2 v3015 = minusplus(v3013, v3014); + real2 v3017 = minusplus(uminus(v3013), v3014); + real2 v2643 = ctimesminusplus(reverse(v2629), tbl[464 + tbloffset], ctimes(v2629, tbl[465 + tbloffset])); + real2 v2723 = ctimesminusplus(reverse(v2709), tbl[480 + tbloffset], ctimes(v2709, tbl[481 + tbloffset])); + real2 v3039 = plus(v2643, v2723); + real2 v3033 = reverse(minus(v2643, v2723)); + real2 v2683 = ctimesminusplus(reverse(v2669), tbl[472 + tbloffset], ctimes(v2669, tbl[473 + tbloffset])); + real2 v3031 = ctimesminusplus(reverse(v3017), tbl[532 + tbloffset], ctimes(v3017, tbl[533 + tbloffset])); + real2 v2603 = ctimesminusplus(reverse(v2589), tbl[456 + tbloffset], ctimes(v2589, tbl[457 + tbloffset])); + real2 v3034 = minus(v2683, v2603); + real2 v3038 = plus(v2603, v2683); + real2 v3037 = minusplus(uminus(v3033), v3034); + real2 v3035 = minusplus(v3033, v3034); + real2 v3051 = ctimesminusplus(reverse(v3037), tbl[536 + tbloffset], ctimes(v3037, tbl[537 + tbloffset])); + store(out, 63 << outShift, plus(v3031, v3051)); + real2 v3084 = minus(v3031, v3051); + store(out, 127 << outShift, ctimesminusplus(v3084, tbl[0 + tbloffset], ctimes(reverse(v3084), tbl[1 + tbloffset]))); + real2 v3025 = ctimesminusplus(reverse(v3015), tbl[530 + tbloffset], ctimes(v3015, tbl[531 + tbloffset])); + real2 v3045 = ctimesminusplus(reverse(v3035), tbl[534 + tbloffset], ctimes(v3035, tbl[535 + tbloffset])); + store(out, 31 << outShift, plus(v3025, v3045)); + real2 v3078 = minus(v3025, v3045); + store(out, 95 << outShift, ctimesminusplus(v3078, tbl[0 + tbloffset], ctimes(reverse(v3078), tbl[1 + tbloffset]))); + real2 v3058 = plus(v3018, v3019); + real2 v3054 = minus(v3019, v3018); + real2 v3053 = reverse(minus(v3038, v3039)); + real2 v3059 = plus(v3038, v3039); + real2 v3055 = minusplus(v3053, v3054); + store(out, 47 << outShift, ctimesminusplus(reverse(v3055), tbl[538 + tbloffset], ctimes(v3055, tbl[539 + tbloffset]))); + real2 v3057 = minusplus(uminus(v3053), v3054); + store(out, 111 << outShift, ctimesminusplus(reverse(v3057), tbl[540 + tbloffset], ctimes(v3057, tbl[541 + tbloffset]))); + store(out, 15 << outShift, plus(v3058, v3059)); + real2 v3072 = minus(v3058, v3059); + store(out, 79 << outShift, ctimesminusplus(v3072, tbl[0 + tbloffset], ctimes(reverse(v3072), tbl[1 + tbloffset]))); + real2 v683 = ctimesminusplus(reverse(v673), tbl[110 + tbloffset], ctimes(v673, tbl[111 + tbloffset])); + real2 v363 = ctimesminusplus(reverse(v353), tbl[46 + tbloffset], ctimes(v353, tbl[47 + tbloffset])); + real2 v2105 = plus(v363, v683); + real2 v2099 = reverse(minus(v363, v683)); + real2 v283 = ctimesminusplus(reverse(v273), tbl[30 + tbloffset], ctimes(v273, tbl[31 + tbloffset])); + real2 v723 = ctimesminusplus(reverse(v713), tbl[118 + tbloffset], ctimes(v713, tbl[119 + tbloffset])); + real2 v403 = ctimesminusplus(reverse(v393), tbl[54 + tbloffset], ctimes(v393, tbl[55 + tbloffset])); + real2 v603 = ctimesminusplus(reverse(v593), tbl[94 + tbloffset], ctimes(v593, tbl[95 + tbloffset])); + real2 v2180 = minus(v603, v283); + real2 v2184 = plus(v283, v603); + real2 v2145 = plus(v403, v723); + real2 v2139 = reverse(minus(v403, v723)); + real2 v543 = ctimesminusplus(reverse(v533), tbl[82 + tbloffset], ctimes(v533, tbl[83 + tbloffset])); + real2 v383 = ctimesminusplus(reverse(v373), tbl[50 + tbloffset], ctimes(v373, tbl[51 + tbloffset])); + real2 v703 = ctimesminusplus(reverse(v693), tbl[114 + tbloffset], ctimes(v693, tbl[115 + tbloffset])); + real2 v2125 = plus(v383, v703); + real2 v2119 = reverse(minus(v383, v703)); + real2 v223 = ctimesminusplus(reverse(v213), tbl[18 + tbloffset], ctimes(v213, tbl[19 + tbloffset])); + real2 v2120 = minus(v543, v223); + real2 v2124 = plus(v223, v543); + real2 v443 = ctimesminusplus(reverse(v433), tbl[62 + tbloffset], ctimes(v433, tbl[63 + tbloffset])); + real2 v203 = ctimesminusplus(reverse(v193), tbl[14 + tbloffset], ctimes(v193, tbl[15 + tbloffset])); + real2 v763 = ctimesminusplus(reverse(v753), tbl[126 + tbloffset], ctimes(v753, tbl[127 + tbloffset])); + real2 v2179 = reverse(minus(v443, v763)); + real2 v2185 = plus(v443, v763); + real2 v523 = ctimesminusplus(reverse(v513), tbl[78 + tbloffset], ctimes(v513, tbl[79 + tbloffset])); + real2 v2100 = minus(v523, v203); + real2 v2104 = plus(v203, v523); + real2 v2264 = plus(v2104, v2105); + real2 v2260 = minus(v2105, v2104); + real2 v643 = ctimesminusplus(reverse(v633), tbl[102 + tbloffset], ctimes(v633, tbl[103 + tbloffset])); + real2 v2265 = plus(v2184, v2185); + real2 v2259 = reverse(minus(v2184, v2185)); + real2 v563 = ctimesminusplus(reverse(v553), tbl[86 + tbloffset], ctimes(v553, tbl[87 + tbloffset])); + real2 v243 = ctimesminusplus(reverse(v233), tbl[22 + tbloffset], ctimes(v233, tbl[23 + tbloffset])); + real2 v2144 = plus(v243, v563); + real2 v2140 = minus(v563, v243); + real2 v143 = ctimesminusplus(reverse(v133), tbl[2 + tbloffset], ctimes(v133, tbl[3 + tbloffset])); + real2 v183 = ctimesminusplus(reverse(v173), tbl[10 + tbloffset], ctimes(v173, tbl[11 + tbloffset])); + real2 v2084 = plus(v183, v503); + real2 v2080 = minus(v503, v183); + real2 v163 = ctimesminusplus(reverse(v153), tbl[6 + tbloffset], ctimes(v153, tbl[7 + tbloffset])); + real2 v303 = ctimesminusplus(reverse(v293), tbl[34 + tbloffset], ctimes(v293, tbl[35 + tbloffset])); + real2 v623 = ctimesminusplus(reverse(v613), tbl[98 + tbloffset], ctimes(v613, tbl[99 + tbloffset])); + real2 v2039 = reverse(minus(v303, v623)); + real2 v2045 = plus(v303, v623); + real2 v463 = ctimesminusplus(reverse(v453), tbl[66 + tbloffset], ctimes(v453, tbl[67 + tbloffset])); + real2 v2044 = plus(v143, v463); + real2 v2040 = minus(v463, v143); + real2 v2204 = plus(v2044, v2045); + real2 v2200 = minus(v2045, v2044); + real2 v323 = ctimesminusplus(reverse(v313), tbl[38 + tbloffset], ctimes(v313, tbl[39 + tbloffset])); + real2 v2205 = plus(v2124, v2125); + real2 v2199 = reverse(minus(v2124, v2125)); + real2 v2280 = minus(v2205, v2204); + real2 v2284 = plus(v2204, v2205); + real2 v2225 = plus(v2144, v2145); + real2 v2219 = reverse(minus(v2144, v2145)); + real2 v2305 = plus(v2264, v2265); + real2 v2299 = reverse(minus(v2264, v2265)); + real2 v2240 = minus(v2085, v2084); + real2 v2244 = plus(v2084, v2085); + real2 v2279 = reverse(minus(v2244, v2245)); + real2 v2285 = plus(v2244, v2245); + real2 v2281 = minusplus(v2279, v2280); + real2 v2283 = minusplus(uminus(v2279), v2280); + real2 v2291 = ctimesminusplus(reverse(v2281), tbl[406 + tbloffset], ctimes(v2281, tbl[407 + tbloffset])); + real2 v483 = ctimesminusplus(reverse(v473), tbl[70 + tbloffset], ctimes(v473, tbl[71 + tbloffset])); + real2 v2060 = minus(v483, v163); + real2 v2064 = plus(v163, v483); + real2 v2065 = plus(v323, v643); + real2 v2059 = reverse(minus(v323, v643)); + real2 v2220 = minus(v2065, v2064); + real2 v2224 = plus(v2064, v2065); + real2 v2304 = plus(v2224, v2225); + real2 v2300 = minus(v2225, v2224); + real2 v2301 = minusplus(v2299, v2300); + real2 v2303 = minusplus(uminus(v2299), v2300); + real2 v2311 = ctimesminusplus(reverse(v2301), tbl[410 + tbloffset], ctimes(v2301, tbl[411 + tbloffset])); + store(out, 17 << outShift, plus(v2291, v2311)); + real2 v2344 = minus(v2291, v2311); + store(out, 81 << outShift, ctimesminusplus(v2344, tbl[0 + tbloffset], ctimes(reverse(v2344), tbl[1 + tbloffset]))); + real2 v2297 = ctimesminusplus(reverse(v2283), tbl[408 + tbloffset], ctimes(v2283, tbl[409 + tbloffset])); + real2 v2317 = ctimesminusplus(reverse(v2303), tbl[412 + tbloffset], ctimes(v2303, tbl[413 + tbloffset])); + store(out, 49 << outShift, plus(v2297, v2317)); + real2 v2350 = minus(v2297, v2317); + store(out, 113 << outShift, ctimesminusplus(v2350, tbl[0 + tbloffset], ctimes(reverse(v2350), tbl[1 + tbloffset]))); + real2 v2320 = minus(v2285, v2284); + real2 v2324 = plus(v2284, v2285); + real2 v2325 = plus(v2304, v2305); + real2 v2319 = reverse(minus(v2304, v2305)); + store(out, 1 << outShift, plus(v2324, v2325)); + real2 v2338 = minus(v2324, v2325); + store(out, 65 << outShift, ctimesminusplus(v2338, tbl[0 + tbloffset], ctimes(reverse(v2338), tbl[1 + tbloffset]))); + real2 v2321 = minusplus(v2319, v2320); + store(out, 33 << outShift, ctimesminusplus(reverse(v2321), tbl[414 + tbloffset], ctimes(v2321, tbl[415 + tbloffset]))); + real2 v2323 = minusplus(uminus(v2319), v2320); + store(out, 97 << outShift, ctimesminusplus(reverse(v2323), tbl[416 + tbloffset], ctimes(v2323, tbl[417 + tbloffset]))); + real2 v2201 = minusplus(v2199, v2200); + real2 v2203 = minusplus(uminus(v2199), v2200); + real2 v2263 = minusplus(uminus(v2259), v2260); + real2 v2261 = minusplus(v2259, v2260); + real2 v2243 = minusplus(uminus(v2239), v2240); + real2 v2241 = minusplus(v2239, v2240); + real2 v2257 = ctimesminusplus(reverse(v2243), tbl[400 + tbloffset], ctimes(v2243, tbl[401 + tbloffset])); + real2 v2217 = ctimesminusplus(reverse(v2203), tbl[392 + tbloffset], ctimes(v2203, tbl[393 + tbloffset])); + real2 v2388 = plus(v2217, v2257); + real2 v2384 = minus(v2257, v2217); + real2 v2277 = ctimesminusplus(reverse(v2263), tbl[404 + tbloffset], ctimes(v2263, tbl[405 + tbloffset])); + real2 v2221 = minusplus(v2219, v2220); + real2 v2223 = minusplus(uminus(v2219), v2220); + real2 v2237 = ctimesminusplus(reverse(v2223), tbl[396 + tbloffset], ctimes(v2223, tbl[397 + tbloffset])); + real2 v2389 = plus(v2237, v2277); + real2 v2383 = reverse(minus(v2237, v2277)); + store(out, 25 << outShift, plus(v2388, v2389)); + real2 v2402 = minus(v2388, v2389); + store(out, 89 << outShift, ctimesminusplus(v2402, tbl[0 + tbloffset], ctimes(reverse(v2402), tbl[1 + tbloffset]))); + real2 v2385 = minusplus(v2383, v2384); + real2 v2387 = minusplus(uminus(v2383), v2384); + store(out, 121 << outShift, ctimesminusplus(reverse(v2387), tbl[424 + tbloffset], ctimes(v2387, tbl[425 + tbloffset]))); + store(out, 57 << outShift, ctimesminusplus(reverse(v2385), tbl[422 + tbloffset], ctimes(v2385, tbl[423 + tbloffset]))); + real2 v2251 = ctimesminusplus(reverse(v2241), tbl[398 + tbloffset], ctimes(v2241, tbl[399 + tbloffset])); + real2 v2211 = ctimesminusplus(reverse(v2201), tbl[390 + tbloffset], ctimes(v2201, tbl[391 + tbloffset])); + real2 v2358 = minus(v2251, v2211); + real2 v2362 = plus(v2211, v2251); + real2 v2271 = ctimesminusplus(reverse(v2261), tbl[402 + tbloffset], ctimes(v2261, tbl[403 + tbloffset])); + real2 v2231 = ctimesminusplus(reverse(v2221), tbl[394 + tbloffset], ctimes(v2221, tbl[395 + tbloffset])); + real2 v2357 = reverse(minus(v2231, v2271)); + real2 v2363 = plus(v2231, v2271); + store(out, 9 << outShift, plus(v2362, v2363)); + real2 v2376 = minus(v2362, v2363); + store(out, 73 << outShift, ctimesminusplus(v2376, tbl[0 + tbloffset], ctimes(reverse(v2376), tbl[1 + tbloffset]))); + real2 v2361 = minusplus(uminus(v2357), v2358); + store(out, 105 << outShift, ctimesminusplus(reverse(v2361), tbl[420 + tbloffset], ctimes(v2361, tbl[421 + tbloffset]))); + real2 v2359 = minusplus(v2357, v2358); + store(out, 41 << outShift, ctimesminusplus(reverse(v2359), tbl[418 + tbloffset], ctimes(v2359, tbl[419 + tbloffset]))); + real2 v2121 = minusplus(v2119, v2120); + real2 v2123 = minusplus(uminus(v2119), v2120); + real2 v2083 = minusplus(uminus(v2079), v2080); + real2 v2081 = minusplus(v2079, v2080); + real2 v2091 = ctimesminusplus(reverse(v2081), tbl[366 + tbloffset], ctimes(v2081, tbl[367 + tbloffset])); + real2 v2043 = minusplus(uminus(v2039), v2040); + real2 v2041 = minusplus(v2039, v2040); + real2 v2051 = ctimesminusplus(reverse(v2041), tbl[358 + tbloffset], ctimes(v2041, tbl[359 + tbloffset])); + real2 v2131 = ctimesminusplus(reverse(v2121), tbl[374 + tbloffset], ctimes(v2121, tbl[375 + tbloffset])); + real2 v2163 = minusplus(uminus(v2159), v2160); + real2 v2161 = minusplus(v2159, v2160); + real2 v2171 = ctimesminusplus(reverse(v2161), tbl[382 + tbloffset], ctimes(v2161, tbl[383 + tbloffset])); + real2 v2409 = reverse(minus(v2091, v2171)); + real2 v2415 = plus(v2091, v2171); + real2 v2410 = minus(v2131, v2051); + real2 v2414 = plus(v2051, v2131); + real2 v2454 = plus(v2414, v2415); + real2 v2450 = minus(v2415, v2414); + real2 v2181 = minusplus(v2179, v2180); + real2 v2183 = minusplus(uminus(v2179), v2180); + real2 v2191 = ctimesminusplus(reverse(v2181), tbl[386 + tbloffset], ctimes(v2181, tbl[387 + tbloffset])); + real2 v2103 = minusplus(uminus(v2099), v2100); + real2 v2101 = minusplus(v2099, v2100); + real2 v2111 = ctimesminusplus(reverse(v2101), tbl[370 + tbloffset], ctimes(v2101, tbl[371 + tbloffset])); + real2 v2435 = plus(v2111, v2191); + real2 v2429 = reverse(minus(v2111, v2191)); + real2 v2141 = minusplus(v2139, v2140); + real2 v2143 = minusplus(uminus(v2139), v2140); + real2 v2151 = ctimesminusplus(reverse(v2141), tbl[378 + tbloffset], ctimes(v2141, tbl[379 + tbloffset])); + real2 v2063 = minusplus(uminus(v2059), v2060); + real2 v2061 = minusplus(v2059, v2060); + real2 v2071 = ctimesminusplus(reverse(v2061), tbl[362 + tbloffset], ctimes(v2061, tbl[363 + tbloffset])); + real2 v2434 = plus(v2071, v2151); + real2 v2430 = minus(v2151, v2071); + real2 v2455 = plus(v2434, v2435); + real2 v2449 = reverse(minus(v2434, v2435)); + store(out, 5 << outShift, plus(v2454, v2455)); + real2 v2468 = minus(v2454, v2455); + store(out, 69 << outShift, ctimesminusplus(v2468, tbl[0 + tbloffset], ctimes(reverse(v2468), tbl[1 + tbloffset]))); + real2 v2451 = minusplus(v2449, v2450); + real2 v2453 = minusplus(uminus(v2449), v2450); + store(out, 101 << outShift, ctimesminusplus(reverse(v2453), tbl[436 + tbloffset], ctimes(v2453, tbl[437 + tbloffset]))); + store(out, 37 << outShift, ctimesminusplus(reverse(v2451), tbl[434 + tbloffset], ctimes(v2451, tbl[435 + tbloffset]))); + real2 v2411 = minusplus(v2409, v2410); + real2 v2413 = minusplus(uminus(v2409), v2410); + real2 v2433 = minusplus(uminus(v2429), v2430); + real2 v2431 = minusplus(v2429, v2430); + real2 v2421 = ctimesminusplus(reverse(v2411), tbl[426 + tbloffset], ctimes(v2411, tbl[427 + tbloffset])); + real2 v2441 = ctimesminusplus(reverse(v2431), tbl[430 + tbloffset], ctimes(v2431, tbl[431 + tbloffset])); + store(out, 21 << outShift, plus(v2421, v2441)); + real2 v2474 = minus(v2421, v2441); + store(out, 85 << outShift, ctimesminusplus(v2474, tbl[0 + tbloffset], ctimes(reverse(v2474), tbl[1 + tbloffset]))); + real2 v2427 = ctimesminusplus(reverse(v2413), tbl[428 + tbloffset], ctimes(v2413, tbl[429 + tbloffset])); + real2 v2447 = ctimesminusplus(reverse(v2433), tbl[432 + tbloffset], ctimes(v2433, tbl[433 + tbloffset])); + store(out, 53 << outShift, plus(v2427, v2447)); + real2 v2480 = minus(v2427, v2447); + store(out, 117 << outShift, ctimesminusplus(v2480, tbl[0 + tbloffset], ctimes(reverse(v2480), tbl[1 + tbloffset]))); + real2 v2057 = ctimesminusplus(reverse(v2043), tbl[360 + tbloffset], ctimes(v2043, tbl[361 + tbloffset])); + real2 v2097 = ctimesminusplus(reverse(v2083), tbl[368 + tbloffset], ctimes(v2083, tbl[369 + tbloffset])); + real2 v2157 = ctimesminusplus(reverse(v2143), tbl[380 + tbloffset], ctimes(v2143, tbl[381 + tbloffset])); + real2 v2197 = ctimesminusplus(reverse(v2183), tbl[388 + tbloffset], ctimes(v2183, tbl[389 + tbloffset])); + real2 v2117 = ctimesminusplus(reverse(v2103), tbl[372 + tbloffset], ctimes(v2103, tbl[373 + tbloffset])); + real2 v2507 = reverse(minus(v2117, v2197)); + real2 v2513 = plus(v2117, v2197); + real2 v2137 = ctimesminusplus(reverse(v2123), tbl[376 + tbloffset], ctimes(v2123, tbl[377 + tbloffset])); + real2 v2488 = minus(v2137, v2057); + real2 v2492 = plus(v2057, v2137); + real2 v2177 = ctimesminusplus(reverse(v2163), tbl[384 + tbloffset], ctimes(v2163, tbl[385 + tbloffset])); + real2 v2493 = plus(v2097, v2177); + real2 v2487 = reverse(minus(v2097, v2177)); + real2 v2532 = plus(v2492, v2493); + real2 v2528 = minus(v2493, v2492); + real2 v2077 = ctimesminusplus(reverse(v2063), tbl[364 + tbloffset], ctimes(v2063, tbl[365 + tbloffset])); + real2 v2512 = plus(v2077, v2157); + real2 v2508 = minus(v2157, v2077); + real2 v2527 = reverse(minus(v2512, v2513)); + real2 v2533 = plus(v2512, v2513); + real2 v2529 = minusplus(v2527, v2528); + real2 v2531 = minusplus(uminus(v2527), v2528); + store(out, 109 << outShift, ctimesminusplus(reverse(v2531), tbl[448 + tbloffset], ctimes(v2531, tbl[449 + tbloffset]))); + store(out, 45 << outShift, ctimesminusplus(reverse(v2529), tbl[446 + tbloffset], ctimes(v2529, tbl[447 + tbloffset]))); + store(out, 13 << outShift, plus(v2532, v2533)); + real2 v2546 = minus(v2532, v2533); + store(out, 77 << outShift, ctimesminusplus(v2546, tbl[0 + tbloffset], ctimes(reverse(v2546), tbl[1 + tbloffset]))); + real2 v2509 = minusplus(v2507, v2508); + real2 v2511 = minusplus(uminus(v2507), v2508); + real2 v2491 = minusplus(uminus(v2487), v2488); + real2 v2489 = minusplus(v2487, v2488); + real2 v2499 = ctimesminusplus(reverse(v2489), tbl[438 + tbloffset], ctimes(v2489, tbl[439 + tbloffset])); + real2 v2519 = ctimesminusplus(reverse(v2509), tbl[442 + tbloffset], ctimes(v2509, tbl[443 + tbloffset])); + store(out, 29 << outShift, plus(v2499, v2519)); + real2 v2552 = minus(v2499, v2519); + store(out, 93 << outShift, ctimesminusplus(v2552, tbl[0 + tbloffset], ctimes(reverse(v2552), tbl[1 + tbloffset]))); + real2 v2505 = ctimesminusplus(reverse(v2491), tbl[440 + tbloffset], ctimes(v2491, tbl[441 + tbloffset])); + real2 v2525 = ctimesminusplus(reverse(v2511), tbl[444 + tbloffset], ctimes(v2511, tbl[445 + tbloffset])); + store(out, 61 << outShift, plus(v2505, v2525)); + real2 v2558 = minus(v2505, v2525); + store(out, 125 << outShift, ctimesminusplus(v2558, tbl[0 + tbloffset], ctimes(reverse(v2558), tbl[1 + tbloffset]))); +// Pres : 76263 + } +} + +ALIGNED(8192) void but128b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const int outShift, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * (i0 >> outShift); + +// Pres : 148586 + real2 v56 = load(in, 54 << inShift); + real2 v120 = load(in, 118 << inShift); + real2 v571 = reverse(minus(v120, v56)); + real2 v577 = plus(v56, v120); + real2 v24 = load(in, 22 << inShift); + real2 v88 = load(in, 86 << inShift); + real2 v576 = plus(v24, v88); + real2 v572 = minus(v88, v24); + real2 v573 = minusplus(v571, v572); + real2 v575 = minusplus(uminus(v571), v572); + real2 v589 = ctimesminusplus(reverse(v575), tbl[92 + tbloffset], ctimes(v575, tbl[93 + tbloffset])); + real2 v583 = ctimesminusplus(reverse(v573), tbl[90 + tbloffset], ctimes(v573, tbl[91 + tbloffset])); + real2 v897 = plus(v576, v577); + real2 v891 = reverse(minus(v577, v576)); + real2 v8 = load(in, 6 << inShift); + real2 v72 = load(in, 70 << inShift); + real2 v252 = minus(v72, v8); + real2 v256 = plus(v8, v72); + real2 v104 = load(in, 102 << inShift); + real2 v40 = load(in, 38 << inShift); + real2 v251 = reverse(minus(v104, v40)); + real2 v257 = plus(v40, v104); + real2 v255 = minusplus(uminus(v251), v252); + real2 v253 = minusplus(v251, v252); + real2 v263 = ctimesminusplus(reverse(v253), tbl[26 + tbloffset], ctimes(v253, tbl[27 + tbloffset])); + real2 v896 = plus(v256, v257); + real2 v892 = minus(v257, v256); + real2 v895 = minusplus(uminus(v891), v892); + real2 v893 = minusplus(v891, v892); + real2 v909 = ctimesminusplus(reverse(v895), tbl[156 + tbloffset], ctimes(v895, tbl[157 + tbloffset])); + real2 v903 = ctimesminusplus(reverse(v893), tbl[154 + tbloffset], ctimes(v893, tbl[155 + tbloffset])); + real2 v269 = ctimesminusplus(reverse(v255), tbl[28 + tbloffset], ctimes(v255, tbl[29 + tbloffset])); + real2 v1216 = plus(v896, v897); + real2 v1212 = minus(v897, v896); + real2 v2160 = minus(v583, v263); + real2 v2164 = plus(v263, v583); + real2 v2686 = minus(v589, v269); + real2 v2690 = plus(v269, v589); + real2 v96 = load(in, 94 << inShift); + real2 v32 = load(in, 30 << inShift); + real2 v736 = plus(v32, v96); + real2 v732 = minus(v96, v32); + real2 v64 = load(in, 62 << inShift); + real2 v128 = load(in, 126 << inShift); + real2 v737 = plus(v64, v128); + real2 v731 = reverse(minus(v128, v64)); + real2 v1057 = plus(v736, v737); + real2 v1051 = reverse(minus(v737, v736)); + real2 v733 = minusplus(v731, v732); + real2 v735 = minusplus(uminus(v731), v732); + real2 v749 = ctimesminusplus(reverse(v735), tbl[124 + tbloffset], ctimes(v735, tbl[125 + tbloffset])); + real2 v743 = ctimesminusplus(reverse(v733), tbl[122 + tbloffset], ctimes(v733, tbl[123 + tbloffset])); + real2 v16 = load(in, 14 << inShift); + real2 v80 = load(in, 78 << inShift); + real2 v412 = minus(v80, v16); + real2 v416 = plus(v16, v80); + real2 v112 = load(in, 110 << inShift); + real2 v48 = load(in, 46 << inShift); + real2 v417 = plus(v48, v112); + real2 v411 = reverse(minus(v112, v48)); + real2 v1056 = plus(v416, v417); + real2 v1052 = minus(v417, v416); + real2 v1055 = minusplus(uminus(v1051), v1052); + real2 v1053 = minusplus(v1051, v1052); + real2 v1063 = ctimesminusplus(reverse(v1053), tbl[186 + tbloffset], ctimes(v1053, tbl[187 + tbloffset])); + real2 v1665 = plus(v903, v1063); + real2 v1659 = reverse(minus(v1063, v903)); + real2 v1069 = ctimesminusplus(reverse(v1055), tbl[188 + tbloffset], ctimes(v1055, tbl[189 + tbloffset])); + real2 v1869 = reverse(minus(v1069, v909)); + real2 v1875 = plus(v909, v1069); + real2 v413 = minusplus(v411, v412); + real2 v415 = minusplus(uminus(v411), v412); + real2 v429 = ctimesminusplus(reverse(v415), tbl[60 + tbloffset], ctimes(v415, tbl[61 + tbloffset])); + real2 v1217 = plus(v1056, v1057); + real2 v1211 = reverse(minus(v1057, v1056)); + real2 v1297 = plus(v1216, v1217); + real2 v1291 = reverse(minus(v1217, v1216)); + real2 v2691 = plus(v429, v749); + real2 v2685 = reverse(minus(v749, v429)); + real2 v2765 = reverse(minus(v2691, v2690)); + real2 v2771 = plus(v2690, v2691); + real2 v2689 = minusplus(uminus(v2685), v2686); + real2 v2687 = minusplus(v2685, v2686); + real2 v2703 = ctimesminusplus(reverse(v2689), tbl[476 + tbloffset], ctimes(v2689, tbl[477 + tbloffset])); + real2 v2697 = ctimesminusplus(reverse(v2687), tbl[474 + tbloffset], ctimes(v2687, tbl[475 + tbloffset])); + real2 v1215 = minusplus(uminus(v1211), v1212); + real2 v1213 = minusplus(v1211, v1212); + real2 v1223 = ctimesminusplus(reverse(v1213), tbl[218 + tbloffset], ctimes(v1213, tbl[219 + tbloffset])); + real2 v1229 = ctimesminusplus(reverse(v1215), tbl[220 + tbloffset], ctimes(v1215, tbl[221 + tbloffset])); + real2 v423 = ctimesminusplus(reverse(v413), tbl[58 + tbloffset], ctimes(v413, tbl[59 + tbloffset])); + real2 v2165 = plus(v423, v743); + real2 v2159 = reverse(minus(v743, v423)); + real2 v2245 = plus(v2164, v2165); + real2 v2239 = reverse(minus(v2165, v2164)); + real2 v44 = load(in, 42 << inShift); + real2 v108 = load(in, 106 << inShift); + real2 v331 = reverse(minus(v108, v44)); + real2 v337 = plus(v44, v108); + real2 v76 = load(in, 74 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v336 = plus(v12, v76); + real2 v332 = minus(v76, v12); + real2 v976 = plus(v336, v337); + real2 v972 = minus(v337, v336); + real2 v335 = minusplus(uminus(v331), v332); + real2 v333 = minusplus(v331, v332); + real2 v343 = ctimesminusplus(reverse(v333), tbl[42 + tbloffset], ctimes(v333, tbl[43 + tbloffset])); + real2 v349 = ctimesminusplus(reverse(v335), tbl[44 + tbloffset], ctimes(v335, tbl[45 + tbloffset])); + real2 v124 = load(in, 122 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v651 = reverse(minus(v124, v60)); + real2 v657 = plus(v60, v124); + real2 v28 = load(in, 26 << inShift); + real2 v92 = load(in, 90 << inShift); + real2 v652 = minus(v92, v28); + real2 v656 = plus(v28, v92); + real2 v977 = plus(v656, v657); + real2 v971 = reverse(minus(v657, v656)); + real2 v973 = minusplus(v971, v972); + real2 v975 = minusplus(uminus(v971), v972); + real2 v983 = ctimesminusplus(reverse(v973), tbl[170 + tbloffset], ctimes(v973, tbl[171 + tbloffset])); + real2 v1131 = reverse(minus(v977, v976)); + real2 v1137 = plus(v976, v977); + real2 v655 = minusplus(uminus(v651), v652); + real2 v653 = minusplus(v651, v652); + real2 v669 = ctimesminusplus(reverse(v655), tbl[108 + tbloffset], ctimes(v655, tbl[109 + tbloffset])); + real2 v663 = ctimesminusplus(reverse(v653), tbl[106 + tbloffset], ctimes(v653, tbl[107 + tbloffset])); + real2 v2079 = reverse(minus(v663, v343)); + real2 v2085 = plus(v343, v663); + real2 v2605 = reverse(minus(v669, v349)); + real2 v2611 = plus(v349, v669); + real2 v989 = ctimesminusplus(reverse(v975), tbl[172 + tbloffset], ctimes(v975, tbl[173 + tbloffset])); + real2 v20 = load(in, 18 << inShift); + real2 v84 = load(in, 82 << inShift); + real2 v496 = plus(v20, v84); + real2 v492 = minus(v84, v20); + real2 v52 = load(in, 50 << inShift); + real2 v116 = load(in, 114 << inShift); + real2 v491 = reverse(minus(v116, v52)); + real2 v497 = plus(v52, v116); + real2 v817 = plus(v496, v497); + real2 v811 = reverse(minus(v497, v496)); + real2 v493 = minusplus(v491, v492); + real2 v495 = minusplus(uminus(v491), v492); + real2 v509 = ctimesminusplus(reverse(v495), tbl[76 + tbloffset], ctimes(v495, tbl[77 + tbloffset])); + real2 v503 = ctimesminusplus(reverse(v493), tbl[74 + tbloffset], ctimes(v493, tbl[75 + tbloffset])); + real2 v36 = load(in, 34 << inShift); + real2 v100 = load(in, 98 << inShift); + real2 v171 = reverse(minus(v100, v36)); + real2 v177 = plus(v36, v100); + real2 v68 = load(in, 66 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v176 = plus(v4, v68); + real2 v172 = minus(v68, v4); + real2 v816 = plus(v176, v177); + real2 v812 = minus(v177, v176); + real2 v1136 = plus(v816, v817); + real2 v1132 = minus(v817, v816); + real2 v1133 = minusplus(v1131, v1132); + real2 v1135 = minusplus(uminus(v1131), v1132); + real2 v1149 = ctimesminusplus(reverse(v1135), tbl[204 + tbloffset], ctimes(v1135, tbl[205 + tbloffset])); + real2 v1296 = plus(v1136, v1137); + real2 v1292 = minus(v1137, v1136); + real2 v1295 = minusplus(uminus(v1291), v1292); + real2 v1293 = minusplus(v1291, v1292); + real2 v1303 = ctimesminusplus(reverse(v1293), tbl[234 + tbloffset], ctimes(v1293, tbl[235 + tbloffset])); + real2 v1331 = reverse(minus(v1297, v1296)); + real2 v1337 = plus(v1296, v1297); + real2 v173 = minusplus(v171, v172); + real2 v175 = minusplus(uminus(v171), v172); + real2 v189 = ctimesminusplus(reverse(v175), tbl[12 + tbloffset], ctimes(v175, tbl[13 + tbloffset])); + real2 v1309 = ctimesminusplus(reverse(v1295), tbl[236 + tbloffset], ctimes(v1295, tbl[237 + tbloffset])); + real2 v815 = minusplus(uminus(v811), v812); + real2 v813 = minusplus(v811, v812); + real2 v1143 = ctimesminusplus(reverse(v1133), tbl[202 + tbloffset], ctimes(v1133, tbl[203 + tbloffset])); + real2 v1541 = reverse(minus(v1229, v1149)); + real2 v1547 = plus(v1149, v1229); + real2 v2610 = plus(v189, v509); + real2 v2606 = minus(v509, v189); + real2 v2770 = plus(v2610, v2611); + real2 v2766 = minus(v2611, v2610); + real2 v823 = ctimesminusplus(reverse(v813), tbl[138 + tbloffset], ctimes(v813, tbl[139 + tbloffset])); + real2 v829 = ctimesminusplus(reverse(v815), tbl[140 + tbloffset], ctimes(v815, tbl[141 + tbloffset])); + real2 v2811 = plus(v2770, v2771); + real2 v2805 = reverse(minus(v2771, v2770)); + real2 v2767 = minusplus(v2765, v2766); + real2 v2769 = minusplus(uminus(v2765), v2766); + real2 v2607 = minusplus(v2605, v2606); + real2 v2609 = minusplus(uminus(v2605), v2606); + real2 v2617 = ctimesminusplus(reverse(v2607), tbl[458 + tbloffset], ctimes(v2607, tbl[459 + tbloffset])); + real2 v2623 = ctimesminusplus(reverse(v2609), tbl[460 + tbloffset], ctimes(v2609, tbl[461 + tbloffset])); + real2 v3013 = reverse(minus(v2703, v2623)); + real2 v3019 = plus(v2623, v2703); + real2 v2783 = ctimesminusplus(reverse(v2769), tbl[492 + tbloffset], ctimes(v2769, tbl[493 + tbloffset])); + real2 v2941 = plus(v2617, v2697); + real2 v2935 = reverse(minus(v2697, v2617)); + real2 v2777 = ctimesminusplus(reverse(v2767), tbl[490 + tbloffset], ctimes(v2767, tbl[491 + tbloffset])); + real2 v1660 = minus(v983, v823); + real2 v1664 = plus(v823, v983); + real2 v1874 = plus(v829, v989); + real2 v1870 = minus(v989, v829); + real2 v1909 = reverse(minus(v1875, v1874)); + real2 v1915 = plus(v1874, v1875); + real2 v1663 = minusplus(uminus(v1659), v1660); + real2 v1661 = minusplus(v1659, v1660); + real2 v1677 = ctimesminusplus(reverse(v1663), tbl[296 + tbloffset], ctimes(v1663, tbl[297 + tbloffset])); + real2 v1873 = minusplus(uminus(v1869), v1870); + real2 v1871 = minusplus(v1869, v1870); + real2 v1887 = ctimesminusplus(reverse(v1873), tbl[332 + tbloffset], ctimes(v1873, tbl[333 + tbloffset])); + real2 v1705 = plus(v1664, v1665); + real2 v1699 = reverse(minus(v1665, v1664)); + real2 v1671 = ctimesminusplus(reverse(v1661), tbl[294 + tbloffset], ctimes(v1661, tbl[295 + tbloffset])); + real2 v1881 = ctimesminusplus(reverse(v1871), tbl[330 + tbloffset], ctimes(v1871, tbl[331 + tbloffset])); + real2 v1469 = plus(v1143, v1223); + real2 v1463 = reverse(minus(v1223, v1143)); + real2 v54 = load(in, 52 << inShift); + real2 v118 = load(in, 116 << inShift); + real2 v537 = plus(v54, v118); + real2 v531 = reverse(minus(v118, v54)); + real2 v86 = load(in, 84 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v536 = plus(v22, v86); + real2 v532 = minus(v86, v22); + real2 v851 = reverse(minus(v537, v536)); + real2 v857 = plus(v536, v537); + real2 v533 = minusplus(v531, v532); + real2 v535 = minusplus(uminus(v531), v532); + real2 v549 = ctimesminusplus(reverse(v535), tbl[84 + tbloffset], ctimes(v535, tbl[85 + tbloffset])); + real2 v102 = load(in, 100 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v217 = plus(v38, v102); + real2 v211 = reverse(minus(v102, v38)); + real2 v70 = load(in, 68 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v216 = plus(v6, v70); + real2 v212 = minus(v70, v6); + real2 v213 = minusplus(v211, v212); + real2 v215 = minusplus(uminus(v211), v212); + real2 v229 = ctimesminusplus(reverse(v215), tbl[20 + tbloffset], ctimes(v215, tbl[21 + tbloffset])); + real2 v2646 = minus(v549, v229); + real2 v2650 = plus(v229, v549); + real2 v856 = plus(v216, v217); + real2 v852 = minus(v217, v216); + real2 v853 = minusplus(v851, v852); + real2 v855 = minusplus(uminus(v851), v852); + real2 v863 = ctimesminusplus(reverse(v853), tbl[146 + tbloffset], ctimes(v853, tbl[147 + tbloffset])); + real2 v869 = ctimesminusplus(reverse(v855), tbl[148 + tbloffset], ctimes(v855, tbl[149 + tbloffset])); + real2 v1176 = plus(v856, v857); + real2 v1172 = minus(v857, v856); + real2 v110 = load(in, 108 << inShift); + real2 v46 = load(in, 44 << inShift); + real2 v377 = plus(v46, v110); + real2 v371 = reverse(minus(v110, v46)); + real2 v78 = load(in, 76 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v372 = minus(v78, v14); + real2 v376 = plus(v14, v78); + real2 v1012 = minus(v377, v376); + real2 v1016 = plus(v376, v377); + real2 v373 = minusplus(v371, v372); + real2 v375 = minusplus(uminus(v371), v372); + real2 v389 = ctimesminusplus(reverse(v375), tbl[52 + tbloffset], ctimes(v375, tbl[53 + tbloffset])); + real2 v30 = load(in, 28 << inShift); + real2 v94 = load(in, 92 << inShift); + real2 v696 = plus(v30, v94); + real2 v692 = minus(v94, v30); + real2 v62 = load(in, 60 << inShift); + real2 v126 = load(in, 124 << inShift); + real2 v697 = plus(v62, v126); + real2 v691 = reverse(minus(v126, v62)); + real2 v1017 = plus(v696, v697); + real2 v1011 = reverse(minus(v697, v696)); + real2 v1171 = reverse(minus(v1017, v1016)); + real2 v1177 = plus(v1016, v1017); + real2 v1013 = minusplus(v1011, v1012); + real2 v1015 = minusplus(uminus(v1011), v1012); + real2 v1175 = minusplus(uminus(v1171), v1172); + real2 v1173 = minusplus(v1171, v1172); + real2 v1183 = ctimesminusplus(reverse(v1173), tbl[210 + tbloffset], ctimes(v1173, tbl[211 + tbloffset])); + real2 v1189 = ctimesminusplus(reverse(v1175), tbl[212 + tbloffset], ctimes(v1175, tbl[213 + tbloffset])); + real2 v1029 = ctimesminusplus(reverse(v1015), tbl[180 + tbloffset], ctimes(v1015, tbl[181 + tbloffset])); + real2 v1023 = ctimesminusplus(reverse(v1013), tbl[178 + tbloffset], ctimes(v1013, tbl[179 + tbloffset])); + real2 v1625 = plus(v863, v1023); + real2 v1619 = reverse(minus(v1023, v863)); + real2 v1835 = plus(v869, v1029); + real2 v1829 = reverse(minus(v1029, v869)); + real2 v693 = minusplus(v691, v692); + real2 v695 = minusplus(uminus(v691), v692); + real2 v709 = ctimesminusplus(reverse(v695), tbl[116 + tbloffset], ctimes(v695, tbl[117 + tbloffset])); + real2 v2645 = reverse(minus(v709, v389)); + real2 v2651 = plus(v389, v709); + real2 v1257 = plus(v1176, v1177); + real2 v1251 = reverse(minus(v1177, v1176)); + real2 v2731 = plus(v2650, v2651); + real2 v2725 = reverse(minus(v2651, v2650)); + real2 v114 = load(in, 112 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v457 = plus(v50, v114); + real2 v451 = reverse(minus(v114, v50)); + real2 v18 = load(in, 16 << inShift); + real2 v82 = load(in, 80 << inShift); + real2 v456 = plus(v18, v82); + real2 v452 = minus(v82, v18); + real2 v771 = reverse(minus(v457, v456)); + real2 v777 = plus(v456, v457); + real2 v453 = minusplus(v451, v452); + real2 v455 = minusplus(uminus(v451), v452); + real2 v469 = ctimesminusplus(reverse(v455), tbl[68 + tbloffset], ctimes(v455, tbl[69 + tbloffset])); + real2 v66 = load(in, 64 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v131 = reverse(minus(v98, v34)); + real2 v137 = plus(v34, v98); + real2 v133 = minusplus(v131, v132); + real2 v135 = minusplus(uminus(v131), v132); + real2 v149 = ctimesminusplus(reverse(v135), tbl[4 + tbloffset], ctimes(v135, tbl[5 + tbloffset])); + real2 v2566 = minus(v469, v149); + real2 v2570 = plus(v149, v469); + real2 v772 = minus(v137, v136); + real2 v776 = plus(v136, v137); + real2 v1092 = minus(v777, v776); + real2 v1096 = plus(v776, v777); + real2 v773 = minusplus(v771, v772); + real2 v775 = minusplus(uminus(v771), v772); + real2 v783 = ctimesminusplus(reverse(v773), tbl[130 + tbloffset], ctimes(v773, tbl[131 + tbloffset])); + real2 v789 = ctimesminusplus(reverse(v775), tbl[132 + tbloffset], ctimes(v775, tbl[133 + tbloffset])); + real2 v74 = load(in, 72 << inShift); + real2 v10 = load(in, 8 << inShift); + real2 v296 = plus(v10, v74); + real2 v292 = minus(v74, v10); + real2 v42 = load(in, 40 << inShift); + real2 v106 = load(in, 104 << inShift); + real2 v291 = reverse(minus(v106, v42)); + real2 v297 = plus(v42, v106); + real2 v293 = minusplus(v291, v292); + real2 v295 = minusplus(uminus(v291), v292); + real2 v309 = ctimesminusplus(reverse(v295), tbl[36 + tbloffset], ctimes(v295, tbl[37 + tbloffset])); + real2 v932 = minus(v297, v296); + real2 v936 = plus(v296, v297); + real2 v122 = load(in, 120 << inShift); + real2 v58 = load(in, 56 << inShift); + real2 v617 = plus(v58, v122); + real2 v611 = reverse(minus(v122, v58)); + real2 v26 = load(in, 24 << inShift); + real2 v90 = load(in, 88 << inShift); + real2 v612 = minus(v90, v26); + real2 v616 = plus(v26, v90); + real2 v937 = plus(v616, v617); + real2 v931 = reverse(minus(v617, v616)); + real2 v1091 = reverse(minus(v937, v936)); + real2 v1097 = plus(v936, v937); + real2 v933 = minusplus(v931, v932); + real2 v935 = minusplus(uminus(v931), v932); + real2 v1093 = minusplus(v1091, v1092); + real2 v1095 = minusplus(uminus(v1091), v1092); + real2 v1103 = ctimesminusplus(reverse(v1093), tbl[194 + tbloffset], ctimes(v1093, tbl[195 + tbloffset])); + real2 v1468 = plus(v1103, v1183); + real2 v1464 = minus(v1183, v1103); + real2 v1508 = plus(v1468, v1469); + real2 v1504 = minus(v1469, v1468); + real2 v1252 = minus(v1097, v1096); + real2 v1256 = plus(v1096, v1097); + real2 v1336 = plus(v1256, v1257); + real2 v1332 = minus(v1257, v1256); + real2 v1335 = minusplus(uminus(v1331), v1332); + real2 v1333 = minusplus(v1331, v1332); + real2 v1343 = ctimesminusplus(reverse(v1333), tbl[242 + tbloffset], ctimes(v1333, tbl[243 + tbloffset])); + real2 v1349 = ctimesminusplus(reverse(v1335), tbl[244 + tbloffset], ctimes(v1335, tbl[245 + tbloffset])); + real2 v1376 = plus(v1336, v1337); + real2 v1372 = minus(v1337, v1336); + real2 v1465 = minusplus(v1463, v1464); + real2 v1467 = minusplus(uminus(v1463), v1464); + real2 v1255 = minusplus(uminus(v1251), v1252); + real2 v1253 = minusplus(v1251, v1252); + real2 v1481 = ctimesminusplus(reverse(v1467), tbl[264 + tbloffset], ctimes(v1467, tbl[265 + tbloffset])); + real2 v1475 = ctimesminusplus(reverse(v1465), tbl[262 + tbloffset], ctimes(v1465, tbl[263 + tbloffset])); + real2 v1109 = ctimesminusplus(reverse(v1095), tbl[196 + tbloffset], ctimes(v1095, tbl[197 + tbloffset])); + real2 v1542 = minus(v1189, v1109); + real2 v1546 = plus(v1109, v1189); + real2 v1545 = minusplus(uminus(v1541), v1542); + real2 v1543 = minusplus(v1541, v1542); + real2 v1553 = ctimesminusplus(reverse(v1543), tbl[274 + tbloffset], ctimes(v1543, tbl[275 + tbloffset])); + real2 v1559 = ctimesminusplus(reverse(v1545), tbl[276 + tbloffset], ctimes(v1545, tbl[277 + tbloffset])); + real2 v1582 = minus(v1547, v1546); + real2 v1586 = plus(v1546, v1547); + real2 v1269 = ctimesminusplus(reverse(v1255), tbl[228 + tbloffset], ctimes(v1255, tbl[229 + tbloffset])); + real2 v1438 = minus(v1309, v1269); + real2 v1442 = plus(v1269, v1309); + real2 v1263 = ctimesminusplus(reverse(v1253), tbl[226 + tbloffset], ctimes(v1253, tbl[227 + tbloffset])); + real2 v943 = ctimesminusplus(reverse(v933), tbl[162 + tbloffset], ctimes(v933, tbl[163 + tbloffset])); + real2 v1624 = plus(v783, v943); + real2 v1620 = minus(v943, v783); + real2 v1623 = minusplus(uminus(v1619), v1620); + real2 v1621 = minusplus(v1619, v1620); + real2 v1700 = minus(v1625, v1624); + real2 v1704 = plus(v1624, v1625); + real2 v1631 = ctimesminusplus(reverse(v1621), tbl[286 + tbloffset], ctimes(v1621, tbl[287 + tbloffset])); + real2 v949 = ctimesminusplus(reverse(v935), tbl[164 + tbloffset], ctimes(v935, tbl[165 + tbloffset])); + real2 v1830 = minus(v949, v789); + real2 v1834 = plus(v789, v949); + real2 v1782 = plus(v1631, v1671); + real2 v1778 = minus(v1671, v1631); + real2 v1910 = minus(v1835, v1834); + real2 v1914 = plus(v1834, v1835); + real2 v1950 = minus(v1915, v1914); + real2 v1954 = plus(v1914, v1915); + real2 v1913 = minusplus(uminus(v1909), v1910); + real2 v1911 = minusplus(v1909, v1910); + real2 v613 = minusplus(v611, v612); + real2 v615 = minusplus(uminus(v611), v612); + real2 v629 = ctimesminusplus(reverse(v615), tbl[100 + tbloffset], ctimes(v615, tbl[101 + tbloffset])); + real2 v1744 = plus(v1704, v1705); + real2 v1740 = minus(v1705, v1704); + real2 v1637 = ctimesminusplus(reverse(v1623), tbl[288 + tbloffset], ctimes(v1623, tbl[289 + tbloffset])); + real2 v1927 = ctimesminusplus(reverse(v1913), tbl[340 + tbloffset], ctimes(v1913, tbl[341 + tbloffset])); + real2 v2571 = plus(v309, v629); + real2 v2565 = reverse(minus(v629, v309)); + real2 v1833 = minusplus(uminus(v1829), v1830); + real2 v1831 = minusplus(v1829, v1830); + real2 v1921 = ctimesminusplus(reverse(v1911), tbl[338 + tbloffset], ctimes(v1911, tbl[339 + tbloffset])); + real2 v1804 = minus(v1677, v1637); + real2 v1808 = plus(v1637, v1677); + real2 v1847 = ctimesminusplus(reverse(v1833), tbl[324 + tbloffset], ctimes(v1833, tbl[325 + tbloffset])); + real2 v2014 = minus(v1887, v1847); + real2 v2018 = plus(v1847, v1887); + real2 v1841 = ctimesminusplus(reverse(v1831), tbl[322 + tbloffset], ctimes(v1831, tbl[323 + tbloffset])); + real2 v1988 = minus(v1881, v1841); + real2 v1992 = plus(v1841, v1881); + real2 v1703 = minusplus(uminus(v1699), v1700); + real2 v1701 = minusplus(v1699, v1700); + real2 v1717 = ctimesminusplus(reverse(v1703), tbl[304 + tbloffset], ctimes(v1703, tbl[305 + tbloffset])); + real2 v1711 = ctimesminusplus(reverse(v1701), tbl[302 + tbloffset], ctimes(v1701, tbl[303 + tbloffset])); + real2 v2730 = plus(v2570, v2571); + real2 v2726 = minus(v2571, v2570); + real2 v1412 = minus(v1303, v1263); + real2 v1416 = plus(v1263, v1303); + real2 v63 = load(in, 61 << inShift); + real2 v127 = load(in, 125 << inShift); + real2 v717 = plus(v63, v127); + real2 v711 = reverse(minus(v127, v63)); + real2 v95 = load(in, 93 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v712 = minus(v95, v31); + real2 v716 = plus(v31, v95); + real2 v1037 = plus(v716, v717); + real2 v1031 = reverse(minus(v717, v716)); + real2 v79 = load(in, 77 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v396 = plus(v15, v79); + real2 v392 = minus(v79, v15); + real2 v111 = load(in, 109 << inShift); + real2 v47 = load(in, 45 << inShift); + real2 v397 = plus(v47, v111); + real2 v391 = reverse(minus(v111, v47)); + real2 v1032 = minus(v397, v396); + real2 v1036 = plus(v396, v397); + real2 v1033 = minusplus(v1031, v1032); + real2 v1035 = minusplus(uminus(v1031), v1032); + real2 v1049 = ctimesminusplus(reverse(v1035), tbl[184 + tbloffset], ctimes(v1035, tbl[185 + tbloffset])); + real2 v1043 = ctimesminusplus(reverse(v1033), tbl[182 + tbloffset], ctimes(v1033, tbl[183 + tbloffset])); + real2 v1197 = plus(v1036, v1037); + real2 v1191 = reverse(minus(v1037, v1036)); + real2 v23 = load(in, 21 << inShift); + real2 v87 = load(in, 85 << inShift); + real2 v556 = plus(v23, v87); + real2 v552 = minus(v87, v23); + real2 v119 = load(in, 117 << inShift); + real2 v55 = load(in, 53 << inShift); + real2 v557 = plus(v55, v119); + real2 v551 = reverse(minus(v119, v55)); + real2 v877 = plus(v556, v557); + real2 v871 = reverse(minus(v557, v556)); + real2 v7 = load(in, 5 << inShift); + real2 v71 = load(in, 69 << inShift); + real2 v232 = minus(v71, v7); + real2 v236 = plus(v7, v71); + real2 v103 = load(in, 101 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v237 = plus(v39, v103); + real2 v231 = reverse(minus(v103, v39)); + real2 v876 = plus(v236, v237); + real2 v872 = minus(v237, v236); + real2 v1192 = minus(v877, v876); + real2 v1196 = plus(v876, v877); + real2 v1271 = reverse(minus(v1197, v1196)); + real2 v1277 = plus(v1196, v1197); + real2 v875 = minusplus(uminus(v871), v872); + real2 v873 = minusplus(v871, v872); + real2 v883 = ctimesminusplus(reverse(v873), tbl[150 + tbloffset], ctimes(v873, tbl[151 + tbloffset])); + real2 v1639 = reverse(minus(v1043, v883)); + real2 v1645 = plus(v883, v1043); + real2 v1195 = minusplus(uminus(v1191), v1192); + real2 v1193 = minusplus(v1191, v1192); + real2 v1209 = ctimesminusplus(reverse(v1195), tbl[216 + tbloffset], ctimes(v1195, tbl[217 + tbloffset])); + real2 v1203 = ctimesminusplus(reverse(v1193), tbl[214 + tbloffset], ctimes(v1193, tbl[215 + tbloffset])); + real2 v83 = load(in, 81 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v476 = plus(v19, v83); + real2 v472 = minus(v83, v19); + real2 v51 = load(in, 49 << inShift); + real2 v115 = load(in, 113 << inShift); + real2 v477 = plus(v51, v115); + real2 v471 = reverse(minus(v115, v51)); + real2 v797 = plus(v476, v477); + real2 v791 = reverse(minus(v477, v476)); + real2 v3 = load(in, 1 << inShift); + real2 v67 = load(in, 65 << inShift); + real2 v156 = plus(v3, v67); + real2 v152 = minus(v67, v3); + real2 v35 = load(in, 33 << inShift); + real2 v99 = load(in, 97 << inShift); + real2 v157 = plus(v35, v99); + real2 v151 = reverse(minus(v99, v35)); + real2 v792 = minus(v157, v156); + real2 v796 = plus(v156, v157); + real2 v793 = minusplus(v791, v792); + real2 v795 = minusplus(uminus(v791), v792); + real2 v803 = ctimesminusplus(reverse(v793), tbl[134 + tbloffset], ctimes(v793, tbl[135 + tbloffset])); + real2 v1112 = minus(v797, v796); + real2 v1116 = plus(v796, v797); + real2 v107 = load(in, 105 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v317 = plus(v43, v107); + real2 v311 = reverse(minus(v107, v43)); + real2 v75 = load(in, 73 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v316 = plus(v11, v75); + real2 v312 = minus(v75, v11); + real2 v956 = plus(v316, v317); + real2 v952 = minus(v317, v316); + real2 v59 = load(in, 57 << inShift); + real2 v123 = load(in, 121 << inShift); + real2 v631 = reverse(minus(v123, v59)); + real2 v637 = plus(v59, v123); + real2 v27 = load(in, 25 << inShift); + real2 v91 = load(in, 89 << inShift); + real2 v636 = plus(v27, v91); + real2 v632 = minus(v91, v27); + real2 v957 = plus(v636, v637); + real2 v951 = reverse(minus(v637, v636)); + real2 v1111 = reverse(minus(v957, v956)); + real2 v1117 = plus(v956, v957); + real2 v1276 = plus(v1116, v1117); + real2 v1272 = minus(v1117, v1116); + real2 v1275 = minusplus(uminus(v1271), v1272); + real2 v1273 = minusplus(v1271, v1272); + real2 v1283 = ctimesminusplus(reverse(v1273), tbl[230 + tbloffset], ctimes(v1273, tbl[231 + tbloffset])); + real2 v1352 = minus(v1277, v1276); + real2 v1356 = plus(v1276, v1277); + real2 v1289 = ctimesminusplus(reverse(v1275), tbl[232 + tbloffset], ctimes(v1275, tbl[233 + tbloffset])); + real2 v1115 = minusplus(uminus(v1111), v1112); + real2 v1113 = minusplus(v1111, v1112); + real2 v1123 = ctimesminusplus(reverse(v1113), tbl[198 + tbloffset], ctimes(v1113, tbl[199 + tbloffset])); + real2 v1129 = ctimesminusplus(reverse(v1115), tbl[200 + tbloffset], ctimes(v1115, tbl[201 + tbloffset])); + real2 v1488 = plus(v1123, v1203); + real2 v1484 = minus(v1203, v1123); + real2 v1566 = plus(v1129, v1209); + real2 v1562 = minus(v1209, v1129); + real2 v85 = load(in, 83 << inShift); + real2 v21 = load(in, 19 << inShift); + real2 v512 = minus(v85, v21); + real2 v516 = plus(v21, v85); + real2 v117 = load(in, 115 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v517 = plus(v53, v117); + real2 v511 = reverse(minus(v117, v53)); + real2 v831 = reverse(minus(v517, v516)); + real2 v837 = plus(v516, v517); + real2 v69 = load(in, 67 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v192 = minus(v69, v5); + real2 v196 = plus(v5, v69); + real2 v37 = load(in, 35 << inShift); + real2 v101 = load(in, 99 << inShift); + real2 v197 = plus(v37, v101); + real2 v191 = reverse(minus(v101, v37)); + real2 v832 = minus(v197, v196); + real2 v836 = plus(v196, v197); + real2 v1152 = minus(v837, v836); + real2 v1156 = plus(v836, v837); + real2 v61 = load(in, 59 << inShift); + real2 v125 = load(in, 123 << inShift); + real2 v677 = plus(v61, v125); + real2 v671 = reverse(minus(v125, v61)); + real2 v29 = load(in, 27 << inShift); + real2 v93 = load(in, 91 << inShift); + real2 v672 = minus(v93, v29); + real2 v676 = plus(v29, v93); + real2 v997 = plus(v676, v677); + real2 v991 = reverse(minus(v677, v676)); + real2 v109 = load(in, 107 << inShift); + real2 v45 = load(in, 43 << inShift); + real2 v357 = plus(v45, v109); + real2 v351 = reverse(minus(v109, v45)); + real2 v77 = load(in, 75 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v352 = minus(v77, v13); + real2 v356 = plus(v13, v77); + real2 v992 = minus(v357, v356); + real2 v996 = plus(v356, v357); + real2 v1157 = plus(v996, v997); + real2 v1151 = reverse(minus(v997, v996)); + real2 v1155 = minusplus(uminus(v1151), v1152); + real2 v1153 = minusplus(v1151, v1152); + real2 v1163 = ctimesminusplus(reverse(v1153), tbl[206 + tbloffset], ctimes(v1153, tbl[207 + tbloffset])); + real2 v1316 = plus(v1156, v1157); + real2 v1312 = minus(v1157, v1156); + real2 v41 = load(in, 39 << inShift); + real2 v105 = load(in, 103 << inShift); + real2 v277 = plus(v41, v105); + real2 v271 = reverse(minus(v105, v41)); + real2 v9 = load(in, 7 << inShift); + real2 v73 = load(in, 71 << inShift); + real2 v276 = plus(v9, v73); + real2 v272 = minus(v73, v9); + real2 v916 = plus(v276, v277); + real2 v912 = minus(v277, v276); + real2 v89 = load(in, 87 << inShift); + real2 v25 = load(in, 23 << inShift); + real2 v592 = minus(v89, v25); + real2 v596 = plus(v25, v89); + real2 v57 = load(in, 55 << inShift); + real2 v121 = load(in, 119 << inShift); + real2 v591 = reverse(minus(v121, v57)); + real2 v597 = plus(v57, v121); + real2 v911 = reverse(minus(v597, v596)); + real2 v917 = plus(v596, v597); + real2 v1236 = plus(v916, v917); + real2 v1232 = minus(v917, v916); + real2 v81 = load(in, 79 << inShift); + real2 v17 = load(in, 15 << inShift); + real2 v432 = minus(v81, v17); + real2 v436 = plus(v17, v81); + real2 v113 = load(in, 111 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v437 = plus(v49, v113); + real2 v431 = reverse(minus(v113, v49)); + real2 v1072 = minus(v437, v436); + real2 v1076 = plus(v436, v437); + real2 v65 = load(in, 63 << inShift); + real2 v129 = load(in, 127 << inShift); + real2 v757 = plus(v65, v129); + real2 v751 = reverse(minus(v129, v65)); + real2 v97 = load(in, 95 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v752 = minus(v97, v33); + real2 v756 = plus(v33, v97); + real2 v1077 = plus(v756, v757); + real2 v1071 = reverse(minus(v757, v756)); + real2 v1231 = reverse(minus(v1077, v1076)); + real2 v1237 = plus(v1076, v1077); + real2 v1317 = plus(v1236, v1237); + real2 v1311 = reverse(minus(v1237, v1236)); + real2 v1351 = reverse(minus(v1317, v1316)); + real2 v1357 = plus(v1316, v1317); + real2 v1371 = reverse(minus(v1357, v1356)); + real2 v1377 = plus(v1356, v1357); + store(out, 0 << outShift, plus(v1376, v1377)); + real2 v1390 = minus(v1376, v1377); + store(out, 64 << outShift, ctimesminusplus(v1390, tbl[0 + tbloffset], ctimes(reverse(v1390), tbl[1 + tbloffset]))); + real2 v1353 = minusplus(v1351, v1352); + real2 v1355 = minusplus(uminus(v1351), v1352); + real2 v1369 = ctimesminusplus(reverse(v1355), tbl[248 + tbloffset], ctimes(v1355, tbl[249 + tbloffset])); + store(out, 48 << outShift, plus(v1349, v1369)); + real2 v1404 = minus(v1349, v1369); + store(out, 112 << outShift, ctimesminusplus(v1404, tbl[0 + tbloffset], ctimes(reverse(v1404), tbl[1 + tbloffset]))); + real2 v1363 = ctimesminusplus(reverse(v1353), tbl[246 + tbloffset], ctimes(v1353, tbl[247 + tbloffset])); + store(out, 16 << outShift, plus(v1343, v1363)); + real2 v1398 = minus(v1343, v1363); + store(out, 80 << outShift, ctimesminusplus(v1398, tbl[0 + tbloffset], ctimes(reverse(v1398), tbl[1 + tbloffset]))); + real2 v1373 = minusplus(v1371, v1372); + real2 v1375 = minusplus(uminus(v1371), v1372); + store(out, 96 << outShift, ctimesminusplus(reverse(v1375), tbl[252 + tbloffset], ctimes(v1375, tbl[253 + tbloffset]))); + store(out, 32 << outShift, ctimesminusplus(reverse(v1373), tbl[250 + tbloffset], ctimes(v1373, tbl[251 + tbloffset]))); + real2 v1313 = minusplus(v1311, v1312); + real2 v1315 = minusplus(uminus(v1311), v1312); + real2 v1323 = ctimesminusplus(reverse(v1313), tbl[238 + tbloffset], ctimes(v1313, tbl[239 + tbloffset])); + real2 v1417 = plus(v1283, v1323); + real2 v1411 = reverse(minus(v1323, v1283)); + store(out, 8 << outShift, plus(v1416, v1417)); + real2 v1430 = minus(v1416, v1417); + store(out, 72 << outShift, ctimesminusplus(v1430, tbl[0 + tbloffset], ctimes(reverse(v1430), tbl[1 + tbloffset]))); + real2 v1413 = minusplus(v1411, v1412); + real2 v1415 = minusplus(uminus(v1411), v1412); + store(out, 104 << outShift, ctimesminusplus(reverse(v1415), tbl[256 + tbloffset], ctimes(v1415, tbl[257 + tbloffset]))); + store(out, 40 << outShift, ctimesminusplus(reverse(v1413), tbl[254 + tbloffset], ctimes(v1413, tbl[255 + tbloffset]))); + real2 v1329 = ctimesminusplus(reverse(v1315), tbl[240 + tbloffset], ctimes(v1315, tbl[241 + tbloffset])); + real2 v1443 = plus(v1289, v1329); + real2 v1437 = reverse(minus(v1329, v1289)); + store(out, 24 << outShift, plus(v1442, v1443)); + real2 v1456 = minus(v1442, v1443); + store(out, 88 << outShift, ctimesminusplus(v1456, tbl[0 + tbloffset], ctimes(reverse(v1456), tbl[1 + tbloffset]))); + real2 v1441 = minusplus(uminus(v1437), v1438); + real2 v1439 = minusplus(v1437, v1438); + store(out, 120 << outShift, ctimesminusplus(reverse(v1441), tbl[260 + tbloffset], ctimes(v1441, tbl[261 + tbloffset]))); + store(out, 56 << outShift, ctimesminusplus(reverse(v1439), tbl[258 + tbloffset], ctimes(v1439, tbl[259 + tbloffset]))); + real2 v1235 = minusplus(uminus(v1231), v1232); + real2 v1233 = minusplus(v1231, v1232); + real2 v1243 = ctimesminusplus(reverse(v1233), tbl[222 + tbloffset], ctimes(v1233, tbl[223 + tbloffset])); + real2 v1489 = plus(v1163, v1243); + real2 v1483 = reverse(minus(v1243, v1163)); + real2 v1509 = plus(v1488, v1489); + real2 v1503 = reverse(minus(v1489, v1488)); + store(out, 4 << outShift, plus(v1508, v1509)); + real2 v1522 = minus(v1508, v1509); + store(out, 68 << outShift, ctimesminusplus(v1522, tbl[0 + tbloffset], ctimes(reverse(v1522), tbl[1 + tbloffset]))); + real2 v1507 = minusplus(uminus(v1503), v1504); + real2 v1505 = minusplus(v1503, v1504); + store(out, 36 << outShift, ctimesminusplus(reverse(v1505), tbl[270 + tbloffset], ctimes(v1505, tbl[271 + tbloffset]))); + store(out, 100 << outShift, ctimesminusplus(reverse(v1507), tbl[272 + tbloffset], ctimes(v1507, tbl[273 + tbloffset]))); + real2 v1485 = minusplus(v1483, v1484); + real2 v1487 = minusplus(uminus(v1483), v1484); + real2 v1501 = ctimesminusplus(reverse(v1487), tbl[268 + tbloffset], ctimes(v1487, tbl[269 + tbloffset])); + store(out, 52 << outShift, plus(v1481, v1501)); + real2 v1534 = minus(v1481, v1501); + store(out, 116 << outShift, ctimesminusplus(v1534, tbl[0 + tbloffset], ctimes(reverse(v1534), tbl[1 + tbloffset]))); + real2 v1495 = ctimesminusplus(reverse(v1485), tbl[266 + tbloffset], ctimes(v1485, tbl[267 + tbloffset])); + store(out, 20 << outShift, plus(v1475, v1495)); + real2 v1528 = minus(v1475, v1495); + store(out, 84 << outShift, ctimesminusplus(v1528, tbl[0 + tbloffset], ctimes(reverse(v1528), tbl[1 + tbloffset]))); + real2 v1249 = ctimesminusplus(reverse(v1235), tbl[224 + tbloffset], ctimes(v1235, tbl[225 + tbloffset])); + real2 v1169 = ctimesminusplus(reverse(v1155), tbl[208 + tbloffset], ctimes(v1155, tbl[209 + tbloffset])); + real2 v1567 = plus(v1169, v1249); + real2 v1561 = reverse(minus(v1249, v1169)); + real2 v1581 = reverse(minus(v1567, v1566)); + real2 v1587 = plus(v1566, v1567); + store(out, 12 << outShift, plus(v1586, v1587)); + real2 v1600 = minus(v1586, v1587); + store(out, 76 << outShift, ctimesminusplus(v1600, tbl[0 + tbloffset], ctimes(reverse(v1600), tbl[1 + tbloffset]))); + real2 v1583 = minusplus(v1581, v1582); + store(out, 44 << outShift, ctimesminusplus(reverse(v1583), tbl[282 + tbloffset], ctimes(v1583, tbl[283 + tbloffset]))); + real2 v1585 = minusplus(uminus(v1581), v1582); + store(out, 108 << outShift, ctimesminusplus(reverse(v1585), tbl[284 + tbloffset], ctimes(v1585, tbl[285 + tbloffset]))); + real2 v1565 = minusplus(uminus(v1561), v1562); + real2 v1563 = minusplus(v1561, v1562); + real2 v1579 = ctimesminusplus(reverse(v1565), tbl[280 + tbloffset], ctimes(v1565, tbl[281 + tbloffset])); + store(out, 60 << outShift, plus(v1559, v1579)); + real2 v1612 = minus(v1559, v1579); + store(out, 124 << outShift, ctimesminusplus(v1612, tbl[0 + tbloffset], ctimes(reverse(v1612), tbl[1 + tbloffset]))); + real2 v1573 = ctimesminusplus(reverse(v1563), tbl[278 + tbloffset], ctimes(v1563, tbl[279 + tbloffset])); + store(out, 28 << outShift, plus(v1553, v1573)); + real2 v1606 = minus(v1553, v1573); + store(out, 92 << outShift, ctimesminusplus(v1606, tbl[0 + tbloffset], ctimes(reverse(v1606), tbl[1 + tbloffset]))); + real2 v833 = minusplus(v831, v832); + real2 v835 = minusplus(uminus(v831), v832); + real2 v955 = minusplus(uminus(v951), v952); + real2 v953 = minusplus(v951, v952); + real2 v963 = ctimesminusplus(reverse(v953), tbl[166 + tbloffset], ctimes(v953, tbl[167 + tbloffset])); + real2 v995 = minusplus(uminus(v991), v992); + real2 v993 = minusplus(v991, v992); + real2 v1003 = ctimesminusplus(reverse(v993), tbl[174 + tbloffset], ctimes(v993, tbl[175 + tbloffset])); + real2 v843 = ctimesminusplus(reverse(v833), tbl[142 + tbloffset], ctimes(v833, tbl[143 + tbloffset])); + real2 v1640 = minus(v963, v803); + real2 v1644 = plus(v803, v963); + real2 v1680 = minus(v1003, v843); + real2 v1684 = plus(v843, v1003); + real2 v1641 = minusplus(v1639, v1640); + real2 v1643 = minusplus(uminus(v1639), v1640); + real2 v1657 = ctimesminusplus(reverse(v1643), tbl[292 + tbloffset], ctimes(v1643, tbl[293 + tbloffset])); + real2 v913 = minusplus(v911, v912); + real2 v915 = minusplus(uminus(v911), v912); + real2 v1073 = minusplus(v1071, v1072); + real2 v1075 = minusplus(uminus(v1071), v1072); + real2 v923 = ctimesminusplus(reverse(v913), tbl[158 + tbloffset], ctimes(v913, tbl[159 + tbloffset])); + real2 v1083 = ctimesminusplus(reverse(v1073), tbl[190 + tbloffset], ctimes(v1073, tbl[191 + tbloffset])); + real2 v1685 = plus(v923, v1083); + real2 v1679 = reverse(minus(v1083, v923)); + real2 v1681 = minusplus(v1679, v1680); + real2 v1683 = minusplus(uminus(v1679), v1680); + real2 v1697 = ctimesminusplus(reverse(v1683), tbl[300 + tbloffset], ctimes(v1683, tbl[301 + tbloffset])); + real2 v1809 = plus(v1657, v1697); + real2 v1803 = reverse(minus(v1697, v1657)); + store(out, 26 << outShift, plus(v1808, v1809)); + real2 v1822 = minus(v1808, v1809); + store(out, 90 << outShift, ctimesminusplus(v1822, tbl[0 + tbloffset], ctimes(reverse(v1822), tbl[1 + tbloffset]))); + real2 v1807 = minusplus(uminus(v1803), v1804); + real2 v1805 = minusplus(v1803, v1804); + store(out, 58 << outShift, ctimesminusplus(reverse(v1805), tbl[318 + tbloffset], ctimes(v1805, tbl[319 + tbloffset]))); + store(out, 122 << outShift, ctimesminusplus(reverse(v1807), tbl[320 + tbloffset], ctimes(v1807, tbl[321 + tbloffset]))); + real2 v1651 = ctimesminusplus(reverse(v1641), tbl[290 + tbloffset], ctimes(v1641, tbl[291 + tbloffset])); + real2 v1691 = ctimesminusplus(reverse(v1681), tbl[298 + tbloffset], ctimes(v1681, tbl[299 + tbloffset])); + real2 v1783 = plus(v1651, v1691); + real2 v1777 = reverse(minus(v1691, v1651)); + real2 v1779 = minusplus(v1777, v1778); + real2 v1781 = minusplus(uminus(v1777), v1778); + store(out, 106 << outShift, ctimesminusplus(reverse(v1781), tbl[316 + tbloffset], ctimes(v1781, tbl[317 + tbloffset]))); + store(out, 42 << outShift, ctimesminusplus(reverse(v1779), tbl[314 + tbloffset], ctimes(v1779, tbl[315 + tbloffset]))); + store(out, 10 << outShift, plus(v1782, v1783)); + real2 v1796 = minus(v1782, v1783); + store(out, 74 << outShift, ctimesminusplus(v1796, tbl[0 + tbloffset], ctimes(reverse(v1796), tbl[1 + tbloffset]))); + real2 v1720 = minus(v1645, v1644); + real2 v1724 = plus(v1644, v1645); + real2 v1719 = reverse(minus(v1685, v1684)); + real2 v1725 = plus(v1684, v1685); + real2 v1745 = plus(v1724, v1725); + real2 v1739 = reverse(minus(v1725, v1724)); + store(out, 2 << outShift, plus(v1744, v1745)); + real2 v1758 = minus(v1744, v1745); + store(out, 66 << outShift, ctimesminusplus(v1758, tbl[0 + tbloffset], ctimes(reverse(v1758), tbl[1 + tbloffset]))); + real2 v1741 = minusplus(v1739, v1740); + real2 v1743 = minusplus(uminus(v1739), v1740); + store(out, 98 << outShift, ctimesminusplus(reverse(v1743), tbl[312 + tbloffset], ctimes(v1743, tbl[313 + tbloffset]))); + store(out, 34 << outShift, ctimesminusplus(reverse(v1741), tbl[310 + tbloffset], ctimes(v1741, tbl[311 + tbloffset]))); + real2 v1723 = minusplus(uminus(v1719), v1720); + real2 v1721 = minusplus(v1719, v1720); + real2 v1737 = ctimesminusplus(reverse(v1723), tbl[308 + tbloffset], ctimes(v1723, tbl[309 + tbloffset])); + store(out, 50 << outShift, plus(v1717, v1737)); + real2 v1770 = minus(v1717, v1737); + store(out, 114 << outShift, ctimesminusplus(v1770, tbl[0 + tbloffset], ctimes(reverse(v1770), tbl[1 + tbloffset]))); + real2 v1731 = ctimesminusplus(reverse(v1721), tbl[306 + tbloffset], ctimes(v1721, tbl[307 + tbloffset])); + store(out, 18 << outShift, plus(v1711, v1731)); + real2 v1764 = minus(v1711, v1731); + store(out, 82 << outShift, ctimesminusplus(v1764, tbl[0 + tbloffset], ctimes(reverse(v1764), tbl[1 + tbloffset]))); + real2 v809 = ctimesminusplus(reverse(v795), tbl[136 + tbloffset], ctimes(v795, tbl[137 + tbloffset])); + real2 v969 = ctimesminusplus(reverse(v955), tbl[168 + tbloffset], ctimes(v955, tbl[169 + tbloffset])); + real2 v1850 = minus(v969, v809); + real2 v1854 = plus(v809, v969); + real2 v849 = ctimesminusplus(reverse(v835), tbl[144 + tbloffset], ctimes(v835, tbl[145 + tbloffset])); + real2 v929 = ctimesminusplus(reverse(v915), tbl[160 + tbloffset], ctimes(v915, tbl[161 + tbloffset])); + real2 v889 = ctimesminusplus(reverse(v875), tbl[152 + tbloffset], ctimes(v875, tbl[153 + tbloffset])); + real2 v1089 = ctimesminusplus(reverse(v1075), tbl[192 + tbloffset], ctimes(v1075, tbl[193 + tbloffset])); + real2 v1009 = ctimesminusplus(reverse(v995), tbl[176 + tbloffset], ctimes(v995, tbl[177 + tbloffset])); + real2 v1890 = minus(v1009, v849); + real2 v1894 = plus(v849, v1009); + real2 v1849 = reverse(minus(v1049, v889)); + real2 v1855 = plus(v889, v1049); + real2 v1930 = minus(v1855, v1854); + real2 v1934 = plus(v1854, v1855); + real2 v1895 = plus(v929, v1089); + real2 v1889 = reverse(minus(v1089, v929)); + real2 v1929 = reverse(minus(v1895, v1894)); + real2 v1935 = plus(v1894, v1895); + real2 v1955 = plus(v1934, v1935); + real2 v1949 = reverse(minus(v1935, v1934)); + store(out, 6 << outShift, plus(v1954, v1955)); + real2 v1968 = minus(v1954, v1955); + store(out, 70 << outShift, ctimesminusplus(v1968, tbl[0 + tbloffset], ctimes(reverse(v1968), tbl[1 + tbloffset]))); + real2 v1951 = minusplus(v1949, v1950); + store(out, 38 << outShift, ctimesminusplus(reverse(v1951), tbl[346 + tbloffset], ctimes(v1951, tbl[347 + tbloffset]))); + real2 v1953 = minusplus(uminus(v1949), v1950); + store(out, 102 << outShift, ctimesminusplus(reverse(v1953), tbl[348 + tbloffset], ctimes(v1953, tbl[349 + tbloffset]))); + real2 v1931 = minusplus(v1929, v1930); + real2 v1933 = minusplus(uminus(v1929), v1930); + real2 v1947 = ctimesminusplus(reverse(v1933), tbl[344 + tbloffset], ctimes(v1933, tbl[345 + tbloffset])); + store(out, 54 << outShift, plus(v1927, v1947)); + real2 v1980 = minus(v1927, v1947); + store(out, 118 << outShift, ctimesminusplus(v1980, tbl[0 + tbloffset], ctimes(reverse(v1980), tbl[1 + tbloffset]))); + real2 v1941 = ctimesminusplus(reverse(v1931), tbl[342 + tbloffset], ctimes(v1931, tbl[343 + tbloffset])); + store(out, 22 << outShift, plus(v1921, v1941)); + real2 v1974 = minus(v1921, v1941); + store(out, 86 << outShift, ctimesminusplus(v1974, tbl[0 + tbloffset], ctimes(reverse(v1974), tbl[1 + tbloffset]))); + real2 v1851 = minusplus(v1849, v1850); + real2 v1853 = minusplus(uminus(v1849), v1850); + real2 v1867 = ctimesminusplus(reverse(v1853), tbl[328 + tbloffset], ctimes(v1853, tbl[329 + tbloffset])); + real2 v1891 = minusplus(v1889, v1890); + real2 v1893 = minusplus(uminus(v1889), v1890); + real2 v1907 = ctimesminusplus(reverse(v1893), tbl[336 + tbloffset], ctimes(v1893, tbl[337 + tbloffset])); + real2 v2019 = plus(v1867, v1907); + real2 v2013 = reverse(minus(v1907, v1867)); + store(out, 30 << outShift, plus(v2018, v2019)); + real2 v2032 = minus(v2018, v2019); + store(out, 94 << outShift, ctimesminusplus(v2032, tbl[0 + tbloffset], ctimes(reverse(v2032), tbl[1 + tbloffset]))); + real2 v2017 = minusplus(uminus(v2013), v2014); + store(out, 126 << outShift, ctimesminusplus(reverse(v2017), tbl[356 + tbloffset], ctimes(v2017, tbl[357 + tbloffset]))); + real2 v2015 = minusplus(v2013, v2014); + store(out, 62 << outShift, ctimesminusplus(reverse(v2015), tbl[354 + tbloffset], ctimes(v2015, tbl[355 + tbloffset]))); + real2 v1861 = ctimesminusplus(reverse(v1851), tbl[326 + tbloffset], ctimes(v1851, tbl[327 + tbloffset])); + real2 v1901 = ctimesminusplus(reverse(v1891), tbl[334 + tbloffset], ctimes(v1891, tbl[335 + tbloffset])); + real2 v1993 = plus(v1861, v1901); + real2 v1987 = reverse(minus(v1901, v1861)); + store(out, 14 << outShift, plus(v1992, v1993)); + real2 v2006 = minus(v1992, v1993); + store(out, 78 << outShift, ctimesminusplus(v2006, tbl[0 + tbloffset], ctimes(reverse(v2006), tbl[1 + tbloffset]))); + real2 v1991 = minusplus(uminus(v1987), v1988); + store(out, 110 << outShift, ctimesminusplus(reverse(v1991), tbl[352 + tbloffset], ctimes(v1991, tbl[353 + tbloffset]))); + real2 v1989 = minusplus(v1987, v1988); + store(out, 46 << outShift, ctimesminusplus(reverse(v1989), tbl[350 + tbloffset], ctimes(v1989, tbl[351 + tbloffset]))); + real2 v593 = minusplus(v591, v592); + real2 v595 = minusplus(uminus(v591), v592); + real2 v473 = minusplus(v471, v472); + real2 v475 = minusplus(uminus(v471), v472); + real2 v555 = minusplus(uminus(v551), v552); + real2 v553 = minusplus(v551, v552); + real2 v609 = ctimesminusplus(reverse(v595), tbl[96 + tbloffset], ctimes(v595, tbl[97 + tbloffset])); + real2 v195 = minusplus(uminus(v191), v192); + real2 v193 = minusplus(v191, v192); + real2 v275 = minusplus(uminus(v271), v272); + real2 v273 = minusplus(v271, v272); + real2 v673 = minusplus(v671, v672); + real2 v675 = minusplus(uminus(v671), v672); + real2 v689 = ctimesminusplus(reverse(v675), tbl[112 + tbloffset], ctimes(v675, tbl[113 + tbloffset])); + real2 v209 = ctimesminusplus(reverse(v195), tbl[16 + tbloffset], ctimes(v195, tbl[17 + tbloffset])); + real2 v289 = ctimesminusplus(reverse(v275), tbl[32 + tbloffset], ctimes(v275, tbl[33 + tbloffset])); + real2 v755 = minusplus(uminus(v751), v752); + real2 v753 = minusplus(v751, v752); + real2 v435 = minusplus(uminus(v431), v432); + real2 v433 = minusplus(v431, v432); + real2 v513 = minusplus(v511, v512); + real2 v515 = minusplus(uminus(v511), v512); + real2 v529 = ctimesminusplus(reverse(v515), tbl[80 + tbloffset], ctimes(v515, tbl[81 + tbloffset])); + real2 v353 = minusplus(v351, v352); + real2 v355 = minusplus(uminus(v351), v352); + real2 v369 = ctimesminusplus(reverse(v355), tbl[48 + tbloffset], ctimes(v355, tbl[49 + tbloffset])); + real2 v2631 = plus(v369, v689); + real2 v2625 = reverse(minus(v689, v369)); + real2 v449 = ctimesminusplus(reverse(v435), tbl[64 + tbloffset], ctimes(v435, tbl[65 + tbloffset])); + real2 v2710 = plus(v289, v609); + real2 v2706 = minus(v609, v289); + real2 v2630 = plus(v209, v529); + real2 v2626 = minus(v529, v209); + real2 v2790 = plus(v2630, v2631); + real2 v2786 = minus(v2631, v2630); + real2 v713 = minusplus(v711, v712); + real2 v715 = minusplus(uminus(v711), v712); + real2 v769 = ctimesminusplus(reverse(v755), tbl[128 + tbloffset], ctimes(v755, tbl[129 + tbloffset])); + real2 v2705 = reverse(minus(v769, v449)); + real2 v2711 = plus(v449, v769); + real2 v313 = minusplus(v311, v312); + real2 v315 = minusplus(uminus(v311), v312); + real2 v393 = minusplus(v391, v392); + real2 v395 = minusplus(uminus(v391), v392); + real2 v409 = ctimesminusplus(reverse(v395), tbl[56 + tbloffset], ctimes(v395, tbl[57 + tbloffset])); + real2 v729 = ctimesminusplus(reverse(v715), tbl[120 + tbloffset], ctimes(v715, tbl[121 + tbloffset])); + real2 v329 = ctimesminusplus(reverse(v315), tbl[40 + tbloffset], ctimes(v315, tbl[41 + tbloffset])); + real2 v489 = ctimesminusplus(reverse(v475), tbl[72 + tbloffset], ctimes(v475, tbl[73 + tbloffset])); + real2 v153 = minusplus(v151, v152); + real2 v155 = minusplus(uminus(v151), v152); + real2 v169 = ctimesminusplus(reverse(v155), tbl[8 + tbloffset], ctimes(v155, tbl[9 + tbloffset])); + real2 v2586 = minus(v489, v169); + real2 v2590 = plus(v169, v489); + real2 v233 = minusplus(v231, v232); + real2 v235 = minusplus(uminus(v231), v232); + real2 v633 = minusplus(v631, v632); + real2 v635 = minusplus(uminus(v631), v632); + real2 v649 = ctimesminusplus(reverse(v635), tbl[104 + tbloffset], ctimes(v635, tbl[105 + tbloffset])); + real2 v249 = ctimesminusplus(reverse(v235), tbl[24 + tbloffset], ctimes(v235, tbl[25 + tbloffset])); + real2 v569 = ctimesminusplus(reverse(v555), tbl[88 + tbloffset], ctimes(v555, tbl[89 + tbloffset])); + real2 v2670 = plus(v249, v569); + real2 v2666 = minus(v569, v249); + real2 v2785 = reverse(minus(v2711, v2710)); + real2 v2791 = plus(v2710, v2711); + real2 v2825 = reverse(minus(v2791, v2790)); + real2 v2831 = plus(v2790, v2791); + real2 v2671 = plus(v409, v729); + real2 v2665 = reverse(minus(v729, v409)); + real2 v2745 = reverse(minus(v2671, v2670)); + real2 v2751 = plus(v2670, v2671); + real2 v2806 = minus(v2731, v2730); + real2 v2810 = plus(v2730, v2731); + real2 v2846 = minus(v2811, v2810); + real2 v2850 = plus(v2810, v2811); + real2 v2591 = plus(v329, v649); + real2 v2585 = reverse(minus(v649, v329)); + real2 v2750 = plus(v2590, v2591); + real2 v2746 = minus(v2591, v2590); + real2 v2830 = plus(v2750, v2751); + real2 v2826 = minus(v2751, v2750); + real2 v2845 = reverse(minus(v2831, v2830)); + real2 v2851 = plus(v2830, v2831); + store(out, 3 << outShift, plus(v2850, v2851)); + real2 v2864 = minus(v2850, v2851); + store(out, 67 << outShift, ctimesminusplus(v2864, tbl[0 + tbloffset], ctimes(reverse(v2864), tbl[1 + tbloffset]))); + real2 v2849 = minusplus(uminus(v2845), v2846); + real2 v2847 = minusplus(v2845, v2846); + store(out, 35 << outShift, ctimesminusplus(reverse(v2847), tbl[506 + tbloffset], ctimes(v2847, tbl[507 + tbloffset]))); + store(out, 99 << outShift, ctimesminusplus(reverse(v2849), tbl[508 + tbloffset], ctimes(v2849, tbl[509 + tbloffset]))); + real2 v2827 = minusplus(v2825, v2826); + real2 v2829 = minusplus(uminus(v2825), v2826); + real2 v2837 = ctimesminusplus(reverse(v2827), tbl[502 + tbloffset], ctimes(v2827, tbl[503 + tbloffset])); + real2 v2809 = minusplus(uminus(v2805), v2806); + real2 v2807 = minusplus(v2805, v2806); + real2 v2817 = ctimesminusplus(reverse(v2807), tbl[498 + tbloffset], ctimes(v2807, tbl[499 + tbloffset])); + store(out, 19 << outShift, plus(v2817, v2837)); + real2 v2870 = minus(v2817, v2837); + store(out, 83 << outShift, ctimesminusplus(v2870, tbl[0 + tbloffset], ctimes(reverse(v2870), tbl[1 + tbloffset]))); + real2 v2823 = ctimesminusplus(reverse(v2809), tbl[500 + tbloffset], ctimes(v2809, tbl[501 + tbloffset])); + real2 v2843 = ctimesminusplus(reverse(v2829), tbl[504 + tbloffset], ctimes(v2829, tbl[505 + tbloffset])); + store(out, 51 << outShift, plus(v2823, v2843)); + real2 v2876 = minus(v2823, v2843); + store(out, 115 << outShift, ctimesminusplus(v2876, tbl[0 + tbloffset], ctimes(reverse(v2876), tbl[1 + tbloffset]))); + real2 v2787 = minusplus(v2785, v2786); + real2 v2789 = minusplus(uminus(v2785), v2786); + real2 v2803 = ctimesminusplus(reverse(v2789), tbl[496 + tbloffset], ctimes(v2789, tbl[497 + tbloffset])); + real2 v2727 = minusplus(v2725, v2726); + real2 v2729 = minusplus(uminus(v2725), v2726); + real2 v2743 = ctimesminusplus(reverse(v2729), tbl[484 + tbloffset], ctimes(v2729, tbl[485 + tbloffset])); + real2 v2914 = plus(v2743, v2783); + real2 v2910 = minus(v2783, v2743); + real2 v2749 = minusplus(uminus(v2745), v2746); + real2 v2747 = minusplus(v2745, v2746); + real2 v2763 = ctimesminusplus(reverse(v2749), tbl[488 + tbloffset], ctimes(v2749, tbl[489 + tbloffset])); + real2 v2909 = reverse(minus(v2803, v2763)); + real2 v2915 = plus(v2763, v2803); + store(out, 27 << outShift, plus(v2914, v2915)); + real2 v2928 = minus(v2914, v2915); + store(out, 91 << outShift, ctimesminusplus(v2928, tbl[0 + tbloffset], ctimes(reverse(v2928), tbl[1 + tbloffset]))); + real2 v2913 = minusplus(uminus(v2909), v2910); + store(out, 123 << outShift, ctimesminusplus(reverse(v2913), tbl[516 + tbloffset], ctimes(v2913, tbl[517 + tbloffset]))); + real2 v2911 = minusplus(v2909, v2910); + store(out, 59 << outShift, ctimesminusplus(reverse(v2911), tbl[514 + tbloffset], ctimes(v2911, tbl[515 + tbloffset]))); + real2 v2737 = ctimesminusplus(reverse(v2727), tbl[482 + tbloffset], ctimes(v2727, tbl[483 + tbloffset])); + real2 v2888 = plus(v2737, v2777); + real2 v2884 = minus(v2777, v2737); + real2 v2797 = ctimesminusplus(reverse(v2787), tbl[494 + tbloffset], ctimes(v2787, tbl[495 + tbloffset])); + real2 v2757 = ctimesminusplus(reverse(v2747), tbl[486 + tbloffset], ctimes(v2747, tbl[487 + tbloffset])); + real2 v2889 = plus(v2757, v2797); + real2 v2883 = reverse(minus(v2797, v2757)); + store(out, 11 << outShift, plus(v2888, v2889)); + real2 v2902 = minus(v2888, v2889); + store(out, 75 << outShift, ctimesminusplus(v2902, tbl[0 + tbloffset], ctimes(reverse(v2902), tbl[1 + tbloffset]))); + real2 v2887 = minusplus(uminus(v2883), v2884); + store(out, 107 << outShift, ctimesminusplus(reverse(v2887), tbl[512 + tbloffset], ctimes(v2887, tbl[513 + tbloffset]))); + real2 v2885 = minusplus(v2883, v2884); + store(out, 43 << outShift, ctimesminusplus(reverse(v2885), tbl[510 + tbloffset], ctimes(v2885, tbl[511 + tbloffset]))); + real2 v2669 = minusplus(uminus(v2665), v2666); + real2 v2667 = minusplus(v2665, v2666); + real2 v2707 = minusplus(v2705, v2706); + real2 v2709 = minusplus(uminus(v2705), v2706); + real2 v2717 = ctimesminusplus(reverse(v2707), tbl[478 + tbloffset], ctimes(v2707, tbl[479 + tbloffset])); + real2 v2627 = minusplus(v2625, v2626); + real2 v2629 = minusplus(uminus(v2625), v2626); + real2 v2637 = ctimesminusplus(reverse(v2627), tbl[462 + tbloffset], ctimes(v2627, tbl[463 + tbloffset])); + real2 v2961 = plus(v2637, v2717); + real2 v2955 = reverse(minus(v2717, v2637)); + real2 v2649 = minusplus(uminus(v2645), v2646); + real2 v2647 = minusplus(v2645, v2646); + real2 v2569 = minusplus(uminus(v2565), v2566); + real2 v2567 = minusplus(v2565, v2566); + real2 v2577 = ctimesminusplus(reverse(v2567), tbl[450 + tbloffset], ctimes(v2567, tbl[451 + tbloffset])); + real2 v2657 = ctimesminusplus(reverse(v2647), tbl[466 + tbloffset], ctimes(v2647, tbl[467 + tbloffset])); + real2 v2936 = minus(v2657, v2577); + real2 v2940 = plus(v2577, v2657); + real2 v2976 = minus(v2941, v2940); + real2 v2980 = plus(v2940, v2941); + real2 v2677 = ctimesminusplus(reverse(v2667), tbl[470 + tbloffset], ctimes(v2667, tbl[471 + tbloffset])); + real2 v2587 = minusplus(v2585, v2586); + real2 v2589 = minusplus(uminus(v2585), v2586); + real2 v2597 = ctimesminusplus(reverse(v2587), tbl[454 + tbloffset], ctimes(v2587, tbl[455 + tbloffset])); + real2 v2956 = minus(v2677, v2597); + real2 v2960 = plus(v2597, v2677); + real2 v2975 = reverse(minus(v2961, v2960)); + real2 v2981 = plus(v2960, v2961); + store(out, 7 << outShift, plus(v2980, v2981)); + real2 v2994 = minus(v2980, v2981); + store(out, 71 << outShift, ctimesminusplus(v2994, tbl[0 + tbloffset], ctimes(reverse(v2994), tbl[1 + tbloffset]))); + real2 v2979 = minusplus(uminus(v2975), v2976); + store(out, 103 << outShift, ctimesminusplus(reverse(v2979), tbl[528 + tbloffset], ctimes(v2979, tbl[529 + tbloffset]))); + real2 v2977 = minusplus(v2975, v2976); + store(out, 39 << outShift, ctimesminusplus(reverse(v2977), tbl[526 + tbloffset], ctimes(v2977, tbl[527 + tbloffset]))); + real2 v2939 = minusplus(uminus(v2935), v2936); + real2 v2937 = minusplus(v2935, v2936); + real2 v2953 = ctimesminusplus(reverse(v2939), tbl[520 + tbloffset], ctimes(v2939, tbl[521 + tbloffset])); + real2 v2957 = minusplus(v2955, v2956); + real2 v2959 = minusplus(uminus(v2955), v2956); + real2 v2973 = ctimesminusplus(reverse(v2959), tbl[524 + tbloffset], ctimes(v2959, tbl[525 + tbloffset])); + store(out, 55 << outShift, plus(v2953, v2973)); + real2 v3006 = minus(v2953, v2973); + store(out, 119 << outShift, ctimesminusplus(v3006, tbl[0 + tbloffset], ctimes(reverse(v3006), tbl[1 + tbloffset]))); + real2 v2947 = ctimesminusplus(reverse(v2937), tbl[518 + tbloffset], ctimes(v2937, tbl[519 + tbloffset])); + real2 v2967 = ctimesminusplus(reverse(v2957), tbl[522 + tbloffset], ctimes(v2957, tbl[523 + tbloffset])); + store(out, 23 << outShift, plus(v2947, v2967)); + real2 v3000 = minus(v2947, v2967); + store(out, 87 << outShift, ctimesminusplus(v3000, tbl[0 + tbloffset], ctimes(reverse(v3000), tbl[1 + tbloffset]))); + real2 v2663 = ctimesminusplus(reverse(v2649), tbl[468 + tbloffset], ctimes(v2649, tbl[469 + tbloffset])); + real2 v2583 = ctimesminusplus(reverse(v2569), tbl[452 + tbloffset], ctimes(v2569, tbl[453 + tbloffset])); + real2 v3014 = minus(v2663, v2583); + real2 v3018 = plus(v2583, v2663); + real2 v3015 = minusplus(v3013, v3014); + real2 v3017 = minusplus(uminus(v3013), v3014); + real2 v2643 = ctimesminusplus(reverse(v2629), tbl[464 + tbloffset], ctimes(v2629, tbl[465 + tbloffset])); + real2 v2723 = ctimesminusplus(reverse(v2709), tbl[480 + tbloffset], ctimes(v2709, tbl[481 + tbloffset])); + real2 v3039 = plus(v2643, v2723); + real2 v3033 = reverse(minus(v2723, v2643)); + real2 v2683 = ctimesminusplus(reverse(v2669), tbl[472 + tbloffset], ctimes(v2669, tbl[473 + tbloffset])); + real2 v3031 = ctimesminusplus(reverse(v3017), tbl[532 + tbloffset], ctimes(v3017, tbl[533 + tbloffset])); + real2 v2603 = ctimesminusplus(reverse(v2589), tbl[456 + tbloffset], ctimes(v2589, tbl[457 + tbloffset])); + real2 v3034 = minus(v2683, v2603); + real2 v3038 = plus(v2603, v2683); + real2 v3037 = minusplus(uminus(v3033), v3034); + real2 v3035 = minusplus(v3033, v3034); + real2 v3051 = ctimesminusplus(reverse(v3037), tbl[536 + tbloffset], ctimes(v3037, tbl[537 + tbloffset])); + store(out, 63 << outShift, plus(v3031, v3051)); + real2 v3084 = minus(v3031, v3051); + store(out, 127 << outShift, ctimesminusplus(v3084, tbl[0 + tbloffset], ctimes(reverse(v3084), tbl[1 + tbloffset]))); + real2 v3025 = ctimesminusplus(reverse(v3015), tbl[530 + tbloffset], ctimes(v3015, tbl[531 + tbloffset])); + real2 v3045 = ctimesminusplus(reverse(v3035), tbl[534 + tbloffset], ctimes(v3035, tbl[535 + tbloffset])); + store(out, 31 << outShift, plus(v3025, v3045)); + real2 v3078 = minus(v3025, v3045); + store(out, 95 << outShift, ctimesminusplus(v3078, tbl[0 + tbloffset], ctimes(reverse(v3078), tbl[1 + tbloffset]))); + real2 v3058 = plus(v3018, v3019); + real2 v3054 = minus(v3019, v3018); + real2 v3053 = reverse(minus(v3039, v3038)); + real2 v3059 = plus(v3038, v3039); + real2 v3055 = minusplus(v3053, v3054); + store(out, 47 << outShift, ctimesminusplus(reverse(v3055), tbl[538 + tbloffset], ctimes(v3055, tbl[539 + tbloffset]))); + real2 v3057 = minusplus(uminus(v3053), v3054); + store(out, 111 << outShift, ctimesminusplus(reverse(v3057), tbl[540 + tbloffset], ctimes(v3057, tbl[541 + tbloffset]))); + store(out, 15 << outShift, plus(v3058, v3059)); + real2 v3072 = minus(v3058, v3059); + store(out, 79 << outShift, ctimesminusplus(v3072, tbl[0 + tbloffset], ctimes(reverse(v3072), tbl[1 + tbloffset]))); + real2 v683 = ctimesminusplus(reverse(v673), tbl[110 + tbloffset], ctimes(v673, tbl[111 + tbloffset])); + real2 v363 = ctimesminusplus(reverse(v353), tbl[46 + tbloffset], ctimes(v353, tbl[47 + tbloffset])); + real2 v2105 = plus(v363, v683); + real2 v2099 = reverse(minus(v683, v363)); + real2 v283 = ctimesminusplus(reverse(v273), tbl[30 + tbloffset], ctimes(v273, tbl[31 + tbloffset])); + real2 v723 = ctimesminusplus(reverse(v713), tbl[118 + tbloffset], ctimes(v713, tbl[119 + tbloffset])); + real2 v403 = ctimesminusplus(reverse(v393), tbl[54 + tbloffset], ctimes(v393, tbl[55 + tbloffset])); + real2 v603 = ctimesminusplus(reverse(v593), tbl[94 + tbloffset], ctimes(v593, tbl[95 + tbloffset])); + real2 v2180 = minus(v603, v283); + real2 v2184 = plus(v283, v603); + real2 v2145 = plus(v403, v723); + real2 v2139 = reverse(minus(v723, v403)); + real2 v543 = ctimesminusplus(reverse(v533), tbl[82 + tbloffset], ctimes(v533, tbl[83 + tbloffset])); + real2 v383 = ctimesminusplus(reverse(v373), tbl[50 + tbloffset], ctimes(v373, tbl[51 + tbloffset])); + real2 v703 = ctimesminusplus(reverse(v693), tbl[114 + tbloffset], ctimes(v693, tbl[115 + tbloffset])); + real2 v2125 = plus(v383, v703); + real2 v2119 = reverse(minus(v703, v383)); + real2 v223 = ctimesminusplus(reverse(v213), tbl[18 + tbloffset], ctimes(v213, tbl[19 + tbloffset])); + real2 v2120 = minus(v543, v223); + real2 v2124 = plus(v223, v543); + real2 v443 = ctimesminusplus(reverse(v433), tbl[62 + tbloffset], ctimes(v433, tbl[63 + tbloffset])); + real2 v203 = ctimesminusplus(reverse(v193), tbl[14 + tbloffset], ctimes(v193, tbl[15 + tbloffset])); + real2 v763 = ctimesminusplus(reverse(v753), tbl[126 + tbloffset], ctimes(v753, tbl[127 + tbloffset])); + real2 v2179 = reverse(minus(v763, v443)); + real2 v2185 = plus(v443, v763); + real2 v523 = ctimesminusplus(reverse(v513), tbl[78 + tbloffset], ctimes(v513, tbl[79 + tbloffset])); + real2 v2100 = minus(v523, v203); + real2 v2104 = plus(v203, v523); + real2 v2264 = plus(v2104, v2105); + real2 v2260 = minus(v2105, v2104); + real2 v643 = ctimesminusplus(reverse(v633), tbl[102 + tbloffset], ctimes(v633, tbl[103 + tbloffset])); + real2 v2265 = plus(v2184, v2185); + real2 v2259 = reverse(minus(v2185, v2184)); + real2 v563 = ctimesminusplus(reverse(v553), tbl[86 + tbloffset], ctimes(v553, tbl[87 + tbloffset])); + real2 v243 = ctimesminusplus(reverse(v233), tbl[22 + tbloffset], ctimes(v233, tbl[23 + tbloffset])); + real2 v2144 = plus(v243, v563); + real2 v2140 = minus(v563, v243); + real2 v143 = ctimesminusplus(reverse(v133), tbl[2 + tbloffset], ctimes(v133, tbl[3 + tbloffset])); + real2 v183 = ctimesminusplus(reverse(v173), tbl[10 + tbloffset], ctimes(v173, tbl[11 + tbloffset])); + real2 v2084 = plus(v183, v503); + real2 v2080 = minus(v503, v183); + real2 v163 = ctimesminusplus(reverse(v153), tbl[6 + tbloffset], ctimes(v153, tbl[7 + tbloffset])); + real2 v303 = ctimesminusplus(reverse(v293), tbl[34 + tbloffset], ctimes(v293, tbl[35 + tbloffset])); + real2 v623 = ctimesminusplus(reverse(v613), tbl[98 + tbloffset], ctimes(v613, tbl[99 + tbloffset])); + real2 v2039 = reverse(minus(v623, v303)); + real2 v2045 = plus(v303, v623); + real2 v463 = ctimesminusplus(reverse(v453), tbl[66 + tbloffset], ctimes(v453, tbl[67 + tbloffset])); + real2 v2044 = plus(v143, v463); + real2 v2040 = minus(v463, v143); + real2 v2204 = plus(v2044, v2045); + real2 v2200 = minus(v2045, v2044); + real2 v323 = ctimesminusplus(reverse(v313), tbl[38 + tbloffset], ctimes(v313, tbl[39 + tbloffset])); + real2 v2205 = plus(v2124, v2125); + real2 v2199 = reverse(minus(v2125, v2124)); + real2 v2280 = minus(v2205, v2204); + real2 v2284 = plus(v2204, v2205); + real2 v2225 = plus(v2144, v2145); + real2 v2219 = reverse(minus(v2145, v2144)); + real2 v2305 = plus(v2264, v2265); + real2 v2299 = reverse(minus(v2265, v2264)); + real2 v2240 = minus(v2085, v2084); + real2 v2244 = plus(v2084, v2085); + real2 v2279 = reverse(minus(v2245, v2244)); + real2 v2285 = plus(v2244, v2245); + real2 v2281 = minusplus(v2279, v2280); + real2 v2283 = minusplus(uminus(v2279), v2280); + real2 v2291 = ctimesminusplus(reverse(v2281), tbl[406 + tbloffset], ctimes(v2281, tbl[407 + tbloffset])); + real2 v483 = ctimesminusplus(reverse(v473), tbl[70 + tbloffset], ctimes(v473, tbl[71 + tbloffset])); + real2 v2060 = minus(v483, v163); + real2 v2064 = plus(v163, v483); + real2 v2065 = plus(v323, v643); + real2 v2059 = reverse(minus(v643, v323)); + real2 v2220 = minus(v2065, v2064); + real2 v2224 = plus(v2064, v2065); + real2 v2304 = plus(v2224, v2225); + real2 v2300 = minus(v2225, v2224); + real2 v2301 = minusplus(v2299, v2300); + real2 v2303 = minusplus(uminus(v2299), v2300); + real2 v2311 = ctimesminusplus(reverse(v2301), tbl[410 + tbloffset], ctimes(v2301, tbl[411 + tbloffset])); + store(out, 17 << outShift, plus(v2291, v2311)); + real2 v2344 = minus(v2291, v2311); + store(out, 81 << outShift, ctimesminusplus(v2344, tbl[0 + tbloffset], ctimes(reverse(v2344), tbl[1 + tbloffset]))); + real2 v2297 = ctimesminusplus(reverse(v2283), tbl[408 + tbloffset], ctimes(v2283, tbl[409 + tbloffset])); + real2 v2317 = ctimesminusplus(reverse(v2303), tbl[412 + tbloffset], ctimes(v2303, tbl[413 + tbloffset])); + store(out, 49 << outShift, plus(v2297, v2317)); + real2 v2350 = minus(v2297, v2317); + store(out, 113 << outShift, ctimesminusplus(v2350, tbl[0 + tbloffset], ctimes(reverse(v2350), tbl[1 + tbloffset]))); + real2 v2320 = minus(v2285, v2284); + real2 v2324 = plus(v2284, v2285); + real2 v2325 = plus(v2304, v2305); + real2 v2319 = reverse(minus(v2305, v2304)); + store(out, 1 << outShift, plus(v2324, v2325)); + real2 v2338 = minus(v2324, v2325); + store(out, 65 << outShift, ctimesminusplus(v2338, tbl[0 + tbloffset], ctimes(reverse(v2338), tbl[1 + tbloffset]))); + real2 v2321 = minusplus(v2319, v2320); + store(out, 33 << outShift, ctimesminusplus(reverse(v2321), tbl[414 + tbloffset], ctimes(v2321, tbl[415 + tbloffset]))); + real2 v2323 = minusplus(uminus(v2319), v2320); + store(out, 97 << outShift, ctimesminusplus(reverse(v2323), tbl[416 + tbloffset], ctimes(v2323, tbl[417 + tbloffset]))); + real2 v2201 = minusplus(v2199, v2200); + real2 v2203 = minusplus(uminus(v2199), v2200); + real2 v2263 = minusplus(uminus(v2259), v2260); + real2 v2261 = minusplus(v2259, v2260); + real2 v2243 = minusplus(uminus(v2239), v2240); + real2 v2241 = minusplus(v2239, v2240); + real2 v2257 = ctimesminusplus(reverse(v2243), tbl[400 + tbloffset], ctimes(v2243, tbl[401 + tbloffset])); + real2 v2217 = ctimesminusplus(reverse(v2203), tbl[392 + tbloffset], ctimes(v2203, tbl[393 + tbloffset])); + real2 v2388 = plus(v2217, v2257); + real2 v2384 = minus(v2257, v2217); + real2 v2277 = ctimesminusplus(reverse(v2263), tbl[404 + tbloffset], ctimes(v2263, tbl[405 + tbloffset])); + real2 v2221 = minusplus(v2219, v2220); + real2 v2223 = minusplus(uminus(v2219), v2220); + real2 v2237 = ctimesminusplus(reverse(v2223), tbl[396 + tbloffset], ctimes(v2223, tbl[397 + tbloffset])); + real2 v2389 = plus(v2237, v2277); + real2 v2383 = reverse(minus(v2277, v2237)); + store(out, 25 << outShift, plus(v2388, v2389)); + real2 v2402 = minus(v2388, v2389); + store(out, 89 << outShift, ctimesminusplus(v2402, tbl[0 + tbloffset], ctimes(reverse(v2402), tbl[1 + tbloffset]))); + real2 v2385 = minusplus(v2383, v2384); + real2 v2387 = minusplus(uminus(v2383), v2384); + store(out, 121 << outShift, ctimesminusplus(reverse(v2387), tbl[424 + tbloffset], ctimes(v2387, tbl[425 + tbloffset]))); + store(out, 57 << outShift, ctimesminusplus(reverse(v2385), tbl[422 + tbloffset], ctimes(v2385, tbl[423 + tbloffset]))); + real2 v2251 = ctimesminusplus(reverse(v2241), tbl[398 + tbloffset], ctimes(v2241, tbl[399 + tbloffset])); + real2 v2211 = ctimesminusplus(reverse(v2201), tbl[390 + tbloffset], ctimes(v2201, tbl[391 + tbloffset])); + real2 v2358 = minus(v2251, v2211); + real2 v2362 = plus(v2211, v2251); + real2 v2271 = ctimesminusplus(reverse(v2261), tbl[402 + tbloffset], ctimes(v2261, tbl[403 + tbloffset])); + real2 v2231 = ctimesminusplus(reverse(v2221), tbl[394 + tbloffset], ctimes(v2221, tbl[395 + tbloffset])); + real2 v2357 = reverse(minus(v2271, v2231)); + real2 v2363 = plus(v2231, v2271); + store(out, 9 << outShift, plus(v2362, v2363)); + real2 v2376 = minus(v2362, v2363); + store(out, 73 << outShift, ctimesminusplus(v2376, tbl[0 + tbloffset], ctimes(reverse(v2376), tbl[1 + tbloffset]))); + real2 v2361 = minusplus(uminus(v2357), v2358); + store(out, 105 << outShift, ctimesminusplus(reverse(v2361), tbl[420 + tbloffset], ctimes(v2361, tbl[421 + tbloffset]))); + real2 v2359 = minusplus(v2357, v2358); + store(out, 41 << outShift, ctimesminusplus(reverse(v2359), tbl[418 + tbloffset], ctimes(v2359, tbl[419 + tbloffset]))); + real2 v2121 = minusplus(v2119, v2120); + real2 v2123 = minusplus(uminus(v2119), v2120); + real2 v2083 = minusplus(uminus(v2079), v2080); + real2 v2081 = minusplus(v2079, v2080); + real2 v2091 = ctimesminusplus(reverse(v2081), tbl[366 + tbloffset], ctimes(v2081, tbl[367 + tbloffset])); + real2 v2043 = minusplus(uminus(v2039), v2040); + real2 v2041 = minusplus(v2039, v2040); + real2 v2051 = ctimesminusplus(reverse(v2041), tbl[358 + tbloffset], ctimes(v2041, tbl[359 + tbloffset])); + real2 v2131 = ctimesminusplus(reverse(v2121), tbl[374 + tbloffset], ctimes(v2121, tbl[375 + tbloffset])); + real2 v2163 = minusplus(uminus(v2159), v2160); + real2 v2161 = minusplus(v2159, v2160); + real2 v2171 = ctimesminusplus(reverse(v2161), tbl[382 + tbloffset], ctimes(v2161, tbl[383 + tbloffset])); + real2 v2409 = reverse(minus(v2171, v2091)); + real2 v2415 = plus(v2091, v2171); + real2 v2410 = minus(v2131, v2051); + real2 v2414 = plus(v2051, v2131); + real2 v2454 = plus(v2414, v2415); + real2 v2450 = minus(v2415, v2414); + real2 v2181 = minusplus(v2179, v2180); + real2 v2183 = minusplus(uminus(v2179), v2180); + real2 v2191 = ctimesminusplus(reverse(v2181), tbl[386 + tbloffset], ctimes(v2181, tbl[387 + tbloffset])); + real2 v2103 = minusplus(uminus(v2099), v2100); + real2 v2101 = minusplus(v2099, v2100); + real2 v2111 = ctimesminusplus(reverse(v2101), tbl[370 + tbloffset], ctimes(v2101, tbl[371 + tbloffset])); + real2 v2435 = plus(v2111, v2191); + real2 v2429 = reverse(minus(v2191, v2111)); + real2 v2141 = minusplus(v2139, v2140); + real2 v2143 = minusplus(uminus(v2139), v2140); + real2 v2151 = ctimesminusplus(reverse(v2141), tbl[378 + tbloffset], ctimes(v2141, tbl[379 + tbloffset])); + real2 v2063 = minusplus(uminus(v2059), v2060); + real2 v2061 = minusplus(v2059, v2060); + real2 v2071 = ctimesminusplus(reverse(v2061), tbl[362 + tbloffset], ctimes(v2061, tbl[363 + tbloffset])); + real2 v2434 = plus(v2071, v2151); + real2 v2430 = minus(v2151, v2071); + real2 v2455 = plus(v2434, v2435); + real2 v2449 = reverse(minus(v2435, v2434)); + store(out, 5 << outShift, plus(v2454, v2455)); + real2 v2468 = minus(v2454, v2455); + store(out, 69 << outShift, ctimesminusplus(v2468, tbl[0 + tbloffset], ctimes(reverse(v2468), tbl[1 + tbloffset]))); + real2 v2451 = minusplus(v2449, v2450); + real2 v2453 = minusplus(uminus(v2449), v2450); + store(out, 101 << outShift, ctimesminusplus(reverse(v2453), tbl[436 + tbloffset], ctimes(v2453, tbl[437 + tbloffset]))); + store(out, 37 << outShift, ctimesminusplus(reverse(v2451), tbl[434 + tbloffset], ctimes(v2451, tbl[435 + tbloffset]))); + real2 v2411 = minusplus(v2409, v2410); + real2 v2413 = minusplus(uminus(v2409), v2410); + real2 v2433 = minusplus(uminus(v2429), v2430); + real2 v2431 = minusplus(v2429, v2430); + real2 v2421 = ctimesminusplus(reverse(v2411), tbl[426 + tbloffset], ctimes(v2411, tbl[427 + tbloffset])); + real2 v2441 = ctimesminusplus(reverse(v2431), tbl[430 + tbloffset], ctimes(v2431, tbl[431 + tbloffset])); + store(out, 21 << outShift, plus(v2421, v2441)); + real2 v2474 = minus(v2421, v2441); + store(out, 85 << outShift, ctimesminusplus(v2474, tbl[0 + tbloffset], ctimes(reverse(v2474), tbl[1 + tbloffset]))); + real2 v2427 = ctimesminusplus(reverse(v2413), tbl[428 + tbloffset], ctimes(v2413, tbl[429 + tbloffset])); + real2 v2447 = ctimesminusplus(reverse(v2433), tbl[432 + tbloffset], ctimes(v2433, tbl[433 + tbloffset])); + store(out, 53 << outShift, plus(v2427, v2447)); + real2 v2480 = minus(v2427, v2447); + store(out, 117 << outShift, ctimesminusplus(v2480, tbl[0 + tbloffset], ctimes(reverse(v2480), tbl[1 + tbloffset]))); + real2 v2057 = ctimesminusplus(reverse(v2043), tbl[360 + tbloffset], ctimes(v2043, tbl[361 + tbloffset])); + real2 v2097 = ctimesminusplus(reverse(v2083), tbl[368 + tbloffset], ctimes(v2083, tbl[369 + tbloffset])); + real2 v2157 = ctimesminusplus(reverse(v2143), tbl[380 + tbloffset], ctimes(v2143, tbl[381 + tbloffset])); + real2 v2197 = ctimesminusplus(reverse(v2183), tbl[388 + tbloffset], ctimes(v2183, tbl[389 + tbloffset])); + real2 v2117 = ctimesminusplus(reverse(v2103), tbl[372 + tbloffset], ctimes(v2103, tbl[373 + tbloffset])); + real2 v2507 = reverse(minus(v2197, v2117)); + real2 v2513 = plus(v2117, v2197); + real2 v2137 = ctimesminusplus(reverse(v2123), tbl[376 + tbloffset], ctimes(v2123, tbl[377 + tbloffset])); + real2 v2488 = minus(v2137, v2057); + real2 v2492 = plus(v2057, v2137); + real2 v2177 = ctimesminusplus(reverse(v2163), tbl[384 + tbloffset], ctimes(v2163, tbl[385 + tbloffset])); + real2 v2493 = plus(v2097, v2177); + real2 v2487 = reverse(minus(v2177, v2097)); + real2 v2532 = plus(v2492, v2493); + real2 v2528 = minus(v2493, v2492); + real2 v2077 = ctimesminusplus(reverse(v2063), tbl[364 + tbloffset], ctimes(v2063, tbl[365 + tbloffset])); + real2 v2512 = plus(v2077, v2157); + real2 v2508 = minus(v2157, v2077); + real2 v2527 = reverse(minus(v2513, v2512)); + real2 v2533 = plus(v2512, v2513); + real2 v2529 = minusplus(v2527, v2528); + real2 v2531 = minusplus(uminus(v2527), v2528); + store(out, 109 << outShift, ctimesminusplus(reverse(v2531), tbl[448 + tbloffset], ctimes(v2531, tbl[449 + tbloffset]))); + store(out, 45 << outShift, ctimesminusplus(reverse(v2529), tbl[446 + tbloffset], ctimes(v2529, tbl[447 + tbloffset]))); + store(out, 13 << outShift, plus(v2532, v2533)); + real2 v2546 = minus(v2532, v2533); + store(out, 77 << outShift, ctimesminusplus(v2546, tbl[0 + tbloffset], ctimes(reverse(v2546), tbl[1 + tbloffset]))); + real2 v2509 = minusplus(v2507, v2508); + real2 v2511 = minusplus(uminus(v2507), v2508); + real2 v2491 = minusplus(uminus(v2487), v2488); + real2 v2489 = minusplus(v2487, v2488); + real2 v2499 = ctimesminusplus(reverse(v2489), tbl[438 + tbloffset], ctimes(v2489, tbl[439 + tbloffset])); + real2 v2519 = ctimesminusplus(reverse(v2509), tbl[442 + tbloffset], ctimes(v2509, tbl[443 + tbloffset])); + store(out, 29 << outShift, plus(v2499, v2519)); + real2 v2552 = minus(v2499, v2519); + store(out, 93 << outShift, ctimesminusplus(v2552, tbl[0 + tbloffset], ctimes(reverse(v2552), tbl[1 + tbloffset]))); + real2 v2505 = ctimesminusplus(reverse(v2491), tbl[440 + tbloffset], ctimes(v2491, tbl[441 + tbloffset])); + real2 v2525 = ctimesminusplus(reverse(v2511), tbl[444 + tbloffset], ctimes(v2511, tbl[445 + tbloffset])); + store(out, 61 << outShift, plus(v2505, v2525)); + real2 v2558 = minus(v2505, v2525); + store(out, 125 << outShift, ctimesminusplus(v2558, tbl[0 + tbloffset], ctimes(reverse(v2558), tbl[1 + tbloffset]))); +// Pres : 76263 + } +} + +ALIGNED(8192) void tbut128f_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + +// Pres : 148586 + real2 v56 = load(in, 54 << inShift); + real2 v120 = load(in, 118 << inShift); + real2 v571 = reverse(minus(v56, v120)); + real2 v577 = plus(v56, v120); + real2 v24 = load(in, 22 << inShift); + real2 v88 = load(in, 86 << inShift); + real2 v576 = plus(v24, v88); + real2 v572 = minus(v88, v24); + real2 v573 = minusplus(v571, v572); + real2 v575 = minusplus(uminus(v571), v572); + real2 v589 = timesminusplus(reverse(v575), load(tbl, 92 * VECWIDTH + tbloffset), times(v575, load(tbl, 93 * VECWIDTH + tbloffset))); + real2 v583 = timesminusplus(reverse(v573), load(tbl, 90 * VECWIDTH + tbloffset), times(v573, load(tbl, 91 * VECWIDTH + tbloffset))); + real2 v897 = plus(v576, v577); + real2 v891 = reverse(minus(v576, v577)); + real2 v8 = load(in, 6 << inShift); + real2 v72 = load(in, 70 << inShift); + real2 v252 = minus(v72, v8); + real2 v256 = plus(v8, v72); + real2 v104 = load(in, 102 << inShift); + real2 v40 = load(in, 38 << inShift); + real2 v251 = reverse(minus(v40, v104)); + real2 v257 = plus(v40, v104); + real2 v255 = minusplus(uminus(v251), v252); + real2 v253 = minusplus(v251, v252); + real2 v263 = timesminusplus(reverse(v253), load(tbl, 26 * VECWIDTH + tbloffset), times(v253, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v896 = plus(v256, v257); + real2 v892 = minus(v257, v256); + real2 v895 = minusplus(uminus(v891), v892); + real2 v893 = minusplus(v891, v892); + real2 v909 = timesminusplus(reverse(v895), load(tbl, 156 * VECWIDTH + tbloffset), times(v895, load(tbl, 157 * VECWIDTH + tbloffset))); + real2 v903 = timesminusplus(reverse(v893), load(tbl, 154 * VECWIDTH + tbloffset), times(v893, load(tbl, 155 * VECWIDTH + tbloffset))); + real2 v269 = timesminusplus(reverse(v255), load(tbl, 28 * VECWIDTH + tbloffset), times(v255, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v1216 = plus(v896, v897); + real2 v1212 = minus(v897, v896); + real2 v2160 = minus(v583, v263); + real2 v2164 = plus(v263, v583); + real2 v2686 = minus(v589, v269); + real2 v2690 = plus(v269, v589); + real2 v96 = load(in, 94 << inShift); + real2 v32 = load(in, 30 << inShift); + real2 v736 = plus(v32, v96); + real2 v732 = minus(v96, v32); + real2 v64 = load(in, 62 << inShift); + real2 v128 = load(in, 126 << inShift); + real2 v737 = plus(v64, v128); + real2 v731 = reverse(minus(v64, v128)); + real2 v1057 = plus(v736, v737); + real2 v1051 = reverse(minus(v736, v737)); + real2 v733 = minusplus(v731, v732); + real2 v735 = minusplus(uminus(v731), v732); + real2 v749 = timesminusplus(reverse(v735), load(tbl, 124 * VECWIDTH + tbloffset), times(v735, load(tbl, 125 * VECWIDTH + tbloffset))); + real2 v743 = timesminusplus(reverse(v733), load(tbl, 122 * VECWIDTH + tbloffset), times(v733, load(tbl, 123 * VECWIDTH + tbloffset))); + real2 v16 = load(in, 14 << inShift); + real2 v80 = load(in, 78 << inShift); + real2 v412 = minus(v80, v16); + real2 v416 = plus(v16, v80); + real2 v112 = load(in, 110 << inShift); + real2 v48 = load(in, 46 << inShift); + real2 v417 = plus(v48, v112); + real2 v411 = reverse(minus(v48, v112)); + real2 v1056 = plus(v416, v417); + real2 v1052 = minus(v417, v416); + real2 v1055 = minusplus(uminus(v1051), v1052); + real2 v1053 = minusplus(v1051, v1052); + real2 v1063 = timesminusplus(reverse(v1053), load(tbl, 186 * VECWIDTH + tbloffset), times(v1053, load(tbl, 187 * VECWIDTH + tbloffset))); + real2 v1665 = plus(v903, v1063); + real2 v1659 = reverse(minus(v903, v1063)); + real2 v1069 = timesminusplus(reverse(v1055), load(tbl, 188 * VECWIDTH + tbloffset), times(v1055, load(tbl, 189 * VECWIDTH + tbloffset))); + real2 v1869 = reverse(minus(v909, v1069)); + real2 v1875 = plus(v909, v1069); + real2 v413 = minusplus(v411, v412); + real2 v415 = minusplus(uminus(v411), v412); + real2 v429 = timesminusplus(reverse(v415), load(tbl, 60 * VECWIDTH + tbloffset), times(v415, load(tbl, 61 * VECWIDTH + tbloffset))); + real2 v1217 = plus(v1056, v1057); + real2 v1211 = reverse(minus(v1056, v1057)); + real2 v1297 = plus(v1216, v1217); + real2 v1291 = reverse(minus(v1216, v1217)); + real2 v2691 = plus(v429, v749); + real2 v2685 = reverse(minus(v429, v749)); + real2 v2765 = reverse(minus(v2690, v2691)); + real2 v2771 = plus(v2690, v2691); + real2 v2689 = minusplus(uminus(v2685), v2686); + real2 v2687 = minusplus(v2685, v2686); + real2 v2703 = timesminusplus(reverse(v2689), load(tbl, 476 * VECWIDTH + tbloffset), times(v2689, load(tbl, 477 * VECWIDTH + tbloffset))); + real2 v2697 = timesminusplus(reverse(v2687), load(tbl, 474 * VECWIDTH + tbloffset), times(v2687, load(tbl, 475 * VECWIDTH + tbloffset))); + real2 v1215 = minusplus(uminus(v1211), v1212); + real2 v1213 = minusplus(v1211, v1212); + real2 v1223 = timesminusplus(reverse(v1213), load(tbl, 218 * VECWIDTH + tbloffset), times(v1213, load(tbl, 219 * VECWIDTH + tbloffset))); + real2 v1229 = timesminusplus(reverse(v1215), load(tbl, 220 * VECWIDTH + tbloffset), times(v1215, load(tbl, 221 * VECWIDTH + tbloffset))); + real2 v423 = timesminusplus(reverse(v413), load(tbl, 58 * VECWIDTH + tbloffset), times(v413, load(tbl, 59 * VECWIDTH + tbloffset))); + real2 v2165 = plus(v423, v743); + real2 v2159 = reverse(minus(v423, v743)); + real2 v2245 = plus(v2164, v2165); + real2 v2239 = reverse(minus(v2164, v2165)); + real2 v44 = load(in, 42 << inShift); + real2 v108 = load(in, 106 << inShift); + real2 v331 = reverse(minus(v44, v108)); + real2 v337 = plus(v44, v108); + real2 v76 = load(in, 74 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v336 = plus(v12, v76); + real2 v332 = minus(v76, v12); + real2 v976 = plus(v336, v337); + real2 v972 = minus(v337, v336); + real2 v335 = minusplus(uminus(v331), v332); + real2 v333 = minusplus(v331, v332); + real2 v343 = timesminusplus(reverse(v333), load(tbl, 42 * VECWIDTH + tbloffset), times(v333, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v349 = timesminusplus(reverse(v335), load(tbl, 44 * VECWIDTH + tbloffset), times(v335, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v124 = load(in, 122 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v651 = reverse(minus(v60, v124)); + real2 v657 = plus(v60, v124); + real2 v28 = load(in, 26 << inShift); + real2 v92 = load(in, 90 << inShift); + real2 v652 = minus(v92, v28); + real2 v656 = plus(v28, v92); + real2 v977 = plus(v656, v657); + real2 v971 = reverse(minus(v656, v657)); + real2 v973 = minusplus(v971, v972); + real2 v975 = minusplus(uminus(v971), v972); + real2 v983 = timesminusplus(reverse(v973), load(tbl, 170 * VECWIDTH + tbloffset), times(v973, load(tbl, 171 * VECWIDTH + tbloffset))); + real2 v1131 = reverse(minus(v976, v977)); + real2 v1137 = plus(v976, v977); + real2 v655 = minusplus(uminus(v651), v652); + real2 v653 = minusplus(v651, v652); + real2 v669 = timesminusplus(reverse(v655), load(tbl, 108 * VECWIDTH + tbloffset), times(v655, load(tbl, 109 * VECWIDTH + tbloffset))); + real2 v663 = timesminusplus(reverse(v653), load(tbl, 106 * VECWIDTH + tbloffset), times(v653, load(tbl, 107 * VECWIDTH + tbloffset))); + real2 v2079 = reverse(minus(v343, v663)); + real2 v2085 = plus(v343, v663); + real2 v2605 = reverse(minus(v349, v669)); + real2 v2611 = plus(v349, v669); + real2 v989 = timesminusplus(reverse(v975), load(tbl, 172 * VECWIDTH + tbloffset), times(v975, load(tbl, 173 * VECWIDTH + tbloffset))); + real2 v20 = load(in, 18 << inShift); + real2 v84 = load(in, 82 << inShift); + real2 v496 = plus(v20, v84); + real2 v492 = minus(v84, v20); + real2 v52 = load(in, 50 << inShift); + real2 v116 = load(in, 114 << inShift); + real2 v491 = reverse(minus(v52, v116)); + real2 v497 = plus(v52, v116); + real2 v817 = plus(v496, v497); + real2 v811 = reverse(minus(v496, v497)); + real2 v493 = minusplus(v491, v492); + real2 v495 = minusplus(uminus(v491), v492); + real2 v509 = timesminusplus(reverse(v495), load(tbl, 76 * VECWIDTH + tbloffset), times(v495, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v503 = timesminusplus(reverse(v493), load(tbl, 74 * VECWIDTH + tbloffset), times(v493, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v36 = load(in, 34 << inShift); + real2 v100 = load(in, 98 << inShift); + real2 v171 = reverse(minus(v36, v100)); + real2 v177 = plus(v36, v100); + real2 v68 = load(in, 66 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v176 = plus(v4, v68); + real2 v172 = minus(v68, v4); + real2 v816 = plus(v176, v177); + real2 v812 = minus(v177, v176); + real2 v1136 = plus(v816, v817); + real2 v1132 = minus(v817, v816); + real2 v1133 = minusplus(v1131, v1132); + real2 v1135 = minusplus(uminus(v1131), v1132); + real2 v1149 = timesminusplus(reverse(v1135), load(tbl, 204 * VECWIDTH + tbloffset), times(v1135, load(tbl, 205 * VECWIDTH + tbloffset))); + real2 v1296 = plus(v1136, v1137); + real2 v1292 = minus(v1137, v1136); + real2 v1295 = minusplus(uminus(v1291), v1292); + real2 v1293 = minusplus(v1291, v1292); + real2 v1303 = timesminusplus(reverse(v1293), load(tbl, 234 * VECWIDTH + tbloffset), times(v1293, load(tbl, 235 * VECWIDTH + tbloffset))); + real2 v1331 = reverse(minus(v1296, v1297)); + real2 v1337 = plus(v1296, v1297); + real2 v173 = minusplus(v171, v172); + real2 v175 = minusplus(uminus(v171), v172); + real2 v189 = timesminusplus(reverse(v175), load(tbl, 12 * VECWIDTH + tbloffset), times(v175, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v1309 = timesminusplus(reverse(v1295), load(tbl, 236 * VECWIDTH + tbloffset), times(v1295, load(tbl, 237 * VECWIDTH + tbloffset))); + real2 v815 = minusplus(uminus(v811), v812); + real2 v813 = minusplus(v811, v812); + real2 v1143 = timesminusplus(reverse(v1133), load(tbl, 202 * VECWIDTH + tbloffset), times(v1133, load(tbl, 203 * VECWIDTH + tbloffset))); + real2 v1541 = reverse(minus(v1149, v1229)); + real2 v1547 = plus(v1149, v1229); + real2 v2610 = plus(v189, v509); + real2 v2606 = minus(v509, v189); + real2 v2770 = plus(v2610, v2611); + real2 v2766 = minus(v2611, v2610); + real2 v823 = timesminusplus(reverse(v813), load(tbl, 138 * VECWIDTH + tbloffset), times(v813, load(tbl, 139 * VECWIDTH + tbloffset))); + real2 v829 = timesminusplus(reverse(v815), load(tbl, 140 * VECWIDTH + tbloffset), times(v815, load(tbl, 141 * VECWIDTH + tbloffset))); + real2 v2811 = plus(v2770, v2771); + real2 v2805 = reverse(minus(v2770, v2771)); + real2 v2767 = minusplus(v2765, v2766); + real2 v2769 = minusplus(uminus(v2765), v2766); + real2 v2607 = minusplus(v2605, v2606); + real2 v2609 = minusplus(uminus(v2605), v2606); + real2 v2617 = timesminusplus(reverse(v2607), load(tbl, 458 * VECWIDTH + tbloffset), times(v2607, load(tbl, 459 * VECWIDTH + tbloffset))); + real2 v2623 = timesminusplus(reverse(v2609), load(tbl, 460 * VECWIDTH + tbloffset), times(v2609, load(tbl, 461 * VECWIDTH + tbloffset))); + real2 v3013 = reverse(minus(v2623, v2703)); + real2 v3019 = plus(v2623, v2703); + real2 v2783 = timesminusplus(reverse(v2769), load(tbl, 492 * VECWIDTH + tbloffset), times(v2769, load(tbl, 493 * VECWIDTH + tbloffset))); + real2 v2941 = plus(v2617, v2697); + real2 v2935 = reverse(minus(v2617, v2697)); + real2 v2777 = timesminusplus(reverse(v2767), load(tbl, 490 * VECWIDTH + tbloffset), times(v2767, load(tbl, 491 * VECWIDTH + tbloffset))); + real2 v1660 = minus(v983, v823); + real2 v1664 = plus(v823, v983); + real2 v1874 = plus(v829, v989); + real2 v1870 = minus(v989, v829); + real2 v1909 = reverse(minus(v1874, v1875)); + real2 v1915 = plus(v1874, v1875); + real2 v1663 = minusplus(uminus(v1659), v1660); + real2 v1661 = minusplus(v1659, v1660); + real2 v1677 = timesminusplus(reverse(v1663), load(tbl, 296 * VECWIDTH + tbloffset), times(v1663, load(tbl, 297 * VECWIDTH + tbloffset))); + real2 v1873 = minusplus(uminus(v1869), v1870); + real2 v1871 = minusplus(v1869, v1870); + real2 v1887 = timesminusplus(reverse(v1873), load(tbl, 332 * VECWIDTH + tbloffset), times(v1873, load(tbl, 333 * VECWIDTH + tbloffset))); + real2 v1705 = plus(v1664, v1665); + real2 v1699 = reverse(minus(v1664, v1665)); + real2 v1671 = timesminusplus(reverse(v1661), load(tbl, 294 * VECWIDTH + tbloffset), times(v1661, load(tbl, 295 * VECWIDTH + tbloffset))); + real2 v1881 = timesminusplus(reverse(v1871), load(tbl, 330 * VECWIDTH + tbloffset), times(v1871, load(tbl, 331 * VECWIDTH + tbloffset))); + real2 v1469 = plus(v1143, v1223); + real2 v1463 = reverse(minus(v1143, v1223)); + real2 v54 = load(in, 52 << inShift); + real2 v118 = load(in, 116 << inShift); + real2 v537 = plus(v54, v118); + real2 v531 = reverse(minus(v54, v118)); + real2 v86 = load(in, 84 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v536 = plus(v22, v86); + real2 v532 = minus(v86, v22); + real2 v851 = reverse(minus(v536, v537)); + real2 v857 = plus(v536, v537); + real2 v533 = minusplus(v531, v532); + real2 v535 = minusplus(uminus(v531), v532); + real2 v549 = timesminusplus(reverse(v535), load(tbl, 84 * VECWIDTH + tbloffset), times(v535, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v102 = load(in, 100 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v217 = plus(v38, v102); + real2 v211 = reverse(minus(v38, v102)); + real2 v70 = load(in, 68 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v216 = plus(v6, v70); + real2 v212 = minus(v70, v6); + real2 v213 = minusplus(v211, v212); + real2 v215 = minusplus(uminus(v211), v212); + real2 v229 = timesminusplus(reverse(v215), load(tbl, 20 * VECWIDTH + tbloffset), times(v215, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v2646 = minus(v549, v229); + real2 v2650 = plus(v229, v549); + real2 v856 = plus(v216, v217); + real2 v852 = minus(v217, v216); + real2 v853 = minusplus(v851, v852); + real2 v855 = minusplus(uminus(v851), v852); + real2 v863 = timesminusplus(reverse(v853), load(tbl, 146 * VECWIDTH + tbloffset), times(v853, load(tbl, 147 * VECWIDTH + tbloffset))); + real2 v869 = timesminusplus(reverse(v855), load(tbl, 148 * VECWIDTH + tbloffset), times(v855, load(tbl, 149 * VECWIDTH + tbloffset))); + real2 v1176 = plus(v856, v857); + real2 v1172 = minus(v857, v856); + real2 v110 = load(in, 108 << inShift); + real2 v46 = load(in, 44 << inShift); + real2 v377 = plus(v46, v110); + real2 v371 = reverse(minus(v46, v110)); + real2 v78 = load(in, 76 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v372 = minus(v78, v14); + real2 v376 = plus(v14, v78); + real2 v1012 = minus(v377, v376); + real2 v1016 = plus(v376, v377); + real2 v373 = minusplus(v371, v372); + real2 v375 = minusplus(uminus(v371), v372); + real2 v389 = timesminusplus(reverse(v375), load(tbl, 52 * VECWIDTH + tbloffset), times(v375, load(tbl, 53 * VECWIDTH + tbloffset))); + real2 v30 = load(in, 28 << inShift); + real2 v94 = load(in, 92 << inShift); + real2 v696 = plus(v30, v94); + real2 v692 = minus(v94, v30); + real2 v62 = load(in, 60 << inShift); + real2 v126 = load(in, 124 << inShift); + real2 v697 = plus(v62, v126); + real2 v691 = reverse(minus(v62, v126)); + real2 v1017 = plus(v696, v697); + real2 v1011 = reverse(minus(v696, v697)); + real2 v1171 = reverse(minus(v1016, v1017)); + real2 v1177 = plus(v1016, v1017); + real2 v1013 = minusplus(v1011, v1012); + real2 v1015 = minusplus(uminus(v1011), v1012); + real2 v1175 = minusplus(uminus(v1171), v1172); + real2 v1173 = minusplus(v1171, v1172); + real2 v1183 = timesminusplus(reverse(v1173), load(tbl, 210 * VECWIDTH + tbloffset), times(v1173, load(tbl, 211 * VECWIDTH + tbloffset))); + real2 v1189 = timesminusplus(reverse(v1175), load(tbl, 212 * VECWIDTH + tbloffset), times(v1175, load(tbl, 213 * VECWIDTH + tbloffset))); + real2 v1029 = timesminusplus(reverse(v1015), load(tbl, 180 * VECWIDTH + tbloffset), times(v1015, load(tbl, 181 * VECWIDTH + tbloffset))); + real2 v1023 = timesminusplus(reverse(v1013), load(tbl, 178 * VECWIDTH + tbloffset), times(v1013, load(tbl, 179 * VECWIDTH + tbloffset))); + real2 v1625 = plus(v863, v1023); + real2 v1619 = reverse(minus(v863, v1023)); + real2 v1835 = plus(v869, v1029); + real2 v1829 = reverse(minus(v869, v1029)); + real2 v693 = minusplus(v691, v692); + real2 v695 = minusplus(uminus(v691), v692); + real2 v709 = timesminusplus(reverse(v695), load(tbl, 116 * VECWIDTH + tbloffset), times(v695, load(tbl, 117 * VECWIDTH + tbloffset))); + real2 v2645 = reverse(minus(v389, v709)); + real2 v2651 = plus(v389, v709); + real2 v1257 = plus(v1176, v1177); + real2 v1251 = reverse(minus(v1176, v1177)); + real2 v2731 = plus(v2650, v2651); + real2 v2725 = reverse(minus(v2650, v2651)); + real2 v114 = load(in, 112 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v457 = plus(v50, v114); + real2 v451 = reverse(minus(v50, v114)); + real2 v18 = load(in, 16 << inShift); + real2 v82 = load(in, 80 << inShift); + real2 v456 = plus(v18, v82); + real2 v452 = minus(v82, v18); + real2 v771 = reverse(minus(v456, v457)); + real2 v777 = plus(v456, v457); + real2 v453 = minusplus(v451, v452); + real2 v455 = minusplus(uminus(v451), v452); + real2 v469 = timesminusplus(reverse(v455), load(tbl, 68 * VECWIDTH + tbloffset), times(v455, load(tbl, 69 * VECWIDTH + tbloffset))); + real2 v66 = load(in, 64 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v131 = reverse(minus(v34, v98)); + real2 v137 = plus(v34, v98); + real2 v133 = minusplus(v131, v132); + real2 v135 = minusplus(uminus(v131), v132); + real2 v149 = timesminusplus(reverse(v135), load(tbl, 4 * VECWIDTH + tbloffset), times(v135, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v2566 = minus(v469, v149); + real2 v2570 = plus(v149, v469); + real2 v772 = minus(v137, v136); + real2 v776 = plus(v136, v137); + real2 v1092 = minus(v777, v776); + real2 v1096 = plus(v776, v777); + real2 v773 = minusplus(v771, v772); + real2 v775 = minusplus(uminus(v771), v772); + real2 v783 = timesminusplus(reverse(v773), load(tbl, 130 * VECWIDTH + tbloffset), times(v773, load(tbl, 131 * VECWIDTH + tbloffset))); + real2 v789 = timesminusplus(reverse(v775), load(tbl, 132 * VECWIDTH + tbloffset), times(v775, load(tbl, 133 * VECWIDTH + tbloffset))); + real2 v74 = load(in, 72 << inShift); + real2 v10 = load(in, 8 << inShift); + real2 v296 = plus(v10, v74); + real2 v292 = minus(v74, v10); + real2 v42 = load(in, 40 << inShift); + real2 v106 = load(in, 104 << inShift); + real2 v291 = reverse(minus(v42, v106)); + real2 v297 = plus(v42, v106); + real2 v293 = minusplus(v291, v292); + real2 v295 = minusplus(uminus(v291), v292); + real2 v309 = timesminusplus(reverse(v295), load(tbl, 36 * VECWIDTH + tbloffset), times(v295, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v932 = minus(v297, v296); + real2 v936 = plus(v296, v297); + real2 v122 = load(in, 120 << inShift); + real2 v58 = load(in, 56 << inShift); + real2 v617 = plus(v58, v122); + real2 v611 = reverse(minus(v58, v122)); + real2 v26 = load(in, 24 << inShift); + real2 v90 = load(in, 88 << inShift); + real2 v612 = minus(v90, v26); + real2 v616 = plus(v26, v90); + real2 v937 = plus(v616, v617); + real2 v931 = reverse(minus(v616, v617)); + real2 v1091 = reverse(minus(v936, v937)); + real2 v1097 = plus(v936, v937); + real2 v933 = minusplus(v931, v932); + real2 v935 = minusplus(uminus(v931), v932); + real2 v1093 = minusplus(v1091, v1092); + real2 v1095 = minusplus(uminus(v1091), v1092); + real2 v1103 = timesminusplus(reverse(v1093), load(tbl, 194 * VECWIDTH + tbloffset), times(v1093, load(tbl, 195 * VECWIDTH + tbloffset))); + real2 v1468 = plus(v1103, v1183); + real2 v1464 = minus(v1183, v1103); + real2 v1508 = plus(v1468, v1469); + real2 v1504 = minus(v1469, v1468); + real2 v1252 = minus(v1097, v1096); + real2 v1256 = plus(v1096, v1097); + real2 v1336 = plus(v1256, v1257); + real2 v1332 = minus(v1257, v1256); + real2 v1335 = minusplus(uminus(v1331), v1332); + real2 v1333 = minusplus(v1331, v1332); + real2 v1343 = timesminusplus(reverse(v1333), load(tbl, 242 * VECWIDTH + tbloffset), times(v1333, load(tbl, 243 * VECWIDTH + tbloffset))); + real2 v1349 = timesminusplus(reverse(v1335), load(tbl, 244 * VECWIDTH + tbloffset), times(v1335, load(tbl, 245 * VECWIDTH + tbloffset))); + real2 v1376 = plus(v1336, v1337); + real2 v1372 = minus(v1337, v1336); + real2 v1465 = minusplus(v1463, v1464); + real2 v1467 = minusplus(uminus(v1463), v1464); + real2 v1255 = minusplus(uminus(v1251), v1252); + real2 v1253 = minusplus(v1251, v1252); + real2 v1481 = timesminusplus(reverse(v1467), load(tbl, 264 * VECWIDTH + tbloffset), times(v1467, load(tbl, 265 * VECWIDTH + tbloffset))); + real2 v1475 = timesminusplus(reverse(v1465), load(tbl, 262 * VECWIDTH + tbloffset), times(v1465, load(tbl, 263 * VECWIDTH + tbloffset))); + real2 v1109 = timesminusplus(reverse(v1095), load(tbl, 196 * VECWIDTH + tbloffset), times(v1095, load(tbl, 197 * VECWIDTH + tbloffset))); + real2 v1542 = minus(v1189, v1109); + real2 v1546 = plus(v1109, v1189); + real2 v1545 = minusplus(uminus(v1541), v1542); + real2 v1543 = minusplus(v1541, v1542); + real2 v1553 = timesminusplus(reverse(v1543), load(tbl, 274 * VECWIDTH + tbloffset), times(v1543, load(tbl, 275 * VECWIDTH + tbloffset))); + real2 v1559 = timesminusplus(reverse(v1545), load(tbl, 276 * VECWIDTH + tbloffset), times(v1545, load(tbl, 277 * VECWIDTH + tbloffset))); + real2 v1582 = minus(v1547, v1546); + real2 v1586 = plus(v1546, v1547); + real2 v1269 = timesminusplus(reverse(v1255), load(tbl, 228 * VECWIDTH + tbloffset), times(v1255, load(tbl, 229 * VECWIDTH + tbloffset))); + real2 v1438 = minus(v1309, v1269); + real2 v1442 = plus(v1269, v1309); + real2 v1263 = timesminusplus(reverse(v1253), load(tbl, 226 * VECWIDTH + tbloffset), times(v1253, load(tbl, 227 * VECWIDTH + tbloffset))); + real2 v943 = timesminusplus(reverse(v933), load(tbl, 162 * VECWIDTH + tbloffset), times(v933, load(tbl, 163 * VECWIDTH + tbloffset))); + real2 v1624 = plus(v783, v943); + real2 v1620 = minus(v943, v783); + real2 v1623 = minusplus(uminus(v1619), v1620); + real2 v1621 = minusplus(v1619, v1620); + real2 v1700 = minus(v1625, v1624); + real2 v1704 = plus(v1624, v1625); + real2 v1631 = timesminusplus(reverse(v1621), load(tbl, 286 * VECWIDTH + tbloffset), times(v1621, load(tbl, 287 * VECWIDTH + tbloffset))); + real2 v949 = timesminusplus(reverse(v935), load(tbl, 164 * VECWIDTH + tbloffset), times(v935, load(tbl, 165 * VECWIDTH + tbloffset))); + real2 v1830 = minus(v949, v789); + real2 v1834 = plus(v789, v949); + real2 v1782 = plus(v1631, v1671); + real2 v1778 = minus(v1671, v1631); + real2 v1910 = minus(v1835, v1834); + real2 v1914 = plus(v1834, v1835); + real2 v1950 = minus(v1915, v1914); + real2 v1954 = plus(v1914, v1915); + real2 v1913 = minusplus(uminus(v1909), v1910); + real2 v1911 = minusplus(v1909, v1910); + real2 v613 = minusplus(v611, v612); + real2 v615 = minusplus(uminus(v611), v612); + real2 v629 = timesminusplus(reverse(v615), load(tbl, 100 * VECWIDTH + tbloffset), times(v615, load(tbl, 101 * VECWIDTH + tbloffset))); + real2 v1744 = plus(v1704, v1705); + real2 v1740 = minus(v1705, v1704); + real2 v1637 = timesminusplus(reverse(v1623), load(tbl, 288 * VECWIDTH + tbloffset), times(v1623, load(tbl, 289 * VECWIDTH + tbloffset))); + real2 v1927 = timesminusplus(reverse(v1913), load(tbl, 340 * VECWIDTH + tbloffset), times(v1913, load(tbl, 341 * VECWIDTH + tbloffset))); + real2 v2571 = plus(v309, v629); + real2 v2565 = reverse(minus(v309, v629)); + real2 v1833 = minusplus(uminus(v1829), v1830); + real2 v1831 = minusplus(v1829, v1830); + real2 v1921 = timesminusplus(reverse(v1911), load(tbl, 338 * VECWIDTH + tbloffset), times(v1911, load(tbl, 339 * VECWIDTH + tbloffset))); + real2 v1804 = minus(v1677, v1637); + real2 v1808 = plus(v1637, v1677); + real2 v1847 = timesminusplus(reverse(v1833), load(tbl, 324 * VECWIDTH + tbloffset), times(v1833, load(tbl, 325 * VECWIDTH + tbloffset))); + real2 v2014 = minus(v1887, v1847); + real2 v2018 = plus(v1847, v1887); + real2 v1841 = timesminusplus(reverse(v1831), load(tbl, 322 * VECWIDTH + tbloffset), times(v1831, load(tbl, 323 * VECWIDTH + tbloffset))); + real2 v1988 = minus(v1881, v1841); + real2 v1992 = plus(v1841, v1881); + real2 v1703 = minusplus(uminus(v1699), v1700); + real2 v1701 = minusplus(v1699, v1700); + real2 v1717 = timesminusplus(reverse(v1703), load(tbl, 304 * VECWIDTH + tbloffset), times(v1703, load(tbl, 305 * VECWIDTH + tbloffset))); + real2 v1711 = timesminusplus(reverse(v1701), load(tbl, 302 * VECWIDTH + tbloffset), times(v1701, load(tbl, 303 * VECWIDTH + tbloffset))); + real2 v2730 = plus(v2570, v2571); + real2 v2726 = minus(v2571, v2570); + real2 v1412 = minus(v1303, v1263); + real2 v1416 = plus(v1263, v1303); + real2 v63 = load(in, 61 << inShift); + real2 v127 = load(in, 125 << inShift); + real2 v717 = plus(v63, v127); + real2 v711 = reverse(minus(v63, v127)); + real2 v95 = load(in, 93 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v712 = minus(v95, v31); + real2 v716 = plus(v31, v95); + real2 v1037 = plus(v716, v717); + real2 v1031 = reverse(minus(v716, v717)); + real2 v79 = load(in, 77 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v396 = plus(v15, v79); + real2 v392 = minus(v79, v15); + real2 v111 = load(in, 109 << inShift); + real2 v47 = load(in, 45 << inShift); + real2 v397 = plus(v47, v111); + real2 v391 = reverse(minus(v47, v111)); + real2 v1032 = minus(v397, v396); + real2 v1036 = plus(v396, v397); + real2 v1033 = minusplus(v1031, v1032); + real2 v1035 = minusplus(uminus(v1031), v1032); + real2 v1049 = timesminusplus(reverse(v1035), load(tbl, 184 * VECWIDTH + tbloffset), times(v1035, load(tbl, 185 * VECWIDTH + tbloffset))); + real2 v1043 = timesminusplus(reverse(v1033), load(tbl, 182 * VECWIDTH + tbloffset), times(v1033, load(tbl, 183 * VECWIDTH + tbloffset))); + real2 v1197 = plus(v1036, v1037); + real2 v1191 = reverse(minus(v1036, v1037)); + real2 v23 = load(in, 21 << inShift); + real2 v87 = load(in, 85 << inShift); + real2 v556 = plus(v23, v87); + real2 v552 = minus(v87, v23); + real2 v119 = load(in, 117 << inShift); + real2 v55 = load(in, 53 << inShift); + real2 v557 = plus(v55, v119); + real2 v551 = reverse(minus(v55, v119)); + real2 v877 = plus(v556, v557); + real2 v871 = reverse(minus(v556, v557)); + real2 v7 = load(in, 5 << inShift); + real2 v71 = load(in, 69 << inShift); + real2 v232 = minus(v71, v7); + real2 v236 = plus(v7, v71); + real2 v103 = load(in, 101 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v237 = plus(v39, v103); + real2 v231 = reverse(minus(v39, v103)); + real2 v876 = plus(v236, v237); + real2 v872 = minus(v237, v236); + real2 v1192 = minus(v877, v876); + real2 v1196 = plus(v876, v877); + real2 v1271 = reverse(minus(v1196, v1197)); + real2 v1277 = plus(v1196, v1197); + real2 v875 = minusplus(uminus(v871), v872); + real2 v873 = minusplus(v871, v872); + real2 v883 = timesminusplus(reverse(v873), load(tbl, 150 * VECWIDTH + tbloffset), times(v873, load(tbl, 151 * VECWIDTH + tbloffset))); + real2 v1639 = reverse(minus(v883, v1043)); + real2 v1645 = plus(v883, v1043); + real2 v1195 = minusplus(uminus(v1191), v1192); + real2 v1193 = minusplus(v1191, v1192); + real2 v1209 = timesminusplus(reverse(v1195), load(tbl, 216 * VECWIDTH + tbloffset), times(v1195, load(tbl, 217 * VECWIDTH + tbloffset))); + real2 v1203 = timesminusplus(reverse(v1193), load(tbl, 214 * VECWIDTH + tbloffset), times(v1193, load(tbl, 215 * VECWIDTH + tbloffset))); + real2 v83 = load(in, 81 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v476 = plus(v19, v83); + real2 v472 = minus(v83, v19); + real2 v51 = load(in, 49 << inShift); + real2 v115 = load(in, 113 << inShift); + real2 v477 = plus(v51, v115); + real2 v471 = reverse(minus(v51, v115)); + real2 v797 = plus(v476, v477); + real2 v791 = reverse(minus(v476, v477)); + real2 v3 = load(in, 1 << inShift); + real2 v67 = load(in, 65 << inShift); + real2 v156 = plus(v3, v67); + real2 v152 = minus(v67, v3); + real2 v35 = load(in, 33 << inShift); + real2 v99 = load(in, 97 << inShift); + real2 v157 = plus(v35, v99); + real2 v151 = reverse(minus(v35, v99)); + real2 v792 = minus(v157, v156); + real2 v796 = plus(v156, v157); + real2 v793 = minusplus(v791, v792); + real2 v795 = minusplus(uminus(v791), v792); + real2 v803 = timesminusplus(reverse(v793), load(tbl, 134 * VECWIDTH + tbloffset), times(v793, load(tbl, 135 * VECWIDTH + tbloffset))); + real2 v1112 = minus(v797, v796); + real2 v1116 = plus(v796, v797); + real2 v107 = load(in, 105 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v317 = plus(v43, v107); + real2 v311 = reverse(minus(v43, v107)); + real2 v75 = load(in, 73 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v316 = plus(v11, v75); + real2 v312 = minus(v75, v11); + real2 v956 = plus(v316, v317); + real2 v952 = minus(v317, v316); + real2 v59 = load(in, 57 << inShift); + real2 v123 = load(in, 121 << inShift); + real2 v631 = reverse(minus(v59, v123)); + real2 v637 = plus(v59, v123); + real2 v27 = load(in, 25 << inShift); + real2 v91 = load(in, 89 << inShift); + real2 v636 = plus(v27, v91); + real2 v632 = minus(v91, v27); + real2 v957 = plus(v636, v637); + real2 v951 = reverse(minus(v636, v637)); + real2 v1111 = reverse(minus(v956, v957)); + real2 v1117 = plus(v956, v957); + real2 v1276 = plus(v1116, v1117); + real2 v1272 = minus(v1117, v1116); + real2 v1275 = minusplus(uminus(v1271), v1272); + real2 v1273 = minusplus(v1271, v1272); + real2 v1283 = timesminusplus(reverse(v1273), load(tbl, 230 * VECWIDTH + tbloffset), times(v1273, load(tbl, 231 * VECWIDTH + tbloffset))); + real2 v1352 = minus(v1277, v1276); + real2 v1356 = plus(v1276, v1277); + real2 v1289 = timesminusplus(reverse(v1275), load(tbl, 232 * VECWIDTH + tbloffset), times(v1275, load(tbl, 233 * VECWIDTH + tbloffset))); + real2 v1115 = minusplus(uminus(v1111), v1112); + real2 v1113 = minusplus(v1111, v1112); + real2 v1123 = timesminusplus(reverse(v1113), load(tbl, 198 * VECWIDTH + tbloffset), times(v1113, load(tbl, 199 * VECWIDTH + tbloffset))); + real2 v1129 = timesminusplus(reverse(v1115), load(tbl, 200 * VECWIDTH + tbloffset), times(v1115, load(tbl, 201 * VECWIDTH + tbloffset))); + real2 v1488 = plus(v1123, v1203); + real2 v1484 = minus(v1203, v1123); + real2 v1566 = plus(v1129, v1209); + real2 v1562 = minus(v1209, v1129); + real2 v85 = load(in, 83 << inShift); + real2 v21 = load(in, 19 << inShift); + real2 v512 = minus(v85, v21); + real2 v516 = plus(v21, v85); + real2 v117 = load(in, 115 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v517 = plus(v53, v117); + real2 v511 = reverse(minus(v53, v117)); + real2 v831 = reverse(minus(v516, v517)); + real2 v837 = plus(v516, v517); + real2 v69 = load(in, 67 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v192 = minus(v69, v5); + real2 v196 = plus(v5, v69); + real2 v37 = load(in, 35 << inShift); + real2 v101 = load(in, 99 << inShift); + real2 v197 = plus(v37, v101); + real2 v191 = reverse(minus(v37, v101)); + real2 v832 = minus(v197, v196); + real2 v836 = plus(v196, v197); + real2 v1152 = minus(v837, v836); + real2 v1156 = plus(v836, v837); + real2 v61 = load(in, 59 << inShift); + real2 v125 = load(in, 123 << inShift); + real2 v677 = plus(v61, v125); + real2 v671 = reverse(minus(v61, v125)); + real2 v29 = load(in, 27 << inShift); + real2 v93 = load(in, 91 << inShift); + real2 v672 = minus(v93, v29); + real2 v676 = plus(v29, v93); + real2 v997 = plus(v676, v677); + real2 v991 = reverse(minus(v676, v677)); + real2 v109 = load(in, 107 << inShift); + real2 v45 = load(in, 43 << inShift); + real2 v357 = plus(v45, v109); + real2 v351 = reverse(minus(v45, v109)); + real2 v77 = load(in, 75 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v352 = minus(v77, v13); + real2 v356 = plus(v13, v77); + real2 v992 = minus(v357, v356); + real2 v996 = plus(v356, v357); + real2 v1157 = plus(v996, v997); + real2 v1151 = reverse(minus(v996, v997)); + real2 v1155 = minusplus(uminus(v1151), v1152); + real2 v1153 = minusplus(v1151, v1152); + real2 v1163 = timesminusplus(reverse(v1153), load(tbl, 206 * VECWIDTH + tbloffset), times(v1153, load(tbl, 207 * VECWIDTH + tbloffset))); + real2 v1316 = plus(v1156, v1157); + real2 v1312 = minus(v1157, v1156); + real2 v41 = load(in, 39 << inShift); + real2 v105 = load(in, 103 << inShift); + real2 v277 = plus(v41, v105); + real2 v271 = reverse(minus(v41, v105)); + real2 v9 = load(in, 7 << inShift); + real2 v73 = load(in, 71 << inShift); + real2 v276 = plus(v9, v73); + real2 v272 = minus(v73, v9); + real2 v916 = plus(v276, v277); + real2 v912 = minus(v277, v276); + real2 v89 = load(in, 87 << inShift); + real2 v25 = load(in, 23 << inShift); + real2 v592 = minus(v89, v25); + real2 v596 = plus(v25, v89); + real2 v57 = load(in, 55 << inShift); + real2 v121 = load(in, 119 << inShift); + real2 v591 = reverse(minus(v57, v121)); + real2 v597 = plus(v57, v121); + real2 v911 = reverse(minus(v596, v597)); + real2 v917 = plus(v596, v597); + real2 v1236 = plus(v916, v917); + real2 v1232 = minus(v917, v916); + real2 v81 = load(in, 79 << inShift); + real2 v17 = load(in, 15 << inShift); + real2 v432 = minus(v81, v17); + real2 v436 = plus(v17, v81); + real2 v113 = load(in, 111 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v437 = plus(v49, v113); + real2 v431 = reverse(minus(v49, v113)); + real2 v1072 = minus(v437, v436); + real2 v1076 = plus(v436, v437); + real2 v65 = load(in, 63 << inShift); + real2 v129 = load(in, 127 << inShift); + real2 v757 = plus(v65, v129); + real2 v751 = reverse(minus(v65, v129)); + real2 v97 = load(in, 95 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v752 = minus(v97, v33); + real2 v756 = plus(v33, v97); + real2 v1077 = plus(v756, v757); + real2 v1071 = reverse(minus(v756, v757)); + real2 v1231 = reverse(minus(v1076, v1077)); + real2 v1237 = plus(v1076, v1077); + real2 v1317 = plus(v1236, v1237); + real2 v1311 = reverse(minus(v1236, v1237)); + real2 v1351 = reverse(minus(v1316, v1317)); + real2 v1357 = plus(v1316, v1317); + real2 v1371 = reverse(minus(v1356, v1357)); + real2 v1377 = plus(v1356, v1357); + scatter(out, 0, 128, plus(v1376, v1377)); + real2 v1390 = minus(v1376, v1377); + scatter(out, 64, 128, timesminusplus(v1390, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1390), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1353 = minusplus(v1351, v1352); + real2 v1355 = minusplus(uminus(v1351), v1352); + real2 v1369 = timesminusplus(reverse(v1355), load(tbl, 248 * VECWIDTH + tbloffset), times(v1355, load(tbl, 249 * VECWIDTH + tbloffset))); + scatter(out, 48, 128, plus(v1349, v1369)); + real2 v1404 = minus(v1349, v1369); + scatter(out, 112, 128, timesminusplus(v1404, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1404), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1363 = timesminusplus(reverse(v1353), load(tbl, 246 * VECWIDTH + tbloffset), times(v1353, load(tbl, 247 * VECWIDTH + tbloffset))); + scatter(out, 16, 128, plus(v1343, v1363)); + real2 v1398 = minus(v1343, v1363); + scatter(out, 80, 128, timesminusplus(v1398, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1398), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1373 = minusplus(v1371, v1372); + real2 v1375 = minusplus(uminus(v1371), v1372); + scatter(out, 96, 128, timesminusplus(reverse(v1375), load(tbl, 252 * VECWIDTH + tbloffset), times(v1375, load(tbl, 253 * VECWIDTH + tbloffset)))); + scatter(out, 32, 128, timesminusplus(reverse(v1373), load(tbl, 250 * VECWIDTH + tbloffset), times(v1373, load(tbl, 251 * VECWIDTH + tbloffset)))); + real2 v1313 = minusplus(v1311, v1312); + real2 v1315 = minusplus(uminus(v1311), v1312); + real2 v1323 = timesminusplus(reverse(v1313), load(tbl, 238 * VECWIDTH + tbloffset), times(v1313, load(tbl, 239 * VECWIDTH + tbloffset))); + real2 v1417 = plus(v1283, v1323); + real2 v1411 = reverse(minus(v1283, v1323)); + scatter(out, 8, 128, plus(v1416, v1417)); + real2 v1430 = minus(v1416, v1417); + scatter(out, 72, 128, timesminusplus(v1430, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1430), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1413 = minusplus(v1411, v1412); + real2 v1415 = minusplus(uminus(v1411), v1412); + scatter(out, 104, 128, timesminusplus(reverse(v1415), load(tbl, 256 * VECWIDTH + tbloffset), times(v1415, load(tbl, 257 * VECWIDTH + tbloffset)))); + scatter(out, 40, 128, timesminusplus(reverse(v1413), load(tbl, 254 * VECWIDTH + tbloffset), times(v1413, load(tbl, 255 * VECWIDTH + tbloffset)))); + real2 v1329 = timesminusplus(reverse(v1315), load(tbl, 240 * VECWIDTH + tbloffset), times(v1315, load(tbl, 241 * VECWIDTH + tbloffset))); + real2 v1443 = plus(v1289, v1329); + real2 v1437 = reverse(minus(v1289, v1329)); + scatter(out, 24, 128, plus(v1442, v1443)); + real2 v1456 = minus(v1442, v1443); + scatter(out, 88, 128, timesminusplus(v1456, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1456), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1441 = minusplus(uminus(v1437), v1438); + real2 v1439 = minusplus(v1437, v1438); + scatter(out, 120, 128, timesminusplus(reverse(v1441), load(tbl, 260 * VECWIDTH + tbloffset), times(v1441, load(tbl, 261 * VECWIDTH + tbloffset)))); + scatter(out, 56, 128, timesminusplus(reverse(v1439), load(tbl, 258 * VECWIDTH + tbloffset), times(v1439, load(tbl, 259 * VECWIDTH + tbloffset)))); + real2 v1235 = minusplus(uminus(v1231), v1232); + real2 v1233 = minusplus(v1231, v1232); + real2 v1243 = timesminusplus(reverse(v1233), load(tbl, 222 * VECWIDTH + tbloffset), times(v1233, load(tbl, 223 * VECWIDTH + tbloffset))); + real2 v1489 = plus(v1163, v1243); + real2 v1483 = reverse(minus(v1163, v1243)); + real2 v1509 = plus(v1488, v1489); + real2 v1503 = reverse(minus(v1488, v1489)); + scatter(out, 4, 128, plus(v1508, v1509)); + real2 v1522 = minus(v1508, v1509); + scatter(out, 68, 128, timesminusplus(v1522, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1522), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1507 = minusplus(uminus(v1503), v1504); + real2 v1505 = minusplus(v1503, v1504); + scatter(out, 36, 128, timesminusplus(reverse(v1505), load(tbl, 270 * VECWIDTH + tbloffset), times(v1505, load(tbl, 271 * VECWIDTH + tbloffset)))); + scatter(out, 100, 128, timesminusplus(reverse(v1507), load(tbl, 272 * VECWIDTH + tbloffset), times(v1507, load(tbl, 273 * VECWIDTH + tbloffset)))); + real2 v1485 = minusplus(v1483, v1484); + real2 v1487 = minusplus(uminus(v1483), v1484); + real2 v1501 = timesminusplus(reverse(v1487), load(tbl, 268 * VECWIDTH + tbloffset), times(v1487, load(tbl, 269 * VECWIDTH + tbloffset))); + scatter(out, 52, 128, plus(v1481, v1501)); + real2 v1534 = minus(v1481, v1501); + scatter(out, 116, 128, timesminusplus(v1534, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1534), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1495 = timesminusplus(reverse(v1485), load(tbl, 266 * VECWIDTH + tbloffset), times(v1485, load(tbl, 267 * VECWIDTH + tbloffset))); + scatter(out, 20, 128, plus(v1475, v1495)); + real2 v1528 = minus(v1475, v1495); + scatter(out, 84, 128, timesminusplus(v1528, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1528), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1249 = timesminusplus(reverse(v1235), load(tbl, 224 * VECWIDTH + tbloffset), times(v1235, load(tbl, 225 * VECWIDTH + tbloffset))); + real2 v1169 = timesminusplus(reverse(v1155), load(tbl, 208 * VECWIDTH + tbloffset), times(v1155, load(tbl, 209 * VECWIDTH + tbloffset))); + real2 v1567 = plus(v1169, v1249); + real2 v1561 = reverse(minus(v1169, v1249)); + real2 v1581 = reverse(minus(v1566, v1567)); + real2 v1587 = plus(v1566, v1567); + scatter(out, 12, 128, plus(v1586, v1587)); + real2 v1600 = minus(v1586, v1587); + scatter(out, 76, 128, timesminusplus(v1600, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1600), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1583 = minusplus(v1581, v1582); + scatter(out, 44, 128, timesminusplus(reverse(v1583), load(tbl, 282 * VECWIDTH + tbloffset), times(v1583, load(tbl, 283 * VECWIDTH + tbloffset)))); + real2 v1585 = minusplus(uminus(v1581), v1582); + scatter(out, 108, 128, timesminusplus(reverse(v1585), load(tbl, 284 * VECWIDTH + tbloffset), times(v1585, load(tbl, 285 * VECWIDTH + tbloffset)))); + real2 v1565 = minusplus(uminus(v1561), v1562); + real2 v1563 = minusplus(v1561, v1562); + real2 v1579 = timesminusplus(reverse(v1565), load(tbl, 280 * VECWIDTH + tbloffset), times(v1565, load(tbl, 281 * VECWIDTH + tbloffset))); + scatter(out, 60, 128, plus(v1559, v1579)); + real2 v1612 = minus(v1559, v1579); + scatter(out, 124, 128, timesminusplus(v1612, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1612), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1573 = timesminusplus(reverse(v1563), load(tbl, 278 * VECWIDTH + tbloffset), times(v1563, load(tbl, 279 * VECWIDTH + tbloffset))); + scatter(out, 28, 128, plus(v1553, v1573)); + real2 v1606 = minus(v1553, v1573); + scatter(out, 92, 128, timesminusplus(v1606, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1606), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v833 = minusplus(v831, v832); + real2 v835 = minusplus(uminus(v831), v832); + real2 v955 = minusplus(uminus(v951), v952); + real2 v953 = minusplus(v951, v952); + real2 v963 = timesminusplus(reverse(v953), load(tbl, 166 * VECWIDTH + tbloffset), times(v953, load(tbl, 167 * VECWIDTH + tbloffset))); + real2 v995 = minusplus(uminus(v991), v992); + real2 v993 = minusplus(v991, v992); + real2 v1003 = timesminusplus(reverse(v993), load(tbl, 174 * VECWIDTH + tbloffset), times(v993, load(tbl, 175 * VECWIDTH + tbloffset))); + real2 v843 = timesminusplus(reverse(v833), load(tbl, 142 * VECWIDTH + tbloffset), times(v833, load(tbl, 143 * VECWIDTH + tbloffset))); + real2 v1640 = minus(v963, v803); + real2 v1644 = plus(v803, v963); + real2 v1680 = minus(v1003, v843); + real2 v1684 = plus(v843, v1003); + real2 v1641 = minusplus(v1639, v1640); + real2 v1643 = minusplus(uminus(v1639), v1640); + real2 v1657 = timesminusplus(reverse(v1643), load(tbl, 292 * VECWIDTH + tbloffset), times(v1643, load(tbl, 293 * VECWIDTH + tbloffset))); + real2 v913 = minusplus(v911, v912); + real2 v915 = minusplus(uminus(v911), v912); + real2 v1073 = minusplus(v1071, v1072); + real2 v1075 = minusplus(uminus(v1071), v1072); + real2 v923 = timesminusplus(reverse(v913), load(tbl, 158 * VECWIDTH + tbloffset), times(v913, load(tbl, 159 * VECWIDTH + tbloffset))); + real2 v1083 = timesminusplus(reverse(v1073), load(tbl, 190 * VECWIDTH + tbloffset), times(v1073, load(tbl, 191 * VECWIDTH + tbloffset))); + real2 v1685 = plus(v923, v1083); + real2 v1679 = reverse(minus(v923, v1083)); + real2 v1681 = minusplus(v1679, v1680); + real2 v1683 = minusplus(uminus(v1679), v1680); + real2 v1697 = timesminusplus(reverse(v1683), load(tbl, 300 * VECWIDTH + tbloffset), times(v1683, load(tbl, 301 * VECWIDTH + tbloffset))); + real2 v1809 = plus(v1657, v1697); + real2 v1803 = reverse(minus(v1657, v1697)); + scatter(out, 26, 128, plus(v1808, v1809)); + real2 v1822 = minus(v1808, v1809); + scatter(out, 90, 128, timesminusplus(v1822, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1822), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1807 = minusplus(uminus(v1803), v1804); + real2 v1805 = minusplus(v1803, v1804); + scatter(out, 58, 128, timesminusplus(reverse(v1805), load(tbl, 318 * VECWIDTH + tbloffset), times(v1805, load(tbl, 319 * VECWIDTH + tbloffset)))); + scatter(out, 122, 128, timesminusplus(reverse(v1807), load(tbl, 320 * VECWIDTH + tbloffset), times(v1807, load(tbl, 321 * VECWIDTH + tbloffset)))); + real2 v1651 = timesminusplus(reverse(v1641), load(tbl, 290 * VECWIDTH + tbloffset), times(v1641, load(tbl, 291 * VECWIDTH + tbloffset))); + real2 v1691 = timesminusplus(reverse(v1681), load(tbl, 298 * VECWIDTH + tbloffset), times(v1681, load(tbl, 299 * VECWIDTH + tbloffset))); + real2 v1783 = plus(v1651, v1691); + real2 v1777 = reverse(minus(v1651, v1691)); + real2 v1779 = minusplus(v1777, v1778); + real2 v1781 = minusplus(uminus(v1777), v1778); + scatter(out, 106, 128, timesminusplus(reverse(v1781), load(tbl, 316 * VECWIDTH + tbloffset), times(v1781, load(tbl, 317 * VECWIDTH + tbloffset)))); + scatter(out, 42, 128, timesminusplus(reverse(v1779), load(tbl, 314 * VECWIDTH + tbloffset), times(v1779, load(tbl, 315 * VECWIDTH + tbloffset)))); + scatter(out, 10, 128, plus(v1782, v1783)); + real2 v1796 = minus(v1782, v1783); + scatter(out, 74, 128, timesminusplus(v1796, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1796), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1720 = minus(v1645, v1644); + real2 v1724 = plus(v1644, v1645); + real2 v1719 = reverse(minus(v1684, v1685)); + real2 v1725 = plus(v1684, v1685); + real2 v1745 = plus(v1724, v1725); + real2 v1739 = reverse(minus(v1724, v1725)); + scatter(out, 2, 128, plus(v1744, v1745)); + real2 v1758 = minus(v1744, v1745); + scatter(out, 66, 128, timesminusplus(v1758, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1758), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1741 = minusplus(v1739, v1740); + real2 v1743 = minusplus(uminus(v1739), v1740); + scatter(out, 98, 128, timesminusplus(reverse(v1743), load(tbl, 312 * VECWIDTH + tbloffset), times(v1743, load(tbl, 313 * VECWIDTH + tbloffset)))); + scatter(out, 34, 128, timesminusplus(reverse(v1741), load(tbl, 310 * VECWIDTH + tbloffset), times(v1741, load(tbl, 311 * VECWIDTH + tbloffset)))); + real2 v1723 = minusplus(uminus(v1719), v1720); + real2 v1721 = minusplus(v1719, v1720); + real2 v1737 = timesminusplus(reverse(v1723), load(tbl, 308 * VECWIDTH + tbloffset), times(v1723, load(tbl, 309 * VECWIDTH + tbloffset))); + scatter(out, 50, 128, plus(v1717, v1737)); + real2 v1770 = minus(v1717, v1737); + scatter(out, 114, 128, timesminusplus(v1770, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1770), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1731 = timesminusplus(reverse(v1721), load(tbl, 306 * VECWIDTH + tbloffset), times(v1721, load(tbl, 307 * VECWIDTH + tbloffset))); + scatter(out, 18, 128, plus(v1711, v1731)); + real2 v1764 = minus(v1711, v1731); + scatter(out, 82, 128, timesminusplus(v1764, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1764), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v809 = timesminusplus(reverse(v795), load(tbl, 136 * VECWIDTH + tbloffset), times(v795, load(tbl, 137 * VECWIDTH + tbloffset))); + real2 v969 = timesminusplus(reverse(v955), load(tbl, 168 * VECWIDTH + tbloffset), times(v955, load(tbl, 169 * VECWIDTH + tbloffset))); + real2 v1850 = minus(v969, v809); + real2 v1854 = plus(v809, v969); + real2 v849 = timesminusplus(reverse(v835), load(tbl, 144 * VECWIDTH + tbloffset), times(v835, load(tbl, 145 * VECWIDTH + tbloffset))); + real2 v929 = timesminusplus(reverse(v915), load(tbl, 160 * VECWIDTH + tbloffset), times(v915, load(tbl, 161 * VECWIDTH + tbloffset))); + real2 v889 = timesminusplus(reverse(v875), load(tbl, 152 * VECWIDTH + tbloffset), times(v875, load(tbl, 153 * VECWIDTH + tbloffset))); + real2 v1089 = timesminusplus(reverse(v1075), load(tbl, 192 * VECWIDTH + tbloffset), times(v1075, load(tbl, 193 * VECWIDTH + tbloffset))); + real2 v1009 = timesminusplus(reverse(v995), load(tbl, 176 * VECWIDTH + tbloffset), times(v995, load(tbl, 177 * VECWIDTH + tbloffset))); + real2 v1890 = minus(v1009, v849); + real2 v1894 = plus(v849, v1009); + real2 v1849 = reverse(minus(v889, v1049)); + real2 v1855 = plus(v889, v1049); + real2 v1930 = minus(v1855, v1854); + real2 v1934 = plus(v1854, v1855); + real2 v1895 = plus(v929, v1089); + real2 v1889 = reverse(minus(v929, v1089)); + real2 v1929 = reverse(minus(v1894, v1895)); + real2 v1935 = plus(v1894, v1895); + real2 v1955 = plus(v1934, v1935); + real2 v1949 = reverse(minus(v1934, v1935)); + scatter(out, 6, 128, plus(v1954, v1955)); + real2 v1968 = minus(v1954, v1955); + scatter(out, 70, 128, timesminusplus(v1968, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1968), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1951 = minusplus(v1949, v1950); + scatter(out, 38, 128, timesminusplus(reverse(v1951), load(tbl, 346 * VECWIDTH + tbloffset), times(v1951, load(tbl, 347 * VECWIDTH + tbloffset)))); + real2 v1953 = minusplus(uminus(v1949), v1950); + scatter(out, 102, 128, timesminusplus(reverse(v1953), load(tbl, 348 * VECWIDTH + tbloffset), times(v1953, load(tbl, 349 * VECWIDTH + tbloffset)))); + real2 v1931 = minusplus(v1929, v1930); + real2 v1933 = minusplus(uminus(v1929), v1930); + real2 v1947 = timesminusplus(reverse(v1933), load(tbl, 344 * VECWIDTH + tbloffset), times(v1933, load(tbl, 345 * VECWIDTH + tbloffset))); + scatter(out, 54, 128, plus(v1927, v1947)); + real2 v1980 = minus(v1927, v1947); + scatter(out, 118, 128, timesminusplus(v1980, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1980), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1941 = timesminusplus(reverse(v1931), load(tbl, 342 * VECWIDTH + tbloffset), times(v1931, load(tbl, 343 * VECWIDTH + tbloffset))); + scatter(out, 22, 128, plus(v1921, v1941)); + real2 v1974 = minus(v1921, v1941); + scatter(out, 86, 128, timesminusplus(v1974, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1974), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1851 = minusplus(v1849, v1850); + real2 v1853 = minusplus(uminus(v1849), v1850); + real2 v1867 = timesminusplus(reverse(v1853), load(tbl, 328 * VECWIDTH + tbloffset), times(v1853, load(tbl, 329 * VECWIDTH + tbloffset))); + real2 v1891 = minusplus(v1889, v1890); + real2 v1893 = minusplus(uminus(v1889), v1890); + real2 v1907 = timesminusplus(reverse(v1893), load(tbl, 336 * VECWIDTH + tbloffset), times(v1893, load(tbl, 337 * VECWIDTH + tbloffset))); + real2 v2019 = plus(v1867, v1907); + real2 v2013 = reverse(minus(v1867, v1907)); + scatter(out, 30, 128, plus(v2018, v2019)); + real2 v2032 = minus(v2018, v2019); + scatter(out, 94, 128, timesminusplus(v2032, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2032), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2017 = minusplus(uminus(v2013), v2014); + scatter(out, 126, 128, timesminusplus(reverse(v2017), load(tbl, 356 * VECWIDTH + tbloffset), times(v2017, load(tbl, 357 * VECWIDTH + tbloffset)))); + real2 v2015 = minusplus(v2013, v2014); + scatter(out, 62, 128, timesminusplus(reverse(v2015), load(tbl, 354 * VECWIDTH + tbloffset), times(v2015, load(tbl, 355 * VECWIDTH + tbloffset)))); + real2 v1861 = timesminusplus(reverse(v1851), load(tbl, 326 * VECWIDTH + tbloffset), times(v1851, load(tbl, 327 * VECWIDTH + tbloffset))); + real2 v1901 = timesminusplus(reverse(v1891), load(tbl, 334 * VECWIDTH + tbloffset), times(v1891, load(tbl, 335 * VECWIDTH + tbloffset))); + real2 v1993 = plus(v1861, v1901); + real2 v1987 = reverse(minus(v1861, v1901)); + scatter(out, 14, 128, plus(v1992, v1993)); + real2 v2006 = minus(v1992, v1993); + scatter(out, 78, 128, timesminusplus(v2006, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2006), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1991 = minusplus(uminus(v1987), v1988); + scatter(out, 110, 128, timesminusplus(reverse(v1991), load(tbl, 352 * VECWIDTH + tbloffset), times(v1991, load(tbl, 353 * VECWIDTH + tbloffset)))); + real2 v1989 = minusplus(v1987, v1988); + scatter(out, 46, 128, timesminusplus(reverse(v1989), load(tbl, 350 * VECWIDTH + tbloffset), times(v1989, load(tbl, 351 * VECWIDTH + tbloffset)))); + real2 v593 = minusplus(v591, v592); + real2 v595 = minusplus(uminus(v591), v592); + real2 v473 = minusplus(v471, v472); + real2 v475 = minusplus(uminus(v471), v472); + real2 v555 = minusplus(uminus(v551), v552); + real2 v553 = minusplus(v551, v552); + real2 v609 = timesminusplus(reverse(v595), load(tbl, 96 * VECWIDTH + tbloffset), times(v595, load(tbl, 97 * VECWIDTH + tbloffset))); + real2 v195 = minusplus(uminus(v191), v192); + real2 v193 = minusplus(v191, v192); + real2 v275 = minusplus(uminus(v271), v272); + real2 v273 = minusplus(v271, v272); + real2 v673 = minusplus(v671, v672); + real2 v675 = minusplus(uminus(v671), v672); + real2 v689 = timesminusplus(reverse(v675), load(tbl, 112 * VECWIDTH + tbloffset), times(v675, load(tbl, 113 * VECWIDTH + tbloffset))); + real2 v209 = timesminusplus(reverse(v195), load(tbl, 16 * VECWIDTH + tbloffset), times(v195, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v289 = timesminusplus(reverse(v275), load(tbl, 32 * VECWIDTH + tbloffset), times(v275, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v755 = minusplus(uminus(v751), v752); + real2 v753 = minusplus(v751, v752); + real2 v435 = minusplus(uminus(v431), v432); + real2 v433 = minusplus(v431, v432); + real2 v513 = minusplus(v511, v512); + real2 v515 = minusplus(uminus(v511), v512); + real2 v529 = timesminusplus(reverse(v515), load(tbl, 80 * VECWIDTH + tbloffset), times(v515, load(tbl, 81 * VECWIDTH + tbloffset))); + real2 v353 = minusplus(v351, v352); + real2 v355 = minusplus(uminus(v351), v352); + real2 v369 = timesminusplus(reverse(v355), load(tbl, 48 * VECWIDTH + tbloffset), times(v355, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v2631 = plus(v369, v689); + real2 v2625 = reverse(minus(v369, v689)); + real2 v449 = timesminusplus(reverse(v435), load(tbl, 64 * VECWIDTH + tbloffset), times(v435, load(tbl, 65 * VECWIDTH + tbloffset))); + real2 v2710 = plus(v289, v609); + real2 v2706 = minus(v609, v289); + real2 v2630 = plus(v209, v529); + real2 v2626 = minus(v529, v209); + real2 v2790 = plus(v2630, v2631); + real2 v2786 = minus(v2631, v2630); + real2 v713 = minusplus(v711, v712); + real2 v715 = minusplus(uminus(v711), v712); + real2 v769 = timesminusplus(reverse(v755), load(tbl, 128 * VECWIDTH + tbloffset), times(v755, load(tbl, 129 * VECWIDTH + tbloffset))); + real2 v2705 = reverse(minus(v449, v769)); + real2 v2711 = plus(v449, v769); + real2 v313 = minusplus(v311, v312); + real2 v315 = minusplus(uminus(v311), v312); + real2 v393 = minusplus(v391, v392); + real2 v395 = minusplus(uminus(v391), v392); + real2 v409 = timesminusplus(reverse(v395), load(tbl, 56 * VECWIDTH + tbloffset), times(v395, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v729 = timesminusplus(reverse(v715), load(tbl, 120 * VECWIDTH + tbloffset), times(v715, load(tbl, 121 * VECWIDTH + tbloffset))); + real2 v329 = timesminusplus(reverse(v315), load(tbl, 40 * VECWIDTH + tbloffset), times(v315, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v489 = timesminusplus(reverse(v475), load(tbl, 72 * VECWIDTH + tbloffset), times(v475, load(tbl, 73 * VECWIDTH + tbloffset))); + real2 v153 = minusplus(v151, v152); + real2 v155 = minusplus(uminus(v151), v152); + real2 v169 = timesminusplus(reverse(v155), load(tbl, 8 * VECWIDTH + tbloffset), times(v155, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v2586 = minus(v489, v169); + real2 v2590 = plus(v169, v489); + real2 v233 = minusplus(v231, v232); + real2 v235 = minusplus(uminus(v231), v232); + real2 v633 = minusplus(v631, v632); + real2 v635 = minusplus(uminus(v631), v632); + real2 v649 = timesminusplus(reverse(v635), load(tbl, 104 * VECWIDTH + tbloffset), times(v635, load(tbl, 105 * VECWIDTH + tbloffset))); + real2 v249 = timesminusplus(reverse(v235), load(tbl, 24 * VECWIDTH + tbloffset), times(v235, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v569 = timesminusplus(reverse(v555), load(tbl, 88 * VECWIDTH + tbloffset), times(v555, load(tbl, 89 * VECWIDTH + tbloffset))); + real2 v2670 = plus(v249, v569); + real2 v2666 = minus(v569, v249); + real2 v2785 = reverse(minus(v2710, v2711)); + real2 v2791 = plus(v2710, v2711); + real2 v2825 = reverse(minus(v2790, v2791)); + real2 v2831 = plus(v2790, v2791); + real2 v2671 = plus(v409, v729); + real2 v2665 = reverse(minus(v409, v729)); + real2 v2745 = reverse(minus(v2670, v2671)); + real2 v2751 = plus(v2670, v2671); + real2 v2806 = minus(v2731, v2730); + real2 v2810 = plus(v2730, v2731); + real2 v2846 = minus(v2811, v2810); + real2 v2850 = plus(v2810, v2811); + real2 v2591 = plus(v329, v649); + real2 v2585 = reverse(minus(v329, v649)); + real2 v2750 = plus(v2590, v2591); + real2 v2746 = minus(v2591, v2590); + real2 v2830 = plus(v2750, v2751); + real2 v2826 = minus(v2751, v2750); + real2 v2845 = reverse(minus(v2830, v2831)); + real2 v2851 = plus(v2830, v2831); + scatter(out, 3, 128, plus(v2850, v2851)); + real2 v2864 = minus(v2850, v2851); + scatter(out, 67, 128, timesminusplus(v2864, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2864), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2849 = minusplus(uminus(v2845), v2846); + real2 v2847 = minusplus(v2845, v2846); + scatter(out, 35, 128, timesminusplus(reverse(v2847), load(tbl, 506 * VECWIDTH + tbloffset), times(v2847, load(tbl, 507 * VECWIDTH + tbloffset)))); + scatter(out, 99, 128, timesminusplus(reverse(v2849), load(tbl, 508 * VECWIDTH + tbloffset), times(v2849, load(tbl, 509 * VECWIDTH + tbloffset)))); + real2 v2827 = minusplus(v2825, v2826); + real2 v2829 = minusplus(uminus(v2825), v2826); + real2 v2837 = timesminusplus(reverse(v2827), load(tbl, 502 * VECWIDTH + tbloffset), times(v2827, load(tbl, 503 * VECWIDTH + tbloffset))); + real2 v2809 = minusplus(uminus(v2805), v2806); + real2 v2807 = minusplus(v2805, v2806); + real2 v2817 = timesminusplus(reverse(v2807), load(tbl, 498 * VECWIDTH + tbloffset), times(v2807, load(tbl, 499 * VECWIDTH + tbloffset))); + scatter(out, 19, 128, plus(v2817, v2837)); + real2 v2870 = minus(v2817, v2837); + scatter(out, 83, 128, timesminusplus(v2870, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2870), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2823 = timesminusplus(reverse(v2809), load(tbl, 500 * VECWIDTH + tbloffset), times(v2809, load(tbl, 501 * VECWIDTH + tbloffset))); + real2 v2843 = timesminusplus(reverse(v2829), load(tbl, 504 * VECWIDTH + tbloffset), times(v2829, load(tbl, 505 * VECWIDTH + tbloffset))); + scatter(out, 51, 128, plus(v2823, v2843)); + real2 v2876 = minus(v2823, v2843); + scatter(out, 115, 128, timesminusplus(v2876, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2876), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2787 = minusplus(v2785, v2786); + real2 v2789 = minusplus(uminus(v2785), v2786); + real2 v2803 = timesminusplus(reverse(v2789), load(tbl, 496 * VECWIDTH + tbloffset), times(v2789, load(tbl, 497 * VECWIDTH + tbloffset))); + real2 v2727 = minusplus(v2725, v2726); + real2 v2729 = minusplus(uminus(v2725), v2726); + real2 v2743 = timesminusplus(reverse(v2729), load(tbl, 484 * VECWIDTH + tbloffset), times(v2729, load(tbl, 485 * VECWIDTH + tbloffset))); + real2 v2914 = plus(v2743, v2783); + real2 v2910 = minus(v2783, v2743); + real2 v2749 = minusplus(uminus(v2745), v2746); + real2 v2747 = minusplus(v2745, v2746); + real2 v2763 = timesminusplus(reverse(v2749), load(tbl, 488 * VECWIDTH + tbloffset), times(v2749, load(tbl, 489 * VECWIDTH + tbloffset))); + real2 v2909 = reverse(minus(v2763, v2803)); + real2 v2915 = plus(v2763, v2803); + scatter(out, 27, 128, plus(v2914, v2915)); + real2 v2928 = minus(v2914, v2915); + scatter(out, 91, 128, timesminusplus(v2928, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2928), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2913 = minusplus(uminus(v2909), v2910); + scatter(out, 123, 128, timesminusplus(reverse(v2913), load(tbl, 516 * VECWIDTH + tbloffset), times(v2913, load(tbl, 517 * VECWIDTH + tbloffset)))); + real2 v2911 = minusplus(v2909, v2910); + scatter(out, 59, 128, timesminusplus(reverse(v2911), load(tbl, 514 * VECWIDTH + tbloffset), times(v2911, load(tbl, 515 * VECWIDTH + tbloffset)))); + real2 v2737 = timesminusplus(reverse(v2727), load(tbl, 482 * VECWIDTH + tbloffset), times(v2727, load(tbl, 483 * VECWIDTH + tbloffset))); + real2 v2888 = plus(v2737, v2777); + real2 v2884 = minus(v2777, v2737); + real2 v2797 = timesminusplus(reverse(v2787), load(tbl, 494 * VECWIDTH + tbloffset), times(v2787, load(tbl, 495 * VECWIDTH + tbloffset))); + real2 v2757 = timesminusplus(reverse(v2747), load(tbl, 486 * VECWIDTH + tbloffset), times(v2747, load(tbl, 487 * VECWIDTH + tbloffset))); + real2 v2889 = plus(v2757, v2797); + real2 v2883 = reverse(minus(v2757, v2797)); + scatter(out, 11, 128, plus(v2888, v2889)); + real2 v2902 = minus(v2888, v2889); + scatter(out, 75, 128, timesminusplus(v2902, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2902), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2887 = minusplus(uminus(v2883), v2884); + scatter(out, 107, 128, timesminusplus(reverse(v2887), load(tbl, 512 * VECWIDTH + tbloffset), times(v2887, load(tbl, 513 * VECWIDTH + tbloffset)))); + real2 v2885 = minusplus(v2883, v2884); + scatter(out, 43, 128, timesminusplus(reverse(v2885), load(tbl, 510 * VECWIDTH + tbloffset), times(v2885, load(tbl, 511 * VECWIDTH + tbloffset)))); + real2 v2669 = minusplus(uminus(v2665), v2666); + real2 v2667 = minusplus(v2665, v2666); + real2 v2707 = minusplus(v2705, v2706); + real2 v2709 = minusplus(uminus(v2705), v2706); + real2 v2717 = timesminusplus(reverse(v2707), load(tbl, 478 * VECWIDTH + tbloffset), times(v2707, load(tbl, 479 * VECWIDTH + tbloffset))); + real2 v2627 = minusplus(v2625, v2626); + real2 v2629 = minusplus(uminus(v2625), v2626); + real2 v2637 = timesminusplus(reverse(v2627), load(tbl, 462 * VECWIDTH + tbloffset), times(v2627, load(tbl, 463 * VECWIDTH + tbloffset))); + real2 v2961 = plus(v2637, v2717); + real2 v2955 = reverse(minus(v2637, v2717)); + real2 v2649 = minusplus(uminus(v2645), v2646); + real2 v2647 = minusplus(v2645, v2646); + real2 v2569 = minusplus(uminus(v2565), v2566); + real2 v2567 = minusplus(v2565, v2566); + real2 v2577 = timesminusplus(reverse(v2567), load(tbl, 450 * VECWIDTH + tbloffset), times(v2567, load(tbl, 451 * VECWIDTH + tbloffset))); + real2 v2657 = timesminusplus(reverse(v2647), load(tbl, 466 * VECWIDTH + tbloffset), times(v2647, load(tbl, 467 * VECWIDTH + tbloffset))); + real2 v2936 = minus(v2657, v2577); + real2 v2940 = plus(v2577, v2657); + real2 v2976 = minus(v2941, v2940); + real2 v2980 = plus(v2940, v2941); + real2 v2677 = timesminusplus(reverse(v2667), load(tbl, 470 * VECWIDTH + tbloffset), times(v2667, load(tbl, 471 * VECWIDTH + tbloffset))); + real2 v2587 = minusplus(v2585, v2586); + real2 v2589 = minusplus(uminus(v2585), v2586); + real2 v2597 = timesminusplus(reverse(v2587), load(tbl, 454 * VECWIDTH + tbloffset), times(v2587, load(tbl, 455 * VECWIDTH + tbloffset))); + real2 v2956 = minus(v2677, v2597); + real2 v2960 = plus(v2597, v2677); + real2 v2975 = reverse(minus(v2960, v2961)); + real2 v2981 = plus(v2960, v2961); + scatter(out, 7, 128, plus(v2980, v2981)); + real2 v2994 = minus(v2980, v2981); + scatter(out, 71, 128, timesminusplus(v2994, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2994), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2979 = minusplus(uminus(v2975), v2976); + scatter(out, 103, 128, timesminusplus(reverse(v2979), load(tbl, 528 * VECWIDTH + tbloffset), times(v2979, load(tbl, 529 * VECWIDTH + tbloffset)))); + real2 v2977 = minusplus(v2975, v2976); + scatter(out, 39, 128, timesminusplus(reverse(v2977), load(tbl, 526 * VECWIDTH + tbloffset), times(v2977, load(tbl, 527 * VECWIDTH + tbloffset)))); + real2 v2939 = minusplus(uminus(v2935), v2936); + real2 v2937 = minusplus(v2935, v2936); + real2 v2953 = timesminusplus(reverse(v2939), load(tbl, 520 * VECWIDTH + tbloffset), times(v2939, load(tbl, 521 * VECWIDTH + tbloffset))); + real2 v2957 = minusplus(v2955, v2956); + real2 v2959 = minusplus(uminus(v2955), v2956); + real2 v2973 = timesminusplus(reverse(v2959), load(tbl, 524 * VECWIDTH + tbloffset), times(v2959, load(tbl, 525 * VECWIDTH + tbloffset))); + scatter(out, 55, 128, plus(v2953, v2973)); + real2 v3006 = minus(v2953, v2973); + scatter(out, 119, 128, timesminusplus(v3006, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3006), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2947 = timesminusplus(reverse(v2937), load(tbl, 518 * VECWIDTH + tbloffset), times(v2937, load(tbl, 519 * VECWIDTH + tbloffset))); + real2 v2967 = timesminusplus(reverse(v2957), load(tbl, 522 * VECWIDTH + tbloffset), times(v2957, load(tbl, 523 * VECWIDTH + tbloffset))); + scatter(out, 23, 128, plus(v2947, v2967)); + real2 v3000 = minus(v2947, v2967); + scatter(out, 87, 128, timesminusplus(v3000, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3000), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2663 = timesminusplus(reverse(v2649), load(tbl, 468 * VECWIDTH + tbloffset), times(v2649, load(tbl, 469 * VECWIDTH + tbloffset))); + real2 v2583 = timesminusplus(reverse(v2569), load(tbl, 452 * VECWIDTH + tbloffset), times(v2569, load(tbl, 453 * VECWIDTH + tbloffset))); + real2 v3014 = minus(v2663, v2583); + real2 v3018 = plus(v2583, v2663); + real2 v3015 = minusplus(v3013, v3014); + real2 v3017 = minusplus(uminus(v3013), v3014); + real2 v2643 = timesminusplus(reverse(v2629), load(tbl, 464 * VECWIDTH + tbloffset), times(v2629, load(tbl, 465 * VECWIDTH + tbloffset))); + real2 v2723 = timesminusplus(reverse(v2709), load(tbl, 480 * VECWIDTH + tbloffset), times(v2709, load(tbl, 481 * VECWIDTH + tbloffset))); + real2 v3039 = plus(v2643, v2723); + real2 v3033 = reverse(minus(v2643, v2723)); + real2 v2683 = timesminusplus(reverse(v2669), load(tbl, 472 * VECWIDTH + tbloffset), times(v2669, load(tbl, 473 * VECWIDTH + tbloffset))); + real2 v3031 = timesminusplus(reverse(v3017), load(tbl, 532 * VECWIDTH + tbloffset), times(v3017, load(tbl, 533 * VECWIDTH + tbloffset))); + real2 v2603 = timesminusplus(reverse(v2589), load(tbl, 456 * VECWIDTH + tbloffset), times(v2589, load(tbl, 457 * VECWIDTH + tbloffset))); + real2 v3034 = minus(v2683, v2603); + real2 v3038 = plus(v2603, v2683); + real2 v3037 = minusplus(uminus(v3033), v3034); + real2 v3035 = minusplus(v3033, v3034); + real2 v3051 = timesminusplus(reverse(v3037), load(tbl, 536 * VECWIDTH + tbloffset), times(v3037, load(tbl, 537 * VECWIDTH + tbloffset))); + scatter(out, 63, 128, plus(v3031, v3051)); + real2 v3084 = minus(v3031, v3051); + scatter(out, 127, 128, timesminusplus(v3084, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3084), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v3025 = timesminusplus(reverse(v3015), load(tbl, 530 * VECWIDTH + tbloffset), times(v3015, load(tbl, 531 * VECWIDTH + tbloffset))); + real2 v3045 = timesminusplus(reverse(v3035), load(tbl, 534 * VECWIDTH + tbloffset), times(v3035, load(tbl, 535 * VECWIDTH + tbloffset))); + scatter(out, 31, 128, plus(v3025, v3045)); + real2 v3078 = minus(v3025, v3045); + scatter(out, 95, 128, timesminusplus(v3078, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3078), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v3058 = plus(v3018, v3019); + real2 v3054 = minus(v3019, v3018); + real2 v3053 = reverse(minus(v3038, v3039)); + real2 v3059 = plus(v3038, v3039); + real2 v3055 = minusplus(v3053, v3054); + scatter(out, 47, 128, timesminusplus(reverse(v3055), load(tbl, 538 * VECWIDTH + tbloffset), times(v3055, load(tbl, 539 * VECWIDTH + tbloffset)))); + real2 v3057 = minusplus(uminus(v3053), v3054); + scatter(out, 111, 128, timesminusplus(reverse(v3057), load(tbl, 540 * VECWIDTH + tbloffset), times(v3057, load(tbl, 541 * VECWIDTH + tbloffset)))); + scatter(out, 15, 128, plus(v3058, v3059)); + real2 v3072 = minus(v3058, v3059); + scatter(out, 79, 128, timesminusplus(v3072, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3072), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v683 = timesminusplus(reverse(v673), load(tbl, 110 * VECWIDTH + tbloffset), times(v673, load(tbl, 111 * VECWIDTH + tbloffset))); + real2 v363 = timesminusplus(reverse(v353), load(tbl, 46 * VECWIDTH + tbloffset), times(v353, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v2105 = plus(v363, v683); + real2 v2099 = reverse(minus(v363, v683)); + real2 v283 = timesminusplus(reverse(v273), load(tbl, 30 * VECWIDTH + tbloffset), times(v273, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v723 = timesminusplus(reverse(v713), load(tbl, 118 * VECWIDTH + tbloffset), times(v713, load(tbl, 119 * VECWIDTH + tbloffset))); + real2 v403 = timesminusplus(reverse(v393), load(tbl, 54 * VECWIDTH + tbloffset), times(v393, load(tbl, 55 * VECWIDTH + tbloffset))); + real2 v603 = timesminusplus(reverse(v593), load(tbl, 94 * VECWIDTH + tbloffset), times(v593, load(tbl, 95 * VECWIDTH + tbloffset))); + real2 v2180 = minus(v603, v283); + real2 v2184 = plus(v283, v603); + real2 v2145 = plus(v403, v723); + real2 v2139 = reverse(minus(v403, v723)); + real2 v543 = timesminusplus(reverse(v533), load(tbl, 82 * VECWIDTH + tbloffset), times(v533, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v383 = timesminusplus(reverse(v373), load(tbl, 50 * VECWIDTH + tbloffset), times(v373, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v703 = timesminusplus(reverse(v693), load(tbl, 114 * VECWIDTH + tbloffset), times(v693, load(tbl, 115 * VECWIDTH + tbloffset))); + real2 v2125 = plus(v383, v703); + real2 v2119 = reverse(minus(v383, v703)); + real2 v223 = timesminusplus(reverse(v213), load(tbl, 18 * VECWIDTH + tbloffset), times(v213, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v2120 = minus(v543, v223); + real2 v2124 = plus(v223, v543); + real2 v443 = timesminusplus(reverse(v433), load(tbl, 62 * VECWIDTH + tbloffset), times(v433, load(tbl, 63 * VECWIDTH + tbloffset))); + real2 v203 = timesminusplus(reverse(v193), load(tbl, 14 * VECWIDTH + tbloffset), times(v193, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v763 = timesminusplus(reverse(v753), load(tbl, 126 * VECWIDTH + tbloffset), times(v753, load(tbl, 127 * VECWIDTH + tbloffset))); + real2 v2179 = reverse(minus(v443, v763)); + real2 v2185 = plus(v443, v763); + real2 v523 = timesminusplus(reverse(v513), load(tbl, 78 * VECWIDTH + tbloffset), times(v513, load(tbl, 79 * VECWIDTH + tbloffset))); + real2 v2100 = minus(v523, v203); + real2 v2104 = plus(v203, v523); + real2 v2264 = plus(v2104, v2105); + real2 v2260 = minus(v2105, v2104); + real2 v643 = timesminusplus(reverse(v633), load(tbl, 102 * VECWIDTH + tbloffset), times(v633, load(tbl, 103 * VECWIDTH + tbloffset))); + real2 v2265 = plus(v2184, v2185); + real2 v2259 = reverse(minus(v2184, v2185)); + real2 v563 = timesminusplus(reverse(v553), load(tbl, 86 * VECWIDTH + tbloffset), times(v553, load(tbl, 87 * VECWIDTH + tbloffset))); + real2 v243 = timesminusplus(reverse(v233), load(tbl, 22 * VECWIDTH + tbloffset), times(v233, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v2144 = plus(v243, v563); + real2 v2140 = minus(v563, v243); + real2 v143 = timesminusplus(reverse(v133), load(tbl, 2 * VECWIDTH + tbloffset), times(v133, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v183 = timesminusplus(reverse(v173), load(tbl, 10 * VECWIDTH + tbloffset), times(v173, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v2084 = plus(v183, v503); + real2 v2080 = minus(v503, v183); + real2 v163 = timesminusplus(reverse(v153), load(tbl, 6 * VECWIDTH + tbloffset), times(v153, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v303 = timesminusplus(reverse(v293), load(tbl, 34 * VECWIDTH + tbloffset), times(v293, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v623 = timesminusplus(reverse(v613), load(tbl, 98 * VECWIDTH + tbloffset), times(v613, load(tbl, 99 * VECWIDTH + tbloffset))); + real2 v2039 = reverse(minus(v303, v623)); + real2 v2045 = plus(v303, v623); + real2 v463 = timesminusplus(reverse(v453), load(tbl, 66 * VECWIDTH + tbloffset), times(v453, load(tbl, 67 * VECWIDTH + tbloffset))); + real2 v2044 = plus(v143, v463); + real2 v2040 = minus(v463, v143); + real2 v2204 = plus(v2044, v2045); + real2 v2200 = minus(v2045, v2044); + real2 v323 = timesminusplus(reverse(v313), load(tbl, 38 * VECWIDTH + tbloffset), times(v313, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v2205 = plus(v2124, v2125); + real2 v2199 = reverse(minus(v2124, v2125)); + real2 v2280 = minus(v2205, v2204); + real2 v2284 = plus(v2204, v2205); + real2 v2225 = plus(v2144, v2145); + real2 v2219 = reverse(minus(v2144, v2145)); + real2 v2305 = plus(v2264, v2265); + real2 v2299 = reverse(minus(v2264, v2265)); + real2 v2240 = minus(v2085, v2084); + real2 v2244 = plus(v2084, v2085); + real2 v2279 = reverse(minus(v2244, v2245)); + real2 v2285 = plus(v2244, v2245); + real2 v2281 = minusplus(v2279, v2280); + real2 v2283 = minusplus(uminus(v2279), v2280); + real2 v2291 = timesminusplus(reverse(v2281), load(tbl, 406 * VECWIDTH + tbloffset), times(v2281, load(tbl, 407 * VECWIDTH + tbloffset))); + real2 v483 = timesminusplus(reverse(v473), load(tbl, 70 * VECWIDTH + tbloffset), times(v473, load(tbl, 71 * VECWIDTH + tbloffset))); + real2 v2060 = minus(v483, v163); + real2 v2064 = plus(v163, v483); + real2 v2065 = plus(v323, v643); + real2 v2059 = reverse(minus(v323, v643)); + real2 v2220 = minus(v2065, v2064); + real2 v2224 = plus(v2064, v2065); + real2 v2304 = plus(v2224, v2225); + real2 v2300 = minus(v2225, v2224); + real2 v2301 = minusplus(v2299, v2300); + real2 v2303 = minusplus(uminus(v2299), v2300); + real2 v2311 = timesminusplus(reverse(v2301), load(tbl, 410 * VECWIDTH + tbloffset), times(v2301, load(tbl, 411 * VECWIDTH + tbloffset))); + scatter(out, 17, 128, plus(v2291, v2311)); + real2 v2344 = minus(v2291, v2311); + scatter(out, 81, 128, timesminusplus(v2344, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2344), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2297 = timesminusplus(reverse(v2283), load(tbl, 408 * VECWIDTH + tbloffset), times(v2283, load(tbl, 409 * VECWIDTH + tbloffset))); + real2 v2317 = timesminusplus(reverse(v2303), load(tbl, 412 * VECWIDTH + tbloffset), times(v2303, load(tbl, 413 * VECWIDTH + tbloffset))); + scatter(out, 49, 128, plus(v2297, v2317)); + real2 v2350 = minus(v2297, v2317); + scatter(out, 113, 128, timesminusplus(v2350, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2350), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2320 = minus(v2285, v2284); + real2 v2324 = plus(v2284, v2285); + real2 v2325 = plus(v2304, v2305); + real2 v2319 = reverse(minus(v2304, v2305)); + scatter(out, 1, 128, plus(v2324, v2325)); + real2 v2338 = minus(v2324, v2325); + scatter(out, 65, 128, timesminusplus(v2338, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2338), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2321 = minusplus(v2319, v2320); + scatter(out, 33, 128, timesminusplus(reverse(v2321), load(tbl, 414 * VECWIDTH + tbloffset), times(v2321, load(tbl, 415 * VECWIDTH + tbloffset)))); + real2 v2323 = minusplus(uminus(v2319), v2320); + scatter(out, 97, 128, timesminusplus(reverse(v2323), load(tbl, 416 * VECWIDTH + tbloffset), times(v2323, load(tbl, 417 * VECWIDTH + tbloffset)))); + real2 v2201 = minusplus(v2199, v2200); + real2 v2203 = minusplus(uminus(v2199), v2200); + real2 v2263 = minusplus(uminus(v2259), v2260); + real2 v2261 = minusplus(v2259, v2260); + real2 v2243 = minusplus(uminus(v2239), v2240); + real2 v2241 = minusplus(v2239, v2240); + real2 v2257 = timesminusplus(reverse(v2243), load(tbl, 400 * VECWIDTH + tbloffset), times(v2243, load(tbl, 401 * VECWIDTH + tbloffset))); + real2 v2217 = timesminusplus(reverse(v2203), load(tbl, 392 * VECWIDTH + tbloffset), times(v2203, load(tbl, 393 * VECWIDTH + tbloffset))); + real2 v2388 = plus(v2217, v2257); + real2 v2384 = minus(v2257, v2217); + real2 v2277 = timesminusplus(reverse(v2263), load(tbl, 404 * VECWIDTH + tbloffset), times(v2263, load(tbl, 405 * VECWIDTH + tbloffset))); + real2 v2221 = minusplus(v2219, v2220); + real2 v2223 = minusplus(uminus(v2219), v2220); + real2 v2237 = timesminusplus(reverse(v2223), load(tbl, 396 * VECWIDTH + tbloffset), times(v2223, load(tbl, 397 * VECWIDTH + tbloffset))); + real2 v2389 = plus(v2237, v2277); + real2 v2383 = reverse(minus(v2237, v2277)); + scatter(out, 25, 128, plus(v2388, v2389)); + real2 v2402 = minus(v2388, v2389); + scatter(out, 89, 128, timesminusplus(v2402, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2402), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2385 = minusplus(v2383, v2384); + real2 v2387 = minusplus(uminus(v2383), v2384); + scatter(out, 121, 128, timesminusplus(reverse(v2387), load(tbl, 424 * VECWIDTH + tbloffset), times(v2387, load(tbl, 425 * VECWIDTH + tbloffset)))); + scatter(out, 57, 128, timesminusplus(reverse(v2385), load(tbl, 422 * VECWIDTH + tbloffset), times(v2385, load(tbl, 423 * VECWIDTH + tbloffset)))); + real2 v2251 = timesminusplus(reverse(v2241), load(tbl, 398 * VECWIDTH + tbloffset), times(v2241, load(tbl, 399 * VECWIDTH + tbloffset))); + real2 v2211 = timesminusplus(reverse(v2201), load(tbl, 390 * VECWIDTH + tbloffset), times(v2201, load(tbl, 391 * VECWIDTH + tbloffset))); + real2 v2358 = minus(v2251, v2211); + real2 v2362 = plus(v2211, v2251); + real2 v2271 = timesminusplus(reverse(v2261), load(tbl, 402 * VECWIDTH + tbloffset), times(v2261, load(tbl, 403 * VECWIDTH + tbloffset))); + real2 v2231 = timesminusplus(reverse(v2221), load(tbl, 394 * VECWIDTH + tbloffset), times(v2221, load(tbl, 395 * VECWIDTH + tbloffset))); + real2 v2357 = reverse(minus(v2231, v2271)); + real2 v2363 = plus(v2231, v2271); + scatter(out, 9, 128, plus(v2362, v2363)); + real2 v2376 = minus(v2362, v2363); + scatter(out, 73, 128, timesminusplus(v2376, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2376), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2361 = minusplus(uminus(v2357), v2358); + scatter(out, 105, 128, timesminusplus(reverse(v2361), load(tbl, 420 * VECWIDTH + tbloffset), times(v2361, load(tbl, 421 * VECWIDTH + tbloffset)))); + real2 v2359 = minusplus(v2357, v2358); + scatter(out, 41, 128, timesminusplus(reverse(v2359), load(tbl, 418 * VECWIDTH + tbloffset), times(v2359, load(tbl, 419 * VECWIDTH + tbloffset)))); + real2 v2121 = minusplus(v2119, v2120); + real2 v2123 = minusplus(uminus(v2119), v2120); + real2 v2083 = minusplus(uminus(v2079), v2080); + real2 v2081 = minusplus(v2079, v2080); + real2 v2091 = timesminusplus(reverse(v2081), load(tbl, 366 * VECWIDTH + tbloffset), times(v2081, load(tbl, 367 * VECWIDTH + tbloffset))); + real2 v2043 = minusplus(uminus(v2039), v2040); + real2 v2041 = minusplus(v2039, v2040); + real2 v2051 = timesminusplus(reverse(v2041), load(tbl, 358 * VECWIDTH + tbloffset), times(v2041, load(tbl, 359 * VECWIDTH + tbloffset))); + real2 v2131 = timesminusplus(reverse(v2121), load(tbl, 374 * VECWIDTH + tbloffset), times(v2121, load(tbl, 375 * VECWIDTH + tbloffset))); + real2 v2163 = minusplus(uminus(v2159), v2160); + real2 v2161 = minusplus(v2159, v2160); + real2 v2171 = timesminusplus(reverse(v2161), load(tbl, 382 * VECWIDTH + tbloffset), times(v2161, load(tbl, 383 * VECWIDTH + tbloffset))); + real2 v2409 = reverse(minus(v2091, v2171)); + real2 v2415 = plus(v2091, v2171); + real2 v2410 = minus(v2131, v2051); + real2 v2414 = plus(v2051, v2131); + real2 v2454 = plus(v2414, v2415); + real2 v2450 = minus(v2415, v2414); + real2 v2181 = minusplus(v2179, v2180); + real2 v2183 = minusplus(uminus(v2179), v2180); + real2 v2191 = timesminusplus(reverse(v2181), load(tbl, 386 * VECWIDTH + tbloffset), times(v2181, load(tbl, 387 * VECWIDTH + tbloffset))); + real2 v2103 = minusplus(uminus(v2099), v2100); + real2 v2101 = minusplus(v2099, v2100); + real2 v2111 = timesminusplus(reverse(v2101), load(tbl, 370 * VECWIDTH + tbloffset), times(v2101, load(tbl, 371 * VECWIDTH + tbloffset))); + real2 v2435 = plus(v2111, v2191); + real2 v2429 = reverse(minus(v2111, v2191)); + real2 v2141 = minusplus(v2139, v2140); + real2 v2143 = minusplus(uminus(v2139), v2140); + real2 v2151 = timesminusplus(reverse(v2141), load(tbl, 378 * VECWIDTH + tbloffset), times(v2141, load(tbl, 379 * VECWIDTH + tbloffset))); + real2 v2063 = minusplus(uminus(v2059), v2060); + real2 v2061 = minusplus(v2059, v2060); + real2 v2071 = timesminusplus(reverse(v2061), load(tbl, 362 * VECWIDTH + tbloffset), times(v2061, load(tbl, 363 * VECWIDTH + tbloffset))); + real2 v2434 = plus(v2071, v2151); + real2 v2430 = minus(v2151, v2071); + real2 v2455 = plus(v2434, v2435); + real2 v2449 = reverse(minus(v2434, v2435)); + scatter(out, 5, 128, plus(v2454, v2455)); + real2 v2468 = minus(v2454, v2455); + scatter(out, 69, 128, timesminusplus(v2468, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2468), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2451 = minusplus(v2449, v2450); + real2 v2453 = minusplus(uminus(v2449), v2450); + scatter(out, 101, 128, timesminusplus(reverse(v2453), load(tbl, 436 * VECWIDTH + tbloffset), times(v2453, load(tbl, 437 * VECWIDTH + tbloffset)))); + scatter(out, 37, 128, timesminusplus(reverse(v2451), load(tbl, 434 * VECWIDTH + tbloffset), times(v2451, load(tbl, 435 * VECWIDTH + tbloffset)))); + real2 v2411 = minusplus(v2409, v2410); + real2 v2413 = minusplus(uminus(v2409), v2410); + real2 v2433 = minusplus(uminus(v2429), v2430); + real2 v2431 = minusplus(v2429, v2430); + real2 v2421 = timesminusplus(reverse(v2411), load(tbl, 426 * VECWIDTH + tbloffset), times(v2411, load(tbl, 427 * VECWIDTH + tbloffset))); + real2 v2441 = timesminusplus(reverse(v2431), load(tbl, 430 * VECWIDTH + tbloffset), times(v2431, load(tbl, 431 * VECWIDTH + tbloffset))); + scatter(out, 21, 128, plus(v2421, v2441)); + real2 v2474 = minus(v2421, v2441); + scatter(out, 85, 128, timesminusplus(v2474, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2474), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2427 = timesminusplus(reverse(v2413), load(tbl, 428 * VECWIDTH + tbloffset), times(v2413, load(tbl, 429 * VECWIDTH + tbloffset))); + real2 v2447 = timesminusplus(reverse(v2433), load(tbl, 432 * VECWIDTH + tbloffset), times(v2433, load(tbl, 433 * VECWIDTH + tbloffset))); + scatter(out, 53, 128, plus(v2427, v2447)); + real2 v2480 = minus(v2427, v2447); + scatter(out, 117, 128, timesminusplus(v2480, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2480), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2057 = timesminusplus(reverse(v2043), load(tbl, 360 * VECWIDTH + tbloffset), times(v2043, load(tbl, 361 * VECWIDTH + tbloffset))); + real2 v2097 = timesminusplus(reverse(v2083), load(tbl, 368 * VECWIDTH + tbloffset), times(v2083, load(tbl, 369 * VECWIDTH + tbloffset))); + real2 v2157 = timesminusplus(reverse(v2143), load(tbl, 380 * VECWIDTH + tbloffset), times(v2143, load(tbl, 381 * VECWIDTH + tbloffset))); + real2 v2197 = timesminusplus(reverse(v2183), load(tbl, 388 * VECWIDTH + tbloffset), times(v2183, load(tbl, 389 * VECWIDTH + tbloffset))); + real2 v2117 = timesminusplus(reverse(v2103), load(tbl, 372 * VECWIDTH + tbloffset), times(v2103, load(tbl, 373 * VECWIDTH + tbloffset))); + real2 v2507 = reverse(minus(v2117, v2197)); + real2 v2513 = plus(v2117, v2197); + real2 v2137 = timesminusplus(reverse(v2123), load(tbl, 376 * VECWIDTH + tbloffset), times(v2123, load(tbl, 377 * VECWIDTH + tbloffset))); + real2 v2488 = minus(v2137, v2057); + real2 v2492 = plus(v2057, v2137); + real2 v2177 = timesminusplus(reverse(v2163), load(tbl, 384 * VECWIDTH + tbloffset), times(v2163, load(tbl, 385 * VECWIDTH + tbloffset))); + real2 v2493 = plus(v2097, v2177); + real2 v2487 = reverse(minus(v2097, v2177)); + real2 v2532 = plus(v2492, v2493); + real2 v2528 = minus(v2493, v2492); + real2 v2077 = timesminusplus(reverse(v2063), load(tbl, 364 * VECWIDTH + tbloffset), times(v2063, load(tbl, 365 * VECWIDTH + tbloffset))); + real2 v2512 = plus(v2077, v2157); + real2 v2508 = minus(v2157, v2077); + real2 v2527 = reverse(minus(v2512, v2513)); + real2 v2533 = plus(v2512, v2513); + real2 v2529 = minusplus(v2527, v2528); + real2 v2531 = minusplus(uminus(v2527), v2528); + scatter(out, 109, 128, timesminusplus(reverse(v2531), load(tbl, 448 * VECWIDTH + tbloffset), times(v2531, load(tbl, 449 * VECWIDTH + tbloffset)))); + scatter(out, 45, 128, timesminusplus(reverse(v2529), load(tbl, 446 * VECWIDTH + tbloffset), times(v2529, load(tbl, 447 * VECWIDTH + tbloffset)))); + scatter(out, 13, 128, plus(v2532, v2533)); + real2 v2546 = minus(v2532, v2533); + scatter(out, 77, 128, timesminusplus(v2546, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2546), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2509 = minusplus(v2507, v2508); + real2 v2511 = minusplus(uminus(v2507), v2508); + real2 v2491 = minusplus(uminus(v2487), v2488); + real2 v2489 = minusplus(v2487, v2488); + real2 v2499 = timesminusplus(reverse(v2489), load(tbl, 438 * VECWIDTH + tbloffset), times(v2489, load(tbl, 439 * VECWIDTH + tbloffset))); + real2 v2519 = timesminusplus(reverse(v2509), load(tbl, 442 * VECWIDTH + tbloffset), times(v2509, load(tbl, 443 * VECWIDTH + tbloffset))); + scatter(out, 29, 128, plus(v2499, v2519)); + real2 v2552 = minus(v2499, v2519); + scatter(out, 93, 128, timesminusplus(v2552, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2552), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2505 = timesminusplus(reverse(v2491), load(tbl, 440 * VECWIDTH + tbloffset), times(v2491, load(tbl, 441 * VECWIDTH + tbloffset))); + real2 v2525 = timesminusplus(reverse(v2511), load(tbl, 444 * VECWIDTH + tbloffset), times(v2511, load(tbl, 445 * VECWIDTH + tbloffset))); + scatter(out, 61, 128, plus(v2505, v2525)); + real2 v2558 = minus(v2505, v2525); + scatter(out, 125, 128, timesminusplus(v2558, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2558), load(tbl, 1 * VECWIDTH + tbloffset)))); +// Pres : 76263 + } +} + +ALIGNED(8192) void tbut128b_%CONFIG%_%ISA%(real *RESTRICT out0, uint32_t *q, const real *RESTRICT in0, const int inShift, const real *RESTRICT tbl, const int K) { + const int k = 1 << (inShift - LOG2VECWIDTH); + int i=0; +#pragma omp parallel for + for(i=0;i < k;i++) { + int i0 = i << LOG2VECWIDTH; + real *out = out0 + q[i]; + const real *in = in0 + i0*2; + const int tbloffset = K * i0; + +// Pres : 148586 + real2 v56 = load(in, 54 << inShift); + real2 v120 = load(in, 118 << inShift); + real2 v571 = reverse(minus(v120, v56)); + real2 v577 = plus(v56, v120); + real2 v24 = load(in, 22 << inShift); + real2 v88 = load(in, 86 << inShift); + real2 v576 = plus(v24, v88); + real2 v572 = minus(v88, v24); + real2 v573 = minusplus(v571, v572); + real2 v575 = minusplus(uminus(v571), v572); + real2 v589 = timesminusplus(reverse(v575), load(tbl, 92 * VECWIDTH + tbloffset), times(v575, load(tbl, 93 * VECWIDTH + tbloffset))); + real2 v583 = timesminusplus(reverse(v573), load(tbl, 90 * VECWIDTH + tbloffset), times(v573, load(tbl, 91 * VECWIDTH + tbloffset))); + real2 v897 = plus(v576, v577); + real2 v891 = reverse(minus(v577, v576)); + real2 v8 = load(in, 6 << inShift); + real2 v72 = load(in, 70 << inShift); + real2 v252 = minus(v72, v8); + real2 v256 = plus(v8, v72); + real2 v104 = load(in, 102 << inShift); + real2 v40 = load(in, 38 << inShift); + real2 v251 = reverse(minus(v104, v40)); + real2 v257 = plus(v40, v104); + real2 v255 = minusplus(uminus(v251), v252); + real2 v253 = minusplus(v251, v252); + real2 v263 = timesminusplus(reverse(v253), load(tbl, 26 * VECWIDTH + tbloffset), times(v253, load(tbl, 27 * VECWIDTH + tbloffset))); + real2 v896 = plus(v256, v257); + real2 v892 = minus(v257, v256); + real2 v895 = minusplus(uminus(v891), v892); + real2 v893 = minusplus(v891, v892); + real2 v909 = timesminusplus(reverse(v895), load(tbl, 156 * VECWIDTH + tbloffset), times(v895, load(tbl, 157 * VECWIDTH + tbloffset))); + real2 v903 = timesminusplus(reverse(v893), load(tbl, 154 * VECWIDTH + tbloffset), times(v893, load(tbl, 155 * VECWIDTH + tbloffset))); + real2 v269 = timesminusplus(reverse(v255), load(tbl, 28 * VECWIDTH + tbloffset), times(v255, load(tbl, 29 * VECWIDTH + tbloffset))); + real2 v1216 = plus(v896, v897); + real2 v1212 = minus(v897, v896); + real2 v2160 = minus(v583, v263); + real2 v2164 = plus(v263, v583); + real2 v2686 = minus(v589, v269); + real2 v2690 = plus(v269, v589); + real2 v96 = load(in, 94 << inShift); + real2 v32 = load(in, 30 << inShift); + real2 v736 = plus(v32, v96); + real2 v732 = minus(v96, v32); + real2 v64 = load(in, 62 << inShift); + real2 v128 = load(in, 126 << inShift); + real2 v737 = plus(v64, v128); + real2 v731 = reverse(minus(v128, v64)); + real2 v1057 = plus(v736, v737); + real2 v1051 = reverse(minus(v737, v736)); + real2 v733 = minusplus(v731, v732); + real2 v735 = minusplus(uminus(v731), v732); + real2 v749 = timesminusplus(reverse(v735), load(tbl, 124 * VECWIDTH + tbloffset), times(v735, load(tbl, 125 * VECWIDTH + tbloffset))); + real2 v743 = timesminusplus(reverse(v733), load(tbl, 122 * VECWIDTH + tbloffset), times(v733, load(tbl, 123 * VECWIDTH + tbloffset))); + real2 v16 = load(in, 14 << inShift); + real2 v80 = load(in, 78 << inShift); + real2 v412 = minus(v80, v16); + real2 v416 = plus(v16, v80); + real2 v112 = load(in, 110 << inShift); + real2 v48 = load(in, 46 << inShift); + real2 v417 = plus(v48, v112); + real2 v411 = reverse(minus(v112, v48)); + real2 v1056 = plus(v416, v417); + real2 v1052 = minus(v417, v416); + real2 v1055 = minusplus(uminus(v1051), v1052); + real2 v1053 = minusplus(v1051, v1052); + real2 v1063 = timesminusplus(reverse(v1053), load(tbl, 186 * VECWIDTH + tbloffset), times(v1053, load(tbl, 187 * VECWIDTH + tbloffset))); + real2 v1665 = plus(v903, v1063); + real2 v1659 = reverse(minus(v1063, v903)); + real2 v1069 = timesminusplus(reverse(v1055), load(tbl, 188 * VECWIDTH + tbloffset), times(v1055, load(tbl, 189 * VECWIDTH + tbloffset))); + real2 v1869 = reverse(minus(v1069, v909)); + real2 v1875 = plus(v909, v1069); + real2 v413 = minusplus(v411, v412); + real2 v415 = minusplus(uminus(v411), v412); + real2 v429 = timesminusplus(reverse(v415), load(tbl, 60 * VECWIDTH + tbloffset), times(v415, load(tbl, 61 * VECWIDTH + tbloffset))); + real2 v1217 = plus(v1056, v1057); + real2 v1211 = reverse(minus(v1057, v1056)); + real2 v1297 = plus(v1216, v1217); + real2 v1291 = reverse(minus(v1217, v1216)); + real2 v2691 = plus(v429, v749); + real2 v2685 = reverse(minus(v749, v429)); + real2 v2765 = reverse(minus(v2691, v2690)); + real2 v2771 = plus(v2690, v2691); + real2 v2689 = minusplus(uminus(v2685), v2686); + real2 v2687 = minusplus(v2685, v2686); + real2 v2703 = timesminusplus(reverse(v2689), load(tbl, 476 * VECWIDTH + tbloffset), times(v2689, load(tbl, 477 * VECWIDTH + tbloffset))); + real2 v2697 = timesminusplus(reverse(v2687), load(tbl, 474 * VECWIDTH + tbloffset), times(v2687, load(tbl, 475 * VECWIDTH + tbloffset))); + real2 v1215 = minusplus(uminus(v1211), v1212); + real2 v1213 = minusplus(v1211, v1212); + real2 v1223 = timesminusplus(reverse(v1213), load(tbl, 218 * VECWIDTH + tbloffset), times(v1213, load(tbl, 219 * VECWIDTH + tbloffset))); + real2 v1229 = timesminusplus(reverse(v1215), load(tbl, 220 * VECWIDTH + tbloffset), times(v1215, load(tbl, 221 * VECWIDTH + tbloffset))); + real2 v423 = timesminusplus(reverse(v413), load(tbl, 58 * VECWIDTH + tbloffset), times(v413, load(tbl, 59 * VECWIDTH + tbloffset))); + real2 v2165 = plus(v423, v743); + real2 v2159 = reverse(minus(v743, v423)); + real2 v2245 = plus(v2164, v2165); + real2 v2239 = reverse(minus(v2165, v2164)); + real2 v44 = load(in, 42 << inShift); + real2 v108 = load(in, 106 << inShift); + real2 v331 = reverse(minus(v108, v44)); + real2 v337 = plus(v44, v108); + real2 v76 = load(in, 74 << inShift); + real2 v12 = load(in, 10 << inShift); + real2 v336 = plus(v12, v76); + real2 v332 = minus(v76, v12); + real2 v976 = plus(v336, v337); + real2 v972 = minus(v337, v336); + real2 v335 = minusplus(uminus(v331), v332); + real2 v333 = minusplus(v331, v332); + real2 v343 = timesminusplus(reverse(v333), load(tbl, 42 * VECWIDTH + tbloffset), times(v333, load(tbl, 43 * VECWIDTH + tbloffset))); + real2 v349 = timesminusplus(reverse(v335), load(tbl, 44 * VECWIDTH + tbloffset), times(v335, load(tbl, 45 * VECWIDTH + tbloffset))); + real2 v124 = load(in, 122 << inShift); + real2 v60 = load(in, 58 << inShift); + real2 v651 = reverse(minus(v124, v60)); + real2 v657 = plus(v60, v124); + real2 v28 = load(in, 26 << inShift); + real2 v92 = load(in, 90 << inShift); + real2 v652 = minus(v92, v28); + real2 v656 = plus(v28, v92); + real2 v977 = plus(v656, v657); + real2 v971 = reverse(minus(v657, v656)); + real2 v973 = minusplus(v971, v972); + real2 v975 = minusplus(uminus(v971), v972); + real2 v983 = timesminusplus(reverse(v973), load(tbl, 170 * VECWIDTH + tbloffset), times(v973, load(tbl, 171 * VECWIDTH + tbloffset))); + real2 v1131 = reverse(minus(v977, v976)); + real2 v1137 = plus(v976, v977); + real2 v655 = minusplus(uminus(v651), v652); + real2 v653 = minusplus(v651, v652); + real2 v669 = timesminusplus(reverse(v655), load(tbl, 108 * VECWIDTH + tbloffset), times(v655, load(tbl, 109 * VECWIDTH + tbloffset))); + real2 v663 = timesminusplus(reverse(v653), load(tbl, 106 * VECWIDTH + tbloffset), times(v653, load(tbl, 107 * VECWIDTH + tbloffset))); + real2 v2079 = reverse(minus(v663, v343)); + real2 v2085 = plus(v343, v663); + real2 v2605 = reverse(minus(v669, v349)); + real2 v2611 = plus(v349, v669); + real2 v989 = timesminusplus(reverse(v975), load(tbl, 172 * VECWIDTH + tbloffset), times(v975, load(tbl, 173 * VECWIDTH + tbloffset))); + real2 v20 = load(in, 18 << inShift); + real2 v84 = load(in, 82 << inShift); + real2 v496 = plus(v20, v84); + real2 v492 = minus(v84, v20); + real2 v52 = load(in, 50 << inShift); + real2 v116 = load(in, 114 << inShift); + real2 v491 = reverse(minus(v116, v52)); + real2 v497 = plus(v52, v116); + real2 v817 = plus(v496, v497); + real2 v811 = reverse(minus(v497, v496)); + real2 v493 = minusplus(v491, v492); + real2 v495 = minusplus(uminus(v491), v492); + real2 v509 = timesminusplus(reverse(v495), load(tbl, 76 * VECWIDTH + tbloffset), times(v495, load(tbl, 77 * VECWIDTH + tbloffset))); + real2 v503 = timesminusplus(reverse(v493), load(tbl, 74 * VECWIDTH + tbloffset), times(v493, load(tbl, 75 * VECWIDTH + tbloffset))); + real2 v36 = load(in, 34 << inShift); + real2 v100 = load(in, 98 << inShift); + real2 v171 = reverse(minus(v100, v36)); + real2 v177 = plus(v36, v100); + real2 v68 = load(in, 66 << inShift); + real2 v4 = load(in, 2 << inShift); + real2 v176 = plus(v4, v68); + real2 v172 = minus(v68, v4); + real2 v816 = plus(v176, v177); + real2 v812 = minus(v177, v176); + real2 v1136 = plus(v816, v817); + real2 v1132 = minus(v817, v816); + real2 v1133 = minusplus(v1131, v1132); + real2 v1135 = minusplus(uminus(v1131), v1132); + real2 v1149 = timesminusplus(reverse(v1135), load(tbl, 204 * VECWIDTH + tbloffset), times(v1135, load(tbl, 205 * VECWIDTH + tbloffset))); + real2 v1296 = plus(v1136, v1137); + real2 v1292 = minus(v1137, v1136); + real2 v1295 = minusplus(uminus(v1291), v1292); + real2 v1293 = minusplus(v1291, v1292); + real2 v1303 = timesminusplus(reverse(v1293), load(tbl, 234 * VECWIDTH + tbloffset), times(v1293, load(tbl, 235 * VECWIDTH + tbloffset))); + real2 v1331 = reverse(minus(v1297, v1296)); + real2 v1337 = plus(v1296, v1297); + real2 v173 = minusplus(v171, v172); + real2 v175 = minusplus(uminus(v171), v172); + real2 v189 = timesminusplus(reverse(v175), load(tbl, 12 * VECWIDTH + tbloffset), times(v175, load(tbl, 13 * VECWIDTH + tbloffset))); + real2 v1309 = timesminusplus(reverse(v1295), load(tbl, 236 * VECWIDTH + tbloffset), times(v1295, load(tbl, 237 * VECWIDTH + tbloffset))); + real2 v815 = minusplus(uminus(v811), v812); + real2 v813 = minusplus(v811, v812); + real2 v1143 = timesminusplus(reverse(v1133), load(tbl, 202 * VECWIDTH + tbloffset), times(v1133, load(tbl, 203 * VECWIDTH + tbloffset))); + real2 v1541 = reverse(minus(v1229, v1149)); + real2 v1547 = plus(v1149, v1229); + real2 v2610 = plus(v189, v509); + real2 v2606 = minus(v509, v189); + real2 v2770 = plus(v2610, v2611); + real2 v2766 = minus(v2611, v2610); + real2 v823 = timesminusplus(reverse(v813), load(tbl, 138 * VECWIDTH + tbloffset), times(v813, load(tbl, 139 * VECWIDTH + tbloffset))); + real2 v829 = timesminusplus(reverse(v815), load(tbl, 140 * VECWIDTH + tbloffset), times(v815, load(tbl, 141 * VECWIDTH + tbloffset))); + real2 v2811 = plus(v2770, v2771); + real2 v2805 = reverse(minus(v2771, v2770)); + real2 v2767 = minusplus(v2765, v2766); + real2 v2769 = minusplus(uminus(v2765), v2766); + real2 v2607 = minusplus(v2605, v2606); + real2 v2609 = minusplus(uminus(v2605), v2606); + real2 v2617 = timesminusplus(reverse(v2607), load(tbl, 458 * VECWIDTH + tbloffset), times(v2607, load(tbl, 459 * VECWIDTH + tbloffset))); + real2 v2623 = timesminusplus(reverse(v2609), load(tbl, 460 * VECWIDTH + tbloffset), times(v2609, load(tbl, 461 * VECWIDTH + tbloffset))); + real2 v3013 = reverse(minus(v2703, v2623)); + real2 v3019 = plus(v2623, v2703); + real2 v2783 = timesminusplus(reverse(v2769), load(tbl, 492 * VECWIDTH + tbloffset), times(v2769, load(tbl, 493 * VECWIDTH + tbloffset))); + real2 v2941 = plus(v2617, v2697); + real2 v2935 = reverse(minus(v2697, v2617)); + real2 v2777 = timesminusplus(reverse(v2767), load(tbl, 490 * VECWIDTH + tbloffset), times(v2767, load(tbl, 491 * VECWIDTH + tbloffset))); + real2 v1660 = minus(v983, v823); + real2 v1664 = plus(v823, v983); + real2 v1874 = plus(v829, v989); + real2 v1870 = minus(v989, v829); + real2 v1909 = reverse(minus(v1875, v1874)); + real2 v1915 = plus(v1874, v1875); + real2 v1663 = minusplus(uminus(v1659), v1660); + real2 v1661 = minusplus(v1659, v1660); + real2 v1677 = timesminusplus(reverse(v1663), load(tbl, 296 * VECWIDTH + tbloffset), times(v1663, load(tbl, 297 * VECWIDTH + tbloffset))); + real2 v1873 = minusplus(uminus(v1869), v1870); + real2 v1871 = minusplus(v1869, v1870); + real2 v1887 = timesminusplus(reverse(v1873), load(tbl, 332 * VECWIDTH + tbloffset), times(v1873, load(tbl, 333 * VECWIDTH + tbloffset))); + real2 v1705 = plus(v1664, v1665); + real2 v1699 = reverse(minus(v1665, v1664)); + real2 v1671 = timesminusplus(reverse(v1661), load(tbl, 294 * VECWIDTH + tbloffset), times(v1661, load(tbl, 295 * VECWIDTH + tbloffset))); + real2 v1881 = timesminusplus(reverse(v1871), load(tbl, 330 * VECWIDTH + tbloffset), times(v1871, load(tbl, 331 * VECWIDTH + tbloffset))); + real2 v1469 = plus(v1143, v1223); + real2 v1463 = reverse(minus(v1223, v1143)); + real2 v54 = load(in, 52 << inShift); + real2 v118 = load(in, 116 << inShift); + real2 v537 = plus(v54, v118); + real2 v531 = reverse(minus(v118, v54)); + real2 v86 = load(in, 84 << inShift); + real2 v22 = load(in, 20 << inShift); + real2 v536 = plus(v22, v86); + real2 v532 = minus(v86, v22); + real2 v851 = reverse(minus(v537, v536)); + real2 v857 = plus(v536, v537); + real2 v533 = minusplus(v531, v532); + real2 v535 = minusplus(uminus(v531), v532); + real2 v549 = timesminusplus(reverse(v535), load(tbl, 84 * VECWIDTH + tbloffset), times(v535, load(tbl, 85 * VECWIDTH + tbloffset))); + real2 v102 = load(in, 100 << inShift); + real2 v38 = load(in, 36 << inShift); + real2 v217 = plus(v38, v102); + real2 v211 = reverse(minus(v102, v38)); + real2 v70 = load(in, 68 << inShift); + real2 v6 = load(in, 4 << inShift); + real2 v216 = plus(v6, v70); + real2 v212 = minus(v70, v6); + real2 v213 = minusplus(v211, v212); + real2 v215 = minusplus(uminus(v211), v212); + real2 v229 = timesminusplus(reverse(v215), load(tbl, 20 * VECWIDTH + tbloffset), times(v215, load(tbl, 21 * VECWIDTH + tbloffset))); + real2 v2646 = minus(v549, v229); + real2 v2650 = plus(v229, v549); + real2 v856 = plus(v216, v217); + real2 v852 = minus(v217, v216); + real2 v853 = minusplus(v851, v852); + real2 v855 = minusplus(uminus(v851), v852); + real2 v863 = timesminusplus(reverse(v853), load(tbl, 146 * VECWIDTH + tbloffset), times(v853, load(tbl, 147 * VECWIDTH + tbloffset))); + real2 v869 = timesminusplus(reverse(v855), load(tbl, 148 * VECWIDTH + tbloffset), times(v855, load(tbl, 149 * VECWIDTH + tbloffset))); + real2 v1176 = plus(v856, v857); + real2 v1172 = minus(v857, v856); + real2 v110 = load(in, 108 << inShift); + real2 v46 = load(in, 44 << inShift); + real2 v377 = plus(v46, v110); + real2 v371 = reverse(minus(v110, v46)); + real2 v78 = load(in, 76 << inShift); + real2 v14 = load(in, 12 << inShift); + real2 v372 = minus(v78, v14); + real2 v376 = plus(v14, v78); + real2 v1012 = minus(v377, v376); + real2 v1016 = plus(v376, v377); + real2 v373 = minusplus(v371, v372); + real2 v375 = minusplus(uminus(v371), v372); + real2 v389 = timesminusplus(reverse(v375), load(tbl, 52 * VECWIDTH + tbloffset), times(v375, load(tbl, 53 * VECWIDTH + tbloffset))); + real2 v30 = load(in, 28 << inShift); + real2 v94 = load(in, 92 << inShift); + real2 v696 = plus(v30, v94); + real2 v692 = minus(v94, v30); + real2 v62 = load(in, 60 << inShift); + real2 v126 = load(in, 124 << inShift); + real2 v697 = plus(v62, v126); + real2 v691 = reverse(minus(v126, v62)); + real2 v1017 = plus(v696, v697); + real2 v1011 = reverse(minus(v697, v696)); + real2 v1171 = reverse(minus(v1017, v1016)); + real2 v1177 = plus(v1016, v1017); + real2 v1013 = minusplus(v1011, v1012); + real2 v1015 = minusplus(uminus(v1011), v1012); + real2 v1175 = minusplus(uminus(v1171), v1172); + real2 v1173 = minusplus(v1171, v1172); + real2 v1183 = timesminusplus(reverse(v1173), load(tbl, 210 * VECWIDTH + tbloffset), times(v1173, load(tbl, 211 * VECWIDTH + tbloffset))); + real2 v1189 = timesminusplus(reverse(v1175), load(tbl, 212 * VECWIDTH + tbloffset), times(v1175, load(tbl, 213 * VECWIDTH + tbloffset))); + real2 v1029 = timesminusplus(reverse(v1015), load(tbl, 180 * VECWIDTH + tbloffset), times(v1015, load(tbl, 181 * VECWIDTH + tbloffset))); + real2 v1023 = timesminusplus(reverse(v1013), load(tbl, 178 * VECWIDTH + tbloffset), times(v1013, load(tbl, 179 * VECWIDTH + tbloffset))); + real2 v1625 = plus(v863, v1023); + real2 v1619 = reverse(minus(v1023, v863)); + real2 v1835 = plus(v869, v1029); + real2 v1829 = reverse(minus(v1029, v869)); + real2 v693 = minusplus(v691, v692); + real2 v695 = minusplus(uminus(v691), v692); + real2 v709 = timesminusplus(reverse(v695), load(tbl, 116 * VECWIDTH + tbloffset), times(v695, load(tbl, 117 * VECWIDTH + tbloffset))); + real2 v2645 = reverse(minus(v709, v389)); + real2 v2651 = plus(v389, v709); + real2 v1257 = plus(v1176, v1177); + real2 v1251 = reverse(minus(v1177, v1176)); + real2 v2731 = plus(v2650, v2651); + real2 v2725 = reverse(minus(v2651, v2650)); + real2 v114 = load(in, 112 << inShift); + real2 v50 = load(in, 48 << inShift); + real2 v457 = plus(v50, v114); + real2 v451 = reverse(minus(v114, v50)); + real2 v18 = load(in, 16 << inShift); + real2 v82 = load(in, 80 << inShift); + real2 v456 = plus(v18, v82); + real2 v452 = minus(v82, v18); + real2 v771 = reverse(minus(v457, v456)); + real2 v777 = plus(v456, v457); + real2 v453 = minusplus(v451, v452); + real2 v455 = minusplus(uminus(v451), v452); + real2 v469 = timesminusplus(reverse(v455), load(tbl, 68 * VECWIDTH + tbloffset), times(v455, load(tbl, 69 * VECWIDTH + tbloffset))); + real2 v66 = load(in, 64 << inShift); + real2 v2 = load(in, 0 << inShift); + real2 v132 = minus(v66, v2); + real2 v136 = plus(v2, v66); + real2 v98 = load(in, 96 << inShift); + real2 v34 = load(in, 32 << inShift); + real2 v131 = reverse(minus(v98, v34)); + real2 v137 = plus(v34, v98); + real2 v133 = minusplus(v131, v132); + real2 v135 = minusplus(uminus(v131), v132); + real2 v149 = timesminusplus(reverse(v135), load(tbl, 4 * VECWIDTH + tbloffset), times(v135, load(tbl, 5 * VECWIDTH + tbloffset))); + real2 v2566 = minus(v469, v149); + real2 v2570 = plus(v149, v469); + real2 v772 = minus(v137, v136); + real2 v776 = plus(v136, v137); + real2 v1092 = minus(v777, v776); + real2 v1096 = plus(v776, v777); + real2 v773 = minusplus(v771, v772); + real2 v775 = minusplus(uminus(v771), v772); + real2 v783 = timesminusplus(reverse(v773), load(tbl, 130 * VECWIDTH + tbloffset), times(v773, load(tbl, 131 * VECWIDTH + tbloffset))); + real2 v789 = timesminusplus(reverse(v775), load(tbl, 132 * VECWIDTH + tbloffset), times(v775, load(tbl, 133 * VECWIDTH + tbloffset))); + real2 v74 = load(in, 72 << inShift); + real2 v10 = load(in, 8 << inShift); + real2 v296 = plus(v10, v74); + real2 v292 = minus(v74, v10); + real2 v42 = load(in, 40 << inShift); + real2 v106 = load(in, 104 << inShift); + real2 v291 = reverse(minus(v106, v42)); + real2 v297 = plus(v42, v106); + real2 v293 = minusplus(v291, v292); + real2 v295 = minusplus(uminus(v291), v292); + real2 v309 = timesminusplus(reverse(v295), load(tbl, 36 * VECWIDTH + tbloffset), times(v295, load(tbl, 37 * VECWIDTH + tbloffset))); + real2 v932 = minus(v297, v296); + real2 v936 = plus(v296, v297); + real2 v122 = load(in, 120 << inShift); + real2 v58 = load(in, 56 << inShift); + real2 v617 = plus(v58, v122); + real2 v611 = reverse(minus(v122, v58)); + real2 v26 = load(in, 24 << inShift); + real2 v90 = load(in, 88 << inShift); + real2 v612 = minus(v90, v26); + real2 v616 = plus(v26, v90); + real2 v937 = plus(v616, v617); + real2 v931 = reverse(minus(v617, v616)); + real2 v1091 = reverse(minus(v937, v936)); + real2 v1097 = plus(v936, v937); + real2 v933 = minusplus(v931, v932); + real2 v935 = minusplus(uminus(v931), v932); + real2 v1093 = minusplus(v1091, v1092); + real2 v1095 = minusplus(uminus(v1091), v1092); + real2 v1103 = timesminusplus(reverse(v1093), load(tbl, 194 * VECWIDTH + tbloffset), times(v1093, load(tbl, 195 * VECWIDTH + tbloffset))); + real2 v1468 = plus(v1103, v1183); + real2 v1464 = minus(v1183, v1103); + real2 v1508 = plus(v1468, v1469); + real2 v1504 = minus(v1469, v1468); + real2 v1252 = minus(v1097, v1096); + real2 v1256 = plus(v1096, v1097); + real2 v1336 = plus(v1256, v1257); + real2 v1332 = minus(v1257, v1256); + real2 v1335 = minusplus(uminus(v1331), v1332); + real2 v1333 = minusplus(v1331, v1332); + real2 v1343 = timesminusplus(reverse(v1333), load(tbl, 242 * VECWIDTH + tbloffset), times(v1333, load(tbl, 243 * VECWIDTH + tbloffset))); + real2 v1349 = timesminusplus(reverse(v1335), load(tbl, 244 * VECWIDTH + tbloffset), times(v1335, load(tbl, 245 * VECWIDTH + tbloffset))); + real2 v1376 = plus(v1336, v1337); + real2 v1372 = minus(v1337, v1336); + real2 v1465 = minusplus(v1463, v1464); + real2 v1467 = minusplus(uminus(v1463), v1464); + real2 v1255 = minusplus(uminus(v1251), v1252); + real2 v1253 = minusplus(v1251, v1252); + real2 v1481 = timesminusplus(reverse(v1467), load(tbl, 264 * VECWIDTH + tbloffset), times(v1467, load(tbl, 265 * VECWIDTH + tbloffset))); + real2 v1475 = timesminusplus(reverse(v1465), load(tbl, 262 * VECWIDTH + tbloffset), times(v1465, load(tbl, 263 * VECWIDTH + tbloffset))); + real2 v1109 = timesminusplus(reverse(v1095), load(tbl, 196 * VECWIDTH + tbloffset), times(v1095, load(tbl, 197 * VECWIDTH + tbloffset))); + real2 v1542 = minus(v1189, v1109); + real2 v1546 = plus(v1109, v1189); + real2 v1545 = minusplus(uminus(v1541), v1542); + real2 v1543 = minusplus(v1541, v1542); + real2 v1553 = timesminusplus(reverse(v1543), load(tbl, 274 * VECWIDTH + tbloffset), times(v1543, load(tbl, 275 * VECWIDTH + tbloffset))); + real2 v1559 = timesminusplus(reverse(v1545), load(tbl, 276 * VECWIDTH + tbloffset), times(v1545, load(tbl, 277 * VECWIDTH + tbloffset))); + real2 v1582 = minus(v1547, v1546); + real2 v1586 = plus(v1546, v1547); + real2 v1269 = timesminusplus(reverse(v1255), load(tbl, 228 * VECWIDTH + tbloffset), times(v1255, load(tbl, 229 * VECWIDTH + tbloffset))); + real2 v1438 = minus(v1309, v1269); + real2 v1442 = plus(v1269, v1309); + real2 v1263 = timesminusplus(reverse(v1253), load(tbl, 226 * VECWIDTH + tbloffset), times(v1253, load(tbl, 227 * VECWIDTH + tbloffset))); + real2 v943 = timesminusplus(reverse(v933), load(tbl, 162 * VECWIDTH + tbloffset), times(v933, load(tbl, 163 * VECWIDTH + tbloffset))); + real2 v1624 = plus(v783, v943); + real2 v1620 = minus(v943, v783); + real2 v1623 = minusplus(uminus(v1619), v1620); + real2 v1621 = minusplus(v1619, v1620); + real2 v1700 = minus(v1625, v1624); + real2 v1704 = plus(v1624, v1625); + real2 v1631 = timesminusplus(reverse(v1621), load(tbl, 286 * VECWIDTH + tbloffset), times(v1621, load(tbl, 287 * VECWIDTH + tbloffset))); + real2 v949 = timesminusplus(reverse(v935), load(tbl, 164 * VECWIDTH + tbloffset), times(v935, load(tbl, 165 * VECWIDTH + tbloffset))); + real2 v1830 = minus(v949, v789); + real2 v1834 = plus(v789, v949); + real2 v1782 = plus(v1631, v1671); + real2 v1778 = minus(v1671, v1631); + real2 v1910 = minus(v1835, v1834); + real2 v1914 = plus(v1834, v1835); + real2 v1950 = minus(v1915, v1914); + real2 v1954 = plus(v1914, v1915); + real2 v1913 = minusplus(uminus(v1909), v1910); + real2 v1911 = minusplus(v1909, v1910); + real2 v613 = minusplus(v611, v612); + real2 v615 = minusplus(uminus(v611), v612); + real2 v629 = timesminusplus(reverse(v615), load(tbl, 100 * VECWIDTH + tbloffset), times(v615, load(tbl, 101 * VECWIDTH + tbloffset))); + real2 v1744 = plus(v1704, v1705); + real2 v1740 = minus(v1705, v1704); + real2 v1637 = timesminusplus(reverse(v1623), load(tbl, 288 * VECWIDTH + tbloffset), times(v1623, load(tbl, 289 * VECWIDTH + tbloffset))); + real2 v1927 = timesminusplus(reverse(v1913), load(tbl, 340 * VECWIDTH + tbloffset), times(v1913, load(tbl, 341 * VECWIDTH + tbloffset))); + real2 v2571 = plus(v309, v629); + real2 v2565 = reverse(minus(v629, v309)); + real2 v1833 = minusplus(uminus(v1829), v1830); + real2 v1831 = minusplus(v1829, v1830); + real2 v1921 = timesminusplus(reverse(v1911), load(tbl, 338 * VECWIDTH + tbloffset), times(v1911, load(tbl, 339 * VECWIDTH + tbloffset))); + real2 v1804 = minus(v1677, v1637); + real2 v1808 = plus(v1637, v1677); + real2 v1847 = timesminusplus(reverse(v1833), load(tbl, 324 * VECWIDTH + tbloffset), times(v1833, load(tbl, 325 * VECWIDTH + tbloffset))); + real2 v2014 = minus(v1887, v1847); + real2 v2018 = plus(v1847, v1887); + real2 v1841 = timesminusplus(reverse(v1831), load(tbl, 322 * VECWIDTH + tbloffset), times(v1831, load(tbl, 323 * VECWIDTH + tbloffset))); + real2 v1988 = minus(v1881, v1841); + real2 v1992 = plus(v1841, v1881); + real2 v1703 = minusplus(uminus(v1699), v1700); + real2 v1701 = minusplus(v1699, v1700); + real2 v1717 = timesminusplus(reverse(v1703), load(tbl, 304 * VECWIDTH + tbloffset), times(v1703, load(tbl, 305 * VECWIDTH + tbloffset))); + real2 v1711 = timesminusplus(reverse(v1701), load(tbl, 302 * VECWIDTH + tbloffset), times(v1701, load(tbl, 303 * VECWIDTH + tbloffset))); + real2 v2730 = plus(v2570, v2571); + real2 v2726 = minus(v2571, v2570); + real2 v1412 = minus(v1303, v1263); + real2 v1416 = plus(v1263, v1303); + real2 v63 = load(in, 61 << inShift); + real2 v127 = load(in, 125 << inShift); + real2 v717 = plus(v63, v127); + real2 v711 = reverse(minus(v127, v63)); + real2 v95 = load(in, 93 << inShift); + real2 v31 = load(in, 29 << inShift); + real2 v712 = minus(v95, v31); + real2 v716 = plus(v31, v95); + real2 v1037 = plus(v716, v717); + real2 v1031 = reverse(minus(v717, v716)); + real2 v79 = load(in, 77 << inShift); + real2 v15 = load(in, 13 << inShift); + real2 v396 = plus(v15, v79); + real2 v392 = minus(v79, v15); + real2 v111 = load(in, 109 << inShift); + real2 v47 = load(in, 45 << inShift); + real2 v397 = plus(v47, v111); + real2 v391 = reverse(minus(v111, v47)); + real2 v1032 = minus(v397, v396); + real2 v1036 = plus(v396, v397); + real2 v1033 = minusplus(v1031, v1032); + real2 v1035 = minusplus(uminus(v1031), v1032); + real2 v1049 = timesminusplus(reverse(v1035), load(tbl, 184 * VECWIDTH + tbloffset), times(v1035, load(tbl, 185 * VECWIDTH + tbloffset))); + real2 v1043 = timesminusplus(reverse(v1033), load(tbl, 182 * VECWIDTH + tbloffset), times(v1033, load(tbl, 183 * VECWIDTH + tbloffset))); + real2 v1197 = plus(v1036, v1037); + real2 v1191 = reverse(minus(v1037, v1036)); + real2 v23 = load(in, 21 << inShift); + real2 v87 = load(in, 85 << inShift); + real2 v556 = plus(v23, v87); + real2 v552 = minus(v87, v23); + real2 v119 = load(in, 117 << inShift); + real2 v55 = load(in, 53 << inShift); + real2 v557 = plus(v55, v119); + real2 v551 = reverse(minus(v119, v55)); + real2 v877 = plus(v556, v557); + real2 v871 = reverse(minus(v557, v556)); + real2 v7 = load(in, 5 << inShift); + real2 v71 = load(in, 69 << inShift); + real2 v232 = minus(v71, v7); + real2 v236 = plus(v7, v71); + real2 v103 = load(in, 101 << inShift); + real2 v39 = load(in, 37 << inShift); + real2 v237 = plus(v39, v103); + real2 v231 = reverse(minus(v103, v39)); + real2 v876 = plus(v236, v237); + real2 v872 = minus(v237, v236); + real2 v1192 = minus(v877, v876); + real2 v1196 = plus(v876, v877); + real2 v1271 = reverse(minus(v1197, v1196)); + real2 v1277 = plus(v1196, v1197); + real2 v875 = minusplus(uminus(v871), v872); + real2 v873 = minusplus(v871, v872); + real2 v883 = timesminusplus(reverse(v873), load(tbl, 150 * VECWIDTH + tbloffset), times(v873, load(tbl, 151 * VECWIDTH + tbloffset))); + real2 v1639 = reverse(minus(v1043, v883)); + real2 v1645 = plus(v883, v1043); + real2 v1195 = minusplus(uminus(v1191), v1192); + real2 v1193 = minusplus(v1191, v1192); + real2 v1209 = timesminusplus(reverse(v1195), load(tbl, 216 * VECWIDTH + tbloffset), times(v1195, load(tbl, 217 * VECWIDTH + tbloffset))); + real2 v1203 = timesminusplus(reverse(v1193), load(tbl, 214 * VECWIDTH + tbloffset), times(v1193, load(tbl, 215 * VECWIDTH + tbloffset))); + real2 v83 = load(in, 81 << inShift); + real2 v19 = load(in, 17 << inShift); + real2 v476 = plus(v19, v83); + real2 v472 = minus(v83, v19); + real2 v51 = load(in, 49 << inShift); + real2 v115 = load(in, 113 << inShift); + real2 v477 = plus(v51, v115); + real2 v471 = reverse(minus(v115, v51)); + real2 v797 = plus(v476, v477); + real2 v791 = reverse(minus(v477, v476)); + real2 v3 = load(in, 1 << inShift); + real2 v67 = load(in, 65 << inShift); + real2 v156 = plus(v3, v67); + real2 v152 = minus(v67, v3); + real2 v35 = load(in, 33 << inShift); + real2 v99 = load(in, 97 << inShift); + real2 v157 = plus(v35, v99); + real2 v151 = reverse(minus(v99, v35)); + real2 v792 = minus(v157, v156); + real2 v796 = plus(v156, v157); + real2 v793 = minusplus(v791, v792); + real2 v795 = minusplus(uminus(v791), v792); + real2 v803 = timesminusplus(reverse(v793), load(tbl, 134 * VECWIDTH + tbloffset), times(v793, load(tbl, 135 * VECWIDTH + tbloffset))); + real2 v1112 = minus(v797, v796); + real2 v1116 = plus(v796, v797); + real2 v107 = load(in, 105 << inShift); + real2 v43 = load(in, 41 << inShift); + real2 v317 = plus(v43, v107); + real2 v311 = reverse(minus(v107, v43)); + real2 v75 = load(in, 73 << inShift); + real2 v11 = load(in, 9 << inShift); + real2 v316 = plus(v11, v75); + real2 v312 = minus(v75, v11); + real2 v956 = plus(v316, v317); + real2 v952 = minus(v317, v316); + real2 v59 = load(in, 57 << inShift); + real2 v123 = load(in, 121 << inShift); + real2 v631 = reverse(minus(v123, v59)); + real2 v637 = plus(v59, v123); + real2 v27 = load(in, 25 << inShift); + real2 v91 = load(in, 89 << inShift); + real2 v636 = plus(v27, v91); + real2 v632 = minus(v91, v27); + real2 v957 = plus(v636, v637); + real2 v951 = reverse(minus(v637, v636)); + real2 v1111 = reverse(minus(v957, v956)); + real2 v1117 = plus(v956, v957); + real2 v1276 = plus(v1116, v1117); + real2 v1272 = minus(v1117, v1116); + real2 v1275 = minusplus(uminus(v1271), v1272); + real2 v1273 = minusplus(v1271, v1272); + real2 v1283 = timesminusplus(reverse(v1273), load(tbl, 230 * VECWIDTH + tbloffset), times(v1273, load(tbl, 231 * VECWIDTH + tbloffset))); + real2 v1352 = minus(v1277, v1276); + real2 v1356 = plus(v1276, v1277); + real2 v1289 = timesminusplus(reverse(v1275), load(tbl, 232 * VECWIDTH + tbloffset), times(v1275, load(tbl, 233 * VECWIDTH + tbloffset))); + real2 v1115 = minusplus(uminus(v1111), v1112); + real2 v1113 = minusplus(v1111, v1112); + real2 v1123 = timesminusplus(reverse(v1113), load(tbl, 198 * VECWIDTH + tbloffset), times(v1113, load(tbl, 199 * VECWIDTH + tbloffset))); + real2 v1129 = timesminusplus(reverse(v1115), load(tbl, 200 * VECWIDTH + tbloffset), times(v1115, load(tbl, 201 * VECWIDTH + tbloffset))); + real2 v1488 = plus(v1123, v1203); + real2 v1484 = minus(v1203, v1123); + real2 v1566 = plus(v1129, v1209); + real2 v1562 = minus(v1209, v1129); + real2 v85 = load(in, 83 << inShift); + real2 v21 = load(in, 19 << inShift); + real2 v512 = minus(v85, v21); + real2 v516 = plus(v21, v85); + real2 v117 = load(in, 115 << inShift); + real2 v53 = load(in, 51 << inShift); + real2 v517 = plus(v53, v117); + real2 v511 = reverse(minus(v117, v53)); + real2 v831 = reverse(minus(v517, v516)); + real2 v837 = plus(v516, v517); + real2 v69 = load(in, 67 << inShift); + real2 v5 = load(in, 3 << inShift); + real2 v192 = minus(v69, v5); + real2 v196 = plus(v5, v69); + real2 v37 = load(in, 35 << inShift); + real2 v101 = load(in, 99 << inShift); + real2 v197 = plus(v37, v101); + real2 v191 = reverse(minus(v101, v37)); + real2 v832 = minus(v197, v196); + real2 v836 = plus(v196, v197); + real2 v1152 = minus(v837, v836); + real2 v1156 = plus(v836, v837); + real2 v61 = load(in, 59 << inShift); + real2 v125 = load(in, 123 << inShift); + real2 v677 = plus(v61, v125); + real2 v671 = reverse(minus(v125, v61)); + real2 v29 = load(in, 27 << inShift); + real2 v93 = load(in, 91 << inShift); + real2 v672 = minus(v93, v29); + real2 v676 = plus(v29, v93); + real2 v997 = plus(v676, v677); + real2 v991 = reverse(minus(v677, v676)); + real2 v109 = load(in, 107 << inShift); + real2 v45 = load(in, 43 << inShift); + real2 v357 = plus(v45, v109); + real2 v351 = reverse(minus(v109, v45)); + real2 v77 = load(in, 75 << inShift); + real2 v13 = load(in, 11 << inShift); + real2 v352 = minus(v77, v13); + real2 v356 = plus(v13, v77); + real2 v992 = minus(v357, v356); + real2 v996 = plus(v356, v357); + real2 v1157 = plus(v996, v997); + real2 v1151 = reverse(minus(v997, v996)); + real2 v1155 = minusplus(uminus(v1151), v1152); + real2 v1153 = minusplus(v1151, v1152); + real2 v1163 = timesminusplus(reverse(v1153), load(tbl, 206 * VECWIDTH + tbloffset), times(v1153, load(tbl, 207 * VECWIDTH + tbloffset))); + real2 v1316 = plus(v1156, v1157); + real2 v1312 = minus(v1157, v1156); + real2 v41 = load(in, 39 << inShift); + real2 v105 = load(in, 103 << inShift); + real2 v277 = plus(v41, v105); + real2 v271 = reverse(minus(v105, v41)); + real2 v9 = load(in, 7 << inShift); + real2 v73 = load(in, 71 << inShift); + real2 v276 = plus(v9, v73); + real2 v272 = minus(v73, v9); + real2 v916 = plus(v276, v277); + real2 v912 = minus(v277, v276); + real2 v89 = load(in, 87 << inShift); + real2 v25 = load(in, 23 << inShift); + real2 v592 = minus(v89, v25); + real2 v596 = plus(v25, v89); + real2 v57 = load(in, 55 << inShift); + real2 v121 = load(in, 119 << inShift); + real2 v591 = reverse(minus(v121, v57)); + real2 v597 = plus(v57, v121); + real2 v911 = reverse(minus(v597, v596)); + real2 v917 = plus(v596, v597); + real2 v1236 = plus(v916, v917); + real2 v1232 = minus(v917, v916); + real2 v81 = load(in, 79 << inShift); + real2 v17 = load(in, 15 << inShift); + real2 v432 = minus(v81, v17); + real2 v436 = plus(v17, v81); + real2 v113 = load(in, 111 << inShift); + real2 v49 = load(in, 47 << inShift); + real2 v437 = plus(v49, v113); + real2 v431 = reverse(minus(v113, v49)); + real2 v1072 = minus(v437, v436); + real2 v1076 = plus(v436, v437); + real2 v65 = load(in, 63 << inShift); + real2 v129 = load(in, 127 << inShift); + real2 v757 = plus(v65, v129); + real2 v751 = reverse(minus(v129, v65)); + real2 v97 = load(in, 95 << inShift); + real2 v33 = load(in, 31 << inShift); + real2 v752 = minus(v97, v33); + real2 v756 = plus(v33, v97); + real2 v1077 = plus(v756, v757); + real2 v1071 = reverse(minus(v757, v756)); + real2 v1231 = reverse(minus(v1077, v1076)); + real2 v1237 = plus(v1076, v1077); + real2 v1317 = plus(v1236, v1237); + real2 v1311 = reverse(minus(v1237, v1236)); + real2 v1351 = reverse(minus(v1317, v1316)); + real2 v1357 = plus(v1316, v1317); + real2 v1371 = reverse(minus(v1357, v1356)); + real2 v1377 = plus(v1356, v1357); + scatter(out, 0, 128, plus(v1376, v1377)); + real2 v1390 = minus(v1376, v1377); + scatter(out, 64, 128, timesminusplus(v1390, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1390), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1353 = minusplus(v1351, v1352); + real2 v1355 = minusplus(uminus(v1351), v1352); + real2 v1369 = timesminusplus(reverse(v1355), load(tbl, 248 * VECWIDTH + tbloffset), times(v1355, load(tbl, 249 * VECWIDTH + tbloffset))); + scatter(out, 48, 128, plus(v1349, v1369)); + real2 v1404 = minus(v1349, v1369); + scatter(out, 112, 128, timesminusplus(v1404, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1404), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1363 = timesminusplus(reverse(v1353), load(tbl, 246 * VECWIDTH + tbloffset), times(v1353, load(tbl, 247 * VECWIDTH + tbloffset))); + scatter(out, 16, 128, plus(v1343, v1363)); + real2 v1398 = minus(v1343, v1363); + scatter(out, 80, 128, timesminusplus(v1398, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1398), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1373 = minusplus(v1371, v1372); + real2 v1375 = minusplus(uminus(v1371), v1372); + scatter(out, 96, 128, timesminusplus(reverse(v1375), load(tbl, 252 * VECWIDTH + tbloffset), times(v1375, load(tbl, 253 * VECWIDTH + tbloffset)))); + scatter(out, 32, 128, timesminusplus(reverse(v1373), load(tbl, 250 * VECWIDTH + tbloffset), times(v1373, load(tbl, 251 * VECWIDTH + tbloffset)))); + real2 v1313 = minusplus(v1311, v1312); + real2 v1315 = minusplus(uminus(v1311), v1312); + real2 v1323 = timesminusplus(reverse(v1313), load(tbl, 238 * VECWIDTH + tbloffset), times(v1313, load(tbl, 239 * VECWIDTH + tbloffset))); + real2 v1417 = plus(v1283, v1323); + real2 v1411 = reverse(minus(v1323, v1283)); + scatter(out, 8, 128, plus(v1416, v1417)); + real2 v1430 = minus(v1416, v1417); + scatter(out, 72, 128, timesminusplus(v1430, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1430), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1413 = minusplus(v1411, v1412); + real2 v1415 = minusplus(uminus(v1411), v1412); + scatter(out, 104, 128, timesminusplus(reverse(v1415), load(tbl, 256 * VECWIDTH + tbloffset), times(v1415, load(tbl, 257 * VECWIDTH + tbloffset)))); + scatter(out, 40, 128, timesminusplus(reverse(v1413), load(tbl, 254 * VECWIDTH + tbloffset), times(v1413, load(tbl, 255 * VECWIDTH + tbloffset)))); + real2 v1329 = timesminusplus(reverse(v1315), load(tbl, 240 * VECWIDTH + tbloffset), times(v1315, load(tbl, 241 * VECWIDTH + tbloffset))); + real2 v1443 = plus(v1289, v1329); + real2 v1437 = reverse(minus(v1329, v1289)); + scatter(out, 24, 128, plus(v1442, v1443)); + real2 v1456 = minus(v1442, v1443); + scatter(out, 88, 128, timesminusplus(v1456, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1456), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1441 = minusplus(uminus(v1437), v1438); + real2 v1439 = minusplus(v1437, v1438); + scatter(out, 120, 128, timesminusplus(reverse(v1441), load(tbl, 260 * VECWIDTH + tbloffset), times(v1441, load(tbl, 261 * VECWIDTH + tbloffset)))); + scatter(out, 56, 128, timesminusplus(reverse(v1439), load(tbl, 258 * VECWIDTH + tbloffset), times(v1439, load(tbl, 259 * VECWIDTH + tbloffset)))); + real2 v1235 = minusplus(uminus(v1231), v1232); + real2 v1233 = minusplus(v1231, v1232); + real2 v1243 = timesminusplus(reverse(v1233), load(tbl, 222 * VECWIDTH + tbloffset), times(v1233, load(tbl, 223 * VECWIDTH + tbloffset))); + real2 v1489 = plus(v1163, v1243); + real2 v1483 = reverse(minus(v1243, v1163)); + real2 v1509 = plus(v1488, v1489); + real2 v1503 = reverse(minus(v1489, v1488)); + scatter(out, 4, 128, plus(v1508, v1509)); + real2 v1522 = minus(v1508, v1509); + scatter(out, 68, 128, timesminusplus(v1522, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1522), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1507 = minusplus(uminus(v1503), v1504); + real2 v1505 = minusplus(v1503, v1504); + scatter(out, 36, 128, timesminusplus(reverse(v1505), load(tbl, 270 * VECWIDTH + tbloffset), times(v1505, load(tbl, 271 * VECWIDTH + tbloffset)))); + scatter(out, 100, 128, timesminusplus(reverse(v1507), load(tbl, 272 * VECWIDTH + tbloffset), times(v1507, load(tbl, 273 * VECWIDTH + tbloffset)))); + real2 v1485 = minusplus(v1483, v1484); + real2 v1487 = minusplus(uminus(v1483), v1484); + real2 v1501 = timesminusplus(reverse(v1487), load(tbl, 268 * VECWIDTH + tbloffset), times(v1487, load(tbl, 269 * VECWIDTH + tbloffset))); + scatter(out, 52, 128, plus(v1481, v1501)); + real2 v1534 = minus(v1481, v1501); + scatter(out, 116, 128, timesminusplus(v1534, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1534), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1495 = timesminusplus(reverse(v1485), load(tbl, 266 * VECWIDTH + tbloffset), times(v1485, load(tbl, 267 * VECWIDTH + tbloffset))); + scatter(out, 20, 128, plus(v1475, v1495)); + real2 v1528 = minus(v1475, v1495); + scatter(out, 84, 128, timesminusplus(v1528, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1528), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1249 = timesminusplus(reverse(v1235), load(tbl, 224 * VECWIDTH + tbloffset), times(v1235, load(tbl, 225 * VECWIDTH + tbloffset))); + real2 v1169 = timesminusplus(reverse(v1155), load(tbl, 208 * VECWIDTH + tbloffset), times(v1155, load(tbl, 209 * VECWIDTH + tbloffset))); + real2 v1567 = plus(v1169, v1249); + real2 v1561 = reverse(minus(v1249, v1169)); + real2 v1581 = reverse(minus(v1567, v1566)); + real2 v1587 = plus(v1566, v1567); + scatter(out, 12, 128, plus(v1586, v1587)); + real2 v1600 = minus(v1586, v1587); + scatter(out, 76, 128, timesminusplus(v1600, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1600), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1583 = minusplus(v1581, v1582); + scatter(out, 44, 128, timesminusplus(reverse(v1583), load(tbl, 282 * VECWIDTH + tbloffset), times(v1583, load(tbl, 283 * VECWIDTH + tbloffset)))); + real2 v1585 = minusplus(uminus(v1581), v1582); + scatter(out, 108, 128, timesminusplus(reverse(v1585), load(tbl, 284 * VECWIDTH + tbloffset), times(v1585, load(tbl, 285 * VECWIDTH + tbloffset)))); + real2 v1565 = minusplus(uminus(v1561), v1562); + real2 v1563 = minusplus(v1561, v1562); + real2 v1579 = timesminusplus(reverse(v1565), load(tbl, 280 * VECWIDTH + tbloffset), times(v1565, load(tbl, 281 * VECWIDTH + tbloffset))); + scatter(out, 60, 128, plus(v1559, v1579)); + real2 v1612 = minus(v1559, v1579); + scatter(out, 124, 128, timesminusplus(v1612, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1612), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1573 = timesminusplus(reverse(v1563), load(tbl, 278 * VECWIDTH + tbloffset), times(v1563, load(tbl, 279 * VECWIDTH + tbloffset))); + scatter(out, 28, 128, plus(v1553, v1573)); + real2 v1606 = minus(v1553, v1573); + scatter(out, 92, 128, timesminusplus(v1606, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1606), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v833 = minusplus(v831, v832); + real2 v835 = minusplus(uminus(v831), v832); + real2 v955 = minusplus(uminus(v951), v952); + real2 v953 = minusplus(v951, v952); + real2 v963 = timesminusplus(reverse(v953), load(tbl, 166 * VECWIDTH + tbloffset), times(v953, load(tbl, 167 * VECWIDTH + tbloffset))); + real2 v995 = minusplus(uminus(v991), v992); + real2 v993 = minusplus(v991, v992); + real2 v1003 = timesminusplus(reverse(v993), load(tbl, 174 * VECWIDTH + tbloffset), times(v993, load(tbl, 175 * VECWIDTH + tbloffset))); + real2 v843 = timesminusplus(reverse(v833), load(tbl, 142 * VECWIDTH + tbloffset), times(v833, load(tbl, 143 * VECWIDTH + tbloffset))); + real2 v1640 = minus(v963, v803); + real2 v1644 = plus(v803, v963); + real2 v1680 = minus(v1003, v843); + real2 v1684 = plus(v843, v1003); + real2 v1641 = minusplus(v1639, v1640); + real2 v1643 = minusplus(uminus(v1639), v1640); + real2 v1657 = timesminusplus(reverse(v1643), load(tbl, 292 * VECWIDTH + tbloffset), times(v1643, load(tbl, 293 * VECWIDTH + tbloffset))); + real2 v913 = minusplus(v911, v912); + real2 v915 = minusplus(uminus(v911), v912); + real2 v1073 = minusplus(v1071, v1072); + real2 v1075 = minusplus(uminus(v1071), v1072); + real2 v923 = timesminusplus(reverse(v913), load(tbl, 158 * VECWIDTH + tbloffset), times(v913, load(tbl, 159 * VECWIDTH + tbloffset))); + real2 v1083 = timesminusplus(reverse(v1073), load(tbl, 190 * VECWIDTH + tbloffset), times(v1073, load(tbl, 191 * VECWIDTH + tbloffset))); + real2 v1685 = plus(v923, v1083); + real2 v1679 = reverse(minus(v1083, v923)); + real2 v1681 = minusplus(v1679, v1680); + real2 v1683 = minusplus(uminus(v1679), v1680); + real2 v1697 = timesminusplus(reverse(v1683), load(tbl, 300 * VECWIDTH + tbloffset), times(v1683, load(tbl, 301 * VECWIDTH + tbloffset))); + real2 v1809 = plus(v1657, v1697); + real2 v1803 = reverse(minus(v1697, v1657)); + scatter(out, 26, 128, plus(v1808, v1809)); + real2 v1822 = minus(v1808, v1809); + scatter(out, 90, 128, timesminusplus(v1822, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1822), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1807 = minusplus(uminus(v1803), v1804); + real2 v1805 = minusplus(v1803, v1804); + scatter(out, 58, 128, timesminusplus(reverse(v1805), load(tbl, 318 * VECWIDTH + tbloffset), times(v1805, load(tbl, 319 * VECWIDTH + tbloffset)))); + scatter(out, 122, 128, timesminusplus(reverse(v1807), load(tbl, 320 * VECWIDTH + tbloffset), times(v1807, load(tbl, 321 * VECWIDTH + tbloffset)))); + real2 v1651 = timesminusplus(reverse(v1641), load(tbl, 290 * VECWIDTH + tbloffset), times(v1641, load(tbl, 291 * VECWIDTH + tbloffset))); + real2 v1691 = timesminusplus(reverse(v1681), load(tbl, 298 * VECWIDTH + tbloffset), times(v1681, load(tbl, 299 * VECWIDTH + tbloffset))); + real2 v1783 = plus(v1651, v1691); + real2 v1777 = reverse(minus(v1691, v1651)); + real2 v1779 = minusplus(v1777, v1778); + real2 v1781 = minusplus(uminus(v1777), v1778); + scatter(out, 106, 128, timesminusplus(reverse(v1781), load(tbl, 316 * VECWIDTH + tbloffset), times(v1781, load(tbl, 317 * VECWIDTH + tbloffset)))); + scatter(out, 42, 128, timesminusplus(reverse(v1779), load(tbl, 314 * VECWIDTH + tbloffset), times(v1779, load(tbl, 315 * VECWIDTH + tbloffset)))); + scatter(out, 10, 128, plus(v1782, v1783)); + real2 v1796 = minus(v1782, v1783); + scatter(out, 74, 128, timesminusplus(v1796, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1796), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1720 = minus(v1645, v1644); + real2 v1724 = plus(v1644, v1645); + real2 v1719 = reverse(minus(v1685, v1684)); + real2 v1725 = plus(v1684, v1685); + real2 v1745 = plus(v1724, v1725); + real2 v1739 = reverse(minus(v1725, v1724)); + scatter(out, 2, 128, plus(v1744, v1745)); + real2 v1758 = minus(v1744, v1745); + scatter(out, 66, 128, timesminusplus(v1758, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1758), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1741 = minusplus(v1739, v1740); + real2 v1743 = minusplus(uminus(v1739), v1740); + scatter(out, 98, 128, timesminusplus(reverse(v1743), load(tbl, 312 * VECWIDTH + tbloffset), times(v1743, load(tbl, 313 * VECWIDTH + tbloffset)))); + scatter(out, 34, 128, timesminusplus(reverse(v1741), load(tbl, 310 * VECWIDTH + tbloffset), times(v1741, load(tbl, 311 * VECWIDTH + tbloffset)))); + real2 v1723 = minusplus(uminus(v1719), v1720); + real2 v1721 = minusplus(v1719, v1720); + real2 v1737 = timesminusplus(reverse(v1723), load(tbl, 308 * VECWIDTH + tbloffset), times(v1723, load(tbl, 309 * VECWIDTH + tbloffset))); + scatter(out, 50, 128, plus(v1717, v1737)); + real2 v1770 = minus(v1717, v1737); + scatter(out, 114, 128, timesminusplus(v1770, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1770), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1731 = timesminusplus(reverse(v1721), load(tbl, 306 * VECWIDTH + tbloffset), times(v1721, load(tbl, 307 * VECWIDTH + tbloffset))); + scatter(out, 18, 128, plus(v1711, v1731)); + real2 v1764 = minus(v1711, v1731); + scatter(out, 82, 128, timesminusplus(v1764, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1764), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v809 = timesminusplus(reverse(v795), load(tbl, 136 * VECWIDTH + tbloffset), times(v795, load(tbl, 137 * VECWIDTH + tbloffset))); + real2 v969 = timesminusplus(reverse(v955), load(tbl, 168 * VECWIDTH + tbloffset), times(v955, load(tbl, 169 * VECWIDTH + tbloffset))); + real2 v1850 = minus(v969, v809); + real2 v1854 = plus(v809, v969); + real2 v849 = timesminusplus(reverse(v835), load(tbl, 144 * VECWIDTH + tbloffset), times(v835, load(tbl, 145 * VECWIDTH + tbloffset))); + real2 v929 = timesminusplus(reverse(v915), load(tbl, 160 * VECWIDTH + tbloffset), times(v915, load(tbl, 161 * VECWIDTH + tbloffset))); + real2 v889 = timesminusplus(reverse(v875), load(tbl, 152 * VECWIDTH + tbloffset), times(v875, load(tbl, 153 * VECWIDTH + tbloffset))); + real2 v1089 = timesminusplus(reverse(v1075), load(tbl, 192 * VECWIDTH + tbloffset), times(v1075, load(tbl, 193 * VECWIDTH + tbloffset))); + real2 v1009 = timesminusplus(reverse(v995), load(tbl, 176 * VECWIDTH + tbloffset), times(v995, load(tbl, 177 * VECWIDTH + tbloffset))); + real2 v1890 = minus(v1009, v849); + real2 v1894 = plus(v849, v1009); + real2 v1849 = reverse(minus(v1049, v889)); + real2 v1855 = plus(v889, v1049); + real2 v1930 = minus(v1855, v1854); + real2 v1934 = plus(v1854, v1855); + real2 v1895 = plus(v929, v1089); + real2 v1889 = reverse(minus(v1089, v929)); + real2 v1929 = reverse(minus(v1895, v1894)); + real2 v1935 = plus(v1894, v1895); + real2 v1955 = plus(v1934, v1935); + real2 v1949 = reverse(minus(v1935, v1934)); + scatter(out, 6, 128, plus(v1954, v1955)); + real2 v1968 = minus(v1954, v1955); + scatter(out, 70, 128, timesminusplus(v1968, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1968), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1951 = minusplus(v1949, v1950); + scatter(out, 38, 128, timesminusplus(reverse(v1951), load(tbl, 346 * VECWIDTH + tbloffset), times(v1951, load(tbl, 347 * VECWIDTH + tbloffset)))); + real2 v1953 = minusplus(uminus(v1949), v1950); + scatter(out, 102, 128, timesminusplus(reverse(v1953), load(tbl, 348 * VECWIDTH + tbloffset), times(v1953, load(tbl, 349 * VECWIDTH + tbloffset)))); + real2 v1931 = minusplus(v1929, v1930); + real2 v1933 = minusplus(uminus(v1929), v1930); + real2 v1947 = timesminusplus(reverse(v1933), load(tbl, 344 * VECWIDTH + tbloffset), times(v1933, load(tbl, 345 * VECWIDTH + tbloffset))); + scatter(out, 54, 128, plus(v1927, v1947)); + real2 v1980 = minus(v1927, v1947); + scatter(out, 118, 128, timesminusplus(v1980, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1980), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1941 = timesminusplus(reverse(v1931), load(tbl, 342 * VECWIDTH + tbloffset), times(v1931, load(tbl, 343 * VECWIDTH + tbloffset))); + scatter(out, 22, 128, plus(v1921, v1941)); + real2 v1974 = minus(v1921, v1941); + scatter(out, 86, 128, timesminusplus(v1974, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v1974), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1851 = minusplus(v1849, v1850); + real2 v1853 = minusplus(uminus(v1849), v1850); + real2 v1867 = timesminusplus(reverse(v1853), load(tbl, 328 * VECWIDTH + tbloffset), times(v1853, load(tbl, 329 * VECWIDTH + tbloffset))); + real2 v1891 = minusplus(v1889, v1890); + real2 v1893 = minusplus(uminus(v1889), v1890); + real2 v1907 = timesminusplus(reverse(v1893), load(tbl, 336 * VECWIDTH + tbloffset), times(v1893, load(tbl, 337 * VECWIDTH + tbloffset))); + real2 v2019 = plus(v1867, v1907); + real2 v2013 = reverse(minus(v1907, v1867)); + scatter(out, 30, 128, plus(v2018, v2019)); + real2 v2032 = minus(v2018, v2019); + scatter(out, 94, 128, timesminusplus(v2032, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2032), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2017 = minusplus(uminus(v2013), v2014); + scatter(out, 126, 128, timesminusplus(reverse(v2017), load(tbl, 356 * VECWIDTH + tbloffset), times(v2017, load(tbl, 357 * VECWIDTH + tbloffset)))); + real2 v2015 = minusplus(v2013, v2014); + scatter(out, 62, 128, timesminusplus(reverse(v2015), load(tbl, 354 * VECWIDTH + tbloffset), times(v2015, load(tbl, 355 * VECWIDTH + tbloffset)))); + real2 v1861 = timesminusplus(reverse(v1851), load(tbl, 326 * VECWIDTH + tbloffset), times(v1851, load(tbl, 327 * VECWIDTH + tbloffset))); + real2 v1901 = timesminusplus(reverse(v1891), load(tbl, 334 * VECWIDTH + tbloffset), times(v1891, load(tbl, 335 * VECWIDTH + tbloffset))); + real2 v1993 = plus(v1861, v1901); + real2 v1987 = reverse(minus(v1901, v1861)); + scatter(out, 14, 128, plus(v1992, v1993)); + real2 v2006 = minus(v1992, v1993); + scatter(out, 78, 128, timesminusplus(v2006, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2006), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v1991 = minusplus(uminus(v1987), v1988); + scatter(out, 110, 128, timesminusplus(reverse(v1991), load(tbl, 352 * VECWIDTH + tbloffset), times(v1991, load(tbl, 353 * VECWIDTH + tbloffset)))); + real2 v1989 = minusplus(v1987, v1988); + scatter(out, 46, 128, timesminusplus(reverse(v1989), load(tbl, 350 * VECWIDTH + tbloffset), times(v1989, load(tbl, 351 * VECWIDTH + tbloffset)))); + real2 v593 = minusplus(v591, v592); + real2 v595 = minusplus(uminus(v591), v592); + real2 v473 = minusplus(v471, v472); + real2 v475 = minusplus(uminus(v471), v472); + real2 v555 = minusplus(uminus(v551), v552); + real2 v553 = minusplus(v551, v552); + real2 v609 = timesminusplus(reverse(v595), load(tbl, 96 * VECWIDTH + tbloffset), times(v595, load(tbl, 97 * VECWIDTH + tbloffset))); + real2 v195 = minusplus(uminus(v191), v192); + real2 v193 = minusplus(v191, v192); + real2 v275 = minusplus(uminus(v271), v272); + real2 v273 = minusplus(v271, v272); + real2 v673 = minusplus(v671, v672); + real2 v675 = minusplus(uminus(v671), v672); + real2 v689 = timesminusplus(reverse(v675), load(tbl, 112 * VECWIDTH + tbloffset), times(v675, load(tbl, 113 * VECWIDTH + tbloffset))); + real2 v209 = timesminusplus(reverse(v195), load(tbl, 16 * VECWIDTH + tbloffset), times(v195, load(tbl, 17 * VECWIDTH + tbloffset))); + real2 v289 = timesminusplus(reverse(v275), load(tbl, 32 * VECWIDTH + tbloffset), times(v275, load(tbl, 33 * VECWIDTH + tbloffset))); + real2 v755 = minusplus(uminus(v751), v752); + real2 v753 = minusplus(v751, v752); + real2 v435 = minusplus(uminus(v431), v432); + real2 v433 = minusplus(v431, v432); + real2 v513 = minusplus(v511, v512); + real2 v515 = minusplus(uminus(v511), v512); + real2 v529 = timesminusplus(reverse(v515), load(tbl, 80 * VECWIDTH + tbloffset), times(v515, load(tbl, 81 * VECWIDTH + tbloffset))); + real2 v353 = minusplus(v351, v352); + real2 v355 = minusplus(uminus(v351), v352); + real2 v369 = timesminusplus(reverse(v355), load(tbl, 48 * VECWIDTH + tbloffset), times(v355, load(tbl, 49 * VECWIDTH + tbloffset))); + real2 v2631 = plus(v369, v689); + real2 v2625 = reverse(minus(v689, v369)); + real2 v449 = timesminusplus(reverse(v435), load(tbl, 64 * VECWIDTH + tbloffset), times(v435, load(tbl, 65 * VECWIDTH + tbloffset))); + real2 v2710 = plus(v289, v609); + real2 v2706 = minus(v609, v289); + real2 v2630 = plus(v209, v529); + real2 v2626 = minus(v529, v209); + real2 v2790 = plus(v2630, v2631); + real2 v2786 = minus(v2631, v2630); + real2 v713 = minusplus(v711, v712); + real2 v715 = minusplus(uminus(v711), v712); + real2 v769 = timesminusplus(reverse(v755), load(tbl, 128 * VECWIDTH + tbloffset), times(v755, load(tbl, 129 * VECWIDTH + tbloffset))); + real2 v2705 = reverse(minus(v769, v449)); + real2 v2711 = plus(v449, v769); + real2 v313 = minusplus(v311, v312); + real2 v315 = minusplus(uminus(v311), v312); + real2 v393 = minusplus(v391, v392); + real2 v395 = minusplus(uminus(v391), v392); + real2 v409 = timesminusplus(reverse(v395), load(tbl, 56 * VECWIDTH + tbloffset), times(v395, load(tbl, 57 * VECWIDTH + tbloffset))); + real2 v729 = timesminusplus(reverse(v715), load(tbl, 120 * VECWIDTH + tbloffset), times(v715, load(tbl, 121 * VECWIDTH + tbloffset))); + real2 v329 = timesminusplus(reverse(v315), load(tbl, 40 * VECWIDTH + tbloffset), times(v315, load(tbl, 41 * VECWIDTH + tbloffset))); + real2 v489 = timesminusplus(reverse(v475), load(tbl, 72 * VECWIDTH + tbloffset), times(v475, load(tbl, 73 * VECWIDTH + tbloffset))); + real2 v153 = minusplus(v151, v152); + real2 v155 = minusplus(uminus(v151), v152); + real2 v169 = timesminusplus(reverse(v155), load(tbl, 8 * VECWIDTH + tbloffset), times(v155, load(tbl, 9 * VECWIDTH + tbloffset))); + real2 v2586 = minus(v489, v169); + real2 v2590 = plus(v169, v489); + real2 v233 = minusplus(v231, v232); + real2 v235 = minusplus(uminus(v231), v232); + real2 v633 = minusplus(v631, v632); + real2 v635 = minusplus(uminus(v631), v632); + real2 v649 = timesminusplus(reverse(v635), load(tbl, 104 * VECWIDTH + tbloffset), times(v635, load(tbl, 105 * VECWIDTH + tbloffset))); + real2 v249 = timesminusplus(reverse(v235), load(tbl, 24 * VECWIDTH + tbloffset), times(v235, load(tbl, 25 * VECWIDTH + tbloffset))); + real2 v569 = timesminusplus(reverse(v555), load(tbl, 88 * VECWIDTH + tbloffset), times(v555, load(tbl, 89 * VECWIDTH + tbloffset))); + real2 v2670 = plus(v249, v569); + real2 v2666 = minus(v569, v249); + real2 v2785 = reverse(minus(v2711, v2710)); + real2 v2791 = plus(v2710, v2711); + real2 v2825 = reverse(minus(v2791, v2790)); + real2 v2831 = plus(v2790, v2791); + real2 v2671 = plus(v409, v729); + real2 v2665 = reverse(minus(v729, v409)); + real2 v2745 = reverse(minus(v2671, v2670)); + real2 v2751 = plus(v2670, v2671); + real2 v2806 = minus(v2731, v2730); + real2 v2810 = plus(v2730, v2731); + real2 v2846 = minus(v2811, v2810); + real2 v2850 = plus(v2810, v2811); + real2 v2591 = plus(v329, v649); + real2 v2585 = reverse(minus(v649, v329)); + real2 v2750 = plus(v2590, v2591); + real2 v2746 = minus(v2591, v2590); + real2 v2830 = plus(v2750, v2751); + real2 v2826 = minus(v2751, v2750); + real2 v2845 = reverse(minus(v2831, v2830)); + real2 v2851 = plus(v2830, v2831); + scatter(out, 3, 128, plus(v2850, v2851)); + real2 v2864 = minus(v2850, v2851); + scatter(out, 67, 128, timesminusplus(v2864, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2864), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2849 = minusplus(uminus(v2845), v2846); + real2 v2847 = minusplus(v2845, v2846); + scatter(out, 35, 128, timesminusplus(reverse(v2847), load(tbl, 506 * VECWIDTH + tbloffset), times(v2847, load(tbl, 507 * VECWIDTH + tbloffset)))); + scatter(out, 99, 128, timesminusplus(reverse(v2849), load(tbl, 508 * VECWIDTH + tbloffset), times(v2849, load(tbl, 509 * VECWIDTH + tbloffset)))); + real2 v2827 = minusplus(v2825, v2826); + real2 v2829 = minusplus(uminus(v2825), v2826); + real2 v2837 = timesminusplus(reverse(v2827), load(tbl, 502 * VECWIDTH + tbloffset), times(v2827, load(tbl, 503 * VECWIDTH + tbloffset))); + real2 v2809 = minusplus(uminus(v2805), v2806); + real2 v2807 = minusplus(v2805, v2806); + real2 v2817 = timesminusplus(reverse(v2807), load(tbl, 498 * VECWIDTH + tbloffset), times(v2807, load(tbl, 499 * VECWIDTH + tbloffset))); + scatter(out, 19, 128, plus(v2817, v2837)); + real2 v2870 = minus(v2817, v2837); + scatter(out, 83, 128, timesminusplus(v2870, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2870), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2823 = timesminusplus(reverse(v2809), load(tbl, 500 * VECWIDTH + tbloffset), times(v2809, load(tbl, 501 * VECWIDTH + tbloffset))); + real2 v2843 = timesminusplus(reverse(v2829), load(tbl, 504 * VECWIDTH + tbloffset), times(v2829, load(tbl, 505 * VECWIDTH + tbloffset))); + scatter(out, 51, 128, plus(v2823, v2843)); + real2 v2876 = minus(v2823, v2843); + scatter(out, 115, 128, timesminusplus(v2876, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2876), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2787 = minusplus(v2785, v2786); + real2 v2789 = minusplus(uminus(v2785), v2786); + real2 v2803 = timesminusplus(reverse(v2789), load(tbl, 496 * VECWIDTH + tbloffset), times(v2789, load(tbl, 497 * VECWIDTH + tbloffset))); + real2 v2727 = minusplus(v2725, v2726); + real2 v2729 = minusplus(uminus(v2725), v2726); + real2 v2743 = timesminusplus(reverse(v2729), load(tbl, 484 * VECWIDTH + tbloffset), times(v2729, load(tbl, 485 * VECWIDTH + tbloffset))); + real2 v2914 = plus(v2743, v2783); + real2 v2910 = minus(v2783, v2743); + real2 v2749 = minusplus(uminus(v2745), v2746); + real2 v2747 = minusplus(v2745, v2746); + real2 v2763 = timesminusplus(reverse(v2749), load(tbl, 488 * VECWIDTH + tbloffset), times(v2749, load(tbl, 489 * VECWIDTH + tbloffset))); + real2 v2909 = reverse(minus(v2803, v2763)); + real2 v2915 = plus(v2763, v2803); + scatter(out, 27, 128, plus(v2914, v2915)); + real2 v2928 = minus(v2914, v2915); + scatter(out, 91, 128, timesminusplus(v2928, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2928), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2913 = minusplus(uminus(v2909), v2910); + scatter(out, 123, 128, timesminusplus(reverse(v2913), load(tbl, 516 * VECWIDTH + tbloffset), times(v2913, load(tbl, 517 * VECWIDTH + tbloffset)))); + real2 v2911 = minusplus(v2909, v2910); + scatter(out, 59, 128, timesminusplus(reverse(v2911), load(tbl, 514 * VECWIDTH + tbloffset), times(v2911, load(tbl, 515 * VECWIDTH + tbloffset)))); + real2 v2737 = timesminusplus(reverse(v2727), load(tbl, 482 * VECWIDTH + tbloffset), times(v2727, load(tbl, 483 * VECWIDTH + tbloffset))); + real2 v2888 = plus(v2737, v2777); + real2 v2884 = minus(v2777, v2737); + real2 v2797 = timesminusplus(reverse(v2787), load(tbl, 494 * VECWIDTH + tbloffset), times(v2787, load(tbl, 495 * VECWIDTH + tbloffset))); + real2 v2757 = timesminusplus(reverse(v2747), load(tbl, 486 * VECWIDTH + tbloffset), times(v2747, load(tbl, 487 * VECWIDTH + tbloffset))); + real2 v2889 = plus(v2757, v2797); + real2 v2883 = reverse(minus(v2797, v2757)); + scatter(out, 11, 128, plus(v2888, v2889)); + real2 v2902 = minus(v2888, v2889); + scatter(out, 75, 128, timesminusplus(v2902, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2902), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2887 = minusplus(uminus(v2883), v2884); + scatter(out, 107, 128, timesminusplus(reverse(v2887), load(tbl, 512 * VECWIDTH + tbloffset), times(v2887, load(tbl, 513 * VECWIDTH + tbloffset)))); + real2 v2885 = minusplus(v2883, v2884); + scatter(out, 43, 128, timesminusplus(reverse(v2885), load(tbl, 510 * VECWIDTH + tbloffset), times(v2885, load(tbl, 511 * VECWIDTH + tbloffset)))); + real2 v2669 = minusplus(uminus(v2665), v2666); + real2 v2667 = minusplus(v2665, v2666); + real2 v2707 = minusplus(v2705, v2706); + real2 v2709 = minusplus(uminus(v2705), v2706); + real2 v2717 = timesminusplus(reverse(v2707), load(tbl, 478 * VECWIDTH + tbloffset), times(v2707, load(tbl, 479 * VECWIDTH + tbloffset))); + real2 v2627 = minusplus(v2625, v2626); + real2 v2629 = minusplus(uminus(v2625), v2626); + real2 v2637 = timesminusplus(reverse(v2627), load(tbl, 462 * VECWIDTH + tbloffset), times(v2627, load(tbl, 463 * VECWIDTH + tbloffset))); + real2 v2961 = plus(v2637, v2717); + real2 v2955 = reverse(minus(v2717, v2637)); + real2 v2649 = minusplus(uminus(v2645), v2646); + real2 v2647 = minusplus(v2645, v2646); + real2 v2569 = minusplus(uminus(v2565), v2566); + real2 v2567 = minusplus(v2565, v2566); + real2 v2577 = timesminusplus(reverse(v2567), load(tbl, 450 * VECWIDTH + tbloffset), times(v2567, load(tbl, 451 * VECWIDTH + tbloffset))); + real2 v2657 = timesminusplus(reverse(v2647), load(tbl, 466 * VECWIDTH + tbloffset), times(v2647, load(tbl, 467 * VECWIDTH + tbloffset))); + real2 v2936 = minus(v2657, v2577); + real2 v2940 = plus(v2577, v2657); + real2 v2976 = minus(v2941, v2940); + real2 v2980 = plus(v2940, v2941); + real2 v2677 = timesminusplus(reverse(v2667), load(tbl, 470 * VECWIDTH + tbloffset), times(v2667, load(tbl, 471 * VECWIDTH + tbloffset))); + real2 v2587 = minusplus(v2585, v2586); + real2 v2589 = minusplus(uminus(v2585), v2586); + real2 v2597 = timesminusplus(reverse(v2587), load(tbl, 454 * VECWIDTH + tbloffset), times(v2587, load(tbl, 455 * VECWIDTH + tbloffset))); + real2 v2956 = minus(v2677, v2597); + real2 v2960 = plus(v2597, v2677); + real2 v2975 = reverse(minus(v2961, v2960)); + real2 v2981 = plus(v2960, v2961); + scatter(out, 7, 128, plus(v2980, v2981)); + real2 v2994 = minus(v2980, v2981); + scatter(out, 71, 128, timesminusplus(v2994, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2994), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2979 = minusplus(uminus(v2975), v2976); + scatter(out, 103, 128, timesminusplus(reverse(v2979), load(tbl, 528 * VECWIDTH + tbloffset), times(v2979, load(tbl, 529 * VECWIDTH + tbloffset)))); + real2 v2977 = minusplus(v2975, v2976); + scatter(out, 39, 128, timesminusplus(reverse(v2977), load(tbl, 526 * VECWIDTH + tbloffset), times(v2977, load(tbl, 527 * VECWIDTH + tbloffset)))); + real2 v2939 = minusplus(uminus(v2935), v2936); + real2 v2937 = minusplus(v2935, v2936); + real2 v2953 = timesminusplus(reverse(v2939), load(tbl, 520 * VECWIDTH + tbloffset), times(v2939, load(tbl, 521 * VECWIDTH + tbloffset))); + real2 v2957 = minusplus(v2955, v2956); + real2 v2959 = minusplus(uminus(v2955), v2956); + real2 v2973 = timesminusplus(reverse(v2959), load(tbl, 524 * VECWIDTH + tbloffset), times(v2959, load(tbl, 525 * VECWIDTH + tbloffset))); + scatter(out, 55, 128, plus(v2953, v2973)); + real2 v3006 = minus(v2953, v2973); + scatter(out, 119, 128, timesminusplus(v3006, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3006), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2947 = timesminusplus(reverse(v2937), load(tbl, 518 * VECWIDTH + tbloffset), times(v2937, load(tbl, 519 * VECWIDTH + tbloffset))); + real2 v2967 = timesminusplus(reverse(v2957), load(tbl, 522 * VECWIDTH + tbloffset), times(v2957, load(tbl, 523 * VECWIDTH + tbloffset))); + scatter(out, 23, 128, plus(v2947, v2967)); + real2 v3000 = minus(v2947, v2967); + scatter(out, 87, 128, timesminusplus(v3000, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3000), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2663 = timesminusplus(reverse(v2649), load(tbl, 468 * VECWIDTH + tbloffset), times(v2649, load(tbl, 469 * VECWIDTH + tbloffset))); + real2 v2583 = timesminusplus(reverse(v2569), load(tbl, 452 * VECWIDTH + tbloffset), times(v2569, load(tbl, 453 * VECWIDTH + tbloffset))); + real2 v3014 = minus(v2663, v2583); + real2 v3018 = plus(v2583, v2663); + real2 v3015 = minusplus(v3013, v3014); + real2 v3017 = minusplus(uminus(v3013), v3014); + real2 v2643 = timesminusplus(reverse(v2629), load(tbl, 464 * VECWIDTH + tbloffset), times(v2629, load(tbl, 465 * VECWIDTH + tbloffset))); + real2 v2723 = timesminusplus(reverse(v2709), load(tbl, 480 * VECWIDTH + tbloffset), times(v2709, load(tbl, 481 * VECWIDTH + tbloffset))); + real2 v3039 = plus(v2643, v2723); + real2 v3033 = reverse(minus(v2723, v2643)); + real2 v2683 = timesminusplus(reverse(v2669), load(tbl, 472 * VECWIDTH + tbloffset), times(v2669, load(tbl, 473 * VECWIDTH + tbloffset))); + real2 v3031 = timesminusplus(reverse(v3017), load(tbl, 532 * VECWIDTH + tbloffset), times(v3017, load(tbl, 533 * VECWIDTH + tbloffset))); + real2 v2603 = timesminusplus(reverse(v2589), load(tbl, 456 * VECWIDTH + tbloffset), times(v2589, load(tbl, 457 * VECWIDTH + tbloffset))); + real2 v3034 = minus(v2683, v2603); + real2 v3038 = plus(v2603, v2683); + real2 v3037 = minusplus(uminus(v3033), v3034); + real2 v3035 = minusplus(v3033, v3034); + real2 v3051 = timesminusplus(reverse(v3037), load(tbl, 536 * VECWIDTH + tbloffset), times(v3037, load(tbl, 537 * VECWIDTH + tbloffset))); + scatter(out, 63, 128, plus(v3031, v3051)); + real2 v3084 = minus(v3031, v3051); + scatter(out, 127, 128, timesminusplus(v3084, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3084), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v3025 = timesminusplus(reverse(v3015), load(tbl, 530 * VECWIDTH + tbloffset), times(v3015, load(tbl, 531 * VECWIDTH + tbloffset))); + real2 v3045 = timesminusplus(reverse(v3035), load(tbl, 534 * VECWIDTH + tbloffset), times(v3035, load(tbl, 535 * VECWIDTH + tbloffset))); + scatter(out, 31, 128, plus(v3025, v3045)); + real2 v3078 = minus(v3025, v3045); + scatter(out, 95, 128, timesminusplus(v3078, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3078), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v3058 = plus(v3018, v3019); + real2 v3054 = minus(v3019, v3018); + real2 v3053 = reverse(minus(v3039, v3038)); + real2 v3059 = plus(v3038, v3039); + real2 v3055 = minusplus(v3053, v3054); + scatter(out, 47, 128, timesminusplus(reverse(v3055), load(tbl, 538 * VECWIDTH + tbloffset), times(v3055, load(tbl, 539 * VECWIDTH + tbloffset)))); + real2 v3057 = minusplus(uminus(v3053), v3054); + scatter(out, 111, 128, timesminusplus(reverse(v3057), load(tbl, 540 * VECWIDTH + tbloffset), times(v3057, load(tbl, 541 * VECWIDTH + tbloffset)))); + scatter(out, 15, 128, plus(v3058, v3059)); + real2 v3072 = minus(v3058, v3059); + scatter(out, 79, 128, timesminusplus(v3072, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v3072), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v683 = timesminusplus(reverse(v673), load(tbl, 110 * VECWIDTH + tbloffset), times(v673, load(tbl, 111 * VECWIDTH + tbloffset))); + real2 v363 = timesminusplus(reverse(v353), load(tbl, 46 * VECWIDTH + tbloffset), times(v353, load(tbl, 47 * VECWIDTH + tbloffset))); + real2 v2105 = plus(v363, v683); + real2 v2099 = reverse(minus(v683, v363)); + real2 v283 = timesminusplus(reverse(v273), load(tbl, 30 * VECWIDTH + tbloffset), times(v273, load(tbl, 31 * VECWIDTH + tbloffset))); + real2 v723 = timesminusplus(reverse(v713), load(tbl, 118 * VECWIDTH + tbloffset), times(v713, load(tbl, 119 * VECWIDTH + tbloffset))); + real2 v403 = timesminusplus(reverse(v393), load(tbl, 54 * VECWIDTH + tbloffset), times(v393, load(tbl, 55 * VECWIDTH + tbloffset))); + real2 v603 = timesminusplus(reverse(v593), load(tbl, 94 * VECWIDTH + tbloffset), times(v593, load(tbl, 95 * VECWIDTH + tbloffset))); + real2 v2180 = minus(v603, v283); + real2 v2184 = plus(v283, v603); + real2 v2145 = plus(v403, v723); + real2 v2139 = reverse(minus(v723, v403)); + real2 v543 = timesminusplus(reverse(v533), load(tbl, 82 * VECWIDTH + tbloffset), times(v533, load(tbl, 83 * VECWIDTH + tbloffset))); + real2 v383 = timesminusplus(reverse(v373), load(tbl, 50 * VECWIDTH + tbloffset), times(v373, load(tbl, 51 * VECWIDTH + tbloffset))); + real2 v703 = timesminusplus(reverse(v693), load(tbl, 114 * VECWIDTH + tbloffset), times(v693, load(tbl, 115 * VECWIDTH + tbloffset))); + real2 v2125 = plus(v383, v703); + real2 v2119 = reverse(minus(v703, v383)); + real2 v223 = timesminusplus(reverse(v213), load(tbl, 18 * VECWIDTH + tbloffset), times(v213, load(tbl, 19 * VECWIDTH + tbloffset))); + real2 v2120 = minus(v543, v223); + real2 v2124 = plus(v223, v543); + real2 v443 = timesminusplus(reverse(v433), load(tbl, 62 * VECWIDTH + tbloffset), times(v433, load(tbl, 63 * VECWIDTH + tbloffset))); + real2 v203 = timesminusplus(reverse(v193), load(tbl, 14 * VECWIDTH + tbloffset), times(v193, load(tbl, 15 * VECWIDTH + tbloffset))); + real2 v763 = timesminusplus(reverse(v753), load(tbl, 126 * VECWIDTH + tbloffset), times(v753, load(tbl, 127 * VECWIDTH + tbloffset))); + real2 v2179 = reverse(minus(v763, v443)); + real2 v2185 = plus(v443, v763); + real2 v523 = timesminusplus(reverse(v513), load(tbl, 78 * VECWIDTH + tbloffset), times(v513, load(tbl, 79 * VECWIDTH + tbloffset))); + real2 v2100 = minus(v523, v203); + real2 v2104 = plus(v203, v523); + real2 v2264 = plus(v2104, v2105); + real2 v2260 = minus(v2105, v2104); + real2 v643 = timesminusplus(reverse(v633), load(tbl, 102 * VECWIDTH + tbloffset), times(v633, load(tbl, 103 * VECWIDTH + tbloffset))); + real2 v2265 = plus(v2184, v2185); + real2 v2259 = reverse(minus(v2185, v2184)); + real2 v563 = timesminusplus(reverse(v553), load(tbl, 86 * VECWIDTH + tbloffset), times(v553, load(tbl, 87 * VECWIDTH + tbloffset))); + real2 v243 = timesminusplus(reverse(v233), load(tbl, 22 * VECWIDTH + tbloffset), times(v233, load(tbl, 23 * VECWIDTH + tbloffset))); + real2 v2144 = plus(v243, v563); + real2 v2140 = minus(v563, v243); + real2 v143 = timesminusplus(reverse(v133), load(tbl, 2 * VECWIDTH + tbloffset), times(v133, load(tbl, 3 * VECWIDTH + tbloffset))); + real2 v183 = timesminusplus(reverse(v173), load(tbl, 10 * VECWIDTH + tbloffset), times(v173, load(tbl, 11 * VECWIDTH + tbloffset))); + real2 v2084 = plus(v183, v503); + real2 v2080 = minus(v503, v183); + real2 v163 = timesminusplus(reverse(v153), load(tbl, 6 * VECWIDTH + tbloffset), times(v153, load(tbl, 7 * VECWIDTH + tbloffset))); + real2 v303 = timesminusplus(reverse(v293), load(tbl, 34 * VECWIDTH + tbloffset), times(v293, load(tbl, 35 * VECWIDTH + tbloffset))); + real2 v623 = timesminusplus(reverse(v613), load(tbl, 98 * VECWIDTH + tbloffset), times(v613, load(tbl, 99 * VECWIDTH + tbloffset))); + real2 v2039 = reverse(minus(v623, v303)); + real2 v2045 = plus(v303, v623); + real2 v463 = timesminusplus(reverse(v453), load(tbl, 66 * VECWIDTH + tbloffset), times(v453, load(tbl, 67 * VECWIDTH + tbloffset))); + real2 v2044 = plus(v143, v463); + real2 v2040 = minus(v463, v143); + real2 v2204 = plus(v2044, v2045); + real2 v2200 = minus(v2045, v2044); + real2 v323 = timesminusplus(reverse(v313), load(tbl, 38 * VECWIDTH + tbloffset), times(v313, load(tbl, 39 * VECWIDTH + tbloffset))); + real2 v2205 = plus(v2124, v2125); + real2 v2199 = reverse(minus(v2125, v2124)); + real2 v2280 = minus(v2205, v2204); + real2 v2284 = plus(v2204, v2205); + real2 v2225 = plus(v2144, v2145); + real2 v2219 = reverse(minus(v2145, v2144)); + real2 v2305 = plus(v2264, v2265); + real2 v2299 = reverse(minus(v2265, v2264)); + real2 v2240 = minus(v2085, v2084); + real2 v2244 = plus(v2084, v2085); + real2 v2279 = reverse(minus(v2245, v2244)); + real2 v2285 = plus(v2244, v2245); + real2 v2281 = minusplus(v2279, v2280); + real2 v2283 = minusplus(uminus(v2279), v2280); + real2 v2291 = timesminusplus(reverse(v2281), load(tbl, 406 * VECWIDTH + tbloffset), times(v2281, load(tbl, 407 * VECWIDTH + tbloffset))); + real2 v483 = timesminusplus(reverse(v473), load(tbl, 70 * VECWIDTH + tbloffset), times(v473, load(tbl, 71 * VECWIDTH + tbloffset))); + real2 v2060 = minus(v483, v163); + real2 v2064 = plus(v163, v483); + real2 v2065 = plus(v323, v643); + real2 v2059 = reverse(minus(v643, v323)); + real2 v2220 = minus(v2065, v2064); + real2 v2224 = plus(v2064, v2065); + real2 v2304 = plus(v2224, v2225); + real2 v2300 = minus(v2225, v2224); + real2 v2301 = minusplus(v2299, v2300); + real2 v2303 = minusplus(uminus(v2299), v2300); + real2 v2311 = timesminusplus(reverse(v2301), load(tbl, 410 * VECWIDTH + tbloffset), times(v2301, load(tbl, 411 * VECWIDTH + tbloffset))); + scatter(out, 17, 128, plus(v2291, v2311)); + real2 v2344 = minus(v2291, v2311); + scatter(out, 81, 128, timesminusplus(v2344, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2344), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2297 = timesminusplus(reverse(v2283), load(tbl, 408 * VECWIDTH + tbloffset), times(v2283, load(tbl, 409 * VECWIDTH + tbloffset))); + real2 v2317 = timesminusplus(reverse(v2303), load(tbl, 412 * VECWIDTH + tbloffset), times(v2303, load(tbl, 413 * VECWIDTH + tbloffset))); + scatter(out, 49, 128, plus(v2297, v2317)); + real2 v2350 = minus(v2297, v2317); + scatter(out, 113, 128, timesminusplus(v2350, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2350), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2320 = minus(v2285, v2284); + real2 v2324 = plus(v2284, v2285); + real2 v2325 = plus(v2304, v2305); + real2 v2319 = reverse(minus(v2305, v2304)); + scatter(out, 1, 128, plus(v2324, v2325)); + real2 v2338 = minus(v2324, v2325); + scatter(out, 65, 128, timesminusplus(v2338, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2338), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2321 = minusplus(v2319, v2320); + scatter(out, 33, 128, timesminusplus(reverse(v2321), load(tbl, 414 * VECWIDTH + tbloffset), times(v2321, load(tbl, 415 * VECWIDTH + tbloffset)))); + real2 v2323 = minusplus(uminus(v2319), v2320); + scatter(out, 97, 128, timesminusplus(reverse(v2323), load(tbl, 416 * VECWIDTH + tbloffset), times(v2323, load(tbl, 417 * VECWIDTH + tbloffset)))); + real2 v2201 = minusplus(v2199, v2200); + real2 v2203 = minusplus(uminus(v2199), v2200); + real2 v2263 = minusplus(uminus(v2259), v2260); + real2 v2261 = minusplus(v2259, v2260); + real2 v2243 = minusplus(uminus(v2239), v2240); + real2 v2241 = minusplus(v2239, v2240); + real2 v2257 = timesminusplus(reverse(v2243), load(tbl, 400 * VECWIDTH + tbloffset), times(v2243, load(tbl, 401 * VECWIDTH + tbloffset))); + real2 v2217 = timesminusplus(reverse(v2203), load(tbl, 392 * VECWIDTH + tbloffset), times(v2203, load(tbl, 393 * VECWIDTH + tbloffset))); + real2 v2388 = plus(v2217, v2257); + real2 v2384 = minus(v2257, v2217); + real2 v2277 = timesminusplus(reverse(v2263), load(tbl, 404 * VECWIDTH + tbloffset), times(v2263, load(tbl, 405 * VECWIDTH + tbloffset))); + real2 v2221 = minusplus(v2219, v2220); + real2 v2223 = minusplus(uminus(v2219), v2220); + real2 v2237 = timesminusplus(reverse(v2223), load(tbl, 396 * VECWIDTH + tbloffset), times(v2223, load(tbl, 397 * VECWIDTH + tbloffset))); + real2 v2389 = plus(v2237, v2277); + real2 v2383 = reverse(minus(v2277, v2237)); + scatter(out, 25, 128, plus(v2388, v2389)); + real2 v2402 = minus(v2388, v2389); + scatter(out, 89, 128, timesminusplus(v2402, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2402), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2385 = minusplus(v2383, v2384); + real2 v2387 = minusplus(uminus(v2383), v2384); + scatter(out, 121, 128, timesminusplus(reverse(v2387), load(tbl, 424 * VECWIDTH + tbloffset), times(v2387, load(tbl, 425 * VECWIDTH + tbloffset)))); + scatter(out, 57, 128, timesminusplus(reverse(v2385), load(tbl, 422 * VECWIDTH + tbloffset), times(v2385, load(tbl, 423 * VECWIDTH + tbloffset)))); + real2 v2251 = timesminusplus(reverse(v2241), load(tbl, 398 * VECWIDTH + tbloffset), times(v2241, load(tbl, 399 * VECWIDTH + tbloffset))); + real2 v2211 = timesminusplus(reverse(v2201), load(tbl, 390 * VECWIDTH + tbloffset), times(v2201, load(tbl, 391 * VECWIDTH + tbloffset))); + real2 v2358 = minus(v2251, v2211); + real2 v2362 = plus(v2211, v2251); + real2 v2271 = timesminusplus(reverse(v2261), load(tbl, 402 * VECWIDTH + tbloffset), times(v2261, load(tbl, 403 * VECWIDTH + tbloffset))); + real2 v2231 = timesminusplus(reverse(v2221), load(tbl, 394 * VECWIDTH + tbloffset), times(v2221, load(tbl, 395 * VECWIDTH + tbloffset))); + real2 v2357 = reverse(minus(v2271, v2231)); + real2 v2363 = plus(v2231, v2271); + scatter(out, 9, 128, plus(v2362, v2363)); + real2 v2376 = minus(v2362, v2363); + scatter(out, 73, 128, timesminusplus(v2376, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2376), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2361 = minusplus(uminus(v2357), v2358); + scatter(out, 105, 128, timesminusplus(reverse(v2361), load(tbl, 420 * VECWIDTH + tbloffset), times(v2361, load(tbl, 421 * VECWIDTH + tbloffset)))); + real2 v2359 = minusplus(v2357, v2358); + scatter(out, 41, 128, timesminusplus(reverse(v2359), load(tbl, 418 * VECWIDTH + tbloffset), times(v2359, load(tbl, 419 * VECWIDTH + tbloffset)))); + real2 v2121 = minusplus(v2119, v2120); + real2 v2123 = minusplus(uminus(v2119), v2120); + real2 v2083 = minusplus(uminus(v2079), v2080); + real2 v2081 = minusplus(v2079, v2080); + real2 v2091 = timesminusplus(reverse(v2081), load(tbl, 366 * VECWIDTH + tbloffset), times(v2081, load(tbl, 367 * VECWIDTH + tbloffset))); + real2 v2043 = minusplus(uminus(v2039), v2040); + real2 v2041 = minusplus(v2039, v2040); + real2 v2051 = timesminusplus(reverse(v2041), load(tbl, 358 * VECWIDTH + tbloffset), times(v2041, load(tbl, 359 * VECWIDTH + tbloffset))); + real2 v2131 = timesminusplus(reverse(v2121), load(tbl, 374 * VECWIDTH + tbloffset), times(v2121, load(tbl, 375 * VECWIDTH + tbloffset))); + real2 v2163 = minusplus(uminus(v2159), v2160); + real2 v2161 = minusplus(v2159, v2160); + real2 v2171 = timesminusplus(reverse(v2161), load(tbl, 382 * VECWIDTH + tbloffset), times(v2161, load(tbl, 383 * VECWIDTH + tbloffset))); + real2 v2409 = reverse(minus(v2171, v2091)); + real2 v2415 = plus(v2091, v2171); + real2 v2410 = minus(v2131, v2051); + real2 v2414 = plus(v2051, v2131); + real2 v2454 = plus(v2414, v2415); + real2 v2450 = minus(v2415, v2414); + real2 v2181 = minusplus(v2179, v2180); + real2 v2183 = minusplus(uminus(v2179), v2180); + real2 v2191 = timesminusplus(reverse(v2181), load(tbl, 386 * VECWIDTH + tbloffset), times(v2181, load(tbl, 387 * VECWIDTH + tbloffset))); + real2 v2103 = minusplus(uminus(v2099), v2100); + real2 v2101 = minusplus(v2099, v2100); + real2 v2111 = timesminusplus(reverse(v2101), load(tbl, 370 * VECWIDTH + tbloffset), times(v2101, load(tbl, 371 * VECWIDTH + tbloffset))); + real2 v2435 = plus(v2111, v2191); + real2 v2429 = reverse(minus(v2191, v2111)); + real2 v2141 = minusplus(v2139, v2140); + real2 v2143 = minusplus(uminus(v2139), v2140); + real2 v2151 = timesminusplus(reverse(v2141), load(tbl, 378 * VECWIDTH + tbloffset), times(v2141, load(tbl, 379 * VECWIDTH + tbloffset))); + real2 v2063 = minusplus(uminus(v2059), v2060); + real2 v2061 = minusplus(v2059, v2060); + real2 v2071 = timesminusplus(reverse(v2061), load(tbl, 362 * VECWIDTH + tbloffset), times(v2061, load(tbl, 363 * VECWIDTH + tbloffset))); + real2 v2434 = plus(v2071, v2151); + real2 v2430 = minus(v2151, v2071); + real2 v2455 = plus(v2434, v2435); + real2 v2449 = reverse(minus(v2435, v2434)); + scatter(out, 5, 128, plus(v2454, v2455)); + real2 v2468 = minus(v2454, v2455); + scatter(out, 69, 128, timesminusplus(v2468, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2468), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2451 = minusplus(v2449, v2450); + real2 v2453 = minusplus(uminus(v2449), v2450); + scatter(out, 101, 128, timesminusplus(reverse(v2453), load(tbl, 436 * VECWIDTH + tbloffset), times(v2453, load(tbl, 437 * VECWIDTH + tbloffset)))); + scatter(out, 37, 128, timesminusplus(reverse(v2451), load(tbl, 434 * VECWIDTH + tbloffset), times(v2451, load(tbl, 435 * VECWIDTH + tbloffset)))); + real2 v2411 = minusplus(v2409, v2410); + real2 v2413 = minusplus(uminus(v2409), v2410); + real2 v2433 = minusplus(uminus(v2429), v2430); + real2 v2431 = minusplus(v2429, v2430); + real2 v2421 = timesminusplus(reverse(v2411), load(tbl, 426 * VECWIDTH + tbloffset), times(v2411, load(tbl, 427 * VECWIDTH + tbloffset))); + real2 v2441 = timesminusplus(reverse(v2431), load(tbl, 430 * VECWIDTH + tbloffset), times(v2431, load(tbl, 431 * VECWIDTH + tbloffset))); + scatter(out, 21, 128, plus(v2421, v2441)); + real2 v2474 = minus(v2421, v2441); + scatter(out, 85, 128, timesminusplus(v2474, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2474), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2427 = timesminusplus(reverse(v2413), load(tbl, 428 * VECWIDTH + tbloffset), times(v2413, load(tbl, 429 * VECWIDTH + tbloffset))); + real2 v2447 = timesminusplus(reverse(v2433), load(tbl, 432 * VECWIDTH + tbloffset), times(v2433, load(tbl, 433 * VECWIDTH + tbloffset))); + scatter(out, 53, 128, plus(v2427, v2447)); + real2 v2480 = minus(v2427, v2447); + scatter(out, 117, 128, timesminusplus(v2480, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2480), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2057 = timesminusplus(reverse(v2043), load(tbl, 360 * VECWIDTH + tbloffset), times(v2043, load(tbl, 361 * VECWIDTH + tbloffset))); + real2 v2097 = timesminusplus(reverse(v2083), load(tbl, 368 * VECWIDTH + tbloffset), times(v2083, load(tbl, 369 * VECWIDTH + tbloffset))); + real2 v2157 = timesminusplus(reverse(v2143), load(tbl, 380 * VECWIDTH + tbloffset), times(v2143, load(tbl, 381 * VECWIDTH + tbloffset))); + real2 v2197 = timesminusplus(reverse(v2183), load(tbl, 388 * VECWIDTH + tbloffset), times(v2183, load(tbl, 389 * VECWIDTH + tbloffset))); + real2 v2117 = timesminusplus(reverse(v2103), load(tbl, 372 * VECWIDTH + tbloffset), times(v2103, load(tbl, 373 * VECWIDTH + tbloffset))); + real2 v2507 = reverse(minus(v2197, v2117)); + real2 v2513 = plus(v2117, v2197); + real2 v2137 = timesminusplus(reverse(v2123), load(tbl, 376 * VECWIDTH + tbloffset), times(v2123, load(tbl, 377 * VECWIDTH + tbloffset))); + real2 v2488 = minus(v2137, v2057); + real2 v2492 = plus(v2057, v2137); + real2 v2177 = timesminusplus(reverse(v2163), load(tbl, 384 * VECWIDTH + tbloffset), times(v2163, load(tbl, 385 * VECWIDTH + tbloffset))); + real2 v2493 = plus(v2097, v2177); + real2 v2487 = reverse(minus(v2177, v2097)); + real2 v2532 = plus(v2492, v2493); + real2 v2528 = minus(v2493, v2492); + real2 v2077 = timesminusplus(reverse(v2063), load(tbl, 364 * VECWIDTH + tbloffset), times(v2063, load(tbl, 365 * VECWIDTH + tbloffset))); + real2 v2512 = plus(v2077, v2157); + real2 v2508 = minus(v2157, v2077); + real2 v2527 = reverse(minus(v2513, v2512)); + real2 v2533 = plus(v2512, v2513); + real2 v2529 = minusplus(v2527, v2528); + real2 v2531 = minusplus(uminus(v2527), v2528); + scatter(out, 109, 128, timesminusplus(reverse(v2531), load(tbl, 448 * VECWIDTH + tbloffset), times(v2531, load(tbl, 449 * VECWIDTH + tbloffset)))); + scatter(out, 45, 128, timesminusplus(reverse(v2529), load(tbl, 446 * VECWIDTH + tbloffset), times(v2529, load(tbl, 447 * VECWIDTH + tbloffset)))); + scatter(out, 13, 128, plus(v2532, v2533)); + real2 v2546 = minus(v2532, v2533); + scatter(out, 77, 128, timesminusplus(v2546, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2546), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2509 = minusplus(v2507, v2508); + real2 v2511 = minusplus(uminus(v2507), v2508); + real2 v2491 = minusplus(uminus(v2487), v2488); + real2 v2489 = minusplus(v2487, v2488); + real2 v2499 = timesminusplus(reverse(v2489), load(tbl, 438 * VECWIDTH + tbloffset), times(v2489, load(tbl, 439 * VECWIDTH + tbloffset))); + real2 v2519 = timesminusplus(reverse(v2509), load(tbl, 442 * VECWIDTH + tbloffset), times(v2509, load(tbl, 443 * VECWIDTH + tbloffset))); + scatter(out, 29, 128, plus(v2499, v2519)); + real2 v2552 = minus(v2499, v2519); + scatter(out, 93, 128, timesminusplus(v2552, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2552), load(tbl, 1 * VECWIDTH + tbloffset)))); + real2 v2505 = timesminusplus(reverse(v2491), load(tbl, 440 * VECWIDTH + tbloffset), times(v2491, load(tbl, 441 * VECWIDTH + tbloffset))); + real2 v2525 = timesminusplus(reverse(v2511), load(tbl, 444 * VECWIDTH + tbloffset), times(v2511, load(tbl, 445 * VECWIDTH + tbloffset))); + scatter(out, 61, 128, plus(v2505, v2525)); + real2 v2558 = minus(v2505, v2525); + scatter(out, 125, 128, timesminusplus(v2558, load(tbl, 0 * VECWIDTH + tbloffset), times(reverse(v2558), load(tbl, 1 * VECWIDTH + tbloffset)))); +// Pres : 76263 + } +} +#endif + +// + +#undef EMITREALSUB + +#ifdef EMITREALSUB +ALIGNED(8192) void realSub0_%ISA%(real *d, const real *s, const int log2len, const real *rtCoef0, const real *rtCoef1) { + const int n = 1 << log2len; + real s0 = s[0], s1 = s[1]; + int k=1; + + d[n+0] = s[n+0]; + d[n+1] = s[n+1]; + + for(;;k+=VECWIDTH) { + int idx0 = k, idx1 = n-VECWIDTH+1-k; + if (idx0 + VECWIDTH >= idx1) break; + + real2 v = loadu(s, idx0); + real2 u = reverse2(load (s, idx1)); + + real2 t = minusplus(v, u); + real2 m = minusplus(reverse(times(t, loadu(rtCoef1, k))), + times(t, loadu(rtCoef0, k))); + + storeu(d, idx0, minusplus(v, uminus(m))); + store (d, idx1, reverse2(minus(u, m))); + } + + for(;k= idx1) break; + + real2 v = loadu(s, idx0); + real2 u = reverse2(load (s, idx1)); + + real2 t = minusplus(v, u); + real2 m = minusplus(reverse(times(t, loadu(rtCoef1, k))), + times(t, loadu(rtCoef0, k))); + + storeu(d, idx0, ctimes(uplusminus(minus(u, m)), c)); + store (d, idx1, ctimes(reverse2(minusplus(m, uminus(v))), c)); + } + + for(;k +#include "sleef.h" + +#ifdef ENABLE_SSE2 +#include "helpersse2.h" +#endif + +#ifdef ENABLE_AVX +#include "helperavx.h" +#endif + +#ifdef ENABLE_AVX2 +#include "helperavx2.h" +#endif + +#ifdef ENABLE_AVX512F +#include "helperavx512f.h" +#endif + +#ifdef ENABLE_NEON32 +#include "helperneon32.h" +#endif + +#ifdef ENABLE_ADVSIMD +#include "helperadvsimd.h" +#endif + +#ifdef ENABLE_SVE +#include "helpersve.h" +#endif + +#if defined(ENABLE_RVVM1) || defined(ENABLE_RVVM2) +#include "helperrvv.h" +#endif + +#ifdef ENABLE_VSX +#include "helperpower_128.h" +#endif + +#ifdef ENABLE_VSX3 +#include "helperpower_128.h" +#endif + +#ifdef ENABLE_VXE +#include "helpers390x_128.h" +#endif + +#ifdef ENABLE_VXE2 +#include "helpers390x_128.h" +#endif + +#ifdef ENABLE_VECEXT +#include "helpervecext.h" +#endif + +#ifdef ENABLE_PUREC +#include "helperpurec.h" +#endif + +#define IMPORT_IS_EXPORT +#include "sleefdft.h" + +#if BASETYPEID == 1 +#define LOG2VECWIDTH (LOG2VECTLENDP-1) +#define VECWIDTH (1 << LOG2VECWIDTH) + +typedef double real; +typedef vdouble real2; + +static int available(int name) { return vavailability_i(name); } + +static INLINE real2 uminus(real2 d0) { return vneg_vd_vd(d0); } +static INLINE real2 uplusminus(real2 d0) { return vposneg_vd_vd(d0); } +static INLINE real2 uminusplus(real2 d0) { return vnegpos_vd_vd(d0); } + +static INLINE real2 plus(real2 d0, real2 d1) { return vadd_vd_vd_vd(d0, d1); } +static INLINE real2 minus(real2 d0, real2 d1) { return vsub_vd_vd_vd(d0, d1); } +static INLINE real2 minusplus(real2 d0, real2 d1) { return vsubadd_vd_vd_vd(d0, d1); } +static INLINE real2 times(real2 d0, real2 d1) { return vmul_vd_vd_vd(d0, d1); } +static INLINE real2 timesminusplus(real2 d0, real2 d2, real2 d1) { return vmlsubadd_vd_vd_vd_vd(d0, d2, d1); } +static INLINE real2 ctimes(real2 d0, real d) { return vmul_vd_vd_vd(d0, vcast_vd_d(d)); } +static INLINE real2 ctimesminusplus(real2 d0, real c, real2 d1) { return vmlsubadd_vd_vd_vd_vd(d0, vcast_vd_d(c), d1); } + +static INLINE real2 reverse(real2 d0) { return vrev21_vd_vd(d0); } +static INLINE real2 reverse2(real2 d0) { return vreva2_vd_vd(d0); } + +static INLINE real2 loadc(real c) { return vcast_vd_d(c); } + +static INLINE real2 load(const real *ptr, int offset) { return vload_vd_p(&ptr[2*offset]); } +static INLINE real2 loadu(const real *ptr, int offset) { return vloadu_vd_p(&ptr[2*offset]); } +static INLINE void store(real *ptr, int offset, real2 v) { vstore_v_p_vd(&ptr[2*offset], v); } +static INLINE void storeu(real *ptr, int offset, real2 v) { vstoreu_v_p_vd(&ptr[2*offset], v); } +static INLINE void stream(real *ptr, int offset, real2 v) { vstream_v_p_vd(&ptr[2*offset], v); } +static INLINE void scatter(real *ptr, int offset, int step, real2 v) { vscatter2_v_p_i_i_vd(ptr, offset, step, v); } +static INLINE void scstream(real *ptr, int offset, int step, real2 v) { vsscatter2_v_p_i_i_vd(ptr, offset, step, v); } + +static INLINE void prefetch(real *ptr, int offset) { vprefetch_v_p(&ptr[2*offset]); } +#elif BASETYPEID == 2 +#define LOG2VECWIDTH (LOG2VECTLENSP-1) +#define VECWIDTH (1 << LOG2VECWIDTH) + +typedef float real; +typedef vfloat real2; + +static int available(int name) { return vavailability_i(name); } + +static INLINE real2 uminus(real2 d0) { return vneg_vf_vf(d0); } +static INLINE real2 uplusminus(real2 d0) { return vposneg_vf_vf(d0); } +static INLINE real2 uminusplus(real2 d0) { return vnegpos_vf_vf(d0); } + +static INLINE real2 plus(real2 d0, real2 d1) { return vadd_vf_vf_vf(d0, d1); } +static INLINE real2 minus(real2 d0, real2 d1) { return vsub_vf_vf_vf(d0, d1); } +static INLINE real2 minusplus(real2 d0, real2 d1) { return vsubadd_vf_vf_vf(d0, d1); } +static INLINE real2 times(real2 d0, real2 d1) { return vmul_vf_vf_vf(d0, d1); } +static INLINE real2 ctimes(real2 d0, real d) { return vmul_vf_vf_vf(d0, vcast_vf_f(d)); } +static INLINE real2 timesminusplus(real2 d0, real2 d2, real2 d1) { return vmlsubadd_vf_vf_vf_vf(d0, d2, d1); } +static INLINE real2 ctimesminusplus(real2 d0, real c, real2 d1) { return vmlsubadd_vf_vf_vf_vf(d0, vcast_vf_f(c), d1); } + +static INLINE real2 reverse(real2 d0) { return vrev21_vf_vf(d0); } +static INLINE real2 reverse2(real2 d0) { return vreva2_vf_vf(d0); } + +static INLINE real2 loadc(real c) { return vcast_vf_f(c); } + +static INLINE real2 load(const real *ptr, int offset) { return vload_vf_p(&ptr[2*offset]); } +static INLINE real2 loadu(const real *ptr, int offset) { return vloadu_vf_p(&ptr[2*offset]); } +static INLINE void store(real *ptr, int offset, real2 v) { vstore_v_p_vf(&ptr[2*offset], v); } +static INLINE void storeu(real *ptr, int offset, real2 v) { vstoreu_v_p_vf(&ptr[2*offset], v); } +static INLINE void stream(real *ptr, int offset, real2 v) { vstream_v_p_vf(&ptr[2*offset], v); } +static INLINE void scatter(real *ptr, int offset, int step, real2 v) { vscatter2_v_p_i_i_vf(ptr, offset, step, v); } +static INLINE void scstream(real *ptr, int offset, int step, real2 v) { vsscatter2_v_p_i_i_vf(ptr, offset, step, v); } + +static INLINE void prefetch(real *ptr, int offset) { vprefetch_v_p(&ptr[2*offset]); } +#else +#error No BASETYPEID specified +#endif + +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/Makefile b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/Makefile new file mode 100644 index 0000000000000..38394880c826d --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/Makefile @@ -0,0 +1,16 @@ +.PHONY: all +all : gencoef mkrempitab mkrempitabqp + +gencoef : gencoef.c simplexfr.c sp.h dp.h ld.h qp.h + gcc -O gencoef.c simplexfr.c -o gencoef -lmpfr -lm + +mkrempitab : mkrempitab.c + gcc -O mkrempitab.c -o mkrempitab -lmpfr + +mkrempitabqp : mkrempitabqp.c + gcc -O mkrempitabqp.c -o mkrempitabqp -lmpfr + +.PHONY: clean +clean : + rm -f gencoef gencoefdp gencoefld mkrempitab mkrempitabqp a.out *~ + rm -f *.obj *.lib *.dll *.exp *.exe diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/dp.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/dp.h new file mode 100644 index 0000000000000..038988e78b705 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/dp.h @@ -0,0 +1,196 @@ +// This is part of SLEEF, written by Naoki +// Shibata. http://shibatch.sourceforge.net + +// The code in this file is distributed under the Creative Commons +// Attribution 4.0 International License. + +#define PREC_TARGET 53 + +#if 0 +#define N 8 // Degree of equation +#define S 40 // Number of samples for phase 1 +#define L 4 // Number of high precision coefficients +#define MIN 0.0 // Min argument +#define MAX (M_PI/4) // Max argument +#define PMUL 2 // The form of polynomial is y = x^(PADD+PMUL*0) + x^(PADD+PMUL*1) + ... +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_sin(ret, a, GMP_RNDN); } // The function to approximate +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 // Fix coef 0 to 1.0 +#endif + +#if 0 +#define N 10 +#define S 40 +#define L 2 +#define MIN 0.0 +#define MAX (M_PI/4) + +void TARGET(mpfr_t ret, mpfr_t a) { // cos(x) - 1 + mpfr_t x; + mpfr_init(x); + mpfr_cos(ret, a, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clear(x); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } + +#define PMUL 2 +#define PADD 2 +#define FIXCOEF0 (-0.5) +#endif + + +#if 0 // for xsincospi4_u05 +#define S 40 +#define N 8 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_sin(ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + +#if 0 // for xsincospi4_u05 +#define N 8 +#define S 40 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_cos(ret, x, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define PMUL 2 +#define PADD 2 +#endif + + +#if 0 // for xsincospi4 +#define N 7 +#define S 40 +#define L 0 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_sin(ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + + +#if 0 +#define N 17 +#define S 60 +#define L 0 +#define MIN 0.0 +#define MAX (M_PI/4) +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_tan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif + +#if 0 +#define N 11 +#define S 35 +#define L 2 +#define MIN 1 //0.75 +#define MAX 1.5 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_log(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t frd, mpfr_t fra) { + mpfr_t tmp, one; + mpfr_inits(tmp, one, NULL); + mpfr_set_d(one, 1, GMP_RNDN); + mpfr_add(tmp, fra, one, GMP_RNDN); + mpfr_sub(frd, fra, one, GMP_RNDN); + mpfr_div(frd, frd, tmp, GMP_RNDN); + mpfr_clears(tmp, one, NULL); +} +#define FIXCOEF0 2.0 +#endif + +#if 1 +#define N 12 +#define S 50 +#define L 2 +#define MIN -0.347 +#define MAX 0.347 // 0.5 log 2 +#define PMUL 1 +#define PADD 0 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_exp(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#define FIXCOEF1 1.0 +//#define FIXCOEF2 0.5 +#endif + +#if 0 +#define N 21 +#define S 100 +#define L 1 +#define P 1.1 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_atan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif + +#if 0 +#define N 20 +#define S 100 +#define L 0 +#define P 1.54 +#define MIN 0.0 +#define MAX 0.708 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_asin(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.c new file mode 100644 index 0000000000000..62ff69d847640 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.c @@ -0,0 +1,375 @@ +// This is part of SLEEF, written by Naoki Shibata. http://shibatch.sourceforge.net + +// Since the original code for simplex algorithm is developed by Haruhiko Okumura and +// the code is distributed under the Creative Commons Attribution 4.0 International License, +// the contents under this directory are also distributed under the same license. + +#include +#include +#include +#include +#include +#include +#include +#include + +//#include "sp.h" +#include "dp.h" +//#include "ld.h" +//#include "qp.h" + +#undef VERBOSE + +#define PREC 4096 + +#define EPS 1e-50 + +#define PREC2 (PREC_TARGET*4) + +#ifndef P +#define P 1 +#endif + +#ifndef Q +#define Q 10000 +#endif + +void mpfr_zinit(mpfr_t m); +void regressMinRelError_fr(int n, int m, mpfr_t **x, mpfr_t *result); + +char *mpfrToStr(mpfr_t m) { + mpfr_t fra; + mpfr_init2(fra, mpfr_get_prec(m)); + + mpfr_abs(fra, m, GMP_RNDN); + mpfr_exp_t e; + char *s = mpfr_get_str(NULL, &e, 10, 0, fra, GMP_RNDN); + + char *ret = malloc(strlen(s) + 20); + + if (mpfr_sgn(m) == -1) ret[0] = '-'; else ret[0] = '+'; + ret[1] = '0'; + ret[2] = '.'; + + strcpy(&ret[3], s); + mpfr_free_str(s); + + char estr[10]; + sprintf(estr, "e%+d", (int)e); + strcat(ret, estr); + + mpfr_clears(fra, NULL); + return ret; +} + +double countULP(mpfr_t d, mpfr_t c) { + mpfr_t fry, frw; + mpfr_inits(fry, frw, NULL); + + double c2 = mpfr_get_d(c, GMP_RNDN); + if (c2 == 0 && mpfr_cmp_d(d, 0) != 0) return 10000; + + long e; + mpfr_get_d_2exp(&e, c, GMP_RNDN); + mpfr_set_ui_2exp(frw, 1, e-PREC_TARGET, GMP_RNDN); + + mpfr_sub(fry, d, c, GMP_RNDN); + mpfr_div(fry, fry, frw, GMP_RNDN); + double u = fabs(mpfr_get_d(fry, GMP_RNDN)); + + mpfr_clears(fry, frw, NULL); + + return u; +} + +void func(mpfr_t s, mpfr_t x, mpfr_t *coef, int n) { + mpfr_set_prec(s, PREC_TARGET); + mpfr_set(s, coef[n-1], GMP_RNDN); + + for(int i=n-1;i>0;i--) { + if (i == L-1) { + mpfr_t t; + mpfr_init2(t, PREC2); + mpfr_set(t, s, GMP_RNDN); + mpfr_set_prec(s, PREC2); + mpfr_set(s, t, GMP_RNDN); + mpfr_clear(t); + } + mpfr_mul(s, s, x, GMP_RNDN); + mpfr_add(s, s, coef[i-1], GMP_RNDN); + } +} + +int main(int argc, char **argv) +{ + int i, j; + int n, m; + double p; + + mpfr_set_default_prec(PREC); + +#if 0 + { + mpfr_t a, b; + mpfr_inits(a, b, NULL); + + float x = M_PI; + mpfr_set_d(a, x, GMP_RNDN); + x = nexttowardf(x, 100); + x = nexttowardf(x, 100); + x = nexttowardf(x, 100); + mpfr_set_d(b, x, GMP_RNDN); + + printf("%g\n", countULP(b, a)); + mpfr_clears(a, b, NULL); + exit(0); + } +#endif + +#if 0 + { + mpfr_t a, b; + mpfr_inits(a, b, NULL); + + double x = M_PI; + mpfr_set_d(a, x, GMP_RNDN); + x = nexttoward(x, 100); + x = nexttoward(x, 100); + x = nexttoward(x, 100); + mpfr_set_d(b, x, GMP_RNDN); + + printf("%g\n", countULP(b, a)); + mpfr_clears(a, b, NULL); + exit(0); + } +#endif + +#if 0 + { + mpfr_t a, b; + mpfr_inits(a, b, NULL); + + long double x = M_PI; + mpfr_set_ld(a, x, GMP_RNDN); + x = nexttowardl(x, 100); + x = nexttowardl(x, 100); + x = nexttowardl(x, 100); + mpfr_set_ld(b, x, GMP_RNDN); + + printf("%g\n", countULP(b, a)); + mpfr_clears(a, b, NULL); + exit(0); + } +#endif + +#if 0 + { + mpfr_t a, b; + mpfr_inits(a, b, NULL); + + __float128 x = M_PI; + mpfr_set_f128(a, x, GMP_RNDN); + x = nextafterq(x, 100); + x = nextafterq(x, 100); + x = nextafterq(x, 100); + mpfr_set_f128(b, x, GMP_RNDN); + + printf("%g\n", countULP(b, a)); + mpfr_clears(a, b, NULL); + exit(0); + } +#endif + + m = N+1; + n = argc >= 2 ? atoi(argv[1]) : S; + p = argc >= 3 ? atof(argv[2]) : P; + + mpfr_t **x, *result; // x[m][n], result[m] + + x = calloc(sizeof(mpfr_t *), m); + result = calloc(sizeof(mpfr_t), m); + for(i=0;i=0;i--) { + mpfr_set_prec(fra, PREC_TARGET+4); + mpfr_set(fra, result[i], GMP_RNDN); + + char *s; + printf("%s, \n", s = mpfrToStr(fra)); + free(s); + } + printf("\n"); + + mpfr_set_prec(fra, PREC); + + double emax = 0; + + for(i=0;i<=n*10;i++) { + double a = i * (double)(MAX - MIN) / (n*10.0) + MIN; + mpfr_set_d(fra, a, GMP_RNDN); + + CFUNC(frd, fra); + + mpfr_set_d(frb, 0, GMP_RNDN); + + for(j=m-1;j>=0;j--) { + mpfr_set_d(frc, (double)j*PMUL+PADD, GMP_RNDN); + mpfr_pow(frc, frd, frc, GMP_RNDN); + mpfr_mul(frc, frc, result[j], GMP_RNDN); + mpfr_add(frb, frb, frc, GMP_RNDN); + } + + TARGET(frc, fra); + double u = countULP(frb, frc); + + if (u > emax) emax = u; + } + + printf("Phase 1 : Max error = %g ULP\n\n", emax); + fflush(stdout); + + // + + mpfr_t bestcoef[N], curcoef[N]; + + for(i=0;i= L ? PREC_TARGET : PREC2); + mpfr_set(bestcoef[i], result[i], GMP_RNDN); + + mpfr_init2(curcoef[i], i >= L ? PREC_TARGET : PREC2); + mpfr_set(curcoef[i], result[i], GMP_RNDN); + } + + srandom(time(NULL)); + + mpfr_set_default_prec(PREC2); + + static mpfr_t a[Q], v[Q], am[Q], aa[Q]; + + for(i=0;i=0;j--) { + mpfr_set_d(frc, (double)j*PMUL+PADD, GMP_RNDN); + mpfr_pow(frc, a[i], frc, GMP_RNDN); + mpfr_mul(frc, frc, curcoef[j], GMP_RNDN); + mpfr_add(frb, frb, frc, GMP_RNDN); + } + + double e = countULP(frb, v[i]); + + //printf("c = %.20g, t = %.20g, ulp = %g\n", mpfr_get_d(v[i], GMP_RNDN), mpfr_get_d(frb, GMP_RNDN), e); + + if (!isfinite(e)) continue; + if (e > emax) { emax = e; worstx = mpfr_get_d(a[i], GMP_RNDN); } + esum += e; + } + mpfr_set_prec(frb, PREC); + + //printf("emax = %g\n", emax); + + if (emax < best || (emax == best && esum < bestsum)) { + for(i=0;i 10) printf("Max error = %g ULP, Sum error = %g (Max error at %g)\n", emax, esum, worstx); + if ((best - emax) / best > 0.0001) k = 0; + best = emax; + bestsum = esum; + bestworstx = worstx; + } + + for(i=0;i 0) { + for(int j=0;jr;j--) mpfr_nextbelow(curcoef[i]); + } + } + } + + printf("\n"); + + for(i=N-1;i>=0;i--) { + mpfr_set_prec(fra, i >= L ? PREC_TARGET+4 : PREC2); + mpfr_set(fra, bestcoef[i], GMP_RNDN); + + char *s; + printf("%s, \n", s = mpfrToStr(fra)); + free(s); + } + printf("\nPhase 2 : max error = %g ULP at %g\n", best, bestworstx); + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.txt new file mode 100644 index 0000000000000..f57bdfe5352c9 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/gencoef.txt @@ -0,0 +1,43 @@ + +With this small tool, the coefficients for polynomial approximation +used in kernels can be generated. + +Usage + +Edit gencoefdp.c. In the beginning of the file, specifications of the +parameters for generating coefficients are listed. Enable one of them +by changing #if. Then, run make to compile the source code. Run the +gencoef, and it will show the generated coefficients in a few minutes. + + +How it works + +There are two phases of the program. + +The first phase is the regression for minimizing the maximum relative +error. This problem can be reduced to a linear programming problem, +and the Simplex method is used in this implementation. This requires +multi-precision calculation, and the implementation uses the MPFR +library to do this. In this phase, only a small number of values +(specified by S macro, usually 40 or so) of the function to +approximate are sampled within the argument range. The function to +approximate can be given by FRFUNC function. Specifying higher values +for S does not always give better results. + +The second phase is to optimize the coefficients so that it gives good +accuracy with double precision calculation. In this phase, it checks +100000 points (specified by Q macro) within the specified argument +range to see if the polynomial gives good error bound. In some cases, +the last few terms have to be calculated in higher precision in order +to achieve 1 ULP overall accuracy, and this implementation can take +care of that. The L parameter specifies the number of high precision +coefficients. + +In some cases, it is desirable to fix the last few coefficients to +values like 1. This can be specified if you define FIXCOEF0 +macro. This sometimes does not work, however. In this case, you need +to specify the function to approximate as shown in the definition for +cos. + +Finding a set of good parameters is not a straightforward process. You +usually need many iterations of trial and error. diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/ld.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/ld.h new file mode 100644 index 0000000000000..069202c498959 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/ld.h @@ -0,0 +1,178 @@ +// This is part of SLEEF, written by Naoki +// Shibata. http://shibatch.sourceforge.net + +// The code in this file is distributed under the Creative Commons +// Attribution 4.0 International License. + +#define PREC_TARGET 64 + +#if 0 +#define N 8 // Degree of equation +#define S 40 // Number of samples for phase 1 +#define L 4 // Number of high precision coefficients +#define MIN 0.0 // Min argument +#define MAX (M_PI/4) // Max argument +#define PMUL 2 // The form of polynomial is y = x^(PADD+PMUL*0) + x^(PADD+PMUL*1) + ... +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_sin(ret, a, GMP_RNDN); } // The function to approximate +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 // Fix coef 0 to 1.0 +#endif + +#if 0 +#define N 10 +#define S 40 +#define L 2 +#define MIN 0.0 +#define MAX (M_PI/4) +void TARGET(mpfr_t ret, mpfr_t a) { // cos(x) - 1 + mpfr_t x; + mpfr_init(x); + mpfr_cos(ret, a, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clear(x); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } + +#define PMUL 2 +#define PADD 2 +#define FIXCOEF0 (-0.5) +#endif + + +#if 0 // for xsincospi4_u05 +#define N 9 +#define S 40 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_sin(ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + +#if 0 // for xsincospi4_u05 +#define N 9 +#define S 40 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +void TARGET(mpfr_t ret, mpfr_t a) { // cos(x) - 1 + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_cos(ret, x, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define PMUL 2 +#define PADD 2 +#endif + + +#if 0 // for xsincospi4 +#define N 7 +#define S 40 +#define L 0 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_sin(ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + + +#if 0 +#define N 17 +#define S 40 +#define L 0 +#define MIN 0.0 +#define MAX (M_PI/4) +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_tan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif + +#if 0 +#define N 9 +#define S 40 +#define L 2 +#define MIN 1 //0.75 +#define MAX 1.5 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_log(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t frd, mpfr_t fra) { + mpfr_t tmp, one; + mpfr_inits(tmp, one, NULL); + mpfr_set_d(one, 1, GMP_RNDN); + mpfr_add(tmp, fra, one, GMP_RNDN); + mpfr_sub(frd, fra, one, GMP_RNDN); + mpfr_div(frd, frd, tmp, GMP_RNDN); + mpfr_clear(tmp, one, NULL); +} +#define FIXCOEF0 2.0 +#endif + +#if 0 +#define N 12 +#define S 50 +#define L 0 +#define MIN -0.347 +#define MAX 0.347 // 0.5 log 2 +#define PMUL 1 +#define PADD 0 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_exp(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#define FIXCOEF1 1.0 +#define FIXCOEF2 0.5 +#endif + +#if 0 +#define N 22 +#define S 100 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_atan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitab.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitab.c new file mode 100644 index 0000000000000..cf48cd3e97c73 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitab.c @@ -0,0 +1,121 @@ +#include +#include +#include +#include +#include + +static int64_t doubleToRawLongBits(double d) { + union { + double f; + int64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static double longBitsToDouble(int64_t i) { + union { + double f; + int64_t i; + } tmp; + tmp.i = i; + return tmp.f; +} + +static double removelsb(double d) { + return longBitsToDouble(doubleToRawLongBits(d) & 0xfffffffffffffffeLL); +} + +static int32_t floatToRawIntBits(float d) { + union { + float f; + int32_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static float intBitsToFloat(int32_t i) { + union { + float f; + int32_t i; + } tmp; + tmp.i = i; + return tmp.f; +} + +static float removelsbf(float x) { + return intBitsToFloat(0xfffffffc & floatToRawIntBits(x)); +} + +int main(int argc, char **argv) { + mpfr_set_default_prec(2048); + mpfr_t pi, rpi, xrpi, x, y, z, r; + mpfr_inits(pi, rpi, xrpi, x, y, z, r, NULL); + mpfr_const_pi(pi, GMP_RNDN); + mpfr_set_d(x, 0.5, GMP_RNDN); + mpfr_div(rpi, x, pi, GMP_RNDN); + + printf("NOEXPORT ALIGNED(64) const double rempitabdp[] = {\n"); + for(int i=55;i<1024;i++) { + int M = i > 700 ? -64 : 0; + int ex = i - 53; + if (ex < -52) ex = -52; + mpfr_set_d(x, ldexp(1, ex), GMP_RNDN); + mpfr_mul(y, x, rpi, GMP_RNDN); + mpfr_frac(xrpi, y, GMP_RNDN); + mpfr_div(xrpi, xrpi, x, GMP_RNDN); + + mpfr_set_exp(xrpi, mpfr_get_exp(xrpi) - M); + + mpfr_set(x, xrpi, GMP_RNDN); + + double rpi0 = removelsb(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi0, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + double rpi1 = removelsb(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi1, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + double rpi2 = removelsb(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi2, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + double rpi3 = mpfr_get_d(x, GMP_RNDN); + + printf(" %.20g, %.20g, %.20g, %.20g,\n", rpi0, rpi1, rpi2, rpi3); + } + printf("};\n\n"); + + printf("NOEXPORT ALIGNED(64) const float rempitabsp[] = {\n"); + for(int i=25;i<128;i++) { + int M = i > 90 ? -64 : 0; + int ex = i - 23; + mpfr_set_d(x, ldexp(1, ex), GMP_RNDN); + mpfr_mul(y, x, rpi, GMP_RNDN); + mpfr_frac(xrpi, y, GMP_RNDN); + mpfr_div(xrpi, xrpi, x, GMP_RNDN); + + mpfr_set_exp(xrpi, mpfr_get_exp(xrpi) - M); + + mpfr_set(x, xrpi, GMP_RNDN); + + float rpi20 = removelsbf(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi20, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + float rpi21 = removelsbf(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi21, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + float rpi22 = removelsbf(mpfr_get_d(x, GMP_RNDN)); + mpfr_set_d(y, rpi22, GMP_RNDN); + mpfr_sub(x, x, y, GMP_RNDN); + + float rpi23 = mpfr_get_d(x, GMP_RNDN); + + printf(" %.10g, %.10g, %.10g, %.10g,\n", rpi20, rpi21, rpi22, rpi23); + } + printf("};\n"); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitabqp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitabqp.c new file mode 100644 index 0000000000000..51e02c619eca0 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/mkrempitabqp.c @@ -0,0 +1,63 @@ +#include +#include +#include +#include +#include +#include +#include + +#define N 8 +#define B 8 +#define NCOL (53-B) +#define NROW ((16385+(53-B)*N-106)/NCOL+1) + +static double *rempitabqp = NULL; + +void generateRempitabqp() { + rempitabqp = calloc(16385-106+(53-B)*(N+1), sizeof(double)); + + int orgprec = mpfr_get_default_prec(); + mpfr_set_default_prec(18000); + + mpfr_t pi, m, n, o; + mpfr_inits(pi, m, n, o, NULL); + mpfr_const_pi(pi, GMP_RNDN); + + mpfr_d_div(n, 0.5, pi, GMP_RNDN); + + for(int e=106;e<16385+(53-B)*N;e++) { + mpfr_set(m, n, GMP_RNDN); + + mpfr_set_ui_2exp(o, 1, -(113 - e), GMP_RNDN); + mpfr_mul(m, m, o, GMP_RNDN); + + mpfr_frac(m, m, GMP_RNDN); + + mpfr_set_ui_2exp(o, 1, (53-B), GMP_RNDN); + mpfr_mul(m, m, o, GMP_RNDN); + + mpfr_trunc(m, m); + + mpfr_set_ui_2exp(o, 1, 7-(53-B), GMP_RNDN); + mpfr_mul(m, m, o, GMP_RNDN); + + int col = (e - 106) % NCOL; + int row = (e - 106) / NCOL; + rempitabqp[col * NROW + row] = mpfr_get_d(m, GMP_RNDN); + } + + mpfr_clears(pi, m, n, o, NULL); + mpfr_set_default_prec(orgprec); +} + + +int main(int argc, char **argv) { + generateRempitabqp(); + + printf("NOEXPORT const double Sleef_rempitabqp[] = {\n "); + for(int i=0;i<16385-106+(53-B)*(N+1);i++) { + printf("%.20g, ", rempitabqp[i]); + if ((i & 3) == 3) printf("\n "); + } + printf("\n};\n"); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/qp.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/qp.h new file mode 100644 index 0000000000000..ec0d409e28fbc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/qp.h @@ -0,0 +1,161 @@ +// This is part of SLEEF, written by Naoki +// Shibata. http://shibatch.sourceforge.net + +// The code in this file is distributed under the Creative Commons +// Attribution 4.0 International License. + +#define PREC_TARGET 113 + +// + +#if 0 +#define N 15 // Degree of equation +#define S 150 // Number of samples for phase 1 +#define L 0 // Number of high precision coefficients +#define P 0.37 +#define MIN 0.0 // Min argument +#define MAX (M_PI/2) // Max argument +#define PMUL 2 // The form of polynomial is y = x^(PADD+PMUL*0) + x^(PADD+PMUL*1) + ... +#define PADD 3 +void TARGET(mpfr_t ret, mpfr_t a) { // The function to approximate + mpfr_sin(ret, a, GMP_RNDN); + mpfr_sub(ret, ret, a, GMP_RNDN); // ret = sin(a) - a +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + +#if 0 +#define N 15 +#define S 150 +#define L 0 +#define MIN 0.0 +#define MAX (M_PI/2) +void TARGET(mpfr_t ret, mpfr_t a) { // cos(x) - 1 + mpfr_t x; + mpfr_init(x); + mpfr_cos(ret, a, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clear(x); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } + +#define PMUL 2 +#define PADD 2 +//#define FIXCOEF0 (-0.5) +#endif + + +#if 0 // for xsincospi4_u05 +#define N 13 +#define S 150 +#define L 2 +#define P 0.9 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_sin(ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#endif + +#if 0 // for xsincospi4_u05 +#define N 13 +#define S 150 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +void TARGET(mpfr_t ret, mpfr_t a) { // cos(x) - 1 + mpfr_t x, y; + mpfr_inits(x, y, NULL); + mpfr_const_pi(x, GMP_RNDN); + mpfr_set_d(y, 1.0/4, GMP_RNDN); + mpfr_mul(x, x, y, GMP_RNDN); + mpfr_mul(x, x, a, GMP_RNDN); + mpfr_cos(ret, x, GMP_RNDN); + mpfr_set_ld(x, 1, GMP_RNDN); + mpfr_sub(ret, ret, x, GMP_RNDN); + mpfr_clears(x, y, NULL); +} +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define PMUL 2 +#define PADD 2 +#endif + +#if 0 // running +#define N 31 +#define S 100 +#define P 1.7 +#define L 0 +#define MIN 0.0 +#define MAX (M_PI/4) +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_tan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif + +#if 0 // running +#define N 20 +#define S 110 +#define L 2 +#define MIN 1 //0.75 +#define MAX 1.5 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_log(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t frd, mpfr_t fra) { + mpfr_t tmp, one; + mpfr_inits(tmp, one, NULL); + mpfr_set_d(one, 1, GMP_RNDN); + mpfr_add(tmp, fra, one, GMP_RNDN); + mpfr_sub(frd, fra, one, GMP_RNDN); + mpfr_div(frd, frd, tmp, GMP_RNDN); + mpfr_clears(tmp, one, NULL); +} +#define FIXCOEF0 2.0 +#endif + +#if 1 +#define N 22 +#define S 140 +#define L 2 +#define MIN -0.347 +#define MAX 0.347 // 0.5 log 2 +#define PMUL 1 +#define PADD 0 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_exp(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#define FIXCOEF1 1.0 +//#define FIXCOEF2 0.5 +#endif + +#if 0 // running +#define N 45 +#define S 100 +#define P 1.55 +#define L 2 +#define MIN 0.0 +#define MAX 1.0 +#define PMUL 2 +#define PADD 1 + +void TARGET(mpfr_t ret, mpfr_t a) { mpfr_atan(ret, a, GMP_RNDN); } +void CFUNC(mpfr_t dst, mpfr_t src) { mpfr_set(dst, src, GMP_RNDN); } +#define FIXCOEF0 1.0 +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/simplexfr.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/simplexfr.c new file mode 100644 index 0000000000000..f58ed3d5a0d69 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/gencoef/simplexfr.c @@ -0,0 +1,459 @@ + // The original code for simplex algorithm is taken from Haruhiko Okumura's book. +// https://oku.edu.mie-u.ac.jp/~okumura/algo/ +// The code is distributed under the Creative Commons Attribution 4.0 International License. +// https://creativecommons.org/licenses/by/4.0/ + +// The code is modified by Naoki Shibata to process arbitrary precision numbers. + +#include +#include +#include +#include +#include +#include +#include + +#define PREC 4096 +#define EPS 1e-50 + +#define OK 0 +#define MAXIMIZABLE_TO_INFINITY 1 +#define NOT_FEASIBLE 2 +#define ERROR (-1) + +#define NOP (-1) +#define EQU (0) +#define LEQ 1 +#define GEQ 2 + +static int m, n, n1, n2, n3, jmax; +static int *col, *row, *nonzero_row, *inequality; +static mpfr_t **a, *c, **q, *pivotcolumn; + +static mpfr_t zero, one, eps, minuseps, large; + +void mpfr_zinit(mpfr_t m) { + mpfr_init(m); + mpfr_set_d(m, 0, GMP_RNDN); +} + +static void init(int n0, int m0) { + int i, j; + + m = m0; n = n0; + + mpfr_init(zero); mpfr_set_d(zero, 0, GMP_RNDN); + mpfr_init(one); mpfr_set_d(one, 1, GMP_RNDN); + + mpfr_init(eps); + mpfr_set_d(eps, EPS, GMP_RNDN); + + mpfr_init(minuseps); + mpfr_set_d(minuseps, -EPS, GMP_RNDN); + + mpfr_init(large); + mpfr_set_d(large, 1.0 / EPS, GMP_RNDN); + + a = malloc(sizeof(mpfr_t *) * (m + 1)); + for(i=0;i < m+1;i++) { + a[i] = malloc(sizeof(mpfr_t) * (n + 1)); + for(j=0;j < (n+1);j++) { + mpfr_zinit(a[i][j]); + } + } + + q = malloc(sizeof(mpfr_t *) * (m + 1)); + for(i=0;i < m+1;i++) { + q[i] = malloc(sizeof(mpfr_t) * (m + 1)); + for(j=0;j < m+1;j++) { + mpfr_zinit(q[i][j]); + } + } + + c = malloc(sizeof(mpfr_t) * (n + 1)); + for(j=0;j < (n+1);j++) { + mpfr_zinit(c[j]); + } + + pivotcolumn = malloc(sizeof(mpfr_t) * (m + 1)); + for(j=0;j < (m+1);j++) { + mpfr_zinit(pivotcolumn[j]); + } + + col = calloc(m+1, sizeof(int)); + row = calloc(n+2*m+1, sizeof(int)); + nonzero_row = calloc(n+2*m+1, sizeof(int)); + inequality = calloc(m+1, sizeof(int)); +} + +static void dispose() { + mpfr_clears(zero, one, eps, minuseps, large, (mpfr_ptr)0); + + int i, j; + + for(i=0;i < m+1;i++) { + for(j=0;j < m+1;j++) { + mpfr_clear(q[i][j]); + } + free(q[i]); + } + free(q); + + for(i=0;i < m+1;i++) { + for(j=0;j < n+1;j++) { + mpfr_clear(a[i][j]); + } + free(a[i]); + } + free(a); + + for(j=0;j < n+1;j++) { + mpfr_clear(c[j]); + } + free(c); + + for(j=0;j < m+1;j++) { + mpfr_clear(pivotcolumn[j]); + } + free(pivotcolumn); + + free(col); + free(row); + free(nonzero_row); + free(inequality); +} + +static void prepare() { + int i; + + n1 = n; + for (i = 1; i <= m; i++) + if (inequality[i] == GEQ) { + n1++; nonzero_row[n1] = i; + } + n2 = n1; + for (i = 1; i <= m; i++) + if (inequality[i] == LEQ) { + n2++; col[i] = n2; + nonzero_row[n2] = row[n2] = i; + } + n3 = n2; + for (i = 1; i <= m; i++) + if (inequality[i] != LEQ) { + n3++; col[i] = n3; + nonzero_row[n3] = row[n3] = i; + } + + for (i = 0; i <= m; i++) { + mpfr_set_d(q[i][i], 1, GMP_RNDN); + } +} + +static void tableau(mpfr_t ret, int i, int j) { + int k; + + if (col[i] < 0) { mpfr_set_d(ret, 0, GMP_RNDN); return; } + + if (j <= n) { + mpfr_t s; + mpfr_zinit(s); + mpfr_set_d(s, 0, GMP_RNDN); + + mpfr_t *tab = malloc(sizeof(mpfr_t) * (m + 1)); + mpfr_ptr *ptab = malloc(sizeof(mpfr_ptr) * (m + 1)); + for (k = 0; k <= m; k++) { + mpfr_zinit(tab[k]); + ptab[k] = (mpfr_ptr)&tab[k]; + mpfr_mul(tab[k], q[i][k], a[k][j], GMP_RNDN); + } + mpfr_sum(s, ptab, m+1, GMP_RNDN); + for (k = 0; k <= m; k++) { + mpfr_clear(tab[k]); + } + free(ptab); + free(tab); + + mpfr_set(ret, s, GMP_RNDN); + mpfr_clear(s); + return; + } + + mpfr_set(ret, q[i][nonzero_row[j]], GMP_RNDN); + + if (j <= n1) { mpfr_neg(ret, ret, GMP_RNDN); return; } + if (j <= n2 || i != 0) return; + + mpfr_add(ret, ret, one, GMP_RNDN); + return; +} + +static void pivot(int ipivot, int jpivot) { + int i, j; + mpfr_t u; + + mpfr_zinit(u); + + mpfr_set(u, pivotcolumn[ipivot], GMP_RNDN); + + for (j = 1; j <= m; j++) { + mpfr_div(q[ipivot][j], q[ipivot][j], u, GMP_RNDN); + } + + for (i = 0; i <= m; i++) + if (i != ipivot) { + mpfr_set(u, pivotcolumn[i], GMP_RNDN); + + for (j = 1; j <= m; j++) { + mpfr_fms(q[i][j], q[ipivot][j], u, q[i][j], GMP_RNDN); + mpfr_neg(q[i][j], q[i][j], GMP_RNDN); + } + } + + row[col[ipivot]] = 0; + + col[ipivot] = jpivot; row[jpivot] = ipivot; + + mpfr_clear(u); +} + +static int minimize() { + int i, ipivot, jpivot; + mpfr_t t, u; + mpfr_inits(t, u, (mpfr_ptr)0); + + for (;;) { + for (jpivot = 1; jpivot <= jmax; jpivot++) { + if (row[jpivot] == 0) { + tableau(pivotcolumn[0], 0, jpivot); + if (mpfr_cmp(pivotcolumn[0], minuseps) < 0) break; + } + } + if (jpivot > jmax) { + mpfr_clears(t, u, (mpfr_ptr)0); + return 1; + } + + mpfr_set(u, large, GMP_RNDN); + ipivot = 0; + for (i = 1; i <= m; i++) { + tableau(pivotcolumn[i], i, jpivot); + if (mpfr_cmp(pivotcolumn[i], eps) > 0) { + tableau(t, i, 0); + mpfr_div(t, t, pivotcolumn[i], GMP_RNDN); + if (mpfr_cmp(t, u) < 0) { ipivot = i; mpfr_set(u, t, GMP_RNDN); } + } + } + if (ipivot == 0) { + mpfr_clears(t, u, (mpfr_ptr)0); + return 0; // the objective function can be minimized to -infinite + } + pivot(ipivot, jpivot); + } +} + +static int phase1() { + int i, j; + mpfr_t u; + mpfr_zinit(u); + + jmax = n3; + for (i = 0; i <= m; i++) { + if (col[i] > n2) mpfr_set_d(q[0][i], -1, GMP_RNDN); + } + + minimize(); + + tableau(u, 0, 0); + if (mpfr_cmp(u, minuseps) < 0) { + mpfr_clear(u); + return 0; + } + for (i = 1; i <= m; i++) { + if (col[i] > n2) { + col[i] = -1; + } + } + mpfr_set_d(q[0][0], 1, GMP_RNDN); + for (j = 1; j <= m; j++) mpfr_set_d(q[0][j], 0, GMP_RNDN); + for (i = 1; i <= m; i++) { + if ((j = col[i]) > 0 && j <= n && mpfr_cmp_d(c[j], 0) != 0) { + mpfr_set(u, c[j], GMP_RNDN); + for (j = 1; j <= m; j++) { + mpfr_fms(q[0][j], q[i][j], u, q[0][j], GMP_RNDN); + mpfr_neg(q[0][j], q[0][j], GMP_RNDN); + } + } + + } + + mpfr_clear(u); + return 1; +} + +static int phase2() { + int j; + jmax = n2; + for (j = 0; j <= n; j++) { + mpfr_set(a[0][j], c[j], GMP_RNDN); + } + + return minimize(); +} + +int solve_fr(mpfr_t *result, int n0, int m0, mpfr_t **a0, int *ineq0, mpfr_t *c0) { + int i,j; + + m = m0; // number of inequations + n = n0+1; // number of variables + + init(n, m); + + mpfr_t csum; + mpfr_zinit(csum); + + for(j=0;j /dev/null) +ARCH := $(shell uname -p) + +all : +ifndef BUILDDIR + @echo + @echo Please set the build directory to BUILDDIR environment variable and run make once again. + @echo e.g. export BUILDDIR='`pwd`'/../../build + @echo +else + @echo + @echo You can start measurement by "'"make measure"'". +ifdef ICCAVAILABLE + @echo You can start measurement with SVML by "'"make measureSVML"'". +endif + @echo Then, you can plot the results of measurement by "'"make plot"'". + @echo + @echo You have to install java and gnuplot to do plotting. + @echo Stop all tasks on the computer before starting measurement. + @echo +endif + +benchsvml128_10.o : benchsvml128.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml128.c -Wall -I.. -DSVMLULP=1 -fimf-max-error=1.0 -fimf-domain-exclusion=0 -march=core-avx2 -O0 -lm -c -o benchsvml128_10.o + +benchsvml128_40.o : benchsvml128.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml128.c -Wall -I.. -DSVMLULP=4 -fimf-max-error=4.0 -fimf-domain-exclusion=0 -march=core-avx2 -O0 -lm -c -o benchsvml128_40.o + +benchsvml256_10.o : benchsvml256.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml256.c -Wall -I.. -DSVMLULP=1 -fimf-max-error=1.0 -fimf-domain-exclusion=0 -march=core-avx2 -O0 -lm -c -o benchsvml256_10.o + +benchsvml256_40.o : benchsvml256.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml256.c -Wall -I.. -DSVMLULP=4 -fimf-max-error=4.0 -fimf-domain-exclusion=0 -march=core-avx2 -O0 -lm -c -o benchsvml256_40.o + +benchsvml512_10.o : benchsvml512.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml512.c -Wall -I.. -DSVMLULP=1 -fimf-max-error=1.0 -fimf-domain-exclusion=0 -xCOMMON-AVX512 -O0 -lm -c -o benchsvml512_10.o + +benchsvml512_40.o : benchsvml512.c bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml512.c -Wall -I.. -DSVMLULP=4 -fimf-max-error=4.0 -fimf-domain-exclusion=0 -xCOMMON-AVX512 -O0 -lm -c -o benchsvml512_40.o + + +benchsvml_10 : benchsvml.c benchsvml128_10.o benchsvml256_10.o benchsvml512_10.o bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml.c benchsvml128_10.o benchsvml256_10.o benchsvml512_10.o -Wall -I.. -DSVMLULP=1 -fimf-max-error=1.0 -fimf-domain-exclusion=0 -O0 -march=native -lm -o benchsvml_10 + +benchsvml_40 : benchsvml.c benchsvml128_40.o benchsvml256_40.o benchsvml512_40.o bench.h + -command -v icc >/dev/null 2>&1 && icc benchsvml.c benchsvml128_40.o benchsvml256_40.o benchsvml512_40.o -Wall -I.. -DSVMLULP=4 -fimf-max-error=4.0 -fimf-domain-exclusion=0 -O0 -march=native -lm -o benchsvml_40 + +# + +ifeq ($(ARCH),aarch64) + +benchsleef : benchsleef.c benchsleef128.o bench.h + $(CC) benchsleef.c benchsleef128.o -Wall -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -lsleef -lm -o benchsleef + +benchsleef128.o : benchsleef128.c bench.h + $(CC) benchsleef128.c -Wall -march=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +else ifeq ($(ARCH),s390x) + +benchsleef : benchsleef.c benchsleef128.o bench.h + $(CC) benchsleef.c benchsleef128.o -Wall -march=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -lsleef -lm -o benchsleef + +benchsleef128.o : benchsleef128.c bench.h + $(CC) benchsleef128.c -Wall -mzvector -march=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +else ifeq ($(ARCH),ppc64le) + +benchsleef : benchsleef.c benchsleef128.o bench.h + $(CC) benchsleef.c benchsleef128.o -Wall -mcpu=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -lsleef -lm -o benchsleef + +benchsleef128.o : benchsleef128.c bench.h + $(CC) benchsleef128.c -Wall -mcpu=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +else + +benchsleef : benchsleef.c benchsleef128.o benchsleef256.o benchsleef512.o bench.h + $(CC) benchsleef.c benchsleef128.o benchsleef256.o benchsleef512.o -Wall -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -lsleef -lm -o benchsleef + +benchsleef128.o : benchsleef128.c bench.h + $(CC) benchsleef128.c -Wall -march=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +benchsleef256.o : benchsleef256.c bench.h + $(CC) benchsleef256.c -Wall -march=native -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +benchsleef512.o : benchsleef512.c bench.h + $(CC) benchsleef512.c -Wall -mavx512f -O0 -g -I$(BUILDDIR)/include -L$(BUILDDIR)/lib -Wno-attributes -c + +endif + +# + +ProcessData.class : ProcessData.java + javac ProcessData.java + +# + +ifndef BUILDDIR +measure : + @echo + @echo Please set the build directory to BUILDDIR environment variable and run make once again. + @echo e.g. export BUILDDIR='`pwd`'/../../build + @echo +else +measure : benchsleef + chmod +x ./measure.sh + LD_LIBRARY_PATH=$(BUILDDIR)/lib ./measure.sh ./benchsleef + @echo + @echo Now, you can plot the results of measurement by "'"make plot"'". + @echo You can do another measurement by "'"make measure"'". +ifdef ICCAVAILABLE + @echo You can start another measurement with SVML by "'"make measureSVML"'". +endif + @echo You can start over by "'"make restart"'". + @echo +endif + +measureSVML : all benchsvml_10 benchsvml_40 + chmod +x ./measure.sh + ./measure.sh ./benchsvml_10 ./benchsvml_40 + @echo + @echo Now, you can plot the results of measurement by "'"make plot"'". + @echo You can do another measurement by "'"make measure"'". +ifdef ICCAVAILABLE + @echo You can start another measurement with SVML by "'"make measureSVML"'". +endif + @echo You can start over by "'"make restart"'". + @echo + +plot : ProcessData.class counter.txt + java ProcessData *dptrig*.out + gnuplot script.out + mv output.png trigdp.png + java ProcessData *dpnontrig*.out + gnuplot script.out + mv output.png nontrigdp.png + java ProcessData *sptrig*.out + gnuplot script.out + mv output.png trigsp.png + java ProcessData *spnontrig*.out + gnuplot script.out + mv output.png nontrigsp.png + @echo + @echo Plotted results are in trigdp.png, nontrigdp.png, trigsp.png and nontrigsp.png. + @echo + +clean : + rm -f *~ a.out *.so *.so.* *.a *.s *.o + rm -rf *.dSYM *.dylib + rm -f *.obj *.lib *.dll *.exp *.exe *.stackdump + rm -f *.class *.png benchsleef benchsvml_10 benchsvml_40 *.out counter.txt + +restart : + rm -f *.out counter.txt diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/ProcessData.java b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/ProcessData.java new file mode 100644 index 0000000000000..7231191e9905d --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/ProcessData.java @@ -0,0 +1,193 @@ +import java.util.*; +import java.io.*; + +public class ProcessData { + static final int DP = 64, SP = 32; + + static LinkedHashMap funcNameOrder = new LinkedHashMap(); + + static class Key { + final String funcName; + + final int prec, bits; + final ArrayList range = new ArrayList(); + final double ulps; + + Key(String s) { + String[] a = s.split(","); + + funcName = a[0].trim(); + if (funcNameOrder.get(funcName) == null) { + funcNameOrder.put(funcName, funcNameOrder.size()); + } + + prec = + a[1].trim().equals("DP") ? DP : + a[1].trim().equals("SP") ? SP : + 0; + + bits = Integer.parseInt(a[2].trim()); + + int c; + + for(c = 3;;c++) { + if (a[c].trim().endsWith("ulps")) break; + range.add(Double.parseDouble(a[c])); + } + + ulps = Double.parseDouble(a[c].trim().replace("ulps", "")); + } + + public int hashCode() { + int h = funcName.hashCode(); + h ^= prec ^ bits; + return h; + } + + public boolean equals(Object o) { + if (this == o) return true; + Key k = (Key) o; + if (funcName.compareTo(k.funcName) != 0) return false; + if (prec != k.prec) return false; + if (bits != k.bits) return false; + if (range.size() != k.range.size()) return false; + for(int i=0;i { + public int compare(Key d0, Key d1) { + if (d0 == d1) return 0; + if (d0.prec < d1.prec) return 1; + if (d0.prec > d1.prec) return -1; + if (d0.ulps > d1.ulps) return 1; + if (d0.ulps < d1.ulps) return -1; + + int fc = (int)funcNameOrder.get(d0.funcName) - (int)funcNameOrder.get(d1.funcName); + if (fc != 0) return fc; + + if (d0.bits > d1.bits) return 1; + if (d0.bits < d1.bits) return -1; + + if (d0.range.size() > d1.range.size()) return 1; + if (d0.range.size() < d1.range.size()) return -1; + + for(int i=0;i d1.range.get(i)) return 1; + if (d0.range.get(i) < d1.range.get(i)) return -1; + } + + return 0; + } + } + + public static void main(String[] args) throws Exception { + LinkedHashMap> allData = new LinkedHashMap>(); + TreeSet allKeys = new TreeSet(new KeyComparator()); + LinkedHashSet allColumnTitles = new LinkedHashSet(); + double maximum = 0; + + for(int i=0;i v = allData.get(key); + if (v == null) { + v = new LinkedHashMap(); + allData.put(key, v); + } + String[] a = s.split(","); + + double time = Double.parseDouble(a[a.length-1]); + v.put(columnTitle, time); + maximum = Math.max(maximum, time); + } + + lnr.close(); + } + + PrintStream ps = new PrintStream("data.out"); + + for(Key k : allKeys) { + ps.print("\"" + k + "\" "); + + LinkedHashMap v = allData.get(k); + + for(String s : allColumnTitles) { + Double d = v.get(s); + if (d != null) ps.print(d); + if (d == null) ps.print("0"); + ps.print("\t"); + } + ps.println(); + } + + ps.close(); + + ps = new PrintStream("script.out"); + + ps.println("set terminal pngcairo size 1280, 800 font \",10\""); + ps.println("set output \"output.png\""); + + ps.println("color00 = \"#FF5050\";"); // red + ps.println("color01 = \"#0066FF\";"); // blue + ps.println("color02 = \"#00FF00\";"); // green + ps.println("color03 = \"#FF9900\";"); // orange + ps.println("color04 = \"#CC00CC\";"); // purple + ps.println("color05 = \"#880000\";"); // brown + ps.println("color06 = \"#003300\";"); // dark green + ps.println("color07 = \"#000066\";"); // dark blue + + ps.println("set style data histogram"); + ps.println("set style histogram cluster gap 1"); + ps.println("set style fill solid 1.00"); + ps.println("set boxwidth 0.9"); + ps.println("set xtics format \"\""); + ps.println("set xtics rotate by -90"); + ps.println("set grid ytics"); + + ps.println("set ylabel \"Execution time in micro sec.\""); + ps.println("set yrange [0:*]"); + ps.println("set bmargin 24"); + + ps.println("set title \"Single execution time in micro sec.\""); + ps.print("plot"); + + int i = 0; + for(String s : allColumnTitles) { + ps.print("\"data.out\" using " + (i+2) + ":xtic(1) title \"" + s + + "\" linecolor rgb color" + String.format("%02d", i)); + if (i != allColumnTitles.size()-1) ps.print(", "); + i++; + } + ps.println(); + + ps.close(); + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/bench.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/bench.h new file mode 100644 index 0000000000000..d4c87edf28b25 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/bench.h @@ -0,0 +1,58 @@ +#define NITER1 100000 +#define NITER2 10000 +#define NITER (NITER1 * NITER2) + +#define callFuncSLEEF1_1(funcName, name, xmin, xmax, ulp, arg, type) ({ \ + printf("%s\n", #funcName); \ + uint64_t t = Sleef_currentTimeMicros(); \ + for(int j=0;j +#include +#include +#include +#include +#include +#include + +#include "bench.h" + +int veclen = 16; +double *abufdp, *bbufdp; +float *abufsp, *bbufsp; +FILE *fp; + +#if defined(__i386__) || defined(__x86_64__) +void x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx) { + uint32_t a, b, c, d; + __asm__ __volatile__ ("cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (eax), "c"(ecx)); + out[0] = a; out[1] = b; out[2] = c; out[3] = d; +} + +int cpuSupportsAVX() { + int32_t reg[4]; + x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 28)) != 0; +} + +int cpuSupportsAVX512F() { + int32_t reg[4]; + x86CpuID(reg, 7, 0); + return (reg[1] & (1 << 16)) != 0; +} +#endif + +void fillDP(double *buf, double min, double max) { + for(int i=0;i= 3) fnBase = argv[2]; + + srandom(time(NULL)); + +#if defined(__i386__) || defined(__x86_64__) + int do128bit = 1; + int do256bit = cpuSupportsAVX(); + int do512bit = cpuSupportsAVX512F(); +#elif defined(__ARM_NEON) || defined(__VSX__) || defined(__VX__) + int do128bit = 1; +#else +#error Unsupported architecture +#endif + + posix_memalign((void **)&abufdp, veclen*sizeof(double), NITER1*veclen*sizeof(double)); + posix_memalign((void **)&bbufdp, veclen*sizeof(double), NITER1*veclen*sizeof(double)); + + abufsp = (float *)abufdp; + bbufsp = (float *)bbufdp; + + sprintf(fn, "%sdptrig.out", fnBase); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do128bit) benchSleef128_DPTrig(); +#if defined(__i386__) || defined(__x86_64__) + if (do256bit) benchSleef256_DPTrig(); + if (do512bit) benchSleef512_DPTrig(); +#endif + + fclose(fp); + + sprintf(fn, "%sdpnontrig.out", fnBase); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do128bit) benchSleef128_DPNontrig(); +#if defined(__i386__) || defined(__x86_64__) + if (do256bit) benchSleef256_DPNontrig(); + if (do512bit) benchSleef512_DPNontrig(); +#endif + + fclose(fp); + + sprintf(fn, "%ssptrig.out", fnBase); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do128bit) benchSleef128_SPTrig(); +#if defined(__i386__) || defined(__x86_64__) + if (do256bit) benchSleef256_SPTrig(); + if (do512bit) benchSleef512_SPTrig(); +#endif + + fclose(fp); + + sprintf(fn, "%sspnontrig.out", fnBase); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do128bit) benchSleef128_SPNontrig(); +#if defined(__i386__) || defined(__x86_64__) + if (do256bit) benchSleef256_SPNontrig(); + if (do512bit) benchSleef512_SPNontrig(); +#endif + + fclose(fp); + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef128.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef128.c new file mode 100644 index 0000000000000..e5632d18fc138 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef128.c @@ -0,0 +1,195 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __SSE2__ +#if defined(_MSC_VER) +#include +#else +#include +#endif +typedef __m128d vdouble; +typedef __m128 vfloat; +#define ENABLED +#elif defined(__ARM_NEON) +#include +typedef float64x2_t vdouble; +typedef float32x4_t vfloat; +#define ENABLED +#elif defined(__VSX__) +#include +typedef __vector double vdouble; +typedef __vector float vfloat; +#define ENABLED +#elif defined(__VX__) +#include +typedef __vector double vdouble; +typedef __vector float vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void benchSleef128_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sind2_u10 , "sin, DP, 128", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u10 , "cos, DP, 128", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u10 , "tan, DP, 128", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u10, "sincos, DP, 128", 0, 6.28, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind2_u35 , "sin, DP, 128", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u35 , "cos, DP, 128", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u35 , "tan, DP, 128", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u35, "sincos, DP, 128", 0, 6.28, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSLEEF1_1(Sleef_sind2_u10 , "sin, DP, 128", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u10 , "cos, DP, 128", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u10 , "tan, DP, 128", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u10, "sincos, DP, 128", 0, 1e+6, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind2_u35 , "sin, DP, 128", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u35 , "cos, DP, 128", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u35 , "tan, DP, 128", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u35, "sincos, DP, 128", 0, 1e+6, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSLEEF1_1(Sleef_sind2_u10 , "sin, DP, 128", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u10 , "cos, DP, 128", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u10 , "tan, DP, 128", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u10, "sincos, DP, 128", 0, 1e+100, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind2_u35 , "sin, DP, 128", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd2_u35 , "cos, DP, 128", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand2_u35 , "tan, DP, 128", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd2_u35, "sincos, DP, 128", 0, 1e+100, 4.0, abufdp, vdouble); +} + +void benchSleef128_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSLEEF1_1(Sleef_logd2_u10 , "log, DP, 128", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log10d2_u10, "log10, DP, 128", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log1pd2_u10, "log1p, DP, 128", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_logd2_u35 , "log, DP, 128", 0, 1e+300, 4.0, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSLEEF1_1(Sleef_expd2_u10 , "exp, DP, 128", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp2d2_u10 , "exp2, DP, 128", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp10d2_u10, "exp10, DP, 128", -700, 700, 1.0, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSLEEF1_2(Sleef_powd2_u10, "pow, DP, 128", -30, 30, -30, 30, 1.0, abufdp, bbufdp, vdouble); + + fillDP(abufdp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asind2_u10, "asin, DP, 128", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd2_u10, "acos, DP, 128", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_asind2_u35, "asin, DP, 128", -1.0, 1.0, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd2_u35, "acos, DP, 128", -1.0, 1.0, 4.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSLEEF1_1(Sleef_atand2_u10, "atan, DP, 128", -10, 10, 1.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d2_u10, "atan2, DP, 128", -10, 10, -10, 10, 1.0, abufdp, bbufdp, vdouble); + callFuncSLEEF1_1(Sleef_atand2_u35, "atan, DP, 128", -10, 10, 4.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d2_u35, "atan2, DP, 128", -10, 10, -10, 10, 4.0, abufdp, bbufdp, vdouble); +} + +void benchSleef128_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sinf4_u10 , "sin, SP, 128", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf4_u10 , "cos, SP, 128", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf4_u10 , "tan, SP, 128", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf4_u10, "sincos, SP, 128", 0, 6.28, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf4_u35 , "sin, SP, 128", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf4_u35 , "cos, SP, 128", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf4_u35 , "tan, SP, 128", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf4_u35, "sincos, SP, 128", 0, 6.28, 4.0, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSLEEF1_1(Sleef_sinf4_u10 , "sin, SP, 128", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf4_u10 , "cos, SP, 128", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf4_u10 , "tan, SP, 128", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf4_u10, "sincos, SP, 128", 0, 1e+20, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf4_u35 , "sin, SP, 128", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf4_u35 , "cos, SP, 128", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf4_u35 , "tan, SP, 128", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf4_u35, "sincos, SP, 128", 0, 1e+20, 4.0, abufsp, vfloat); +} + +void benchSleef128_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSLEEF1_1(Sleef_logf4_u10 , "log, SP, 128", 0, 1e+38, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_log10f4_u10, "log10, SP, 128", 0, 1e+38, 1.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf4_u10, "log1p, SP, 128", 0, 1e+38, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_logf4_u35 , "log, SP, 128", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log10f4_u35, "log10, SP, 128", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf4_u35, "log1p, SP, 128", 0, 1e+38, 4.0, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSLEEF1_1(Sleef_expf4_u10 , "exp, SP, 128", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp2f4_u10 , "exp2, SP, 128", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp10f4_u10, "exp10, SP, 128", -100, 100, 1.0, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSLEEF1_2(Sleef_powf4_u10, "pow, SP, 128", -30, 30, -30, 30, 1.0, abufsp, bbufsp, vfloat); + + fillSP(abufsp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asinf4_u10, "asin, SP, 128", -1.0, 1, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf4_u10, "acos, SP, 128", -1.0, 1, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_asinf4_u35, "asin, SP, 128", -1.0, 1.0, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf4_u35, "acos, SP, 128", -1.0, 1.0, 4.0, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSLEEF1_1(Sleef_atanf4_u10, "atan, SP, 128", -10, 10, 1.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f4_u10, "atan2, SP, 128", -10, 10, -10, 10, 1.0, abufsp, bbufsp, vfloat); + + callFuncSLEEF1_1(Sleef_atanf4_u35, "atan, SP, 128", -10, 10, 4.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f4_u35, "atan2, SP, 128", -10, 10, -10, 10, 4.0, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void benchSleef128_DPTrig() {} +void benchSleef128_DPNontrig() {} +void benchSleef128_SPTrig() {} +void benchSleef128_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef256.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef256.c new file mode 100644 index 0000000000000..12cdf35f31b36 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef256.c @@ -0,0 +1,181 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __AVX__ +#if defined(_MSC_VER) +#include +#else +#include +#endif +typedef __m256d vdouble; +typedef __m256 vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void benchSleef256_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sind4_u10 , "sin, DP, 256", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u10 , "cos, DP, 256", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u10 , "tan, DP, 256", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u10, "sincos, DP, 256", 0, 6.28, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind4_u35 , "sin, DP, 256", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u35 , "cos, DP, 256", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u35 , "tan, DP, 256", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u35, "sincos, DP, 256", 0, 6.28, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSLEEF1_1(Sleef_sind4_u10 , "sin, DP, 256", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u10 , "cos, DP, 256", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u10 , "tan, DP, 256", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u10, "sincos, DP, 256", 0, 1e+6, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind4_u35 , "sin, DP, 256", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u35 , "cos, DP, 256", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u35 , "tan, DP, 256", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u35, "sincos, DP, 256", 0, 1e+6, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSLEEF1_1(Sleef_sind4_u10 , "sin, DP, 256", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u10 , "cos, DP, 256", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u10 , "tan, DP, 256", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u10, "sincos, DP, 256", 0, 1e+100, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind4_u35 , "sin, DP, 256", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd4_u35 , "cos, DP, 256", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand4_u35 , "tan, DP, 256", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd4_u35, "sincos, DP, 256", 0, 1e+100, 4.0, abufdp, vdouble); +} + +void benchSleef256_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSLEEF1_1(Sleef_logd4_u10 , "log, DP, 256", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log10d4_u10, "log10, DP, 256", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log1pd4_u10, "log1p, DP, 256", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_logd4_u35 , "log, DP, 256", 0, 1e+300, 4.0, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSLEEF1_1(Sleef_expd4_u10 , "exp, DP, 256", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp2d4_u10 , "exp2, DP, 256", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp10d4_u10, "exp10, DP, 256", -700, 700, 1.0, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSLEEF1_2(Sleef_powd4_u10, "pow, DP, 256", -30, 30, -30, 30, 1.0, abufdp, bbufdp, vdouble); + + fillDP(abufdp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asind4_u10, "asin, DP, 256", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd4_u10, "acos, DP, 256", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_asind4_u35, "asin, DP, 256", -1.0, 1.0, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd4_u35, "acos, DP, 256", -1.0, 1.0, 4.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSLEEF1_1(Sleef_atand4_u10, "atan, DP, 256", -10, 10, 1.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d4_u10, "atan2, DP, 256", -10, 10, -10, 10, 1.0, abufdp, bbufdp, vdouble); + callFuncSLEEF1_1(Sleef_atand4_u35, "atan, DP, 256", -10, 10, 4.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d4_u35, "atan2, DP, 256", -10, 10, -10, 10, 4.0, abufdp, bbufdp, vdouble); +} + +void benchSleef256_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sinf8_u10 , "sin, SP, 256", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf8_u10 , "cos, SP, 256", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf8_u10 , "tan, SP, 256", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf8_u10, "sincos, SP, 256", 0, 6.28, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf8_u35 , "sin, SP, 256", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf8_u35 , "cos, SP, 256", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf8_u35 , "tan, SP, 256", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf8_u35, "sincos, SP, 256", 0, 6.28, 4.0, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSLEEF1_1(Sleef_sinf8_u10 , "sin, SP, 256", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf8_u10 , "cos, SP, 256", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf8_u10 , "tan, SP, 256", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf8_u10, "sincos, SP, 256", 0, 1e+20, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf8_u35 , "sin, SP, 256", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf8_u35 , "cos, SP, 256", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf8_u35 , "tan, SP, 256", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf8_u35, "sincos, SP, 256", 0, 1e+20, 4.0, abufsp, vfloat); +} + +void benchSleef256_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSLEEF1_1(Sleef_logf8_u10 , "log, SP, 256", 0, 1e+38, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_log10f8_u10, "log10, SP, 256", 0, 1e+38, 1.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf8_u10, "log1p, SP, 256", 0, 1e+38, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_logf8_u35 , "log, SP, 256", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log10f8_u35, "log10, SP, 256", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf8_u35, "log1p, SP, 256", 0, 1e+38, 4.0, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSLEEF1_1(Sleef_expf8_u10 , "exp, SP, 256", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp2f8_u10 , "exp2, SP, 256", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp10f8_u10, "exp10, SP, 256", -100, 100, 1.0, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSLEEF1_2(Sleef_powf8_u10, "pow, SP, 256", -30, 30, -30, 30, 1.0, abufsp, bbufsp, vfloat); + + fillSP(abufsp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asinf8_u10, "asin, SP, 256", -1.0, 1, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf8_u10, "acos, SP, 256", -1.0, 1, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_asinf8_u35, "asin, SP, 256", -1.0, 1.0, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf8_u35, "acos, SP, 256", -1.0, 1.0, 4.0, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSLEEF1_1(Sleef_atanf8_u10, "atan, SP, 256", -10, 10, 1.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f8_u10, "atan2, SP, 256", -10, 10, -10, 10, 1.0, abufsp, bbufsp, vfloat); + + callFuncSLEEF1_1(Sleef_atanf8_u35, "atan, SP, 256", -10, 10, 4.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f8_u35, "atan2, SP, 256", -10, 10, -10, 10, 4.0, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void zeroupper256() {} +void benchSleef256_DPTrig() {} +void benchSleef256_DPNontrig() {} +void benchSleef256_SPTrig() {} +void benchSleef256_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef512.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef512.c new file mode 100644 index 0000000000000..296c123693132 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsleef512.c @@ -0,0 +1,180 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __AVX512F__ +#if defined(_MSC_VER) +#include +#else +#include +#endif +typedef __m512d vdouble; +typedef __m512 vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void benchSleef512_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sind8_u10 , "sin, DP, 512", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u10 , "cos, DP, 512", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u10 , "tan, DP, 512", 0, 6.28, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u10, "sincos, DP, 512", 0, 6.28, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind8_u35 , "sin, DP, 512", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u35 , "cos, DP, 512", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u35 , "tan, DP, 512", 0, 6.28, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u35, "sincos, DP, 512", 0, 6.28, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSLEEF1_1(Sleef_sind8_u10 , "sin, DP, 512", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u10 , "cos, DP, 512", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u10 , "tan, DP, 512", 0, 1e+6, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u10, "sincos, DP, 512", 0, 1e+6, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind8_u35 , "sin, DP, 512", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u35 , "cos, DP, 512", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u35 , "tan, DP, 512", 0, 1e+6, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u35, "sincos, DP, 512", 0, 1e+6, 4.0, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSLEEF1_1(Sleef_sind8_u10 , "sin, DP, 512", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u10 , "cos, DP, 512", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u10 , "tan, DP, 512", 0, 1e+100, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u10, "sincos, DP, 512", 0, 1e+100, 1.0, abufdp, vdouble); + + callFuncSLEEF1_1(Sleef_sind8_u35 , "sin, DP, 512", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_cosd8_u35 , "cos, DP, 512", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_tand8_u35 , "tan, DP, 512", 0, 1e+100, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_sincosd8_u35, "sincos, DP, 512", 0, 1e+100, 4.0, abufdp, vdouble); +} + +void benchSleef512_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSLEEF1_1(Sleef_logd8_u10 , "log, DP, 512", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log10d8_u10, "log10, DP, 512", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_log1pd8_u10, "log1p, DP, 512", 0, 1e+300, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_logd8_u35 , "log, DP, 512", 0, 1e+300, 4.0, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSLEEF1_1(Sleef_expd8_u10 , "exp, DP, 512", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp2d8_u10 , "exp2, DP, 512", -700, 700, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_exp10d8_u10, "exp10, DP, 512", -700, 700, 1.0, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSLEEF1_2(Sleef_powd8_u10, "pow, DP, 512", -30, 30, -30, 30, 1.0, abufdp, bbufdp, vdouble); + + fillDP(abufdp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asind8_u10, "asin, DP, 512", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd8_u10, "acos, DP, 512", -1.0, 1.0, 1.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_asind8_u35, "asin, DP, 512", -1.0, 1.0, 4.0, abufdp, vdouble); + callFuncSLEEF1_1(Sleef_acosd8_u35, "acos, DP, 512", -1.0, 1.0, 4.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSLEEF1_1(Sleef_atand8_u10, "atan, DP, 512", -10, 10, 1.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d8_u10, "atan2, DP, 512", -10, 10, -10, 10, 1.0, abufdp, bbufdp, vdouble); + callFuncSLEEF1_1(Sleef_atand8_u35, "atan, DP, 512", -10, 10, 4.0, abufdp, vdouble); + callFuncSLEEF1_2(Sleef_atan2d8_u35, "atan2, DP, 512", -10, 10, -10, 10, 4.0, abufdp, bbufdp, vdouble); +} + +void benchSleef512_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSLEEF1_1(Sleef_sinf16_u10 , "sin, SP, 512", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf16_u10 , "cos, SP, 512", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf16_u10 , "tan, SP, 512", 0, 6.28, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf16_u10, "sincos, SP, 512", 0, 6.28, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf16_u35 , "sin, SP, 512", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf16_u35 , "cos, SP, 512", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf16_u35 , "tan, SP, 512", 0, 6.28, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf16_u35, "sincos, SP, 512", 0, 6.28, 4.0, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSLEEF1_1(Sleef_sinf16_u10 , "sin, SP, 512", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf16_u10 , "cos, SP, 512", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf16_u10 , "tan, SP, 512", 0, 1e+20, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf16_u10, "sincos, SP, 512", 0, 1e+20, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_sinf16_u35 , "sin, SP, 512", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_cosf16_u35 , "cos, SP, 512", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_tanf16_u35 , "tan, SP, 512", 0, 1e+20, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_sincosf16_u35, "sincos, SP, 512", 0, 1e+20, 4.0, abufsp, vfloat); +} + +void benchSleef512_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSLEEF1_1(Sleef_logf16_u10 , "log, SP, 512", 0, 1e+38, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_log10f16_u10, "log10, SP, 512", 0, 1e+38, 1.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf16_u10, "log1p, SP, 512", 0, 1e+38, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_logf16_u35 , "log, SP, 512", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log10f16_u35, "log10, SP, 512", 0, 1e+38, 4.0, abufsp, vfloat); + //callFuncSLEEF1_1(Sleef_log1pf16_u35, "log1p, SP, 512", 0, 1e+38, 4.0, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSLEEF1_1(Sleef_expf16_u10 , "exp, SP, 512", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp2f16_u10 , "exp2, SP, 512", -100, 100, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_exp10f16_u10, "exp10, SP, 512", -100, 100, 1.0, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSLEEF1_2(Sleef_powf16_u10, "pow, SP, 512", -30, 30, -30, 30, 1.0, abufsp, bbufsp, vfloat); + + fillSP(abufsp, -1.0, 1.0); + + callFuncSLEEF1_1(Sleef_asinf16_u10, "asin, SP, 512", -1.0, 1, 1.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf16_u10, "acos, SP, 512", -1.0, 1, 1.0, abufsp, vfloat); + + callFuncSLEEF1_1(Sleef_asinf16_u35, "asin, SP, 512", -1.0, 1.0, 4.0, abufsp, vfloat); + callFuncSLEEF1_1(Sleef_acosf16_u35, "acos, SP, 512", -1.0, 1.0, 4.0, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSLEEF1_1(Sleef_atanf16_u10, "atan, SP, 512", -10, 10, 1.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f16_u10, "atan2, SP, 512", -10, 10, -10, 10, 1.0, abufsp, bbufsp, vfloat); + + callFuncSLEEF1_1(Sleef_atanf16_u35, "atan, SP, 512", -10, 10, 4.0, abufsp, vfloat); + callFuncSLEEF1_2(Sleef_atan2f16_u35, "atan2, SP, 512", -10, 10, -10, 10, 4.0, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void benchSleef512_DPTrig() {} +void benchSleef512_DPNontrig() {} +void benchSleef512_SPTrig() {} +void benchSleef512_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml.c new file mode 100644 index 0000000000000..feb9cb6263ba0 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml.c @@ -0,0 +1,153 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bench.h" + +int veclen = 16; +int enableLogExp; +double *abufdp, *bbufdp; +float *abufsp, *bbufsp; +FILE *fp; + +#if defined(__i386__) || defined(__x86_64__) +void x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx) { + uint32_t a, b, c, d; + __asm__ __volatile__ ("cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (eax), "c"(ecx)); + out[0] = a; out[1] = b; out[2] = c; out[3] = d; +} + +int cpuSupportsAVX() { + int32_t reg[4]; + x86CpuID(reg, 1, 0); + return (reg[2] & (1 << 28)) != 0; +} + +int cpuSupportsAVX512F() { + int32_t reg[4]; + x86CpuID(reg, 7, 0); + return (reg[1] & (1 << 16)) != 0; +} +#endif + +uint64_t Sleef_currentTimeMicros() { + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return (uint64_t)tp.tv_sec * 1000000LL + ((uint64_t)tp.tv_nsec/1000); +} + +void fillDP(double *buf, double min, double max) { + for(int i=0;i= 3) fnBase = argv[2]; + + srandom(time(NULL)); + +#if defined(__i386__) || defined(__x86_64__) + int do128bit = 1; + int do256bit = cpuSupportsAVX(); + int do512bit = cpuSupportsAVX512F(); +#elif defined(__ARM_NEON) + int do128bit = 1; + int do256bit = 0; + int do512bit = 0; +#else +#error Unsupported architecture +#endif + + posix_memalign((void **)&abufdp, veclen*sizeof(double), NITER1*veclen*sizeof(double)); + posix_memalign((void **)&bbufdp, veclen*sizeof(double), NITER1*veclen*sizeof(double)); + + abufsp = (float *)abufdp; + bbufsp = (float *)bbufdp; + + enableLogExp = SVMLULP < 2; + + sprintf(fn, "%sdptrig%gulp.out", fnBase, (double)SVMLULP); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do256bit) zeroupper256(); + if (do128bit) benchSVML128_DPTrig(); + if (do256bit) benchSVML256_DPTrig(); + if (do512bit) benchSVML512_DPTrig(); + + fclose(fp); + + sprintf(fn, "%sdpnontrig%gulp.out", fnBase, (double)SVMLULP); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do256bit) zeroupper256(); + if (do128bit) benchSVML128_DPNontrig(); + if (do256bit) benchSVML256_DPNontrig(); + if (do512bit) benchSVML512_DPNontrig(); + + fclose(fp); + + sprintf(fn, "%ssptrig%gulp.out", fnBase, (double)SVMLULP); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do256bit) zeroupper256(); + if (do128bit) benchSVML128_SPTrig(); + if (do256bit) benchSVML256_SPTrig(); + if (do512bit) benchSVML512_SPTrig(); + + fclose(fp); + + sprintf(fn, "%sspnontrig%gulp.out", fnBase, (double)SVMLULP); + fp = fopen(fn, "w"); + fprintf(fp, "%s\n", columnTitle); + + if (do256bit) zeroupper256(); + if (do128bit) benchSVML128_SPNontrig(); + if (do256bit) benchSVML256_SPNontrig(); + if (do512bit) benchSVML512_SPNontrig(); + + fclose(fp); + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml128.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml128.c new file mode 100644 index 0000000000000..5c8c5d785468f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml128.c @@ -0,0 +1,144 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t Sleef_currentTimeMicros(); +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern int enableLogExp; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __SSE2__ +typedef __m128d vdouble; +typedef __m128 vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void benchSVML128_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSVML1_1(_mm_sin_pd , "sin, DP, 128", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm_cos_pd , "cos, DP, 128", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm_tan_pd , "tan, DP, 128", 0, 6.28, abufdp, vdouble); + callFuncSVML2_1(_mm_sincos_pd, "sincos, DP, 128", 0, 6.28, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSVML1_1(_mm_sin_pd , "sin, DP, 128", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm_cos_pd , "cos, DP, 128", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm_tan_pd , "tan, DP, 128", 0, 1e+6, abufdp, vdouble); + callFuncSVML2_1(_mm_sincos_pd, "sincos, DP, 128", 0, 1e+6, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSVML1_1(_mm_sin_pd , "sin, DP, 128", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm_cos_pd , "cos, DP, 128", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm_tan_pd , "tan, DP, 128", 0, 1e+100, abufdp, vdouble); + callFuncSVML2_1(_mm_sincos_pd, "sincos, DP, 128", 0, 1e+100, abufdp, vdouble); +} + +void benchSVML128_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSVML1_1(_mm_log_pd , "log, DP, 128", 0, 1e+300, abufdp, vdouble); + + if (enableLogExp) { + callFuncSVML1_1(_mm_log10_pd, "log10, DP, 128", 0, 1e+300, abufdp, vdouble); + callFuncSVML1_1(_mm_log1p_pd, "log1p, DP, 128", 0, 1e+300, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSVML1_1(_mm_exp_pd , "exp, DP, 128", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm_exp2_pd , "exp2, DP, 128", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm_exp10_pd, "exp10, DP, 128", -700, 700, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSVML1_2(_mm_pow_pd, "pow, DP, 128", -30, 30, -30, 30, abufdp, bbufdp, vdouble); + } + + fillDP(abufdp, -1.0, 1.0); + + callFuncSVML1_1(_mm_asin_pd, "asin, DP, 128", -1.0, 1.0, abufdp, vdouble); + callFuncSVML1_1(_mm_acos_pd, "acos, DP, 128", -1.0, 1.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSVML1_1(_mm_atan_pd, "atan, DP, 128", -10, 10, abufdp, vdouble); + callFuncSVML1_2(_mm_atan2_pd, "atan2, DP, 128", -10, 10, -10, 10, abufdp, bbufdp, vdouble); +} + +void benchSVML128_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSVML1_1(_mm_sin_ps , "sin, SP, 128", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm_cos_ps , "cos, SP, 128", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm_tan_ps , "tan, SP, 128", 0, 6.28, abufsp, vfloat); + callFuncSVML2_1(_mm_sincos_ps, "sincos, SP, 128", 0, 6.28, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSVML1_1(_mm_sin_ps , "sin, SP, 128", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm_cos_ps , "cos, SP, 128", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm_tan_ps , "tan, SP, 128", 0, 1e+20, abufsp, vfloat); + callFuncSVML2_1(_mm_sincos_ps, "sincos, SP, 128", 0, 1e+20, abufsp, vfloat); +} + +void benchSVML128_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSVML1_1(_mm_log_ps , "log, SP, 128", 0, 1e+38, abufsp, vfloat); + + if (enableLogExp) { + callFuncSVML1_1(_mm_log10_ps, "log10, SP, 128", 0, 1e+38, abufsp, vfloat); + //callFuncSVML1_1(_mm_log1p_ps, "log1p, SP, 128", 0, 1e+38, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSVML1_1(_mm_exp_ps , "exp, SP, 128", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm_exp2_ps , "exp2, SP, 128", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm_exp10_ps, "exp10, SP, 128", -100, 100, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSVML1_2(_mm_pow_ps, "pow, SP, 128", -30, 30, -30, 30, abufsp, bbufsp, vfloat); + } + + fillSP(abufsp, -1.0, 1.0); + + callFuncSVML1_1(_mm_asin_ps, "asin, SP, 128", -1.0, 1, abufsp, vfloat); + callFuncSVML1_1(_mm_acos_ps, "acos, SP, 128", -1.0, 1, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSVML1_1(_mm_atan_ps, "atan, SP, 128", -10, 10, abufsp, vfloat); + callFuncSVML1_2(_mm_atan2_ps, "atan2, SP, 128", -10, 10, -10, 10, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void benchSVML128_DPTrig() {} +void benchSVML128_DPNontrig() {} +void benchSVML128_SPTrig() {} +void benchSVML128_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml256.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml256.c new file mode 100644 index 0000000000000..2f1e2ee5e2136 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml256.c @@ -0,0 +1,147 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t Sleef_currentTimeMicros(); +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern int enableLogExp; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __AVX__ +typedef __m256d vdouble; +typedef __m256 vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void zeroupper256() { _mm256_zeroupper(); } + +void benchSVML256_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSVML1_1(_mm256_sin_pd , "sin, DP, 256", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm256_cos_pd , "cos, DP, 256", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm256_tan_pd , "tan, DP, 256", 0, 6.28, abufdp, vdouble); + callFuncSVML2_1(_mm256_sincos_pd, "sincos, DP, 256", 0, 6.28, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSVML1_1(_mm256_sin_pd , "sin, DP, 256", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm256_cos_pd , "cos, DP, 256", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm256_tan_pd , "tan, DP, 256", 0, 1e+6, abufdp, vdouble); + callFuncSVML2_1(_mm256_sincos_pd, "sincos, DP, 256", 0, 1e+6, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSVML1_1(_mm256_sin_pd , "sin, DP, 256", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm256_cos_pd , "cos, DP, 256", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm256_tan_pd , "tan, DP, 256", 0, 1e+100, abufdp, vdouble); + callFuncSVML2_1(_mm256_sincos_pd, "sincos, DP, 256", 0, 1e+100, abufdp, vdouble); +} + +void benchSVML256_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSVML1_1(_mm256_log_pd , "log, DP, 256", 0, 1e+300, abufdp, vdouble); + + if (enableLogExp) { + callFuncSVML1_1(_mm256_log10_pd, "log10, DP, 256", 0, 1e+300, abufdp, vdouble); + callFuncSVML1_1(_mm256_log1p_pd, "log1p, DP, 256", 0, 1e+300, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSVML1_1(_mm256_exp_pd , "exp, DP, 256", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm256_exp2_pd , "exp2, DP, 256", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm256_exp10_pd, "exp10, DP, 256", -700, 700, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSVML1_2(_mm256_pow_pd, "pow, DP, 256", -30, 30, -30, 30, abufdp, bbufdp, vdouble); + } + + fillDP(abufdp, -1.0, 1.0); + + callFuncSVML1_1(_mm256_asin_pd, "asin, DP, 256", -1.0, 1.0, abufdp, vdouble); + callFuncSVML1_1(_mm256_acos_pd, "acos, DP, 256", -1.0, 1.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSVML1_1(_mm256_atan_pd, "atan, DP, 256", -10, 10, abufdp, vdouble); + callFuncSVML1_2(_mm256_atan2_pd, "atan2, DP, 256", -10, 10, -10, 10, abufdp, bbufdp, vdouble); +} + +void benchSVML256_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSVML1_1(_mm256_sin_ps , "sin, SP, 256", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm256_cos_ps , "cos, SP, 256", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm256_tan_ps , "tan, SP, 256", 0, 6.28, abufsp, vfloat); + callFuncSVML2_1(_mm256_sincos_ps, "sincos, SP, 256", 0, 6.28, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSVML1_1(_mm256_sin_ps , "sin, SP, 256", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm256_cos_ps , "cos, SP, 256", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm256_tan_ps , "tan, SP, 256", 0, 1e+20, abufsp, vfloat); + callFuncSVML2_1(_mm256_sincos_ps, "sincos, SP, 256", 0, 1e+20, abufsp, vfloat); +} + +void benchSVML256_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSVML1_1(_mm256_log_ps , "log, SP, 256", 0, 1e+38, abufsp, vfloat); + + if (enableLogExp) { + callFuncSVML1_1(_mm256_log10_ps, "log10, SP, 256", 0, 1e+38, abufsp, vfloat); + //callFuncSVML1_1(_mm256_log1p_ps, "log1p, SP, 256", 0, 1e+38, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSVML1_1(_mm256_exp_ps , "exp, SP, 256", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm256_exp2_ps , "exp2, SP, 256", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm256_exp10_ps, "exp10, SP, 256", -100, 100, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSVML1_2(_mm256_pow_ps, "pow, SP, 256", -30, 30, -30, 30, abufsp, bbufsp, vfloat); + } + + fillSP(abufsp, -1.0, 1.0); + + callFuncSVML1_1(_mm256_asin_ps, "asin, SP, 256", -1.0, 1, abufsp, vfloat); + callFuncSVML1_1(_mm256_acos_ps, "acos, SP, 256", -1.0, 1, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSVML1_1(_mm256_atan_ps, "atan, SP, 256", -10, 10, abufsp, vfloat); + callFuncSVML1_2(_mm256_atan2_ps, "atan2, SP, 256", -10, 10, -10, 10, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void zeroupper256() {} +void benchSVML256_DPTrig() {} +void benchSVML256_DPNontrig() {} +void benchSVML256_SPTrig() {} +void benchSVML256_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml512.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml512.c new file mode 100644 index 0000000000000..537ee28658a74 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/benchsvml512.c @@ -0,0 +1,144 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t Sleef_currentTimeMicros(); +void fillDP(double *buf, double min, double max); +void fillSP(float *buf, double min, double max); + +extern char x86BrandString[256], versionString[1024]; +extern int veclen; +extern int enableLogExp; +extern double *abufdp, *bbufdp; +extern float *abufsp, *bbufsp; +extern FILE *fp; + +#include "bench.h" + +#ifdef __AVX512F__ +typedef __m512d vdouble; +typedef __m512 vfloat; +#define ENABLED +#endif + +#ifdef ENABLED +void benchSVML512_DPTrig() { + fillDP(abufdp, 0, 6.28); + + callFuncSVML1_1(_mm512_sin_pd , "sin, DP, 512", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm512_cos_pd , "cos, DP, 512", 0, 6.28, abufdp, vdouble); + callFuncSVML1_1(_mm512_tan_pd , "tan, DP, 512", 0, 6.28, abufdp, vdouble); + callFuncSVML2_1(_mm512_sincos_pd, "sincos, DP, 512", 0, 6.28, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+6); + + callFuncSVML1_1(_mm512_sin_pd , "sin, DP, 512", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm512_cos_pd , "cos, DP, 512", 0, 1e+6, abufdp, vdouble); + callFuncSVML1_1(_mm512_tan_pd , "tan, DP, 512", 0, 1e+6, abufdp, vdouble); + callFuncSVML2_1(_mm512_sincos_pd, "sincos, DP, 512", 0, 1e+6, abufdp, vdouble); + + fillDP(abufdp, 0, 1e+100); + + callFuncSVML1_1(_mm512_sin_pd , "sin, DP, 512", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm512_cos_pd , "cos, DP, 512", 0, 1e+100, abufdp, vdouble); + callFuncSVML1_1(_mm512_tan_pd , "tan, DP, 512", 0, 1e+100, abufdp, vdouble); + callFuncSVML2_1(_mm512_sincos_pd, "sincos, DP, 512", 0, 1e+100, abufdp, vdouble); +} + +void benchSVML512_DPNontrig() { + fillDP(abufdp, 0, 1e+300); + + callFuncSVML1_1(_mm512_log_pd , "log, DP, 512", 0, 1e+300, abufdp, vdouble); + + if (enableLogExp) { + callFuncSVML1_1(_mm512_log10_pd, "log10, DP, 512", 0, 1e+300, abufdp, vdouble); + callFuncSVML1_1(_mm512_log1p_pd, "log1p, DP, 512", 0, 1e+300, abufdp, vdouble); + + fillDP(abufdp, -700, 700); + + callFuncSVML1_1(_mm512_exp_pd , "exp, DP, 512", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm512_exp2_pd , "exp2, DP, 512", -700, 700, abufdp, vdouble); + callFuncSVML1_1(_mm512_exp10_pd, "exp10, DP, 512", -700, 700, abufdp, vdouble); + + fillDP(abufdp, -30, 30); + fillDP(bbufdp, -30, 30); + + callFuncSVML1_2(_mm512_pow_pd, "pow, DP, 512", -30, 30, -30, 30, abufdp, bbufdp, vdouble); + } + + fillDP(abufdp, -1.0, 1.0); + + callFuncSVML1_1(_mm512_asin_pd, "asin, DP, 512", -1.0, 1.0, abufdp, vdouble); + callFuncSVML1_1(_mm512_acos_pd, "acos, DP, 512", -1.0, 1.0, abufdp, vdouble); + + fillDP(abufdp, -10, 10); + fillDP(bbufdp, -10, 10); + + callFuncSVML1_1(_mm512_atan_pd, "atan, DP, 512", -10, 10, abufdp, vdouble); + callFuncSVML1_2(_mm512_atan2_pd, "atan2, DP, 512", -10, 10, -10, 10, abufdp, bbufdp, vdouble); +} + +void benchSVML512_SPTrig() { + fillSP(abufsp, 0, 6.28); + + callFuncSVML1_1(_mm512_sin_ps , "sin, SP, 512", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm512_cos_ps , "cos, SP, 512", 0, 6.28, abufsp, vfloat); + callFuncSVML1_1(_mm512_tan_ps , "tan, SP, 512", 0, 6.28, abufsp, vfloat); + callFuncSVML2_1(_mm512_sincos_ps, "sincos, SP, 512", 0, 6.28, abufsp, vfloat); + + fillSP(abufsp, 0, 1e+20); + + callFuncSVML1_1(_mm512_sin_ps , "sin, SP, 512", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm512_cos_ps , "cos, SP, 512", 0, 1e+20, abufsp, vfloat); + callFuncSVML1_1(_mm512_tan_ps , "tan, SP, 512", 0, 1e+20, abufsp, vfloat); + callFuncSVML2_1(_mm512_sincos_ps, "sincos, SP, 512", 0, 1e+20, abufsp, vfloat); +} + +void benchSVML512_SPNontrig() { + fillSP(abufsp, 0, 1e+38); + + callFuncSVML1_1(_mm512_log_ps , "log, SP, 512", 0, 1e+38, abufsp, vfloat); + + if (enableLogExp) { + callFuncSVML1_1(_mm512_log10_ps, "log10, SP, 512", 0, 1e+38, abufsp, vfloat); + //callFuncSVML1_1(_mm512_log1p_ps, "log1p, SP, 512", 0, 1e+38, abufsp, vfloat); + + fillSP(abufsp, -100, 100); + + callFuncSVML1_1(_mm512_exp_ps , "exp, SP, 512", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm512_exp2_ps , "exp2, SP, 512", -100, 100, abufsp, vfloat); + callFuncSVML1_1(_mm512_exp10_ps, "exp10, SP, 512", -100, 100, abufsp, vfloat); + + fillSP(abufsp, -30, 30); + fillSP(bbufsp, -30, 30); + + callFuncSVML1_2(_mm512_pow_ps, "pow, SP, 512", -30, 30, -30, 30, abufsp, bbufsp, vfloat); + } + + fillSP(abufsp, -1.0, 1.0); + + callFuncSVML1_1(_mm512_asin_ps, "asin, SP, 512", -1.0, 1, abufsp, vfloat); + callFuncSVML1_1(_mm512_acos_ps, "acos, SP, 512", -1.0, 1, abufsp, vfloat); + + fillSP(abufsp, -10, 10); + fillSP(bbufsp, -10, 10); + + callFuncSVML1_1(_mm512_atan_ps, "atan, SP, 512", -10, 10, abufsp, vfloat); + callFuncSVML1_2(_mm512_atan2_ps, "atan2, SP, 512", -10, 10, -10, 10, abufsp, bbufsp, vfloat); +} +#else // #ifdef ENABLED +void benchSVML512_DPTrig() {} +void benchSVML512_DPNontrig() {} +void benchSVML512_SPTrig() {} +void benchSVML512_SPNontrig() {} +#endif // #ifdef ENABLED diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/measure.sh b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/measure.sh new file mode 100644 index 0000000000000..74ccb8b53270e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-benchmarks/measure.sh @@ -0,0 +1,17 @@ +#!/bin/sh +echo +read -p "Enter label of measurement(e.g. My desktop PC) : " label + +if [ -f counter.txt ] +then + counter=`cat counter.txt` +else + counter=0 +fi + +echo Measurement in progress. This may take several minutes. +for i in $*; do + $i "$label" $counter +done +counter=$((counter+1)) +echo $counter > counter.txt diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/CMakeLists.txt new file mode 100644 index 0000000000000..b391c1525a45f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/CMakeLists.txt @@ -0,0 +1,517 @@ + +# Settings + +# TESTER3_DEFINITIONS + +set(TESTER3_DEFINITIONS_SSE2 ATR=cinz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=sse2) +set(TESTER3_DEFINITIONS_SSE4 ATR=cinz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=sse4) +set(TESTER3_DEFINITIONS_AVX2128 ATR=finz_ DPTYPE=__m128d SPTYPE=__m128 DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=avx2128) +set(TESTER3_DEFINITIONS_AVX ATR=cinz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=avx) +set(TESTER3_DEFINITIONS_FMA4 ATR=finz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=fma4) +set(TESTER3_DEFINITIONS_AVX2 ATR=finz_ DPTYPE=__m256d SPTYPE=__m256 DPTYPESPEC=d4 SPTYPESPEC=f8 EXTSPEC=avx2) +set(TESTER3_DEFINITIONS_AVX512F ATR=finz_ DPTYPE=__m512d SPTYPE=__m512 DPTYPESPEC=d8 SPTYPESPEC=f16 EXTSPEC=avx512f) +set(TESTER3_DEFINITIONS_AVX512FNOFMA ATR=cinz_ DPTYPE=__m512d SPTYPE=__m512 DPTYPESPEC=d8 SPTYPESPEC=f16 EXTSPEC=avx512fnofma) + +set(TESTER3_DEFINITIONS_ADVSIMD ATR=finz_ DPTYPE=float64x2_t SPTYPE=float32x4_t DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=advsimd) +set(TESTER3_DEFINITIONS_ADVSIMDNOFMA ATR=cinz_ DPTYPE=float64x2_t SPTYPE=float32x4_t DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=advsimdnofma) +set(TESTER3_DEFINITIONS_SVE ATR=finz_ DPTYPE=svfloat64_t SPTYPE=svfloat32_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=sve) +set(TESTER3_DEFINITIONS_SVENOFMA ATR=cinz_ DPTYPE=svfloat64_t SPTYPE=svfloat32_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=svenofma) + +set(TESTER3_DEFINITIONS_VSX ATR=finz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsx) +set(TESTER3_DEFINITIONS_VSXNOFMA ATR=cinz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsxnofma) +set(TESTER3_DEFINITIONS_VSX3 ATR=finz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsx3) +set(TESTER3_DEFINITIONS_VSX3NOFMA ATR=cinz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vsx3nofma) + +set(TESTER3_DEFINITIONS_VXE ATR=finz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vxe) +set(TESTER3_DEFINITIONS_VXENOFMA ATR=cinz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vxenofma) +set(TESTER3_DEFINITIONS_VXE2 ATR=finz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vxe2) +set(TESTER3_DEFINITIONS_VXE2NOFMA ATR=cinz_ DPTYPE=SLEEF_VECTOR_DOUBLE SPTYPE=SLEEF_VECTOR_FLOAT DPTYPESPEC=d2 SPTYPESPEC=f4 EXTSPEC=vxe2nofma) + +set(TESTER3_DEFINITIONS_RVVM1 ATR=finz_ DPTYPE=vfloat64m1_t SPTYPE=vfloat32m1_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=rvvm1 ENABLE_RVVM1) +set(TESTER3_DEFINITIONS_RVVM1NOFMA ATR=cinz_ DPTYPE=vfloat64m1_t SPTYPE=vfloat32m1_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=rvvm1nofma ENABLE_RVVM1) +set(TESTER3_DEFINITIONS_RVVM2 ATR=finz_ DPTYPE=vfloat64m2_t SPTYPE=vfloat32m2_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=rvvm2 ENABLE_RVVM2) +set(TESTER3_DEFINITIONS_RVVM2NOFMA ATR=cinz_ DPTYPE=vfloat64m2_t SPTYPE=vfloat32m2_t DPTYPESPEC=dx SPTYPESPEC=fx EXTSPEC=rvvm2nofma ENABLE_RVVM2) + +set(TESTER3_DEFINITIONS_PUREC_SCALAR ATR=cinz_ DPTYPE=double SPTYPE=float DPTYPESPEC=d1 SPTYPESPEC=f1 EXTSPEC=purec) +set(TESTER3_DEFINITIONS_PURECFMA_SCALAR ATR=finz_ DPTYPE=double SPTYPE=float DPTYPESPEC=d1 SPTYPESPEC=f1 EXTSPEC=purecfma) + +# + +if (SLEEF_ARCH_X86) + set(TEST3_CINZ purec_scalar sse2 sse4 avx avx512fnofma) + set(TEST3_FINZ purecfma_scalar avx2128 avx2 avx512f) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(TEST3_CINZ purec_scalar advsimdnofma svenofma) + set(TEST3_FINZ purecfma_scalar advsimd sve) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + set(TEST3_CINZ purec_scalar) + set(TEST3_FINZ purecfma_scalar) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") + set(TEST3_CINZ purec_scalar vsxnofma vsx3nofma) + set(TEST3_FINZ purecfma_scalar vsx vsx3) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x") + set(TEST3_CINZ purec_scalar vxenofma vxe2nofma) + set(TEST3_FINZ purecfma_scalar vxe vxe2) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") + set(TEST3_CINZ purec_scalar rvvm1nofma rvvm2nofma) + set(TEST3_FINZ purecfma_scalar rvvm1 rvvm2) +endif() + +# + +link_directories(${sleef_BINARY_DIR}/lib) # libsleef +link_directories(${sleef_BINARY_DIR}/src/common) # common.a +include_directories(${sleef_BINARY_DIR}/include) # sleef.h +include_directories(${sleef_SOURCE_DIR}/src/libm) # rename.h +include_directories(${sleef_BINARY_DIR}/src/libm/include) # rename headers + +if(NOT LIB_MPFR) + find_program(TESTER_COMMAND tester) +endif(NOT LIB_MPFR) + +if (SLEEF_ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) + message(FATAL_ERROR "SLEEF_ENFORCE_TESTER is specified and tester is not available") +endif(SLEEF_ENFORCE_TESTER AND NOT LIB_MPFR AND NOT TESTER_COMMAND) + +find_library(LIBRT rt) +if (NOT LIBRT) + set(LIBRT "") +endif() + +set(CMAKE_C_FLAGS "${ORG_CMAKE_C_FLAGS} ${SLEEF_C_FLAGS} ${FLAGS_NOSTRICTALIASING}") + +set(COMMON_TARGET_PROPERTIES + C_STANDARD 99 # -std=gnu99 + ) + +if (SLEEF_ENABLE_LTO) + list(APPEND COMMON_TARGET_PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) # -flto +endif() + +# + +function(add_test_iut IUT C) + if (LIB_MPFR) + set(TESTER ${TARGET_TESTER}) + elseif(TESTER_COMMAND) + set(TESTER ${TESTER_COMMAND}) + endif() + # When we are crosscompiling using the mkrename* tools from a native + # build, we use the tester executable from the native build. + if (CMAKE_CROSSCOMPILING AND NATIVE_BUILD_DIR) + set(TESTER ${NATIVE_BUILD_DIR}/bin/${TARGET_TESTER}) + endif(CMAKE_CROSSCOMPILING AND NATIVE_BUILD_DIR) + if (TESTER) + if (NOT EMULATOR) + if (SDE_COMMAND) + set(FLAGS_SDE "--sde" ${SDE_COMMAND}) + else() + set(FLAGS_SDE) + endif() + if (ARMIE_COMMAND) + set(FLAGS_ARMIE ${ARMIE_COMMAND} -msve-vector-bits=${SVE_VECTOR_BITS}) + else() + set(FLAGS_ARMIE) + endif() + add_test(NAME ${IUT} + COMMAND ${TESTER} ${FLAGS_SDE} ${FLAGS_ARMIE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${IUT} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set_tests_properties(${IUT} PROPERTIES COST ${C}) + else() + add_test(NAME ${IUT} + COMMAND ${TESTER} "--qemu" ${EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${IUT} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set_tests_properties(${IUT} PROPERTIES COST ${C}) + endif() + endif() +endfunction() + +# Compile executable 'iut' +add_executable(${TARGET_IUT} iut.c testerutil.c) +target_compile_definitions(${TARGET_IUT} PRIVATE ${COMMON_TARGET_DEFINITIONS}) +target_link_libraries(${TARGET_IUT} ${TARGET_LIBSLEEF} + ${LIBM} ${LIBRT}) +set_target_properties(${TARGET_IUT} PROPERTIES ${COMMON_TARGET_PROPERTIES}) +add_test_iut(${TARGET_IUT} 1.0) +set(IUT_LIST ${TARGET_IUT}) + +# Compile executable 'iutcuda' +if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) + add_executable(iutcuda iutcuda.cu) + set_target_properties(iutcuda PROPERTIES LINKER_LANGUAGE CUDA) + target_compile_options(iutcuda PRIVATE "--fmad=false;-Xcompiler;-ffp-contract=off") + add_dependencies(iutcuda ${TARGET_INLINE_HEADERS}) + add_test_iut(iutcuda 20.0) + list(APPEND IUT_LIST iutcuda) +endif() + +set(IUT_SRC iutsimd.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c testerutil.c) + +# Add vector extension `iut`s +macro(test_extension SIMD) + if(COMPILER_SUPPORTS_${SIMD}) + string(TOLOWER ${SIMD} LCSIMD) + string(CONCAT TARGET_IUT${SIMD} "iut" ${LCSIMD}) + + add_executable(${TARGET_IUT${SIMD}} ${IUT_SRC}) + target_compile_options(${TARGET_IUT${SIMD}} + PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${TARGET_IUT${SIMD}} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(${TARGET_IUT${SIMD}} ${TARGET_LIBSLEEF} + ${LIBM} ${LIBRT}) + if (FORCE_AAVPCS) + target_compile_definitions(${TARGET_IUT${SIMD}} PRIVATE ENABLE_AAVPCS=1) + endif(FORCE_AAVPCS) + + add_dependencies(${TARGET_IUT${SIMD}} ${TARGET_HEADERS}) + add_dependencies(${TARGET_IUT${SIMD}} ${TARGET_LIBSLEEF}) + set_target_properties(${TARGET_IUT${SIMD}} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + if (DEFINED COSTOVERRIDE_${SIMD}) + add_test_iut(${TARGET_IUT${SIMD}} ${COSTOVERRIDE_${SIMD}}) + else() + add_test_iut(${TARGET_IUT${SIMD}} 1.0) + endif() + list(APPEND IUT_LIST ${TARGET_IUT${SIMD}}) + + # The iut programs whose names begin with "iuty" are the iut for the + # deterministic version of functions. By checking the result of + # testing with iutysse2, for example, it can be checked that the + # corresponding deterministic functions passes the accuracy and + # nonnumber tests. + + string(CONCAT IUTYNAME "iuty" ${LCSIMD}) + add_executable(${IUTYNAME} ${IUT_SRC}) + target_compile_options(${IUTYNAME} + PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${IUTYNAME} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS} DETERMINISTIC=1) + target_link_libraries(${IUTYNAME} ${TARGET_LIBSLEEF} + ${LIBM} ${LIBRT}) + add_dependencies(${IUTYNAME} ${TARGET_HEADERS}) + add_dependencies(${IUTYNAME} ${TARGET_LIBSLEEF}) + set_target_properties(${IUTYNAME} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + if (DEFINED COSTOVERRIDE_${SIMD}) + add_test_iut(${IUTYNAME} ${COSTOVERRIDE_${SIMD}}) + else() + add_test_iut(${IUTYNAME} 1.0) + endif() + list(APPEND IUT_LIST ${IUTYNAME}) + + # The iut programs whose names begin with "iuti" are the iut for the + # inline version of functions. + + if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) + string(CONCAT IUTINAME "iuti" ${LCSIMD}) + add_executable(${IUTINAME} ${IUT_SRC}) + target_compile_options(${IUTINAME} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${IUTINAME} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS} + USE_INLINE_HEADER="sleefinline_${LCSIMD}.h" + MACRO_ONLY_HEADER="macroonly${SIMD}.h" + SIMD_SUFFIX=_${LCSIMD}_sleef + ) + target_include_directories(${IUTINAME} PRIVATE ${PROJECT_BINARY_DIR}/include) + target_link_libraries(${IUTINAME} ${LIBM} ${LIBRT}) + add_dependencies(${IUTINAME} ${TARGET_INLINE_HEADERS}) + set_target_properties(${IUTINAME} PROPERTIES C_STANDARD 99) + if (DEFINED COSTOVERRIDE_${SIMD}) + add_test_iut(${IUTINAME} ${COSTOVERRIDE_${SIMD}}) + else() + add_test_iut(${IUTINAME} 1.0) + endif() + list(APPEND IUT_LIST ${IUTINAME}) + endif(SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) + + if(LIB_MPFR AND NOT ${SIMD} STREQUAL NEON32 AND NOT ${SIMD} STREQUAL NEON32VFPV4 AND NOT MINGW) + # Build tester2 SIMD + string(TOLOWER ${SIMD} SCSIMD) + foreach(P dp sp) + set(T "tester2${SCSIMD}${P}") + add_executable(${T} tester2simd${P}.c testerutil.c) + if(FORCE_AAVPCS) + target_compile_definitions(${T} PRIVATE ENABLE_AAVPCS=1) + endif(FORCE_AAVPCS) + target_compile_options(${T} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${T} PRIVATE ENABLE_${SIMD}=1 USEMPFR=1 ${COMMON_TARGET_DEFINITIONS}) + set_target_properties(${T} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_link_libraries(${T} ${TARGET_LIBSLEEF} ${LIB_MPFR} ${LIBM} ${LIBGMP}) + add_dependencies(${T} ${TARGET_HEADERS}) + add_dependencies(${T} ${TARGET_LIBSLEEF}) + if (MPFR_INCLUDE_DIR) + target_include_directories(${T} PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + + # The tester2 programs whose name begins with "tester2y" are the + # testing program for the deterministic version of functions. + + set(T "tester2y${SCSIMD}${P}") + add_executable(${T} tester2simd${P}.c testerutil.c) + target_compile_options(${T} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${T} PRIVATE ENABLE_${SIMD}=1 USEMPFR=1 ${COMMON_TARGET_DEFINITIONS} DETERMINISTIC=1) + set_target_properties(${T} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_link_libraries(${T} ${TARGET_LIBSLEEF} ${LIB_MPFR} ${LIBM} ${LIBGMP}) + add_dependencies(${T} ${TARGET_HEADERS}) + add_dependencies(${T} ${TARGET_LIBSLEEF}) + if (MPFR_INCLUDE_DIR) + target_include_directories(${T} PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + endforeach() + endif() + + if(NOT ${SIMD} STREQUAL NEON32 AND NOT ${SIMD} STREQUAL NEON32VFPV4 AND SLEEF_OPENSSL_FOUND) + # Build tester3 + string(TOLOWER ${SIMD} SCSIMD) + set(T "tester3${SCSIMD}") + add_executable(${T} tester3.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c testerutil.c) + target_compile_options(${T} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${T} PRIVATE ${COMMON_TARGET_DEFINITIONS} ${TESTER3_DEFINITIONS_${SIMD}}) + set_target_properties(${T} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + + # Enable Vector PCS for Advanced SIMD (if supported) + if(FORCE_AAVPCS) + host_target_AAVPCS_definitions(${T}) + endif() + + target_link_libraries(${T} ${TARGET_LIBSLEEF} ${LIBM} ${SLEEF_OPENSSL_LIBRARIES}) + target_include_directories(${T} PRIVATE ${SLEEF_OPENSSL_INCLUDE_DIR}) + add_dependencies(${T} ${TARGET_HEADERS}) + add_dependencies(${T} ${TARGET_LIBSLEEF}) + + # Add test with tester3 + list(FIND TEST3_CINZ ${SCSIMD} INDEX_TEST3_CINZ) + if (NOT INDEX_TEST3_CINZ EQUAL -1) + if (SDE_COMMAND) + add_test(NAME tester3${SCSIMD} COMMAND ${SDE_COMMAND} "--" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_cinz.txt) + elseif(EMULATOR) + add_test(NAME tester3${SCSIMD} COMMAND ${EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_cinz.txt) + else() + add_test(NAME tester3${SCSIMD} COMMAND tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_cinz.txt) + endif() + if (DEFINED COSTOVERRIDE_${SIMD}) + set_tests_properties(tester3${SCSIMD} PROPERTIES COST ${COSTOVERRIDE_${SIMD}}) + else() + set_tests_properties(tester3${SCSIMD} PROPERTIES COST 0.5) + endif() + endif() + + list(FIND TEST3_FINZ ${SCSIMD} INDEX_TEST3_FINZ) + if (NOT INDEX_TEST3_FINZ EQUAL -1) + if (SDE_COMMAND) + add_test(NAME tester3${SCSIMD} COMMAND ${SDE_COMMAND} "--" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_finz.txt) + elseif(EMULATOR) + add_test(NAME tester3${SCSIMD} COMMAND ${EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_finz.txt) + else() + add_test(NAME tester3${SCSIMD} COMMAND tester3${SCSIMD} ${sleef_SOURCE_DIR}/src/libm-tester/hash_finz.txt) + endif() + if (DEFINED COSTOVERRIDE_${SIMD}) + set_tests_properties(tester3${SCSIMD} PROPERTIES COST ${COSTOVERRIDE_${SIMD}}) + else() + set_tests_properties(tester3${SCSIMD} PROPERTIES COST 0.5) + endif() + endif() + endif() + endif(COMPILER_SUPPORTS_${SIMD}) +endmacro(test_extension) + +foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS}) + test_extension(${SIMD}) +endforeach() + +function(add_gnuabi_compatibility_test SIMD MASKED) + if (MASKED) + set(GNUABI_COMPATIBILITY_TEST gnuabi_compatibility_${SIMD}_masked) + else(MASKED) + set(GNUABI_COMPATIBILITY_TEST gnuabi_compatibility_${SIMD}) + endif(MASKED) + add_executable(${GNUABI_COMPATIBILITY_TEST} gnuabi_compatibility.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c) + set_target_properties(${GNUABI_COMPATIBILITY_TEST} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_options(${GNUABI_COMPATIBILITY_TEST} + PRIVATE ${FLAGS_ENABLE_${SIMD}}) + if (MASKED) + target_compile_definitions(${GNUABI_COMPATIBILITY_TEST} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS} MASKED_GNUABI=1) + else(MASKED) + target_compile_definitions(${GNUABI_COMPATIBILITY_TEST} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS}) + endif(MASKED) + if (FORCE_AAVPCS) + target_compile_definitions(${GNUABI_COMPATIBILITY_TEST} PRIVATE ENABLE_AAVPCS=1) + endif(FORCE_AAVPCS) + target_link_libraries(${GNUABI_COMPATIBILITY_TEST} ${TARGET_LIBSLEEFGNUABI} ${LIBM}) + # These are linker tests that don't really need to be executed, + # but seeing them in the report of ctest gives an idea of what + # has been built for testing. + if (EMULATOR) + add_test(NAME ${GNUABI_COMPATIBILITY_TEST} + COMMAND ${EMULATOR} $ + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + elseif(SDE_COMMAND) + add_test(NAME ${GNUABI_COMPATIBILITY_TEST} + COMMAND ${SDE_COMMAND} "--" $) + else() + add_test(NAME ${GNUABI_COMPATIBILITY_TEST} + COMMAND $) + endif(EMULATOR) +endfunction(add_gnuabi_compatibility_test) + +if(ENABLE_GNUABI) + foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + # GNUABI compatibility for the unmasked symbols. + add_gnuabi_compatibility_test(${SIMD} OFF) + # GNUABI compatibility for the masked symbols. + if (MKMASKED_PARAMS_GNUABI_${SIMD}_sp) + add_gnuabi_compatibility_test(${SIMD} ON) + endif(MKMASKED_PARAMS_GNUABI_${SIMD}_sp) + endif (COMPILER_SUPPORTS_${SIMD}) + endforeach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS}) +endif(ENABLE_GNUABI) + +# + +if (SLEEF_ARCH_X86) + # iutdsp128 + add_executable(iutdsp128 ${IUT_SRC}) + target_compile_definitions(iutdsp128 PRIVATE ENABLE_DSP128=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(iutdsp128 PRIVATE ${FLAGS_ENABLE_SSE2}) + target_link_libraries(iutdsp128 ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(iutdsp128 ${TARGET_HEADERS} ${TARGET_LIBSLEEF}) + add_test_iut(iutdsp128 1.0) + list(APPEND IUT_LIST iutdsp128) + + # iutdsp256 + add_executable(iutdsp256 ${IUT_SRC}) + target_compile_definitions(iutdsp256 PRIVATE ENABLE_DSP256=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(iutdsp256 PRIVATE ${FLAGS_ENABLE_AVX}) + target_link_libraries(iutdsp256 ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(iutdsp256 ${TARGET_HEADERS} ${TARGET_LIBSLEEF}) + add_test_iut(iutdsp256 1.0) + list(APPEND IUT_LIST iutdsp256) +endif(SLEEF_ARCH_X86) + +if (SLEEF_ARCH_PPC64) + add_executable(iutdsp128 ${IUT_SRC}) + target_compile_definitions(iutdsp128 PRIVATE ENABLE_DSPPOWER_128=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(iutdsp128 PRIVATE ${FLAGS_ENABLE_VSX}) + target_link_libraries(iutdsp128 ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(iutdsp128 ${TARGET_HEADERS} ${TARGET_LIBSLEEF}) + add_test_iut(iutdsp128 1.0) + list(APPEND IUT_LIST iutdsp128) +endif(SLEEF_ARCH_PPC64) + +if (SLEEF_ARCH_S390X) + add_executable(iutdsp128 ${IUT_SRC}) + target_compile_definitions(iutdsp128 PRIVATE ENABLE_DSPS390X_128=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(iutdsp128 PRIVATE ${FLAGS_ENABLE_VXE}) + target_link_libraries(iutdsp128 ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(iutdsp128 ${TARGET_HEADERS} ${TARGET_LIBSLEEF}) + add_test_iut(iutdsp128 1.0) + list(APPEND IUT_LIST iutdsp128) +endif(SLEEF_ARCH_S390X) + +if(SLEEF_BUILD_SCALAR_LIB) + # Compile executable 'iutscalar' + add_executable(iutscalar iut.c testerutil.c) + target_compile_definitions(iutscalar PRIVATE ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(iutscalar sleefscalar ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + set_target_properties(iutscalar PROPERTIES ${COMMON_TARGET_PROPERTIES}) + add_test_iut(iutscalar 1.0) + list(APPEND IUT_LIST iutscalar) +endif() + +if(LIB_MPFR AND NOT MINGW) + # Build tester2 scalar + set(PRECISIONS dp sp) + if(COMPILER_SUPPORTS_LONG_DOUBLE) + list(APPEND PRECISIONS ld) + endif() + if(COMPILER_SUPPORTS_QUADMATH) + list(APPEND PRECISIONS qp) + set(LIBQUADMATH "-lquadmath") + set(ENABLEFLOAT128 PRIVATE ENABLEFLOAT128=1) + endif() + foreach(P ${PRECISIONS}) + set(T "tester2${P}") + add_executable(${T} tester2${P}.c testerutil.c) + target_compile_definitions(${T} PRIVATE USEMPFR=1 ${ENABLEFLOAT128} ${COMMON_TARGET_DEFINITIONS}) + set_target_properties(${T} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + if (FORCE_AAVPCS) + target_compile_definitions(${T} PRIVATE ENABLE_AAVPCS=1) + endif(FORCE_AAVPCS) + if (MPFR_INCLUDE_DIR) + target_include_directories(${T} PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + target_link_libraries(${T} ${TARGET_LIBSLEEF} ${LIBQUADMATH} ${LIB_MPFR} ${LIBM} ${LIBGMP}) + add_dependencies(${T} ${TARGET_HEADERS}) + add_dependencies(${T} ${TARGET_LIBSLEEF}) + endforeach() + + # Compile executable 'tester' + add_host_executable(${TARGET_TESTER} tester.c testerutil.c) + if (NOT CMAKE_CROSSCOMPILING) + target_link_libraries(${TARGET_TESTER} ${LIB_MPFR} ${TARGET_LIBSLEEF} ${LIBM} ${LIBGMP}) + target_compile_definitions(${TARGET_TESTER} + PRIVATE USEMPFR=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(${TARGET_TESTER} PRIVATE -Wno-unused-result) + set_target_properties(${TARGET_TESTER} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + if (MPFR_INCLUDE_DIR) + target_include_directories(${TARGET_TESTER} PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + endif() +endif(LIB_MPFR AND NOT MINGW) + +if(ENABLE_GNUABI AND COMPILER_SUPPORTS_OMP_SIMD AND NOT SLEEF_TARGET_PROCESSOR MATCHES "^i.86$") + # Build tester for vectorabi + add_executable(testervecabi testervecabi.c) + target_compile_definitions(testervecabi PRIVATE ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(testervecabi PRIVATE ${OpenMP_C_FLAGS}) + target_link_libraries(testervecabi ${TARGET_LIBSLEEF} ${OpenMP_C_FLAGS}) + set_target_properties(testervecabi PROPERTIES C_STANDARD 99) + add_test(NAME testervecabi COMMAND ${EMULATOR} testervecabi + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +endif() + +# mveclibtest + +if (ENABLE_GNUABI AND SLEEF_ARCH_X86 AND CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.99) + add_executable(mveclibtest-sse2 mveclibtest.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c) + set_target_properties(mveclibtest-sse2 PROPERTIES C_STANDARD 99) + target_compile_options(mveclibtest-sse2 PRIVATE ${FLAGS_FASTMATH} "-O3") + target_link_libraries(mveclibtest-sse2 ${TARGET_LIBSLEEF} ${TARGET_LIBSLEEFGNUABI}) + add_dependencies(mveclibtest-sse2 ${TARGET_HEADERS}) + add_test(NAME mveclibtest-sse2 COMMAND mveclibtest-sse2) + + add_executable(mveclibtest-avx mveclibtest.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c) + set_target_properties(mveclibtest-avx PROPERTIES C_STANDARD 99) + target_compile_options(mveclibtest-avx PRIVATE ${FLAGS_FASTMATH} ${FLAGS_ENABLE_AVX} "-O3") + target_link_libraries(mveclibtest-avx ${TARGET_LIBSLEEF} ${TARGET_LIBSLEEFGNUABI}) + add_dependencies(mveclibtest-avx ${TARGET_HEADERS}) + add_test(NAME mveclibtest-avx COMMAND mveclibtest-avx) + + add_executable(mveclibtest-avx2 mveclibtest.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c) + set_target_properties(mveclibtest-avx2 PROPERTIES C_STANDARD 99) + target_compile_options(mveclibtest-avx2 PRIVATE ${FLAGS_FASTMATH} ${FLAGS_ENABLE_AVX2} "-O3") + target_link_libraries(mveclibtest-avx2 ${TARGET_LIBSLEEF} ${TARGET_LIBSLEEFGNUABI}) + add_dependencies(mveclibtest-avx2 ${TARGET_HEADERS}) + add_test(NAME mveclibtest-avx2 COMMAND mveclibtest-avx2) + + add_executable(mveclibtest-avx512f mveclibtest.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c) + set_target_properties(mveclibtest-avx512f PROPERTIES C_STANDARD 99) + target_compile_options(mveclibtest-avx512f PRIVATE ${FLAGS_FASTMATH} ${FLAGS_ENABLE_AVX512F} "-O3") + target_link_libraries(mveclibtest-avx512f ${TARGET_LIBSLEEF} ${TARGET_LIBSLEEFGNUABI}) + add_dependencies(mveclibtest-avx512f ${TARGET_HEADERS}) + add_test(NAME mveclibtest-avx512f COMMAND mveclibtest-avx512f) +endif() + +# + +if (FILECHECK_COMMAND AND COMPILER_SUPPORTS_OPENMP AND SLEEF_ARCH_X86 AND CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.99) + add_test(NAME autovec-avx2 COMMAND sh -c "${CMAKE_C_COMPILER} -Wno-attributes -fopenmp -mavx2 -O3 ${CMAKE_CURRENT_SOURCE_DIR}/autovec.c -I${sleef_BINARY_DIR}/include -S -o- | ${FILECHECK_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/autovec.c -check-prefix=CHECK-AVX2") + add_test(NAME autovec-sse2 COMMAND sh -c "${CMAKE_C_COMPILER} -Wno-attributes -fopenmp -msse2 -O3 ${CMAKE_CURRENT_SOURCE_DIR}/autovec.c -I${sleef_BINARY_DIR}/include -S -o- | ${FILECHECK_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/autovec.c -check-prefix=CHECK-SSE2") + add_test(NAME testervecabi-sse2 COMMAND sh -c "${CMAKE_C_COMPILER} -Wno-attributes -fopenmp -msse2 -O3 ${CMAKE_CURRENT_SOURCE_DIR}/testervecabi.c -I${sleef_BINARY_DIR}/include -S -o- | ${FILECHECK_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/testervecabi.c -check-prefix=CHECK-SSE2") + add_test(NAME testervecabi-avx2 COMMAND sh -c "${CMAKE_C_COMPILER} -Wno-attributes -fopenmp -mavx2 -O3 ${CMAKE_CURRENT_SOURCE_DIR}/testervecabi.c -I${sleef_BINARY_DIR}/include -S -o- | ${FILECHECK_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/testervecabi.c -check-prefix=CHECK-AVX2") +endif() + +# Tests depends on the library +add_dependencies(${TARGET_IUT} ${TARGET_HEADERS}) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/autovec.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/autovec.c new file mode 100644 index 0000000000000..41a0d0f2a776f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/autovec.c @@ -0,0 +1,651 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define SLEEF_ENABLE_OMP_SIMD +#include "sleef.h" + +#define N 1024 +double a[N], b[N], c[N], d[N]; +float e[N], f[N], g[N], h[N]; + +void testsind1_u10() { +// CHECK-SSE2: testsind1_u10 +// CHECK-AVX2: testsind1_u10 + for(int i=0;i` are present in +/// `libsleefgnuabi.so`. +/// +/// The header `math.h` is not the same on all systems, and different +/// macros can activate different sets of functions. The list provide +/// here shoudl cover the union of all possible systems that we want +/// to support. In particular, the test is checking that the "finite" +/// symmbols from `#include ` are present for +/// those systems supporting them. + +#include +#include +#include + +#if defined(ENABLE_SSE4) || defined(ENABLE_SSE2) +#include + +#define ISA_TOKEN b +#define VLEN_SP 4 +#define VLEN_DP 2 +#define VECTOR_CC + +typedef __m128i vopmask; +typedef __m128d vdouble; +typedef __m128 vfloat; +typedef __m128i vint; +typedef __m128i vint2; +#endif /* defined(ENABLE_SSE4) || defined(ENABLE_SSE2) */ + +#ifdef ENABLE_AVX +#include + +#define ISA_TOKEN c +#define VLEN_SP 8 +#define VLEN_DP 4 +#define VECTOR_CC + +typedef __m256i vopmask; +typedef __m256d vdouble; +typedef __m256 vfloat; +typedef __m128i vint; +typedef struct { __m128i x, y; } vint2; +#endif /* ENABLE_AVX */ + +#ifdef ENABLE_AVX2 +#include + +#define ISA_TOKEN d +#define VLEN_SP 8 +#define VLEN_DP 4 +#define VECTOR_CC + +typedef __m256i vopmask; +typedef __m256d vdouble; +typedef __m256 vfloat; +typedef __m128i vint; +typedef __m256i vint2; +#endif /* ENABLE_AVX2 */ + +#ifdef ENABLE_AVX512F +#include + +#define ISA_TOKEN e +#define VLEN_SP 16 +#define VLEN_DP 8 +#define VECTOR_CC + +typedef __mmask16 vopmask; +typedef __m512d vdouble; +typedef __m512 vfloat; +typedef __m256i vint; +typedef __m512i vint2; +#endif /* ENABLE_AVX512F */ + +#ifdef ENABLE_ADVSIMD +#include +#define ISA_TOKEN n +#define VLEN_DP 2 +#define VLEN_SP 4 + +#ifdef ENABLE_AAVPCS +#define VECTOR_CC __attribute__((aarch64_vector_pcs)) +#else +#define VECTOR_CC +#endif + +typedef uint32x4_t vopmask; +typedef float64x2_t vdouble; +typedef float32x4_t vfloat; +typedef int32x2_t vint; +typedef int32x4_t vint2; +#endif /* ENABLE_ADVSIMDF */ + +#ifdef ENABLE_SVE +#include +#define ISA_TOKEN s +#define VLEN_SP (svcntw()) +#define VLEN_DP (svcntd()) +#define VLA_TOKEN x +#define VECTOR_CC + +typedef svbool_t vopmask; +typedef svfloat64_t vdouble; +typedef svfloat32_t vfloat; +typedef svint32_t vint; +typedef svint32_t vint2; +#endif /* ENABLE_SVE */ + +// GNUABI name mangling macro. +#ifndef MASKED_GNUABI + +#define __MAKE_FN_NAME(name, t, vl, p) _ZGV##t##N##vl##p##_##name + +#define __DECLARE_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble) +#define __CALL_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1); } while(0) + +#define __DECLARE_vi_vd(name, t, vl, p) \ + extern vint VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble) +#define __CALL_vi_vd(name, t, vl, p) \ + do { vi0 = __MAKE_FN_NAME(name, t, vl, p)(vd1); } while(0) + +#define __DECLARE_vd_vd_vi(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vint) +#define __CALL_vd_vd_vi(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vi2); } while(0) + +#define __DECLARE_vd_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble) +#define __CALL_vd_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vd2); } while(0) + +#define __DECLARE_vd_vd_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble, vdouble) +#define __CALL_vd_vd_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vd2, vd3); } while(0) + +#define __DECLARE_vd_vd_pvd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble *) +#define __CALL_vd_vd_pvd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, &vd2); } while(0) + +#define __DECLARE_v_vd_pvd_pvd(name, t, vl, p) \ + extern void VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble *, vdouble *) +#define __CALL_v_vd_pvd_pvd(name, t, vl, p) \ + do { __MAKE_FN_NAME(name, t, vl, p)(vd0, &vd1, &vd2); } while(0) + +#define __DECLARE_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat) +#define __CALL_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1); } while(0) + +#define __DECLARE_vf_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat) +#define __CALL_vf_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vf2); } while(0) + +#define __DECLARE_vf_vf_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat, vfloat) +#define __CALL_vf_vf_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vf2, vf3); } while(0) + +#define __DECLARE_vf_vf_pvf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat *) +#define __CALL_vf_vf_pvf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, &vf2); } while(0) + +#define __DECLARE_vi_vf(name, t, vl, p) \ + extern vint2 VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat) +#define __CALL_vi_vf(name, t, vl, p) \ + do { vi20 = __MAKE_FN_NAME(name, t, vl, p)(vf1); } while(0) + +#define __DECLARE_vf_vf_vi(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vint2) +#define __CALL_vf_vf_vi(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vi22); } while(0) + +#define __DECLARE_v_vf_pvf_pvf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat *, vfloat*) +#define __CALL_v_vf_pvf_pvf(name, t, vl, p) \ + do { __MAKE_FN_NAME(name, t, vl, p)(vf0, &vf1, &vf2); } while(0) + +#else /******************** MASKED_GNUABI *****************************/ + +#define __MAKE_FN_NAME(name, t, vl, p) _ZGV##t##M##vl##p##_##name + +#define __DECLARE_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vopmask) +#define __CALL_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, mask); } while(0) + +#define __DECLARE_vi_vd(name, t, vl, p) \ + extern vint VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vopmask) +#define __CALL_vi_vd(name, t, vl, p) \ + do { vi0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, mask); } while(0) + +#define __DECLARE_vd_vd_vi(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vint, vopmask) +#define __CALL_vd_vd_vi(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vi2, mask); } while(0) + +#define __DECLARE_vd_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble, vopmask) +#define __CALL_vd_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vd2, mask); } while(0) + +#define __DECLARE_vd_vd_vd_vd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble, vdouble, vopmask) +#define __CALL_vd_vd_vd_vd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, vd2, vd3, mask); } while(0) + +#define __DECLARE_vd_vd_pvd(name, t, vl, p) \ + extern vdouble VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble *, vopmask) +#define __CALL_vd_vd_pvd(name, t, vl, p) \ + do { vd0 = __MAKE_FN_NAME(name, t, vl, p)(vd1, &vd2, mask); } while(0) + +#define __DECLARE_v_vd_pvd_pvd(name, t, vl, p) \ + extern void VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vdouble, vdouble *, vdouble *, vopmask) +#define __CALL_v_vd_pvd_pvd(name, t, vl, p) \ + do { __MAKE_FN_NAME(name, t, vl, p)(vd0, &vd1, &vd2, mask); } while(0) + +#define __DECLARE_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vopmask) +#define __CALL_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, mask); } while(0) + +#define __DECLARE_vf_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat, vopmask) +#define __CALL_vf_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vf2, mask); } while(0) + +#define __DECLARE_vf_vf_vf_vf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat, vfloat, vopmask) +#define __CALL_vf_vf_vf_vf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vf2, vf3, mask); } while(0) + +#define __DECLARE_vf_vf_pvf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat *, vopmask) +#define __CALL_vf_vf_pvf(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, &vf2, mask); } while(0) + +#define __DECLARE_vi_vf(name, t, vl, p) \ + extern vint2 VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vopmask) +#define __CALL_vi_vf(name, t, vl, p) \ + do { vi20 = __MAKE_FN_NAME(name, t, vl, p)(vf1, mask); } while(0) + +#define __DECLARE_vf_vf_vi(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vint2, vopmask) +#define __CALL_vf_vf_vi(name, t, vl, p) \ + do { vf0 = __MAKE_FN_NAME(name, t, vl, p)(vf1, vi22, mask); } while(0) + +#define __DECLARE_v_vf_pvf_pvf(name, t, vl, p) \ + extern vfloat VECTOR_CC __MAKE_FN_NAME(name, t, vl, p)(vfloat, vfloat *, vfloat*, vopmask) +#define __CALL_v_vf_pvf_pvf(name, t, vl, p) \ + do { __MAKE_FN_NAME(name, t, vl, p)(vf0, &vf1, &vf2, mask); } while(0) + +#endif /* MASKED_GNUABI */ +// Level-1 expansion macros for declaration and call. The signature of +// each function has three input paramters to avoid segfaults of +// sincos-like functions that are effectively loading data from +// memory. + + +// Make sure that the architectural macros are defined for each vector +// extension. +#ifndef ISA_TOKEN +#error "Missing ISA token" +#endif + +#ifndef VLEN_DP +#error "Missing VLEN_DP" +#endif + +#ifndef VLEN_DP +#error "Missing VLEN_SP" +#endif + +#if defined(ENABLE_SVE) && !defined(VLA_TOKEN) +#error "Missing VLA_TOKEN" +#endif /* defined(ENABLE_SVE) && !defined(VLA_TOKEN) */ + +// Declaration and call, first level expantion to pick up the +// ISA_TOKEN and VLEN_* architectural macros. +#ifndef ENABLE_SVE + +#define DECLARE_DP_vd_vd(name, p) __DECLARE_vd_vd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vd_vd(name, p) __CALL_vd_vd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_vd_vd_vd(name, p) __DECLARE_vd_vd_vd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vd_vd_vd(name, p) __CALL_vd_vd_vd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_vd_vd_vd_vd(name, p) __DECLARE_vd_vd_vd_vd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vd_vd_vd_vd(name, p) __CALL_vd_vd_vd_vd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_vd_vd_pvd(name, p) __DECLARE_vd_vd_pvd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vd_vd_pvd(name, p) __CALL_vd_vd_pvd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_vi_vd(name, p) __DECLARE_vi_vd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vi_vd(name, p) __CALL_vi_vd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_vd_vd_vi(name, p) __DECLARE_vd_vd_vi(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_vd_vd_vi(name, p) __CALL_vd_vd_vi(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_DP_v_vd_pvd_pvd(name, p) __DECLARE_v_vd_pvd_pvd(name, ISA_TOKEN, VLEN_DP, p) +#define CALL_DP_v_vd_pvd_pvd(name, p) __CALL_v_vd_pvd_pvd(name, ISA_TOKEN, VLEN_DP, p) + +#define DECLARE_SP_vf_vf(name, p) __DECLARE_vf_vf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vf_vf(name, p) __CALL_vf_vf(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_vf_vf_vf(name, p) __DECLARE_vf_vf_vf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vf_vf_vf(name, p) __CALL_vf_vf_vf(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_vf_vf_vf_vf(name, p) __DECLARE_vf_vf_vf_vf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vf_vf_vf_vf(name, p) __CALL_vf_vf_vf_vf(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_vf_vf_pvf(name, p) __DECLARE_vf_vf_pvf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vf_vf_pvf(name, p) __CALL_vf_vf_pvf(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_vi_vf(name, p) __DECLARE_vi_vf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vi_vf(name, p) __CALL_vi_vf(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_vf_vf_vi(name, p) __DECLARE_vf_vf_vi(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_vf_vf_vi(name, p) __CALL_vf_vf_vi(name, ISA_TOKEN, VLEN_SP, p) + +#define DECLARE_SP_v_vf_pvf_pvf(name, p) __DECLARE_v_vf_pvf_pvf(name, ISA_TOKEN, VLEN_SP, p) +#define CALL_SP_v_vf_pvf_pvf(name, p) __CALL_v_vf_pvf_pvf(name, ISA_TOKEN, VLEN_SP, p) + +#else /* ENABLE_SVE */ + +#define DECLARE_DP_vd_vd(name, p) __DECLARE_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vd_vd(name, p) __CALL_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd0) + +#define DECLARE_DP_vd_vd_vd(name, p) __DECLARE_vd_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vd_vd_vd(name, p) __CALL_vd_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd0) + +#define DECLARE_DP_vd_vd_vd_vd(name, p) __DECLARE_vd_vd_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vd_vd_vd_vd(name, p) __CALL_vd_vd_vd_vd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd0) + +#define DECLARE_DP_vd_vd_pvd(name, p) __DECLARE_vd_vd_pvd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vd_vd_pvd(name, p) __CALL_vd_vd_pvd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd2) + +#define DECLARE_DP_vi_vd(name, p) __DECLARE_vi_vd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vi_vd(name, p) __CALL_vi_vd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_s32(svptrue_b8(), (int *)outbuf, vi0) + +#define DECLARE_DP_vd_vd_vi(name, p) __DECLARE_vd_vd_vi(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_vd_vd_vi(name, p) __CALL_vd_vd_vi(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd0) + +#define DECLARE_DP_v_vd_pvd_pvd(name, p) __DECLARE_v_vd_pvd_pvd(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_DP_v_vd_pvd_pvd(name, p) __CALL_v_vd_pvd_pvd(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f64(svptrue_b8(), (double *)outbuf, vd2) + +#define DECLARE_SP_vf_vf(name, p) __DECLARE_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vf_vf(name, p) __CALL_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf0) + +#define DECLARE_SP_vf_vf_vf(name, p) __DECLARE_vf_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vf_vf_vf(name, p) __CALL_vf_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf0) + +#define DECLARE_SP_vf_vf_vf_vf(name, p) __DECLARE_vf_vf_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vf_vf_vf_vf(name, p) __CALL_vf_vf_vf_vf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf0) + +#define DECLARE_SP_vf_vf_pvf(name, p) __DECLARE_vf_vf_pvf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vf_vf_pvf(name, p) __CALL_vf_vf_pvf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf2) + +#define DECLARE_SP_vi_vf(name, p) __DECLARE_vi_vf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vi_vf(name, p) __CALL_vi_vf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_s32(svptrue_b8(), (int *)outbuf, vi20) + +#define DECLARE_SP_vf_vf_vi(name, p) __DECLARE_vf_vf_vi(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_vf_vf_vi(name, p) __CALL_vf_vf_vi(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf0) + +#define DECLARE_SP_v_vf_pvf_pvf(name, p) __DECLARE_v_vf_pvf_pvf(name, ISA_TOKEN, VLA_TOKEN, p) +#define CALL_SP_v_vf_pvf_pvf(name, p) __CALL_v_vf_pvf_pvf(name, ISA_TOKEN, VLA_TOKEN, p); svst1_f32(svptrue_b8(), (float *)outbuf, vf2) + +#endif /* ENABLE_SVE */ + +// + +// Douple precision function declarations. +DECLARE_DP_vd_vd(__acos_finite, v); +DECLARE_DP_vd_vd(__acosh_finite, v); +DECLARE_DP_vd_vd(__asin_finite, v); +DECLARE_DP_vd_vd_vd(__atan2_finite, vv); +DECLARE_DP_vd_vd(__atanh_finite, v); +DECLARE_DP_vd_vd(__cosh_finite, v); +DECLARE_DP_vd_vd(__exp10_finite, v); +DECLARE_DP_vd_vd(__exp2_finite, v); +DECLARE_DP_vd_vd(__exp_finite, v); +DECLARE_DP_vd_vd_vd(__fmod_finite, vv); +DECLARE_DP_vd_vd_pvd(__modf_finite, vl8); +DECLARE_DP_vd_vd_vd(__hypot_finite, vv); +DECLARE_DP_vd_vd(__log10_finite, v); +// DECLARE_DP_vd_vd(__log2_finite,v); +DECLARE_DP_vd_vd(__log_finite, v); +DECLARE_DP_vd_vd_vd(__pow_finite, vv); +DECLARE_DP_vd_vd(__sinh_finite, v); +DECLARE_DP_vd_vd(__sqrt_finite, v); +DECLARE_DP_vd_vd(acos, v); +DECLARE_DP_vd_vd(acosh, v); +DECLARE_DP_vd_vd(asin, v); +DECLARE_DP_vd_vd(asinh, v); +DECLARE_DP_vd_vd(atan, v); +DECLARE_DP_vd_vd_vd(atan2, vv); +DECLARE_DP_vd_vd_vd(__atan2_finite, vv); +DECLARE_DP_vd_vd(atanh, v); +DECLARE_DP_vd_vd(cbrt, v); +DECLARE_DP_vd_vd(ceil, v); +DECLARE_DP_vd_vd_vd(copysign, vv); +DECLARE_DP_vd_vd(cos, v); +DECLARE_DP_vd_vd(cosh, v); +DECLARE_DP_vd_vd(cospi, v); +DECLARE_DP_vd_vd(erf, v); +DECLARE_DP_vd_vd(erfc, v); +DECLARE_DP_vd_vd(exp, v); +DECLARE_DP_vd_vd(exp10, v); +DECLARE_DP_vd_vd(exp2, v); +DECLARE_DP_vi_vd(expfrexp, v); +DECLARE_DP_vd_vd(expm1, v); +DECLARE_DP_vd_vd(fabs, v); +DECLARE_DP_vd_vd_vd(fdim, vv); +DECLARE_DP_vd_vd(floor, v); +DECLARE_DP_vd_vd_vd_vd(fma, vvv); +DECLARE_DP_vd_vd_vd(fmax, vv); +DECLARE_DP_vd_vd_vd(fmin, vv); +DECLARE_DP_vd_vd_vd(fmod, vv); +DECLARE_DP_vd_vd(frfrexp, v); +DECLARE_DP_vd_vd_vd(hypot, vv); +DECLARE_DP_vi_vd(ilogb, v); +DECLARE_DP_vd_vd_vi(ldexp, vv); +DECLARE_DP_vd_vd(lgamma, v); +DECLARE_DP_vd_vd(log, v); +DECLARE_DP_vd_vd(log10, v); +DECLARE_DP_vd_vd(log1p, v); +DECLARE_DP_vd_vd(log2, v); +DECLARE_DP_vd_vd_pvd(modf, vl8); +DECLARE_DP_vd_vd_vd(nextafter, vv); +DECLARE_DP_vd_vd_vd(pow, vv); +DECLARE_DP_vd_vd(rint, v); +DECLARE_DP_vd_vd(round, v); +DECLARE_DP_vd_vd(sin, v); +DECLARE_DP_v_vd_pvd_pvd(sincos, vl8l8); +DECLARE_DP_v_vd_pvd_pvd(sincospi, vl8l8); +DECLARE_DP_vd_vd(sinh, v); +DECLARE_DP_vd_vd(sinpi, v); +DECLARE_DP_vd_vd(sqrt, v); +DECLARE_DP_vd_vd(tan, v); +DECLARE_DP_vd_vd(tanh, v); +DECLARE_DP_vd_vd(tgamma, v); +DECLARE_DP_vd_vd(trunc, v); + +// Single precision function declarations. +DECLARE_SP_vf_vf(__acosf_finite, v); +DECLARE_SP_vf_vf(__acoshf_finite, v); +DECLARE_SP_vf_vf(__asinf_finite, v); +DECLARE_SP_vf_vf_vf(__atan2f_finite, vv); +DECLARE_SP_vf_vf(__atanhf_finite, v); +DECLARE_SP_vf_vf(__coshf_finite, v); +DECLARE_SP_vf_vf(__exp10f_finite, v); +DECLARE_SP_vf_vf(__exp2f_finite, v); +DECLARE_SP_vf_vf(__expf_finite, v); +DECLARE_SP_vf_vf_vf(__fmodf_finite, vv); +DECLARE_SP_vf_vf_pvf(__modff_finite, vl4); +DECLARE_SP_vf_vf_vf(__hypotf_finite, vv); +DECLARE_SP_vf_vf(__log10f_finite, v); +// DECLARE_SP_vf_vf(__log2f_finite,v); +DECLARE_SP_vf_vf(__logf_finite, v); +DECLARE_SP_vf_vf_vf(__powf_finite, vv); +DECLARE_SP_vf_vf(__sinhf_finite, v); +DECLARE_SP_vf_vf(__sqrtf_finite, v); +DECLARE_SP_vf_vf(acosf, v); +DECLARE_SP_vf_vf(acoshf, v); +DECLARE_SP_vf_vf(asinf, v); +DECLARE_SP_vf_vf(asinhf, v); +DECLARE_SP_vf_vf(atanf, v); +DECLARE_SP_vf_vf_vf(atan2f, vv); +DECLARE_SP_vf_vf(atanhf, v); +DECLARE_SP_vf_vf(cbrtf, v); +DECLARE_SP_vf_vf(ceilf, v); +DECLARE_SP_vf_vf_vf(copysignf, vv); +DECLARE_SP_vf_vf(cosf, v); +DECLARE_SP_vf_vf(coshf, v); +DECLARE_SP_vf_vf(cospif, v); +DECLARE_SP_vf_vf(erff, v); +DECLARE_SP_vf_vf(erfcf, v); +DECLARE_SP_vf_vf(expf, v); +DECLARE_SP_vf_vf(exp10f, v); +DECLARE_SP_vf_vf(exp2f, v); +DECLARE_SP_vf_vf(expm1f, v); +DECLARE_SP_vf_vf(fabsf, v); +DECLARE_SP_vf_vf_vf(fdimf, vv); +DECLARE_SP_vf_vf(floorf, v); +DECLARE_SP_vf_vf_vf_vf(fmaf, vvv); +DECLARE_SP_vf_vf_vf(fmaxf, vv); +DECLARE_SP_vf_vf_vf(fminf, vv); +DECLARE_SP_vf_vf_vf(fmodf, vv); +DECLARE_SP_vf_vf(frfrexpf, v); +DECLARE_SP_vf_vf_vf(hypotf, vv); +#ifndef ENABLE_AVX +// These two functions are not checked in some configurations due to +// the issue in https://github.com/shibatch/sleef/issues/221 +DECLARE_SP_vi_vf(expfrexpf, v); +DECLARE_SP_vi_vf(ilogbf, v); +#endif +DECLARE_SP_vf_vf_vi(ldexpf, vv); +DECLARE_SP_vf_vf(lgammaf, v); +DECLARE_SP_vf_vf(logf, v); +DECLARE_SP_vf_vf(log10f, v); +DECLARE_SP_vf_vf(log1pf, v); +DECLARE_SP_vf_vf(log2f, v); +DECLARE_SP_vf_vf_pvf(modff, vl4); +DECLARE_SP_vf_vf_vf(nextafterf, vv); +DECLARE_SP_vf_vf_vf(powf, vv); +DECLARE_SP_vf_vf(rintf, v); +DECLARE_SP_vf_vf(roundf, v); +DECLARE_SP_vf_vf(sinf, v); +DECLARE_SP_v_vf_pvf_pvf(sincosf, vl4l4); +DECLARE_SP_v_vf_pvf_pvf(sincospif, vl4l4); +DECLARE_SP_vf_vf(sinhf, v); +DECLARE_SP_vf_vf(sinpif, v); +DECLARE_SP_vf_vf(sqrtf, v); +DECLARE_SP_vf_vf(tanf, v); +DECLARE_SP_vf_vf(tanhf, v); +DECLARE_SP_vf_vf(tgammaf, v); +DECLARE_SP_vf_vf(truncf, v); + +#ifndef ENABLE_SVE +vdouble vd0, vd1, vd2, vd3; +vfloat vf0, vf1, vf2, vf3; +vint vi0, vi1, vi2, vi3; +vint2 vi20, vi21, vi22, vi23; +vopmask mask; +#else +volatile char outbuf[1024]; +#endif + +int check_feature(double d, float f) { +#ifdef ENABLE_SVE + vdouble vd0 = svdup_n_f64(d), vd1 = svdup_n_f64(d); +#ifdef MASKED_GNUABI + vopmask mask = svcmpne_s32(svptrue_b8(), svdup_n_s32(f), svdup_n_s32(0)); +#endif +#endif + + CALL_DP_vd_vd(__acos_finite, v); +#ifdef ENABLE_SVE + svst1_f64(svptrue_b8(), (double *)outbuf, vd0); +#endif + return 1; +} + +int main2(int argc, char **argv) { +#ifdef ENABLE_SVE + vdouble vd0 = svdup_n_f64(argc), vd1 = svdup_n_f64(argc), vd2 = svdup_n_f64(argc), vd3 = svdup_n_f64(argc); + vfloat vf0 = svdup_n_f32(argc), vf1 = svdup_n_f32(argc), vf2 = svdup_n_f32(argc), vf3 = svdup_n_f32(argc); + vint vi0 = svdup_n_s32(argc), vi2 = svdup_n_s32(argc); + vint2 vi20 = svdup_n_s32(argc), vi22 = svdup_n_s32(argc); +#ifdef MASKED_GNUABI + vopmask mask = svcmpne_s32(svptrue_b8(), svdup_n_s32(argc), svdup_n_s32(0)); +#endif +#endif + + // Double precision function call. + CALL_DP_vd_vd(__acos_finite, v); + CALL_DP_vd_vd(__acosh_finite, v); + CALL_DP_vd_vd(__asin_finite, v); + CALL_DP_vd_vd_vd(__atan2_finite, vv); + CALL_DP_vd_vd(__atanh_finite, v); + CALL_DP_vd_vd(__cosh_finite, v); + CALL_DP_vd_vd(__exp10_finite, v); + CALL_DP_vd_vd(__exp2_finite, v); + CALL_DP_vd_vd(__exp_finite, v); + CALL_DP_vd_vd_vd(__fmod_finite, vv); + CALL_DP_vd_vd_pvd(__modf_finite, vl8); + CALL_DP_vd_vd_vd(__hypot_finite, vv); + CALL_DP_vd_vd(__log10_finite, v); + // CALL_DP_vd_vd(__log2_finite,v); + CALL_DP_vd_vd(__log_finite, v); + CALL_DP_vd_vd_vd(__pow_finite, vv); + CALL_DP_vd_vd(__sinh_finite, v); + CALL_DP_vd_vd(__sqrt_finite, v); + CALL_DP_vd_vd(acos, v); + CALL_DP_vd_vd(acosh, v); + CALL_DP_vd_vd(asin, v); + CALL_DP_vd_vd(asinh, v); + CALL_DP_vd_vd(atan, v); + CALL_DP_vd_vd_vd(atan2, vv); + CALL_DP_vd_vd(atanh, v); + CALL_DP_vd_vd(cbrt, v); + CALL_DP_vd_vd(ceil, v); + CALL_DP_vd_vd_vd(copysign, vv); + CALL_DP_vd_vd(cos, v); + CALL_DP_vd_vd(cosh, v); + CALL_DP_vd_vd(cospi, v); + CALL_DP_vd_vd(erf, v); + CALL_DP_vd_vd(erfc, v); + CALL_DP_vd_vd(exp, v); + CALL_DP_vd_vd(exp10, v); + CALL_DP_vd_vd(exp2, v); + CALL_DP_vi_vd(expfrexp, v); + CALL_DP_vd_vd(expm1, v); + CALL_DP_vd_vd(fabs, v); + CALL_DP_vd_vd_vd(fdim, vv); + CALL_DP_vd_vd(floor, v); + CALL_DP_vd_vd_vd_vd(fma, vvv); + CALL_DP_vd_vd_vd(fmax, vv); + CALL_DP_vd_vd_vd(fmin, vv); + CALL_DP_vd_vd_vd(fmod, vv); + CALL_DP_vd_vd(frfrexp, v); + CALL_DP_vd_vd_vd(hypot, vv); + CALL_DP_vi_vd(ilogb, v); + CALL_DP_vd_vd_vi(ldexp, vv); + CALL_DP_vd_vd(lgamma, v); + CALL_DP_vd_vd(log, v); + CALL_DP_vd_vd(log10, v); + CALL_DP_vd_vd(log1p, v); + CALL_DP_vd_vd(log2, v); + CALL_DP_vd_vd_pvd(modf, vl8); + CALL_DP_vd_vd_vd(nextafter, vv); + CALL_DP_vd_vd_vd(pow, vv); + CALL_DP_vd_vd(rint, v); + CALL_DP_vd_vd(round, v); + CALL_DP_vd_vd(sin, v); + CALL_DP_v_vd_pvd_pvd(sincos, vl8l8); + CALL_DP_v_vd_pvd_pvd(sincospi, vl8l8); + CALL_DP_vd_vd(sinh, v); + CALL_DP_vd_vd(sinpi, v); + CALL_DP_vd_vd(sqrt, v); + CALL_DP_vd_vd(tan, v); + CALL_DP_vd_vd(tanh, v); + CALL_DP_vd_vd(tgamma, v); + CALL_DP_vd_vd(trunc, v); + + // Single precision function call. + CALL_SP_vf_vf(__acosf_finite, v); + CALL_SP_vf_vf(__acoshf_finite, v); + CALL_SP_vf_vf(__asinf_finite, v); + CALL_SP_vf_vf_vf(__atan2f_finite, vv); + CALL_SP_vf_vf(__atanhf_finite, v); + CALL_SP_vf_vf(__coshf_finite, v); + CALL_SP_vf_vf(__exp10f_finite, v); + CALL_SP_vf_vf(__exp2f_finite, v); + CALL_SP_vf_vf(__expf_finite, v); + CALL_SP_vf_vf_vf(__fmodf_finite, vv); + CALL_SP_vf_vf_pvf(__modff_finite, vl4); + CALL_SP_vf_vf_vf(__hypotf_finite, vv); + CALL_SP_vf_vf(__log10f_finite, v); + // CALL_SP_vf_vf(__log2f_finite,v); + CALL_SP_vf_vf(__logf_finite, v); + CALL_SP_vf_vf_vf(__powf_finite, vv); + CALL_SP_vf_vf(__sinhf_finite, v); + CALL_SP_vf_vf(__sqrtf_finite, v); + CALL_SP_vf_vf(acosf, v); + CALL_SP_vf_vf(acoshf, v); + CALL_SP_vf_vf(asinf, v); + CALL_SP_vf_vf(asinhf, v); + CALL_SP_vf_vf(atanf, v); + CALL_SP_vf_vf_vf(atan2f, vv); + CALL_SP_vf_vf(atanhf, v); + CALL_SP_vf_vf(cbrtf, v); + CALL_SP_vf_vf(ceilf, v); + CALL_SP_vf_vf_vf(copysignf, vv); + CALL_SP_vf_vf(cosf, v); + CALL_SP_vf_vf(coshf, v); + CALL_SP_vf_vf(cospif, v); + CALL_SP_vf_vf(erff, v); + CALL_SP_vf_vf(erfcf, v); + CALL_SP_vf_vf(expf, v); + CALL_SP_vf_vf(exp10f, v); + CALL_SP_vf_vf(exp2f, v); + CALL_SP_vf_vf(expm1f, v); + CALL_SP_vf_vf(fabsf, v); + CALL_SP_vf_vf_vf(fdimf, vv); + CALL_SP_vf_vf(floorf, v); + CALL_SP_vf_vf_vf_vf(fmaf, vvv); + CALL_SP_vf_vf_vf(fmaxf, vv); + CALL_SP_vf_vf_vf(fminf, vv); + CALL_SP_vf_vf_vf(fmodf, vv); + CALL_SP_vf_vf(frfrexpf, v); + CALL_SP_vf_vf_vf(hypotf, vv); +#ifndef ENABLE_AVX +// These two functions are not checked in some configurations due to +// the issue in https://github.com/shibatch/sleef/issues/221 + CALL_SP_vi_vf(expfrexpf, v); + CALL_SP_vi_vf(ilogbf, v); +#endif + CALL_SP_vf_vf_vi(ldexpf, vv); + CALL_SP_vf_vf(lgammaf, v); + CALL_SP_vf_vf(logf, v); + CALL_SP_vf_vf(log10f, v); + CALL_SP_vf_vf(log1pf, v); + CALL_SP_vf_vf(log2f, v); + CALL_SP_vf_vf_pvf(modff, vl4); + CALL_SP_vf_vf_vf(nextafterf, vv); + CALL_SP_vf_vf_vf(powf, vv); + CALL_SP_vf_vf(rintf, v); + CALL_SP_vf_vf(roundf, v); + CALL_SP_vf_vf(sinf, v); + CALL_SP_v_vf_pvf_pvf(sincosf, vl4l4); + CALL_SP_v_vf_pvf_pvf(sincospif, vl4l4); + CALL_SP_vf_vf(sinhf, v); + CALL_SP_vf_vf(sinpif, v); + CALL_SP_vf_vf(sqrtf, v); + CALL_SP_vf_vf(tanf, v); + CALL_SP_vf_vf(tanhf, v); + CALL_SP_vf_vf(tgammaf, v); + CALL_SP_vf_vf(truncf, v); + + return 0; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_cinz.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_cinz.txt new file mode 100644 index 0000000000000..2a8c1a85c9f34 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_cinz.txt @@ -0,0 +1,129 @@ +sin u35 bc50dfbcbd8ef534541d1babe90860c7 +sin u10 dbc2cf81f292ef50fa0119e222c6c9f9 +cos u35 506e34a809b80ad3603ed46ba2a574b0 +cos u10 a0f69df5937152b8f8f0e671f3676289 +tan u35 970b5cd7f0e05defa22ebb155ab61a40 +tan u10 5fd08e0552e3ab853439bf5fd2bd344d +sincos u10 7c164edcaa45988f6165b653fc76c495 +sincos u35 38fe7e261e184ed8dbf432ce6bedc5c4 +sincospi u05 0c6fc00c7aaf0b6e67d66542d1be833d +sincospi u35 c428b0fc3e6c5be4d2c03dcd8bb27a7c +log u10 4855b27222d900bea47a27cadba71727 +log u35 c95484de57c167da3d8d6d1baadf9ffa +log2 u10 2662df9af919680ca62e1752fb1b7539 +log2 u35 1cd6d7f194a5e8364191497adc5c5cec +log10 u10 36645e8031d873d66fd0ec2c5959f273 +log1p u10 1383924fb56cf2e7eda27de21320c591 +exp u10 13692a48edf2cf7a3e047b16ddfb7b81 +exp2 u10 436146f8d6dcaa4a754837108a9aa3e1 +exp2 u35 8881d075d9101a1dfa3f6a10b9ee8373 +exp10 u10 9d704b310f683872a6446cfc97726a4d +exp10 u35 bc07745ebc22a7ee97679154c24b23cc +expm1 u10 cd3f0b8e86943d52c278394b60e2d22e +pow u10 a0ea63b27d33262346a35c9439741075 +cbrt u10 5d8bf28ac74624594fd1be9217817690 +cbrt u10 3c896e03746bcf1b3f70182dfec3d93b +cbrt u35 73daa306764e208aab1627ac110b10d7 +cbrt u35 c29b7bf200215425b4ba948c8cc94c42 +hypot u05 cc2f18e409e19a02cadf7b91fd869120 +hypot u35 5194e0a554174a6145511ce3df9c1f46 +asin u10 86c061caec3fa2e1bc71bda4dad29f4c +asin u35 31303b88bdc00206265002d6cc5e89e4 +acos u10 0a1a403590f2ac8364f132b334920945 +acos u35 493f960c1cce57931d95a5a22a0587a3 +atan u10 c97624a24ec034cc0c8985acb61d13cd +atan u10 0be0f550406923016cfeb5ef62c25b15 +atan u35 9d6d83e066b5a4851d44771418c9948c +atan u35 f32c1aa4caa08c6945afd1125ba8b113 +atan2 u10 6b1d9d25fcd96053acc19d1633fab36a +atan2 u35 afb07894347062a96dab705b34eb1763 +sinh u10 61d459b1f368087f6f23ebf8e9f0ea01 +cosh u10 f77eb95f79e274c12b4e92dc0389259b +tanh u10 2bb9dd54ed0fa22bb5f3b6d557eb58a3 +asinh u10 01136e54e2a434839530dda54f33cfdb +acosh u10 2f3c28c9ee2eb2b3d5659c6cb2a58e3e +atanh u10 601a77ba8c1d5175f2808b48a41260c1 +lgamma u10 90cdc41063f4198c6ad592c0cdd0f5da +tgamma u10 6f864c3a1f17fbdf914cac7ffcd82cb7 +erf u10 f4ae148b59bb7501d8f5746300850376 +erfc u15 5e116a4316dafa742769f71e18f6f9fe +fabs bef2f2ac8a4789357e580b4da4f9b9fe +copysign 3219022f267464e3704f90558e8df3bc +fmax 4e4f5220ccfef191864c316df0d18fc0 +fmin c0f8effb6c611e2b3b91b820ad943f62 +fdim e876d103931f18ceede5bfd7e3df7ab0 +fmod 618aa751e13012afdb41ec80dd35e6ba +remainder 8d692dbb44bbc9be5af0c0657d3008b8 +modf f03ce73cd4f9ea7f69c017f6e53355d5 +nextafter 9eba4e30d12d74dc4e8003fcff0f1582 +trunc 1bc7e909eba121dcef7f0e4046937ae5 +floor 2cff66b499dc8a30cec9467de659b774 +ceil b080e632dcb8f8134d8715752be12917 +round 8907e21687ca9c2a539297536e754950 +rint e49f837096bc661fe1c742801dd99a30 +sinf u35 833d845950b9cbb025629fe4c040f8f6 +sinf u10 9c21afa4d7d6af3fc666309c3cd647fe +cosf u35 74d7f871a6553cd0019087895e2052ad +cosf u10 35349e94c323c1614f22093959288010 +tanf u35 bbb7c092d017e96d2454a38a20687735 +tanf u10 227423bc04f42d76a8f68082ba696126 +sincosf u10 83ecc4e3d5295056e9d8c52bc196b666 +sincosf u35 533319caa49a961e4909bd6dcab40721 +sincospif u05 8b3762b67a661957c1414c351ec49034 +sincospif u35 cec15ed76a358091632634166fa77b66 +logf u10 c5a90119943acc4199e1cc7030b5def8 +logf u35 af2fbe4bfa2caaf59c734e3749dd15be +log2f u10 ba8acae369bbb7b6404cccbc633fe25b +log2f u35 ba32ebaa8c470899ebd433d190c00f03 +log10f u10 7e235a82d960e4434575dd39648d8bb7 +log1pf u10 350fc4f13502b36bb1107e1b1122acb1 +expf u10 ee4adaabefa3fac6c0f1925b2a948eea +exp2f u10 b0d283dbae0f36f1b3c7eed9871f0d0d +exp2f u35 522cc30f722f77fceb07015830b351a3 +exp10f u10 b0564be151965600f5744ff2e4992bc9 +exp10f u35 d142f1fb40e44f0c9e042718f27ee3e0 +expm1f u10 ebfd6498cb40f61b609882de8a7f3c74 +powf u10 a7cba3239c87969662e8b41a4dd8b4ab +cbrtf u10 01c5cac23fe21638be1c3eab6e368fd6 +cbrtf u10 2a245b03f83e9114644d03b40dac707b +cbrtf u35 3ce62350fd585f0524a12c974fbe6cf5 +cbrtf u35 2aca0404626a28f7af7f60105ad6e217 +hypotf u05 bc5971cbeebee27b4c0d91fbe3f6bf30 +hypotf u35 a6f0f774b346a6bba08889ff9ba3f193 +asinf u10 7f77f7453b961512c89e87e49c549cfe +asinf u35 22ed8760aa328e1f714031eec592a4d8 +acosf u10 15617dd0429b90e59d2923415934c2a6 +acosf u35 af0b132d9e263721f9296187dbf9b9bf +atanf u10 26b77fb423104b45633cf24500237d6e +atanf u10 4313d0bc2708de53f74d804aac6564d4 +atanf u35 97a1797897955643c722c7d291987331 +atanf u35 7d3f47169415058e8578f11d899bfd10 +atan2f u10 098a33f730fe95ce4774a991db4cee14 +atan2f u35 56fc6bd8349979f0d0b1dcdb57f68363 +sinhf u10 0780a2f57df3a831718195d1ee5c19ef +coshf u10 cfbb6aed408e43a7b7f053474100ff2d +tanhf u10 d19f254d41e8726c748df87b95bc9acd +asinhf u10 260d129221468a86bbfd609c27bfea6a +acoshf u10 24ced7e5631c78b20a5716faeedbaa92 +atanhf u10 164fd77b8372b8c131baaacab1c9e650 +lgammaf u10 3bf6d824175c4f4d86f3073064e41e84 +tgammaf u10 f3a8d25c852068622bdfcae4cb813583 +erff u10 f34af3814153de040b93e573ca7d21d8 +erfcf u15 915ab9830de89a5a504b3ce7cd2fecda +fabsf a3c72220bc0ade68fe22e0a15eb730d4 +copysignf 6b35517b8e1da78d9c9b52915d9a9b19 +fmaxf 9833a60a2080e8fd9ae8de32c758966f +fminf 2dcfa19e1f1ab4973a7dec9f2cc09fa0 +fdimf c5c0fe7b095eb8ccbb19fbf934a36b24 +fmodf 77aa84a9703e202a56e5f4609bd2482b +remainderf 5a453b1217c173e4dc0b0211066750be +modff 5fa4f044f20478216aa085a01b189697 +nextafterf 517c1c8f072e9024518d3d9ead98b85b +truncf 6937050850be63c44d4b7dbd666febe6 +floorf 9341be69ee345c8554bf3ab4e9316133 +ceilf c70874771cbe9741f1f05fedd4b629e9 +roundf 0cf52f6b8015099771e9a7dfa6b090bc +rintf bed68e788e2b11543c09c9d52198abf8 +fastsinf u3500 8eb51f86fb40414dd21284f020f24b6c +fastcosf u3500 69cbc3703f1d2c68695b00b1b09287b2 +fastpowf u3500 e02e6a692cfa22a6b7149168c67ea1d2 diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_finz.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_finz.txt new file mode 100644 index 0000000000000..6d8589f35bcff --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/hash_finz.txt @@ -0,0 +1,129 @@ +sin u35 c163e4a7e9ccebb2181dcc8653367d8c +sin u10 0d6bf6f2c935db82588222da95659019 +cos u35 52f902bd939d751b5b544ac70181fcff +cos u10 afcdba92a75a76d56b8cf2f22d4bec9e +tan u35 906cc42b6755fe514c5e185fcb4d2f55 +tan u10 c98f29a62067fa63646d9bcc29a310c6 +sincos u10 3fe37f4eb805505152f2b14a22a9f94e +sincos u35 95a7b7f48c71febf10ec6eff796dd391 +sincospi u05 0c6fc00c7aaf0b6e67d66542d1be833d +sincospi u35 c428b0fc3e6c5be4d2c03dcd8bb27a7c +log u10 4855b27222d900bea47a27cadba71727 +log u35 015f8ae899c9b921d48919dd12ef19a9 +log2 u10 2662df9af919680ca62e1752fb1b7539 +log2 u35 908b1949db34ea855944f00089b21e23 +log10 u10 36645e8031d873d66fd0ec2c5959f273 +log1p u10 1383924fb56cf2e7eda27de21320c591 +exp u10 084e5be89c2ad03e356078ea4f287bab +exp2 u10 6e36db9ae2cf9eca82e3d9157c622351 +exp2 u35 6e36db9ae2cf9eca82e3d9157c622351 +exp10 u10 0cc08bc6a3d08d6e61450b5370c6161e +exp10 u35 6904d5509ca794747aa249c13886f90f +expm1 u10 cd3f0b8e86943d52c278394b60e2d22e +pow u10 7e19796027d7c1d1999be948f90e6181 +cbrt u10 5d8bf28ac74624594fd1be9217817690 +cbrt u10 3c896e03746bcf1b3f70182dfec3d93b +cbrt u35 fc7ee3e3e6c54365d708b752c242a947 +cbrt u35 2408714a56d74f8c82389ca6772cdbc1 +hypot u05 cc2f18e409e19a02cadf7b91fd869120 +hypot u35 be7bbd41dffd746b70261ee773cbd4b2 +asin u10 8a21b7c28cdaffc9d3e53f415367932e +asin u35 9c9e8107782898e9faed6924ad1b3cb1 +acos u10 28261e4eb8331865660c814676d5c6bc +acos u35 310911130bfc45b10dabe3a072939331 +atan u10 f931de72f2f6a7928f307a8a382ae255 +atan u10 453f9ef62f58f9829320baf482a1d457 +atan u35 6161b6189609f105b017d8768d0a41f1 +atan u35 6face71d8d93c69448d49ed6140e361d +atan2 u10 469babaeee9bd30e17af2f473b3ea500 +atan2 u35 6a3e764125aab2a0a13e7a0d9ec02f7f +sinh u10 61d459b1f368087f6f23ebf8e9f0ea01 +cosh u10 f77eb95f79e274c12b4e92dc0389259b +tanh u10 2bb9dd54ed0fa22bb5f3b6d557eb58a3 +asinh u10 01136e54e2a434839530dda54f33cfdb +acosh u10 2f3c28c9ee2eb2b3d5659c6cb2a58e3e +atanh u10 601a77ba8c1d5175f2808b48a41260c1 +lgamma u10 90cdc41063f4198c6ad592c0cdd0f5da +tgamma u10 cb9a93844ad1713d2ab92ff5b6398150 +erf u10 8a0bc2146a5c67b6bebc58f4b0076568 +erfc u15 3e247a54183eeddedc33e99c50118995 +fabs bef2f2ac8a4789357e580b4da4f9b9fe +copysign 3219022f267464e3704f90558e8df3bc +fmax 4e4f5220ccfef191864c316df0d18fc0 +fmin c0f8effb6c611e2b3b91b820ad943f62 +fdim e876d103931f18ceede5bfd7e3df7ab0 +fmod 618aa751e13012afdb41ec80dd35e6ba +remainder 8d692dbb44bbc9be5af0c0657d3008b8 +modf f03ce73cd4f9ea7f69c017f6e53355d5 +nextafter 9eba4e30d12d74dc4e8003fcff0f1582 +trunc 1bc7e909eba121dcef7f0e4046937ae5 +floor 2cff66b499dc8a30cec9467de659b774 +ceil b080e632dcb8f8134d8715752be12917 +round 8907e21687ca9c2a539297536e754950 +rint e49f837096bc661fe1c742801dd99a30 +sinf u35 f8f804eae1d9443103e81fec96293477 +sinf u10 3f12a7381f1cbb1830d92b4ec72d21fe +cosf u35 f2f3d1c9f090cde9c02439608dc7066e +cosf u10 dc35f27fae65f63f0aa6ad241f8b387b +tanf u35 68d42ad1fb412e6b8be3853461e61213 +tanf u10 97df301d4f59e67d5318b5356b703f06 +sincosf u10 a97124d810ec461c135dc4fb0c059b6f +sincosf u35 0cc521e52ae1227d311012c2919c1ff2 +sincospif u05 8b3762b67a661957c1414c351ec49034 +sincospif u35 8720757f221c00cc8de24b7dc4949144 +logf u10 c5a90119943acc4199e1cc7030b5def8 +logf u35 b6234302d534d6ccd48155dd6b9a4293 +log2f u10 ba8acae369bbb7b6404cccbc633fe25b +log2f u35 74174c90717c86642b71284452a8aef6 +log10f u10 7e235a82d960e4434575dd39648d8bb7 +log1pf u10 e53dbfa80bcc1a7bcfd21000e6950475 +expf u10 9597388315e4b3e89c4c97ce46374dcf +exp2f u10 42d66e5e4cb88feb29c5b36c632159a5 +exp2f u35 42d66e5e4cb88feb29c5b36c632159a5 +exp10f u10 954f0824b6d949d0da03b49950dc6642 +exp10f u35 6fb0e9a829e12a06679d379d05b53ede +expm1f u10 ebfd6498cb40f61b609882de8a7f3c74 +powf u10 2ed84af40d03e307a620365f172d010d +cbrtf u10 01c5cac23fe21638be1c3eab6e368fd6 +cbrtf u10 2a245b03f83e9114644d03b40dac707b +cbrtf u35 6c22a6dc132c5212250970f22f42256d +cbrtf u35 5ab696ae11f9637413d30e6496d5324b +hypotf u05 bc5971cbeebee27b4c0d91fbe3f6bf30 +hypotf u35 2a7cd97768287084b7fffc7e9fb39072 +asinf u10 e2e571a01984c4ffb3f6e38e0328d90e +asinf u35 70df2dfc3a3569868cce60c38e7b1962 +acosf u10 5180fde4b02a0ca4cd75f0a786a1bfeb +acosf u35 72b0e2f9791f90f1c43570b9e9ba893f +atanf u10 fa672e387a204055f735b7af98dd8a35 +atanf u10 d017670c13bc221b68bc9ee5f41c4b5e +atanf u35 f592e46eaa5d29583f86d3e336f20b6b +atanf u35 e7087fe40de46921826b373d10c40954 +atan2f u10 275b2fa8ee554c45551bb142db9f8197 +atan2f u35 44b187851195d24bab2561eb8f4ff5d0 +sinhf u10 45bc228a14c3e39eeb35e9764394a23e +coshf u10 838d441e85d415ef4fb1e5c5ea966a71 +tanhf u10 d19f254d41e8726c748df87b95bc9acd +asinhf u10 927eeb621a3e2d5039f1a07fcf150901 +acoshf u10 932520013273174fcabe2be4a55f919f +atanhf u10 164fd77b8372b8c131baaacab1c9e650 +lgammaf u10 3bf6d824175c4f4d86f3073064e41e84 +tgammaf u10 c3059747811d98846f74a63d3747ac3d +erff u10 f34af3814153de040b93e573ca7d21d8 +erfcf u15 687a9c577512d349ddbc0643013d2c56 +fabsf a3c72220bc0ade68fe22e0a15eb730d4 +copysignf 6b35517b8e1da78d9c9b52915d9a9b19 +fmaxf 9833a60a2080e8fd9ae8de32c758966f +fminf 2dcfa19e1f1ab4973a7dec9f2cc09fa0 +fdimf c5c0fe7b095eb8ccbb19fbf934a36b24 +fmodf 77aa84a9703e202a56e5f4609bd2482b +remainderf 5a453b1217c173e4dc0b0211066750be +modff 5fa4f044f20478216aa085a01b189697 +nextafterf 517c1c8f072e9024518d3d9ead98b85b +truncf 6937050850be63c44d4b7dbd666febe6 +floorf 9341be69ee345c8554bf3ab4e9316133 +ceilf c70874771cbe9741f1f05fedd4b629e9 +roundf 0cf52f6b8015099771e9a7dfa6b090bc +rintf bed68e788e2b11543c09c9d52198abf8 +fastsinf u3500 5c48081c74cd0316379b580b047dbfc2 +fastcosf u3500 6f73d116f109283e5632c31f5988f55b +fastpowf u3500 6dbb3110412df4fed5a71f50d40def89 diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iut.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iut.c new file mode 100644 index 0000000000000..079bbc09d859e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iut.c @@ -0,0 +1,777 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +#include + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) +#define STDIN_FILENO 0 +#else +#include +#include +#endif + +#include "sleef.h" +#include "testerutil.h" + +#define DORENAME +#include "rename.h" + +#define BUFSIZE 1024 + +int main(int argc, char **argv) { + char buf[BUFSIZE]; + + printf("3\n"); + fflush(stdout); + + for(;;) { + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; + + if (startsWith(buf, "sin ")) { + uint64_t u; + sscanf(buf, "sin %" PRIx64, &u); + u = d2u(xsin(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sin_u1 ")) { + uint64_t u; + sscanf(buf, "sin_u1 %" PRIx64, &u); + u = d2u(xsin_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cos ")) { + uint64_t u; + sscanf(buf, "cos %" PRIx64, &u); + u = d2u(xcos(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cos_u1 ")) { + uint64_t u; + sscanf(buf, "cos_u1 %" PRIx64, &u); + u = d2u(xcos_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sincos ")) { + uint64_t u; + sscanf(buf, "sincos %" PRIx64, &u); + Sleef_double2 x = xsincos(u2d(u)); + printf("%" PRIx64 " %" PRIx64 "\n", d2u(x.x), d2u(x.y)); + } else if (startsWith(buf, "sincos_u1 ")) { + uint64_t u; + sscanf(buf, "sincos_u1 %" PRIx64, &u); + Sleef_double2 x = xsincos_u1(u2d(u)); + printf("%" PRIx64 " %" PRIx64 "\n", d2u(x.x), d2u(x.y)); + } else if (startsWith(buf, "sincospi_u05 ")) { + uint64_t u; + sscanf(buf, "sincospi_u05 %" PRIx64, &u); + Sleef_double2 x = xsincospi_u05(u2d(u)); + printf("%" PRIx64 " %" PRIx64 "\n", d2u(x.x), d2u(x.y)); + } else if (startsWith(buf, "sincospi_u35 ")) { + uint64_t u; + sscanf(buf, "sincospi_u35 %" PRIx64, &u); + Sleef_double2 x = xsincospi_u35(u2d(u)); + printf("%" PRIx64 " %" PRIx64 "\n", d2u(x.x), d2u(x.y)); + } else if (startsWith(buf, "sinpi_u05 ")) { + uint64_t u; + sscanf(buf, "sinpi_u05 %" PRIx64, &u); + u = d2u(xsinpi_u05(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cospi_u05 ")) { + uint64_t u; + sscanf(buf, "cospi_u05 %" PRIx64, &u); + u = d2u(xcospi_u05(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "tan ")) { + uint64_t u; + sscanf(buf, "tan %" PRIx64, &u); + u = d2u(xtan(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "tan_u1 ")) { + uint64_t u; + sscanf(buf, "tan_u1 %" PRIx64, &u); + u = d2u(xtan_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "asin ")) { + uint64_t u; + sscanf(buf, "asin %" PRIx64, &u); + u = d2u(xasin(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "acos ")) { + uint64_t u; + sscanf(buf, "acos %" PRIx64, &u); + u = d2u(xacos(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "atan ")) { + uint64_t u; + sscanf(buf, "atan %" PRIx64, &u); + u = d2u(xatan(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log ")) { + uint64_t u; + sscanf(buf, "log %" PRIx64, &u); + u = d2u(xlog(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "exp ")) { + uint64_t u; + sscanf(buf, "exp %" PRIx64, &u); + u = d2u(xexp(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "atan2 ")) { + uint64_t u, v; + sscanf(buf, "atan2 %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xatan2(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "asin_u1 ")) { + uint64_t u; + sscanf(buf, "asin_u1 %" PRIx64, &u); + u = d2u(xasin_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "acos_u1 ")) { + uint64_t u; + sscanf(buf, "acos_u1 %" PRIx64, &u); + u = d2u(xacos_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "atan_u1 ")) { + uint64_t u; + sscanf(buf, "atan_u1 %" PRIx64, &u); + u = d2u(xatan_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "atan2_u1 ")) { + uint64_t u, v; + sscanf(buf, "atan2_u1 %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xatan2_u1(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log_u1 ")) { + uint64_t u; + sscanf(buf, "log_u1 %" PRIx64, &u); + u = d2u(xlog_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "pow ")) { + uint64_t u, v; + sscanf(buf, "pow %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xpow(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sinh ")) { + uint64_t u; + sscanf(buf, "sinh %" PRIx64, &u); + u = d2u(xsinh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cosh ")) { + uint64_t u; + sscanf(buf, "cosh %" PRIx64, &u); + u = d2u(xcosh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "tanh ")) { + uint64_t u; + sscanf(buf, "tanh %" PRIx64, &u); + u = d2u(xtanh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sinh_u35 ")) { + uint64_t u; + sscanf(buf, "sinh_u35 %" PRIx64, &u); + u = d2u(xsinh_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cosh_u35 ")) { + uint64_t u; + sscanf(buf, "cosh_u35 %" PRIx64, &u); + u = d2u(xcosh_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "tanh_u35 ")) { + uint64_t u; + sscanf(buf, "tanh_u35 %" PRIx64, &u); + u = d2u(xtanh_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "asinh ")) { + uint64_t u; + sscanf(buf, "asinh %" PRIx64, &u); + u = d2u(xasinh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "acosh ")) { + uint64_t u; + sscanf(buf, "acosh %" PRIx64, &u); + u = d2u(xacosh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "atanh ")) { + uint64_t u; + sscanf(buf, "atanh %" PRIx64, &u); + u = d2u(xatanh(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fma ")) { + uint64_t u, v, w; + sscanf(buf, "fma %" PRIx64 " %" PRIx64 " %" PRIx64, &u, &v, &w); + u = d2u(xfma(u2d(u), u2d(v), u2d(w))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sqrt ")) { + uint64_t u; + sscanf(buf, "sqrt %" PRIx64, &u); + u = d2u(xsqrt(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sqrt_u05 ")) { + uint64_t u; + sscanf(buf, "sqrt_u05 %" PRIx64, &u); + u = d2u(xsqrt_u05(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "sqrt_u35 ")) { + uint64_t u; + sscanf(buf, "sqrt_u35 %" PRIx64, &u); + u = d2u(xsqrt_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cbrt ")) { + uint64_t u; + sscanf(buf, "cbrt %" PRIx64, &u); + u = d2u(xcbrt(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "cbrt_u1 ")) { + uint64_t u; + sscanf(buf, "cbrt_u1 %" PRIx64, &u); + u = d2u(xcbrt_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "exp2 ")) { + uint64_t u; + sscanf(buf, "exp2 %" PRIx64, &u); + u = d2u(xexp2(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "exp2_u35 ")) { + uint64_t u; + sscanf(buf, "exp2_u35 %" PRIx64, &u); + u = d2u(xexp2_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "exp10 ")) { + uint64_t u; + sscanf(buf, "exp10 %" PRIx64, &u); + u = d2u(xexp10(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "exp10_u35 ")) { + uint64_t u; + sscanf(buf, "exp10_u35 %" PRIx64, &u); + u = d2u(xexp10_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "expm1 ")) { + uint64_t u; + sscanf(buf, "expm1 %" PRIx64, &u); + u = d2u(xexpm1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log10 ")) { + uint64_t u; + sscanf(buf, "log10 %" PRIx64, &u); + u = d2u(xlog10(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log2 ")) { + uint64_t u; + sscanf(buf, "log2 %" PRIx64, &u); + u = d2u(xlog2(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log2_u35 ")) { + uint64_t u; + sscanf(buf, "log2_u35 %" PRIx64, &u); + u = d2u(xlog2_u35(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "log1p ")) { + uint64_t u; + sscanf(buf, "log1p %" PRIx64, &u); + u = d2u(xlog1p(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "ldexp ")) { + uint64_t u, v; + sscanf(buf, "ldexp %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xldexp(u2d(u), (int)u2d(v))); + printf("%" PRIx64 "\n", u); + } + + else if (startsWith(buf, "hypot_u05 ")) { + uint64_t u, v; + sscanf(buf, "hypot_u05 %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xhypot_u05(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "hypot_u35 ")) { + uint64_t u, v; + sscanf(buf, "hypot_u35 %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xhypot_u35(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "copysign ")) { + uint64_t u, v; + sscanf(buf, "copysign %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xcopysign(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fmax ")) { + uint64_t u, v; + sscanf(buf, "fmax %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xfmax(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fmin ")) { + uint64_t u, v; + sscanf(buf, "fmin %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xfmin(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fdim ")) { + uint64_t u, v; + sscanf(buf, "fdim %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xfdim(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "nextafter ")) { + uint64_t u, v; + sscanf(buf, "nextafter %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xnextafter(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fmod ")) { + uint64_t u, v; + sscanf(buf, "fmod %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xfmod(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "remainder ")) { + uint64_t u, v; + sscanf(buf, "remainder %" PRIx64 " %" PRIx64, &u, &v); + u = d2u(xremainder(u2d(u), u2d(v))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "fabs ")) { + uint64_t u; + sscanf(buf, "fabs %" PRIx64, &u); + u = d2u(xfabs(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "trunc ")) { + uint64_t u; + sscanf(buf, "trunc %" PRIx64, &u); + u = d2u(xtrunc(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "floor ")) { + uint64_t u; + sscanf(buf, "floor %" PRIx64, &u); + u = d2u(xfloor(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "ceil ")) { + uint64_t u; + sscanf(buf, "ceil %" PRIx64, &u); + u = d2u(xceil(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "round ")) { + uint64_t u; + sscanf(buf, "round %" PRIx64, &u); + u = d2u(xround(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "rint ")) { + uint64_t u; + sscanf(buf, "rint %" PRIx64, &u); + u = d2u(xrint(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "frfrexp ")) { + uint64_t u; + sscanf(buf, "frfrexp %" PRIx64, &u); + u = d2u(xfrfrexp(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "modf ")) { + uint64_t u; + sscanf(buf, "modf %" PRIx64, &u); + Sleef_double2 x = xmodf(u2d(u)); + printf("%" PRIx64 " %" PRIx64 "\n", d2u(x.x), d2u(x.y)); + } else if (startsWith(buf, "tgamma_u1 ")) { + uint64_t u; + sscanf(buf, "tgamma_u1 %" PRIx64, &u); + u = d2u(xtgamma_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "lgamma_u1 ")) { + uint64_t u; + sscanf(buf, "lgamma_u1 %" PRIx64, &u); + u = d2u(xlgamma_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "erf_u1 ")) { + uint64_t u; + sscanf(buf, "erf_u1 %" PRIx64, &u); + u = d2u(xerf_u1(u2d(u))); + printf("%" PRIx64 "\n", u); + } else if (startsWith(buf, "erfc_u15 ")) { + uint64_t u; + sscanf(buf, "erfc_u15 %" PRIx64, &u); + u = d2u(xerfc_u15(u2d(u))); + printf("%" PRIx64 "\n", u); + } + + else if (startsWith(buf, "sinf ")) { + uint32_t u; + sscanf(buf, "sinf %x", &u); + u = f2u(xsinf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "cosf ")) { + uint32_t u; + sscanf(buf, "cosf %x", &u); + u = f2u(xcosf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sincosf ")) { + uint32_t u; + sscanf(buf, "sincosf %x", &u); + Sleef_float2 x = xsincosf(u2f(u)); + printf("%x %x\n", f2u(x.x), f2u(x.y)); + } else if (startsWith(buf, "tanf ")) { + uint32_t u; + sscanf(buf, "tanf %x", &u); + u = f2u(xtanf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "asinf ")) { + uint32_t u; + sscanf(buf, "asinf %x", &u); + u = f2u(xasinf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "acosf ")) { + uint32_t u; + sscanf(buf, "acosf %x", &u); + u = f2u(xacosf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "atanf ")) { + uint32_t u; + sscanf(buf, "atanf %x", &u); + u = f2u(xatanf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "atan2f ")) { + uint32_t u, v; + sscanf(buf, "atan2f %x %x", &u, &v); + u = f2u(xatan2f(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "logf ")) { + uint32_t u; + sscanf(buf, "logf %x", &u); + u = f2u(xlogf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "expf ")) { + uint32_t u; + sscanf(buf, "expf %x", &u); + u = f2u(xexpf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "cbrtf ")) { + uint32_t u; + sscanf(buf, "cbrtf %x", &u); + u = f2u(xcbrtf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sqrtf ")) { + uint32_t u; + sscanf(buf, "sqrtf %x", &u); + u = f2u(xsqrtf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sqrtf_u05 ")) { + uint32_t u; + sscanf(buf, "sqrtf_u05 %x", &u); + u = f2u(xsqrtf_u05(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sqrtf_u35 ")) { + uint32_t u; + sscanf(buf, "sqrtf_u35 %x", &u); + u = f2u(xsqrtf_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "ldexpf ")) { + uint32_t u, v; + sscanf(buf, "ldexpf %x %x", &u, &v); + u = f2u(xldexpf(u2f(u), (int)u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "powf ")) { + uint32_t u, v; + sscanf(buf, "powf %x %x", &u, &v); + u = f2u(xpowf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fastpowf_u3500 ")) { + uint32_t u, v; + sscanf(buf, "fastpowf_u3500 %x %x", &u, &v); + u = f2u(xfastpowf_u3500(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "sinhf ")) { + uint32_t u; + sscanf(buf, "sinhf %x", &u); + u = f2u(xsinhf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "coshf ")) { + uint32_t u; + sscanf(buf, "coshf %x", &u); + u = f2u(xcoshf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "tanhf ")) { + uint32_t u; + sscanf(buf, "tanhf %x", &u); + u = f2u(xtanhf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sinhf_u35 ")) { + uint32_t u; + sscanf(buf, "sinhf_u35 %x", &u); + u = f2u(xsinhf_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "coshf_u35 ")) { + uint32_t u; + sscanf(buf, "coshf_u35 %x", &u); + u = f2u(xcoshf_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "tanhf_u35 ")) { + uint32_t u; + sscanf(buf, "tanhf_u35 %x", &u); + u = f2u(xtanhf_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "asinhf ")) { + uint32_t u; + sscanf(buf, "asinhf %x", &u); + u = f2u(xasinhf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "acoshf ")) { + uint32_t u; + sscanf(buf, "acoshf %x", &u); + u = f2u(xacoshf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "atanhf ")) { + uint32_t u; + sscanf(buf, "atanhf %x", &u); + u = f2u(xatanhf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "exp2f ")) { + uint32_t u; + sscanf(buf, "exp2f %x", &u); + u = f2u(xexp2f(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "exp10f ")) { + uint32_t u; + sscanf(buf, "exp10f %x", &u); + u = f2u(xexp10f(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "exp2f_u35 ")) { + uint32_t u; + sscanf(buf, "exp2f_u35 %x", &u); + u = f2u(xexp2f_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "exp10f_u35 ")) { + uint32_t u; + sscanf(buf, "exp10f_u35 %x", &u); + u = f2u(xexp10f_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "expm1f ")) { + uint32_t u; + sscanf(buf, "expm1f %x", &u); + u = f2u(xexpm1f(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "log10f ")) { + uint32_t u; + sscanf(buf, "log10f %x", &u); + u = f2u(xlog10f(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "log2f ")) { + uint32_t u; + sscanf(buf, "log2f %x", &u); + u = f2u(xlog2f(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "log2f_u35 ")) { + uint32_t u; + sscanf(buf, "log2f_u35 %x", &u); + u = f2u(xlog2f_u35(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "log1pf ")) { + uint32_t u; + sscanf(buf, "log1pf %x", &u); + u = f2u(xlog1pf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sinf_u1 ")) { + uint32_t u; + sscanf(buf, "sinf_u1 %x", &u); + u = f2u(xsinf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "cosf_u1 ")) { + uint32_t u; + sscanf(buf, "cosf_u1 %x", &u); + u = f2u(xcosf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "sincosf_u1 ")) { + uint32_t u; + sscanf(buf, "sincosf_u1 %x", &u); + Sleef_float2 x = xsincosf_u1(u2f(u)); + printf("%x %x\n", f2u(x.x), f2u(x.y)); + } else if (startsWith(buf, "sincospif_u05 ")) { + uint32_t u; + sscanf(buf, "sincospif_u05 %x", &u); + Sleef_float2 x = xsincospif_u05(u2f(u)); + printf("%x %x\n", f2u(x.x), f2u(x.y)); + } else if (startsWith(buf, "sincospif_u35 ")) { + uint32_t u; + sscanf(buf, "sincospif_u35 %x", &u); + Sleef_float2 x = xsincospif_u35(u2f(u)); + printf("%x %x\n", f2u(x.x), f2u(x.y)); + } else if (startsWith(buf, "sinpif_u05 ")) { + uint32_t u; + sscanf(buf, "sinpif_u05 %x", &u); + u = f2u(xsinpif_u05(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "cospif_u05 ")) { + uint32_t u; + sscanf(buf, "cospif_u05 %x", &u); + u = f2u(xcospif_u05(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "fastsinf_u3500 ")) { + uint32_t u; + sscanf(buf, "fastsinf_u3500 %x", &u); + u = f2u(xfastsinf_u3500(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "fastcosf_u3500 ")) { + uint32_t u; + sscanf(buf, "fastcosf_u3500 %x", &u); + u = f2u(xfastcosf_u3500(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "tanf_u1 ")) { + uint32_t u; + sscanf(buf, "tanf_u1 %x", &u); + u = f2u(xtanf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "asinf_u1 ")) { + uint32_t u; + sscanf(buf, "asinf_u1 %x", &u); + u = f2u(xasinf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "acosf_u1 ")) { + uint32_t u; + sscanf(buf, "acosf_u1 %x", &u); + u = f2u(xacosf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "atanf_u1 ")) { + uint32_t u; + sscanf(buf, "atanf_u1 %x", &u); + u = f2u(xatanf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "atan2f_u1 ")) { + uint32_t u, v; + sscanf(buf, "atan2f_u1 %x %x", &u, &v); + u = f2u(xatan2f_u1(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "logf_u1 ")) { + uint32_t u; + sscanf(buf, "logf_u1 %x", &u); + u = f2u(xlogf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "cbrtf_u1 ")) { + uint32_t u; + sscanf(buf, "cbrtf_u1 %x", &u); + u = f2u(xcbrtf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "ilogb ")) { + uint64_t u; + int i; + sscanf(buf, "ilogb %" PRIx64, &u); + i = xilogb(u2d(u)); + printf("%d\n", i); + } else if (startsWith(buf, "ilogbf ")) { + uint32_t u; + int i; + sscanf(buf, "ilogbf %x", &u); + i = xilogbf(u2f(u)); + printf("%d\n", i); + } + + else if (startsWith(buf, "hypotf_u05 ")) { + uint32_t u, v; + sscanf(buf, "hypotf_u05 %x %x", &u, &v); + u = f2u(xhypotf_u05(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "hypotf_u35 ")) { + uint32_t u, v; + sscanf(buf, "hypotf_u35 %x %x", &u, &v); + u = f2u(xhypotf_u35(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "copysignf ")) { + uint32_t u, v; + sscanf(buf, "copysignf %x %x", &u, &v); + u = f2u(xcopysignf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fmaxf ")) { + uint32_t u, v; + sscanf(buf, "fmaxf %x %x", &u, &v); + u = f2u(xfmaxf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fminf ")) { + uint32_t u, v; + sscanf(buf, "fminf %x %x", &u, &v); + u = f2u(xfminf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fdimf ")) { + uint32_t u, v; + sscanf(buf, "fdimf %x %x", &u, &v); + u = f2u(xfdimf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "nextafterf ")) { + uint32_t u, v; + sscanf(buf, "nextafterf %x %x", &u, &v); + u = f2u(xnextafterf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fmodf ")) { + uint32_t u, v; + sscanf(buf, "fmodf %x %x", &u, &v); + u = f2u(xfmodf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "remainderf ")) { + uint32_t u, v; + sscanf(buf, "remainderf %x %x", &u, &v); + u = f2u(xremainderf(u2f(u), u2f(v))); + printf("%x\n", u); + } else if (startsWith(buf, "fabsf ")) { + uint32_t u; + sscanf(buf, "fabsf %x", &u); + u = f2u(xfabsf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "truncf ")) { + uint32_t u; + sscanf(buf, "truncf %x", &u); + u = f2u(xtruncf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "floorf ")) { + uint32_t u; + sscanf(buf, "floorf %x", &u); + u = f2u(xfloorf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "ceilf ")) { + uint32_t u; + sscanf(buf, "ceilf %x", &u); + u = f2u(xceilf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "roundf ")) { + uint32_t u; + sscanf(buf, "roundf %x", &u); + u = f2u(xroundf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "rintf ")) { + uint32_t u; + sscanf(buf, "rintf %x", &u); + u = f2u(xrintf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "frfrexpf ")) { + uint32_t u; + sscanf(buf, "frfrexpf %x", &u); + u = f2u(xfrfrexpf(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "modff ")) { + uint32_t u; + sscanf(buf, "modff %x", &u); + Sleef_float2 x = xmodff(u2f(u)); + printf("%x %x\n", f2u(x.x), f2u(x.y)); + } else if (startsWith(buf, "tgammaf_u1 ")) { + uint32_t u; + sscanf(buf, "tgammaf_u1 %x", &u); + u = f2u(xtgammaf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "lgammaf_u1 ")) { + uint32_t u; + sscanf(buf, "lgammaf_u1 %x", &u); + u = f2u(xlgammaf_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "erff_u1 ")) { + uint32_t u; + sscanf(buf, "erff_u1 %x", &u); + u = f2u(xerff_u1(u2f(u))); + printf("%x\n", u); + } else if (startsWith(buf, "erfcf_u15 ")) { + uint32_t u; + sscanf(buf, "erfcf_u15 %x", &u); + u = f2u(xerfcf_u15(u2f(u))); + printf("%x\n", u); + } + + else { + break; + } + + fflush(stdout); + } + + return 0; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutcuda.cu b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutcuda.cu new file mode 100644 index 0000000000000..fe58ba29997e7 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutcuda.cu @@ -0,0 +1,546 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sleefinline_purec_scalar.h" +#include "sleefinline_cuda.h" + +#define STDIN_FILENO 0 + +#define SIMD_SUFFIX _cuda_sleef +#define CONCAT_SIMD_SUFFIX_(keyword, suffix) keyword ## suffix +#define CONCAT_SIMD_SUFFIX(keyword, suffix) CONCAT_SIMD_SUFFIX_(keyword, suffix) + +#define vdouble2 CONCAT_SIMD_SUFFIX(vdouble2, SIMD_SUFFIX) +#define vfloat2 CONCAT_SIMD_SUFFIX(vfloat2, SIMD_SUFFIX) + +// + +static int startsWith(const char *str, const char *prefix) { + while(*prefix != '\0') if (*str++ != *prefix++) return 0; + return *prefix == '\0'; +} + +static double u2d(uint64_t u) { + union { + double f; + uint64_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint64_t d2u(double d) { + union { + double f; + uint64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static float u2f(uint32_t u) { + union { + float f; + uint32_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint32_t f2u(float d) { + union { + float f; + uint32_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +// + +__global__ void xsin(double *r, double *a0) { *r = Sleef_sind1_u35cuda(*a0); } +__global__ void xcos(double *r, double *a0) { *r = Sleef_cosd1_u35cuda(*a0); } +__global__ void xsincos(vdouble2 *r, double *a0) { *r = Sleef_sincosd1_u35cuda(*a0); } +__global__ void xtan(double *r, double *a0) { *r = Sleef_tand1_u35cuda(*a0); } +__global__ void xasin(double *r, double *a0) { *r = Sleef_asind1_u35cuda(*a0); } +__global__ void xacos(double *r, double *a0) { *r = Sleef_acosd1_u35cuda(*a0); } +__global__ void xatan(double *r, double *a0) { *r = Sleef_atand1_u35cuda(*a0); } +__global__ void xatan2(double *r, double *a0, double *a1) { *r = Sleef_atan2d1_u35cuda(*a0, *a1); } +__global__ void xlog(double *r, double *a0) { *r = Sleef_logd1_u35cuda(*a0); } +__global__ void xcbrt(double *r, double *a0) { *r = Sleef_cbrtd1_u35cuda(*a0); } +__global__ void xsin_u1(double *r, double *a0) { *r = Sleef_sind1_u10cuda(*a0); } +__global__ void xcos_u1(double *r, double *a0) { *r = Sleef_cosd1_u10cuda(*a0); } +__global__ void xsincos_u1(vdouble2 *r, double *a0) { *r = Sleef_sincosd1_u10cuda(*a0); } +__global__ void xtan_u1(double *r, double *a0) { *r = Sleef_tand1_u10cuda(*a0); } +__global__ void xasin_u1(double *r, double *a0) { *r = Sleef_asind1_u10cuda(*a0); } +__global__ void xacos_u1(double *r, double *a0) { *r = Sleef_acosd1_u10cuda(*a0); } +__global__ void xatan_u1(double *r, double *a0) { *r = Sleef_atand1_u10cuda(*a0); } +__global__ void xatan2_u1(double *r, double *a0, double *a1) { *r = Sleef_atan2d1_u10cuda(*a0, *a1); } +__global__ void xlog_u1(double *r, double *a0) { *r = Sleef_logd1_u10cuda(*a0); } +__global__ void xcbrt_u1(double *r, double *a0) { *r = Sleef_cbrtd1_u10cuda(*a0); } +__global__ void xexp(double *r, double *a0) { *r = Sleef_expd1_u10cuda(*a0); } +__global__ void xpow(double *r, double *a0, double *a1) { *r = Sleef_powd1_u10cuda(*a0, *a1); } +__global__ void xsinh(double *r, double *a0) { *r = Sleef_sinhd1_u10cuda(*a0); } +__global__ void xcosh(double *r, double *a0) { *r = Sleef_coshd1_u10cuda(*a0); } +__global__ void xtanh(double *r, double *a0) { *r = Sleef_tanhd1_u10cuda(*a0); } +__global__ void xsinh_u35(double *r, double *a0) { *r = Sleef_sinhd1_u35cuda(*a0); } +__global__ void xcosh_u35(double *r, double *a0) { *r = Sleef_coshd1_u35cuda(*a0); } +__global__ void xtanh_u35(double *r, double *a0) { *r = Sleef_tanhd1_u35cuda(*a0); } +__global__ void xasinh(double *r, double *a0) { *r = Sleef_asinhd1_u10cuda(*a0); } +__global__ void xacosh(double *r, double *a0) { *r = Sleef_acoshd1_u10cuda(*a0); } +__global__ void xatanh(double *r, double *a0) { *r = Sleef_atanhd1_u10cuda(*a0); } +__global__ void xexp2(double *r, double *a0) { *r = Sleef_exp2d1_u10cuda(*a0); } +__global__ void xexp2_u35(double *r, double *a0) { *r = Sleef_exp2d1_u35cuda(*a0); } +__global__ void xexp10(double *r, double *a0) { *r = Sleef_exp10d1_u10cuda(*a0); } +__global__ void xexp10_u35(double *r, double *a0) { *r = Sleef_exp10d1_u35cuda(*a0); } +__global__ void xexpm1(double *r, double *a0) { *r = Sleef_expm1d1_u10cuda(*a0); } +__global__ void xlog10(double *r, double *a0) { *r = Sleef_log10d1_u10cuda(*a0); } +__global__ void xlog2(double *r, double *a0) { *r = Sleef_log2d1_u10cuda(*a0); } +__global__ void xlog2_u35(double *r, double *a0) { *r = Sleef_log2d1_u35cuda(*a0); } +__global__ void xlog1p(double *r, double *a0) { *r = Sleef_log1pd1_u10cuda(*a0); } +__global__ void xsincospi_u05(vdouble2 *r, double *a0) { *r = Sleef_sincospid1_u05cuda(*a0); } +__global__ void xsincospi_u35(vdouble2 *r, double *a0) { *r = Sleef_sincospid1_u35cuda(*a0); } +__global__ void xsinpi_u05(double *r, double *a0) { *r = Sleef_sinpid1_u05cuda(*a0); } +__global__ void xcospi_u05(double *r, double *a0) { *r = Sleef_cospid1_u05cuda(*a0); } +__global__ void xldexp(double *r, double *a0, int *a1) { *r = Sleef_ldexpd1_cuda(*a0, *a1); } +__global__ void xilogb(int *r, double *a0) { *r = Sleef_ilogbd1_cuda(*a0); } +__global__ void xfma(double *r, double *a0, double *a1, double *a2) { *r = Sleef_fmad1_cuda(*a0, *a1, *a2); } +__global__ void xsqrt(double *r, double *a0) { *r = Sleef_sqrtd1_cuda(*a0); } +__global__ void xsqrt_u05(double *r, double *a0) { *r = Sleef_sqrtd1_u05cuda(*a0); } +__global__ void xsqrt_u35(double *r, double *a0) { *r = Sleef_sqrtd1_u35cuda(*a0); } +__global__ void xhypot_u05(double *r, double *a0, double *a1) { *r = Sleef_hypotd1_u05cuda(*a0, *a1); } +__global__ void xhypot_u35(double *r, double *a0, double *a1) { *r = Sleef_hypotd1_u35cuda(*a0, *a1); } +__global__ void xfabs(double *r, double *a0) { *r = Sleef_fabsd1_cuda(*a0); } +__global__ void xcopysign(double *r, double *a0, double *a1) { *r = Sleef_copysignd1_cuda(*a0, *a1); } +__global__ void xfmax(double *r, double *a0, double *a1) { *r = Sleef_fmaxd1_cuda(*a0, *a1); } +__global__ void xfmin(double *r, double *a0, double *a1) { *r = Sleef_fmind1_cuda(*a0, *a1); } +__global__ void xfdim(double *r, double *a0, double *a1) { *r = Sleef_fdimd1_cuda(*a0, *a1); } +__global__ void xtrunc(double *r, double *a0) { *r = Sleef_truncd1_cuda(*a0); } +__global__ void xfloor(double *r, double *a0) { *r = Sleef_floord1_cuda(*a0); } +__global__ void xceil(double *r, double *a0) { *r = Sleef_ceild1_cuda(*a0); } +__global__ void xround(double *r, double *a0) { *r = Sleef_roundd1_cuda(*a0); } +__global__ void xrint(double *r, double *a0) { *r = Sleef_rintd1_cuda(*a0); } +__global__ void xnextafter(double *r, double *a0, double *a1) { *r = Sleef_nextafterd1_cuda(*a0, *a1); } +__global__ void xfrfrexp(double *r, double *a0) { *r = Sleef_frfrexpd1_cuda(*a0); } +__global__ void xexpfrexp(int *r, double *a0) { *r = Sleef_expfrexpd1_cuda(*a0); } +__global__ void xfmod(double *r, double *a0, double *a1) { *r = Sleef_fmodd1_cuda(*a0, *a1); } +__global__ void xremainder(double *r, double *a0, double *a1) { *r = Sleef_remainderd1_cuda(*a0, *a1); } +__global__ void xmodf(vdouble2 *r, double *a0) { *r = Sleef_modfd1_cuda(*a0); } +__global__ void xlgamma_u1(double *r, double *a0) { *r = Sleef_lgammad1_u10cuda(*a0); } +__global__ void xtgamma_u1(double *r, double *a0) { *r = Sleef_tgammad1_u10cuda(*a0); } +__global__ void xerf_u1(double *r, double *a0) { *r = Sleef_erfd1_u10cuda(*a0); } +__global__ void xerfc_u15(double *r, double *a0) { *r = Sleef_erfcd1_u15cuda(*a0); } + +__global__ void xsinf(float *r, float *a0) { *r = Sleef_sinf1_u35cuda(*a0); } +__global__ void xcosf(float *r, float *a0) { *r = Sleef_cosf1_u35cuda(*a0); } +__global__ void xsincosf(vfloat2 *r, float *a0) { *r = Sleef_sincosf1_u35cuda(*a0); } +__global__ void xtanf(float *r, float *a0) { *r = Sleef_tanf1_u35cuda(*a0); } +__global__ void xasinf(float *r, float *a0) { *r = Sleef_asinf1_u35cuda(*a0); } +__global__ void xacosf(float *r, float *a0) { *r = Sleef_acosf1_u35cuda(*a0); } +__global__ void xatanf(float *r, float *a0) { *r = Sleef_atanf1_u35cuda(*a0); } +__global__ void xatan2f(float *r, float *a0, float *a1) { *r = Sleef_atan2f1_u35cuda(*a0, *a1); } +__global__ void xlogf(float *r, float *a0) { *r = Sleef_logf1_u35cuda(*a0); } +__global__ void xcbrtf(float *r, float *a0) { *r = Sleef_cbrtf1_u35cuda(*a0); } +__global__ void xsinf_u1(float *r, float *a0) { *r = Sleef_sinf1_u10cuda(*a0); } +__global__ void xcosf_u1(float *r, float *a0) { *r = Sleef_cosf1_u10cuda(*a0); } +__global__ void xsincosf_u1(vfloat2 *r, float *a0) { *r = Sleef_sincosf1_u10cuda(*a0); } +__global__ void xtanf_u1(float *r, float *a0) { *r = Sleef_tanf1_u10cuda(*a0); } +__global__ void xasinf_u1(float *r, float *a0) { *r = Sleef_asinf1_u10cuda(*a0); } +__global__ void xacosf_u1(float *r, float *a0) { *r = Sleef_acosf1_u10cuda(*a0); } +__global__ void xatanf_u1(float *r, float *a0) { *r = Sleef_atanf1_u10cuda(*a0); } +__global__ void xatan2f_u1(float *r, float *a0, float *a1) { *r = Sleef_atan2f1_u10cuda(*a0, *a1); } +__global__ void xlogf_u1(float *r, float *a0) { *r = Sleef_logf1_u10cuda(*a0); } +__global__ void xcbrtf_u1(float *r, float *a0) { *r = Sleef_cbrtf1_u10cuda(*a0); } +__global__ void xexpf(float *r, float *a0) { *r = Sleef_expf1_u10cuda(*a0); } +__global__ void xpowf(float *r, float *a0, float *a1) { *r = Sleef_powf1_u10cuda(*a0, *a1); } +__global__ void xsinhf(float *r, float *a0) { *r = Sleef_sinhf1_u10cuda(*a0); } +__global__ void xcoshf(float *r, float *a0) { *r = Sleef_coshf1_u10cuda(*a0); } +__global__ void xtanhf(float *r, float *a0) { *r = Sleef_tanhf1_u10cuda(*a0); } +__global__ void xsinhf_u35(float *r, float *a0) { *r = Sleef_sinhf1_u35cuda(*a0); } +__global__ void xcoshf_u35(float *r, float *a0) { *r = Sleef_coshf1_u35cuda(*a0); } +__global__ void xtanhf_u35(float *r, float *a0) { *r = Sleef_tanhf1_u35cuda(*a0); } +__global__ void xfastsinf_u3500(float *r, float *a0) { *r = Sleef_fastsinf1_u3500cuda(*a0); } +__global__ void xfastcosf_u3500(float *r, float *a0) { *r = Sleef_fastcosf1_u3500cuda(*a0); } +__global__ void xfastpowf_u3500(float *r, float *a0, float *a1) { *r = Sleef_fastpowf1_u3500cuda(*a0, *a1); } +__global__ void xasinhf(float *r, float *a0) { *r = Sleef_asinhf1_u10cuda(*a0); } +__global__ void xacoshf(float *r, float *a0) { *r = Sleef_acoshf1_u10cuda(*a0); } +__global__ void xatanhf(float *r, float *a0) { *r = Sleef_atanhf1_u10cuda(*a0); } +__global__ void xexp2f(float *r, float *a0) { *r = Sleef_exp2f1_u10cuda(*a0); } +__global__ void xexp2f_u35(float *r, float *a0) { *r = Sleef_exp2f1_u35cuda(*a0); } +__global__ void xexp10f(float *r, float *a0) { *r = Sleef_exp10f1_u10cuda(*a0); } +__global__ void xexp10f_u35(float *r, float *a0) { *r = Sleef_exp10f1_u35cuda(*a0); } +__global__ void xexpm1f(float *r, float *a0) { *r = Sleef_expm1f1_u10cuda(*a0); } +__global__ void xlog10f(float *r, float *a0) { *r = Sleef_log10f1_u10cuda(*a0); } +__global__ void xlog2f(float *r, float *a0) { *r = Sleef_log2f1_u10cuda(*a0); } +__global__ void xlog2f_u35(float *r, float *a0) { *r = Sleef_log2f1_u35cuda(*a0); } +__global__ void xlog1pf(float *r, float *a0) { *r = Sleef_log1pf1_u10cuda(*a0); } +__global__ void xsincospif_u05(vfloat2 *r, float *a0) { *r = Sleef_sincospif1_u05cuda(*a0); } +__global__ void xsincospif_u35(vfloat2 *r, float *a0) { *r = Sleef_sincospif1_u35cuda(*a0); } +__global__ void xsinpif_u05(float *r, float *a0) { *r = Sleef_sinpif1_u05cuda(*a0); } +__global__ void xcospif_u05(float *r, float *a0) { *r = Sleef_cospif1_u05cuda(*a0); } +__global__ void xldexpf(float *r, float *a0, int *a1) { *r = Sleef_ldexpf1_cuda(*a0, *a1); } +__global__ void xilogbf(int *r, float *a0) { *r = Sleef_ilogbf1_cuda(*a0); } +__global__ void xfmaf(float *r, float *a0, float *a1, float *a2) { *r = Sleef_fmaf1_cuda(*a0, *a1, *a2); } +__global__ void xsqrtf(float *r, float *a0) { *r = Sleef_sqrtf1_cuda(*a0); } +__global__ void xsqrtf_u05(float *r, float *a0) { *r = Sleef_sqrtf1_u05cuda(*a0); } +__global__ void xsqrtf_u35(float *r, float *a0) { *r = Sleef_sqrtf1_u35cuda(*a0); } +__global__ void xhypotf_u05(float *r, float *a0, float *a1) { *r = Sleef_hypotf1_u05cuda(*a0, *a1); } +__global__ void xhypotf_u35(float *r, float *a0, float *a1) { *r = Sleef_hypotf1_u35cuda(*a0, *a1); } +__global__ void xfabsf(float *r, float *a0) { *r = Sleef_fabsf1_cuda(*a0); } +__global__ void xcopysignf(float *r, float *a0, float *a1) { *r = Sleef_copysignf1_cuda(*a0, *a1); } +__global__ void xfmaxf(float *r, float *a0, float *a1) { *r = Sleef_fmaxf1_cuda(*a0, *a1); } +__global__ void xfminf(float *r, float *a0, float *a1) { *r = Sleef_fminf1_cuda(*a0, *a1); } +__global__ void xfdimf(float *r, float *a0, float *a1) { *r = Sleef_fdimf1_cuda(*a0, *a1); } +__global__ void xtruncf(float *r, float *a0) { *r = Sleef_truncf1_cuda(*a0); } +__global__ void xfloorf(float *r, float *a0) { *r = Sleef_floorf1_cuda(*a0); } +__global__ void xceilf(float *r, float *a0) { *r = Sleef_ceilf1_cuda(*a0); } +__global__ void xroundf(float *r, float *a0) { *r = Sleef_roundf1_cuda(*a0); } +__global__ void xrintf(float *r, float *a0) { *r = Sleef_rintf1_cuda(*a0); } +__global__ void xnextafterf(float *r, float *a0, float *a1) { *r = Sleef_nextafterf1_cuda(*a0, *a1); } +__global__ void xfrfrexpf(float *r, float *a0) { *r = Sleef_frfrexpf1_cuda(*a0); } +__global__ void xexpfrexpf(float *r, float *a0) { *r = Sleef_expfrexpf1_cuda(*a0); } +__global__ void xfmodf(float *r, float *a0, float *a1) { *r = Sleef_fmodf1_cuda(*a0, *a1); } +__global__ void xremainderf(float *r, float *a0, float *a1) { *r = Sleef_remainderf1_cuda(*a0, *a1); } +__global__ void xmodff(vfloat2 *r, float *a0) { *r = Sleef_modff1_cuda(*a0); } +__global__ void xlgammaf_u1(float *r, float *a0) { *r = Sleef_lgammaf1_u10cuda(*a0); } +__global__ void xtgammaf_u1(float *r, float *a0) { *r = Sleef_tgammaf1_u10cuda(*a0); } +__global__ void xerff_u1(float *r, float *a0) { *r = Sleef_erff1_u10cuda(*a0); } +__global__ void xerfcf_u15(float *r, float *a0) { *r = Sleef_erfcf1_u15cuda(*a0); } + +// + +#define func_d_d(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint64_t u; \ + sscanf(buf, funcStr " %" PRIx64, &u); \ + *a0 = u2d(u); \ + funcName<<<1, 1>>>(r, a0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", d2u(*r)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_d2_d(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint64_t u; \ + sscanf(buf, funcStr " %" PRIx64, &u); \ + *a0 = u2d(u); \ + funcName<<<1, 1>>>(r2, a0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 " %" PRIx64 "\n", d2u(r2->x), d2u(r2->y)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_d_d_d(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint64_t u, v; \ + sscanf(buf, funcStr " %" PRIx64 " %" PRIx64, &u, &v); \ + *a0 = u2d(u); \ + *a1 = u2d(v); \ + funcName<<<1, 1>>>(r, a0, a1); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", d2u(*r)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_d_d_i(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint64_t u, v; \ + sscanf(buf, funcStr " %" PRIx64 " %" PRIx64, &u, &v); \ + *a0 = u2d(u); \ + *i0 = (int)u2d(v); \ + funcName<<<1, 1>>>(r, a0, i0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", d2u(*r)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_i_d(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint64_t u; \ + sscanf(buf, funcStr " %" PRIx64, &u); \ + *a0 = u2d(u); \ + funcName<<<1, 1>>>(i0, a0); \ + cudaDeviceSynchronize(); \ + printf("%d\n", *i0); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +// + +#define func_f_f(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint32_t u; \ + sscanf(buf, funcStr " %x", &u); \ + *b0 = u2f(u); \ + funcName<<<1, 1>>>(s, b0); \ + cudaDeviceSynchronize(); \ + printf("%x\n", f2u(*s)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_f2_f(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint32_t u; \ + sscanf(buf, funcStr " %x", &u); \ + *b0 = u2f(u); \ + funcName<<<1, 1>>>(s2, b0); \ + cudaDeviceSynchronize(); \ + printf("%x %x\n", f2u(s2->x), f2u(s2->y)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_f_f_f(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + uint32_t u, v; \ + sscanf(buf, funcStr " %x %x", &u, &v); \ + *b0 = u2f(u); \ + *b1 = u2f(v); \ + funcName<<<1, 1>>>(s, b0, b1); \ + cudaDeviceSynchronize(); \ + printf("%x\n", f2u(*s)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +// + +#define BUFSIZE 1024 + +int main(int argc, char **argv) { +#if 0 + cuInit(0); + + int ndevice; + cuDeviceGetCount(&ndevice); + if (ndevice == 0) { + fprintf(stderr, "No cuda device available\n"); + exit(0); + } + + CUdevice device; + char deviceName[1024]; + cuDeviceGet(&device, 0); + cuDeviceGetName(deviceName, 1000, device); + fprintf(stderr, "Device : %s\n", deviceName); +#endif + + cudaSetDeviceFlags(cudaDeviceScheduleSpin); + + vdouble2 *r2; + vfloat2 *s2; + double *r, *a0, *a1, *a2; + float *s, *b0, *b1, *b2; + int *i0; + cudaMallocManaged(&r , 1*sizeof(double)); + cudaMallocManaged(&r2, 1*sizeof(vdouble2)); + cudaMallocManaged(&a0, 1*sizeof(double)); + cudaMallocManaged(&a1, 1*sizeof(double)); + cudaMallocManaged(&a2, 1*sizeof(double)); + cudaMallocManaged(&s , 1*sizeof(float)); + cudaMallocManaged(&s2, 1*sizeof(vfloat2)); + cudaMallocManaged(&b0, 1*sizeof(float)); + cudaMallocManaged(&b1, 1*sizeof(float)); + cudaMallocManaged(&b2, 1*sizeof(float)); + cudaMallocManaged(&i0, 1*sizeof(int)); + + printf("3\n"); + fflush(stdout); + + char buf[BUFSIZE]; + if (fgets(buf, BUFSIZE-1, stdin)) {} + + while(!feof(stdin)) { + func_d_d("sin", xsin); + func_d_d("cos", xcos); + func_d_d("tan", xtan); + func_d_d("asin", xasin); + func_d_d("acos", xacos); + func_d_d("atan", xatan); + func_d_d("log", xlog); + func_d_d("exp", xexp); + + func_d_d("sqrt", xsqrt); + func_d_d("sqrt_u05", xsqrt_u05); + func_d_d("sqrt_u35", xsqrt_u35); + func_d_d("cbrt", xcbrt); + func_d_d("cbrt_u1", xcbrt_u1); + + func_d_d("sinh", xsinh); + func_d_d("cosh", xcosh); + func_d_d("tanh", xtanh); + func_d_d("sinh_u35", xsinh_u35); + func_d_d("cosh_u35", xcosh_u35); + func_d_d("tanh_u35", xtanh_u35); + func_d_d("asinh", xasinh); + func_d_d("acosh", xacosh); + func_d_d("atanh", xatanh); + + func_d_d("sin_u1", xsin_u1); + func_d_d("cos_u1", xcos_u1); + func_d_d("tan_u1", xtan_u1); + func_d_d("sinpi_u05", xsinpi_u05); + func_d_d("cospi_u05", xcospi_u05); + func_d_d("asin_u1", xasin_u1); + func_d_d("acos_u1", xacos_u1); + func_d_d("atan_u1", xatan_u1); + func_d_d("log_u1", xlog_u1); + + func_d_d("exp2", xexp2); + func_d_d("exp10", xexp10); + func_d_d("exp2_u35", xexp2_u35); + func_d_d("exp10_u35", xexp10_u35); + func_d_d("expm1", xexpm1); + func_d_d("log10", xlog10); + func_d_d("log2", xlog2); + func_d_d("log2_u35", xlog2_u35); + func_d_d("log1p", xlog1p); + func_d_d("fabs", xfabs); + func_d_d("trunc", xtrunc); + func_d_d("floor", xfloor); + func_d_d("ceil", xceil); + func_d_d("round", xround); + func_d_d("rint", xrint); + func_d_d("frfrexp", xfrfrexp); + func_d_d("tgamma_u1", xtgamma_u1); + func_d_d("lgamma_u1", xlgamma_u1); + func_d_d("erf_u1", xerf_u1); + func_d_d("erfc_u15", xerfc_u15); + + func_d2_d("sincos", xsincos); + func_d2_d("sincos_u1", xsincos_u1); + func_d2_d("sincospi_u35", xsincospi_u35); + func_d2_d("sincospi_u05", xsincospi_u05); + func_d2_d("modf", xmodf); + + func_d_d_d("pow", xpow); + func_d_d_d("atan2", xatan2); + func_d_d_d("atan2_u1", xatan2_u1); + func_d_d_d("hypot_u05", xhypot_u05); + func_d_d_d("hypot_u35", xhypot_u35); + func_d_d_d("copysign", xcopysign); + func_d_d_d("fmax", xfmax); + func_d_d_d("fmin", xfmin); + func_d_d_d("fdim", xfdim); + func_d_d_d("nextafter", xnextafter); + func_d_d_d("fmod", xfmod); + func_d_d_d("remainder", xremainder); + + func_d_d_i("ldexp", xldexp); + func_i_d("ilogb", xilogb); + func_i_d("expfrexp", xexpfrexp); + + // + + func_f_f("sinf", xsinf); + func_f_f("cosf", xcosf); + func_f_f("tanf", xtanf); + func_f_f("asinf", xasinf); + func_f_f("acosf", xacosf); + func_f_f("atanf", xatanf); + func_f_f("logf", xlogf); + func_f_f("expf", xexpf); + + func_f_f("sqrtf", xsqrtf); + func_f_f("sqrtf_u05", xsqrtf_u05); + func_f_f("sqrtf_u35", xsqrtf_u35); + func_f_f("cbrtf", xcbrtf); + func_f_f("cbrtf_u1", xcbrtf_u1); + + func_f_f("sinhf", xsinhf); + func_f_f("coshf", xcoshf); + func_f_f("tanhf", xtanhf); + func_f_f("sinhf_u35", xsinhf_u35); + func_f_f("coshf_u35", xcoshf_u35); + func_f_f("tanhf_u35", xtanhf_u35); + func_f_f("asinhf", xasinhf); + func_f_f("acoshf", xacoshf); + func_f_f("atanhf", xatanhf); + + func_f_f("sinf_u1", xsinf_u1); + func_f_f("cosf_u1", xcosf_u1); + func_f_f("tanf_u1", xtanf_u1); + func_f_f("sinpif_u05", xsinpif_u05); + func_f_f("cospif_u05", xcospif_u05); + func_f_f("asinf_u1", xasinf_u1); + func_f_f("acosf_u1", xacosf_u1); + func_f_f("atanf_u1", xatanf_u1); + func_f_f("logf_u1", xlogf_u1); + + func_f_f("exp2f", xexp2f); + func_f_f("exp10f", xexp10f); + func_f_f("exp2f_u35", xexp2f_u35); + func_f_f("exp10f_u35", xexp10f_u35); + func_f_f("expm1f", xexpm1f); + func_f_f("log10f", xlog10f); + func_f_f("log2f", xlog2f); + func_f_f("log2f_u35", xlog2f_u35); + func_f_f("log1pf", xlog1pf); + + func_f2_f("sincosf", xsincosf); + func_f2_f("sincosf_u1", xsincosf_u1); + func_f2_f("sincospif_u35", xsincospif_u35); + func_f2_f("sincospif_u05", xsincospif_u05); + + func_f_f_f("powf", xpowf); + func_f_f_f("atan2f", xatan2f); + func_f_f_f("atan2f_u1", xatan2f_u1); + + func_f_f("fabsf", xfabsf); + func_f_f("truncf", xtruncf); + func_f_f("floorf", xfloorf); + func_f_f("ceilf", xceilf); + func_f_f("roundf", xroundf); + func_f_f("rintf", xrintf); + func_f_f("frfrexpf", xfrfrexpf); + + func_f_f_f("hypotf_u05", xhypotf_u05); + func_f_f_f("hypotf_u35", xhypotf_u35); + func_f_f_f("copysignf", xcopysignf); + func_f_f_f("fmaxf", xfmaxf); + func_f_f_f("fminf", xfminf); + func_f_f_f("fdimf", xfdimf); + func_f_f_f("nextafterf", xnextafterf); + func_f_f_f("fmodf", xfmodf); + func_f_f_f("remainderf", xremainderf); + + func_f2_f("modff", xmodff); + + func_f_f("tgammaf_u1", xtgammaf_u1); + func_f_f("lgammaf_u1", xlgammaf_u1); + func_f_f("erff_u1", xerff_u1); + func_f_f("erfcf_u15", xerfcf_u15); + + func_f_f("fastsinf_u3500", xfastsinf_u3500); + func_f_f("fastcosf_u3500", xfastcosf_u3500); + func_f_f_f("fastpowf_u3500", xfastpowf_u3500); + } + + return 0; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutsimd.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutsimd.c new file mode 100644 index 0000000000000..dd8ee96ba36a5 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/iutsimd.c @@ -0,0 +1,859 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#if defined(_MSC_VER) +#define STDIN_FILENO 0 +#else +#include +#include +#endif + +#include "quaddef.h" +#include "misc.h" + +#if !defined(USE_INLINE_HEADER) +#include "sleef.h" +#else // #if !defined(USE_INLINE_HEADER) +#include +#include +#include +#include + +#if defined(__AVX2__) || defined(__aarch64__) || defined(__arm__) || defined(__powerpc64__) +#ifndef FP_FAST_FMA +#define FP_FAST_FMA +#endif +#endif + +#if defined(_MSC_VER) && !defined(__STDC__) +#define __STDC__ 1 +#endif + +#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) +#include +#endif + +#if (defined(_MSC_VER)) +#include +#endif + +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#include +#endif + +#if defined(__ARM_FEATURE_SVE) +#include +#endif + +#if defined(__riscv) && defined(__riscv_v) +#include +#endif + +#if defined(__VSX__) +#include +#endif + +#if defined(__VX__) +#include +#endif + +#define SLEEF_ALWAYS_INLINE inline +#define SLEEF_INLINE +#define SLEEF_CONST +#include USE_INLINE_HEADER +#include MACRO_ONLY_HEADER + +#ifndef ENABLE_PUREC_SCALAR +#include "sleefinline_purec_scalar.h" +#endif + +#endif // #if !defined(USE_INLINE_HEADER) + +#include "testerutil.h" + +#define DORENAME + +#ifdef ENABLE_SSE2 +#include "renamesse2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helpersse2.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_SSE4 +#include "renamesse4.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 4 +#include "helpersse2.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_AVX +#include "renameavx.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_FMA4 +#include "renamefma4.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 4 +#include "helperavx.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_AVX2 +#include "renameavx2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx2.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_AVX2128 +#include "renameavx2128.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx2_128.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_AVX512F +#include "renameavx512f.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx512f.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_AVX512FNOFMA +#include "renameavx512fnofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperavx512f.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VECEXT +#define CONFIG 1 +#include "helpervecext.h" +#include "norename.h" +#endif + +#ifdef ENABLE_PUREC +#define CONFIG 1 +#include "helperpurec.h" +#include "norename.h" +#endif + +#ifdef ENABLE_NEON32 +#include "renameneon32.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperneon32.h" +typedef Sleef_float32x4_t_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_NEON32VFPV4 +#include "renameneon32vfpv4.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 4 +#include "helperneon32.h" +typedef Sleef_float32x4_t_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_ADVSIMD +#include "renameadvsimd.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperadvsimd.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_ADVSIMDNOFMA +#include "renameadvsimdnofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperadvsimd.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_DSP128 +#define CONFIG 2 +#include "helpersse2.h" +#include "renamedsp128.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_SVE +#include "renamesve.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helpersve.h" +#endif +#endif + +#ifdef ENABLE_SVENOFMA +#include "renamesvenofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helpersve.h" +#endif +#endif + +#ifdef ENABLE_DSP256 +#define CONFIG 1 +#include "helperavx.h" +#include "renamedsp256.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_VSX +#include "renamevsx.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperpower_128.h" +#include "renamevsx.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VSXNOFMA +#include "renamevsxnofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperpower_128.h" +#include "renamevsxnofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VSX3 +#include "renamevsx3.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 3 +#include "helperpower_128.h" +#include "renamevsx3.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VSX3NOFMA +#include "renamevsx3nofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 4 +#include "helperpower_128.h" +#include "renamevsx3nofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VXE +#include "renamevxe.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 140 +#include "helpers390x_128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VXENOFMA +#include "renamevxenofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 141 +#include "helpers390x_128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VXE2 +#include "renamevxe2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 150 +#include "helpers390x_128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_VXE2NOFMA +#include "renamevxe2nofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 151 +#include "helpers390x_128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_DSPPOWER_128 +#define CONFIG 1 +#include "helperpower_128.h" +#include "renamedsp128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_DSPS390X_128 +#define CONFIG 140 +#include "helpers390x_128.h" +#include "renamedsp128.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_RVVM1 +#include "renamervvm1.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperrvv.h" +#endif +#endif + +#ifdef ENABLE_RVVM1NOFMA +#include "renamervvm1nofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperrvv.h" +#endif +#endif + +#ifdef ENABLE_RVVM2 +#include "renamervvm2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperrvv.h" +#endif +#endif + +#ifdef ENABLE_RVVM2NOFMA +#include "renamervvm2nofma.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperrvv.h" +#endif +#endif + +#ifdef ENABLE_PUREC_SCALAR +#include "renamepurec_scalar.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperpurec_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#include "renamepurecfma_scalar.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperpurec_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif +#endif + +#ifdef ENABLE_DSP_SCALAR +#include "renamedspscalar.h" +#define CONFIG 1 +#include "helperpurec_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif + +#ifdef USE_INLINE_HEADER +#define CONCAT_SIMD_SUFFIX_(keyword, suffix) keyword ## suffix +#define CONCAT_SIMD_SUFFIX(keyword, suffix) CONCAT_SIMD_SUFFIX_(keyword, suffix) +#define vmask CONCAT_SIMD_SUFFIX(vmask, SIMD_SUFFIX) +#define vopmask CONCAT_SIMD_SUFFIX(vopmask, SIMD_SUFFIX) +#define vdouble CONCAT_SIMD_SUFFIX(vdouble, SIMD_SUFFIX) +#define vint CONCAT_SIMD_SUFFIX(vint, SIMD_SUFFIX) +#define vfloat CONCAT_SIMD_SUFFIX(vfloat, SIMD_SUFFIX) +#define vint2 CONCAT_SIMD_SUFFIX(vint2, SIMD_SUFFIX) +#define vdouble2 CONCAT_SIMD_SUFFIX(vdouble2, SIMD_SUFFIX) +#define vfloat2 CONCAT_SIMD_SUFFIX(vfloat2, SIMD_SUFFIX) +#define vd2getx_vd_vd2 CONCAT_SIMD_SUFFIX(vd2getx_vd_vd2, SIMD_SUFFIX) +#define vd2gety_vd_vd2 CONCAT_SIMD_SUFFIX(vd2gety_vd_vd2, SIMD_SUFFIX) +#define vf2getx_vf_vf2 CONCAT_SIMD_SUFFIX(vf2getx_vf_vf2, SIMD_SUFFIX) +#define vf2gety_vf_vf2 CONCAT_SIMD_SUFFIX(vf2gety_vf_vf2, SIMD_SUFFIX) +#define vloadu_vd_p CONCAT_SIMD_SUFFIX(vloadu_vd_p, SIMD_SUFFIX) +#define vstoreu_v_p_vd CONCAT_SIMD_SUFFIX(vstoreu_v_p_vd, SIMD_SUFFIX) +#define vloadu_vf_p CONCAT_SIMD_SUFFIX(vloadu_vf_p, SIMD_SUFFIX) +#define vstoreu_v_p_vf CONCAT_SIMD_SUFFIX(vstoreu_v_p_vf, SIMD_SUFFIX) +#define vloadu_vi_p CONCAT_SIMD_SUFFIX(vloadu_vi_p, SIMD_SUFFIX) +#define vstoreu_v_p_vi CONCAT_SIMD_SUFFIX(vstoreu_v_p_vi, SIMD_SUFFIX) +#endif + +// + +int check_feature(double d, float f) { +#ifdef ENABLE_DP + { + double s[VECTLENDP]; + int i; + for(i=0;i +#include +#include +#include + +#include + +#define N 64 +#define M 256 + +double r0[N], a0[N], a1[N], a2[N]; + +void do_libm() { for(int i=0;i +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "misc.h" +#include "testerutil.h" + +#ifndef NANf +#define NANf ((float)NAN) +#endif + +void stop(char *mes) { + fprintf(stderr, "%s\n", mes); + exit(-1); +} + +int ptoc[2], ctop[2]; +int pid; +FILE *fpctop; + +extern char **environ; + +void startChild(const char *path, char *const argv[]) { + pipe(ptoc); + pipe(ctop); + + pid = fork(); + + assert(pid != -1); + + if (pid == 0) { + // child process + char buf0[1], buf1[1]; + + close(ptoc[1]); + close(ctop[0]); + + fflush(stdin); + fflush(stdout); + + if (dup2(ptoc[0], fileno(stdin)) == -1) exit(-1); + if (dup2(ctop[1], fileno(stdout)) == -1) exit(-1); + + setvbuf(stdin, buf0, _IONBF,0); + setvbuf(stdout, buf1, _IONBF,0); + + fflush(stdin); + fflush(stdout); + +#if !defined(__APPLE__) && !defined(__FreeBSD__) + execvpe(path, argv, environ); +#else + execvp(path, argv); +#endif + + fprintf(stderr, "execvp in startChild : %s\n", strerror(errno)); + + exit(-1); + } + + // parent process + + close(ptoc[0]); + close(ctop[1]); +} + +// + +#define child_d_d(funcStr, arg) do { \ + char str[256]; \ + uint64_t u; \ + sprintf(str, funcStr " %" PRIx64 "\n", d2u(arg)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64, &u); \ + return u2d(u); \ + } while(0) + +#define child_d2_d(funcStr, arg) do { \ + char str[256]; \ + uint64_t u, v; \ + sprintf(str, funcStr " %" PRIx64 "\n", d2u(arg)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 " %" PRIx64, &u, &v); \ + Sleef_double2 ret; \ + ret.x = u2d(u); \ + ret.y = u2d(v); \ + return ret; \ + } while(0) + +#define child_d_d_d(funcStr, arg1, arg2) do { \ + char str[256]; \ + uint64_t u; \ + sprintf(str, funcStr " %" PRIx64 " %" PRIx64 "\n", d2u(arg1), d2u(arg2)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64, &u); \ + return u2d(u); \ + } while(0) + +double child_sin(double x) { child_d_d("sin", x); } +double child_cos(double x) { child_d_d("cos", x); } +double child_tan(double x) { child_d_d("tan", x); } +double child_asin(double x) { child_d_d("asin", x); } +double child_acos(double x) { child_d_d("acos", x); } +double child_atan(double x) { child_d_d("atan", x); } +double child_log(double x) { child_d_d("log", x); } +double child_exp(double x) { child_d_d("exp", x); } +double child_cbrt(double x) { child_d_d("cbrt", x); } +double child_atan2(double y, double x) { child_d_d_d("atan2", y, x); } +Sleef_double2 child_sincos(double x) { child_d2_d("sincos", x); } + +double child_sin_u1(double x) { child_d_d("sin_u1", x); } +double child_cos_u1(double x) { child_d_d("cos_u1", x); } +double child_tan_u1(double x) { child_d_d("tan_u1", x); } +double child_asin_u1(double x) { child_d_d("asin_u1", x); } +double child_acos_u1(double x) { child_d_d("acos_u1", x); } +double child_atan_u1(double x) { child_d_d("atan_u1", x); } +double child_log_u1(double x) { child_d_d("log_u1", x); } +double child_exp_u1(double x) { child_d_d("exp_u1", x); } +double child_cbrt_u1(double x) { child_d_d("cbrt_u1", x); } +double child_atan2_u1(double y, double x) { child_d_d_d("atan2_u1", y, x); } +Sleef_double2 child_sincos_u1(double x) { child_d2_d("sincos_u1", x); } + +double child_pow(double x, double y) { child_d_d_d("pow", x, y); } +double child_sqrt(double x) { child_d_d("sqrt", x); } +double child_sqrt_u05(double x) { child_d_d("sqrt_u05", x); } +double child_sqrt_u35(double x) { child_d_d("sqrt_u35", x); } + +double child_sinh(double x) { child_d_d("sinh", x); } +double child_cosh(double x) { child_d_d("cosh", x); } +double child_tanh(double x) { child_d_d("tanh", x); } +double child_sinh_u35(double x) { child_d_d("sinh_u35", x); } +double child_cosh_u35(double x) { child_d_d("cosh_u35", x); } +double child_tanh_u35(double x) { child_d_d("tanh_u35", x); } +double child_asinh(double x) { child_d_d("asinh", x); } +double child_acosh(double x) { child_d_d("acosh", x); } +double child_atanh(double x) { child_d_d("atanh", x); } + +double child_log10(double x) { child_d_d("log10", x); } +double child_log2(double x) { child_d_d("log2", x); } +double child_log2_u35(double x) { child_d_d("log2_u35", x); } +double child_log1p(double x) { child_d_d("log1p", x); } +double child_exp2(double x) { child_d_d("exp2", x); } +double child_exp10(double x) { child_d_d("exp10", x); } +double child_exp2_u35(double x) { child_d_d("exp2_u35", x); } +double child_exp10_u35(double x) { child_d_d("exp10_u35", x); } +double child_expm1(double x) { child_d_d("expm1", x); } + +Sleef_double2 child_sincospi_u05(double x) { child_d2_d("sincospi_u05", x); } +Sleef_double2 child_sincospi_u35(double x) { child_d2_d("sincospi_u35", x); } +double child_sinpi_u05(double x) { child_d_d("sinpi_u05", x); } +double child_cospi_u05(double x) { child_d_d("cospi_u05", x); } + +double child_hypot_u05(double x, double y) { child_d_d_d("hypot_u05", x, y); } +double child_hypot_u35(double x, double y) { child_d_d_d("hypot_u35", x, y); } +double child_copysign(double x, double y) { child_d_d_d("copysign", x, y); } +double child_fmax(double x, double y) { child_d_d_d("fmax", x, y); } +double child_fmin(double x, double y) { child_d_d_d("fmin", x, y); } +double child_fdim(double x, double y) { child_d_d_d("fdim", x, y); } +double child_nextafter(double x, double y) { child_d_d_d("nextafter", x, y); } +double child_fmod(double x, double y) { child_d_d_d("fmod", x, y); } +double child_remainder(double x, double y) { child_d_d_d("remainder", x, y); } +double child_fabs(double x) { child_d_d("fabs", x); } +double child_trunc(double x) { child_d_d("trunc", x); } +double child_floor(double x) { child_d_d("floor", x); } +double child_ceil(double x) { child_d_d("ceil", x); } +double child_round(double x) { child_d_d("round", x); } +double child_rint(double x) { child_d_d("rint", x); } +double child_frfrexp(double x) { child_d_d("frfrexp", x); } +Sleef_double2 child_modf(double x) { child_d2_d("modf", x); } +double child_tgamma_u1(double x) { child_d_d("tgamma_u1", x); } +double child_lgamma_u1(double x) { child_d_d("lgamma_u1", x); } +double child_erf_u1(double x) { child_d_d("erf_u1", x); } +double child_erfc_u15(double x) { child_d_d("erfc_u15", x); } + +// + +double child_ldexp(double x, int q) { + char str[256]; + uint64_t u; + + sprintf(str, "ldexp %" PRIx64 " %" PRIx64 "\n", d2u(x), d2u(q)); + write(ptoc[1], str, strlen(str)); + if (fgets(str, 255, fpctop) == NULL) stop("child_ldexp"); + sscanf(str, "%" PRIx64, &u); + return u2d(u); +} + +int child_ilogb(double x) { + char str[256]; + int i; + + sprintf(str, "ilogb %" PRIx64 "\n", d2u(x)); + write(ptoc[1], str, strlen(str)); + if (fgets(str, 255, fpctop) == NULL) stop("child_ilogb"); + sscanf(str, "%d", &i); + return i; +} + +// + +#define child_f_f(funcStr, arg) do { \ + char str[256]; \ + uint32_t u; \ + sprintf(str, funcStr " %x\n", f2u(arg)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%x", &u); \ + return u2f(u); \ + } while(0) + +#define child_f2_f(funcStr, arg) do { \ + char str[256]; \ + uint32_t u, v; \ + sprintf(str, funcStr " %x\n", f2u(arg)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%x %x", &u, &v); \ + Sleef_float2 ret; \ + ret.x = u2f(u); \ + ret.y = u2f(v); \ + return ret; \ + } while(0) + +#define child_f_f_f(funcStr, arg1, arg2) do { \ + char str[256]; \ + uint32_t u; \ + sprintf(str, funcStr " %x %x\n", f2u(arg1), f2u(arg2)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%x", &u); \ + return u2f(u); \ + } while(0) + +float child_sinf(float x) { child_f_f("sinf", x); } +float child_cosf(float x) { child_f_f("cosf", x); } +float child_tanf(float x) { child_f_f("tanf", x); } +float child_asinf(float x) { child_f_f("asinf", x); } +float child_acosf(float x) { child_f_f("acosf", x); } +float child_atanf(float x) { child_f_f("atanf", x); } +float child_logf(float x) { child_f_f("logf", x); } +float child_expf(float x) { child_f_f("expf", x); } +float child_cbrtf(float x) { child_f_f("cbrtf", x); } +float child_atan2f(float y, float x) { child_f_f_f("atan2f", y, x); } +Sleef_float2 child_sincosf(float x) { child_f2_f("sincosf", x); } + +float child_sinf_u1(float x) { child_f_f("sinf_u1", x); } +float child_cosf_u1(float x) { child_f_f("cosf_u1", x); } +float child_tanf_u1(float x) { child_f_f("tanf_u1", x); } +float child_asinf_u1(float x) { child_f_f("asinf_u1", x); } +float child_acosf_u1(float x) { child_f_f("acosf_u1", x); } +float child_atanf_u1(float x) { child_f_f("atanf_u1", x); } +float child_logf_u1(float x) { child_f_f("logf_u1", x); } +float child_expf_u1(float x) { child_f_f("expf_u1", x); } +float child_cbrtf_u1(float x) { child_f_f("cbrtf_u1", x); } +float child_atan2f_u1(float y, float x) { child_f_f_f("atan2f_u1", y, x); } +Sleef_float2 child_sincosf_u1(float x) { child_f2_f("sincosf_u1", x); } + +float child_powf(float x, float y) { child_f_f_f("powf", x, y); } +float child_sqrtf(float x) { child_f_f("sqrtf", x); } +float child_sqrtf_u05(float x) { child_f_f("sqrtf_u05", x); } +float child_sqrtf_u35(float x) { child_f_f("sqrtf_u35", x); } + +float child_sinhf(float x) { child_f_f("sinhf", x); } +float child_coshf(float x) { child_f_f("coshf", x); } +float child_tanhf(float x) { child_f_f("tanhf", x); } +float child_sinhf_u35(float x) { child_f_f("sinhf_u35", x); } +float child_coshf_u35(float x) { child_f_f("coshf_u35", x); } +float child_tanhf_u35(float x) { child_f_f("tanhf_u35", x); } +float child_asinhf(float x) { child_f_f("asinhf", x); } +float child_acoshf(float x) { child_f_f("acoshf", x); } +float child_atanhf(float x) { child_f_f("atanhf", x); } + +float child_log10f(float x) { child_f_f("log10f", x); } +float child_log2f(float x) { child_f_f("log2f", x); } +float child_log2f_u35(float x) { child_f_f("log2f_u35", x); } +float child_log1pf(float x) { child_f_f("log1pf", x); } +float child_exp2f(float x) { child_f_f("exp2f", x); } +float child_exp10f(float x) { child_f_f("exp10f", x); } +float child_exp2f_u35(float x) { child_f_f("exp2f_u35", x); } +float child_exp10f_u35(float x) { child_f_f("exp10f_u35", x); } +float child_expm1f(float x) { child_f_f("expm1f", x); } + +Sleef_float2 child_sincospif_u05(float x) { child_f2_f("sincospif_u05", x); } +Sleef_float2 child_sincospif_u35(float x) { child_f2_f("sincospif_u35", x); } +float child_sinpif_u05(float x) { child_f_f("sinpif_u05", x); } +float child_cospif_u05(float x) { child_f_f("cospif_u05", x); } + +float child_hypotf_u05(float x, float y) { child_f_f_f("hypotf_u05", x, y); } +float child_hypotf_u35(float x, float y) { child_f_f_f("hypotf_u35", x, y); } +float child_copysignf(float x, float y) { child_f_f_f("copysignf", x, y); } +float child_fmaxf(float x, float y) { child_f_f_f("fmaxf", x, y); } +float child_fminf(float x, float y) { child_f_f_f("fminf", x, y); } +float child_fdimf(float x, float y) { child_f_f_f("fdimf", x, y); } +float child_nextafterf(float x, float y) { child_f_f_f("nextafterf", x, y); } +float child_fmodf(float x, float y) { child_f_f_f("fmodf", x, y); } +float child_remainderf(float x, float y) { child_f_f_f("remainderf", x, y); } +float child_fabsf(float x) { child_f_f("fabsf", x); } +float child_truncf(float x) { child_f_f("truncf", x); } +float child_floorf(float x) { child_f_f("floorf", x); } +float child_ceilf(float x) { child_f_f("ceilf", x); } +float child_roundf(float x) { child_f_f("roundf", x); } +float child_rintf(float x) { child_f_f("rintf", x); } +float child_frfrexpf(float x) { child_f_f("frfrexpf", x); } +Sleef_float2 child_modff(float x) { child_f2_f("modff", x); } +float child_tgammaf_u1(float x) { child_f_f("tgammaf_u1", x); } +float child_lgammaf_u1(float x) { child_f_f("lgammaf_u1", x); } +float child_erff_u1(float x) { child_f_f("erff_u1", x); } +float child_erfcf_u15(float x) { child_f_f("erfcf_u15", x); } + +float child_fastsinf_u3500(float x) { child_f_f("fastsinf_u3500", x); } +float child_fastcosf_u3500(float x) { child_f_f("fastcosf_u3500", x); } +float child_fastpowf_u3500(float x, float y) { child_f_f_f("fastpowf_u3500", x, y); } + +float child_ldexpf(float x, int q) { + char str[256]; + uint32_t u; + + sprintf(str, "ldexpf %x %x\n", f2u(x), f2u(q)); + write(ptoc[1], str, strlen(str)); + if (fgets(str, 255, fpctop) == NULL) stop("child_powf"); + sscanf(str, "%x", &u); + return u2f(u); +} + +int child_ilogbf(float x) { + char str[256]; + int i; + + sprintf(str, "ilogbf %x\n", f2u(x)); + write(ptoc[1], str, strlen(str)); + if (fgets(str, 255, fpctop) == NULL) stop("child_ilogbf"); + sscanf(str, "%d", &i); + return i; +} + +// + +int allTestsPassed = 1; + +void showResult(int success) { + if (!success) allTestsPassed = 0; + fprintf(stderr, "%s\n", success ? "OK" : "NG **************"); + + if (!success) { + fprintf(stderr, "\n\n*** Test failed\n"); + exit(-1); + } +} + +int enableDP = 0, enableSP = 0, deterministicMode = 0; + +void do_test() { + mpfr_t frc, frt, frx, fry, frz; + mpfr_inits(frc, frt, frx, fry, frz, NULL); + + int i, j; + int64_t i64; + double d, x, y; + int success = 1; + + if (enableDP) { + fprintf(stderr, "Denormal/nonnumber test atan2(y, x)\n\n"); + + fprintf(stderr, "If y is +0 and x is -0, +pi is returned : "); + showResult(child_atan2(+0.0, -0.0) == M_PI); + + fprintf(stderr, "If y is -0 and x is -0, -pi is returned : "); + showResult(child_atan2(-0.0, -0.0) == -M_PI); + + fprintf(stderr, "If y is +0 and x is +0, +0 is returned : "); + showResult(isPlusZero(child_atan2(+0.0, +0.0))); + + fprintf(stderr, "If y is -0 and x is +0, -0 is returned : "); + showResult(isMinusZero(child_atan2(-0.0, +0.0))); + + fprintf(stderr, "If y is positive infinity and x is negative infinity, +3*pi/4 is returned : "); + showResult(child_atan2(POSITIVE_INFINITY, NEGATIVE_INFINITY) == 3*M_PI/4); + + fprintf(stderr, "If y is negative infinity and x is negative infinity, -3*pi/4 is returned : "); + showResult(child_atan2(NEGATIVE_INFINITY, NEGATIVE_INFINITY) == -3*M_PI/4); + + fprintf(stderr, "If y is positive infinity and x is positive infinity, +pi/4 is returned : "); + showResult(child_atan2(POSITIVE_INFINITY, POSITIVE_INFINITY) == M_PI/4); + + fprintf(stderr, "If y is negative infinity and x is positive infinity, -pi/4 is returned : "); + showResult(child_atan2(NEGATIVE_INFINITY, POSITIVE_INFINITY) == -M_PI/4); + + { + fprintf(stderr, "If y is +0 and x is less than 0, +pi is returned : "); + + double ya[] = { +0.0 }; + double xa[] = { -100000.5, -100000, -3, -2.5, -2, -1.5, -1.0, -0.5 }; + + for(i=0;i 1e+300) continue; + cmpDenorm_d_d(mpfr_fmod, child_fmod, xa[i], ya[j]); + } + } + + showResult(success); + } + + { + fprintf(stderr, "remainder denormal/nonnumber test : "); + + double xa[] = { +0.0, -0.0, +1, -1, +1e+100, -1e+100, 1.7e+308, DBL_MAX, -DBL_MAX, DBL_MIN, -DBL_MIN, POSITIVE_INFINITY, NEGATIVE_INFINITY, NAN }; + double ya[] = { +0.0, -0.0, +1, -1, +1e+100, -1e+100, 1.0e+308, DBL_MAX, -DBL_MAX, DBL_MIN, -DBL_MIN, POSITIVE_INFINITY, NEGATIVE_INFINITY, NAN }; + + for(i=0;i 1e+300) continue; + cmpDenorm_d_d(mpfr_remainder, child_remainder, xa[i], ya[j]); + } + } + + showResult(success); + } + + { + fprintf(stderr, "trunc denormal/nonnumber test : "); + double xa[] = { +0.0, -0.0, +1, -1, +1e+10, -1e+10, DBL_MAX, -DBL_MAX, DBL_MIN, -DBL_MIN, POSITIVE_INFINITY, NEGATIVE_INFINITY, NAN }; + for(i=0;i 1e+38) continue; + cmpDenorm_f_f(mpfr_fmod, child_fmodf, xa[i], ya[j]); + } + } + } else { + float xa[] = { +0.0, -0.0, +1, -1, +1e+30, -1e+30, FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + float ya[] = { +0.0, -0.0, +1, -1, +1e+30, -1e+30, FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + for(i=0;i 1e+38) continue; + cmpDenorm_f_f(mpfr_fmod, child_fmodf, xa[i], ya[j]); + } + } + } + + showResult(success); + } + + { + fprintf(stderr, "remainderf denormal/nonnumber test : "); + + if (enableFlushToZero) { + float xa[] = { +0.0, -0.0, +1, -1, +1e+30, -1e+30, FLT_MAX, -FLT_MAX, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + float ya[] = { +0.0, -0.0, +1, -1, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + for(i=0;i 1e+38) continue; + cmpDenorm_f_f(mpfr_remainder, child_remainderf, xa[i], ya[j]); + } + } + } else { + float xa[] = { +0.0, -0.0, +1, -1, +1e+30, -1e+30, FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + float ya[] = { +0.0, -0.0, +1, -1, +1e+30, -1e+30, FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + for(i=0;i 1e+38) continue; + cmpDenorm_f_f(mpfr_remainder, child_remainderf, xa[i], ya[j]); + } + } + } + + showResult(success); + } + + { + fprintf(stderr, "truncf denormal/nonnumber test : "); + float xa[] = { +0.0, -0.0, +1, -1, +1e+10, -1e+10, FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, POSITIVE_INFINITYf, NEGATIVE_INFINITYf, NAN }; + for(i=0;i bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", argx, childFunc(argx), mpfr_get_d(frc, GMP_RNDN), countULPdp(childFunc(argx), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyNR_d(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, argx, GMP_RNDN); \ + mpfrFunc(frc, frx); \ + if (countULPdp(childFunc(argx), frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", argx, childFunc(argx), mpfr_get_d(frc, GMP_RNDN), countULPdp(childFunc(argx), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_d_d(mpfrFunc, childFunc, argx, argy, bound) do { \ + mpfr_set_d(frx, argx, GMP_RNDN); \ + mpfr_set_d(fry, argy, GMP_RNDN); \ + mpfrFunc(frc, frx, fry, GMP_RNDN); \ + if (countULPdp(childFunc(argx, argy), frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", \ + argx, argy, childFunc(argx, argy), mpfr_get_d(frc, GMP_RNDN), countULPdp(childFunc(argx, argy), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyX_d(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, argx, GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + Sleef_double2 d2 = childFunc(argx); \ + if (countULPdp(d2.x, frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", argx, d2.x, mpfr_get_d(frc, GMP_RNDN), countULPdp(d2.x, frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyY_d(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, argx, GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + Sleef_double2 d2 = childFunc(argx); \ + if (countULPdp(d2.y, frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", argx, d2.y, mpfr_get_d(frc, GMP_RNDN), countULPdp(d2.y, frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + + // + + fprintf(stderr, "\nAccuracy test\n"); + + // + + if (enableDP) { + // 64 > 53(=number of bits in DP mantissa) + mpfr_set_default_prec(64); + + fprintf(stderr, "hypot_u35 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_hypot, child_hypot_u35, y, x, 3.5); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_hypot, child_hypot_u35, y, x, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "hypot_u05 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_hypot, child_hypot_u05, y, x, 0.5); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_hypot, child_hypot_u05, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "copysign : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_copysign, child_copysign, y, x, 0); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_copysign, child_copysign, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fmax : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_max, child_fmax, y, x, 0); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_max, child_fmax, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fmin : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_min, child_fmin, y, x, 0); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_min, child_fmin, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fdim : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_dim, child_fdim, y, x, 0.5); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_dim, child_fdim, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "fmod : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_fmod, child_fmod, y, x, 0.5); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_fmod, child_fmod, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "remainder : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_remainder, child_remainder, y, x, 0.5); + } + for(y = -1e+10;y < 1e+10 && success;y += 1.51e+8) { + for(x = -1e+10;x < 1e+10 && success;x += 1.51e+8) checkAccuracy_d_d(mpfr_remainder, child_remainder, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "trunc : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_trunc, child_trunc, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_d(mpfr_trunc, child_trunc, d, 0); + { + double start = u2d(d2u((double)(INT64_C(1) << 52))-20), end = u2d(d2u((double)(INT64_C(1) << 52))+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_trunc, child_trunc, d, 0); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_trunc, child_trunc, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "floor : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_floor, child_floor, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_d(mpfr_floor, child_floor, d, 0); + { + double start = u2d(d2u((double)(INT64_C(1) << 52))-20), end = u2d(d2u((double)(INT64_C(1) << 52))+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_floor, child_floor, d, 0); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_floor, child_floor, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "ceil : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_ceil, child_ceil, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_d(mpfr_ceil, child_ceil, d, 0); + { + double start = u2d(d2u((double)(INT64_C(1) << 52))-20), end = u2d(d2u((double)(INT64_C(1) << 52))+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_ceil, child_ceil, d, 0); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_ceil, child_ceil, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "round : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_round, child_round, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_d(mpfr_round, child_round, d, 0); + { + double start = u2d(d2u((double)(INT64_C(1) << 52))-20), end = u2d(d2u((double)(INT64_C(1) << 52))+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_round, child_round, d, 0); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyNR_d(mpfr_round, child_round, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "rint : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_rint, child_rint, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracy_d(mpfr_rint, child_rint, d, 0); + { + double start = u2d(d2u((double)(INT64_C(1) << 52))-20), end = u2d(d2u((double)(INT64_C(1) << 52))+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_rint, child_rint, d, 0); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_rint, child_rint, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "sin : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_sin, child_sin, d, 3.5); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_sin, child_sin, d, 3.5); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_sin, child_sin, pow(2.16, i), 3.5); + for(i64=(int64_t)-1e+14;i64<(int64_t)1e+14 && success;i64+=(int64_t)1e+12) { + double start = u2d(d2u(M_PI_4 * i64)-20), end = u2d(d2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_sin, child_sin, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sin_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_sin, child_sin_u1, d, 1.0); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_sin, child_sin_u1, d, 1.0); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_sin, child_sin_u1, pow(2.16, i), 1.0); + for(i64=(int64_t)-1e+14;i64<(int64_t)1e+14 && success;i64+=(int64_t)1e+12) { + double start = u2d(d2u(M_PI_4 * i64)-20), end = u2d(d2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_sin, child_sin_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincos : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyX_d(mpfr_sin, child_sincos, d, 3.5); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracyX_d(mpfr_sin, child_sincos, d, 3.5); + for(i = 0;i < 920 && success;i++) checkAccuracyX_d(mpfr_sin, child_sincos, pow(2.16, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sin, child_sincos, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincos_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyX_d(mpfr_sin, child_sincos_u1, d, 1.0); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracyX_d(mpfr_sin, child_sincos_u1, d, 1.0); + for(i = 0;i < 920 && success;i++) checkAccuracyX_d(mpfr_sin, child_sincos_u1, pow(2.16, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sin, child_sincos_u1, d, 1.0); + } + showResult(success); + + // + + // 1280 > 1024(=maximum DP exponent) + 53(=number of bits in DP mantissa) + mpfr_set_default_prec(1280); + + fprintf(stderr, "sin in sincospi_u35 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u35, d, 3.5); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u35, d, 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u35, d, 3.5); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincospi_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u05, d, 0.506); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyX_d(mpfr_sinpi, child_sincospi_u05, d, 0.506); + } + showResult(success); + + // + + fprintf(stderr, "sinpi_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracy_d(mpfr_sinpi, child_sinpi_u05, d, 0.506); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_sinpi, child_sinpi_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_sinpi, child_sinpi_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_sinpi, child_sinpi_u05, d, 0.506); + } + showResult(success); + + // + + fprintf(stderr, "cospi_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracy_d(mpfr_cospi, child_cospi_u05, d, 0.506); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_cospi, child_cospi_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_cospi, child_cospi_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_cospi, child_cospi_u05, d, 0.506); + } + showResult(success); + + mpfr_set_default_prec(64); + + // + + fprintf(stderr, "cos : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_cos, child_cos, d, 3.5); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_cos, child_cos, d, 3.5); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_cos, child_cos, pow(2.16, i), 3.5); + for(i64=(int64_t)-1e+14;i64<(int64_t)1e+14 && success;i64+=(int64_t)1e+12) { + double start = u2d(d2u(M_PI_4 * i64)-20), end = u2d(d2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_cos, child_cos, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cos_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_cos, child_cos_u1, d, 1.0); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_cos, child_cos_u1, d, 1.0); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_cos, child_cos_u1, pow(2.16, i), 1.0); + for(i64=(int64_t)-1e+14;i64<(int64_t)1e+14 && success;i64+=(int64_t)1e+12) { + double start = u2d(d2u(M_PI_4 * i64)-20), end = u2d(d2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_cos, child_cos_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincos : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyY_d(mpfr_cos, child_sincos, d, 3.5); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracyY_d(mpfr_cos, child_sincos, d, 3.5); + for(i = 0;i < 920 && success;i++) checkAccuracyY_d(mpfr_cos, child_sincos, pow(2.16, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cos, child_sincos, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincos_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyY_d(mpfr_cos, child_sincos_u1, d, 1.0); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracyY_d(mpfr_cos, child_sincos_u1, d, 1.0); + for(i = 0;i < 920 && success;i++) checkAccuracyY_d(mpfr_cos, child_sincos_u1, pow(2.16, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cos, child_sincos_u1, d, 1.0); + } + showResult(success); + + // + + mpfr_set_default_prec(1280); + + fprintf(stderr, "cos in sincospi_u35 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyY_d(mpfr_cospi, child_sincospi_u35, d, 3.5); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u35, d, 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u35, d, 3.5); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincospi_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyY_d(mpfr_cospi, child_sincospi_u05, d, 0.506); + for(d = -1e+8-0.1;d < 1e+8 && success;d += (1e+10 + 0.1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(i)-20), end = u2d(d2u(i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2d(d2u(0.25 * i)-20), end = u2d(d2u(0.25 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracyY_d(mpfr_cospi, child_sincospi_u05, d, 0.506); + } + showResult(success); + + mpfr_set_default_prec(64); + + // + + fprintf(stderr, "tan : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_tan, child_tan, d, 3.5); + for(d = -1e+7;d < 1e+7 && success;d += 1000.1) checkAccuracy_d(mpfr_tan, child_tan, d, 3.5); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_tan, child_tan, d, 3.5); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_tan, child_tan, pow(2.16, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_tan, child_tan, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "tan_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_tan, child_tan_u1, d, 1.0); + for(d = -1e+7;d < 1e+7 && success;d += 1000.1) checkAccuracy_d(mpfr_tan, child_tan_u1, d, 1.0); + for(d = -1e+14;d < 1e+14 && success;d += (1e+10 + 0.1)) checkAccuracy_d(mpfr_tan, child_tan_u1, d, 1.0); + for(i = 0;i < 920 && success;i++) checkAccuracy_d(mpfr_tan, child_tan_u1, pow(2.16, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2d(d2u(M_PI_4 * i)-20), end = u2d(d2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2d(d2u(d)+1)) checkAccuracy_d(mpfr_tan, child_tan_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "log : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log, child_log, d, 3.5); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_d(mpfr_log, child_log, d, 3.5); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log, pow(2.1, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log, DBL_MAX * pow(0.9314821319758632, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log, pow(0.933254300796991, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log, DBL_MIN * pow(0.996323, i), 3.5); + showResult(success); + + // + + fprintf(stderr, "log_u1 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log, child_log_u1, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_d(mpfr_log, child_log_u1, d, 1.0); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log_u1, pow(2.1, i), 1.0); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log_u1, DBL_MAX * pow(0.9314821319758632, i), 1.0); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log_u1, pow(0.933254300796991, i), 1.0); + for(i=0;i<10000 && success;i+=10) checkAccuracy_d(mpfr_log, child_log_u1, DBL_MIN * pow(0.996323, i), 1.0); + showResult(success); + + // + + fprintf(stderr, "exp : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_exp, child_exp, d, 1.0); + for(d = -1000;d < 1000 && success;d += 1.1) checkAccuracy_d(mpfr_exp, child_exp, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "pow : "); + for(y = 0.1;y < 100 && success;y += 0.6) { + for(x = -100;x < 100 && success;x += 0.6) { + checkAccuracy_d_d(mpfr_pow, child_pow, x, y, 1.0); + } + } + for(y = -1000;y < 1000 && success;y += 0.1) checkAccuracy_d_d(mpfr_pow, child_pow, 2.1, y, 1.0); + showResult(success); + + // + + if (!deterministicMode) { + fprintf(stderr, "sqrt : "); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_sqrt, child_sqrt, d, 1.0); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_sqrt, child_sqrt, pow(2.1, d), 1.0); + showResult(success); + + // + + fprintf(stderr, "sqrt_u05 : "); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_sqrt, child_sqrt_u05, d, 0.506); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_sqrt, child_sqrt_u05, pow(2.1, d), 0.506); + showResult(success); + + // + + fprintf(stderr, "sqrt_u35 : "); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_sqrt, child_sqrt_u35, d, 3.5); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_sqrt, child_sqrt_u35, pow(2.1, d), 3.5); + showResult(success); + } + + // + + fprintf(stderr, "cbrt : "); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_cbrt, child_cbrt, d, 3.5); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_cbrt, child_cbrt, pow(2.1, d), 3.5); + showResult(success); + + // + + fprintf(stderr, "cbrt_u1 : "); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_cbrt, child_cbrt_u1, d, 1.0); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_d(mpfr_cbrt, child_cbrt_u1, pow(2.1, d), 1.0); + showResult(success); + + // + + fprintf(stderr, "asin : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_d(mpfr_asin, child_asin, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "asin_u1 : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_d(mpfr_asin, child_asin_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "acos : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_d(mpfr_acos, child_acos, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "acos_u1 : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_d(mpfr_acos, child_acos_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "atan : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_atan, child_atan, d, 3.5); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_atan, child_atan, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "atan_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_atan, child_atan_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_d(mpfr_atan, child_atan_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "atan2 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_atan2, child_atan2, y, x, 3.5); + } + for(y = -100;y < 100 && success;y += 1.51) { + for(x = -100;x < 100 && success;x += 1.51) checkAccuracy_d_d(mpfr_atan2, child_atan2, y, x, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "atan2_u1 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_d_d(mpfr_atan2, child_atan2_u1, y, x, 1.0); + } + for(y = -100;y < 100 && success;y += 1.51) { + for(x = -100;x < 100 && success;x += 1.51) checkAccuracy_d_d(mpfr_atan2, child_atan2_u1, y, x, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "sinh : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_sinh, child_sinh, d, 1.0); + for(d = -709;d < 709 && success;d += 0.2) checkAccuracy_d(mpfr_sinh, child_sinh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "cosh : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_cosh, child_cosh, d, 1.0); + for(d = -709;d < 709 && success;d += 0.2) checkAccuracy_d(mpfr_cosh, child_cosh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "tanh : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_tanh, child_tanh, d, 1.0); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_tanh, child_tanh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "sinh_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_sinh, child_sinh_u35, d, 3.5); + for(d = -709;d < 709 && success;d += 0.2) checkAccuracy_d(mpfr_sinh, child_sinh_u35, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "cosh_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_cosh, child_cosh_u35, d, 3.5); + for(d = -709;d < 709 && success;d += 0.2) checkAccuracy_d(mpfr_cosh, child_cosh_u35, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "tanh_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_tanh, child_tanh_u35, d, 3.5); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_tanh, child_tanh_u35, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "asinh : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_asinh, child_asinh, d, 1.0); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_asinh, child_asinh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "acosh : "); + for(d = 1;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_acosh, child_acosh, d, 1.0); + for(d = 1;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_acosh, child_acosh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "atanh : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_atanh, child_atanh, d, 1.0); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_atanh, child_atanh, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "exp2 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_exp2, child_exp2, d, 1.0); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_exp2, child_exp2, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "exp10 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_exp10, child_exp10, d, 1.0); + for(d = -300;d < 300 && success;d += 0.1) checkAccuracy_d(mpfr_exp10, child_exp10, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "exp2_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_exp2, child_exp2_u35, d, 3.5); + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_d(mpfr_exp2, child_exp2_u35, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "exp10_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_exp10, child_exp10_u35, d, 3.5); + for(d = -300;d < 300 && success;d += 0.1) checkAccuracy_d(mpfr_exp10, child_exp10_u35, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "expm1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_expm1, child_expm1, d, 1.0); + for(d = -1000;d < 1000 && success;d += 0.21) checkAccuracy_d(mpfr_expm1, child_expm1, d, 1.0); + for(d = 0;d < 300 && success;d += 0.21) checkAccuracy_d(mpfr_expm1, child_expm1, pow(10, -d), 1.0); + for(d = 0;d < 300 && success;d += 0.21) checkAccuracy_d(mpfr_expm1, child_expm1, (-pow(10, -d)), 1.0); + showResult(success); + + // + + fprintf(stderr, "log10 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log10, child_log10, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_d(mpfr_log10, child_log10, d, 1.0); + for(i=0;i<10000 && success;i++) checkAccuracy_d(mpfr_log10, child_log10, (DBL_MIN * pow(0.996323, i)), 1.0); + showResult(success); + + // + + fprintf(stderr, "log2 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log2, child_log2, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_d(mpfr_log2, child_log2, d, 1.0); + for(i=0;i<10000 && success;i++) checkAccuracy_d(mpfr_log2, child_log2, (DBL_MIN * pow(0.996323, i)), 1.0); + showResult(success); + + // + + fprintf(stderr, "log2_u35 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log2, child_log2_u35, d, 3.5); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_d(mpfr_log2, child_log2_u35, d, 3.5); + for(i=0;i<10000 && success;i++) checkAccuracy_d(mpfr_log2, child_log2_u35, (DBL_MIN * pow(0.996323, i)), 3.5); + showResult(success); + + // + + fprintf(stderr, "log1p : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_d(mpfr_log1p, child_log1p, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "lgamma_u1 : "); + for(d = -5000;d < 5000 && success;d += 1.1) checkAccuracy_d(mpfr_lgamma_nosign, child_lgamma_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "tgamma_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_d(mpfr_gamma, child_tgamma_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "erf_u1 : "); + for(d = -100;d < 100 && success;d += 0.02) checkAccuracy_d(mpfr_erf, child_erf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "erfc_u15 : "); + for(d = -1;d < 100 && success;d += 0.01) checkAccuracy_d(mpfr_erfc, child_erfc_u15, d, 1.5); + showResult(success); + + // + + { + fprintf(stderr, "ilogb : "); + + for(d = 0.0001;d < 10;d += 0.001) { + int q = child_ilogb(d); + int c = ilogb(d); + if (q != c) { + fprintf(stderr, "ilogb : arg = %.20g, test = %d, correct = %d\n", d, ilogb(d), child_ilogb(d)); + success = 0; + showResult(success); + } + } + + for(d = 0.0001;d < 10000;d += 1.1) { + int q = child_ilogb(d); + int c = ilogb(d); + if (q != c) { + fprintf(stderr, "ilogb : arg = %.20g, test = %d, correct = %d\n", d, ilogb(d), child_ilogb(d)); + success = 0; + showResult(success); + } + } + + for(i=0;i<10000;i+=10) { + d = DBL_MIN * pow(0.996323, i); + if (d == 0) continue; + int q = child_ilogb(d); + int c = ilogb(d); + if (q != c) { + fprintf(stderr, "ilogb : arg = %.20g, test = %d, correct = %d\n", d, ilogb(d), child_ilogb(d)); + success = 0; + showResult(success); + } + } + + for(i=0;i<10000;i+=10) { + d = pow(0.933254300796991, i); + if (d == 0) continue; + int q = child_ilogb(d); + int c = ilogb(d); + if (q != c) { + fprintf(stderr, "ilogb : arg = %.20g, test = %d, correct = %d\n", d, ilogb(d), child_ilogb(d)); + success = 0; + showResult(success); + } + } + + showResult(success); + } + } + + // + +#define checkAccuracy_f(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + if (countULPsp(childFunc((float)flushToZero(argx)), frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", \ + (float)flushToZero(argx), (double)childFunc((float)flushToZero(argx)), mpfr_get_d(frc, GMP_RNDN), countULPsp(childFunc((float)flushToZero(argx)), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyNR_f(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfrFunc(frc, frx); \ + if (countULPsp(childFunc((float)flushToZero(argx)), frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", \ + (float)flushToZero(argx), (double)childFunc((float)flushToZero(argx)), mpfr_get_d(frc, GMP_RNDN), countULPsp(childFunc((float)flushToZero(argx)), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_f_f(mpfrFunc, childFunc, argx, argy, bound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfr_set_d(fry, (float)flushToZero(argy), GMP_RNDN); \ + mpfrFunc(frc, frx, fry, GMP_RNDN); \ + if (countULPsp(childFunc((float)flushToZero(argx), (float)flushToZero(argy)), frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", \ + (float)flushToZero(argx), (float)flushToZero(argy), childFunc((float)flushToZero(argx), (float)flushToZero(argy)), mpfr_get_d(frc, GMP_RNDN), countULPsp(childFunc((float)flushToZero(argx), (float)flushToZero(argy)), frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyX_f(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + Sleef_float2 d2 = childFunc((float)flushToZero(argx)); \ + if (countULPsp(d2.x, frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", (float)flushToZero(argx), (double)d2.x, mpfr_get_d(frc, GMP_RNDN), countULPsp(d2.x, frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyY_f(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + Sleef_float2 d2 = childFunc((float)flushToZero(argx)); \ + if (countULPsp(d2.y, frc) > bound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf\n", (float)flushToZero(argx), (double)d2.y, mpfr_get_d(frc, GMP_RNDN), countULPsp(d2.y, frc)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy2_f(mpfrFunc, childFunc, argx, bound, abound) do { \ + mpfr_set_d(frx, (float)flushToZero(argx), GMP_RNDN); \ + mpfrFunc(frc, frx, GMP_RNDN); \ + double t = childFunc((float)flushToZero(argx)); \ + double ae = fabs(mpfr_get_d(frc, GMP_RNDN) - t); \ + if (countULPsp(t, frc) > bound && ae > abound) { \ + fprintf(stderr, "\narg = %.20g, test = %.20g, correct = %.20g, ULP = %lf, abserror = %g\n", \ + (float)flushToZero(argx), (double)childFunc((float)flushToZero(argx)), mpfr_get_d(frc, GMP_RNDN), countULPsp(childFunc((float)flushToZero(argx)), frc), ae); \ + success = 0; \ + break; \ + } \ + } while(0) + + // + + if (enableSP) { + // 53 > 24(=number of bits in SP mantissa) + mpfr_set_default_prec(53); + + fprintf(stderr, "hypotf_u35 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_hypot, child_hypotf_u35, y, x, 3.5); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_hypot, child_hypotf_u35, y, x, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "hypotf_u05 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_hypot, child_hypotf_u05, y, x, 0.5); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_hypot, child_hypotf_u05, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "copysignf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_copysign, child_copysignf, y, x, 0); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_copysign, child_copysignf, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fmaxf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_max, child_fmaxf, y, x, 0); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_max, child_fmaxf, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fminf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_min, child_fminf, y, x, 0); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_min, child_fminf, y, x, 0); + } + showResult(success); + + // + + fprintf(stderr, "fdimf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_dim, child_fdimf, y, x, 0.5); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_dim, child_fdimf, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "fmodf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_fmod, child_fmodf, y, x, 0.5); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_fmod, child_fmodf, y, x, 0.5); + } + showResult(success); + + // + + fprintf(stderr, "remainderf : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_remainder, child_remainderf, y, x, 0.5); + } + for(y = -1e+7;y < 1e+7 && success;y += 1.51e+5) { + for(x = -1e+7;x < 1e+7 && success;x += 1.51e+5) checkAccuracy_f_f(mpfr_remainder, child_remainderf, y, x, 0.5); + } + checkAccuracy_f_f(mpfr_remainder, child_remainderf, 11114942644092928.0, 224544296009728.0, 0.5); + showResult(success); + + // + + fprintf(stderr, "truncf : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_f(mpfr_trunc, child_truncf, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_f(mpfr_trunc, child_truncf, d, 0); + { + double start = u2f(f2u((double)(INT64_C(1) << 23))-20), end = u2f(f2u((double)(INT64_C(1) << 23))+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_trunc, child_truncf, d, 0); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_trunc, child_truncf, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "floorf : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_f(mpfr_floor, child_floorf, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_f(mpfr_floor, child_floorf, d, 0); + { + double start = u2f(f2u((double)(INT64_C(1) << 23))-20), end = u2f(f2u((double)(INT64_C(1) << 23))+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_floor, child_floorf, d, 0); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_floor, child_floorf, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "ceilf : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_f(mpfr_ceil, child_ceilf, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_f(mpfr_ceil, child_ceilf, d, 0); + { + double start = u2f(f2u((double)(INT64_C(1) << 23))-20), end = u2f(f2u((double)(INT64_C(1) << 23))+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_ceil, child_ceilf, d, 0); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_ceil, child_ceilf, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "roundf : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracyNR_f(mpfr_round, child_roundf, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracyNR_f(mpfr_round, child_roundf, d, 0); + { + double start = u2f(f2u((double)(INT64_C(1) << 23))-20), end = u2f(f2u((double)(INT64_C(1) << 23))+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_round, child_roundf, d, 0); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyNR_f(mpfr_round, child_roundf, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "rintf : "); + for(x = -100.5;x <= 100.5;x+=0.5) { + for(d = u2d(d2u(x)-3);d <= u2d(d2u(x)+3) && success;d = u2d(d2u(d)+1)) checkAccuracy_f(mpfr_rint, child_rintf, d, 0); + } + for(d = -10000;d < 10000 && success;d += 2.5) checkAccuracy_f(mpfr_rint, child_rintf, d, 0); + { + double start = u2f(f2u((double)(INT64_C(1) << 23))-20), end = u2f(f2u((double)(INT64_C(1) << 23))+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_rint, child_rintf, d, 0); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_rint, child_rintf, -d, 0); + } + showResult(success); + + // + + fprintf(stderr, "sinf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_sin, child_sinf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_sin, child_sinf, d, 3.5); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_sin, child_sinf, pow(1.092, i), 3.5); + for(i64=(int64_t)-1000;i64<(int64_t)1000 && success;i64+=(int64_t)1) { + double start = u2f(f2u(M_PI_4 * i64)-20), end = u2f(f2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_sin, child_sinf, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sinf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_sin, child_sinf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_sin, child_sinf_u1, d, 1.0); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_sin, child_sinf_u1, pow(1.092, i), 1.0); + for(i64=(int64_t)-1000;i64<(int64_t)1000 && success;i64+=(int64_t)1) { + double start = u2f(f2u(M_PI_4 * i64)-20), end = u2f(f2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_sin, child_sinf_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincosf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyX_f(mpfr_sin, child_sincosf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracyX_f(mpfr_sin, child_sincosf, d, 3.5); + for(i = 0;i < 1000 && success;i++) checkAccuracyX_f(mpfr_sin, child_sincosf, pow(1.092, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sin, child_sincosf, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincosf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyX_f(mpfr_sin, child_sincosf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracyX_f(mpfr_sin, child_sincosf_u1, d, 1.0); + for(i = 0;i < 1000 && success;i++) checkAccuracyX_f(mpfr_sin, child_sincosf_u1, pow(1.092, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sin, child_sincosf_u1, d, 1.0); + } + showResult(success); + + // + + // 256 > 128(=maximum SP exponent) + 24(=number of bits in SP mantissa) + mpfr_set_default_prec(256); + + fprintf(stderr, "sin in sincospif_u35 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u35, d, 3.5); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u35, d, 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u35, d, 3.5); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "sin in sincospif_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u05, d, 0.506); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyX_f(mpfr_sinpi, child_sincospif_u05, d, 0.506); + } + showResult(success); + + // + + fprintf(stderr, "sinpif_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracy_f(mpfr_sinpi, child_sinpif_u05, d, 0.506); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_sinpi, child_sinpif_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_sinpi, child_sinpif_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_sinpi, child_sinpif_u05, d, 0.506); + } + showResult(success); + + // + + fprintf(stderr, "cospif_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracy_f(mpfr_cospi, child_cospif_u05, d, 0.506); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_cospi, child_cospif_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_cospi, child_cospif_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_cospi, child_cospif_u05, d, 0.506); + } + showResult(success); + + mpfr_set_default_prec(53); + + // + + fprintf(stderr, "cosf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_cos, child_cosf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_cos, child_cosf, d, 3.5); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_cos, child_cosf, pow(1.092, i), 3.5); + for(i64=(int64_t)-1000;i64<(int64_t)1000 && success;i64+=(int64_t)1) { + double start = u2f(f2u(M_PI_4 * i64)-20), end = u2f(f2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_cos, child_cosf, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cosf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_cos, child_cosf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_cos, child_cosf_u1, d, 1.0); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_cos, child_cosf_u1, pow(1.092, i), 1.0); + for(i64=(int64_t)-1000;i64<(int64_t)1000 && success;i64+=(int64_t)1) { + double start = u2f(f2u(M_PI_4 * i64)-20), end = u2f(f2u(M_PI_4 * i64)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_cos, child_cosf_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincosf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyY_f(mpfr_cos, child_sincosf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracyY_f(mpfr_cos, child_sincosf, d, 3.5); + for(i = 0;i < 1000 && success;i++) checkAccuracyY_f(mpfr_cos, child_sincosf, pow(1.092, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cos, child_sincosf, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincosf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracyY_f(mpfr_cos, child_sincosf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracyY_f(mpfr_cos, child_sincosf_u1, d, 1.0); + for(i = 0;i < 1000 && success;i++) checkAccuracyY_f(mpfr_cos, child_sincosf_u1, pow(1.092, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cos, child_sincosf_u1, d, 1.0); + } + showResult(success); + + // + + mpfr_set_default_prec(256); + + fprintf(stderr, "cos in sincospif_u35 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyY_f(mpfr_cospi, child_sincospif_u35, d, 3.5); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracyY_f(mpfr_cospi, child_sincospif_u35, d, 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cospi, child_sincospif_u35, d, 3.5); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cospi, child_sincospif_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "cos in sincospif_u05 : "); + for(d = -10.1;d < 10 && success;d += 0.0021) checkAccuracyY_f(mpfr_cospi, child_sincospif_u05, d, 0.506); + for(d = -10000-0.1;d < 10000 && success;d += 1.1) checkAccuracyY_f(mpfr_cospi, child_sincospif_u05, d, 0.506); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(i)-20), end = u2f(f2u(i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cospi, child_sincospif_u05, d, 0.506); + } + for(i=1;i<=20 && success;i++) { + double start = u2f(f2u(0.25 * i)-20), end = u2f(f2u(0.25 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracyY_f(mpfr_cospi, child_sincospif_u05, d, 0.506); + } + showResult(success); + + mpfr_set_default_prec(53); + + // + + fprintf(stderr, "fastsinf_u3500 : "); + for(d = -32;d < 32 && success;d += 0.001) checkAccuracy2_f(mpfr_sin, child_fastsinf_u3500, d, 350, 2e-6); + showResult(success); + + fprintf(stderr, "fastcosf_u3500 : "); + for(d = -32;d < 32 && success;d += 0.001) checkAccuracy2_f(mpfr_cos, child_fastcosf_u3500, d, 350, 2e-6); + showResult(success); + + // + + fprintf(stderr, "tanf : "); + checkAccuracy_f(mpfr_tan, child_tanf, 70.936981201171875, 3.5); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_tan, child_tanf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_tan, child_tanf, d, 3.5); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_tan, child_tanf, pow(1.092, i), 3.5); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_tan, child_tanf, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "tanf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_tan, child_tanf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_tan, child_tanf_u1, d, 1.0); + for(i = 0;i < 1000 && success;i++) checkAccuracy_f(mpfr_tan, child_tanf_u1, pow(1.092, i), 1.0); + for(i=1;i<10000 && success;i+=31) { + double start = u2f(f2u(M_PI_4 * i)-20), end = u2f(f2u(M_PI_4 * i)+20); + for(d = start;d <= end;d = u2f(f2u(d)+1)) checkAccuracy_f(mpfr_tan, child_tanf_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "logf : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log, child_logf, d, 3.5); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log, child_logf, d, 3.5); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf, pow(2.1, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf, FLT_MAX * pow(0.9314821319758632, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf, pow(0.933254300796991, i), 3.5); + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf, FLT_MIN * pow(0.996323, i), 3.5); + showResult(success); + + // + + fprintf(stderr, "logf_u1 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log, child_logf_u1, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log, child_logf_u1, d, 1.0); + + if (!enableFlushToZero) { + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf_u1, FLT_MAX * pow(0.9314821319758632, i), 1.0); + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf_u1, pow(2.1, i), 1.0); + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf_u1, pow(0.933254300796991, i), 1.0); + for(i=0;i<10000 && success;i+=10) checkAccuracy_f(mpfr_log, child_logf_u1, FLT_MIN * pow(0.996323, i), 1.0); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log, child_logf_u1, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log, child_logf_u1, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "expf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_exp, child_expf, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 1.1) checkAccuracy_f(mpfr_exp, child_expf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "powf : "); + if (!enableFlushToZero) { + for(y = 0.1;y < 100 && success;y += 0.6) { + for(x = -100;x < 100 && success;x += 0.6) { + checkAccuracy_f_f(mpfr_pow, child_powf, x, y, 1.0); + } + } + for(y = -1000;y < 1000 && success;y += 0.1) checkAccuracy_f_f(mpfr_pow, child_powf, 2.1, y, 1.0); + } else { + for(y = 0.1;y < 10 && success;y += 0.06) { + for(x = -100;x < 10 && success;x += 0.06) { + checkAccuracy_f_f(mpfr_pow, child_powf, x, y, 1.0); + } + } + } + showResult(success); + + // + + fprintf(stderr, "fastpowf_u3500 : "); + for(y = -25;y < 25 && success;y += 0.121) { + for(x = 0.1;x < 25 && success;x += 0.251) { + checkAccuracy_f_f(mpfr_pow, child_fastpowf_u3500, x, y, 350); + } + } + showResult(success); + + // + + if (!deterministicMode) { + fprintf(stderr, "sqrtf : "); + if (!enableFlushToZero) { + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_sqrt, child_sqrtf, d, 1.0); + } + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_sqrt, child_sqrtf, pow(2.1, d), 1.0); + showResult(success); + + // + + fprintf(stderr, "sqrtf_u05 : "); + if (!enableFlushToZero) { + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_sqrt, child_sqrtf_u05, d, 0.506); + } + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_sqrt, child_sqrtf_u05, pow(2.1, d), 0.506); + showResult(success); + + // + + fprintf(stderr, "sqrtf_u35 : "); + if (!enableFlushToZero) { + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_sqrt, child_sqrtf_u35, d, 3.5); + } + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_sqrt, child_sqrtf_u35, pow(2.1, d), 3.5); + showResult(success); + } + + // + + fprintf(stderr, "cbrtf : "); + if (!enableFlushToZero) { + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_cbrt, child_cbrtf, d, 3.5); + } + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_cbrt, child_cbrtf, pow(2.1, d), 3.5); + showResult(success); + + // + + fprintf(stderr, "cbrtf_u1 : "); + if (!enableFlushToZero) { + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_cbrt, child_cbrtf_u1, d, 1.0); + } + for(i = -1000;i <= 1000 && success;i+=10) checkAccuracy_f(mpfr_cbrt, child_cbrtf_u1, pow(2.1, d), 1.0); + showResult(success); + + // + + fprintf(stderr, "asinf : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_f(mpfr_asin, child_asinf, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "asinf_u1 : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_f(mpfr_asin, child_asinf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "acosf : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_f(mpfr_acos, child_acosf, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "acosf_u1 : "); + for(d = -1;d < 1 && success;d += 0.0002) checkAccuracy_f(mpfr_acos, child_acosf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "atanf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_atan, child_atanf, d, 3.5); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_atan, child_atanf, d, 3.5); + showResult(success); + + // + + fprintf(stderr, "atanf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_atan, child_atanf_u1, d, 1.0); + for(d = -10000;d < 10000 && success;d += 2.1) checkAccuracy_f(mpfr_atan, child_atanf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "atan2f : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_atan2, child_atan2f, y, x, 3.5); + } + for(y = -100;y < 100 && success;y += 1.51) { + for(x = -100;x < 100 && success;x += 1.51) checkAccuracy_f_f(mpfr_atan2, child_atan2f, y, x, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "atan2f_u1 : "); + for(y = -10;y < 10 && success;y += 0.15) { + for(x = -10;x < 10 && success;x += 0.15) checkAccuracy_f_f(mpfr_atan2, child_atan2f_u1, y, x, 1.0); + } + for(y = -100;y < 100 && success;y += 1.51) { + for(x = -100;x < 100 && success;x += 1.51) checkAccuracy_f_f(mpfr_atan2, child_atan2f_u1, y, x, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "sinhf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_sinh, child_sinhf, d, 1.0); + if (!enableFlushToZero) { + for(d = -88;d < 88 && success;d += 0.2) checkAccuracy_f(mpfr_sinh, child_sinhf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "coshf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_cosh, child_coshf, d, 1.0); + if (!enableFlushToZero) { + for(d = -88;d < 88 && success;d += 0.2) checkAccuracy_f(mpfr_cosh, child_coshf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "tanhf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_tanh, child_tanhf, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_tanh, child_tanhf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "sinhf_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_sinh, child_sinhf_u35, d, 3.5); + if (!enableFlushToZero) { + for(d = -88;d < 88 && success;d += 0.2) checkAccuracy_f(mpfr_sinh, child_sinhf_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "coshf_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_cosh, child_coshf_u35, d, 3.5); + if (!enableFlushToZero) { + for(d = -88;d < 88 && success;d += 0.2) checkAccuracy_f(mpfr_cosh, child_coshf_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "tanhf_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_tanh, child_tanhf_u35, d, 3.5); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_tanh, child_tanhf_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "asinhf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_asinh, child_asinhf, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_asinh, child_asinhf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "acoshf : "); + for(d = 1;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_acosh, child_acoshf, d, 1.0); + if (!enableFlushToZero) { + for(d = 1;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_acosh, child_acoshf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "atanhf : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_atanh, child_atanhf, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_atanh, child_atanhf, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "exp2f : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_exp2, child_exp2f, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_exp2, child_exp2f, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "exp10f : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_exp10, child_exp10f, d, 1.0); + if (!enableFlushToZero) { + for(d = -300;d < 300 && success;d += 0.1) checkAccuracy_f(mpfr_exp10, child_exp10f, d, 1.0); + } + showResult(success); + + // + + fprintf(stderr, "exp2f_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_exp2, child_exp2f_u35, d, 3.5); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.2) checkAccuracy_f(mpfr_exp2, child_exp2f_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "exp10f_u35 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_exp10, child_exp10f_u35, d, 3.5); + if (!enableFlushToZero) { + for(d = -300;d < 300 && success;d += 0.1) checkAccuracy_f(mpfr_exp10, child_exp10f_u35, d, 3.5); + } + showResult(success); + + // + + fprintf(stderr, "expm1f : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_expm1, child_expm1f, d, 1.0); + if (!enableFlushToZero) { + for(d = -1000;d < 1000 && success;d += 0.21) checkAccuracy_f(mpfr_expm1, child_expm1f, d, 1.0); + for(d = 0;d < 300 && success;d += 0.21) checkAccuracy_f(mpfr_expm1, child_expm1f, pow(10, -d), 1.0); + for(d = 0;d < 300 && success;d += 0.21) checkAccuracy_f(mpfr_expm1, child_expm1f, (-pow(10, -d)), 1.0); + } + showResult(success); + + // + + fprintf(stderr, "log10f : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log10, child_log10f, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log10, child_log10f, d, 1.0); + for(i=0;i<10000 && success;i++) checkAccuracy_f(mpfr_log10, child_log10f, (FLT_MIN * pow(0.996323, i)), 1.0); + showResult(success); + + // + + fprintf(stderr, "log2f : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log2, child_log2f, d, 1.0); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log2, child_log2f, d, 1.0); + for(i=0;i<10000 && success;i++) checkAccuracy_f(mpfr_log2, child_log2f, (FLT_MIN * pow(0.996323, i)), 1.0); + showResult(success); + + // + + fprintf(stderr, "log2f_u35 : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log2, child_log2f_u35, d, 3.5); + for(d = 0.0001;d < 10000 && success;d += 1.1) checkAccuracy_f(mpfr_log2, child_log2f_u35, d, 3.5); + for(i=0;i<10000 && success;i++) checkAccuracy_f(mpfr_log2, child_log2f_u35, (FLT_MIN * pow(0.996323, i)), 3.5); + showResult(success); + + // + + fprintf(stderr, "log1pf : "); + for(d = 0.0001;d < 10 && success;d += 0.001) checkAccuracy_f(mpfr_log1p, child_log1pf, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "lgammaf_u1 : "); + for(d = -5000;d < 5000 && success;d += 1.1) checkAccuracy_f(mpfr_lgamma_nosign, child_lgammaf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "tgammaf_u1 : "); + for(d = -10;d < 10 && success;d += 0.002) checkAccuracy_f(mpfr_gamma, child_tgammaf_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "erff_u1 : "); + for(d = -100;d < 100 && success;d += 0.02) checkAccuracy_f(mpfr_erf, child_erff_u1, d, 1.0); + showResult(success); + + // + + fprintf(stderr, "erfcf_u15 : "); + for(d = -1;d < 8 && success;d += 0.001) checkAccuracy_f(mpfr_erfc, child_erfcf_u15, d, 1.5); + showResult(success); + } + mpfr_clears(frc, frt, frx, fry, frz, NULL); +} + +int main(int argc, char **argv) { + char *argv2[argc+2], *commandSde = NULL, *commandQEmu = NULL; + int i, a2s; + + // BUGFIX: this flush is to prevent incorrect syncing with the + // `iut*` executable that causes failures in the CPU detection on + // some CI systems. + fflush(stdout); + + for(a2s=1;a2s +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#include +#endif + +#include "sleef.h" +#include "testerutil.h" + +#define DORENAME +#include "rename.h" + +#define DENORMAL_DBL_MIN (4.9406564584124654418e-324) +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +typedef union { + double d; + uint64_t u64; + int64_t i64; +} conv_t; + +double nexttoward0(double x, int n) { + union { + double f; + uint64_t u; + } cx; + cx.f = x; + cx.u -=n ; + return cx.f; +} + +double rnd() { + conv_t c; + switch(random() & 63) { + case 0: return nexttoward0( 0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 1: return nexttoward0(-0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 2: return nexttoward0( INFINITY, (random() & ((1 << (random() & 31)) - 1))); + case 3: return nexttoward0(-INFINITY, (random() & ((1 << (random() & 31)) - 1))); + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + return c.d; +} + +double rnd_fr() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + } while(!isnumber(c.d)); + return c.d; +} + +double rnd_zo() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + } while(!isnumber(c.d) || c.d < -1 || 1 < c.d); + return c.d; +} + +int main(int argc,char **argv) +{ + mpfr_t frw, frx, fry, frz; + + mpfr_set_default_prec(1280); + mpfr_inits(frw, frx, fry, frz, NULL); + + conv_t cd; + double d, t; + double d2, d3, zo; + + int cnt, ecnt = 0; + + srandom(time(NULL)); + + for(cnt = 0;ecnt < 1000;cnt++) { + switch(cnt & 7) { + case 0: + d = rnd(); + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 1: + cd.d = rint(rnd_zo() * 1e+10) * M_PI_4; + cd.i64 += (random() & 0xff) - 0x7f; + d = cd.d; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 2: + cd.d = rnd_fr() * M_PI_4; + cd.i64 += (random() & 0xf) - 0x7; + d = cd.d; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + default: + d = rnd_fr(); + d2 = rnd_fr(); + d3 = rnd_fr(); + zo = rnd_zo(); + break; + } + + Sleef_double2 sc = xsincospi_u05(d); + Sleef_double2 sc2 = xsincospi_u35(d); + + { + const double rangemax2 = 1e+9/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinpi(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = sc.x, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospi_u05 sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = sc2.x, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 1.5) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospi_u35 sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2dp(t = xsinpi_u05(d), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sinpi_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + { + const double rangemax2 = 1e+9/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cospi(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = sc.y, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospi_u05 cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = sc.y, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 1.5) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospi_u35 cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2dp(t = xcospi_u05(d), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cospi_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + sc = xsincos(d); + sc2 = xsincos_u1(d); + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sin(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xsin(d), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sin arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(sc.x, frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincos sin arg=%.20g ulp=%.20g\n", d, u1); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + + double u2 = countULPdp(t = xsin_u1(d), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sin_u1 arg=%.20g ulp=%.20g\n", d, u2); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + + double u3 = countULPdp(t = sc2.x, frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincos_u1 sin arg=%.20g ulp=%.20g\n", d, u3); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cos(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xcos(d), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = sc.y, frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincos cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULPdp(t = xcos_u1(d), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cos_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + double u3 = countULPdp(t = sc2.y, frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincos_u1 cos arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tan(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xtan(d), frx); + + if (u0 != 0 && (u0 > 3.5 || isnan(t))) { + printf("Pure C tan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xtan_u1(d), frx); + + if (u1 != 0 && (u1 > 1 || isnan(t))) { + printf("Pure C tan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xlog(fabs(d)), frx); + + if (u0 > 3.5) { + printf("Pure C log arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xlog_u1(fabs(d)), frx); + + if (u1 > 1) { + printf("Pure C log_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log10(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xlog10(fabs(d)), frx); + + if (u0 > 1) { + printf("Pure C log10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log2(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xlog2(fabs(d)), frx); + + if (u0 > 1) { + printf("Pure C log2 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xlog2_u35(fabs(d)), frx); + + if (u1 > 3.5) { + printf("Pure C log2_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_log1p(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xlog1p(d), frx); + + if ((-1 <= d && d <= 1e+307 && u0 > 1) || + (d < -1 && !isnan(t)) || + (d > 1e+307 && !(u0 <= 1 || isinf(t)))) { + printf("Pure C log1p arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xexp(d), frx); + + if (u0 > 1) { + printf("Pure C exp arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp2(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xexp2(d), frx); + + if (u0 > 1) { + printf("Pure C exp2 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xexp2_u35(d), frx); + + if (u1 > 3.5) { + printf("Pure C exp2_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp10(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xexp10(d), frx); + + if (u0 > 1.09) { + printf("Pure C exp10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xexp10_u35(d), frx); + + if (u1 > 3.5) { + printf("Pure C exp10_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_expm1(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xexpm1(d), frx); + + if (u0 > 1) { + printf("Pure C expm1 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_pow(frx, fry, frx, GMP_RNDN); + + double u0 = countULPdp(t = xpow(d2, d), frx); + + if (u0 > 1) { + printf("Pure C pow arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cbrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xcbrt(d), frx); + + if (u0 > 3.5) { + printf("Pure C cbrt arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xcbrt_u1(d), frx); + + if (u1 > 1) { + printf("Pure C cbrt_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_asin(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xasin(zo), frx); + + if (u0 > 3.5) { + printf("Pure C asin arg=%.20g ulp=%.20g\n", zo, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xasin_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C asin_u1 arg=%.20g ulp=%.20g\n", zo, u1); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_acos(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xacos(zo), frx); + + if (u0 > 3.5) { + printf("Pure C acos arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xacos_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C acos_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atan(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xatan(d), frx); + + if (u0 > 3.5) { + printf("Pure C atan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = xatan_u1(d), frx); + + if (u1 > 1) { + printf("Pure C atan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_atan2(frx, fry, frx, GMP_RNDN); + + double u0 = countULPdp(t = xatan2(d2, d), frx); + + if (u0 > 3.5) { + printf("Pure C atan2 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = xatan2_u1(d2, d), frx); + + if (u1 > 1) { + printf("Pure C atan2_u1 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xsinh(d), frx); + + if ((fabs(d) <= 709 && u0 > 1) || + (d > 709 && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d < -709 && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf("Pure C sinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xcosh(d), frx); + + if ((fabs(d) <= 709 && u0 > 1) || !(u0 <= 1 || (isinf(t) && t > 0))) { + printf("Pure C cosh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xtanh(d), frx); + + if (u0 > 1) { + printf("Pure C tanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xsinh_u35(d), frx); + + if ((fabs(d) <= 709 && u0 > 3.5) || + (d > 709 && !(u0 <= 3.5 || (isinf(t) && t > 0))) || + (d < -709 && !(u0 <= 3.5 || (isinf(t) && t < 0)))) { + printf("Pure C sinh_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xcosh_u35(d), frx); + + if ((fabs(d) <= 709 && u0 > 3.5) || !(u0 <= 3.5 || (isinf(t) && t > 0))) { + printf("Pure C cosh_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xtanh_u35(d), frx); + + if (u0 > 3.5) { + printf("Pure C tanh_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_asinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xasinh(d), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf("Pure C asinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_acosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xacosh(d), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !isnan(t))) { + printf("Pure C acosh arg=%.20g ulp=%.20g\n", d, u0); + printf("%.20g\n", t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xatanh(d), frx); + + if (u0 > 1) { + printf("Pure C atanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + // + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_abs(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xfabs(d), frx); + + if (u0 != 0) { + printf("Pure C fabs arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_copysign(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xcopysign(d, d2), frx); + + if (u0 != 0 && !isnan(d2)) { + printf("Pure C copysign arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_max(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xfmax(d, d2), frx); + + if (u0 != 0) { + printf("Pure C fmax arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_min(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xfmin(d, d2), frx); + + if (u0 != 0) { + printf("Pure C fmin arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_dim(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xfdim(d, d2), frx); + + if (u0 > 0.5) { + printf("Pure C fdim arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_trunc(frx, frx); + + double u0 = countULPdp(t = xtrunc(d), frx); + + if (u0 != 0) { + printf("Pure C trunc arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_floor(frx, frx); + + double u0 = countULPdp(t = xfloor(d), frx); + + if (u0 != 0) { + printf("Pure C floor arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_ceil(frx, frx); + + double u0 = countULPdp(t = xceil(d), frx); + + if (u0 != 0) { + printf("Pure C ceil arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_round(frx, frx); + + double u0 = countULPdp(t = xround(d), frx); + + if (u0 != 0) { + printf("Pure C round arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_rint(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xrint(d), frx); + + if (u0 != 0) { + printf("Pure C rint arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_set_d(frz, d3, GMP_RNDN); + mpfr_fma(frx, frx, fry, frz, GMP_RNDN); + + double u0 = countULP2dp(t = xfma(d, d2, d3), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+303 < c && c < 1e+303 && u0 > 0.5) || + !(u0 <= 0.5 || isinf(t))) { + printf("Pure C fma arg=%.20g, %.20g, %.20g ulp=%.20g\n", d, d2, d3, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = xsqrt_u05(d), frx); + + if (u0 > 0.50001) { + printf("Pure C sqrt_u05 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2dp(t = xhypot_u05(d, d2), frx); + + if (u0 > 0.5) { + printf("Pure C hypot arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2dp(t = xhypot_u35(d, d2), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+308 < c && c < 1e+308 && u0 > 3.5) || + !(u0 <= 3.5 || isinf(t))) { + printf("Pure C hypot arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + t = xnextafter(d, d2); + double c = nextafter(d, d2); + + if (!(isnan(t) && isnan(c)) && t != c) { + printf("Pure C nextafter arg=%.20g, %.20g\n", d, d2); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, 0); + + double u0 = countULPdp(t = xfrfrexp(d), frx); + + if (d != 0 && isnumber(d) && u0 != 0) { + printf("Pure C frfrexp arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int cexp = mpfr_get_exp(frx); + + int texp = xexpfrexp(d); + + if (d != 0 && isnumber(d) && cexp != texp) { + printf("Pure C expfrexp arg=%.20g\n", d); + printf("correct = %d, test = %d\n", cexp, texp); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_fmod(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xfmod(d, d2), frx); + + if (fabsl((long double)d / d2) < 1e+300 && u0 > 0.5) { + printf("Pure C fmod arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_remainder(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = xremainder(d, d2), frx); + + if (fabsl((long double)d / d2) < 1e+300 && u0 > 0.5) { + printf("Pure C remainder arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + int exp = (random() & 8191) - 4096; + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, mpfr_get_exp(frx) + exp); + + double u0 = countULPdp(t = xldexp(d, exp), frx); + + if (u0 > 0.5) { + printf("Pure C ldexp arg=%.20g %d ulp=%.20g\n", d, exp, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_modf(fry, frz, frx, GMP_RNDN); + + Sleef_double2 t2 = xmodf(d); + double u0 = countULPdp(t2.x, frz); + double u1 = countULPdp(t2.y, fry); + + if (u0 != 0 || u1 != 0) { + printf("Pure C modf arg=%.20g ulp=%.20g %.20g\n", d, u0, u1); + printf("correct = %.20g, %.20g\n", mpfr_get_d(frz, GMP_RNDN), mpfr_get_d(fry, GMP_RNDN)); + printf("test = %.20g, %.20g\n", t2.x, t2.y); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int s; + mpfr_lgamma(frx, &s, frx, GMP_RNDN); + + double u0 = countULPdp(t = xlgamma_u1(d), frx); + + if (((d < 0 && fabsl(t - mpfr_get_ld(frx, GMP_RNDN)) > 1e-15 && u0 > 1) || (0 <= d && d < 2e+305 && u0 > 1) || (2e+305 <= d && !(u0 <= 1 || isinf(t))))) { + printf("Pure C xlgamma_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_gamma(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = xtgamma_u1(d), frx); + + if (u0 > 1.0) { + printf("Pure C xtgamma_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erfc(frx, frx, GMP_RNDN); + + static double ebz = 9.8813129168249308835e-324; // nextafter(nextafter(0, 1), 1); + + double u0 = countULP2dp(t = xerfc_u15(d), frx); + + if ((d > 26.2 && u0 > 2.5 && !(mpfr_get_d(frx, GMP_RNDN) == 0 && t <= ebz)) || (d <= 26.2 && u0 > 1.5)) { + printf("Pure C xerfc_u15 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erf(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = xerf_u1(d), frx); + + if (u0 > 0.75) { + printf("Pure C xerf_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + mpfr_clears(frw, frx, fry, frz, NULL); + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2ld.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2ld.c new file mode 100644 index 0000000000000..dd75119c81068 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2ld.c @@ -0,0 +1,241 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "misc.h" + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#include +#endif + +#include "sleef.h" +#include "testerutil.h" + +#define DORENAME +#include "rename.h" + +#define DENORMAL_LDBL_MIN (3.6451995318824746025284059336194e-4951L) +#define XLDBL_MIN (3.3621031431120935062626778173218e-4932L) + +#ifndef M_PIl +#define M_PIl 3.141592653589793238462643383279502884L +#endif + +#ifndef M_PI_4l +#define M_PI_4l .785398163397448309615660845819875721049292L +#endif + +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +int isnumberl(long double x) { return x != SLEEF_INFINITYl && x != -SLEEF_INFINITYl && x == x; } +int isPlusZerol(long double x) { return x == 0 && copysignl(1, x) == 1; } +int isMinusZerol(long double x) { return x == 0 && copysignl(1, x) == -1; } + +mpfr_t fra, frb, frd; + +double countULP(long double d, mpfr_t c) { + long double c2 = mpfr_get_ld(c, GMP_RNDN); + if (c2 == 0 && d != 0) return 10000; + //if (isPlusZerol(c2) && !isPlusZerol(d)) return 10003; + //if (isMinusZerol(c2) && !isMinusZerol(d)) return 10004; + if (isnanl(c2) && isnanl(d)) return 0; + if (isnanl(c2) || isnanl(d)) return 10001; + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) return 0; + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) return 0; + if (!isnumberl(c2) && !isnumberl(d)) return 0; + + int e; + frexpl(mpfr_get_ld(c, GMP_RNDN), &e); + mpfr_set_ld(frb, fmaxl(ldexpl(1.0, e-64), DENORMAL_LDBL_MIN), GMP_RNDN); + + mpfr_set_ld(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + return u; +} + +double countULP2(long double d, mpfr_t c) { + long double c2 = mpfr_get_ld(c, GMP_RNDN); + if (c2 == 0 && d != 0) return 10000; + //if (isPlusZerol(c2) && !isPlusZerol(d)) return 10003; + //if (isMinusZerol(c2) && !isMinusZerol(d)) return 10004; + if (isnanl(c2) && isnanl(d)) return 0; + if (isnanl(c2) || isnanl(d)) return 10001; + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) return 0; + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) return 0; + if (!isnumberl(c2) && !isnumberl(d)) return 0; + + int e; + frexpl(mpfr_get_ld(c, GMP_RNDN), &e); + mpfr_set_ld(frb, fmaxl(ldexpl(1.0, e-64), LDBL_MIN), GMP_RNDN); + + mpfr_set_ld(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + return u; +} + +typedef union { + long double d; + __int128 u128; +} conv_t; + +long double rnd() { + conv_t c; + switch(random() & 15) { + case 0: return INFINITY; + case 1: return -INFINITY; + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + return c.d; +} + +long double rnd_fr() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + } while(!isnumberl(c.d)); + return c.d; +} + +long double rnd_zo() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + } while(!isnumberl(c.d) || c.d < -1 || 1 < c.d); + return c.d; +} + +void sinpifr(mpfr_t ret, long double d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_ld(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_sin(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +void cospifr(mpfr_t ret, long double d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_ld(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_cos(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +int main(int argc,char **argv) +{ + mpfr_t frx; + + mpfr_set_default_prec(256); + mpfr_inits(fra, frb, frd, frx, NULL); + + conv_t cd; + long double d, t; + + int cnt, ecnt = 0; + + srandom(time(NULL)); + + for(cnt = 0;ecnt < 1000;cnt++) { + switch(cnt & 7) { + case 0: + d = rnd(); + break; + case 1: + cd.d = rint((2 * (double)random() / RAND_MAX - 1) * 1e+10) * M_PI_4; + cd.u128 += (random() & 0xff) - 0x7f; + d = cd.d; + break; + default: + d = rnd_fr(); + break; + } + + Sleef_longdouble2 sc = xsincospil_u05(d); + Sleef_longdouble2 sc2 = xsincospil_u35(d); + + { + const double rangemax2 = 1e+9; + + sinpifr(frx, d); + + double u0 = countULP2(t = sc.x, frx); + + if (u0 != 0 && ((fabsl(d) <= rangemax2 && u0 > 0.505) || fabsl(t) > 1 || !isnumberl(t))) { + printf("Pure C sincospil_u05 sin arg=%.30Lg ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2(t = sc2.x, frx); + + if (u1 != 0 && ((fabsl(d) <= rangemax2 && u1 > 1.5) || fabsl(t) > 1 || !isnumberl(t))) { + printf("Pure C sincospil_u35 sin arg=%.30Lg ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + const double rangemax2 = 1e+9; + + cospifr(frx, d); + + double u0 = countULP2(t = sc.y, frx); + + if (u0 != 0 && ((fabsl(d) <= rangemax2 && u0 > 0.505) || fabsl(t) > 1 || !isnumberl(t))) { + printf("Pure C sincospil_u05 cos arg=%.30Lg ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2(t = sc.y, frx); + + if (u1 != 0 && ((fabsl(d) <= rangemax2 && u1 > 1.5) || fabsl(t) > 1 || !isnumberl(t))) { + printf("Pure C sincospil_u35 cos arg=%.30Lg ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2qp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2qp.c new file mode 100644 index 0000000000000..2065e2eb74afd --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2qp.c @@ -0,0 +1,624 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#include +#endif + +#include "sleef.h" + +#include "f128util.h" + +#define DORENAME +#include "rename.h" + +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +int isnumberq(Sleef_quad x) { return !isinfq(x) && !isnanq(x); } +int isPlusZeroq(Sleef_quad x) { return x == 0 && copysignq(1, x) == 1; } +int isMinusZeroq(Sleef_quad x) { return x == 0 && copysignq(1, x) == -1; } + +mpfr_t fra, frb, frc, frd; + +double countULP(Sleef_quad d, mpfr_t c) { + Sleef_quad c2 = mpfr_get_f128(c, GMP_RNDN); + if (c2 == 0 && d != 0) return 10000; + //if (isPlusZeroq(c2) && !isPlusZeroq(d)) return 10003; + //if (isMinusZeroq(c2) && !isMinusZeroq(d)) return 10004; + if (isnanq(c2) && isnanq(d)) return 0; + if (isnanq(c2) || isnanq(d)) return 10001; + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) return 0; + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) return 0; + if (!isnumberq(c2) && !isnumberq(d)) return 0; + + int e; + frexpq(mpfr_get_f128(c, GMP_RNDN), &e); + mpfr_set_f128(frb, fmaxq(ldexpq(1.0, e-113), FLT128_DENORM_MIN), GMP_RNDN); + + mpfr_set_f128(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + return u; +} + +double countULP2(Sleef_quad d, mpfr_t c) { + Sleef_quad c2 = mpfr_get_f128(c, GMP_RNDN); + if (c2 == 0 && d != 0) return 10000; + //if (isPlusZeroq(c2) && !isPlusZeroq(d)) return 10003; + //if (isMinusZeroq(c2) && !isMinusZeroq(d)) return 10004; + if (isnanq(c2) && isnanq(d)) return 0; + if (isnanq(c2) || isnanq(d)) return 10001; + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) return 0; + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) return 0; + if (!isnumberq(c2) && !isnumberq(d)) return 0; + + int e; + frexpq(mpfr_get_f128(c, GMP_RNDN), &e); + mpfr_set_f128(frb, fmaxq(ldexpq(1.0, e-113), FLT128_MIN), GMP_RNDN); + + mpfr_set_f128(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + return u; +} + +typedef union { + Sleef_quad d; + __int128 u128; + uint64_t u[2]; +} conv_t; + +Sleef_quad rnd() { + conv_t c; + switch(random() & 15) { + case 0: return INFINITY; + case 1: return -INFINITY; + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + return c.d; + +} + +Sleef_quad rnd_fr() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + } while(!isnumberq(c.d)); + return c.d; +} + +Sleef_quad rnd_zo() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u128, sizeof(c.u128), 0); +#else + c.u128 = random() | ((__int128)random() << 31) | ((__int128)random() << (31*2)) | ((__int128)random() << (31*3)) | ((__int128)random() << (31*4)); +#endif + } while(!isnumberq(c.d) || c.d < -1 || 1 < c.d); + return c.d; +} + +void sinpifr(mpfr_t ret, Sleef_quad d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_f128(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_sin(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +void cospifr(mpfr_t ret, Sleef_quad d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_f128(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_cos(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +int main(int argc,char **argv) +{ + mpfr_t frw, frx, fry, frz; + + mpfr_set_default_prec(2048); + mpfr_inits(fra, frb, frc, frd, frw, frx, fry, frz, NULL); + + conv_t cd; + Sleef_quad d, t, d2, zo; + + int cnt, ecnt = 0; + + srandom(time(NULL)); + +#if 0 + cd.d = M_PIq; + mpfr_set_f128(frx, cd.d, GMP_RNDN); + cd.u128 += 3; + printf("%g\n", countULP2(cd.d, frx)); +#endif + + const Sleef_quad rangemax = 1e+9; + + for(cnt = 0;ecnt < 1000;cnt++) { + switch(cnt & 7) { + case 0: + d = rnd(); + d2 = rnd(); + zo = rnd(); + break; + case 1: + cd.d = rint((2 * (double)random() / RAND_MAX - 1) * 1e+10) * M_PI_4; + cd.u128 += (random() & 0xff) - 0x7f; + d = cd.d; + d2 = rnd(); + zo = rnd(); + break; + default: + d = rnd_fr(); + d2 = rnd_fr(); + zo = rnd_zo(); + break; + } + + Sleef_quad2 sc = xsincospiq_u05(d); + Sleef_quad2 sc2 = xsincospiq_u35(d); + + { + const double rangemax2 = 1e+9; + + sinpifr(frx, d); + + double u0 = countULP2(t = sc.x, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumberq(t))) { + printf("Pure C sincospiq_u05 sin arg="); printf128(d); printf(" ulp=%.20g\n", u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2(t = sc2.x, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumberq(t))) { + printf("Pure C sincospiq_u35 sin arg=%.30Lg ulp=%.20g\n", (long double)d, u1); + fflush(stdout); ecnt++; + } + + } + + { + const double rangemax2 = 1e+9; + + cospifr(frx, d); + + double u0 = countULP2(t = sc.y, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumberq(t))) { + printf("Pure C sincospiq_u05 cos arg=%.30Lg ulp=%.20g\n", (long double)d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2(t = sc.y, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumberq(t))) { + printf("Pure C sincospiq_u35 cos arg=%.30Lg ulp=%.20g\n", (long double)d, u1); + fflush(stdout); ecnt++; + } + + } + +#if 0 + double2 sc = xsincos(d); + double2 sc2 = xsincos_u1(d); + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sin(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xsin(d), frx); + + if ((fabs(d) <= rangemax && u0 > 3.5) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(sc.x, frx); + + if ((fabs(d) <= rangemax && u1 > 3.5) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sincos sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP(t = xsin_u1(d), frx); + + if ((fabs(d) <= rangemax && u2 > 1) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sin_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + double u3 = countULP(t = sc2.x, frx); + + if ((fabs(d) <= rangemax && u3 > 1) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sincos_u1 sin arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cos(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xcos(d), frx); + + if ((fabs(d) <= rangemax && u0 > 3.5) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = sc.y, frx); + + if ((fabs(d) <= rangemax && u1 > 3.5) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sincos cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP(t = xcos_u1(d), frx); + + if ((fabs(d) <= rangemax && u2 > 1) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C cos_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + double u3 = countULP(t = sc2.y, frx); + + if ((fabs(d) <= rangemax && u3 > 1) || fabs(t) > 1 || !isnumberq(t)) { + printf("Pure C sincos_u1 cos arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tan(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xtan(d), frx); + + if ((fabs(d) < 1e+7 && u0 > 3.5) || (fabs(d) <= rangemax && u0 > 5) || isnan(t)) { + printf("Pure C tan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xtan_u1(d), frx); + + if ((fabs(d) <= rangemax && u1 > 1) || isnan(t)) { + printf("Pure C tan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + d = rnd_fr(); + double d2 = rnd_fr(), zo = rnd_zo(); + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xlog(fabs(d)), frx); + + if (u0 > 3.5) { + printf("Pure C log arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xlog_u1(fabs(d)), frx); + + if (u1 > 1) { + printf("Pure C log_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log10(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xlog10(fabs(d)), frx); + + if (u0 > 1) { + printf("Pure C log10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_log1p(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xlog1p(d), frx); + + if ((-1 <= d && d <= 1e+307 && u0 > 1) || + (d < -1 && !isnan(t)) || + (d > 1e+307 && !(u0 <= 1 || isinf(t)))) { + printf("Pure C log1p arg=%.20g ulp=%.20g\n", d, u0); + printf("%g\n", t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xexp(d), frx); + + if (u0 > 1) { + printf("Pure C exp arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp2(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xexp2(d), frx); + + if (u0 > 1) { + printf("Pure C exp2 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp10(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xexp10(d), frx); + + if (u0 > 1) { + printf("Pure C exp10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_expm1(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xexpm1(d), frx); + + if (u0 > 1) { + printf("Pure C expm1 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_pow(frx, fry, frx, GMP_RNDN); + + double u0 = countULP(t = xpow(d2, d), frx); + + if (u0 > 1) { + printf("Pure C pow arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cbrt(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xcbrt(d), frx); + + if (u0 > 3.5) { + printf("Pure C cbrt arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xcbrt_u1(d), frx); + + if (u1 > 1) { + printf("Pure C cbrt_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_asin(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xasin(zo), frx); + + if (u0 > 3.5) { + printf("Pure C asin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xasin_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C asin_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_acos(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xacos(zo), frx); + + if (u0 > 3.5) { + printf("Pure C acos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xacos_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C acos_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atan(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xatan(d), frx); + + if (u0 > 3.5) { + printf("Pure C atan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP(t = xatan_u1(d), frx); + + if (u1 > 1) { + printf("Pure C atan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_atan2(frx, fry, frx, GMP_RNDN); + + double u0 = countULP(t = xatan2(d2, d), frx); + + if (u0 > 3.5) { + printf("Pure C atan2 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2(t = xatan2_u1(d2, d), frx); + + if (u1 > 1) { + printf("Pure C atan2_u1 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xsinh(d), frx); + + if ((fabs(d) <= 709 && u0 > 1) || + (d > 709 && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d < -709 && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf("Pure C sinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xcosh(d), frx); + + if ((fabs(d) <= 709 && u0 > 1) || !(u0 <= 1 || (isinf(t) && t > 0))) { + printf("Pure C cosh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xtanh(d), frx); + + if (u0 > 1) { + printf("Pure C tanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_asinh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xasinh(d), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf("Pure C asinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_acosh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xacosh(d), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !isnan(t))) { + printf("Pure C acosh arg=%.20g ulp=%.20g\n", d, u0); + printf("%.20g\n", t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atanh(frx, frx, GMP_RNDN); + + double u0 = countULP(t = xatanh(d), frx); + + if (u0 > 1) { + printf("Pure C atanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } +#endif + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simddp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simddp.c new file mode 100644 index 0000000000000..1ceffcb6fcff8 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simddp.c @@ -0,0 +1,1298 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#endif + +#include "sleef.h" +#include "quaddef.h" +#include "testerutil.h" + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#include "helpersse2.h" +#include "renamesse2.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_SSE4 +#define CONFIG 4 +#include "helpersse2.h" +#include "renamesse4.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_AVX +#define CONFIG 1 +#include "helperavx.h" +#include "renameavx.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_FMA4 +#define CONFIG 4 +#include "helperavx.h" +#include "renamefma4.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#include "helperavx2.h" +#include "renameavx2.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#include "helperavx2_128.h" +#include "renameavx2128.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#include "helperavx512f.h" +#include "renameavx512f.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif + +#ifdef ENABLE_AVX512FNOFMA +#define CONFIG 2 +#include "helperavx512f.h" +#include "renameavx512fnofma.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif + +#ifdef ENABLE_VECEXT +#define CONFIG 1 +#include "helpervecext.h" +#include "norename.h" +#endif + +#ifdef ENABLE_PUREC +#define CONFIG 1 +#include "helperpurec.h" +#include "norename.h" +#endif + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#include "helperadvsimd.h" +#include "renameadvsimd.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif + +#ifdef ENABLE_ADVSIMDNOFMA +#define CONFIG 2 +#include "helperadvsimd.h" +#include "renameadvsimdnofma.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#include "helpersve.h" +#include "renamesve.h" +#endif /* ENABLE_SVE */ + +#ifdef ENABLE_SVENOFMA +#define CONFIG 2 +#include "helpersve.h" +#include "renamesvenofma.h" +#endif + +#ifdef ENABLE_VSX +#define CONFIG 1 +#include "helperpower_128.h" +#include "renamevsx.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSXNOFMA +#define CONFIG 2 +#include "helperpower_128.h" +#include "renamevsxnofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#include "helperpower_128.h" +#include "renamevsx3.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSX3NOFMA +#define CONFIG 4 +#include "helperpower_128.h" +#include "renamevsx3nofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#include "helpers390x_128.h" +#include "renamevxe.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXENOFMA +#define CONFIG 141 +#include "helpers390x_128.h" +#include "renamevxenofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#include "helpers390x_128.h" +#include "renamevxe2.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE2NOFMA +#define CONFIG 151 +#include "helpers390x_128.h" +#include "renamevxe2nofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm1.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM1NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm1nofma.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm2.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM2NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm2nofma.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#include "helperpurec_scalar.h" +#include "renamepurec_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#include "helperpurec_scalar.h" +#include "renamepurecfma_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif + +// + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +static vdouble vd2getx_vd_vd2(vdouble2 v) { return v.x; } +static vdouble vd2gety_vd_vd2(vdouble2 v) { return v.y; } +#endif + +// + +#define DENORMAL_DBL_MIN (4.9406564584124654418e-324) + +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +typedef union { + double d; + uint64_t u64; + int64_t i64; +} conv_t; + +double nexttoward0(double x, int n) { + union { + double f; + uint64_t u; + } cx; + cx.f = x; + cx.u -= n; + return cx.f; +} + +double rnd() { + conv_t c; + switch(random() & 63) { + case 0: return nexttoward0( 0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 1: return nexttoward0(-0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 2: return nexttoward0( INFINITY, (random() & ((1 << (random() & 31)) - 1))); + case 3: return nexttoward0(-INFINITY, (random() & ((1 << (random() & 31)) - 1))); + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + return c.d; +} + +double rnd_fr() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + } while(!isnumber(c.d)); + return c.d; +} + +double rnd_zo() { + conv_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u64, sizeof(c.u64), 0); +#else + c.u64 = random() | ((uint64_t)random() << 31) | ((uint64_t)random() << 62); +#endif + } while(!isnumber(c.d) || c.d < -1 || 1 < c.d); + return c.d; +} + +void sinpifr(mpfr_t ret, double d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_d(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_sin(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +void cospifr(mpfr_t ret, double d) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_set_d(frd, d, GMP_RNDN); + mpfr_mul(frd, frpi, frd, GMP_RNDN); + mpfr_cos(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +vdouble vset(vdouble v, int idx, double d) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + a[idx] = d; + return vloadu_vd_p(a); +} + +double vget(vdouble v, int idx) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + return a[idx]; +} + +int vgeti(vint v, int idx) { + int a[VECTLENDP*2]; + vstoreu_v_p_vi(a, v); + return a[idx]; +} + +int main(int argc,char **argv) +{ + mpfr_t frw, frx, fry, frz; + + mpfr_set_default_prec(256); + mpfr_inits(frw, frx, fry, frz, NULL); + + conv_t cd; + double d, t; + double d2, d3, zo; + vdouble vd = vcast_vd_d(0); + vdouble vd2 = vcast_vd_d(0); + vdouble vd3 = vcast_vd_d(0); + vdouble vzo = vcast_vd_d(0); + vdouble vad = vcast_vd_d(0); + vdouble2 sc, sc2; + int cnt, ecnt = 0; + + srandom(time(NULL)); + + for(cnt = 0;ecnt < 1000;cnt++) { + int e = cnt % VECTLENDP; + switch(cnt & 7) { + case 0: + d = rnd(); + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 1: + cd.d = rint(rnd_zo() * 1e+10) * M_PI_4; + cd.i64 += (random() & 0xff) - 0x7f; + d = cd.d; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 2: + cd.d = rnd_fr() * M_PI_4; + cd.i64 += (random() & 0xf) - 0x7; + d = cd.d; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + default: + d = rnd_fr(); + d2 = rnd_fr(); + d3 = rnd_fr(); + zo = rnd_zo(); + break; + } + + vd = vset(vd, e, d); + vd2 = vset(vd2, e, d2); + vd3 = vset(vd3, e, d3); + vzo = vset(vzo, e, zo); + vad = vset(vad, e, fabs(d)); + + // + + sc = xsincospi_u05(vd); + sc2 = xsincospi_u35(vd); + + { + const double rangemax2 = 1e+9/4; + + sinpifr(frx, d); + + double u0 = countULP2dp(t = vget(vd2getx_vd_vd2(sc), e), frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospi_u05 sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = vget(vd2getx_vd_vd2(sc2), e), frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 1.5) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospi_u35 sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2dp(t = vget(xsinpi_u05(vd), e), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sinpi_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + { + const double rangemax2 = 1e+9/4; + + cospifr(frx, d); + + double u0 = countULP2dp(t = vget(vd2gety_vd_vd2(sc), e), frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospi_u05 cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = vget(vd2gety_vd_vd2(sc), e), frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 1.5) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospi_u35 cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2dp(t = vget(xcospi_u05(vd), e), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cospi_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + sc = xsincos(vd); + sc2 = xsincos_u1(vd); + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sin(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsin(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(vd2getx_vd_vd2(sc), e), frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincos sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULPdp(t = vget(xsin_u1(vd), e), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sin_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + double u3 = countULPdp(t = vget(vd2getx_vd_vd2(sc2), e), frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincos_u1 sin arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cos(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xcos(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(vd2gety_vd_vd2(sc), e), frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincos cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULPdp(t = vget(xcos_u1(vd), e), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cos_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + double u3 = countULPdp(t = vget(vd2gety_vd_vd2(sc2), e), frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincos_u1 cos arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tan(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xtan(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || isnan(t))) { + printf(ISANAME " tan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xtan_u1(vd), e), frx); + + if (u1 != 0 && (u1 > 1 || isnan(t))) { + printf(ISANAME " tan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xlog(vad), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " log arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xlog_u1(vad), e), frx); + + if (u1 > 1) { + printf(ISANAME " log_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log10(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xlog10(vad), e), frx); + + if (u0 > 1) { + printf(ISANAME " log10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabs(d), GMP_RNDN); + mpfr_log2(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xlog2(vad), e), frx); + + if (u0 > 1) { + printf(ISANAME " log2 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xlog2_u35(vad), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " log2_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_log1p(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xlog1p(vd), e), frx); + + if ((-1 <= d && d <= 1e+307 && u0 > 1) || + (d < -1 && !isnan(t)) || + (d > 1e+307 && !(u0 <= 1 || isinf(t)))) { + printf(ISANAME " log1p arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xexp(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " exp arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp2(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xexp2(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " exp2 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xexp2_u35(vd), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " exp2_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp10(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xexp10(vd), e), frx); + + if (u0 > 1.09) { + printf(ISANAME " exp10 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xexp10_u35(vd), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " exp10_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_expm1(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xexpm1(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " expm1 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_pow(frx, fry, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xpow(vd2, vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " pow arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cbrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xcbrt(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " cbrt arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xcbrt_u1(vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " cbrt_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_asin(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xasin(vzo), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " asin arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xasin_u1(vzo), e), frx); + + if (u1 > 1) { + printf(ISANAME " asin_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_acos(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xacos(vzo), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " acos arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xacos_u1(vzo), e), frx); + + if (u1 > 1) { + printf(ISANAME " acos_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atan(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xatan(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " atan arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPdp(t = vget(xatan_u1(vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " atan_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_atan2(frx, fry, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xatan2(vd2, vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " atan2 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2dp(t = vget(xatan2_u1(vd2, vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " atan2_u1 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsinh(vd), e), frx); + + if ((fabs(d) <= 709 && u0 > 1) || + (d > 709 && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d < -709 && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf(ISANAME " sinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xcosh(vd), e), frx); + + if ((fabs(d) <= 709 && u0 > 1) || !(u0 <= 1 || (isinf(t) && t > 0))) { + printf(ISANAME " cosh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xtanh(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " tanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsinh_u35(vd), e), frx); + + if ((fabs(d) <= 709 && u0 > 3.5) || + (d > 709 && !(u0 <= 3.5 || (isinf(t) && t > 0))) || + (d < -709 && !(u0 <= 3.5 || (isinf(t) && t < 0)))) { + printf(ISANAME " sinh_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xcosh_u35(vd), e), frx); + + if ((fabs(d) <= 709 && u0 > 3.5) || !(u0 <= 3.5 || (isinf(t) && t > 0))) { + printf(ISANAME " cosh_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xtanh_u35(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " tanh_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_asinh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xasinh(vd), e), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf(ISANAME " asinh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_acosh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xacosh(vd), e), frx); + + if ((fabs(d) < sqrt(DBL_MAX) && u0 > 1) || + (d >= sqrt(DBL_MAX) && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d <= -sqrt(DBL_MAX) && !isnan(t))) { + printf(ISANAME " acosh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atanh(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xatanh(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " atanh arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + // + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_abs(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xfabs(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " fabs arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_copysign(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xcopysign(vd, vd2), e), frx); + + if (u0 != 0 && !isnan(d2)) { + printf(ISANAME " copysign arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_max(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xfmax(vd, vd2), e), frx); + + if (u0 != 0) { + printf(ISANAME " fmax arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_min(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xfmin(vd, vd2), e), frx); + + if (u0 != 0) { + printf(ISANAME " fmin arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_dim(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xfdim(vd, vd2), e), frx); + + if (u0 > 0.5) { + printf(ISANAME " fdim arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_trunc(frx, frx); + + double u0 = countULPdp(t = vget(xtrunc(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " trunc arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_floor(frx, frx); + + double u0 = countULPdp(t = vget(xfloor(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " floor arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_ceil(frx, frx); + + double u0 = countULPdp(t = vget(xceil(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " ceil arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_round(frx, frx); + + double u0 = countULPdp(t = vget(xround(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " round arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_rint(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xrint(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " rint arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_set_d(frz, d3, GMP_RNDN); + mpfr_fma(frx, frx, fry, frz, GMP_RNDN); + + double u0 = countULP2dp(t = vget(xfma(vd, vd2, vd3), e), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+303 < c && c < 1e+303 && u0 > 0.5) || + !(u0 <= 0.5 || isinf(t))) { + printf(ISANAME " fma arg=%.20g, %.20g, %.20g ulp=%.20g\n", d, d2, d3, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + +#ifndef DETERMINISTIC + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsqrt(vd), e), frx); + + if (u0 > 1.0) { + printf(ISANAME " sqrt arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsqrt_u05(vd), e), frx); + + if (u0 > 0.50001) { + printf(ISANAME " sqrt_u05 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xsqrt_u35(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " sqrt_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } +#endif // #ifndef DETERMINISTIC + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2dp(t = vget(xhypot_u05(vd, vd2), e), frx); + + if (u0 > 0.5) { + printf(ISANAME " hypot_u05 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2dp(t = vget(xhypot_u35(vd, vd2), e), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+308 < c && c < 1e+308 && u0 > 3.5) || + !(u0 <= 3.5 || isinf(t))) { + if (!(isinf(c) && t == 1.7976931348623157081e+308)) { + printf(ISANAME " hypot_u35 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + + { + t = vget(xnextafter(vd, vd2), e); + double c = nextafter(d, d2); + + if (!(isnan(t) && isnan(c)) && t != c) { + printf(ISANAME " nextafter arg=%.20g, %.20g\n", d, d2); + printf("correct = %.20g, test = %.20g\n", c, t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, 0); + + double u0 = countULPdp(t = vget(xfrfrexp(vd), e), frx); + + if (d != 0 && isnumber(d) && u0 != 0) { + printf(ISANAME " frfrexp arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_fmod(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xfmod(vd, vd2), e), frx); + + if (fabsl((long double)d / d2) < 1e+300 && u0 > 0.5) { + printf(ISANAME " fmod arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_remainder(frx, frx, fry, GMP_RNDN); + + double u0 = countULPdp(t = vget(xremainder(vd, vd2), e), frx); + + if (fabsl((long double)d / d2) < 1e+300 && u0 > 0.5) { + printf(ISANAME " remainder arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + /* + { + mpfr_set_d(frx, d, GMP_RNDN); + int cexp = mpfr_get_exp(frx); + + int texp = vgeti(xexpfrexp(vd), e); + + if (isnumber(d) && cexp != texp) { + printf(ISANAME " expfrexp arg=%.20g\n", d); + fflush(stdout); ecnt++; + } + } + + { + int exp = (random() & 8191) - 4096; + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, mpfr_get_exp(frx) + exp); + + double u0 = countULPdp(t = vget(xldexp(d, exp), e), frx); + + if (u0 > 0.5) { + printf(ISANAME " ldexp arg=%.20g %d ulp=%.20g\n", d, exp, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + */ + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_modf(fry, frz, frx, GMP_RNDN); + + vdouble2 t2 = xmodf(vd); + double u0 = countULPdp(vget(vd2getx_vd_vd2(t2), e), frz); + double u1 = countULPdp(vget(vd2gety_vd_vd2(t2), e), fry); + + if (u0 != 0 || u1 != 0) { + printf(ISANAME " modf arg=%.20g ulp=%.20g %.20g\n", d, u0, u1); + printf("correct = %.20g, %.20g\n", mpfr_get_d(frz, GMP_RNDN), mpfr_get_d(fry, GMP_RNDN)); + printf("test = %.20g, %.20g\n", vget(vd2getx_vd_vd2(t2), e), vget(vd2gety_vd_vd2(t2), e)); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int s; + mpfr_lgamma(frx, &s, frx, GMP_RNDN); + + double u0 = countULPdp(t = vget(xlgamma_u1(vd), e), frx); + + if (((d < 0 && fabsl(t - mpfr_get_ld(frx, GMP_RNDN)) > 1e-15 && u0 > 1) || (0 <= d && d < 2e+305 && u0 > 1) || (2e+305 <= d && !(u0 <= 1 || isinf(t))))) { + printf(ISANAME " xlgamma_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_gamma(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = vget(xtgamma_u1(vd), e), frx); + + if (u0 > 1.0) { + printf(ISANAME " xtgamma_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erfc(frx, frx, GMP_RNDN); + + static double ebz = 9.8813129168249308835e-324; // nextafter(nextafter(0, 1), 1); + + double u0 = countULP2dp(t = vget(xerfc_u15(vd), e), frx); + + if ((d > 26.2 && u0 > 2.5 && !(mpfr_get_d(frx, GMP_RNDN) == 0 && t <= ebz)) || (d <= 26.2 && u0 > 1.5)) { + printf(ISANAME " xerfc_u15 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erf(frx, frx, GMP_RNDN); + + double u0 = countULP2dp(t = vget(xerf_u1(vd), e), frx); + + if (u0 > 0.75) { + printf(ISANAME " xerf_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + mpfr_clears(frw, frx, fry, frz, NULL); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simdsp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simdsp.c new file mode 100644 index 0000000000000..930cadfb43d1c --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2simdsp.c @@ -0,0 +1,1298 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#endif + +#include "sleef.h" +#include "quaddef.h" +#include "testerutil.h" + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#include "helpersse2.h" +#include "renamesse2.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_SSE4 +#define CONFIG 4 +#include "helpersse2.h" +#include "renamesse4.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_AVX +#define CONFIG 1 +#include "helperavx.h" +#include "renameavx.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_FMA4 +#define CONFIG 4 +#include "helperavx.h" +#include "renamefma4.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#include "helperavx2.h" +#include "renameavx2.h" +typedef Sleef___m256d_2 vdouble2; +typedef Sleef___m256_2 vfloat2; +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#include "helperavx2_128.h" +#include "renameavx2128.h" +typedef Sleef___m128d_2 vdouble2; +typedef Sleef___m128_2 vfloat2; +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#include "helperavx512f.h" +#include "renameavx512f.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif + +#ifdef ENABLE_AVX512FNOFMA +#define CONFIG 2 +#include "helperavx512f.h" +#include "renameavx512fnofma.h" +typedef Sleef___m512d_2 vdouble2; +typedef Sleef___m512_2 vfloat2; +#endif + +#ifdef ENABLE_VECEXT +#define CONFIG 1 +#include "helpervecext.h" +#include "norename.h" +#endif + +#ifdef ENABLE_PUREC +#define CONFIG 1 +#include "helperpurec.h" +#include "norename.h" +#endif + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#include "helperadvsimd.h" +#include "renameadvsimd.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif + +#ifdef ENABLE_ADVSIMDNOFMA +#define CONFIG 2 +#include "helperadvsimd.h" +#include "renameadvsimdnofma.h" +typedef Sleef_float64x2_t_2 vdouble2; +typedef Sleef_float32x4_t_2 vfloat2; +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#include "helpersve.h" +#include "renamesve.h" +#endif /* ENABLE_SVE */ + +#ifdef ENABLE_SVENOFMA +#define CONFIG 2 +#include "helpersve.h" +#include "renamesvenofma.h" +#endif + +#ifdef ENABLE_VSX +#define CONFIG 1 +#include "helperpower_128.h" +#include "renamevsx.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSXNOFMA +#define CONFIG 2 +#include "helperpower_128.h" +#include "renamevsxnofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#include "helperpower_128.h" +#include "renamevsx3.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VSX3NOFMA +#define CONFIG 4 +#include "helperpower_128.h" +#include "renamevsx3nofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#include "helpers390x_128.h" +#include "renamevxe.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXENOFMA +#define CONFIG 141 +#include "helpers390x_128.h" +#include "renamevxenofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#include "helpers390x_128.h" +#include "renamevxe2.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_VXE2NOFMA +#define CONFIG 151 +#include "helpers390x_128.h" +#include "renamevxe2nofma.h" +typedef Sleef_SLEEF_VECTOR_DOUBLE_2 vdouble2; +typedef Sleef_SLEEF_VECTOR_FLOAT_2 vfloat2; +#endif + +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_SP +#include "helperrvv.h" +#include "renamervvm1.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM1NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm1nofma.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_SP +#include "helperrvv.h" +#include "renamervvm2.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_RVVM2NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "renamervvm2nofma.h" +#include "sleef.h" +#endif + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#include "helperpurec_scalar.h" +#include "renamepurec_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#include "helperpurec_scalar.h" +#include "renamepurecfma_scalar.h" +typedef Sleef_double_2 vdouble2; +typedef Sleef_float_2 vfloat2; +#endif + +// + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +static vfloat vf2getx_vf_vf2(vfloat2 v) { return v.x; } +static vfloat vf2gety_vf_vf2(vfloat2 v) { return v.y; } +#endif + +// + +#define DENORMAL_FLT_MIN (1.4012984643248170709e-45f) +#define POSITIVE_INFINITYf ((float)INFINITY) +#define NEGATIVE_INFINITYf (-(float)INFINITY) + +typedef union { + double d; + uint64_t u64; + int64_t i64; +} conv64_t; + +typedef union { + float f; + uint32_t u32; + int32_t i32; +} conv32_t; + +static float nexttoward0f(float x, int n) { + union { + float f; + int32_t u; + } cx; + cx.f = x; + cx.u -= n; + return x == 0 ? 0 : cx.f; +} + +float rnd() { + conv32_t c; + switch(random() & 63) { + case 0: return nexttoward0f( 0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 1: return nexttoward0f(-0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 2: return nexttoward0f( INFINITY, (random() & ((1 << (random() & 31)) - 1))); + case 3: return nexttoward0f(-INFINITY, (random() & ((1 << (random() & 31)) - 1))); + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + return c.f; +} + +float rnd_fr() { + conv32_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + } while(!isnumber(c.f)); + return c.f; +} + +float rnd_zo() { + conv32_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + } while(!isnumber(c.f) || c.f < -1 || 1 < c.f); + return c.f; +} + +vfloat vset(vfloat v, int idx, float d) { + float a[VECTLENSP]; + vstoreu_v_p_vf(a, v); + a[idx] = d; + return vloadu_vf_p(a); +} + +float vget(vfloat v, int idx) { + float a[VECTLENSP]; + vstoreu_v_p_vf(a, v); + return a[idx]; +} + +int main(int argc,char **argv) +{ + mpfr_t frw, frx, fry, frz; + + mpfr_set_default_prec(256); + mpfr_inits(frw, frx, fry, frz, NULL); + + conv32_t cd; + float d, t; + float d2, d3, zo; + vfloat vd = vcast_vf_f(0); + vfloat vd2 = vcast_vf_f(0); + vfloat vd3 = vcast_vf_f(0); + vfloat vzo = vcast_vf_f(0); + vfloat vad = vcast_vf_f(0); + vfloat2 sc, sc2; + int cnt, ecnt = 0; + + srandom(time(NULL)); + + for(cnt = 0;ecnt < 1000;cnt++) { + int e = cnt % VECTLENSP; + switch(cnt & 7) { + case 0: + d = rnd(); + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 1: + cd.f = rint(rnd_zo() * 1e+10) * M_PI_4; + cd.i32 += (random() & 0xff) - 0x7f; + d = cd.f; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 2: + cd.f = rnd_fr() * M_PI_4; + cd.i32 += (random() & 0xf) - 0x7; + d = cd.f; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + default: + d = rnd_fr(); + d2 = rnd_fr(); + d3 = rnd_fr(); + zo = rnd_zo(); + break; + } + + vd = vset(vd, e, d); + vd2 = vset(vd2, e, d2); + vd3 = vset(vd3, e, d3); + vzo = vset(vzo, e, zo); + vad = vset(vad, e, fabs(d)); + + sc = xsincospif_u05(vd); + sc2 = xsincospif_u35(vd); + + { + const double rangemax2 = 1e+7/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinpi(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = vget(vf2getx_vf_vf2(sc), e), frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospif_u05 sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = vget(vf2getx_vf_vf2(sc2), e), frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospif_u35 sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2sp(t = vget(xsinpif_u05(vd), e), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sinpif_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + { + const double rangemax2 = 1e+7/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cospi(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = vget(vf2gety_vf_vf2(sc), e), frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospif_u05 cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = vget(vf2gety_vf_vf2(sc), e), frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincospif_u35 cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2sp(t = vget(xcospif_u05(vd), e), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cospif_u05 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + } + + sc = xsincosf(vd); + sc2 = xsincosf_u1(vd); + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sin(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = vget(xsinf(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sinf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = vget(vf2getx_vf_vf2(sc), e), frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincosf sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + float u2 = countULPsp(t = vget(xsinf_u1(vd), e), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sinf_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + float u3 = countULPsp(t = vget(vf2getx_vf_vf2(sc2), e), frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincosf_u1 sin arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + + float u4 = countULPsp(t = vget(xfastsinf_u3500(vd), e), frx); + double ae4 = fabs(mpfr_get_d(frx, GMP_RNDN) - t); + + if (u4 > 350 && ae4 > 2e-6) { + printf(ISANAME " fastsinf_u3500 arg=%.20g ulp=%.20g\n", d, u4); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cos(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = vget(xcosf(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cosf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = vget(vf2gety_vf_vf2(sc), e), frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincosf cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + float u2 = countULPsp(t = vget(xcosf_u1(vd), e), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " cosf_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + float u3 = countULPsp(t = vget(vf2gety_vf_vf2(sc2), e), frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf(ISANAME " sincosf_u1 cos arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + + float u4 = countULPsp(t = vget(xfastcosf_u3500(vd), e), frx); + double ae4 = fabs(mpfr_get_d(frx, GMP_RNDN) - t); + + if (u4 > 350 && ae4 > 2e-6) { + printf(ISANAME " fastcosf_u3500 arg=%.20g ulp=%.20g\n", d, u4); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tan(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = vget(xtanf(vd), e), frx); + + if (u0 != 0 && (u0 > 3.5 || isnan(t))) { + printf(ISANAME " tanf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = vget(xtanf_u1(vd), e), frx); + + if (u1 != 0 && (u1 > 1 || isnan(t))) { + printf(ISANAME " tanf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xlogf(vad), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " logf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xlogf_u1(vad), e), frx); + + if (u1 > 1) { + printf(ISANAME " logf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log10(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xlog10f(vad), e), frx); + + if (u0 > 1) { + printf(ISANAME " log10f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log2(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xlog2f(vad), e), frx); + + if (u0 > 1) { + printf(ISANAME " log2f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xlog2f_u35(vad), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " log2f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_log1p(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xlog1pf(vd), e), frx); + + if ((-1 <= d && d <= 1e+38 && u0 > 1) || + (d < -1 && !isnan(t)) || + (d > 1e+38 && !(u0 <= 1 || isinf(t)))) { + printf(ISANAME " log1pf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xexpf(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " expf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp2(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xexp2f(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " exp2f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xexp2f_u35(vd), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " exp2f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp10(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xexp10f(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " exp10f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xexp10f_u35(vd), e), frx); + + if (u1 > 3.5) { + printf(ISANAME " exp10f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_expm1(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xexpm1f(vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " expm1f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_pow(frx, fry, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xpowf(vd2, vd), e), frx); + + if (u0 > 1) { + printf(ISANAME " powf arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + + if (isnumber(d) && isnumber(d2)) { + double u1 = countULPsp(t = vget(xfastpowf_u3500(vd2, vd), e), frx); + + if (isnumber((float)mpfr_get_d(frx, GMP_RNDN)) && u1 > 350) { + printf(ISANAME " fastpowf_u3500 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cbrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xcbrtf(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " cbrtf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xcbrtf_u1(vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " cbrtf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_asin(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xasinf(vzo), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " asinf arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xasinf_u1(vzo), e), frx); + + if (u1 > 1) { + printf(ISANAME " asinf_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_acos(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xacosf(vzo), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " acosf arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xacosf_u1(vzo), e), frx); + + if (u1 > 1) { + printf(ISANAME " acosf_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atan(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xatanf(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " atanf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = vget(xatanf_u1(vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " atanf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_atan2(frx, fry, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xatan2f(vd2, vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " atan2f arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = vget(xatan2f_u1(vd2, vd), e), frx); + + if (u1 > 1) { + printf(ISANAME " atan2f_u1 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xsinhf(vd), e), frx); + + if ((fabs(d) <= 88.5 && u0 > 1) || + (d > 88.5 && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d < -88.5 && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf(ISANAME " sinhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xcoshf(vd), e), frx); + + if ((fabs(d) <= 88.5 && u0 > 1) || !(u0 <= 1 || (isinf(t) && t > 0))) { + printf(ISANAME " coshf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xtanhf(vd), e), frx); + + if (u0 > 1.0001) { + printf(ISANAME " tanhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xsinhf_u35(vd), e), frx); + + if ((fabs(d) <= 88 && u0 > 3.5) || + (d > 88 && !(u0 <= 3.5 || (isinf(t) && t > 0))) || + (d < -88 && !(u0 <= 3.5 || (isinf(t) && t < 0)))) { + printf(ISANAME " sinhf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xcoshf_u35(vd), e), frx); + + if ((fabs(d) <= 88 && u0 > 3.5) || !(u0 <= 3.5 || (isinf(t) && t > 0))) { + printf(ISANAME " coshf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xtanhf_u35(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " tanhf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_asinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xasinhf(vd), e), frx); + + if ((fabs(d) < sqrt(FLT_MAX) && u0 > 1.0001) || + (d >= sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinf(t) && t > 0))) || + (d <= -sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinf(t) && t < 0)))) { + printf(ISANAME " asinhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_acosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xacoshf(vd), e), frx); + + if ((fabs(d) < sqrt(FLT_MAX) && u0 > 1.0001) || + (d >= sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinff(t) && t > 0))) || + (d <= -sqrt(FLT_MAX) && !isnan(t))) { + printf(ISANAME " acoshf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xatanhf(vd), e), frx); + + if (u0 > 1.0001) { + printf(ISANAME " atanhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + // + + /* + { + int exp = (random() & 8191) - 4096; + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, mpfr_get_exp(frx) + exp); + + double u0 = countULPsp(t = vget(xldexpf(d, exp)), frx); + + if (u0 > 0.5001) { + printf("Pure C ldexpf arg=%.20g %d ulp=%.20g\n", d, exp, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + */ + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_abs(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xfabsf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " fabsf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_copysign(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xcopysignf(vd, vd2), e), frx); + + if (u0 != 0 && !isnan(d2)) { + printf(ISANAME " copysignf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_max(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xfmaxf(vd, vd2), e), frx); + + if (u0 != 0) { + printf(ISANAME " fmaxf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_min(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xfminf(vd, vd2), e), frx); + + if (u0 != 0) { + printf(ISANAME " fminf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_dim(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xfdimf(vd, vd2), e), frx); + + if (u0 > 0.5) { + printf(ISANAME " fdimf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_trunc(frx, frx); + + double u0 = countULPsp(t = vget(xtruncf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " truncf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_floor(frx, frx); + + double u0 = countULPsp(t = vget(xfloorf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " floorf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_ceil(frx, frx); + + double u0 = countULPsp(t = vget(xceilf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " ceilf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_round(frx, frx); + + double u0 = countULPsp(t = vget(xroundf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " roundf arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_rint(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xrintf(vd), e), frx); + + if (u0 != 0) { + printf(ISANAME " rintf arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_modf(fry, frz, frx, GMP_RNDN); + + vfloat2 t2 = xmodff(vd); + double u0 = countULPsp(vget(vf2getx_vf_vf2(t2), e), frz); + double u1 = countULPsp(vget(vf2gety_vf_vf2(t2), e), fry); + + if (u0 != 0 || u1 != 0) { + printf(ISANAME " modff arg=%.20g ulp=%.20g %.20g\n", d, u0, u1); + printf("correct = %.20g, %.20g\n", mpfr_get_d(frz, GMP_RNDN), mpfr_get_d(fry, GMP_RNDN)); + printf("test = %.20g, %.20g\n", vget(vf2getx_vf_vf2(t2), e), vget(vf2gety_vf_vf2(t2), e)); + fflush(stdout); ecnt++; + } + } + + { + t = vget(xnextafterf(vd, vd2), e); + double c = nextafterf(d, d2); + + if (!(isnan(t) && isnan(c)) && t != c) { + printf(ISANAME " nextafterf arg=%.20g, %.20g\n", d, d2); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, 0); + + double u0 = countULPsp(t = vget(xfrfrexpf(vd), e), frx); + + if (d != 0 && isnumber(d) && u0 != 0) { + printf(ISANAME " frfrexpf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + /* + { + mpfr_set_d(frx, d, GMP_RNDN); + int cexp = mpfr_get_exp(frx); + + int texp = xexpfrexpf(d); + + if (d != 0 && isnumber(d) && cexp != texp) { + printf(ISANAME " expfrexpf arg=%.20g\n", d); + fflush(stdout); ecnt++; + } + } + */ + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xhypotf_u05(vd, vd2), e), frx); + + if (u0 > 0.5001) { + printf(ISANAME " hypotf_u05 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xhypotf_u35(vd, vd2), e), frx); + + if (u0 >= 3.5) { + printf(ISANAME " hypotf_u35 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_fmod(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xfmodf(vd, vd2), e), frx); + + if (fabs((double)d / d2) < 1e+38 && u0 > 0.5) { + printf(ISANAME " fmodf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_remainder(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = vget(xremainderf(vd, vd2), e), frx); + + if (fabs((double)d / d2) < 1e+38 && u0 > 0.5) { + printf(ISANAME " remainderf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_set_d(frz, d3, GMP_RNDN); + mpfr_fma(frx, frx, fry, frz, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xfmaf(vd, vd2, vd3), e), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+34 < c && c < 1e+33 && u0 > 0.5001) || + !(u0 <= 0.5001 || isinf(t))) { + printf(ISANAME " fmaf arg=%.20g, %.20g, %.20g ulp=%.20g\n", d, d2, d3, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + +#ifndef DETERMINISTIC + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xsqrtf(vd), e), frx); + + if (u0 > 1.0) { + printf(ISANAME " sqrtf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xsqrtf_u05(vd), e), frx); + + if (u0 > 0.5001) { + printf(ISANAME " sqrtf_u05 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xsqrtf_u35(vd), e), frx); + + if (u0 > 3.5) { + printf(ISANAME " sqrtf_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } +#endif // #ifndef DETERMINISTIC + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erfc(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xerfcf_u15(vd), e), frx); + + if (u0 > 1.5) { + printf(ISANAME " erfcf_u15 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erf(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xerff_u1(vd), e), frx); + + if (u0 > 0.75) { + printf(ISANAME " erff_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int s; + mpfr_lgamma(frx, &s, frx, GMP_RNDN); + + double u0 = countULPsp(t = vget(xlgammaf_u1(vd), e), frx); + + if (((d < 0 && fabsl(t - mpfr_get_ld(frx, GMP_RNDN)) > 1e-8 && u0 > 1) || + (0 <= d && d < 4e+36 && u0 > 1) || (4e+36 <= d && !(u0 <= 1 || isinf(t))))) { + printf(ISANAME " xlgammaf_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", (float)mpfr_get_d(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_gamma(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = vget(xtgammaf_u1(vd), e), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if (isnumber(c) || isnumber(t)) { + if (u0 > 1.0) { + printf(ISANAME " xtgammaf_u1 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", (float)mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + +#if 0 + if (cnt % 1000 == 0) { + printf("cnt = %d \r", cnt); + fflush(stdout); + } +#endif + } + mpfr_clears(frw, frx, fry, frz, NULL); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2sp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2sp.c new file mode 100644 index 0000000000000..b5af396516850 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester2sp.c @@ -0,0 +1,1037 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef ENABLE_SYS_getrandom +#define _GNU_SOURCE +#include +#include +#include +#endif + +#include "sleef.h" +#include "testerutil.h" + +#define DORENAME +#include "rename.h" + +#if defined(__APPLE__) +static int isinff(float x) { return x == __builtin_inff() || x == -__builtin_inff(); } +#endif + +#if defined(__FreeBSD__) +#define isinff(x) ((x) == (float)(1e+300) || (x) == -(float)(1e+300)) +#endif + +#define DENORMAL_FLT_MIN (1.4012984643248170709e-45f) +#define POSITIVE_INFINITYf ((float)INFINITY) +#define NEGATIVE_INFINITYf (-(float)INFINITY) + +typedef union { + double d; + uint64_t u64; + int64_t i64; +} conv64_t; + +typedef union { + float f; + uint32_t u32; + int32_t i32; +} conv32_t; + +static float nexttoward0f(float x, int n) { + union { + float f; + int32_t u; + } cx; + cx.f = x; + cx.u -= n; + return x == 0 ? 0 : cx.f; +} + +float rnd() { + conv32_t c; + switch(random() & 63) { + case 0: return nexttoward0f( 0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 1: return nexttoward0f(-0.0, -(random() & ((1 << (random() & 31)) - 1))); + case 2: return nexttoward0f( INFINITY, (random() & ((1 << (random() & 31)) - 1))); + case 3: return nexttoward0f(-INFINITY, (random() & ((1 << (random() & 31)) - 1))); + } +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + return c.f; +} + +float rnd_fr() { + conv32_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + } while(!isnumber(c.f)); + return c.f; +} + +float rnd_zo() { + conv32_t c; + do { +#ifdef ENABLE_SYS_getrandom + syscall(SYS_getrandom, &c.u32, sizeof(c.u32), 0); +#else + c.u32 = (uint32_t)random() | ((uint32_t)random() << 31); +#endif + } while(!isnumber(c.f) || c.f < -1 || 1 < c.f); + return c.f; +} + +int main(int argc,char **argv) +{ + mpfr_t frw, frx, fry, frz; + + mpfr_set_default_prec(256); + mpfr_inits(frw, frx, fry, frz, NULL); + + conv32_t cd; + float d, t; + float d2, d3, zo; + + int cnt, ecnt = 0; + + srandom(time(NULL)); + + for(cnt = 0;ecnt < 1000;cnt++) { + switch(cnt & 7) { + case 0: + d = rnd(); + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 1: + cd.f = rint(rnd_zo() * 1e+10) * M_PI_4; + cd.i32 += (random() & 0xff) - 0x7f; + d = cd.f; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + case 2: + cd.f = rnd_fr() * M_PI_4; + cd.i32 += (random() & 0xf) - 0x7; + d = cd.f; + d2 = rnd(); + d3 = rnd(); + zo = rnd(); + break; + default: + d = rnd_fr(); + d2 = rnd_fr(); + d3 = rnd_fr(); + zo = rnd_zo(); + break; + } + + Sleef_float2 sc = xsincospif_u05(d); + Sleef_float2 sc2 = xsincospif_u35(d); + + { + const float rangemax2 = 1e+7/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinpi(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = sc.x, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospif_u05 sin arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = sc2.x, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospif_u35 sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2sp(t = xsinpif_u05(d), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sinpif_u05 arg=%.20g ulp=%.20g\n", d, u2); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + const float rangemax2 = 1e+7/4; + + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cospi(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = sc.y, frx); + + if (u0 != 0 && ((fabs(d) <= rangemax2 && u0 > 0.505) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospif_u05 cos arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = sc.y, frx); + + if (u1 != 0 && ((fabs(d) <= rangemax2 && u1 > 2.0) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincospif_u35 cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + double u2 = countULP2sp(t = xcospif_u05(d), frx); + + if (u2 != 0 && ((fabs(d) <= rangemax2 && u2 > 0.506) || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cospif_u05 arg=%.20g ulp=%.20g\n", d, u2); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + sc = xsincosf(d); + sc2 = xsincosf_u1(d); + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sin(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = xsinf(d), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sinf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = sc.x, frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincosf sin arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + float u2 = countULPsp(t = xsinf_u1(d), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sinf_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + float u3 = countULPsp(t = sc2.x, frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincosf_u1 sin arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + + float u4 = countULPsp(t = xfastsinf_u3500(d), frx); + double ae4 = fabs(mpfr_get_d(frx, GMP_RNDN) - t); + + if (u4 > 350 && ae4 > 2e-6) { + printf("Pure C fastsinf_u3500 arg=%.20g ulp=%.20g\n", d, u4); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cos(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = xcosf(d), frx); + + if (u0 != 0 && (u0 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cosf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = sc.y, frx); + + if (u1 != 0 && (u1 > 3.5 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincosf cos arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + + float u2 = countULPsp(t = xcosf_u1(d), frx); + + if (u2 != 0 && (u2 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C cosf_u1 arg=%.20g ulp=%.20g\n", d, u2); + fflush(stdout); ecnt++; + } + + float u3 = countULPsp(t = sc2.y, frx); + + if (u3 != 0 && (u3 > 1 || fabs(t) > 1 || !isnumber(t))) { + printf("Pure C sincosf_u1 cos arg=%.20g ulp=%.20g\n", d, u3); + fflush(stdout); ecnt++; + } + + float u4 = countULPsp(t = xfastcosf_u3500(d), frx); + double ae4 = fabs(mpfr_get_d(frx, GMP_RNDN) - t); + + if (u4 > 350 && ae4 > 2e-6) { + printf("Pure C fastcosf_u3500 arg=%.20g ulp=%.20g\n", d, u4); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tan(frx, frx, GMP_RNDN); + + float u0 = countULPsp(t = xtanf(d), frx); + + if (u0 != 0 && (u0 > 3.5 || isnan(t))) { + printf("Pure C tanf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + float u1 = countULPsp(t = xtanf_u1(d), frx); + + if (u1 != 0 && (u1 > 1 || isnan(t))) { + printf("Pure C tanf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xlogf(fabsf(d)), frx); + + if (u0 > 3.5) { + printf("Pure C logf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xlogf_u1(fabsf(d)), frx); + + if (u1 > 1) { + printf("Pure C logf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log10(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xlog10f(fabsf(d)), frx); + + if (u0 > 1) { + printf("Pure C log10f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, fabsf(d), GMP_RNDN); + mpfr_log2(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xlog2f(fabsf(d)), frx); + + if (u0 > 1) { + printf("Pure C log2f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xlog2f_u35(fabsf(d)), frx); + + if (u1 > 3.5) { + printf("Pure C log2f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_log1p(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xlog1pf(d), frx); + + if ((-1 <= d && d <= 1e+38 && u0 > 1) || + (d < -1 && !isnan(t)) || + (d > 1e+38 && !(u0 <= 1 || isinf(t)))) { + printf("Pure C log1pf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xexpf(d), frx); + + if (u0 > 1) { + printf("Pure C expf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp2(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xexp2f(d), frx); + + if (u0 > 1) { + printf("Pure C exp2f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xexp2f_u35(d), frx); + + if (u1 > 3.5) { + printf("Pure C exp2f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_exp10(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xexp10f(d), frx); + + if (u0 > 1) { + printf("Pure C exp10f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xexp10f_u35(d), frx); + + if (u1 > 3.5) { + printf("Pure C exp10f_u35 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_expm1(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xexpm1f(d), frx); + + if (u0 > 1) { + printf("Pure C expm1f arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_pow(frx, fry, frx, GMP_RNDN); + + double u0 = countULPsp(t = xpowf(d2, d), frx); + + if (u0 > 1) { + printf("Pure C powf arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + if (isnumber(d) && isnumber(d2)) { + double u1 = countULPsp(t = xfastpowf_u3500(d2, d), frx); + + if (isnumber((float)mpfr_get_d(frx, GMP_RNDN)) && u1 > 350) { + printf("Pure C fastpowf_u3500 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cbrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xcbrtf(d), frx); + + if (u0 > 3.5) { + printf("Pure C cbrtf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xcbrtf_u1(d), frx); + + if (u1 > 1) { + printf("Pure C cbrtf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_asin(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xasinf(zo), frx); + + if (u0 > 3.5) { + printf("Pure C asinf arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xasinf_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C asinf_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, zo, GMP_RNDN); + mpfr_acos(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xacosf(zo), frx); + + if (u0 > 3.5) { + printf("Pure C acosf arg=%.20g ulp=%.20g\n", zo, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xacosf_u1(zo), frx); + + if (u1 > 1) { + printf("Pure C acosf_u1 arg=%.20g ulp=%.20g\n", zo, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atan(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xatanf(d), frx); + + if (u0 > 3.5) { + printf("Pure C atanf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULPsp(t = xatanf_u1(d), frx); + + if (u1 > 1) { + printf("Pure C atanf_u1 arg=%.20g ulp=%.20g\n", d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_atan2(frx, fry, frx, GMP_RNDN); + + double u0 = countULPsp(t = xatan2f(d2, d), frx); + + if (u0 > 3.5) { + printf("Pure C atan2f arg=%.20g, %.20g ulp=%.20g\n", d2, d, u0); + fflush(stdout); ecnt++; + } + + double u1 = countULP2sp(t = xatan2f_u1(d2, d), frx); + + if (u1 > 1) { + printf("Pure C atan2f_u1 arg=%.20g, %.20g ulp=%.20g\n", d2, d, u1); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xsinhf(d), frx); + + if ((fabs(d) <= 88.5 && u0 > 1) || + (d > 88.5 && !(u0 <= 1 || (isinf(t) && t > 0))) || + (d < -88.5 && !(u0 <= 1 || (isinf(t) && t < 0)))) { + printf("Pure C sinhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xcoshf(d), frx); + + if ((fabs(d) <= 88.5 && u0 > 1) || !(u0 <= 1 || (isinf(t) && t > 0))) { + printf("Pure C coshf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xtanhf(d), frx); + + if (u0 > 1.0001) { + printf("Pure C tanhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xsinhf_u35(d), frx); + + if ((fabs(d) <= 88 && u0 > 3.5) || + (d > 88 && !(u0 <= 3.5 || (isinf(t) && t > 0))) || + (d < -88 && !(u0 <= 3.5 || (isinf(t) && t < 0)))) { + printf("Pure C sinhf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_cosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xcoshf_u35(d), frx); + + if ((fabs(d) <= 88 && u0 > 3.5) || !(u0 <= 3.5 || (isinf(t) && t > 0))) { + printf("Pure C coshf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_tanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xtanhf_u35(d), frx); + + if (u0 > 3.5) { + printf("Pure C tanhf_u35 arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_asinh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xasinhf(d), frx); + + if ((fabs(d) < sqrt(FLT_MAX) && u0 > 1.0001) || + (d >= sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinf(t) && t > 0))) || + (d <= -sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinf(t) && t < 0)))) { + printf("Pure C asinhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_acosh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xacoshf(d), frx); + + if ((fabs(d) < sqrt(FLT_MAX) && u0 > 1.0001) || + (d >= sqrt(FLT_MAX) && !(u0 <= 1.0001 || (isinff(t) && t > 0))) || + (d <= -sqrt(FLT_MAX) && !isnan(t))) { + printf("Pure C acoshf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_atanh(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xatanhf(d), frx); + + if (u0 > 1.0001) { + printf("Pure C atanhf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + // + + { + int exp = (random() & 8191) - 4096; + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, mpfr_get_exp(frx) + exp); + + double u0 = countULPsp(t = xldexpf(d, exp), frx); + + if (u0 > 0.5002) { + printf("Pure C ldexpf arg=%.20g %d ulp=%.20g\n", d, exp, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_abs(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xfabsf(d), frx); + + if (u0 != 0) { + printf("Pure C fabsf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_copysign(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xcopysignf(d, d2), frx); + + if (u0 != 0 && !isnan(d2)) { + printf("Pure C copysignf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %g, test = %g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_max(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xfmaxf(d, d2), frx); + + if (u0 != 0) { + printf("Pure C fmaxf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_min(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xfminf(d, d2), frx); + + if (u0 != 0) { + printf("Pure C fminf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_dim(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xfdimf(d, d2), frx); + + if (u0 > 0.5) { + printf("Pure C fdimf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_trunc(frx, frx); + + double u0 = countULPsp(t = xtruncf(d), frx); + + if (u0 != 0) { + printf("Pure C truncf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_floor(frx, frx); + + double u0 = countULPsp(t = xfloorf(d), frx); + + if (u0 != 0) { + printf("Pure C floorf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_ceil(frx, frx); + + double u0 = countULPsp(t = xceilf(d), frx); + + if (u0 != 0) { + printf("Pure C ceilf arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_round(frx, frx); + + double u0 = countULPsp(t = xroundf(d), frx); + + if (u0 != 0) { + printf("Pure C roundf arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_rint(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xrintf(d), frx); + + if (u0 != 0) { + printf("Pure C rintf arg=%.24g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_modf(fry, frz, frx, GMP_RNDN); + + Sleef_float2 t2 = xmodff(d); + double u0 = countULPsp(t2.x, frz); + double u1 = countULPsp(t2.y, fry); + + if (u0 != 0 || u1 != 0) { + printf("Pure C modff arg=%.20g ulp=%.20g %.20g\n", d, u0, u1); + printf("correct = %.20g, %.20g\n", mpfr_get_d(frz, GMP_RNDN), mpfr_get_d(fry, GMP_RNDN)); + printf("test = %.20g, %.20g\n", t2.x, t2.y); + fflush(stdout); ecnt++; + } + } + + + { + t = xnextafterf(d, d2); + double c = nextafterf(d, d2); + + if (!(isnan(t) && isnan(c)) && t != c) { + printf("Pure C nextafterf arg=%.20g, %.20g\n", d, d2); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_exp(frx, 0); + + double u0 = countULPsp(t = xfrfrexpf(d), frx); + + if (d != 0 && isnumber(d) && u0 != 0) { + printf("Pure C frfrexpf arg=%.20g ulp=%.20g\n", d, u0); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int cexp = mpfr_get_exp(frx); + + int texp = xexpfrexpf(d); + + if (d != 0 && isnumber(d) && cexp != texp) { + printf("Pure C expfrexpf arg=%.20g\n", d); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2sp(t = xhypotf_u05(d, d2), frx); + + if (u0 > 0.5001) { + printf("Pure C hypotf_u05 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_hypot(frx, frx, fry, GMP_RNDN); + + double u0 = countULP2sp(t = xhypotf_u35(d, d2), frx); + + if (u0 >= 3.5) { + printf("Pure C hypotf_u35 arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_fmod(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xfmodf(d, d2), frx); + + if (fabs((double)d / d2) < 1e+38 && u0 > 0.5) { + printf("Pure C fmodf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_remainder(frx, frx, fry, GMP_RNDN); + + double u0 = countULPsp(t = xremainderf(d, d2), frx); + + if (fabs((double)d / d2) < 1e+38 && u0 > 0.5) { + printf("Pure C remainderf arg=%.20g, %.20g ulp=%.20g\n", d, d2, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_set_d(fry, d2, GMP_RNDN); + mpfr_set_d(frz, d3, GMP_RNDN); + mpfr_fma(frx, frx, fry, frz, GMP_RNDN); + + double u0 = countULP2sp(t = xfmaf(d, d2, d3), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if ((-1e+34 < c && c < 1e+33 && u0 > 0.5001) || + !(u0 <= 0.5001 || isinf(t))) { + printf("Pure C fmaf arg=%.20g, %.20g, %.20g ulp=%.20g\n", d, d2, d3, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xsqrtf_u05(d), frx); + + if (u0 > 0.5001) { + printf("Pure C sqrtf_u05 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_sqrt(frx, frx, GMP_RNDN); + + double u0 = countULPsp(t = xsqrtf_u35(d), frx); + + if (u0 > 3.5) { + printf("Pure C sqrtf_u35 arg=%.20g ulp=%.20g\n", d, u0); + printf("correct = %.20g, test = %.20g\n", mpfr_get_d(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erfc(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = xerfcf_u15(d), frx); + + if (u0 > 1.5) { + printf("Pure C erfcf arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_erf(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = xerff_u1(d), frx); + + if (u0 > 0.75) { + printf("Pure C erff arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + int s; + mpfr_lgamma(frx, &s, frx, GMP_RNDN); + + double u0 = countULPsp(t = xlgammaf_u1(d), frx); + + if (((d < 0 && fabsl(t - mpfr_get_ld(frx, GMP_RNDN)) > 1e-8 && u0 > 1) || + (0 <= d && d < 4e+36 && u0 > 1) || (4e+36 <= d && !(u0 <= 1 || isinf(t))))) { + printf("Pure C xlgammaf arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + printf("Diff = %.20Lg\n", fabsl(t - mpfr_get_ld(frx, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_set_d(frx, d, GMP_RNDN); + mpfr_gamma(frx, frx, GMP_RNDN); + + double u0 = countULP2sp(t = xtgammaf_u1(d), frx); + double c = mpfr_get_d(frx, GMP_RNDN); + + if (isnumber(c) || isnumber(t)) { + if (u0 > 1.0) { + printf("Pure C xtgamma arg=%.20g ulp=%.20g\n", d, u0); + printf("Correct = %.20Lg, test = %.20g\n", mpfr_get_ld(frx, GMP_RNDN), t); + fflush(stdout); ecnt++; + } + } + } + } + mpfr_clears(frw, frx, fry, frz, NULL); + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester3.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester3.c new file mode 100644 index 0000000000000..9abeca4db5bea --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/tester3.c @@ -0,0 +1,524 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "sleef.h" +#include "misc.h" +#include "testerutil.h" + +#ifdef __VSX__ +#include +#undef vector +#undef bool +typedef __vector double __vector_double; +typedef __vector float __vector_float; +#endif + +#if defined(__VX__) && defined(__VEC__) +#ifndef SLEEF_VECINTRIN_H_INCLUDED +#include +#define SLEEF_VECINTRIN_H_INCLUDED +#endif +typedef __attribute__((vector_size(16))) double vector_double; +typedef __attribute__((vector_size(16))) float vector_float; +#endif + +// + +#define XNAN (((union { int64_t u; double d; }) { .u = INT64_C(0xffffffffffffffff) }).d) +#define XNANf (((union { int32_t u; float d; }) { .u = 0xffffffff }).d) + +static INLINE double unifyValue(double x) { x = !(x == x) ? XNAN : x; return x; } +static INLINE float unifyValuef(float x) { x = !(x == x) ? XNANf : x; return x; } + +static INLINE double setdouble(double d, int r) { return d; } +static INLINE double getdouble(double v, int r) { return unifyValue(v); } +static INLINE float setfloat(float d, int r) { return d; } +static INLINE float getfloat(float v, int r) { return unifyValuef(v); } + +#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) +static INLINE __m128d set__m128d(double d, int r) { static double a[2]; memrand(a, sizeof(a)); a[r & 1] = d; return _mm_loadu_pd(a); } +static INLINE double get__m128d(__m128d v, int r) { static double a[2]; _mm_storeu_pd(a, v); return unifyValue(a[r & 1]); } +static INLINE __m128 set__m128(float d, int r) { static float a[4]; memrand(a, sizeof(a)); a[r & 3] = d; return _mm_loadu_ps(a); } +static INLINE float get__m128(__m128 v, int r) { static float a[4]; _mm_storeu_ps(a, v); return unifyValuef(a[r & 3]); } + +#if defined(__AVX__) +static INLINE __m256d set__m256d(double d, int r) { static double a[4]; memrand(a, sizeof(a)); a[r & 3] = d; return _mm256_loadu_pd(a); } +static INLINE double get__m256d(__m256d v, int r) { static double a[4]; _mm256_storeu_pd(a, v); return unifyValue(a[r & 3]); } +static INLINE __m256 set__m256(float d, int r) { static float a[8]; memrand(a, sizeof(a)); a[r & 7] = d; return _mm256_loadu_ps(a); } +static INLINE float get__m256(__m256 v, int r) { static float a[8]; _mm256_storeu_ps(a, v); return unifyValuef(a[r & 7]); } +#endif + +#if defined(__AVX512F__) +static INLINE __m512d set__m512d(double d, int r) { static double a[8]; memrand(a, sizeof(a)); a[r & 7] = d; return _mm512_loadu_pd(a); } +static INLINE double get__m512d(__m512d v, int r) { static double a[8]; _mm512_storeu_pd(a, v); return unifyValue(a[r & 7]); } +static INLINE __m512 set__m512(float d, int r) { static float a[16]; memrand(a, sizeof(a)); a[r & 15] = d; return _mm512_loadu_ps(a); } +static INLINE float get__m512(__m512 v, int r) { static float a[16]; _mm512_storeu_ps(a, v); return unifyValuef(a[r & 15]); } +#endif +#endif // #if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) + +#if defined(__aarch64__) && defined(__ARM_NEON) +static INLINE VECTOR_CC float64x2_t setfloat64x2_t(double d, int r) { double a[2]; memrand(a, sizeof(a)); a[r & 1] = d; return vld1q_f64(a); } +static INLINE VECTOR_CC double getfloat64x2_t(float64x2_t v, int r) { double a[2]; vst1q_f64(a, v); return unifyValue(a[r & 1]); } +static INLINE VECTOR_CC float32x4_t setfloat32x4_t(float d, int r) { float a[4]; memrand(a, sizeof(a)); a[r & 3] = d; return vld1q_f32(a); } +static INLINE VECTOR_CC float getfloat32x4_t(float32x4_t v, int r) { float a[4]; vst1q_f32(a, v); return unifyValuef(a[r & 3]); } +#endif + +#ifdef __ARM_FEATURE_SVE +static INLINE svfloat64_t setsvfloat64_t(double d, int r) { double a[svcntd()]; memrand(a, sizeof(a)); a[r & (svcntd()-1)] = d; return svld1_f64(svptrue_b8(), a); } +static INLINE double getsvfloat64_t(svfloat64_t v, int r) { double a[svcntd()]; svst1_f64(svptrue_b8(), a, v); return unifyValue(a[r & (svcntd()-1)]); } +static INLINE svfloat32_t setsvfloat32_t(float d, int r) { float a[svcntw()]; memrand(a, sizeof(a)); a[r & (svcntw()-1)] = d; return svld1_f32(svptrue_b8(), a); } +static INLINE float getsvfloat32_t(svfloat32_t v, int r) { float a[svcntw()]; svst1_f32(svptrue_b8(), a, v); return unifyValuef(a[r & (svcntw()-1)]); } + +static svfloat64_t vd2getx_vd_vd2(svfloat64x2_t v) { return svget2_f64(v, 0); } +static svfloat64_t vd2gety_vd_vd2(svfloat64x2_t v) { return svget2_f64(v, 1); } +static svfloat32_t vf2getx_vf_vf2(svfloat32x2_t v) { return svget2_f32(v, 0); } +static svfloat32_t vf2gety_vf_vf2(svfloat32x2_t v) { return svget2_f32(v, 1); } +#endif + +#ifdef __VSX__ +static INLINE __vector double setSLEEF_VECTOR_DOUBLE(double d, int r) { double a[2]; memrand(a, sizeof(a)); a[r & 1] = d; return vec_vsx_ld(0, a); } +static INLINE double getSLEEF_VECTOR_DOUBLE(__vector double v, int r) { double a[2]; vec_vsx_st(v, 0, a); return unifyValue(a[r & 1]); } +static INLINE __vector float setSLEEF_VECTOR_FLOAT(float d, int r) { float a[4]; memrand(a, sizeof(a)); a[r & 3] = d; return vec_vsx_ld(0, a); } +static INLINE float getSLEEF_VECTOR_FLOAT(__vector float v, int r) { float a[4]; vec_vsx_st(v, 0, a); return unifyValuef(a[r & 3]); } +#endif + +#ifdef __VX__ +static INLINE __attribute__((vector_size(16))) double setSLEEF_VECTOR_DOUBLE(double d, int r) { double a[2]; memrand(a, sizeof(a)); a[r & 1] = d; return (__attribute__((vector_size(16))) double) { a[0], a[1] }; } +static INLINE double getSLEEF_VECTOR_DOUBLE(__attribute__((vector_size(16))) double v, int r) { return unifyValue(v[r & 1]); } +static INLINE __attribute__((vector_size(16))) float setSLEEF_VECTOR_FLOAT(float d, int r) { float a[4]; memrand(a, sizeof(a)); a[r & 3] = d; return (__attribute__((vector_size(16))) float) { a[0], a[1], a[2], a[3] }; } +static INLINE float getSLEEF_VECTOR_FLOAT(__attribute__((vector_size(16))) float v, int r) { return unifyValuef(v[r & 3]); } +#endif + +#if __riscv && __riscv_v + +#if defined(ENABLE_RVVM1) +#define VECTLENSP (1 * __riscv_vlenb() / sizeof(float)) +#define VECTLENDP (1 * __riscv_vlenb() / sizeof(double)) + +static INLINE vfloat32m1_t setvfloat32m1_t(float d, int r) { float a[VECTLENSP]; memrand(a, sizeof(a)); a[r & (VECTLENSP-1)] = d; return __riscv_vle32_v_f32m1(a, VECTLENSP); } +static INLINE float getvfloat32m1_t(vfloat32m1_t v, int r) { float a[VECTLENSP]; __riscv_vse32(a, v, VECTLENSP); return unifyValuef(a[r & (VECTLENSP-1)]); } +static INLINE vfloat64m1_t setvfloat64m1_t(double d, int r) { double a[VECTLENDP]; memrand(a, sizeof(a)); a[r & (VECTLENDP-1)] = d; return __riscv_vle64_v_f64m1(a, VECTLENDP); } +static INLINE double getvfloat64m1_t(vfloat64m1_t v, int r) { double a[VECTLENDP]; __riscv_vse64(a, v, VECTLENDP); return unifyValue(a[r & (VECTLENDP-1)]); } + +static vfloat32m1_t vf2getx_vf_vf2(vfloat32m2_t v) { return __riscv_vget_f32m1(v, 0); } +static vfloat32m1_t vf2gety_vf_vf2(vfloat32m2_t v) { return __riscv_vget_f32m1(v, 1); } +static vfloat64m1_t vd2getx_vd_vd2(vfloat64m2_t v) { return __riscv_vget_f64m1(v, 0); } +static vfloat64m1_t vd2gety_vd_vd2(vfloat64m2_t v) { return __riscv_vget_f64m1(v, 1); } + +#elif defined(ENABLE_RVVM2) +#define VECTLENSP (2 * __riscv_vlenb() / sizeof(float)) +#define VECTLENDP (2 * __riscv_vlenb() / sizeof(double)) + +static INLINE vfloat32m2_t setvfloat32m2_t(float d, int r) { float a[VECTLENSP]; memrand(a, sizeof(a)); a[r & (VECTLENSP-1)] = d; return __riscv_vle32_v_f32m2(a, VECTLENSP); } +static INLINE float getvfloat32m2_t(vfloat32m2_t v, int r) { float a[VECTLENSP]; __riscv_vse32(a, v, VECTLENSP); return unifyValuef(a[r & (VECTLENSP-1)]); } +static INLINE vfloat64m2_t setvfloat64m2_t(double d, int r) { double a[VECTLENDP]; memrand(a, sizeof(a)); a[r & (VECTLENDP-1)] = d; return __riscv_vle64_v_f64m2(a, VECTLENDP); } +static INLINE double getvfloat64m2_t(vfloat64m2_t v, int r) { double a[VECTLENDP]; __riscv_vse64(a, v, VECTLENDP); return unifyValue(a[r & (VECTLENDP-1)]); } + +static vfloat32m2_t vf2getx_vf_vf2(vfloat32m4_t v) { return __riscv_vget_f32m2(v, 0); } +static vfloat32m2_t vf2gety_vf_vf2(vfloat32m4_t v) { return __riscv_vget_f32m2(v, 1); } +static vfloat64m2_t vd2getx_vd_vd2(vfloat64m4_t v) { return __riscv_vget_f64m2(v, 0); } +static vfloat64m2_t vd2gety_vd_vd2(vfloat64m4_t v) { return __riscv_vget_f64m2(v, 1); } + +#else +#error "unknown RVV" +#endif + +#undef VECTLENSP +#undef VECTLENDP +#endif + +// + +// ATR = cinz_, NAME = sin, TYPE = d2, ULP = u35, EXT = sse2 +#define FUNC(ATR, NAME, TYPE, ULP, EXT) Sleef_ ## ATR ## NAME ## TYPE ## _ ## ULP ## EXT +#define _TYPE2(TYPE) Sleef_ ## TYPE ## _2 +#define TYPE2(TYPE) _TYPE2(TYPE) +#define SET(TYPE) set ## TYPE +#define GET(TYPE) get ## TYPE + +#if !defined(__ARM_FEATURE_SVE) && !(defined(__riscv) && defined(__riscv_v)) +static DPTYPE vd2getx_vd_vd2(TYPE2(DPTYPE) v) { return v.x; } +static DPTYPE vd2gety_vd_vd2(TYPE2(DPTYPE) v) { return v.y; } +static SPTYPE vf2getx_vf_vf2(TYPE2(SPTYPE) v) { return v.x; } +static SPTYPE vf2gety_vf_vf2(TYPE2(SPTYPE) v) { return v.y; } +#endif + +// + +#define initDigest \ + EVP_MD_CTX *ctx; ctx = EVP_MD_CTX_new(); \ + if (!ctx) { \ + fprintf(stderr, "Error creating context.\n"); \ + return 0; \ + } \ + if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) { \ + fprintf(stderr, "Error initializing context.\n"); \ + return 0; \ + } + +#define checkDigest(NAME, ULP) do { \ + unsigned int md5_digest_len = EVP_MD_size(EVP_md5()); \ + unsigned char *md5_digest; \ + md5_digest = (unsigned char *)malloc(md5_digest_len); \ + if (!EVP_DigestFinal_ex(ctx, md5_digest, &md5_digest_len)) { \ + fprintf(stderr, "Error finalizing digest.\n"); \ + return 0; \ + } \ + EVP_MD_CTX_free(ctx); \ + unsigned char mes[64], buf[64]; \ + memset(mes, 0, 64); \ + sprintf((char *)mes, "%s ", #NAME " " #ULP); \ + char tmp[3] = { 0 }; \ + for (int i = 0; i < md5_digest_len; i++) { \ + sprintf(tmp, "%02x", md5_digest[i]); \ + strcat((char *)mes, tmp); \ + } \ + free(md5_digest); \ + if (fp != NULL) { \ + fgets((char *)buf, 60, fp); \ + if (strncmp((char *)mes, (char *)buf, strlen((char *)mes)) != 0) { \ + puts((char *)mes); \ + puts((char *)buf); \ + success = 0; \ + } \ + } else puts((char *)mes); \ + } while(0) + +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#define convertEndianness(ptr, len) do { \ + for(int k=0;k +#include +#include +#include +#include +#include +#include + +#include + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) +#define STDIN_FILENO 0 +#else +#include +#include +#endif + +#if defined(__MINGW32__) || defined(__MINGW64__) +#include +#endif + +#if defined(_MSC_VER) +#include +#endif + +#include "misc.h" + +#define DENORMAL_DBL_MIN (4.9406564584124654418e-324) +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +#define DENORMAL_FLT_MIN (1.4012984643248170709e-45f) +#define POSITIVE_INFINITYf ((float)INFINITY) +#define NEGATIVE_INFINITYf (-(float)INFINITY) + +int isnumber(double x) { return !isinf(x) && !isnan(x); } +int isPlusZero(double x) { return x == 0 && copysign(1, x) == 1; } +int isMinusZero(double x) { return x == 0 && copysign(1, x) == -1; } +double sign(double d) { return d < 0 ? -1 : 1; } +int xisnan(double x) { return x != x; } + +int isnumberf(float x) { return !isinf(x) && !isnan(x); } +int isPlusZerof(float x) { return x == 0 && copysignf(1, x) == 1; } +int isMinusZerof(float x) { return x == 0 && copysignf(1, x) == -1; } +float signf(float d) { return d < 0 ? -1 : 1; } +int xisnanf(float x) { return x != x; } + +int enableFlushToZero = 0; + +double flushToZero(double y) { + if (enableFlushToZero && fabs(y) < FLT_MIN) y = copysign(0.0, y); + return y; +} + +// + +int readln(int fd, char *buf, int cnt) { + int i, rcnt = 0; + + if (cnt < 1) return -1; + + while(cnt >= 2) { + i = read(fd, buf, 1); + if (i != 1) return i; + + if (*buf == '\n') break; + + rcnt++; + buf++; + cnt--; + } + + *++buf = '\0'; + rcnt++; + return rcnt; +} + +static uint64_t xseed; + +uint64_t xrand() { + xseed = xseed * UINT64_C(6364136223846793005) + 1; + return xseed; +} + +// Fill memory with random bits +void memrand(void *p, int size) { + uint64_t *q = (uint64_t *)p; + int i; + for(i=0;i + +int cmpDenormsp(float x, mpfr_t fry) { + float y = mpfr_get_d(fry, GMP_RNDN); + x = flushToZero(x); + y = flushToZero(y); + if (xisnanf(x) && xisnanf(y)) return 1; + if (xisnanf(x) || xisnanf(y)) return 0; + if (isinf(x) != isinf(y)) return 0; + if (x == POSITIVE_INFINITYf && y == POSITIVE_INFINITYf) return 1; + if (x == NEGATIVE_INFINITYf && y == NEGATIVE_INFINITYf) return 1; + if (y == 0) { + if (isPlusZerof(x) && isPlusZerof(y)) return 1; + if (isMinusZerof(x) && isMinusZerof(y)) return 1; + return 0; + } + if (!xisnanf(x) && !xisnanf(y) && !isinf(x) && !isinf(y)) return signf(x) == signf(y); + return 0; +} + +int cmpDenormdp(double x, mpfr_t fry) { + double y = mpfr_get_d(fry, GMP_RNDN); + if (xisnan(x) && xisnan(y)) return 1; + if (xisnan(x) || xisnan(y)) return 0; + if (isinf(x) != isinf(y)) return 0; + if (x == POSITIVE_INFINITY && y == POSITIVE_INFINITY) return 1; + if (x == NEGATIVE_INFINITY && y == NEGATIVE_INFINITY) return 1; + if (y == 0) { + if (isPlusZero(x) && isPlusZero(y)) return 1; + if (isMinusZero(x) && isMinusZero(y)) return 1; + return 0; + } + if (!xisnan(x) && !xisnan(y) && !isinf(x) && !isinf(y)) return sign(x) == sign(y); + return 0; +} + +double countULPdp(double d, mpfr_t c) { + mpfr_t fra, frb, frc, frd; + mpfr_inits(fra, frb, frc, frd, NULL); + + double c2 = mpfr_get_d(c, GMP_RNDN); + if (c2 == 0 && d != 0) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 10000; + } + if (isnan(c2) && isnan(d)) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + if (isnan(c2) || isnan(d)) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 10001; + } + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + + double v = 0; + if (isinf(d) && !isinf(mpfr_get_d(c, GMP_RNDN))) { + d = copysign(DBL_MAX, c2); + v = 1; + } + + // + + int e; + frexp(mpfr_get_d(c, GMP_RNDN), &e); + mpfr_set_ld(frb, fmaxl(ldexpl(1.0, e-53), DENORMAL_DBL_MIN), GMP_RNDN); + + mpfr_set_d(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + mpfr_clears(fra, frb, frc, frd, NULL); + + return u + v; +} + +double countULP2dp(double d, mpfr_t c) { + mpfr_t fra, frb, frc, frd; + mpfr_inits(fra, frb, frc, frd, NULL); + + double c2 = mpfr_get_d(c, GMP_RNDN); + if (c2 == 0 && d != 0) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 10000; + } + if (isnan(c2) && isnan(d)) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + if (isnan(c2) || isnan(d)) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 10001; + } + if (c2 == POSITIVE_INFINITY && d == POSITIVE_INFINITY) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + if (c2 == NEGATIVE_INFINITY && d == NEGATIVE_INFINITY) { + mpfr_clears(fra, frb, frc, frd, NULL); + return 0; + } + + double v = 0; + if (isinf(d) && !isinf(mpfr_get_d(c, GMP_RNDN))) { + d = copysign(DBL_MAX, c2); + v = 1; + } + + // + + int e; + frexp(mpfr_get_d(c, GMP_RNDN), &e); + mpfr_set_ld(frb, fmaxl(ldexpl(1.0, e-53), DBL_MIN), GMP_RNDN); + + mpfr_set_d(frd, d, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + double u = fabs(mpfr_get_d(fra, GMP_RNDN)); + + mpfr_clears(fra, frb, frc, frd, NULL); + + return u + v; +} + +double countULPsp(float d, mpfr_t c0) { + double c = mpfr_get_d(c0, GMP_RNDN); + + d = flushToZero(d); + float c2 = flushToZero(c); + if (c2 == 0 && d != 0) return 10000; + if (isnan(c2) && isnan(d)) return 0; + if (isnan(c2) || isnan(d)) return 10001; + if (c2 == POSITIVE_INFINITYf && d == POSITIVE_INFINITYf) return 0; + if (c2 == NEGATIVE_INFINITYf && d == NEGATIVE_INFINITYf) return 0; + + double v = 0; + if (isinf(d) && !isinf(c)) { + d = copysign(FLT_MAX, c2); + v = 1; + } + + // + + int e; + frexp(c, &e); + + double u = fabs(d - c) * fmin(ldexp(1.0, 24-e), 1.0 / DENORMAL_FLT_MIN); + + return u + v; +} + +double countULP2sp(float d, mpfr_t c0) { + double c = mpfr_get_d(c0, GMP_RNDN); + + d = flushToZero(d); + float c2 = flushToZero(c); + if (c2 == 0 && d != 0) return 10000; + if (isnan(c2) && isnan(d)) return 0; + if (isnan(c2) || isnan(d)) return 10001; + if (c2 == POSITIVE_INFINITYf && d == POSITIVE_INFINITYf) return 0; + if (c2 == NEGATIVE_INFINITYf && d == NEGATIVE_INFINITYf) return 0; + + double v = 0; + if (isinf(d) && !isinf(c)) { + d = copysign(FLT_MAX, c2); + v = 1; + } + + // + + int e; + frexp(c, &e); + + double u = fabs(d - c) * fmin(ldexp(1.0, 24-e), 1.0 / FLT_MIN); + + return u + v; +} + +// + +#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) +void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_mul(frd, frpi, arg, GMP_RNDN); + mpfr_sin(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} + +void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { + mpfr_t frpi, frd; + mpfr_inits(frpi, frd, NULL); + + mpfr_const_pi(frpi, GMP_RNDN); + mpfr_set_d(frd, 1.0, GMP_RNDN); + mpfr_mul(frpi, frpi, frd, GMP_RNDN); + mpfr_mul(frd, frpi, arg, GMP_RNDN); + mpfr_cos(ret, frd, GMP_RNDN); + + mpfr_clears(frpi, frd, NULL); +} +#endif + +void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { + int s; + mpfr_lgamma(ret, &s, arg, rnd); +} +#endif // #define USEMPFR diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testerutil.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testerutil.h new file mode 100644 index 0000000000000..53350746c3c10 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testerutil.h @@ -0,0 +1,100 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define DENORMAL_DBL_MIN (4.9406564584124654418e-324) +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +#define DENORMAL_FLT_MIN (1.4012984643248170709e-45f) +#define POSITIVE_INFINITYf ((float)INFINITY) +#define NEGATIVE_INFINITYf (-(float)INFINITY) + +#ifndef M_PIf +# define M_PIf ((float)M_PI) +#endif + +extern int enableFlushToZero; +double flushToZero(double y); + +int isnumber(double x); +int isPlusZero(double x); +int isMinusZero(double x); +int xisnan(double x); +double sign(double d); + +int isnumberf(float x); +int isPlusZerof(float x); +int isMinusZerof(float x); +int xisnanf(float x); +float signf(float d); + +int readln(int fd, char *buf, int cnt); + +#define XRAND_MAX (INT64_C(0x100000000) * (double)INT64_C(0x100000000)) + +void xsrand(uint64_t s); +uint64_t xrand(); +void memrand(void *p, int size); + +// The following functions are meant to be inlined + +static double u2d(uint64_t u) { + union { + double f; + uint64_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint64_t d2u(double d) { + union { + double f; + uint64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static float u2f(uint32_t u) { + union { + float f; + uint32_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint32_t f2u(float d) { + union { + float f; + uint32_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static int startsWith(char *str, char *prefix) { + while(*prefix != '\0') if (*str++ != *prefix++) return 0; + return *prefix == '\0'; +} + +// + +#ifdef USEMPFR +int cmpDenormdp(double x, mpfr_t fry); +double countULPdp(double d, mpfr_t c); +double countULP2dp(double d, mpfr_t c); + +int cmpDenormsp(float x, mpfr_t fry); +double countULPsp(float d, mpfr_t c); +double countULP2sp(float d, mpfr_t c); + +#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) +void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); +void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); +#endif +void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testervecabi.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testervecabi.c new file mode 100644 index 0000000000000..a428540f15eeb --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm-tester/testervecabi.c @@ -0,0 +1,850 @@ +#include +#include + +#define SLEEF_ENABLE_OMP_SIMD +#include + +#define N (65536 - 1) +#define THRES 1e-10 +#define THRESF 0.02 + +double a[N], b[N], c[N], d[N]; +float e[N], f[N], g[N], h[N]; + +static void check(char *mes, double thres) { + double err = 0; + for (int i = 0; i < N; i++) err += d[i] >= 0 ? d[i] : -d[i]; + if (err > thres) { + printf("%s, error=%g\n", mes, err); + exit(-1); + } +} + +static void checkf(char *mes, double thres) { + double err = 0; + for (int i = 0; i < N; i++) err += h[i] >= 0 ? h[i] : -h[i]; + if (err > thres) { + printf("%s, error=%g\n", mes, err); + exit(-1); + } +} + +void func00() { +// CHECK-AVX512: func00 +// CHECK-AVX2: func00 +// CHECK-SSE2: func00 + for (int i = 0; i < N; i++) d[i] = Sleef_asin_u10(Sleef_sin_u10(a[i])) - a[i]; + check("sin_u10, asin_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_asin_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sin_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_asin_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sin_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_asin_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sin_u10 +} + +void func01() { +// CHECK-AVX512: func01 +// CHECK-AVX2: func01 +// CHECK-SSE2: func01 + for (int i = 0; i < N; i++) d[i] = Sleef_asin_u35(Sleef_sin_u35(a[i])) - a[i]; + check("sin_u35, asin_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_asin_u35 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sin_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_asin_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sin_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_asin_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sin_u35 +} + +void func02() { +// CHECK-AVX512: func02 +// CHECK-AVX2: func02 +// CHECK-SSE2: func02 + for (int i = 0; i < N; i++) d[i] = Sleef_acos_u10(Sleef_cos_u10(a[i])) - a[i]; + check("cos_u10, acos_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_acos_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cos_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_acos_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cos_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_acos_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cos_u10 +} + +void func03() { +// CHECK-AVX512: func03 +// CHECK-AVX2: func03 +// CHECK-SSE2: func03 + for (int i = 0; i < N; i++) d[i] = Sleef_acos_u35(Sleef_cos_u35(a[i])) - a[i]; + check("cos_u35, acos_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_acos_u35 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cos_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_acos_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cos_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_acos_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cos_u35 +} + +void func04() { +// CHECK-AVX512: func04 +// CHECK-AVX2: func04 +// CHECK-SSE2: func04 + for (int i = 0; i < N; i++) d[i] = Sleef_atan_u10(Sleef_tan_u10(a[i])) - a[i]; + check("tan_u10, atan_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_atan_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_tan_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_atan_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_tan_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_atan_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_tan_u10 +} + +void func05() { +// CHECK-AVX512: func05 +// CHECK-AVX2: func05 +// CHECK-SSE2: func05 + for (int i = 0; i < N; i++) d[i] = Sleef_atan_u35(Sleef_tan_u35(a[i])) - a[i]; + check("tan_u35, atan_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_atan_u35 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_tan_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_atan_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_tan_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_atan_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_tan_u35 +} + +void func06() { +// CHECK-AVX512: func06 +// CHECK-AVX2: func06 +// CHECK-SSE2: func06 + for (int i = 0; i < N; i++) d[i] = Sleef_atan2_u10(b[i] * Sleef_sinpi_u05(a[i]*0.1), b[i] * Sleef_cospi_u05(a[i]*0.1)) - a[i]*0.3141592653589793; + check("sinpi_u05, cospi_u05, atan2_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sinpi_u05 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cospi_u05 +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_atan2_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sinpi_u05 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cospi_u05 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_atan2_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sinpi_u05 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cospi_u05 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_atan2_u10 +} + +void func07() { +// CHECK-AVX512: func07 +// CHECK-AVX2: func07 +// CHECK-SSE2: func07 + for (int i = 0; i < N; i++) d[i] = Sleef_atan2_u35(b[i] * Sleef_sinpi_u05(a[i]*0.1), b[i] * Sleef_cospi_u05(a[i]*0.1)) - a[i]*0.3141592653589793; + check("sinpi_u05, cospi_u05, atan2_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sinpi_u05 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cospi_u05 +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_atan2_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sinpi_u05 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cospi_u05 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_atan2_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sinpi_u05 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cospi_u05 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_atan2_u35 +} + +void func08() { +// CHECK-AVX512: func08 +// CHECK-AVX2: func08 +// CHECK-SSE2: func08 + for (int i = 0; i < N; i++) d[i] = Sleef_log2_u10(Sleef_exp2_u10(a[i])) - a[i]; + check("log2_u10, exp2_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log2_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp2_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log2_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp2_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log2_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp2_u10 +} + +void func09() { +// CHECK-AVX512: func09 +// CHECK-AVX2: func09 +// CHECK-SSE2: func09 + for (int i = 0; i < N; i++) d[i] = Sleef_log2_u35(Sleef_exp2_u35(a[i])) - a[i]; + check("log2_u35, exp2_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log2_u35 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp2_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log2_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp2_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log2_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp2_u35 +} + +void func10() { +// CHECK-AVX512: func10 +// CHECK-AVX2: func10 +// CHECK-SSE2: func10 + for (int i = 0; i < N; i++) d[i] = Sleef_log10_u10(Sleef_exp10_u35(a[i])) - a[i]; + check("log10_u10, exp10_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log10_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp10_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log10_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp10_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log10_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp10_u35 +} + +void func11() { +// CHECK-AVX512: func11 +// CHECK-AVX2: func11 +// CHECK-SSE2: func11 + for (int i = 0; i < N; i++) d[i] = Sleef_log10_u10(Sleef_exp10_u10(a[i])) - a[i]; + check("log10_u10, exp10_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log10_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp10_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log10_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp10_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log10_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp10_u10 +} + +void func12() { +// CHECK-AVX512: func12 +// CHECK-AVX2: func12 +// CHECK-SSE2: func12 + for (int i = 0; i < N; i++) d[i] = Sleef_log1p_u10(Sleef_expm1_u10(a[i])) - a[i]; + check("log1p_u10, expm1_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log1p_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_expm1_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log1p_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_expm1_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log1p_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_expm1_u10 +} + +void func13() { +// CHECK-AVX512: func13 +// CHECK-AVX2: func13 +// CHECK-SSE2: func13 + for (int i = 0; i < N; i++) d[i] = Sleef_pow_u10(a[i], b[i]) - Sleef_exp_u10(Sleef_log_u10(a[i]) * b[i]); + check("pow_u10, exp_u10, log_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_pow_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log_u10 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_pow_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log_u10 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_pow_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log_u10 +} + +void func14() { +// CHECK-AVX512: func14 +// CHECK-AVX2: func14 +// CHECK-SSE2: func14 + for (int i = 0; i < N; i++) d[i] = Sleef_pow_u10(a[i], b[i]) - Sleef_exp_u10(Sleef_log_u35(a[i]) * b[i]); + check("pow_u10, exp_u10, log_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_pow_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_exp_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_log_u35 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_pow_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_exp_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_log_u35 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_pow_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_exp_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_log_u35 +} + +void func15() { +// CHECK-AVX512: func15 +// CHECK-AVX2: func15 +// CHECK-SSE2: func15 + for (int i = 0; i < N; i++) d[i] = Sleef_cbrt_u10(a[i] * a[i] * a[i]) - a[i]; + check("cbrt_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cbrt_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cbrt_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cbrt_u10 +} + +void func16() { +// CHECK-AVX512: func16 +// CHECK-AVX2: func16 +// CHECK-SSE2: func16 + for (int i = 0; i < N; i++) d[i] = Sleef_cbrt_u35(a[i] * a[i] * a[i]) - a[i]; + check("cbrt_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cbrt_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cbrt_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cbrt_u35 +} + +void func17() { +// CHECK-AVX512: func17 +// CHECK-AVX2: func17 +// CHECK-SSE2: func17 + for (int i = 0; i < N; i++) d[i] = Sleef_asinh_u10(Sleef_sinh_u10(a[i])) - a[i]; + check("asinh_u10, sinh_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_asinh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sinh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_asinh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sinh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_asinh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sinh_u10 +} + +void func18() { +// CHECK-AVX512: func18 +// CHECK-AVX2: func18 +// CHECK-SSE2: func18 + for (int i = 0; i < N; i++) d[i] = Sleef_asinh_u10(Sleef_sinh_u35(a[i])) - a[i]; + check("asinh_u10, sinh_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_asinh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_sinh_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_asinh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_sinh_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_asinh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_sinh_u35 +} + +void func19() { +// CHECK-AVX512: func19 +// CHECK-AVX2: func19 +// CHECK-SSE2: func19 + for (int i = 0; i < N; i++) d[i] = Sleef_acosh_u10(Sleef_cosh_u10(a[i])) - a[i]; + check("acosh_u10, cosh_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_acosh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cosh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_acosh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cosh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_acosh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cosh_u10 +} + +void func20() { +// CHECK-AVX512: func20 +// CHECK-AVX2: func20 +// CHECK-SSE2: func20 + for (int i = 0; i < N; i++) d[i] = Sleef_acosh_u10(Sleef_cosh_u35(a[i])) - a[i]; + check("acosh_u10, cosh_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_acosh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_cosh_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_acosh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_cosh_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_acosh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_cosh_u35 +} + +void func21() { +// CHECK-AVX512: func21 +// CHECK-AVX2: func21 +// CHECK-SSE2: func21 + for (int i = 0; i < N; i++) d[i] = Sleef_atanh_u10(Sleef_tanh_u10(a[i])) - a[i]; + check("atanh_u10, tanh_u10", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_atanh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_tanh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_atanh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_tanh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_atanh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_tanh_u10 +} + +void func22() { +// CHECK-AVX512: func22 +// CHECK-AVX2: func22 +// CHECK-SSE2: func22 + for (int i = 0; i < N; i++) d[i] = Sleef_atanh_u10(Sleef_tanh_u35(a[i])) - a[i]; + check("atanh_u10, tanh_u35", THRES); +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_atanh_u10 +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_tanh_u35 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_atanh_u10 +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_tanh_u35 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_atanh_u10 +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_tanh_u35 +} + +void func23() { +// CHECK-AVX512: func23 +// CHECK-AVX2: func23 +// CHECK-SSE2: func23 + for (int i = 0; i < N; i++) d[i] = Sleef_fma(a[i], b[i], c[i]) - (a[i] * b[i] + c[i]); + check("fma", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vvv_Sleef_fma +// CHECK-AVX512-DAG: _ZGVeN8vvv_Sleef_fma +// CHECK-SSE2-DAG: _ZGVbN2vvv_Sleef_fma +} + +void func24() { +// CHECK-AVX512: func24 +// CHECK-AVX2: func24 +// CHECK-SSE2: func24 + for (int i = 0; i < N; i++) d[i] = Sleef_hypot_u05(a[i], b[i]) - Sleef_sqrt_u05(a[i] * a[i] + b[i] * b[i]); + check("hypot_u05, sqrt_u05", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_hypot_u05 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_hypot_u05 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_hypot_u05 +} + +void func25() { +// CHECK-AVX512: func25 +// CHECK-AVX2: func25 +// CHECK-SSE2: func25 + for (int i = 0; i < N; i++) d[i] = Sleef_hypot_u35(a[i], b[i]) - Sleef_sqrt_u05(a[i] * a[i] + b[i] * b[i]); + check("hypot_u35, sqrt_u05", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_hypot_u35 +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_hypot_u35 +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_hypot_u35 +} + +void func26() { +// CHECK-AVX512: func26 +// CHECK-AVX2: func26 +// CHECK-SSE2: func26 + for (int i = 0; i < N; i++) d[i] = Sleef_fmod(a[i], b[i]) - (a[i] - Sleef_floor(a[i] / b[i]) * b[i]); + check("fmod, floor", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_fmod +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_floor +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_fmod +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_floor +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_fmod +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_floor +} + +void func27() { +// CHECK-AVX512: func27 +// CHECK-AVX2: func27 +// CHECK-SSE2: func27 + for (int i = 0; i < N; i++) d[i] = Sleef_remainder(a[i], b[i]) - (a[i] - Sleef_rint(a[i] / b[i]) * b[i]); + check("remainder, rint", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_remainder +// CHECK-AVX2-DAG: _ZGVdN4v_Sleef_rint +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_remainder +// CHECK-AVX512-DAG: _ZGVeN8v_Sleef_rint +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_remainder +// CHECK-SSE2-DAG: _ZGVbN2v_Sleef_rint +} + +void func28() { +// CHECK-AVX512: func28 +// CHECK-AVX2: func28 +// CHECK-SSE2: func28 + for (int i = 0; i < N; i++) d[i] = Sleef_nextafter(Sleef_nextafter(a[i], b[i]), -b[i]) - a[i]; + check("nextafter", THRES); +// CHECK-AVX2-DAG: _ZGVdN4vv_Sleef_nextafter +// CHECK-AVX512-DAG: _ZGVeN8vv_Sleef_nextafter +// CHECK-SSE2-DAG: _ZGVbN2vv_Sleef_nextafter +} + +void func29() { +// CHECK-AVX512: func29 +// CHECK-AVX2: func29 +// CHECK-SSE2: func29 + for (int i = 0; i < N; i++) h[i] = Sleef_asinf_u10(Sleef_sinf_u10(e[i])) - e[i]; + checkf("sinf_u10, asinf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_asinf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_asinf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_asinf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinf_u10 +} + +void func30() { +// CHECK-AVX512: func30 +// CHECK-AVX2: func30 +// CHECK-SSE2: func30 + for (int i = 0; i < N; i++) h[i] = Sleef_asinf_u35(Sleef_sinf_u35(e[i])) - e[i]; + checkf("sinf_u35, asinf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_asinf_u35 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_asinf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_asinf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinf_u35 +} + +void func31() { +// CHECK-AVX512: func31 +// CHECK-AVX2: func31 +// CHECK-SSE2: func31 + for (int i = 0; i < N; i++) h[i] = Sleef_acosf_u10(Sleef_cosf_u10(e[i])) - e[i]; + checkf("cosf_u10, acosf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_acosf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cosf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_acosf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cosf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_acosf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cosf_u10 +} + +void func32() { +// CHECK-AVX512: func32 +// CHECK-AVX2: func32 +// CHECK-SSE2: func32 + for (int i = 0; i < N; i++) h[i] = Sleef_acosf_u35(Sleef_cosf_u35(e[i])) - e[i]; + checkf("cosf_u35, acosf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_acosf_u35 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cosf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_acosf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cosf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_acosf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cosf_u35 +} + +void func33() { +// CHECK-AVX512: func33 +// CHECK-AVX2: func33 +// CHECK-SSE2: func33 + for (int i = 0; i < N; i++) h[i] = Sleef_atanf_u10(Sleef_tanf_u10(e[i])) - e[i]; + checkf("tanf_u10, atanf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_atanf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_tanf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_atanf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_tanf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_atanf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_tanf_u10 +} + +void func34() { +// CHECK-AVX512: func34 +// CHECK-AVX2: func34 +// CHECK-SSE2: func34 + for (int i = 0; i < N; i++) h[i] = Sleef_atanf_u35(Sleef_tanf_u35(e[i])) - e[i]; + checkf("tanf_u35, atanf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_atanf_u35 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_tanf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_atanf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_tanf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_atanf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_tanf_u35 +} + +void func35() { +// CHECK-AVX512: func35 +// CHECK-AVX2: func35 +// CHECK-SSE2: func35 + for (int i = 0; i < N; i++) h[i] = Sleef_atan2f_u10(f[i] * Sleef_sinpif_u05(e[i]*0.1), f[i] * Sleef_cospif_u05(e[i]*0.1)) - e[i]*0.3141592653589793; + checkf("sinpif_u05, cospif_u05, atan2f_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinpif_u05 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cospif_u05 +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_atan2f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinpif_u05 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cospif_u05 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_atan2f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinpif_u05 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cospif_u05 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_atan2f_u10 +} + +void func36() { +// CHECK-AVX512: func36 +// CHECK-AVX2: func36 +// CHECK-SSE2: func36 + for (int i = 0; i < N; i++) h[i] = Sleef_atan2f_u35(f[i] * Sleef_sinpif_u05(e[i]*0.1), f[i] * Sleef_cospif_u05(e[i]*0.1)) - e[i]*0.3141592653589793; + checkf("sinpif_u05, cospif_u05, atan2f_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinpif_u05 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cospif_u05 +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_atan2f_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinpif_u05 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cospif_u05 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_atan2f_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinpif_u05 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cospif_u05 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_atan2f_u35 +} + +void func37() { +// CHECK-AVX512: func37 +// CHECK-AVX2: func37 +// CHECK-SSE2: func37 + for (int i = 0; i < N; i++) h[i] = Sleef_log2f_u10(Sleef_exp2f_u10(e[i])) - e[i]; + checkf("log2f_u10, exp2f_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_log2f_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_exp2f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_log2f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_exp2f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_log2f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_exp2f_u10 +} + +void func38() { +// CHECK-AVX512: func38 +// CHECK-AVX2: func38 +// CHECK-SSE2: func38 + for (int i = 0; i < N; i++) h[i] = Sleef_log2f_u35(Sleef_exp2f_u35(e[i])) - e[i]; + checkf("log2f_u35, exp2f_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_log2f_u35 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_exp2f_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_log2f_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_exp2f_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_log2f_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_exp2f_u35 +} + +void func39() { +// CHECK-AVX512: func39 +// CHECK-AVX2: func39 +// CHECK-SSE2: func39 + for (int i = 0; i < N; i++) h[i] = Sleef_log10f_u10(Sleef_exp10f_u35(e[i])) - e[i]; + checkf("log10f_u10, exp10f_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_log10f_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_exp10f_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_log10f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_exp10f_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_log10f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_exp10f_u35 +} + +void func40() { +// CHECK-AVX512: func40 +// CHECK-AVX2: func40 +// CHECK-SSE2: func40 + for (int i = 0; i < N; i++) h[i] = Sleef_log10f_u10(Sleef_exp10f_u10(e[i])) - e[i]; + checkf("log10f_u10, exp10f_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_log10f_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_exp10f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_log10f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_exp10f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_log10f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_exp10f_u10 +} + +void func41() { +// CHECK-AVX512: func41 +// CHECK-AVX2: func41 +// CHECK-SSE2: func41 + for (int i = 0; i < N; i++) h[i] = Sleef_log1pf_u10(Sleef_expm1f_u10(e[i])) - e[i]; + checkf("log1pf_u10, expm1f_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_log1pf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_expm1f_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_log1pf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_expm1f_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_log1pf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_expm1f_u10 +} + +void func42() { +// CHECK-AVX512: func42 +// CHECK-AVX2: func42 +// CHECK-SSE2: func42 + for (int i = 0; i < N; i++) h[i] = Sleef_powf_u10(e[i], f[i]) - Sleef_expf_u10(Sleef_logf_u10(e[i]) * f[i]); + checkf("powf_u10, expf_u10, logf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_powf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_expf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_logf_u10 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_powf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_expf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_logf_u10 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_powf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_expf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_logf_u10 +} + +void func43() { +// CHECK-AVX512: func43 +// CHECK-AVX2: func43 +// CHECK-SSE2: func43 + for (int i = 0; i < N; i++) h[i] = Sleef_powf_u10(e[i], f[i]) - Sleef_expf_u10(Sleef_logf_u35(e[i]) * f[i]); + checkf("powf_u10, expf_u10, logf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_powf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_expf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_logf_u35 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_powf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_expf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_logf_u35 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_powf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_expf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_logf_u35 +} + +void func44() { +// CHECK-AVX512: func44 +// CHECK-AVX2: func44 +// CHECK-SSE2: func44 + for (int i = 0; i < N; i++) h[i] = Sleef_cbrtf_u10(e[i] * e[i] * e[i]) - e[i]; + checkf("cbrtf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cbrtf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cbrtf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cbrtf_u10 +} + +void func45() { +// CHECK-AVX512: func45 +// CHECK-AVX2: func45 +// CHECK-SSE2: func45 + for (int i = 0; i < N; i++) h[i] = Sleef_cbrtf_u35(e[i] * e[i] * e[i]) - e[i]; + checkf("cbrtf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_cbrtf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_cbrtf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_cbrtf_u35 +} + +void func46() { +// CHECK-AVX512: func46 +// CHECK-AVX2: func46 +// CHECK-SSE2: func46 + for (int i = 0; i < N; i++) h[i] = Sleef_asinhf_u10(Sleef_sinhf_u10(e[i])) - e[i]; + checkf("asinhf_u10, sinhf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_asinhf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_asinhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_asinhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinhf_u10 +} + +void func47() { +// CHECK-AVX512: func47 +// CHECK-AVX2: func47 +// CHECK-SSE2: func47 + for (int i = 0; i < N; i++) h[i] = Sleef_asinhf_u10(Sleef_sinhf_u35(e[i])) - e[i]; + checkf("asinhf_u10, sinhf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_asinhf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_sinhf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_asinhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_sinhf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_asinhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_sinhf_u35 +} + +void func48() { +// CHECK-AVX512: func48 +// CHECK-AVX2: func48 +// CHECK-SSE2: func48 + for (int i = 0; i < N; i++) h[i] = Sleef_acoshf_u10(Sleef_coshf_u10(e[i])) - e[i]; + checkf("acoshf_u10, coshf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_acoshf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_coshf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_acoshf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_coshf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_acoshf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_coshf_u10 +} + +void func49() { +// CHECK-AVX512: func49 +// CHECK-AVX2: func49 +// CHECK-SSE2: func49 + for (int i = 0; i < N; i++) h[i] = Sleef_acoshf_u10(Sleef_coshf_u35(e[i])) - e[i]; + checkf("acoshf_u10, coshf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_acoshf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_coshf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_acoshf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_coshf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_acoshf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_coshf_u35 +} + +void func50() { +// CHECK-AVX512: func50 +// CHECK-AVX2: func50 +// CHECK-SSE2: func50 + for (int i = 0; i < N; i++) h[i] = Sleef_atanhf_u10(Sleef_tanhf_u10(e[i])) - e[i]; + checkf("atanhf_u10, tanhf_u10", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_atanhf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_tanhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_atanhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_tanhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_atanhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_tanhf_u10 +} + +void func51() { +// CHECK-AVX512: func51 +// CHECK-AVX2: func51 +// CHECK-SSE2: func51 + for (int i = 0; i < N; i++) h[i] = Sleef_atanhf_u10(Sleef_tanhf_u35(e[i])) - e[i]; + checkf("atanhf_u10, tanhf_u35", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_atanhf_u10 +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_tanhf_u35 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_atanhf_u10 +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_tanhf_u35 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_atanhf_u10 +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_tanhf_u35 +} + +void func52() { +// CHECK-AVX512: func52 +// CHECK-AVX2: func52 +// CHECK-SSE2: func52 + for (int i = 0; i < N; i++) h[i] = Sleef_fmaf(e[i], f[i], g[i]) - (e[i] * f[i] + g[i]); + checkf("fmaf", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vvv_Sleef_fma +// CHECK-AVX512-DAG: _ZGVeN16vvv_Sleef_fma +// CHECK-SSE2-DAG: _ZGVbN4vvv_Sleef_fma +} + +void func53() { +// CHECK-AVX512: func53 +// CHECK-AVX2: func53 +// CHECK-SSE2: func53 + for (int i = 0; i < N; i++) h[i] = Sleef_hypotf_u05(e[i], f[i]) - Sleef_sqrtf_u05(e[i] * e[i] + f[i] * f[i]); + checkf("hypotf_u05, sqrtf_u05", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_hypotf_u05 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_hypotf_u05 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_hypotf_u05 +} + +void func54() { +// CHECK-AVX512: func54 +// CHECK-AVX2: func54 +// CHECK-SSE2: func54 + for (int i = 0; i < N; i++) h[i] = Sleef_hypotf_u35(e[i], f[i]) - Sleef_sqrtf_u05(e[i] * e[i] + f[i] * f[i]); + checkf("hypotf_u35, sqrtf_u05", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_hypotf_u35 +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_hypotf_u35 +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_hypotf_u35 +} + +void func55() { +// CHECK-AVX2: func55 +// CHECK-SSE2: func55 + for (int i = 0; i < N; i++) h[i] = Sleef_fmodf(e[i], f[i]) - (e[i] - Sleef_floorf(e[i] / f[i]) * f[i]); + checkf("fmodf, floorf", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_fmodf +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_floorf +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_fmodf +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_floorf +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_fmodf +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_floorf +} + +void func56() { +// CHECK-AVX2: func56 +// CHECK-SSE2: func56 + for (int i = 0; i < N; i++) h[i] = Sleef_remainderf(e[i], f[i]) - (e[i] - Sleef_rintf(e[i] / f[i]) * f[i]); + checkf("remainderf, rintf", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_remainderf +// CHECK-AVX2-DAG: _ZGVdN8v_Sleef_rintf +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_remainderf +// CHECK-AVX512-DAG: _ZGVeN16v_Sleef_rintf +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_remainderf +// CHECK-SSE2-DAG: _ZGVbN4v_Sleef_rintf +} + +void func57() { +// CHECK-AVX2: func57 +// CHECK-SSE2: func57 + for (int i = 0; i < N; i++) h[i] = Sleef_nextafterf(Sleef_nextafter(e[i], f[i]), -f[i]) - e[i]; + checkf("nextafterf", THRESF); +// CHECK-AVX2-DAG: _ZGVdN8vv_Sleef_nextafterf +// CHECK-AVX512-DAG: _ZGVeN16vv_Sleef_nextafterf +// CHECK-SSE2-DAG: _ZGVbN4vv_Sleef_nextafterf +} + +int main() { + for (int i = 0; i < N; i++) { + a[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + b[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + c[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + } + + for (int i = 0; i < N; i++) { + e[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + f[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + g[i] = 1.5 * rand() / (double)RAND_MAX + 1e-100; + } + + func00(); func01(); func02(); func03(); func04(); func05(); func06(); func07(); func08(); func09(); + func10(); func11(); func12(); func13(); func14(); func15(); func16(); func17(); func18(); func19(); + func20(); func21(); func22(); func23(); func24(); func25(); func26(); func27(); func28(); func29(); + func30(); func31(); func32(); func33(); func34(); func35(); func36(); func37(); func38(); func39(); + func40(); func41(); func42(); func43(); func44(); func45(); func46(); func47(); func48(); func49(); + func50(); func51(); func52(); func53(); func54(); func55(); func56(); func57(); + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/CMakeLists.txt new file mode 100644 index 0000000000000..aebc3d34edcb0 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/CMakeLists.txt @@ -0,0 +1,1065 @@ + +# Settings + +if (SLEEF_ARCH_X86) + set(SLEEF_HEADER_LIST + SSE_ + SSE2 + SSE4 + AVX_ + AVX + FMA4 + AVX2 + AVX2128 + AVX512F_ + AVX512F + AVX512FNOFMA + PUREC_SCALAR + PURECFMA_SCALAR + DSP_SCALAR + ) +elseif(SLEEF_ARCH_AARCH64) + set(SLEEF_HEADER_LIST + ADVSIMD_ + ADVSIMD + ADVSIMDNOFMA + SVE + SVENOFMA + PUREC_SCALAR + PURECFMA_SCALAR + DSP_SCALAR + ) +elseif(SLEEF_ARCH_AARCH32) + set(SLEEF_HEADER_LIST + NEON32_ + NEON32 + NEON32VFPV4 + PUREC_SCALAR + PURECFMA_SCALAR + DSP_SCALAR + ) +elseif(SLEEF_ARCH_PPC64) + set(SLEEF_HEADER_LIST + VSX_ + VSX + VSXNOFMA + VSX3 + VSX3NOFMA + PUREC_SCALAR + PURECFMA_SCALAR + DSP_SCALAR + ) +elseif(SLEEF_ARCH_S390X) + set(SLEEF_HEADER_LIST + VXE_ + VXE + VXENOFMA + VXE2 + VXE2NOFMA + PUREC_SCALAR + PURECFMA_SCALAR + DSP_SCALAR + ) +elseif(SLEEF_ARCH_RISCV64) + set(SLEEF_HEADER_LIST + RVVM1 + RVVM1NOFMA + RVVM2 + RVVM2NOFMA + PUREC_SCALAR + PURECFMA_SCALAR + ) +endif() + +# HEADER_PARAMS + +command_arguments(HEADER_PARAMS_SSE_ - 2 4 __m128d __m128 __m128i __m128i __SSE2__) +command_arguments(HEADER_PARAMS_SSE2 cinz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ sse2) +command_arguments(HEADER_PARAMS_SSE4 cinz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ sse4) +command_arguments(HEADER_PARAMS_AVX_ - 4 8 __m256d __m256 __m128i "struct { __m128i x, y$ }" __AVX__) +command_arguments(HEADER_PARAMS_AVX cinz_ 4 8 __m256d __m256 __m128i "struct { __m128i x, y$ }" __AVX__ avx) +command_arguments(HEADER_PARAMS_FMA4 finz_ 4 8 __m256d __m256 __m128i "struct { __m128i x, y$ }" __AVX__ fma4) +command_arguments(HEADER_PARAMS_AVX2 finz_ 4 8 __m256d __m256 __m128i __m256i __AVX__ avx2) +command_arguments(HEADER_PARAMS_AVX2128 finz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ avx2128) +command_arguments(HEADER_PARAMS_AVX512F_ - 8 16 __m512d __m512 __m256i __m512i __AVX512F__) +command_arguments(HEADER_PARAMS_AVX512F finz_ 8 16 __m512d __m512 __m256i __m512i __AVX512F__ avx512f) +command_arguments(HEADER_PARAMS_AVX512FNOFMA cinz_ 8 16 __m512d __m512 __m256i __m512i __AVX512F__ avx512fnofma) + +command_arguments(HEADER_PARAMS_ADVSIMD_ - 2 4 float64x2_t float32x4_t int32x2_t int32x4_t __ARM_NEON) +command_arguments(HEADER_PARAMS_ADVSIMD finz_ 2 4 float64x2_t float32x4_t int32x2_t int32x4_t __ARM_NEON advsimd) +command_arguments(HEADER_PARAMS_ADVSIMDNOFMA cinz_ 2 4 float64x2_t float32x4_t int32x2_t int32x4_t __ARM_NEON advsimdnofma) +command_arguments(HEADER_PARAMS_SVE finz_ x x svfloat64_t svfloat32_t svint32_t svint32_t __ARM_FEATURE_SVE sve) +command_arguments(HEADER_PARAMS_SVENOFMA cinz_ x x svfloat64_t svfloat32_t svint32_t svint32_t __ARM_FEATURE_SVE svenofma) + +command_arguments(HEADER_PARAMS_NEON32_ - 2 4 - float32x4_t int32x2_t int32x4_t __ARM_NEON__) +command_arguments(HEADER_PARAMS_NEON32 cinz_ 2 4 - float32x4_t int32x2_t int32x4_t __ARM_NEON__ neon) +command_arguments(HEADER_PARAMS_NEON32VFPV4 finz_ 2 4 - float32x4_t int32x2_t int32x4_t __ARM_NEON__ neonvfpv4) + +command_arguments(HEADER_PARAMS_VSX_ - 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VSX__) +command_arguments(HEADER_PARAMS_VSX finz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VSX__ vsx) +command_arguments(HEADER_PARAMS_VSXNOFMA cinz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VSX__ vsxnofma) +command_arguments(HEADER_PARAMS_VSX3 finz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VSX__ vsx3) +command_arguments(HEADER_PARAMS_VSX3NOFMA cinz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VSX__ vsx3nofma) + +command_arguments(HEADER_PARAMS_VXE_ - 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VEC__) +command_arguments(HEADER_PARAMS_VXE finz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VEC__ vxe) +command_arguments(HEADER_PARAMS_VXENOFMA cinz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VEC__ vxenofma) +command_arguments(HEADER_PARAMS_VXE2 finz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VEC__ vxe2) +command_arguments(HEADER_PARAMS_VXE2NOFMA cinz_ 2 4 "SLEEF_VECTOR_DOUBLE" "SLEEF_VECTOR_FLOAT" "SLEEF_VECTOR_INT" "SLEEF_VECTOR_INT" __VEC__ vxe2nofma) + +command_arguments(HEADER_PARAMS_RVVM1 finz_ x x vfloat64m1_t vfloat32m1_t vint32mf2_t vint32m1_t __riscv_v rvvm1) +command_arguments(HEADER_PARAMS_RVVM1NOFMA cinz_ x x vfloat64m1_t vfloat32m1_t vint32mf2_t vint32m1_t __riscv_v rvvm1nofma) +command_arguments(HEADER_PARAMS_RVVM2 finz_ x x vfloat64m2_t vfloat32m2_t vint32m1_t vint32m2_t __riscv_v rvvm2) +command_arguments(HEADER_PARAMS_RVVM2NOFMA cinz_ x x vfloat64m2_t vfloat32m2_t vint32m1_t vint32m2_t __riscv_v rvvm2nofma) + +command_arguments(HEADER_PARAMS_DSP_SCALAR - 1 1 double float int32_t int32_t __STDC__) +command_arguments(HEADER_PARAMS_PUREC_SCALAR cinz_ 1 1 double float int32_t int32_t __STDC__ purec) +command_arguments(HEADER_PARAMS_PURECFMA_SCALAR finz_ 1 1 double float int32_t int32_t __STDC__ purecfma) + +# RENAME_PARAMS + +command_arguments(RENAME_PARAMS_SSE2 cinz_ 2 4 sse2) +command_arguments(RENAME_PARAMS_SSE4 cinz_ 2 4 sse4) +command_arguments(RENAME_PARAMS_AVX cinz_ 4 8 avx) +command_arguments(RENAME_PARAMS_FMA4 finz_ 4 8 fma4) +command_arguments(RENAME_PARAMS_AVX2 finz_ 4 8 avx2) +command_arguments(RENAME_PARAMS_AVX2128 finz_ 2 4 avx2128) +command_arguments(RENAME_PARAMS_AVX512F finz_ 8 16 avx512f) +command_arguments(RENAME_PARAMS_AVX512FNOFMA cinz_ 8 16 avx512fnofma) +command_arguments(RENAME_PARAMS_ADVSIMD finz_ 2 4 advsimd) +command_arguments(RENAME_PARAMS_ADVSIMDNOFMA cinz_ 2 4 advsimdnofma) +command_arguments(RENAME_PARAMS_NEON32 cinz_ 2 4 neon) +command_arguments(RENAME_PARAMS_NEON32VFPV4 finz_ 2 4 neonvfpv4) +command_arguments(RENAME_PARAMS_VSX finz_ 2 4 vsx) +command_arguments(RENAME_PARAMS_VSXNOFMA cinz_ 2 4 vsxnofma) +command_arguments(RENAME_PARAMS_VSX3 finz_ 2 4 vsx3) +command_arguments(RENAME_PARAMS_VSX3NOFMA cinz_ 2 4 vsx3nofma) +command_arguments(RENAME_PARAMS_VXE finz_ 2 4 vxe) +command_arguments(RENAME_PARAMS_VXENOFMA cinz_ 2 4 vxenofma) +command_arguments(RENAME_PARAMS_VXE2 finz_ 2 4 vxe2) +command_arguments(RENAME_PARAMS_VXE2NOFMA cinz_ 2 4 vxe2nofma) +command_arguments(RENAME_PARAMS_PUREC_SCALAR cinz_ 1 1 purec) +command_arguments(RENAME_PARAMS_PURECFMA_SCALAR finz_ 1 1 purecfma) +command_arguments(RENAME_PARAMS_CUDA finz_ 1 1 cuda) + +# The vector length parameters in SVE, for SP and DP, are chosen for +# the smallest SVE vector size (128-bit). The name is generated using +# the "x" token of VLA SVE vector functions. +command_arguments(RENAME_PARAMS_SVE finz_ x x sve) +command_arguments(RENAME_PARAMS_SVENOFMA cinz_ x x svenofma) + +command_arguments(RENAME_PARAMS_GNUABI_SSE2 sse2 b 2 4 _mm128d _mm128 _mm128i _mm128i __SSE2__) +command_arguments(RENAME_PARAMS_GNUABI_AVX avx c 4 8 __m256d __m256 __m128i "struct { __m128i x, y$ }" __AVX__) +command_arguments(RENAME_PARAMS_GNUABI_AVX2 avx2 d 4 8 __m256d __m256 __m128i __m256i __AVX2__) +command_arguments(RENAME_PARAMS_GNUABI_AVX512F avx512f e 8 16 __m512d __m512 __m256i __m512i __AVX512F__) +command_arguments(RENAME_PARAMS_GNUABI_ADVSIMD advsimd n 2 4 float64x2_t float32x4_t int32x2_t int32x4_t __ARM_NEON) +# The vector length parameters in SVE, for SP and DP, are chosen for +# the smallest SVE vector size (128-bit). The name is generated using +# the "x" token of VLA SVE vector functions. +command_arguments(RENAME_PARAMS_GNUABI_SVE sve s x x svfloat64_t svfloat32_t svint32_t svint32_t __ARM_SVE) + +command_arguments(RENAME_PARAMS_RVVM1 finz_ x x rvvm1) +command_arguments(RENAME_PARAMS_RVVM1NOFMA cinz_ x x rvvm1nofma) +command_arguments(RENAME_PARAMS_RVVM2 finz_ x x rvvm2) +command_arguments(RENAME_PARAMS_RVVM2NOFMA cinz_ x x rvvm2nofma) + +# ALIAS_PARAMS + +command_arguments(ALIAS_PARAMS_AVX512F_DP 8 __m512d __m256i e avx512f) +command_arguments(ALIAS_PARAMS_AVX512F_SP -16 __m512 __m512i e avx512f) + +command_arguments(ALIAS_PARAMS_ADVSIMD_DP 2 float64x2_t int32x2_t n advsimd) +command_arguments(ALIAS_PARAMS_ADVSIMD_SP -4 float32x4_t int32x4_t n advsimd) + +command_arguments(ALIAS_PARAMS_NEON32_SP -4 float32x4_t int32x4_t - neon) +command_arguments(ALIAS_PARAMS_NEON32_DP 0) + +set(EXT_ENABLE_ALIAS AVX512F ADVSIMD NEON32) + +# + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set(CMAKE_C_FLAGS "${ORG_CMAKE_C_FLAGS} ${SLEEF_C_FLAGS}") + +# -------------------------------------------------------------------- +# sleef.h +# -------------------------------------------------------------------- +# File generated for the headers +set(SLEEF_ORG_HEADER ${CMAKE_CURRENT_BINARY_DIR}/sleeflibm_header.h.org) +set(SLEEF_ORG_FOOTER ${CMAKE_CURRENT_SOURCE_DIR}/sleeflibm_footer.h.org) +set(SLEEF_INCLUDE_HEADER ${sleef_BINARY_DIR}/include/sleef.h) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sleeflibm_header.h.org.in ${SLEEF_ORG_HEADER}) + +set(SLEEF_HEADER_SIMD_SECTIONS "") +foreach(SIMD ${SLEEF_HEADER_LIST}) + set(SIMD_SECTION_FILE ${CMAKE_CURRENT_BINARY_DIR}/sleeflibm_${SIMD}.h.tmp) + list(APPEND SLEEF_HEADER_SIMD_SECTIONS ${SIMD_SECTION_FILE}) + add_custom_command( + OUTPUT ${SIMD_SECTION_FILE} + COMMAND $ ${HEADER_PARAMS_${SIMD}} > ${SIMD_SECTION_FILE} + DEPENDS ${TARGET_MKRENAME} + ) +endforeach() + +file(MAKE_DIRECTORY ${sleef_BINARY_DIR}/include) +sleef_concat_files( + OUTPUT ${SLEEF_INCLUDE_HEADER} + SOURCES ${SLEEF_ORG_HEADER} ${SLEEF_HEADER_SIMD_SECTIONS} ${SLEEF_ORG_FOOTER} +) + +# -------------------------------------------------------------------- +# TARGET_MKRENAME +# renameXXX.h for each SIMD +# -------------------------------------------------------------------- +# Helper executable: generates parts of the sleef header file +add_host_executable(${TARGET_MKRENAME} mkrename.c) + +# Enable Vector PCS for Advanced SIMD (if supported) +if(FORCE_AAVPCS) + host_target_AAVPCS_definitions(${TARGET_MKRENAME}) +endif() + +set(HEADER_FILES_GENERATED "") +foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + # Need lowercase string for rename header + string(TOLOWER ${SIMD} vecarch) + set(OBJECT_${SIMD} "sleef${vecarch}") + set(OBJECTDET_${SIMD} "sleefdet${vecarch}") + set(HEADER_${SIMD} ${CMAKE_CURRENT_BINARY_DIR}/include/rename${vecarch}.h) + list(APPEND HEADER_FILES_GENERATED ${HEADER_${SIMD}}) + + # Generate mkrename commands + add_custom_command(OUTPUT ${HEADER_${SIMD}} + COMMAND echo Generating rename${vecarch}.h: ${TARGET_MKRENAME} ${RENAME_PARAMS_${SIMD}} + COMMAND $ ${RENAME_PARAMS_${SIMD}} > ${HEADER_${SIMD}} + DEPENDS ${TARGET_MKRENAME} + ) + add_custom_target(rename${SIMD}.h_generated DEPENDS ${HEADER_${SIMD}}) + endif() +endforeach() + +# Generate renamecuda.h + +set(HEADER_CUDA ${CMAKE_CURRENT_BINARY_DIR}/include/renamecuda.h) +list(APPEND HEADER_FILES_GENERATED ${HEADER_CUDA}) +add_custom_command(OUTPUT ${HEADER_CUDA} + COMMAND echo Generating renamecuda.h: ${TARGET_MKRENAME} ${RENAME_PARAMS_CUDA} + COMMAND $ ${RENAME_PARAMS_CUDA} > ${HEADER_CUDA} + DEPENDS ${TARGET_MKRENAME} + ) +add_custom_target(renameCUDA.h_generated DEPENDS ${HEADER_CUDA}) + +# -------------------------------------------------------------------- +# TARGET_MKRENAME_GNUABI +# renameXXX_gnuabi.h for each SIMD GNU Abi +# -------------------------------------------------------------------- +# Helper executable: generates parts of the sleef header file gnu_abi +add_host_executable(${TARGET_MKRENAME_GNUABI} mkrename_gnuabi.c) + +set(HEADER_GNUABI_FILES_GENERATED "") +if(ENABLE_GNUABI) + foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + string(TOLOWER ${SIMD} vecarch) + set(OBJECT_${SIMD}_dp_GNUABI "sleefgnuabi${vecarch}dp") + set(OBJECT_${SIMD}_sp_GNUABI "sleefgnuabi${vecarch}sp") + set(HEADER_${SIMD}_GNUABI ${CMAKE_CURRENT_BINARY_DIR}/include/rename${vecarch}_gnuabi.h) + list(APPEND HEADER_GNUABI_FILES_GENERATED ${HEADER_${SIMD}_GNUABI}) + + # Generate mkrename_gnuabi commands + add_custom_command(OUTPUT ${HEADER_${SIMD}_GNUABI} + COMMAND echo Generating rename${vecarch}_gnuabi.h: ${TARGET_MKRENAME_GNUABI} ${RENAME_PARAMS_GNUABI_${SIMD}} + COMMAND $ ${RENAME_PARAMS_GNUABI_${SIMD}} > ${HEADER_${SIMD}_GNUABI} + DEPENDS ${TARGET_MKRENAME_GNUABI} + ) + # set_source_files_properties(${HEADER_${SIMD}_GNUABI} PROPERTIES GENERATED TRUE) + endif() + endforeach() +endif() + +# -------------------------------------------------------------------- + +# TARGET_MKMASKED_GNUABI +add_host_executable(${TARGET_MKMASKED_GNUABI} mkmasked_gnuabi.c) + +# maskedXXX_YY_gnuabi.h +if(ENABLE_GNUABI) + foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD} AND MKMASKED_PARAMS_GNUABI_${SIMD}_sp) + string(TOLOWER ${SIMD} vecarch) + + set(HEADER_GENERATED "") + foreach(T dp sp) + set(HEADER_MASKED_${SIMD}_${T}_GNUABI ${CMAKE_CURRENT_BINARY_DIR}/include/masked_${vecarch}_${T}_gnuabi.h) + list(APPEND HEADER_GENERATED ${HEADER_MASKED_${SIMD}_${T}_GNUABI}) + + add_custom_command(OUTPUT ${HEADER_MASKED_${SIMD}_${T}_GNUABI} + COMMAND $ ${MKMASKED_PARAMS_GNUABI_${SIMD}_${T}} > ${HEADER_MASKED_${SIMD}_${T}_GNUABI} + DEPENDS ${TARGET_MKMASKED_GNUABI} + ) + endforeach() + add_custom_target(masked${SIMD}_generated DEPENDS ${HEADER_GENERATED}) + endif() + endforeach() +endif() + +# -------------------------------------------------------------------- +# TARGET_HEADERS +# -------------------------------------------------------------------- +add_custom_target(${TARGET_HEADERS} ALL + DEPENDS + ${SLEEF_INCLUDE_HEADER} # Output only + ${HEADER_FILES_GENERATED} # Output only + ${HEADER_GNUABI_FILES_GENERATED} # Output only +) + +# -------------------------------------------------------------------- +# TARGET_MKALIAS +# -------------------------------------------------------------------- +add_host_executable(${TARGET_MKALIAS} mkalias.c) +if(FORCE_AAVPCS) + host_target_AAVPCS_definitions(${TARGET_MKALIAS}) +endif() + +# -------------------------------------------------------------------- +# TARGET_MKDISP +# -------------------------------------------------------------------- +# Helper executable: dispatcher for the vector extensions +add_host_executable(${TARGET_MKDISP} mkdisp.c) + +# Set C standard requirement (-std=gnu99 for gcc) +set_target_properties( + ${TARGET_MKRENAME} ${TARGET_MKRENAME_GNUABI} ${TARGET_MKDISP} + ${TARGET_MKALIAS} ${TARGET_MKMASKED_GNUABI} + PROPERTIES C_STANDARD 99 +) + +# -------------------------------------------------------------------- +# TARGET_LIBSLEEF +# -------------------------------------------------------------------- +# Build main library + +set(COMMON_TARGET_PROPERTIES + C_STANDARD 99 # -std=gnu99 + ) + +if (BUILD_SHARED_LIBS) + list(APPEND COMMON_TARGET_PROPERTIES POSITION_INDEPENDENT_CODE ON) # -fPIC +endif() + +if (SLEEF_ENABLE_LTO) + list(APPEND COMMON_TARGET_PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) # -flto +endif() + +# Original sleef sources +set(STANDARD_SOURCES rempitab.c) +# Check for different precision support and add sources accordingly +if(COMPILER_SUPPORTS_LONG_DOUBLE) + list(APPEND STANDARD_SOURCES sleefld.c) +endif() + +add_library(${TARGET_LIBSLEEF} ${STANDARD_SOURCES}) +add_dependencies(${TARGET_LIBSLEEF} ${TARGET_HEADERS}) +set_target_properties(${TARGET_LIBSLEEF} PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} + ${COMMON_TARGET_PROPERTIES} +) + +target_compile_definitions(${TARGET_LIBSLEEF} + PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} +) + +if(COMPILER_SUPPORTS_FLOAT128) + # TODO: Not supported for LLVM bitcode gen as it has a specific compilation flags + target_sources(${TARGET_LIBSLEEF} PRIVATE sleefqp.c) + target_compile_definitions(${TARGET_LIBSLEEF} + PRIVATE ENABLEFLOAT128=1 ${COMMON_TARGET_DEFINITIONS}) +endif() + +if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(${TARGET_LIBSLEEF} PRIVATE ENABLE_BUILTIN_MATH=1) +endif() + +# Compile SIMD versions +# Single precision and double precision + +# Include symbols for each SIMD architecture (if supported by the platform) +# Note: adds object file as sources via cmake conditional generator expression +foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + list(FIND EXT_ENABLE_ALIAS ${SIMD} INDEX_ALIAS) + string(TOLOWER ${SIMD} SIMDLC) + + if (${SIMD} STREQUAL "NEON32" OR ${SIMD} STREQUAL "NEON32VFPV4") + set(SIMD_SOURCES sleefsimdsp.c) + else() + set(SIMD_SOURCES sleefsimdsp.c sleefsimddp.c) + endif() + + # Create a library + add_library(${OBJECT_${SIMD}} OBJECT ${SIMD_SOURCES} ${HEADER_${SIMD}}) + add_library(${OBJECTDET_${SIMD}} OBJECT ${SIMD_SOURCES} ${HEADER_${SIMD}}) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE DETERMINISTIC=1) + + if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE ENABLE_BUILTIN_MATH=1) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE ENABLE_BUILTIN_MATH=1) + endif() + + if(SLEEF_ENABLE_ALTDIV) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE SLEEF_ENABLE_ALTDIV=1) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE SLEEF_ENABLE_ALTDIV=1) + endif() + + if(SLEEF_ENABLE_ALTSQRT) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE SLEEF_ENABLE_ALTSQRT=1) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE SLEEF_ENABLE_ALTSQRT=1) + endif() + + if (INDEX_ALIAS EQUAL -1) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE + ENABLE_${SIMD}=1 + DORENAME=1 + ${COMMON_TARGET_DEFINITIONS} + ) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE + ENABLE_${SIMD}=1 + DORENAME=1 + ${COMMON_TARGET_DEFINITIONS} + ) + else() + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_dp.h.tmp + COMMAND $ ${ALIAS_PARAMS_${SIMD}_DP} > ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_dp.h.tmp + DEPENDS ${TARGET_MKALIAS} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_sp.h.tmp + COMMAND $ ${ALIAS_PARAMS_${SIMD}_SP} > ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_sp.h.tmp + DEPENDS ${TARGET_MKALIAS} + ) + sleef_concat_files( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/alias_${SIMDLC}.h + SOURCES ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_sp.h.tmp ${CMAKE_CURRENT_BINARY_DIR}/alias_${SIMD}_dp.h.tmp + ) + add_custom_target(alias_${SIMDLC}.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/include/alias_${SIMDLC}.h) + add_dependencies(${OBJECT_${SIMD}} alias_${SIMDLC}.h_generated) + add_dependencies(${OBJECTDET_${SIMD}} alias_${SIMDLC}.h_generated) + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE + ENABLE_${SIMD}=1 + DORENAME=1 + ${COMMON_TARGET_DEFINITIONS} + ALIAS_NO_EXT_SUFFIX=\"alias_${SIMDLC}.h\" + ) + target_compile_definitions(${OBJECTDET_${SIMD}} PRIVATE + ENABLE_${SIMD}=1 + DORENAME=1 + ${COMMON_TARGET_DEFINITIONS} + ALIAS_NO_EXT_SUFFIX=\"alias_${SIMDLC}.h\" + ) + endif() + + # Enable Vector PCS for Advanced SIMD (if supported) + if(FORCE_AAVPCS AND ${SIMD} STREQUAL "ADVSIMD") + target_compile_definitions(${OBJECT_${SIMD}} PRIVATE + ENABLE_AAVPCS=1 + ) + endif() + + add_dependencies(${OBJECT_${SIMD}} rename${SIMD}.h_generated) + add_dependencies(${OBJECTDET_${SIMD}} rename${SIMD}.h_generated) + + set_target_properties(${OBJECT_${SIMD}} PROPERTIES + ${COMMON_TARGET_PROPERTIES} + ) + + set_target_properties(${OBJECTDET_${SIMD}} PROPERTIES + ${COMMON_TARGET_PROPERTIES} + ) + + target_compile_options(${OBJECT_${SIMD}} PRIVATE + ${FLAGS_ENABLE_${SIMD}}) + + target_compile_options(${OBJECTDET_${SIMD}} PRIVATE + ${FLAGS_ENABLE_${SIMD}}) + + target_sources(${TARGET_LIBSLEEF} PRIVATE $ $) + endif(COMPILER_SUPPORTS_${SIMD}) +endforeach() + +# + +if(SLEEF_BUILD_INLINE_HEADERS) + if(CMAKE_C_COMPILER_ID MATCHES "Intel") + message(FATAL_ERROR "SLEEF_BUILD_INLINE_HEADERS is not supported with Intel Compiler") + endif() + + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/) + set(INLINE_HEADER_FILES_GENERATED "") + + if (SED_COMMAND) + foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS} CUDA) + if(COMPILER_SUPPORTS_${SIMD} OR ${SIMD} STREQUAL "CUDA") + string(TOLOWER ${SIMD} SIMDLC) + + if(CMAKE_CROSSCOMPILING AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_TARGET AND NOT "${SIMD}" STREQUAL "CUDA" ) + set(FLAG_TARGET --target=${CMAKE_C_COMPILER_TARGET}) + endif() + + if ("${SIMD}" STREQUAL "CUDA") + set(TARGET_PP_FLAGS ${FLAG_DEFINE}SLEEF_ALWAYS_INLINE=__device__ + ${FLAG_DEFINE}SLEEF_INLINE=__device__ + ${FLAG_DEFINE}SLEEF_CONST=__device__ + ${FLAG_DEFINE}static=__device__) + set(INLINE_HEADER_ORG ${CMAKE_CURRENT_SOURCE_DIR}/sleefinline_cuda_header.h.org) + # Remove redundant __device__ + set(TARGET_REPLACEMENTS -e "s/__device__ __device__/__device__/g" -e "s/__device__ __device__/__device__/g") + set(TARGET_ADDSUFFIX_KEYWORDS double2 double3 float2) + else() + set(TARGET_ADDSUFFIX_KEYWORDS Sleef_rempitabdp Sleef_rempitabsp) + set(INLINE_HEADER_ORG ${CMAKE_CURRENT_SOURCE_DIR}/sleefinline_header.h.org) + endif() + + set(INLINE_HEADER_FILE ${PROJECT_BINARY_DIR}/include/sleefinline_${SIMDLC}.h) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp + + # Preprocess sleefsimddp.c with SLEEF_GENHEADER defined, comments are preserved + COMMAND "${CMAKE_C_COMPILER}" ${FLAG_PREPROCESS} ${FLAG_PRESERVE_COMMENTS} # gcc -E -C + ${FLAG_TARGET} ${FLAGS_ENABLE_${SIMD}} # -msse2 + ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/common ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/arch # -I/sleef/src/common -I/sleef/src/arch + ${FLAG_INCLUDE}${CMAKE_CURRENT_BINARY_DIR}/include/ # -I/build/src/libm/include + ${FLAG_DEFINE}SLEEF_GENHEADER ${FLAG_DEFINE}ENABLE_${SIMD} ${FLAG_DEFINE}DORENAME # -DSLEEF_GENHEADER -DENABLE_SSE2 -DDORENAME + ${TARGET_PP_FLAGS} + ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimddp.c > ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp # /sleef/src/libm/sleefsimddp.c > /build/libm/sleefsimddpSSE2.h.tmp + + # ${HEADER_${SIMD}} listed here as sleefsimddp.c includes it for renaming + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimddp.c ${HEADER_${SIMD}} + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/macroonly${SIMD}.h + + # Remove all lines except those begin with "//@", then remove "//@" + COMMAND ${SED_COMMAND} -e "/^\\/\\/@#.*$/!d" + -e "s/^\\/\\/@#/#/g" + ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp + > ${CMAKE_CURRENT_BINARY_DIR}/include/macroonly${SIMD}.h + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleefsimdsp${SIMD}.h.tmp + + # Preprocess sleefsimdsp.c with SLEEF_GENHEADER defined. Include macroonly*.h instead of helper*.h. + COMMAND "${CMAKE_C_COMPILER}" ${FLAG_PREPROCESS} ${FLAG_PRESERVE_COMMENTS} # gcc -E -C + ${FLAG_TARGET} ${FLAGS_ENABLE_${SIMD}} # -msse2 + ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/common ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/arch # -I/sleef/src/common -I/sleef/src/arch + ${FLAG_INCLUDE}${CMAKE_CURRENT_BINARY_DIR}/include/ # -I/build/src/libm/include + ${FLAG_DEFINE}SLEEF_GENHEADER ${FLAG_DEFINE}ENABLE_${SIMD} ${FLAG_DEFINE}DORENAME # -DSLEEF_GENHEADER -DENABLE_SSE2 -DDORENAME + ${TARGET_PP_FLAGS} + ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimdsp.c > ${CMAKE_CURRENT_BINARY_DIR}/sleefsimdsp${SIMD}.h.tmp # /sleef/src/libm/sleefsimdsp.c > /build/libm/sleefsimdspSSE2.h.tmp + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/macroonly${SIMD}.h ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimdsp.c + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.c + + # Remove lines beginning with "#" so that the resulting file can be preprocessed again. + COMMAND ${CMAKE_COMMAND} -E cat ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp + ${CMAKE_CURRENT_BINARY_DIR}/sleefsimdsp${SIMD}.h.tmp + | ${SED_COMMAND} -e "s/^#.*//g" > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.c + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleefsimdsp${SIMD}.h.tmp ${CMAKE_CURRENT_BINARY_DIR}/sleefsimddp${SIMD}.h.tmp + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp3 + + # Preprocess the intemediate file again to remove comments + COMMAND "${CMAKE_C_COMPILER}" ${FLAG_PREPROCESS} ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.c + # Remove lines beginning with "#" + | ${SED_COMMAND} -e "s/^#.*//g" + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp3 + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.c + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp4 + + COMMAND ${CMAKE_COMMAND} -E cat + ${INLINE_HEADER_ORG} + ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp3 + | ${SED_COMMAND} + # Embed version number into the header + -e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCH}/g" + -e "s/SLEEF_SIMD_SLEEF/${SIMD}/g" + # Substitute "SLEEFSHARP" at the beginning of line with "#" + -e "s/^SLEEFSHARP/#/g" + # Remove SLEEFXXX + -e "s/SLEEFXXX//g" + # Replace multiple empty lines with a single empty line (part 1) + -e "s/^[[:space:]]*$//g" + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp4 + + DEPENDS ${INLINE_HEADER_ORG} ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp3 + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 + + # Replace multiple empty lines with a single empty line + # (part 2 - cannot occur in same command as part 1) + COMMAND ${SED_COMMAND} -e "/^$/N" -e "/^\\n$/D" ${TARGET_REPLACEMENTS} ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp4 + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp4 + VERBATIM + ) + + add_custom_command( + OUTPUT ${INLINE_HEADER_FILE} + + COMMAND $ ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 # addSuffix /build/src/libm/sleefSSE2.h.tmp5 + ${sleef_SOURCE_DIR}/src/common/keywords.txt "_${SIMDLC}_sleef" # keywords.txt "_sse2_sleef" + ${TARGET_ADDSUFFIX_KEYWORDS} + > ${PROJECT_BINARY_DIR}/include/sleefinline_${SIMDLC}.h # > /build/include/sleefinline_sse2.h + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 addSuffix + VERBATIM + ) + + list(APPEND INLINE_HEADER_FILES_GENERATED ${INLINE_HEADER_FILE}) + endif(COMPILER_SUPPORTS_${SIMD} OR ${SIMD} STREQUAL "CUDA") + endforeach() + + add_custom_target(${TARGET_INLINE_HEADERS}_util ALL + DEPENDS + ${INLINE_HEADER_FILES_GENERATED} + ) + + add_library("${TARGET_INLINE_HEADERS}" INTERFACE) + add_dependencies("${TARGET_INLINE_HEADERS}" "${TARGET_INLINE_HEADERS}_util") + target_include_directories( + "${TARGET_INLINE_HEADERS}" + INTERFACE + "$" + ) + + # CMake 3.4 can't have PUBLIC_HEADER property on INTERFACE libraries + install( + FILES ${INLINE_HEADER_FILES_GENERATED} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT sleef_Development + ) + + install( + TARGETS "${TARGET_INLINE_HEADERS}" + EXPORT sleefTargets + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + endif(SED_COMMAND) +endif(SLEEF_BUILD_INLINE_HEADERS) + +# On some systems we need to explicitly link libsleef against libm to +# use some of the math functions used in the scalar code (for example +# sqrt). +if(LIBM AND NOT COMPILER_SUPPORTS_BUILTIN_MATH) + target_link_libraries(${TARGET_LIBSLEEF} ${LIBM}) +endif() + +target_sources(${TARGET_LIBSLEEF} PRIVATE $) + +# -------------------------------------------------------------------- + +# Target dispscalar.c + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dispscalar.c.body + COMMAND $ 1 1 double float int32_t purec purecfma x > ${CMAKE_CURRENT_BINARY_DIR}/dispscalar.c.body + DEPENDS ${TARGET_MKDISP} + ) + +sleef_concat_files( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dispscalar.c + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dispscalar.c.org + ${CMAKE_CURRENT_BINARY_DIR}/dispscalar.c.body + ${CMAKE_CURRENT_SOURCE_DIR}/dispscalar_footer.c.org +) +add_custom_target(dispscalar.c_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dispscalar.c) + +# Target renamedspscalar.h + +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/renamedspscalar.h + COMMAND $ - 1 1 > ${CMAKE_CURRENT_BINARY_DIR}/include/renamedspscalar.h + DEPENDS ${TARGET_MKRENAME} + ) +add_custom_target(renamedspscalar.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/include/renamedspscalar.h) + +# Target dispscalar_obj + +add_library(dispscalar_obj OBJECT dispscalar.c) +set_target_properties(dispscalar_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) +target_compile_definitions(dispscalar_obj PRIVATE ${COMMON_TARGET_DEFINITIONS}) +target_include_directories(dispscalar_obj PRIVATE ${sleef_BINARY_DIR}/include) +add_dependencies(dispscalar_obj dispscalar.c_generated renamedspscalar.h_generated ${TARGET_HEADERS}) +target_sources(${TARGET_LIBSLEEF} PRIVATE $) + +# + +function(sleef_generate_disp_simd simd) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/disp${simd}.c.tmp + COMMAND $ "${ARGN}" > ${CMAKE_CURRENT_BINARY_DIR}/disp${simd}.c.tmp + DEPENDS ${TARGET_MKDISP} + COMMAND_EXPAND_LISTS + ) + sleef_concat_files(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/disp${simd}.c + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/disp${simd}.c.org ${CMAKE_CURRENT_BINARY_DIR}/disp${simd}.c.tmp + ) + add_custom_target(disp${simd}.c_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/disp${simd}.c) +endfunction() + +function(sleef_generate_rename_simd simd) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/renamed${simd}.h + COMMAND $ "${ARGN}" > ${CMAKE_CURRENT_BINARY_DIR}/include/renamed${simd}.h + DEPENDS ${TARGET_MKRENAME} + COMMAND_EXPAND_LISTS + ) + add_custom_target(renamed${simd}.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/include/renamed${simd}.h) + endfunction() + +if (SLEEF_ARCH_X86) + # Target dispsse.c + sleef_generate_disp_simd(sse 2 4 __m128d __m128 __m128i sse2 sse4 avx2128) + + # Target renamedsp128.h + sleef_generate_rename_simd(sp128 - 2 4) + + # Target dispavx.c + sleef_generate_disp_simd(avx 4 8 __m256d __m256 __m128i avx fma4 avx2) + + # Target renamedsp256.h + sleef_generate_rename_simd(sp256 - 4 8) + + # Target dispsse_obj + if (COMPILER_SUPPORTS_FMA4) + set(DISPATCHER_DEFINITIONS ${DISPATCHER_DEFINITIONS} ENABLE_FMA4=1) + endif() + + if (COMPILER_SUPPORTS_AVX2) + set(DISPATCHER_DEFINITIONS ${DISPATCHER_DEFINITIONS} ENABLE_AVX2=1) + endif() + + if(COMPILER_SUPPORTS_SSE2) + add_library(dispsse_obj OBJECT dispsse.c) + target_compile_options(dispsse_obj PRIVATE ${FLAGS_ENABLE_SSE2}) + set_target_properties(dispsse_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_definitions(dispsse_obj PRIVATE ${COMMON_TARGET_DEFINITIONS} ${DISPATCHER_DEFINITIONS}) + target_include_directories(dispsse_obj PRIVATE ${sleef_BINARY_DIR}/include) + add_dependencies(dispsse_obj dispsse.c_generated renamedsp128.h_generated ${TARGET_HEADERS}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + endif() + + # Target dispavx_obj + + if(COMPILER_SUPPORTS_AVX) + add_library(dispavx_obj OBJECT dispavx.c) + target_compile_options(dispavx_obj PRIVATE ${FLAGS_ENABLE_AVX}) + set_target_properties(dispavx_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_definitions(dispavx_obj PRIVATE ${COMMON_TARGET_DEFINITIONS} ${DISPATCHER_DEFINITIONS}) + target_include_directories(dispavx_obj PRIVATE ${sleef_BINARY_DIR}/include) + add_dependencies(dispavx_obj dispavx.c_generated renamedsp256.h_generated ${TARGET_HEADERS}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + endif() +endif(SLEEF_ARCH_X86) + +if (SLEEF_ARCH_PPC64) + # Target disppower_128.c + sleef_generate_disp_simd(power_128 2 4 SLEEF_VECTOR_DOUBLE SLEEF_VECTOR_FLOAT SLEEF_VECTOR_INT vsx vsx3 x) + + # Target renamedsp128.h + sleef_generate_rename_simd(sp128 - 2 4) + + # Target disppower_128_obj + add_library(disppower_128_obj OBJECT disppower_128.c) + target_compile_options(disppower_128_obj PRIVATE ${FLAGS_ENABLE_VSX}) + if(COMPILER_SUPPORTS_VSX3) + set(DISPATCHER_DEFINITIONS ENABLE_VSX3=1) + endif() + set_target_properties(disppower_128_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_definitions(disppower_128_obj PRIVATE ${COMMON_TARGET_DEFINITIONS} ${DISPATCHER_DEFINITIONS}) + target_include_directories(disppower_128_obj PRIVATE ${CMAKE_BINARY_DIR}/include) + add_dependencies(disppower_128_obj disppower_128.c_generated renamedsp128.h_generated ${TARGET_HEADERS}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + + if(COMPILER_SUPPORTS_VSX3) + add_library(tryvsx3_obj OBJECT tryvsx3.c) + target_compile_options(tryvsx3_obj PRIVATE ${FLAGS_ENABLE_VSX3}) + set_target_properties(tryvsx3_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + endif() +endif(SLEEF_ARCH_PPC64) + +if (SLEEF_ARCH_S390X) + # Target disps390x_128.c + sleef_generate_disp_simd(s390x_128 2 4 SLEEF_VECTOR_DOUBLE SLEEF_VECTOR_FLOAT SLEEF_VECTOR_INT vxe vxe2 x) + + # Target renamedsp128.h + sleef_generate_rename_simd(sp128 - 2 4) + + # Target disps390x_128_obj + add_library(disps390x_128_obj OBJECT disps390x_128.c) + target_compile_options(disps390x_128_obj PRIVATE ${FLAGS_ENABLE_VXE}) + if(COMPILER_SUPPORTS_VXE2) + set(DISPATCHER_DEFINITIONS ENABLE_VXE2=1) + endif() + set_target_properties(disps390x_128_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_definitions(disps390x_128_obj PRIVATE ${COMMON_TARGET_DEFINITIONS} ${DISPATCHER_DEFINITIONS}) + target_include_directories(disps390x_128_obj PRIVATE ${CMAKE_BINARY_DIR}/include) + add_dependencies(disps390x_128_obj disps390x_128.c_generated renamedsp128.h_generated ${TARGET_HEADERS}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + + if(COMPILER_SUPPORTS_VXE2) + add_library(tryvxe2_obj OBJECT tryvxe2.c) + target_compile_options(tryvxe2_obj PRIVATE ${FLAGS_ENABLE_VXE2}) + set_target_properties(tryvxe2_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_sources(${TARGET_LIBSLEEF} PRIVATE $) + endif() +endif(SLEEF_ARCH_S390X) + +# -------------------------------------------------------------------- +# TARGET_LIBSLEEFGNUABI +# Compile SIMD versions for GNU Abi +# -------------------------------------------------------------------- +# Build gnuabi version from just simd object files +if(ENABLE_GNUABI) + set(TARGET_LIBSLEEFGNUABI_OBJECTS "") + foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + # Need lowercase string for rename header + string(TOLOWER ${SIMD} vecarch) + + foreach(T dp sp) + add_library(${OBJECT_${SIMD}_${T}_GNUABI} OBJECT sleefsimd${T}.c ${HEADER_${SIMD}_GNUABI}) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE + ENABLE_${SIMD}=1 + DORENAME=1 + ENABLE_GNUABI=1 + ) + + if(FORCE_AAVPCS AND ${SIMD} STREQUAL "ADVSIMD") + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE + ENABLE_AAVPCS=1 + ) + endif() + + if(SLEEF_ENABLE_ALTDIV) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE SLEEF_ENABLE_ALTDIV=1) + endif() + + if(SLEEF_ENABLE_ALTSQRT) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE SLEEF_ENABLE_ALTSQRT=1) + endif() + + set_target_properties(${OBJECT_${SIMD}_${T}_GNUABI} PROPERTIES + ${COMMON_TARGET_PROPERTIES} + ) + + target_compile_options(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + if (COMPILER_SUPPORTS_WEAK_ALIASES) + target_compile_options(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE -DENABLE_GNUABI=1) + endif(COMPILER_SUPPORTS_WEAK_ALIASES) + list(APPEND TARGET_LIBSLEEFGNUABI_OBJECTS $) + + if(MKMASKED_PARAMS_GNUABI_${SIMD}_${T}) + target_compile_definitions(${OBJECT_${SIMD}_${T}_GNUABI} PRIVATE + HEADER_MASKED=\"masked_${vecarch}_${T}_gnuabi.h\") + add_dependencies(${OBJECT_${SIMD}_${T}_GNUABI} masked${SIMD}_generated) + endif() + endforeach() + endif(COMPILER_SUPPORTS_${SIMD}) + endforeach() + + # Create library + add_library(${TARGET_LIBSLEEFGNUABI} ${TARGET_LIBSLEEFGNUABI_OBJECTS} rempitab.c) + + # Library properties + set_target_properties(${TARGET_LIBSLEEFGNUABI} PROPERTIES + VERSION ${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR} + SOVERSION ${SLEEF_SOVERSION} + POSITION_INDEPENDENT_CODE ON # -fPIC + C_STANDARD 99 # -std=gnu99 + LINKER_LANGUAGE C + ) + +# On some systems we need to explicitly link libsleefgnuabi against +# libm to use some of the math functions used in the scalar code (for +# example sqrt). +if(LIBM AND NOT COMPILER_SUPPORTS_BUILTIN_MATH) + target_link_libraries(${TARGET_LIBSLEEFGNUABI} ${LIBM}) +endif() +endif(ENABLE_GNUABI) + +# -------------------------------------------------------------------- +# TARGET_LLVM_BITCODE +# Generate LLVM bitcode +# -------------------------------------------------------------------- +if(CLANG_EXE_PATH AND SLEEF_ENABLE_LLVM_BITCODE) + set(SLEEP_LLVM_BITCODE_INCLUDES "") + get_property(SLEEP_LLVM_BITCODE_INCLUDES_LIST DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) + foreach(INCLUDE_DIRECTORY ${SLEEP_LLVM_BITCODE_INCLUDES_LIST}) + set(SLEEP_LLVM_BITCODE_INCLUDES "${SLEEP_LLVM_BITCODE_INCLUDES} -I ${INCLUDE_DIRECTORY}") + endforeach() + + separate_arguments(SLEEP_LLVM_BITCODE_INCLUDES_CLANG WINDOWS_COMMAND "${SLEEP_LLVM_BITCODE_INCLUDES}") + set(SLEEF_CLANG_LLVM_BITCODE_OPTIONS -O3 -S -emit-llvm -D NDEBUG -D DORENAME=1) + set(LLVM_BITCODE_OUTPUTS "") + + # Generate LLVM bitcode for regular SLEEF + foreach(STANDARD_SOURCE ${STANDARD_SOURCES}) + get_filename_component(SRC_WITHOUT_EXT ${STANDARD_SOURCE} NAME_WE) + set(LLVM_BITCODE_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_WITHOUT_EXT}.c) + set(LLVM_BITCODE_OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SRC_WITHOUT_EXT}.ll) + add_custom_command(OUTPUT ${LLVM_BITCODE_OUTPUT} + COMMAND ${CLANG_EXE_PATH} ${SLEEF_CLANG_LLVM_BITCODE_OPTIONS} -o ${LLVM_BITCODE_OUTPUT} ${LLVM_BITCODE_INPUT} ${SLEEP_LLVM_BITCODE_INCLUDES_CLANG} + DEPENDS + ${LLVM_BITCODE_INPUT} + ) + list(APPEND LLVM_BITCODE_OUTPUTS ${LLVM_BITCODE_OUTPUT}) + endforeach() + + # Generate LLVM bitcode for SIMD SLEEF + foreach(SIMD ${SLEEF_SUPPORTED_LIBM_EXTENSIONS}) + if (${SIMD} STREQUAL "NEON32" OR ${SIMD} STREQUAL "NEON32VFPV4") + set(SIMD_SOURCES sleefsimdsp.c) + else() + set(SIMD_SOURCES sleefsimdsp.c sleefsimddp.c) + endif() + + if(COMPILER_SUPPORTS_${SIMD}) + foreach(SIMD_SOURCE ${SIMD_SOURCES}) + get_filename_component(SIMD_SOURCE_WITHOUT_EXT ${SIMD_SOURCE} NAME_WE) + set(LLVM_BITCODE_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${SIMD_SOURCE}) + set(LLVM_BITCODE_OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SIMD_SOURCE_WITHOUT_EXT}_${SIMD}.ll) + add_custom_command(OUTPUT ${LLVM_BITCODE_OUTPUT} + COMMAND ${CLANG_EXE_PATH} ${CLANG_FLAGS_ENABLE_${SIMD}} ${SLEEF_CLANG_LLVM_BITCODE_OPTIONS} -D ENABLE_${SIMD}=1 -o ${LLVM_BITCODE_OUTPUT} ${LLVM_BITCODE_INPUT} ${SLEEP_LLVM_BITCODE_INCLUDES_CLANG} + DEPENDS + ${LLVM_BITCODE_INPUT} + ) + list(APPEND LLVM_BITCODE_OUTPUTS ${LLVM_BITCODE_OUTPUT}) + endforeach() + endif() + endforeach() + + file(MAKE_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + add_custom_target(${TARGET_LLVM_BITCODE} ALL + DEPENDS + ${LLVM_BITCODE_OUTPUTS} + ) + add_dependencies(${TARGET_LLVM_BITCODE} ${TARGET_HEADERS}) + + install( + FILES ${LLVM_BITCODE_OUTPUTS} + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + ) +endif() + +# -------------------------------------------------------------------- +# TARGET_LIBSLEEFSCALAR +# -------------------------------------------------------------------- +# Build scalar-only library from sleefdp.c and sleefsp.c +if(SLEEF_BUILD_SCALAR_LIB) + add_library(sleefscalar sleefdp.c sleefsp.c rempitab.c) + add_dependencies(sleefscalar ${TARGET_HEADERS}) + set_target_properties(sleefscalar PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} + ${COMMON_TARGET_PROPERTIES} + ) + + target_compile_definitions(sleefscalar + PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} + ) + + if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) + endif() + + install( + TARGETS sleefscalar + EXPORT sleefTargets + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime + NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + RUNTIME # + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT sleef_Runtime + ) +endif() + +# -------------------------------------------------------------------- +# Install +# -------------------------------------------------------------------- +# Install libsleef and sleef.h +install( + TARGETS ${TARGET_LIBSLEEF} + EXPORT sleefTargets + PUBLIC_HEADER # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT sleef_Development + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime + NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + RUNTIME # + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT sleef_Runtime + INCLUDES # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) +configure_file("sleef.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/sleef.pc" @ONLY) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/sleef.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + COMPONENT sleef_Development +) + +if(ENABLE_GNUABI) + install( + TARGETS ${TARGET_LIBSLEEFGNUABI} + EXPORT sleefTargets + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime + NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + RUNTIME # + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT sleef_Runtime + ) +endif() diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispatcher.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispatcher.h new file mode 100644 index 0000000000000..6a81892e26edf --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispatcher.h @@ -0,0 +1,172 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) +#define CONST __attribute__((const)) +#else +#define CONST +#endif + +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +static jmp_buf sigjmp; +#define SETJMP(x) setjmp(x) +#define LONGJMP longjmp +#else +static sigjmp_buf sigjmp; +#define SETJMP(x) sigsetjmp(x, 1) +#define LONGJMP siglongjmp +#endif + +static void sighandler(int signum) { + LONGJMP(sigjmp, 1); +} + +static int cpuSupportsExt(void (*tryExt)()) { + static int cache = -1; + if (cache != -1) return cache; + + void (*org); + org = signal(SIGILL, sighandler); + + if (SETJMP(sigjmp) == 0) { + (*tryExt)(); + cache = 1; + } else { + cache = 0; + } + + signal(SIGILL, org); + return cache; +} + +#ifndef VECALIAS_vf_vf +#define VECALIAS_vf_vf(fptype, funcNameS, funcName, veclen) +#define VECALIAS_vf_vf_vf(fptype, funcNameS, funcName, veclen) +#define VECALIAS_vf_vf_vf_vf(fptype, funcNameS, funcName, veclen) +#endif + +/* + * DISPATCH_R_X, DISPATCH_R_X_Y and DISPATCH_R_X_Y_Z are the macro for + * defining dispatchers. R, X, Y and Z represent the data types of + * return value, first argument, second argument and third argument, + * respectively. vf, vi, i and p correspond to vector FP, vector + * integer, scalar integer and scalar pointer types, respectively. + * + * The arguments for the macros are as follows: + * fptype : FP type name + * veclen : Vector length + * funcnameS : First scalar function name + * funcnameS2 : Second scalar function name + * funcname : Fundamental function name + * pfn : Name of pointer of the function to the dispatcher + * dfn : Name of the dispatcher function + * funcExt0 : Name of the function for vector extension 0 + * funcExt1 : Name of the function for vector extension 1 + * funcExt2 : Name of the function for vector extension 2 + */ + +#define DISPATCH_vf_vf(fptype, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0); \ + static CONST VECTOR_CC fptype dfn(fptype arg0) { \ + fptype CONST VECTOR_CC (*p)(fptype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0) = dfn; \ + EXPORT CONST VECTOR_CC fptype funcName(fptype arg0) { return (*pfn)(arg0); } \ + VECALIAS_vf_vf(fptype, funcNameS, funcName, veclen) \ + VECALIAS_vf_vf(fptype, funcNameS2, funcName, veclen) + +#define DISPATCH_vf_vf_vf(fptype, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, fptype arg1); \ + static CONST VECTOR_CC fptype dfn(fptype arg0, fptype arg1) { \ + fptype CONST VECTOR_CC (*p)(fptype arg0, fptype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, fptype arg1) = dfn; \ + EXPORT CONST VECTOR_CC fptype funcName(fptype arg0, fptype arg1) { return (*pfn)(arg0, arg1); } \ + VECALIAS_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + VECALIAS_vf_vf_vf(fptype, funcNameS2, funcName, veclen) + +#define DISPATCH_vf2_vf(fptype, fptype2, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC fptype2 (*pfn)(fptype arg0); \ + static CONST VECTOR_CC fptype2 dfn(fptype arg0) { \ + fptype2 CONST VECTOR_CC (*p)(fptype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC fptype2 (*pfn)(fptype arg0) = dfn; \ + EXPORT CONST VECTOR_CC fptype2 funcName(fptype arg0) { return (*pfn)(arg0); } + +#define DISPATCH_vf_vf_vi(fptype, itype, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, itype arg1); \ + static CONST VECTOR_CC fptype dfn(fptype arg0, itype arg1) { \ + fptype CONST VECTOR_CC (*p)(fptype arg0, itype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, itype arg1) = dfn; \ + EXPORT CONST VECTOR_CC fptype funcName(fptype arg0, itype arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_vi_vf(fptype, itype, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC itype (*pfn)(fptype arg0); \ + static CONST VECTOR_CC itype dfn(fptype arg0) { \ + itype CONST VECTOR_CC (*p)(fptype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC itype (*pfn)(fptype arg0) = dfn; \ + EXPORT CONST VECTOR_CC itype funcName(fptype arg0) { return (*pfn)(arg0); } + +#define DISPATCH_vf_vf_vf_vf(fptype, veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, fptype arg1, fptype arg2); \ + static CONST VECTOR_CC fptype dfn(fptype arg0, fptype arg1, fptype arg2) { \ + fptype CONST VECTOR_CC (*p)(fptype arg0, fptype arg1, fptype arg2) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0, arg1, arg2); \ + } \ + static CONST VECTOR_CC fptype (*pfn)(fptype arg0, fptype arg1, fptype arg2) = dfn; \ + EXPORT CONST VECTOR_CC fptype funcName(fptype arg0, fptype arg1, fptype arg2) { return (*pfn)(arg0, arg1, arg2); } \ + VECALIAS_vf_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + VECALIAS_vf_vf_vf_vf(fptype, funcNameS2, funcName, veclen) + +#define DISPATCH_i_i(veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST int (*pfn)(int arg0); \ + static CONST int dfn(int arg0) { \ + int CONST (*p)(int) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST int (*pfn)(int arg0) = dfn; \ + EXPORT CONST int funcName(int arg0) { return (*pfn)(arg0); } + +#define DISPATCH_p_i(veclen, funcNameS, funcNameS2, funcName, pfn, dfn, funcExt0, funcExt1, funcExt2) \ + static CONST void *(*pfn)(int arg0); \ + static CONST void *dfn(int arg0) { \ + CONST void *(*p)(int) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + SUBST_IF_EXT2(funcExt2); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST void *(*pfn)(int arg0) = dfn; \ + EXPORT CONST void *funcName(int arg0) { return (*pfn)(arg0); } + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispavx.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispavx.c.org new file mode 100644 index 0000000000000..30dda0c9f1914 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispavx.c.org @@ -0,0 +1,72 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleef.h" + +static int cpuSupportsAVX2() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 7, 0); + ret = (reg[1] & (1 << 5)) != 0; + } + return ret; +} + +static int cpuSupportsFMA() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + ret = (reg[2] & (1 << 12)) != 0; + } + return ret; +} + +static int cpuSupportsFMA4() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 0x80000001, 0); + ret = (reg[2] & (1 << 16)) != 0; + } + return ret; +} + +#ifdef ENABLE_FMA4 +#define SUBST_IF_EXT1(funcfma4) if (cpuSupportsFMA4()) p = funcfma4; +#else +#define SUBST_IF_EXT1(funcfma4) +#endif + +#ifdef ENABLE_AVX2 +#define SUBST_IF_EXT2(funcavx2) if (cpuSupportsAVX2() && cpuSupportsFMA()) p = funcavx2; +#else +#define SUBST_IF_EXT2(funcavx2) +#endif + +#ifdef ENABLE_ALIAS +#define VECALIAS_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVcN ## veclen ## v_ ## funcNameS(fptype) __attribute__((alias(stringify(funcName)))); \ + EXPORT CONST VECTOR_CC fptype _ZGVdN ## veclen ## v_ ## funcNameS(fptype) __attribute__((alias(stringify(funcName)))); +#define VECALIAS_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVcN ## veclen ## vv_ ## funcNameS(fptype, fptype) __attribute__((alias(stringify(funcName)))); \ + EXPORT CONST VECTOR_CC fptype _ZGVdN ## veclen ## vv_ ## funcNameS(fptype, fptype) __attribute__((alias(stringify(funcName)))); +#define VECALIAS_vf_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVcN ## veclen ## vvv_ ## funcNameS(fptype, fptype, fptype) __attribute__((alias(stringify(funcName)))); \ + EXPORT CONST VECTOR_CC fptype _ZGVdN ## veclen ## vvv_ ## funcNameS(fptype, fptype, fptype) __attribute__((alias(stringify(funcName)))); +#endif + +#include "dispatcher.h" + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disppower_128.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disppower_128.c.org new file mode 100644 index 0000000000000..334b2b88eefcd --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disppower_128.c.org @@ -0,0 +1,30 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleef.h" + +#include "dispatcher.h" + +typedef __vector double vector_double; +typedef __vector float vector_float; + +#ifdef ENABLE_VSX3 +void sleef_tryVSX3(); +#define SUBST_IF_EXT1(funcvsx3) if (cpuSupportsExt(sleef_tryVSX3)) p = funcvsx3; +#else +#define SUBST_IF_EXT1(funcvsx3) +#endif + +#define SUBST_IF_EXT2(funcExt2) + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disps390x_128.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disps390x_128.c.org new file mode 100644 index 0000000000000..ae912145abba4 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/disps390x_128.c.org @@ -0,0 +1,27 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleef.h" + +#include "dispatcher.h" + +#ifdef ENABLE_VXE2 +void sleef_tryVXE2(); +#define SUBST_IF_EXT1(funcvxe2) if (cpuSupportsExt(sleef_tryVXE2)) p = funcvxe2; +#else +#define SUBST_IF_EXT1(funcvxe2) +#endif + +#define SUBST_IF_EXT2(funcExt2) + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar.c.org new file mode 100644 index 0000000000000..a18f030ad7dcc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar.c.org @@ -0,0 +1,24 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleef.h" + +#include "dispatcher.h" + +NOEXPORT double sleef_cpuid_SCALFMA; +static void tryFMA() { sleef_cpuid_SCALFMA = Sleef_sind1_u10purecfma(sleef_cpuid_SCALFMA); } + +#define SUBST_IF_EXT1(funcExt1) if (cpuSupportsExt(tryFMA)) p = funcExt1; +#define SUBST_IF_EXT2(funcExt2) + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar_footer.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar_footer.c.org new file mode 100644 index 0000000000000..5eb3daf092acc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispscalar_footer.c.org @@ -0,0 +1,183 @@ + +// + +#ifdef ENABLE_ALIAS +#define DALIAS_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_d2_d(DFUNC, SFUNC) EXPORT CONST Sleef_double2 DFUNC(double) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_i_d(DFUNC, SFUNC) EXPORT CONST int DFUNC(double) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_d_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double, double) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_d_d_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double, double, double) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_d_d_i(DFUNC, SFUNC) EXPORT CONST double DFUNC(double, int) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_f2_f(DFUNC, SFUNC) EXPORT CONST Sleef_float2 DFUNC(float) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_i_f(DFUNC, SFUNC) EXPORT CONST int DFUNC(float) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_f_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float, float) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_f_f_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float, float, float) __attribute__((alias( stringify( SFUNC ) ))); +#define DALIAS_f_f_i(DFUNC, SFUNC) EXPORT CONST float DFUNC(float, int) __attribute__((alias( stringify( SFUNC ) ))); +#else +#define DALIAS_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double d) { return SFUNC (d); } +#define DALIAS_d2_d(DFUNC, SFUNC) EXPORT CONST Sleef_double2 DFUNC(double d) { return SFUNC (d); } +#define DALIAS_i_d(DFUNC, SFUNC) EXPORT CONST int DFUNC(double d) { return SFUNC (d); } +#define DALIAS_d_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double x, double y) { return SFUNC (x, y); } +#define DALIAS_d_d_d_d(DFUNC, SFUNC) EXPORT CONST double DFUNC(double x, double y, double z) { return SFUNC (x, y, z); } +#define DALIAS_d_d_i(DFUNC, SFUNC) EXPORT CONST double DFUNC(double x, int i) { return SFUNC (x, i); } +#define DALIAS_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float d) { return SFUNC (d); } +#define DALIAS_f2_f(DFUNC, SFUNC) EXPORT CONST Sleef_float2 DFUNC(float d) { return SFUNC (d); } +#define DALIAS_i_f(DFUNC, SFUNC) EXPORT CONST int DFUNC(float d) { return SFUNC (d); } +#define DALIAS_f_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float x, float y) { return SFUNC (x, y); } +#define DALIAS_f_f_f_f(DFUNC, SFUNC) EXPORT CONST float DFUNC(float x, float y, float z) { return SFUNC (x, y, z); } +#define DALIAS_f_f_i(DFUNC, SFUNC) EXPORT CONST float DFUNC(float x, int i) { return SFUNC (x, i); } +#endif + +DALIAS_d_d(Sleef_sin_u10, Sleef_sind1_u10) +DALIAS_d_d(Sleef_cos_u10, Sleef_cosd1_u10) +DALIAS_d_d(Sleef_tan_u10, Sleef_tand1_u10) +DALIAS_d_d(Sleef_sin_u35, Sleef_sind1_u35) +DALIAS_d_d(Sleef_cos_u35, Sleef_cosd1_u35) +DALIAS_d_d(Sleef_tan_u35, Sleef_tand1_u35) +DALIAS_d_d(Sleef_asin_u10, Sleef_asind1_u10) +DALIAS_d_d(Sleef_acos_u10, Sleef_acosd1_u10) +DALIAS_d_d(Sleef_atan_u10, Sleef_atand1_u10) +DALIAS_d_d(Sleef_asin_u35, Sleef_asind1_u35) +DALIAS_d_d(Sleef_acos_u35, Sleef_acosd1_u35) +DALIAS_d_d(Sleef_atan_u35, Sleef_atand1_u35) +DALIAS_d_d(Sleef_sinh_u10, Sleef_sinhd1_u10) +DALIAS_d_d(Sleef_cosh_u10, Sleef_coshd1_u10) +DALIAS_d_d(Sleef_tanh_u10, Sleef_tanhd1_u10) +DALIAS_d_d(Sleef_sinh_u35, Sleef_sinhd1_u35) +DALIAS_d_d(Sleef_cosh_u35, Sleef_coshd1_u35) +DALIAS_d_d(Sleef_tanh_u35, Sleef_tanhd1_u35) +DALIAS_d_d(Sleef_asinh_u10, Sleef_asinhd1_u10) +DALIAS_d_d(Sleef_acosh_u10, Sleef_acoshd1_u10) +DALIAS_d_d(Sleef_atanh_u10, Sleef_atanhd1_u10) +DALIAS_d_d(Sleef_log_u10, Sleef_logd1_u10) +DALIAS_d_d(Sleef_log2_u10, Sleef_log2d1_u10) +DALIAS_d_d(Sleef_log10_u10, Sleef_log10d1_u10) +DALIAS_d_d(Sleef_log1p_u10, Sleef_log1pd1_u10) +DALIAS_d_d(Sleef_log_u35, Sleef_logd1_u35) +DALIAS_d_d(Sleef_log2_u35, Sleef_log2d1_u35) +DALIAS_d_d(Sleef_exp_u10, Sleef_expd1_u10) +DALIAS_d_d(Sleef_exp2_u10, Sleef_exp2d1_u10) +DALIAS_d_d(Sleef_exp10_u10, Sleef_exp10d1_u10) +DALIAS_d_d(Sleef_expm1_u10, Sleef_expm1d1_u10) +DALIAS_d_d(Sleef_exp2_u35, Sleef_exp2d1_u35) +DALIAS_d_d(Sleef_exp10_u35, Sleef_exp10d1_u35) +DALIAS_d_d(Sleef_sqrt, Sleef_sqrtd1) +DALIAS_d_d(Sleef_sqrt_u05, Sleef_sqrtd1_u05) +DALIAS_d_d(Sleef_sqrt_u35, Sleef_sqrtd1_u35) +DALIAS_d_d(Sleef_cbrt_u10, Sleef_cbrtd1_u10) +DALIAS_d_d(Sleef_cbrt_u35, Sleef_cbrtd1_u35) +DALIAS_d_d(Sleef_sinpi_u05, Sleef_sinpid1_u05) +DALIAS_d_d(Sleef_cospi_u05, Sleef_cospid1_u05) +DALIAS_d_d(Sleef_fabs, Sleef_fabsd1) +DALIAS_d_d(Sleef_trunc, Sleef_truncd1) +DALIAS_d_d(Sleef_floor, Sleef_floord1) +DALIAS_d_d(Sleef_ceil, Sleef_ceild1) +DALIAS_d_d(Sleef_round, Sleef_roundd1) +DALIAS_d_d(Sleef_rint, Sleef_rintd1) +DALIAS_d_d(Sleef_lgamma_u10, Sleef_lgammad1_u10) +DALIAS_d_d(Sleef_tgamma_u10, Sleef_tgammad1_u10) +DALIAS_d_d(Sleef_erf_u10, Sleef_erfd1_u10) +DALIAS_d_d(Sleef_erfc_u15, Sleef_erfcd1_u15) +DALIAS_d2_d(Sleef_sincospi_u05, Sleef_sincospid1_u05) +DALIAS_d2_d(Sleef_sincospi_u35, Sleef_sincospid1_u35) +DALIAS_d2_d(Sleef_modf, Sleef_modfd1) +DALIAS_d_d_d(Sleef_copysign, Sleef_copysignd1) +DALIAS_d_d_d(Sleef_fmax, Sleef_fmaxd1) +DALIAS_d_d_d(Sleef_fmin, Sleef_fmind1) +DALIAS_d_d_d(Sleef_fdim, Sleef_fdimd1) +DALIAS_d_d_d(Sleef_nextafter, Sleef_nextafterd1) +DALIAS_i_d(Sleef_expfrexp, Sleef_expfrexpd1) +DALIAS_d_d_d_d(Sleef_fma, Sleef_fmad1) +DALIAS_d_d_d(Sleef_hypot_u05, Sleef_hypotd1_u05) +DALIAS_d_d_d(Sleef_hypot_u35, Sleef_hypotd1_u35) +DALIAS_d_d_d(Sleef_fmod, Sleef_fmodd1) +DALIAS_d_d_d(Sleef_remainder, Sleef_remainderd1) +DALIAS_d_d(Sleef_frfrexp, Sleef_frfrexpd1) +DALIAS_d2_d(Sleef_sincos_u35, Sleef_sincosd1_u35) +DALIAS_d2_d(Sleef_sincos_u10, Sleef_sincosd1_u10) +DALIAS_d_d_d(Sleef_atan2_u35, Sleef_atan2d1_u35) +DALIAS_d_d_d(Sleef_atan2_u10, Sleef_atan2d1_u10) +DALIAS_d_d_d(Sleef_pow_u10, Sleef_powd1_u10) +DALIAS_d_d_i(Sleef_ldexp, Sleef_ldexpd1) +DALIAS_i_d(Sleef_ilogb, Sleef_ilogbd1) + +DALIAS_f_f(Sleef_sinf_u35, Sleef_sinf1_u35) +DALIAS_f_f(Sleef_cosf_u35, Sleef_cosf1_u35) +DALIAS_f_f(Sleef_tanf_u35, Sleef_tanf1_u35) +DALIAS_f_f(Sleef_asinf_u35, Sleef_asinf1_u35) +DALIAS_f_f(Sleef_acosf_u35, Sleef_acosf1_u35) +DALIAS_f_f(Sleef_atanf_u35, Sleef_atanf1_u35) +DALIAS_f_f(Sleef_logf_u35, Sleef_logf1_u35) +DALIAS_f_f(Sleef_cbrtf_u35, Sleef_cbrtf1_u35) +DALIAS_f_f(Sleef_sinf_u10, Sleef_sinf1_u10) +DALIAS_f_f(Sleef_cosf_u10, Sleef_cosf1_u10) +DALIAS_f_f(Sleef_fastsinf_u3500, Sleef_fastsinf1_u3500) +DALIAS_f_f(Sleef_fastcosf_u3500, Sleef_fastcosf1_u3500) +DALIAS_f_f(Sleef_tanf_u10, Sleef_tanf1_u10) +DALIAS_f_f(Sleef_asinf_u10, Sleef_asinf1_u10) +DALIAS_f_f(Sleef_acosf_u10, Sleef_acosf1_u10) +DALIAS_f_f(Sleef_atanf_u10, Sleef_atanf1_u10) +DALIAS_f_f(Sleef_logf_u10, Sleef_logf1_u10) +DALIAS_f_f(Sleef_cbrtf_u10, Sleef_cbrtf1_u10) +DALIAS_f_f(Sleef_expf_u10, Sleef_expf1_u10) +DALIAS_f_f(Sleef_sinhf_u10, Sleef_sinhf1_u10) +DALIAS_f_f(Sleef_coshf_u10, Sleef_coshf1_u10) +DALIAS_f_f(Sleef_tanhf_u10, Sleef_tanhf1_u10) +DALIAS_f_f(Sleef_sinhf_u35, Sleef_sinhf1_u35) +DALIAS_f_f(Sleef_coshf_u35, Sleef_coshf1_u35) +DALIAS_f_f(Sleef_tanhf_u35, Sleef_tanhf1_u35) +DALIAS_f_f(Sleef_asinhf_u10, Sleef_asinhf1_u10) +DALIAS_f_f(Sleef_acoshf_u10, Sleef_acoshf1_u10) +DALIAS_f_f(Sleef_atanhf_u10, Sleef_atanhf1_u10) +DALIAS_f_f(Sleef_exp2f_u10, Sleef_exp2f1_u10) +DALIAS_f_f(Sleef_exp10f_u10, Sleef_exp10f1_u10) +DALIAS_f_f(Sleef_exp2f_u35, Sleef_exp2f1_u35) +DALIAS_f_f(Sleef_exp10f_u35, Sleef_exp10f1_u35) +DALIAS_f_f(Sleef_expm1f_u10, Sleef_expm1f1_u10) +DALIAS_f_f(Sleef_log10f_u10, Sleef_log10f1_u10) +DALIAS_f_f(Sleef_log2f_u10, Sleef_log2f1_u10) +DALIAS_f_f(Sleef_log2f_u35, Sleef_log2f1_u35) +DALIAS_f_f(Sleef_log1pf_u10, Sleef_log1pf1_u10) +DALIAS_f_f(Sleef_sinpif_u05, Sleef_sinpif1_u05) +DALIAS_f_f(Sleef_cospif_u05, Sleef_cospif1_u05) +DALIAS_f_f(Sleef_sqrtf_u05, Sleef_sqrtf1_u05) +DALIAS_f_f(Sleef_sqrtf_u35, Sleef_sqrtf1_u35) +DALIAS_f_f(Sleef_lgammaf_u10, Sleef_lgammaf1_u10) +DALIAS_f_f(Sleef_tgammaf_u10, Sleef_tgammaf1_u10) +DALIAS_f_f(Sleef_erff_u10, Sleef_erff1_u10) +DALIAS_f_f(Sleef_erfcf_u15, Sleef_erfcf1_u15) +DALIAS_f_f(Sleef_sqrtf, Sleef_sqrtf1) +DALIAS_f_f(Sleef_fabsf, Sleef_fabsf1) +DALIAS_f_f(Sleef_truncf, Sleef_truncf1) +DALIAS_f_f(Sleef_floorf, Sleef_floorf1) +DALIAS_f_f(Sleef_ceilf, Sleef_ceilf1) +DALIAS_f_f(Sleef_roundf, Sleef_roundf1) +DALIAS_f_f(Sleef_rintf, Sleef_rintf1) +DALIAS_f_f(Sleef_frfrexpf, Sleef_frfrexpf1) +DALIAS_f2_f(Sleef_sincospif_u05, Sleef_sincospif1_u05) +DALIAS_f2_f(Sleef_sincospif_u35, Sleef_sincospif1_u35) +DALIAS_f2_f(Sleef_sincosf_u35, Sleef_sincosf1_u35) +DALIAS_f2_f(Sleef_sincosf_u10, Sleef_sincosf1_u10) +DALIAS_f2_f(Sleef_modff, Sleef_modff1) +DALIAS_f_f_f(Sleef_hypotf_u05, Sleef_hypotf1_u05) +DALIAS_f_f_f(Sleef_hypotf_u35, Sleef_hypotf1_u35) +DALIAS_f_f_f(Sleef_atan2f_u35, Sleef_atan2f1_u35) +DALIAS_f_f_f(Sleef_atan2f_u10, Sleef_atan2f1_u10) +DALIAS_f_f_f(Sleef_powf_u10, Sleef_powf1_u10) +DALIAS_f_f_f(Sleef_fastpowf_u3500, Sleef_fastpowf1_u3500) +DALIAS_f_f_f_f(Sleef_fmaf, Sleef_fmaf1) +DALIAS_f_f_f(Sleef_nextafterf, Sleef_nextafterf1) +DALIAS_f_f_f(Sleef_fmodf, Sleef_fmodf1) +DALIAS_f_f_f(Sleef_remainderf, Sleef_remainderf1) +DALIAS_f_f_f(Sleef_copysignf, Sleef_copysignf1) +DALIAS_f_f_f(Sleef_fmaxf, Sleef_fmaxf1) +DALIAS_f_f_f(Sleef_fminf, Sleef_fminf1) +DALIAS_f_f_f(Sleef_fdimf, Sleef_fdimf1) + +CONST float Sleef_ldexpf1_purec(float, int); +EXPORT CONST float Sleef_ldexpf(float f, int i) { return Sleef_ldexpf1_purec(f, i); } +CONST int Sleef_ilogbf1_purec(float); +EXPORT CONST int Sleef_ilogbf(float f) { return Sleef_ilogbf1_purec(f); } +CONST int Sleef_expfrexpf1_purec(float); +EXPORT CONST int Sleef_expfrexpf(float f) { return Sleef_expfrexpf1_purec(f); } diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispsse.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispsse.c.org new file mode 100644 index 0000000000000..1436e1030cf27 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/dispsse.c.org @@ -0,0 +1,65 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleef.h" + +static int cpuSupportsSSE4_1() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + ret = (reg[2] & (1 << 19)) != 0; + } + return ret; +} + +static int cpuSupportsAVX2() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 7, 0); + ret = (reg[1] & (1 << 5)) != 0; + } + return ret; +} + +static int cpuSupportsFMA() { + static int ret = -1; + if (ret == -1) { + int32_t reg[4]; + Sleef_x86CpuID(reg, 1, 0); + ret = (reg[2] & (1 << 12)) != 0; + } + return ret; +} + +#define SUBST_IF_EXT1(funcsse4) if (cpuSupportsSSE4_1()) p = funcsse4; + +#ifdef ENABLE_AVX2 +#define SUBST_IF_EXT2(funcavx2) if (cpuSupportsAVX2() && cpuSupportsFMA()) p = funcavx2; +#else +#define SUBST_IF_EXT2(funcavx2) +#endif + +#ifdef ENABLE_ALIAS +#define VECALIAS_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVbN ## veclen ## v_ ## funcNameS(fptype) __attribute__((alias(stringify(funcName)))); +#define VECALIAS_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVbN ## veclen ## vv_ ## funcNameS(fptype, fptype) __attribute__((alias(stringify(funcName)))); +#define VECALIAS_vf_vf_vf_vf(fptype, funcNameS, funcName, veclen) \ + EXPORT CONST VECTOR_CC fptype _ZGVbN ## veclen ## vvv_ ## funcNameS(fptype, fptype, fptype) __attribute__((alias(stringify(funcName)))); +#endif + +#include "dispatcher.h" + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/funcproto.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/funcproto.h new file mode 100644 index 0000000000000..1ab66b3b90503 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/funcproto.h @@ -0,0 +1,126 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +typedef struct { + char *name; + int ulp; + int ulpSuffix; + int funcType; + int flags; +} funcSpec; + +/* + ulp : (error bound in ulp) * 10 + + ulpSuffix: + 0 : "" + 1 : "_u1" + 2 : "_u05" + 3 : "_u35" + 4 : "_u15" + 5 : "_u3500" + + funcType: + 0 : vdouble func(vdouble); + 1 : vdouble func(vdouble, vdouble); + 2 : vdouble2 func(vdouble); GNUABI : void func(vdouble, double *, double *); + 3 : vdouble func(vdouble, vint); + 4 : vint func(vdouble); + 5 : vdouble func(vdouble, vdouble, vdouble); + 6 : vdouble2 func(vdouble); GNUABI : vdouble func(vdouble, double *); + 7 : int func(int); + 8 : void *func(int); + + flags: + 1 : No GNUABI + 2 : No double func + */ + +funcSpec funcList[] = { + { "sin", 35, 0, 0, 0 }, + { "cos", 35, 0, 0, 0 }, + { "sincos", 35, 0, 2, 0 }, + { "tan", 35, 0, 0, 0 }, + { "asin", 35, 0, 0, 0 }, + { "acos", 35, 0, 0, 0 }, + { "atan", 35, 0, 0, 0 }, + { "atan2", 35, 0, 1, 0 }, + { "log", 35, 0, 0, 0 }, + { "cbrt", 35, 0, 0, 0 }, + { "sin", 10, 1, 0, 0 }, + { "cos", 10, 1, 0, 0 }, + { "sincos", 10, 1, 2, 0 }, + { "tan", 10, 1, 0, 0 }, + { "asin", 10, 1, 0, 0 }, + { "acos", 10, 1, 0, 0 }, + { "atan", 10, 1, 0, 0 }, + { "atan2", 10, 1, 1, 0 }, + { "log", 10, 1, 0, 0 }, + { "cbrt", 10, 1, 0, 0 }, + { "exp", 10, 0, 0, 0 }, + { "pow", 10, 0, 1, 0 }, + { "sinh", 10, 0, 0, 0 }, + { "cosh", 10, 0, 0, 0 }, + { "tanh", 10, 0, 0, 0 }, + { "sinh", 35, 3, 0, 0 }, + { "cosh", 35, 3, 0, 0 }, + { "tanh", 35, 3, 0, 0 }, + + { "fastsin", 3500, 5, 0, 2 }, + { "fastcos", 3500, 5, 0, 2 }, + { "fastpow", 3500, 5, 1, 2 }, + + { "asinh", 10, 0, 0, 0 }, + { "acosh", 10, 0, 0, 0 }, + { "atanh", 10, 0, 0, 0 }, + { "exp2", 10, 0, 0, 0 }, + { "exp2", 35, 3, 0, 0 }, + { "exp10", 10, 0, 0, 0 }, + { "exp10", 35, 3, 0, 0 }, + { "expm1", 10, 0, 0, 0 }, + { "log10", 10, 0, 0, 0 }, + { "log2", 10, 0, 0, 0 }, + { "log2", 35, 3, 0, 0 }, + { "log1p", 10, 0, 0, 0 }, + { "sincospi", 5, 2, 2, 0 }, + { "sincospi", 35, 3, 2, 0 }, + { "sinpi", 5, 2, 0, 0 }, + { "cospi", 5, 2, 0, 0 }, + { "ldexp", -1, 0, 3, 0 }, + { "ilogb", -1, 0, 4, 0 }, + + { "fma", -1, 0, 5, 0 }, + { "sqrt", -1, 0, 0, 0 }, + { "sqrt", 5, 2, 0, 1 }, + { "sqrt", 35, 3, 0, 0 }, + { "hypot", 5, 2, 1, 0 }, + { "hypot", 35, 3, 1, 0 }, + { "fabs", -1, 0, 0, 0 }, + { "copysign", -1, 0, 1, 0 }, + { "fmax", -1, 0, 1, 0 }, + { "fmin", -1, 0, 1, 0 }, + { "fdim", -1, 0, 1, 0 }, + { "trunc", -1, 0, 0, 0 }, + { "floor", -1, 0, 0, 0 }, + { "ceil", -1, 0, 0, 0 }, + { "round", -1, 0, 0, 0 }, + { "rint", -1, 0, 0, 0 }, + { "nextafter", -1, 0, 1, 0 }, + { "frfrexp", -1, 0, 0, 0 }, + { "expfrexp", -1, 0, 4, 0 }, + { "fmod", -1, 0, 1, 0 }, + { "remainder", -1, 0, 1, 0 }, + { "modf", -1, 0, 6, 0 }, + + { "lgamma", 10, 1, 0, 0 }, + { "tgamma", 10, 1, 0, 0 }, + { "erf", 10, 1, 0, 0 }, + { "erfc", 15, 4, 0, 0 }, + + { "getInt", -1, 0, 7, 1}, + { "getPtr", -1, 0, 8, 1}, + + { NULL, -1, 0, 0, 0 }, +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkalias.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkalias.c new file mode 100644 index 0000000000000..8a06c79139536 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkalias.c @@ -0,0 +1,160 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "funcproto.h" + +int main(int argc, char **argv) { + if (argc == 2 && strcmp(argv[1], "0") == 0) exit(0); + + if (argc < 6) { + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(-1); + } + + int vw = atoi(argv[1]); + int fptype = vw >= 0 ? 0 : 1; + vw = vw < 0 ? -vw : vw; + char *mangledisa = argv[4]; + int genAliasVectorABI = (mangledisa[0] != '-'); + char *isaname = argc == 6 ? argv[5] : ""; + + char * vectorcc=""; +#ifdef ENABLE_AAVPCS + if (strcmp(isaname, "advsimd") == 0) + vectorcc =" __attribute__((aarch64_vector_pcs))"; + genAliasVectorABI = 0; +#endif + + static char *argType2[] = { + "a0", "a0, a1", "a0", "a0, a1", + "a0", "a0, a1, a2", "a0", "a0", "a0" + }; + static char *typeSpecS[] = { "", "f" }; + static char *typeSpec[] = { "d", "f" }; + static char *vparameterStr[9] = { "v", "vv", "", "vv", "v", "vvv", "", "", "" }; + + static char returnType[9][1000]; + static char argType0[9][1000]; + static char argType1[9][1000]; + + sprintf(returnType[0], "%s", argv[2]); + sprintf(returnType[1], "%s", argv[2]); + sprintf(returnType[2], "%s", fptype ? "vfloat2" : "vdouble2"); + sprintf(returnType[3], "%s", argv[2]); + sprintf(returnType[4], "%s", argv[3]); + sprintf(returnType[5], "%s", argv[2]); + sprintf(returnType[6], "%s", fptype ? "vfloat2" : "vdouble2"); + sprintf(returnType[7], "int"); + sprintf(returnType[8], "void *"); + + sprintf(argType0[0], "%s", argv[2]); + sprintf(argType0[1], "%s, %s", argv[2], argv[2]); + sprintf(argType0[2], "%s", argv[2]); + sprintf(argType0[3], "%s, %s", argv[2], argv[3]); + sprintf(argType0[4], "%s", argv[2]); + sprintf(argType0[5], "%s, %s, %s", argv[2], argv[2], argv[2]); + sprintf(argType0[6], "%s", argv[2]); + sprintf(argType0[7], "int"); + sprintf(argType0[8], "int"); + + sprintf(argType1[0], "%s a0", argv[2]); + sprintf(argType1[1], "%s a0, %s a1", argv[2], argv[2]); + sprintf(argType1[2], "%s a0", argv[2]); + sprintf(argType1[3], "%s a0, %s a1", argv[2], argv[3]); + sprintf(argType1[4], "%s a0", argv[2]); + sprintf(argType1[5], "%s a0, %s a1, %s a2", argv[2], argv[2], argv[2]); + sprintf(argType1[6], "%s a0", argv[2]); + sprintf(argType1[7], "int a0"); + sprintf(argType1[8], "int a0"); + + // + + if (fptype == 0) { + printf("#ifdef __SLEEFSIMDDP_C__\n"); + } else { + printf("#ifdef __SLEEFSIMDSP_C__\n"); + } + printf("#ifdef ENABLE_ALIAS\n"); + + if (argc == 6) { + for(int i=0;funcList[i].name != NULL;i++) { + if (fptype == 0 && (funcList[i].flags & 2) != 0) continue; + if (funcList[i].ulp >= 0) { + printf("EXPORT CONST %s Sleef_%s%s%d_u%02d(%s) __attribute__((alias(\"Sleef_%s%s%d_u%02d%s\"))) %s;\n", + returnType[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, funcList[i].ulp, + argType0[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, funcList[i].ulp, isaname, vectorcc + ); + if (genAliasVectorABI && vparameterStr[funcList[i].funcType] != NULL) { + printf("EXPORT CONST VECTOR_CC %s _ZGV%sN%d%s_Sleef_%s%s_u%02d(%s) __attribute__((alias(\"Sleef_%s%s%d_u%02d%s\")))%s;\n", + returnType[funcList[i].funcType], + mangledisa, vw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype], funcList[i].ulp, + argType0[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, funcList[i].ulp, isaname, vectorcc + ); + } + } else { + printf("EXPORT CONST %s Sleef_%s%s%d(%s) __attribute__((alias(\"Sleef_%s%s%d_%s\"))) %s;\n", + returnType[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, + argType0[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, isaname, vectorcc + ); + if (genAliasVectorABI && vparameterStr[funcList[i].funcType] != NULL) { + printf("EXPORT CONST VECTOR_CC %s _ZGV%sN%d%s_Sleef_%s%s(%s) __attribute__((alias(\"Sleef_%s%s%d_%s\")))%s;\n", + returnType[funcList[i].funcType], + mangledisa, vw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype], + argType0[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, isaname, vectorcc + ); + } + } + } + + printf("\n"); + } + + printf("#else // #ifdef ENABLE_ALIAS\n"); + + if (argc == 6) { + for(int i=0;funcList[i].name != NULL;i++) { + if (fptype == 0 && (funcList[i].flags & 2) != 0) continue; + if (funcList[i].ulp >= 0) { + printf("EXPORT CONST %s %s Sleef_%s%s%d_u%02d(%s) { return Sleef_%s%s%d_u%02d%s(%s); }\n", + returnType[funcList[i].funcType], vectorcc, + funcList[i].name, typeSpec[fptype], vw, funcList[i].ulp, + argType1[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, funcList[i].ulp, isaname, + argType2[funcList[i].funcType] + ); + } else { + printf("EXPORT CONST %s %s Sleef_%s%s%d(%s) { return Sleef_%s%s%d_%s(%s); }\n", + returnType[funcList[i].funcType], vectorcc, + funcList[i].name, typeSpec[fptype], vw, + argType1[funcList[i].funcType], + funcList[i].name, typeSpec[fptype], vw, isaname, + argType2[funcList[i].funcType] + ); + } + } + + printf("\n"); + } + + printf("#endif // #ifdef ENABLE_ALIAS\n"); + if (fptype == 0) { + printf("#endif // #ifdef __SLEEFSIMDDP_C__\n"); + } else { + printf("#endif // #ifdef __SLEEFSIMDSP_C__\n"); + } + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkdisp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkdisp.c new file mode 100644 index 0000000000000..7579753cfd93f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkdisp.c @@ -0,0 +1,201 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "funcproto.h" + +int main(int argc, char **argv) { + if (argc < 7) { + fprintf(stderr, "Usage : %s [ ...]\n", argv[0]); + fprintf(stderr, "\n"); + exit(-1); + } + + const int wdp = atoi(argv[1]), wsp = atoi(argv[2]); + const char *vdoublename = argv[3], *vfloatname = argv[4], *vintname = argv[5]; + const int isastart = 6, nisa = argc - isastart; + + for(int i=0;funcList[i].name != NULL;i++) { + char ulpSuffix0[100] = "", ulpSuffix1[100] = "_"; + if (funcList[i].ulp >= 0) { + sprintf(ulpSuffix0, "_u%02d", funcList[i].ulp); + sprintf(ulpSuffix1, "_u%02d", funcList[i].ulp); + } + + switch(funcList[i].funcType) { + case 0: + if ((funcList[i].flags & 2) == 0) { + printf("DISPATCH_vf_vf(%s, %d, Sleef_%s%s, Sleef_%sd1%s, Sleef_%sd%d%s, pnt_%sd%d%s, disp_%sd%d%s", + vdoublename, + wdp, funcList[i].name, ulpSuffix0, + funcList[i].name, ulpSuffix0, + funcList[i].name, wdp, ulpSuffix0, + funcList[i].name, wdp, ulpSuffix0, + funcList[i].name, wdp, ulpSuffix0); + for(int j=0;j +#include +#include +#include +#include + +#include "funcproto.h" + +int main(int argc, char **argv) { + if (argc < 4) { + fprintf(stderr, "\nUsage : %s \n\n", argv[0]); + fprintf(stderr, "This program generates an include file defining masked functions.\n"); + exit(-1); + } + + // + + const char *isaname = argv[1]; + const char *mangledisa = argv[2]; + const int vw = atoi(argv[3]); + int fptype = 0; + + // Remove the "-" sign in the SP value + const char *cvw = (vw < 0) ? argv[3] + 1 : argv[3]; + + if (vw < 0) { + fptype = 1; + } + + // VLA SVE does not set the vector length in the mangled names. + if (strcmp(isaname, "sve") == 0) + cvw = "x"; + + // + +#define LEN0 16 +#define LEN1 256 + + static char *vfpname[] = { "vdouble", "vfloat" }; + static char *vintname[] = { "vint", "vint2" }; + static int sizeoffp[] = { 8, 4 }; + + static char vparameterStr[7][LEN0] = { "v", "vv", "vl8l8", "vv", "v", "vvv", "vl8" }; + static char *typeSpecS[] = { "", "f" }; + static char funcname[4][LEN1]; + + snprintf(vparameterStr[2], LEN0, "vl%dl%d", sizeoffp[fptype], sizeoffp[fptype]); + snprintf(vparameterStr[6], LEN0, "vl%d", sizeoffp[fptype]); + + // + + for(int i=0;funcList[i].name != NULL;i++) { + if ((funcList[i].flags & 1) != 0) continue; + if (fptype == 0 && (funcList[i].flags & 2) != 0) continue; + if (funcList[i].ulp < 20) { + snprintf(funcname[0], LEN1, "_ZGV%sN%s%s_%s%s", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype]); + snprintf(funcname[1], LEN1, "_ZGV%sM%s%s_%s%s", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype]); + } else { + snprintf(funcname[0], LEN1, "_ZGV%sN%s%s_%s%s_u%d", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype], funcList[i].ulp); + snprintf(funcname[1], LEN1, "_ZGV%sM%s%s_%s%s_u%d", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype], funcList[i].ulp); + } + + snprintf(funcname[2], LEN1, "_ZGV%sN%s%s___%s%s_finite", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype]); + snprintf(funcname[3], LEN1, "_ZGV%sM%s%s___%s%s_finite", + mangledisa, cvw, vparameterStr[funcList[i].funcType], funcList[i].name, typeSpecS[fptype]); + + switch(funcList[i].funcType) { + case 0: { + printf("EXPORT CONST %s %s(%s a0, vopmask m) { return %s(a0); }\n", + vfpname[fptype], funcname[1], vfpname[fptype], funcname[0]); + + if (funcList[i].ulp < 20) + printf("EXPORT CONST %s %s(%s, vopmask) __attribute__((weak, alias(\"%s\")));\n", + vfpname[fptype], funcname[3], vfpname[fptype], funcname[1]); + else + printf("EXPORT CONST %s %s_u%d(%s, vopmask) __attribute__((weak, alias(\"%s\")));\n", + vfpname[fptype], funcname[3],funcList[i].ulp, vfpname[fptype], funcname[1]); + break; + } + case 1: { + printf("EXPORT CONST %s %s(%s a0, %s a1, vopmask m) { return %s(a0, a1); }\n", + vfpname[fptype], funcname[1], vfpname[fptype], vfpname[fptype], funcname[0]); + if (funcList[i].ulp < 20) + printf("EXPORT CONST %s %s(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n", + vfpname[fptype], funcname[3], vfpname[fptype], vfpname[fptype], funcname[1]); + else + printf("EXPORT CONST %s %s_u%d(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n", + vfpname[fptype], funcname[3],funcList[i].ulp, vfpname[fptype], vfpname[fptype], funcname[1]); + break; + } + case 2: + if (sizeoffp[fptype] == sizeof(double)) { + printf("#ifndef ENABLE_SVE\n"); + printf("EXPORT void %s(vdouble a0, double *a1, double *a2, vopmask m) {\n", funcname[1]); + printf(" double s[VECTLENDP], c[VECTLENDP];\n"); + printf(" int32_t mbuf[VECTLENSP];\n"); + printf(" %s(a0, s, c);\n", funcname[0]); + printf(" vstoreu_v_p_vi2(mbuf, vcast_vi2_vm(vand_vm_vo64_vm(m, vcast_vm_i_i(-1, -1))));\n"); + printf(" for(int i=0;i +#include +#include +#include + +#include "funcproto.h" + +// In VSX intrinsics, vector data types are like "vector float". +// This function replaces space characters with '_'. +char *escapeSpace(char *str) { + char *ret = malloc(strlen(str) + 10); + strcpy(ret, str); + for(char *p = ret;*p != '\0';p++) if (*p == ' ') *p = '_'; + return ret; +} + +int main(int argc, char **argv) { + if (argc < 4) { + fprintf(stderr, "Generate a header for renaming functions\n"); + fprintf(stderr, "Usage : %s []\n", argv[0]); + fprintf(stderr, "\n"); + + fprintf(stderr, "Generate a part of header for library functions\n"); + fprintf(stderr, "Usage : %s []\n", argv[0]); + fprintf(stderr, "\n"); + + exit(-1); + } + + static char *ulpSuffixStr[] = { "", "_u1", "_u05", "_u35", "_u15", "_u3500" }; + + if (argc == 4 || argc == 5) { + char *atrPrefix = strcmp(argv[1], "-") == 0 ? NULL : argv[1]; + char *wdp = argv[2]; + char *wsp = argv[3]; + char *isaname = argc == 4 ? "" : argv[4]; + char *isaub = argc == 5 ? "_" : ""; + + // + + printf("#ifndef DETERMINISTIC\n\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + if (funcList[i].ulp >= 0) { + printf("#define x%s%s Sleef_%s%sd%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + "", funcList[i].name, wdp, + funcList[i].ulp, isaname); + if (atrPrefix != NULL) { + printf("#define y%s%s Sleef_%s%sd%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname); + } + } else { + printf("#define x%s Sleef_%s%sd%s%s%s\n", + funcList[i].name, + "", funcList[i].name, wdp, isaub, isaname); + if (atrPrefix != NULL) { + printf("#define y%s Sleef_%s%sd%s%s%s\n", + funcList[i].name, + atrPrefix, funcList[i].name, wdp, isaub, isaname); + } + } + } + + printf("\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + if (funcList[i].ulp >= 0) { + printf("#define x%sf%s Sleef_%s%sf%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + "", funcList[i].name, wsp, + funcList[i].ulp, isaname); + if (atrPrefix != NULL) { + printf("#define y%sf%s Sleef_%s%sf%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname); + } + } else { + printf("#define x%sf Sleef_%s%sf%s%s%s\n", + funcList[i].name, + "", funcList[i].name, wsp, isaub, isaname); + if (atrPrefix != NULL) { + printf("#define y%sf Sleef_%s%sf%s%s%s\n", + funcList[i].name, + atrPrefix, funcList[i].name, wsp, isaub, isaname); + } + } + } + + // + + if (atrPrefix != NULL) { + printf("\n#else //#ifndef DETERMINISTIC\n\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + if (funcList[i].ulp >= 0) { + printf("#define x%s%s Sleef_%s%sd%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname); + } else { + printf("#define x%s Sleef_%s%sd%s%s%s\n", + funcList[i].name, + atrPrefix, funcList[i].name, wdp, isaub, isaname); + } + } + + printf("\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + if (funcList[i].ulp >= 0) { + printf("#define x%sf%s Sleef_%s%sf%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname); + } else { + printf("#define x%sf Sleef_%s%sf%s%s%s\n", + funcList[i].name, + atrPrefix, funcList[i].name, wsp, isaub, isaname); + } + } + } + + printf("\n#endif // #ifndef DETERMINISTIC\n"); + } + else { + char *atrPrefix = strcmp(argv[1], "-") == 0 ? NULL : argv[1]; + char *wdp = argv[2]; + char *wsp = argv[3]; + char *vdoublename = argv[4], *vdoublename_escspace = escapeSpace(vdoublename); + char *vfloatname = argv[5], *vfloatname_escspace = escapeSpace(vfloatname); + char *vintname = argv[6], *vintname_escspace = escapeSpace(vintname); + char *vint2name = argv[7], *vint2name_escspace = escapeSpace(vint2name); + char *architecture = argv[8]; + char *isaname = argc == 10 ? argv[9] : ""; + char *isaub = argc == 10 ? "_" : ""; + char *str_omp_simd_dp = (argc < 10 && strcmp(wdp, "1") == 0) ? "SLEEF_PRAGMA_OMP_SIMD_DP " : ""; + char *str_omp_simd_sp = (argc < 10 && strcmp(wsp, "1") == 0) ? "SLEEF_PRAGMA_OMP_SIMD_SP " : ""; + + if (strcmp(isaname, "sve") == 0) + wdp = wsp = "x"; + + char * vectorcc = ""; +#ifdef ENABLE_AAVPCS + if (strcmp(isaname, "advsimd") == 0) + vectorcc =" __attribute__((aarch64_vector_pcs))"; +#endif + + printf("#ifdef %s\n", architecture); + + if (strcmp(vdoublename, "-") != 0) { + if (strcmp(vdoublename, "double") != 0) { + printf("\n"); + printf("#ifndef Sleef_%s_2_DEFINED\n", vdoublename_escspace); + if (strcmp(architecture, "__ARM_FEATURE_SVE") == 0) { + printf("typedef svfloat64x2_t Sleef_%s_2;\n", vdoublename_escspace); + } else { + printf("typedef struct {\n"); + printf(" %s x, y;\n", vdoublename); + printf("} Sleef_%s_2;\n", vdoublename_escspace); + } + printf("#define Sleef_%s_2_DEFINED\n", vdoublename_escspace); + printf("#endif\n"); + printf("\n"); + } else { + printf("\n"); + printf("#ifndef Sleef_double_2_DEFINED\n"); + printf("typedef Sleef_double2 Sleef_double_2;\n"); + printf("#define Sleef_double_2_DEFINED\n"); + printf("#endif\n"); + printf("\n"); + } + + for(int i=0;funcList[i].name != NULL;i++) { + switch(funcList[i].funcType) { + case 0: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s_u%02d%s(%s)%s;\n", + str_omp_simd_dp, + vdoublename, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s_u%02d%s(%s)%s;\n", + vdoublename, + atrPrefix, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + } + } else { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s%s%s(%s)%s;\n", + str_omp_simd_dp, + vdoublename, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s%s%s(%s)%s;\n", + vdoublename, + atrPrefix, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + } + } + break; + case 1: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s_u%02d%s(%s, %s)%s;\n", + str_omp_simd_dp, + vdoublename, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s_u%02d%s(%s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vdoublename, + vectorcc); + } + } else { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s%s%s(%s, %s)%s;\n", + str_omp_simd_dp, + vdoublename, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s%s%s(%s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + isaub, isaname, + vdoublename, vdoublename, + vectorcc); + } + } + break; + case 2: + case 6: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%sd%s_u%02d%s(%s)%s;\n", + vdoublename_escspace, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%s%sd%s_u%02d%s(%s)%s;\n", + vdoublename_escspace, + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + } + } else { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%sd%s%s%s(%s)%s;\n", + vdoublename_escspace, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%s%sd%s%s%s(%s)%s;\n", + vdoublename_escspace, + atrPrefix, funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + } + } + break; + case 3: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s_u%02d%s(%s, %s)%s;\n", + vdoublename, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vintname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s_u%02d%s(%s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vintname, + vectorcc); + } + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s%s%s(%s, %s)%s;\n", + vdoublename, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, vintname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s%s%s(%s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + isaub, isaname, + vdoublename, vintname, + vectorcc); + } + } + break; + case 4: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s_u%02d%s(%s)%s;\n", + vintname, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s_u%02d%s(%s)%s;\n", + vintname, + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, + vectorcc); + } + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s%s%s(%s)%s;\n", + vintname, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s%s%s(%s)%s;\n", + vintname, + atrPrefix, funcList[i].name, wdp, + isaub, isaname, + vdoublename, + vectorcc); + } + } + break; + case 5: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s_u%02d%s(%s, %s, %s)%s;\n", + str_omp_simd_dp, + vdoublename, + funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vdoublename, vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s_u%02d%s(%s, %s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + funcList[i].ulp, isaname, + vdoublename, vdoublename, vdoublename, + vectorcc); + } + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sd%s%s%s(%s, %s, %s)%s;\n", + vdoublename, + funcList[i].name, wdp, + isaub, isaname, + vdoublename, vdoublename, vdoublename, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sd%s%s%s(%s, %s, %s)%s;\n", + vdoublename, + atrPrefix, funcList[i].name, wdp, + isaub, isaname, + vdoublename, vdoublename, vdoublename, + vectorcc); + } + } + break; + // The two cases below should not use vector calling convention. + // They do not have vector type as argument or return value. + // Also, the corresponding definition (`getPtr` and `getInt`) in `sleefsimd*.c` + // are not defined with `VECTOR_CC`. (Same for single precision case below) + case 7: + printf("SLEEF_IMPORT SLEEF_CONST int Sleef_%sd%s%s%s(int);\n", + funcList[i].name, wdp, isaub, isaname); + break; + case 8: + printf("SLEEF_IMPORT SLEEF_CONST void *Sleef_%sd%s%s%s(int);\n", + funcList[i].name, wdp, isaub, isaname); + break; + } + } + } + + if (strcmp(vfloatname, "float") != 0) { + printf("\n"); + printf("#ifndef Sleef_%s_2_DEFINED\n", vfloatname_escspace); + if (strcmp(architecture, "__ARM_FEATURE_SVE") == 0) { + printf("typedef svfloat32x2_t Sleef_%s_2;\n", vfloatname_escspace); + } else { + printf("typedef struct {\n"); + printf(" %s x, y;\n", vfloatname); + printf("} Sleef_%s_2;\n", vfloatname_escspace); + } + printf("#define Sleef_%s_2_DEFINED\n", vfloatname_escspace); + printf("#endif\n"); + printf("\n"); + } else { + printf("\n"); + printf("#ifndef Sleef_float_2_DEFINED\n"); + printf("typedef Sleef_float2 Sleef_float_2;\n"); + printf("#define Sleef_float_2_DEFINED\n"); + printf("#endif\n"); + printf("\n"); + } + + //printf("typedef %s vint2_%s;\n", vint2name, isaname); + //printf("\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + switch(funcList[i].funcType) { + case 0: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s_u%02d%s(%s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s_u%02d%s(%s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, + vectorcc); + } + } else { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s%s%s(%s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + isaub, isaname, + vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s%s%s(%s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + isaub, isaname, + vfloatname, + vectorcc); + } + } + break; + case 1: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s_u%02d%s(%s, %s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, vfloatname, vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s_u%02d%s(%s, %s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, vfloatname, + vectorcc); + } + } else { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s%s%s(%s, %s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + isaub, isaname, + vfloatname, vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s%s%s(%s, %s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + isaub, isaname, + vfloatname, vfloatname, + vectorcc); + } + } + break; + case 2: + case 6: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%sf%s_u%02d%s(%s)%s;\n", + vfloatname_escspace, + funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%s%sf%s_u%02d%s(%s)%s;\n", + vfloatname_escspace, + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, + vectorcc); + } + } else { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%sf%s%s%s(%s)%s;\n", + vfloatname_escspace, + funcList[i].name, wsp, + isaub, isaname, + vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST Sleef_%s_2 Sleef_%s%sf%s%s%s(%s)%s;\n", + vfloatname_escspace, + atrPrefix, funcList[i].name, wsp, + isaub, isaname, + vfloatname, + vectorcc); + } + } + break; + /* + case 3: + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%d_%s(%s, vint2_%s);\n", + vfloatname, + funcList[i].name, wsp, + isaname, + vfloatname, isaname); + break; + case 4: + printf("SLEEF_IMPORT SLEEF_CONST vint2_%s Sleef_%sf%d_%s(%s);\n", + isaname, + funcList[i].name, wsp, + isaname, + vfloatname); + break; + */ + case 5: + if (funcList[i].ulp >= 0) { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s_u%02d%s(%s, %s, %s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, vfloatname, vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s_u%02d%s(%s, %s, %s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + funcList[i].ulp, isaname, + vfloatname, vfloatname, vfloatname, + vectorcc); + } + } else { + printf("%sSLEEF_IMPORT SLEEF_CONST %s Sleef_%sf%s%s%s(%s, %s, %s)%s;\n", + str_omp_simd_sp, + vfloatname, + funcList[i].name, wsp, + isaub, isaname, + vfloatname, vfloatname, vfloatname, + vectorcc); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%s%sf%s%s%s(%s, %s, %s)%s;\n", + vfloatname, + atrPrefix, funcList[i].name, wsp, + isaub, isaname, + vfloatname, vfloatname, vfloatname, + vectorcc); + } + } + break; + // The two cases below should not use vector calling convention. + // See comments for double precision case above. + case 7: + printf("SLEEF_IMPORT SLEEF_CONST int Sleef_%sf%s%s%s(int);\n", + funcList[i].name, wsp, isaub, isaname); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST int Sleef_%s%sf%s%s%s(int);\n", + atrPrefix, funcList[i].name, wsp, isaub, isaname); + } + break; + case 8: + printf("SLEEF_IMPORT SLEEF_CONST void *Sleef_%sf%s%s%s(int);\n", + funcList[i].name, wsp, isaub, isaname); + if (atrPrefix != NULL) { + printf("SLEEF_IMPORT SLEEF_CONST void *Sleef_%s%sf%s%s%s(int);\n", + atrPrefix, funcList[i].name, wsp, isaub, isaname); + } + break; + } + } + + printf("#endif\n"); + + free(vdoublename_escspace); + free(vfloatname_escspace); + free(vintname_escspace); + free(vint2name_escspace); + } + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkrename_gnuabi.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkrename_gnuabi.c new file mode 100644 index 0000000000000..ed7ab9164dc52 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/mkrename_gnuabi.c @@ -0,0 +1,100 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "funcproto.h" + +int main(int argc, char **argv) { + if (argc < 5) { + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(-1); + } + + char *isaname = argv[1]; + char *mangledisa = argv[2]; + char *wdp = argv[3]; + char *wsp = argv[4]; + + // VLA SVE does not set the vector length in the mangled names. + if (strcmp(isaname, "sve") == 0) + wdp = wsp = "x"; + + static char *ulpSuffixStr[] = { "", "_u1", "_u05", "_u35", "_u15", "_u3500" }; + static char *vparameterStrDP[] = { "v", "vv", "vl8l8", "vv", "v", "vvv", "vl8" }; + static char *vparameterStrSP[] = { "v", "vv", "vl4l4", "vv", "v", "vvv", "vl4" }; + + for(int i=0;funcList[i].name != NULL;i++) { + if ((funcList[i].flags & 1) != 0) continue; + if ((funcList[i].flags & 2) != 0) continue; + if (funcList[i].ulp < 0) { + printf("#define x%s _ZGV%sN%s%s_%s\n", funcList[i].name, + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + printf("#define str_x%s \"_ZGV%sN%s%s_%s\"\n", funcList[i].name, + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + printf("#define __%s_finite _ZGV%sN%s%s___%s_finite\n", funcList[i].name, + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + } else if (funcList[i].ulp < 20) { + printf("#define x%s%s _ZGV%sN%s%s_%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + printf("#define str_x%s%s \"_ZGV%sN%s%s_%s\"\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + printf("#define __%s%s_finite _ZGV%sN%s%s___%s_finite\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + } else { + printf("#define x%s%s _ZGV%sN%s%s_%s_u%d\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name, funcList[i].ulp); + printf("#define str_x%s%s \"_ZGV%sN%s%s_%s_u%d\"\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name, funcList[i].ulp); + printf("#define __%s%s_finite _ZGV%sN%s%s___%s_finite\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wdp, vparameterStrDP[funcList[i].funcType], funcList[i].name); + } + } + + printf("\n"); + + for(int i=0;funcList[i].name != NULL;i++) { + if ((funcList[i].flags & 1) != 0) continue; + if (funcList[i].ulp < 0) { + printf("#define x%sf _ZGV%sN%s%s_%sf\n", funcList[i].name, + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + printf("#define str_x%sf \"_ZGV%sN%s%s_%sf\"\n", funcList[i].name, + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + printf("#define __%sf_finite _ZGV%sN%s%s___%sf_finite\n", funcList[i].name, + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + } else if (funcList[i].ulp < 20) { + printf("#define x%sf%s _ZGV%sN%s%s_%sf\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + printf("#define str_x%sf%s \"_ZGV%sN%s%s_%sf\"\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + printf("#define __%sf%s_finite _ZGV%sN%s%s___%sf_finite\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + } else { + printf("#define x%sf%s _ZGV%sN%s%s_%sf_u%d\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name, funcList[i].ulp); + printf("#define str_x%sf%s \"_ZGV%sN%s%s_%sf_u%d\"\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name, funcList[i].ulp); + printf("#define __%sf%s_finite _ZGV%sN%s%s___%sf_finite\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + mangledisa, wsp, vparameterStrSP[funcList[i].funcType], funcList[i].name); + } + } + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/norename.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/norename.h new file mode 100644 index 0000000000000..e8b3ae6babccc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/norename.h @@ -0,0 +1,203 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#ifdef ENABLE_DP +#ifdef ENABLE_SVE +typedef svfloat64x2_t vdouble2; +#else +typedef struct { + vdouble x, y; +} vdouble2; +#endif + +vdouble xldexp(vdouble x, vint q); +vint xilogb(vdouble d); + +vdouble xsin(vdouble d); +vdouble xcos(vdouble d); +vdouble2 xsincos(vdouble d); +vdouble xtan(vdouble d); +vdouble xasin(vdouble s); +vdouble xacos(vdouble s); +vdouble xatan(vdouble s); +vdouble xatan2(vdouble y, vdouble x); +vdouble xlog(vdouble d); +vdouble xexp(vdouble d); +vdouble xpow(vdouble x, vdouble y); + +vdouble xsinh(vdouble d); +vdouble xcosh(vdouble d); +vdouble xtanh(vdouble d); +vdouble xsinh_u35(vdouble d); +vdouble xcosh_u35(vdouble d); +vdouble xtanh_u35(vdouble d); +vdouble xasinh(vdouble s); +vdouble xacosh(vdouble s); +vdouble xatanh(vdouble s); + +vdouble xcbrt(vdouble d); + +vdouble xexp2(vdouble a); +vdouble xexp10(vdouble a); +vdouble xexp2_u35(vdouble a); +vdouble xexp10_u35(vdouble a); +vdouble xexpm1(vdouble a); +vdouble xlog10(vdouble a); +vdouble xlog2(vdouble a); +vdouble xlog2_u35(vdouble a); +vdouble xlog1p(vdouble a); + +vdouble xsin_u1(vdouble d); +vdouble xcos_u1(vdouble d); +vdouble2 xsincos_u1(vdouble d); +vdouble xtan_u1(vdouble d); +vdouble xasin_u1(vdouble s); +vdouble xacos_u1(vdouble s); +vdouble xatan_u1(vdouble s); +vdouble xatan2_u1(vdouble y, vdouble x); +vdouble xlog_u1(vdouble d); +vdouble xcbrt_u1(vdouble d); + +vdouble2 xsincospi_u05(vdouble d); +vdouble2 xsincospi_u35(vdouble d); +vdouble xsinpi_u05(vdouble d); +vdouble xcospi_u05(vdouble d); + +vdouble xldexp(vdouble, vint); +vint xilogb(vdouble); +vdouble xfma(vdouble, vdouble, vdouble); +vdouble xsqrt(vdouble); +vdouble xsqrt_u05(vdouble); +vdouble xsqrt_u35(vdouble); + +vdouble xhypot_u05(vdouble, vdouble); +vdouble xhypot_u35(vdouble, vdouble); + +vdouble xfabs(vdouble); +vdouble xcopysign(vdouble, vdouble); +vdouble xfmax(vdouble, vdouble); +vdouble xfmin(vdouble, vdouble); +vdouble xfdim(vdouble, vdouble); +vdouble xtrunc(vdouble); +vdouble xfloor(vdouble); +vdouble xceil(vdouble); +vdouble xround(vdouble); +vdouble xrint(vdouble); +vdouble xnextafter(vdouble, vdouble); +vdouble xfrfrexp(vdouble); +vint xexpfrexp(vdouble); +vdouble xfmod(vdouble, vdouble); +vdouble xremainder(vdouble, vdouble); +vdouble2 xmodf(vdouble); + +vdouble xlgamma_u1(vdouble); +vdouble xtgamma_u1(vdouble); + +vdouble xerf_u1(vdouble); +vdouble xerfc_u15(vdouble); +#endif + +// + +#ifdef ENABLE_SP +#ifdef ENABLE_SVE +typedef svfloat32x2_t vfloat2; +#else +typedef struct { + vfloat x, y; +} vfloat2; +#endif + +vfloat xldexpf(vfloat x, vint2 q); +vint2 xilogbf(vfloat d); + +vfloat xsinf(vfloat d); +vfloat xcosf(vfloat d); +vfloat2 xsincosf(vfloat d); +vfloat xtanf(vfloat d); +vfloat xasinf(vfloat s); +vfloat xacosf(vfloat s); +vfloat xatanf(vfloat s); +vfloat xatan2f(vfloat y, vfloat x); +vfloat xlogf(vfloat d); +vfloat xexpf(vfloat d); +vfloat xcbrtf(vfloat s); + +vfloat xpowf(vfloat x, vfloat y); +vfloat xsinhf(vfloat x); +vfloat xcoshf(vfloat x); +vfloat xtanhf(vfloat x); +vfloat xsinhf_u35(vfloat x); +vfloat xcoshf_u35(vfloat x); +vfloat xtanhf_u35(vfloat x); +vfloat xasinhf(vfloat x); +vfloat xacoshf(vfloat x); +vfloat xatanhf(vfloat x); +vfloat xexp2f(vfloat a); +vfloat xexp10f(vfloat a); +vfloat xexp2f_u35(vfloat a); +vfloat xexp10f_u35(vfloat a); +vfloat xexpm1f(vfloat a); +vfloat xlog10f(vfloat a); +vfloat xlog2f(vfloat a); +vfloat xlog2f_u35(vfloat a); +vfloat xlog1pf(vfloat a); + +vfloat xsinf_u1(vfloat d); +vfloat xcosf_u1(vfloat d); +vfloat2 xsincosf_u1(vfloat d); +vfloat xtanf_u1(vfloat d); +vfloat xasinf_u1(vfloat s); +vfloat xacosf_u1(vfloat s); +vfloat xatanf_u1(vfloat s); +vfloat xatan2f_u1(vfloat y, vfloat x); +vfloat xlogf_u1(vfloat d); +vfloat xcbrtf_u1(vfloat s); + +vfloat2 xsincospif_u05(vfloat d); +vfloat2 xsincospif_u35(vfloat d); +vfloat xsinpif_u05(vfloat d); +vfloat xcospif_u05(vfloat d); + + +vfloat xldexpf(vfloat, vint2); +vint2 xilogbf(vfloat); +vfloat xfmaf(vfloat, vfloat, vfloat); +vfloat xsqrtf(vfloat s); +vfloat xsqrtf_u05(vfloat s); +vfloat xsqrtf_u35(vfloat s); + +vfloat xhypotf_u05(vfloat, vfloat); +vfloat xhypotf_u35(vfloat, vfloat); + +vfloat xfabsf(vfloat); +vfloat xcopysignf(vfloat, vfloat); +vfloat xfmaxf(vfloat, vfloat); +vfloat xfminf(vfloat, vfloat); +vfloat xfdimf(vfloat, vfloat); +vfloat xtruncf(vfloat); +vfloat xfloorf(vfloat); +vfloat xceilf(vfloat); +vfloat xroundf(vfloat); +vfloat xrintf(vfloat); +vfloat xnextafterf(vfloat, vfloat); +vfloat xfrfrexpf(vfloat); +vint2 xexpfrexpf(vfloat); +vfloat xfmodf(vfloat, vfloat); +vfloat xremainderf(vfloat, vfloat); +vfloat2 xmodff(vfloat); + +vfloat xlgammaf_u1(vfloat); +vfloat xtgammaf_u1(vfloat); + +vfloat xerff_u1(vfloat); +vfloat xerfcf_u15(vfloat); + +vfloat xfastsinf_u3500(vfloat d); +vfloat xfastcosf_u3500(vfloat d); +vfloat xfastpowf_u3500(vfloat x, vfloat y); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rempitab.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rempitab.c new file mode 100644 index 0000000000000..b174bc7bdc1dd --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rempitab.c @@ -0,0 +1,1092 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "misc.h" + +#if !defined(SLEEF_GENHEADER) +#define FUNCATR NOEXPORT ALIGNED(64) +#else +#define FUNCATR EXPORT ALIGNED(64) +#endif + +FUNCATR const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, + 0, 0, 0, 0, +}; + +NOEXPORT ALIGNED(64) const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 0, 0, 0, 0, +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rename.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rename.h new file mode 100644 index 0000000000000..8810742b1a58e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/rename.h @@ -0,0 +1,181 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define xsin Sleef_sin_u35 +#define xcos Sleef_cos_u35 +#define xsincos Sleef_sincos_u35 +#define xtan Sleef_tan_u35 +#define xasin Sleef_asin_u35 +#define xacos Sleef_acos_u35 +#define xatan Sleef_atan_u35 +#define xatan2 Sleef_atan2_u35 +#define xlog Sleef_log_u35 +#define xcbrt Sleef_cbrt_u35 + +#define xsin_u1 Sleef_sin_u10 +#define xcos_u1 Sleef_cos_u10 +#define xsincos_u1 Sleef_sincos_u10 +#define xtan_u1 Sleef_tan_u10 +#define xasin_u1 Sleef_asin_u10 +#define xacos_u1 Sleef_acos_u10 +#define xatan_u1 Sleef_atan_u10 +#define xatan2_u1 Sleef_atan2_u10 +#define xlog_u1 Sleef_log_u10 +#define xcbrt_u1 Sleef_cbrt_u10 + +#define xexp Sleef_exp_u10 +#define xpow Sleef_pow_u10 +#define xsinh Sleef_sinh_u10 +#define xcosh Sleef_cosh_u10 +#define xtanh Sleef_tanh_u10 +#define xsinh_u35 Sleef_sinh_u35 +#define xcosh_u35 Sleef_cosh_u35 +#define xtanh_u35 Sleef_tanh_u35 +#define xasinh Sleef_asinh_u10 +#define xacosh Sleef_acosh_u10 +#define xatanh Sleef_atanh_u10 + +#define xexp2 Sleef_exp2_u10 +#define xexp10 Sleef_exp10_u10 +#define xexp2_u35 Sleef_exp2_u35 +#define xexp10_u35 Sleef_exp10_u35 +#define xexpm1 Sleef_expm1_u10 +#define xlog10 Sleef_log10_u10 +#define xlog2 Sleef_log2_u10 +#define xlog2_u35 Sleef_log2_u35 +#define xlog1p Sleef_log1p_u10 + +#define xsincospi_u05 Sleef_sincospi_u05 +#define xsincospi_u35 Sleef_sincospi_u35 +#define xsinpi_u05 Sleef_sinpi_u05 +#define xcospi_u05 Sleef_cospi_u05 + +#define xldexp Sleef_ldexp +#define xilogb Sleef_ilogb + +#define xfma Sleef_fma +#define xsqrt Sleef_sqrt +#define xsqrt_u05 Sleef_sqrt_u05 +#define xsqrt_u35 Sleef_sqrt_u35 +#define xhypot_u05 Sleef_hypot_u05 +#define xhypot_u35 Sleef_hypot_u35 + +#define xfabs Sleef_fabs +#define xcopysign Sleef_copysign +#define xfmax Sleef_fmax +#define xfmin Sleef_fmin +#define xfdim Sleef_fdim +#define xtrunc Sleef_trunc +#define xfloor Sleef_floor +#define xceil Sleef_ceil +#define xround Sleef_round +#define xrint Sleef_rint +#define xnextafter Sleef_nextafter +#define xfrfrexp Sleef_frfrexp +#define xexpfrexp Sleef_expfrexp +#define xfmod Sleef_fmod +#define xremainder Sleef_remainder +#define xmodf Sleef_modf + +#define xlgamma_u1 Sleef_lgamma_u10 +#define xtgamma_u1 Sleef_tgamma_u10 +#define xerf_u1 Sleef_erf_u10 +#define xerfc_u15 Sleef_erfc_u15 + +// + +#define xsinf Sleef_sinf_u35 +#define xcosf Sleef_cosf_u35 +#define xsincosf Sleef_sincosf_u35 +#define xtanf Sleef_tanf_u35 +#define xasinf Sleef_asinf_u35 +#define xacosf Sleef_acosf_u35 +#define xatanf Sleef_atanf_u35 +#define xatan2f Sleef_atan2f_u35 +#define xlogf Sleef_logf_u35 +#define xcbrtf Sleef_cbrtf_u35 + +#define xsinf_u1 Sleef_sinf_u10 +#define xcosf_u1 Sleef_cosf_u10 +#define xsincosf_u1 Sleef_sincosf_u10 +#define xtanf_u1 Sleef_tanf_u10 +#define xasinf_u1 Sleef_asinf_u10 +#define xacosf_u1 Sleef_acosf_u10 +#define xatanf_u1 Sleef_atanf_u10 +#define xatan2f_u1 Sleef_atan2f_u10 +#define xlogf_u1 Sleef_logf_u10 +#define xcbrtf_u1 Sleef_cbrtf_u10 + +#define xexpf Sleef_expf_u10 +#define xpowf Sleef_powf_u10 +#define xsinhf Sleef_sinhf_u10 +#define xcoshf Sleef_coshf_u10 +#define xtanhf Sleef_tanhf_u10 +#define xsinhf_u35 Sleef_sinhf_u35 +#define xcoshf_u35 Sleef_coshf_u35 +#define xtanhf_u35 Sleef_tanhf_u35 +#define xasinhf Sleef_asinhf_u10 +#define xacoshf Sleef_acoshf_u10 +#define xatanhf Sleef_atanhf_u10 + +#define xexp2f Sleef_exp2f_u10 +#define xexp10f Sleef_exp10f_u10 +#define xexp2f_u35 Sleef_exp2f_u35 +#define xexp10f_u35 Sleef_exp10f_u35 +#define xexpm1f Sleef_expm1f_u10 +#define xlog10f Sleef_log10f_u10 +#define xlog2f Sleef_log2f_u10 +#define xlog10f_u35 Sleef_log10f_u35 +#define xlog2f_u35 Sleef_log2f_u35 +#define xlog1pf Sleef_log1pf_u10 + +#define xsincospif_u05 Sleef_sincospif_u05 +#define xsincospif_u35 Sleef_sincospif_u35 +#define xsinpif_u05 Sleef_sinpif_u05 +#define xcospif_u05 Sleef_cospif_u05 + +#define xldexpf Sleef_ldexpf +#define xilogbf Sleef_ilogbf + +#define xfmaf Sleef_fmaf +#define xsqrtf Sleef_sqrtf +#define xsqrtf_u05 Sleef_sqrtf_u05 +#define xsqrtf_u35 Sleef_sqrtf_u35 +#define xhypotf_u05 Sleef_hypotf_u05 +#define xhypotf_u35 Sleef_hypotf_u35 + +#define xfabsf Sleef_fabsf +#define xcopysignf Sleef_copysignf +#define xfmaxf Sleef_fmaxf +#define xfminf Sleef_fminf +#define xfdimf Sleef_fdimf +#define xtruncf Sleef_truncf +#define xfloorf Sleef_floorf +#define xceilf Sleef_ceilf +#define xroundf Sleef_roundf +#define xrintf Sleef_rintf +#define xnextafterf Sleef_nextafterf +#define xfrfrexpf Sleef_frfrexpf +#define xexpfrexpf Sleef_expfrexpf +#define xfmodf Sleef_fmodf +#define xremainderf Sleef_remainderf +#define xmodff Sleef_modff + +#define xlgammaf_u1 Sleef_lgammaf_u10 +#define xtgammaf_u1 Sleef_tgammaf_u10 +#define xerff_u1 Sleef_erff_u10 +#define xerfcf_u15 Sleef_erfcf_u15 + +#define xfastsinf_u3500 Sleef_fastsinf_u3500 +#define xfastcosf_u3500 Sleef_fastcosf_u3500 +#define xfastpowf_u3500 Sleef_fastpowf_u3500 + +// + +#define xsincospil_u05 Sleef_sincospil_u05 +#define xsincospil_u35 Sleef_sincospil_u35 + +#define xsincospiq_u05 Sleef_sincospiq_u05 +#define xsincospiq_u35 Sleef_sincospiq_u35 diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleef.pc.in b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleef.pc.in new file mode 100644 index 0000000000000..f73bc14570d7b --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleef.pc.in @@ -0,0 +1,9 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: SLEEF +Description: SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT +Version: @SLEEF_VERSION_MAJOR@.@SLEEF_VERSION_MINOR@.@SLEEF_VERSION_PATCH@ +Cflags: -I${includedir} +Libs: -L${libdir} -lsleef diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefdp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefdp.c new file mode 100644 index 0000000000000..0ece9233c164b --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefdp.c @@ -0,0 +1,2724 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#include +#include +#include +#include +#include + +#ifndef ENABLE_BUILTIN_MATH +#include +#define SQRT sqrt +#else +#define SQRT __builtin_sqrt +#endif + +#include "misc.h" + +extern const double Sleef_rempitabdp[]; + +#ifdef DORENAME +#include "rename.h" +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#define MLA mla +#define C2V(x) (x) +#include "estrin.h" + +static INLINE CONST int64_t doubleToRawLongBits(double d) { + int64_t ret; + memcpy(&ret, &d, sizeof(ret)); + return ret; +} + +static INLINE CONST double longBitsToDouble(int64_t i) { + double ret; + memcpy(&ret, &i, sizeof(ret)); + return ret; +} + +static INLINE CONST double fabsk(double x) { + return longBitsToDouble(INT64_C(0x7fffffffffffffff) & doubleToRawLongBits(x)); +} + +static INLINE CONST double mulsign(double x, double y) { + return longBitsToDouble(doubleToRawLongBits(x) ^ (doubleToRawLongBits(y) & (INT64_C(1) << 63))); +} + +static INLINE CONST double copysignk(double x, double y) { + return longBitsToDouble((doubleToRawLongBits(x) & ~(INT64_C(1) << 63)) ^ (doubleToRawLongBits(y) & (INT64_C(1) << 63))); +} + +static INLINE CONST double sign(double d) { return mulsign(1, d); } +static INLINE CONST double mla(double x, double y, double z) { return x * y + z; } +static INLINE CONST double rintk(double x) { return x < 0 ? (int)(x - 0.5) : (int)(x + 0.5); } +static INLINE CONST int ceilk(double x) { return (int)x + (x < 0 ? 0 : 1); } +static INLINE CONST double trunck(double x) { return (double)(int)x; } +static INLINE CONST double fmink(double x, double y) { return x < y ? x : y; } +static INLINE CONST double fmaxk(double x, double y) { return x > y ? x : y; } + +static INLINE CONST int xsignbit(double d) { return (doubleToRawLongBits(d) & doubleToRawLongBits(-0.0)) == doubleToRawLongBits(-0.0); } +static INLINE CONST int xisnan(double x) { return x != x; } +static INLINE CONST int xisinf(double x) { return x == SLEEF_INFINITY || x == -SLEEF_INFINITY; } +static INLINE CONST int xisminf(double x) { return x == -SLEEF_INFINITY; } +static INLINE CONST int xispinf(double x) { return x == SLEEF_INFINITY; } +static INLINE CONST int xisnegzero(double x) { return doubleToRawLongBits(x) == doubleToRawLongBits(-0.0); } +static INLINE CONST int xisnumber(double x) { return !xisinf(x) && !xisnan(x); } + +static INLINE CONST int xisint(double d) { + double x = d - (double)(INT64_C(1) << 31) * (int)(d * (1.0 / (INT64_C(1) << 31))); + return (x == (int)x) || (fabsk(d) >= (double)(INT64_C(1) << 53)); +} + +static INLINE CONST int xisodd(double d) { + double x = d - (double)(INT64_C(1) << 31) * (int)(d * (1.0 / (INT64_C(1) << 31))); + return (1 & (int)x) != 0 && fabsk(d) < (double)(INT64_C(1) << 53); +} + +static INLINE CONST double pow2i(int q) { + return longBitsToDouble(((int64_t)(q + 0x3ff)) << 52); +} + +static INLINE CONST double ldexpk(double x, int q) { + double u; + int m; + m = q >> 31; + m = (((m + q) >> 9) - m) << 7; + q = q - (m << 2); + m += 0x3ff; + m = m < 0 ? 0 : m; + m = m > 0x7ff ? 0x7ff : m; + u = longBitsToDouble(((int64_t)m) << 52); + x = x * u * u * u * u; + u = longBitsToDouble(((int64_t)(q + 0x3ff)) << 52); + return x * u; +} + +static INLINE CONST double ldexp2k(double d, int e) { // faster than ldexpk, short reach + return d * pow2i(e >> 1) * pow2i(e - (e >> 1)); +} + +static INLINE CONST double ldexp3k(double d, int e) { // very fast, no denormal + return longBitsToDouble(doubleToRawLongBits(d) + (((int64_t)e) << 52)); +} + +EXPORT CONST double xldexp(double x, int exp) { + if (exp > 2100) exp = 2100; + if (exp < -2100) exp = -2100; + + int e0 = exp >> 2; + if (exp < 0) e0++; + if (-100 < exp && exp < 100) e0 = 0; + int e1 = exp - (e0 << 2); + + double p = pow2i(e0); + double ret = x * pow2i(e1) * p * p * p * p; + + return ret; +} + +static INLINE CONST int ilogbk(double d) { + int m = d < 4.9090934652977266E-91; + d = m ? 2.037035976334486E90 * d : d; + int q = (doubleToRawLongBits(d) >> 52) & 0x7ff; + q = m ? q - (300 + 0x03ff) : q - 0x03ff; + return q; +} + +// ilogb2k is similar to ilogbk, but the argument has to be a +// normalized FP value. +static INLINE CONST int ilogb2k(double d) { + return ((doubleToRawLongBits(d) >> 52) & 0x7ff) - 0x3ff; +} + +EXPORT CONST int xilogb(double d) { + int e = ilogbk(fabsk(d)); + e = d == 0.0 ? SLEEF_FP_ILOGB0 : e; + e = xisnan(d) ? SLEEF_FP_ILOGBNAN : e; + e = xisinf(d) ? INT_MAX : e; + return e; +} + +// + +#ifndef NDEBUG +static int checkfp(double x) { + if (xisinf(x) || xisnan(x)) return 1; + return 0; +} +#endif + +static INLINE CONST double upper(double d) { + return longBitsToDouble(doubleToRawLongBits(d) & INT64_C(0xfffffffff8000000)); +} + +static INLINE CONST Sleef_double2 dd(double h, double l) { + Sleef_double2 ret; + ret.x = h; ret.y = l; + return ret; +} + +static INLINE CONST Sleef_double2 ddnormalize_d2_d2(Sleef_double2 t) { + Sleef_double2 s; + + s.x = t.x + t.y; + s.y = t.x - s.x + t.y; + + return s; +} + +static INLINE CONST Sleef_double2 ddscale_d2_d2_d(Sleef_double2 d, double s) { + Sleef_double2 r; + + r.x = d.x * s; + r.y = d.y * s; + + return r; +} + +static INLINE CONST Sleef_double2 ddneg_d2_d2(Sleef_double2 d) { + Sleef_double2 r; + + r.x = -d.x; + r.y = -d.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddabs_d2_d2(Sleef_double2 x) { + return dd(x.x < 0 ? -x.x : x.x, x.x < 0 ? -x.y : x.y); +} + +/* + * ddadd and ddadd2 are functions for double-double addition. ddadd + * is simpler and faster than ddadd2, but it requires the absolute + * value of first argument to be larger than the second argument. The + * exact condition that should be met is checked if NDEBUG macro is + * not defined. + * + * Please note that if the results won't be used, it is no problem to + * feed arguments that do not meet this condition. You will see + * warning messages if you turn off NDEBUG macro and run tester2, but + * this is normal. + * + * Please see : + * Jonathan Richard Shewchuk, Adaptive Precision Floating-Point + * Arithmetic and Fast Robust Geometric Predicates, Discrete & + * Computational Geometry 18:305-363, 1997. + */ + +static INLINE CONST Sleef_double2 ddadd_d2_d_d(double x, double y) { + // |x| >= |y| + + Sleef_double2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y) || fabsk(x) >= fabsk(y) || (fabsk(x+y) <= fabsk(x) && fabsk(x+y) <= fabsk(y)))) { + fprintf(stderr, "[ddadd_d2_d_d : %g, %g]\n", x, y); + fflush(stderr); + } +#endif + + r.x = x + y; + r.y = x - r.x + y; + + return r; +} + +static INLINE CONST Sleef_double2 ddadd2_d2_d_d(double x, double y) { + Sleef_double2 r; + + r.x = x + y; + double v = r.x - x; + r.y = (x - (r.x - v)) + (y - v); + + return r; +} + +static INLINE CONST Sleef_double2 ddadd_d2_d2_d(Sleef_double2 x, double y) { + // |x| >= |y| + + Sleef_double2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y) || fabsk(x.x) >= fabsk(y) || (fabsk(x.x+y) <= fabsk(x.x) && fabsk(x.x+y) <= fabsk(y)))) { + fprintf(stderr, "[ddadd_d2_d2_d : %g %g]\n", x.x, y); + fflush(stderr); + } +#endif + + r.x = x.x + y; + r.y = x.x - r.x + y + x.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddadd2_d2_d2_d(Sleef_double2 x, double y) { + Sleef_double2 r; + + r.x = x.x + y; + double v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y - v); + r.y += x.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddadd_d2_d_d2(double x, Sleef_double2 y) { + // |x| >= |y| + + Sleef_double2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y.x) || fabsk(x) >= fabsk(y.x) || (fabsk(x+y.x) <= fabsk(x) && fabsk(x+y.x) <= fabsk(y.x)))) { + fprintf(stderr, "[ddadd_d2_d_d2 : %g %g]\n", x, y.x); + fflush(stderr); + } +#endif + + r.x = x + y.x; + r.y = x - r.x + y.x + y.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddadd2_d2_d_d2(double x, Sleef_double2 y) { + Sleef_double2 r; + + r.x = x + y.x; + double v = r.x - x; + r.y = (x - (r.x - v)) + (y.x - v) + y.y; + + return r; +} + +static INLINE CONST double ddadd2_d_d_d2(double x, Sleef_double2 y) { return y.y + y.x + x; } + +static INLINE CONST Sleef_double2 ddadd_d2_d2_d2(Sleef_double2 x, Sleef_double2 y) { + // |x| >= |y| + + Sleef_double2 r; + +#ifndef NDEBUG + if (!(x.x == 0 || checkfp(x.x) || checkfp(y.x) || fabsk(x.x) >= fabsk(y.x) || (fabsk(x.x+y.x) <= fabsk(x.x) && fabsk(x.x+y.x) <= fabsk(y.x)))) { + fprintf(stderr, "[ddadd_d2_d2_d2 : %g %g]\n", x.x, y.x); + fflush(stderr); + } +#endif + + r.x = x.x + y.x; + r.y = x.x - r.x + y.x + x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddadd2_d2_d2_d2(Sleef_double2 x, Sleef_double2 y) { + Sleef_double2 r; + + r.x = x.x + y.x; + double v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y.x - v); + r.y += x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_double2 ddsub_d2_d2_d2(Sleef_double2 x, Sleef_double2 y) { + // |x| >= |y| + + Sleef_double2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || fabsk(x.x) >= fabsk(y.x) || (fabsk(x.x-y.x) <= fabsk(x.x) && fabsk(x.x-y.x) <= fabsk(y.x)))) { + fprintf(stderr, "[ddsub_d2_d2_d2 : %g %g]\n", x.x, y.x); + fflush(stderr); + } +#endif + + r.x = x.x - y.x; + r.y = x.x - r.x - y.x + x.y - y.y; + + return r; +} + +static INLINE CONST Sleef_double2 dddiv_d2_d2_d2(Sleef_double2 n, Sleef_double2 d) { + double t = 1.0 / d.x; + double dh = upper(d.x), dl = d.x - dh; + double th = upper(t ), tl = t - th; + double nhh = upper(n.x), nhl = n.x - nhh; + + Sleef_double2 q; + + q.x = n.x * t; + + double u = -q.x + nhh * th + nhh * tl + nhl * th + nhl * tl + + q.x * (1 - dh * th - dh * tl - dl * th - dl * tl); + + q.y = t * (n.y - q.x * d.y) + u; + + return q; +} + +static INLINE CONST Sleef_double2 ddmul_d2_d_d(double x, double y) { + double xh = upper(x), xl = x - xh; + double yh = upper(y), yl = y - yh; + Sleef_double2 r; + + r.x = x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl; + + return r; +} + +static INLINE CONST Sleef_double2 ddmul_d2_d2_d(Sleef_double2 x, double y) { + double xh = upper(x.x), xl = x.x - xh; + double yh = upper(y ), yl = y - yh; + Sleef_double2 r; + + r.x = x.x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.y * y; + + return r; +} + +static INLINE CONST Sleef_double2 ddmul_d2_d2_d2(Sleef_double2 x, Sleef_double2 y) { + double xh = upper(x.x), xl = x.x - xh; + double yh = upper(y.x), yl = y.x - yh; + Sleef_double2 r; + + r.x = x.x * y.x; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.x * y.y + x.y * y.x; + + return r; +} + +static INLINE CONST double ddmul_d_d2_d2(Sleef_double2 x, Sleef_double2 y) { + double xh = upper(x.x), xl = x.x - xh; + double yh = upper(y.x), yl = y.x - yh; + + return x.y * yh + xh * y.y + xl * yl + xh * yl + xl * yh + xh * yh; +} + +static INLINE CONST Sleef_double2 ddsqu_d2_d2(Sleef_double2 x) { + double xh = upper(x.x), xl = x.x - xh; + Sleef_double2 r; + + r.x = x.x * x.x; + r.y = xh * xh - r.x + (xh + xh) * xl + xl * xl + x.x * (x.y + x.y); + + return r; +} + +static INLINE CONST double ddsqu_d_d2(Sleef_double2 x) { + double xh = upper(x.x), xl = x.x - xh; + + return xh * x.y + xh * x.y + xl * xl + (xh * xl + xh * xl) + xh * xh; +} + +static INLINE CONST Sleef_double2 ddrec_d2_d(double d) { + double t = 1.0 / d; + double dh = upper(d), dl = d - dh; + double th = upper(t), tl = t - th; + Sleef_double2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl); + + return q; +} + +static INLINE CONST Sleef_double2 ddrec_d2_d2(Sleef_double2 d) { + double t = 1.0 / d.x; + double dh = upper(d.x), dl = d.x - dh; + double th = upper(t ), tl = t - th; + Sleef_double2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl - d.y * t); + + return q; +} + +static INLINE CONST Sleef_double2 ddsqrt_d2_d2(Sleef_double2 d) { + double t = SQRT(d.x + d.y); + return ddscale_d2_d2_d(ddmul_d2_d2_d2(ddadd2_d2_d2_d2(d, ddmul_d2_d_d(t, t)), ddrec_d2_d(t)), 0.5); +} + +static INLINE CONST Sleef_double2 ddsqrt_d2_d(double d) { + double t = SQRT(d); + return ddscale_d2_d2_d(ddmul_d2_d2_d2(ddadd2_d2_d_d2(d, ddmul_d2_d_d(t, t)), ddrec_d2_d(t)), 0.5); +} + +// + +static INLINE CONST double atan2k(double y, double x) { + double s, t, u; + int q = 0; + + if (x < 0) { x = -x; q = -2; } + if (y > x) { t = x; x = y; y = -t; q += 1; } + + s = y / x; + t = s * s; + + double t2 = t * t, t4 = t2 * t2, t8 = t4 * t4, t16 = t8 * t8; + u = POLY19(t, t2, t4, t8, t16, + -1.88796008463073496563746e-05, + 0.000209850076645816976906797, + -0.00110611831486672482563471, + 0.00370026744188713119232403, + -0.00889896195887655491740809, + 0.016599329773529201970117, + -0.0254517624932312641616861, + 0.0337852580001353069993897, + -0.0407629191276836500001934, + 0.0466667150077840625632675, + -0.0523674852303482457616113, + 0.0587666392926673580854313, + -0.0666573579361080525984562, + 0.0769219538311769618355029, + -0.090908995008245008229153, + 0.111111105648261418443745, + -0.14285714266771329383765, + 0.199999999996591265594148, + -0.333333333333311110369124); + + t = u * t * s + s; + t = q * (M_PI/2) + t; + + return t; +} + +EXPORT CONST double xatan2(double y, double x) { + double r = atan2k(fabsk(y), x); + + r = mulsign(r, x); + if (xisinf(x) || x == 0) r = M_PI/2 - (xisinf(x) ? (sign(x) * (M_PI /2)) : 0); + if (xisinf(y) ) r = M_PI/2 - (xisinf(x) ? (sign(x) * (M_PI*1/4)) : 0); + if ( y == 0) r = (sign(x) == -1 ? M_PI : 0); + + return xisnan(x) || xisnan(y) ? SLEEF_NAN : mulsign(r, y); +} + +EXPORT CONST double xasin(double d) { + int o = fabsk(d) < 0.5; + double x2 = o ? (d*d) : ((1-fabsk(d))*0.5), x = o ? fabsk(d) : SQRT(x2), u; + + double x4 = x2 * x2, x8 = x4 * x4, x16 = x8 * x8; + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u = mla(u, x * x2, x); + + double r = o ? u : (M_PI/2 - 2*u); + r = mulsign(r, d); + + return r; +} + +EXPORT CONST double xacos(double d) { + int o = fabsk(d) < 0.5; + double x2 = o ? (d*d) : ((1-fabsk(d))*0.5), u; + double x = o ? fabsk(d) : SQRT(x2); + x = fabsk(d) == 1.0 ? 0 : x; + + double x4 = x2 * x2, x8 = x4 * x4, x16 = x8 * x8; + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u *= x * x2; + + double y = 3.1415926535897932/2 - (mulsign(x, d) + mulsign(u, d)); + x += u; + double r = o ? y : (x*2); + if (!o && d < 0) r = ddadd_d2_d2_d(dd(3.141592653589793116, 1.2246467991473532072e-16), -r).x; + + return r; +} + +EXPORT CONST double xatan(double s) { + double t, u; + int q = 0; + + if (sign(s) == -1) { s = -s; q = 2; } + if (s > 1) { s = 1.0 / s; q |= 1; } + + t = s * s; + + double t2 = t * t, t4 = t2 * t2, t8 = t4 * t4, t16 = t8 * t8; + u = POLY19(t, t2, t4, t8, t16, + -1.88796008463073496563746e-05, + 0.000209850076645816976906797, + -0.00110611831486672482563471, + 0.00370026744188713119232403, + -0.00889896195887655491740809, + 0.016599329773529201970117, + -0.0254517624932312641616861, + 0.0337852580001353069993897, + -0.0407629191276836500001934, + 0.0466667150077840625632675, + -0.0523674852303482457616113, + 0.0587666392926673580854313, + -0.0666573579361080525984562, + 0.0769219538311769618355029, + -0.090908995008245008229153, + 0.111111105648261418443745, + -0.14285714266771329383765, + 0.199999999996591265594148, + -0.333333333333311110369124); + + t = s + s * (t * u); + + if ((q & 1) != 0) t = 1.570796326794896557998982 - t; + if ((q & 2) != 0) t = -t; + + return t; +} + +static Sleef_double2 atan2k_u1(Sleef_double2 y, Sleef_double2 x) { + double u; + Sleef_double2 s, t; + int q = 0; + + if (x.x < 0) { x.x = -x.x; x.y = -x.y; q = -2; } + if (y.x > x.x) { t = x; x = y; y.x = -t.x; y.y = -t.y; q += 1; } + + s = dddiv_d2_d2_d2(y, x); + t = ddsqu_d2_d2(s); + t = ddnormalize_d2_d2(t); + + double t2 = t.x * t.x, t4 = t2 * t2, t8 = t4 * t4; + u = POLY16(t.x, t2, t4, t8, + 1.06298484191448746607415e-05, + -0.000125620649967286867384336, + 0.00070557664296393412389774, + -0.00251865614498713360352999, + 0.00646262899036991172313504, + -0.0128281333663399031014274, + 0.0208024799924145797902497, + -0.0289002344784740315686289, + 0.0359785005035104590853656, + -0.041848579703592507506027, + 0.0470843011653283988193763, + -0.0524914210588448421068719, + 0.0587946590969581003860434, + -0.0666620884778795497194182, + 0.0769225330296203768654095, + -0.0909090442773387574781907); + u = mla(u, t.x, 0.111111108376896236538123); + u = mla(u, t.x, -0.142857142756268568062339); + u = mla(u, t.x, 0.199999999997977351284817); + u = mla(u, t.x, -0.333333333333317605173818); + + t = ddadd_d2_d2_d2(s, ddmul_d2_d2_d(ddmul_d2_d2_d2(s, t), u)); + + if (fabsk(s.x) < 1e-200) t = s; + t = ddadd2_d2_d2_d2(ddmul_d2_d2_d(dd(1.570796326794896557998982, 6.12323399573676603586882e-17), q), t); + + return t; +} + +EXPORT CONST double xatan2_u1(double y, double x) { + if (fabsk(x) < 5.5626846462680083984e-309) { y *= (UINT64_C(1) << 53); x *= (UINT64_C(1) << 53); } // nexttoward((1.0 / DBL_MAX), 1) + Sleef_double2 d = atan2k_u1(dd(fabsk(y), 0), dd(x, 0)); + double r = d.x + d.y; + + r = mulsign(r, x); + if (xisinf(x) || x == 0) r = M_PI/2 - (xisinf(x) ? (sign(x) * (M_PI /2)) : 0); + if (xisinf(y) ) r = M_PI/2 - (xisinf(x) ? (sign(x) * (M_PI*1/4)) : 0); + if ( y == 0) r = (sign(x) == -1 ? M_PI : 0); + + return xisnan(x) || xisnan(y) ? SLEEF_NAN : mulsign(r, y); +} + +EXPORT CONST double xasin_u1(double d) { + int o = fabsk(d) < 0.5; + double x2 = o ? (d*d) : ((1-fabsk(d))*0.5), u; + Sleef_double2 x = o ? dd(fabsk(d), 0) : ddsqrt_d2_d(x2); + x = fabsk(d) == 1.0 ? dd(0, 0) : x; + + double x4 = x2 * x2, x8 = x4 * x4, x16 = x8 * x8; + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u *= x2 * x.x; + + Sleef_double2 y = ddadd_d2_d2_d(ddsub_d2_d2_d2(dd(3.141592653589793116/4, 1.2246467991473532072e-16/4), x), -u); + double r = o ? (u + x.x) : ((y.x + y.y)*2); + r = mulsign(r, d); + + return r; +} + +EXPORT CONST double xacos_u1(double d) { + int o = fabsk(d) < 0.5; + double x2 = o ? (d*d) : ((1-fabsk(d))*0.5), u; + Sleef_double2 x = o ? dd(fabsk(d), 0) : ddsqrt_d2_d(x2); + x = fabsk(d) == 1.0 ? dd(0, 0) : x; + + double x4 = x2 * x2, x8 = x4 * x4, x16 = x8 * x8; + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u *= x.x * x2; + + Sleef_double2 y = ddsub_d2_d2_d2(dd(3.141592653589793116/2, 1.2246467991473532072e-16/2), + ddadd_d2_d_d(mulsign(x.x, d), mulsign(u, d))); + x = ddadd_d2_d2_d(x, u); + y = o ? y : ddscale_d2_d2_d(x, 2); + if (!o && d < 0) y = ddsub_d2_d2_d2(dd(3.141592653589793116, 1.2246467991473532072e-16), y); + + return y.x + y.y; +} + +EXPORT CONST double xatan_u1(double d) { + Sleef_double2 d2 = atan2k_u1(dd(fabsk(d), 0), dd(1, 0)); + double r = d2.x + d2.y; + if (xisinf(d)) r = 1.570796326794896557998982; + return mulsign(r, d); +} + +typedef struct { + double d; + int32_t i; +} di_t; + +typedef struct { + Sleef_double2 dd; + int32_t i; +} ddi_t; + +static INLINE CONST double orsign(double x, double y) { + return longBitsToDouble(doubleToRawLongBits(x) | (doubleToRawLongBits(y) & (INT64_C(1) << 63))); +} + +static CONST di_t rempisub(double x) { + // This function is equivalent to : + // di_t ret = { x - rint(4 * x) * 0.25, (int32_t)(rint(4 * x) - rint(x) * 4) }; + di_t ret; + double c = mulsign(INT64_C(1) << 52, x); + double rint4x = fabsk(4*x) > INT64_C(1) << 52 ? (4*x) : orsign(mla(4, x, c) - c, x); + double rintx = fabsk( x) > INT64_C(1) << 52 ? x : orsign(x + c - c , x); + ret.d = mla(-0.25, rint4x, x); + ret.i = mla(-4 , rintx , rint4x); + return ret; +} + +// Payne-Hanek like argument reduction +static CONST ddi_t rempi(double a) { + Sleef_double2 x, y; + di_t di; + int ex = ilogb2k(a) - 55, q = ex > (700-55) ? -64 : 0; + a = ldexp3k(a, q); + if (ex < 0) ex = 0; + ex *= 4; + x = ddmul_d2_d_d(a, Sleef_rempitabdp[ex]); + di = rempisub(x.x); + q = di.i; + x.x = di.d; + x = ddnormalize_d2_d2(x); + y = ddmul_d2_d_d(a, Sleef_rempitabdp[ex+1]); + x = ddadd2_d2_d2_d2(x, y); + di = rempisub(x.x); + q += di.i; + x.x = di.d; + x = ddnormalize_d2_d2(x); + y = ddmul_d2_d2_d(dd(Sleef_rempitabdp[ex+2], Sleef_rempitabdp[ex+3]), a); + x = ddadd2_d2_d2_d2(x, y); + x = ddnormalize_d2_d2(x); + x = ddmul_d2_d2_d2(x, dd(3.141592653589793116*2, 1.2246467991473532072e-16*2)); + ddi_t ret = { fabsk(a) < 0.7 ? dd(a, 0) : x, q }; + return ret; +} + +EXPORT CONST double xsin(double d) { + double u, s, t = d; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(d * M_1_PI); + d = mla(ql, -PI_A2, d); + d = mla(ql, -PI_B2, d); + } else if (fabsk(d) < TRIGRANGEMAX) { + double dqh = trunck(d * (M_1_PI / (1 << 24))) * (double)(1 << 24); + ql = rintk(mla(d, M_1_PI, -dqh)); + + d = mla(dqh, -PI_A, d); + d = mla( ql, -PI_A, d); + d = mla(dqh, -PI_B, d); + d = mla( ql, -PI_B, d); + d = mla(dqh, -PI_C, d); + d = mla( ql, -PI_C, d); + d = mla(dqh + ql, -PI_D, d); + } else { + ddi_t ddi = rempi(t); + ql = ((ddi.i & 3) * 2 + (ddi.dd.x > 0) + 1) >> 2; + if ((ddi.i & 1) != 0) { + ddi.dd = ddadd2_d2_d2_d2(ddi.dd, dd(mulsign(3.141592653589793116*-0.5, ddi.dd.x), + mulsign(1.2246467991473532072e-16*-0.5, ddi.dd.x))); + } + d = ddi.dd.x + ddi.dd.y; + if (xisinf(t) || xisnan(t)) d = SLEEF_NAN; + } + + s = d * d; + + if ((ql & 1) != 0) d = -d; + + double s2 = s * s, s4 = s2 * s2; + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = mla(u, s, -0.166666666666666657414808); + + u = mla(s, u * d, d); + + if (xisnegzero(t)) u = t; + + return u; +} + +EXPORT CONST double xsin_u1(double d) { + double u; + Sleef_double2 s, t, x; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(d * M_1_PI); + u = mla(ql, -PI_A2, d); + s = ddadd_d2_d_d (u, ql * -PI_B2); + } else if (fabsk(d) < TRIGRANGEMAX) { + const double dqh = trunck(d * (M_1_PI / (1 << 24))) * (double)(1 << 24); + ql = rintk(mla(d, M_1_PI, -dqh)); + + u = mla(dqh, -PI_A, d); + s = ddadd_d2_d_d (u, ql * -PI_A); + s = ddadd2_d2_d2_d(s, dqh * -PI_B); + s = ddadd2_d2_d2_d(s, ql * -PI_B); + s = ddadd2_d2_d2_d(s, dqh * -PI_C); + s = ddadd2_d2_d2_d(s, ql * -PI_C); + s = ddadd_d2_d2_d (s, (dqh + ql) * -PI_D); + } else { + ddi_t ddi = rempi(d); + ql = ((ddi.i & 3) * 2 + (ddi.dd.x > 0) + 1) >> 2; + if ((ddi.i & 1) != 0) { + ddi.dd = ddadd2_d2_d2_d2(ddi.dd, dd(mulsign(3.141592653589793116*-0.5, ddi.dd.x), + mulsign(1.2246467991473532072e-16*-0.5, ddi.dd.x))); + } + s = ddnormalize_d2_d2(ddi.dd); + if (xisinf(d) || xisnan(d)) s.x = SLEEF_NAN; + } + + t = s; + s = ddsqu_d2_d2(s); + + double s2 = s.x * s.x, s4 = s2 * s2; + u = POLY6(s.x, s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = mla(u, s.x, 0.00833333333333318056201922); + + x = ddadd_d2_d_d2(1, ddmul_d2_d2_d2(ddadd_d2_d_d(-0.166666666666666657414808, u * s.x), s)); + u = ddmul_d_d2_d2(t, x); + + if ((ql & 1) != 0) u = -u; + if (xisnegzero(d)) u = d; + + return u; +} + +EXPORT CONST double xcos(double d) { + double u, s, t = d; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = mla(2, rintk(d * M_1_PI - 0.5), 1); + d = mla(ql, -PI_A2*0.5, d); + d = mla(ql, -PI_B2*0.5, d); + } else if (fabsk(d) < TRIGRANGEMAX) { + double dqh = trunck(d * (M_1_PI / (INT64_C(1) << 23)) - 0.5 * (M_1_PI / (INT64_C(1) << 23))); + ql = 2*rintk(d * M_1_PI - 0.5 - dqh * (double)(INT64_C(1) << 23))+1; + dqh *= 1 << 24; + + d = mla(dqh, -PI_A*0.5, d); + d = mla( ql, -PI_A*0.5, d); + d = mla(dqh, -PI_B*0.5, d); + d = mla( ql, -PI_B*0.5, d); + d = mla(dqh, -PI_C*0.5, d); + d = mla( ql, -PI_C*0.5, d); + d = mla(dqh + ql , -PI_D*0.5, d); + } else { + ddi_t ddi = rempi(t); + ql = ((ddi.i & 3) * 2 + (ddi.dd.x > 0) + 7) >> 1; + if ((ddi.i & 1) == 0) { + ddi.dd = ddadd2_d2_d2_d2(ddi.dd, dd(mulsign(3.141592653589793116*-0.5, ddi.dd.x > 0 ? 1 : -1), + mulsign(1.2246467991473532072e-16*-0.5, ddi.dd.x > 0 ? 1 : -1))); + } + d = ddi.dd.x + ddi.dd.y; + if (xisinf(t) || xisnan(t)) d = SLEEF_NAN; + } + + s = d * d; + + if ((ql & 2) == 0) d = -d; + + double s2 = s * s, s4 = s2 * s2; + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = mla(u, s, -0.166666666666666657414808); + + u = mla(s, u * d, d); + + return u; +} + +EXPORT CONST double xcos_u1(double d) { + double u; + Sleef_double2 s, t, x; + int ql; + + d = fabsk(d); + + if (d < TRIGRANGEMAX2) { + ql = mla(2, rintk(d * M_1_PI - 0.5), 1); + s = ddadd2_d2_d_d(d, ql * (-PI_A2*0.5)); + s = ddadd_d2_d2_d(s, ql * (-PI_B2*0.5)); + } else if (d < TRIGRANGEMAX) { + double dqh = trunck(d * (M_1_PI / (INT64_C(1) << 23)) - 0.5 * (M_1_PI / (INT64_C(1) << 23))); + ql = 2*rintk(d * M_1_PI - 0.5 - dqh * (double)(INT64_C(1) << 23))+1; + dqh *= 1 << 24; + + u = mla(dqh, -PI_A*0.5, d); + s = ddadd2_d2_d_d (u, ql * (-PI_A*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_C*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_C*0.5)); + s = ddadd_d2_d2_d(s, (dqh + ql) * (-PI_D*0.5)); + } else { + ddi_t ddi = rempi(d); + ql = ((ddi.i & 3) * 2 + (ddi.dd.x > 0) + 7) >> 1; + if ((ddi.i & 1) == 0) { + ddi.dd = ddadd2_d2_d2_d2(ddi.dd, dd(mulsign(3.141592653589793116*-0.5, ddi.dd.x > 0 ? 1 : -1), + mulsign(1.2246467991473532072e-16*-0.5, ddi.dd.x > 0 ? 1 : -1))); + } + s = ddnormalize_d2_d2(ddi.dd); + if (xisinf(d) || xisnan(d)) s.x = SLEEF_NAN; + } + + t = s; + s = ddsqu_d2_d2(s); + + double s2 = s.x * s.x, s4 = s2 * s2; + u = POLY6(s.x, s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = mla(u, s.x, 0.00833333333333318056201922); + + x = ddadd_d2_d_d2(1, ddmul_d2_d2_d2(ddadd_d2_d_d(-0.166666666666666657414808, u * s.x), s)); + u = ddmul_d_d2_d2(t, x); + + if ((((int)ql) & 2) == 0) u = -u; + + return u; +} + +EXPORT CONST Sleef_double2 xsincos(double d) { + double u, s, t; + Sleef_double2 r; + int ql; + + s = d; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(s * (2 * M_1_PI)); + s = mla(ql, -PI_A2*0.5, s); + s = mla(ql, -PI_B2*0.5, s); + } else if (fabsk(d) < TRIGRANGEMAX) { + double dqh = trunck(d * ((2 * M_1_PI) / (1 << 24))) * (double)(1 << 24); + ql = rintk(d * (2 * M_1_PI) - dqh); + + s = mla(dqh, -PI_A * 0.5, s); + s = mla( ql, -PI_A * 0.5, s); + s = mla(dqh, -PI_B * 0.5, s); + s = mla( ql, -PI_B * 0.5, s); + s = mla(dqh, -PI_C * 0.5, s); + s = mla( ql, -PI_C * 0.5, s); + s = mla(dqh + ql, -PI_D * 0.5, s); + } else { + ddi_t ddi = rempi(d); + ql = ddi.i; + s = ddi.dd.x + ddi.dd.y; + if (xisinf(d) || xisnan(d)) s = SLEEF_NAN; + } + + t = s; + + s = s * s; + + u = 1.58938307283228937328511e-10; + u = mla(u, s, -2.50506943502539773349318e-08); + u = mla(u, s, 2.75573131776846360512547e-06); + u = mla(u, s, -0.000198412698278911770864914); + u = mla(u, s, 0.0083333333333191845961746); + u = mla(u, s, -0.166666666666666130709393); + u = u * s * t; + + r.x = t + u; + + if (xisnegzero(d)) r.x = -0.0; + + u = -1.13615350239097429531523e-11; + u = mla(u, s, 2.08757471207040055479366e-09); + u = mla(u, s, -2.75573144028847567498567e-07); + u = mla(u, s, 2.48015872890001867311915e-05); + u = mla(u, s, -0.00138888888888714019282329); + u = mla(u, s, 0.0416666666666665519592062); + u = mla(u, s, -0.5); + + r.y = u * s + 1; + + if ((ql & 1) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((ql & 2) != 0) { r.x = -r.x; } + if (((ql+1) & 2) != 0) { r.y = -r.y; } + + return r; +} + +EXPORT CONST Sleef_double2 xsincos_u1(double d) { + double u; + Sleef_double2 r, s, t, x; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(d * (2 * M_1_PI)); + u = mla(ql, -PI_A2*0.5, d); + s = ddadd_d2_d_d (u, ql * (-PI_B2*0.5)); + } else if (fabsk(d) < TRIGRANGEMAX) { + const double dqh = trunck(d * ((2 * M_1_PI) / (1 << 24))) * (double)(1 << 24); + ql = rintk(d * (2 * M_1_PI) - dqh); + + u = mla(dqh, -PI_A*0.5, d); + s = ddadd_d2_d_d(u, ql * (-PI_A*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_C*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_C*0.5)); + s = ddadd_d2_d2_d(s, (dqh + ql) * (-PI_D*0.5)); + } else { + ddi_t ddi = rempi(d); + ql = ddi.i; + s = ddi.dd; + if (xisinf(d) || xisnan(d)) s = dd(SLEEF_NAN, SLEEF_NAN); + } + + t = s; + + s.x = ddsqu_d_d2(s); + + u = 1.58938307283228937328511e-10; + u = mla(u, s.x, -2.50506943502539773349318e-08); + u = mla(u, s.x, 2.75573131776846360512547e-06); + u = mla(u, s.x, -0.000198412698278911770864914); + u = mla(u, s.x, 0.0083333333333191845961746); + u = mla(u, s.x, -0.166666666666666130709393); + + u *= s.x * t.x; + + x = ddadd_d2_d2_d(t, u); + r.x = x.x + x.y; + + if (xisnegzero(d)) r.x = -0.0; + + u = -1.13615350239097429531523e-11; + u = mla(u, s.x, 2.08757471207040055479366e-09); + u = mla(u, s.x, -2.75573144028847567498567e-07); + u = mla(u, s.x, 2.48015872890001867311915e-05); + u = mla(u, s.x, -0.00138888888888714019282329); + u = mla(u, s.x, 0.0416666666666665519592062); + u = mla(u, s.x, -0.5); + + x = ddadd_d2_d_d2(1, ddmul_d2_d_d(s.x, u)); + r.y = x.x + x.y; + + if ((ql & 1) != 0) { u = r.y; r.y = r.x; r.x = u; } + if ((ql & 2) != 0) { r.x = -r.x; } + if (((ql+1) & 2) != 0) { r.y = -r.y; } + + return r; +} + +EXPORT CONST Sleef_double2 xsincospi_u05(double d) { + double u, s, t; + Sleef_double2 r, x, s2; + + u = d * 4; + int q = ceilk(u) & ~(int)1; + + s = u - (double)q; + t = s; + s = s * s; + s2 = ddmul_d2_d_d(t, t); + + // + + u = -2.02461120785182399295868e-14; + u = mla(u, s, 6.94821830580179461327784e-12); + u = mla(u, s, -1.75724749952853179952664e-09); + u = mla(u, s, 3.13361688966868392878422e-07); + u = mla(u, s, -3.6576204182161551920361e-05); + u = mla(u, s, 0.00249039457019271850274356); + x = ddadd2_d2_d_d2(u * s, dd(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_d2_d2_d2(ddmul_d2_d2_d2(s2, x), dd(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_d2_d2_d(x, t); + r.x = x.x + x.y; + + if (xisnegzero(d)) r.x = -0.0; + + // + + u = 9.94480387626843774090208e-16; + u = mla(u, s, -3.89796226062932799164047e-13); + u = mla(u, s, 1.15011582539996035266901e-10); + u = mla(u, s, -2.4611369501044697495359e-08); + u = mla(u, s, 3.59086044859052754005062e-06); + u = mla(u, s, -0.000325991886927389905997954); + x = ddadd2_d2_d_d2(u * s, dd(0.0158543442438155018914259, -1.04693272280631521908845e-18)); + x = ddadd2_d2_d2_d2(ddmul_d2_d2_d2(s2, x), dd(-0.308425137534042437259529, -1.95698492133633550338345e-17)); + + x = ddadd2_d2_d2_d(ddmul_d2_d2_d2(x, s2), 1); + r.y = x.x + x.y; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (fabsk(d) > TRIGRANGEMAX3/4) { r.x = 0; r.y = 1; } + if (xisinf(d)) { r.x = r.y = SLEEF_NAN; } + + return r; +} + +EXPORT CONST Sleef_double2 xsincospi_u35(double d) { + double u, s, t; + Sleef_double2 r; + + u = d * 4; + int q = ceilk(u) & ~(int)1; + + s = u - (double)q; + t = s; + s = s * s; + + // + + u = +0.6880638894766060136e-11; + u = mla(u, s, -0.1757159564542310199e-8); + u = mla(u, s, +0.3133616327257867311e-6); + u = mla(u, s, -0.3657620416388486452e-4); + u = mla(u, s, +0.2490394570189932103e-2); + u = mla(u, s, -0.8074551218828056320e-1); + u = mla(u, s, +0.7853981633974482790e+0); + + r.x = u * t; + + // + + u = -0.3860141213683794352e-12; + u = mla(u, s, +0.1150057888029681415e-9); + u = mla(u, s, -0.2461136493006663553e-7); + u = mla(u, s, +0.3590860446623516713e-5); + u = mla(u, s, -0.3259918869269435942e-3); + u = mla(u, s, +0.1585434424381541169e-1); + u = mla(u, s, -0.3084251375340424373e+0); + u = mla(u, s, 1); + + r.y = u; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (fabsk(d) > TRIGRANGEMAX3/4) { r.x = 0; r.y = 1; } + if (xisinf(d)) { r.x = r.y = SLEEF_NAN; } + + return r; +} + +static INLINE CONST Sleef_double2 sinpik(double d) { + double u, s, t; + Sleef_double2 x, s2; + + u = d * 4; + int q = ceilk(u) & ~1; + int o = (q & 2) != 0; + + s = u - (double)q; + t = s; + s = s * s; + s2 = ddmul_d2_d_d(t, t); + + // + + u = o ? 9.94480387626843774090208e-16 : -2.02461120785182399295868e-14; + u = mla(u, s, o ? -3.89796226062932799164047e-13 : 6.94821830580179461327784e-12); + u = mla(u, s, o ? 1.15011582539996035266901e-10 : -1.75724749952853179952664e-09); + u = mla(u, s, o ? -2.4611369501044697495359e-08 : 3.13361688966868392878422e-07); + u = mla(u, s, o ? 3.59086044859052754005062e-06 : -3.6576204182161551920361e-05); + u = mla(u, s, o ? -0.000325991886927389905997954 : 0.00249039457019271850274356); + x = ddadd2_d2_d_d2(u * s, o ? dd(0.0158543442438155018914259, -1.04693272280631521908845e-18) : + dd(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_d2_d2_d2(ddmul_d2_d2_d2(s2, x), o ? dd(-0.308425137534042437259529, -1.95698492133633550338345e-17) : + dd(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_d2_d2_d2(x, o ? s2 : dd(t, 0)); + x = o ? ddadd2_d2_d2_d(x, 1) : x; + + // + + if ((q & 4) != 0) { x.x = -x.x; x.y = -x.y; } + + return x; +} + +EXPORT CONST double xsinpi_u05(double d) { + Sleef_double2 x = sinpik(d); + double r = x.x + x.y; + + if (xisnegzero(d)) r = -0.0; + if (fabsk(d) > TRIGRANGEMAX3/4) r = 0; + if (xisinf(d)) r = SLEEF_NAN; + + return r; +} + +static INLINE CONST Sleef_double2 cospik(double d) { + double u, s, t; + Sleef_double2 x, s2; + + u = d * 4; + int q = ceilk(u) & ~1; + int o = (q & 2) == 0; + + s = u - (double)q; + t = s; + s = s * s; + s2 = ddmul_d2_d_d(t, t); + + // + + u = o ? 9.94480387626843774090208e-16 : -2.02461120785182399295868e-14; + u = mla(u, s, o ? -3.89796226062932799164047e-13 : 6.94821830580179461327784e-12); + u = mla(u, s, o ? 1.15011582539996035266901e-10 : -1.75724749952853179952664e-09); + u = mla(u, s, o ? -2.4611369501044697495359e-08 : 3.13361688966868392878422e-07); + u = mla(u, s, o ? 3.59086044859052754005062e-06 : -3.6576204182161551920361e-05); + u = mla(u, s, o ? -0.000325991886927389905997954 : 0.00249039457019271850274356); + x = ddadd2_d2_d_d2(u * s, o ? dd(0.0158543442438155018914259, -1.04693272280631521908845e-18) : + dd(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_d2_d2_d2(ddmul_d2_d2_d2(s2, x), o ? dd(-0.308425137534042437259529, -1.95698492133633550338345e-17) : + dd(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_d2_d2_d2(x, o ? s2 : dd(t, 0)); + x = o ? ddadd2_d2_d2_d(x, 1) : x; + + // + + if (((q+2) & 4) != 0) { x.x = -x.x; x.y = -x.y; } + + return x; +} + +EXPORT CONST double xcospi_u05(double d) { + Sleef_double2 x = cospik(d); + double r = x.x + x.y; + + if (fabsk(d) > TRIGRANGEMAX3/4) r = 1; + if (xisinf(d)) r = SLEEF_NAN; + + return r; +} + +EXPORT CONST double xtan(double d) { + double u, s, x, y; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(d * (2 * M_1_PI)); + x = mla(ql, -PI_A2*0.5, d); + x = mla(ql, -PI_B2*0.5, x); + } else if (fabsk(d) < 1e+6) { + double dqh = trunck(d * ((2 * M_1_PI) / (1 << 24))) * (double)(1 << 24); + ql = rintk(d * (2 * M_1_PI) - dqh); + + x = mla(dqh, -PI_A * 0.5, d); + x = mla( ql, -PI_A * 0.5, x); + x = mla(dqh, -PI_B * 0.5, x); + x = mla( ql, -PI_B * 0.5, x); + x = mla(dqh, -PI_C * 0.5, x); + x = mla( ql, -PI_C * 0.5, x); + x = mla(dqh + ql, -PI_D * 0.5, x); + } else { + ddi_t ddi = rempi(d); + ql = ddi.i; + x = ddi.dd.x + ddi.dd.y; + if (xisinf(d) || xisnan(d)) x = SLEEF_NAN; + } + + x *= 0.5; + s = x * x; + + double s2 = s * s, s4 = s2 * s2; + u = POLY8(s, s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = mla(u, s, +0.3333333333333343695e+0); + u = mla(s, u * x, x); + + y = mla(u, u, -1); + x = -2 * u; + + if ((ql & 1) != 0) { double t = x; x = y; y = -t; } + + u = x / y; + + return u; +} + +EXPORT CONST double xtan_u1(double d) { + double u; + Sleef_double2 s, t, x, y; + int ql; + + if (fabsk(d) < TRIGRANGEMAX2) { + ql = rintk(d * (2 * M_1_PI)); + u = mla(ql, -PI_A2*0.5, d); + s = ddadd_d2_d_d(u, ql * (-PI_B2*0.5)); + } else if (fabsk(d) < TRIGRANGEMAX) { + const double dqh = trunck(d * (M_2_PI / (1 << 24))) * (double)(1 << 24); + s = ddadd2_d2_d2_d(ddmul_d2_d2_d(dd(M_2_PI_H, M_2_PI_L), d), (d < 0 ? -0.5 : 0.5) - dqh); + ql = s.x + s.y; + + u = mla(dqh, -PI_A*0.5, d); + s = ddadd_d2_d_d (u, ql * (-PI_A*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_B*0.5)); + s = ddadd2_d2_d2_d(s, dqh * (-PI_C*0.5)); + s = ddadd2_d2_d2_d(s, ql * (-PI_C*0.5)); + s = ddadd_d2_d2_d(s, (dqh + ql) * (-PI_D*0.5)); + } else { + ddi_t ddi = rempi(d); + ql = ddi.i; + s = ddi.dd; + if (xisinf(d) || xisnan(d)) s.x = SLEEF_NAN; + } + + t = ddscale_d2_d2_d(s, 0.5); + s = ddsqu_d2_d2(t); + + double s2 = s.x * s.x, s4 = s2 * s2; + u = POLY8(s.x, s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = mla(u, s.x, +0.3333333333333343695e+0); + x = ddadd_d2_d2_d2(t, ddmul_d2_d2_d(ddmul_d2_d2_d2(s, t), u)); + + y = ddadd_d2_d_d2(-1, ddsqu_d2_d2(x)); + x = ddscale_d2_d2_d(x, -2); + + if ((ql & 1) != 0) { t = x; x = y; y = ddneg_d2_d2(t); } + + x = dddiv_d2_d2_d2(x, y); + + u = x.x + x.y; + + if (xisnegzero(d)) u = d; + + return u; +} + +EXPORT CONST double xlog(double d) { + double x, x2, t, m; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = (m-1) / (m+1); + x2 = x * x; + + double x4 = x2 * x2, x8 = x4 * x4; + + t = POLY7(x2, x4, x8, + 0.153487338491425068243146, + 0.152519917006351951593857, + 0.181863266251982985677316, + 0.222221366518767365905163, + 0.285714294746548025383248, + 0.399999999950799600689777, + 0.6666666666667778740063); + + x = x * 2 + 0.693147180559945286226764 * e + x * x2 * t; + + if (xisinf(d)) x = SLEEF_INFINITY; + if (d < 0 || xisnan(d)) x = SLEEF_NAN; + if (d == 0) x = -SLEEF_INFINITY; + + return x; +} + +EXPORT CONST double xexp(double d) { + int q = (int)rintk(d * R_LN2); + double s, u; + + s = mla(q, -L2U, d); + s = mla(q, -L2L, s); + + double s2 = s * s, s4 = s2 * s2, s8 = s4 * s4; + u = POLY10(s, s2, s4, s8, + 2.08860621107283687536341e-09, + 2.51112930892876518610661e-08, + 2.75573911234900471893338e-07, + 2.75572362911928827629423e-06, + 2.4801587159235472998791e-05, + 0.000198412698960509205564975, + 0.00138888888889774492207962, + 0.00833333333331652721664984, + 0.0416666666666665047591422, + 0.166666666666666851703837); + u = mla(u, s, +0.5); + + u = s * s * u + s + 1; + u = ldexp2k(u, q); + + if (d > 709.78271114955742909217217426) u = SLEEF_INFINITY; + if (d < -1000) u = 0; + + return u; +} + +static INLINE CONST double expm1k(double d) { + int q = (int)rintk(d * R_LN2); + double s, u; + + s = mla(q, -L2U, d); + s = mla(q, -L2L, s); + + double s2 = s * s, s4 = s2 * s2, s8 = s4 * s4; + u = POLY10(s, s2, s4, s8, + 2.08860621107283687536341e-09, + 2.51112930892876518610661e-08, + 2.75573911234900471893338e-07, + 2.75572362911928827629423e-06, + 2.4801587159235472998791e-05, + 0.000198412698960509205564975, + 0.00138888888889774492207962, + 0.00833333333331652721664984, + 0.0416666666666665047591422, + 0.166666666666666851703837); + + u = mla(s2, 0.5, s2 * s * u) + s; + + if (q != 0) u = ldexp2k(u + 1, q) - 1; + + return u; +} + +static INLINE CONST Sleef_double2 logk(double d) { + Sleef_double2 x, x2, s; + double m, t; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = dddiv_d2_d2_d2(ddadd2_d2_d_d(-1, m), ddadd2_d2_d_d(1, m)); + x2 = ddsqu_d2_d2(x); + + double x4 = x2.x * x2.x, x8 = x4 * x4, x16 = x8 * x8; + t = POLY9(x2.x, x4, x8, x16, + 0.116255524079935043668677, + 0.103239680901072952701192, + 0.117754809412463995466069, + 0.13332981086846273921509, + 0.153846227114512262845736, + 0.181818180850050775676507, + 0.222222222230083560345903, + 0.285714285714249172087875, + 0.400000000000000077715612); + + Sleef_double2 c = dd(0.666666666666666629659233, 3.80554962542412056336616e-17); + s = ddmul_d2_d2_d(dd(0.693147180559945286226764, 2.319046813846299558417771e-17), e); + s = ddadd_d2_d2_d2(s, ddscale_d2_d2_d(x, 2)); + x = ddmul_d2_d2_d2(x2, x); + s = ddadd_d2_d2_d2(s, ddmul_d2_d2_d2(x, c)); + x = ddmul_d2_d2_d2(x2, x); + s = ddadd_d2_d2_d2(s, ddmul_d2_d2_d(x, t)); + + return s; +} + +EXPORT CONST double xlog_u1(double d) { + Sleef_double2 x, s; + double m, t, x2; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = dddiv_d2_d2_d2(ddadd2_d2_d_d(-1, m), ddadd2_d2_d_d(1, m)); + x2 = x.x * x.x; + + double x4 = x2 * x2, x8 = x4 * x4; + t = POLY7(x2, x4, x8, + 0.1532076988502701353e+0, + 0.1525629051003428716e+0, + 0.1818605932937785996e+0, + 0.2222214519839380009e+0, + 0.2857142932794299317e+0, + 0.3999999999635251990e+0, + 0.6666666666667333541e+0); + + s = ddmul_d2_d2_d(dd(0.693147180559945286226764, 2.319046813846299558417771e-17), (double)e); + s = ddadd_d2_d2_d2(s, ddscale_d2_d2_d(x, 2)); + s = ddadd_d2_d2_d(s, x2 * x.x * t); + + double r = s.x + s.y; + + if (xisinf(d)) r = SLEEF_INFINITY; + if (d < 0 || xisnan(d)) r = SLEEF_NAN; + if (d == 0) r = -SLEEF_INFINITY; + + return r; +} + +static INLINE CONST double expk(Sleef_double2 d) { + int q = (int)rintk((d.x + d.y) * R_LN2); + Sleef_double2 s, t; + double u; + + s = ddadd2_d2_d2_d(d, q * -L2U); + s = ddadd2_d2_d2_d(s, q * -L2L); + + s = ddnormalize_d2_d2(s); + + double s2 = s.x * s.x, s4 = s2 * s2, s8 = s4 * s4; + u = POLY10(s.x, s2, s4, s8, + 2.51069683420950419527139e-08, + 2.76286166770270649116855e-07, + 2.75572496725023574143864e-06, + 2.48014973989819794114153e-05, + 0.000198412698809069797676111, + 0.0013888888939977128960529, + 0.00833333333332371417601081, + 0.0416666666665409524128449, + 0.166666666666666740681535, + 0.500000000000000999200722); + + t = ddadd_d2_d_d2(1, s); + t = ddadd_d2_d2_d2(t, ddmul_d2_d2_d(ddsqu_d2_d2(s), u)); + + u = ldexpk(t.x + t.y, q); + + if (d.x < -1000) u = 0; + + return u; +} + +EXPORT CONST double xpow(double x, double y) { + int yisint = xisint(y); + int yisodd = yisint && xisodd(y); + + Sleef_double2 d = ddmul_d2_d2_d(logk(fabsk(x)), y); + double result = expk(d); + + result = (d.x > 709.78271114955742909217217426 || xisnan(result)) ? SLEEF_INFINITY : result; + result *= (x > 0 ? 1 : (yisint ? (yisodd ? -1 : 1) : SLEEF_NAN)); + + double efx = mulsign(fabsk(x) - 1, y); + if (xisinf(y)) result = efx < 0 ? 0.0 : (efx == 0 ? 1.0 : SLEEF_INFINITY); + if (xisinf(x) || x == 0) result = mulsign((xsignbit(y) ^ (x == 0)) ? 0 : SLEEF_INFINITY, yisodd ? x : 1); + if (xisnan(x) || xisnan(y)) result = SLEEF_NAN; + if (y == 0 || x == 1) result = 1; + + return result; +} + +static INLINE CONST Sleef_double2 expk2(Sleef_double2 d) { + int q = (int)rintk((d.x + d.y) * R_LN2); + Sleef_double2 s, t; + double u; + + s = ddadd2_d2_d2_d(d, q * -L2U); + s = ddadd2_d2_d2_d(s, q * -L2L); + + u = +0.1602472219709932072e-9; + u = mla(u, s.x, +0.2092255183563157007e-8); + u = mla(u, s.x, +0.2505230023782644465e-7); + u = mla(u, s.x, +0.2755724800902135303e-6); + u = mla(u, s.x, +0.2755731892386044373e-5); + u = mla(u, s.x, +0.2480158735605815065e-4); + u = mla(u, s.x, +0.1984126984148071858e-3); + u = mla(u, s.x, +0.1388888888886763255e-2); + u = mla(u, s.x, +0.8333333333333347095e-2); + u = mla(u, s.x, +0.4166666666666669905e-1); + + t = ddadd2_d2_d2_d(ddmul_d2_d2_d(s, u), +0.1666666666666666574e+0); + t = ddadd2_d2_d2_d(ddmul_d2_d2_d2(s, t), 0.5); + t = ddadd2_d2_d2_d2(s, ddmul_d2_d2_d2(ddsqu_d2_d2(s), t)); + + t = ddadd2_d2_d_d2(1, t); + + t.x = ldexp2k(t.x, q); + t.y = ldexp2k(t.y, q); + + return d.x < -1000 ? dd(0, 0) : t; +} + +EXPORT CONST double xsinh(double x) { + double y = fabsk(x); + Sleef_double2 d = expk2(dd(y, 0)); + d = ddsub_d2_d2_d2(d, ddrec_d2_d2(d)); + y = (d.x + d.y) * 0.5; + + y = fabsk(x) > 710 ? SLEEF_INFINITY : y; + y = xisnan(y) ? SLEEF_INFINITY : y; + y = mulsign(y, x); + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xcosh(double x) { + double y = fabsk(x); + Sleef_double2 d = expk2(dd(y, 0)); + d = ddadd_d2_d2_d2(d, ddrec_d2_d2(d)); + y = (d.x + d.y) * 0.5; + + y = fabsk(x) > 710 ? SLEEF_INFINITY : y; + y = xisnan(y) ? SLEEF_INFINITY : y; + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xtanh(double x) { + double y = fabsk(x); + Sleef_double2 d = expk2(dd(y, 0)); + Sleef_double2 e = ddrec_d2_d2(d); + d = dddiv_d2_d2_d2(ddsub_d2_d2_d2(d, e), ddadd_d2_d2_d2(d, e)); + y = d.x + d.y; + + y = fabsk(x) > 18.714973875 ? 1.0 : y; + y = xisnan(y) ? 1.0 : y; + y = mulsign(y, x); + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xsinh_u35(double x) { + double e = expm1k(fabsk(x)); + double y = (e + 2) / (e + 1) * (0.5 * e); + + y = fabsk(x) > 709 ? SLEEF_INFINITY : y; + y = xisnan(y) ? SLEEF_INFINITY : y; + y = mulsign(y, x); + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xcosh_u35(double x) { + double e = xexp(fabsk(x)); + double y = 0.5 / e + 0.5 * e; + + y = fabsk(x) > 709 ? SLEEF_INFINITY : y; + y = xisnan(y) ? SLEEF_INFINITY : y; + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xtanh_u35(double x) { + double y = fabsk(x); + double d = expm1k(2*y); + y = d / (d + 2); + + y = fabsk(x) > 18.714973875 ? 1.0 : y; + y = xisnan(y) ? 1.0 : y; + y = mulsign(y, x); + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +static INLINE CONST Sleef_double2 logk2(Sleef_double2 d) { + Sleef_double2 x, x2, m, s; + double t; + int e; + + e = ilogbk(d.x * (1.0/0.75)); + + m.x = ldexp2k(d.x, -e); + m.y = ldexp2k(d.y, -e); + + x = dddiv_d2_d2_d2(ddadd2_d2_d2_d(m, -1), ddadd2_d2_d2_d(m, 1)); + x2 = ddsqu_d2_d2(x); + + double x4 = x2.x * x2.x, x8 = x4 * x4; + t = POLY7(x2.x, x4, x8, + 0.13860436390467167910856, + 0.131699838841615374240845, + 0.153914168346271945653214, + 0.181816523941564611721589, + 0.22222224632662035403996, + 0.285714285511134091777308, + 0.400000000000914013309483); + t = mla(t, x2.x, 0.666666666666664853302393); + + s = ddmul_d2_d2_d(dd(0.693147180559945286226764, 2.319046813846299558417771e-17), e); + s = ddadd_d2_d2_d2(s, ddscale_d2_d2_d(x, 2)); + s = ddadd_d2_d2_d2(s, ddmul_d2_d2_d(ddmul_d2_d2_d2(x2, x), t)); + + return s; +} + +EXPORT CONST double xasinh(double x) { + double y = fabsk(x); + Sleef_double2 d; + + d = y > 1 ? ddrec_d2_d(x) : dd(y, 0); + d = ddsqrt_d2_d2(ddadd2_d2_d2_d(ddsqu_d2_d2(d), 1)); + d = y > 1 ? ddmul_d2_d2_d(d, y) : d; + + d = logk2(ddnormalize_d2_d2(ddadd_d2_d2_d(d, x))); + y = d.x + d.y; + + y = (fabsk(x) > SQRT_DBL_MAX || xisnan(y)) ? mulsign(SLEEF_INFINITY, x) : y; + y = xisnan(x) ? SLEEF_NAN : y; + y = xisnegzero(x) ? -0.0 : y; + + return y; +} + +EXPORT CONST double xacosh(double x) { + Sleef_double2 d = logk2(ddadd2_d2_d2_d(ddmul_d2_d2_d2(ddsqrt_d2_d2(ddadd2_d2_d_d(x, 1)), ddsqrt_d2_d2(ddadd2_d2_d_d(x, -1))), x)); + double y = d.x + d.y; + + y = (x > SQRT_DBL_MAX || xisnan(y)) ? SLEEF_INFINITY : y; + y = x == 1.0 ? 0.0 : y; + y = x < 1.0 ? SLEEF_NAN : y; + y = xisnan(x) ? SLEEF_NAN : y; + + return y; +} + +EXPORT CONST double xatanh(double x) { + double y = fabsk(x); + Sleef_double2 d = logk2(dddiv_d2_d2_d2(ddadd2_d2_d_d(1, y), ddadd2_d2_d_d(1, -y))); + y = y > 1.0 ? SLEEF_NAN : (y == 1.0 ? SLEEF_INFINITY : (d.x + d.y) * 0.5); + + y = mulsign(y, x); + y = (xisinf(x) || xisnan(y)) ? SLEEF_NAN : y; + + return y; +} + +// + +EXPORT CONST double xcbrt(double d) { // max error : 2 ulps + double x, y, q = 1.0; + int e, r; + + e = ilogbk(fabsk(d))+1; + d = ldexp2k(d, -e); + r = (e + 6144) % 3; + q = (r == 1) ? 1.2599210498948731647672106 : q; + q = (r == 2) ? 1.5874010519681994747517056 : q; + q = ldexp2k(q, (e + 6144) / 3 - 2048); + + q = mulsign(q, d); + d = fabsk(d); + + x = -0.640245898480692909870982; + x = mla(x, d, 2.96155103020039511818595); + x = mla(x, d, -5.73353060922947843636166); + x = mla(x, d, 6.03990368989458747961407); + x = mla(x, d, -3.85841935510444988821632); + x = mla(x, d, 2.2307275302496609725722); + + y = x * x; y = y * y; x -= (d * y - x) * (1.0 / 3.0); + y = d * x * x; + y = (y - (2.0 / 3.0) * y * (y * x - 1)) * q; + + return y; +} + +EXPORT CONST double xcbrt_u1(double d) { + double x, y, z; + Sleef_double2 q2 = dd(1, 0), u, v; + int e, r; + + e = ilogbk(fabsk(d))+1; + d = ldexp2k(d, -e); + r = (e + 6144) % 3; + q2 = (r == 1) ? dd(1.2599210498948731907, -2.5899333753005069177e-17) : q2; + q2 = (r == 2) ? dd(1.5874010519681995834, -1.0869008194197822986e-16) : q2; + + q2.x = mulsign(q2.x, d); q2.y = mulsign(q2.y, d); + d = fabsk(d); + + x = -0.640245898480692909870982; + x = mla(x, d, 2.96155103020039511818595); + x = mla(x, d, -5.73353060922947843636166); + x = mla(x, d, 6.03990368989458747961407); + x = mla(x, d, -3.85841935510444988821632); + x = mla(x, d, 2.2307275302496609725722); + + y = x * x; y = y * y; x -= (d * y - x) * (1.0 / 3.0); + + z = x; + + u = ddmul_d2_d_d(x, x); + u = ddmul_d2_d2_d2(u, u); + u = ddmul_d2_d2_d(u, d); + u = ddadd2_d2_d2_d(u, -x); + y = u.x + u.y; + + y = -2.0 / 3.0 * y * z; + v = ddadd2_d2_d2_d(ddmul_d2_d_d(z, z), y); + v = ddmul_d2_d2_d(v, d); + v = ddmul_d2_d2_d2(v, q2); + z = ldexp2k(v.x + v.y, (e + 6144) / 3 - 2048); + + if (xisinf(d)) { z = mulsign(SLEEF_INFINITY, q2.x); } + if (d == 0) { z = mulsign(0, q2.x); } + + return z; +} + +EXPORT CONST double xexp2(double d) { + int q = (int)rintk(d); + double s, u; + + s = d - q; + + double s2 = s * s, s4 = s2 * s2, s8 = s4 * s4; + u = POLY10(s, s2, s4, s8, + +0.4434359082926529454e-9, + +0.7073164598085707425e-8, + +0.1017819260921760451e-6, + +0.1321543872511327615e-5, + +0.1525273353517584730e-4, + +0.1540353045101147808e-3, + +0.1333355814670499073e-2, + +0.9618129107597600536e-2, + +0.5550410866482046596e-1, + +0.2402265069591012214e+0); + u = mla(u, s, +0.6931471805599452862e+0); + + u = ddnormalize_d2_d2(ddadd_d2_d_d2(1, ddmul_d2_d_d(u, s))).x; + + u = ldexp2k(u, q); + + if (d >= 1024) u = SLEEF_INFINITY; + if (d < -2000) u = 0; + + return u; +} + +EXPORT CONST double xexp2_u35(double d) { + int q = (int)rintk(d); + double s, u; + + s = d - q; + + u = +0.4434359082926529454e-9; + u = mla(u, s, +0.7073164598085707425e-8); + u = mla(u, s, +0.1017819260921760451e-6); + u = mla(u, s, +0.1321543872511327615e-5); + u = mla(u, s, +0.1525273353517584730e-4); + u = mla(u, s, +0.1540353045101147808e-3); + u = mla(u, s, +0.1333355814670499073e-2); + u = mla(u, s, +0.9618129107597600536e-2); + u = mla(u, s, +0.5550410866482046596e-1); + u = mla(u, s, +0.2402265069591012214e+0); + u = mla(u, s, +0.6931471805599452862e+0); + u = mla(u, s, +0.1000000000000000000e+1); + + u = ldexp2k(u, q); + + if (d >= 1024) u = SLEEF_INFINITY; + if (d < -2000) u = 0; + + return u; +} + +EXPORT CONST double xexp10(double d) { + int q = (int)rintk(d * LOG10_2); + double s, u; + + s = mla(q, -L10U, d); + s = mla(q, -L10L, s); + + u = +0.2411463498334267652e-3; + u = mla(u, s, +0.1157488415217187375e-2); + u = mla(u, s, +0.5013975546789733659e-2); + u = mla(u, s, +0.1959762320720533080e-1); + u = mla(u, s, +0.6808936399446784138e-1); + u = mla(u, s, +0.2069958494722676234e+0); + u = mla(u, s, +0.5393829292058536229e+0); + u = mla(u, s, +0.1171255148908541655e+1); + u = mla(u, s, +0.2034678592293432953e+1); + u = mla(u, s, +0.2650949055239205876e+1); + u = mla(u, s, +0.2302585092994045901e+1); + + u = ddnormalize_d2_d2(ddadd_d2_d_d2(1, ddmul_d2_d_d(u, s))).x; + + u = ldexp2k(u, q); + + if (d > 308.25471555991671) u = SLEEF_INFINITY; // log10(DBL_MAX) + if (d < -350) u = 0; + + return u; +} + +EXPORT CONST double xexp10_u35(double d) { + int q = (int)rintk(d * LOG10_2); + double s, u; + + s = mla(q, -L10U, d); + s = mla(q, -L10L, s); + + u = +0.2411463498334267652e-3; + u = mla(u, s, +0.1157488415217187375e-2); + u = mla(u, s, +0.5013975546789733659e-2); + u = mla(u, s, +0.1959762320720533080e-1); + u = mla(u, s, +0.6808936399446784138e-1); + u = mla(u, s, +0.2069958494722676234e+0); + u = mla(u, s, +0.5393829292058536229e+0); + u = mla(u, s, +0.1171255148908541655e+1); + u = mla(u, s, +0.2034678592293432953e+1); + u = mla(u, s, +0.2650949055239205876e+1); + u = mla(u, s, +0.2302585092994045901e+1); + u = mla(u, s, +0.1000000000000000000e+1); + + u = ldexp2k(u, q); + + if (d > 308.25471555991671) u = SLEEF_INFINITY; + if (d < -350) u = 0; + + return u; +} + +EXPORT CONST double xexpm1(double a) { + Sleef_double2 d = ddadd2_d2_d2_d(expk2(dd(a, 0)), -1.0); + double x = d.x + d.y; + if (a > 709.782712893383996732223) x = SLEEF_INFINITY; // log(DBL_MAX) + if (a < -36.736800569677101399113302437) x = -1; // log(1 - nexttoward(1, 0)) + if (xisnegzero(a)) x = -0.0; + return x; +} + +EXPORT CONST double xlog10(double d) { + Sleef_double2 x, s; + double m, t, x2; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = dddiv_d2_d2_d2(ddadd2_d2_d_d(-1, m), ddadd2_d2_d_d(1, m)); + x2 = x.x * x.x; + + double x4 = x2 * x2, x8 = x4 * x4; + t = POLY7(x2, x4, x8, + +0.6653725819576758460e-1, + +0.6625722782820833712e-1, + +0.7898105214313944078e-1, + +0.9650955035715275132e-1, + +0.1240841409721444993e+0, + +0.1737177927454605086e+0, + +0.2895296546021972617e+0); + + s = ddmul_d2_d2_d(dd(0.30102999566398119802, -2.803728127785170339e-18), (double)e); + s = ddadd_d2_d2_d2(s, ddmul_d2_d2_d2(x, dd(0.86858896380650363334, 1.1430059694096389311e-17))); + s = ddadd_d2_d2_d(s, x2 * x.x * t); + + double r = s.x + s.y; + + if (xisinf(d)) r = SLEEF_INFINITY; + if (d < 0 || xisnan(d)) r = SLEEF_NAN; + if (d == 0) r = -SLEEF_INFINITY; + + return r; +} + +EXPORT CONST double xlog2(double d) { + Sleef_double2 x, s; + double m, t, x2; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = dddiv_d2_d2_d2(ddadd2_d2_d_d(-1, m), ddadd2_d2_d_d(1, m)); + x2 = x.x * x.x; + + double x4 = x2 * x2, x8 = x4 * x4; + t = POLY7(x2, x4, x8, + +0.2211941750456081490e+0, + +0.2200768693152277689e+0, + +0.2623708057488514656e+0, + +0.3205977477944495502e+0, + +0.4121985945485324709e+0, + +0.5770780162997058982e+0, + +0.96179669392608091449); + + s = ddadd2_d2_d_d2(e, ddmul_d2_d2_d2(x, dd(2.885390081777926774, 6.0561604995516736434e-18))); + s = ddadd2_d2_d2_d(s, x2 * x.x * t); + + double r = s.x + s.y; + + if (xisinf(d)) r = SLEEF_INFINITY; + if (d < 0 || xisnan(d)) r = SLEEF_NAN; + if (d == 0) r = -SLEEF_INFINITY; + + return r; +} + +EXPORT CONST double xlog2_u35(double d) { + double m, t, x, x2; + int e; + + int o = d < DBL_MIN; + if (o) d *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(d * (1.0/0.75)); + m = ldexp3k(d, -e); + + if (o) e -= 64; + + x = (m - 1) / (m + 1); + x2 = x * x; + + t = +0.2211941750456081490e+0; + t = mla(t, x2, +0.2200768693152277689e+0); + t = mla(t, x2, +0.2623708057488514656e+0); + t = mla(t, x2, +0.3205977477944495502e+0); + t = mla(t, x2, +0.4121985945485324709e+0); + t = mla(t, x2, +0.5770780162997058982e+0); + t = mla(t, x2, +0.96179669392608091449 ); + + Sleef_double2 s = ddadd_d2_d_d2(e, ddmul_d2_d_d(2.885390081777926774, x)); + double r = mla(t, x * x2, s.x + s.y); + + if (xisinf(d)) r = SLEEF_INFINITY; + if (d < 0 || xisnan(d)) r = SLEEF_NAN; + if (d == 0) r = -SLEEF_INFINITY; + + return r; +} + +EXPORT CONST double xlog1p(double d) { + Sleef_double2 x, s; + double m, t, x2; + int e; + + double dp1 = d + 1; + + int o = dp1 < DBL_MIN; + if (o) dp1 *= (double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32); + + e = ilogb2k(dp1 * (1.0/0.75)); + + t = ldexp3k(1, -e); + m = mla(d, t, t - 1); + + if (o) e -= 64; + + x = dddiv_d2_d2_d2(dd(m, 0), ddadd_d2_d_d(2, m)); + x2 = x.x * x.x; + + double x4 = x2 * x2, x8 = x4 * x4; + t = POLY7(x2, x4, x8, + 0.1532076988502701353e+0, + 0.1525629051003428716e+0, + 0.1818605932937785996e+0, + 0.2222214519839380009e+0, + 0.2857142932794299317e+0, + 0.3999999999635251990e+0, + 0.6666666666667333541e+0); + + s = ddmul_d2_d2_d(dd(0.693147180559945286226764, 2.319046813846299558417771e-17), (double)e); + s = ddadd_d2_d2_d2(s, ddscale_d2_d2_d(x, 2)); + s = ddadd_d2_d2_d(s, x2 * x.x * t); + + double r = s.x + s.y; + + if (d > 1e+307) r = SLEEF_INFINITY; + if (d < -1 || xisnan(d)) r = SLEEF_NAN; + if (d == -1) r = -SLEEF_INFINITY; + if (xisnegzero(d)) r = -0.0; + + return r; +} + +// + +EXPORT CONST double xfma(double x, double y, double z) { + double h2 = x * y + z, q = 1; + if (fabsk(h2) < 1e-300) { + const double c0 = UINT64_C(1) << 54, c1 = c0 * c0, c2 = c1 * c1; + x *= c1; + y *= c1; + z *= c2; + q = 1.0 / c2; + } + if (fabsk(h2) > 1e+299) { + const double c0 = UINT64_C(1) << 54, c1 = c0 * c0, c2 = c1 * c1; + x *= 1.0 / c1; + y *= 1.0 / c1; + z *= 1. / c2; + q = c2; + } + Sleef_double2 d = ddmul_d2_d_d(x, y); + d = ddadd2_d2_d2_d(d, z); + double ret = (x == 0 || y == 0) ? z : (d.x + d.y); + if ((xisinf(z) && !xisinf(x) && !xisnan(x) && !xisinf(y) && !xisnan(y))) h2 = z; + return (xisinf(h2) || xisnan(h2)) ? h2 : ret*q; +} + +EXPORT CONST double xsqrt_u05(double d) { + double q = 0.5; + + d = d < 0 ? SLEEF_NAN : d; + + if (d < 8.636168555094445E-78) { + d *= 1.157920892373162E77; + q = 2.9387358770557188E-39 * 0.5; + } + + if (d > 1.3407807929942597e+154) { + d *= 7.4583407312002070e-155; + q = 1.1579208923731620e+77 * 0.5; + } + + // http://en.wikipedia.org/wiki/Fast_inverse_square_root + double x = longBitsToDouble(0x5fe6ec85e7de30da - (doubleToRawLongBits(d + 1e-320) >> 1)); + + x = x * (1.5 - 0.5 * d * x * x); + x = x * (1.5 - 0.5 * d * x * x); + x = x * (1.5 - 0.5 * d * x * x) * d; + + Sleef_double2 d2 = ddmul_d2_d2_d2(ddadd2_d2_d_d2(d, ddmul_d2_d_d(x, x)), ddrec_d2_d(x)); + + double ret = (d2.x + d2.y) * q; + + ret = d == SLEEF_INFINITY ? SLEEF_INFINITY : ret; + ret = d == 0 ? d : ret; + + return ret; +} + +EXPORT CONST double xsqrt_u35(double d) { return xsqrt_u05(d); } +EXPORT CONST double xsqrt(double d) { return SQRT(d); } + +EXPORT CONST double xfabs(double x) { return fabsk(x); } + +EXPORT CONST double xcopysign(double x, double y) { return copysignk(x, y); } + +EXPORT CONST double xfmax(double x, double y) { + return y != y ? x : (x > y ? x : y); +} + +EXPORT CONST double xfmin(double x, double y) { + return y != y ? x : (x < y ? x : y); +} + +EXPORT CONST double xfdim(double x, double y) { + double ret = x - y; + if (ret < 0 || x == y) ret = 0; + return ret; +} + +EXPORT CONST double xtrunc(double x) { + double fr = x - (double)(INT64_C(1) << 31) * (int32_t)(x * (1.0 / (INT64_C(1) << 31))); + fr = fr - (int32_t)fr; + return (xisinf(x) || fabsk(x) >= (double)(INT64_C(1) << 52)) ? x : copysignk(x - fr, x); +} + +EXPORT CONST double xfloor(double x) { + double fr = x - (double)(INT64_C(1) << 31) * (int32_t)(x * (1.0 / (INT64_C(1) << 31))); + fr = fr - (int32_t)fr; + fr = fr < 0 ? fr+1.0 : fr; + return (xisinf(x) || fabsk(x) >= (double)(INT64_C(1) << 52)) ? x : copysignk(x - fr, x); +} + +EXPORT CONST double xceil(double x) { + double fr = x - (double)(INT64_C(1) << 31) * (int32_t)(x * (1.0 / (INT64_C(1) << 31))); + fr = fr - (int32_t)fr; + fr = fr <= 0 ? fr : fr-1.0; + return (xisinf(x) || fabsk(x) >= (double)(INT64_C(1) << 52)) ? x : copysignk(x - fr, x); +} + +EXPORT CONST double xround(double d) { + double x = d + 0.5; + double fr = x - (double)(INT64_C(1) << 31) * (int32_t)(x * (1.0 / (INT64_C(1) << 31))); + fr = fr - (int32_t)fr; + if (fr == 0 && x <= 0) x--; + fr = fr < 0 ? fr+1.0 : fr; + x = d == 0.49999999999999994449 ? 0 : x; // nextafter(0.5, 0) + return (xisinf(d) || fabsk(d) >= (double)(INT64_C(1) << 52)) ? d : copysignk(x - fr, d); +} + +EXPORT CONST double xrint(double d) { + double c = mulsign(INT64_C(1) << 52, d); + return fabsk(d) > INT64_C(1) << 52 ? d : orsign(d + c - c, d); +} + +EXPORT CONST double xhypot_u05(double x, double y) { + x = fabsk(x); + y = fabsk(y); + double min = fmink(x, y), n = min; + double max = fmaxk(x, y), d = max; + + if (max < DBL_MIN) { n *= UINT64_C(1) << 54; d *= UINT64_C(1) << 54; } + Sleef_double2 t = dddiv_d2_d2_d2(dd(n, 0), dd(d, 0)); + t = ddmul_d2_d2_d(ddsqrt_d2_d2(ddadd2_d2_d2_d(ddsqu_d2_d2(t), 1)), max); + double ret = t.x + t.y; + if (xisnan(ret)) ret = SLEEF_INFINITY; + if (min == 0) ret = max; + if (xisnan(x) || xisnan(y)) ret = SLEEF_NAN; + if (x == SLEEF_INFINITY || y == SLEEF_INFINITY) ret = SLEEF_INFINITY; + return ret; +} + +EXPORT CONST double xhypot_u35(double x, double y) { + x = fabsk(x); + y = fabsk(y); + double min = fmink(x, y); + double max = fmaxk(x, y); + + double t = min / max; + double ret = max * SQRT(1 + t*t); + if (min == 0) ret = max; + if (xisnan(x) || xisnan(y)) ret = SLEEF_NAN; + if (x == SLEEF_INFINITY || y == SLEEF_INFINITY) ret = SLEEF_INFINITY; + return ret; +} + +EXPORT CONST double xnextafter(double x, double y) { + double cxf; + int64_t cxi; + + x = x == 0 ? mulsign(0, y) : x; + cxf = x; + memcpy(&cxi, &cxf, sizeof(cxi)); + + int c = (cxi < 0) == (y < x); + if (c) cxi = -(cxi ^ (int64_t)(UINT64_C(1) << 63)); + + if (x != y) cxi--; + + if (c) cxi = -(cxi ^ (int64_t)(UINT64_C(1) << 63)); + + memcpy(&cxf, &cxi, sizeof(cxf)); + if (cxf == 0 && x != 0) cxf = mulsign(0, x); + if (x == 0 && y == 0) cxf = y; + if (xisnan(x) || xisnan(y)) cxf = SLEEF_NAN; + + return cxf; +} + +EXPORT CONST double xfrfrexp(double x) { + double cxf; + uint64_t cxu; + + if (fabsk(x) < DBL_MIN) x *= (UINT64_C(1) << 63); + + cxf = x; + memcpy(&cxu, &cxf, sizeof(cxu)); + + cxu &= ~UINT64_C(0x7ff0000000000000); + cxu |= UINT64_C(0x3fe0000000000000); + + memcpy(&cxf, &cxu, sizeof(cxf)); + if (xisinf(x)) cxf = mulsign(SLEEF_INFINITY, x); + if (x == 0) cxf = x; + + return cxf; +} + +EXPORT CONST int xexpfrexp(double x) { + double cxf; + uint64_t cxu; + + int ret = 0; + + if (fabsk(x) < DBL_MIN) { x *= (UINT64_C(1) << 63); ret = -63; } + + cxf = x; + memcpy(&cxu, &cxf, sizeof(cxu)); + + ret += (int32_t)(((cxu >> 52) & 0x7ff)) - 0x3fe; + + if (x == 0 || xisnan(x) || xisinf(x)) ret = 0; + + return ret; +} + +static INLINE CONST double toward0(double d) { + return d == 0 ? 0 : longBitsToDouble(doubleToRawLongBits(d)-1); +} + +static INLINE CONST double removelsb(double d) { + return longBitsToDouble(doubleToRawLongBits(d) & INT64_C(0xfffffffffffffffe)); +} + +static INLINE CONST double ptrunc(double x) { + double fr = mla(-(double)(INT64_C(1) << 31), (int32_t)(x * (1.0 / (INT64_C(1) << 31))), x); + return fabsk(x) >= (double)(INT64_C(1) << 52) ? x : (x - (fr - (int32_t)fr)); +} + +EXPORT CONST double xfmod(double x, double y) { + double n = fabsk(x), d = fabsk(y), s = 1, q; + if (d < DBL_MIN) { n *= UINT64_C(1) << 54; d *= UINT64_C(1) << 54; s = 1.0 / (UINT64_C(1) << 54); } + Sleef_double2 r = dd(n, 0); + double rd = toward0(1.0 / d); + + for(int i=0;i < 21;i++) { // ceil(log2(DBL_MAX) / 52) + q = removelsb(ptrunc(toward0(r.x) * rd)); + q = (3*d > r.x && r.x > d) ? 2 : q; + q = (2*d > r.x && r.x > d) ? 1 : q; + q = r.x == d ? (r.y >= 0 ? 1 : 0) : q; + r = ddnormalize_d2_d2(ddadd2_d2_d2_d2(r, ddmul_d2_d_d(q, -d))); + if (r.x < d) break; + } + + double ret = r.x * s; + if (r.x + r.y == d) ret = 0; + ret = mulsign(ret, x); + if (n < d) ret = x; + if (d == 0) ret = SLEEF_NAN; + + return ret; +} + +static INLINE CONST double rintk2(double d) { + double c = mulsign(INT64_C(1) << 52, d); + return fabsk(d) > INT64_C(1) << 52 ? d : orsign(d + c - c, d); +} + +EXPORT CONST double xremainder(double x, double y) { + double n = fabsk(x), d = fabsk(y), s = 1, q; + if (d < DBL_MIN*2) { n *= UINT64_C(1) << 54; d *= UINT64_C(1) << 54; s = 1.0 / (UINT64_C(1) << 54); } + double rd = 1.0 / d; + Sleef_double2 r = dd(n, 0); + int qisodd = 0; + + for(int i=0;i < 21;i++) { // ceil(log2(DBL_MAX) / 52) + q = removelsb(rintk2(r.x * rd)); + if (fabsk(r.x) < 1.5 * d) q = r.x < 0 ? -1 : 1; + if (fabsk(r.x) < 0.5 * d || (fabsk(r.x) == 0.5 * d && !qisodd)) q = 0; + if (q == 0) break; + if (xisinf(q * -d)) q = q + mulsign(-1, r.x); + qisodd ^= xisodd(q); + r = ddnormalize_d2_d2(ddadd2_d2_d2_d2(r, ddmul_d2_d_d(q, -d))); + } + + double ret = r.x * s; + ret = mulsign(ret, x); + if (xisinf(y)) ret = xisinf(x) ? SLEEF_NAN : x; + if (d == 0) ret = SLEEF_NAN; + + return ret; +} + +EXPORT CONST Sleef_double2 xmodf(double x) { + double fr = x - (double)(INT64_C(1) << 31) * (int32_t)(x * (1.0 / (INT64_C(1) << 31))); + fr = fr - (int32_t)fr; + fr = fabsk(x) >= (double)(INT64_C(1) << 52) ? 0 : fr; + Sleef_double2 ret = { copysignk(fr, x), copysignk(x - fr, x) }; + return ret; +} + +typedef struct { + Sleef_double2 a, b; +} dd2; + +static CONST dd2 gammak(double a) { + Sleef_double2 clc = dd(0, 0), clln = dd(1, 0), clld = dd(1, 0), x, y, z; + double t, u; + + int otiny = fabsk(a) < 1e-306, oref = a < 0.5; + + x = otiny ? dd(0, 0) : (oref ? ddadd2_d2_d_d(1, -a) : dd(a, 0)); + + int o0 = (0.5 <= x.x && x.x <= 1.1), o2 = 2.3 < x.x; + + y = ddnormalize_d2_d2(ddmul_d2_d2_d2(ddadd2_d2_d2_d(x, 1), x)); + y = ddnormalize_d2_d2(ddmul_d2_d2_d2(ddadd2_d2_d2_d(x, 2), y)); + y = ddnormalize_d2_d2(ddmul_d2_d2_d2(ddadd2_d2_d2_d(x, 3), y)); + y = ddnormalize_d2_d2(ddmul_d2_d2_d2(ddadd2_d2_d2_d(x, 4), y)); + + clln = (o2 && x.x <= 7) ? y : clln; + + x = (o2 && x.x <= 7) ? ddadd2_d2_d2_d(x, 5) : x; + t = o2 ? (1.0 / x.x) : ddnormalize_d2_d2(ddadd2_d2_d2_d(x, o0 ? -1 : -2)).x; + + u = o2 ? -156.801412704022726379848862 : (o0 ? +0.2947916772827614196e+2 : +0.7074816000864609279e-7); + u = mla(u, t, o2 ? +1.120804464289911606838558160000 : (o0 ? +0.1281459691827820109e+3 : +0.4009244333008730443e-6)); + u = mla(u, t, o2 ? +13.39798545514258921833306020000 : (o0 ? +0.2617544025784515043e+3 : +0.1040114641628246946e-5)); + u = mla(u, t, o2 ? -0.116546276599463200848033357000 : (o0 ? +0.3287022855685790432e+3 : +0.1508349150733329167e-5)); + u = mla(u, t, o2 ? -1.391801093265337481495562410000 : (o0 ? +0.2818145867730348186e+3 : +0.1288143074933901020e-5)); + u = mla(u, t, o2 ? +0.015056113040026424412918973400 : (o0 ? +0.1728670414673559605e+3 : +0.4744167749884993937e-6)); + u = mla(u, t, o2 ? +0.179540117061234856098844714000 : (o0 ? +0.7748735764030416817e+2 : -0.6554816306542489902e-7)); + u = mla(u, t, o2 ? -0.002481743600264997730942489280 : (o0 ? +0.2512856643080930752e+2 : -0.3189252471452599844e-6)); + u = mla(u, t, o2 ? -0.029527880945699120504851034100 : (o0 ? +0.5766792106140076868e+1 : +0.1358883821470355377e-6)); + u = mla(u, t, o2 ? +0.000540164767892604515196325186 : (o0 ? +0.7270275473996180571e+0 : -0.4343931277157336040e-6)); + u = mla(u, t, o2 ? +0.006403362833808069794787256200 : (o0 ? +0.8396709124579147809e-1 : +0.9724785897406779555e-6)); + u = mla(u, t, o2 ? -0.000162516262783915816896611252 : (o0 ? -0.8211558669746804595e-1 : -0.2036886057225966011e-5)); + u = mla(u, t, o2 ? -0.001914438498565477526465972390 : (o0 ? +0.6828831828341884458e-1 : +0.4373363141819725815e-5)); + u = mla(u, t, o2 ? +7.20489541602001055898311517e-05 : (o0 ? -0.7712481339961671511e-1 : -0.9439951268304008677e-5)); + u = mla(u, t, o2 ? +0.000839498720672087279971000786 : (o0 ? +0.8337492023017314957e-1 : +0.2050727030376389804e-4)); + u = mla(u, t, o2 ? -5.17179090826059219329394422e-05 : (o0 ? -0.9094964931456242518e-1 : -0.4492620183431184018e-4)); + u = mla(u, t, o2 ? -0.000592166437353693882857342347 : (o0 ? +0.1000996313575929358e+0 : +0.9945751236071875931e-4)); + u = mla(u, t, o2 ? +6.97281375836585777403743539e-05 : (o0 ? -0.1113342861544207724e+0 : -0.2231547599034983196e-3)); + u = mla(u, t, o2 ? +0.000784039221720066627493314301 : (o0 ? +0.1255096673213020875e+0 : +0.5096695247101967622e-3)); + u = mla(u, t, o2 ? -0.000229472093621399176949318732 : (o0 ? -0.1440498967843054368e+0 : -0.1192753911667886971e-2)); + u = mla(u, t, o2 ? -0.002681327160493827160473958490 : (o0 ? +0.1695571770041949811e+0 : +0.2890510330742210310e-2)); + u = mla(u, t, o2 ? +0.003472222222222222222175164840 : (o0 ? -0.2073855510284092762e+0 : -0.7385551028674461858e-2)); + u = mla(u, t, o2 ? +0.083333333333333333335592087900 : (o0 ? +0.2705808084277815939e+0 : +0.2058080842778455335e-1)); + + y = ddmul_d2_d2_d2(ddadd2_d2_d2_d(x, -0.5), logk2(x)); + y = ddadd2_d2_d2_d2(y, ddneg_d2_d2(x)); + y = ddadd2_d2_d2_d2(y, dd(0.91893853320467278056, -3.8782941580672414498e-17)); // 0.5*log(2*M_PI) + + z = ddadd2_d2_d2_d(ddmul_d2_d_d (u, t), o0 ? -0.4006856343865314862e+0 : -0.6735230105319810201e-1); + z = ddadd2_d2_d2_d(ddmul_d2_d2_d(z, t), o0 ? +0.8224670334241132030e+0 : +0.3224670334241132030e+0); + z = ddadd2_d2_d2_d(ddmul_d2_d2_d(z, t), o0 ? -0.5772156649015328655e+0 : +0.4227843350984671345e+0); + z = ddmul_d2_d2_d(z, t); + + clc = o2 ? y : z; + + clld = o2 ? ddadd2_d2_d2_d(ddmul_d2_d_d(u, t), 1) : clld; + + y = clln; + + clc = otiny ? dd(83.1776616671934334590333, 3.67103459631568507221878e-15) : // log(2^120) + (oref ? ddadd2_d2_d2_d2(dd(1.1447298858494001639, 1.026595116270782638e-17), ddneg_d2_d2(clc)) : clc); // log(M_PI) + clln = otiny ? dd(1, 0) : (oref ? clln : clld); + + if (oref) x = ddmul_d2_d2_d2(clld, sinpik(a - (double)(INT64_C(1) << 28) * (int32_t)(a * (1.0 / (INT64_C(1) << 28))))); + + clld = otiny ? dd(a*((INT64_C(1) << 60)*(double)(INT64_C(1) << 60)), 0) : (oref ? x : y); + + dd2 ret = { clc, dddiv_d2_d2_d2(clln, clld) }; + + return ret; +} + +EXPORT CONST double xtgamma_u1(double a) { + dd2 d = gammak(a); + Sleef_double2 y = ddmul_d2_d2_d2(expk2(d.a), d.b); + double r = y.x + y.y; + r = (a == -SLEEF_INFINITY || (a < 0 && xisint(a)) || (xisnumber(a) && a < 0 && xisnan(r))) ? SLEEF_NAN : r; + r = ((a == SLEEF_INFINITY || xisnumber(a)) && a >= -DBL_MIN && (a == 0 || a > 200 || xisnan(r))) ? mulsign(SLEEF_INFINITY, a) : r; + return r; +} + +EXPORT CONST double xlgamma_u1(double a) { + dd2 d = gammak(a); + Sleef_double2 y = ddadd2_d2_d2_d2(d.a, logk2(ddabs_d2_d2(d.b))); + double r = y.x + y.y; + r = (xisinf(a) || (a <= 0 && xisint(a)) || (xisnumber(a) && xisnan(r))) ? SLEEF_INFINITY : r; + return r; +} + +static INLINE CONST Sleef_double2 ddmla(double x, Sleef_double2 y, Sleef_double2 z) { + return ddadd2_d2_d2_d2(z, ddmul_d2_d2_d(y, x)); +} +static INLINE CONST Sleef_double2 poly2dd_b(double x, Sleef_double2 c1, Sleef_double2 c0) { return ddmla(x, c1, c0); } +static INLINE CONST Sleef_double2 poly2dd(double x, double c1, Sleef_double2 c0) { return ddmla(x, dd(c1, 0), c0); } +static INLINE CONST Sleef_double2 poly4dd(double x, double c3, Sleef_double2 c2, Sleef_double2 c1, Sleef_double2 c0) { + return ddmla(x*x, poly2dd(x, c3, c2), poly2dd_b(x, c1, c0)); +} + +EXPORT CONST double xerf_u1(double a) { + double t, x = fabsk(a); + Sleef_double2 t2; + double x2 = x * x, x4 = x2 * x2, x8 = x4 * x4, x16 = x8 * x8; + + if (x < 2.5) { + // Abramowitz and Stegun + t = POLY21(x, x2, x4, x8, x16, + -0.2083271002525222097e-14, + +0.7151909970790897009e-13, + -0.1162238220110999364e-11, + +0.1186474230821585259e-10, + -0.8499973178354613440e-10, + +0.4507647462598841629e-9, + -0.1808044474288848915e-8, + +0.5435081826716212389e-8, + -0.1143939895758628484e-7, + +0.1215442362680889243e-7, + +0.1669878756181250355e-7, + -0.9808074602255194288e-7, + +0.1389000557865837204e-6, + +0.2945514529987331866e-6, + -0.1842918273003998283e-5, + +0.3417987836115362136e-5, + +0.3860236356493129101e-5, + -0.3309403072749947546e-4, + +0.1060862922597579532e-3, + +0.2323253155213076174e-3, + +0.1490149719145544729e-3); + t2 = poly4dd(x, t, + dd(0.0092877958392275604405, 7.9287559463961107493e-19), + dd(0.042275531758784692937, 1.3785226620501016138e-19), + dd(0.07052369794346953491, 9.5846628070792092842e-19)); + t2 = ddadd_d2_d_d2(1, ddmul_d2_d2_d(t2, x)); + t2 = ddsqu_d2_d2(t2); + t2 = ddsqu_d2_d2(t2); + t2 = ddsqu_d2_d2(t2); + t2 = ddsqu_d2_d2(t2); + t2 = ddrec_d2_d2(t2); + } else if (x > 6.0) { + t2 = dd(0, 0); + } else { + t = POLY21(x, x2, x4, x8, x16, + -0.4024015130752621932e-18, + +0.3847193332817048172e-16, + -0.1749316241455644088e-14, + +0.5029618322872872715e-13, + -0.1025221466851463164e-11, + +0.1573695559331945583e-10, + -0.1884658558040203709e-9, + +0.1798167853032159309e-8, + -0.1380745342355033142e-7, + +0.8525705726469103499e-7, + -0.4160448058101303405e-6, + +0.1517272660008588485e-5, + -0.3341634127317201697e-5, + -0.2515023395879724513e-5, + +0.6539731269664907554e-4, + -0.3551065097428388658e-3, + +0.1210736097958368864e-2, + -0.2605566912579998680e-2, + +0.1252823202436093193e-2, + +0.1820191395263313222e-1, + -0.1021557155453465954e+0); + t2 = poly4dd(x, t, + dd(-0.63691044383641748361, -2.4249477526539431839e-17), + dd(-1.1282926061803961737, -6.2970338860410996505e-17), + dd(-1.2261313785184804967e-05, -5.5329707514490107044e-22)); + t2 = dd(expk(t2), 0); + } + + t2 = ddadd2_d2_d2_d(t2, -1); + + if (x < 1e-8) t2 = dd(-1.12837916709551262756245475959 * x, 0); + return mulsign(a == 0 ? 0 : (xisinf(a) ? 1 : (-t2.x - t2.y)), a); +} + +EXPORT CONST double xerfc_u15(double a) { + double s = a, r = 0, t; + Sleef_double2 u, d, x; + a = fabsk(a); + int o0 = a < 1.0, o1 = a < 2.2, o2 = a < 4.2, o3 = a < 27.3; + u = o0 ? ddmul_d2_d_d(a, a) : o1 ? dd(a, 0) : dddiv_d2_d2_d2(dd(1, 0), dd(a, 0)); + + t = o0 ? +0.6801072401395386139e-20 : o1 ? +0.3438010341362585303e-12 : o2 ? -0.5757819536420710449e+2 : +0.2334249729638701319e+5; + t = mla(t, u.x, o0 ? -0.2161766247570055669e-18 : o1 ? -0.1237021188160598264e-10 : o2 ? +0.4669289654498104483e+3 : -0.4695661044933107769e+5); + t = mla(t, u.x, o0 ? +0.4695919173301595670e-17 : o1 ? +0.2117985839877627852e-09 : o2 ? -0.1796329879461355858e+4 : +0.3173403108748643353e+5); + t = mla(t, u.x, o0 ? -0.9049140419888007122e-16 : o1 ? -0.2290560929177369506e-08 : o2 ? +0.4355892193699575728e+4 : +0.3242982786959573787e+4); + t = mla(t, u.x, o0 ? +0.1634018903557410728e-14 : o1 ? +0.1748931621698149538e-07 : o2 ? -0.7456258884965764992e+4 : -0.2014717999760347811e+5); + t = mla(t, u.x, o0 ? -0.2783485786333451745e-13 : o1 ? -0.9956602606623249195e-07 : o2 ? +0.9553977358167021521e+4 : +0.1554006970967118286e+5); + t = mla(t, u.x, o0 ? +0.4463221276786415752e-12 : o1 ? +0.4330010240640327080e-06 : o2 ? -0.9470019905444229153e+4 : -0.6150874190563554293e+4); + t = mla(t, u.x, o0 ? -0.6711366622850136563e-11 : o1 ? -0.1435050600991763331e-05 : o2 ? +0.7387344321849855078e+4 : +0.1240047765634815732e+4); + t = mla(t, u.x, o0 ? +0.9422759050232662223e-10 : o1 ? +0.3460139479650695662e-05 : o2 ? -0.4557713054166382790e+4 : -0.8210325475752699731e+2); + t = mla(t, u.x, o0 ? -0.1229055530100229098e-08 : o1 ? -0.4988908180632898173e-05 : o2 ? +0.2207866967354055305e+4 : +0.3242443880839930870e+2); + t = mla(t, u.x, o0 ? +0.1480719281585086512e-07 : o1 ? -0.1308775976326352012e-05 : o2 ? -0.8217975658621754746e+3 : -0.2923418863833160586e+2); + t = mla(t, u.x, o0 ? -0.1636584469123399803e-06 : o1 ? +0.2825086540850310103e-04 : o2 ? +0.2268659483507917400e+3 : +0.3457461732814383071e+0); + t = mla(t, u.x, o0 ? +0.1646211436588923575e-05 : o1 ? -0.6393913713069986071e-04 : o2 ? -0.4633361260318560682e+2 : +0.5489730155952392998e+1); + t = mla(t, u.x, o0 ? -0.1492565035840623511e-04 : o1 ? -0.2566436514695078926e-04 : o2 ? +0.9557380123733945965e+1 : +0.1559934132251294134e-2); + t = mla(t, u.x, o0 ? +0.1205533298178967851e-03 : o1 ? +0.5895792375659440364e-03 : o2 ? -0.2958429331939661289e+1 : -0.1541741566831520638e+1); + t = mla(t, u.x, o0 ? -0.8548327023450850081e-03 : o1 ? -0.1695715579163588598e-02 : o2 ? +0.1670329508092765480e+0 : +0.2823152230558364186e-5); + t = mla(t, u.x, o0 ? +0.5223977625442187932e-02 : o1 ? +0.2089116434918055149e-03 : o2 ? +0.6096615680115419211e+0 : +0.6249999184195342838e+0); + t = mla(t, u.x, o0 ? -0.2686617064513125222e-01 : o1 ? +0.1912855949584917753e-01 : o2 ? +0.1059212443193543585e-2 : +0.1741749416408701288e-8); + + d = ddmul_d2_d2_d(u, t); + d = ddadd2_d2_d2_d2(d, o0 ? dd(0.11283791670955126141, -4.0175691625932118483e-18) : + o1 ? dd(-0.10277263343147646779, -6.2338714083404900225e-18) : + o2 ? dd(-0.50005180473999022439, 2.6362140569041995803e-17) : + dd(-0.5000000000258444377, -4.0074044712386992281e-17)); + d = ddmul_d2_d2_d2(d, u); + d = ddadd2_d2_d2_d2(d, o0 ? dd(-0.37612638903183753802, 1.3391897206042552387e-17) : + o1 ? dd(-0.63661976742916359662, 7.6321019159085724662e-18) : + o2 ? dd(1.601106273924963368e-06, 1.1974001857764476775e-23) : + dd(2.3761973137523364792e-13, -1.1670076950531026582e-29)); + d = ddmul_d2_d2_d2(d, u); + d = ddadd2_d2_d2_d2(d, o0 ? dd(1.1283791670955125586, 1.5335459613165822674e-17) : + o1 ? dd(-1.1283791674717296161, 8.0896847755965377194e-17) : + o2 ? dd(-0.57236496645145429341, 3.0704553245872027258e-17) : + dd(-0.57236494292470108114, -2.3984352208056898003e-17)); + + x = ddmul_d2_d2_d(o1 ? d : dd(-a, 0), a); + x = o1 ? x : ddadd2_d2_d2_d2(x, d); + x = o0 ? ddsub_d2_d2_d2(dd(1, 0), x) : expk2(x); + x = o1 ? x : ddmul_d2_d2_d2(x, u); + + r = o3 ? (x.x + x.y) : 0; + if (s < 0) r = 2 - r; + r = xisnan(s) ? SLEEF_NAN : r; + return r; +} + +#ifdef ENABLE_MAIN +// gcc -w -DENABLE_MAIN -I../common sleefdp.c rempitab.c -lm +#include +int main(int argc, char **argv) { + double d1 = atof(argv[1]); + printf("arg1 = %.20g\n", d1); + //int i1 = atoi(argv[1]); + //double d2 = atof(argv[2]); + //printf("arg2 = %.20g\n", d2); + //printf("%d\n", (int)d2); +#if 0 + double d3 = atof(argv[3]); + printf("arg3 = %.20g\n", d3); +#endif + //printf("%g\n", pow2i(i1)); + //int exp = xexpfrexp(d1); + //double r = xnextafter(d1, d2); + //double r = xfma(d1, d2, d3); + printf("test = %.20g\n", xcos_u1(d1)); + //printf("test = %.20g\n", xlog(d1)); + //r = nextafter(d1, d2); + printf("corr = %.20g\n", cos(d1)); + //printf("%.20g %.20g\n", xround(d1), xrint(d1)); + //Sleef_double2 r = xsincospi_u35(d); + //printf("%g, %g\n", (double)r.x, (double)r.y); +} +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_cuda_header.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_cuda_header.h.org new file mode 100644 index 0000000000000..c129f4ec297c9 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_cuda_header.h.org @@ -0,0 +1,1094 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF SLEEF_VERSION_SLEEF + +// Use --fmad=false option to compile this file +// Include cmath, cfloat and cstdint before including this file + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +__device__ const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, +}; + +__device__ const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_header.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_header.h.org new file mode 100644 index 0000000000000..a2cb471e7f6aa --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefinline_header.h.org @@ -0,0 +1,1120 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF SLEEF_VERSION_SLEEF + +#ifndef SLEEF_ALWAYS_INLINE +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_ALWAYS_INLINE inline __forceinline +#else +#define SLEEF_ALWAYS_INLINE inline +#endif +#endif + +#ifndef SLEEF_INLINE +#define SLEEF_INLINE static inline +#endif + +#ifndef SLEEF_CONST +#define SLEEF_CONST +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#define SLEEFINLINE_SLEEF_SIMD_SLEEF_H_INCLUDED + +#ifndef __SLEEF_REMPITAB__ +#define __SLEEF_REMPITAB__ +static const double Sleef_rempitabdp[] = { + 0.15915494309189531785, 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.03415494309189533173, 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.0029049430918953351999, 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.496415728504571394e-51, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00095181809189533563356, 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762436344e-52, + 0.00046353684189533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 0.00021939621689533574198, 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.301187206862134399e-54, + 9.7325904395335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 3.6290748145335769087e-05, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.7731700203357690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 1.9584727547107690874e-06, -2.0362228529073840241e-22, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 5.1124121898268875627e-08, 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369025999e-57, + 2.1321799510573569745e-08, 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369025999e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 6.4206383167259151492e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 2.6953480182640010867e-09, -1.3585460269359374382e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 8.3270286903304384868e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 3.6704158172530459087e-10, 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, + 1.3421093807143501366e-10, 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.7795616244500218596e-11, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 3.2437010161333667893e-12, -1.452834466126541428e-28, -1.5869767474823787636e-44, -2.6168913164368963837e-61, + 1.4247116125875099096e-12, 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, + 5.1521691081458187359e-13, 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 6.0469559928117805118e-14, 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 3.6261410673097965595e-15, -1.3304005198798645927e-31, -1.7578597149294783985e-47, 8.4432539107728104262e-64, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 7.3427388509295482183e-17, 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659578102e-65, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 1.7916237278037667488e-17, 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 4.0384494702232122736e-18, 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188129325e-66, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 5.6900251826959904774e-19, 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 1.3532164927539732229e-19, -6.4410794381603004826e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 2.6901432026846872871e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.3348904870778067446e-20, -4.2254836195018827479e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 6.5726412927436632287e-21, 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.5887057810247033998e-68, + 3.1845095037264626247e-21, 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 1.4904436092178623228e-21, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 6.4341066196356198368e-22, -4.6390169687056261795e-38, -1.1392999419355048437e-54, -4.587677453735884283e-71, + 2.1989418833641172011e-22, 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 8.135951522836682362e-24, 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 1.5185066224124613304e-24, 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 6.9132600985943383921e-25, 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, + 2.7773570358292009361e-25, -1.3244127270701094468e-41, -2.4695541513869446866e-57, -3.2399200798614356002e-74, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 7.0940550444663151936e-26, 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.9241762160098927996e-26, 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.317065088957874881e-27, -3.2976062348358281152e-43, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 3.0858908211726098086e-27, 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524896742e-75, + 1.4703036872799779898e-27, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.625101203336619011e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 2.5861333686050385673e-28, 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 5.6664945123924856962e-29, 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.1778471897801070206e-30, 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 3.0224035688960604996e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 1.4446817584540368888e-30, 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008290615e-78, + 6.5582085323302525856e-31, 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639313137e-79, + 2.6139040062251944343e-31, -1.7578597149294783985e-47, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 6.4175174317266470186e-32, 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371102229e-79, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 1.4871367740953237822e-32, -1.1571307704883330232e-48, -6.7249112515659569668e-65, -7.2335760163150273591e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.5454160968749269937e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 1.0046721413651383112e-33, 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 2.3430016361024414106e-34, 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 4.1707169171520598517e-35, -2.4964157285045710972e-51, -1.866653112309982615e-67, 1.4185069655957361252e-83, + 1.7633044866680145008e-35, 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 5.595982714259923599e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 2.5867171761548675786e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 1.0820844071023395684e-36, 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085140685e-84, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 3.2976802257607573031e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 1.4168892644450972904e-37, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 4.7649378378726728402e-38, 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280944778e-86, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 6.2960434583523738135e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 2.6226236120327253511e-40, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 7.8591368887290111994e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 3.2673620808294506214e-41, 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.524218473063975309e-90, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 9.7147467687967058732e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.9750282589222551507e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 1.1051690039850297894e-42, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 3.8770419025072344914e-43, 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257943935e-91, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.8971783383570358633e-44, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 6.5510079543732854985e-45, -2.6168913164368963837e-61, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 9.4581409707401690366e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 2.451648649116083682e-46, 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 7.0002556871006273225e-47, 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.5355611056488084652e-94, + 2.6211979860855749482e-47, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 4.3166913557804827486e-48, 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, + 1.5797802926460750146e-48, 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 2.1132476107887107169e-49, 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 4.0267819632970559834e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 1.8885701952232994665e-50, -7.8013829534098555144e-67, -1.1759240463442418271e-82, 2.8738690232659205689e-99, + 8.1946431118642097069e-51, 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, + 2.8491136916798196016e-51, 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 1.7634898158762432635e-52, 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142808004e-99, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 9.3011872068621332399e-54, 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, + 4.0809436324633147776e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.470821845263904967e-54, -4.587677453735884283e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 1.6576095166419998917e-55, 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630537605e-103, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 2.6283399642369020339e-57, 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.145584788913072936e-105, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 7.9392906424978921242e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 3.9565608646667614317e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 1.9651959757511960854e-59, 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.554706987098633963e-107, + 9.6951353129341363331e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 4.7167230906452229674e-60, 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, + 2.2275169795007668372e-60, 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, + 9.8291392392853877215e-61, -6.5385728340754726503e-77, -1.3520652573660833788e-93, -2.3220403312043059402e-109, + 3.6061239614242446325e-61, 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 4.9461632249367446986e-62, 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 1.0567786762735315635e-62, -6.1446417754639301152e-79, -1.535561105648808199e-94, -1.9306041120023063932e-110, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 8.4432539107728090768e-64, 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514358328e-112, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 2.3660905534865399025e-64, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.4679971416497210292e-65, -7.2335760163150273591e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 8.7154294504188118783e-66, 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 3.9676455775389135587e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 1.5937536410989638719e-66, 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 4.0680767287898916022e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 1.1007118082399544936e-67, 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894110579e-116, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 3.588705781024702988e-68, 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, + 1.7341027056809927069e-68, 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418876704e-116, + 8.0680116800913756637e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 3.4315039917320989315e-69, -2.2809159455312046184e-85, -4.0748824503880445403e-101, -6.3915272253158644628e-117, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 1.113250147552460308e-69, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 5.3368668650755071652e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 2.4390495598509592076e-70, 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, + 9.901409072386855505e-71, -2.8859500138942368532e-87, -5.6567402911297190423e-103, -4.6672632026740766185e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 2.6568658093254848067e-71, 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 8.4572999356014273536e-72, 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, + 3.9294603961880721752e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 1.6655406264813940833e-72, 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894729832e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 5.3358074162805516304e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.5059077041472040156e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 1.0909578480805302081e-73, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 3.8348292004719330442e-74, 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598455046e-121, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 2.9745456030524891833e-75, 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.6368645294831185015e-76, 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 2.1097166542226745549e-76, 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 7.2792968540756372162e-77, 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 3.7036201000008285821e-78, 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251472933e-126, + 1.5445779612272179051e-78, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 4.6505689184041232695e-79, 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251472933e-126, + 1.9517662449371099233e-79, 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 6.0236490820360325022e-80, -3.7424672147304925625e-96, -1.784871512364483542e-112, 6.7095375687163151728e-129, + 2.6501457402022643213e-80, 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, + 9.6339406928538097998e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.2001823382693912203e-81, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.459625439463388979e-82, 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 1.4185069655957361252e-83, -7.8369062883735917115e-100, -1.9081236411894107761e-116, -2.1796760241698337334e-132, + 5.9489775128085131541e-84, 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 1.830931441234090934e-84, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 8.0141992334048515034e-85, 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247800778e-132, + 2.8666416439368237283e-85, 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 2.9286284920280941206e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 1.3200167453193350837e-86, 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, + 5.1571087196495574384e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.1355793528776598461e-87, 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 1.3019701118468578292e-88, -7.5747169634236195447e-105, -2.0152904854894725532e-121, -3.1562414818576682143e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 4.5242184730639744369e-90, 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852683481e-137, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 5.969437008257942845e-91, 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534162772e-139, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.0603435429602168369e-91, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 4.4670685979800101779e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 1.3988851821689310822e-92, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 6.3183932821616130831e-93, 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591188256e-141, + 2.4831640123977650651e-93, 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007823264e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 5.6554937751584084315e-94, -1.9306041120023063932e-110, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 8.6145718795359707834e-95, 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.62202614552995759e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 1.1238897120284541253e-95, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 3.7482149527770239293e-96, 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868987041e-145, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 2.8738690232659205689e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.0450891972142805974e-99, 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.3069928418846076386e-100, 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.5448727249069983612e-148, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.6400545060233297363e-101, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 2.1132026692048600853e-102, -4.6672632026740766185e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 3.2728487032630532648e-103, 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 1.0404514546648604359e-103, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 4.8235214251531210473e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 2.0330248644053793915e-104, 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435652883e-152, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 6.3777658403150887343e-105, -2.0152904854894725532e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 2.88964513938041089e-105, 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, + 1.1455847889130727424e-105, 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 2.7355461367940366859e-106, -7.8994528064813712419e-123, -2.0037599452814940222e-138, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 5.5547069870986327528e-107, 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.0451839188820145747e-108, 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 1.9359195088038447797e-109, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 8.7142954880180709975e-110, -4.8867691298577234423e-126, -2.0587960670007819622e-142, -2.8326669474241479263e-158, + 3.3918456880078814158e-110, 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 7.3062078800278780675e-111, 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220312367e-159, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 6.5314563001514349095e-112, 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657616072e-160, + 2.3732923938934761454e-112, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 2.9421044076449630171e-113, 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 3.4325196623373878948e-114, 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 1.8395411057335783574e-115, -7.8150389500644475446e-132, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 8.2436437080731844263e-116, 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606945839e-164, + 3.1677600334418871069e-116, 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942429241e-163, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 6.2981819612623816536e-117, 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254779927e-164, + 3.1257546646178208289e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 1.5395410162955400644e-117, -6.6414926959353515111e-134, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 7.4643419213439950602e-118, 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, + 3.4988078005382940294e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 1.5160407401354430737e-118, 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, + 5.2465720993401781599e-119, -3.755176715260116501e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 2.896544483330507019e-120, 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, + 1.3475077173907800538e-120, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 5.7298933442091639924e-121, -3.156241481857667737e-137, -7.0684085473731388916e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 1.8573014293598452896e-121, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 8.8915345064751572143e-122, 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, + 4.0507946129135104481e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.6304246661326865276e-122, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 4.2023969274227456735e-123, 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911825673e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 1.1769344939467164447e-123, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2056888557770896953e-124, 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064369683e-172, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 4.2386081393205242443e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.8749656131673758844e-125, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 6.931443500908017045e-126, 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 1.0223371855251471293e-126, 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 2.8369889610228834887e-127, 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, + 9.9039323746573674262e-128, -8.6629775332868972816e-145, -1.5987060076657612913e-160, -2.5389576707476506925e-176, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 6.7095375687163138915e-129, 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.197724948400014906e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 9.3892593260023063019e-130, 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691155518e-177, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 2.175994780857201024e-130, 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.7267864457092460442e-131, 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 1.4726412753514008951e-131, -3.9681466199873824165e-148, 2.9106774506606941983e-164, 5.1948630316441296498e-180, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 3.4556869017247794521e-132, 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 6.3800543877747317218e-133, 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795152755e-180, + 2.8579525590905986764e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 1.0969016447485317626e-133, -5.7828074707888119584e-150, -1.2825052715093464343e-165, -1.0696067158221530218e-181, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 2.1637618757749825688e-134, -8.9490928918944555247e-151, -1.9717385086233606481e-166, 1.3535321672928907047e-182, + 1.0631050543111905033e-134, 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, + 5.1277664357929471499e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 2.3761243821334675971e-135, 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, + 1.0003033553037281263e-135, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 3.1239284188885823808e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 1.4041521353514076604e-136, 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, + 5.4426399358282049106e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 1.1431992269852681095e-137, 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 6.8339049774534147855e-139, 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328578981e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1602886988632691941e-140, 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.1062055705591186799e-141, 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.5016298192952031469e-142, -2.8326669474241479263e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 1.2214168761472102282e-142, 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 4.0136364036021218058e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 1.9635033141346264592e-143, -1.0134099605688458828e-159, -2.5389576707476506925e-176, -6.2404128071707654958e-193, + 9.3843676940087855824e-144, 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, + 4.2590349703400483539e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 1.6963686085056791706e-144, 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896458822e-192, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 4.1503542758849472122e-145, -1.7614040799531193879e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 9.4702132359198537748e-146, 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.856794109153959173e-193, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 1.4618808551874518553e-146, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 4.6083930759590139305e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.105789206980137775e-147, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 8.544872724906996972e-148, 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 2.2883630524598079723e-148, 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091032843e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 7.2423563434801054878e-149, 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.1067843414450286726e-196, + 3.3320377982006123631e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 1.3768785255608653665e-149, 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.9929888924099219388e-150, -1.9717385086233606481e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 1.5490398016102376505e-150, 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 3.2706525621039604902e-151, 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.1571619860435648643e-152, 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 2.4782675885631257398e-153, -3.3573283875161501977e-170, 3.0568054078295488291e-186, 1.4980560800565462618e-202, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 9.1598554579059548847e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 1.7015147267057481414e-155, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 7.6922213530572229852e-156, -4.5159745404911819927e-172, -4.5870810097328572602e-188, -3.2905064432040069127e-204, + 3.0307583960570927356e-156, 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 7.0002691755702864582e-157, 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 1.1734404793201255869e-157, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 4.4508689228885539715e-158, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 8.0910098773220302259e-159, 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.3321093418096261919e-207, + 3.5387999583765925506e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2626949989038732076e-159, 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.3321093418096261919e-207, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.2464251916751375716e-160, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 5.3514239183991277695e-161, 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, + 1.7950099192230045857e-161, -1.6991004655691153326e-177, -1.8567941091539589297e-193, -1.8074851186411640793e-209, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 1.6802919634942426156e-163, 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 2.9106774506606941983e-164, 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189357559e-211, + 1.1741471776254777999e-164, 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756583552e-212, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.0588204110786950436e-165, 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 8.8815756978467430465e-166, 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, + 3.4549185946116918017e-166, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 7.4159004299416557678e-167, 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 6.3257905089784152346e-168, 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 2.0862146470760309789e-168, -1.146150630053972131e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 1.026320681600434562e-168, 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, + 4.9637369886263658882e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 2.3140020749373754342e-169, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 9.8913461809288020723e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.2670088967063259373e-170, 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 1.6109245756507072713e-170, -6.2044048008378732802e-187, -5.4322544592823556944e-203, 4.2491789852161138683e-219, + 7.8288241512289757055e-171, 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, + 3.6886133485899290404e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 1.6185079472704052482e-171, 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161138683e-219, + 5.8345524661064358191e-172, 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 6.5928896280762691321e-173, 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.2381024895275844856e-174, -8.4789520282639751913e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 2.2730883653953564668e-175, 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190082842e-224, + 1.0095962991602958391e-175, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 3.7785026604276538491e-176, -6.2404128071707654958e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 6.1977249484000140293e-177, 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578162463e-225, + 2.2493122414154495675e-177, 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.7510588792316711745e-178, 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450500218e-227, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 2.8330093736631818036e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 1.2906606599973359683e-179, -7.4549709281190454638e-196, -1.4481306607622412036e-212, 9.9192633285681635836e-229, + 5.1948630316441287936e-180, 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 1.3389912474795150614e-180, 1.106784341445028435e-196, 3.3045982549756578275e-212, 6.2685154049107876715e-228, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 3.7502330143836152136e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3403131492807310959e-181, 3.6564932749519464998e-198, 3.7097125405852507464e-214, 2.5658818466966882188e-231, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 1.3535321672928907047e-182, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 6.0043220944823941786e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 2.2388223052591377446e-183, 3.1205762277848031878e-199, -3.3569248349832580936e-217, -1.0577661142165146927e-233, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.5607241064750984115e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2072867382105631402e-184, -1.4832196127821708615e-201, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 3.0568054078295488291e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 1.2181824638728806485e-186, 1.4980560800565460352e-202, 2.6911956484118910092e-218, -5.1336618966962585332e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 2.9887099189454666024e-187, 4.774153170641553462e-203, 4.2491789852161132393e-219, 7.4467067939231424594e-235, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.9043123899963188689e-188, -3.2905064432040069127e-204, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.1586156901317304854e-188, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 4.4040360264865697732e-189, -1.0100405885278530137e-205, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 8.129755890712020335e-190, 9.8339840169166049336e-206, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 3.6409303439428119063e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3965175705582071936e-190, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 2.7431118386590483722e-191, -1.332109341809626019e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 1.3403538552936701153e-191, 1.7826390804083638359e-207, -9.1795828160190063645e-224, -2.3569545504732004486e-239, + 6.389748636109812983e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.8828536776963681193e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 1.1294061984896456875e-192, 2.2526486929936882202e-208, -5.3441928036578156465e-225, -7.741539335184153052e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 2.5268245888628466632e-193, 3.0593092910744445285e-209, 5.4622616159087170031e-225, 4.2560351759808952526e-241, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 3.3501523985444386676e-194, 6.2591208621664049475e-210, 5.9034406125450490845e-227, 1.3186893776791012681e-242, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 6.1039071228393547627e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.6792050150137250131e-195, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 9.6685396110091013832e-196, 1.7562785002189355449e-211, 1.6821693549018732055e-227, -8.7276385348052817035e-244, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 2.0416567491425607157e-177, 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 6.7450395650278649168e-179, 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 5.756447103644822603e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 1.9005753194802080146e-180, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3660737343905436753e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 4.5462340041847754398e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.1363141390818913221e-181, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 9.3135420653044926323e-182, -6.1924333305615830735e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 3.2887424025472810002e-182, 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921697356e-230, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 2.7634257116867652192e-183, 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 8.806758170751374203e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 4.0998834342223036605e-184, 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749095611e-233, + 1.7464460659577689118e-184, 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749095611e-233, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.697273818255015375e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.755477107924346286e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.2845787527590117414e-185, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 5.4912957517634446918e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 1.8140498638501083305e-186, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 8.9473839187177424013e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.3508265588260719497e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 2.0525478788802367239e-187, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 9.0340853890731911095e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 3.288388689208603045e-188, -1.6933341491052464293e-204, -4.3478137385944270631e-220, -2.3353910329236990725e-236, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 4.1554033927630885323e-189, -9.8582956929636044137e-206, -1.4280619485269765742e-221, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 5.643429553477207926e-190, 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 1.1546040067079994973e-190, 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 3.2397620015697148712e-192, 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 1.4863145223629928288e-192, -7.9038076992129241506e-209, -1.609965144193984205e-224, -1.8313007053436627876e-240, + 6.0959078275963141821e-193, 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436627876e-240, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 1.712289129579509076e-193, 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.1638445507530779946e-194, -6.0361608463951204924e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 6.8432117823206978686e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 3.418509674495068119e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 1.7061586205822532442e-195, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 8.499830936258458068e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 4.218953301476420881e-196, 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.029900079464340522e-245, + 2.0785144840854027628e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 1.008295075389893466e-196, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.7318537104213881764e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 2.0563051886826149345e-197, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 7.185309278132283136e-198, -1.9512340798794268979e-214, -3.6162764918921692779e-230, -2.8387319855193022476e-246, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 4.9643797378534984559e-199, -9.4699347169310243473e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 7.8383517263666503337e-200, 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 2.612671019845610006e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 1.306250843215349634e-200, 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421728101e-248, + 6.5304075490021959302e-201, 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, + 3.2643571074265457254e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 1.6313318866387202604e-201, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 8.1481927624480752786e-202, -4.2219277387461470355e-218, -1.753154605289404553e-234, -7.5861268822635538093e-251, + 4.0656297104785107096e-202, 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, + 2.0243481844937293316e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.0037074215013384159e-202, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 4.9338704000514295811e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 2.3822684925704522921e-203, 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, + 1.1064675388299639308e-203, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 4.6856706195971960852e-204, 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608782288e-251, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 1.4961682352459748279e-204, -8.0675475439086544798e-221, -3.6970842501441777651e-237, -5.7032870362481275794e-253, + 6.9879263915816924805e-205, 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843495713e-252, + 3.0010484111426663515e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0076094209231528444e-205, 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 1.0889925813396166947e-207, 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 3.1030547578511949035e-208, -1.609965144193984205e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.156336993964950812e-208, 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525059632e-256, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 1.8297811202182925249e-209, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 6.1308251778939023781e-210, 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.1174271110208206547e-259, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 4.7332165749391048364e-212, 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.3568521170701555846e-212, -7.7818310317651142243e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 1.1686698881356804311e-212, 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 5.7457877366844311816e-213, 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, + 2.7753321643482446169e-213, -1.1860946916976500828e-229, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.290104378180150675e-213, 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, + 5.4749048509610403382e-214, 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501532045e-261, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.7618353855408067201e-214, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 8.3356801918574821257e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 3.6943433600821895879e-215, 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, + 1.3736749441945438342e-215, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 2.1334073625072069974e-216, -9.2331809177749077733e-233, -1.4042876247421726117e-248, -9.9505977179164858712e-265, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 6.8298960257742791824e-217, 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 3.2038516259498326923e-217, -1.1817449557784924788e-233, -6.3454186796659920093e-250, -2.6436684620390282645e-267, + 1.3908294260376086421e-217, 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, + 4.8431832608149701961e-218, 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 3.1062776103441183191e-219, 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 2.7343042298126957741e-220, 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, + 9.6377473771091526132e-221, 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844372114e-268, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 7.8509991660024955813e-222, 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.318094503184431479e-222, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 9.3486833747991514629e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.4325525462765697993e-223, -1.1429360314275701698e-239, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 7.0351983914592419146e-224, 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539155726e-272, + 2.7126166236326293347e-224, -1.8313007053436625212e-240, -2.3341145329525056675e-256, -2.0046830753539155726e-272, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 5.5132573971932232487e-225, 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 1.1003018740995688645e-226, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 2.560476225709334075e-227, 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.4984059688774601837e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 1.8601114328504743806e-228, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 5.409641648369814791e-229, -3.0299000794643401155e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 2.1117734783360818049e-229, 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 4.6283939331921604413e-230, 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 5.060587206499956961e-231, 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580820317e-280, + 2.4841276986611042098e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 1.1958979447416775482e-231, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 5.5178306778196421733e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 2.2972562930210755192e-232, 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 6.8696910062179237095e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 2.8439730252197153919e-233, 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 8.3111403472061145651e-234, 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 3.2789928709583552854e-234, 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 7.6291913283447536617e-235, 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 1.3390069830350552605e-235, -6.026193929640082176e-252, -7.0535576022338457803e-268, -4.3807022524130141006e-284, + 5.5273393987134252385e-236, 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 1.5959741828948633012e-236, 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, + 6.1313287894022281692e-237, 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006739096e-285, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 1.2171222696290252021e-237, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 6.0284645465737476297e-238, -2.4742181023285720738e-254, -1.2030990169203137715e-270, -9.5347405022956042207e-287, + 2.9570854717154947523e-238, 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956042207e-287, + 1.4213959342863689955e-238, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 6.5355116557180594664e-239, 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956042207e-287, + 2.6962878121452450746e-239, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 7.766758903588374524e-240, 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 2.9677290991223565342e-240, -2.3341145329525056675e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 5.6821419688934674008e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 2.6827483411022054912e-241, 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, + 1.1830515272065748694e-241, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 4.3320312025875939195e-242, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 5.827891678485165325e-243, -3.117427111020820077e-259, -5.9718623963762788119e-275, 6.1155422068568954053e-291, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 1.1413391350613183311e-243, -5.1586784110844895013e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 5.5552006713333735927e-244, 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181717279e-292, + 2.6261053316934700345e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 1.1615576618735179302e-244, 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997740506e-292, + 4.2928382696354204061e-245, -2.8075477999879273582e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 6.3146909508553973881e-246, 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 1.7379794826680480784e-246, 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, + 5.9380161562121075096e-247, -1.2904053011746964278e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 2.1712682097791944335e-248, 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150276549e-299, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 3.8349029251851101018e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.6001805286092554504e-249, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 4.8281933032132812475e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.0347903074934629333e-250, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 6.3808880963355377617e-251, -2.6436684620390282645e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.8891343516857640937e-251, 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 1.1432574793608780349e-251, 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 2.7031904319843490867e-252, 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 5.2084434157824127104e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 2.4805108027747776379e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 1.1165444962709601017e-253, 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482777461e-301, + 4.3456134301905148502e-254, 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 9.3569766393097138822e-255, 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 8.3218722366085688343e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 2.9938788518280315834e-256, -2.0046830753539152442e-272, -3.4057806738724185961e-288, 2.3458177946667328156e-304, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 3.2988215943776273615e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 1.6338236616337094706e-257, 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, + 8.0132469526175071002e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 3.850752120757712373e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 1.7695047048278150093e-258, 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, + 7.2888099686286655858e-259, 5.581381609158630475e-275, 6.1155422068568946933e-291, 1.0380272777574237546e-306, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 2.0856914288039227544e-259, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 7.8491179384773690214e-260, -1.9524039360882352712e-276, -2.9779654517181712829e-292, -3.000817432603284506e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 1.345219763696439399e-260, 1.6579848156414234801e-276, 1.0303712682997738281e-292, 1.4493302844111182601e-308, + 5.3223249184882342185e-261, -1.472095602234059958e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.2573885592501529789e-261, 3.0408903374280139822e-277, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 2.4115446944063306384e-262, 2.202741251392177696e-278, 2.8287088295287585094e-294, -1.0874435234232647519e-310, + 1.1412520821444306741e-262, -6.1787496089661820348e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 5.0610577601348040988e-263, 7.9243314524777990283e-279, -3.028042329852615431e-295, -2.182740474438892116e-311, + 1.8853262294800541881e-263, 8.7279092175580810531e-280, 8.8634899828990930877e-296, -9.8167844904532653004e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.9746046415267896827e-264, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 9.8977243486757054781e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 4.9356438320276576408e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.4546035737036337221e-265, -8.6516445844406224413e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2140834445416214873e-265, 1.8893435613692150014e-281, 3.0075895258731974416e-297, -9.8167844904532653004e-314, + 5.9382337996061564537e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 2.8369334767011265554e-266, 5.1208955146257653156e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 1.2862833152486119506e-266, 1.6777604898591683764e-282, -5.0528699238150265939e-299, -1.3288013265921760399e-314, + 5.1095823452235464813e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 1.2329569415922591084e-267, -4.3807022524130141006e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.638005906844371576e-268, 6.3790946999826013345e-284, -2.7456019707854725967e-300, -2.5539572388808429997e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 2.1511502957481757317e-269, 3.2670891426006735363e-285, 2.4084160842482773317e-301, 5.7350888195772519812e-317, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.3684349745470443788e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 2.5826679788133653036e-270, -9.5347405022956030541e-287, -1.5805886663557401565e-302, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 6.8978448094652555593e-271, 1.1480487920352081009e-286, 7.5257037990230704094e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 2.1656360647981577662e-271, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.825838786313830552e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 3.9105778554799569972e-272, 9.7287370902823839435e-288, 1.6928061833779524157e-303, 3.6369654387311681856e-319, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 9.5294739006302120482e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.1353977370878701046e-273, -1.2215123283371736879e-289, 6.7342163555358599277e-306, -5.681754927174335258e-322, + 2.8687869620228451614e-274, -1.9537812801257956865e-290, 1.0380272777574237546e-306, 6.4228533959362050743e-323, +}; + +static const float Sleef_rempitabsp[] = { + 0.159154892, 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.03415493667, 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.002904943191, -9.861969574e-11, -9.839336547e-18, -1.790215892e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0009518179577, 1.342109202e-10, 1.791623576e-17, 1.518506657e-24, + 0.0004635368241, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 0.0002193961991, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 9.73258866e-05, 1.779561221e-11, 4.038449606e-18, -1.358546052e-25, + 3.62907449e-05, 3.243700447e-12, 5.690024473e-19, 7.09405479e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 5.773168596e-06, 1.424711477e-12, 1.3532163e-19, 1.92417627e-26, + 1.958472239e-06, 5.152167755e-13, 1.3532163e-19, 1.92417627e-26, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 5.112411827e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 2.132179588e-08, 3.626141271e-15, -2.036222915e-22, 6.177847236e-30, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 6.420638243e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 2.695347945e-09, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 8.327027956e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 3.670415083e-10, 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, + 1.342109202e-10, 1.791623576e-17, 1.518506361e-24, 2.613904e-31, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 1.779561221e-11, 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 3.243700447e-12, 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, + 1.424711477e-12, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 5.152167755e-13, 1.3532163e-19, 1.924175961e-26, 2.545416018e-33, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 6.046956013e-14, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 3.626141271e-15, -2.036222915e-22, 6.177846108e-30, 1.082084378e-36, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 7.342738037e-17, 8.135951656e-24, -1.330400526e-31, 6.296048013e-40, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 1.791623576e-17, 1.518506361e-24, 2.61390353e-31, 4.764937743e-38, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 4.038449606e-18, -1.358545683e-25, -3.443243946e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 5.690024473e-19, 7.094053557e-26, 1.487136711e-32, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 1.3532163e-19, 1.924175961e-26, 2.545415467e-33, 6.296048013e-40, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 2.690143217e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 1.334890502e-20, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 6.572641438e-21, -1.452834402e-28, -6.441077673e-36, -1.764234767e-42, + 0.05874381959, 1.222115387e-08, 7.693612965e-16, 1.792054435e-22, + 0.02749382704, 4.77057327e-09, 7.693612965e-16, 1.792054435e-22, + 0.01186883077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.00405633077, 1.045283415e-09, 3.252721926e-16, 7.332633139e-23, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 0.000150081818, -2.454155802e-12, 1.161414894e-20, 1.291319272e-27, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 2.801149822e-05, 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, + 1.275271279e-05, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 5.12331826e-06, 1.183823005e-12, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 1.308621904e-06, 2.743283031e-13, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 3.549478151e-07, 4.695462769e-14, 1.161414894e-20, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 1.165292645e-07, 1.853292503e-14, 4.837885366e-21, 1.291319272e-27, + 5.69246339e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 2.712231151e-08, 4.322073705e-15, 1.449754789e-21, 7.962890365e-29, + 1.222115387e-08, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 4.77057327e-09, 7.693612965e-16, 1.792054182e-22, 2.91418027e-29, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.045283415e-09, 3.252721926e-16, 7.332632508e-23, 3.898253736e-30, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 1.139611461e-10, 1.996093359e-17, 5.344349223e-25, 1.511644828e-31, + 5.575349904e-11, 6.083145782e-18, 5.344349223e-25, 1.511644828e-31, + 2.664967552e-11, -8.557475018e-19, -8.595036458e-26, -2.139883875e-32, + 1.209775682e-11, 2.61369883e-18, 5.344349223e-25, 1.511644828e-31, + 4.821800945e-12, 8.789757674e-19, 1.208447639e-25, 3.253064536e-33, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 1.183823005e-12, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, + 2.743283031e-13, 1.161414894e-20, 1.29131908e-27, 1.715766248e-34, +}; +#endif // #ifndef __SLEEF_REMPITAB__ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefld.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefld.c new file mode 100644 index 0000000000000..0d9eff87b080e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefld.c @@ -0,0 +1,419 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#include + +#include +#include +#include + +#include "misc.h" + +#ifdef DORENAME +#include "rename.h" +#endif + +#if (defined(_MSC_VER)) +#pragma fp_contract (off) +#endif + +static INLINE CONST long double mlal(long double x, long double y, long double z) { return x * y + z; } +static INLINE CONST long double xrintl(long double x) { return x < 0 ? (int)(x - 0.5) : (int)(x + 0.5); } +static INLINE CONST int64_t xceill(long double x) { return (int64_t)x + (x < 0 ? 0 : 1); } +static INLINE CONST long double xtruncl(long double x) { return (long double)(int)x; } + +static INLINE CONST int xisnanl(long double x) { return x != x; } +static INLINE CONST int xisinfl(long double x) { return x == SLEEF_INFINITYl || x == -SLEEF_INFINITYl; } +static INLINE CONST int xisminfl(long double x) { return x == -SLEEF_INFINITYl; } +static INLINE CONST int xispinfl(long double x) { return x == SLEEF_INFINITYl; } + +static INLINE CONST long double xfabsl(long double x) { return x >= 0 ? x : -x; } + +// + +#ifndef NDEBUG +static int checkfp(long double x) { + if (xisinfl(x) || xisnanl(x)) return 1; + return 0; +} +#endif + +static INLINE CONST long double upperl(long double d) { + union { + long double ld; + uint32_t u[4]; + } cnv; + + cnv.ld = d; + cnv.u[0] = 0; + return cnv.ld; +} + +static INLINE CONST Sleef_longdouble2 dl(long double h, long double l) { + Sleef_longdouble2 ret; + ret.x = h; ret.y = l; + return ret; +} + +static INLINE CONST Sleef_longdouble2 dlnormalize_l2_l2(Sleef_longdouble2 t) { + Sleef_longdouble2 s; + + s.x = t.x + t.y; + s.y = t.x - s.x + t.y; + + return s; +} + +static INLINE CONST Sleef_longdouble2 dlscale_l2_l2_l(Sleef_longdouble2 d, long double s) { + Sleef_longdouble2 r; + + r.x = d.x * s; + r.y = d.y * s; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlneg_l2_l2(Sleef_longdouble2 d) { + Sleef_longdouble2 r; + + r.x = -d.x; + r.y = -d.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd_l2_l_l(long double x, long double y) { + // |x| >= |y| + + Sleef_longdouble2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y) || xfabsl(x) >= xfabsl(y))) { + fprintf(stderr, "[dladd_l2_l_l : %Lg, %Lg]\n", x, y); + fflush(stderr); + } +#endif + + r.x = x + y; + r.y = x - r.x + y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd2_l2_l_l(long double x, long double y) { + Sleef_longdouble2 r; + + r.x = x + y; + long double v = r.x - x; + r.y = (x - (r.x - v)) + (y - v); + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd_l2_l2_l(Sleef_longdouble2 x, long double y) { + // |x| >= |y| + + Sleef_longdouble2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y) || xfabsl(x.x) >= xfabsl(y))) { + fprintf(stderr, "[dladd_l2_l2_l : %Lg %Lg]\n", x.x, y); + fflush(stderr); + } +#endif + + r.x = x.x + y; + r.y = x.x - r.x + y + x.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd2_l2_l2_l(Sleef_longdouble2 x, long double y) { + // |x| >= |y| + + Sleef_longdouble2 r; + + r.x = x.x + y; + long double v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y - v); + r.y += x.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd_l2_l_l2(long double x, Sleef_longdouble2 y) { + // |x| >= |y| + + Sleef_longdouble2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y.x) || xfabsl(x) >= xfabsl(y.x))) { + fprintf(stderr, "[dladd_l2_l_l2 : %Lg %Lg]\n", x, y.x); + fflush(stderr); + } +#endif + + r.x = x + y.x; + r.y = x - r.x + y.x + y.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd2_l2_l_l2(long double x, Sleef_longdouble2 y) { + Sleef_longdouble2 r; + + r.x = x + y.x; + long double v = r.x - x; + r.y = (x - (r.x - v)) + (y.x - v) + y.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd_l2_l2_l2(Sleef_longdouble2 x, Sleef_longdouble2 y) { + // |x| >= |y| + + Sleef_longdouble2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || xfabsl(x.x) >= xfabsl(y.x))) { + fprintf(stderr, "[dladd_l2_l2_l2 : %Lg %Lg]\n", x.x, y.x); + fflush(stderr); + } +#endif + + r.x = x.x + y.x; + r.y = x.x - r.x + y.x + x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dladd2_l2_l2_l2(Sleef_longdouble2 x, Sleef_longdouble2 y) { + Sleef_longdouble2 r; + + r.x = x.x + y.x; + long double v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y.x - v); + r.y += x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlsub_l2_l2_l2(Sleef_longdouble2 x, Sleef_longdouble2 y) { + // |x| >= |y| + + Sleef_longdouble2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || xfabsl(x.x) >= xfabsl(y.x))) { + fprintf(stderr, "[dlsub_l2_l2_l2 : %Lg %Lg]\n", x.x, y.x); + fflush(stderr); + } +#endif + + r.x = x.x - y.x; + r.y = x.x - r.x - y.x + x.y - y.y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dldiv_l2_l2_l2(Sleef_longdouble2 n, Sleef_longdouble2 d) { + long double t = 1.0 / d.x; + long double dh = upperl(d.x), dl = d.x - dh; + long double th = upperl(t ), tl = t - th; + long double nhh = upperl(n.x), nhl = n.x - nhh; + + Sleef_longdouble2 q; + + q.x = n.x * t; + + long double u = -q.x + nhh * th + nhh * tl + nhl * th + nhl * tl + + q.x * (1 - dh * th - dh * tl - dl * th - dl * tl); + + q.y = t * (n.y - q.x * d.y) + u; + + return q; +} + +static INLINE CONST Sleef_longdouble2 dlmul_l2_l_l(long double x, long double y) { + long double xh = upperl(x), xl = x - xh; + long double yh = upperl(y), yl = y - yh; + Sleef_longdouble2 r; + + r.x = x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlmul_l2_l2_l(Sleef_longdouble2 x, long double y) { + long double xh = upperl(x.x), xl = x.x - xh; + long double yh = upperl(y ), yl = y - yh; + Sleef_longdouble2 r; + + r.x = x.x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.y * y; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlmul_l2_l2_l2(Sleef_longdouble2 x, Sleef_longdouble2 y) { + long double xh = upperl(x.x), xl = x.x - xh; + long double yh = upperl(y.x), yl = y.x - yh; + Sleef_longdouble2 r; + + r.x = x.x * y.x; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.x * y.y + x.y * y.x; + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlsqu_l2_l2(Sleef_longdouble2 x) { + long double xh = upperl(x.x), xl = x.x - xh; + Sleef_longdouble2 r; + + r.x = x.x * x.x; + r.y = xh * xh - r.x + (xh + xh) * xl + xl * xl + x.x * (x.y + x.y); + + return r; +} + +static INLINE CONST Sleef_longdouble2 dlrec_l2_l(long double d) { + long double t = 1.0 / d; + long double dh = upperl(d), dl = d - dh; + long double th = upperl(t), tl = t - th; + Sleef_longdouble2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl); + + return q; +} + +static INLINE CONST Sleef_longdouble2 dlrec_l2_l2(Sleef_longdouble2 d) { + long double t = 1.0 / d.x; + long double dh = upperl(d.x), dl = d.x - dh; + long double th = upperl(t ), tl = t - th; + Sleef_longdouble2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl - d.y * t); + + return q; +} + +/* +static INLINE CONST Sleef_longdouble2 dlsqrt_l2_l2(Sleef_longdouble2 d) { + long double t = sqrt(d.x + d.y); + return dlscale_l2_l2_l(dlmul_l2_l2_l2(dladd2_l2_l2_l2(d, dlmul_l2_l_l(t, t)), dlrec_l2_l(t)), 0.5); +} +*/ + +// + +EXPORT CONST Sleef_longdouble2 xsincospil_u05(long double d) { + long double u, s, t; + Sleef_longdouble2 r, x, s2; + + u = d * 4; + int64_t q = xceill(u) & ~(int64_t)1; + + s = u - (long double)q; + t = s; + s = s * s; + s2 = dlmul_l2_l_l(t, t); + + // + + u = 4.59265607313529833157632e-17L; + u = mlal(u, s, -2.04096140520547829627419e-14L); + u = mlal(u, s, 6.94845264320316515640316e-12L); + u = mlal(u, s, -1.75724767308629210422023e-09L); + u = mlal(u, s, 3.13361689037693212744991e-07L); + u = mlal(u, s, -3.65762041821772284521155e-05L); + u = mlal(u, s, 0.00249039457019272015784594L); + x = dladd2_l2_l_l2(u * s, dl(-0.0807455121882807817044873L, -2.40179063154839769223037e-21L)); + x = dladd2_l2_l2_l2(dlmul_l2_l2_l2(s2, x), dl(0.785398163397448309628202L, -1.25420305812534448752181e-20L)); + + x = dlmul_l2_l2_l(x, t); + r.x = x.x + x.y; + + // + + u = -2.00423964577657539380734e-18L; + u = mlal(u, s, 1.00185574457758689324113e-15L); + u = mlal(u, s, -3.89807283423502620989528e-13L); + u = mlal(u, s, 1.15011591257563133685341e-10L); + u = mlal(u, s, -2.461136950493305818105e-08L); + u = mlal(u, s, 3.59086044859150791782134e-06L); + u = mlal(u, s, -0.00032599188692739001335938L); + x = dladd2_l2_l_l2(u * s, dl(0.0158543442438155008529635L, -6.97556143018517384674258e-22L)); + x = dladd2_l2_l2_l2(dlmul_l2_l2_l2(s2, x), dl(-0.308425137534042456829379L, -9.19882299434302978226668e-21L)); + + x = dladd2_l2_l2_l(dlmul_l2_l2_l2(x, s2), 1); + r.y = x.x + x.y; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (xisinfl(d)) { r.x = r.y = SLEEF_NAN; } + if (!xisinfl(d) && xfabsl(d) > TRIGRANGEMAX3) { r.x = r.y = 0; } + + return r; +} + +EXPORT CONST Sleef_longdouble2 xsincospil_u35(long double d) { + long double u, s, t; + Sleef_longdouble2 r; + + u = d * 4; + int64_t q = xceill(u) & ~(int64_t)1; + + s = u - (long double)q; + t = s; + s = s * s; + + // + + u = -0.2023275819380976135024e-13L; + u = mlal(u, s, +0.6948176964255957574946e-11L); + u = mlal(u, s, -0.1757247450021535880723e-8L); + u = mlal(u, s, +0.3133616889379195970541e-6L); + u = mlal(u, s, -0.3657620418215300856408e-4L); + u = mlal(u, s, +0.2490394570192717262476e-2L); + u = mlal(u, s, -0.8074551218828078160284e-1L); + u = mlal(u, s, +0.7853981633974483096282e+0L); + + r.x = u * t; + + // + + u = +0.9933418221428971922705e-15L; + u = mlal(u, s, -0.3897923064055824005357e-12L); + u = mlal(u, s, +0.1150115771521792692066e-9L); + u = mlal(u, s, -0.2461136949725905367314e-7L); + u = mlal(u, s, +0.3590860448589084195081e-5L); + u = mlal(u, s, -0.3259918869273895914840e-3L); + u = mlal(u, s, +0.1585434424381550079706e-1L); + u = mlal(u, s, -0.3084251375340424568294e+0L); + u = mlal(u, s, 1.0L); + + r.y = u; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (xisinfl(d)) { r.x = r.y = SLEEF_NAN; } + if (!xisinfl(d) && xfabsl(d) > TRIGRANGEMAX3) { r.x = r.y = 0; } + + return r; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_footer.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_footer.h.org new file mode 100644 index 0000000000000..b30cf6bc0ecbd --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_footer.h.org @@ -0,0 +1,8 @@ + +// + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // #ifndef __SLEEF_H__ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_header.h.org.in b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_header.h.org.in new file mode 100644 index 0000000000000..66d88db3c7025 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleeflibm_header.h.org.in @@ -0,0 +1,364 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __SLEEF_H__ +#define __SLEEF_H__ + +#define SLEEF_VERSION_MAJOR @SLEEF_VERSION_MAJOR@ +#define SLEEF_VERSION_MINOR @SLEEF_VERSION_MINOR@ +#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCH@ + +#include +#include + +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_CONST __attribute__((const)) +#define SLEEF_INLINE __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_CONST +#define SLEEF_INLINE __forceinline +#endif + +#if defined(__AVX2__) || defined(__aarch64__) || defined(__arm__) || defined(__powerpc64__) || defined(__zarch__) +#ifndef FP_FAST_FMA +#define FP_FAST_FMA +#endif +#ifndef FP_FAST_FMAF +#define FP_FAST_FMAF +#endif +#endif + +#if defined(_MSC_VER) && !defined(__STDC__) +#define __STDC__ 1 +#endif + +#if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#ifdef SLEEF_IMPORT_IS_EXPORT +#define SLEEF_IMPORT __declspec(dllexport) +#else // #ifdef SLEEF_IMPORT_IS_EXPORT +#define SLEEF_IMPORT __declspec(dllimport) +#if (defined(_MSC_VER)) +#pragma comment(lib,"sleef.lib") +#endif // #if (defined(_MSC_VER)) +#endif // #ifdef SLEEF_IMPORT_IS_EXPORT +#else // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#define SLEEF_IMPORT +#endif // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) + +#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) +#include +#endif + +#if (defined(_MSC_VER)) +#include +#endif + +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#include +#endif + +#if defined(__ARM_FEATURE_SVE) +#include +#endif + +#if defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__) +#include +typedef __vector double SLEEF_VECTOR_DOUBLE; +typedef __vector float SLEEF_VECTOR_FLOAT; +typedef __vector int SLEEF_VECTOR_INT; +typedef __vector unsigned int SLEEF_VECTOR_UINT; +typedef __vector long long SLEEF_VECTOR_LONGLONG; +typedef __vector unsigned long long SLEEF_VECTOR_ULONGLONG; +#endif + +#if defined(__VX__) && defined(__VEC__) +#ifndef SLEEF_VECINTRIN_H_INCLUDED +#include +#define SLEEF_VECINTRIN_H_INCLUDED +#endif +typedef __vector double SLEEF_VECTOR_DOUBLE; +typedef __vector float SLEEF_VECTOR_FLOAT; +typedef __vector int SLEEF_VECTOR_INT; +typedef __vector unsigned int SLEEF_VECTOR_UINT; +typedef __vector long long SLEEF_VECTOR_LONGLONG; +typedef __vector unsigned long long SLEEF_VECTOR_ULONGLONG; +#endif + +// + +#if defined(SLEEF_ENABLE_OMP_SIMD) && (defined(__GNUC__) || defined(__CLANG__)) && !defined(__INTEL_COMPILER) +#if defined(__aarch64__) +//#define SLEEF_PRAGMA_OMP_SIMD_DP _Pragma ("omp declare simd simdlen(2) notinbranch") +//#define SLEEF_PRAGMA_OMP_SIMD_SP _Pragma ("omp declare simd simdlen(4) notinbranch") +//#elif defined(__x86_64__) && defined(__AVX512F__) +//#define SLEEF_PRAGMA_OMP_SIMD_DP _Pragma ("omp declare simd simdlen(8) notinbranch") +//#define SLEEF_PRAGMA_OMP_SIMD_SP _Pragma ("omp declare simd simdlen(16) notinbranch") +#elif defined(__x86_64__) && defined(__AVX__) +#define SLEEF_PRAGMA_OMP_SIMD_DP _Pragma ("omp declare simd simdlen(4) notinbranch") +#define SLEEF_PRAGMA_OMP_SIMD_SP _Pragma ("omp declare simd simdlen(8) notinbranch") +#elif defined(__x86_64__) && defined(__SSE2__) +#define SLEEF_PRAGMA_OMP_SIMD_DP _Pragma ("omp declare simd simdlen(2) notinbranch") +#define SLEEF_PRAGMA_OMP_SIMD_SP _Pragma ("omp declare simd simdlen(4) notinbranch") +#endif +#endif + +#ifndef SLEEF_PRAGMA_OMP_SIMD_DP +#define SLEEF_PRAGMA_OMP_SIMD_DP +#define SLEEF_PRAGMA_OMP_SIMD_SP +#endif + +// + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +// + +SLEEF_IMPORT void *Sleef_malloc(size_t z); +SLEEF_IMPORT void Sleef_free(void *ptr); +SLEEF_IMPORT uint64_t Sleef_currentTimeMicros(); + +#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER) +SLEEF_IMPORT void Sleef_x86CpuID(int32_t out[4], uint32_t eax, uint32_t ecx); +#endif + +// + +#if defined(__riscv_v) +#include +typedef vfloat64m2_t Sleef_vfloat64m1_t_2; +typedef vfloat32m2_t Sleef_vfloat32m1_t_2; +typedef vfloat64m4_t Sleef_vfloat64m2_t_2; +typedef vfloat32m4_t Sleef_vfloat32m2_t_2; +#define Sleef_vfloat64m1_t_2_DEFINED +#define Sleef_vfloat32m1_t_2_DEFINED +#define Sleef_vfloat64m2_t_2_DEFINED +#define Sleef_vfloat32m2_t_2_DEFINED +#endif + +#ifndef Sleef_double2_DEFINED +#define Sleef_double2_DEFINED +typedef struct { + double x, y; +} Sleef_double2; +#endif + +#ifndef Sleef_float2_DEFINED +#define Sleef_float2_DEFINED +typedef struct { + float x, y; +} Sleef_float2; +#endif + +#ifndef Sleef_longdouble2_DEFINED +#define Sleef_longdouble2_DEFINED +typedef struct { + long double x, y; +} Sleef_longdouble2; +#endif + +#if (defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) || defined(ENABLEFLOAT128) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif +#if !defined(Sleef_quad2_DEFINED) +#define Sleef_quad2_DEFINED +typedef union { + struct { + Sleef_quad x, y; + }; + Sleef_quad s[2]; +} Sleef_quad2; +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sin_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cos_u35(double); +SLEEF_IMPORT SLEEF_CONST Sleef_double2 Sleef_sincos_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_tan_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_asin_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_acos_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_atan_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_atan2_u35(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cbrt_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sin_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cos_u10(double); +SLEEF_IMPORT SLEEF_CONST Sleef_double2 Sleef_sincos_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_tan_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_asin_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_acos_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_atan_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_atan2_u10(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cbrt_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_exp_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_pow_u10(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sinh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cosh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_tanh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sinh_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cosh_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_tanh_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_asinh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_acosh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_atanh_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_exp2_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_exp10_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_exp2_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_exp10_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_expm1_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log10_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log2_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log2_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_log1p_u10(double); +SLEEF_IMPORT SLEEF_CONST Sleef_double2 Sleef_sincospi_u05(double); +SLEEF_IMPORT SLEEF_CONST Sleef_double2 Sleef_sincospi_u35(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sinpi_u05(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_cospi_u05(double); +SLEEF_IMPORT SLEEF_CONST double Sleef_ldexp(double, int); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST int Sleef_ilogb(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fma(double, double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sqrt(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sqrt_u05(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_sqrt_u35(double); + +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_hypot_u05(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_hypot_u35(double, double); + +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fabs(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_copysign(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fmax(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fmin(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fdim(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_trunc(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_floor(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_ceil(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_round(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_rint(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_nextafter(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_frfrexp(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST int Sleef_expfrexp(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_fmod(double, double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_remainder(double, double); +SLEEF_IMPORT SLEEF_CONST Sleef_double2 Sleef_modf(double); + +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_lgamma_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_tgamma_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_erf_u10(double); +SLEEF_PRAGMA_OMP_SIMD_DP SLEEF_IMPORT SLEEF_CONST double Sleef_erfc_u15(double); + +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sinf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_cosf_u35(float); +SLEEF_IMPORT SLEEF_CONST Sleef_float2 Sleef_sincosf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_tanf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_asinf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_acosf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_atanf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_atan2f_u35(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_logf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_cbrtf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sinf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_cosf_u10(float); +SLEEF_IMPORT SLEEF_CONST Sleef_float2 Sleef_sincosf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fastsinf_u3500(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fastcosf_u3500(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_tanf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_asinf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_acosf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_atanf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_atan2f_u10(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_logf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_cbrtf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_expf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_powf_u10(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fastpowf_u3500(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sinhf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_coshf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_tanhf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sinhf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_coshf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_tanhf_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_asinhf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_acoshf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_atanhf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_exp2f_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_exp10f_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_exp2f_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_exp10f_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_expm1f_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_log10f_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_log2f_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_log2f_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_log1pf_u10(float); +SLEEF_IMPORT SLEEF_CONST Sleef_float2 Sleef_sincospif_u05(float); +SLEEF_IMPORT SLEEF_CONST Sleef_float2 Sleef_sincospif_u35(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sinpif_u05(float d); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_cospif_u05(float d); +SLEEF_IMPORT SLEEF_CONST float Sleef_ldexpf(float, int); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST int Sleef_ilogbf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fmaf(float, float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sqrtf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sqrtf_u05(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_sqrtf_u35(float); + +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_hypotf_u05(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_hypotf_u35(float, float); + +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fabsf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_copysignf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fmaxf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fminf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fdimf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_truncf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_floorf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_ceilf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_roundf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_rintf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_nextafterf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_frfrexpf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST int Sleef_expfrexpf(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_fmodf(float, float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_remainderf(float, float); +SLEEF_IMPORT SLEEF_CONST Sleef_float2 Sleef_modff(float); + +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_lgammaf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_tgammaf_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_erff_u10(float); +SLEEF_PRAGMA_OMP_SIMD_SP SLEEF_IMPORT SLEEF_CONST float Sleef_erfcf_u15(float); + +SLEEF_IMPORT SLEEF_CONST Sleef_longdouble2 Sleef_sincospil_u05(long double); +SLEEF_IMPORT SLEEF_CONST Sleef_longdouble2 Sleef_sincospil_u35(long double); + +#if defined(Sleef_quad2_DEFINED) +SLEEF_IMPORT SLEEF_CONST Sleef_quad2 Sleef_sincospiq_u05(Sleef_quad); +SLEEF_IMPORT SLEEF_CONST Sleef_quad2 Sleef_sincospiq_u35(Sleef_quad); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefqp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefqp.c new file mode 100644 index 0000000000000..f605c0eb8ad7e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefqp.c @@ -0,0 +1,472 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#include + +#include +#include +#include + +#include "misc.h" +#include "quaddef.h" + +#ifdef DORENAME +#include "rename.h" +#endif + +#if (defined(_MSC_VER)) +#pragma fp_contract (off) +#endif + +static INLINE CONST Sleef_quad mlaq(Sleef_quad x, Sleef_quad y, Sleef_quad z) { return x * y + z; } +static INLINE CONST int64_t xrintq(Sleef_quad x) { return x < 0 ? (int64_t)(x - 0.5) : (int64_t)(x + 0.5); } +static INLINE CONST int64_t xceilq(Sleef_quad x) { return (int64_t)x + (x < 0 ? 0 : 1); } +static INLINE CONST Sleef_quad xtruncq(Sleef_quad x) { return (Sleef_quad)(int64_t)x; } + +static INLINE CONST int xisnanq(Sleef_quad x) { return x != x; } +static INLINE CONST int xisinfq(Sleef_quad x) { return x == SLEEF_INFINITYq || x == -SLEEF_INFINITYq; } +static INLINE CONST int xisminfq(Sleef_quad x) { return x == -SLEEF_INFINITYq; } +static INLINE CONST int xispinfq(Sleef_quad x) { return x == SLEEF_INFINITYq; } + +static INLINE CONST Sleef_quad xfabsq(Sleef_quad x) { + union { + Sleef_quad q; + uint64_t u[2]; + } cnv; + + cnv.q = x; + cnv.u[1] &= UINT64_C(0x7fffffffffffffff); + return cnv.q; +} + +// + +#ifndef NDEBUG +static int checkfp(Sleef_quad x) { + if (xisinfq(x) || xisnanq(x)) return 1; + return 0; +} +#endif + +static INLINE CONST Sleef_quad upperq(Sleef_quad d) { + union { + Sleef_quad q; + uint64_t u[2]; + } cnv; + + cnv.q = d; + cnv.u[0] &= ~((UINT64_C(1) << (112/2+1)) - 1); + return cnv.q; +} + +static INLINE CONST Sleef_quad2 dq(Sleef_quad h, Sleef_quad l) { + Sleef_quad2 ret; + ret.x = h; ret.y = l; + return ret; +} + +static INLINE CONST Sleef_quad2 dqnormalize_q2_q2(Sleef_quad2 t) { + Sleef_quad2 s; + + s.x = t.x + t.y; + s.y = t.x - s.x + t.y; + + return s; +} + +static INLINE CONST Sleef_quad2 dqscale_q2_q2_q(Sleef_quad2 d, Sleef_quad s) { + Sleef_quad2 r; + + r.x = d.x * s; + r.y = d.y * s; + + return r; +} + +static INLINE CONST Sleef_quad2 dqneg_q2_q2(Sleef_quad2 d) { + Sleef_quad2 r; + + r.x = -d.x; + r.y = -d.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd_q2_q_q(Sleef_quad x, Sleef_quad y) { + // |x| >= |y| + + Sleef_quad2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y) || xfabsq(x) >= xfabsq(y))) { + fprintf(stderr, "[dqadd_q2_q_q : %g, %g]\n", (double)x, (double)y); + fflush(stderr); + } +#endif + + r.x = x + y; + r.y = x - r.x + y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd2_q2_q_q(Sleef_quad x, Sleef_quad y) { + Sleef_quad2 r; + + r.x = x + y; + Sleef_quad v = r.x - x; + r.y = (x - (r.x - v)) + (y - v); + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd_q2_q2_q(Sleef_quad2 x, Sleef_quad y) { + // |x| >= |y| + + Sleef_quad2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y) || xfabsq(x.x) >= xfabsq(y))) { + fprintf(stderr, "[dqadd_q2_q2_q : %g %g]\n", (double)x.x, (double)y); + fflush(stderr); + } +#endif + + r.x = x.x + y; + r.y = x.x - r.x + y + x.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd2_q2_q2_q(Sleef_quad2 x, Sleef_quad y) { + // |x| >= |y| + + Sleef_quad2 r; + + r.x = x.x + y; + Sleef_quad v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y - v); + r.y += x.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd_q2_q_q2(Sleef_quad x, Sleef_quad2 y) { + // |x| >= |y| + + Sleef_quad2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y.x) || xfabsq(x) >= xfabsq(y.x))) { + fprintf(stderr, "[dqadd_q2_q_q2 : %g %g]\n", (double)x, (double)y.x); + fflush(stderr); + } +#endif + + r.x = x + y.x; + r.y = x - r.x + y.x + y.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd2_q2_q_q2(Sleef_quad x, Sleef_quad2 y) { + Sleef_quad2 r; + + r.x = x + y.x; + Sleef_quad v = r.x - x; + r.y = (x - (r.x - v)) + (y.x - v) + y.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd_q2_q2_q2(Sleef_quad2 x, Sleef_quad2 y) { + // |x| >= |y| + + Sleef_quad2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || xfabsq(x.x) >= xfabsq(y.x))) { + fprintf(stderr, "[dqadd_q2_q2_q2 : %g %g]\n", (double)x.x, (double)y.x); + fflush(stderr); + } +#endif + + r.x = x.x + y.x; + r.y = x.x - r.x + y.x + x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqadd2_q2_q2_q2(Sleef_quad2 x, Sleef_quad2 y) { + Sleef_quad2 r; + + r.x = x.x + y.x; + Sleef_quad v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y.x - v); + r.y += x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqsub_q2_q2_q2(Sleef_quad2 x, Sleef_quad2 y) { + // |x| >= |y| + + Sleef_quad2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || xfabsq(x.x) >= xfabsq(y.x))) { + fprintf(stderr, "[dqsub_q2_q2_q2 : %g %g]\n", (double)x.x, (double)y.x); + fflush(stderr); + } +#endif + + r.x = x.x - y.x; + r.y = x.x - r.x - y.x + x.y - y.y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqdiv_q2_q2_q2(Sleef_quad2 n, Sleef_quad2 d) { + Sleef_quad t = 1.0 / d.x; + Sleef_quad dh = upperq(d.x), dl = d.x - dh; + Sleef_quad th = upperq(t ), tl = t - th; + Sleef_quad nhh = upperq(n.x), nhl = n.x - nhh; + + Sleef_quad2 q; + + q.x = n.x * t; + + Sleef_quad u = -q.x + nhh * th + nhh * tl + nhl * th + nhl * tl + + q.x * (1 - dh * th - dh * tl - dl * th - dl * tl); + + q.y = t * (n.y - q.x * d.y) + u; + + return q; +} + +static INLINE CONST Sleef_quad2 dqmul_q2_q_q(Sleef_quad x, Sleef_quad y) { + Sleef_quad xh = upperq(x), xl = x - xh; + Sleef_quad yh = upperq(y), yl = y - yh; + Sleef_quad2 r; + + r.x = x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl; + + return r; +} + +static INLINE CONST Sleef_quad2 dqmul_q2_q2_q(Sleef_quad2 x, Sleef_quad y) { + Sleef_quad xh = upperq(x.x), xl = x.x - xh; + Sleef_quad yh = upperq(y ), yl = y - yh; + Sleef_quad2 r; + + r.x = x.x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.y * y; + + return r; +} + +static INLINE CONST Sleef_quad2 dqmul_q2_q2_q2(Sleef_quad2 x, Sleef_quad2 y) { + Sleef_quad xh = upperq(x.x), xl = x.x - xh; + Sleef_quad yh = upperq(y.x), yl = y.x - yh; + Sleef_quad2 r; + + r.x = x.x * y.x; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.x * y.y + x.y * y.x; + + return r; +} + +static INLINE CONST Sleef_quad2 dqsqu_q2_q2(Sleef_quad2 x) { + Sleef_quad xh = upperq(x.x), xl = x.x - xh; + Sleef_quad2 r; + + r.x = x.x * x.x; + r.y = xh * xh - r.x + (xh + xh) * xl + xl * xl + x.x * (x.y + x.y); + + return r; +} + +static INLINE CONST Sleef_quad2 dqrec_q2_q(Sleef_quad d) { + Sleef_quad t = 1.0 / d; + Sleef_quad dh = upperq(d), dl = d - dh; + Sleef_quad th = upperq(t), tl = t - th; + Sleef_quad2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl); + + return q; +} + +static INLINE CONST Sleef_quad2 dqrec_q2_q2(Sleef_quad2 d) { + Sleef_quad t = 1.0 / d.x; + Sleef_quad dh = upperq(d.x), dl = d.x - dh; + Sleef_quad th = upperq(t ), tl = t - th; + Sleef_quad2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl - d.y * t); + + return q; +} + +/* +static INLINE CONST Sleef_quad2 dqsqrt_q2_q2(Sleef_quad2 d) { + Sleef_quad t = sqrt(d.x + d.y); + return dqscale_q2_q2_q(dqmul_q2_q2_q2(dqadd2_q2_q2_q2(d, dqmul_q2_q_q(t, t)), dqrec_q2_q(t)), 0.5); +} +*/ + +// + +EXPORT CONST Sleef_quad2 xsincospiq_u05(Sleef_quad d) { + Sleef_quad u, s, t; + Sleef_quad2 r, x, s2; + + u = d * 4; + int64_t q = xceilq(u) & ~(int64_t)1; + + s = u - (Sleef_quad)q; + t = s; + s = s * s; + s2 = dqmul_q2_q_q(t, t); + + // + + u = +0.1528321016188828732764080161368244291e-27Q; + u = mlaq(u, s, -0.1494741498689376415859233754050616110e-24Q); + u = mlaq(u, s, +0.1226149947504428931621181953791777769e-21Q); + u = mlaq(u, s, -0.8348589834426964519785265770009675533e-19Q); + u = mlaq(u, s, +0.4628704628834415551415078707261146069e-16Q); + u = mlaq(u, s, -0.2041026339664143925641158896030605061e-13Q); + u = mlaq(u, s, +0.6948453273886629408492386065037620114e-11Q); + u = mlaq(u, s, -0.1757247673443401045145682042627557066e-8Q); + u = mlaq(u, s, +0.3133616890378121520950407496603902388e-6Q); + u = mlaq(u, s, -0.3657620418217725078660518698299784909e-4Q); + u = mlaq(u, s, +0.2490394570192720160015798421577395304e-2Q); + x = dqadd2_q2_q_q2(u * s, dq(-0.08074551218828078170696957048724322192457Q, 5.959584458773288360696286320980429277618e-36)); + x = dqadd2_q2_q2_q2(dqmul_q2_q2_q2(s2, x), dq(0.7853981633974483096156608458198756993698Q, 2.167745574452451779709844565881105067311e-35Q)); + + x = dqmul_q2_q2_q(x, t); + r.x = x.x + x.y; + + // + + u = -0.4616472554003168470361503708527464705e-29Q; + u = mlaq(u, s, +0.4891528531228245577148587028696897180e-26Q); + u = mlaq(u, s, -0.4377345071482935585011339656701961637e-23Q); + u = mlaq(u, s, +0.3278483561449753435303463083506802784e-20Q); + u = mlaq(u, s, -0.2019653396886554861865456720993185772e-17Q); + u = mlaq(u, s, +0.1001886461636271957275884859852184250e-14Q); + u = mlaq(u, s, -0.3898073171259675439843028673969857173e-12Q); + u = mlaq(u, s, +0.1150115912797405152263176921581706121e-9Q); + u = mlaq(u, s, -0.2461136950494199754009084018126527316e-7Q); + u = mlaq(u, s, +0.3590860448591510079069203991167071234e-5Q); + u = mlaq(u, s, -0.3259918869273900136414318317506198622e-3Q); + x = dqadd2_q2_q_q2(u * s, dq(0.01585434424381550085228521039855226376329Q, 6.529088663284413499535484912972485728198e-38Q)); + x = dqadd2_q2_q2_q2(dqmul_q2_q2_q2(s2, x), dq(-0.308425137534042456838577843746129712906Q, -1.006808646313642786855469666154064243572e-35Q)); + + x = dqadd2_q2_q2_q(dqmul_q2_q2_q2(x, s2), 1); + r.y = x.x + x.y; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (xisinfq(d)) { r.x = r.y = SLEEF_NANq; } + if (!xisinfq(d) && xfabsq(d) > TRIGRANGEMAX3) { r.x = r.y = 0; } + + return r; +} + +EXPORT CONST Sleef_quad2 xsincospiq_u35(Sleef_quad d) { + Sleef_quad u, s, t; + Sleef_quad2 r; + + u = d * 4; + int64_t q = xceilq(u) & ~(int64_t)1; + + s = u - (Sleef_quad)q; + t = s; + s = s * s; + + // + + u = -0.1485963032785725729464918728185622156e-24Q; + u = mlaq(u, s, +0.1226127943866088943202201676879490635e-21Q); + u = mlaq(u, s, -0.8348589518463078609690110857435995326e-19Q); + u = mlaq(u, s, +0.4628704628547538824855302470312741438e-16Q); + u = mlaq(u, s, -0.2041026339663972432248777826778586936e-13Q); + u = mlaq(u, s, +0.6948453273886628726907826757576187848e-11Q); + u = mlaq(u, s, -0.1757247673443401044967978719804318982e-8Q); + u = mlaq(u, s, +0.3133616890378121520950114757196589206e-6Q); + u = mlaq(u, s, -0.3657620418217725078660518414453815240e-4Q); + u = mlaq(u, s, +0.2490394570192720160015798421435124000e-2Q); + u = mlaq(u, s, -0.8074551218828078170696957048724041729e-1Q); + u = mlaq(u, s, +0.7853981633974483096156608458198756994e+0Q); + + r.x = u * t; + + // + + u = +0.4862670988511544771355006256522366302e-26Q; + u = mlaq(u, s, -0.4377265452147065611484052550741141029e-23Q); + u = mlaq(u, s, +0.3278483433857326331665386021267750285e-20Q); + u = mlaq(u, s, -0.2019653396755055912482006994709659430e-17Q); + u = mlaq(u, s, +0.1001886461636180795663169552615123249e-14Q); + u = mlaq(u, s, -0.3898073171259675007871885150022866077e-12Q); + u = mlaq(u, s, +0.1150115912797405152123832255915284811e-9Q); + u = mlaq(u, s, -0.2461136950494199754008784937314856168e-7Q); + u = mlaq(u, s, +0.3590860448591510079069203583263258862e-5Q); + u = mlaq(u, s, -0.3259918869273900136414318317180623832e-3Q); + u = mlaq(u, s, +0.1585434424381550085228521039855096075e-1Q); + u = mlaq(u, s, -0.3084251375340424568385778437461297129e+0Q); + u = mlaq(u, s, 1.0Q); + + r.y = u; + + // + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (xisinfq(d)) { r.x = r.y = SLEEF_NANq; } + if (!xisinfq(d) && xfabsq(d) > TRIGRANGEMAX3) { r.x = r.y = 0; } + + return r; +} + +// + +#ifdef ENABLE_MAIN +#include +#include +int main(int argc, char **argv) { + Sleef_quad a = -8.3998726984803832684266802333309369056312711821029e-09Q; + Sleef_quad2 q = xsincospiq_u05(a); + printf(" "); printf128(q.x); printf("\n"); + + /* + printf128(0.1Q); printf("\n"); + Sleef_quad2 q2 = dqmul_q2_q_q(0.1Q, 0.1Q); + printf128(q2.x); printf("\n"); + printf128(q2.y); printf("\n"); + */ + /* + printf("%s\n", toBCq(0.1Q)); + printf("%s\n", toBCq(upperq(0.1Q))); + printf("%s\n", toBCq(0.1Q-upperq(0.1Q))); + Sleef_quad2 q2 = dqmul_q2_q_q(0.1Q, 0.1Q); + printf("%s + ", toBCq(q2.x)); + printf("%s\n", toBCq(q2.y)); + */ +} +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimddp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimddp.c new file mode 100644 index 0000000000000..1d64424a0ef0d --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimddp.c @@ -0,0 +1,3741 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#if !defined(SLEEF_GENHEADER) +#include +#include +#include +#include +#endif + +#include "quaddef.h" +#include "misc.h" + +#ifndef SLEEF_ENABLE_CUDA +extern const double Sleef_rempitabdp[]; +#endif + +#define __SLEEFSIMDDP_C__ + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +// Intel + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#include "helpersse2.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamesse2_gnuabi.h" +#else +#include "renamesse2.h" +#endif +#endif +#endif + +#ifdef ENABLE_SSE4 +#define CONFIG 4 +#include "helpersse2.h" +#ifdef DORENAME +#include "renamesse4.h" +#endif +#endif + +#ifdef ENABLE_AVX +#define CONFIG 1 +#include "helperavx.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx_gnuabi.h" +#else +#include "renameavx.h" +#endif +#endif +#endif + +#ifdef ENABLE_FMA4 +#define CONFIG 4 +#include "helperavx.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamefma4_gnuabi.h" +#else +#include "renamefma4.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#include "helperavx2.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx2_gnuabi.h" +#else +#include "renameavx2.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#include "helperavx2_128.h" +#ifdef DORENAME +#include "renameavx2128.h" +#endif +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#include "helperavx512f.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx512f_gnuabi.h" +#else +#include "renameavx512f.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX512FNOFMA +#define CONFIG 2 +#include "helperavx512f.h" +#ifdef DORENAME +#include "renameavx512fnofma.h" +#endif +#endif + +// Arm + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#include "helperadvsimd.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameadvsimd_gnuabi.h" +#else +#include "renameadvsimd.h" +#endif +#endif +#endif + +#ifdef ENABLE_ADVSIMDNOFMA +#define CONFIG 2 +#include "helperadvsimd.h" +#ifdef DORENAME +#include "renameadvsimdnofma.h" +#endif +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#include "helpersve.h" +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamesve_gnuabi.h" +#else +#include "renamesve.h" +#endif /* ENABLE_GNUABI */ +#endif /* DORENAME */ +#endif /* ENABLE_SVE */ + +#ifdef ENABLE_SVENOFMA +#define CONFIG 2 +#include "helpersve.h" +#ifdef DORENAME +#include "renamesvenofma.h" +#endif /* DORENAME */ +#endif /* ENABLE_SVE */ + +// IBM + +#ifdef ENABLE_VSX +#define CONFIG 1 +#include "helperpower_128.h" +#ifdef DORENAME +#include "renamevsx.h" +#endif +#endif + +#ifdef ENABLE_VSXNOFMA +#define CONFIG 2 +#include "helperpower_128.h" +#ifdef DORENAME +#include "renamevsxnofma.h" +#endif +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#include "helperpower_128.h" +#ifdef DORENAME +#include "renamevsx3.h" +#endif +#endif + +#ifdef ENABLE_VSX3NOFMA +#define CONFIG 4 +#include "helperpower_128.h" +#ifdef DORENAME +#include "renamevsx3nofma.h" +#endif +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "renamevxe.h" +#endif +#endif + +#ifdef ENABLE_VXENOFMA +#define CONFIG 141 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "renamevxenofma.h" +#endif +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "renamevxe2.h" +#endif +#endif + +#ifdef ENABLE_VXE2NOFMA +#define CONFIG 151 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "renamevxe2nofma.h" +#endif +#endif + +// RISC-V +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "renamervvm1.h" +#endif +#endif + +#ifdef ENABLE_RVVM1NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "renamervvm1nofma.h" +#endif +#endif /* ENABLE_RVVM1NOFMA */ + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "renamervvm2.h" +#endif +#endif + +#ifdef ENABLE_RVVM2NOFMA +#define CONFIG 2 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "renamervvm2nofma.h" +#endif +#endif /* ENABLE_RVVM2NOFMA */ + +// Generic + +#ifdef ENABLE_VECEXT +#define CONFIG 1 +#include "helpervecext.h" +#ifdef DORENAME +#include "renamevecext.h" +#endif +#endif + +#ifdef ENABLE_PUREC +#define CONFIG 1 +#include "helperpurec.h" +#ifdef DORENAME +#include "renamepurec.h" +#endif +#endif + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "renamepurec_scalar.h" +#endif +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "renamepurecfma_scalar.h" +#endif +#endif + +#ifdef SLEEF_ENABLE_CUDA +#define CONFIG 3 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "renamecuda.h" +#endif +#endif + +// + +#define MLA(x, y, z) vmla_vd_vd_vd_vd((x), (y), (z)) +#define C2V(c) vcast_vd_d(c) +#include "estrin.h" + +// + +#include "dd.h" +#include "commonfuncs.h" + +// return d0 < d1 ? x : y +static INLINE CONST VECTOR_CC vint vsel_vi_vd_vd_vi_vi(vdouble d0, vdouble d1, vint x, vint y) { return vsel_vi_vo_vi_vi(vcast_vo32_vo64(vlt_vo_vd_vd(d0, d1)), x, y); } + +// return d0 < 0 ? x : 0 +static INLINE CONST VECTOR_CC vint vsel_vi_vd_vi(vdouble d, vint x) { return vand_vi_vo_vi(vcast_vo32_vo64(vsignbit_vo_vd(d)), x); } + +// + +EXPORT CONST VECTOR_CC vdouble xldexp(vdouble x, vint q) { return vldexp_vd_vd_vi(x, q); } + +EXPORT CONST VECTOR_CC vint xilogb(vdouble d) { + vdouble e = vcast_vd_vi(vilogbk_vi_vd(vabs_vd_vd(d))); + e = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_FP_ILOGB0), e); + e = vsel_vd_vo_vd_vd(visnan_vo_vd(d), vcast_vd_d(SLEEF_FP_ILOGBNAN), e); + e = vsel_vd_vo_vd_vd(visinf_vo_vd(d), vcast_vd_d(SLEEF_INT_MAX), e); + return vrint_vi_vd(e); +} + +static INLINE CONST ddi_t rempi(vdouble a) { + vdouble2 x, y; + vint ex = vilogb2k_vi_vd(a); +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + ex = vandnot_vi_vi_vi(vsra_vi_vi_i(ex, 31), ex); + ex = vand_vi_vi_vi(ex, vcast_vi_i(1023)); +#endif + ex = vsub_vi_vi_vi(ex, vcast_vi_i(55)); + vint q = vand_vi_vo_vi(vgt_vo_vi_vi(ex, vcast_vi_i(700-55)), vcast_vi_i(-64)); + a = vldexp3_vd_vd_vi(a, q); + ex = vandnot_vi_vi_vi(vsra_vi_vi_i(ex, 31), ex); + ex = vsll_vi_vi_i(ex, 2); + x = ddmul_vd2_vd_vd(a, vgather_vd_p_vi(Sleef_rempitabdp, ex)); + di_t di = rempisub(vd2getx_vd_vd2(x)); + q = digeti_vi_di(di); + x = vd2setx_vd2_vd2_vd(x, digetd_vd_di(di)); + x = ddnormalize_vd2_vd2(x); + y = ddmul_vd2_vd_vd(a, vgather_vd_p_vi(Sleef_rempitabdp+1, ex)); + x = ddadd2_vd2_vd2_vd2(x, y); + di = rempisub(vd2getx_vd_vd2(x)); + q = vadd_vi_vi_vi(q, digeti_vi_di(di)); + x = vd2setx_vd2_vd2_vd(x, digetd_vd_di(di)); + x = ddnormalize_vd2_vd2(x); + y = vcast_vd2_vd_vd(vgather_vd_p_vi(Sleef_rempitabdp+2, ex), vgather_vd_p_vi(Sleef_rempitabdp+3, ex)); + y = ddmul_vd2_vd2_vd(y, a); + x = ddadd2_vd2_vd2_vd2(x, y); + x = ddnormalize_vd2_vd2(x); + x = ddmul_vd2_vd2_vd2(x, vcast_vd2_d_d(3.141592653589793116*2, 1.2246467991473532072e-16*2)); + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(a), vcast_vd_d(0.7)); + x = vd2setx_vd2_vd2_vd(x, vsel_vd_vo_vd_vd(o, a, vd2getx_vd_vd2(x))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vandnot_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + return ddisetddi_ddi_vd2_vi(x, q); +} + +EXPORT CONST VECTOR_CC vdouble xsin(vdouble d) { +#if !defined(DETERMINISTIC) +// The SIMD source files(sleefsimd?p.c) are compiled twice for each +// vector extension, with DETERMINISTIC macro turned on and off. +// Below is the normal(faster) implementation of sin function. The +// function name xsin will be renamed to Sleef_sind2_u35sse2 with +// renamesse2.h, for example. + + vdouble u, s, r = d; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI))); + ql = vrint_vi_vd(dql); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2), d); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vmlapn_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), dqh)); + ql = vrint_vi_vd(dql); + + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A), d); + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B), d); + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C), d); + d = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D), d); + } else { + ddi_t ddi = rempi(d); + ql = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(2), vcast_vi_i(1))); + ql = vsra_vi_vi_i(ql, 2); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi))), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)))); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + d = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + d = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(r), visnan_vo_vd(r)), vreinterpret_vm_vd(d))); + } + + s = vmul_vd_vd_vd(d, d); + + d = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(d))); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd(vmul_vd_vd_vd(s, vmul_vd_vd_vd(u, d)), d); + + u = vsel_vd_vo_vd_vd(visnegzero_vo_vd(r), r, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + +// This is the deterministic implementation of sin function. Returned +// values from deterministic functions are bitwise consistent across +// all platforms. The function name xsin will be renamed to +// Sleef_cinz_sind2_u35sse2 with renamesse2.h, for example. The +// renaming by rename*.h is switched according to DETERMINISTIC macro. + vdouble u, s, r = d; + vint ql; + + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI))); + ql = vrint_vi_vd(dql); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2), d); + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(r), vcast_vd_d(TRIGRANGEMAX2)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(r, vcast_vd_d(M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vmlapn_vd_vd_vd_vd(r, vcast_vd_d(M_1_PI), dqh)); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A), r); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C), u); + u = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D), u); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + d = vsel_vd_vo_vd_vd(g, d, u); + g = vlt_vo_vd_vd(vabs_vd_vd(r), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(r); + vint ql2 = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(2), vcast_vi_i(1))); + ql2 = vsra_vi_vi_i(ql2, 2); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi))), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)))); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + u = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + d = vsel_vd_vo_vd_vd(g, d, u); + d = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(r), visnan_vo_vd(r)), vreinterpret_vm_vd(d))); + } + } + + s = vmul_vd_vd_vd(d, d); + + d = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(d))); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd(vmul_vd_vd_vd(s, vmul_vd_vd_vd(u, d)), d); + + u = vsel_vd_vo_vd_vd(visnegzero_vo_vd(r), r, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vdouble xsin_u1(vdouble d) { +#if !defined(DETERMINISTIC) + vdouble u; + vdouble2 s, t, x; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + const vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2))); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + const vdouble dql = vrint_vd_vd(vmlapn_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), dqh)); + ql = vrint_vi_vd(dql); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D))); + } else { + ddi_t ddi = rempi(d); + ql = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(2), vcast_vi_i(1))); + ql = vsra_vi_vi_i(ql, 2); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi))), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)))); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + s = ddnormalize_vd2_vd2(ddigetdd_vd2_ddi(ddi)); + s = vd2setx_vd2_vd2_vd(s, vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(vd2getx_vd_vd2(s))))); + } + + t = s; + s = ddsqu_vd2_vd2(s); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY6(vd2getx_vd_vd2(s), s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd2(ddadd_vd2_vd_vd(vcast_vd_d(-0.166666666666666657414808), vmul_vd_vd_vd(u, vd2getx_vd_vd2(s))), s)); + u = ddmul_vd_vd2_vd2(t, x); + + u = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))), + vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(u))); + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vdouble u; + vdouble2 s, t, x; + vint ql; + + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2), d); + x = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2))); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + const vdouble dql = vrint_vd_vd(vmlapn_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), dqh)); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + x = vsel_vd2_vo_vd2_vd2(g, x, s); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + vint ql2 = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(2), vcast_vi_i(1))); + ql2 = vsra_vi_vi_i(ql2, 2); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(1)); + vdouble2 t = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi))), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)))); + t = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), t); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), t, ddigetdd_vd2_ddi(ddi))); + s = ddnormalize_vd2_vd2(ddigetdd_vd2_ddi(ddi)); + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + x = vsel_vd2_vo_vd2_vd2(g, x, s); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + } + } + + t = x; + s = ddsqu_vd2_vd2(x); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY6(vd2getx_vd_vd2(s), s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd2(ddadd_vd2_vd_vd(vcast_vd_d(-0.166666666666666657414808), vmul_vd_vd_vd(u, vd2getx_vd_vd2(s))), s)); + u = ddmul_vd_vd2_vd2(t, x); + + u = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))), + vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(u))); + + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vdouble xcos(vdouble d) { +#if !defined(DETERMINISTIC) + vdouble u, s, r = d; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vmla_vd_vd_vd_vd(vcast_vd_d(2), + vrint_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), vcast_vd_d(-0.5))), + vcast_vd_d(1)); + ql = vrint_vi_vd(dql); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), d); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 23)), vcast_vd_d(-M_1_PI / (1 << 24)))); + ql = vrint_vi_vd(vadd_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI)), + vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-(1 << 23)), vcast_vd_d(-0.5)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vcast_vi_i(1)); + vdouble dql = vcast_vd_vi(ql); + + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), d); + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), d); + d = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), d); + d = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), d); + } else { + ddi_t ddi = rempi(d); + ql = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(8), vcast_vi_i(7))); + ql = vsra_vi_vi_i(ql, 1); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(0)); + vdouble y = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0)), vcast_vd_d(0), vcast_vd_d(-1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + d = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + d = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(r), visnan_vo_vd(r)), vreinterpret_vm_vd(d))); + } + + s = vmul_vd_vd_vd(d, d); + + d = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(0))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(d))); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd(vmul_vd_vd_vd(s, vmul_vd_vd_vd(u, d)), d); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vdouble u, s, r = d; + vint ql; + + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + vdouble dql = vmla_vd_vd_vd_vd(vcast_vd_d(2), + vrint_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), vcast_vd_d(-0.5))), + vcast_vd_d(1)); + ql = vrint_vi_vd(dql); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), d); + d = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), d); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmla_vd_vd_vd_vd(r, vcast_vd_d(M_1_PI / (1 << 23)), vcast_vd_d(-M_1_PI / (1 << 24)))); + vint ql2 = vrint_vi_vd(vadd_vd_vd_vd(vmul_vd_vd_vd(r, vcast_vd_d(M_1_PI)), + vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-(1 << 23)), vcast_vd_d(-0.5)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vcast_vi_i(1)); + vdouble dql = vcast_vd_vi(ql2); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), r); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), u); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + d = vsel_vd_vo_vd_vd(g, d, u); + g = vlt_vo_vd_vd(vabs_vd_vd(r), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(r); + vint ql2 = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(8), vcast_vi_i(7))); + ql2 = vsra_vi_vi_i(ql2, 1); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(0)); + vdouble y = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0)), vcast_vd_d(0), vcast_vd_d(-1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + u = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + d = vsel_vd_vo_vd_vd(g, d, u); + d = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(r), visnan_vo_vd(r)), vreinterpret_vm_vd(d))); + } + } + + s = vmul_vd_vd_vd(d, d); + + d = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(0))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(d))); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + -7.97255955009037868891952e-18, + 2.81009972710863200091251e-15, + -7.64712219118158833288484e-13, + 1.60590430605664501629054e-10, + -2.50521083763502045810755e-08, + 2.75573192239198747630416e-06, + -0.000198412698412696162806809, + 0.00833333333333332974823815); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666657414808)); + + u = vadd_vd_vd_vd(vmul_vd_vd_vd(s, vmul_vd_vd_vd(u, d)), d); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vdouble xcos_u1(vdouble d) { +#if !defined(DETERMINISTIC) + vdouble u; + vdouble2 s, t, x; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vrint_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), vcast_vd_d(-0.5))); + dql = vmla_vd_vd_vd_vd(vcast_vd_d(2), dql, vcast_vd_d(1)); + ql = vrint_vi_vd(dql); + s = ddadd2_vd2_vd_vd(d, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 23)), vcast_vd_d(-M_1_PI / (1 << 24)))); + ql = vrint_vi_vd(vadd_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI)), + vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-(1 << 23)), vcast_vd_d(-0.5)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vcast_vi_i(1)); + const vdouble dql = vcast_vd_vi(ql); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + s = ddadd2_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + } else { + ddi_t ddi = rempi(d); + ql = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql = vadd_vi_vi_vi(vadd_vi_vi_vi(ql, ql), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(8), vcast_vi_i(7))); + ql = vsra_vi_vi_i(ql, 1); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(0)); + vdouble y = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0)), vcast_vd_d(0), vcast_vd_d(-1)); + vdouble2 x = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), y)); + x = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), x); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), x, ddigetdd_vd2_ddi(ddi))); + s = ddnormalize_vd2_vd2(ddigetdd_vd2_ddi(ddi)); + s = vd2setx_vd2_vd2_vd(s, vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(vd2getx_vd_vd2(s))))); + } + + t = s; + s = ddsqu_vd2_vd2(s); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY6(vd2getx_vd_vd2(s), s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd2(ddadd_vd2_vd_vd(vcast_vd_d(-0.166666666666666657414808), vmul_vd_vd_vd(u, vd2getx_vd_vd2(s))), s)); + u = ddmul_vd_vd2_vd2(t, x); + + u = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(0))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(u))); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vdouble u; + vdouble2 s, t, x; + vint ql; + + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + vdouble dql = vrint_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI), vcast_vd_d(-0.5))); + dql = vmla_vd_vd_vd_vd(vcast_vd_d(2), dql, vcast_vd_d(1)); + ql = vrint_vi_vd(dql); + x = ddadd2_vd2_vd_vd(d, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5))); + x = ddadd_vd2_vd2_vd(x, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmla_vd_vd_vd_vd(d, vcast_vd_d(M_1_PI / (1 << 23)), vcast_vd_d(-M_1_PI / (1 << 24)))); + vint ql2 = vrint_vi_vd(vadd_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(M_1_PI)), + vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-(1 << 23)), vcast_vd_d(-0.5)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vcast_vi_i(1)); + const vdouble dql = vcast_vd_vi(ql2); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + s = ddadd2_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + x = vsel_vd2_vo_vd2_vd2(g, x, s); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + vint ql2 = vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(3)); + ql2 = vadd_vi_vi_vi(vadd_vi_vi_vi(ql2, ql2), vsel_vi_vo_vi_vi(vcast_vo32_vo64(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0))), vcast_vi_i(8), vcast_vi_i(7))); + ql2 = vsra_vi_vi_i(ql2, 1); + vopmask o = veq_vo_vi_vi(vand_vi_vi_vi(ddigeti_vi_ddi(ddi), vcast_vi_i(1)), vcast_vi_i(0)); + vdouble y = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vcast_vd_d(0)), vcast_vd_d(0), vcast_vd_d(-1)); + vdouble2 t = vcast_vd2_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(-3.141592653589793116 * 0.5), y), + vmulsign_vd_vd_vd(vcast_vd_d(-1.2246467991473532072e-16 * 0.5), y)); + t = ddadd2_vd2_vd2_vd2(ddigetdd_vd2_ddi(ddi), t); + ddi = ddisetdd_ddi_ddi_vd2(ddi, vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(o), t, ddigetdd_vd2_ddi(ddi))); + s = ddnormalize_vd2_vd2(ddigetdd_vd2_ddi(ddi)); + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + x = vsel_vd2_vo_vd2_vd2(g, x, s); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + } + } + + t = x; + s = ddsqu_vd2_vd2(x); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY6(vd2getx_vd_vd2(s), s2, s4, + 2.72052416138529567917983e-15, + -7.6429259411395447190023e-13, + 1.60589370117277896211623e-10, + -2.5052106814843123359368e-08, + 2.75573192104428224777379e-06, + -0.000198412698412046454654947); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.00833333333333318056201922)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd2(ddadd_vd2_vd_vd(vcast_vd_d(-0.166666666666666657414808), vmul_vd_vd_vd(u, vd2getx_vd_vd2(s))), s)); + u = ddmul_vd_vd2_vd2(t, x); + + u = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(0))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(u))); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +#ifdef ENABLE_GNUABI +#define TYPE2_FUNCATR static INLINE CONST +#define TYPE6_FUNCATR static INLINE CONST +#define SQRTU05_FUNCATR static INLINE CONST +#define XSINCOS sincosk +#define XSINCOS_U1 sincosk_u1 +#define XSINCOSPI_U05 sincospik_u05 +#define XSINCOSPI_U35 sincospik_u35 +#define XMODF modfk +#else +#define TYPE2_FUNCATR EXPORT +#define TYPE6_FUNCATR EXPORT CONST +#define SQRTU05_FUNCATR EXPORT CONST +#define XSINCOS xsincos +#define XSINCOS_U1 xsincos_u1 +#define XSINCOSPI_U05 xsincospi_u05 +#define XSINCOSPI_U35 xsincospi_u35 +#define XMODF xmodf +#endif + +TYPE2_FUNCATR VECTOR_CC vdouble2 XSINCOS(vdouble d) { +#if !defined(DETERMINISTIC) + vopmask o; + vdouble u, t, rx, ry, s; + vdouble2 r; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), d); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), s); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + ql = vrint_vi_vd(dql); + + s = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), s); + s = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), s); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), s); + s = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), s); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), s); + s = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), s); + } else { + ddi_t ddi = rempi(d); + ql = ddigeti_vi_ddi(ddi); + s = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + s = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(s))); + } + + t = s; + + s = vmul_vd_vd_vd(s, s); + + u = vcast_vd_d(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666130709393)); + + rx = vmla_vd_vd_vd_vd(vmul_vd_vd_vd(u, s), t, t); + rx = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), rx); + + u = vcast_vd_d(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.5)); + + ry = vmla_vd_vd_vd_vd(s, u, vcast_vd_d(1)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; + +#else // #if !defined(DETERMINISTIC) + + vopmask o; + vdouble u, t, rx, ry, s = d; + vdouble2 r; + vint ql; + + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(s, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), s); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), s); + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), u); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + s = vsel_vd_vo_vd_vd(g, s, u); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + u = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + u = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(u))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ddigeti_vi_ddi(ddi)); + s = vsel_vd_vo_vd_vd(g, s, u); + } + } + + t = s; + + s = vmul_vd_vd_vd(s, s); + + u = vcast_vd_d(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.166666666666666130709393)); + + rx = vmla_vd_vd_vd_vd(vmul_vd_vd_vd(u, s), t, t); + rx = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), rx); + + u = vcast_vd_d(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.5)); + + ry = vmla_vd_vd_vd_vd(s, u, vcast_vd_d(1)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; +#endif // #if !defined(DETERMINISTIC) +} + +TYPE2_FUNCATR VECTOR_CC vdouble2 XSINCOS_U1(vdouble d) { +#if !defined(DETERMINISTIC) + vopmask o; + vdouble u, rx, ry; + vdouble2 r, s, t, x; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + const vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + const vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + ql = vrint_vi_vd(dql); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + s = ddadd_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + } else { + ddi_t ddi = rempi(d); + ql = ddigeti_vi_ddi(ddi); + s = ddigetdd_vd2_ddi(ddi); + o = vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)); + s = vd2setxy_vd2_vd_vd(vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(s)))), + vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(s))))); + } + + t = s; + + s = vd2setx_vd2_vd2_vd(s, ddsqu_vd_vd2(s)); + + u = vcast_vd_d(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.166666666666666130709393)); + + u = vmul_vd_vd_vd(u, vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(t))); + + x = ddadd_vd2_vd2_vd(t, u); + rx = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + rx = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), rx); + + u = vcast_vd_d(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.5)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd_vd(vd2getx_vd_vd2(s), u)); + ry = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; + +#else // #if !defined(DETERMINISTIC) + + vopmask o; + vdouble u, rx, ry; + vdouble2 r, s, t, x; + vint ql; + + const vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + const vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + x = ddadd_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5))); + x = ddadd_vd2_vd2_vd(x, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + s = vsel_vd2_vo_vd2_vd2(g, s, x); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + x = ddigetdd_vd2_ddi(ddi); + o = vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ddigeti_vi_ddi(ddi)); + s = vsel_vd2_vo_vd2_vd2(g, s, x); + } + } + + t = s; + + s = vd2setx_vd2_vd2_vd(s, ddsqu_vd_vd2(s)); + + u = vcast_vd_d(1.58938307283228937328511e-10); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-2.50506943502539773349318e-08)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.75573131776846360512547e-06)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.000198412698278911770864914)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.0083333333333191845961746)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.166666666666666130709393)); + + u = vmul_vd_vd_vd(u, vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(t))); + + x = ddadd_vd2_vd2_vd(t, u); + rx = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + rx = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), rx); + + u = vcast_vd_d(-1.13615350239097429531523e-11); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.08757471207040055479366e-09)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-2.75573144028847567498567e-07)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(2.48015872890001867311915e-05)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.00138888888888714019282329)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(0.0416666666666665519592062)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(-0.5)); + + x = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd_vd(vd2getx_vd_vd2(s), u)); + ry = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(2)), vcast_vi_i(2))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; +#endif // #if !defined(DETERMINISTIC) +} + +#if !defined(DETERMINISTIC) +TYPE2_FUNCATR VECTOR_CC vdouble2 XSINCOSPI_U05(vdouble d) { + vopmask o; + vdouble u, s, t, rx, ry; + vdouble2 r, x, s2; + + u = vmul_vd_vd_vd(d, vcast_vd_d(4.0)); + vint q = vtruncate_vi_vd(u); + q = vand_vi_vi_vi(vadd_vi_vi_vi(q, vxor_vi_vi_vi(vsrl_vi_vi_i(q, 31), vcast_vi_i(1))), vcast_vi_i(~1)); + s = vsub_vd_vd_vd(u, vcast_vd_vi(q)); + + t = s; + s = vmul_vd_vd_vd(s, s); + s2 = ddmul_vd2_vd_vd(t, t); + + // + + u = vcast_vd_d(-2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(6.94821830580179461327784e-12)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(3.13361688966868392878422e-07)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-3.6576204182161551920361e-05)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(0.00249039457019271850274356)); + x = ddadd2_vd2_vd_vd2(vmul_vd_vd_vd(u, s), vcast_vd2_d_d(-0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2(ddmul_vd2_vd2_vd2(s2, x), vcast_vd2_d_d(0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd(x, t); + rx = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + rx = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), rx); + + // + + u = vcast_vd_d(9.94480387626843774090208e-16); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-3.89796226062932799164047e-13)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(1.15011582539996035266901e-10)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-2.4611369501044697495359e-08)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(3.59086044859052754005062e-06)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.000325991886927389905997954)); + x = ddadd2_vd2_vd_vd2(vmul_vd_vd_vd(u, s), vcast_vd2_d_d(0.0158543442438155018914259, -1.04693272280631521908845e-18)); + x = ddadd2_vd2_vd2_vd2(ddmul_vd2_vd2_vd2(s2, x), vcast_vd2_d_d(-0.308425137534042437259529, -1.95698492133633550338345e-17)); + + x = ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd2(x, s2), vcast_vd_d(1)); + ry = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + // + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(4)), vcast_vi_i(4))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(4)), vcast_vi_i(4))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + o = vgt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX3/4)); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vandnot_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + r = vd2sety_vd2_vd2_vd(r, vsel_vd_vo_vd_vd(o, vcast_vd_d(1), vd2gety_vd_vd2(r))); + + o = visinf_vo_vd(d); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; +} + +TYPE2_FUNCATR VECTOR_CC vdouble2 XSINCOSPI_U35(vdouble d) { + vopmask o; + vdouble u, s, t, rx, ry; + vdouble2 r; + + u = vmul_vd_vd_vd(d, vcast_vd_d(4.0)); + vint q = vtruncate_vi_vd(u); + q = vand_vi_vi_vi(vadd_vi_vi_vi(q, vxor_vi_vi_vi(vsrl_vi_vi_i(q, 31), vcast_vi_i(1))), vcast_vi_i(~1)); + s = vsub_vd_vd_vd(u, vcast_vd_vi(q)); + + t = s; + s = vmul_vd_vd_vd(s, s); + + // + + u = vcast_vd_d(+0.6880638894766060136e-11); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.1757159564542310199e-8)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.3133616327257867311e-6)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.3657620416388486452e-4)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.2490394570189932103e-2)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.8074551218828056320e-1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.7853981633974482790e+0)); + + rx = vmul_vd_vd_vd(u, t); + + // + + u = vcast_vd_d(-0.3860141213683794352e-12); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1150057888029681415e-9)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.2461136493006663553e-7)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.3590860446623516713e-5)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.3259918869269435942e-3)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1585434424381541169e-1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(-0.3084251375340424373e+0)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(1)); + + ry = u; + + // + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(0))); + r = vd2setxy_vd2_vd_vd(vsel_vd_vo_vd_vd(o, rx, ry), vsel_vd_vo_vd_vd(o, ry, rx)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(4)), vcast_vi_i(4))); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(4)), vcast_vi_i(4))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + o = vgt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX3/4)); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vandnot_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vandnot_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + o = visinf_vo_vd(d); + r = vd2setx_vd2_vd2_vd(r, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(r))))); + r = vd2sety_vd2_vd2_vd(r, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(r))))); + + return r; +} + +TYPE6_FUNCATR VECTOR_CC vdouble2 XMODF(vdouble x) { + vdouble fr = vsub_vd_vd_vd(x, vmul_vd_vd_vd(vcast_vd_d(INT64_C(1) << 31), vcast_vd_vi(vtruncate_vi_vd(vmul_vd_vd_vd(x, vcast_vd_d(1.0 / (INT64_C(1) << 31))))))); + fr = vsub_vd_vd_vd(fr, vcast_vd_vi(vtruncate_vi_vd(fr))); + fr = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(INT64_C(1) << 52)), vcast_vd_d(0), fr); + + vdouble2 ret; + + ret = vd2setxy_vd2_vd_vd(vcopysign_vd_vd_vd(fr, x), vcopysign_vd_vd_vd(vsub_vd_vd_vd(x, fr), x)); + + return ret; +} + +#ifdef ENABLE_GNUABI +EXPORT VECTOR_CC void xsincos(vdouble a, double *ps, double *pc) { + vdouble2 r = sincosk(a); + vstoreu_v_p_vd(ps, vd2getx_vd_vd2(r)); + vstoreu_v_p_vd(pc, vd2gety_vd_vd2(r)); +} + +EXPORT VECTOR_CC void xsincos_u1(vdouble a, double *ps, double *pc) { + vdouble2 r = sincosk_u1(a); + vstoreu_v_p_vd(ps, vd2getx_vd_vd2(r)); + vstoreu_v_p_vd(pc, vd2gety_vd_vd2(r)); +} + +EXPORT VECTOR_CC void xsincospi_u05(vdouble a, double *ps, double *pc) { + vdouble2 r = sincospik_u05(a); + vstoreu_v_p_vd(ps, vd2getx_vd_vd2(r)); + vstoreu_v_p_vd(pc, vd2gety_vd_vd2(r)); +} + +EXPORT VECTOR_CC void xsincospi_u35(vdouble a, double *ps, double *pc) { + vdouble2 r = sincospik_u35(a); + vstoreu_v_p_vd(ps, vd2getx_vd_vd2(r)); + vstoreu_v_p_vd(pc, vd2gety_vd_vd2(r)); +} + +EXPORT CONST VECTOR_CC vdouble xmodf(vdouble a, double *iptr) { + vdouble2 r = modfk(a); + vstoreu_v_p_vd(iptr, vd2gety_vd_vd2(r)); + return vd2getx_vd_vd2(r); +} +#endif // #ifdef ENABLE_GNUABI +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vdouble2 sinpik(vdouble d) { + vopmask o; + vdouble u, s, t; + vdouble2 x, s2; + + u = vmul_vd_vd_vd(d, vcast_vd_d(4.0)); + vint q = vtruncate_vi_vd(u); + q = vand_vi_vi_vi(vadd_vi_vi_vi(q, vxor_vi_vi_vi(vsrl_vi_vi_i(q, 31), vcast_vi_i(1))), vcast_vi_i(~1)); + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(2))); + + s = vsub_vd_vd_vd(u, vcast_vd_vi(q)); + t = s; + s = vmul_vd_vd_vd(s, s); + s2 = ddmul_vd2_vd_vd(t, t); + + // + + u = vsel_vd_vo_d_d(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2(vmul_vd_vd_vd(u, s), + vsel_vd2_vo_d_d_d_d(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2(ddmul_vd2_vd2_vd2(s2, x), + vsel_vd2_vo_d_d_d_d(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2(x, vsel_vd2_vo_vd2_vd2(o, s2, vcast_vd2_vd_vd(t, vcast_vd_d(0)))); + x = vsel_vd2_vo_vd2_vd2(o, ddadd2_vd2_vd2_vd(x, vcast_vd_d(1)), x); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(4)), vcast_vi_i(4))); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + + return x; +} + +EXPORT CONST VECTOR_CC vdouble xsinpi_u05(vdouble d) { + vdouble2 x = sinpik(d); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + r = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), r); + r = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vgt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX3/4)), vreinterpret_vm_vd(r))); + r = vreinterpret_vd_vm(vor_vm_vo64_vm(visinf_vo_vd(d), vreinterpret_vm_vd(r))); + + return r; +} + +static INLINE CONST VECTOR_CC vdouble2 cospik(vdouble d) { + vopmask o; + vdouble u, s, t; + vdouble2 x, s2; + + u = vmul_vd_vd_vd(d, vcast_vd_d(4.0)); + vint q = vtruncate_vi_vd(u); + q = vand_vi_vi_vi(vadd_vi_vi_vi(q, vxor_vi_vi_vi(vsrl_vi_vi_i(q, 31), vcast_vi_i(1))), vcast_vi_i(~1)); + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(0))); + + s = vsub_vd_vd_vd(u, vcast_vd_vi(q)); + t = s; + s = vmul_vd_vd_vd(s, s); + s2 = ddmul_vd2_vd_vd(t, t); + + // + + u = vsel_vd_vo_d_d(o, 9.94480387626843774090208e-16, -2.02461120785182399295868e-14); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -3.89796226062932799164047e-13, 6.948218305801794613277840e-12)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, 1.150115825399960352669010e-10, -1.75724749952853179952664e-09)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -2.46113695010446974953590e-08, 3.133616889668683928784220e-07)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, 3.590860448590527540050620e-06, -3.65762041821615519203610e-05)); + u = vmla_vd_vd_vd_vd(u, s, vsel_vd_vo_d_d(o, -0.000325991886927389905997954, 0.0024903945701927185027435600)); + x = ddadd2_vd2_vd_vd2(vmul_vd_vd_vd(u, s), + vsel_vd2_vo_d_d_d_d(o, 0.0158543442438155018914259, -1.04693272280631521908845e-18, + -0.0807455121882807852484731, 3.61852475067037104849987e-18)); + x = ddadd2_vd2_vd2_vd2(ddmul_vd2_vd2_vd2(s2, x), + vsel_vd2_vo_d_d_d_d(o, -0.308425137534042437259529, -1.95698492133633550338345e-17, + 0.785398163397448278999491, 3.06287113727155002607105e-17)); + + x = ddmul_vd2_vd2_vd2(x, vsel_vd2_vo_vd2_vd2(o, s2, vcast_vd2_vd_vd(t, vcast_vd_d(0)))); + x = vsel_vd2_vo_vd2_vd2(o, ddadd2_vd2_vd2_vd(x, vcast_vd_d(1)), x); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(vadd_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(4)), vcast_vi_i(4))); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + + return x; +} + +EXPORT CONST VECTOR_CC vdouble xcospi_u05(vdouble d) { + vdouble2 x = cospik(d); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + r = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX3/4)), vcast_vd_d(1), r); + r = vreinterpret_vd_vm(vor_vm_vo64_vm(visinf_vo_vd(d), vreinterpret_vm_vd(r))); + + return r; +} + +EXPORT CONST VECTOR_CC vdouble xtan(vdouble d) { +#if !defined(DETERMINISTIC) + vdouble u, s, x, y; + vopmask o; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + x = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), d); + x = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), x); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(1e+6))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + ql = vrint_vi_vd(dql); + + x = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + x = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), x); + x = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), x); + x = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), x); + x = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), x); + x = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), x); + x = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), x); + } else { + ddi_t ddi = rempi(d); + ql = ddigeti_vi_ddi(ddi); + x = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + x = vreinterpret_vd_vm(vor_vm_vo64_vm(visinf_vo_vd(d), vreinterpret_vm_vd(x))); + x = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(x))); + } + + x = vmul_vd_vd_vd(x, vcast_vd_d(0.5)); + s = vmul_vd_vd_vd(x, x); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.3333333333333343695e+0)); + u = vmla_vd_vd_vd_vd(s, vmul_vd_vd_vd(u, x), x); + + y = vmla_vd_vd_vd_vd(u, u, vcast_vd_d(-1)); + x = vmul_vd_vd_vd(u, vcast_vd_d(-2)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))); + u = vdiv_vd_vd_vd(vsel_vd_vo_vd_vd(o, vneg_vd_vd(y), x), + vsel_vd_vo_vd_vd(o, x, y)); + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vdouble u, s, x, y; + vopmask o; + vint ql; + + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2 * 0.5), d); + s = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B2 * 0.5), s); + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + vdouble dql = vrint_vd_vd(vsub_vd_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI)), dqh)); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_B * 0.5), u); + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_C * 0.5), u); + u = vmla_vd_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D * 0.5), u); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + s = vsel_vd_vo_vd_vd(g, s, u); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(1e+6)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + vint ql2 = ddigeti_vi_ddi(ddi); + u = vadd_vd_vd_vd(vd2getx_vd_vd2(ddigetdd_vd2_ddi(ddi)), vd2gety_vd_vd2(ddigetdd_vd2_ddi(ddi))); + u = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)), vreinterpret_vm_vd(u))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ql2); + s = vsel_vd_vo_vd_vd(g, s, u); + } + } + + x = vmul_vd_vd_vd(s, vcast_vd_d(0.5)); + s = vmul_vd_vd_vd(x, x); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(s, s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.3333333333333343695e+0)); + u = vmla_vd_vd_vd_vd(s, vmul_vd_vd_vd(u, x), x); + + y = vmla_vd_vd_vd_vd(u, u, vcast_vd_d(-1)); + x = vmul_vd_vd_vd(u, vcast_vd_d(-2)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))); + u = vdiv_vd_vd_vd(vsel_vd_vo_vd_vd(o, vneg_vd_vd(y), x), + vsel_vd_vo_vd_vd(o, x, y)); + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vdouble xtan_u1(vdouble d) { +#if !defined(DETERMINISTIC) + vdouble u; + vdouble2 s, t, x, y; + vopmask o; + vint ql; + + if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2))))) { + vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + } else if (LIKELY(vtestallones_i_vo64(vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX))))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + s = ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd(vcast_vd2_d_d(M_2_PI_H, M_2_PI_L), d), + vsub_vd_vd_vd(vsel_vd_vo_vd_vd(vlt_vo_vd_vd(d, vcast_vd_d(0)), + vcast_vd_d(-0.5), vcast_vd_d(0.5)), dqh)); + const vdouble dql = vtruncate_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s))); + ql = vrint_vi_vd(dql); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + s = ddadd_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5 ))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5 ))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5 ))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + } else { + ddi_t ddi = rempi(d); + ql = ddigeti_vi_ddi(ddi); + s = ddigetdd_vd2_ddi(ddi); + o = vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)); + s = vd2setx_vd2_vd2_vd(s, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(s))))); + s = vd2sety_vd2_vd2_vd(s, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(s))))); + } + + t = ddscale_vd2_vd2_vd(s, vcast_vd_d(0.5)); + s = ddsqu_vd2_vd2(t); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(vd2getx_vd_vd2(s), s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(+0.3333333333333343695e+0)); + x = ddadd_vd2_vd2_vd2(t, ddmul_vd2_vd2_vd(ddmul_vd2_vd2_vd2(s, t), u)); + + y = ddadd_vd2_vd_vd2(vcast_vd_d(-1), ddsqu_vd2_vd2(x)); + x = ddscale_vd2_vd2_vd(x, vcast_vd_d(-2)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))); + + x = dddiv_vd2_vd2_vd2(vsel_vd2_vo_vd2_vd2(o, ddneg_vd2_vd2(y), x), + vsel_vd2_vo_vd2_vd2(o, x, y)); + + u = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vdouble u; + vdouble2 s, t, x, y; + vopmask o; + vint ql; + + const vdouble dql = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2 * M_1_PI))); + ql = vrint_vi_vd(dql); + u = vmla_vd_vd_vd_vd(dql, vcast_vd_d(-PI_A2*0.5), d); + s = ddadd_vd2_vd_vd (u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B2*0.5))); + vopmask g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX2)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + vdouble dqh = vtruncate_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(2*M_1_PI / (1 << 24)))); + dqh = vmul_vd_vd_vd(dqh, vcast_vd_d(1 << 24)); + x = ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd(vcast_vd2_d_d(M_2_PI_H, M_2_PI_L), d), + vsub_vd_vd_vd(vsel_vd_vo_vd_vd(vlt_vo_vd_vd(d, vcast_vd_d(0)), + vcast_vd_d(-0.5), vcast_vd_d(0.5)), dqh)); + const vdouble dql = vtruncate_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x))); + + u = vmla_vd_vd_vd_vd(dqh, vcast_vd_d(-PI_A * 0.5), d); + x = ddadd_vd2_vd_vd(u, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_A*0.5 ))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_B*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_B*0.5 ))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dqh, vcast_vd_d(-PI_C*0.5))); + x = ddadd2_vd2_vd2_vd(x, vmul_vd_vd_vd(dql, vcast_vd_d(-PI_C*0.5 ))); + x = ddadd_vd2_vd2_vd(x, vmul_vd_vd_vd(vadd_vd_vd_vd(dqh, dql), vcast_vd_d(-PI_D*0.5))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, vrint_vi_vd(dql)); + s = vsel_vd2_vo_vd2_vd2(g, s, x); + g = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(TRIGRANGEMAX)); + + if (!LIKELY(vtestallones_i_vo64(g))) { + ddi_t ddi = rempi(d); + x = ddigetdd_vd2_ddi(ddi); + o = vor_vo_vo_vo(visinf_vo_vd(d), visnan_vo_vd(d)); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vor_vm_vo64_vm(o, vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + + ql = vsel_vi_vo_vi_vi(vcast_vo32_vo64(g), ql, ddigeti_vi_ddi(ddi)); + s = vsel_vd2_vo_vd2_vd2(g, s, x); + } + } + + t = ddscale_vd2_vd2_vd(s, vcast_vd_d(0.5)); + s = ddsqu_vd2_vd2(t); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2); + u = POLY8(vd2getx_vd_vd2(s), s2, s4, + +0.3245098826639276316e-3, + +0.5619219738114323735e-3, + +0.1460781502402784494e-2, + +0.3591611540792499519e-2, + +0.8863268409563113126e-2, + +0.2186948728185535498e-1, + +0.5396825399517272970e-1, + +0.1333333333330500581e+0); + + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(s), vcast_vd_d(+0.3333333333333343695e+0)); + x = ddadd_vd2_vd2_vd2(t, ddmul_vd2_vd2_vd(ddmul_vd2_vd2_vd2(s, t), u)); + + y = ddadd_vd2_vd_vd2(vcast_vd_d(-1), ddsqu_vd2_vd2(x)); + x = ddscale_vd2_vd2_vd(x, vcast_vd_d(-2)); + + o = vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(ql, vcast_vi_i(1)), vcast_vi_i(1))); + + x = dddiv_vd2_vd2_vd2(vsel_vd2_vo_vd2_vd2(o, ddneg_vd2_vd2(y), x), + vsel_vd2_vo_vd2_vd2(o, x, y)); + + u = vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)); + + u = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +static INLINE CONST VECTOR_CC vdouble atan2k(vdouble y, vdouble x) { + vdouble s, t, u; + vint q; + vopmask p; + + q = vsel_vi_vd_vi(x, vcast_vi_i(-2)); + x = vabs_vd_vd(x); + + q = vsel_vi_vd_vd_vi_vi(x, y, vadd_vi_vi_vi(q, vcast_vi_i(1)), q); + p = vlt_vo_vd_vd(x, y); + s = vsel_vd_vo_vd_vd(p, vneg_vd_vd(x), y); + t = vmax_vd_vd_vd(x, y); + + s = vdiv_vd_vd_vd(s, t); + t = vmul_vd_vd_vd(s, s); + + vdouble t2 = vmul_vd_vd_vd(t, t), t4 = vmul_vd_vd_vd(t2, t2), t8 = vmul_vd_vd_vd(t4, t4), t16 = vmul_vd_vd_vd(t8, t8); + u = POLY19(t, t2, t4, t8, t16, + -1.88796008463073496563746e-05, + 0.000209850076645816976906797, + -0.00110611831486672482563471, + 0.00370026744188713119232403, + -0.00889896195887655491740809, + 0.016599329773529201970117, + -0.0254517624932312641616861, + 0.0337852580001353069993897, + -0.0407629191276836500001934, + 0.0466667150077840625632675, + -0.0523674852303482457616113, + 0.0587666392926673580854313, + -0.0666573579361080525984562, + 0.0769219538311769618355029, + -0.090908995008245008229153, + 0.111111105648261418443745, + -0.14285714266771329383765, + 0.199999999996591265594148, + -0.333333333333311110369124); + + t = vmla_vd_vd_vd_vd(s, vmul_vd_vd_vd(t, u), s); + t = vmla_vd_vd_vd_vd(vcast_vd_vi(q), vcast_vd_d(M_PI/2), t); + + return t; +} + +static INLINE CONST VECTOR_CC vdouble2 atan2k_u1(vdouble2 y, vdouble2 x) { + vdouble u; + vdouble2 s, t; + vint q; + vopmask p; + + q = vsel_vi_vd_vi(vd2getx_vd_vd2(x), vcast_vi_i(-2)); + p = vlt_vo_vd_vd(vd2getx_vd_vd2(x), vcast_vd_d(0)); + vmask b = vand_vm_vo64_vm(p, vreinterpret_vm_vd(vcast_vd_d(-0.0))); + x = vd2setx_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(b, vreinterpret_vm_vd(vd2getx_vd_vd2(x))))); + x = vd2sety_vd2_vd2_vd(x, vreinterpret_vd_vm(vxor_vm_vm_vm(b, vreinterpret_vm_vd(vd2gety_vd_vd2(x))))); + + q = vsel_vi_vd_vd_vi_vi(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y), vadd_vi_vi_vi(q, vcast_vi_i(1)), q); + p = vlt_vo_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + s = vsel_vd2_vo_vd2_vd2(p, ddneg_vd2_vd2(x), y); + t = vsel_vd2_vo_vd2_vd2(p, y, x); + + s = dddiv_vd2_vd2_vd2(s, t); + t = ddsqu_vd2_vd2(s); + t = ddnormalize_vd2_vd2(t); + + vdouble t2 = vmul_vd_vd_vd(vd2getx_vd_vd2(t), vd2getx_vd_vd2(t)), t4 = vmul_vd_vd_vd(t2, t2), t8 = vmul_vd_vd_vd(t4, t4); + u = POLY16(vd2getx_vd_vd2(t), t2, t4, t8, + 1.06298484191448746607415e-05, + -0.000125620649967286867384336, + 0.00070557664296393412389774, + -0.00251865614498713360352999, + 0.00646262899036991172313504, + -0.0128281333663399031014274, + 0.0208024799924145797902497, + -0.0289002344784740315686289, + 0.0359785005035104590853656, + -0.041848579703592507506027, + 0.0470843011653283988193763, + -0.0524914210588448421068719, + 0.0587946590969581003860434, + -0.0666620884778795497194182, + 0.0769225330296203768654095, + -0.0909090442773387574781907); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(t), vcast_vd_d(0.111111108376896236538123)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(t), vcast_vd_d(-0.142857142756268568062339)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(t), vcast_vd_d(0.199999999997977351284817)); + u = vmla_vd_vd_vd_vd(u, vd2getx_vd_vd2(t), vcast_vd_d(-0.333333333333317605173818)); + + t = ddadd_vd2_vd2_vd2(s, ddmul_vd2_vd2_vd(ddmul_vd2_vd2_vd2(s, t), u)); + + t = ddadd_vd2_vd2_vd2(ddmul_vd2_vd2_vd(vcast_vd2_d_d(1.570796326794896557998982, 6.12323399573676603586882e-17), vcast_vd_vi(q)), t); + + return t; +} + +static INLINE CONST VECTOR_CC vdouble visinf2_vd_vd_vd(vdouble d, vdouble m) { + return vreinterpret_vd_vm(vand_vm_vo64_vm(visinf_vo_vd(d), vor_vm_vm_vm(vand_vm_vm_vm(vreinterpret_vm_vd(d), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(m)))); +} + +EXPORT CONST VECTOR_CC vdouble xatan2(vdouble y, vdouble x) { + vdouble r = atan2k(vabs_vd_vd(y), x); + + r = vmulsign_vd_vd_vd(r, x); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visinf_vo_vd(x), veq_vo_vd_vd(x, vcast_vd_d(0))), vsub_vd_vd_vd(vcast_vd_d(M_PI/2), visinf2_vd_vd_vd(x, vmulsign_vd_vd_vd(vcast_vd_d(M_PI/2), x))), r); + r = vsel_vd_vo_vd_vd(visinf_vo_vd(y), vsub_vd_vd_vd(vcast_vd_d(M_PI/2), visinf2_vd_vd_vd(x, vmulsign_vd_vd_vd(vcast_vd_d(M_PI/4), x))), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(y, vcast_vd_d(0.0)), vreinterpret_vd_vm(vand_vm_vo64_vm(vsignbit_vo_vd(x), vreinterpret_vm_vd(vcast_vd_d(M_PI)))), r); + + r = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vreinterpret_vm_vd(vmulsign_vd_vd_vd(r, y)))); + return r; +} + +EXPORT CONST VECTOR_CC vdouble xatan2_u1(vdouble y, vdouble x) { + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(5.5626846462680083984e-309)); // nexttoward((1.0 / DBL_MAX), 1) + x = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(x, vcast_vd_d(UINT64_C(1) << 53)), x); + y = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(y, vcast_vd_d(UINT64_C(1) << 53)), y); + + vdouble2 d = atan2k_u1(vcast_vd2_vd_vd(vabs_vd_vd(y), vcast_vd_d(0)), vcast_vd2_vd_vd(x, vcast_vd_d(0))); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)); + + r = vmulsign_vd_vd_vd(r, x); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visinf_vo_vd(x), veq_vo_vd_vd(x, vcast_vd_d(0))), vsub_vd_vd_vd(vcast_vd_d(M_PI/2), visinf2_vd_vd_vd(x, vmulsign_vd_vd_vd(vcast_vd_d(M_PI/2), x))), r); + r = vsel_vd_vo_vd_vd(visinf_vo_vd(y), vsub_vd_vd_vd(vcast_vd_d(M_PI/2), visinf2_vd_vd_vd(x, vmulsign_vd_vd_vd(vcast_vd_d(M_PI/4), x))), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(y, vcast_vd_d(0.0)), vreinterpret_vd_vm(vand_vm_vo64_vm(vsignbit_vo_vd(x), vreinterpret_vm_vd(vcast_vd_d(M_PI)))), r); + + r = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vreinterpret_vm_vd(vmulsign_vd_vd_vd(r, y)))); + return r; +} + +EXPORT CONST VECTOR_CC vdouble xasin(vdouble d) { + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(0.5)); + vdouble x2 = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, d), vmul_vd_vd_vd(vsub_vd_vd_vd(vcast_vd_d(1), vabs_vd_vd(d)), vcast_vd_d(0.5))); + vdouble x = vsel_vd_vo_vd_vd(o, vabs_vd_vd(d), vsqrt_vd_vd(x2)), u; + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u = vmla_vd_vd_vd_vd(u, vmul_vd_vd_vd(x, x2), x); + + vdouble r = vsel_vd_vo_vd_vd(o, u, vmla_vd_vd_vd_vd(u, vcast_vd_d(-2), vcast_vd_d(M_PI/2))); + return vmulsign_vd_vd_vd(r, d); +} + +EXPORT CONST VECTOR_CC vdouble xasin_u1(vdouble d) { + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(0.5)); + vdouble x2 = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, d), vmul_vd_vd_vd(vsub_vd_vd_vd(vcast_vd_d(1), vabs_vd_vd(d)), vcast_vd_d(0.5))), u; + vdouble2 x = vsel_vd2_vo_vd2_vd2(o, vcast_vd2_vd_vd(vabs_vd_vd(d), vcast_vd_d(0)), ddsqrt_vd2_vd(x2)); + x = vsel_vd2_vo_vd2_vd2(veq_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(1.0)), vcast_vd2_d_d(0, 0), x); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u = vmul_vd_vd_vd(u, vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x))); + + vdouble2 y = ddsub_vd2_vd2_vd(ddsub_vd2_vd2_vd2(vcast_vd2_d_d(3.141592653589793116/4, 1.2246467991473532072e-16/4), x), u); + + vdouble r = vsel_vd_vo_vd_vd(o, vadd_vd_vd_vd(u, vd2getx_vd_vd2(x)), + vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(y), vd2gety_vd_vd2(y)), vcast_vd_d(2))); + return vmulsign_vd_vd_vd(r, d); +} + +EXPORT CONST VECTOR_CC vdouble xacos(vdouble d) { + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(0.5)); + vdouble x2 = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, d), + vmul_vd_vd_vd(vsub_vd_vd_vd(vcast_vd_d(1), vabs_vd_vd(d)), vcast_vd_d(0.5))), u; + vdouble x = vsel_vd_vo_vd_vd(o, vabs_vd_vd(d), vsqrt_vd_vd(x2)); + x = vsel_vd_vo_vd_vd(veq_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(1.0)), vcast_vd_d(0), x); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u = vmul_vd_vd_vd(u, vmul_vd_vd_vd(x2, x)); + + vdouble y = vsub_vd_vd_vd(vcast_vd_d(M_PI/2), vadd_vd_vd_vd(vmulsign_vd_vd_vd(x, d), vmulsign_vd_vd_vd(u, d))); + x = vadd_vd_vd_vd(x, u); + vdouble r = vsel_vd_vo_vd_vd(o, y, vmul_vd_vd_vd(x, vcast_vd_d(2))); + return vsel_vd_vo_vd_vd(vandnot_vo_vo_vo(o, vlt_vo_vd_vd(d, vcast_vd_d(0))), + vd2getx_vd_vd2(ddadd_vd2_vd2_vd(vcast_vd2_d_d(3.141592653589793116, 1.2246467991473532072e-16), + vneg_vd_vd(r))), r); +} + +EXPORT CONST VECTOR_CC vdouble xacos_u1(vdouble d) { + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(0.5)); + vdouble x2 = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, d), vmul_vd_vd_vd(vsub_vd_vd_vd(vcast_vd_d(1), vabs_vd_vd(d)), vcast_vd_d(0.5))), u; + vdouble2 x = vsel_vd2_vo_vd2_vd2(o, vcast_vd2_vd_vd(vabs_vd_vd(d), vcast_vd_d(0)), ddsqrt_vd2_vd(x2)); + x = vsel_vd2_vo_vd2_vd2(veq_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(1.0)), vcast_vd2_d_d(0, 0), x); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + u = POLY12(x2, x4, x8, x16, + +0.3161587650653934628e-1, + -0.1581918243329996643e-1, + +0.1929045477267910674e-1, + +0.6606077476277170610e-2, + +0.1215360525577377331e-1, + +0.1388715184501609218e-1, + +0.1735956991223614604e-1, + +0.2237176181932048341e-1, + +0.3038195928038132237e-1, + +0.4464285681377102438e-1, + +0.7500000000378581611e-1, + +0.1666666666666497543e+0); + + u = vmul_vd_vd_vd(u, vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x))); + + vdouble2 y = ddsub_vd2_vd2_vd2(vcast_vd2_d_d(3.141592653589793116/2, 1.2246467991473532072e-16/2), + ddadd_vd2_vd_vd(vmulsign_vd_vd_vd(vd2getx_vd_vd2(x), d), vmulsign_vd_vd_vd(u, d))); + x = ddadd_vd2_vd2_vd(x, u); + + y = vsel_vd2_vo_vd2_vd2(o, y, ddscale_vd2_vd2_vd(x, vcast_vd_d(2))); + + y = vsel_vd2_vo_vd2_vd2(vandnot_vo_vo_vo(o, vlt_vo_vd_vd(d, vcast_vd_d(0))), + ddsub_vd2_vd2_vd2(vcast_vd2_d_d(3.141592653589793116, 1.2246467991473532072e-16), y), y); + + return vadd_vd_vd_vd(vd2getx_vd_vd2(y), vd2gety_vd_vd2(y)); +} + +EXPORT CONST VECTOR_CC vdouble xatan_u1(vdouble d) { + vdouble2 d2 = atan2k_u1(vcast_vd2_vd_vd(vabs_vd_vd(d), vcast_vd_d(0)), vcast_vd2_d_d(1, 0)); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(d2), vd2gety_vd_vd2(d2)); + r = vsel_vd_vo_vd_vd(visinf_vo_vd(d), vcast_vd_d(1.570796326794896557998982), r); + return vmulsign_vd_vd_vd(r, d); +} + +EXPORT CONST VECTOR_CC vdouble xatan(vdouble s) { + vdouble t, u; + vint q; +#if defined(__INTEL_COMPILER) && defined(ENABLE_PURECFMA_SCALAR) + vdouble w = s; +#endif + + q = vsel_vi_vd_vi(s, vcast_vi_i(2)); + s = vabs_vd_vd(s); + + q = vsel_vi_vd_vd_vi_vi(vcast_vd_d(1), s, vadd_vi_vi_vi(q, vcast_vi_i(1)), q); + s = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(vcast_vd_d(1), s), vrec_vd_vd(s), s); + + t = vmul_vd_vd_vd(s, s); + + vdouble t2 = vmul_vd_vd_vd(t, t), t4 = vmul_vd_vd_vd(t2, t2), t8 = vmul_vd_vd_vd(t4, t4), t16 = vmul_vd_vd_vd(t8, t8); + u = POLY19(t, t2, t4, t8, t16, + -1.88796008463073496563746e-05, + 0.000209850076645816976906797, + -0.00110611831486672482563471, + 0.00370026744188713119232403, + -0.00889896195887655491740809, + 0.016599329773529201970117, + -0.0254517624932312641616861, + 0.0337852580001353069993897, + -0.0407629191276836500001934, + 0.0466667150077840625632675, + -0.0523674852303482457616113, + 0.0587666392926673580854313, + -0.0666573579361080525984562, + 0.0769219538311769618355029, + -0.090908995008245008229153, + 0.111111105648261418443745, + -0.14285714266771329383765, + 0.199999999996591265594148, + -0.333333333333311110369124); + + t = vmla_vd_vd_vd_vd(s, vmul_vd_vd_vd(t, u), s); + + t = vsel_vd_vo_vd_vd(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(1)), vcast_vi_i(1))), vsub_vd_vd_vd(vcast_vd_d(M_PI/2), t), t); + t = vreinterpret_vd_vm(vxor_vm_vm_vm(vand_vm_vo64_vm(vcast_vo64_vo32(veq_vo_vi_vi(vand_vi_vi_vi(q, vcast_vi_i(2)), vcast_vi_i(2))), vreinterpret_vm_vd(vcast_vd_d(-0.0))), vreinterpret_vm_vd(t))); + +#if defined(__INTEL_COMPILER) && defined(ENABLE_PURECFMA_SCALAR) + t = vsel_vd_vo_vd_vd(veq_vo_vd_vd(w, vcast_vd_d(0)), w, t); +#endif + + return t; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vdouble xlog(vdouble d) { + vdouble x, x2; + vdouble t, m; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = vdiv_vd_vd_vd(vsub_vd_vd_vd(m, vcast_vd_d(1)), vadd_vd_vd_vd(vcast_vd_d(1), m)); + x2 = vmul_vd_vd_vd(x, x); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4), x3 = vmul_vd_vd_vd(x, x2); + t = POLY7(x2, x4, x8, + 0.153487338491425068243146, + 0.152519917006351951593857, + 0.181863266251982985677316, + 0.222221366518767365905163, + 0.285714294746548025383248, + 0.399999999950799600689777, + 0.6666666666667778740063); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + x = vmla_vd_vd_vd_vd(x, vcast_vd_d(2), vmul_vd_vd_vd(vcast_vd_d(0.693147180559945286226764), vcast_vd_vi(e))); + x = vmla_vd_vd_vd_vd(x3, t, x); + + x = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), x); + x = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(0)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), x); + x = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(-SLEEF_INFINITY), x); +#else + x = vmla_vd_vd_vd_vd(x, vcast_vd_d(2), vmul_vd_vd_vd(vcast_vd_d(0.693147180559945286226764), e)); + x = vmla_vd_vd_vd_vd(x3, t, x); + + x = vfixup_vd_vd_vd_vi2_i(x, d, vcast_vi2_i((5 << (5*4))), 0); +#endif + + return x; +} +#endif // #if !defined(DETERMINISTIC) + +EXPORT CONST VECTOR_CC vdouble xexp(vdouble d) { + vdouble u = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(R_LN2))), s; + vint q = vrint_vi_vd(u); + + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L2U), d); + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L2L), s); + +#ifdef ENABLE_FMA_DP + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(s, s2, s4, s8, + +0.2081276378237164457e-8, + +0.2511210703042288022e-7, + +0.2755762628169491192e-6, + +0.2755723402025388239e-5, + +0.2480158687479686264e-4, + +0.1984126989855865850e-3, + +0.1388888888914497797e-2, + +0.8333333333314938210e-2, + +0.4166666666666602598e-1, + +0.1666666666666669072e+0); + u = vfma_vd_vd_vd_vd(u, s, vcast_vd_d(+0.5000000000000000000e+0)); + u = vfma_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1000000000000000000e+1)); + u = vfma_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1000000000000000000e+1)); +#else // #ifdef ENABLE_FMA_DP + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(s, s2, s4, s8, + 2.08860621107283687536341e-09, + 2.51112930892876518610661e-08, + 2.75573911234900471893338e-07, + 2.75572362911928827629423e-06, + 2.4801587159235472998791e-05, + 0.000198412698960509205564975, + 0.00138888888889774492207962, + 0.00833333333331652721664984, + 0.0416666666666665047591422, + 0.166666666666666851703837); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.5000000000000000000e+0)); + + u = vadd_vd_vd_vd(vcast_vd_d(1), vmla_vd_vd_vd_vd(vmul_vd_vd_vd(s, s), u, s)); +#endif // #ifdef ENABLE_FMA_DP + + u = vldexp2_vd_vd_vi(u, q); + + u = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(d, vcast_vd_d(709.78271114955742909217217426)), vcast_vd_d(SLEEF_INFINITY), u); + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(d, vcast_vd_d(-1000)), vreinterpret_vm_vd(u))); + + return u; +} + +static INLINE CONST VECTOR_CC vdouble expm1k(vdouble d) { + vdouble u = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(R_LN2))), s; + vint q = vrint_vi_vd(u); + + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L2U), d); + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L2L), s); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(s, s2, s4, s8, + 2.08860621107283687536341e-09, + 2.51112930892876518610661e-08, + 2.75573911234900471893338e-07, + 2.75572362911928827629423e-06, + 2.4801587159235472998791e-05, + 0.000198412698960509205564975, + 0.00138888888889774492207962, + 0.00833333333331652721664984, + 0.0416666666666665047591422, + 0.166666666666666851703837); + + u = vadd_vd_vd_vd(vmla_vd_vd_vd_vd(s2, vcast_vd_d(0.5), vmul_vd_vd_vd(vmul_vd_vd_vd(s2, s), u)), s); + + u = vsel_vd_vo_vd_vd(vcast_vo64_vo32(veq_vo_vi_vi(q, vcast_vi_i(0))), u, + vsub_vd_vd_vd(vldexp2_vd_vd_vi(vadd_vd_vd_vd(u, vcast_vd_d(1)), q), vcast_vd_d(1))); + + return u; +} + +static INLINE CONST VECTOR_CC vdouble2 logk(vdouble d) { + vdouble2 x, x2, s; + vdouble t, m; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd_vd(vcast_vd_d(-1), m), ddadd2_vd2_vd_vd(vcast_vd_d(1), m)); + x2 = ddsqu_vd2_vd2(x); + + vdouble x4 = vmul_vd_vd_vd(vd2getx_vd_vd2(x2), vd2getx_vd_vd2(x2)), x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + t = POLY9(vd2getx_vd_vd2(x2), x4, x8, x16, + 0.116255524079935043668677, + 0.103239680901072952701192, + 0.117754809412463995466069, + 0.13332981086846273921509, + 0.153846227114512262845736, + 0.181818180850050775676507, + 0.222222222230083560345903, + 0.285714285714249172087875, + 0.400000000000000077715612); + + vdouble2 c = vcast_vd2_d_d(0.666666666666666629659233, 3.80554962542412056336616e-17); +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi(e)); +#else + s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), e); +#endif + s = ddadd_vd2_vd2_vd2(s, ddscale_vd2_vd2_vd(x, vcast_vd_d(2))); + x = ddmul_vd2_vd2_vd2(x2, x); + s = ddadd_vd2_vd2_vd2(s, ddmul_vd2_vd2_vd2(x, c)); + x = ddmul_vd2_vd2_vd2(x2, x); + s = ddadd_vd2_vd2_vd2(s, ddmul_vd2_vd2_vd(x, t)); + + return s; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vdouble xlog_u1(vdouble d) { + vdouble2 x; + vdouble t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd_vd(vcast_vd_d(-1), m), ddadd2_vd2_vd_vd(vcast_vd_d(1), m)); + x2 = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4); + t = POLY7(x2, x4, x8, + 0.1532076988502701353e+0, + 0.1525629051003428716e+0, + 0.1818605932937785996e+0, + 0.2222214519839380009e+0, + 0.2857142932794299317e+0, + 0.3999999999635251990e+0, + 0.6666666666667333541e+0); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi(e)); +#else + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), e); +#endif + + s = ddadd_vd2_vd2_vd2(s, ddscale_vd2_vd2_vd(x, vcast_vd_d(2))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x)), t)); + + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(0)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(-SLEEF_INFINITY), r); +#else + r = vfixup_vd_vd_vd_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vdouble expk(vdouble2 d) { + vdouble u = vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)), vcast_vd_d(R_LN2)); + vdouble dq = vrint_vd_vd(u); + vint q = vrint_vi_vd(dq); + vdouble2 s, t; + + s = ddadd2_vd2_vd2_vd(d, vmul_vd_vd_vd(dq, vcast_vd_d(-L2U))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dq, vcast_vd_d(-L2L))); + + s = ddnormalize_vd2_vd2(s); + + vdouble s2 = vmul_vd_vd_vd(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s)), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(vd2getx_vd_vd2(s), s2, s4, s8, + 2.51069683420950419527139e-08, + 2.76286166770270649116855e-07, + 2.75572496725023574143864e-06, + 2.48014973989819794114153e-05, + 0.000198412698809069797676111, + 0.0013888888939977128960529, + 0.00833333333332371417601081, + 0.0416666666665409524128449, + 0.166666666666666740681535, + 0.500000000000000999200722); + + t = ddadd_vd2_vd_vd2(vcast_vd_d(1), s); + t = ddadd_vd2_vd2_vd2(t, ddmul_vd2_vd2_vd(ddsqu_vd2_vd2(s), u)); + + u = vadd_vd_vd_vd(vd2getx_vd_vd2(t), vd2gety_vd_vd2(t)); + u = vldexp2_vd_vd_vi(u, q); + + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(vd2getx_vd_vd2(d), vcast_vd_d(-1000)), vreinterpret_vm_vd(u))); + + return u; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vdouble xpow(vdouble x, vdouble y) { +#if 1 + vopmask yisint = visint_vo_vd(y); + vopmask yisodd = vand_vo_vo_vo(visodd_vo_vd(y), yisint); + + vdouble2 d = ddmul_vd2_vd2_vd(logk(vabs_vd_vd(x)), y); + vdouble result = expk(d); + result = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vd2getx_vd_vd2(d), vcast_vd_d(709.78271114955742909217217426)), vcast_vd_d(SLEEF_INFINITY), result); + + result = vmul_vd_vd_vd(result, + vsel_vd_vo_vd_vd(vgt_vo_vd_vd(x, vcast_vd_d(0)), + vcast_vd_d(1), + vsel_vd_vo_vd_vd(yisint, vsel_vd_vo_vd_vd(yisodd, vcast_vd_d(-1.0), vcast_vd_d(1)), vcast_vd_d(SLEEF_NAN)))); + + vdouble efx = vmulsign_vd_vd_vd(vsub_vd_vd_vd(vabs_vd_vd(x), vcast_vd_d(1)), y); + + result = vsel_vd_vo_vd_vd(visinf_vo_vd(y), + vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(efx, vcast_vd_d(0.0)), + vreinterpret_vm_vd(vsel_vd_vo_vd_vd(veq_vo_vd_vd(efx, vcast_vd_d(0.0)), + vcast_vd_d(1.0), + vcast_vd_d(SLEEF_INFINITY))))), + result); + + result = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visinf_vo_vd(x), veq_vo_vd_vd(x, vcast_vd_d(0.0))), + vmulsign_vd_vd_vd(vsel_vd_vo_vd_vd(vxor_vo_vo_vo(vsignbit_vo_vd(y), veq_vo_vd_vd(x, vcast_vd_d(0.0))), + vcast_vd_d(0), vcast_vd_d(SLEEF_INFINITY)), + vsel_vd_vo_vd_vd(yisodd, x, vcast_vd_d(1))), result); + + result = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vreinterpret_vm_vd(result))); + + result = vsel_vd_vo_vd_vd(vor_vo_vo_vo(veq_vo_vd_vd(y, vcast_vd_d(0)), veq_vo_vd_vd(x, vcast_vd_d(1))), vcast_vd_d(1), result); + + return result; +#else + return expk(ddmul_vd2_vd2_vd(logk(x), y)); +#endif +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vdouble2 expk2(vdouble2 d) { + vdouble u = vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)), vcast_vd_d(R_LN2)); + vdouble dq = vrint_vd_vd(u); + vint q = vrint_vi_vd(dq); + vdouble2 s, t; + + s = ddadd2_vd2_vd2_vd(d, vmul_vd_vd_vd(dq, vcast_vd_d(-L2U))); + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(dq, vcast_vd_d(-L2L))); + + vdouble2 s2 = ddsqu_vd2_vd2(s), s4 = ddsqu_vd2_vd2(s2); + vdouble s8 = vmul_vd_vd_vd(vd2getx_vd_vd2(s4), vd2getx_vd_vd2(s4)); + u = POLY10(vd2getx_vd_vd2(s), vd2getx_vd_vd2(s2), vd2getx_vd_vd2(s4), s8, + +0.1602472219709932072e-9, + +0.2092255183563157007e-8, + +0.2505230023782644465e-7, + +0.2755724800902135303e-6, + +0.2755731892386044373e-5, + +0.2480158735605815065e-4, + +0.1984126984148071858e-3, + +0.1388888888886763255e-2, + +0.8333333333333347095e-2, + +0.4166666666666669905e-1); + + t = ddadd_vd2_vd_vd2(vcast_vd_d(0.5), ddmul_vd2_vd2_vd(s, vcast_vd_d(+0.1666666666666666574e+0))); + t = ddadd_vd2_vd_vd2(vcast_vd_d(1.0), ddmul_vd2_vd2_vd2(t, s)); + t = ddadd_vd2_vd_vd2(vcast_vd_d(1.0), ddmul_vd2_vd2_vd2(t, s)); + t = ddadd_vd2_vd2_vd2(t, ddmul_vd2_vd2_vd(s4, u)); + + t = vd2setx_vd2_vd2_vd(t, vldexp2_vd_vd_vi(vd2getx_vd_vd2(t), q)); + t = vd2sety_vd2_vd2_vd(t, vldexp2_vd_vd_vi(vd2gety_vd_vd2(t), q)); + + t = vd2setx_vd2_vd2_vd(t, vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(vd2getx_vd_vd2(d), vcast_vd_d(-1000)), vreinterpret_vm_vd(vd2getx_vd_vd2(t))))); + t = vd2sety_vd2_vd2_vd(t, vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(vd2getx_vd_vd2(d), vcast_vd_d(-1000)), vreinterpret_vm_vd(vd2gety_vd_vd2(t))))); + + return t; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vdouble xsinh(vdouble x) { + vdouble y = vabs_vd_vd(x); + vdouble2 d = expk2(vcast_vd2_vd_vd(y, vcast_vd_d(0))); + d = ddsub_vd2_vd2_vd2(d, ddrec_vd2_vd2(d)); + y = vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)), vcast_vd_d(0.5)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(710)), visnan_vo_vd(y)), vcast_vd_d(SLEEF_INFINITY), y); + y = vmulsign_vd_vd_vd(y, x); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xcosh(vdouble x) { + vdouble y = vabs_vd_vd(x); + vdouble2 d = expk2(vcast_vd2_vd_vd(y, vcast_vd_d(0))); + d = ddadd_vd2_vd2_vd2(d, ddrec_vd2_vd2(d)); + y = vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)), vcast_vd_d(0.5)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(710)), visnan_vo_vd(y)), vcast_vd_d(SLEEF_INFINITY), y); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xtanh(vdouble x) { + vdouble y = vabs_vd_vd(x); + vdouble2 d = expk2(vcast_vd2_vd_vd(y, vcast_vd_d(0))); + vdouble2 e = ddrec_vd2_vd2(d); + d = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd2_vd2(d, ddneg_vd2_vd2(e)), ddadd2_vd2_vd2_vd2(d, e)); + y = vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(18.714973875)), visnan_vo_vd(y)), vcast_vd_d(1.0), y); + y = vmulsign_vd_vd_vd(y, x); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xsinh_u35(vdouble x) { + vdouble e = expm1k(vabs_vd_vd(x)); + + vdouble y = vdiv_vd_vd_vd(vadd_vd_vd_vd(e, vcast_vd_d(2)), vadd_vd_vd_vd(e, vcast_vd_d(1))); + y = vmul_vd_vd_vd(y, vmul_vd_vd_vd(vcast_vd_d(0.5), e)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(709)), visnan_vo_vd(y)), vcast_vd_d(SLEEF_INFINITY), y); + y = vmulsign_vd_vd_vd(y, x); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xcosh_u35(vdouble x) { + vdouble e = xexp(vabs_vd_vd(x)); + vdouble y = vmla_vd_vd_vd_vd(vcast_vd_d(0.5), e, vdiv_vd_vd_vd(vcast_vd_d(0.5), e)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(709)), visnan_vo_vd(y)), vcast_vd_d(SLEEF_INFINITY), y); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xtanh_u35(vdouble x) { + vdouble d = expm1k(vmul_vd_vd_vd(vcast_vd_d(2), vabs_vd_vd(x))); + vdouble y = vdiv_vd_vd_vd(d, vadd_vd_vd_vd(vcast_vd_d(2), d)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(18.714973875)), visnan_vo_vd(y)), vcast_vd_d(1.0), y); + y = vmulsign_vd_vd_vd(y, x); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +static INLINE CONST VECTOR_CC vdouble2 logk2(vdouble2 d) { + vdouble2 x, x2, m, s; + vdouble t; + vint e; + + e = vilogbk_vi_vd(vmul_vd_vd_vd(vd2getx_vd_vd2(d), vcast_vd_d(1.0/0.75))); + + m = vd2setxy_vd2_vd_vd(vldexp2_vd_vd_vi(vd2getx_vd_vd2(d), vneg_vi_vi(e)), + vldexp2_vd_vd_vi(vd2gety_vd_vd2(d), vneg_vi_vi(e))); + + x = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(m, vcast_vd_d(-1)), ddadd2_vd2_vd2_vd(m, vcast_vd_d(1))); + x2 = ddsqu_vd2_vd2(x); + + vdouble x4 = vmul_vd_vd_vd(vd2getx_vd_vd2(x2), vd2getx_vd_vd2(x2)), x8 = vmul_vd_vd_vd(x4, x4); + t = POLY7(vd2getx_vd_vd2(x2), x4, x8, + 0.13860436390467167910856, + 0.131699838841615374240845, + 0.153914168346271945653214, + 0.181816523941564611721589, + 0.22222224632662035403996, + 0.285714285511134091777308, + 0.400000000000914013309483); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(x2), vcast_vd_d(0.666666666666664853302393)); + + s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi(e)); + s = ddadd_vd2_vd2_vd2(s, ddscale_vd2_vd2_vd(x, vcast_vd_d(2))); + s = ddadd_vd2_vd2_vd2(s, ddmul_vd2_vd2_vd(ddmul_vd2_vd2_vd2(x2, x), t)); + + return s; +} + +EXPORT CONST VECTOR_CC vdouble xasinh(vdouble x) { + vdouble y = vabs_vd_vd(x); + vopmask o = vgt_vo_vd_vd(y, vcast_vd_d(1)); + vdouble2 d; + + d = vsel_vd2_vo_vd2_vd2(o, ddrec_vd2_vd(x), vcast_vd2_vd_vd(y, vcast_vd_d(0))); + d = ddsqrt_vd2_vd2(ddadd2_vd2_vd2_vd(ddsqu_vd2_vd2(d), vcast_vd_d(1))); + d = vsel_vd2_vo_vd2_vd2(o, ddmul_vd2_vd2_vd(d, y), d); + + d = logk2(ddnormalize_vd2_vd2(ddadd2_vd2_vd2_vd(d, x))); + y = vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(SQRT_DBL_MAX)), + visnan_vo_vd(y)), + vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), x), y); + + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + y = vsel_vd_vo_vd_vd(visnegzero_vo_vd(x), vcast_vd_d(-0.0), y); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xacosh(vdouble x) { + vdouble2 d = logk2(ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd2(ddsqrt_vd2_vd2(ddadd2_vd2_vd_vd(x, vcast_vd_d(1))), ddsqrt_vd2_vd2(ddadd2_vd2_vd_vd(x, vcast_vd_d(-1)))), x)); + vdouble y = vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)); + + y = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vgt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(SQRT_DBL_MAX)), + visnan_vo_vd(y)), + vcast_vd_d(SLEEF_INFINITY), y); + y = vreinterpret_vd_vm(vandnot_vm_vo64_vm(veq_vo_vd_vd(x, vcast_vd_d(1.0)), vreinterpret_vm_vd(y))); + + y = vreinterpret_vd_vm(vor_vm_vo64_vm(vlt_vo_vd_vd(x, vcast_vd_d(1.0)), vreinterpret_vm_vd(y))); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xatanh(vdouble x) { + vdouble y = vabs_vd_vd(x); + vdouble2 d = logk2(dddiv_vd2_vd2_vd2(ddadd2_vd2_vd_vd(vcast_vd_d(1), y), ddadd2_vd2_vd_vd(vcast_vd_d(1), vneg_vd_vd(y)))); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(vgt_vo_vd_vd(y, vcast_vd_d(1.0)), vreinterpret_vm_vd(vsel_vd_vo_vd_vd(veq_vo_vd_vd(y, vcast_vd_d(1.0)), vcast_vd_d(SLEEF_INFINITY), vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)), vcast_vd_d(0.5)))))); + + y = vmulsign_vd_vd_vd(y, x); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(vor_vo_vo_vo(visinf_vo_vd(x), visnan_vo_vd(y)), vreinterpret_vm_vd(y))); + y = vreinterpret_vd_vm(vor_vm_vo64_vm(visnan_vo_vd(x), vreinterpret_vm_vd(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xcbrt(vdouble d) { + vdouble x, y, q = vcast_vd_d(1.0); + vint e, qu, re; + vdouble t; + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + vdouble s = d; +#endif + e = vadd_vi_vi_vi(vilogbk_vi_vd(vabs_vd_vd(d)), vcast_vi_i(1)); + d = vldexp2_vd_vd_vi(d, vneg_vi_vi(e)); + + t = vadd_vd_vd_vd(vcast_vd_vi(e), vcast_vd_d(6144)); + qu = vtruncate_vi_vd(vmul_vd_vd_vd(t, vcast_vd_d(1.0/3.0))); + re = vtruncate_vi_vd(vsub_vd_vd_vd(t, vmul_vd_vd_vd(vcast_vd_vi(qu), vcast_vd_d(3)))); + + q = vsel_vd_vo_vd_vd(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(1))), vcast_vd_d(1.2599210498948731647672106), q); + q = vsel_vd_vo_vd_vd(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(2))), vcast_vd_d(1.5874010519681994747517056), q); + q = vldexp2_vd_vd_vi(q, vsub_vi_vi_vi(qu, vcast_vi_i(2048))); + + q = vmulsign_vd_vd_vd(q, d); + + d = vabs_vd_vd(d); + + x = vcast_vd_d(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(2.2307275302496609725722)); + + y = vmul_vd_vd_vd(x, x); y = vmul_vd_vd_vd(y, y); x = vsub_vd_vd_vd(x, vmul_vd_vd_vd(vmlapn_vd_vd_vd_vd(d, y, x), vcast_vd_d(1.0 / 3.0))); + y = vmul_vd_vd_vd(vmul_vd_vd_vd(d, x), x); + y = vmul_vd_vd_vd(vsub_vd_vd_vd(y, vmul_vd_vd_vd(vmul_vd_vd_vd(vcast_vd_d(2.0 / 3.0), y), vmla_vd_vd_vd_vd(y, x, vcast_vd_d(-1.0)))), q); + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + y = vsel_vd_vo_vd_vd(visinf_vo_vd(s), vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), s), y); + y = vsel_vd_vo_vd_vd(veq_vo_vd_vd(s, vcast_vd_d(0)), vmulsign_vd_vd_vd(vcast_vd_d(0), s), y); +#endif + + return y; +} + +EXPORT CONST VECTOR_CC vdouble xcbrt_u1(vdouble d) { + vdouble x, y, z, t; + vdouble2 q2 = vcast_vd2_d_d(1, 0), u, v; + vint e, qu, re; + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + vdouble s = d; +#endif + e = vadd_vi_vi_vi(vilogbk_vi_vd(vabs_vd_vd(d)), vcast_vi_i(1)); + d = vldexp2_vd_vd_vi(d, vneg_vi_vi(e)); + + t = vadd_vd_vd_vd(vcast_vd_vi(e), vcast_vd_d(6144)); + qu = vtruncate_vi_vd(vmul_vd_vd_vd(t, vcast_vd_d(1.0/3.0))); + re = vtruncate_vi_vd(vsub_vd_vd_vd(t, vmul_vd_vd_vd(vcast_vd_vi(qu), vcast_vd_d(3)))); + + q2 = vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(1))), vcast_vd2_d_d(1.2599210498948731907, -2.5899333753005069177e-17), q2); + q2 = vsel_vd2_vo_vd2_vd2(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(2))), vcast_vd2_d_d(1.5874010519681995834, -1.0869008194197822986e-16), q2); + + q2 = vd2setxy_vd2_vd_vd(vmulsign_vd_vd_vd(vd2getx_vd_vd2(q2), d), vmulsign_vd_vd_vd(vd2gety_vd_vd2(q2), d)); + d = vabs_vd_vd(d); + + x = vcast_vd_d(-0.640245898480692909870982); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd(x, d, vcast_vd_d(2.2307275302496609725722)); + + y = vmul_vd_vd_vd(x, x); y = vmul_vd_vd_vd(y, y); x = vsub_vd_vd_vd(x, vmul_vd_vd_vd(vmlapn_vd_vd_vd_vd(d, y, x), vcast_vd_d(1.0 / 3.0))); + + z = x; + + u = ddmul_vd2_vd_vd(x, x); + u = ddmul_vd2_vd2_vd2(u, u); + u = ddmul_vd2_vd2_vd(u, d); + u = ddadd2_vd2_vd2_vd(u, vneg_vd_vd(x)); + y = vadd_vd_vd_vd(vd2getx_vd_vd2(u), vd2gety_vd_vd2(u)); + + y = vmul_vd_vd_vd(vmul_vd_vd_vd(vcast_vd_d(-2.0 / 3.0), y), z); + v = ddadd2_vd2_vd2_vd(ddmul_vd2_vd_vd(z, z), y); + v = ddmul_vd2_vd2_vd(v, d); + v = ddmul_vd2_vd2_vd2(v, q2); + z = vldexp2_vd_vd_vi(vadd_vd_vd_vd(vd2getx_vd_vd2(v), vd2gety_vd_vd2(v)), vsub_vi_vi_vi(qu, vcast_vi_i(2048))); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + z = vsel_vd_vo_vd_vd(visinf_vo_vd(d), vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), vd2getx_vd_vd2(q2)), z); + z = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vreinterpret_vd_vm(vsignbit_vm_vd(vd2getx_vd_vd2(q2))), z); +#else + z = vsel_vd_vo_vd_vd(visinf_vo_vd(s), vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), s), z); + z = vsel_vd_vo_vd_vd(veq_vo_vd_vd(s, vcast_vd_d(0)), vmulsign_vd_vd_vd(vcast_vd_d(0), s), z); +#endif + + return z; +} +#endif // #if !defined(DETERMINISTIC) + +EXPORT CONST VECTOR_CC vdouble xexp2(vdouble d) { + vdouble u = vrint_vd_vd(d), s; + vint q = vrint_vi_vd(u); + + s = vsub_vd_vd_vd(d, u); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(s, s2, s4, s8, + +0.4434359082926529454e-9, + +0.7073164598085707425e-8, + +0.1017819260921760451e-6, + +0.1321543872511327615e-5, + +0.1525273353517584730e-4, + +0.1540353045101147808e-3, + +0.1333355814670499073e-2, + +0.9618129107597600536e-2, + +0.5550410866482046596e-1, + +0.2402265069591012214e+0); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.6931471805599452862e+0)); + +#ifdef ENABLE_FMA_DP + u = vfma_vd_vd_vd_vd(u, s, vcast_vd_d(1)); +#else + u = vd2getx_vd_vd2(ddnormalize_vd2_vd2(ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd_vd(u, s)))); +#endif + + u = vldexp2_vd_vd_vi(u, q); + + u = vsel_vd_vo_vd_vd(vge_vo_vd_vd(d, vcast_vd_d(1024)), vcast_vd_d(SLEEF_INFINITY), u); + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(d, vcast_vd_d(-2000)), vreinterpret_vm_vd(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vdouble xexp2_u35(vdouble d) { + vdouble u = vrint_vd_vd(d), s; + vint q = vrint_vi_vd(u); + + s = vsub_vd_vd_vd(d, u); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY10(s, s2, s4, s8, + +0.4434359082926529454e-9, + +0.7073164598085707425e-8, + +0.1017819260921760451e-6, + +0.1321543872511327615e-5, + +0.1525273353517584730e-4, + +0.1540353045101147808e-3, + +0.1333355814670499073e-2, + +0.9618129107597600536e-2, + +0.5550410866482046596e-1, + +0.2402265069591012214e+0); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.6931471805599452862e+0)); + + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(1)); + + u = vldexp2_vd_vd_vi(u, q); + + u = vsel_vd_vo_vd_vd(vge_vo_vd_vd(d, vcast_vd_d(1024)), vcast_vd_d(SLEEF_INFINITY), u); + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(d, vcast_vd_d(-2000)), vreinterpret_vm_vd(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vdouble xexp10(vdouble d) { + vdouble u = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(LOG10_2))), s; + vint q = vrint_vi_vd(u); + + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L10U), d); + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L10L), s); + + u = vcast_vd_d(+0.2411463498334267652e-3); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1157488415217187375e-2)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.5013975546789733659e-2)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1959762320720533080e-1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.6808936399446784138e-1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.2069958494722676234e+0)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.5393829292058536229e+0)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.1171255148908541655e+1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.2034678592293432953e+1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.2650949055239205876e+1)); + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(+0.2302585092994045901e+1)); + +#ifdef ENABLE_FMA_DP + u = vfma_vd_vd_vd_vd(u, s, vcast_vd_d(1)); +#else + u = vd2getx_vd_vd2(ddnormalize_vd2_vd2(ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd_vd(u, s)))); +#endif + + u = vldexp2_vd_vd_vi(u, q); + + u = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(d, vcast_vd_d(308.25471555991671)), vcast_vd_d(SLEEF_INFINITY), u); + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(d, vcast_vd_d(-350)), vreinterpret_vm_vd(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vdouble xexp10_u35(vdouble d) { + vdouble u = vrint_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(LOG10_2))), s; + vint q = vrint_vi_vd(u); + + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L10U), d); + s = vmla_vd_vd_vd_vd(u, vcast_vd_d(-L10L), s); + + vdouble s2 = vmul_vd_vd_vd(s, s), s4 = vmul_vd_vd_vd(s2, s2), s8 = vmul_vd_vd_vd(s4, s4); + u = POLY11(s, s2, s4, s8, + +0.2411463498334267652e-3, + +0.1157488415217187375e-2, + +0.5013975546789733659e-2, + +0.1959762320720533080e-1, + +0.6808936399446784138e-1, + +0.2069958494722676234e+0, + +0.5393829292058536229e+0, + +0.1171255148908541655e+1, + +0.2034678592293432953e+1, + +0.2650949055239205876e+1, + +0.2302585092994045901e+1); + + u = vmla_vd_vd_vd_vd(u, s, vcast_vd_d(1)); + + u = vldexp2_vd_vd_vi(u, q); + + u = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(d, vcast_vd_d(308.25471555991671)), vcast_vd_d(SLEEF_INFINITY), u); + u = vreinterpret_vd_vm(vandnot_vm_vo64_vm(vlt_vo_vd_vd(d, vcast_vd_d(-350)), vreinterpret_vm_vd(u))); + + return u; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vdouble xexpm1(vdouble a) { + vdouble2 d = ddadd2_vd2_vd2_vd(expk2(vcast_vd2_vd_vd(a, vcast_vd_d(0))), vcast_vd_d(-1.0)); + vdouble x = vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d)); + x = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(a, vcast_vd_d(709.782712893383996732223)), vcast_vd_d(SLEEF_INFINITY), x); + x = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(a, vcast_vd_d(-36.736800569677101399113302437)), vcast_vd_d(-1), x); + x = vsel_vd_vo_vd_vd(visnegzero_vo_vd(a), vcast_vd_d(-0.0), x); + return x; +} + +EXPORT CONST VECTOR_CC vdouble xlog10(vdouble d) { + vdouble2 x; + vdouble t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd_vd(vcast_vd_d(-1), m), ddadd2_vd2_vd_vd(vcast_vd_d(1), m)); + x2 = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4); + t = POLY7(x2, x4, x8, + +0.6653725819576758460e-1, + +0.6625722782820833712e-1, + +0.7898105214313944078e-1, + +0.9650955035715275132e-1, + +0.1240841409721444993e+0, + +0.1737177927454605086e+0, + +0.2895296546021972617e+0); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.30102999566398119802, -2.803728127785170339e-18), vcast_vd_vi(e)); +#else + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.30102999566398119802, -2.803728127785170339e-18), e); +#endif + + s = ddadd_vd2_vd2_vd2(s, ddmul_vd2_vd2_vd2(x, vcast_vd2_d_d(0.86858896380650363334, 1.1430059694096389311e-17))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x)), t)); + + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(0)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(-SLEEF_INFINITY), r); +#else + r = vfixup_vd_vd_vd_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vdouble xlog2(vdouble d) { + vdouble2 x; + vdouble t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = dddiv_vd2_vd2_vd2(ddadd2_vd2_vd_vd(vcast_vd_d(-1), m), ddadd2_vd2_vd_vd(vcast_vd_d(1), m)); + x2 = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4); + t = POLY7(x2, x4, x8, + +0.2211941750456081490e+0, + +0.2200768693152277689e+0, + +0.2623708057488514656e+0, + +0.3205977477944495502e+0, + +0.4121985945485324709e+0, + +0.5770780162997058982e+0, + +0.96179669392608091449); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vdouble2 s = ddadd2_vd2_vd_vd2(vcast_vd_vi(e), + ddmul_vd2_vd2_vd2(x, vcast_vd2_d_d(2.885390081777926774, 6.0561604995516736434e-18))); +#else + vdouble2 s = ddadd2_vd2_vd_vd2(e, + ddmul_vd2_vd2_vd2(x, vcast_vd2_d_d(2.885390081777926774, 6.0561604995516736434e-18))); +#endif + + s = ddadd2_vd2_vd2_vd(s, vmul_vd_vd_vd(vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x)), t)); + + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(0)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(-SLEEF_INFINITY), r); +#else + r = vfixup_vd_vd_vd_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vdouble xlog2_u35(vdouble d) { + vdouble m, t, x, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), d); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + m = vldexp3_vd_vd_vi(d, vneg_vi_vi(e)); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(d, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + m = vgetmant_vd_vd(d); +#endif + + x = vdiv_vd_vd_vd(vsub_vd_vd_vd(m, vcast_vd_d(1)), vadd_vd_vd_vd(m, vcast_vd_d(1))); + x2 = vmul_vd_vd_vd(x, x); + + t = vcast_vd_d(+0.2211941750456081490e+0); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.2200768693152277689e+0)); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.2623708057488514656e+0)); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.3205977477944495502e+0)); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.4121985945485324709e+0)); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.5770780162997058982e+0)); + t = vmla_vd_vd_vd_vd(t, x2, vcast_vd_d(+0.96179669392608091449 )); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vdouble2 s = ddadd_vd2_vd_vd2(vcast_vd_vi(e), + ddmul_vd2_vd_vd(x, vcast_vd_d(2.885390081777926774))); +#else + vdouble2 s = ddadd_vd2_vd_vd2(e, + ddmul_vd2_vd_vd(x, vcast_vd_d(2.885390081777926774))); +#endif + + vdouble r = vmla_vd_vd_vd_vd(t, vmul_vd_vd_vd(x, x2), vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s))); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(0)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(-SLEEF_INFINITY), r); +#else + r = vfixup_vd_vd_vd_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vdouble xlog1p(vdouble d) { + vdouble2 x; + vdouble t, m, x2; + + vdouble dp1 = vadd_vd_vd_vd(d, vcast_vd_d(1)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vd_vd(dp1, vcast_vd_d(SLEEF_DBL_MIN)); + dp1 = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(dp1, vcast_vd_d((double)(INT64_C(1) << 32) * (double)(INT64_C(1) << 32))), dp1); + vint e = vilogb2k_vi_vd(vmul_vd_vd_vd(dp1, vcast_vd_d(1.0/0.75))); + t = vldexp3_vd_vd_vi(vcast_vd_d(1), vneg_vi_vi(e)); + m = vmla_vd_vd_vd_vd(d, t, vsub_vd_vd_vd(t, vcast_vd_d(1))); + e = vsel_vi_vo_vi_vi(vcast_vo32_vo64(o), vsub_vi_vi_vi(e, vcast_vi_i(64)), e); + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), vcast_vd_vi(e)); +#else + vdouble e = vgetexp_vd_vd(vmul_vd_vd_vd(dp1, vcast_vd_d(1.0/0.75))); + e = vsel_vd_vo_vd_vd(vispinf_vo_vd(e), vcast_vd_d(1024.0), e); + t = vldexp3_vd_vd_vi(vcast_vd_d(1), vneg_vi_vi(vrint_vi_vd(e))); + m = vmla_vd_vd_vd_vd(d, t, vsub_vd_vd_vd(t, vcast_vd_d(1))); + vdouble2 s = ddmul_vd2_vd2_vd(vcast_vd2_d_d(0.693147180559945286226764, 2.319046813846299558417771e-17), e); +#endif + + x = dddiv_vd2_vd2_vd2(vcast_vd2_vd_vd(m, vcast_vd_d(0)), ddadd_vd2_vd_vd(vcast_vd_d(2), m)); + x2 = vmul_vd_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(x)); + + vdouble x4 = vmul_vd_vd_vd(x2, x2), x8 = vmul_vd_vd_vd(x4, x4); + t = POLY7(x2, x4, x8, + 0.1532076988502701353e+0, + 0.1525629051003428716e+0, + 0.1818605932937785996e+0, + 0.2222214519839380009e+0, + 0.2857142932794299317e+0, + 0.3999999999635251990e+0, + 0.6666666666667333541e+0); + + s = ddadd_vd2_vd2_vd2(s, ddscale_vd2_vd2_vd(x, vcast_vd_d(2))); + s = ddadd_vd2_vd2_vd(s, vmul_vd_vd_vd(vmul_vd_vd_vd(x2, vd2getx_vd_vd2(x)), t)); + + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(s), vd2gety_vd_vd2(s)); + + r = vsel_vd_vo_vd_vd(vgt_vo_vd_vd(d, vcast_vd_d(1e+307)), vcast_vd_d(SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(d, vcast_vd_d(-1)), visnan_vo_vd(d)), vcast_vd_d(SLEEF_NAN), r); + r = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(-1)), vcast_vd_d(-SLEEF_INFINITY), r); + r = vsel_vd_vo_vd_vd(visnegzero_vo_vd(d), vcast_vd_d(-0.0), r); + + return r; +} + +// + +EXPORT CONST VECTOR_CC vdouble xfabs(vdouble x) { return vabs_vd_vd(x); } + +EXPORT CONST VECTOR_CC vdouble xcopysign(vdouble x, vdouble y) { return vcopysign_vd_vd_vd(x, y); } + +EXPORT CONST VECTOR_CC vdouble xfmax(vdouble x, vdouble y) { +#if (defined(__x86_64__) || defined(__i386__)) && !defined(ENABLE_VECEXT) && !defined(ENABLE_PUREC) + return vsel_vd_vo_vd_vd(visnan_vo_vd(y), x, vmax_vd_vd_vd(x, y)); +#else + return vsel_vd_vo_vd_vd(visnan_vo_vd(y), x, vsel_vd_vo_vd_vd(vgt_vo_vd_vd(x, y), x, y)); +#endif +} + +EXPORT CONST VECTOR_CC vdouble xfmin(vdouble x, vdouble y) { +#if (defined(__x86_64__) || defined(__i386__)) && !defined(ENABLE_VECEXT) && !defined(ENABLE_PUREC) + return vsel_vd_vo_vd_vd(visnan_vo_vd(y), x, vmin_vd_vd_vd(x, y)); +#else + return vsel_vd_vo_vd_vd(visnan_vo_vd(y), x, vsel_vd_vo_vd_vd(vgt_vo_vd_vd(y, x), x, y)); +#endif +} + +EXPORT CONST VECTOR_CC vdouble xfdim(vdouble x, vdouble y) { + vdouble ret = vsub_vd_vd_vd(x, y); + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(ret, vcast_vd_d(0)), veq_vo_vd_vd(x, y)), vcast_vd_d(0), ret); + return ret; +} + +EXPORT CONST VECTOR_CC vdouble xtrunc(vdouble x) { return vtruncate2_vd_vd(x); } +EXPORT CONST VECTOR_CC vdouble xfloor(vdouble x) { return vfloor2_vd_vd(x); } +EXPORT CONST VECTOR_CC vdouble xceil(vdouble x) { return vceil2_vd_vd(x); } +EXPORT CONST VECTOR_CC vdouble xround(vdouble x) { return vround2_vd_vd(x); } +EXPORT CONST VECTOR_CC vdouble xrint(vdouble x) { return vrint2_vd_vd(x); } + +EXPORT CONST VECTOR_CC vdouble xnextafter(vdouble x, vdouble y) { + x = vsel_vd_vo_vd_vd(veq_vo_vd_vd(x, vcast_vd_d(0)), vmulsign_vd_vd_vd(vcast_vd_d(0), y), x); + vmask xi2 = vreinterpret_vm_vd(x); + vopmask c = vxor_vo_vo_vo(vsignbit_vo_vd(x), vge_vo_vd_vd(y, x)); + + xi2 = vsel_vm_vo64_vm_vm(c, vneg64_vm_vm(vxor_vm_vm_vm(xi2, vcast_vm_i_i((int)(1U << 31), 0))), xi2); + + xi2 = vsel_vm_vo64_vm_vm(vneq_vo_vd_vd(x, y), vsub64_vm_vm_vm(xi2, vcast_vm_i_i(0, 1)), xi2); + + xi2 = vsel_vm_vo64_vm_vm(c, vneg64_vm_vm(vxor_vm_vm_vm(xi2, vcast_vm_i_i((int)(1U << 31), 0))), xi2); + + vdouble ret = vreinterpret_vd_vm(xi2); + + ret = vsel_vd_vo_vd_vd(vand_vo_vo_vo(veq_vo_vd_vd(ret, vcast_vd_d(0)), vneq_vo_vd_vd(x, vcast_vd_d(0))), + vmulsign_vd_vd_vd(vcast_vd_d(0), x), ret); + + ret = vsel_vd_vo_vd_vd(vand_vo_vo_vo(veq_vo_vd_vd(x, vcast_vd_d(0)), veq_vo_vd_vd(y, vcast_vd_d(0))), y, ret); + + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vcast_vd_d(SLEEF_NAN), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vdouble xfrfrexp(vdouble x) { + x = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(SLEEF_DBL_MIN)), vmul_vd_vd_vd(x, vcast_vd_d(UINT64_C(1) << 63)), x); + + vmask xm = vreinterpret_vm_vd(x); + xm = vand_vm_vm_vm(xm, vcast_vm_i64(~INT64_C(0x7ff0000000000000))); + xm = vor_vm_vm_vm (xm, vcast_vm_i64( INT64_C(0x3fe0000000000000))); + + vdouble ret = vreinterpret_vd_vm(xm); + + ret = vsel_vd_vo_vd_vd(visinf_vo_vd(x), vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), x), ret); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(x, vcast_vd_d(0)), x, ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vint xexpfrexp(vdouble x) { + x = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(SLEEF_DBL_MIN)), vmul_vd_vd_vd(x, vcast_vd_d(UINT64_C(1) << 63)), x); + + vint ret = vcastu_vi_vm(vreinterpret_vm_vd(x)); + ret = vsub_vi_vi_vi(vand_vi_vi_vi(vsrl_vi_vi_i(ret, 20), vcast_vi_i(0x7ff)), vcast_vi_i(0x3fe)); + + ret = vsel_vi_vo_vi_vi(vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vd_vd(x, vcast_vd_d(0)), visnan_vo_vd(x)), visinf_vo_vd(x)), vcast_vi_i(0), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vdouble xfma(vdouble x, vdouble y, vdouble z) { +#ifdef ENABLE_FMA_DP + return vfma_vd_vd_vd_vd(x, y, z); +#else + vdouble h2 = vadd_vd_vd_vd(vmul_vd_vd_vd(x, y), z), q = vcast_vd_d(1); + vopmask o = vlt_vo_vd_vd(vabs_vd_vd(h2), vcast_vd_d(1e-300)); + { + const double c0 = UINT64_C(1) << 54, c1 = c0 * c0, c2 = c1 * c1; + x = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(x, vcast_vd_d(c1)), x); + y = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(y, vcast_vd_d(c1)), y); + z = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(z, vcast_vd_d(c2)), z); + q = vsel_vd_vo_vd_vd(o, vcast_vd_d(1.0 / c2), q); + } + o = vgt_vo_vd_vd(vabs_vd_vd(h2), vcast_vd_d(1e+300)); + { + const double c0 = UINT64_C(1) << 54, c1 = c0 * c0, c2 = c1 * c1; + x = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(x, vcast_vd_d(1.0 / c1)), x); + y = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(y, vcast_vd_d(1.0 / c1)), y); + z = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(z, vcast_vd_d(1.0 / c2)), z); + q = vsel_vd_vo_vd_vd(o, vcast_vd_d(c2), q); + } + vdouble2 d = ddmul_vd2_vd_vd(x, y); + d = ddadd2_vd2_vd2_vd(d, z); + vdouble ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(veq_vo_vd_vd(x, vcast_vd_d(0)), veq_vo_vd_vd(y, vcast_vd_d(0))), z, vadd_vd_vd_vd(vd2getx_vd_vd2(d), vd2gety_vd_vd2(d))); + o = visinf_vo_vd(z); + o = vandnot_vo_vo_vo(visinf_vo_vd(x), o); + o = vandnot_vo_vo_vo(visnan_vo_vd(x), o); + o = vandnot_vo_vo_vo(visinf_vo_vd(y), o); + o = vandnot_vo_vo_vo(visnan_vo_vd(y), o); + h2 = vsel_vd_vo_vd_vd(o, z, h2); + + o = vor_vo_vo_vo(visinf_vo_vd(h2), visnan_vo_vd(h2)); + + return vsel_vd_vo_vd_vd(o, h2, vmul_vd_vd_vd(ret, q)); +#endif +} + +SQRTU05_FUNCATR VECTOR_CC vdouble xsqrt_u05(vdouble d) { +#if defined(ENABLE_FMA_DP) + vdouble q, w, x, y, z; + + d = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_NAN), d); + + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(8.636168555094445E-78)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(1.157920892373162E77)), d); + q = vsel_vd_vo_vd_vd(o, vcast_vd_d(2.9387358770557188E-39), vcast_vd_d(1)); + + y = vreinterpret_vd_vm(vsub64_vm_vm_vm(vcast_vm_i_i(0x5fe6ec85, 0xe7de30da), vsrl64_vm_vm_i(vreinterpret_vm_vd(d), 1))); + + x = vmul_vd_vd_vd(d, y); w = vmul_vd_vd_vd(vcast_vd_d(0.5), y); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(0.5)); + x = vfma_vd_vd_vd_vd(x, y, x); w = vfma_vd_vd_vd_vd(w, y, w); + + y = vfmanp_vd_vd_vd_vd(x, w, vcast_vd_d(1.5)); w = vadd_vd_vd_vd(w, w); + w = vmul_vd_vd_vd(w, y); + x = vmul_vd_vd_vd(w, d); + y = vfmapn_vd_vd_vd_vd(w, d, x); z = vfmanp_vd_vd_vd_vd(w, x, vcast_vd_d(1)); + + z = vfmanp_vd_vd_vd_vd(w, y, z); w = vmul_vd_vd_vd(vcast_vd_d(0.5), x); + w = vfma_vd_vd_vd_vd(w, z, y); + w = vadd_vd_vd_vd(w, x); + + w = vmul_vd_vd_vd(w, q); + + w = vsel_vd_vo_vd_vd(vor_vo_vo_vo(veq_vo_vd_vd(d, vcast_vd_d(0)), + veq_vo_vd_vd(d, vcast_vd_d(SLEEF_INFINITY))), d, w); + + w = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_NAN), w); + + return w; +#else + vdouble q; + vopmask o; + + d = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_NAN), d); + + o = vlt_vo_vd_vd(d, vcast_vd_d(8.636168555094445E-78)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(1.157920892373162E77)), d); + q = vsel_vd_vo_vd_vd(o, vcast_vd_d(2.9387358770557188E-39*0.5), vcast_vd_d(0.5)); + + o = vgt_vo_vd_vd(d, vcast_vd_d(1.3407807929942597e+154)); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(7.4583407312002070e-155)), d); + q = vsel_vd_vo_vd_vd(o, vcast_vd_d(1.1579208923731620e+77*0.5), q); + + vdouble x = vreinterpret_vd_vm(vsub64_vm_vm_vm(vcast_vm_i_i(0x5fe6ec86, 0), vsrl64_vm_vm_i(vreinterpret_vm_vd(vadd_vd_vd_vd(d, vcast_vd_d(1e-320))), 1))); + + x = vmul_vd_vd_vd(x, vsub_vd_vd_vd(vcast_vd_d(1.5), vmul_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(vcast_vd_d(0.5), d), x), x))); + x = vmul_vd_vd_vd(x, vsub_vd_vd_vd(vcast_vd_d(1.5), vmul_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(vcast_vd_d(0.5), d), x), x))); + x = vmul_vd_vd_vd(x, vsub_vd_vd_vd(vcast_vd_d(1.5), vmul_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(vcast_vd_d(0.5), d), x), x))); + x = vmul_vd_vd_vd(x, d); + + vdouble2 d2 = ddmul_vd2_vd2_vd2(ddadd2_vd2_vd_vd2(d, ddmul_vd2_vd_vd(x, x)), ddrec_vd2_vd(x)); + + x = vmul_vd_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(d2), vd2gety_vd_vd2(d2)), q); + + x = vsel_vd_vo_vd_vd(vispinf_vo_vd(d), vcast_vd_d(SLEEF_INFINITY), x); + x = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), d, x); + + return x; +#endif +} + +EXPORT CONST VECTOR_CC vdouble xsqrt(vdouble d) { +#if defined(ACCURATE_SQRT) + return vsqrt_vd_vd(d); +#else + // fall back to approximation if ACCURATE_SQRT is undefined + return xsqrt_u05(d); +#endif +} + +EXPORT CONST VECTOR_CC vdouble xsqrt_u35(vdouble d) { return xsqrt_u05(d); } + +EXPORT CONST VECTOR_CC vdouble xhypot_u05(vdouble x, vdouble y) { + x = vabs_vd_vd(x); + y = vabs_vd_vd(y); + vdouble min = vmin_vd_vd_vd(x, y), n = min; + vdouble max = vmax_vd_vd_vd(x, y), d = max; + + vopmask o = vlt_vo_vd_vd(max, vcast_vd_d(SLEEF_DBL_MIN)); + n = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(n, vcast_vd_d(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(UINT64_C(1) << 54)), d); + + vdouble2 t = dddiv_vd2_vd2_vd2(vcast_vd2_vd_vd(n, vcast_vd_d(0)), vcast_vd2_vd_vd(d, vcast_vd_d(0))); + t = ddmul_vd2_vd2_vd(ddsqrt_vd2_vd2(ddadd2_vd2_vd2_vd(ddsqu_vd2_vd2(t), vcast_vd_d(1))), max); + vdouble ret = vadd_vd_vd_vd(vd2getx_vd_vd2(t), vd2gety_vd_vd2(t)); + ret = vsel_vd_vo_vd_vd(visnan_vo_vd(ret), vcast_vd_d(SLEEF_INFINITY), ret); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(min, vcast_vd_d(0)), max, ret); + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vcast_vd_d(SLEEF_NAN), ret); + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(veq_vo_vd_vd(x, vcast_vd_d(SLEEF_INFINITY)), veq_vo_vd_vd(y, vcast_vd_d(SLEEF_INFINITY))), vcast_vd_d(SLEEF_INFINITY), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vdouble xhypot_u35(vdouble x, vdouble y) { + x = vabs_vd_vd(x); + y = vabs_vd_vd(y); + vdouble min = vmin_vd_vd_vd(x, y); + vdouble max = vmax_vd_vd_vd(x, y); + + vdouble t = vdiv_vd_vd_vd(min, max); + vdouble ret = vmul_vd_vd_vd(max, vsqrt_vd_vd(vmla_vd_vd_vd_vd(t, t, vcast_vd_d(1)))); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(min, vcast_vd_d(0)), max, ret); + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(visnan_vo_vd(x), visnan_vo_vd(y)), vcast_vd_d(SLEEF_NAN), ret); + ret = vsel_vd_vo_vd_vd(vor_vo_vo_vo(veq_vo_vd_vd(x, vcast_vd_d(SLEEF_INFINITY)), veq_vo_vd_vd(y, vcast_vd_d(SLEEF_INFINITY))), vcast_vd_d(SLEEF_INFINITY), ret); + + return ret; +} + +static INLINE CONST VECTOR_CC vdouble vptrunc_vd_vd(vdouble x) { // round to integer toward 0, positive argument only +#ifdef FULL_FP_ROUNDING + return vtruncate_vd_vd(x); +#else + vdouble fr = vmla_vd_vd_vd_vd(vcast_vd_d(-(double)(INT64_C(1) << 31)), vcast_vd_vi(vtruncate_vi_vd(vmul_vd_vd_vd(x, vcast_vd_d(1.0 / (INT64_C(1) << 31))))), x); + fr = vsub_vd_vd_vd(fr, vcast_vd_vi(vtruncate_vi_vd(fr))); + return vsel_vd_vo_vd_vd(vge_vo_vd_vd(vabs_vd_vd(x), vcast_vd_d(INT64_C(1) << 52)), x, vsub_vd_vd_vd(x, fr)); +#endif +} + +/* TODO AArch64: potential optimization by using `vfmad_lane_f64` */ +EXPORT CONST VECTOR_CC vdouble xfmod(vdouble x, vdouble y) { + vdouble n = vabs_vd_vd(x), d = vabs_vd_vd(y), s = vcast_vd_d(1), q; + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN)); + n = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(n, vcast_vd_d(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(s , vcast_vd_d(1.0 / (UINT64_C(1) << 54))), s); + vdouble2 r = vcast_vd2_vd_vd(n, vcast_vd_d(0)); + vdouble rd = vtoward0_vd_vd(vrec_vd_vd(d)); + + for(int i=0;i<21;i++) { // ceil(log2(DBL_MAX) / 52) + q = vptrunc_vd_vd(vmul_vd_vd_vd(vtoward0_vd_vd(vd2getx_vd_vd2(r)), rd)); +#ifndef ENABLE_FMA_DP + q = vreinterpret_vd_vm(vand_vm_vm_vm(vreinterpret_vm_vd(q), vcast_vm_u64(UINT64_C(0xfffffffffffffffe)))); +#endif + q = vsel_vd_vo_vd_vd(vand_vo_vo_vo(vgt_vo_vd_vd(vmul_vd_vd_vd(vcast_vd_d(3), d), vd2getx_vd_vd2(r)), + vge_vo_vd_vd(vd2getx_vd_vd2(r), d)), + vcast_vd_d(2), q); + q = vsel_vd_vo_vd_vd(vand_vo_vo_vo(vgt_vo_vd_vd(vadd_vd_vd_vd(d, d), vd2getx_vd_vd2(r)), + vge_vo_vd_vd(vd2getx_vd_vd2(r), d)), + vcast_vd_d(1), q); + r = ddnormalize_vd2_vd2(ddadd2_vd2_vd2_vd2(r, ddmul_vd2_vd_vd(q, vneg_vd_vd(d)))); + if (vtestallones_i_vo64(vlt_vo_vd_vd(vd2getx_vd_vd2(r), d))) break; + } + + vdouble ret = vmul_vd_vd_vd(vd2getx_vd_vd2(r), s); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(r), vd2gety_vd_vd2(r)), d), vcast_vd_d(0), ret); + + ret = vmulsign_vd_vd_vd(ret, x); + + ret = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(n, d), x, ret); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_NAN), ret); + + return ret; +} + +static INLINE VECTOR_CC vdouble vrintk2_vd_vd(vdouble d) { +#ifdef FULL_FP_ROUNDING + return vrint_vd_vd(d); +#else + vdouble c = vmulsign_vd_vd_vd(vcast_vd_d(INT64_C(1) << 52), d); + return vsel_vd_vo_vd_vd(vgt_vo_vd_vd(vabs_vd_vd(d), vcast_vd_d(INT64_C(1) << 52)), + d, vorsign_vd_vd_vd(vsub_vd_vd_vd(vadd_vd_vd_vd(d, c), c), d)); +#endif +} + +EXPORT CONST VECTOR_CC vdouble xremainder(vdouble x, vdouble y) { + vdouble n = vabs_vd_vd(x), d = vabs_vd_vd(y), s = vcast_vd_d(1), q; + vopmask o = vlt_vo_vd_vd(d, vcast_vd_d(SLEEF_DBL_MIN*2)); + n = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(n, vcast_vd_d(UINT64_C(1) << 54)), n); + d = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(d, vcast_vd_d(UINT64_C(1) << 54)), d); + s = vsel_vd_vo_vd_vd(o, vmul_vd_vd_vd(s , vcast_vd_d(1.0 / (UINT64_C(1) << 54))), s); + vdouble rd = vrec_vd_vd(d); + vdouble2 r = vcast_vd2_vd_vd(n, vcast_vd_d(0)); + vopmask qisodd = vneq_vo_vd_vd(vcast_vd_d(0), vcast_vd_d(0)); + + for(int i=0;i<21;i++) { // ceil(log2(DBL_MAX) / 52) + q = vrintk2_vd_vd(vmul_vd_vd_vd(vd2getx_vd_vd2(r), rd)); +#ifndef ENABLE_FMA_DP + q = vreinterpret_vd_vm(vand_vm_vm_vm(vreinterpret_vm_vd(q), vcast_vm_u64(UINT64_C(0xfffffffffffffffe)))); +#endif + q = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(vabs_vd_vd(vd2getx_vd_vd2(r)), vmul_vd_vd_vd(d, vcast_vd_d(1.5))), vmulsign_vd_vd_vd(vcast_vd_d(1.0), vd2getx_vd_vd2(r)), q); + q = vsel_vd_vo_vd_vd(vor_vo_vo_vo(vlt_vo_vd_vd(vabs_vd_vd(vd2getx_vd_vd2(r)), vmul_vd_vd_vd(d, vcast_vd_d(0.5))), + vandnot_vo_vo_vo(qisodd, veq_vo_vd_vd(vabs_vd_vd(vd2getx_vd_vd2(r)), vmul_vd_vd_vd(d, vcast_vd_d(0.5))))), + vcast_vd_d(0.0), q); + if (vtestallones_i_vo64(veq_vo_vd_vd(q, vcast_vd_d(0)))) break; + q = vsel_vd_vo_vd_vd(visinf_vo_vd(vmul_vd_vd_vd(q, vneg_vd_vd(d))), vadd_vd_vd_vd(q, vmulsign_vd_vd_vd(vcast_vd_d(-1), vd2getx_vd_vd2(r))), q); + qisodd = vxor_vo_vo_vo(qisodd, visodd_vo_vd(q)); + r = ddnormalize_vd2_vd2(ddadd2_vd2_vd2_vd2(r, ddmul_vd2_vd_vd(q, vneg_vd_vd(d)))); + } + + vdouble ret = vmul_vd_vd_vd(vd2getx_vd_vd2(r), s); + ret = vmulsign_vd_vd_vd(ret, x); + ret = vsel_vd_vo_vd_vd(visinf_vo_vd(y), vsel_vd_vo_vd_vd(visinf_vo_vd(x), vcast_vd_d(SLEEF_NAN), x), ret); + ret = vsel_vd_vo_vd_vd(veq_vo_vd_vd(d, vcast_vd_d(0)), vcast_vd_d(SLEEF_NAN), ret); + return ret; +} + +/* TODO AArch64: potential optimization by using `vfmad_lane_f64` */ +static CONST dd2 gammak(vdouble a) { + vdouble2 clc = vcast_vd2_d_d(0, 0), clln = vcast_vd2_d_d(1, 0), clld = vcast_vd2_d_d(1, 0); + vdouble2 x, y, z; + vdouble t, u; + + vopmask otiny = vlt_vo_vd_vd(vabs_vd_vd(a), vcast_vd_d(1e-306)), oref = vlt_vo_vd_vd(a, vcast_vd_d(0.5)); + + x = vsel_vd2_vo_vd2_vd2(otiny, vcast_vd2_d_d(0, 0), + vsel_vd2_vo_vd2_vd2(oref, ddadd2_vd2_vd_vd(vcast_vd_d(1), vneg_vd_vd(a)), + vcast_vd2_vd_vd(a, vcast_vd_d(0)))); + + vopmask o0 = vand_vo_vo_vo(vle_vo_vd_vd(vcast_vd_d(0.5), vd2getx_vd_vd2(x)), vle_vo_vd_vd(vd2getx_vd_vd2(x), vcast_vd_d(1.1))); + vopmask o2 = vle_vo_vd_vd(vcast_vd_d(2.3), vd2getx_vd_vd2(x)); + + y = ddnormalize_vd2_vd2(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(x, vcast_vd_d(1)), x)); + y = ddnormalize_vd2_vd2(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(x, vcast_vd_d(2)), y)); + y = ddnormalize_vd2_vd2(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(x, vcast_vd_d(3)), y)); + y = ddnormalize_vd2_vd2(ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(x, vcast_vd_d(4)), y)); + + vopmask o = vand_vo_vo_vo(o2, vle_vo_vd_vd(vd2getx_vd_vd2(x), vcast_vd_d(7))); + clln = vsel_vd2_vo_vd2_vd2(o, y, clln); + + x = vsel_vd2_vo_vd2_vd2(o, ddadd2_vd2_vd2_vd(x, vcast_vd_d(5)), x); + + t = vsel_vd_vo_vd_vd(o2, vrec_vd_vd(vd2getx_vd_vd2(x)), vd2getx_vd_vd2(ddnormalize_vd2_vd2(ddadd2_vd2_vd2_vd(x, vsel_vd_vo_d_d(o0, -1, -2))))); + + u = vsel_vd_vo_vo_d_d_d(o2, o0, -156.801412704022726379848862, +0.2947916772827614196e+2, +0.7074816000864609279e-7); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +1.120804464289911606838558160000, +0.1281459691827820109e+3, +0.4009244333008730443e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +13.39798545514258921833306020000, +0.2617544025784515043e+3, +0.1040114641628246946e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.116546276599463200848033357000, +0.3287022855685790432e+3, +0.1508349150733329167e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -1.391801093265337481495562410000, +0.2818145867730348186e+3, +0.1288143074933901020e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.015056113040026424412918973400, +0.1728670414673559605e+3, +0.4744167749884993937e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.179540117061234856098844714000, +0.7748735764030416817e+2, -0.6554816306542489902e-7)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.002481743600264997730942489280, +0.2512856643080930752e+2, -0.3189252471452599844e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.029527880945699120504851034100, +0.5766792106140076868e+1, +0.1358883821470355377e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.000540164767892604515196325186, +0.7270275473996180571e+0, -0.4343931277157336040e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.006403362833808069794787256200, +0.8396709124579147809e-1, +0.9724785897406779555e-6)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.000162516262783915816896611252, -0.8211558669746804595e-1, -0.2036886057225966011e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.001914438498565477526465972390, +0.6828831828341884458e-1, +0.4373363141819725815e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +7.20489541602001055898311517e-05, -0.7712481339961671511e-1, -0.9439951268304008677e-5)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.000839498720672087279971000786, +0.8337492023017314957e-1, +0.2050727030376389804e-4)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -5.17179090826059219329394422e-05, -0.9094964931456242518e-1, -0.4492620183431184018e-4)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.000592166437353693882857342347, +0.1000996313575929358e+0, +0.9945751236071875931e-4)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +6.97281375836585777403743539e-05, -0.1113342861544207724e+0, -0.2231547599034983196e-3)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.000784039221720066627493314301, +0.1255096673213020875e+0, +0.5096695247101967622e-3)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.000229472093621399176949318732, -0.1440498967843054368e+0, -0.1192753911667886971e-2)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, -0.002681327160493827160473958490, +0.1695571770041949811e+0, +0.2890510330742210310e-2)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.003472222222222222222175164840, -0.2073855510284092762e+0, -0.7385551028674461858e-2)); + u = vmla_vd_vd_vd_vd(u, t, vsel_vd_vo_vo_d_d_d(o2, o0, +0.083333333333333333335592087900, +0.2705808084277815939e+0, +0.2058080842778455335e-1)); + + y = ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(x, vcast_vd_d(-0.5)), logk2(x)); + y = ddadd2_vd2_vd2_vd2(y, ddneg_vd2_vd2(x)); + y = ddadd2_vd2_vd2_vd2(y, vcast_vd2_d_d(0.91893853320467278056, -3.8782941580672414498e-17)); // 0.5*log(2*M_PI) + + z = ddadd2_vd2_vd2_vd(ddmul_vd2_vd_vd (u, t), vsel_vd_vo_d_d(o0, -0.4006856343865314862e+0, -0.6735230105319810201e-1)); + z = ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd(z, t), vsel_vd_vo_d_d(o0, +0.8224670334241132030e+0, +0.3224670334241132030e+0)); + z = ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd(z, t), vsel_vd_vo_d_d(o0, -0.5772156649015328655e+0, +0.4227843350984671345e+0)); + z = ddmul_vd2_vd2_vd(z, t); + + clc = vsel_vd2_vo_vd2_vd2(o2, y, z); + + clld = vsel_vd2_vo_vd2_vd2(o2, ddadd2_vd2_vd2_vd(ddmul_vd2_vd_vd(u, t), vcast_vd_d(1)), clld); + + y = clln; + + clc = vsel_vd2_vo_vd2_vd2(otiny, vcast_vd2_d_d(83.1776616671934334590333, 3.67103459631568507221878e-15), // log(2^120) + vsel_vd2_vo_vd2_vd2(oref, ddadd2_vd2_vd2_vd2(vcast_vd2_d_d(1.1447298858494001639, 1.026595116270782638e-17), ddneg_vd2_vd2(clc)), clc)); // log(M_PI) + clln = vsel_vd2_vo_vd2_vd2(otiny, vcast_vd2_d_d(1, 0), vsel_vd2_vo_vd2_vd2(oref, clln, clld)); + + if (!vtestallones_i_vo64(vnot_vo64_vo64(oref))) { + t = vsub_vd_vd_vd(a, vmul_vd_vd_vd(vcast_vd_d(INT64_C(1) << 28), vcast_vd_vi(vtruncate_vi_vd(vmul_vd_vd_vd(a, vcast_vd_d(1.0 / (INT64_C(1) << 28))))))); + x = ddmul_vd2_vd2_vd2(clld, sinpik(t)); + } + + clld = vsel_vd2_vo_vd2_vd2(otiny, vcast_vd2_vd_vd(vmul_vd_vd_vd(a, vcast_vd_d((INT64_C(1) << 60)*(double)(INT64_C(1) << 60))), vcast_vd_d(0)), + vsel_vd2_vo_vd2_vd2(oref, x, y)); + + return dd2setab_dd2_vd2_vd2(clc, dddiv_vd2_vd2_vd2(clln, clld)); +} + +EXPORT CONST VECTOR_CC vdouble xtgamma_u1(vdouble a) { + dd2 d = gammak(a); + vdouble2 y = ddmul_vd2_vd2_vd2(expk2(dd2geta_vd2_dd2(d)), dd2getb_vd2_dd2(d)); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(y), vd2gety_vd_vd2(y)); + vopmask o; + + o = vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vd_vd(a, vcast_vd_d(-SLEEF_INFINITY)), + vand_vo_vo_vo(vlt_vo_vd_vd(a, vcast_vd_d(0)), visint_vo_vd(a))), + vand_vo_vo_vo(vand_vo_vo_vo(visnumber_vo_vd(a), vlt_vo_vd_vd(a, vcast_vd_d(0))), visnan_vo_vd(r))); + r = vsel_vd_vo_vd_vd(o, vcast_vd_d(SLEEF_NAN), r); + + o = vand_vo_vo_vo(vand_vo_vo_vo(vor_vo_vo_vo(veq_vo_vd_vd(a, vcast_vd_d(SLEEF_INFINITY)), visnumber_vo_vd(a)), + vge_vo_vd_vd(a, vcast_vd_d(-SLEEF_DBL_MIN))), + vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vd_vd(a, vcast_vd_d(0)), vgt_vo_vd_vd(a, vcast_vd_d(200))), visnan_vo_vd(r))); + r = vsel_vd_vo_vd_vd(o, vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), a), r); + + return r; +} + +EXPORT CONST VECTOR_CC vdouble xlgamma_u1(vdouble a) { + dd2 d = gammak(a); + vdouble2 y = ddadd2_vd2_vd2_vd2(dd2geta_vd2_dd2(d), logk2(ddabs_vd2_vd2(dd2getb_vd2_dd2(d)))); + vdouble r = vadd_vd_vd_vd(vd2getx_vd_vd2(y), vd2gety_vd_vd2(y)); + vopmask o; + + o = vor_vo_vo_vo(visinf_vo_vd(a), + vor_vo_vo_vo(vand_vo_vo_vo(vle_vo_vd_vd(a, vcast_vd_d(0)), visint_vo_vd(a)), + vand_vo_vo_vo(visnumber_vo_vd(a), visnan_vo_vd(r)))); + r = vsel_vd_vo_vd_vd(o, vcast_vd_d(SLEEF_INFINITY), r); + + return r; +} + +static INLINE CONST vdouble2 ddmla_vd2_vd_vd2_vd2(vdouble x, vdouble2 y, vdouble2 z) { + return ddadd_vd2_vd2_vd2(z, ddmul_vd2_vd2_vd(y, x)); +} + +static INLINE CONST VECTOR_CC vdouble2 poly2dd_b(vdouble x, vdouble2 c1, vdouble2 c0) { return ddmla_vd2_vd_vd2_vd2(x, c1, c0); } +static INLINE CONST VECTOR_CC vdouble2 poly2dd(vdouble x, vdouble c1, vdouble2 c0) { return ddmla_vd2_vd_vd2_vd2(x, vcast_vd2_vd_vd(c1, vcast_vd_d(0)), c0); } +static INLINE CONST VECTOR_CC vdouble2 poly4dd(vdouble x, vdouble c3, vdouble2 c2, vdouble2 c1, vdouble2 c0) { + return ddmla_vd2_vd_vd2_vd2(vmul_vd_vd_vd(x, x), poly2dd(x, c3, c2), poly2dd_b(x, c1, c0)); +} + +EXPORT CONST VECTOR_CC vdouble xerf_u1(vdouble a) { + vdouble t, x = vabs_vd_vd(a); + vdouble2 t2; + vdouble x2 = vmul_vd_vd_vd(x, x), x4 = vmul_vd_vd_vd(x2, x2); + vdouble x8 = vmul_vd_vd_vd(x4, x4), x16 = vmul_vd_vd_vd(x8, x8); + vopmask o25 = vle_vo_vd_vd(x, vcast_vd_d(2.5)); + + if (LIKELY(vtestallones_i_vo64(o25))) { + // Abramowitz and Stegun + t = POLY21(x, x2, x4, x8, x16, + -0.2083271002525222097e-14, + +0.7151909970790897009e-13, + -0.1162238220110999364e-11, + +0.1186474230821585259e-10, + -0.8499973178354613440e-10, + +0.4507647462598841629e-9, + -0.1808044474288848915e-8, + +0.5435081826716212389e-8, + -0.1143939895758628484e-7, + +0.1215442362680889243e-7, + +0.1669878756181250355e-7, + -0.9808074602255194288e-7, + +0.1389000557865837204e-6, + +0.2945514529987331866e-6, + -0.1842918273003998283e-5, + +0.3417987836115362136e-5, + +0.3860236356493129101e-5, + -0.3309403072749947546e-4, + +0.1060862922597579532e-3, + +0.2323253155213076174e-3, + +0.1490149719145544729e-3); + t2 = poly4dd(x, t, + vcast_vd2_d_d(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d(0.07052369794346953491, 9.5846628070792092842e-19)); + t2 = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd(t2, x)); + t2 = ddsqu_vd2_vd2(t2); + t2 = ddsqu_vd2_vd2(t2); + t2 = ddsqu_vd2_vd2(t2); + t2 = ddsqu_vd2_vd2(t2); + t2 = ddrec_vd2_vd2(t2); + } else { +#undef C2V +#define C2V(c) (c) + t = POLY21(x, x2, x4, x8, x16, + vsel_vd_vo_d_d(o25, -0.2083271002525222097e-14, -0.4024015130752621932e-18), + vsel_vd_vo_d_d(o25, +0.7151909970790897009e-13, +0.3847193332817048172e-16), + vsel_vd_vo_d_d(o25, -0.1162238220110999364e-11, -0.1749316241455644088e-14), + vsel_vd_vo_d_d(o25, +0.1186474230821585259e-10, +0.5029618322872872715e-13), + vsel_vd_vo_d_d(o25, -0.8499973178354613440e-10, -0.1025221466851463164e-11), + vsel_vd_vo_d_d(o25, +0.4507647462598841629e-9, +0.1573695559331945583e-10), + vsel_vd_vo_d_d(o25, -0.1808044474288848915e-8, -0.1884658558040203709e-9), + vsel_vd_vo_d_d(o25, +0.5435081826716212389e-8, +0.1798167853032159309e-8), + vsel_vd_vo_d_d(o25, -0.1143939895758628484e-7, -0.1380745342355033142e-7), + vsel_vd_vo_d_d(o25, +0.1215442362680889243e-7, +0.8525705726469103499e-7), + vsel_vd_vo_d_d(o25, +0.1669878756181250355e-7, -0.4160448058101303405e-6), + vsel_vd_vo_d_d(o25, -0.9808074602255194288e-7, +0.1517272660008588485e-5), + vsel_vd_vo_d_d(o25, +0.1389000557865837204e-6, -0.3341634127317201697e-5), + vsel_vd_vo_d_d(o25, +0.2945514529987331866e-6, -0.2515023395879724513e-5), + vsel_vd_vo_d_d(o25, -0.1842918273003998283e-5, +0.6539731269664907554e-4), + vsel_vd_vo_d_d(o25, +0.3417987836115362136e-5, -0.3551065097428388658e-3), + vsel_vd_vo_d_d(o25, +0.3860236356493129101e-5, +0.1210736097958368864e-2), + vsel_vd_vo_d_d(o25, -0.3309403072749947546e-4, -0.2605566912579998680e-2), + vsel_vd_vo_d_d(o25, +0.1060862922597579532e-3, +0.1252823202436093193e-2), + vsel_vd_vo_d_d(o25, +0.2323253155213076174e-3, +0.1820191395263313222e-1), + vsel_vd_vo_d_d(o25, +0.1490149719145544729e-3, -0.1021557155453465954e+0)); + t2 = poly4dd(x, t, + vsel_vd2_vo_vd2_vd2(o25, vcast_vd2_d_d(0.0092877958392275604405, 7.9287559463961107493e-19), + vcast_vd2_d_d(-0.63691044383641748361, -2.4249477526539431839e-17)), + vsel_vd2_vo_vd2_vd2(o25, vcast_vd2_d_d(0.042275531758784692937, 1.3785226620501016138e-19), + vcast_vd2_d_d(-1.1282926061803961737, -6.2970338860410996505e-17)), + vsel_vd2_vo_vd2_vd2(o25, vcast_vd2_d_d(0.07052369794346953491, 9.5846628070792092842e-19), + vcast_vd2_d_d(-1.2261313785184804967e-05, -5.5329707514490107044e-22))); + vdouble2 s2 = ddadd_vd2_vd_vd2(vcast_vd_d(1), ddmul_vd2_vd2_vd(t2, x)); + s2 = ddsqu_vd2_vd2(s2); + s2 = ddsqu_vd2_vd2(s2); + s2 = ddsqu_vd2_vd2(s2); + s2 = ddsqu_vd2_vd2(s2); + s2 = ddrec_vd2_vd2(s2); + t2 = vsel_vd2_vo_vd2_vd2(o25, s2, vcast_vd2_vd_vd(expk(t2), vcast_vd_d(0))); + } + + t2 = ddadd2_vd2_vd2_vd(t2, vcast_vd_d(-1)); + + vdouble z = vneg_vd_vd(vadd_vd_vd_vd(vd2getx_vd_vd2(t2), vd2gety_vd_vd2(t2))); + z = vsel_vd_vo_vd_vd(vlt_vo_vd_vd(x, vcast_vd_d(1e-8)), vmul_vd_vd_vd(x, vcast_vd_d(1.12837916709551262756245475959)), z); + z = vsel_vd_vo_vd_vd(vge_vo_vd_vd(x, vcast_vd_d(6)), vcast_vd_d(1), z); + z = vsel_vd_vo_vd_vd(visinf_vo_vd(a), vcast_vd_d(1), z); + z = vsel_vd_vo_vd_vd(veq_vo_vd_vd(a, vcast_vd_d(0)), vcast_vd_d(0), z); + z = vmulsign_vd_vd_vd(z, a); + + return z; +} + +/* TODO AArch64: potential optimization by using `vfmad_lane_f64` */ +EXPORT CONST VECTOR_CC vdouble xerfc_u15(vdouble a) { + vdouble s = a, r = vcast_vd_d(0), t; + vdouble2 u, d, x; + a = vabs_vd_vd(a); + vopmask o0 = vlt_vo_vd_vd(a, vcast_vd_d(1.0)); + vopmask o1 = vlt_vo_vd_vd(a, vcast_vd_d(2.2)); + vopmask o2 = vlt_vo_vd_vd(a, vcast_vd_d(4.2)); + vopmask o3 = vlt_vo_vd_vd(a, vcast_vd_d(27.3)); + + u = vsel_vd2_vo_vd2_vd2(o0, ddmul_vd2_vd_vd(a, a), vsel_vd2_vo_vd2_vd2(o1, vcast_vd2_vd_vd(a, vcast_vd_d(0)), dddiv_vd2_vd2_vd2(vcast_vd2_d_d(1, 0), vcast_vd2_vd_vd(a, vcast_vd_d(0))))); + + t = vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.6801072401395386139e-20, +0.3438010341362585303e-12, -0.5757819536420710449e+2, +0.2334249729638701319e+5); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.2161766247570055669e-18, -0.1237021188160598264e-10, +0.4669289654498104483e+3, -0.4695661044933107769e+5)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.4695919173301595670e-17, +0.2117985839877627852e-09, -0.1796329879461355858e+4, +0.3173403108748643353e+5)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.9049140419888007122e-16, -0.2290560929177369506e-08, +0.4355892193699575728e+4, +0.3242982786959573787e+4)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.1634018903557410728e-14, +0.1748931621698149538e-07, -0.7456258884965764992e+4, -0.2014717999760347811e+5)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.2783485786333451745e-13, -0.9956602606623249195e-07, +0.9553977358167021521e+4, +0.1554006970967118286e+5)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.4463221276786415752e-12, +0.4330010240640327080e-06, -0.9470019905444229153e+4, -0.6150874190563554293e+4)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.6711366622850136563e-11, -0.1435050600991763331e-05, +0.7387344321849855078e+4, +0.1240047765634815732e+4)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.9422759050232662223e-10, +0.3460139479650695662e-05, -0.4557713054166382790e+4, -0.8210325475752699731e+2)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.1229055530100229098e-08, -0.4988908180632898173e-05, +0.2207866967354055305e+4, +0.3242443880839930870e+2)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.1480719281585086512e-07, -0.1308775976326352012e-05, -0.8217975658621754746e+3, -0.2923418863833160586e+2)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.1636584469123399803e-06, +0.2825086540850310103e-04, +0.2268659483507917400e+3, +0.3457461732814383071e+0)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.1646211436588923575e-05, -0.6393913713069986071e-04, -0.4633361260318560682e+2, +0.5489730155952392998e+1)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.1492565035840623511e-04, -0.2566436514695078926e-04, +0.9557380123733945965e+1, +0.1559934132251294134e-2)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.1205533298178967851e-03, +0.5895792375659440364e-03, -0.2958429331939661289e+1, -0.1541741566831520638e+1)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.8548327023450850081e-03, -0.1695715579163588598e-02, +0.1670329508092765480e+0, +0.2823152230558364186e-5)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, +0.5223977625442187932e-02, +0.2089116434918055149e-03, +0.6096615680115419211e+0, +0.6249999184195342838e+0)); + t = vmla_vd_vd_vd_vd(t, vd2getx_vd_vd2(u), vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.2686617064513125222e-01, +0.1912855949584917753e-01, +0.1059212443193543585e-2, +0.1741749416408701288e-8)); + + d = ddmul_vd2_vd2_vd(u, t); + d = ddadd2_vd2_vd2_vd2(d, vcast_vd2_vd_vd(vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, 0.11283791670955126141, -0.10277263343147646779, -0.50005180473999022439, -0.5000000000258444377), + vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -4.0175691625932118483e-18, -6.2338714083404900225e-18, 2.6362140569041995803e-17, -4.0074044712386992281e-17))); + d = ddmul_vd2_vd2_vd2(d, u); + d = ddadd2_vd2_vd2_vd2(d, vcast_vd2_vd_vd(vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.37612638903183753802, -0.63661976742916359662, 1.601106273924963368e-06, 2.3761973137523364792e-13), + vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, 1.3391897206042552387e-17, 7.6321019159085724662e-18, 1.1974001857764476775e-23, -1.1670076950531026582e-29))); + d = ddmul_vd2_vd2_vd2(d, u); + d = ddadd2_vd2_vd2_vd2(d, vcast_vd2_vd_vd(vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, 1.1283791670955125586, -1.1283791674717296161, -0.57236496645145429341, -0.57236494292470108114), + vsel_vd_vo_vo_vo_d_d_d_d(o0, o1, o2, 1.5335459613165822674e-17, 8.0896847755965377194e-17, 3.0704553245872027258e-17, -2.3984352208056898003e-17))); + + x = ddmul_vd2_vd2_vd(vsel_vd2_vo_vd2_vd2(o1, d, vcast_vd2_vd_vd(vneg_vd_vd(a), vcast_vd_d(0))), a); + x = vsel_vd2_vo_vd2_vd2(o1, x, ddadd2_vd2_vd2_vd2(x, d)); + x = vsel_vd2_vo_vd2_vd2(o0, ddsub_vd2_vd2_vd2(vcast_vd2_d_d(1, 0), x), expk2(x)); + x = vsel_vd2_vo_vd2_vd2(o1, x, ddmul_vd2_vd2_vd2(x, u)); + + r = vsel_vd_vo_vd_vd(o3, vadd_vd_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(x)), vcast_vd_d(0)); + r = vsel_vd_vo_vd_vd(vsignbit_vo_vd(s), vsub_vd_vd_vd(vcast_vd_d(2), r), r); + r = vsel_vd_vo_vd_vd(visnan_vo_vd(s), vcast_vd_d(SLEEF_NAN), r); + return r; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) && !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) +// The normal and deterministic versions of implementations are common +// for the functions like sincospi_u05. Aliases are defined by +// DALIAS_* macros for such functions. The defined aliases +// (e.g. ysincospi_u05) are renamed(e.g. to +// Sleef_cinz_sincospid2_u05sse2) by rename*.h. + +#ifdef ENABLE_ALIAS +#define DALIAS_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vd2_vd(FUNC) EXPORT CONST VECTOR_CC vdouble2 y ## FUNC(vdouble) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vi_vd(FUNC) EXPORT CONST VECTOR_CC vint y ## FUNC(vdouble) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vd_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble, vdouble) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vd_vd_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble, vdouble, vdouble) __attribute__((alias( stringify(x ## FUNC) ))); +#else +#define DALIAS_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble d) { return x ## FUNC (d); } +#define DALIAS_vd2_vd(FUNC) EXPORT CONST VECTOR_CC vdouble2 y ## FUNC(vdouble d) { return x ## FUNC (d); } +#define DALIAS_vi_vd(FUNC) EXPORT CONST VECTOR_CC vint y ## FUNC(vdouble d) { return x ## FUNC (d); } +#define DALIAS_vd_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble x, vdouble y) { return x ## FUNC (x, y); } +#define DALIAS_vd_vd_vd_vd(FUNC) EXPORT CONST VECTOR_CC vdouble y ## FUNC(vdouble x, vdouble y, vdouble z) { return x ## FUNC (x, y, z); } +#endif + +DALIAS_vd2_vd(sincospi_u05) +DALIAS_vd2_vd(sincospi_u35) +DALIAS_vd2_vd(modf) +DALIAS_vd_vd(log) +DALIAS_vd_vd(log_u1) +DALIAS_vd_vd_vd(pow) +DALIAS_vd_vd(sinh) +DALIAS_vd_vd(cosh) +DALIAS_vd_vd(tanh) +DALIAS_vd_vd(sinh_u35) +DALIAS_vd_vd(cosh_u35) +DALIAS_vd_vd(tanh_u35) +DALIAS_vd_vd(asinh) +DALIAS_vd_vd(acosh) +DALIAS_vd_vd(atanh) +DALIAS_vd_vd(cbrt) +DALIAS_vd_vd(cbrt_u1) +DALIAS_vd_vd(expm1) +DALIAS_vd_vd(log10) +DALIAS_vd_vd(log2) +DALIAS_vd_vd(log2_u35) +DALIAS_vd_vd(log1p) +DALIAS_vd_vd(fabs) +DALIAS_vd_vd_vd(copysign) +DALIAS_vd_vd_vd(fmax) +DALIAS_vd_vd_vd(fmin) +DALIAS_vd_vd_vd(fdim) +DALIAS_vd_vd(trunc) +DALIAS_vd_vd(floor) +DALIAS_vd_vd(ceil) +DALIAS_vd_vd(round) +DALIAS_vd_vd(rint) +DALIAS_vd_vd_vd(nextafter) +DALIAS_vd_vd(frfrexp) +DALIAS_vi_vd(expfrexp) +DALIAS_vd_vd_vd_vd(fma) +DALIAS_vd_vd(sqrt_u05) +DALIAS_vd_vd(sqrt_u35) +DALIAS_vd_vd_vd(hypot_u05) +DALIAS_vd_vd_vd(hypot_u35) +DALIAS_vd_vd_vd(fmod) +DALIAS_vd_vd_vd(remainder) +DALIAS_vd_vd(tgamma_u1) +DALIAS_vd_vd(lgamma_u1) +DALIAS_vd_vd(erf_u1) +DALIAS_vd_vd(erfc_u15) +#endif // #if !defined(DETERMINISTIC) && !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) + +#if !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) +EXPORT CONST int xgetInt(int name) { + if (1 <= name && name <= 10) return vavailability_i(name); + return 0; +} + +EXPORT CONST void *xgetPtr(int name) { + if (name == 0) return ISANAME; + return (void *)0; +} +#endif + +#if defined(ALIAS_NO_EXT_SUFFIX) && !defined(DETERMINISTIC) +#include ALIAS_NO_EXT_SUFFIX +#endif + +#ifdef ENABLE_MAIN +// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimddp.c rempitab.c ../common/common.c -lm +#include +#include +#include +int main(int argc, char **argv) { + vdouble d1 = vcast_vd_d(atof(argv[1])); + //vdouble d2 = vcast_vd_d(atof(argv[2])); + //vdouble d3 = vcast_vd_d(atof(argv[3])); + //vdouble r = xnextafter(d1, d2); + //int i; + //double fr = frexp(atof(argv[1]), &i); + //printf("%.20g\n", xfma(d1, d2, d3)[0]);; + //printf("test %.20g\n", xtgamma_u1(d1)[0]); + //printf("corr %.20g\n", tgamma(d1[0])); + printf("test %.20g\n", xerf_u1(d1)[0]); + printf("corr %.20g\n", erf(d1[0])); + //printf("test %.20g\n", xerfc_u15(d1)[0]); + //printf("corr %.20g\n", erfc(d1[0])); + //printf("%.20g\n", nextafter(d1[0], d2[0]));; + //printf("%.20g\n", vcast_d_vd(xhypot_u05(d1, d2))); + //printf("%.20g\n", fr); + //printf("%.20g\n", fmod(atof(argv[1]), atof(argv[2]))); + //printf("%.20g\n", xfmod(d1, d2)[0]); + //vdouble2 r = xsincospi_u35(a); + //printf("%g, %g\n", vcast_d_vd(r.x), vcast_d_vd(r.y)); +} +#endif + +#ifdef ENABLE_GNUABI +/* "finite" aliases for compatibility with GLIBC */ +EXPORT CONST VECTOR_CC vdouble __acos_finite (vdouble) __attribute__((weak, alias(str_xacos ))); +EXPORT CONST VECTOR_CC vdouble __acosh_finite (vdouble) __attribute__((weak, alias(str_xacosh ))); +EXPORT CONST VECTOR_CC vdouble __asin_finite (vdouble) __attribute__((weak, alias(str_xasin_u1 ))); +EXPORT CONST VECTOR_CC vdouble __atan2_finite (vdouble, vdouble) __attribute__((weak, alias(str_xatan2_u1 ))); +EXPORT CONST VECTOR_CC vdouble __atanh_finite (vdouble) __attribute__((weak, alias(str_xatanh ))); +EXPORT CONST VECTOR_CC vdouble __cosh_finite (vdouble) __attribute__((weak, alias(str_xcosh ))); +EXPORT CONST VECTOR_CC vdouble __exp10_finite (vdouble) __attribute__((weak, alias(str_xexp10 ))); +EXPORT CONST VECTOR_CC vdouble __exp2_finite (vdouble) __attribute__((weak, alias(str_xexp2 ))); +EXPORT CONST VECTOR_CC vdouble __exp_finite (vdouble) __attribute__((weak, alias(str_xexp ))); +EXPORT CONST VECTOR_CC vdouble __fmod_finite (vdouble, vdouble) __attribute__((weak, alias(str_xfmod ))); +EXPORT CONST VECTOR_CC vdouble __remainder_finite(vdouble, vdouble) __attribute__((weak, alias(str_xremainder))); +EXPORT CONST VECTOR_CC vdouble __modf_finite (vdouble, vdouble *) __attribute__((weak, alias(str_xmodf ))); +EXPORT CONST VECTOR_CC vdouble __hypot_u05_finite(vdouble, vdouble) __attribute__((weak, alias(str_xhypot_u05))); +EXPORT CONST VECTOR_CC vdouble __lgamma_u1_finite(vdouble) __attribute__((weak, alias(str_xlgamma_u1))); +EXPORT CONST VECTOR_CC vdouble __log10_finite (vdouble) __attribute__((weak, alias(str_xlog10 ))); +EXPORT CONST VECTOR_CC vdouble __log_finite (vdouble) __attribute__((weak, alias(str_xlog_u1 ))); +EXPORT CONST VECTOR_CC vdouble __pow_finite (vdouble, vdouble) __attribute__((weak, alias(str_xpow ))); +EXPORT CONST VECTOR_CC vdouble __sinh_finite (vdouble) __attribute__((weak, alias(str_xsinh ))); +EXPORT CONST VECTOR_CC vdouble __sqrt_finite (vdouble) __attribute__((weak, alias(str_xsqrt ))); +EXPORT CONST VECTOR_CC vdouble __tgamma_u1_finite(vdouble) __attribute__((weak, alias(str_xtgamma_u1))); + +#ifdef HEADER_MASKED +#include HEADER_MASKED +#endif +#endif /* #ifdef ENABLE_GNUABI */ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimdsp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimdsp.c new file mode 100644 index 0000000000000..efe9c0e79c499 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsimdsp.c @@ -0,0 +1,3709 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#if !defined(SLEEF_GENHEADER) +#include +#include +#include +#include +#endif + +#include "quaddef.h" +#include "misc.h" + +#ifndef SLEEF_ENABLE_CUDA +extern const float Sleef_rempitabsp[]; +#endif + +#define __SLEEFSIMDSP_C__ + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +// Intel + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helpersse2.h" +#else +#include "macroonlySSE2.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamesse2_gnuabi.h" +#else +#include "renamesse2.h" +#endif +#endif +#endif + +#ifdef ENABLE_SSE4 +#define CONFIG 4 +#if !defined(SLEEF_GENHEADER) +#include "helpersse2.h" +#else +#include "macroonlySSE4.h" +#endif +#ifdef DORENAME +#include "renamesse4.h" +#endif +#endif + +#ifdef ENABLE_AVX +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperavx.h" +#else +#include "macroonlyAVX.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx_gnuabi.h" +#else +#include "renameavx.h" +#endif +#endif +#endif + +#ifdef ENABLE_FMA4 +#define CONFIG 4 +#if !defined(SLEEF_GENHEADER) +#include "helperavx.h" +#else +#include "macroonlyFMA4.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamefma4_gnuabi.h" +#else +#include "renamefma4.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperavx2.h" +#else +#include "macroonlyAVX2.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx2_gnuabi.h" +#else +#include "renameavx2.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperavx2_128.h" +#else +#include "macroonlyAVX2128.h" +#endif +#ifdef DORENAME +#include "renameavx2128.h" +#endif +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperavx512f.h" +#else +#include "macroonlyAVX512F.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameavx512f_gnuabi.h" +#else +#include "renameavx512f.h" +#endif +#endif +#endif + +#ifdef ENABLE_AVX512FNOFMA +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helperavx512f.h" +#else +#include "macroonlyAVX512FNOFMA.h" +#endif +#ifdef DORENAME +#include "renameavx512fnofma.h" +#endif +#endif + +// Arm + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperadvsimd.h" +#else +#include "macroonlyADVSIMD.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renameadvsimd_gnuabi.h" +#else +#include "renameadvsimd.h" +#endif +#endif +#endif + +#ifdef ENABLE_ADVSIMDNOFMA +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helperadvsimd.h" +#else +#include "macroonlyADVSIMDNOFMA.h" +#endif +#ifdef DORENAME +#include "renameadvsimdnofma.h" +#endif +#endif + +#ifdef ENABLE_NEON32 +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperneon32.h" +#endif +#ifdef DORENAME +#include "renameneon32.h" +#endif +#endif + +#ifdef ENABLE_NEON32VFPV4 +#define CONFIG 4 +#if !defined(SLEEF_GENHEADER) +#include "helperneon32.h" +#endif +#ifdef DORENAME +#include "renameneon32vfpv4.h" +#endif +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helpersve.h" +#else +#include "macroonlySVE.h" +#endif +#ifdef DORENAME +#ifdef ENABLE_GNUABI +#include "renamesve_gnuabi.h" +#else +#include "renamesve.h" +#endif /* ENABLE_GNUABI */ +#endif /* DORENAME */ +#endif /* ENABLE_SVE */ + +#ifdef ENABLE_SVENOFMA +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helpersve.h" +#else +#include "macroonlySVENOFMA.h" +#endif +#ifdef DORENAME +#include "renamesvenofma.h" +#endif /* DORENAME */ +#endif /* ENABLE_SVE */ + +// IBM + +#ifdef ENABLE_VSX +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperpower_128.h" +#else +#include "macroonlyVSX.h" +#endif +#ifdef DORENAME +#include "renamevsx.h" +#endif +#endif + +#ifdef ENABLE_VSXNOFMA +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helperpower_128.h" +#else +#include "macroonlyVSXNOFMA.h" +#endif +#ifdef DORENAME +#include "renamevsxnofma.h" +#endif +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#if !defined(SLEEF_GENHEADER) +#include "helperpower_128.h" +#else +#include "macroonlyVSX3.h" +#endif +#ifdef DORENAME +#include "renamevsx3.h" +#endif +#endif + +#ifdef ENABLE_VSX3NOFMA +#define CONFIG 4 +#if !defined(SLEEF_GENHEADER) +#include "helperpower_128.h" +#else +#include "macroonlyVSX3NOFMA.h" +#endif +#ifdef DORENAME +#include "renamevsx3nofma.h" +#endif +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#if !defined(SLEEF_GENHEADER) +#include "helpers390x_128.h" +#else +#include "macroonlyVXE.h" +#endif +#ifdef DORENAME +#include "renamevxe.h" +#endif +#endif + +#ifdef ENABLE_VXENOFMA +#define CONFIG 141 +#if !defined(SLEEF_GENHEADER) +#include "helpers390x_128.h" +#else +#include "macroonlyVXENOFMA.h" +#endif +#ifdef DORENAME +#include "renamevxenofma.h" +#endif +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#if !defined(SLEEF_GENHEADER) +#include "helpers390x_128.h" +#else +#include "macroonlyVXE2.h" +#endif +#ifdef DORENAME +#include "renamevxe2.h" +#endif +#endif + +#ifdef ENABLE_VXE2NOFMA +#define CONFIG 151 +#if !defined(SLEEF_GENHEADER) +#include "helpers390x_128.h" +#else +#include "macroonlyVXE2NOFMA.h" +#endif +#ifdef DORENAME +#include "renamevxe2nofma.h" +#endif +#endif + +// RISC-V +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_SP +#if !defined(SLEEF_GENHEADER) +#include "helperrvv.h" +#else +#include "macroonlyRVVM1.h" +#endif +#ifdef DORENAME +#include "renamervvm1.h" +#endif +#endif + +#ifdef ENABLE_RVVM1NOFMA +#define CONFIG 2 +#define ENABLE_RVV_SP +#if !defined(SLEEF_GENHEADER) +#include "helperrvv.h" +#else +#include "macroonlyRVVM1NOFMA.h" +#endif +#ifdef DORENAME +#include "renamervvm1nofma.h" +#endif +#endif + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_SP +#if !defined(SLEEF_GENHEADER) +#include "helperrvv.h" +#else +#include "macroonlyRVVM2.h" +#endif +#ifdef DORENAME +#include "renamervvm2.h" +#endif +#endif + +#ifdef ENABLE_RVVM2NOFMA +#define CONFIG 2 +#define ENABLE_RVV_SP +#if !defined(SLEEF_GENHEADER) +#include "helperrvv.h" +#else +#include "macroonlyRVVM2NOFMA.h" +#endif +#ifdef DORENAME +#include "renamervvm2nofma.h" +#endif +#endif + +// Generic + +#ifdef ENABLE_VECEXT +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helpervecext.h" +#endif +#ifdef DORENAME +#include "renamevecext.h" +#endif +#endif + +#ifdef ENABLE_PUREC +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperpurec.h" +#endif +#ifdef DORENAME +#include "renamepurec.h" +#endif +#endif + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#if !defined(SLEEF_GENHEADER) +#include "helperpurec_scalar.h" +#else +#include "macroonlyPUREC_SCALAR.h" +#endif +#ifdef DORENAME +#include "renamepurec_scalar.h" +#endif +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#if !defined(SLEEF_GENHEADER) +#include "helperpurec_scalar.h" +#else +#include "macroonlyPURECFMA_SCALAR.h" +#endif +#ifdef DORENAME +#include "renamepurecfma_scalar.h" +#endif +#endif + +#ifdef SLEEF_ENABLE_CUDA +#define CONFIG 3 +#if !defined(SLEEF_GENHEADER) +#include "helperpurec_scalar.h" +#else +#include "macroonlyCUDA.h" +#endif +#ifdef DORENAME +#include "renamecuda.h" +#endif +#endif + +// + +#define MLA(x, y, z) vmla_vf_vf_vf_vf((x), (y), (z)) +#define C2V(c) vcast_vf_f(c) +#include "estrin.h" + +// + +#include "df.h" + +static INLINE CONST VECTOR_CC vopmask visnegzero_vo_vf(vfloat d) { + return veq_vo_vi2_vi2(vreinterpret_vi2_vf(d), vreinterpret_vi2_vf(vcast_vf_f(-0.0))); +} + +static INLINE VECTOR_CC vopmask vnot_vo32_vo32(vopmask x) { + return vxor_vo_vo_vo(x, veq_vo_vi2_vi2(vcast_vi2_i(0), vcast_vi2_i(0))); +} + +static INLINE CONST VECTOR_CC vmask vsignbit_vm_vf(vfloat f) { + return vand_vm_vm_vm(vreinterpret_vm_vf(f), vreinterpret_vm_vf(vcast_vf_f(-0.0f))); +} + +#if !(defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +static INLINE CONST VECTOR_CC vfloat vmulsign_vf_vf_vf(vfloat x, vfloat y) { + return vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(x), vsignbit_vm_vf(y))); +} + +static INLINE CONST VECTOR_CC vfloat vcopysign_vf_vf_vf(vfloat x, vfloat y) { + return vreinterpret_vf_vm(vxor_vm_vm_vm(vandnot_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(x)), + vand_vm_vm_vm (vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(y)))); +} + +static INLINE CONST VECTOR_CC vfloat vsign_vf_vf(vfloat f) { + return vreinterpret_vf_vm(vor_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(1.0f)), vand_vm_vm_vm(vreinterpret_vm_vf(vcast_vf_f(-0.0f)), vreinterpret_vm_vf(f)))); +} +#endif + +static INLINE CONST VECTOR_CC vopmask vsignbit_vo_vf(vfloat d) { + return veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vreinterpret_vi2_vf(d), vcast_vi2_i(0x80000000)), vcast_vi2_i(0x80000000)); +} + +static INLINE CONST VECTOR_CC vint2 vsel_vi2_vf_vf_vi2_vi2(vfloat f0, vfloat f1, vint2 x, vint2 y) { + return vsel_vi2_vo_vi2_vi2(vlt_vo_vf_vf(f0, f1), x, y); +} + +static INLINE CONST VECTOR_CC vint2 vsel_vi2_vf_vi2(vfloat d, vint2 x) { + return vand_vi2_vo_vi2(vsignbit_vo_vf(d), x); +} + +static INLINE CONST VECTOR_CC vopmask visint_vo_vf(vfloat y) { return veq_vo_vf_vf(vtruncate_vf_vf(y), y); } + +static INLINE CONST VECTOR_CC vopmask visnumber_vo_vf(vfloat x) { return vnot_vo32_vo32(vor_vo_vo_vo(visinf_vo_vf(x), visnan_vo_vf(x))); } + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) +static INLINE CONST VECTOR_CC vint2 vilogbk_vi2_vf(vfloat d) { + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(5.421010862427522E-20f)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(vcast_vf_f(1.8446744073709552E19f), d), d); + vint2 q = vand_vi2_vi2_vi2(vsrl_vi2_vi2_i(vreinterpret_vi2_vf(d), 23), vcast_vi2_i(0xff)); + q = vsub_vi2_vi2_vi2(q, vsel_vi2_vo_vi2_vi2(o, vcast_vi2_i(64 + 0x7f), vcast_vi2_i(0x7f))); + return q; +} + +static INLINE CONST VECTOR_CC vint2 vilogb2k_vi2_vf(vfloat d) { + vint2 q = vreinterpret_vi2_vf(d); + q = vsrl_vi2_vi2_i(q, 23); + q = vand_vi2_vi2_vi2(q, vcast_vi2_i(0xff)); + q = vsub_vi2_vi2_vi2(q, vcast_vi2_i(0x7f)); + return q; +} +#endif + +// + +EXPORT CONST VECTOR_CC vint2 xilogbf(vfloat d) { + vint2 e = vilogbk_vi2_vf(vabs_vf_vf(d)); + e = vsel_vi2_vo_vi2_vi2(veq_vo_vf_vf(d, vcast_vf_f(0.0f)), vcast_vi2_i(SLEEF_FP_ILOGB0), e); + e = vsel_vi2_vo_vi2_vi2(visnan_vo_vf(d), vcast_vi2_i(SLEEF_FP_ILOGBNAN), e); + e = vsel_vi2_vo_vi2_vi2(visinf_vo_vf(d), vcast_vi2_i(SLEEF_INT_MAX), e); + return e; +} + +static INLINE CONST VECTOR_CC vfloat vpow2i_vf_vi2(vint2 q) { + return vreinterpret_vf_vi2(vsll_vi2_vi2_i(vadd_vi2_vi2_vi2(q, vcast_vi2_i(0x7f)), 23)); +} + +static INLINE CONST VECTOR_CC vfloat vldexp_vf_vf_vi2(vfloat x, vint2 q) { + vfloat u; + vint2 m = vsra_vi2_vi2_i(q, 31); + m = vsll_vi2_vi2_i(vsub_vi2_vi2_vi2(vsra_vi2_vi2_i(vadd_vi2_vi2_vi2(m, q), 6), m), 4); + q = vsub_vi2_vi2_vi2(q, vsll_vi2_vi2_i(m, 2)); + m = vadd_vi2_vi2_vi2(m, vcast_vi2_i(0x7f)); + m = vand_vi2_vi2_vi2(vgt_vi2_vi2_vi2(m, vcast_vi2_i(0)), m); + vint2 n = vgt_vi2_vi2_vi2(m, vcast_vi2_i(0xff)); + m = vor_vi2_vi2_vi2(vandnot_vi2_vi2_vi2(n, m), vand_vi2_vi2_vi2(n, vcast_vi2_i(0xff))); + u = vreinterpret_vf_vi2(vsll_vi2_vi2_i(m, 23)); + x = vmul_vf_vf_vf(vmul_vf_vf_vf(vmul_vf_vf_vf(vmul_vf_vf_vf(x, u), u), u), u); + u = vreinterpret_vf_vi2(vsll_vi2_vi2_i(vadd_vi2_vi2_vi2(q, vcast_vi2_i(0x7f)), 23)); + return vmul_vf_vf_vf(x, u); +} + +static INLINE CONST VECTOR_CC vfloat vldexp2_vf_vf_vi2(vfloat d, vint2 e) { + return vmul_vf_vf_vf(vmul_vf_vf_vf(d, vpow2i_vf_vi2(vsra_vi2_vi2_i(e, 1))), vpow2i_vf_vi2(vsub_vi2_vi2_vi2(e, vsra_vi2_vi2_i(e, 1)))); +} + +static INLINE CONST VECTOR_CC vfloat vldexp3_vf_vf_vi2(vfloat d, vint2 q) { + return vreinterpret_vf_vi2(vadd_vi2_vi2_vi2(vreinterpret_vi2_vf(d), vsll_vi2_vi2_i(q, 23))); +} + +EXPORT CONST VECTOR_CC vfloat xldexpf(vfloat x, vint2 q) { return vldexp_vf_vf_vi2(x, q); } + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +typedef struct { + vfloat d; + vint2 i; +} fi_t; + +static vfloat figetd_vf_di(fi_t d) { return d.d; } +static vint2 figeti_vi2_di(fi_t d) { return d.i; } +static fi_t fisetdi_fi_vf_vi2(vfloat d, vint2 i) { + fi_t r = { d, i }; + return r; +} + +typedef struct { + vfloat2 df; + vint2 i; +} dfi_t; + +static vfloat2 dfigetdf_vf2_dfi(dfi_t d) { return d.df; } +static vint2 dfigeti_vi2_dfi(dfi_t d) { return d.i; } +static dfi_t dfisetdfi_dfi_vf2_vi2(vfloat2 v, vint2 i) { + dfi_t r = { v, i }; + return r; +} +static dfi_t dfisetdf_dfi_dfi_vf2(dfi_t dfi, vfloat2 v) { + dfi.df = v; + return dfi; +} +#endif + +#if !(defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) +static INLINE CONST VECTOR_CC vfloat vorsign_vf_vf_vf(vfloat x, vfloat y) { + return vreinterpret_vf_vm(vor_vm_vm_vm(vreinterpret_vm_vf(x), vsignbit_vm_vf(y))); +} +#endif + +static INLINE CONST fi_t rempisubf(vfloat x) { +#ifdef FULL_FP_ROUNDING + vfloat y = vrint_vf_vf(vmul_vf_vf_vf(x, vcast_vf_f(4))); + vint2 vi = vtruncate_vi2_vf(vsub_vf_vf_vf(y, vmul_vf_vf_vf(vrint_vf_vf(x), vcast_vf_f(4)))); + return fisetdi_fi_vf_vi2(vsub_vf_vf_vf(x, vmul_vf_vf_vf(y, vcast_vf_f(0.25))), vi); +#else + vfloat c = vmulsign_vf_vf_vf(vcast_vf_f(1 << 23), x); + vfloat rint4x = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(vmul_vf_vf_vf(vcast_vf_f(4), x)), vcast_vf_f(1 << 23)), + vmul_vf_vf_vf(vcast_vf_f(4), x), + vorsign_vf_vf_vf(vsub_vf_vf_vf(vmla_vf_vf_vf_vf(vcast_vf_f(4), x, c), c), x)); + vfloat rintx = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(1 << 23)), + x, vorsign_vf_vf_vf(vsub_vf_vf_vf(vadd_vf_vf_vf(x, c), c), x)); + return fisetdi_fi_vf_vi2(vmla_vf_vf_vf_vf(vcast_vf_f(-0.25), rint4x, x), + vtruncate_vi2_vf(vmla_vf_vf_vf_vf(vcast_vf_f(-4), rintx, rint4x))); +#endif +} + +static INLINE CONST dfi_t rempif(vfloat a) { + vfloat2 x, y; + vint2 ex = vilogb2k_vi2_vf(a); +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + ex = vandnot_vi2_vi2_vi2(vsra_vi2_vi2_i(ex, 31), ex); + ex = vand_vi2_vi2_vi2(ex, vcast_vi2_i(127)); +#endif + ex = vsub_vi2_vi2_vi2(ex, vcast_vi2_i(25)); + vint2 q = vand_vi2_vo_vi2(vgt_vo_vi2_vi2(ex, vcast_vi2_i(90-25)), vcast_vi2_i(-64)); + a = vldexp3_vf_vf_vi2(a, q); + ex = vandnot_vi2_vi2_vi2(vsra_vi2_vi2_i(ex, 31), ex); + ex = vsll_vi2_vi2_i(ex, 2); + x = dfmul_vf2_vf_vf(a, vgather_vf_p_vi2(Sleef_rempitabsp, ex)); + fi_t di = rempisubf(vf2getx_vf_vf2(x)); + q = figeti_vi2_di(di); + x = vf2setx_vf2_vf2_vf(x, figetd_vf_di(di)); + x = dfnormalize_vf2_vf2(x); + y = dfmul_vf2_vf_vf(a, vgather_vf_p_vi2(Sleef_rempitabsp+1, ex)); + x = dfadd2_vf2_vf2_vf2(x, y); + di = rempisubf(vf2getx_vf_vf2(x)); + q = vadd_vi2_vi2_vi2(q, figeti_vi2_di(di)); + x = vf2setx_vf2_vf2_vf(x, figetd_vf_di(di)); + x = dfnormalize_vf2_vf2(x); + y = vcast_vf2_vf_vf(vgather_vf_p_vi2(Sleef_rempitabsp+2, ex), vgather_vf_p_vi2(Sleef_rempitabsp+3, ex)); + y = dfmul_vf2_vf2_vf(y, a); + x = dfadd2_vf2_vf2_vf2(x, y); + x = dfnormalize_vf2_vf2(x); + x = dfmul_vf2_vf2_vf2(x, vcast_vf2_f_f(3.1415927410125732422f*2, -8.7422776573475857731e-08f*2)); + x = vsel_vf2_vo_vf2_vf2(vlt_vo_vf_vf(vabs_vf_vf(a), vcast_vf_f(0.7f)), vcast_vf2_vf_vf(a, vcast_vf_f(0)), x); + return dfisetdfi_dfi_vf2_vi2(x, q); +} + +EXPORT CONST VECTOR_CC vfloat xsinf(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vfloat u, s, r = d; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI))); + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f), d); + } else if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI))); + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Af), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Bf), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Cf), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Df), d); + } else { + dfi_t dfi = rempif(d); + q = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(2), vcast_vi2_i(1))); + q = vsra_vi2_vi2_i(q, 2); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi))), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)))); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + d = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + + d = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(r), visnan_vo_vf(r)), vreinterpret_vm_vf(d))); + } + + s = vmul_vf_vf_vf(d, d); + + d = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(d))); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf(vmul_vf_vf_vf(s, vmul_vf_vf_vf(u, d)), d); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(r), r, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vfloat u, s, r = d; + + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI))); + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f), d); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(r), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + s = vcast_vf_vi2(q); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Af), r); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Bf), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Cf), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Df), u); + + d = vsel_vf_vo_vf_vf(g, d, u); + g = vlt_vo_vf_vf(vabs_vf_vf(r), vcast_vf_f(TRIGRANGEMAXf)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(r); + vint2 q2 = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q2 = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q2, q2), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(2), vcast_vi2_i(1))); + q2 = vsra_vi2_vi2_i(q2, 2); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi))), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)))); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + u = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + + u = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(r), visnan_vo_vf(r)), vreinterpret_vm_vf(u))); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + d = vsel_vf_vo_vf_vf(g, d, u); + } + } + + s = vmul_vf_vf_vf(d, d); + + d = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(d))); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf(vmul_vf_vf_vf(s, vmul_vf_vf_vf(u, d)), d); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(r), r, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vfloat xcosf(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vfloat u, s, r = d; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + q = vrint_vi2_vf(vsub_vf_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI)), vcast_vf_f(0.5f))); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vcast_vi2_i(1)); + + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), d); + } else if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf))))) { + q = vrint_vi2_vf(vsub_vf_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI)), vcast_vf_f(0.5f))); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vcast_vi2_i(1)); + + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Af*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Bf*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Cf*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Df*0.5f), d); + } else { + dfi_t dfi = rempif(d); + q = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(8), vcast_vi2_i(7))); + q = vsra_vi2_vi2_i(q, 1); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(0)); + vfloat y = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vf_f(0), vcast_vf_f(-1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + d = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + + d = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(r), visnan_vo_vf(r)), vreinterpret_vm_vf(d))); + } + + s = vmul_vf_vf_vf(d, d); + + d = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(d))); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf(vmul_vf_vf_vf(s, vmul_vf_vf_vf(u, d)), d); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vfloat u, s, r = d; + + q = vrint_vi2_vf(vsub_vf_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI)), vcast_vf_f(0.5f))); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vcast_vi2_i(1)); + u = vcast_vf_vi2(q); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), d); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), d); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(r), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + s = vcast_vf_vi2(q); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Af*0.5f), r); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Bf*0.5f), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Cf*0.5f), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Df*0.5f), u); + + d = vsel_vf_vo_vf_vf(g, d, u); + g = vlt_vo_vf_vf(vabs_vf_vf(r), vcast_vf_f(TRIGRANGEMAXf)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(r); + vint2 q2 = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q2 = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q2, q2), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(8), vcast_vi2_i(7))); + q2 = vsra_vi2_vi2_i(q2, 1); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(0)); + vfloat y = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vf_f(0), vcast_vf_f(-1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + u = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + + u = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(r), visnan_vo_vf(r)), vreinterpret_vm_vf(u))); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + d = vsel_vf_vo_vf_vf(g, d, u); + } + } + + s = vmul_vf_vf_vf(d, d); + + d = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(d))); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833307858556509017944336f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666597127914428710938f)); + + u = vadd_vf_vf_vf(vmul_vf_vf_vf(s, vmul_vf_vf_vf(u, d)), d); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vfloat xtanf(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vopmask o; + vfloat u, s, x; + + x = d; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f*0.5f))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)(2 * M_1_PI)))); + u = vcast_vf_vi2(q); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), x); + } else if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)(2 * M_1_PI)))); + u = vcast_vf_vi2(q); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Af*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Bf*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Cf*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Df*0.5f), x); + } else { + dfi_t dfi = rempif(d); + q = dfigeti_vi2_dfi(dfi); + x = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + x = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(x))); + x = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, x); + } + + s = vmul_vf_vf_vf(x, x); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); + x = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(x))); + +#if defined(ENABLE_NEON32) + u = vcast_vf_f(0.00927245803177356719970703f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00331984995864331722259521f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0242998078465461730957031f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0534495301544666290283203f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.133383005857467651367188f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.333331853151321411132812f)); +#else + vfloat s2 = vmul_vf_vf_vf(s, s), s4 = vmul_vf_vf_vf(s2, s2); + u = POLY6(s, s2, s4, + 0.00927245803177356719970703f, + 0.00331984995864331722259521f, + 0.0242998078465461730957031f, + 0.0534495301544666290283203f, + 0.133383005857467651367188f, + 0.333331853151321411132812f); +#endif + + u = vmla_vf_vf_vf_vf(s, vmul_vf_vf_vf(u, x), x); + + u = vsel_vf_vo_vf_vf(o, vrec_vf_vf(u), u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vopmask o; + vfloat u, s, x; + + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)(2 * M_1_PI)))); + u = vcast_vf_vi2(q); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), x); + x = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), x); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f*0.5f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + vint2 q2 = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)(2 * M_1_PI)))); + s = vcast_vf_vi2(q); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Af*0.5f), d); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Bf*0.5f), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Cf*0.5f), u); + u = vmla_vf_vf_vf_vf(s, vcast_vf_f(-PI_Df*0.5f), u); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + x = vsel_vf_vo_vf_vf(g, x, u); + g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + u = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + u = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(u))); + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, u); + q = vsel_vi2_vo_vi2_vi2(g, q, dfigeti_vi2_dfi(dfi)); + x = vsel_vf_vo_vf_vf(g, x, u); + } + } + + s = vmul_vf_vf_vf(x, x); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); + x = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(x))); + +#if defined(ENABLE_NEON32) + u = vcast_vf_f(0.00927245803177356719970703f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00331984995864331722259521f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0242998078465461730957031f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0534495301544666290283203f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.133383005857467651367188f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.333331853151321411132812f)); +#else + vfloat s2 = vmul_vf_vf_vf(s, s), s4 = vmul_vf_vf_vf(s2, s2); + u = POLY6(s, s2, s4, + 0.00927245803177356719970703f, + 0.00331984995864331722259521f, + 0.0242998078465461730957031f, + 0.0534495301544666290283203f, + 0.133383005857467651367188f, + 0.333331853151321411132812f); +#endif + + u = vmla_vf_vf_vf_vf(s, vmul_vf_vf_vf(u, x), x); + + u = vsel_vf_vo_vf_vf(o, vrec_vf_vf(u), u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vfloat xsinf_u1(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vfloat u, v; + vfloat2 s, t, x; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f))); + } else { + dfi_t dfi = rempif(d); + q = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(2), vcast_vi2_i(1))); + q = vsra_vi2_vi2_i(q, 2); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi))), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)))); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + s = dfnormalize_vf2_vf2(dfigetdf_vf2_dfi(dfi)); + +#if !defined(_MSC_VER) + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(vf2getx_vf_vf2(s))))); +#else + s.x = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(s.x))); +#endif + } + + t = s; + s = dfsqu_vf2_vf2(s); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf(vcast_vf_f(-0.166666597127914428710938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))), s)); + + u = dfmul_vf_vf2_vf2(t, x); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(u))); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vfloat u, v; + vfloat2 s, t, x; + + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f))); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + vint2 q2 = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q2 = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q2, q2), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(2), vcast_vi2_i(1))); + q2 = vsra_vi2_vi2_i(q2, 2); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi))), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)))); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + t = dfnormalize_vf2_vf2(dfigetdf_vf2_dfi(dfi)); + + t = vf2setx_vf2_vf2_vf(t, vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(vf2getx_vf_vf2(t))))); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + s = vsel_vf2_vo_vf2_vf2(g, s, t); + } + + t = s; + s = dfsqu_vf2_vf2(s); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf(vcast_vf_f(-0.166666597127914428710938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))), s)); + + u = dfmul_vf_vf2_vf2(t, x); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(u))); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vfloat xcosf_u1(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vfloat u; + vfloat2 s, t, x; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + vfloat dq = vmla_vf_vf_vf_vf(vrint_vf_vf(vmla_vf_vf_vf_vf(d, vcast_vf_f(M_1_PI), vcast_vf_f(-0.5f))), + vcast_vf_f(2), vcast_vf_f(1)); + q = vrint_vi2_vf(dq); + s = dfadd2_vf2_vf_vf (d, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_A2f*0.5f))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_C2f*0.5f))); + } else { + dfi_t dfi = rempif(d); + q = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, q), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(8), vcast_vi2_i(7))); + q = vsra_vi2_vi2_i(q, 1); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(0)); + vfloat y = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vf_f(0), vcast_vf_f(-1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + s = dfnormalize_vf2_vf2(dfigetdf_vf2_dfi(dfi)); + +#if !defined(_MSC_VER) + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(vf2getx_vf_vf2(s))))); +#else + s.x = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(s.x))); +#endif + } + + t = s; + s = dfsqu_vf2_vf2(s); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf(vcast_vf_f(-0.166666597127914428710938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))), s)); + + u = dfmul_vf_vf2_vf2(t, x); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)), vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(u))); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vfloat u; + vfloat2 s, t, x; + + vfloat dq = vmla_vf_vf_vf_vf(vrint_vf_vf(vmla_vf_vf_vf_vf(d, vcast_vf_f(M_1_PI), vcast_vf_f(-0.5f))), + vcast_vf_f(2), vcast_vf_f(1)); + q = vrint_vi2_vf(dq); + s = dfadd2_vf2_vf_vf (d, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_A2f*0.5f))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(dq, vcast_vf_f(-PI_C2f*0.5f))); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + vint2 q2 = vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(3)); + q2 = vadd_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q2, q2), vsel_vi2_vo_vi2_vi2(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vi2_i(8), vcast_vi2_i(7))); + q2 = vsra_vi2_vi2_i(q2, 1); + vopmask o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(dfigeti_vi2_dfi(dfi), vcast_vi2_i(1)), vcast_vi2_i(0)); + vfloat y = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vcast_vf_f(0)), vcast_vf_f(0), vcast_vf_f(-1)); + vfloat2 x = vcast_vf2_vf_vf(vmulsign_vf_vf_vf(vcast_vf_f(3.1415927410125732422f*-0.5), y), + vmulsign_vf_vf_vf(vcast_vf_f(-8.7422776573475857731e-08f*-0.5), y)); + x = dfadd2_vf2_vf2_vf2(dfigetdf_vf2_dfi(dfi), x); + dfi = dfisetdf_dfi_dfi_vf2(dfi, vsel_vf2_vo_vf2_vf2(o, x, dfigetdf_vf2_dfi(dfi))); + t = dfnormalize_vf2_vf2(dfigetdf_vf2_dfi(dfi)); + + t = vf2setx_vf2_vf2_vf(t, vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(vf2getx_vf_vf2(t))))); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + s = vsel_vf2_vo_vf2_vf2(g, s, t); + } + + t = s; + s = dfsqu_vf2_vf2(s); + + u = vcast_vf_f(2.6083159809786593541503e-06f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.0001981069071916863322258f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833307858556509017944336f)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf(vcast_vf_f(-0.166666597127914428710938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))), s)); + + u = dfmul_vf_vf2_vf2(t, x); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)), vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(u))); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +EXPORT CONST VECTOR_CC vfloat xfastsinf_u3500(vfloat d) { + vint2 q; + vfloat u, s, t = d; + + s = vmul_vf_vf_vf(d, vcast_vf_f((float)M_1_PI)); + u = vrint_vf_vf(s); + q = vrint_vi2_vf(s); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-(float)M_PI), d); + + s = vmul_vf_vf_vf(d, d); + + u = vcast_vf_f(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(s, d), u, d); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(u))); + + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(t), vcast_vf_f(30.0f)); + if (!LIKELY(vtestallones_i_vo32(g))) return vsel_vf_vo_vf_vf(g, u, xsinf(t)); + + return u; +} + +EXPORT CONST VECTOR_CC vfloat xfastcosf_u3500(vfloat d) { + vint2 q; + vfloat u, s, t = d; + + s = vmla_vf_vf_vf_vf(d, vcast_vf_f((float)M_1_PI), vcast_vf_f(-0.5f)); + u = vrint_vf_vf(s); + q = vrint_vi2_vf(s); + d = vmla_vf_vf_vf_vf(u, vcast_vf_f(-(float)M_PI), vsub_vf_vf_vf(d, vcast_vf_f((float)M_PI * 0.5f))); + + s = vmul_vf_vf_vf(d, d); + + u = vcast_vf_f(-0.1881748176e-3); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.8323502727e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.1666651368e+0)); + u = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(s, d), u, d); + + u = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(u))); + + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(t), vcast_vf_f(30.0f)); + if (!LIKELY(vtestallones_i_vo32(g))) return vsel_vf_vo_vf_vf(g, u, xcosf(t)); + + return u; +} + +#ifdef ENABLE_GNUABI +#define TYPE2_FUNCATR static INLINE CONST +#define TYPE6_FUNCATR static INLINE CONST +#define SQRTFU05_FUNCATR static INLINE CONST +#define XSINCOSF sincosfk +#define XSINCOSF_U1 sincosfk_u1 +#define XSINCOSPIF_U05 sincospifk_u05 +#define XSINCOSPIF_U35 sincospifk_u35 +#define XMODFF modffk +#else +#define TYPE2_FUNCATR EXPORT CONST +#define TYPE6_FUNCATR EXPORT +#define SQRTFU05_FUNCATR EXPORT +#define XSINCOSF xsincosf +#define XSINCOSF_U1 xsincosf_u1 +#define XSINCOSPIF_U05 xsincospif_u05 +#define XSINCOSPIF_U35 xsincospif_u35 +#define XMODFF xmodff +#endif + +TYPE2_FUNCATR VECTOR_CC vfloat2 XSINCOSF(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vopmask o; + vfloat u, s, t, rx, ry; + vfloat2 r; + + s = d; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_2_PI))); + u = vcast_vf_vi2(q); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), s); + } else if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf))))) { + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_2_PI))); + u = vcast_vf_vi2(q); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Af*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Bf*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Cf*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Df*0.5f), s); + } else { + dfi_t dfi = rempif(d); + q = dfigeti_vi2_dfi(dfi); + s = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + s = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(s))); + } + + t = s; + + s = vmul_vf_vf_vf(s, s); + + u = vcast_vf_f(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666537523269653320312f)); + + rx = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(u, s), t, t); + rx = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), rx); + + u = vcast_vf_f(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.5)); + + ry = vmla_vf_vf_vf_vf(s, u, vcast_vf_f(1)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vopmask o; + vfloat u, s, t, rx, ry; + vfloat2 r; + + q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_2_PI))); + u = vcast_vf_vi2(q); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f), s); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f), s); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + vint2 q2 = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f((float)M_2_PI))); + u = vcast_vf_vi2(q2); + t = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Af*0.5f), d); + t = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Bf*0.5f), t); + t = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Cf*0.5f), t); + t = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_Df*0.5f), t); + + q = vsel_vi2_vo_vi2_vi2(g, q, q2); + s = vsel_vf_vo_vf_vf(g, s, t); + g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAXf)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + t = vadd_vf_vf_vf(vf2getx_vf_vf2(dfigetdf_vf2_dfi(dfi)), vf2gety_vf_vf2(dfigetdf_vf2_dfi(dfi))); + t = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)), vreinterpret_vm_vf(t))); + + q = vsel_vi2_vo_vi2_vi2(g, q, dfigeti_vi2_dfi(dfi)); + s = vsel_vf_vo_vf_vf(g, s, t); + } + } + + t = s; + + s = vmul_vf_vf_vf(s, s); + + u = vcast_vf_f(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.166666537523269653320312f)); + + rx = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(u, s), t, t); + rx = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), rx); + + u = vcast_vf_f(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.5)); + + ry = vmla_vf_vf_vf_vf(s, u, vcast_vf_f(1)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; +#endif // #if !defined(DETERMINISTIC) +} + +TYPE2_FUNCATR VECTOR_CC vfloat2 XSINCOSF_U1(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vopmask o; + vfloat u, v, rx, ry; + vfloat2 r, s, t, x; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(2 * M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f))); + } else { + dfi_t dfi = rempif(d); + q = dfigeti_vi2_dfi(dfi); + s = dfigetdf_vf2_dfi(dfi); + o = vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)); + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(s))))); + } + + t = s; + + s = vf2setx_vf2_vf2_vf(s, dfsqu_vf_vf2(s)); + + u = vcast_vf_f(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.166666537523269653320312f)); + + u = vmul_vf_vf_vf(u, vmul_vf_vf_vf(vf2getx_vf_vf2(s), vf2getx_vf_vf2(t))); + + x = dfadd_vf2_vf2_vf(t, u); + rx = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + rx = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), rx); + + u = vcast_vf_f(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.5)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf_vf(vf2getx_vf_vf2(s), u)); + ry = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vopmask o; + vfloat u, v, rx, ry; + vfloat2 r, s, t, x; + + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(2 * M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f))); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + t = dfigetdf_vf2_dfi(dfi); + o = vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)); + t = vf2setx_vf2_vf2_vf(t, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(t))))); + q = vsel_vi2_vo_vi2_vi2(g, q, dfigeti_vi2_dfi(dfi)); + s = vsel_vf2_vo_vf2_vf2(g, s, t); + } + + t = s; + + s = vf2setx_vf2_vf2_vf(s, dfsqu_vf_vf2(s)); + + u = vcast_vf_f(-0.000195169282960705459117889f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00833215750753879547119141f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.166666537523269653320312f)); + + u = vmul_vf_vf_vf(u, vmul_vf_vf_vf(vf2getx_vf_vf2(s), vf2getx_vf_vf2(t))); + + x = dfadd_vf2_vf2_vf(t, u); + rx = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + rx = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), rx); + + u = vcast_vf_f(-2.71811842367242206819355e-07f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(2.47990446951007470488548e-05f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.00138888787478208541870117f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0416666641831398010253906f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-0.5)); + + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf_vf(vf2getx_vf_vf2(s), u)); + ry = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(2)), vcast_vi2_i(2)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; +#endif // #if !defined(DETERMINISTIC) +} + +#if !defined(DETERMINISTIC) +TYPE2_FUNCATR VECTOR_CC vfloat2 XSINCOSPIF_U05(vfloat d) { + vopmask o; + vfloat u, s, t, rx, ry; + vfloat2 r, x, s2; + + u = vmul_vf_vf_vf(d, vcast_vf_f(4)); + vint2 q = vtruncate_vi2_vf(u); + q = vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vxor_vi2_vi2_vi2(vsrl_vi2_vi2_i(q, 31), vcast_vi2_i(1))), vcast_vi2_i(~1)); + s = vsub_vf_vf_vf(u, vcast_vf_vi2(q)); + + t = s; + s = vmul_vf_vf_vf(s, s); + s2 = dfmul_vf2_vf_vf(t, t); + + // + + u = vcast_vf_f(+0.3093842054e-6); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.3657307388e-4)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2490393585e-2)); + x = dfadd2_vf2_vf_vf2(vmul_vf_vf_vf(u, s), vcast_vf2_f_f(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2(dfmul_vf2_vf2_vf2(s2, x), vcast_vf2_f_f(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf(x, t); + rx = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + rx = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), rx); + + // + + u = vcast_vf_f(-0.2430611801e-7); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.3590577080e-5)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.3259917721e-3)); + x = dfadd2_vf2_vf_vf2(vmul_vf_vf_vf(u, s), vcast_vf2_f_f(0.015854343771934509277, 4.4940051354032242811e-10)); + x = dfadd2_vf2_vf2_vf2(dfmul_vf2_vf2_vf2(s2, x), vcast_vf2_f_f(-0.30842512845993041992, -9.0728339030733922277e-09)); + + x = dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf2(x, s2), vcast_vf_f(1)); + ry = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + // + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(4)), vcast_vi2_i(4)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(4)), vcast_vi2_i(4)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + o = vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1e+7f)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vandnot_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vandnot_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + o = visinf_vo_vf(d); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; +} + +TYPE2_FUNCATR VECTOR_CC vfloat2 XSINCOSPIF_U35(vfloat d) { + vopmask o; + vfloat u, s, t, rx, ry; + vfloat2 r; + + u = vmul_vf_vf_vf(d, vcast_vf_f(4)); + vint2 q = vtruncate_vi2_vf(u); + q = vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vxor_vi2_vi2_vi2(vsrl_vi2_vi2_i(q, 31), vcast_vi2_i(1))), vcast_vi2_i(~1)); + s = vsub_vf_vf_vf(u, vcast_vf_vi2(q)); + + t = s; + s = vmul_vf_vf_vf(s, s); + + // + + u = vcast_vf_f(-0.3600925265e-4); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2490088111e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.8074551076e-1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.7853981853e+0)); + + rx = vmul_vf_vf_vf(u, t); + + // + + u = vcast_vf_f(+0.3539815225e-5); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.3259574005e-3)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1585431583e-1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(-0.3084251285e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(1)); + + ry = u; + + // + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)); + r = vf2setxy_vf2_vf_vf(vsel_vf_vo_vf_vf(o, rx, ry), vsel_vf_vo_vf_vf(o, ry, rx)); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(4)), vcast_vi2_i(4)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(4)), vcast_vi2_i(4)); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + o = vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1e+7f)); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vandnot_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vandnot_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + o = visinf_vo_vf(d); + r = vf2setx_vf2_vf2_vf(r, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(r))))); + r = vf2sety_vf2_vf2_vf(r, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(r))))); + + return r; +} + +TYPE6_FUNCATR VECTOR_CC vfloat2 XMODFF(vfloat x) { + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + fr = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(INT64_C(1) << 23)), vcast_vf_f(0), fr); + + vfloat2 ret; + + ret = vf2setxy_vf2_vf_vf(vcopysign_vf_vf_vf(fr, x), vcopysign_vf_vf_vf(vsub_vf_vf_vf(x, fr), x)); + + return ret; +} + +#ifdef ENABLE_GNUABI +EXPORT VECTOR_CC void xsincosf(vfloat a, float *ps, float *pc) { + vfloat2 r = sincosfk(a); + vstoreu_v_p_vf(ps, vf2getx_vf_vf2(r)); + vstoreu_v_p_vf(pc, vf2gety_vf_vf2(r)); +} + +EXPORT VECTOR_CC void xsincosf_u1(vfloat a, float *ps, float *pc) { + vfloat2 r = sincosfk_u1(a); + vstoreu_v_p_vf(ps, vf2getx_vf_vf2(r)); + vstoreu_v_p_vf(pc, vf2gety_vf_vf2(r)); +} + +EXPORT VECTOR_CC void xsincospif_u05(vfloat a, float *ps, float *pc) { + vfloat2 r = sincospifk_u05(a); + vstoreu_v_p_vf(ps, vf2getx_vf_vf2(r)); + vstoreu_v_p_vf(pc, vf2gety_vf_vf2(r)); +} + +EXPORT VECTOR_CC void xsincospif_u35(vfloat a, float *ps, float *pc) { + vfloat2 r = sincospifk_u35(a); + vstoreu_v_p_vf(ps, vf2getx_vf_vf2(r)); + vstoreu_v_p_vf(pc, vf2gety_vf_vf2(r)); +} + +EXPORT CONST VECTOR_CC vfloat xmodff(vfloat a, float *iptr) { + vfloat2 r = modffk(a); + vstoreu_v_p_vf(iptr, vf2gety_vf_vf2(r)); + return vf2getx_vf_vf2(r); +} +#endif // #ifdef ENABLE_GNUABI +#endif // #if !defined(DETERMINISTIC) + +EXPORT CONST VECTOR_CC vfloat xtanf_u1(vfloat d) { +#if !defined(DETERMINISTIC) + vint2 q; + vfloat u, v; + vfloat2 s, t, x; + vopmask o; + + if (LIKELY(vtestallones_i_vo32(vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f))))) { + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(2 * M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f))); + } else { + dfi_t dfi = rempif(d); + q = dfigeti_vi2_dfi(dfi); + s = dfigetdf_vf2_dfi(dfi); + o = vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)); + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(s))))); + s = vf2sety_vf2_vf2_vf(s, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(s))))); + } + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); + vmask n = vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))); +#if !defined(_MSC_VER) + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2getx_vf_vf2(s)), n))); + s = vf2sety_vf2_vf2_vf(s, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2gety_vf_vf2(s)), n))); +#else + s.x = vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(s.x), n)); + s.y = vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(s.y), n)); +#endif + + t = s; + s = dfsqu_vf2_vf2(s); + s = dfnormalize_vf2_vf2(s); + + u = vcast_vf_f(0.00446636462584137916564941f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-8.3920182078145444393158e-05f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0109639242291450500488281f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0212360303848981857299805f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0540687143802642822265625f)); + + x = dfadd_vf2_vf_vf(vcast_vf_f(0.133325666189193725585938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))); + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(0.33333361148834228515625f), dfmul_vf2_vf2_vf2(s, x)), s)); + x = dfmul_vf2_vf2_vf2(t, x); + + x = vsel_vf2_vo_vf2_vf2(o, dfrec_vf2_vf2(x), x); + + u = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, u); + + return u; + +#else // #if !defined(DETERMINISTIC) + + vint2 q; + vfloat u, v; + vfloat2 s, t, x; + vopmask o; + + u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(2 * M_1_PI))); + q = vrint_vi2_vf(u); + v = vmla_vf_vf_vf_vf(u, vcast_vf_f(-PI_A2f*0.5f), d); + s = dfadd2_vf2_vf_vf(v, vmul_vf_vf_vf(u, vcast_vf_f(-PI_B2f*0.5f))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(u, vcast_vf_f(-PI_C2f*0.5f))); + vopmask g = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX2f)); + + if (!LIKELY(vtestallones_i_vo32(g))) { + dfi_t dfi = rempif(d); + t = dfigetdf_vf2_dfi(dfi); + o = vor_vo_vo_vo(visinf_vo_vf(d), visnan_vo_vf(d)); + t = vf2setx_vf2_vf2_vf(t, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2getx_vf_vf2(t))))); + t = vf2sety_vf2_vf2_vf(t, vreinterpret_vf_vm(vor_vm_vo32_vm(o, vreinterpret_vm_vf(vf2gety_vf_vf2(t))))); + q = vsel_vi2_vo_vi2_vi2(g, q, dfigeti_vi2_dfi(dfi)); + s = vsel_vf2_vo_vf2_vf2(g, s, t); + } + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)); + vmask n = vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))); + s = vf2setx_vf2_vf2_vf(s, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2getx_vf_vf2(s)), n))); + s = vf2sety_vf2_vf2_vf(s, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2gety_vf_vf2(s)), n))); + + t = s; + s = dfsqu_vf2_vf2(s); + s = dfnormalize_vf2_vf2(s); + + u = vcast_vf_f(0.00446636462584137916564941f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(-8.3920182078145444393158e-05f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0109639242291450500488281f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0212360303848981857299805f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0540687143802642822265625f)); + + x = dfadd_vf2_vf_vf(vcast_vf_f(0.133325666189193725585938f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(s))); + x = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(0.33333361148834228515625f), dfmul_vf2_vf2_vf2(s, x)), s)); + x = dfmul_vf2_vf2_vf2(t, x); + + x = vsel_vf2_vo_vf2_vf2(o, dfrec_vf2_vf2(x), x); + + u = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + u = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), d, u); + + return u; +#endif // #if !defined(DETERMINISTIC) +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xatanf(vfloat d) { + vfloat s, t, u; + vint2 q; + + q = vsel_vi2_vf_vi2(d, vcast_vi2_i(2)); + s = vabs_vf_vf(d); + + q = vsel_vi2_vf_vf_vi2_vi2(vcast_vf_f(1.0f), s, vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), q); + s = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vcast_vf_f(1.0f), s), vrec_vf_vf(s), s); + + t = vmul_vf_vf_vf(s, s); + + vfloat t2 = vmul_vf_vf_vf(t, t), t4 = vmul_vf_vf_vf(t2, t2); + u = POLY8(t, t2, t4, + 0.00282363896258175373077393f, + -0.0159569028764963150024414f, + 0.0425049886107444763183594f, + -0.0748900920152664184570312f, + 0.106347933411598205566406f, + -0.142027363181114196777344f, + 0.199926957488059997558594f, + -0.333331018686294555664062f); + + t = vmla_vf_vf_vf_vf(s, vmul_vf_vf_vf(t, u), s); + + t = vsel_vf_vo_vf_vf(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(1)), vcast_vi2_i(1)), vsub_vf_vf_vf(vcast_vf_f((float)(M_PI/2)), t), t); + + t = vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)), vreinterpret_vm_vf(vcast_vf_f(-0.0f))), vreinterpret_vm_vf(t))); + +#if defined(ENABLE_NEON32) || defined(ENABLE_NEON32VFPV4) + t = vsel_vf_vo_vf_vf(visinf_vo_vf(d), vmulsign_vf_vf_vf(vcast_vf_f(1.5874010519681994747517056f), d), t); +#endif + + return t; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat atan2kf(vfloat y, vfloat x) { + vfloat s, t, u; + vint2 q; + vopmask p; + + q = vsel_vi2_vf_vi2(x, vcast_vi2_i(-2)); + x = vabs_vf_vf(x); + + q = vsel_vi2_vf_vf_vi2_vi2(x, y, vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), q); + p = vlt_vo_vf_vf(x, y); + s = vsel_vf_vo_vf_vf(p, vneg_vf_vf(x), y); + t = vmax_vf_vf_vf(x, y); + + s = vdiv_vf_vf_vf(s, t); + t = vmul_vf_vf_vf(s, s); + + vfloat t2 = vmul_vf_vf_vf(t, t), t4 = vmul_vf_vf_vf(t2, t2); + u = POLY8(t, t2, t4, + 0.00282363896258175373077393f, + -0.0159569028764963150024414f, + 0.0425049886107444763183594f, + -0.0748900920152664184570312f, + 0.106347933411598205566406f, + -0.142027363181114196777344f, + 0.199926957488059997558594f, + -0.333331018686294555664062f); + + t = vmla_vf_vf_vf_vf(s, vmul_vf_vf_vf(t, u), s); + t = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f((float)(M_PI/2)), t); + + return t; +} + +static INLINE CONST VECTOR_CC vfloat visinf2_vf_vf_vf(vfloat d, vfloat m) { + return vreinterpret_vf_vm(vand_vm_vo32_vm(visinf_vo_vf(d), vor_vm_vm_vm(vsignbit_vm_vf(d), vreinterpret_vm_vf(m)))); +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xatan2f(vfloat y, vfloat x) { + vfloat r = atan2kf(vabs_vf_vf(y), x); + + r = vmulsign_vf_vf_vf(r, x); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), veq_vo_vf_vf(x, vcast_vf_f(0.0f))), vsub_vf_vf_vf(vcast_vf_f((float)(M_PI/2)), visinf2_vf_vf_vf(x, vmulsign_vf_vf_vf(vcast_vf_f((float)(M_PI/2)), x))), r); + r = vsel_vf_vo_vf_vf(visinf_vo_vf(y), vsub_vf_vf_vf(vcast_vf_f((float)(M_PI/2)), visinf2_vf_vf_vf(x, vmulsign_vf_vf_vf(vcast_vf_f((float)(M_PI/4)), x))), r); + + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(y, vcast_vf_f(0.0f)), vreinterpret_vf_vm(vand_vm_vo32_vm(vsignbit_vo_vf(x), vreinterpret_vm_vf(vcast_vf_f((float)M_PI)))), r); + + r = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vreinterpret_vm_vf(vmulsign_vf_vf_vf(r, y)))); + return r; +} + +EXPORT CONST VECTOR_CC vfloat xasinf(vfloat d) { + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(0.5f)); + vfloat x2 = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, d), vmul_vf_vf_vf(vsub_vf_vf_vf(vcast_vf_f(1), vabs_vf_vf(d)), vcast_vf_f(0.5f))); + vfloat x = vsel_vf_vo_vf_vf(o, vabs_vf_vf(d), vsqrt_vf_vf(x2)), u; + + u = vcast_vf_f(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.1666677296e+0)); + u = vmla_vf_vf_vf_vf(u, vmul_vf_vf_vf(x, x2), x); + + vfloat r = vsel_vf_vo_vf_vf(o, u, vmla_vf_vf_vf_vf(u, vcast_vf_f(-2), vcast_vf_f(M_PIf/2))); + return vmulsign_vf_vf_vf(r, d); +} + +EXPORT CONST VECTOR_CC vfloat xacosf(vfloat d) { + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(0.5f)); + vfloat x2 = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, d), + vmul_vf_vf_vf(vsub_vf_vf_vf(vcast_vf_f(1), vabs_vf_vf(d)), vcast_vf_f(0.5f))), u; + vfloat x = vsel_vf_vo_vf_vf(o, vabs_vf_vf(d), vsqrt_vf_vf(x2)); + x = vsel_vf_vo_vf_vf(veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1.0f)), vcast_vf_f(0), x); + + u = vcast_vf_f(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.1666677296e+0)); + u = vmul_vf_vf_vf(u, vmul_vf_vf_vf(x2, x)); + + vfloat y = vsub_vf_vf_vf(vcast_vf_f(3.1415926535897932f/2), vadd_vf_vf_vf(vmulsign_vf_vf_vf(x, d), vmulsign_vf_vf_vf(u, d))); + x = vadd_vf_vf_vf(x, u); + vfloat r = vsel_vf_vo_vf_vf(o, y, vmul_vf_vf_vf(x, vcast_vf_f(2))); + return vsel_vf_vo_vf_vf(vandnot_vo_vo_vo(o, vlt_vo_vf_vf(d, vcast_vf_f(0))), + vf2getx_vf_vf2(dfadd_vf2_vf2_vf(vcast_vf2_f_f(3.1415927410125732422f,-8.7422776573475857731e-08f), + vneg_vf_vf(r))), r); +} +#endif // #if !defined(DETERMINISTIC) + +// + +static INLINE CONST VECTOR_CC vfloat2 atan2kf_u1(vfloat2 y, vfloat2 x) { + vfloat u; + vfloat2 s, t; + vint2 q; + vopmask p; + vmask r; + + q = vsel_vi2_vf_vf_vi2_vi2(vf2getx_vf_vf2(x), vcast_vf_f(0), vcast_vi2_i(-2), vcast_vi2_i(0)); + p = vlt_vo_vf_vf(vf2getx_vf_vf2(x), vcast_vf_f(0)); + r = vand_vm_vo32_vm(p, vreinterpret_vm_vf(vcast_vf_f(-0.0))); + x = vf2setx_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2getx_vf_vf2(x)), r))); + x = vf2sety_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vreinterpret_vm_vf(vf2gety_vf_vf2(x)), r))); + + q = vsel_vi2_vf_vf_vi2_vi2(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y), vadd_vi2_vi2_vi2(q, vcast_vi2_i(1)), q); + p = vlt_vo_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(y)); + s = vsel_vf2_vo_vf2_vf2(p, dfneg_vf2_vf2(x), y); + t = vsel_vf2_vo_vf2_vf2(p, y, x); + + s = dfdiv_vf2_vf2_vf2(s, t); + t = dfsqu_vf2_vf2(s); + t = dfnormalize_vf2_vf2(t); + + u = vcast_vf_f(-0.00176397908944636583328247f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(0.0107900900766253471374512f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(-0.0309564601629972457885742f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(0.0577365085482597351074219f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(-0.0838950723409652709960938f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(0.109463557600975036621094f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(-0.142626821994781494140625f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(t), vcast_vf_f(0.199983194470405578613281f)); + + t = dfmul_vf2_vf2_vf2(t, dfadd_vf2_vf_vf(vcast_vf_f(-0.333332866430282592773438f), vmul_vf_vf_vf(u, vf2getx_vf_vf2(t)))); + t = dfmul_vf2_vf2_vf2(s, dfadd_vf2_vf_vf2(vcast_vf_f(1), t)); + t = dfadd_vf2_vf2_vf2(dfmul_vf2_vf2_vf(vcast_vf2_f_f(1.5707963705062866211f, -4.3711388286737928865e-08f), vcast_vf_vi2(q)), t); + + return t; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xatan2f_u1(vfloat y, vfloat x) { + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(2.9387372783541830947e-39f)); // nexttowardf((1.0 / FLT_MAX), 1) + x = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(x, vcast_vf_f(1 << 24)), x); + y = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(y, vcast_vf_f(1 << 24)), y); + + vfloat2 d = atan2kf_u1(vcast_vf2_vf_vf(vabs_vf_vf(y), vcast_vf_f(0)), vcast_vf2_vf_vf(x, vcast_vf_f(0))); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)); + + r = vmulsign_vf_vf_vf(r, x); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), veq_vo_vf_vf(x, vcast_vf_f(0))), vsub_vf_vf_vf(vcast_vf_f(M_PI/2), visinf2_vf_vf_vf(x, vmulsign_vf_vf_vf(vcast_vf_f(M_PI/2), x))), r); + r = vsel_vf_vo_vf_vf(visinf_vo_vf(y), vsub_vf_vf_vf(vcast_vf_f(M_PI/2), visinf2_vf_vf_vf(x, vmulsign_vf_vf_vf(vcast_vf_f(M_PI/4), x))), r); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(y, vcast_vf_f(0.0f)), vreinterpret_vf_vm(vand_vm_vo32_vm(vsignbit_vo_vf(x), vreinterpret_vm_vf(vcast_vf_f((float)M_PI)))), r); + + r = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vreinterpret_vm_vf(vmulsign_vf_vf_vf(r, y)))); + return r; +} + +EXPORT CONST VECTOR_CC vfloat xasinf_u1(vfloat d) { + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(0.5f)); + vfloat x2 = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, d), vmul_vf_vf_vf(vsub_vf_vf_vf(vcast_vf_f(1), vabs_vf_vf(d)), vcast_vf_f(0.5f))), u; + vfloat2 x = vsel_vf2_vo_vf2_vf2(o, vcast_vf2_vf_vf(vabs_vf_vf(d), vcast_vf_f(0)), dfsqrt_vf2_vf(x2)); + x = vsel_vf2_vo_vf2_vf2(veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1.0f)), vcast_vf2_f_f(0, 0), x); + + u = vcast_vf_f(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.1666677296e+0)); + u = vmul_vf_vf_vf(u, vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x))); + + vfloat2 y = dfsub_vf2_vf2_vf(dfsub_vf2_vf2_vf2(vcast_vf2_f_f(3.1415927410125732422f/4,-8.7422776573475857731e-08f/4), x), u); + + vfloat r = vsel_vf_vo_vf_vf(o, vadd_vf_vf_vf(u, vf2getx_vf_vf2(x)), + vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(y), vf2gety_vf_vf2(y)), vcast_vf_f(2))); + return vmulsign_vf_vf_vf(r, d); +} + +EXPORT CONST VECTOR_CC vfloat xacosf_u1(vfloat d) { + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(0.5f)); + vfloat x2 = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, d), vmul_vf_vf_vf(vsub_vf_vf_vf(vcast_vf_f(1), vabs_vf_vf(d)), vcast_vf_f(0.5f))), u; + vfloat2 x = vsel_vf2_vo_vf2_vf2(o, vcast_vf2_vf_vf(vabs_vf_vf(d), vcast_vf_f(0)), dfsqrt_vf2_vf(x2)); + x = vsel_vf2_vo_vf2_vf2(veq_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1.0f)), vcast_vf2_f_f(0, 0), x); + + u = vcast_vf_f(+0.4197454825e-1); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.2424046025e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.4547423869e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.7495029271e-1)); + u = vmla_vf_vf_vf_vf(u, x2, vcast_vf_f(+0.1666677296e+0)); + u = vmul_vf_vf_vf(u, vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x))); + + vfloat2 y = dfsub_vf2_vf2_vf2(vcast_vf2_f_f(3.1415927410125732422f/2, -8.7422776573475857731e-08f/2), + dfadd_vf2_vf_vf(vmulsign_vf_vf_vf(vf2getx_vf_vf2(x), d), vmulsign_vf_vf_vf(u, d))); + x = dfadd_vf2_vf2_vf(x, u); + + y = vsel_vf2_vo_vf2_vf2(o, y, dfscale_vf2_vf2_vf(x, vcast_vf_f(2))); + + y = vsel_vf2_vo_vf2_vf2(vandnot_vo_vo_vo(o, vlt_vo_vf_vf(d, vcast_vf_f(0))), + dfsub_vf2_vf2_vf2(vcast_vf2_f_f(3.1415927410125732422f, -8.7422776573475857731e-08f), y), y); + + return vadd_vf_vf_vf(vf2getx_vf_vf2(y), vf2gety_vf_vf2(y)); +} + +EXPORT CONST VECTOR_CC vfloat xatanf_u1(vfloat d) { + vfloat2 d2 = atan2kf_u1(vcast_vf2_vf_vf(vabs_vf_vf(d), vcast_vf_f(0)), vcast_vf2_f_f(1, 0)); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(d2), vf2gety_vf_vf2(d2)); + r = vsel_vf_vo_vf_vf(visinf_vo_vf(d), vcast_vf_f(1.570796326794896557998982), r); + return vmulsign_vf_vf_vf(r, d); +} +#endif // #if !defined(DETERMINISTIC) + +// + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xlogf(vfloat d) { + vfloat x, x2, t, m; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = vdiv_vf_vf_vf(vsub_vf_vf_vf(m, vcast_vf_f(1.0f)), vadd_vf_vf_vf(vcast_vf_f(1.0f), m)); + x2 = vmul_vf_vf_vf(x, x); + + t = vcast_vf_f(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(2.0f)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + x = vmla_vf_vf_vf_vf(x, t, vmul_vf_vf_vf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); + x = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITYf), x); + x = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NANf), x); + x = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITYf), x); +#else + x = vmla_vf_vf_vf_vf(x, t, vmul_vf_vf_vf(vcast_vf_f(0.693147180559945286226764f), e)); + x = vfixup_vf_vf_vf_vi2_i(x, d, vcast_vi2_i((5 << (5*4))), 0); +#endif + + return x; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xexpf(vfloat d) { + vint2 q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(R_LN2f))); + vfloat s, u; + + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf), d); + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf), s); + + u = vcast_vf_f(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.5)); + + u = vadd_vf_vf_vf(vcast_vf_f(1.0f), vmla_vf_vf_vf_vf(vmul_vf_vf_vf(s, s), u, s)); + + u = vldexp2_vf_vf_vi2(u, q); + + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-104)), vreinterpret_vm_vf(u))); + u = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vcast_vf_f(100), d), vcast_vf_f(SLEEF_INFINITYf), u); + + return u; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat expm1fk(vfloat d) { + vint2 q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(R_LN2f))); + vfloat s, u; + + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf), d); + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf), s); + + vfloat s2 = vmul_vf_vf_vf(s, s), s4 = vmul_vf_vf_vf(s2, s2); + u = POLY6(s, s2, s4, + 0.000198527617612853646278381, + 0.00139304355252534151077271, + 0.00833336077630519866943359, + 0.0416664853692054748535156, + 0.166666671633720397949219, + 0.5); + + u = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(s, s), u, s); + + u = vsel_vf_vo_vf_vf(veq_vo_vi2_vi2(q, vcast_vi2_i(0)), u, + vsub_vf_vf_vf(vldexp2_vf_vf_vi2(vadd_vf_vf_vf(u, vcast_vf_f(1)), q), vcast_vf_f(1))); + + return u; +} + +#if defined(ENABLE_NEON32) || defined(ENABLE_NEON32VFPV4) +EXPORT CONST VECTOR_CC vfloat xsqrtf_u35(vfloat d) { + vfloat e = vreinterpret_vf_vi2(vadd_vi2_vi2_vi2(vcast_vi2_i(0x20000000), vand_vi2_vi2_vi2(vcast_vi2_i(0x7f000000), vsrl_vi2_vi2_i(vreinterpret_vi2_vf(d), 1)))); + vfloat m = vreinterpret_vf_vi2(vadd_vi2_vi2_vi2(vcast_vi2_i(0x3f000000), vand_vi2_vi2_vi2(vcast_vi2_i(0x01ffffff), vreinterpret_vi2_vf(d)))); + float32x4_t x = vrsqrteq_f32(m); + x = vmulq_f32(x, vrsqrtsq_f32(m, vmulq_f32(x, x))); + float32x4_t u = vmulq_f32(x, m); + u = vmlaq_f32(u, vmlsq_f32(m, u, u), vmulq_f32(x, vdupq_n_f32(0.5))); + e = vreinterpret_vf_vm(vandnot_vm_vo32_vm(veq_vo_vf_vf(d, vcast_vf_f(0)), vreinterpret_vm_vf(e))); + u = vmul_vf_vf_vf(e, u); + + u = vsel_vf_vo_vf_vf(visinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITYf), u); + u = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visnan_vo_vf(d), vlt_vo_vf_vf(d, vcast_vf_f(0))), vreinterpret_vm_vf(u))); + u = vmulsign_vf_vf_vf(u, d); + + return u; +} +#elif defined(ENABLE_VECEXT) +EXPORT CONST VECTOR_CC vfloat xsqrtf_u35(vfloat d) { + vfloat q = vsqrt_vf_vf(d); + q = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0), q); + return vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITYf), q); +} +#else +EXPORT CONST VECTOR_CC vfloat xsqrtf_u35(vfloat d) { return vsqrt_vf_vf(d); } +#endif + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xcbrtf(vfloat d) { + vfloat x, y, q = vcast_vf_f(1.0), t; + vint2 e, qu, re; + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + vfloat s = d; +#endif + e = vadd_vi2_vi2_vi2(vilogbk_vi2_vf(vabs_vf_vf(d)), vcast_vi2_i(1)); + d = vldexp2_vf_vf_vi2(d, vneg_vi2_vi2(e)); + + t = vadd_vf_vf_vf(vcast_vf_vi2(e), vcast_vf_f(6144)); + qu = vtruncate_vi2_vf(vmul_vf_vf_vf(t, vcast_vf_f(1.0f/3.0f))); + re = vtruncate_vi2_vf(vsub_vf_vf_vf(t, vmul_vf_vf_vf(vcast_vf_vi2(qu), vcast_vf_f(3)))); + + q = vsel_vf_vo_vf_vf(veq_vo_vi2_vi2(re, vcast_vi2_i(1)), vcast_vf_f(1.2599210498948731647672106f), q); + q = vsel_vf_vo_vf_vf(veq_vo_vi2_vi2(re, vcast_vi2_i(2)), vcast_vf_f(1.5874010519681994747517056f), q); + q = vldexp2_vf_vf_vi2(q, vsub_vi2_vi2_vi2(qu, vcast_vi2_i(2048))); + + q = vmulsign_vf_vf_vf(q, d); + d = vabs_vf_vf(d); + + x = vcast_vf_f(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf(vmul_vf_vf_vf(d, x), x); + y = vmul_vf_vf_vf(vsub_vf_vf_vf(y, vmul_vf_vf_vf(vmul_vf_vf_vf(vcast_vf_f(2.0f / 3.0f), y), vmla_vf_vf_vf_vf(y, x, vcast_vf_f(-1.0f)))), q); + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + y = vsel_vf_vo_vf_vf(visinf_vo_vf(s), vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), s), y); + y = vsel_vf_vo_vf_vf(veq_vo_vf_vf(s, vcast_vf_f(0)), vmulsign_vf_vf_vf(vcast_vf_f(0), s), y); +#endif + + return y; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xcbrtf_u1(vfloat d) { + vfloat x, y, z, t; + vfloat2 q2 = vcast_vf2_f_f(1, 0), u, v; + vint2 e, qu, re; + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + vfloat s = d; +#endif + e = vadd_vi2_vi2_vi2(vilogbk_vi2_vf(vabs_vf_vf(d)), vcast_vi2_i(1)); + d = vldexp2_vf_vf_vi2(d, vneg_vi2_vi2(e)); + + t = vadd_vf_vf_vf(vcast_vf_vi2(e), vcast_vf_f(6144)); + qu = vtruncate_vi2_vf(vmul_vf_vf_vf(t, vcast_vf_f(1.0/3.0))); + re = vtruncate_vi2_vf(vsub_vf_vf_vf(t, vmul_vf_vf_vf(vcast_vf_vi2(qu), vcast_vf_f(3)))); + + q2 = vsel_vf2_vo_vf2_vf2(veq_vo_vi2_vi2(re, vcast_vi2_i(1)), vcast_vf2_f_f(1.2599210739135742188f, -2.4018701694217270415e-08), q2); + q2 = vsel_vf2_vo_vf2_vf2(veq_vo_vi2_vi2(re, vcast_vi2_i(2)), vcast_vf2_f_f(1.5874010324478149414f, 1.9520385308169352356e-08), q2); + + q2 = vf2setx_vf2_vf2_vf(q2, vmulsign_vf_vf_vf(vf2getx_vf_vf2(q2), d)); + q2 = vf2sety_vf2_vf2_vf(q2, vmulsign_vf_vf_vf(vf2gety_vf_vf2(q2), d)); + d = vabs_vf_vf(d); + + x = vcast_vf_f(-0.601564466953277587890625f); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(2.8208892345428466796875f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(-5.532182216644287109375f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(5.898262500762939453125f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(-3.8095417022705078125f)); + x = vmla_vf_vf_vf_vf(x, d, vcast_vf_f(2.2241256237030029296875f)); + + y = vmul_vf_vf_vf(x, x); y = vmul_vf_vf_vf(y, y); x = vsub_vf_vf_vf(x, vmul_vf_vf_vf(vmlanp_vf_vf_vf_vf(d, y, x), vcast_vf_f(-1.0 / 3.0))); + + z = x; + + u = dfmul_vf2_vf_vf(x, x); + u = dfmul_vf2_vf2_vf2(u, u); + u = dfmul_vf2_vf2_vf(u, d); + u = dfadd2_vf2_vf2_vf(u, vneg_vf_vf(x)); + y = vadd_vf_vf_vf(vf2getx_vf_vf2(u), vf2gety_vf_vf2(u)); + + y = vmul_vf_vf_vf(vmul_vf_vf_vf(vcast_vf_f(-2.0 / 3.0), y), z); + v = dfadd2_vf2_vf2_vf(dfmul_vf2_vf_vf(z, z), y); + v = dfmul_vf2_vf2_vf(v, d); + v = dfmul_vf2_vf2_vf2(v, q2); + z = vldexp2_vf_vf_vi2(vadd_vf_vf_vf(vf2getx_vf_vf2(v), vf2gety_vf_vf2(v)), vsub_vi2_vi2_vi2(qu, vcast_vi2_i(2048))); + + z = vsel_vf_vo_vf_vf(visinf_vo_vf(d), vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), vf2getx_vf_vf2(q2)), z); + z = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vreinterpret_vf_vm(vsignbit_vm_vf(vf2getx_vf_vf2(q2))), z); + +#if defined(ENABLE_AVX512F) || defined(ENABLE_AVX512FNOFMA) + z = vsel_vf_vo_vf_vf(visinf_vo_vf(s), vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), s), z); + z = vsel_vf_vo_vf_vf(veq_vo_vf_vf(s, vcast_vf_f(0)), vmulsign_vf_vf_vf(vcast_vf_f(0), s), z); +#endif + + return z; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat2 logkf(vfloat d) { + vfloat2 x, x2; + vfloat t, m; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf_vf(vcast_vf_f(-1), m), dfadd2_vf2_vf_vf(vcast_vf_f(1), m)); + x2 = dfsqu_vf2_vf2(x); + + t = vcast_vf_f(0.240320354700088500976562); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(x2), vcast_vf_f(0.285112679004669189453125)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(x2), vcast_vf_f(0.400007992982864379882812)); + vfloat2 c = vcast_vf2_f_f(0.66666662693023681640625f, 3.69183861259614332084311e-09f); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2(e)); +#else + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), e); +#endif + + s = dfadd_vf2_vf2_vf2(s, dfscale_vf2_vf2_vf(x, vcast_vf_f(2))); + s = dfadd_vf2_vf2_vf2(s, dfmul_vf2_vf2_vf2(dfmul_vf2_vf2_vf2(x2, x), + dfadd2_vf2_vf2_vf2(dfmul_vf2_vf2_vf(x2, t), c))); + return s; +} + +static INLINE CONST VECTOR_CC vfloat logk3f(vfloat d) { + vfloat x, x2, t, m; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = vdiv_vf_vf_vf(vsub_vf_vf_vf(m, vcast_vf_f(1.0f)), vadd_vf_vf_vf(vcast_vf_f(1.0f), m)); + x2 = vmul_vf_vf_vf(x, x); + + t = vcast_vf_f(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(0.666666686534881591796875f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(2.0f)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + x = vmla_vf_vf_vf_vf(x, t, vmul_vf_vf_vf(vcast_vf_f(0.693147180559945286226764f), vcast_vf_vi2(e))); +#else + x = vmla_vf_vf_vf_vf(x, t, vmul_vf_vf_vf(vcast_vf_f(0.693147180559945286226764f), e)); +#endif + + return x; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xlogf_u1(vfloat d) { + vfloat2 x; + vfloat t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2(e)); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0f/0.75f))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), e); +#endif + + x = dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf_vf(vcast_vf_f(-1), m), dfadd2_vf2_vf_vf(vcast_vf_f(1), m)); + x2 = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)); + + t = vcast_vf_f(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2(s, dfscale_vf2_vf2_vf(x, vcast_vf_f(2))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x)), t)); + + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(s), vf2gety_vf_vf2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITYf), r); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NANf), r); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITYf), r); +#else + r = vfixup_vf_vf_vf_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat expkf(vfloat2 d) { + vfloat u = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)), vcast_vf_f(R_LN2f)); + vint2 q = vrint_vi2_vf(u); + vfloat2 s, t; + + s = dfadd2_vf2_vf2_vf(d, vmul_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf))); + + s = dfnormalize_vf2_vf2(s); + + u = vcast_vf_f(0.00136324646882712841033936f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.00836596917361021041870117f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.0416710823774337768554688f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.166665524244308471679688f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(0.499999850988388061523438f)); + + t = dfadd_vf2_vf2_vf2(s, dfmul_vf2_vf2_vf(dfsqu_vf2_vf2(s), u)); + + t = dfadd_vf2_vf_vf2(vcast_vf_f(1), t); + u = vadd_vf_vf_vf(vf2getx_vf_vf2(t), vf2gety_vf_vf2(t)); + u = vldexp_vf_vf_vi2(u, q); + + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(vf2getx_vf_vf2(d), vcast_vf_f(-104)), vreinterpret_vm_vf(u))); + + return u; +} + +static INLINE CONST VECTOR_CC vfloat expk3f(vfloat d) { + vint2 q = vrint_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(R_LN2f))); + vfloat s, u; + + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf), d); + s = vmla_vf_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf), s); + + u = vcast_vf_f(0.000198527617612853646278381); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00139304355252534151077271)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.00833336077630519866943359)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.0416664853692054748535156)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.166666671633720397949219)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(0.5)); + + u = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(s, s), u, vadd_vf_vf_vf(s, vcast_vf_f(1.0f))); + u = vldexp2_vf_vf_vi2(u, q); + + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-104)), vreinterpret_vm_vf(u))); + + return u; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xpowf(vfloat x, vfloat y) { +#if 1 + vopmask yisint = vor_vo_vo_vo(veq_vo_vf_vf(vtruncate_vf_vf(y), y), vgt_vo_vf_vf(vabs_vf_vf(y), vcast_vf_f(1 << 24))); + vopmask yisodd = vand_vo_vo_vo(vand_vo_vo_vo(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vtruncate_vi2_vf(y), vcast_vi2_i(1)), vcast_vi2_i(1)), yisint), + vlt_vo_vf_vf(vabs_vf_vf(y), vcast_vf_f(1 << 24))); + +#if defined(ENABLE_NEON32) || defined(ENABLE_NEON32VFPV4) + yisodd = vandnot_vm_vo32_vm(visinf_vo_vf(y), yisodd); +#endif + + vfloat result = expkf(dfmul_vf2_vf2_vf(logkf(vabs_vf_vf(x)), y)); + + result = vsel_vf_vo_vf_vf(visnan_vo_vf(result), vcast_vf_f(SLEEF_INFINITYf), result); + + result = vmul_vf_vf_vf(result, + vsel_vf_vo_vf_vf(vgt_vo_vf_vf(x, vcast_vf_f(0)), + vcast_vf_f(1), + vsel_vf_vo_vf_vf(yisint, vsel_vf_vo_vf_vf(yisodd, vcast_vf_f(-1.0f), vcast_vf_f(1)), vcast_vf_f(SLEEF_NANf)))); + + vfloat efx = vmulsign_vf_vf_vf(vsub_vf_vf_vf(vabs_vf_vf(x), vcast_vf_f(1)), y); + + result = vsel_vf_vo_vf_vf(visinf_vo_vf(y), + vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(efx, vcast_vf_f(0.0f)), + vreinterpret_vm_vf(vsel_vf_vo_vf_vf(veq_vo_vf_vf(efx, vcast_vf_f(0.0f)), + vcast_vf_f(1.0f), + vcast_vf_f(SLEEF_INFINITYf))))), + result); + + result = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), veq_vo_vf_vf(x, vcast_vf_f(0.0))), + vmulsign_vf_vf_vf(vsel_vf_vo_vf_vf(vxor_vo_vo_vo(vsignbit_vo_vf(y), veq_vo_vf_vf(x, vcast_vf_f(0.0f))), + vcast_vf_f(0), vcast_vf_f(SLEEF_INFINITYf)), + vsel_vf_vo_vf_vf(yisodd, x, vcast_vf_f(1))), result); + + result = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vreinterpret_vm_vf(result))); + + result = vsel_vf_vo_vf_vf(vor_vo_vo_vo(veq_vo_vf_vf(y, vcast_vf_f(0)), veq_vo_vf_vf(x, vcast_vf_f(1))), vcast_vf_f(1), result); + + return result; +#else + return expkf(dfmul_vf2_vf2_vf(logkf(x), y)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xfastpowf_u3500(vfloat x, vfloat y) { + vfloat result = expk3f(vmul_vf_vf_vf(logk3f(vabs_vf_vf(x)), y)); + vopmask yisint = vor_vo_vo_vo(veq_vo_vf_vf(vtruncate_vf_vf(y), y), vgt_vo_vf_vf(vabs_vf_vf(y), vcast_vf_f(1 << 24))); + vopmask yisodd = vand_vo_vo_vo(vand_vo_vo_vo(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vtruncate_vi2_vf(y), vcast_vi2_i(1)), vcast_vi2_i(1)), yisint), + vlt_vo_vf_vf(vabs_vf_vf(y), vcast_vf_f(1 << 24))); + + result = vsel_vf_vo_vf_vf(vand_vo_vo_vo(vsignbit_vo_vf(x), yisodd), vneg_vf_vf(result), result); + + result = vsel_vf_vo_vf_vf(veq_vo_vf_vf(x, vcast_vf_f(0)), vcast_vf_f(0), result); + result = vsel_vf_vo_vf_vf(veq_vo_vf_vf(y, vcast_vf_f(0)), vcast_vf_f(1), result); + + return result; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat2 expk2f(vfloat2 d) { + vfloat u = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)), vcast_vf_f(R_LN2f)); + vint2 q = vrint_vi2_vf(u); + vfloat2 s, t; + + s = dfadd2_vf2_vf2_vf(d, vmul_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Uf))); + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(vcast_vf_vi2(q), vcast_vf_f(-L2Lf))); + + u = vcast_vf_f(+0.1980960224e-3f); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(+0.1394256484e-2f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(+0.8333456703e-2f)); + u = vmla_vf_vf_vf_vf(u, vf2getx_vf_vf2(s), vcast_vf_f(+0.4166637361e-1f)); + + t = dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf(s, u), vcast_vf_f(+0.166666659414234244790680580464e+0f)); + t = dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf2(s, t), vcast_vf_f(0.5)); + t = dfadd2_vf2_vf2_vf2(s, dfmul_vf2_vf2_vf2(dfsqu_vf2_vf2(s), t)); + + t = dfadd_vf2_vf_vf2(vcast_vf_f(1), t); + + t = vf2setx_vf2_vf2_vf(t, vldexp2_vf_vf_vi2(vf2getx_vf_vf2(t), q)); + t = vf2sety_vf2_vf2_vf(t, vldexp2_vf_vf_vi2(vf2gety_vf_vf2(t), q)); + + t = vf2setx_vf2_vf2_vf(t, vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(vf2getx_vf_vf2(d), vcast_vf_f(-104)), vreinterpret_vm_vf(vf2getx_vf_vf2(t))))); + t = vf2sety_vf2_vf2_vf(t, vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(vf2getx_vf_vf2(d), vcast_vf_f(-104)), vreinterpret_vm_vf(vf2gety_vf_vf2(t))))); + + return t; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xsinhf(vfloat x) { + vfloat y = vabs_vf_vf(x); + vfloat2 d = expk2f(vcast_vf2_vf_vf(y, vcast_vf_f(0))); + d = dfsub_vf2_vf2_vf2(d, dfrec_vf2_vf2(d)); + y = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)), vcast_vf_f(0.5)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(89)), + visnan_vo_vf(y)), vcast_vf_f(SLEEF_INFINITYf), y); + y = vmulsign_vf_vf_vf(y, x); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xcoshf(vfloat x) { + vfloat y = vabs_vf_vf(x); + vfloat2 d = expk2f(vcast_vf2_vf_vf(y, vcast_vf_f(0))); + d = dfadd_vf2_vf2_vf2(d, dfrec_vf2_vf2(d)); + y = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)), vcast_vf_f(0.5)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(89)), + visnan_vo_vf(y)), vcast_vf_f(SLEEF_INFINITYf), y); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xtanhf(vfloat x) { + vfloat y = vabs_vf_vf(x); + vfloat2 d = expk2f(vcast_vf2_vf_vf(y, vcast_vf_f(0))); + vfloat2 e = dfrec_vf2_vf2(d); + d = dfdiv_vf2_vf2_vf2(dfadd_vf2_vf2_vf2(d, dfneg_vf2_vf2(e)), dfadd_vf2_vf2_vf2(d, e)); + y = vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(8.664339742f)), + visnan_vo_vf(y)), vcast_vf_f(1.0f), y); + y = vmulsign_vf_vf_vf(y, x); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xsinhf_u35(vfloat x) { + vfloat e = expm1fk(vabs_vf_vf(x)); + vfloat y = vdiv_vf_vf_vf(vadd_vf_vf_vf(e, vcast_vf_f(2)), vadd_vf_vf_vf(e, vcast_vf_f(1))); + y = vmul_vf_vf_vf(y, vmul_vf_vf_vf(vcast_vf_f(0.5f), e)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(88)), + visnan_vo_vf(y)), vcast_vf_f(SLEEF_INFINITYf), y); + y = vmulsign_vf_vf_vf(y, x); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xcoshf_u35(vfloat x) { + vfloat e = xexpf(vabs_vf_vf(x)); + vfloat y = vmla_vf_vf_vf_vf(vcast_vf_f(0.5f), e, vdiv_vf_vf_vf(vcast_vf_f(0.5), e)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(88)), + visnan_vo_vf(y)), vcast_vf_f(SLEEF_INFINITYf), y); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xtanhf_u35(vfloat x) { + vfloat d = expm1fk(vmul_vf_vf_vf(vcast_vf_f(2), vabs_vf_vf(x))); + vfloat y = vdiv_vf_vf_vf(d, vadd_vf_vf_vf(vcast_vf_f(2), d)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(8.664339742f)), + visnan_vo_vf(y)), vcast_vf_f(1.0f), y); + y = vmulsign_vf_vf_vf(y, x); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat2 logk2f(vfloat2 d) { + vfloat2 x, x2, m, s; + vfloat t; + vint2 e; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + e = vilogbk_vi2_vf(vmul_vf_vf_vf(vf2getx_vf_vf2(d), vcast_vf_f(1.0f/0.75f))); +#else + e = vrint_vi2_vf(vgetexp_vf_vf(vmul_vf_vf_vf(vf2getx_vf_vf2(d), vcast_vf_f(1.0f/0.75f)))); +#endif + m = dfscale_vf2_vf2_vf(d, vpow2i_vf_vi2(vneg_vi2_vi2(e))); + + x = dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf2_vf(m, vcast_vf_f(-1)), dfadd2_vf2_vf2_vf(m, vcast_vf_f(1))); + x2 = dfsqu_vf2_vf2(x); + + t = vcast_vf_f(0.2392828464508056640625f); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(x2), vcast_vf_f(0.28518211841583251953125f)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(x2), vcast_vf_f(0.400005877017974853515625f)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(x2), vcast_vf_f(0.666666686534881591796875f)); + + s = dfmul_vf2_vf2_vf(vcast_vf2_vf_vf(vcast_vf_f(0.69314718246459960938f), vcast_vf_f(-1.904654323148236017e-09f)), vcast_vf_vi2(e)); + s = dfadd_vf2_vf2_vf2(s, dfscale_vf2_vf2_vf(x, vcast_vf_f(2))); + s = dfadd_vf2_vf2_vf2(s, dfmul_vf2_vf2_vf(dfmul_vf2_vf2_vf2(x2, x), t)); + + return s; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xasinhf(vfloat x) { + vfloat y = vabs_vf_vf(x); + vopmask o = vgt_vo_vf_vf(y, vcast_vf_f(1)); + vfloat2 d; + + d = vsel_vf2_vo_vf2_vf2(o, dfrec_vf2_vf(x), vcast_vf2_vf_vf(y, vcast_vf_f(0))); + d = dfsqrt_vf2_vf2(dfadd2_vf2_vf2_vf(dfsqu_vf2_vf2(d), vcast_vf_f(1))); + d = vsel_vf2_vo_vf2_vf2(o, dfmul_vf2_vf2_vf(d, y), d); + + d = logk2f(dfnormalize_vf2_vf2(dfadd2_vf2_vf2_vf(d, x))); + y = vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(SQRT_FLT_MAX)), + visnan_vo_vf(y)), + vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), x), y); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + y = vsel_vf_vo_vf_vf(visnegzero_vo_vf(x), vcast_vf_f(-0.0), y); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xacoshf(vfloat x) { + vfloat2 d = logk2f(dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf2(dfsqrt_vf2_vf2(dfadd2_vf2_vf_vf(x, vcast_vf_f(1))), dfsqrt_vf2_vf2(dfadd2_vf2_vf_vf(x, vcast_vf_f(-1)))), x)); + vfloat y = vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)); + + y = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vgt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(SQRT_FLT_MAX)), + visnan_vo_vf(y)), + vcast_vf_f(SLEEF_INFINITYf), y); + + y = vreinterpret_vf_vm(vandnot_vm_vo32_vm(veq_vo_vf_vf(x, vcast_vf_f(1.0f)), vreinterpret_vm_vf(y))); + + y = vreinterpret_vf_vm(vor_vm_vo32_vm(vlt_vo_vf_vf(x, vcast_vf_f(1.0f)), vreinterpret_vm_vf(y))); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} + +EXPORT CONST VECTOR_CC vfloat xatanhf(vfloat x) { + vfloat y = vabs_vf_vf(x); + vfloat2 d = logk2f(dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf_vf(vcast_vf_f(1), y), dfadd2_vf2_vf_vf(vcast_vf_f(1), vneg_vf_vf(y)))); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(vgt_vo_vf_vf(y, vcast_vf_f(1.0)), vreinterpret_vm_vf(vsel_vf_vo_vf_vf(veq_vo_vf_vf(y, vcast_vf_f(1.0)), vcast_vf_f(SLEEF_INFINITYf), vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)), vcast_vf_f(0.5)))))); + + y = vreinterpret_vf_vm(vor_vm_vo32_vm(vor_vo_vo_vo(visinf_vo_vf(x), visnan_vo_vf(y)), vreinterpret_vm_vf(y))); + y = vmulsign_vf_vf_vf(y, x); + y = vreinterpret_vf_vm(vor_vm_vo32_vm(visnan_vo_vf(x), vreinterpret_vm_vf(y))); + + return y; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xexp2f(vfloat d) { + vfloat u = vrint_vf_vf(d), s; + vint2 q = vrint_vi2_vf(u); + + s = vsub_vf_vf_vf(d, u); + + u = vcast_vf_f(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.6931471825e+0)); + +#ifdef ENABLE_FMA_SP + u = vfma_vf_vf_vf_vf(u, s, vcast_vf_f(1)); +#else + u = vf2getx_vf_vf2(dfnormalize_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf_vf(u, s)))); +#endif + + u = vldexp2_vf_vf_vi2(u, q); + + u = vsel_vf_vo_vf_vf(vge_vo_vf_vf(d, vcast_vf_f(128)), vcast_vf_f(SLEEF_INFINITY), u); + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-150)), vreinterpret_vm_vf(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vfloat xexp2f_u35(vfloat d) { + vfloat u = vrint_vf_vf(d), s; + vint2 q = vrint_vi2_vf(u); + + s = vsub_vf_vf_vf(d, u); + + u = vcast_vf_f(+0.1535920892e-3); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1339262701e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.9618384764e-2)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5550347269e-1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2402264476e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.6931471825e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2(u, q); + + u = vsel_vf_vo_vf_vf(vge_vo_vf_vf(d, vcast_vf_f(128)), vcast_vf_f(SLEEF_INFINITY), u); + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-150)), vreinterpret_vm_vf(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vfloat xexp10f(vfloat d) { + vfloat u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(LOG10_2))), s; + vint2 q = vrint_vi2_vf(u); + + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Uf), d); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Lf), s); + + u = vcast_vf_f(+0.6802555919e-1); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2078080326e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5393903852e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1171245337e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2034678698e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2650949001e+1)); + vfloat2 x = dfadd_vf2_vf2_vf(vcast_vf2_f_f(2.3025851249694824219, -3.1705172516493593157e-08), vmul_vf_vf_vf(u, s)); + u = vf2getx_vf_vf2(dfnormalize_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf(x, s)))); + + u = vldexp2_vf_vf_vi2(u, q); + + u = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(d, vcast_vf_f(38.5318394191036238941387f)), vcast_vf_f(SLEEF_INFINITYf), u); + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-50)), vreinterpret_vm_vf(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vfloat xexp10f_u35(vfloat d) { + vfloat u = vrint_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(LOG10_2))), s; + vint2 q = vrint_vi2_vf(u); + + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Uf), d); + s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Lf), s); + + u = vcast_vf_f(+0.2064004987e+0); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5417877436e+0)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1171286821e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2034656048e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2650948763e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2302585125e+1)); + u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1000000000e+1)); + + u = vldexp2_vf_vf_vi2(u, q); + + u = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(d, vcast_vf_f(38.5318394191036238941387f)), vcast_vf_f(SLEEF_INFINITYf), u); + u = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vlt_vo_vf_vf(d, vcast_vf_f(-50)), vreinterpret_vm_vf(u))); + + return u; +} + +EXPORT CONST VECTOR_CC vfloat xexpm1f(vfloat a) { + vfloat2 d = dfadd2_vf2_vf2_vf(expk2f(vcast_vf2_vf_vf(a, vcast_vf_f(0))), vcast_vf_f(-1.0)); + vfloat x = vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d)); + x = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(a, vcast_vf_f(88.72283172607421875f)), vcast_vf_f(SLEEF_INFINITYf), x); + x = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(a, vcast_vf_f(-16.635532333438687426013570f)), vcast_vf_f(-1), x); + x = vsel_vf_vo_vf_vf(visnegzero_vo_vf(a), vcast_vf_f(-0.0f), x); + return x; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xlog10f(vfloat d) { + vfloat2 x; + vfloat t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf_vf(vcast_vf_f(-1), m), dfadd2_vf2_vf_vf(vcast_vf_f(1), m)); + x2 = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)); + + t = vcast_vf_f(+0.1314289868e+0); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f( +0.1735493541e+0)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f( +0.2895309627e+0)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.30103001, -1.432098889e-08), vcast_vf_vi2(e)); +#else + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.30103001, -1.432098889e-08), e); +#endif + + s = dfadd_vf2_vf2_vf2(s, dfmul_vf2_vf2_vf2(x, vcast_vf2_f_f(0.868588984, -2.170757285e-08))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x)), t)); + + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(s), vf2gety_vf_vf2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITY), r); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NAN), r); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITY), r); +#else + r = vfixup_vf_vf_vf_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vfloat xlog2f(vfloat d) { + vfloat2 x; + vfloat t, m, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = dfdiv_vf2_vf2_vf2(dfadd2_vf2_vf_vf(vcast_vf_f(-1), m), dfadd2_vf2_vf_vf(vcast_vf_f(1), m)); + x2 = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)); + + t = vcast_vf_f(+0.4374550283e+0f); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.5764790177e+0f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.9618012905120f)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vfloat2 s = dfadd2_vf2_vf_vf2(vcast_vf_vi2(e), + dfmul_vf2_vf2_vf2(x, vcast_vf2_f_f(2.8853900432586669922, 3.2734474483568488616e-08))); +#else + vfloat2 s = dfadd2_vf2_vf_vf2(e, + dfmul_vf2_vf2_vf2(x, vcast_vf2_f_f(2.8853900432586669922, 3.2734474483568488616e-08))); +#endif + + s = dfadd2_vf2_vf2_vf(s, vmul_vf_vf_vf(vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x)), t)); + + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(s), vf2gety_vf_vf2(s)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + r = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITY), r); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NAN), r); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITY), r); +#else + r = vfixup_vf_vf_vf_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vfloat xlog2f_u35(vfloat d) { + vfloat m, t, x, x2; + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), d); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + m = vldexp3_vf_vf_vi2(d, vneg_vi2_vi2(e)); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(d, vcast_vf_f(1.0/0.75))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + m = vgetmant_vf_vf(d); +#endif + + x = vdiv_vf_vf_vf(vsub_vf_vf_vf(m, vcast_vf_f(1)), vadd_vf_vf_vf(m, vcast_vf_f(1))); + x2 = vmul_vf_vf_vf(x, x); + + t = vcast_vf_f(+0.4374088347e+0); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.5764843822e+0)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.9618024230e+0)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vfloat r = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(x2, x), t, + vmla_vf_vf_vf_vf(x, vcast_vf_f(+0.2885390043e+1), vcast_vf_vi2(e))); + + r = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITY), r); + r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NAN), r); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITY), r); +#else + vfloat r = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(x2, x), t, + vmla_vf_vf_vf_vf(x, vcast_vf_f(+0.2885390043e+1), e)); + + r = vfixup_vf_vf_vf_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0); +#endif + + return r; +} + +EXPORT CONST VECTOR_CC vfloat xlog1pf(vfloat d) { + vfloat2 x; + vfloat t, m, x2; + + vfloat dp1 = vadd_vf_vf_vf(d, vcast_vf_f(1)); + +#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA) + vopmask o = vlt_vo_vf_vf(dp1, vcast_vf_f(SLEEF_FLT_MIN)); + dp1 = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(dp1, vcast_vf_f((float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32))), dp1); + vint2 e = vilogb2k_vi2_vf(vmul_vf_vf_vf(dp1, vcast_vf_f(1.0f/0.75f))); + t = vldexp3_vf_vf_vi2(vcast_vf_f(1), vneg_vi2_vi2(e)); + m = vmla_vf_vf_vf_vf(d, t, vsub_vf_vf_vf(t, vcast_vf_f(1))); + e = vsel_vi2_vo_vi2_vi2(o, vsub_vi2_vi2_vi2(e, vcast_vi2_i(64)), e); + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), vcast_vf_vi2(e)); +#else + vfloat e = vgetexp_vf_vf(vmul_vf_vf_vf(dp1, vcast_vf_f(1.0f/0.75f))); + e = vsel_vf_vo_vf_vf(vispinf_vo_vf(e), vcast_vf_f(128.0f), e); + t = vldexp3_vf_vf_vi2(vcast_vf_f(1), vneg_vi2_vi2(vrint_vi2_vf(e))); + m = vmla_vf_vf_vf_vf(d, t, vsub_vf_vf_vf(t, vcast_vf_f(1))); + vfloat2 s = dfmul_vf2_vf2_vf(vcast_vf2_f_f(0.69314718246459960938f, -1.904654323148236017e-09f), e); +#endif + + x = dfdiv_vf2_vf2_vf2(vcast_vf2_vf_vf(m, vcast_vf_f(0)), dfadd_vf2_vf_vf(vcast_vf_f(2), m)); + x2 = vmul_vf_vf_vf(vf2getx_vf_vf2(x), vf2getx_vf_vf2(x)); + + t = vcast_vf_f(+0.3027294874e+0f); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.3996108174e+0f)); + t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.6666694880e+0f)); + + s = dfadd_vf2_vf2_vf2(s, dfscale_vf2_vf2_vf(x, vcast_vf_f(2))); + s = dfadd_vf2_vf2_vf(s, vmul_vf_vf_vf(vmul_vf_vf_vf(x2, vf2getx_vf_vf2(x)), t)); + + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(s), vf2gety_vf_vf2(s)); + + r = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(d, vcast_vf_f(1e+38)), vcast_vf_f(SLEEF_INFINITYf), r); + r = vreinterpret_vf_vm(vor_vm_vo32_vm(vgt_vo_vf_vf(vcast_vf_f(-1), d), vreinterpret_vm_vf(r))); + r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(-1)), vcast_vf_f(-SLEEF_INFINITYf), r); + r = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0f), r); + + return r; +} +#endif // #if !defined(DETERMINISTIC) + +// + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xfabsf(vfloat x) { return vabs_vf_vf(x); } + +EXPORT CONST VECTOR_CC vfloat xcopysignf(vfloat x, vfloat y) { return vcopysign_vf_vf_vf(x, y); } + +EXPORT CONST VECTOR_CC vfloat xfmaxf(vfloat x, vfloat y) { +#if (defined(__x86_64__) || defined(__i386__)) && !defined(ENABLE_VECEXT) && !defined(ENABLE_PUREC) + return vsel_vf_vo_vf_vf(visnan_vo_vf(y), x, vmax_vf_vf_vf(x, y)); +#else + return vsel_vf_vo_vf_vf(visnan_vo_vf(y), x, vsel_vf_vo_vf_vf(vgt_vo_vf_vf(x, y), x, y)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xfminf(vfloat x, vfloat y) { +#if (defined(__x86_64__) || defined(__i386__)) && !defined(ENABLE_VECEXT) && !defined(ENABLE_PUREC) + return vsel_vf_vo_vf_vf(visnan_vo_vf(y), x, vmin_vf_vf_vf(x, y)); +#else + return vsel_vf_vo_vf_vf(visnan_vo_vf(y), x, vsel_vf_vo_vf_vf(vgt_vo_vf_vf(y, x), x, y)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xfdimf(vfloat x, vfloat y) { + vfloat ret = vsub_vf_vf_vf(x, y); + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(ret, vcast_vf_f(0)), veq_vo_vf_vf(x, y)), vcast_vf_f(0), ret); + return ret; +} + +EXPORT CONST VECTOR_CC vfloat xtruncf(vfloat x) { +#ifdef FULL_FP_ROUNDING + return vtruncate_vf_vf(x); +#else + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + return vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), vge_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf(vsub_vf_vf_vf(x, fr), x)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xfloorf(vfloat x) { + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + fr = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(fr, vcast_vf_f(0)), vadd_vf_vf_vf(fr, vcast_vf_f(1.0f)), fr); + return vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), vge_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf(vsub_vf_vf_vf(x, fr), x)); +} + +EXPORT CONST VECTOR_CC vfloat xceilf(vfloat x) { + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + fr = vsel_vf_vo_vf_vf(vle_vo_vf_vf(fr, vcast_vf_f(0)), fr, vsub_vf_vf_vf(fr, vcast_vf_f(1.0f))); + return vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(x), vge_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(INT64_C(1) << 23))), x, vcopysign_vf_vf_vf(vsub_vf_vf_vf(x, fr), x)); +} + +EXPORT CONST VECTOR_CC vfloat xroundf(vfloat d) { + vfloat x = vadd_vf_vf_vf(d, vcast_vf_f(0.5f)); + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + x = vsel_vf_vo_vf_vf(vand_vo_vo_vo(vle_vo_vf_vf(x, vcast_vf_f(0)), veq_vo_vf_vf(fr, vcast_vf_f(0))), vsub_vf_vf_vf(x, vcast_vf_f(1.0f)), x); + fr = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(fr, vcast_vf_f(0)), vadd_vf_vf_vf(fr, vcast_vf_f(1.0f)), fr); + x = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0.4999999701976776123f)), vcast_vf_f(0), x); + return vsel_vf_vo_vf_vf(vor_vo_vo_vo(visinf_vo_vf(d), vge_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(INT64_C(1) << 23))), d, vcopysign_vf_vf_vf(vsub_vf_vf_vf(x, fr), d)); +} + +EXPORT CONST VECTOR_CC vfloat xrintf(vfloat d) { +#ifdef FULL_FP_ROUNDING + return vrint_vf_vf(d); +#else + vfloat c = vmulsign_vf_vf_vf(vcast_vf_f(1 << 23), d); + return vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1 << 23)), + d, vorsign_vf_vf_vf(vsub_vf_vf_vf(vadd_vf_vf_vf(d, c), c), d)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xfmaf(vfloat x, vfloat y, vfloat z) { +#ifdef ENABLE_FMA_SP + return vfma_vf_vf_vf_vf(x, y, z); +#else + vfloat h2 = vadd_vf_vf_vf(vmul_vf_vf_vf(x, y), z), q = vcast_vf_f(1); + vopmask o = vlt_vo_vf_vf(vabs_vf_vf(h2), vcast_vf_f(1e-38f)); + { + const float c0 = UINT64_C(1) << 25, c1 = c0 * c0, c2 = c1 * c1; + x = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(x, vcast_vf_f(c1)), x); + y = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(y, vcast_vf_f(c1)), y); + z = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(z, vcast_vf_f(c2)), z); + q = vsel_vf_vo_vf_vf(o, vcast_vf_f(1.0f / c2), q); + } + o = vgt_vo_vf_vf(vabs_vf_vf(h2), vcast_vf_f(1e+38f)); + { + const float c0 = UINT64_C(1) << 25, c1 = c0 * c0, c2 = c1 * c1; + x = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(x, vcast_vf_f(1.0f / c1)), x); + y = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(y, vcast_vf_f(1.0f / c1)), y); + z = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(z, vcast_vf_f(1.0f / c2)), z); + q = vsel_vf_vo_vf_vf(o, vcast_vf_f(c2), q); + } + vfloat2 d = dfmul_vf2_vf_vf(x, y); + d = dfadd2_vf2_vf2_vf(d, z); + vfloat ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(veq_vo_vf_vf(x, vcast_vf_f(0)), veq_vo_vf_vf(y, vcast_vf_f(0))), z, vadd_vf_vf_vf(vf2getx_vf_vf2(d), vf2gety_vf_vf2(d))); + o = visinf_vo_vf(z); + o = vandnot_vo_vo_vo(visinf_vo_vf(x), o); + o = vandnot_vo_vo_vo(visnan_vo_vf(x), o); + o = vandnot_vo_vo_vo(visinf_vo_vf(y), o); + o = vandnot_vo_vo_vo(visnan_vo_vf(y), o); + h2 = vsel_vf_vo_vf_vf(o, z, h2); + + o = vor_vo_vo_vo(visinf_vo_vf(h2), visnan_vo_vf(h2)); + + return vsel_vf_vo_vf_vf(o, h2, vmul_vf_vf_vf(ret, q)); +#endif +} +#endif // #if !defined(DETERMINISTIC) + +SQRTFU05_FUNCATR VECTOR_CC vfloat xsqrtf_u05(vfloat d) { +#if defined(ENABLE_FMA_SP) + vfloat q, w, x, y, z; + + d = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(SLEEF_NANf), d); + + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(5.2939559203393770e-23f)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f(1.8889465931478580e+22f)), d); + q = vsel_vf_vo_vf_vf(o, vcast_vf_f(7.2759576141834260e-12f), vcast_vf_f(1.0f)); + + y = vreinterpret_vf_vi2(vsub_vi2_vi2_vi2(vcast_vi2_i(0x5f3759df), vsrl_vi2_vi2_i(vreinterpret_vi2_vf(d), 1))); + + x = vmul_vf_vf_vf(d, y); w = vmul_vf_vf_vf(vcast_vf_f(0.5), y); + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(0.5)); + x = vfma_vf_vf_vf_vf(x, y, x); w = vfma_vf_vf_vf_vf(w, y, w); + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(0.5)); + x = vfma_vf_vf_vf_vf(x, y, x); w = vfma_vf_vf_vf_vf(w, y, w); + + y = vfmanp_vf_vf_vf_vf(x, w, vcast_vf_f(1.5)); w = vadd_vf_vf_vf(w, w); + w = vmul_vf_vf_vf(w, y); + x = vmul_vf_vf_vf(w, d); + y = vfmapn_vf_vf_vf_vf(w, d, x); z = vfmanp_vf_vf_vf_vf(w, x, vcast_vf_f(1)); + + z = vfmanp_vf_vf_vf_vf(w, y, z); w = vmul_vf_vf_vf(vcast_vf_f(0.5), x); + w = vfma_vf_vf_vf_vf(w, z, y); + w = vadd_vf_vf_vf(w, x); + + w = vmul_vf_vf_vf(w, q); + + w = vsel_vf_vo_vf_vf(vor_vo_vo_vo(veq_vo_vf_vf(d, vcast_vf_f(0)), + veq_vo_vf_vf(d, vcast_vf_f(SLEEF_INFINITYf))), d, w); + + w = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(SLEEF_NANf), w); + + return w; +#else + vfloat q; + vopmask o; + + d = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(SLEEF_NANf), d); + + o = vlt_vo_vf_vf(d, vcast_vf_f(5.2939559203393770e-23f)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f(1.8889465931478580e+22f)), d); + q = vsel_vf_vo_vf_vf(o, vcast_vf_f(7.2759576141834260e-12f*0.5f), vcast_vf_f(0.5f)); + + o = vgt_vo_vf_vf(d, vcast_vf_f(1.8446744073709552e+19f)); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f(5.4210108624275220e-20f)), d); + q = vsel_vf_vo_vf_vf(o, vcast_vf_f(4294967296.0f * 0.5f), q); + + vfloat x = vreinterpret_vf_vi2(vsub_vi2_vi2_vi2(vcast_vi2_i(0x5f375a86), vsrl_vi2_vi2_i(vreinterpret_vi2_vf(vadd_vf_vf_vf(d, vcast_vf_f(1e-45f))), 1))); + + x = vmul_vf_vf_vf(x, vsub_vf_vf_vf(vcast_vf_f(1.5f), vmul_vf_vf_vf(vmul_vf_vf_vf(vmul_vf_vf_vf(vcast_vf_f(0.5f), d), x), x))); + x = vmul_vf_vf_vf(x, vsub_vf_vf_vf(vcast_vf_f(1.5f), vmul_vf_vf_vf(vmul_vf_vf_vf(vmul_vf_vf_vf(vcast_vf_f(0.5f), d), x), x))); + x = vmul_vf_vf_vf(x, vsub_vf_vf_vf(vcast_vf_f(1.5f), vmul_vf_vf_vf(vmul_vf_vf_vf(vmul_vf_vf_vf(vcast_vf_f(0.5f), d), x), x))); + x = vmul_vf_vf_vf(x, d); + + vfloat2 d2 = dfmul_vf2_vf2_vf2(dfadd2_vf2_vf_vf2(d, dfmul_vf2_vf_vf(x, x)), dfrec_vf2_vf(x)); + + x = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(d2), vf2gety_vf_vf2(d2)), q); + + x = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITYf), x); + x = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), d, x); + + return x; +#endif +} + +EXPORT CONST VECTOR_CC vfloat xsqrtf(vfloat d) { +#ifdef ACCURATE_SQRT + return vsqrt_vf_vf(d); +#else + // fall back to approximation if ACCURATE_SQRT is undefined + return xsqrtf_u05(d); +#endif +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xhypotf_u05(vfloat x, vfloat y) { + x = vabs_vf_vf(x); + y = vabs_vf_vf(y); + vfloat min = vmin_vf_vf_vf(x, y), n = min; + vfloat max = vmax_vf_vf_vf(x, y), d = max; + + vopmask o = vlt_vo_vf_vf(max, vcast_vf_f(SLEEF_FLT_MIN)); + n = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(n, vcast_vf_f(UINT64_C(1) << 24)), n); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f(UINT64_C(1) << 24)), d); + + vfloat2 t = dfdiv_vf2_vf2_vf2(vcast_vf2_vf_vf(n, vcast_vf_f(0)), vcast_vf2_vf_vf(d, vcast_vf_f(0))); + t = dfmul_vf2_vf2_vf(dfsqrt_vf2_vf2(dfadd2_vf2_vf2_vf(dfsqu_vf2_vf2(t), vcast_vf_f(1))), max); + vfloat ret = vadd_vf_vf_vf(vf2getx_vf_vf2(t), vf2gety_vf_vf2(t)); + ret = vsel_vf_vo_vf_vf(visnan_vo_vf(ret), vcast_vf_f(SLEEF_INFINITYf), ret); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(min, vcast_vf_f(0)), max, ret); + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vcast_vf_f(SLEEF_NANf), ret); + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(veq_vo_vf_vf(x, vcast_vf_f(SLEEF_INFINITYf)), veq_vo_vf_vf(y, vcast_vf_f(SLEEF_INFINITYf))), vcast_vf_f(SLEEF_INFINITYf), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vfloat xhypotf_u35(vfloat x, vfloat y) { + x = vabs_vf_vf(x); + y = vabs_vf_vf(y); + vfloat min = vmin_vf_vf_vf(x, y); + vfloat max = vmax_vf_vf_vf(x, y); + + vfloat t = vdiv_vf_vf_vf(min, max); + vfloat ret = vmul_vf_vf_vf(max, vsqrt_vf_vf(vmla_vf_vf_vf_vf(t, t, vcast_vf_f(1)))); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(min, vcast_vf_f(0)), max, ret); + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vcast_vf_f(SLEEF_NANf), ret); + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(veq_vo_vf_vf(x, vcast_vf_f(SLEEF_INFINITYf)), veq_vo_vf_vf(y, vcast_vf_f(SLEEF_INFINITYf))), vcast_vf_f(SLEEF_INFINITYf), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vfloat xnextafterf(vfloat x, vfloat y) { + x = vsel_vf_vo_vf_vf(veq_vo_vf_vf(x, vcast_vf_f(0)), vmulsign_vf_vf_vf(vcast_vf_f(0), y), x); + vint2 xi2 = vreinterpret_vi2_vf(x); + vopmask c = vxor_vo_vo_vo(vsignbit_vo_vf(x), vge_vo_vf_vf(y, x)); + + xi2 = vsel_vi2_vo_vi2_vi2(c, vsub_vi2_vi2_vi2(vcast_vi2_i(0), vxor_vi2_vi2_vi2(xi2, vcast_vi2_i((int)(1U << 31)))), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2(vneq_vo_vf_vf(x, y), vsub_vi2_vi2_vi2(xi2, vcast_vi2_i(1)), xi2); + + xi2 = vsel_vi2_vo_vi2_vi2(c, vsub_vi2_vi2_vi2(vcast_vi2_i(0), vxor_vi2_vi2_vi2(xi2, vcast_vi2_i((int)(1U << 31)))), xi2); + + vfloat ret = vreinterpret_vf_vi2(xi2); + + ret = vsel_vf_vo_vf_vf(vand_vo_vo_vo(veq_vo_vf_vf(ret, vcast_vf_f(0)), vneq_vo_vf_vf(x, vcast_vf_f(0))), + vmulsign_vf_vf_vf(vcast_vf_f(0), x), ret); + + ret = vsel_vf_vo_vf_vf(vand_vo_vo_vo(veq_vo_vf_vf(x, vcast_vf_f(0)), veq_vo_vf_vf(y, vcast_vf_f(0))), y, ret); + + ret = vsel_vf_vo_vf_vf(vor_vo_vo_vo(visnan_vo_vf(x), visnan_vo_vf(y)), vcast_vf_f(SLEEF_NANf), ret); + + return ret; +} + +EXPORT CONST VECTOR_CC vfloat xfrfrexpf(vfloat x) { + x = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(SLEEF_FLT_MIN)), vmul_vf_vf_vf(x, vcast_vf_f(UINT64_C(1) << 30)), x); + + vmask xm = vreinterpret_vm_vf(x); + xm = vand_vm_vm_vm(xm, vcast_vm_i_i(~0x7f800000U, ~0x7f800000U)); + xm = vor_vm_vm_vm (xm, vcast_vm_i_i( 0x3f000000U, 0x3f000000U)); + + vfloat ret = vreinterpret_vf_vm(xm); + + ret = vsel_vf_vo_vf_vf(visinf_vo_vf(x), vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), x), ret); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(x, vcast_vf_f(0)), x, ret); + + return ret; +} +#endif // #if !defined(DETERMINISTIC) + +EXPORT CONST VECTOR_CC vint2 xexpfrexpf(vfloat x) { + /* + x = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(SLEEF_FLT_MIN)), vmul_vf_vf_vf(x, vcast_vf_f(UINT64_C(1) << 63)), x); + + vint ret = vcastu_vi_vi2(vreinterpret_vi2_vf(x)); + ret = vsub_vi_vi_vi(vand_vi_vi_vi(vsrl_vi_vi_i(ret, 20), vcast_vi_i(0x7ff)), vcast_vi_i(0x3fe)); + + ret = vsel_vi_vo_vi_vi(vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vf_vf(x, vcast_vf_f(0)), visnan_vo_vf(x)), visinf_vo_vf(x)), vcast_vi_i(0), ret); + + return ret; + */ + return vcast_vi2_i(0); +} + +static INLINE CONST VECTOR_CC vfloat vtoward0_vf_vf(vfloat x) { + vfloat t = vreinterpret_vf_vi2(vsub_vi2_vi2_vi2(vreinterpret_vi2_vf(x), vcast_vi2_i(1))); + return vsel_vf_vo_vf_vf(veq_vo_vf_vf(x, vcast_vf_f(0)), vcast_vf_f(0), t); +} + +static INLINE CONST VECTOR_CC vfloat vptrunc_vf_vf(vfloat x) { +#ifdef FULL_FP_ROUNDING + return vtruncate_vf_vf(x); +#else + vfloat fr = vsub_vf_vf_vf(x, vcast_vf_vi2(vtruncate_vi2_vf(x))); + return vsel_vf_vo_vf_vf(vge_vo_vf_vf(vabs_vf_vf(x), vcast_vf_f(INT64_C(1) << 23)), x, vsub_vf_vf_vf(x, fr)); +#endif +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xfmodf(vfloat x, vfloat y) { + vfloat nu = vabs_vf_vf(x), de = vabs_vf_vf(y), s = vcast_vf_f(1), q; + vopmask o = vlt_vo_vf_vf(de, vcast_vf_f(SLEEF_FLT_MIN)); + nu = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(nu, vcast_vf_f(UINT64_C(1) << 25)), nu); + de = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(de, vcast_vf_f(UINT64_C(1) << 25)), de); + s = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(s , vcast_vf_f(1.0f / (UINT64_C(1) << 25))), s); + vfloat rde = vtoward0_vf_vf(vrec_vf_vf(de)); +#if defined(ENABLE_NEON32) || defined(ENABLE_NEON32VFPV4) + rde = vtoward0_vf_vf(rde); +#endif + vfloat2 r = vcast_vf2_vf_vf(nu, vcast_vf_f(0)); + + for(int i=0;i<8;i++) { // ceil(log2(FLT_MAX) / 22)+1 + q = vptrunc_vf_vf(vmul_vf_vf_vf(vtoward0_vf_vf(vf2getx_vf_vf2(r)), rde)); + q = vsel_vf_vo_vf_vf(vand_vo_vo_vo(vgt_vo_vf_vf(vmul_vf_vf_vf(vcast_vf_f(3), de), vf2getx_vf_vf2(r)), + vge_vo_vf_vf(vf2getx_vf_vf2(r), de)), + vcast_vf_f(2), q); + q = vsel_vf_vo_vf_vf(vand_vo_vo_vo(vgt_vo_vf_vf(vmul_vf_vf_vf(vcast_vf_f(2), de), vf2getx_vf_vf2(r)), + vge_vo_vf_vf(vf2getx_vf_vf2(r), de)), + vcast_vf_f(1), q); + r = dfnormalize_vf2_vf2(dfadd2_vf2_vf2_vf2(r, dfmul_vf2_vf_vf(vptrunc_vf_vf(q), vneg_vf_vf(de)))); + if (vtestallones_i_vo32(vlt_vo_vf_vf(vf2getx_vf_vf2(r), de))) break; + } + + vfloat ret = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(r), vf2gety_vf_vf2(r)), s); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(r), vf2gety_vf_vf2(r)), de), vcast_vf_f(0), ret); + + ret = vmulsign_vf_vf_vf(ret, x); + + ret = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(nu, de), x, ret); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(de, vcast_vf_f(0)), vcast_vf_f(SLEEF_NANf), ret); + + return ret; +} + +static INLINE CONST VECTOR_CC vfloat vrintfk2_vf_vf(vfloat d) { +#ifdef FULL_FP_ROUNDING + return vrint_vf_vf(d); +#else + vfloat c = vmulsign_vf_vf_vf(vcast_vf_f(1 << 23), d); + return vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(1 << 23)), + d, vorsign_vf_vf_vf(vsub_vf_vf_vf(vadd_vf_vf_vf(d, c), c), d)); +#endif +} + +EXPORT CONST VECTOR_CC vfloat xremainderf(vfloat x, vfloat y) { + vfloat n = vabs_vf_vf(x), d = vabs_vf_vf(y), s = vcast_vf_f(1), q; + vopmask o = vlt_vo_vf_vf(d, vcast_vf_f(SLEEF_FLT_MIN*2)); + n = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(n, vcast_vf_f(UINT64_C(1) << 25)), n); + d = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(d, vcast_vf_f(UINT64_C(1) << 25)), d); + s = vsel_vf_vo_vf_vf(o, vmul_vf_vf_vf(s , vcast_vf_f(1.0f / (UINT64_C(1) << 25))), s); + vfloat2 r = vcast_vf2_vf_vf(n, vcast_vf_f(0)); + vfloat rd = vrec_vf_vf(d); + vopmask qisodd = vneq_vo_vf_vf(vcast_vf_f(0), vcast_vf_f(0)); + + for(int i=0;i<8;i++) { // ceil(log2(FLT_MAX) / 22)+1 + q = vrintfk2_vf_vf(vmul_vf_vf_vf(vf2getx_vf_vf2(r), rd)); + q = vsel_vf_vo_vf_vf(vlt_vo_vf_vf(vabs_vf_vf(vf2getx_vf_vf2(r)), vmul_vf_vf_vf(d, vcast_vf_f(1.5f))), vmulsign_vf_vf_vf(vcast_vf_f(1.0f), vf2getx_vf_vf2(r)), q); + q = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(vabs_vf_vf(vf2getx_vf_vf2(r)), vmul_vf_vf_vf(d, vcast_vf_f(0.5f))), + vandnot_vo_vo_vo(qisodd, veq_vo_vf_vf(vabs_vf_vf(vf2getx_vf_vf2(r)), vmul_vf_vf_vf(d, vcast_vf_f(0.5f))))), + vcast_vf_f(0.0), q); + if (vtestallones_i_vo32(veq_vo_vf_vf(q, vcast_vf_f(0)))) break; + q = vsel_vf_vo_vf_vf(visinf_vo_vf(vmul_vf_vf_vf(q, vneg_vf_vf(d))), vadd_vf_vf_vf(q, vmulsign_vf_vf_vf(vcast_vf_f(-1), vf2getx_vf_vf2(r))), q); + qisodd = vxor_vo_vo_vo(qisodd, vand_vo_vo_vo(veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vtruncate_vi2_vf(q), vcast_vi2_i(1)), vcast_vi2_i(1)), + vlt_vo_vf_vf(vabs_vf_vf(q), vcast_vf_f(1 << 24)))); + r = dfnormalize_vf2_vf2(dfadd2_vf2_vf2_vf2(r, dfmul_vf2_vf_vf(q, vneg_vf_vf(d)))); + } + + vfloat ret = vmul_vf_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(r), vf2gety_vf_vf2(r)), s); + ret = vmulsign_vf_vf_vf(ret, x); + ret = vsel_vf_vo_vf_vf(visinf_vo_vf(y), vsel_vf_vo_vf_vf(visinf_vo_vf(x), vcast_vf_f(SLEEF_NANf), x), ret); + ret = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(SLEEF_NANf), ret); + return ret; +} +#endif // #if !defined(DETERMINISTIC) + +// + +static INLINE CONST VECTOR_CC vfloat2 sinpifk(vfloat d) { + vopmask o; + vfloat u, s, t; + vfloat2 x, s2; + + u = vmul_vf_vf_vf(d, vcast_vf_f(4.0)); + vint2 q = vtruncate_vi2_vf(u); + q = vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vxor_vi2_vi2_vi2(vsrl_vi2_vi2_i(q, 31), vcast_vi2_i(1))), vcast_vi2_i(~1)); + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(2)); + + s = vsub_vf_vf_vf(u, vcast_vf_vi2(q)); + t = s; + s = vmul_vf_vf_vf(s, s); + s2 = dfmul_vf2_vf_vf(t, t); + + // + + u = vsel_vf_vo_f_f(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf(u, s, vsel_vf_vo_f_f(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf(u, s, vsel_vf_vo_f_f(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2(vmul_vf_vf_vf(u, s), + vsel_vf2_vo_f_f_f_f(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2(dfmul_vf2_vf2_vf2(s2, x), + vsel_vf2_vo_f_f_f_f(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2(x, vsel_vf2_vo_vf2_vf2(o, s2, vcast_vf2_vf_vf(t, vcast_vf_f(0)))); + x = vsel_vf2_vo_vf2_vf2(o, dfadd2_vf2_vf2_vf(x, vcast_vf_f(1)), x); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(4)), vcast_vi2_i(4)); + x = vf2setx_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(x))))); + x = vf2sety_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(x))))); + + return x; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xsinpif_u05(vfloat d) { + vfloat2 x = sinpifk(d); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + r = vsel_vf_vo_vf_vf(visnegzero_vo_vf(d), vcast_vf_f(-0.0), r); + r = vreinterpret_vf_vm(vandnot_vm_vo32_vm(vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX4f)), vreinterpret_vm_vf(r))); + r = vreinterpret_vf_vm(vor_vm_vo32_vm(visinf_vo_vf(d), vreinterpret_vm_vf(r))); + + return r; +} +#endif // #if !defined(DETERMINISTIC) + +static INLINE CONST VECTOR_CC vfloat2 cospifk(vfloat d) { + vopmask o; + vfloat u, s, t; + vfloat2 x, s2; + + u = vmul_vf_vf_vf(d, vcast_vf_f(4.0)); + vint2 q = vtruncate_vi2_vf(u); + q = vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vxor_vi2_vi2_vi2(vsrl_vi2_vi2_i(q, 31), vcast_vi2_i(1))), vcast_vi2_i(~1)); + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(0)); + + s = vsub_vf_vf_vf(u, vcast_vf_vi2(q)); + t = s; + s = vmul_vf_vf_vf(s, s); + s2 = dfmul_vf2_vf_vf(t, t); + + // + + u = vsel_vf_vo_f_f(o, -0.2430611801e-7f, +0.3093842054e-6f); + u = vmla_vf_vf_vf_vf(u, s, vsel_vf_vo_f_f(o, +0.3590577080e-5f, -0.3657307388e-4f)); + u = vmla_vf_vf_vf_vf(u, s, vsel_vf_vo_f_f(o, -0.3259917721e-3f, +0.2490393585e-2f)); + x = dfadd2_vf2_vf_vf2(vmul_vf_vf_vf(u, s), + vsel_vf2_vo_f_f_f_f(o, 0.015854343771934509277, 4.4940051354032242811e-10, + -0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_vf2_vf2_vf2(dfmul_vf2_vf2_vf2(s2, x), + vsel_vf2_vo_f_f_f_f(o, -0.30842512845993041992, -9.0728339030733922277e-09, + 0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_vf2_vf2_vf2(x, vsel_vf2_vo_vf2_vf2(o, s2, vcast_vf2_vf_vf(t, vcast_vf_f(0)))); + x = vsel_vf2_vo_vf2_vf2(o, dfadd2_vf2_vf2_vf(x, vcast_vf_f(1)), x); + + o = veq_vo_vi2_vi2(vand_vi2_vi2_vi2(vadd_vi2_vi2_vi2(q, vcast_vi2_i(2)), vcast_vi2_i(4)), vcast_vi2_i(4)); + x = vf2setx_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2getx_vf_vf2(x))))); + x = vf2sety_vf2_vf2_vf(x, vreinterpret_vf_vm(vxor_vm_vm_vm(vand_vm_vo32_vm(o, vreinterpret_vm_vf(vcast_vf_f(-0.0))), vreinterpret_vm_vf(vf2gety_vf_vf2(x))))); + + return x; +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xcospif_u05(vfloat d) { + vfloat2 x = cospifk(d); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)); + + r = vsel_vf_vo_vf_vf(vgt_vo_vf_vf(vabs_vf_vf(d), vcast_vf_f(TRIGRANGEMAX4f)), vcast_vf_f(1), r); + r = vreinterpret_vf_vm(vor_vm_vo32_vm(visinf_vo_vf(d), vreinterpret_vm_vf(r))); + + return r; +} +#endif // #if !defined(DETERMINISTIC) + +#if !(defined(ENABLE_SVE) || defined(ENABLE_SVENOFMA) || defined(ENABLE_RVVM1) || defined(ENABLE_RVVM1NOFMA) || defined(ENABLE_RVVM2) || defined(ENABLE_RVVM2NOFMA)) + typedef struct { + vfloat2 a, b; + } df2; + +static df2 df2setab_df2_vf2_vf2(vfloat2 a, vfloat2 b) { + df2 r = { a, b }; + return r; +} +static vfloat2 df2geta_vf2_df2(df2 d) { return d.a; } +static vfloat2 df2getb_vf2_df2(df2 d) { return d.b; } +#endif + +/* TODO AArch64: potential optimization by using `vfmad_lane_f64` */ +static CONST df2 gammafk(vfloat a) { + vfloat2 clc = vcast_vf2_f_f(0, 0), clln = vcast_vf2_f_f(1, 0), clld = vcast_vf2_f_f(1, 0); + vfloat2 x, y, z; + vfloat t, u; + + vopmask otiny = vlt_vo_vf_vf(vabs_vf_vf(a), vcast_vf_f(1e-30f)), oref = vlt_vo_vf_vf(a, vcast_vf_f(0.5)); + + x = vsel_vf2_vo_vf2_vf2(otiny, vcast_vf2_f_f(0, 0), + vsel_vf2_vo_vf2_vf2(oref, dfadd2_vf2_vf_vf(vcast_vf_f(1), vneg_vf_vf(a)), + vcast_vf2_vf_vf(a, vcast_vf_f(0)))); + + vopmask o0 = vand_vo_vo_vo(vle_vo_vf_vf(vcast_vf_f(0.5), vf2getx_vf_vf2(x)), vle_vo_vf_vf(vf2getx_vf_vf2(x), vcast_vf_f(1.2))); + vopmask o2 = vle_vo_vf_vf(vcast_vf_f(2.3), vf2getx_vf_vf2(x)); + + y = dfnormalize_vf2_vf2(dfmul_vf2_vf2_vf2(dfadd2_vf2_vf2_vf(x, vcast_vf_f(1)), x)); + y = dfnormalize_vf2_vf2(dfmul_vf2_vf2_vf2(dfadd2_vf2_vf2_vf(x, vcast_vf_f(2)), y)); + + vopmask o = vand_vo_vo_vo(o2, vle_vo_vf_vf(vf2getx_vf_vf2(x), vcast_vf_f(7))); + clln = vsel_vf2_vo_vf2_vf2(o, y, clln); + + x = vsel_vf2_vo_vf2_vf2(o, dfadd2_vf2_vf2_vf(x, vcast_vf_f(3)), x); + t = vsel_vf_vo_vf_vf(o2, vrec_vf_vf(vf2getx_vf_vf2(x)), vf2getx_vf_vf2(dfnormalize_vf2_vf2(dfadd2_vf2_vf2_vf(x, vsel_vf_vo_f_f(o0, -1, -2))))); + + u = vsel_vf_vo_vo_f_f_f(o2, o0, +0.000839498720672087279971000786, +0.9435157776e+0f, +0.1102489550e-3f); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, -5.17179090826059219329394422e-05, +0.8670063615e+0f, +0.8160019934e-4f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, -0.000592166437353693882857342347, +0.4826702476e+0f, +0.1528468856e-3f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, +6.97281375836585777403743539e-05, -0.8855129778e-1f, -0.2355068718e-3f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, +0.000784039221720066627493314301, +0.1013825238e+0f, +0.4962242092e-3f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, -0.000229472093621399176949318732, -0.1493408978e+0f, -0.1193488017e-2f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, -0.002681327160493827160473958490, +0.1697509140e+0f, +0.2891599433e-2f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, +0.003472222222222222222175164840, -0.2072454542e+0f, -0.7385451812e-2f)); + u = vmla_vf_vf_vf_vf(u, t, vsel_vf_vo_vo_f_f_f(o2, o0, +0.083333333333333333335592087900, +0.2705872357e+0f, +0.2058077045e-1f)); + + y = dfmul_vf2_vf2_vf2(dfadd2_vf2_vf2_vf(x, vcast_vf_f(-0.5)), logk2f(x)); + y = dfadd2_vf2_vf2_vf2(y, dfneg_vf2_vf2(x)); + y = dfadd2_vf2_vf2_vf2(y, vcast_vf2_d(0.91893853320467278056)); // 0.5*log(2*M_PI) + + z = dfadd2_vf2_vf2_vf(dfmul_vf2_vf_vf (u, t), vsel_vf_vo_f_f(o0, -0.400686534596170958447352690395e+0f, -0.673523028297382446749257758235e-1f)); + z = dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf(z, t), vsel_vf_vo_f_f(o0, +0.822466960142643054450325495997e+0f, +0.322467033928981157743538726901e+0f)); + z = dfadd2_vf2_vf2_vf(dfmul_vf2_vf2_vf(z, t), vsel_vf_vo_f_f(o0, -0.577215665946766039837398973297e+0f, +0.422784335087484338986941629852e+0f)); + z = dfmul_vf2_vf2_vf(z, t); + + clc = vsel_vf2_vo_vf2_vf2(o2, y, z); + + clld = vsel_vf2_vo_vf2_vf2(o2, dfadd2_vf2_vf2_vf(dfmul_vf2_vf_vf(u, t), vcast_vf_f(1)), clld); + + y = clln; + + clc = vsel_vf2_vo_vf2_vf2(otiny, vcast_vf2_d(41.58883083359671856503), // log(2^60) + vsel_vf2_vo_vf2_vf2(oref, dfadd2_vf2_vf2_vf2(vcast_vf2_d(1.1447298858494001639), dfneg_vf2_vf2(clc)), clc)); // log(M_PI) + clln = vsel_vf2_vo_vf2_vf2(otiny, vcast_vf2_f_f(1, 0), vsel_vf2_vo_vf2_vf2(oref, clln, clld)); + + if (!vtestallones_i_vo32(vnot_vo32_vo32(oref))) { + t = vsub_vf_vf_vf(a, vmul_vf_vf_vf(vcast_vf_f(INT64_C(1) << 12), vcast_vf_vi2(vtruncate_vi2_vf(vmul_vf_vf_vf(a, vcast_vf_f(1.0 / (INT64_C(1) << 12))))))); + x = dfmul_vf2_vf2_vf2(clld, sinpifk(t)); + } + + clld = vsel_vf2_vo_vf2_vf2(otiny, vcast_vf2_vf_vf(vmul_vf_vf_vf(a, vcast_vf_f((INT64_C(1) << 30)*(float)(INT64_C(1) << 30))), vcast_vf_f(0)), + vsel_vf2_vo_vf2_vf2(oref, x, y)); + + return df2setab_df2_vf2_vf2(clc, dfdiv_vf2_vf2_vf2(clln, clld)); +} + +#if !defined(DETERMINISTIC) +EXPORT CONST VECTOR_CC vfloat xtgammaf_u1(vfloat a) { + df2 d = gammafk(a); + vfloat2 y = dfmul_vf2_vf2_vf2(expk2f(df2geta_vf2_df2(d)), df2getb_vf2_df2(d)); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(y), vf2gety_vf_vf2(y)); + vopmask o; + + o = vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vf_vf(a, vcast_vf_f(-SLEEF_INFINITYf)), + vand_vo_vo_vo(vlt_vo_vf_vf(a, vcast_vf_f(0)), visint_vo_vf(a))), + vand_vo_vo_vo(vand_vo_vo_vo(visnumber_vo_vf(a), vlt_vo_vf_vf(a, vcast_vf_f(0))), visnan_vo_vf(r))); + r = vsel_vf_vo_vf_vf(o, vcast_vf_f(SLEEF_NANf), r); + + o = vand_vo_vo_vo(vand_vo_vo_vo(vor_vo_vo_vo(veq_vo_vf_vf(a, vcast_vf_f(SLEEF_INFINITYf)), visnumber_vo_vf(a)), + vge_vo_vf_vf(a, vcast_vf_f(-SLEEF_FLT_MIN))), + vor_vo_vo_vo(vor_vo_vo_vo(veq_vo_vf_vf(a, vcast_vf_f(0)), vgt_vo_vf_vf(a, vcast_vf_f(36))), visnan_vo_vf(r))); + r = vsel_vf_vo_vf_vf(o, vmulsign_vf_vf_vf(vcast_vf_f(SLEEF_INFINITYf), a), r); + + return r; +} + +EXPORT CONST VECTOR_CC vfloat xlgammaf_u1(vfloat a) { + df2 d = gammafk(a); + vfloat2 y = dfadd2_vf2_vf2_vf2(df2geta_vf2_df2(d), logk2f(dfabs_vf2_vf2(df2getb_vf2_df2(d)))); + vfloat r = vadd_vf_vf_vf(vf2getx_vf_vf2(y), vf2gety_vf_vf2(y)); + vopmask o; + + o = vor_vo_vo_vo(visinf_vo_vf(a), + vor_vo_vo_vo(vand_vo_vo_vo(vle_vo_vf_vf(a, vcast_vf_f(0)), visint_vo_vf(a)), + vand_vo_vo_vo(visnumber_vo_vf(a), visnan_vo_vf(r)))); + r = vsel_vf_vo_vf_vf(o, vcast_vf_f(SLEEF_INFINITYf), r); + + return r; +} + +static INLINE CONST vfloat2 dfmla_vf2_vf_vf2_vf2(vfloat x, vfloat2 y, vfloat2 z) { + return dfadd_vf2_vf2_vf2(z, dfmul_vf2_vf2_vf(y, x)); +} + +static INLINE CONST vfloat2 poly2df_b(vfloat x, vfloat2 c1, vfloat2 c0) { return dfmla_vf2_vf_vf2_vf2(x, c1, c0); } +static INLINE CONST vfloat2 poly2df(vfloat x, vfloat c1, vfloat2 c0) { return dfmla_vf2_vf_vf2_vf2(x, vcast_vf2_vf_vf(c1, vcast_vf_f(0)), c0); } +static INLINE CONST vfloat2 poly4df(vfloat x, vfloat c3, vfloat2 c2, vfloat2 c1, vfloat2 c0) { + return dfmla_vf2_vf_vf2_vf2(vmul_vf_vf_vf(x, x), poly2df(x, c3, c2), poly2df_b(x, c1, c0)); +} + +EXPORT CONST VECTOR_CC vfloat xerff_u1(vfloat a) { + vfloat t, x = vabs_vf_vf(a); + vfloat2 t2; + vfloat x2 = vmul_vf_vf_vf(x, x), x4 = vmul_vf_vf_vf(x2, x2); + vopmask o25 = vle_vo_vf_vf(x, vcast_vf_f(2.5)); + + if (LIKELY(vtestallones_i_vo32(o25))) { + // Abramowitz and Stegun + t = POLY6(x, x2, x4, + -0.4360447008e-6, + +0.6867515367e-5, + -0.3045156700e-4, + +0.9808536561e-4, + +0.2395523916e-3, + +0.1459901541e-3); + t2 = poly4df(x, t, + vcast_vf2_f_f(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f(0.070523701608180999756, -3.6616309318707365163e-09)); + t2 = dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf(t2, x)); + t2 = dfsqu_vf2_vf2(t2); + t2 = dfsqu_vf2_vf2(t2); + t2 = dfsqu_vf2_vf2(t2); + t2 = dfsqu_vf2_vf2(t2); + t2 = dfrec_vf2_vf2(t2); + } else { +#undef C2V +#define C2V(c) (c) + t = POLY6(x, x2, x4, + vsel_vf_vo_f_f(o25, -0.4360447008e-6, -0.1130012848e-6), + vsel_vf_vo_f_f(o25, +0.6867515367e-5, +0.4115272986e-5), + vsel_vf_vo_f_f(o25, -0.3045156700e-4, -0.6928304356e-4), + vsel_vf_vo_f_f(o25, +0.9808536561e-4, +0.7172692567e-3), + vsel_vf_vo_f_f(o25, +0.2395523916e-3, -0.5131045356e-2), + vsel_vf_vo_f_f(o25, +0.1459901541e-3, +0.2708637156e-1)); + t2 = poly4df(x, t, + vsel_vf2_vo_vf2_vf2(o25, vcast_vf2_f_f(0.0092883445322513580322, -2.7863745897025330755e-11), + vcast_vf2_f_f(-0.11064319312572479248, 3.7050452777225283007e-09)), + vsel_vf2_vo_vf2_vf2(o25, vcast_vf2_f_f(0.042275499552488327026, 1.3461399289988106057e-09), + vcast_vf2_f_f(-0.63192230463027954102, -2.0200432585073177859e-08)), + vsel_vf2_vo_vf2_vf2(o25, vcast_vf2_f_f(0.070523701608180999756, -3.6616309318707365163e-09), + vcast_vf2_f_f(-1.1296638250350952148, 2.5515120196453259252e-08))); + t2 = dfmul_vf2_vf2_vf(t2, x); + vfloat2 s2 = dfadd_vf2_vf_vf2(vcast_vf_f(1), t2); + s2 = dfsqu_vf2_vf2(s2); + s2 = dfsqu_vf2_vf2(s2); + s2 = dfsqu_vf2_vf2(s2); + s2 = dfsqu_vf2_vf2(s2); + s2 = dfrec_vf2_vf2(s2); + t2 = vsel_vf2_vo_vf2_vf2(o25, s2, vcast_vf2_vf_vf(expkf(t2), vcast_vf_f(0))); + } + + t2 = dfadd2_vf2_vf2_vf(t2, vcast_vf_f(-1)); + t2 = vsel_vf2_vo_vf2_vf2(vlt_vo_vf_vf(x, vcast_vf_f(1e-4)), dfmul_vf2_vf2_vf(vcast_vf2_f_f(-1.1283792257308959961, 5.8635383422197591097e-08), x), t2); + + vfloat z = vneg_vf_vf(vadd_vf_vf_vf(vf2getx_vf_vf2(t2), vf2gety_vf_vf2(t2))); + z = vsel_vf_vo_vf_vf(vge_vo_vf_vf(x, vcast_vf_f(6)), vcast_vf_f(1), z); + z = vsel_vf_vo_vf_vf(visinf_vo_vf(a), vcast_vf_f(1), z); + z = vsel_vf_vo_vf_vf(veq_vo_vf_vf(a, vcast_vf_f(0)), vcast_vf_f(0), z); + z = vmulsign_vf_vf_vf(z, a); + + return z; +} + +/* TODO AArch64: potential optimization by using `vfmad_lane_f64` */ +EXPORT CONST VECTOR_CC vfloat xerfcf_u15(vfloat a) { + vfloat s = a, r = vcast_vf_f(0), t; + vfloat2 u, d, x; + a = vabs_vf_vf(a); + vopmask o0 = vlt_vo_vf_vf(a, vcast_vf_f(1.0)); + vopmask o1 = vlt_vo_vf_vf(a, vcast_vf_f(2.2)); + vopmask o2 = vlt_vo_vf_vf(a, vcast_vf_f(4.3)); + vopmask o3 = vlt_vo_vf_vf(a, vcast_vf_f(10.1)); + + u = vsel_vf2_vo_vf2_vf2(o1, vcast_vf2_vf_vf(a, vcast_vf_f(0)), dfdiv_vf2_vf2_vf2(vcast_vf2_f_f(1, 0), vcast_vf2_vf_vf(a, vcast_vf_f(0)))); + + t = vsel_vf_vo_vo_vo_f_f_f_f(o0, o1, o2, -0.8638041618e-4f, -0.6236977242e-5f, -0.3869504035e+0f, +0.1115344167e+1f); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(u), vsel_vf_vo_vo_vo_f_f_f_f(o0, o1, o2, +0.6000166177e-3f, +0.5749821503e-4f, +0.1288077235e+1f, -0.9454904199e+0f)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(u), vsel_vf_vo_vo_vo_f_f_f_f(o0, o1, o2, -0.1665703603e-2f, +0.6002851478e-5f, -0.1816803217e+1f, -0.3667259514e+0f)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(u), vsel_vf_vo_vo_vo_f_f_f_f(o0, o1, o2, +0.1795156277e-3f, -0.2851036377e-2f, +0.1249150872e+1f, +0.7155663371e+0f)); + t = vmla_vf_vf_vf_vf(t, vf2getx_vf_vf2(u), vsel_vf_vo_vo_vo_f_f_f_f(o0, o1, o2, +0.1914106123e-1f, +0.2260518074e-1f, -0.1328857988e+0f, -0.1262947265e-1f)); + + d = dfmul_vf2_vf2_vf(u, t); + d = dfadd2_vf2_vf2_vf2(d, vsel_vf2_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.102775359343930288081655368891e+0, -0.105247583459338632253369014063e+0, -0.482365310333045318680618892669e+0, -0.498961546254537647970305302739e+0)); + d = dfmul_vf2_vf2_vf2(d, u); + d = dfadd2_vf2_vf2_vf2(d, vsel_vf2_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.636619483208481931303752546439e+0, -0.635609463574589034216723775292e+0, -0.134450203224533979217859332703e-2, -0.471199543422848492080722832666e-4)); + d = dfmul_vf2_vf2_vf2(d, u); + d = dfadd2_vf2_vf2_vf2(d, vsel_vf2_vo_vo_vo_d_d_d_d(o0, o1, o2, -0.112837917790537404939545770596e+1, -0.112855987376668622084547028949e+1, -0.572319781150472949561786101080e+0, -0.572364030327966044425932623525e+0)); + + x = dfmul_vf2_vf2_vf(vsel_vf2_vo_vf2_vf2(o1, d, vcast_vf2_vf_vf(vneg_vf_vf(a), vcast_vf_f(0))), a); + x = vsel_vf2_vo_vf2_vf2(o1, x, dfadd2_vf2_vf2_vf2(x, d)); + + x = expk2f(x); + x = vsel_vf2_vo_vf2_vf2(o1, x, dfmul_vf2_vf2_vf2(x, u)); + + r = vsel_vf_vo_vf_vf(o3, vadd_vf_vf_vf(vf2getx_vf_vf2(x), vf2gety_vf_vf2(x)), vcast_vf_f(0)); + r = vsel_vf_vo_vf_vf(vsignbit_vo_vf(s), vsub_vf_vf_vf(vcast_vf_f(2), r), r); + r = vsel_vf_vo_vf_vf(visnan_vo_vf(s), vcast_vf_f(SLEEF_NANf), r); + return r; +} +#endif // #if !defined(DETERMINISTIC) + +#if !defined(DETERMINISTIC) && !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) +// See sleefsimddp.c for explanation of these macros + +#ifdef ENABLE_ALIAS +#define DALIAS_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vf2_vf(FUNC) EXPORT CONST VECTOR_CC vfloat2 y ## FUNC(vfloat) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vf_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat, vfloat) __attribute__((alias( stringify(x ## FUNC) ))); +#define DALIAS_vf_vf_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat, vfloat, vfloat) __attribute__((alias( stringify(x ## FUNC) ))); +#else +#define DALIAS_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat d) { return x ## FUNC (d); } +#define DALIAS_vf2_vf(FUNC) EXPORT CONST VECTOR_CC vfloat2 y ## FUNC(vfloat d) { return x ## FUNC (d); } +#define DALIAS_vf_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat x, vfloat y) { return x ## FUNC (x, y); } +#define DALIAS_vf_vf_vf_vf(FUNC) EXPORT CONST VECTOR_CC vfloat y ## FUNC(vfloat x, vfloat y, vfloat z) { return x ## FUNC (x, y, z); } +#endif + +DALIAS_vf2_vf(sincospif_u05) +DALIAS_vf2_vf(sincospif_u35) +DALIAS_vf2_vf(modff) +DALIAS_vf_vf(atanf) +DALIAS_vf_vf_vf(atan2f) +DALIAS_vf_vf(asinf) +DALIAS_vf_vf(acosf) +DALIAS_vf_vf_vf(atan2f_u1) +DALIAS_vf_vf(asinf_u1) +DALIAS_vf_vf(acosf_u1) +DALIAS_vf_vf(atanf_u1) +DALIAS_vf_vf(logf) +DALIAS_vf_vf(expf) +DALIAS_vf_vf(cbrtf) +DALIAS_vf_vf(cbrtf_u1) +DALIAS_vf_vf(logf_u1) +DALIAS_vf_vf_vf(powf) +DALIAS_vf_vf(sinhf) +DALIAS_vf_vf(coshf) +DALIAS_vf_vf(tanhf) +DALIAS_vf_vf(sinhf_u35) +DALIAS_vf_vf(coshf_u35) +DALIAS_vf_vf(tanhf_u35) +DALIAS_vf_vf(asinhf) +DALIAS_vf_vf(acoshf) +DALIAS_vf_vf(atanhf) +DALIAS_vf_vf(exp2f) +DALIAS_vf_vf(exp2f_u35) +DALIAS_vf_vf(exp10f) +DALIAS_vf_vf(exp10f_u35) +DALIAS_vf_vf(expm1f) +DALIAS_vf_vf(log10f) +DALIAS_vf_vf(log2f) +DALIAS_vf_vf(log2f_u35) +DALIAS_vf_vf(log1pf) +DALIAS_vf_vf(fabsf) +DALIAS_vf_vf_vf(copysignf) +DALIAS_vf_vf_vf(fmaxf) +DALIAS_vf_vf_vf(fminf) +DALIAS_vf_vf_vf(fdimf) +DALIAS_vf_vf(truncf) +DALIAS_vf_vf(floorf) +DALIAS_vf_vf(ceilf) +DALIAS_vf_vf(roundf) +DALIAS_vf_vf(rintf) +DALIAS_vf_vf_vf_vf(fmaf) +DALIAS_vf_vf_vf(hypotf_u05) +DALIAS_vf_vf_vf(hypotf_u35) +DALIAS_vf_vf_vf(nextafterf) +DALIAS_vf_vf(frfrexpf) +DALIAS_vf_vf_vf(fmodf) +DALIAS_vf_vf_vf(remainderf) +DALIAS_vf_vf(sinpif_u05) +DALIAS_vf_vf(cospif_u05) +DALIAS_vf_vf(tgammaf_u1) +DALIAS_vf_vf(lgammaf_u1) +DALIAS_vf_vf(erff_u1) +DALIAS_vf_vf(erfcf_u15) +DALIAS_vf_vf_vf(fastpowf_u3500) +#endif // #if !defined(DETERMINISTIC) && !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) + +#if !defined(ENABLE_GNUABI) && !defined(SLEEF_GENHEADER) +EXPORT CONST int xgetIntf(int name) { + if (1 <= name && name <= 10) return vavailability_i(name); + return 0; +} + +EXPORT CONST void *xgetPtrf(int name) { + if (name == 0) return ISANAME; + return (void *)0; +} +#endif + +#if defined(ALIAS_NO_EXT_SUFFIX) && !defined(DETERMINISTIC) +#include ALIAS_NO_EXT_SUFFIX +#endif + +#ifdef ENABLE_GNUABI +EXPORT CONST VECTOR_CC vfloat __acosf_finite (vfloat) __attribute__((weak, alias(str_xacosf_u1 ))); +EXPORT CONST VECTOR_CC vfloat __acoshf_finite (vfloat) __attribute__((weak, alias(str_xacoshf ))); +EXPORT CONST VECTOR_CC vfloat __asinf_finite (vfloat) __attribute__((weak, alias(str_xasinf_u1 ))); +EXPORT CONST VECTOR_CC vfloat __atan2f_finite (vfloat, vfloat) __attribute__((weak, alias(str_xatan2f_u1 ))); +EXPORT CONST VECTOR_CC vfloat __atanhf_finite (vfloat) __attribute__((weak, alias(str_xatanhf ))); +EXPORT CONST VECTOR_CC vfloat __coshf_finite (vfloat) __attribute__((weak, alias(str_xcoshf ))); +EXPORT CONST VECTOR_CC vfloat __exp10f_finite (vfloat) __attribute__((weak, alias(str_xexp10f ))); +EXPORT CONST VECTOR_CC vfloat __exp2f_finite (vfloat) __attribute__((weak, alias(str_xexp2f ))); +EXPORT CONST VECTOR_CC vfloat __expf_finite (vfloat) __attribute__((weak, alias(str_xexpf ))); +EXPORT CONST VECTOR_CC vfloat __fmodf_finite (vfloat, vfloat) __attribute__((weak, alias(str_xfmodf ))); +EXPORT CONST VECTOR_CC vfloat __remainderf_finite(vfloat, vfloat) __attribute__((weak, alias(str_xremainderf))); +EXPORT CONST VECTOR_CC vfloat __modff_finite (vfloat, vfloat *) __attribute__((weak, alias(str_xmodff ))); +EXPORT CONST VECTOR_CC vfloat __hypotf_u05_finite(vfloat, vfloat) __attribute__((weak, alias(str_xhypotf_u05))); +EXPORT CONST VECTOR_CC vfloat __lgammaf_u1_finite(vfloat) __attribute__((weak, alias(str_xlgammaf_u1))); +EXPORT CONST VECTOR_CC vfloat __log10f_finite (vfloat) __attribute__((weak, alias(str_xlog10f ))); +EXPORT CONST VECTOR_CC vfloat __logf_finite (vfloat) __attribute__((weak, alias(str_xlogf_u1 ))); +EXPORT CONST VECTOR_CC vfloat __powf_finite (vfloat, vfloat) __attribute__((weak, alias(str_xpowf ))); +EXPORT CONST VECTOR_CC vfloat __sinhf_finite (vfloat) __attribute__((weak, alias(str_xsinhf ))); +EXPORT CONST VECTOR_CC vfloat __sqrtf_finite (vfloat) __attribute__((weak, alias(str_xsqrtf ))); +EXPORT CONST VECTOR_CC vfloat __tgammaf_u1_finite(vfloat) __attribute__((weak, alias(str_xtgammaf_u1))); + +#ifdef HEADER_MASKED +#include HEADER_MASKED +#endif +#endif /* #ifdef ENABLE_GNUABI */ + +#ifdef ENABLE_MAIN +// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimdsp.c rempitab.c ../common/common.c -lm +#include +#include +#include +int main(int argc, char **argv) { + vfloat vf1 = vcast_vf_f(atof(argv[1])); + //vfloat vf2 = vcast_vf_f(atof(argv[2])); + + //vfloat r = xpowf(vf1, vf2); + //vfloat r = xsqrtf_u05(vf1); + //printf("%g\n", xnextafterf(vf1, vf2)[0]); + //printf("%g\n", nextafterf(atof(argv[1]), atof(argv[2]))); + printf("t = %.20g\n", xerff_u1(vf1)[0]); + printf("c = %.20g\n", erff(atof(argv[1]))); + +} +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsp.c new file mode 100644 index 0000000000000..7d3370c0b02fc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/sleefsp.c @@ -0,0 +1,2436 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#include +#include +#include +#include +#include + +#ifndef ENABLE_BUILTIN_MATH +#include +#define SQRTF sqrtf +#else +#define SQRTF __builtin_sqrtf +#endif + +#include "misc.h" + +extern const float Sleef_rempitabsp[]; + +#ifdef DORENAME +#include "rename.h" +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#define MLA mlaf +#define C2V(x) (x) +#include "estrin.h" + +static INLINE CONST int32_t floatToRawIntBits(float d) { + int32_t ret; + memcpy(&ret, &d, sizeof(ret)); + return ret; +} + +static INLINE CONST float intBitsToFloat(int32_t i) { + float ret; + memcpy(&ret, &i, sizeof(ret)); + return ret; +} + +static INLINE CONST float fabsfk(float x) { + return intBitsToFloat(0x7fffffffL & floatToRawIntBits(x)); +} + +static INLINE CONST float mulsignf(float x, float y) { + return intBitsToFloat(floatToRawIntBits(x) ^ (floatToRawIntBits(y) & (1 << 31))); +} + +static INLINE CONST float copysignfk(float x, float y) { + return intBitsToFloat((floatToRawIntBits(x) & ~(1 << 31)) ^ (floatToRawIntBits(y) & (1 << 31))); +} + +static INLINE CONST float signf(float d) { return mulsignf(1, d); } +static INLINE CONST float mlaf(float x, float y, float z) { return x * y + z; } +static INLINE CONST float rintfk(float x) { return x < 0 ? (int)(x - 0.5f) : (int)(x + 0.5f); } +static INLINE CONST int ceilfk(float x) { return (int)x + (x < 0 ? 0 : 1); } +static INLINE CONST float fminfk(float x, float y) { return x < y ? x : y; } +static INLINE CONST float fmaxfk(float x, float y) { return x > y ? x : y; } +static INLINE CONST int xisintf(float x) { return (x == (int)x); } + +static INLINE CONST int xsignbitf(double d) { return (floatToRawIntBits(d) & floatToRawIntBits(-0.0)) == floatToRawIntBits(-0.0); } +static INLINE CONST int xisnanf(float x) { return x != x; } +static INLINE CONST int xisinff(float x) { return x == SLEEF_INFINITYf || x == -SLEEF_INFINITYf; } +static INLINE CONST int xisminff(float x) { return x == -SLEEF_INFINITYf; } +static INLINE CONST int xispinff(float x) { return x == SLEEF_INFINITYf; } +static INLINE CONST int xisnegzerof(float x) { return floatToRawIntBits(x) == floatToRawIntBits(-0.0); } +static INLINE CONST int xisnumberf(float x) { return !xisinff(x) && !xisnanf(x); } + +static INLINE CONST int ilogbkf(float d) { + int m = d < 5.421010862427522E-20f; + d = m ? 1.8446744073709552E19f * d : d; + int q = (floatToRawIntBits(d) >> 23) & 0xff; + q = m ? q - (64 + 0x7f) : q - 0x7f; + return q; +} + +// vilogb2kf is similar to ilogbkf, but the argument has to be a +// normalized FP value. +static INLINE CONST int ilogb2kf(float d) { + return ((floatToRawIntBits(d) >> 23) & 0xff) - 0x7f; +} + +EXPORT CONST int xilogbf(float d) { + int e = ilogbkf(fabsfk(d)); + e = d == 0.0f ? SLEEF_FP_ILOGB0 : e; + e = xisnanf(d) ? SLEEF_FP_ILOGBNAN : e; + e = xisinff(d) ? INT_MAX : e; + return e; +} + +static INLINE CONST float pow2if(int q) { + return intBitsToFloat(((int32_t)(q + 0x7f)) << 23); +} + +static INLINE CONST float ldexpkf(float x, int q) { + float u; + int m; + m = q >> 31; + m = (((m + q) >> 6) - m) << 4; + q = q - (m << 2); + m += 127; + m = m < 0 ? 0 : m; + m = m > 255 ? 255 : m; + u = intBitsToFloat(((int32_t)m) << 23); + x = x * u * u * u * u; + u = intBitsToFloat(((int32_t)(q + 0x7f)) << 23); + return x * u; +} + +static INLINE CONST float ldexp2kf(float d, int e) { // faster than ldexpkf, short reach + return d * pow2if(e >> 1) * pow2if(e - (e >> 1)); +} + +static INLINE CONST float ldexp3kf(float d, int e) { // very fast, no denormal + return intBitsToFloat(floatToRawIntBits(d) + (e << 23)); +} + +// + +#ifndef NDEBUG +static int checkfp(float x) { + if (xisinff(x) || xisnanf(x)) return 1; + return 0; +} +#endif + +static INLINE CONST float upperf(float d) { + return intBitsToFloat(floatToRawIntBits(d) & 0xfffff000); +} + +static INLINE CONST Sleef_float2 df(float h, float l) { + Sleef_float2 ret; + ret.x = h; ret.y = l; + return ret; +} + +static INLINE CONST Sleef_float2 dfx(double d) { + Sleef_float2 ret; + ret.x = d; ret.y = d - ret.x; + return ret; +} + +static INLINE CONST Sleef_float2 dfnormalize_f2_f2(Sleef_float2 t) { + Sleef_float2 s; + + s.x = t.x + t.y; + s.y = t.x - s.x + t.y; + + return s; +} + +static INLINE CONST Sleef_float2 dfscale_f2_f2_f(Sleef_float2 d, float s) { + Sleef_float2 r; + + r.x = d.x * s; + r.y = d.y * s; + + return r; +} + +static INLINE CONST Sleef_float2 dfneg_f2_f2(Sleef_float2 d) { + Sleef_float2 r; + + r.x = -d.x; + r.y = -d.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfabs_f2_f2(Sleef_float2 x) { + return df(x.x < 0 ? -x.x : x.x, x.x < 0 ? -x.y : x.y); +} + +static INLINE CONST Sleef_float2 dfadd_f2_f_f(float x, float y) { + // |x| >= |y| + + Sleef_float2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y) || fabsfk(x) >= fabsfk(y))) fprintf(stderr, "[dfadd_f2_f_f : %g, %g]", x, y); +#endif + + r.x = x + y; + r.y = x - r.x + y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd2_f2_f_f(float x, float y) { + Sleef_float2 r; + + r.x = x + y; + float v = r.x - x; + r.y = (x - (r.x - v)) + (y - v); + + return r; +} + +static INLINE CONST Sleef_float2 dfadd_f2_f2_f(Sleef_float2 x, float y) { + // |x| >= |y| + + Sleef_float2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y) || fabsfk(x.x) >= fabsfk(y))) fprintf(stderr, "[dfadd_f2_f2_f : %g %g]", x.x, y); +#endif + + r.x = x.x + y; + r.y = x.x - r.x + y + x.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd_f2_f_f2(float x, Sleef_float2 y) { + // |x| >= |y| + + Sleef_float2 r; + +#ifndef NDEBUG + if (!(checkfp(x) || checkfp(y.x) || fabsfk(x) >= fabsfk(y.x))) { + fprintf(stderr, "[dfadd_f2_f_f2 : %g %g]\n", x, y.x); + fflush(stderr); + } +#endif + + r.x = x + y.x; + r.y = x - r.x + y.x + y.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd2_f2_f2_f(Sleef_float2 x, float y) { + // |x| >= |y| + + Sleef_float2 r; + + r.x = x.x + y; + float v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y - v); + r.y += x.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd2_f2_f_f2(float x, Sleef_float2 y) { + Sleef_float2 r; + + r.x = x + y.x; + float v = r.x - x; + r.y = (x - (r.x - v)) + (y.x - v) + y.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd_f2_f2_f2(Sleef_float2 x, Sleef_float2 y) { + // |x| >= |y| + + Sleef_float2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || fabsfk(x.x) >= fabsfk(y.x))) fprintf(stderr, "[dfadd_f2_f2_f2 : %g %g]", x.x, y.x); +#endif + + r.x = x.x + y.x; + r.y = x.x - r.x + y.x + x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfadd2_f2_f2_f2(Sleef_float2 x, Sleef_float2 y) { + Sleef_float2 r; + + r.x = x.x + y.x; + float v = r.x - x.x; + r.y = (x.x - (r.x - v)) + (y.x - v); + r.y += x.y + y.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfsub_f2_f2_f2(Sleef_float2 x, Sleef_float2 y) { + // |x| >= |y| + + Sleef_float2 r; + +#ifndef NDEBUG + if (!(checkfp(x.x) || checkfp(y.x) || fabsfk(x.x) >= fabsfk(y.x))) fprintf(stderr, "[dfsub_f2_f2_f2 : %g %g]", x.x, y.x); +#endif + + r.x = x.x - y.x; + r.y = x.x - r.x - y.x + x.y - y.y; + + return r; +} + +static INLINE CONST Sleef_float2 dfdiv_f2_f2_f2(Sleef_float2 n, Sleef_float2 d) { + float t = 1.0f / d.x; + float dh = upperf(d.x), dl = d.x - dh; + float th = upperf(t ), tl = t - th; + float nhh = upperf(n.x), nhl = n.x - nhh; + + Sleef_float2 q; + + q.x = n.x * t; + + float u = -q.x + nhh * th + nhh * tl + nhl * th + nhl * tl + + q.x * (1 - dh * th - dh * tl - dl * th - dl * tl); + + q.y = t * (n.y - q.x * d.y) + u; + + return q; +} + +static INLINE CONST Sleef_float2 dfmul_f2_f_f(float x, float y) { + float xh = upperf(x), xl = x - xh; + float yh = upperf(y), yl = y - yh; + Sleef_float2 r; + + r.x = x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl; + + return r; +} + +static INLINE CONST Sleef_float2 dfmul_f2_f2_f(Sleef_float2 x, float y) { + float xh = upperf(x.x), xl = x.x - xh; + float yh = upperf(y ), yl = y - yh; + Sleef_float2 r; + + r.x = x.x * y; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.y * y; + + return r; +} + +static INLINE CONST Sleef_float2 dfmul_f2_f2_f2(Sleef_float2 x, Sleef_float2 y) { + float xh = upperf(x.x), xl = x.x - xh; + float yh = upperf(y.x), yl = y.x - yh; + Sleef_float2 r; + + r.x = x.x * y.x; + r.y = xh * yh - r.x + xl * yh + xh * yl + xl * yl + x.x * y.y + x.y * y.x; + + return r; +} + +static INLINE CONST float dfmul_f_f2_f2(Sleef_float2 x, Sleef_float2 y) { + float xh = upperf(x.x), xl = x.x - xh; + float yh = upperf(y.x), yl = y.x - yh; + + return x.y * yh + xh * y.y + xl * yl + xh * yl + xl * yh + xh * yh; +} + +static INLINE CONST Sleef_float2 dfsqu_f2_f2(Sleef_float2 x) { + float xh = upperf(x.x), xl = x.x - xh; + Sleef_float2 r; + + r.x = x.x * x.x; + r.y = xh * xh - r.x + (xh + xh) * xl + xl * xl + x.x * (x.y + x.y); + + return r; +} + +static INLINE CONST float dfsqu_f_f2(Sleef_float2 x) { + float xh = upperf(x.x), xl = x.x - xh; + + return xh * x.y + xh * x.y + xl * xl + (xh * xl + xh * xl) + xh * xh; +} + +static INLINE CONST Sleef_float2 dfrec_f2_f(float d) { + float t = 1.0f / d; + float dh = upperf(d), dl = d - dh; + float th = upperf(t), tl = t - th; + Sleef_float2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl); + + return q; +} + +static INLINE CONST Sleef_float2 dfrec_f2_f2(Sleef_float2 d) { + float t = 1.0f / d.x; + float dh = upperf(d.x), dl = d.x - dh; + float th = upperf(t ), tl = t - th; + Sleef_float2 q; + + q.x = t; + q.y = t * (1 - dh * th - dh * tl - dl * th - dl * tl - d.y * t); + + return q; +} + +static INLINE CONST Sleef_float2 dfsqrt_f2_f2(Sleef_float2 d) { + float t = SQRTF(d.x + d.y); + return dfscale_f2_f2_f(dfmul_f2_f2_f2(dfadd2_f2_f2_f2(d, dfmul_f2_f_f(t, t)), dfrec_f2_f(t)), 0.5f); +} + +static INLINE CONST Sleef_float2 dfsqrt_f2_f(float d) { + float t = SQRTF(d); + return dfscale_f2_f2_f(dfmul_f2_f2_f2(dfadd2_f2_f_f2(d, dfmul_f2_f_f(t, t)), dfrec_f2_f(t)), 0.5); +} + +// + +typedef struct { + float d; + int32_t i; +} fi_t; + +typedef struct { + Sleef_float2 df; + int32_t i; +} dfi_t; + +static CONST fi_t rempisubf(float x) { + fi_t ret; + float fr = x - (float)(INT64_C(1) << 10) * (int32_t)(x * (1.0f / (INT64_C(1) << 10))); + ret.i = ((7 & ((x > 0 ? 4 : 3) + (int32_t)(fr * 8))) - 3) >> 1; + fr = fr - 0.25f * (int32_t)(fr * 4 + mulsignf(0.5f, x)); + fr = fabsfk(fr) > 0.125f ? (fr - mulsignf(0.5f, x)) : fr; + fr = fabsfk(fr) > 1e+10f ? 0 : fr; + if (fabsfk(x) == 0.12499999254941940308f) { fr = x; ret.i = 0; } + ret.d = fr; + return ret; +} + +static CONST dfi_t rempif(float a) { + Sleef_float2 x, y; + fi_t di; + int ex = ilogb2kf(a) - 25, q = ex > (90 - 25) ? -64 : 0; + a = ldexp3kf(a, q); + if (ex < 0) ex = 0; + ex *= 4; + x = dfmul_f2_f_f(a, Sleef_rempitabsp[ex]); + di = rempisubf(x.x); + q = di.i; + x.x = di.d; + x = dfnormalize_f2_f2(x); + y = dfmul_f2_f_f(a, Sleef_rempitabsp[ex+1]); + x = dfadd2_f2_f2_f2(x, y); + di = rempisubf(x.x); + q += di.i; + x.x = di.d; + x = dfnormalize_f2_f2(x); + y = dfmul_f2_f2_f(df(Sleef_rempitabsp[ex+2], Sleef_rempitabsp[ex+3]), a); + x = dfadd2_f2_f2_f2(x, y); + x = dfnormalize_f2_f2(x); + x = dfmul_f2_f2_f2(x, df(3.1415927410125732422f*2, -8.7422776573475857731e-08f*2)); + dfi_t ret = { fabsfk(a) < 0.7f ? df(a, 0) : x, q }; + return ret; +} + +EXPORT CONST float xsinf(float d) { + int q; + float u, s, t = d; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = (int)rintfk(d * (float)M_1_PI); + d = mlaf(q, -PI_A2f, d); + d = mlaf(q, -PI_B2f, d); + d = mlaf(q, -PI_C2f, d); + } else if (fabsfk(d) < TRIGRANGEMAXf) { + q = (int)rintfk(d * (float)M_1_PI); + d = mlaf(q, -PI_Af, d); + d = mlaf(q, -PI_Bf, d); + d = mlaf(q, -PI_Cf, d); + d = mlaf(q, -PI_Df, d); + } else { + dfi_t dfi = rempif(t); + q = ((dfi.i & 3) * 2 + (dfi.df.x > 0) + 1) >> 2; + if ((dfi.i & 1) != 0) { + dfi.df = dfadd2_f2_f2_f2(dfi.df, df(mulsignf(3.1415927410125732422f*-0.5, dfi.df.x), + mulsignf(-8.7422776573475857731e-08f*-0.5, dfi.df.x))); + } + d = dfi.df.x + dfi.df.y; + if (xisinff(t) || xisnanf(t)) d = SLEEF_NANf; + } + + s = d * d; + + if ((q & 1) != 0) d = -d; + + u = 2.6083159809786593541503e-06f; + u = mlaf(u, s, -0.0001981069071916863322258f); + u = mlaf(u, s, 0.00833307858556509017944336f); + u = mlaf(u, s, -0.166666597127914428710938f); + + u = mlaf(s, u * d, d); + + if (xisnegzerof(t)) u = -0.0f; + + return u; +} + +EXPORT CONST float xsinf_u1(float d) { + int q; + float u; + Sleef_float2 s, t, x; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = (int)rintfk(d * (float)M_1_PI); + u = mlaf(q, -PI_A2f, d); + s = dfadd2_f2_f_f(u, q * (-PI_B2f)); + s = dfadd_f2_f2_f(s, q * (-PI_C2f)); + } else { + dfi_t dfi = rempif(d); + q = ((dfi.i & 3) * 2 + (dfi.df.x > 0) + 1) >> 2; + if ((dfi.i & 1) != 0) { + dfi.df = dfadd2_f2_f2_f2(dfi.df, df(mulsignf(3.1415927410125732422f*-0.5, dfi.df.x), + mulsignf(-8.7422776573475857731e-08f*-0.5, dfi.df.x))); + } + s = dfnormalize_f2_f2(dfi.df); + if (xisinff(d) || xisnanf(d)) s.x = SLEEF_NANf; + } + + t = s; + s = dfsqu_f2_f2(s); + + u = 2.6083159809786593541503e-06f; + u = mlaf(u, s.x, -0.0001981069071916863322258f); + u = mlaf(u, s.x, 0.00833307858556509017944336f); + + x = dfadd_f2_f_f2(1, dfmul_f2_f2_f2(dfadd_f2_f_f(-0.166666597127914428710938f, u * s.x), s)); + + u = dfmul_f_f2_f2(t, x); + + if ((q & 1) != 0) u = -u; + if (xisnegzerof(d)) u = d; + + return u; +} + +EXPORT CONST float xcosf(float d) { + int q; + float u, s, t = d; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = 1 + 2*(int)rintfk(d * (float)M_1_PI - 0.5f); + d = mlaf(q, -PI_A2f*0.5f, d); + d = mlaf(q, -PI_B2f*0.5f, d); + d = mlaf(q, -PI_C2f*0.5f, d); + } else if (fabsfk(d) < TRIGRANGEMAXf) { + q = 1 + 2*(int)rintfk(d * (float)M_1_PI - 0.5f); + d = mlaf(q, -PI_Af*0.5f, d); + d = mlaf(q, -PI_Bf*0.5f, d); + d = mlaf(q, -PI_Cf*0.5f, d); + d = mlaf(q, -PI_Df*0.5f, d); + } else { + dfi_t dfi = rempif(t); + q = ((dfi.i & 3) * 2 + (dfi.df.x > 0) + 7) >> 1; + if ((dfi.i & 1) == 0) { + dfi.df = dfadd2_f2_f2_f2(dfi.df, df(mulsignf(3.1415927410125732422f*-0.5, dfi.df.x > 0 ? 1 : -1), + mulsignf(-8.7422776573475857731e-08f*-0.5, dfi.df.x > 0 ? 1 : -1))); + } + d = dfi.df.x + dfi.df.y; + if (xisinff(t) || xisnanf(t)) d = SLEEF_NANf; + } + + s = d * d; + + if ((q & 2) == 0) d = -d; + + u = 2.6083159809786593541503e-06f; + u = mlaf(u, s, -0.0001981069071916863322258f); + u = mlaf(u, s, 0.00833307858556509017944336f); + u = mlaf(u, s, -0.166666597127914428710938f); + + u = mlaf(s, u * d, d); + + return u; +} + +EXPORT CONST float xcosf_u1(float d) { + float u; + Sleef_float2 s, t, x; + int q; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + d = fabsfk(d); + float dq = mlaf(rintfk(d * (float)M_1_PI - 0.5f), 2, 1); + q = (int)dq; + s = dfadd2_f2_f_f (d, dq * (-PI_A2f*0.5f)); + s = dfadd2_f2_f2_f(s, dq * (-PI_B2f*0.5f)); + s = dfadd2_f2_f2_f(s, dq * (-PI_C2f*0.5f)); + } else { + dfi_t dfi = rempif(d); + q = ((dfi.i & 3) * 2 + (dfi.df.x > 0) + 7) >> 1; + if ((dfi.i & 1) == 0) { + dfi.df = dfadd2_f2_f2_f2(dfi.df, df(mulsignf(3.1415927410125732422f*-0.5, dfi.df.x > 0 ? 1 : -1), + mulsignf(-8.7422776573475857731e-08f*-0.5, dfi.df.x > 0 ? 1 : -1))); + } + s = dfnormalize_f2_f2(dfi.df); + if (xisinff(d) || xisnanf(d)) s.x = SLEEF_NANf; + } + + t = s; + s = dfsqu_f2_f2(s); + + u = 2.6083159809786593541503e-06f; + u = mlaf(u, s.x, -0.0001981069071916863322258f); + u = mlaf(u, s.x, 0.00833307858556509017944336f); + + x = dfadd_f2_f_f2(1, dfmul_f2_f2_f2(dfadd_f2_f_f(-0.166666597127914428710938f, u * s.x), s)); + + u = dfmul_f_f2_f2(t, x); + + if ((((int)q) & 2) == 0) u = -u; + + return u; +} + +EXPORT CONST float xfastsinf_u3500(float d) { + int q; + float u, s, t = d; + + q = rintfk(d * (float)M_1_PI); + d = mlaf(q, -(float)M_PI, d); + + s = d * d; + + u = -0.1881748176e-3; + u = mlaf(u, s, +0.8323502727e-2); + u = mlaf(u, s, -0.1666651368e+0); + u = mlaf(s * d, u, d); + + if ((q & 1) != 0) u = -u; + + if (UNLIKELY(fabsfk(t) > 30.0f)) return xsinf(t); + + return u; +} + +EXPORT CONST float xfastcosf_u3500(float d) { + int q; + float u, s, t = d; + + q = rintfk(mlaf(d, (float)M_1_PI, -0.5f)); + d = mlaf(q, -(float)M_PI, d - (float)M_PI*0.5f); + + s = d * d; + + u = -0.1881748176e-3; + u = mlaf(u, s, +0.8323502727e-2); + u = mlaf(u, s, -0.1666651368e+0); + u = mlaf(s * d, u, d); + + if ((q & 1) == 0) u = -u; + + if (UNLIKELY(fabsfk(t) > 30.0f)) return xcosf(t); + + return u; +} + +EXPORT CONST Sleef_float2 xsincosf(float d) { + int q; + float u, s, t; + Sleef_float2 r; + + s = d; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = (int)rintfk(d * ((float)(2 * M_1_PI))); + s = mlaf(q, -PI_A2f*0.5f, s); + s = mlaf(q, -PI_B2f*0.5f, s); + s = mlaf(q, -PI_C2f*0.5f, s); + } else if (fabsfk(d) < TRIGRANGEMAXf) { + q = (int)rintfk(d * ((float)(2 * M_1_PI))); + s = mlaf(q, -PI_Af*0.5f, s); + s = mlaf(q, -PI_Bf*0.5f, s); + s = mlaf(q, -PI_Cf*0.5f, s); + s = mlaf(q, -PI_Df*0.5f, s); + } else { + dfi_t dfi = rempif(d); + q = dfi.i; + s = dfi.df.x + dfi.df.y; + if (xisinff(d) || xisnanf(d)) s = SLEEF_NANf; + } + + t = s; + + s = s * s; + + u = -0.000195169282960705459117889f; + u = mlaf(u, s, 0.00833215750753879547119141f); + u = mlaf(u, s, -0.166666537523269653320312f); + u = u * s * t; + + r.x = t + u; + + if (xisnegzerof(d)) r.x = -0.0f; + + u = -2.71811842367242206819355e-07f; + u = mlaf(u, s, 2.47990446951007470488548e-05f); + u = mlaf(u, s, -0.00138888787478208541870117f); + u = mlaf(u, s, 0.0416666641831398010253906f); + u = mlaf(u, s, -0.5f); + + r.y = u * s + 1; + + if ((q & 1) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 2) != 0) { r.x = -r.x; } + if (((q+1) & 2) != 0) { r.y = -r.y; } + + return r; +} + +EXPORT CONST Sleef_float2 xsincosf_u1(float d) { + int q; + float u; + Sleef_float2 r, s, t, x; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = (int)rintfk(d * (float)(2 * M_1_PI)); + u = mlaf(q, -PI_A2f*0.5f, d); + s = dfadd2_f2_f_f(u, q * (-PI_B2f*0.5f)); + s = dfadd_f2_f2_f(s, q * (-PI_C2f*0.5f)); + } else { + dfi_t dfi = rempif(d); + q = dfi.i; + s = dfi.df; + if (xisinff(d) || xisnanf(d)) s.x = SLEEF_NANf; + } + + t = s; + s.x = dfsqu_f_f2(s); + + u = -0.000195169282960705459117889f; + u = mlaf(u, s.x, 0.00833215750753879547119141f); + u = mlaf(u, s.x, -0.166666537523269653320312f); + + u *= s.x * t.x; + + x = dfadd_f2_f2_f(t, u); + r.x = x.x + x.y; + if (xisnegzerof(d)) r.x = -0.0f; + + u = -2.71811842367242206819355e-07f; + u = mlaf(u, s.x, 2.47990446951007470488548e-05f); + u = mlaf(u, s.x, -0.00138888787478208541870117f); + u = mlaf(u, s.x, 0.0416666641831398010253906f); + u = mlaf(u, s.x, -0.5f); + + x = dfadd_f2_f_f2(1, dfmul_f2_f_f(s.x, u)); + r.y = x.x + x.y; + + if ((q & 1) != 0) { u = r.y; r.y = r.x; r.x = u; } + if ((q & 2) != 0) { r.x = -r.x; } + if (((q+1) & 2) != 0) { r.y = -r.y; } + + return r; +} + +EXPORT CONST Sleef_float2 xsincospif_u05(float d) { + float u, s, t; + Sleef_float2 r, x, s2; + + u = d * 4; + int q = ceilfk(u) & ~(int)1; + + s = u - (float)q; + t = s; + s = s * s; + s2 = dfmul_f2_f_f(t, t); + + // + + u = +0.3093842054e-6; + u = mlaf(u, s, -0.3657307388e-4); + u = mlaf(u, s, +0.2490393585e-2); + x = dfadd2_f2_f_f2(u * s, df(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_f2_f2_f2(dfmul_f2_f2_f2(s2, x), df(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_f2_f2_f(x, t); + r.x = x.x + x.y; + if (xisnegzerof(d)) r.x = -0.0f; + + u = -0.2430611801e-7; + u = mlaf(u, s, +0.3590577080e-5); + u = mlaf(u, s, -0.3259917721e-3); + x = dfadd2_f2_f_f2(u * s, df(0.015854343771934509277, 4.4940051354032242811e-10)); + x = dfadd2_f2_f2_f2(dfmul_f2_f2_f2(s2, x), df(-0.30842512845993041992, -9.0728339030733922277e-09)); + + x = dfadd2_f2_f2_f(dfmul_f2_f2_f2(x, s2), 1); + r.y = x.x + x.y; + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (fabsfk(d) > 1e+7f) { r.x = 0; r.y = 1; } + if (xisinff(d)) { r.x = r.y = SLEEF_NANf; } + + return r; +} + +EXPORT CONST Sleef_float2 xsincospif_u35(float d) { + float u, s, t; + Sleef_float2 r; + + u = d * 4; + int q = ceilfk(u) & ~(int)1; + + s = u - (float)q; + t = s; + s = s * s; + + // + + u = -0.3600925265e-4; + u = mlaf(u, s, +0.2490088111e-2); + u = mlaf(u, s, -0.8074551076e-1); + u = mlaf(u, s, +0.7853981853e+0); + + r.x = u * t; + + u = +0.3539815225e-5; + u = mlaf(u, s, -0.3259574005e-3); + u = mlaf(u, s, +0.1585431583e-1); + u = mlaf(u, s, -0.3084251285e+0); + u = mlaf(u, s, 1); + + r.y = u; + + if ((q & 2) != 0) { s = r.y; r.y = r.x; r.x = s; } + if ((q & 4) != 0) { r.x = -r.x; } + if (((q+2) & 4) != 0) { r.y = -r.y; } + + if (fabsfk(d) > 1e+7f) { r.x = 0; r.y = 1; } + if (xisinff(d)) { r.x = r.y = SLEEF_NANf; } + + return r; +} + +EXPORT CONST float xtanf(float d) { + int q; + float u, s, x; + + x = d; + + if (fabsfk(d) < TRIGRANGEMAX2f*0.5f) { + q = (int)rintfk(d * (float)(2 * M_1_PI)); + x = mlaf(q, -PI_A2f*0.5f, x); + x = mlaf(q, -PI_B2f*0.5f, x); + x = mlaf(q, -PI_C2f*0.5f, x); + } else if (fabsfk(d) < TRIGRANGEMAXf) { + q = (int)rintfk(d * (float)(2 * M_1_PI)); + x = mlaf(q, -PI_Af*0.5f, x); + x = mlaf(q, -PI_Bf*0.5f, x); + x = mlaf(q, -PI_Cf*0.5f, x); + x = mlaf(q, -PI_Df*0.5f, x); + } else { + dfi_t dfi = rempif(d); + q = dfi.i; + x = dfi.df.x + dfi.df.y; + if (xisinff(d) || xisnanf(d)) x = SLEEF_NANf; + } + + s = x * x; + + if ((q & 1) != 0) x = -x; + + float s2 = s * s, s4 = s2 * s2; + u = POLY6(s, s2, s4, + 0.00927245803177356719970703f, + 0.00331984995864331722259521f, + 0.0242998078465461730957031f, + 0.0534495301544666290283203f, + 0.133383005857467651367188f, + 0.333331853151321411132812f); + + u = mlaf(s, u * x, x); + + if ((q & 1) != 0) u = 1.0f / u; + + return u; +} + +EXPORT CONST float xtanf_u1(float d) { + int q; + float u; + Sleef_float2 s, t, x; + + if (fabsfk(d) < TRIGRANGEMAX2f) { + q = (int)rintfk(d * (float)(2 * M_1_PI)); + u = mlaf(q, -PI_A2f*0.5f, d); + s = dfadd2_f2_f_f(u, q * (-PI_B2f*0.5f)); + s = dfadd_f2_f2_f(s, q * (-PI_C2f*0.5f)); + } else { + dfi_t dfi = rempif(d); + q = dfi.i; + s = dfi.df; + if (xisinff(d) || xisnanf(d)) s.x = SLEEF_NANf; + } + + if ((q & 1) != 0) s = dfneg_f2_f2(s); + + t = s; + s = dfsqu_f2_f2(s); + s = dfnormalize_f2_f2(s); + + u = 0.00446636462584137916564941f; + u = mlaf(u, s.x, -8.3920182078145444393158e-05f); + u = mlaf(u, s.x, 0.0109639242291450500488281f); + u = mlaf(u, s.x, 0.0212360303848981857299805f); + u = mlaf(u, s.x, 0.0540687143802642822265625f); + + x = dfadd_f2_f_f(0.133325666189193725585938f, u * s.x); + x = dfadd_f2_f_f2(1, dfmul_f2_f2_f2(dfadd_f2_f_f2(0.33333361148834228515625f, dfmul_f2_f2_f2(s, x)), s)); + x = dfmul_f2_f2_f2(t, x); + + if ((q & 1) != 0) x = dfrec_f2_f2(x); + + u = x.x + x.y; + + if (xisnegzerof(d)) u = -0.0f; + + return u; +} + +EXPORT CONST float xatanf(float s) { + float t, u; + int q = 0; + + if (signf(s) == -1) { s = -s; q = 2; } + if (s > 1) { s = 1.0f / s; q |= 1; } + + t = s * s; + + float t2 = t * t, t4 = t2 * t2; + u = POLY8(t, t2, t4, + 0.00282363896258175373077393f, + -0.0159569028764963150024414f, + 0.0425049886107444763183594f, + -0.0748900920152664184570312f, + 0.106347933411598205566406f, + -0.142027363181114196777344f, + 0.199926957488059997558594f, + -0.333331018686294555664062f); + + t = s + s * (t * u); + + if ((q & 1) != 0) t = 1.570796326794896557998982f - t; + if ((q & 2) != 0) t = -t; + + return t; +} + +static INLINE CONST float atan2kf(float y, float x) { + float s, t, u; + int q = 0; + + if (x < 0) { x = -x; q = -2; } + if (y > x) { t = x; x = y; y = -t; q += 1; } + + s = y / x; + t = s * s; + + float t2 = t * t, t4 = t2 * t2; + u = POLY8(t, t2, t4, + 0.00282363896258175373077393f, + -0.0159569028764963150024414f, + 0.0425049886107444763183594f, + -0.0748900920152664184570312f, + 0.106347933411598205566406f, + -0.142027363181114196777344f, + 0.199926957488059997558594f, + -0.333331018686294555664062f); + + t = u * t * s + s; + t = q * (float)(M_PI/2) + t; + + return t; +} + +EXPORT CONST float xatan2f(float y, float x) { + float r = atan2kf(fabsfk(y), x); + + r = mulsignf(r, x); + if (xisinff(x) || x == 0) r = M_PIf/2 - (xisinff(x) ? (signf(x) * (float)(M_PI /2)) : 0); + if (xisinff(y) ) r = M_PIf/2 - (xisinff(x) ? (signf(x) * (float)(M_PI*1/4)) : 0); + if ( y == 0) r = (signf(x) == -1 ? M_PIf : 0); + + return xisnanf(x) || xisnanf(y) ? SLEEF_NANf : mulsignf(r, y); +} + +EXPORT CONST float xasinf(float d) { + int o = fabsfk(d) < 0.5f; + float x2 = o ? (d*d) : ((1-fabsfk(d))*0.5f), x = o ? fabsfk(d) : SQRTF(x2), u; + + u = +0.4197454825e-1; + u = mlaf(u, x2, +0.2424046025e-1); + u = mlaf(u, x2, +0.4547423869e-1); + u = mlaf(u, x2, +0.7495029271e-1); + u = mlaf(u, x2, +0.1666677296e+0); + u = mlaf(u, x * x2, x); + + float r = o ? u : (M_PIf/2 - 2*u); + r = mulsignf(r, d); + + return r; +} + +EXPORT CONST float xacosf(float d) { + int o = fabsfk(d) < 0.5f; + float x2 = o ? (d*d) : ((1-fabsfk(d))*0.5f), u; + float x = o ? fabsfk(d) : SQRTF(x2); + x = fabsfk(d) == 1.0 ? 0 : x; + + u = +0.4197454825e-1; + u = mlaf(u, x2, +0.2424046025e-1); + u = mlaf(u, x2, +0.4547423869e-1); + u = mlaf(u, x2, +0.7495029271e-1); + u = mlaf(u, x2, +0.1666677296e+0); + + u *= x * x2; + + float y = 3.1415926535897932f/2 - (mulsignf(x, d) + mulsignf(u, d)); + x += u; + float r = o ? y : (x*2); + if (!o && d < 0) r = dfadd_f2_f2_f(df(3.1415927410125732422f,-8.7422776573475857731e-08f), -r).x; + + return r; +} + +static Sleef_float2 atan2kf_u1(Sleef_float2 y, Sleef_float2 x) { + float u; + Sleef_float2 s, t; + int q = 0; + + if (x.x < 0) { x.x = -x.x; x.y = -x.y; q = -2; } + if (y.x > x.x) { t = x; x = y; y.x = -t.x; y.y = -t.y; q += 1; } + + s = dfdiv_f2_f2_f2(y, x); + t = dfsqu_f2_f2(s); + t = dfnormalize_f2_f2(t); + + u = -0.00176397908944636583328247f; + u = mlaf(u, t.x, 0.0107900900766253471374512f); + u = mlaf(u, t.x, -0.0309564601629972457885742f); + u = mlaf(u, t.x, 0.0577365085482597351074219f); + u = mlaf(u, t.x, -0.0838950723409652709960938f); + u = mlaf(u, t.x, 0.109463557600975036621094f); + u = mlaf(u, t.x, -0.142626821994781494140625f); + u = mlaf(u, t.x, 0.199983194470405578613281f); + + t = dfmul_f2_f2_f2(t, dfadd_f2_f_f(-0.333332866430282592773438f, u * t.x)); + t = dfmul_f2_f2_f2(s, dfadd_f2_f_f2(1, t)); + t = dfadd2_f2_f2_f2(dfmul_f2_f2_f(df(1.5707963705062866211f, -4.3711388286737928865e-08f), q), t); + + return t; +} + +EXPORT CONST float xatan2f_u1(float y, float x) { + if (fabsfk(x) < 2.9387372783541830947e-39f) { y *= (UINT64_C(1) << 24); x *= (UINT64_C(1) << 24); } // nexttowardf((1.0 / FLT_MAX), 1) + Sleef_float2 d = atan2kf_u1(df(fabsfk(y), 0), df(x, 0)); + float r = d.x + d.y; + + r = mulsignf(r, x); + if (xisinff(x) || x == 0) r = (float)M_PI/2 - (xisinff(x) ? (signf(x) * (float)(M_PI /2)) : 0.0f); + if (xisinff(y) ) r = (float)M_PI/2 - (xisinff(x) ? (signf(x) * (float)(M_PI*1/4)) : 0.0f); + if ( y == 0) r = (signf(x) == -1 ? (float)M_PI : 0.0f); + + return xisnanf(x) || xisnanf(y) ? SLEEF_NANf : mulsignf(r, y); +} + +EXPORT CONST float xasinf_u1(float d) { + int o = fabsfk(d) < 0.5f; + float x2 = o ? (d*d) : ((1-fabsfk(d))*0.5f), u; + Sleef_float2 x = o ? df(fabsfk(d), 0) : dfsqrt_f2_f(x2); + x = fabsfk(d) == 1.0f ? df(0, 0) : x; + + u = +0.4197454825e-1; + u = mlaf(u, x2, +0.2424046025e-1); + u = mlaf(u, x2, +0.4547423869e-1); + u = mlaf(u, x2, +0.7495029271e-1); + u = mlaf(u, x2, +0.1666677296e+0); + u *= x2 * x.x; + + Sleef_float2 y = dfadd_f2_f2_f(dfsub_f2_f2_f2(df(3.1415927410125732422f/4,-8.7422776573475857731e-08f/4), x), -u); + float r = o ? (u + x.x) : ((y.x + y.y)*2); + r = mulsignf(r, d); + + return r; +} + +EXPORT CONST float xacosf_u1(float d) { + int o = fabsfk(d) < 0.5f; + float x2 = o ? (d*d) : ((1-fabsfk(d))*0.5f), u; + Sleef_float2 x = o ? df(fabsfk(d), 0) : dfsqrt_f2_f(x2); + x = fabsfk(d) == 1.0 ? df(0, 0) : x; + + u = +0.4197454825e-1; + u = mlaf(u, x2, +0.2424046025e-1); + u = mlaf(u, x2, +0.4547423869e-1); + u = mlaf(u, x2, +0.7495029271e-1); + u = mlaf(u, x2, +0.1666677296e+0); + + u = u * x.x * x2; + + Sleef_float2 y = dfsub_f2_f2_f2(df(3.1415927410125732422f/2,-8.7422776573475857731e-08f/2), + dfadd_f2_f_f(mulsignf(x.x, d), mulsignf(u, d))); + x = dfadd_f2_f2_f(x, u); + y = o ? y : dfscale_f2_f2_f(x, 2); + if (!o && d < 0) y = dfsub_f2_f2_f2(df(3.1415927410125732422f,-8.7422776573475857731e-08f), y); + + return y.x + y.y; +} + +EXPORT CONST float xatanf_u1(float d) { + Sleef_float2 d2 = atan2kf_u1(df(fabsfk(d), 0.0f), df(1.0f, 0.0f)); + float r = d2.x + d2.y; + if (xisinff(d)) r = 1.570796326794896557998982f; + return mulsignf(r, d); +} + +EXPORT CONST float xlogf(float d) { + float x, x2, t, m; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = (m-1.0f) / (m+1.0f); + x2 = x * x; + + t = 0.2392828464508056640625f; + t = mlaf(t, x2, 0.28518211841583251953125f); + t = mlaf(t, x2, 0.400005877017974853515625f); + t = mlaf(t, x2, 0.666666686534881591796875f); + t = mlaf(t, x2, 2.0f); + + x = x * t + 0.693147180559945286226764f * e; + + if (xisinff(d)) x = SLEEF_INFINITYf; + if (d < 0 || xisnanf(d)) x = SLEEF_NANf; + if (d == 0) x = -SLEEF_INFINITYf; + + return x; +} + +EXPORT CONST float xexpf(float d) { + int q = (int)rintfk(d * R_LN2f); + float s, u; + + s = mlaf(q, -L2Uf, d); + s = mlaf(q, -L2Lf, s); + + u = 0.000198527617612853646278381; + u = mlaf(u, s, 0.00139304355252534151077271); + u = mlaf(u, s, 0.00833336077630519866943359); + u = mlaf(u, s, 0.0416664853692054748535156); + u = mlaf(u, s, 0.166666671633720397949219); + u = mlaf(u, s, 0.5); + + u = s * s * u + s + 1.0f; + u = ldexp2kf(u, q); + + if (d < -104) u = 0; + if (d > 104) u = SLEEF_INFINITYf; + + return u; +} + +static INLINE CONST float expkf(Sleef_float2 d) { + int q = (int)rintfk((d.x + d.y) * R_LN2f); + Sleef_float2 s, t; + float u; + + s = dfadd2_f2_f2_f(d, q * -L2Uf); + s = dfadd2_f2_f2_f(s, q * -L2Lf); + + s = dfnormalize_f2_f2(s); + + u = 0.00136324646882712841033936f; + u = mlaf(u, s.x, 0.00836596917361021041870117f); + u = mlaf(u, s.x, 0.0416710823774337768554688f); + u = mlaf(u, s.x, 0.166665524244308471679688f); + u = mlaf(u, s.x, 0.499999850988388061523438f); + + t = dfadd_f2_f2_f2(s, dfmul_f2_f2_f(dfsqu_f2_f2(s), u)); + + t = dfadd_f2_f_f2(1, t); + + u = ldexpkf(t.x + t.y, q); + + if (d.x < -104) u = 0; + + return u; +} + +static INLINE CONST float expm1kf(float d) { + int q = (int)rintfk(d * R_LN2f); + float s, u; + + s = mlaf(q, -L2Uf, d); + s = mlaf(q, -L2Lf, s); + + float s2 = s * s, s4 = s2 * s2; + u = POLY6(s, s2, s4, + 0.000198527617612853646278381, + 0.00139304355252534151077271, + 0.00833336077630519866943359, + 0.0416664853692054748535156, + 0.166666671633720397949219, + 0.5); + + u = s * s * u + s; + + if (q != 0) u = ldexp2kf(u + 1, q) - 1; + + return u; +} + +static INLINE CONST Sleef_float2 logkf(float d) { + Sleef_float2 x, x2, s; + float m, t; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = dfdiv_f2_f2_f2(dfadd2_f2_f_f(-1, m), dfadd2_f2_f_f(1, m)); + x2 = dfsqu_f2_f2(x); + + t = 0.240320354700088500976562; + t = mlaf(t, x2.x, 0.285112679004669189453125); + t = mlaf(t, x2.x, 0.400007992982864379882812); + Sleef_float2 c = df(0.66666662693023681640625f, 3.69183861259614332084311e-09f); + + s = dfmul_f2_f2_f(df(0.69314718246459960938f, -1.904654323148236017e-09f), e); + s = dfadd_f2_f2_f2(s, dfscale_f2_f2_f(x, 2)); + s = dfadd_f2_f2_f2(s, dfmul_f2_f2_f2(dfmul_f2_f2_f2(x2, x), + dfadd2_f2_f2_f2(dfmul_f2_f2_f(x2, t), c))); + return s; +} + +EXPORT CONST float xlogf_u1(float d) { + Sleef_float2 x, s; + float m, t, x2; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = dfdiv_f2_f2_f2(dfadd2_f2_f_f(-1, m), dfadd2_f2_f_f(1, m)); + x2 = x.x * x.x; + + t = +0.3027294874e+0f; + t = mlaf(t, x2, +0.3996108174e+0f); + t = mlaf(t, x2, +0.6666694880e+0f); + + s = dfmul_f2_f2_f(df(0.69314718246459960938f, -1.904654323148236017e-09f), (float)e); + s = dfadd_f2_f2_f2(s, dfscale_f2_f2_f(x, 2)); + s = dfadd_f2_f2_f(s, x2 * x.x * t); + + float r = s.x + s.y; + + if (xisinff(d)) r = SLEEF_INFINITYf; + if (d < 0 || xisnanf(d)) r = SLEEF_NANf; + if (d == 0) r = -SLEEF_INFINITYf; + + return r; +} + +static INLINE CONST Sleef_float2 expk2f(Sleef_float2 d) { + int q = (int)rintfk((d.x + d.y) * R_LN2f); + Sleef_float2 s, t; + float u; + + s = dfadd2_f2_f2_f(d, q * -L2Uf); + s = dfadd2_f2_f2_f(s, q * -L2Lf); + + u = +0.1980960224e-3f; + u = mlaf(u, s.x, +0.1394256484e-2f); + u = mlaf(u, s.x, +0.8333456703e-2f); + u = mlaf(u, s.x, +0.4166637361e-1f); + + t = dfadd2_f2_f2_f(dfmul_f2_f2_f(s, u), +0.166666659414234244790680580464e+0f); + t = dfadd2_f2_f2_f(dfmul_f2_f2_f2(s, t), 0.5); + t = dfadd2_f2_f2_f2(s, dfmul_f2_f2_f2(dfsqu_f2_f2(s), t)); + + t = dfadd2_f2_f_f2(1, t); + + t.x = ldexp2kf(t.x, q); + t.y = ldexp2kf(t.y, q); + + return d.x < -104 ? df(0, 0) : t; +} + +EXPORT CONST float xpowf(float x, float y) { + int yisint = (y == (int)y) || (fabsfk(y) >= (float)(INT64_C(1) << 24)); + int yisodd = (1 & (int)y) != 0 && yisint && fabsfk(y) < (float)(INT64_C(1) << 24); + + float result = expkf(dfmul_f2_f2_f(logkf(fabsfk(x)), y)); + + result = xisnanf(result) ? SLEEF_INFINITYf : result; + result *= (x >= 0 ? 1 : (yisint ? (yisodd ? -1 : 1) : SLEEF_NANf)); + + float efx = mulsignf(fabsfk(x) - 1, y); + if (xisinff(y)) result = efx < 0 ? 0.0f : (efx == 0 ? 1.0f : SLEEF_INFINITYf); + if (xisinff(x) || x == 0) result = mulsignf((xsignbitf(y) ^ (x == 0)) ? 0 : SLEEF_INFINITYf, yisodd ? x : 1); + if (xisnanf(x) || xisnanf(y)) result = SLEEF_NANf; + if (y == 0 || x == 1) result = 1; + + return result; +} + +static INLINE CONST float logk3f(float d) { + float x, x2, t, m; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = (m-1) / (m+1); + x2 = x * x; + + t = 0.2392828464508056640625f; + t = mlaf(t, x2, 0.28518211841583251953125f); + t = mlaf(t, x2, 0.400005877017974853515625f); + t = mlaf(t, x2, 0.666666686534881591796875f); + t = mlaf(t, x2, 2.0f); + + x = mlaf(x, t, 0.693147180559945286226764f * e); + + return x; +} + +static INLINE CONST float expk3f(float d) { + int q = (int)rintfk(d * R_LN2f); + float s, u; + + s = mlaf(q, -L2Uf, d); + s = mlaf(q, -L2Lf, s); + + u = 0.000198527617612853646278381; + u = mlaf(u, s, 0.00139304355252534151077271); + u = mlaf(u, s, 0.00833336077630519866943359); + u = mlaf(u, s, 0.0416664853692054748535156); + u = mlaf(u, s, 0.166666671633720397949219); + u = mlaf(u, s, 0.5); + + u = mlaf(s * s, u, s + 1.0f); + u = ldexpkf(u, q); + + if (d < -104) u = 0; + + return u; +} + +EXPORT CONST float xfastpowf_u3500(float x, float y) { + float result = expk3f(logk3f(fabsfk(x)) * y); + + int yisint = (y == (int)y) || (fabsfk(y) >= (float)(INT64_C(1) << 24)); + int yisodd = (1 & (int)y) != 0 && yisint && fabsfk(y) < (float)(INT64_C(1) << 24); + + result *= (x < 0 && yisodd) ? -1 : 1; + if (x == 0) result = 0; + if (y == 0) result = 1; + + return result; +} + +EXPORT CONST float xsinhf(float x) { + float y = fabsfk(x); + Sleef_float2 d = expk2f(df(y, 0)); + d = dfsub_f2_f2_f2(d, dfrec_f2_f2(d)); + y = (d.x + d.y) * 0.5f; + + y = fabsfk(x) > 89 ? SLEEF_INFINITYf : y; + y = xisnanf(y) ? SLEEF_INFINITYf : y; + y = mulsignf(y, x); + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xcoshf(float x) { + float y = fabsfk(x); + Sleef_float2 d = expk2f(df(y, 0)); + d = dfadd_f2_f2_f2(d, dfrec_f2_f2(d)); + y = (d.x + d.y) * 0.5f; + + y = fabsfk(x) > 89 ? SLEEF_INFINITYf : y; + y = xisnanf(y) ? SLEEF_INFINITYf : y; + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xtanhf(float x) { + float y = fabsfk(x); + Sleef_float2 d = expk2f(df(y, 0)); + Sleef_float2 e = dfrec_f2_f2(d); + d = dfdiv_f2_f2_f2(dfsub_f2_f2_f2(d, e), dfadd_f2_f2_f2(d, e)); + y = d.x + d.y; + + y = fabsfk(x) > 18.714973875f ? 1.0f : y; + y = xisnanf(y) ? 1.0f : y; + y = mulsignf(y, x); + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xsinhf_u35(float x) { + float e = expm1kf(fabsfk(x)); + float y = (e + 2) / (e + 1) * (0.5f * e); + + y = fabsfk(x) > 88 ? SLEEF_INFINITYf : y; + y = xisnanf(y) ? SLEEF_INFINITYf : y; + y = mulsignf(y, x); + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xcoshf_u35(float x) { + float e = xexpf(fabsfk(x)); + float y = 0.5f * e + 0.5f / e; + + y = fabsfk(x) > 88 ? SLEEF_INFINITYf : y; + y = xisnanf(y) ? SLEEF_INFINITYf : y; + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xtanhf_u35(float x) { + float y = fabsfk(x); + float d = expm1kf(2*y); + y = d / (d + 2); + + y = fabsfk(x) > 18.714973875f ? 1.0f : y; + y = xisnanf(y) ? 1.0f : y; + y = mulsignf(y, x); + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +static INLINE CONST Sleef_float2 logk2f(Sleef_float2 d) { + Sleef_float2 x, x2, m, s; + float t; + int e; + + e = ilogbkf(d.x * (1.0f/0.75f)); + m = dfscale_f2_f2_f(d, pow2if(-e)); + + x = dfdiv_f2_f2_f2(dfadd2_f2_f2_f(m, -1), dfadd2_f2_f2_f(m, 1)); + x2 = dfsqu_f2_f2(x); + + t = 0.2392828464508056640625f; + t = mlaf(t, x2.x, 0.28518211841583251953125f); + t = mlaf(t, x2.x, 0.400005877017974853515625f); + t = mlaf(t, x2.x, 0.666666686534881591796875f); + + s = dfmul_f2_f2_f(df(0.69314718246459960938f, -1.904654323148236017e-09f), e); + s = dfadd_f2_f2_f2(s, dfscale_f2_f2_f(x, 2)); + s = dfadd_f2_f2_f2(s, dfmul_f2_f2_f(dfmul_f2_f2_f2(x2, x), t)); + + return s; +} + +EXPORT CONST float xasinhf(float x) { + float y = fabsfk(x); + Sleef_float2 d; + + d = y > 1 ? dfrec_f2_f(x) : df(y, 0); + d = dfsqrt_f2_f2(dfadd2_f2_f2_f(dfsqu_f2_f2(d), 1)); + d = y > 1 ? dfmul_f2_f2_f(d, y) : d; + + d = logk2f(dfnormalize_f2_f2(dfadd_f2_f2_f(d, x))); + y = d.x + d.y; + + y = (fabsfk(x) > SQRT_FLT_MAX || xisnanf(y)) ? mulsignf(SLEEF_INFINITYf, x) : y; + y = xisnanf(x) ? SLEEF_NANf : y; + y = xisnegzerof(x) ? -0.0f : y; + + return y; +} + +EXPORT CONST float xacoshf(float x) { + Sleef_float2 d = logk2f(dfadd2_f2_f2_f(dfmul_f2_f2_f2(dfsqrt_f2_f2(dfadd2_f2_f_f(x, 1)), dfsqrt_f2_f2(dfadd2_f2_f_f(x, -1))), x)); + float y = d.x + d.y; + + y = (x > SQRT_FLT_MAX || xisnanf(y)) ? SLEEF_INFINITYf : y; + y = x == 1.0f ? 0.0f : y; + y = x < 1.0f ? SLEEF_NANf : y; + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xatanhf(float x) { + float y = fabsfk(x); + Sleef_float2 d = logk2f(dfdiv_f2_f2_f2(dfadd2_f2_f_f(1, y), dfadd2_f2_f_f(1, -y))); + y = y > 1.0f ? SLEEF_NANf : (y == 1.0f ? SLEEF_INFINITYf : (d.x + d.y) * 0.5f); + + y = xisinff(x) || xisnanf(y) ? SLEEF_NANf : y; + y = mulsignf(y, x); + y = xisnanf(x) ? SLEEF_NANf : y; + + return y; +} + +EXPORT CONST float xexp2f(float d) { + int q = (int)rintfk(d); + float s, u; + + s = d - q; + + u = +0.1535920892e-3; + u = mlaf(u, s, +0.1339262701e-2); + u = mlaf(u, s, +0.9618384764e-2); + u = mlaf(u, s, +0.5550347269e-1); + u = mlaf(u, s, +0.2402264476e+0); + u = mlaf(u, s, +0.6931471825e+0); + u = dfnormalize_f2_f2(dfadd_f2_f_f2(1, dfmul_f2_f_f(u, s))).x; + + u = ldexp2kf(u, q); + + if (d >= 128) u = SLEEF_INFINITYf; + if (d < -150) u = 0; + + return u; +} + +EXPORT CONST float xexp2f_u35(float d) { + int q = (int)rintfk(d); + float s, u; + + s = d - q; + + u = +0.1535920892e-3; + u = mlaf(u, s, +0.1339262701e-2); + u = mlaf(u, s, +0.9618384764e-2); + u = mlaf(u, s, +0.5550347269e-1); + u = mlaf(u, s, +0.2402264476e+0); + u = mlaf(u, s, +0.6931471825e+0); + u = mlaf(u, s, +0.1000000000e+1); + + u = ldexp2kf(u, q); + + if (d >= 128) u = SLEEF_INFINITYf; + if (d < -150) u = 0; + + return u; +} + +EXPORT CONST float xexp10f(float d) { + int q = (int)rintfk(d * (float)LOG10_2); + float s, u; + + s = mlaf(q, -L10Uf, d); + s = mlaf(q, -L10Lf, s); + + u = +0.6802555919e-1; + u = mlaf(u, s, +0.2078080326e+0); + u = mlaf(u, s, +0.5393903852e+0); + u = mlaf(u, s, +0.1171245337e+1); + u = mlaf(u, s, +0.2034678698e+1); + u = mlaf(u, s, +0.2650949001e+1); + Sleef_float2 x = dfadd_f2_f2_f(df(2.3025851249694824219, -3.1705172516493593157e-08), u * s); + u = dfnormalize_f2_f2(dfadd_f2_f_f2(1, dfmul_f2_f2_f(x, s))).x; + + u = ldexp2kf(u, q); + + if (d > 38.5318394191036238941387f) u = SLEEF_INFINITYf; // log10(FLT_MAX) + if (d < -50) u = 0; + + return u; +} + +EXPORT CONST float xexp10f_u35(float d) { + int q = (int)rintfk(d * (float)LOG10_2); + float s, u; + + s = mlaf(q, -L10Uf, d); + s = mlaf(q, -L10Lf, s); + + u = +0.2064004987e+0; + u = mlaf(u, s, +0.5417877436e+0); + u = mlaf(u, s, +0.1171286821e+1); + u = mlaf(u, s, +0.2034656048e+1); + u = mlaf(u, s, +0.2650948763e+1); + u = mlaf(u, s, +0.2302585125e+1); + u = mlaf(u, s, +0.1000000000e+1); + + u = ldexp2kf(u, q); + + if (d > 38.5318394191036238941387f) u = SLEEF_INFINITYf; // log10(FLT_MAX) + if (d < -50) u = 0; + + return u; +} + +EXPORT CONST float xexpm1f(float a) { + Sleef_float2 d = dfadd2_f2_f2_f(expk2f(df(a, 0)), -1.0f); + float x = d.x + d.y; + if (a > 88.72283172607421875f) x = SLEEF_INFINITYf; + if (a < -16.635532333438687426013570f) x = -1; + if (xisnegzerof(a)) x = -0.0f; + return x; +} + +EXPORT CONST float xlog10f(float d) { + Sleef_float2 x, s; + float m, t, x2; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = dfdiv_f2_f2_f2(dfadd2_f2_f_f(-1, m), dfadd2_f2_f_f(1, m)); + x2 = x.x * x.x; + + t = +0.1314289868e+0; + t = mlaf(t, x2, +0.1735493541e+0); + t = mlaf(t, x2, +0.2895309627e+0); + + s = dfmul_f2_f2_f(df(0.30103001, -1.432098889e-08), (float)e); + s = dfadd_f2_f2_f2(s, dfmul_f2_f2_f2(x, df(0.868588984, -2.170757285e-08))); + s = dfadd_f2_f2_f(s, x2 * x.x * t); + + float r = s.x + s.y; + + if (xisinff(d)) r = SLEEF_INFINITYf; + if (d < 0 || xisnanf(d)) r = SLEEF_NANf; + if (d == 0) r = -SLEEF_INFINITYf; + + return r; +} + +EXPORT CONST float xlog2f(float d) { + Sleef_float2 x, s; + float m, t, x2; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = dfdiv_f2_f2_f2(dfadd2_f2_f_f(-1, m), dfadd2_f2_f_f(1, m)); + x2 = x.x * x.x; + + t = +0.4374550283e+0f; + t = mlaf(t, x2, +0.5764790177e+0f); + t = mlaf(t, x2, +0.9618012905120f); + + s = dfadd2_f2_f_f2(e, dfmul_f2_f2_f2(x, df(2.8853900432586669922, 3.2734474483568488616e-08))); + s = dfadd2_f2_f2_f(s, x2 * x.x * t); + + float r = s.x + s.y; + + if (xisinff(d)) r = SLEEF_INFINITYf; + if (d < 0 || xisnanf(d)) r = SLEEF_NANf; + if (d == 0) r = -SLEEF_INFINITYf; + + return r; +} + +EXPORT CONST float xlog2f_u35(float d) { + float m, t, x, x2; + int e; + + int o = d < FLT_MIN; + if (o) d *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(d * (1.0f/0.75f)); + m = ldexp3kf(d, -e); + + if (o) e -= 64; + + x = (m - 1) / (m + 1); + x2 = x * x; + + t = +0.4374088347e+0; + t = mlaf(t, x2, +0.5764843822e+0); + t = mlaf(t, x2, +0.9618024230e+0); + + float r = mlaf(x2 * x, t, mlaf(x, +0.2885390043e+1, e)); + + if (xisinff(d)) r = SLEEF_INFINITYf; + if (d < 0 || xisnanf(d)) r = SLEEF_NANf; + if (d == 0) r = -SLEEF_INFINITYf; + + return r; +} + +EXPORT CONST float xlog1pf(float d) { + Sleef_float2 x, s; + float m, t, x2; + int e; + + float dp1 = d + 1; + + int o = dp1 < FLT_MIN; + if (o) dp1 *= (float)(INT64_C(1) << 32) * (float)(INT64_C(1) << 32); + + e = ilogb2kf(dp1 * (1.0f/0.75f)); + + t = ldexp3kf(1, -e); + m = mlaf(d, t, t-1); + + if (o) e -= 64; + + x = dfdiv_f2_f2_f2(df(m, 0), dfadd_f2_f_f(2, m)); + x2 = x.x * x.x; + + t = +0.3027294874e+0f; + t = mlaf(t, x2, +0.3996108174e+0f); + t = mlaf(t, x2, +0.6666694880e+0f); + + s = dfmul_f2_f2_f(df(0.69314718246459960938f, -1.904654323148236017e-09f), (float)e); + s = dfadd_f2_f2_f2(s, dfscale_f2_f2_f(x, 2)); + s = dfadd_f2_f2_f(s, x2 * x.x * t); + + float r = s.x + s.y; + + if (d > 1e+38) r = SLEEF_INFINITYf; + if (d < -1) r = SLEEF_NANf; + if (d == -1) r = -SLEEF_INFINITYf; + if (xisnegzerof(d)) r = -0.0f; + + return r; +} + +EXPORT CONST float xcbrtf(float d) { + float x, y, q = 1.0f; + int e, r; + + e = ilogbkf(fabsfk(d))+1; + d = ldexp2kf(d, -e); + r = (e + 6144) % 3; + q = (r == 1) ? 1.2599210498948731647672106f : q; + q = (r == 2) ? 1.5874010519681994747517056f : q; + q = ldexp2kf(q, (e + 6144) / 3 - 2048); + + q = mulsignf(q, d); + d = fabsfk(d); + + x = -0.601564466953277587890625f; + x = mlaf(x, d, 2.8208892345428466796875f); + x = mlaf(x, d, -5.532182216644287109375f); + x = mlaf(x, d, 5.898262500762939453125f); + x = mlaf(x, d, -3.8095417022705078125f); + x = mlaf(x, d, 2.2241256237030029296875f); + + y = d * x * x; + y = (y - (2.0f / 3.0f) * y * (y * x - 1.0f)) * q; + + return y; +} + +EXPORT CONST float xcbrtf_u1(float d) { + float x, y, z; + Sleef_float2 q2 = df(1, 0), u, v; + int e, r; + + e = ilogbkf(fabsfk(d))+1; + d = ldexp2kf(d, -e); + r = (e + 6144) % 3; + q2 = (r == 1) ? df(1.2599210739135742188, -2.4018701694217270415e-08) : q2; + q2 = (r == 2) ? df(1.5874010324478149414, 1.9520385308169352356e-08) : q2; + + q2.x = mulsignf(q2.x, d); q2.y = mulsignf(q2.y, d); + d = fabsfk(d); + + x = -0.601564466953277587890625f; + x = mlaf(x, d, 2.8208892345428466796875f); + x = mlaf(x, d, -5.532182216644287109375f); + x = mlaf(x, d, 5.898262500762939453125f); + x = mlaf(x, d, -3.8095417022705078125f); + x = mlaf(x, d, 2.2241256237030029296875f); + + y = x * x; y = y * y; x -= (d * y - x) * (1.0 / 3.0f); + + z = x; + + u = dfmul_f2_f_f(x, x); + u = dfmul_f2_f2_f2(u, u); + u = dfmul_f2_f2_f(u, d); + u = dfadd2_f2_f2_f(u, -x); + y = u.x + u.y; + + y = -2.0 / 3.0 * y * z; + v = dfadd2_f2_f2_f(dfmul_f2_f_f(z, z), y); + v = dfmul_f2_f2_f(v, d); + v = dfmul_f2_f2_f2(v, q2); + z = ldexp2kf(v.x + v.y, (e + 6144) / 3 - 2048); + + if (xisinff(d)) { z = mulsignf(SLEEF_INFINITYf, q2.x); } + if (d == 0) { z = mulsignf(0, q2.x); } + + return z; +} + +// + +EXPORT CONST float xfabsf(float x) { return fabsfk(x); } + +EXPORT CONST float xcopysignf(float x, float y) { return copysignfk(x, y); } + +EXPORT CONST float xfmaxf(float x, float y) { + return y != y ? x : (x > y ? x : y); +} + +EXPORT CONST float xfminf(float x, float y) { + return y != y ? x : (x < y ? x : y); +} + +EXPORT CONST float xfdimf(float x, float y) { + float ret = x - y; + if (ret < 0 || x == y) ret = 0; + return ret; +} + +EXPORT CONST float xtruncf(float x) { + float fr = x - (int32_t)x; + return (xisinff(x) || fabsfk(x) >= (float)(INT64_C(1) << 23)) ? x : copysignfk(x - fr, x); +} + +EXPORT CONST float xfloorf(float x) { + float fr = x - (int32_t)x; + fr = fr < 0 ? fr+1.0f : fr; + return (xisinff(x) || fabsfk(x) >= (float)(INT64_C(1) << 23)) ? x : copysignfk(x - fr, x); +} + +EXPORT CONST float xceilf(float x) { + float fr = x - (int32_t)x; + fr = fr <= 0 ? fr : fr-1.0f; + return (xisinff(x) || fabsfk(x) >= (float)(INT64_C(1) << 23)) ? x : copysignfk(x - fr, x); +} + +EXPORT CONST float xroundf(float d) { + float x = d + 0.5f; + float fr = x - (int32_t)x; + if (fr == 0 && x <= 0) x--; + fr = fr < 0 ? fr+1.0f : fr; + x = d == 0.4999999701976776123f ? 0 : x; // nextafterf(0.5, 0) + return (xisinff(d) || fabsfk(d) >= (float)(INT64_C(1) << 23)) ? d : copysignfk(x - fr, d); +} + +EXPORT CONST float xrintf(float d) { + float x = d + 0.5f; + int32_t isodd = (1 & (int32_t)x) != 0; + float fr = x - (int32_t)x; + fr = (fr < 0 || (fr == 0 && isodd)) ? fr+1.0f : fr; + x = d == 0.50000005960464477539f ? 0 : x; // nextafterf(0.5, 1) + return (xisinff(d) || fabsfk(d) >= (float)(INT64_C(1) << 23)) ? d : copysignfk(x - fr, d); +} + +EXPORT CONST Sleef_float2 xmodff(float x) { + float fr = x - (int32_t)x; + fr = fabsfk(x) > (float)(INT64_C(1) << 23) ? 0 : fr; + Sleef_float2 ret = { copysignfk(fr, x), copysignfk(x - fr, x) }; + return ret; +} + +EXPORT CONST float xldexpf(float x, int exp) { + if (exp > 300) exp = 300; + if (exp < -300) exp = -300; + + int e0 = exp >> 2; + if (exp < 0) e0++; + if (-50 < exp && exp < 50) e0 = 0; + int e1 = exp - (e0 << 2); + + float p = pow2if(e0); + float ret = x * pow2if(e1) * p * p * p * p; + + return ret; +} + +EXPORT CONST float xnextafterf(float x, float y) { + float cxf; + int32_t cxi; + + cxf = x == 0 ? mulsignf(0, y) : x; + memcpy(&cxi, &cxf, sizeof(cxi)); + int c = (cxi < 0) == (y < x); + if (c) cxi = -(cxi ^ (1 << 31)); + + if (x != y) cxi--; + + if (c) cxi = -(cxi ^ (1 << 31)); + + memcpy(&cxf, &cxi, sizeof(cxf)); + if (cxf == 0 && x != 0) cxf = mulsignf(0, x); + if (x == 0 && y == 0) cxf = y; + if (xisnanf(x) || xisnanf(y)) cxf = SLEEF_NANf; + + return cxf; +} + +EXPORT CONST float xfrfrexpf(float x) { + float cxf; + int32_t cxu; + + if (fabsfk(x) < FLT_MIN) x *= (1 << 30); + + cxf = x; + memcpy(&cxu, &cxf, sizeof(cxu)); + + cxu &= ~0x7f800000U; + cxu |= 0x3f000000U; + + memcpy(&cxf, &cxu, sizeof(cxf)); + if (xisinff(x)) cxf = mulsignf(SLEEF_INFINITYf, x); + if (x == 0) cxf = x; + + return cxf; +} + +EXPORT CONST int xexpfrexpf(float x) { + float cxf; + uint32_t cxu; + + int ret = 0; + + if (fabsfk(x) < FLT_MIN) { x *= (1 << 30); ret = -30; } + + cxf = x; + memcpy(&cxu, &cxf, sizeof(cxu)); + ret += (int32_t)(((cxu >> 23) & 0xff)) - 0x7e; + + if (x == 0 || xisnanf(x) || xisinff(x)) ret = 0; + + return ret; +} + +EXPORT CONST float xhypotf_u05(float x, float y) { + x = fabsfk(x); + y = fabsfk(y); + float min = fminfk(x, y), n = min; + float max = fmaxfk(x, y), d = max; + + if (max < FLT_MIN) { n *= UINT64_C(1) << 24; d *= UINT64_C(1) << 24; } + Sleef_float2 t = dfdiv_f2_f2_f2(df(n, 0), df(d, 0)); + t = dfmul_f2_f2_f(dfsqrt_f2_f2(dfadd2_f2_f2_f(dfsqu_f2_f2(t), 1)), max); + float ret = t.x + t.y; + if (xisnanf(ret)) ret = SLEEF_INFINITYf; + if (min == 0) ret = max; + if (xisnanf(x) || xisnanf(y)) ret = SLEEF_NANf; + if (x == SLEEF_INFINITYf || y == SLEEF_INFINITYf) ret = SLEEF_INFINITYf; + return ret; +} + +EXPORT CONST float xhypotf_u35(float x, float y) { + x = fabsfk(x); + y = fabsfk(y); + float min = fminfk(x, y); + float max = fmaxfk(x, y); + + float t = min / max; + float ret = max * SQRTF(1 + t*t); + if (min == 0) ret = max; + if (xisnanf(x) || xisnanf(y)) ret = SLEEF_NANf; + if (x == SLEEF_INFINITYf || y == SLEEF_INFINITYf) ret = SLEEF_INFINITYf; + return ret; +} + +static INLINE CONST float toward0f(float d) { + return d == 0 ? 0 : intBitsToFloat(floatToRawIntBits(d)-1); +} + +static INLINE CONST float ptruncf(float x) { + return fabsfk(x) >= (float)(INT64_C(1) << 23) ? x : (x - (x - (int32_t)x)); +} + +EXPORT CONST float xfmodf(float x, float y) { + float nu = fabsfk(x), de = fabsfk(y), s = 1, q; + if (de < FLT_MIN) { nu *= UINT64_C(1) << 25; de *= UINT64_C(1) << 25; s = 1.0f / (UINT64_C(1) << 25); } + Sleef_float2 r = df(nu, 0); + float rde = toward0f(1.0f / de); + + for(int i=0;i<8;i++) { // ceil(log2(FLT_MAX) / 22)+1 + q = ptruncf(toward0f(r.x) * rde); + q = (3*de > r.x && r.x >= de) ? 2 : q; + q = (2*de > r.x && r.x >= de) ? 1 : q; + r = dfnormalize_f2_f2(dfadd2_f2_f2_f2(r, dfmul_f2_f_f(q, -de))); + if (r.x < de) break; + } + + float ret = (r.x + r.y) * s; + if (r.x + r.y == de) ret = 0; + ret = mulsignf(ret, x); + if (nu < de) ret = x; + if (de == 0) ret = SLEEF_NANf; + + return ret; +} + +static INLINE CONST float rintfk2(float d) { + float x = d + 0.5f; + int32_t isodd = (1 & (int32_t)x) != 0; + float fr = x - (int32_t)x; + fr = (fr < 0 || (fr == 0 && isodd)) ? fr+1.0f : fr; + return (fabsfk(d) >= (float)(INT64_C(1) << 23)) ? d : copysignfk(x - fr, d); +} + +EXPORT CONST float xremainderf(float x, float y) { + float n = fabsfk(x), d = fabsfk(y), s = 1, q; + if (d < FLT_MIN*2) { n *= UINT64_C(1) << 25; d *= UINT64_C(1) << 25; s = 1.0f / (UINT64_C(1) << 25); } + float rd = 1.0f / d; + Sleef_float2 r = df(n, 0); + int qisodd = 0; + + for(int i=0;i<8;i++) { // ceil(log2(FLT_MAX) / 22)+1 + q = rintfk2(r.x * rd); + if (fabsfk(r.x) < 1.5f * d) q = r.x < 0 ? -1 : 1; + if (fabsfk(r.x) < 0.5f * d || (fabsfk(r.x) == 0.5f * d && !qisodd)) q = 0; + if (q == 0) break; + if (xisinff(q * -d)) q = q + mulsignf(-1, r.x); + qisodd ^= (1 & (int)q) != 0 && fabsfk(q) < (float)(INT64_C(1) << 24); + r = dfnormalize_f2_f2(dfadd2_f2_f2_f2(r, dfmul_f2_f_f(q, -d))); + } + + float ret = r.x * s; + ret = mulsignf(ret, x); + if (xisinff(y)) ret = xisinff(x) ? SLEEF_NANf : x; + if (d == 0) ret = SLEEF_NANf; + + return ret; +} + +EXPORT CONST float xsqrtf_u05(float d) { + float q = 0.5f; + + d = d < 0 ? SLEEF_NANf : d; + + if (d < 5.2939559203393770e-23f) { + d *= 1.8889465931478580e+22f; + q = 7.2759576141834260e-12f * 0.5f; + } + + if (d > 1.8446744073709552e+19f) { + d *= 5.4210108624275220e-20f; + q = 4294967296.0f * 0.5f; + } + + // http://en.wikipedia.org/wiki/Fast_inverse_square_root + float x = intBitsToFloat(0x5f375a86 - (floatToRawIntBits(d + 1e-45f) >> 1)); + + x = x * (1.5f - 0.5f * d * x * x); + x = x * (1.5f - 0.5f * d * x * x); + x = x * (1.5f - 0.5f * d * x * x) * d; + + Sleef_float2 d2 = dfmul_f2_f2_f2(dfadd2_f2_f_f2(d, dfmul_f2_f_f(x, x)), dfrec_f2_f(x)); + + float ret = (d2.x + d2.y) * q; + + ret = d == SLEEF_INFINITYf ? SLEEF_INFINITYf : ret; + ret = d == 0 ? d : ret; + + return ret; +} + +EXPORT CONST float xsqrtf_u35(float d) { + float q = 1.0f; + + d = d < 0 ? SLEEF_NANf : d; + + if (d < 5.2939559203393770e-23f) { + d *= 1.8889465931478580e+22f; + q = 7.2759576141834260e-12f; + } + + if (d > 1.8446744073709552e+19f) { + d *= 5.4210108624275220e-20f; + q = 4294967296.0f; + } + + // http://en.wikipedia.org/wiki/Fast_inverse_square_root + float x = intBitsToFloat(0x5f375a86 - (floatToRawIntBits(d + 1e-45) >> 1)); + + x = x * (1.5f - 0.5f * d * x * x); + x = x * (1.5f - 0.5f * d * x * x); + x = x * (1.5f - 0.5f * d * x * x); + x = x * (1.5f - 0.5f * d * x * x); + + return d == SLEEF_INFINITYf ? SLEEF_INFINITYf : (x * d * q); +} + +EXPORT CONST float xsqrtf(float d) { return SQRTF(d); } + +EXPORT CONST float xfmaf(float x, float y, float z) { + float h2 = x * y + z, q = 1; + if (fabsfk(h2) < 1e-38f) { + const float c0 = 1 << 25, c1 = c0 * c0, c2 = c1 * c1; + x *= c1; + y *= c1; + z *= c2; + q = 1.0f / c2; + } + if (fabsfk(h2) > 1e+38f) { + const float c0 = 1 << 25, c1 = c0 * c0, c2 = c1 * c1; + x *= 1.0 / c1; + y *= 1.0 / c1; + z *= 1.0 / c2; + q = c2; + } + Sleef_float2 d = dfmul_f2_f_f(x, y); + d = dfadd2_f2_f2_f(d, z); + float ret = (x == 0 || y == 0) ? z : (d.x + d.y); + if (xisinff(z) && !xisinff(x) && !xisnanf(x) && !xisinff(y) && !xisnanf(y)) h2 = z; + return (xisinff(h2) || xisnanf(h2)) ? h2 : ret*q; +} + +// + +static INLINE CONST Sleef_float2 sinpifk(float d) { + float u, s, t; + Sleef_float2 x, s2; + + u = d * 4; + int q = ceilfk(u) & ~1; + int o = (q & 2) != 0; + + s = u - (float)q; + t = s; + s = s * s; + s2 = dfmul_f2_f_f(t, t); + + // + + u = o ? -0.2430611801e-7f : +0.3093842054e-6f; + u = mlaf(u, s, o ? +0.3590577080e-5f : -0.3657307388e-4f); + u = mlaf(u, s, o ? -0.3259917721e-3f : +0.2490393585e-2f); + x = dfadd2_f2_f_f2(u * s, o ? df(0.015854343771934509277, 4.4940051354032242811e-10) : + df(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_f2_f2_f2(dfmul_f2_f2_f2(s2, x), o ? df(-0.30842512845993041992, -9.0728339030733922277e-09) : + df(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_f2_f2_f2(x, o ? s2 : df(t, 0)); + x = o ? dfadd2_f2_f2_f(x, 1) : x; + + // + + if ((q & 4) != 0) { x.x = -x.x; x.y = -x.y; } + + return x; +} + +EXPORT CONST float xsinpif_u05(float d) { + Sleef_float2 x = sinpifk(d); + float r = x.x + x.y; + + if (xisnegzerof(d)) r = -0.0; + if (fabsfk(d) > TRIGRANGEMAX4f) r = 0; + if (xisinff(d)) r = SLEEF_NANf; + + return r; +} + +static INLINE CONST Sleef_float2 cospifk(float d) { + float u, s, t; + Sleef_float2 x, s2; + + u = d * 4; + int q = ceilfk(u) & ~1; + int o = (q & 2) == 0; + + s = u - (float)q; + t = s; + s = s * s; + s2 = dfmul_f2_f_f(t, t); + + // + + u = o ? -0.2430611801e-7f : +0.3093842054e-6f; + u = mlaf(u, s, o ? +0.3590577080e-5f : -0.3657307388e-4f); + u = mlaf(u, s, o ? -0.3259917721e-3f : +0.2490393585e-2f); + x = dfadd2_f2_f_f2(u * s, o ? df(0.015854343771934509277, 4.4940051354032242811e-10) : + df(-0.080745510756969451904, -1.3373665339076936258e-09)); + x = dfadd2_f2_f2_f2(dfmul_f2_f2_f2(s2, x), o ? df(-0.30842512845993041992, -9.0728339030733922277e-09) : + df(0.78539818525314331055, -2.1857338617566484855e-08)); + + x = dfmul_f2_f2_f2(x, o ? s2 : df(t, 0)); + x = o ? dfadd2_f2_f2_f(x, 1) : x; + + // + + if (((q+2) & 4) != 0) { x.x = -x.x; x.y = -x.y; } + + return x; +} + +EXPORT CONST float xcospif_u05(float d) { + Sleef_float2 x = cospifk(d); + float r = x.x + x.y; + + if (fabsfk(d) > TRIGRANGEMAX4f) r = 1; + if (xisinff(d)) r = SLEEF_NANf; + + return r; +} + +typedef struct { + Sleef_float2 a, b; +} df2; + +static CONST df2 gammafk(float a) { + Sleef_float2 clc = df(0, 0), clln = df(1, 0), clld = df(1, 0), x, y, z; + float t, u; + + int otiny = fabsfk(a) < 1e-30f, oref = a < 0.5f; + + x = otiny ? df(0, 0) : (oref ? dfadd2_f2_f_f(1, -a) : df(a, 0)); + + int o0 = (0.5f <= x.x && x.x <= 1.2), o2 = 2.3 < x.x; + + y = dfnormalize_f2_f2(dfmul_f2_f2_f2(dfadd2_f2_f2_f(x, 1), x)); + y = dfnormalize_f2_f2(dfmul_f2_f2_f2(dfadd2_f2_f2_f(x, 2), y)); + + clln = (o2 && x.x <= 7) ? y : clln; + + x = (o2 && x.x <= 7) ? dfadd2_f2_f2_f(x, 3) : x; + t = o2 ? (1.0 / x.x) : dfnormalize_f2_f2(dfadd2_f2_f2_f(x, o0 ? -1 : -2)).x; + + u = o2 ? +0.000839498720672087279971000786 : (o0 ? +0.9435157776e+0f : +0.1102489550e-3f); + u = mlaf(u, t, o2 ? -5.17179090826059219329394422e-05 : (o0 ? +0.8670063615e+0f : +0.8160019934e-4f)); + u = mlaf(u, t, o2 ? -0.000592166437353693882857342347 : (o0 ? +0.4826702476e+0f : +0.1528468856e-3f)); + u = mlaf(u, t, o2 ? +6.97281375836585777403743539e-05 : (o0 ? -0.8855129778e-1f : -0.2355068718e-3f)); + u = mlaf(u, t, o2 ? +0.000784039221720066627493314301 : (o0 ? +0.1013825238e+0f : +0.4962242092e-3f)); + u = mlaf(u, t, o2 ? -0.000229472093621399176949318732 : (o0 ? -0.1493408978e+0f : -0.1193488017e-2f)); + u = mlaf(u, t, o2 ? -0.002681327160493827160473958490 : (o0 ? +0.1697509140e+0f : +0.2891599433e-2f)); + u = mlaf(u, t, o2 ? +0.003472222222222222222175164840 : (o0 ? -0.2072454542e+0f : -0.7385451812e-2f)); + u = mlaf(u, t, o2 ? +0.083333333333333333335592087900 : (o0 ? +0.2705872357e+0f : +0.2058077045e-1f)); + + y = dfmul_f2_f2_f2(dfadd2_f2_f2_f(x, -0.5), logk2f(x)); + y = dfadd2_f2_f2_f2(y, dfneg_f2_f2(x)); + y = dfadd2_f2_f2_f2(y, dfx(0.91893853320467278056)); // 0.5*log(2*M_PI) + + z = dfadd2_f2_f2_f(dfmul_f2_f_f (u, t), o0 ? -0.400686534596170958447352690395e+0f : -0.673523028297382446749257758235e-1f); + z = dfadd2_f2_f2_f(dfmul_f2_f2_f(z, t), o0 ? +0.822466960142643054450325495997e+0f : +0.322467033928981157743538726901e+0f); + z = dfadd2_f2_f2_f(dfmul_f2_f2_f(z, t), o0 ? -0.577215665946766039837398973297e+0f : +0.422784335087484338986941629852e+0f); + z = dfmul_f2_f2_f(z, t); + + clc = o2 ? y : z; + + clld = o2 ? dfadd2_f2_f2_f(dfmul_f2_f_f(u, t), 1) : clld; + + y = clln; + + clc = otiny ? dfx(41.58883083359671856503) : // log(2^60) + (oref ? dfadd2_f2_f2_f2(dfx(1.1447298858494001639), dfneg_f2_f2(clc)) : clc); // log(M_PI) + clln = otiny ? df(1, 0) : (oref ? clln : clld); + + if (oref) x = dfmul_f2_f2_f2(clld, sinpifk(a - (float)(INT64_C(1) << 12) * (int32_t)(a * (1.0 / (INT64_C(1) << 12))))); + + clld = otiny ? df(a*((INT64_C(1) << 30)*(float)(INT64_C(1) << 30)), 0) : (oref ? x : y); + + df2 ret = { clc, dfdiv_f2_f2_f2(clln, clld) }; + + return ret; +} + +EXPORT CONST float xtgammaf_u1(float a) { + df2 d = gammafk(a); + Sleef_float2 y = dfmul_f2_f2_f2(expk2f(d.a), d.b); + float r = y.x + y.y; + r = (a == -SLEEF_INFINITYf || (a < 0 && xisintf(a)) || (xisnumberf(a) && a < 0 && xisnanf(r))) ? SLEEF_NANf : r; + r = ((a == SLEEF_INFINITYf || xisnumberf(a)) && a >= -FLT_MIN && (a == 0 || a > 36 || xisnanf(r))) ? mulsignf(SLEEF_INFINITYf, a) : r; + return r; +} + +EXPORT CONST float xlgammaf_u1(float a) { + df2 d = gammafk(a); + Sleef_float2 y = dfadd2_f2_f2_f2(d.a, logk2f(dfabs_f2_f2(d.b))); + float r = y.x + y.y; + r = (xisinff(a) || (a <= 0 && xisintf(a)) || (xisnumberf(a) && xisnanf(r))) ? SLEEF_INFINITYf : r; + return r; +} + +static INLINE CONST Sleef_float2 dfmla(float x, Sleef_float2 y, Sleef_float2 z) { + return dfadd2_f2_f2_f2(z, dfmul_f2_f2_f(y, x)); +} +static INLINE CONST Sleef_float2 poly2df_b(float x, Sleef_float2 c1, Sleef_float2 c0) { return dfmla(x, c1, c0); } +static INLINE CONST Sleef_float2 poly2df(float x, float c1, Sleef_float2 c0) { return dfmla(x, df(c1, 0), c0); } +static INLINE CONST Sleef_float2 poly4df(float x, float c3, Sleef_float2 c2, Sleef_float2 c1, Sleef_float2 c0) { + return dfmla(x*x, poly2df(x, c3, c2), poly2df_b(x, c1, c0)); +} + +EXPORT CONST float xerff_u1(float a) { + float t, x = fabsfk(a); + Sleef_float2 t2; + float x2 = x * x, x4 = x2 * x2; + + if (x < 2.5) { + // Abramowitz and Stegun + t = POLY6(x, x2, x4, + -0.4360447008e-6, + +0.6867515367e-5, + -0.3045156700e-4, + +0.9808536561e-4, + +0.2395523916e-3, + +0.1459901541e-3); + t2 = poly4df(x, t, + df(0.0092883445322513580322, -2.7863745897025330755e-11), + df(0.042275499552488327026, 1.3461399289988106057e-09), + df(0.070523701608180999756, -3.6616309318707365163e-09)); + t2 = dfadd_f2_f_f2(1, dfmul_f2_f2_f(t2, x)); + t2 = dfsqu_f2_f2(t2); + t2 = dfsqu_f2_f2(t2); + t2 = dfsqu_f2_f2(t2); + t2 = dfsqu_f2_f2(t2); + t2 = dfrec_f2_f2(t2); + } else if (x > 4.0) { + t2 = df(0, 0); + } else { + t = POLY6(x, x2, x4, + -0.1130012848e-6, + +0.4115272986e-5, + -0.6928304356e-4, + +0.7172692567e-3, + -0.5131045356e-2, + +0.2708637156e-1); + t2 = poly4df(x, t, + df(-0.11064319312572479248, 3.7050452777225283007e-09), + df(-0.63192230463027954102, -2.0200432585073177859e-08), + df(-1.1296638250350952148, 2.5515120196453259252e-08)); + t2 = dfmul_f2_f2_f(t2, x); + t2 = df(expkf(t2), 0); + } + + t2 = dfadd2_f2_f2_f(t2, -1); + + if (x < 1e-4) t2 = dfmul_f2_f2_f(df(-1.1283792257308959961, 5.8635383422197591097e-08), x); + return mulsignf(a == 0 ? 0 : (xisinff(a) ? 1 : (-t2.x - t2.y)), a); +} + +EXPORT CONST float xerfcf_u15(float a) { + float s = a, r = 0, t; + Sleef_float2 u, d, x; + a = fabsfk(a); + int o0 = a < 1.0f, o1 = a < 2.2f, o2 = a < 4.3f, o3 = a < 10.1f; + u = o1 ? df(a, 0) : dfdiv_f2_f2_f2(df(1, 0), df(a, 0)); + + t = o0 ? -0.8638041618e-4f : o1 ? -0.6236977242e-5f : o2 ? -0.3869504035e+0f : +0.1115344167e+1f; + t = mlaf(t, u.x, o0 ? +0.6000166177e-3f : o1 ? +0.5749821503e-4f : o2 ? +0.1288077235e+1f : -0.9454904199e+0f); + t = mlaf(t, u.x, o0 ? -0.1665703603e-2f : o1 ? +0.6002851478e-5f : o2 ? -0.1816803217e+1f : -0.3667259514e+0f); + t = mlaf(t, u.x, o0 ? +0.1795156277e-3f : o1 ? -0.2851036377e-2f : o2 ? +0.1249150872e+1f : +0.7155663371e+0f); + t = mlaf(t, u.x, o0 ? +0.1914106123e-1f : o1 ? +0.2260518074e-1f : o2 ? -0.1328857988e+0f : -0.1262947265e-1f); + + d = dfmul_f2_f2_f(u, t); + d = dfadd2_f2_f2_f2(d, o0 ? dfx(-0.102775359343930288081655368891e+0) : + o1 ? dfx(-0.105247583459338632253369014063e+0) : + o2 ? dfx(-0.482365310333045318680618892669e+0) : + dfx(-0.498961546254537647970305302739e+0)); + d = dfmul_f2_f2_f2(d, u); + d = dfadd2_f2_f2_f2(d, o0 ? dfx(-0.636619483208481931303752546439e+0) : + o1 ? dfx(-0.635609463574589034216723775292e+0) : + o2 ? dfx(-0.134450203224533979217859332703e-2) : + dfx(-0.471199543422848492080722832666e-4)); + d = dfmul_f2_f2_f2(d, u); + d = dfadd2_f2_f2_f2(d, o0 ? dfx(-0.112837917790537404939545770596e+1) : + o1 ? dfx(-0.112855987376668622084547028949e+1) : + o2 ? dfx(-0.572319781150472949561786101080e+0) : + dfx(-0.572364030327966044425932623525e+0)); + + x = dfmul_f2_f2_f(o1 ? d : df(-a, 0), a); + x = o1 ? x : dfadd2_f2_f2_f2(x, d); + + x = expk2f(x); + x = o1 ? x : dfmul_f2_f2_f2(x, u); + + r = o3 ? (x.x + x.y) : 0; + if (s < 0) r = 2 - r; + r = xisnanf(s) ? SLEEF_NANf : r; + return r; +} + +// + +#ifdef ENABLE_MAIN +// gcc -w -DENABLE_MAIN -I../common sleefsp.c rempitab.c -lm +#include +int main(int argc, char **argv) { + float d1 = atof(argv[1]); + //float d2 = atof(argv[2]); + //float d3 = atof(argv[3]); + //printf("%.20g, %.20g\n", (double)d1, (double)d2); + //float i2 = atoi(argv[2]); + //float c = xatan2f_u1(d1, d2); + //printf("round %.20g\n", (double)d1); + printf("test = %.20g\n", (double)xsqrtf_u05(d1)); + //printf("correct = %.20g\n", (double)roundf(d1)); + //printf("rint %.20g\n", (double)d1); + //printf("test = %.20g\n", (double)xrintf(d1)); + //printf("correct = %.20g\n", (double)rintf(d1)); + //Sleef_float2 r = xsincospif_u35(d); + //printf("%g, %g\n", (double)r.x, (double)r.y); +} +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvsx3.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvsx3.c new file mode 100644 index 0000000000000..b53c750b7cc4a --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvsx3.c @@ -0,0 +1,8 @@ +#include + +__vector double sleef_cpuid_VSX0; +__vector unsigned long long sleef_cpuid_VSX1, sleef_cpuid_VSX3; + +void sleef_tryVSX3() { + sleef_cpuid_VSX0 = vec_insert_exp(sleef_cpuid_VSX1, sleef_cpuid_VSX3); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvxe2.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvxe2.c new file mode 100644 index 0000000000000..b4a73a9f863b7 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/libm/tryvxe2.c @@ -0,0 +1,8 @@ +#include + +__vector float sleef_cpuid_VXE2; +__vector int sleef_cpuid_VXE1; + +void sleef_tryVXE2() { + sleef_cpuid_VXE2 = vec_float(sleef_cpuid_VXE1); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/CMakeLists.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/CMakeLists.txt new file mode 100644 index 0000000000000..f884f1b5b96c8 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/CMakeLists.txt @@ -0,0 +1,253 @@ +link_directories(${sleef_BINARY_DIR}/lib) # libsleefquad +link_directories(${sleef_BINARY_DIR}/src/common) # common.a +include_directories(${sleef_BINARY_DIR}/include) # sleef.h, sleefquad.h +include_directories(${sleef_SOURCE_DIR}/src/quad) # qrename.h +include_directories(${sleef_BINARY_DIR}/src/quad/include) # rename headers + +if(NOT LIB_MPFR) + find_program(QTESTER_COMMAND qtester) +endif(NOT LIB_MPFR) + +find_library(LIBRT rt) +if (NOT LIBRT) + set(LIBRT "") +endif() + +set(CMAKE_C_FLAGS "${ORG_CMAKE_C_FLAGS} ${SLEEF_C_FLAGS} ${FLAGS_NOSTRICTALIASING}") + +if(COMPILER_SUPPORTS_FLOAT128) + list(APPEND COMMON_TARGET_DEFINITIONS ENABLEFLOAT128=1) +endif() + +# + +if(SLEEF_OPENSSL_FOUND) + # Build tester3printf + add_executable(tester3printf tester3printf.c) + add_dependencies(tester3printf sleefquad sleefquad_headers ${TARGET_LIBSLEEF} ${TARGET_HEADERS}) + target_compile_definitions(tester3printf PRIVATE ${COMMON_TARGET_DEFINITIONS}) + set_target_properties(tester3printf PROPERTIES C_STANDARD 99) + target_link_libraries(tester3printf sleefquad ${TARGET_LIBSLEEF} ${SLEEF_OPENSSL_LIBRARIES}) + target_include_directories(tester3printf PRIVATE ${SLEEF_OPENSSL_INCLUDE_DIR}) + + if (SDE_COMMAND) + add_test(NAME tester3printf COMMAND ${SDE_COMMAND} "--" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3printf ${sleef_SOURCE_DIR}/src/quad-tester/hash_printf.txt) + elseif(EMULATOR) + add_test(NAME tester3printf COMMAND ${EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tester3printf ${sleef_SOURCE_DIR}/src/quad-tester/hash_printf.txt) + else() + add_test(NAME tester3printf COMMAND tester3printf ${sleef_SOURCE_DIR}/src/quad-tester/hash_printf.txt) + endif() + set_tests_properties(tester3printf PROPERTIES COST 5.0) +endif() + +# + +function(add_test_iut IUT C) + if (LIB_MPFR) + set(QTESTER qtester) + elseif(QTESTER_COMMAND) + set(QTESTER ${QTESTER_COMMAND}) + endif() + # When we are crosscompiling using the mkrename* tools from a native + # build, we use the tester executable from the native build. + if (CMAKE_CROSSCOMPILING AND NATIVE_BUILD_DIR) + set(QTESTER ${NATIVE_BUILD_DIR}/bin/qtester) + endif(CMAKE_CROSSCOMPILING AND NATIVE_BUILD_DIR) + if (QTESTER) + if (NOT EMULATOR) + if (SDE_COMMAND) + set(FLAGS_SDE "--sde" ${SDE_COMMAND}) + else() + set(FLAGS_SDE) + endif() + if (ARMIE_COMMAND) + set(FLAGS_ARMIE ${ARMIE_COMMAND} -msve-vector-bits=${SVE_VECTOR_BITS}) + else() + set(FLAGS_ARMIE) + endif() + add_test(NAME ${IUT} + COMMAND ${QTESTER} ${FLAGS_SDE} ${FLAGS_ARMIE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${IUT} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set_tests_properties(${IUT} PROPERTIES COST ${C}) + else() + add_test(NAME ${IUT} + COMMAND ${QTESTER} "--qemu" ${EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${IUT} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set_tests_properties(${IUT} PROPERTIES COST ${C}) + endif() + endif() +endfunction() + +# Add vector extension `iut`s +set(IUT_SRC qiutsimd.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c qtesterutil.c) + +macro(test_extension SIMD) + if(COMPILER_SUPPORTS_${SIMD}) + string(TOLOWER ${SIMD} LCSIMD) + string(CONCAT TARGET_IUT${SIMD} "qiut" ${LCSIMD}) + + add_executable(${TARGET_IUT${SIMD}} ${IUT_SRC}) + target_compile_options(${TARGET_IUT${SIMD}} + PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${TARGET_IUT${SIMD}} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(${TARGET_IUT${SIMD}} sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + + add_dependencies(${TARGET_IUT${SIMD}} sleefquad_headers ${TARGET_HEADERS}) + add_dependencies(${TARGET_IUT${SIMD}} sleefquad ${TARGET_LIBSLEEF}) + set_target_properties(${TARGET_IUT${SIMD}} PROPERTIES C_STANDARD 99) + if (DEFINED COSTOVERRIDE_${SIMD}) + math(EXPR C "${COSTOVERRIDE_${SIMD}} + 1") + add_test_iut(${TARGET_IUT${SIMD}} ${C}) + else() + add_test_iut(${TARGET_IUT${SIMD}} 0.5) + endif() + list(APPEND IUT_LIST ${TARGET_IUT${SIMD}}) + + # The iut programs whose names begin with "qiuti" are the iut for the + # inline version of quad functions. + + if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) + if (MSVC AND NOT SLEEF_CLANG_ON_WINDOWS) + message(STATUS "Quad inline headers are not tested with MSVC") + else() + string(CONCAT IUTINAME "qiuti" ${LCSIMD}) + add_executable(${IUTINAME} ${IUT_SRC}) + target_compile_options(${IUTINAME} + PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${IUTINAME} + PRIVATE ENABLE_${SIMD}=1 ${COMMON_TARGET_DEFINITIONS} + USE_INLINE_HEADER="sleefquadinline_${LCSIMD}.h" + MACRO_ONLY_HEADER="qmacroonly${SIMD}.h" + SIMD_SUFFIX=_${LCSIMD}_sleefq + ) + target_include_directories(${IUTINAME} PRIVATE ${PROJECT_BINARY_DIR}/include) + target_link_libraries(${IUTINAME} ${LIBM} ${LIBRT}) + add_dependencies(${IUTINAME} ${TARGET_QINLINE_HEADERS}) + set_target_properties(${IUTINAME} PROPERTIES C_STANDARD 99) + if (DEFINED COSTOVERRIDE_${SIMD}) + math(EXPR C "${COSTOVERRIDE_${SIMD}} + 1") + add_test_iut(${IUTINAME} ${C}) + else() + add_test_iut(${IUTINAME} 0.5) + endif() + list(APPEND IUT_LIST ${IUTINAME}) + endif() + endif(SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND) + + if(LIB_MPFR AND NOT MINGW) + # Build qtester2 SIMD + string(TOLOWER ${SIMD} SIMDLC) + set(T "tester2${SIMDLC}qp") + add_executable(${T} tester2simdqp.c qtesterutil.c) + target_compile_options(${T} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + target_compile_definitions(${T} PRIVATE ENABLE_${SIMD}=1 USEMPFR=1 ${COMMON_TARGET_DEFINITIONS}) + set_target_properties(${T} PROPERTIES C_STANDARD 99) + target_link_libraries(${T} sleefquad ${TARGET_LIBSLEEF} ${LIB_MPFR} ${LIBM} ${LIBGMP}) + add_dependencies(${T} sleefquad sleefquad_headers ${TARGET_LIBSLEEF} ${TARGET_HEADERS}) + if (MPFR_INCLUDE_DIR) + target_include_directories(${T} PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + endif() + endif(COMPILER_SUPPORTS_${SIMD}) +endmacro(test_extension) + +foreach(SIMD ${SLEEF_SUPPORTED_QUAD_EXTENSIONS}) + test_extension(${SIMD}) +endforeach() + +# Compile executable 'qiutdspscalar' + +add_executable(qiutdspscalar ${IUT_SRC}) +target_compile_definitions(qiutdspscalar PRIVATE ENABLE_DSPSCALAR=1 ${COMMON_TARGET_DEFINITIONS}) +target_link_libraries(qiutdspscalar sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) +set_target_properties(qiutdspscalar PROPERTIES C_STANDARD 99) +add_dependencies(qiutdspscalar sleefquad_headers ${TARGET_HEADERS}) +add_dependencies(qiutdspscalar sleefquad ${TARGET_LIBSLEEF}) +add_test_iut(qiutdspscalar 0.5) +list(APPEND IUT_LIST qiutdspscalar) + +if (SLEEF_ARCH_X86) + # Compile executable 'qiutdspx2' + add_executable(qiutdspx2 ${IUT_SRC}) + target_compile_definitions(qiutdspx2 PRIVATE ENABLE_DSPX2_X86=1 ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(qiutdspx2 sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + set_target_properties(qiutdspx2 PROPERTIES C_STANDARD 99) + add_dependencies(qiutdspx2 sleefquad_headers ${TARGET_HEADERS}) + add_dependencies(qiutdspx2 sleefquad ${TARGET_LIBSLEEF}) + add_test_iut(qiutdspx2 0.5) + list(APPEND IUT_LIST qiutdspx2) +endif() + +if (SLEEF_ARCH_AARCH64) + # Compile executable 'qiutdspx2' + add_executable(qiutdspx2 ${IUT_SRC}) + target_compile_definitions(qiutdspx2 PRIVATE ENABLE_DSPX2_AARCH64=1 ${COMMON_TARGET_DEFINITIONS}) + set_target_properties(qiutdspx2 PROPERTIES C_STANDARD 99) + target_link_libraries(qiutdspx2 sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(qiutdspx2 sleefquad_headers ${TARGET_HEADERS}) + add_dependencies(qiutdspx2 sleefquad ${TARGET_LIBSLEEF}) + add_test_iut(qiutdspx2 0.5) + list(APPEND IUT_LIST qiutdspx2) +endif() + +if (SLEEF_ARCH_PPC64) + # Compile executable 'qiutdspx2' + add_executable(qiutdspx2 ${IUT_SRC}) + target_compile_options(qiutdspx2 PRIVATE ${FLAGS_ENABLE_VSX}) + set_target_properties(qiutdspx2 PROPERTIES C_STANDARD 99) + target_compile_definitions(qiutdspx2 PRIVATE ENABLE_DSPX2_PPC64=1 ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(qiutdspx2 sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(qiutdspx2 sleefquad_headers ${TARGET_HEADERS}) + add_dependencies(qiutdspx2 sleefquad ${TARGET_LIBSLEEF}) + add_test_iut(qiutdspx2 0.5) + list(APPEND IUT_LIST qiutdspx2) +endif() + +if (SLEEF_ARCH_S390X) + # Compile executable 'qiutdspx2' + add_executable(qiutdspx2 ${IUT_SRC}) + target_compile_options(qiutdspx2 PRIVATE ${FLAGS_ENABLE_VXE}) + set_target_properties(qiutdspx2 PROPERTIES C_STANDARD 99) + target_compile_definitions(qiutdspx2 PRIVATE ENABLE_DSPX2_S390X=1 ${COMMON_TARGET_DEFINITIONS}) + target_link_libraries(qiutdspx2 sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIBRT}) + add_dependencies(qiutdspx2 sleefquad_headers ${TARGET_HEADERS}) + add_dependencies(qiutdspx2 sleefquad ${TARGET_LIBSLEEF}) + add_test_iut(qiutdspx2 0.5) + list(APPEND IUT_LIST qiutdspx2) +endif() + +# Compile executable 'qiutcuda' + +if (SLEEF_BUILD_INLINE_HEADERS AND SED_COMMAND AND CMAKE_CUDA_COMPILER) + add_executable(qiutcuda qiutcuda.cu) + set_target_properties(qiutcuda PROPERTIES LINKER_LANGUAGE CUDA) + target_compile_options(qiutcuda PRIVATE "--fmad=false;-Xcompiler;-ffp-contract=off") + add_dependencies(qiutcuda ${TARGET_QINLINE_HEADERS}) + add_test_iut(qiutcuda 1.0) + list(APPEND IUT_LIST qiutcuda) +endif() + +# + +if(LIB_MPFR AND NOT MINGW) + # Compile executable 'qtester' + add_host_executable(qtester qtester.c qtesterutil.c) + if (NOT CMAKE_CROSSCOMPILING) + target_link_libraries(qtester sleefquad ${TARGET_LIBSLEEF} ${LIBM} ${LIB_MPFR} ${LIBGMP}) + target_compile_definitions(qtester PRIVATE USEMPFR=1 ${COMMON_TARGET_DEFINITIONS}) + target_compile_options(qtester PRIVATE -Wno-unused-result) + set_target_properties(qtester PROPERTIES C_STANDARD 99) + if (MPFR_INCLUDE_DIR) + target_include_directories(qtester PRIVATE ${MPFR_INCLUDE_DIR}) + endif() + endif() +endif(LIB_MPFR AND NOT MINGW) + +# BUild qutil + +add_executable(qutil qutil.c) +add_dependencies(qutil sleefquad sleefquad_headers ${TARGET_LIBSLEEF} ${TARGET_HEADERS}) +target_compile_definitions(qutil PRIVATE ${COMMON_TARGET_DEFINITIONS}) +set_target_properties(qutil PROPERTIES C_STANDARD 99) +target_link_libraries(qutil sleefquad) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/hash_printf.txt b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/hash_printf.txt new file mode 100644 index 0000000000000..5e6919d554cc3 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/hash_printf.txt @@ -0,0 +1,4 @@ +Pe 7ff4a1686c831c7a9b1bd62faffe9b14 +Pf 84331dfc378b032877f7a07767db7cc5 +Pg 2351f96a90d34bf4dd80dd6341a47624 +Pa ad6bb18af2f2648e791098ebf87ce25d diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutcuda.cu b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutcuda.cu new file mode 100644 index 0000000000000..3baca09029ee8 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutcuda.cu @@ -0,0 +1,472 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sleefquadinline_cuda.h" +#include "sleefquadinline_purec_scalar.h" + +#define STDIN_FILENO 0 + +// + +static int startsWith(const char *str, const char *prefix) { + while(*prefix != '\0') if (*str++ != *prefix++) return 0; + return *prefix == '\0'; +} + +static double u2d(uint64_t u) { + union { + double f; + uint64_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint64_t d2u(double d) { + union { + double f; + uint64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +// + +__global__ void xaddq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_addq1_u05cuda(*a0, *a1); } +__global__ void xsubq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_subq1_u05cuda(*a0, *a1); } +__global__ void xmulq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_mulq1_u05cuda(*a0, *a1); } +__global__ void xdivq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_divq1_u05cuda(*a0, *a1); } +__global__ void xnegq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_negq1_cuda(*a0); } + +__global__ void xicmpltq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpltq1_cuda(*a0, *a1); } +__global__ void xicmpgtq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpgtq1_cuda(*a0, *a1); } +__global__ void xicmpleq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpleq1_cuda(*a0, *a1); } +__global__ void xicmpgeq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpgeq1_cuda(*a0, *a1); } +__global__ void xicmpeqq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpeqq1_cuda(*a0, *a1); } +__global__ void xicmpneq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpneq1_cuda(*a0, *a1); } +__global__ void xicmpq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_icmpq1_cuda(*a0, *a1); } +__global__ void xiunordq(int *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_iunordq1_cuda(*a0, *a1); } + +__global__ void xcast_from_doubleq(Sleef_quadx1 *r0, double *d0) { *r0 = Sleef_cast_from_doubleq1_cuda(*d0); } +__global__ void xcast_to_doubleq(double *r0, Sleef_quadx1 *a0) { *r0 = Sleef_cast_to_doubleq1_cuda(*a0); } +__global__ void xcast_from_int64q(Sleef_quadx1 *r0, int64_t *i0) { *r0 = Sleef_cast_from_int64q1_cuda(*i0); } +__global__ void xcast_to_int64q(int64_t *r0, Sleef_quadx1 *a0) { *r0 = Sleef_cast_to_int64q1_cuda(*a0); } +__global__ void xcast_from_uint64q(Sleef_quadx1 *r0, uint64_t *u0) { *r0 = Sleef_cast_from_uint64q1_cuda(*u0); } +__global__ void xcast_to_uint64q(uint64_t *r0, Sleef_quadx1 *a0) { *r0 = Sleef_cast_to_uint64q1_cuda(*a0); } + +__global__ void xsqrtq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_sqrtq1_u05cuda(*a0); } +__global__ void xcbrtq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_cbrtq1_u10cuda(*a0); } +__global__ void xsinq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_sinq1_u10cuda(*a0); } +__global__ void xcosq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_cosq1_u10cuda(*a0); } +__global__ void xtanq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_tanq1_u10cuda(*a0); } +__global__ void xasinq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_asinq1_u10cuda(*a0); } +__global__ void xacosq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_acosq1_u10cuda(*a0); } +__global__ void xatanq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_atanq1_u10cuda(*a0); } +__global__ void xatan2q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_atan2q1_u10cuda(*a0, *a1); } +__global__ void xexpq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_expq1_u10cuda(*a0); } +__global__ void xexp2q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_exp2q1_u10cuda(*a0); } +__global__ void xexp10q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_exp10q1_u10cuda(*a0); } +__global__ void xexpm1q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_expm1q1_u10cuda(*a0); } +__global__ void xlogq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_logq1_u10cuda(*a0); } +__global__ void xlog2q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_log2q1_u10cuda(*a0); } +__global__ void xlog10q_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_log10q1_u10cuda(*a0); } +__global__ void xlog1pq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_log1pq1_u10cuda(*a0); } +__global__ void xpowq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_powq1_u10cuda(*a0, *a1); } +__global__ void xsinhq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_sinhq1_u10cuda(*a0); } +__global__ void xcoshq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_coshq1_u10cuda(*a0); } +__global__ void xtanhq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_tanhq1_u10cuda(*a0); } +__global__ void xasinhq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_asinhq1_u10cuda(*a0); } +__global__ void xacoshq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_acoshq1_u10cuda(*a0); } +__global__ void xatanhq_u10(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_atanhq1_u10cuda(*a0); } + +__global__ void xfabsq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_fabsq1_cuda(*a0); } +__global__ void xcopysignq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_copysignq1_cuda(*a0, *a1); } +__global__ void xfmaxq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_fmaxq1_cuda(*a0, *a1); } +__global__ void xfminq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_fminq1_cuda(*a0, *a1); } +__global__ void xfdimq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_fdimq1_u05cuda(*a0, *a1); } +__global__ void xfmodq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_fmodq1_cuda(*a0, *a1); } +__global__ void xremainderq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_remainderq1_cuda(*a0, *a1); } +__global__ void xfrexpq(Sleef_quadx1 *r, Sleef_quadx1 *a0, int *i0) { *r = Sleef_frexpq1_cuda(*a0, i0); } +__global__ void xmodfq(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_modfq1_cuda(*a0, a1); } +__global__ void xfmaq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1, Sleef_quadx1 *a2) { *r = Sleef_fmaq1_u05cuda(*a0, *a1, *a2); } +__global__ void xhypotq_u05(Sleef_quadx1 *r, Sleef_quadx1 *a0, Sleef_quadx1 *a1) { *r = Sleef_hypotq1_u05cuda(*a0, *a1); } +__global__ void xilogbq(int *r, Sleef_quadx1 *a0) { *r = Sleef_ilogbq1_cuda(*a0); } +__global__ void xldexpq(Sleef_quadx1 *r, Sleef_quadx1 *a0, int *i0) { *r = Sleef_ldexpq1_cuda(*a0, *i0); } + +__global__ void xtruncq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_truncq1_cuda(*a0); } +__global__ void xfloorq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_floorq1_cuda(*a0); } +__global__ void xceilq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_ceilq1_cuda(*a0); } +__global__ void xroundq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_roundq1_cuda(*a0); } +__global__ void xrintq(Sleef_quadx1 *r, Sleef_quadx1 *a0) { *r = Sleef_rintq1_cuda(*a0); } + +// + +typedef union { + Sleef_quad q; + struct { + uint64_t l, h; + }; +} cnv128; + +#define BUFSIZE 1024 + +#define func_q_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(r, a0); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_q_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0, c1; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l, &c1.h, &c1.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + *a1 = Sleef_setq1_cuda(*a1, 0, c1.q); \ + funcName<<<1, 1>>>(r, a0, a1); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_q_q_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0, c1, c2; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64, \ + &c0.h, &c0.l, &c1.h, &c1.l, &c2.h, &c2.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + *a1 = Sleef_setq1_cuda(*a1, 0, c1.q); \ + *a2 = Sleef_setq1_cuda(*a2, 0, c2.q); \ + funcName<<<1, 1>>>(r, a0, a1, a2); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_i_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(i0, a0); \ + cudaDeviceSynchronize(); \ + printf("%d\n", *i0); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_i_q_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0, c1; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l, &c1.h, &c1.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + *a1 = Sleef_setq1_cuda(*a1, 0, c1.q); \ + funcName<<<1, 1>>>(i0, a0, a1); \ + cudaDeviceSynchronize(); \ + printf("%d\n", *i0); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_q_i(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + int k; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64 " %d", &c0.h, &c0.l, &k); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + *i0 = k; \ + funcName<<<1, 1>>>(r, a0, i0); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_d_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(d0, a0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", d2u(*d0)); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_d(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + uint64_t u; \ + sscanf(buf, funcStr " %" PRIx64, &u); \ + *d0 = u2d(u); \ + funcName<<<1, 1>>>(r, d0); \ + cudaDeviceSynchronize(); \ + cnv128 c0; \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_i64_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(i64, a0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", *i64); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_i64(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + sscanf(buf, funcStr " %" PRIx64, i64); \ + funcName<<<1, 1>>>(r, i64); \ + cudaDeviceSynchronize(); \ + cnv128 c0; \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_u64_q(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(u64, a0); \ + cudaDeviceSynchronize(); \ + printf("%" PRIx64 "\n", *u64); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_u64(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + sscanf(buf, funcStr " %" PRIx64, u64); \ + funcName<<<1, 1>>>(r, u64); \ + cudaDeviceSynchronize(); \ + cnv128 c0; \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_q_pi(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(r, a0, i0); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + printf("%" PRIx64 ":%" PRIx64 " %d\n", c0.h, c0.l, *i0); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +#define func_q_q_pq(funcStr, funcName) { \ + while (startsWith(buf, funcStr " ")) { \ + sentinel = 0; \ + cnv128 c0, c1; \ + sscanf(buf, funcStr " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + *a0 = Sleef_setq1_cuda(*a0, 0, c0.q); \ + funcName<<<1, 1>>>(r, a0, a1); \ + cudaDeviceSynchronize(); \ + c0.q = Sleef_getq1_cuda(*r, 0); \ + c1.q = Sleef_getq1_cuda(*a1, 0); \ + printf("%" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l, c1.h, c1.l); \ + fflush(stdout); \ + if (fgets(buf, BUFSIZE-1, stdin) == NULL) break; \ + } \ + } + +int main(int argc, char **argv) { +#if 0 + cuInit(0); + + int ndevice; + cuDeviceGetCount(&ndevice); + if (ndevice == 0) { + fprintf(stderr, "No cuda device available\n"); + exit(0); + } + + CUdevice device; + char deviceName[1024]; + cuDeviceGet(&device, 0); + cuDeviceGetName(deviceName, 1000, device); + fprintf(stderr, "Device : %s\n", deviceName); +#endif + + cudaSetDeviceFlags(cudaDeviceScheduleSpin); + + Sleef_quadx1 *r, *a0, *a1, *a2; + double *d0; + int *i0; + int64_t *i64; + uint64_t *u64; + cudaMallocManaged(&r , 1*sizeof(Sleef_quadx1)); + cudaMallocManaged(&a0, 1*sizeof(Sleef_quadx1)); + cudaMallocManaged(&a1, 1*sizeof(Sleef_quadx1)); + cudaMallocManaged(&a2, 1*sizeof(Sleef_quadx1)); + cudaMallocManaged(&d0, 1*sizeof(double)); + cudaMallocManaged(&i0, 1*sizeof(int)); + cudaMallocManaged(&i64, 1*sizeof(int64_t)); + cudaMallocManaged(&u64, 1*sizeof(uint64_t)); + + // + + printf("1\n"); + fflush(stdout); + + // + + { + *a0 = Sleef_setq1_cuda(*a0, 0, SLEEF_M_PIq); + *a1 = Sleef_setq1_cuda(*a1, 0, Sleef_strtoq("2.718281828459045235360287471352662498", NULL)); + xmulq_u05<<<1, 1>>>(r, a0, a1); + cudaDeviceSynchronize(); + Sleef_quad v0 = Sleef_getq1_cuda(*r, 0); + if (Sleef_icmpneq1_purec(v0, sleef_q(+0x1114580b45d47LL, 0x49e6108579a2d0caULL, 3))) { + fprintf(stderr, "Testing with Sleef_mulq1_u05cuda failed\n"); + exit(-1); + } + } + + // + + char buf[BUFSIZE]; + if (fgets(buf, BUFSIZE-1, stdin)) {} + int sentinel = 0; + + while(!feof(stdin) && sentinel < 2) { + func_q_q_q("addq_u05", xaddq_u05); + func_q_q_q("subq_u05", xsubq_u05); + func_q_q_q("mulq_u05", xmulq_u05); + func_q_q_q("divq_u05", xdivq_u05); + func_q_q("sqrtq_u05", xsqrtq_u05); + func_q_q("cbrtq_u10", xcbrtq_u10); + func_q_q("sinq_u10", xsinq_u10); + func_q_q("cosq_u10", xcosq_u10); + func_q_q("tanq_u10", xtanq_u10); + func_q_q("asinq_u10", xasinq_u10); + func_q_q("acosq_u10", xacosq_u10); + func_q_q("atanq_u10", xatanq_u10); + func_q_q_q("atan2q_u10", xatan2q_u10); + func_q_q("expq_u10", xexpq_u10); + func_q_q("exp2q_u10", xexp2q_u10); + func_q_q("exp10q_u10", xexp10q_u10); + func_q_q("expm1q_u10", xexpm1q_u10); + func_q_q("logq_u10", xlogq_u10); + func_q_q("log2q_u10", xlog2q_u10); + func_q_q("log10q_u10", xlog10q_u10); + func_q_q("log1pq_u10", xlog1pq_u10); + func_q_q_q("powq_u10", xpowq_u10); + func_q_q("sinhq_u10", xsinhq_u10); + func_q_q("coshq_u10", xcoshq_u10); + func_q_q("tanhq_u10", xtanhq_u10); + func_q_q("asinhq_u10", xasinhq_u10); + func_q_q("acoshq_u10", xacoshq_u10); + func_q_q("atanhq_u10", xatanhq_u10); + + func_q_q("negq", xnegq); + func_q_q("fabsq", xfabsq); + func_q_q_q("copysignq", xcopysignq); + func_q_q_q("fmaxq", xfmaxq); + func_q_q_q("fminq", xfminq); + func_q_q_q("fdimq_u05", xfdimq_u05); + func_q_q_q("fmodq", xfmodq); + func_q_q_q("remainderq", xremainderq); + func_q_q_pi("frexpq", xfrexpq); + func_q_q_pq("modfq", xmodfq); + func_i_q("ilogbq", xilogbq); + func_q_q_i("ldexpq", xldexpq); + func_q_q_q_q("fmaq_u05", xfmaq_u05); + func_q_q_q("hypotq_u05", xhypotq_u05); + + func_q_q("truncq", xtruncq); + func_q_q("floorq", xfloorq); + func_q_q("ceilq", xceilq); + func_q_q("roundq", xroundq); + func_q_q("rintq", xrintq); + + func_q_d("cast_from_doubleq", xcast_from_doubleq); + func_d_q("cast_to_doubleq", xcast_to_doubleq); + func_q_i64("cast_from_int64q", xcast_from_int64q); + func_i64_q("cast_to_int64q", xcast_to_int64q); + func_q_u64("cast_from_uint64q", xcast_from_uint64q); + func_u64_q("cast_to_uint64q", xcast_to_uint64q); + + func_i_q_q("icmpltq", xicmpltq); + func_i_q_q("icmpgtq", xicmpgtq); + func_i_q_q("icmpleq", xicmpleq); + func_i_q_q("icmpgeq", xicmpgeq); + func_i_q_q("icmpeqq", xicmpeqq); + func_i_q_q("icmpneq", xicmpneq); + func_i_q_q("icmpq", xicmpq); + func_i_q_q("iunordq", xiunordq); + + sentinel++; + } + + // + + return 0; +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutsimd.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutsimd.c new file mode 100644 index 0000000000000..b15eecf8bae68 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qiutsimd.c @@ -0,0 +1,804 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#if defined(_MSC_VER) +#define STDIN_FILENO 0 +#else +#include +#include +#endif + +#include "quaddef.h" +#include "misc.h" + +#if !defined(USE_INLINE_HEADER) +#include "sleef.h" +#include "sleefquad.h" +#else // #if !defined(USE_INLINE_HEADER) +#include +#include +#include +#include +#include +#include + +#if defined(__AVX2__) || defined(__aarch64__) || defined(__arm__) || defined(__powerpc64__) +#ifndef FP_FAST_FMA +#define FP_FAST_FMA +#endif +#endif + +#if defined(_MSC_VER) && !defined(__STDC__) +#define __STDC__ 1 +#endif + +#if (defined(__GNUC__) || defined(__CLANG__)) && (defined(__i386__) || defined(__x86_64__)) +#include +#endif + +#if (defined(_MSC_VER)) +#include +#endif + +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#include +#endif + +#if defined(__ARM_FEATURE_SVE) +#include +#endif + +#if defined(__riscv) && defined(__riscv_v) +#include +#endif + +#if defined(__VSX__) +#include +#endif + +#if defined(__VX__) +#include +#endif + +#define SLEEF_ALWAYS_INLINE inline +#define SLEEF_INLINE +#define SLEEF_CONST +#include USE_INLINE_HEADER +#include MACRO_ONLY_HEADER + +#ifndef ENABLE_PUREC_SCALAR +#include "sleefquadinline_purec_scalar.h" +#endif + +#endif // #if !defined(USE_INLINE_HEADER) + +#include "qtesterutil.h" + +// + +#ifdef ENABLE_PUREC_SCALAR +#include "qrenamepurec_scalar.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperpurec_scalar.h" +#define VARGQUAD Sleef_quad +#endif +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#include "qrenamepurecfma_scalar.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helperpurec_scalar.h" +#define VARGQUAD Sleef_quad +#endif +#endif + +#ifdef ENABLE_DSPSCALAR +#include "qrenamedspscalar.h" +#define CONFIG 1 +#include "helperpurec_scalar.h" +#define VARGQUAD Sleef_quad +#endif + +#ifdef ENABLE_SSE2 +#include "qrenamesse2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 2 +#include "helpersse2.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_AVX2128 +#include "qrenameavx2128.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx2_128.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_DSPX2_X86 +#include "qrenamedspx2.h" +#define CONFIG 2 +#include "helpersse2.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_AVX2 +#include "qrenameavx2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx2.h" +#define VARGQUAD Sleef_quadx4 +#endif +#endif + +#ifdef ENABLE_AVX512F +#include "qrenameavx512f.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperavx512f.h" +#define VARGQUAD Sleef_quadx8 +#endif +#endif + +#ifdef ENABLE_ADVSIMD +#include "qrenameadvsimd.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperadvsimd.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_DSPX2_AARCH64 +#include "qrenamedspx2.h" +#define CONFIG 2 +#include "helperadvsimd.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_SVE +#include "qrenamesve.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helpersve.h" +#define VARGQUAD Sleef_svquad +#endif +#define SIZEOF_VARGQUAD (svcntd()*8) +#endif + +#ifdef ENABLE_VSX +#include "qrenamevsx.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#include "helperpower_128.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_VSX3 +#include "qrenamevsx3.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 3 +#include "helperpower_128.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_DSPX2_PPC64 +#include "qrenamedspx2.h" +#define CONFIG 1 +#include "helperpower_128.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_VXE +#include "qrenamevxe.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 140 +#include "helpers390x_128.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_VXE2 +#include "qrenamevxe2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 150 +#include "helpers390x_128.h" +#define VARGQUAD Sleef_quadx2 +#endif +#endif + +#ifdef ENABLE_DSPX2_S390X +#include "qrenamedspx2.h" +#define CONFIG 140 +#include "helpers390x_128.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_RVVM1 +#include "qrenamervvm1.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#define VARGQUAD Sleef_rvvm1quad +#endif +#define SIZEOF_VARGQUAD (__riscv_vsetvlmax_e64m1()*8) +#endif + +#ifdef ENABLE_RVVM2 +#include "qrenamervvm2.h" +#if !defined(USE_INLINE_HEADER) +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#define VARGQUAD Sleef_rvvm2quad +#endif +#define SIZEOF_VARGQUAD (__riscv_vsetvlmax_e64m2()*8) +#endif + + +#ifndef VARGQUAD +#define VARGQUAD vargquad +#endif + +#ifndef SIZEOF_VARGQUAD +#define SIZEOF_VARGQUAD sizeof(VARGQUAD) +#endif + +#ifdef USE_INLINE_HEADER +#define CONCAT_SIMD_SUFFIX_(keyword, suffix) keyword ## suffix +#define CONCAT_SIMD_SUFFIX(keyword, suffix) CONCAT_SIMD_SUFFIX_(keyword, suffix) +#define vmask CONCAT_SIMD_SUFFIX(vmask, SIMD_SUFFIX) +#define vopmask CONCAT_SIMD_SUFFIX(vopmask, SIMD_SUFFIX) +#define vdouble CONCAT_SIMD_SUFFIX(vdouble, SIMD_SUFFIX) +#define vargquad CONCAT_SIMD_SUFFIX(vargquad, SIMD_SUFFIX) +#define vint CONCAT_SIMD_SUFFIX(vint, SIMD_SUFFIX) +#define vint2 CONCAT_SIMD_SUFFIX(vint2, SIMD_SUFFIX) +#define vdouble2 CONCAT_SIMD_SUFFIX(vdouble2, SIMD_SUFFIX) +#define vd2getx_vd_vd2 CONCAT_SIMD_SUFFIX(vd2getx_vd_vd2, SIMD_SUFFIX) +#define vd2gety_vd_vd2 CONCAT_SIMD_SUFFIX(vd2gety_vd_vd2, SIMD_SUFFIX) +#define vloadu_vd_p CONCAT_SIMD_SUFFIX(vloadu_vd_p, SIMD_SUFFIX) +#define vstoreu_v_p_vd CONCAT_SIMD_SUFFIX(vstoreu_v_p_vd, SIMD_SUFFIX) +#define vloadu_vi_p CONCAT_SIMD_SUFFIX(vloadu_vi_p, SIMD_SUFFIX) +#define vstoreu_v_p_vi CONCAT_SIMD_SUFFIX(vstoreu_v_p_vi, SIMD_SUFFIX) +#define vreinterpret_vm_vu64 CONCAT_SIMD_SUFFIX(vreinterpret_vm_vu64, SIMD_SUFFIX) +#define vreinterpret_vu64_vm CONCAT_SIMD_SUFFIX(vreinterpret_vu64_vm, SIMD_SUFFIX) +#define vreinterpret_vm_vi64 CONCAT_SIMD_SUFFIX(vreinterpret_vm_vi64, SIMD_SUFFIX) +#define vreinterpret_vi64_vm CONCAT_SIMD_SUFFIX(vreinterpret_vi64_vm, SIMD_SUFFIX) +#define vreinterpret_vm_vd CONCAT_SIMD_SUFFIX(vreinterpret_vm_vd, SIMD_SUFFIX) +#define vreinterpret_vd_vm CONCAT_SIMD_SUFFIX(vreinterpret_vd_vm, SIMD_SUFFIX) +#endif + +// + +int check_feature(double d, float f) { + double s[VECTLENDP]; + for(int i=0;i +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "misc.h" +#include "qtesterutil.h" + +void stop(char *mes) { + fprintf(stderr, "%s\n", mes); + exit(-1); +} + +int ptoc[2], ctop[2]; +int pid; +FILE *fpctop; + +extern char **environ; + +void startChild(const char *path, char *const argv[]) { + pipe(ptoc); + pipe(ctop); + + pid = fork(); + + assert(pid != -1); + + if (pid == 0) { + // child process + char buf0[1], buf1[1]; + + close(ptoc[1]); + close(ctop[0]); + + fflush(stdin); + fflush(stdout); + + if (dup2(ptoc[0], fileno(stdin)) == -1) exit(-1); + if (dup2(ctop[1], fileno(stdout)) == -1) exit(-1); + + setvbuf(stdin, buf0, _IONBF,0); + setvbuf(stdout, buf1, _IONBF,0); + + fflush(stdin); + fflush(stdout); + +#if !defined(__APPLE__) && !defined(__FreeBSD__) + execvpe(path, argv, environ); +#else + execvp(path, argv); +#endif + + fprintf(stderr, "execvp in startChild : %s\n", strerror(errno)); + + exit(-1); + } + + // parent process + + close(ptoc[0]); + close(ctop[1]); +} + +// + +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +typedef union { + Sleef_quad q; + struct { + uint64_t h, l; + }; +} cnv128; +#else +typedef union { + Sleef_quad q; + struct { + uint64_t l, h; + }; +} cnv128; +#endif + +#define child_q_q(funcStr, arg) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c.h, c.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c.h, &c.l); \ + return c.q; \ + } while(0) + +#define child_q2_q(funcStr, arg) do { \ + char str[256]; \ + cnv128 c0, c1; \ + c0.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 , &c0.h, &c0.l, &c1.h, &c1.l); \ + Sleef_quad2 ret = { c0.q, c1.q }; \ + return ret; \ + } while(0) + +#define child_q_q_q(funcStr, arg0, arg1) do { \ + char str[256]; \ + cnv128 c0, c1; \ + c0.q = arg0; \ + c1.q = arg1; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l, c1.h, c1.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + return c0.q; \ + } while(0) + +#define child_q_q_q_q(funcStr, arg0, arg1, arg2) do { \ + char str[256]; \ + cnv128 c0, c1, c2; \ + c0.q = arg0; \ + c1.q = arg1; \ + c2.q = arg2; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l, c1.h, c1.l, c2.h, c2.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c0.h, &c0.l); \ + return c0.q; \ + } while(0) + +#define child_i_q(funcStr, arg0) do { \ + char str[256]; \ + cnv128 c0; \ + c0.q = arg0; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + int i; \ + sscanf(str, "%d", &i); \ + return i; \ + } while(0) + +#define child_i_q_q(funcStr, arg0, arg1) do { \ + char str[256]; \ + cnv128 c0, c1; \ + c0.q = arg0; \ + c1.q = arg1; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l, c1.h, c1.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + int i; \ + sscanf(str, "%d", &i); \ + return i; \ + } while(0) + +#define child_q_q_i(funcStr, arg0, arg1) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg0; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 " %d\n", c.h, c.l, arg1); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c.h, &c.l); \ + return c.q; \ + } while(0) + +#define child_d_q(funcStr, arg) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c.h, c.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + uint64_t u; \ + sscanf(str, "%" PRIx64, &u); \ + return u2d(u); \ + } while(0) + +#define child_q_d(funcStr, arg) do { \ + char str[256]; \ + sprintf(str, funcStr " %" PRIx64 "\n", d2u(arg)); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + cnv128 c; \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c.h, &c.l); \ + return c.q; \ + } while(0) + +#define child_m_q(funcStr, arg) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c.h, c.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + uint64_t u; \ + sscanf(str, "%" PRIx64, &u); \ + return u; \ + } while(0) + +#define child_q_m(funcStr, arg) do { \ + char str[256]; \ + sprintf(str, funcStr " %" PRIx64 "\n", arg); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + cnv128 c; \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c.h, &c.l); \ + return c.q; \ + } while(0) + +#define child_q_q_pi(funcStr, arg) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c.h, c.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + int i; \ + sscanf(str, "%" PRIx64 ":%" PRIx64 " %d", &c.h, &c.l, &i); \ + *ptr = i; \ + return c.q; \ + } while(0) + +#define child_q_q_pq(funcStr, arg) do { \ + char str[256]; \ + cnv128 c0, c1; \ + c0.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c0.h, c0.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%" PRIx64 ":%" PRIx64 " %" PRIx64 ":%" PRIx64, &c0.h, &c0.l, &c1.h, &c1.l); \ + *ptr = c1.q; \ + return c0.q; \ + } while(0) + +#define child_q_str(funcStr, arg) do { \ + char str[256]; \ + sprintf(str, funcStr " %s\n", arg); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + cnv128 c; \ + sscanf(str, "%" PRIx64 ":%" PRIx64, &c.h, &c.l); \ + return c.q; \ + } while(0) + +#define child_str_q(funcStr, ret, arg) do { \ + char str[256]; \ + cnv128 c; \ + c.q = arg; \ + sprintf(str, funcStr " %" PRIx64 ":%" PRIx64 "\n", c.h, c.l); \ + write(ptoc[1], str, strlen(str)); \ + if (fgets(str, 255, fpctop) == NULL) stop("child " funcStr); \ + sscanf(str, "%63s", ret); \ + } while(0) + +Sleef_quad child_addq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("addq_u05", x, y); } +Sleef_quad child_subq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("subq_u05", x, y); } +Sleef_quad child_mulq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("mulq_u05", x, y); } +Sleef_quad child_divq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("divq_u05", x, y); } +Sleef_quad child_negq(Sleef_quad x) { child_q_q("negq", x); } + +int child_icmpltq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpltq", x, y); } +int child_icmpgtq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpgtq", x, y); } +int child_icmpleq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpleq", x, y); } +int child_icmpgeq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpgeq", x, y); } +int child_icmpeqq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpeqq", x, y); } +int child_icmpneq(Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpneq", x, y); } +int child_icmpq (Sleef_quad x, Sleef_quad y) { child_i_q_q("icmpq" , x, y); } +int child_iunordq(Sleef_quad x, Sleef_quad y) { child_i_q_q("iunordq", x, y); } + +Sleef_quad child_cast_from_doubleq(double x) { child_q_d("cast_from_doubleq", x); } +double child_cast_to_doubleq(Sleef_quad x) { child_d_q("cast_to_doubleq", x); } +Sleef_quad child_cast_from_int64q(int64_t x) { child_q_m("cast_from_int64q", x); } +int64_t child_cast_to_int64q(Sleef_quad x) { child_m_q("cast_to_int64q", x); } +Sleef_quad child_cast_from_uint64q(uint64_t x) { child_q_m("cast_from_uint64q", x); } +uint64_t child_cast_to_uint64q(Sleef_quad x) { child_m_q("cast_to_uint64q", x); } + +Sleef_quad child_strtoq(const char *s) { child_q_str("strtoq", s); } +void child_snprintf_40Qg(char *ret, Sleef_quad x) { child_str_q("snprintf_40Qg", ret, x); } +void child_snprintf_Qa(char *ret, Sleef_quad x) { child_str_q("snprintf_Qa", ret, x); } + +Sleef_quad child_sqrtq_u05(Sleef_quad x) { child_q_q("sqrtq_u05", x); } +Sleef_quad child_cbrtq_u10(Sleef_quad x) { child_q_q("cbrtq_u10", x); } +Sleef_quad child_sinq_u10(Sleef_quad x) { child_q_q("sinq_u10", x); } +Sleef_quad child_cosq_u10(Sleef_quad x) { child_q_q("cosq_u10", x); } +Sleef_quad child_tanq_u10(Sleef_quad x) { child_q_q("tanq_u10", x); } +Sleef_quad child_asinq_u10(Sleef_quad x) { child_q_q("asinq_u10", x); } +Sleef_quad child_acosq_u10(Sleef_quad x) { child_q_q("acosq_u10", x); } +Sleef_quad child_atanq_u10(Sleef_quad x) { child_q_q("atanq_u10", x); } +Sleef_quad child_atan2q_u10(Sleef_quad x, Sleef_quad y) { child_q_q_q("atan2q_u10", x, y); } +Sleef_quad child_expq_u10(Sleef_quad x) { child_q_q("expq_u10", x); } +Sleef_quad child_exp2q_u10(Sleef_quad x) { child_q_q("exp2q_u10", x); } +Sleef_quad child_exp10q_u10(Sleef_quad x) { child_q_q("exp10q_u10", x); } +Sleef_quad child_expm1q_u10(Sleef_quad x) { child_q_q("expm1q_u10", x); } +Sleef_quad child_logq_u10(Sleef_quad x) { child_q_q("logq_u10", x); } +Sleef_quad child_log2q_u10(Sleef_quad x) { child_q_q("log2q_u10", x); } +Sleef_quad child_log10q_u10(Sleef_quad x) { child_q_q("log10q_u10", x); } +Sleef_quad child_log1pq_u10(Sleef_quad x) { child_q_q("log1pq_u10", x); } +Sleef_quad child_powq_u10(Sleef_quad x, Sleef_quad y) { child_q_q_q("powq_u10", x, y); } +Sleef_quad child_sinhq_u10(Sleef_quad x) { child_q_q("sinhq_u10", x); } +Sleef_quad child_coshq_u10(Sleef_quad x) { child_q_q("coshq_u10", x); } +Sleef_quad child_tanhq_u10(Sleef_quad x) { child_q_q("tanhq_u10", x); } +Sleef_quad child_asinhq_u10(Sleef_quad x) { child_q_q("asinhq_u10", x); } +Sleef_quad child_acoshq_u10(Sleef_quad x) { child_q_q("acoshq_u10", x); } +Sleef_quad child_atanhq_u10(Sleef_quad x) { child_q_q("atanhq_u10", x); } + +Sleef_quad child_fabsq(Sleef_quad x) { child_q_q("fabsq", x); } +Sleef_quad child_copysignq(Sleef_quad x, Sleef_quad y) { child_q_q_q("copysignq", x, y); } +Sleef_quad child_fmaxq(Sleef_quad x, Sleef_quad y) { child_q_q_q("fmaxq", x, y); } +Sleef_quad child_fminq(Sleef_quad x, Sleef_quad y) { child_q_q_q("fminq", x, y); } +Sleef_quad child_fdimq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("fdimq_u05", x, y); } +Sleef_quad child_fmodq(Sleef_quad x, Sleef_quad y) { child_q_q_q("fmodq", x, y); } +Sleef_quad child_remainderq(Sleef_quad x, Sleef_quad y) { child_q_q_q("remainderq", x, y); } +Sleef_quad child_frexpq(Sleef_quad x, int *ptr) { child_q_q_pi("frexpq", x); } +Sleef_quad child_modfq(Sleef_quad x, Sleef_quad *ptr) { child_q_q_pq("modfq", x); } + +Sleef_quad child_hypotq_u05(Sleef_quad x, Sleef_quad y) { child_q_q_q("hypotq_u05", x, y); } +Sleef_quad child_fmaq_u05(Sleef_quad x, Sleef_quad y, Sleef_quad z) { child_q_q_q_q("fmaq_u05", x, y, z); } +Sleef_quad child_ldexpq(Sleef_quad x, int k) { child_q_q_i("ldexpq", x, k); } +int child_ilogbq(Sleef_quad x) { child_i_q("ilogbq", x); } + +Sleef_quad child_truncq(Sleef_quad x) { child_q_q("truncq", x); } +Sleef_quad child_floorq(Sleef_quad x) { child_q_q("floorq", x); } +Sleef_quad child_ceilq(Sleef_quad x) { child_q_q("ceilq", x); } +Sleef_quad child_roundq(Sleef_quad x) { child_q_q("roundq", x); } +Sleef_quad child_rintq(Sleef_quad x) { child_q_q("rintq", x); } + +// + +#define cmpDenorm_q(mpfrFunc, childFunc, argx) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(frz, frx, GMP_RNDN); \ + Sleef_quad t = childFunc(argx); \ + double u = countULPf128(t, frz, 1); \ + if (u >= 10) { \ + fprintf(stderr, "\narg = %s\ntest = %s\ncorrect = %s\nulp = %g\n", \ + sprintf128(argx), sprintf128(t), sprintfr(frz), u); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define cmpDenormNMR_q(mpfrFunc, childFunc, argx) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(frz, frx); \ + Sleef_quad t = childFunc(argx); \ + double u = countULPf128(t, frz, 1); \ + if (u >= 10) { \ + fprintf(stderr, "\narg = %s\ntest = %s\ncorrect = %s\nulp = %g\n", \ + sprintf128(argx), sprintf128(t), sprintfr(frz), u); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define cmpDenorm_q_q(mpfrFunc, childFunc, argx, argy) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_set_f128(fry, argy, GMP_RNDN); \ + mpfrFunc(frz, frx, fry, GMP_RNDN); \ + Sleef_quad t = childFunc(argx, argy); \ + double u = countULPf128(t, frz, 1); \ + if (u >= 10) { \ + Sleef_quad qz = mpfr_get_f128(frz, GMP_RNDN); \ + fprintf(stderr, "\narg = %s,\n %s\ntest = %s\ncorrect = %s\nulp = %g\n", \ + sprintf128(argx), sprintf128(argy), sprintf128(t), sprintf128(qz), u); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define cmpDenorm_q_q_q(mpfrFunc, childFunc, argw, argx, argy) do { \ + mpfr_set_f128(frw, argw, GMP_RNDN); \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_set_f128(fry, argy, GMP_RNDN); \ + mpfrFunc(frz, frw, frx, fry, GMP_RNDN); \ + Sleef_quad t = childFunc(argw, argx, argy); \ + double u = countULPf128(t, frz, 1); \ + if (u >= 10) { \ + Sleef_quad qz = mpfr_get_f128(frz, GMP_RNDN); \ + fprintf(stderr, "\narg = %s,\n %s,\n %s\ntest = %s\ncorrect = %s\nulp = %g\n", \ + sprintf128(argw), sprintf128(argx), sprintf128(argy), sprintf128(t), sprintf128(qz), u); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define cmpDenorm_q_pi(mpfrFunc, childFunc, argx) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_exp_t e; \ + mpfrFunc(&e, frz, frx, GMP_RNDN); \ + int i; \ + Sleef_quad t = childFunc(argx, &i); \ + double u = countULPf128(t, frz, 1); \ + if (u >= 10 || i != (int)e) { \ + fprintf(stderr, "\narg = %s\ntest = %s, %d\ncorrect = %s, %d\nulp = %g\n", \ + sprintf128(argx), sprintf128(t), i, sprintfr(frz), (int)e, u); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define cmpDenorm_q_pq(mpfrFunc, childFunc, argx) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(fry, frz, frx, GMP_RNDN); \ + Sleef_quad qi, qf; \ + qf = childFunc(argx, &qi); \ + double u = countULPf128(qf, frz, 1); \ + double v = countULPf128(qi, fry, 1); \ + if (u >= 10 || v >= 10) { \ + fprintf(stderr, "\narg = %s\ntest = %s, %s\ncorrect = %s, %s\nulp = %g, %g\n", \ + sprintf128(argx), sprintf128(qf), sprintf128(qi), sprintfr(frz), sprintfr(fry), u, v); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_q(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(frz, frx, GMP_RNDN); \ + Sleef_quad t = childFunc(argx); \ + double e = countULPf128(t, frz, 0); \ + maxError = fmax(maxError, e); \ + if (e > bound) { \ + fprintf(stderr, "\narg = %s, test = %s, correct = %s, ULP = %lf\n", \ + sprintf128(argx), sprintf128(childFunc(argx)), sprintfr(frz), countULPf128(t, frz, 0)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracyNMR_q(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(frz, frx); \ + Sleef_quad t = childFunc(argx); \ + double e = countULPf128(t, frz, 0); \ + maxError = fmax(maxError, e); \ + if (e > bound) { \ + fprintf(stderr, "\narg = %s, test = %s, correct = %s, ULP = %lf\n", \ + sprintf128(argx), sprintf128(childFunc(argx)), sprintfr(frz), countULPf128(t, frz, 0)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_q_q(mpfrFunc, childFunc, argx, argy, bound) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_set_f128(fry, argy, GMP_RNDN); \ + mpfrFunc(frz, frx, fry, GMP_RNDN); \ + Sleef_quad t = childFunc(argx, argy); \ + double e = countULPf128(t, frz, 0); \ + maxError = fmax(maxError, e); \ + if (e > bound) { \ + fprintf(stderr, "\narg = %s, %s, test = %s, correct = %s, ULP = %lf\n", \ + sprintf128(argx), sprintf128(argy), sprintf128(childFunc(argx, argy)), sprintfr(frz), countULPf128(t, frz, 0)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_q_q_q(mpfrFunc, childFunc, argw, argx, argy, bound) do { \ + mpfr_set_f128(frw, argw, GMP_RNDN); \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_set_f128(fry, argy, GMP_RNDN); \ + mpfrFunc(frz, frw, frx, fry, GMP_RNDN); \ + Sleef_quad t = childFunc(argw, argx, argy); \ + double e = countULPf128(t, frz, 0); \ + maxError = fmax(maxError, e); \ + if (e > bound) { \ + fprintf(stderr, "\narg = %s, %s, %s, test = %s, correct = %s, ULP = %lf\n", \ + sprintf128(argw), sprintf128(argx), sprintf128(argy), sprintf128(childFunc(argw, argx, argy)), sprintfr(frz), countULPf128(t, frz, 0)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_q_pi(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_exp_t ex; \ + mpfrFunc(&ex, frz, frx, GMP_RNDN); \ + int i; \ + Sleef_quad t = childFunc(argx, &i); \ + double e = countULPf128(t, frz, 0); \ + maxError = fmax(maxError, e); \ + if (e > bound || i != (int)ex) { \ + fprintf(stderr, "\narg = %s, test = %s, %d, correct = %s, %d, ULP = %lf\n", \ + sprintf128(argx), sprintf128(t), i, sprintfr(frz), (int)ex, countULPf128(t, frz, 0)); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define checkAccuracy_q_pq(mpfrFunc, childFunc, argx, bound) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfrFunc(fry, frz, frx, GMP_RNDN); \ + Sleef_quad qi, qf; \ + qf = childFunc(argx, &qi); \ + double ef = countULPf128(qf, frz, 0); \ + double ei = countULPf128(qi, fry, 0); \ + maxError = fmax(maxError, ef); \ + maxError = fmax(maxError, ei); \ + if (ef > bound || ei > bound) { \ + fprintf(stderr, "\narg = %s, test = %s, %s, correct = %s, %s, ULP = %lf, %lf\n", \ + sprintf128(argx), sprintf128(qf), sprintf128(qi), sprintfr(frz), sprintfr(fry), ef, ei); \ + success = 0; \ + break; \ + } \ + } while(0) + +#define testComparison(mpfrFunc, childFunc, argx, argy) do { \ + mpfr_set_f128(frx, argx, GMP_RNDN); \ + mpfr_set_f128(fry, argy, GMP_RNDN); \ + int c = mpfrFunc(frx, fry); \ + int t = childFunc(argx, argy); \ + if ((c != 0) != (t != 0)) { \ + fprintf(stderr, "\narg = %s, %s, test = %d, correct = %d\n", \ + sprintf128(argx), sprintf128(argy), t, c); \ + success = 0; \ + break; \ + } \ + } while(0) + +// + +#define cmpDenormOuterLoop_q(mpfrFunc, childFunc, checkVals) do { \ + for(int i=0;i 0.5) { + fprintf(stderr, "\narg = %s, %d\ntest = %s\ncorrect = %s\nulp = %g\n", + sprintf128(a0), ldexpCheckVals[i], sprintf128(t), sprintfr(frz), u); + success = 0; + break; + } + } + } + + checkResult(success, -1); + } + + { + fprintf(stderr, "ilogb : "); + + static const int correctIlogbVals[] = { + -2147483648, -2147483648, -2, -2, -1, -1, -1, -1, + 0, 0, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 0, 332, 332, + -332, -332, 9966, 9966, -9966, -9966, 1, -16382, + -16382, -16494, -16494, 2147483647, 2147483647, 2147483647, + }; + + for(int i=0;i +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef USEMPFR +#include +#endif + +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) +#define STDIN_FILENO 0 +#else +#include +#include +#endif + +#if defined(__MINGW32__) || defined(__MINGW64__) +#include +#endif + +#if defined(_MSC_VER) +#include +#endif + +#include "misc.h" +#include "qtesterutil.h" + +// + +int readln(int fd, char *buf, int cnt) { + int i, rcnt = 0; + + if (cnt < 1) return -1; + + while(cnt >= 2) { + i = read(fd, buf, 1); + if (i != 1) return i; + + if (*buf == '\n') break; + + rcnt++; + buf++; + cnt--; + } + + *++buf = '\0'; + rcnt++; + return rcnt; +} + +int startsWith(char *str, char *prefix) { + return strncmp(str, prefix, strlen(prefix)) == 0; +} + +// + +xuint128 xu(uint64_t h, uint64_t l) { + xuint128 r = { .l = l, .h = h }; + return r; +} + +xuint128 sll128(uint64_t u, int c) { + if (c < 64) { + xuint128 r = { .l = u << c, .h = u >> (64 - c) }; + return r; + } + + xuint128 r = { .l = 0, .h = u << (c - 64) }; + return r; +} + +xuint128 add128(xuint128 x, xuint128 y) { + xuint128 r = { .l = x.l + y.l, .h = x.h + y.h }; + if (r.l < x.l) r.h++; + return r; +} + +static xuint128 cmpcnv(xuint128 cx) { + if ((cx.h & 0x8000000000000000ULL) != 0) { + cx.h ^= 0x7fffffffffffffffULL; + cx.l = ~cx.l; + cx.l++; + if (cx.l == 0) cx.h++; + } + + cx.h ^= 0x8000000000000000ULL; + + return cx; +} + +int lt128(xuint128 x, xuint128 y) { + xuint128 cx = cmpcnv(x), cy = cmpcnv(y); + if (cx.h < cy.h) return 1; + if (cx.h == cy.h && cx.l < cy.l) return 1; + return 0; +} + +// + +typedef union { + Sleef_quad q; + xuint128 x; + struct { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + uint64_t h, l; +#else + uint64_t l, h; +#endif + }; +} cnv_t; + +int iszerof128(Sleef_quad a) { + cnv_t c128 = { .q = a }; + return (((c128.h & UINT64_C(0x7fffffffffffffff)) == 0) && c128.l == 0); +} + +int isnegf128(Sleef_quad a) { + cnv_t c128 = { .q = a }; + return c128.h >> 63; +} + +int isinff128(Sleef_quad a) { + cnv_t c128 = { .q = a }; + return (((c128.h & UINT64_C(0x7fffffffffffffff)) == UINT64_C(0x7fff000000000000)) && c128.l == 0); +} + +int isnonnumberf128(Sleef_quad a) { + cnv_t c128 = { .q = a }; + return (c128.h & UINT64_C(0x7fff000000000000)) == UINT64_C(0x7fff000000000000); +} + +int isnanf128(Sleef_quad a) { + return isnonnumberf128(a) && !isinff128(a); +} + +// + +static uint64_t xseed; + +uint64_t xrand() { + uint64_t u = xseed; + xseed = xseed * UINT64_C(6364136223846793005) + 1; + u = (u & ((~UINT64_C(0)) << 32)) | (xseed >> 32); + xseed = xseed * UINT64_C(6364136223846793005) + 1; + return u; +} + +void xsrand(uint64_t s) { + xseed = s; + xrand(); + xrand(); + xrand(); +} + +void memrand(void *p, int size) { + uint64_t *q = (uint64_t *)p; + int i; + for(i=0;i 0, disinf = isinff128(d); + + if (ciszero && !diszero) { + ret = 10000; + } else if (ciszero && diszero) { + ret = 0; + if (checkNegZero && csign != dsign) ret = 10003; + } else if (cisnan && disnan) { + ret = 0; + } else if (cisnan || disnan) { + ret = 10001; + } else if (cisinf && disinf) { + ret = csign == dsign ? 0 : 10002; + } else { + mpfr_set_f128(frd, d, GMP_RNDN); + int e = mpfr_get_exp(frd); + mpfr_set_d(frb, 1, GMP_RNDN); + assert(!mpfr_zero_p(frb)); + mpfr_set_exp(frb, e-113+1); + mpfr_max(frb, frb, fr_denorm_min, GMP_RNDN); + mpfr_sub(fra, frd, c, GMP_RNDN); + mpfr_div(fra, fra, frb, GMP_RNDN); + ret = fabs(mpfr_get_d(fra, GMP_RNDN)); + } + + mpfr_clears(fra, frb, frc, frd, NULL); + return ret; +} + +// + +char *sprintfr(mpfr_t fr) { + int digits = 51; + mpfr_t t; + mpfr_inits(t, NULL); + int sign = mpfr_signbit(fr) ? -1 : 1; + char *s = malloc(digits + 10); + if (mpfr_inf_p(fr)) { + sprintf(s, "%cinf", sign < 0 ? '-' : '+'); + } else if (mpfr_nan_p(fr)) { + sprintf(s, "nan"); + } else { + mpfr_exp_t e; + s[0] = sign < 0 ? '-' : '+'; + s[1] = '0'; + s[2] = '.'; + mpfr_abs(t, fr, GMP_RNDN); + mpfr_get_str(s+3, &e, 10, digits, t, GMP_RNDN); + int ie = e; + char es[32]; + snprintf(es, 30, "e%c%d", ie >= 0 ? '+' : '-', ie >= 0 ? ie : -ie); + strncat(s, es, digits+10); + } + + mpfr_clears(t, NULL); + return s; +} + +// + +#if MPFR_VERSION_MAJOR >= 4 && defined(SLEEF_FLOAT128_IS_IEEEQP) && !defined(__PPC64__) && !defined(__i386__) && !(defined(__APPLE__) && defined(__MACH__)) +void mpfr_set_f128(mpfr_t frx, Sleef_quad q, mpfr_rnd_t rnd) { + int mpfr_set_float128(mpfr_t rop, __float128 op, mpfr_rnd_t rnd); + union { + Sleef_quad q; + __float128 f; + } c; + c.q = q; + mpfr_set_float128(frx, c.f, rnd); +} + +Sleef_quad mpfr_get_f128(mpfr_t m, mpfr_rnd_t rnd) { + __float128 mpfr_get_float128(mpfr_t op, mpfr_rnd_t rnd); + union { + Sleef_quad q; + __float128 f; + } c; + c.f = mpfr_get_float128(m, rnd); + return c.q; +} +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +void mpfr_set_f128(mpfr_t frx, Sleef_quad q, mpfr_rnd_t rnd) { + union { + Sleef_quad q; + long double f; + } c; + c.q = q; + mpfr_set_ld(frx, c.f, rnd); +} + +Sleef_quad mpfr_get_f128(mpfr_t m, mpfr_rnd_t rnd) { + union { + Sleef_quad q; + long double f; + } c; + c.f = mpfr_get_ld(m, rnd); + return c.q; +} +#else +#pragma message ( "Internal MPFR<->float128 conversion is used" ) +void mpfr_set_f128(mpfr_t frx, Sleef_quad a, mpfr_rnd_t rnd) { + union { + Sleef_quad u; + struct { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + uint64_t h, l; +#else + uint64_t l, h; +#endif + }; + } c128 = { .u = a }; + + int sign = (int)(c128.h >> 63); + int exp = ((int)(c128.h >> 48)) & 0x7fff; + + if (isnanf128(a)) { + mpfr_set_nan(frx); + } else if (isinff128(a)) { + mpfr_set_inf(frx, sign ? -1 : 1); + } else if (exp == 0) { + c128.h &= UINT64_C(0xffffffffffff); + mpfr_set_d(frx, ldexp((double)c128.h, 64), GMP_RNDN); + mpfr_add_d(frx, frx, (double)(c128.l & UINT64_C(0xffffffff00000000)), GMP_RNDN); + mpfr_add_d(frx, frx, (double)(c128.l & UINT64_C(0xffffffff)), GMP_RNDN); + mpfr_set_exp(frx, mpfr_get_exp(frx) - 16382 - 112); + mpfr_setsign(frx, frx, sign, GMP_RNDN); + } else { + c128.h &= UINT64_C(0xffffffffffff); + mpfr_set_d(frx, ldexp(1, 112), GMP_RNDN); + mpfr_add_d(frx, frx, ldexp((double)c128.h, 64), GMP_RNDN); + mpfr_add_d(frx, frx, (double)(c128.l & UINT64_C(0xffffffff00000000)), GMP_RNDN); + mpfr_add_d(frx, frx, (double)(c128.l & UINT64_C(0xffffffff)), GMP_RNDN); + mpfr_set_exp(frx, exp - 16382); + mpfr_setsign(frx, frx, sign, GMP_RNDN); + } +} + +static double3 mpfr_get_d3(mpfr_t fr, mpfr_rnd_t rnd) { + double3 ret; + mpfr_t t; + mpfr_inits(t, NULL); + ret.x = mpfr_get_d(fr, GMP_RNDN); + mpfr_sub_d(t, fr, ret.x, GMP_RNDN); + ret.y = mpfr_get_d(t, GMP_RNDN); + mpfr_sub_d(t, t, ret.y, GMP_RNDN); + ret.z = mpfr_get_d(t, GMP_RNDN); + mpfr_clears(t, NULL); + return ret; +} + +static TDX_t mpfr_get_tdx(mpfr_t fr, mpfr_rnd_t rnd) { + TDX_t td; + + if (mpfr_nan_p(fr)) { + td.dd.x = NAN; + td.dd.y = 0; + td.dd.z = 0; + td.e = 0; + return td; + } + + if (mpfr_inf_p(fr)) { + td.dd.x = copysign(INFINITY, mpfr_cmp_d(fr, 0)); + td.dd.y = 0; + td.dd.z = 0; + td.e = 0; + return td; + } + + if (mpfr_zero_p(fr)) { + td.dd.x = copysign(0, mpfr_signbit(fr) ? -1 : 1); + td.dd.y = 0; + td.dd.z = 0; + td.e = 0; + return td; + } + + mpfr_t t; + mpfr_inits(t, NULL); + + mpfr_set(t, fr, GMP_RNDN); + td.e = mpfr_get_exp(fr) + 16382; + assert(!mpfr_zero_p(t)); + mpfr_set_exp(t, 1); + mpfr_setsign(t, t, mpfr_signbit(fr), GMP_RNDN); + td.dd = mpfr_get_d3(t, GMP_RNDN); + + if (fabs(td.dd.x) == 2.0) { + td.dd.x *= 0.5; + td.dd.y *= 0.5; + td.dd.z *= 0.5; + td.e++; + } + + mpfr_clears(t, NULL); + + return td; +} + +#define HBX 1.0 +#define LOGXSCALE 1 +#define XSCALE (1 << LOGXSCALE) +#define SX 61 +#define HBY (1.0 / (UINT64_C(1) << 53)) +#define LOGYSCALE 4 +#define YSCALE (1 << LOGYSCALE) +#define SY 11 +#define HBZ (1.0 / ((UINT64_C(1) << 53) * (double)(UINT64_C(1) << 53))) +#define LOGZSCALE 10 +#define ZSCALE (1 << LOGZSCALE) +#define SZ 36 +#define HBR (1.0 / (UINT64_C(1) << 60)) + +static int64_t doubleToRawLongBits(double d) { + union { + double f; + int64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +static double longBitsToDouble(int64_t i) { + union { + double f; + int64_t i; + } tmp; + tmp.i = i; + return tmp.f; +} + +static int xisnonnumber(double x) { + return (doubleToRawLongBits(x) & UINT64_C(0x7ff0000000000000)) == UINT64_C(0x7ff0000000000000); +} + +static double xordu(double x, uint64_t y) { + union { + double d; + uint64_t u; + } cx; + cx.d = x; + cx.u ^= y; + return cx.d; +} + +static double pow2i(int q) { + return longBitsToDouble(((int64_t)(q + 0x3ff)) << 52); +} + +static double ldexp2k(double d, int e) { // faster than ldexpk, short reach + return d * pow2i(e >> 1) * pow2i(e - (e >> 1)); +} + +Sleef_quad mpfr_get_f128(mpfr_t a, mpfr_rnd_t rnd) { + TDX_t f = mpfr_get_tdx(a, rnd); + + cnv_t c128; + + union { + double d; + uint64_t u; + } c64; + + c64.d = f.dd.x; + uint64_t signbit = c64.u & UINT64_C(0x8000000000000000); + int isZero = (f.dd.x == 0.0), denorm = 0; + + f.dd.x = xordu(f.dd.x, signbit); + f.dd.y = xordu(f.dd.y, signbit); + f.dd.z = xordu(f.dd.z, signbit); + + double t = 1; + + if (f.e <= 0) { + t = ldexp2k(0.5, f.e); + if (f.e < -120) t = 0; + f.e = 1; + denorm = 1; + } + + if ((fabs(f.dd.x) == 1.0 && f.dd.y <= -pow(2, -114)) && f.e != 1) { + t = 2; + f.e--; + } + + f.dd.x *= t; + f.dd.y *= t; + f.dd.z *= t; + + c64.d = f.dd.y + HBY * YSCALE; + c64.u &= UINT64_C(0xffffffffffffffff) << LOGYSCALE; + f.dd.z += f.dd.y - (c64.d - (HBZ * ZSCALE + HBY * YSCALE)); + f.dd.y = c64.d; + + double c = denorm ? (HBX * XSCALE + HBX) : (HBX * XSCALE); + c64.d = f.dd.x + c; + c64.u &= UINT64_C(0xffffffffffffffff) << LOGXSCALE; + t = f.dd.y + (f.dd.x - (c64.d - c)); + f.dd.z += f.dd.y - t + (f.dd.x - (c64.d - c)); + f.dd.x = c64.d; + + c64.d = t; + c64.u &= UINT64_C(0xffffffffffffffff) << LOGYSCALE; + f.dd.z += t - c64.d; + f.dd.y = c64.d; + + t = f.dd.z - HBZ * ZSCALE < 0 ? HBZ * (ZSCALE/2) : 0; + f.dd.y -= t; + f.dd.z += t; + + t = f.dd.y - HBY * YSCALE < 0 ? HBY * (YSCALE/2) : 0; + f.dd.x -= t; + f.dd.y += t; + + f.dd.z = f.dd.z + HBR - HBR; + + // + + c64.d = f.dd.x; + c64.u &= UINT64_C(0xfffffffffffff); + c128.x = sll128(c64.u, SX); + + c64.d = f.dd.z; + c64.u &= UINT64_C(0xfffffffffffff); + c128.l |= c64.u >> SZ; + + c64.d = f.dd.y; + c64.u &= UINT64_C(0xfffffffffffff); + c128.x = add128(c128.x, sll128(c64.u, SY)); + + c128.h &= denorm ? UINT64_C(0xffffffffffff) : UINT64_C(0x3ffffffffffff); + c128.h += ((f.e-1) & ~((uint64_t)-1UL << 15)) << 48; + + if (isZero) { c128.l = c128.h = 0; } + if (f.e >= 32767 || f.dd.x == INFINITY) { + c128.h = UINT64_C(0x7fff000000000000); + c128.l = 0; + } + if (xisnonnumber(f.dd.x) && f.dd.x != INFINITY) c128.h = c128.l = UINT64_C(0xffffffffffffffff); + + c128.h |= signbit; + + return c128.q; +} +#endif // #if MPFR_VERSION_MAJOR >= 4 + +char *sprintf128(Sleef_quad q) { + mpfr_t fr; + mpfr_inits(fr, NULL); + mpfr_set_f128(fr, q, GMP_RNDN); + char *f = sprintfr(fr); + mpfr_clears(fr, NULL); + cnv_t c128 = { .q = q }; + char *ret = malloc(128); + sprintf(ret, "%016llx%016llx (%s)", (unsigned long long)c128.h, (unsigned long long)c128.l, f); + free(f); + return ret; +} + +double cast_d_q(Sleef_quad q) { + mpfr_t fr; + mpfr_inits(fr, NULL); + mpfr_set_f128(fr, q, GMP_RNDN); + double ret = mpfr_get_d(fr, GMP_RNDN); + mpfr_clears(fr, NULL); + return ret; +} + +Sleef_quad add_q_d(Sleef_quad q, double d) { + mpfr_t fr; + mpfr_inits(fr, NULL); + mpfr_set_f128(fr, q, GMP_RNDN); + mpfr_add_d(fr, fr, d, GMP_RNDN); + q = mpfr_get_f128(fr, GMP_RNDN); + mpfr_clears(fr, NULL); + return q; +} + +Sleef_quad cast_q_str(const char *s) { + mpfr_t fr; + mpfr_inits(fr, NULL); + mpfr_set_str(fr, s, 10, GMP_RNDN); + Sleef_quad q = mpfr_get_f128(fr, GMP_RNDN); + mpfr_clears(fr, NULL); + return q; +} + +Sleef_quad cast_q_str_hex(const char *s) { + mpfr_t fr; + mpfr_inits(fr, NULL); + mpfr_set_str(fr, s, 16, GMP_RNDN); + Sleef_quad q = mpfr_get_f128(fr, GMP_RNDN); + mpfr_clears(fr, NULL); + return q; +} + +Sleef_quad add_q_q(Sleef_quad q, Sleef_quad r) { + mpfr_t fr0, fr1; + mpfr_inits(fr0, fr1, NULL); + mpfr_set_f128(fr0, q, GMP_RNDN); + mpfr_set_f128(fr1, r, GMP_RNDN); + mpfr_add(fr0, fr0, fr1, GMP_RNDN); + q = mpfr_get_f128(fr0, GMP_RNDN); + mpfr_clears(fr0, fr1, NULL); + return q; +} +#else // #ifdef USEMPFR +char *sprintf128(Sleef_quad x) { + cnv_t c128 = { .q = x }; + char *s = malloc(128); + sprintf(s, "%016llx%016llx", (unsigned long long)c128.h, (unsigned long long)c128.l); + return s; +} +#endif // #ifdef USEMPFR diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtesterutil.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtesterutil.h new file mode 100644 index 0000000000000..380e97579ebc3 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qtesterutil.h @@ -0,0 +1,66 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "quaddef.h" + +typedef struct { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + uint64_t h, l; +#else + uint64_t l, h; +#endif +} xuint128; + +xuint128 xu(uint64_t h, uint64_t l); +xuint128 sll128(uint64_t u, int c); +xuint128 add128(xuint128 x, xuint128 y); +int lt128(xuint128 x, xuint128 y); + +void xsrand(uint64_t s); +uint64_t xrand(); +void memrand(void *p, int size); +Sleef_quad rndf128(Sleef_quad min, Sleef_quad max, int setSignRandomly); +Sleef_quad rndf128x(); + +int readln(int fd, char *buf, int cnt); +int startsWith(char *str, char *prefix); + +int iszerof128(Sleef_quad a); +int isnegf128(Sleef_quad a); +int isinff128(Sleef_quad a); +int isnonnumberf128(Sleef_quad a); +int isnanf128(Sleef_quad a); + +static double u2d(uint64_t u) { + union { + double f; + uint64_t i; + } tmp; + tmp.i = u; + return tmp.f; +} + +static uint64_t d2u(double d) { + union { + double f; + uint64_t i; + } tmp; + tmp.f = d; + return tmp.i; +} + +#ifdef USEMPFR +void mpfr_set_f128(mpfr_t frx, Sleef_quad a, mpfr_rnd_t rnd); +Sleef_quad mpfr_get_f128(mpfr_t m, mpfr_rnd_t rnd); + +double countULPf128(Sleef_quad d, mpfr_t c, int checkNegZero); +char *sprintfr(mpfr_t fr); +char *sprintf128(Sleef_quad x); + +double cast_d_q(Sleef_quad q); +Sleef_quad cast_q_str(const char *s); +Sleef_quad cast_q_str_hex(const char *s); +Sleef_quad add_q_d(Sleef_quad q, double d); +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qutil.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qutil.c new file mode 100644 index 0000000000000..11b8b482b2ebc --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/qutil.c @@ -0,0 +1,41 @@ +#include +#include +#include + +#if defined(_MSC_VER) +#pragma warning(disable:4116) // warning C4116: unnamed type definition in parentheses +#endif + +int main(int argc, char **argv) { + if (argc == 1) { + printf("Usage : %s \n", argv[0]); + exit(-1); + } + + if (argc == 4) { + int64_t h = strtoll(argv[1], NULL, 16); + uint64_t l = strtoull(argv[2], NULL, 16); + int e = atoi(argv[3]); + Sleef_quad q = sleef_q(h, l, e); + Sleef_printf("%+Pa = %.30Pg\n", &q, &q); + exit(0); + } + + union { + struct { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + unsigned long long h, l; +#else + unsigned long long l, h; +#endif + }; + Sleef_quad q; + } cnv = { .q = Sleef_strtoq(argv[1], NULL) }; + + Sleef_printf("%+Pa\nsleef_q(%c0x%c%012llxLL, 0x%016llxULL, %d)\n", + &cnv.q, (cnv.h >> 63) ? '-' : '+', + (int)((cnv.h >> 48) & 0x7fff) == 0 ? '0' : '1', + (unsigned long long)(0xffffffffffffULL & cnv.h), + (unsigned long long)cnv.l, + (int)((cnv.h >> 48) & 0x7fff) - 16383); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2printf.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2printf.c new file mode 100644 index 0000000000000..32ff6301ef091 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2printf.c @@ -0,0 +1,283 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// gcc -O3 -Wno-format tester2printf.c qtesterutil.c -I ../../src/common -I ../../build/include -L ../../build/lib -lsleefquad -lsleef -lquadmath + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "sleefquad.h" +#include "qtesterutil.h" + +void testem_rnd(Sleef_quad val) { + int prec = xrand() % 25, width = xrand() % 50; + char *types[] = { "Qe", "Qf", "Qg", "Qa" }; + for(int i=0;i<4;i++) { + for(int alt=0;alt<2;alt++) { + for(int zero=0;zero<2;zero++) { + for(int left=0;left<2;left++) { + for(int blank=0;blank<2;blank++) { + for(int sign=0;sign<2;sign++) { + char fmt[100], corr[100], corr2[100], test[100]; + int lc, lc2, lt; + + // no width, no prec + + snprintf(fmt, 99, "%%%s%s%s%s%s%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + return; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + return; + } + + // width + + snprintf(fmt, 99, "%%%s%s%s%s%s%d.%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + width, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + return; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + return; + } + + // prec + + snprintf(fmt, 99, "%%%s%s%s%s%s.%d%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + prec, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + return; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + return; + } + + // both + + snprintf(fmt, 99, "%%%s%s%s%s%s%d.%d%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + width, prec, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + return; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + return; + } + } + } + } + } + } + } +} + +int testem(Sleef_quad val) { + int ret = 0; + char *types[] = { "Qe", "Qf", "Qg", "Qa" }; + for(int i=0;i<4;i++) { + for(int alt=0;alt<2;alt++) { + for(int zero=0;zero<2;zero++) { + for(int left=0;left<2;left++) { + for(int blank=0;blank<2;blank++) { + for(int sign=0;sign<2;sign++) { + char fmt[100], corr[100], corr2[100], test[100]; + int lc, lc2, lt; + + snprintf(fmt, 99, "%%%s%s%s%s%s%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + ret = 1; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + ret = 1; + } + + int prec = xrand() % 30, width = xrand() % 30; + + for(int width=6;width<=16;width += 2) { + snprintf(fmt, 99, "%%%s%s%s%s%s%d.%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + width, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + ret = 1; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + ret = 1; + } + } + + for(int prec=4;prec<=12;prec += 2) { + for(int width=6;width<=16;width += 2) { + snprintf(fmt, 99, "%%%s%s%s%s%s%d.%d%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + width, prec, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + ret = 1; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + ret = 1; + } + } + + snprintf(fmt, 99, "%%%s%s%s%s%s.%d%s", + alt ? "#" : "", + zero ? "0" : "", + left ? "-" : "", + blank ? " " : "", + sign ? "+" : "", + prec, types[i]); + lc2 = snprintf(corr2, 99, fmt, val); + lc = snprintf(corr, 99, fmt, strtoflt128(corr2, NULL)); + lt = Sleef_snprintf(test, 99, fmt, val); + + if((lc != lt && lc2 != lt) || (strcmp(test, corr) != 0 && strcmp(test, corr2) != 0)) { + printf("val=%Qa %s : c=[%s](%d) t=[%s](%d)\n", val, fmt, corr, lc, test, lt); + ret = 1; + } + if (strtoflt128(corr, NULL) != Sleef_strtoq(corr, NULL) && strstr(corr, "nan") == NULL) { + printf("X [%s] : c=[%.40Qg] t=[%.40Qg]\n", corr, strtoflt128(corr, NULL), Sleef_strtoq(corr, NULL)); + ret = 1; + } + } + } + } + } + } + } + } + return ret; +} + +int main(int argc, char **argv) { + xsrand(time(NULL) + (((int)getpid()) << 12)); + + strtoflt128("1", NULL); // This is for registering hook + + Sleef_quad vals[] = { + 1.2345678912345678912345e+0Q, + 1.2345678912345678912345e+1Q, + 1.2345678912345678912345e-1Q, + 1.2345678912345678912345e+2Q, + 1.2345678912345678912345e-2Q, + 1.2345678912345678912345e+3Q, + 1.2345678912345678912345e-3Q, + 1.2345678912345678912345e+4Q, + 1.2345678912345678912345e-4Q, + 1.2345678912345678912345e+5Q, + 1.2345678912345678912345e-5Q, + 1.2345678912345678912345e+10Q, + 1.2345678912345678912345e-10Q, + 1.2345678912345678912345e+15Q, + 1.2345678912345678912345e-15Q, + 1.2345678912345678912345e+30Q, + 1.2345678912345678912345e-30Q, + //1.2345678912345678912345e+1000Q, + 1.2345678912345678912345e-1000Q, + 1.2345678912345678912345e-4950Q, + //1.2345678912345678912345e+4920Q, + 3.36210314311209350626267781732175260e-4932Q, + //1.18973149535723176508575932662800702e+4932Q, + 6.475175119438025110924438958227646552e-4966Q, + 0.0Q, 1.0Q, + 1e+1Q, 1e+2Q, 1e+3Q, 1e+4Q, 1e+5Q, 1e+6Q, + 1e-1Q, 1e-2Q, 1e-3Q, 1e-4Q, 1e-5Q, 1e-6Q, + 1e+300*1e+300, 1e+300*1e+300 - 1e+300*1e+300 + }; + + for(int i=0;i 1e+25) continue; + testem_rnd(q); + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2simdqp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2simdqp.c new file mode 100644 index 0000000000000..4ddcd36961e31 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester2simdqp.c @@ -0,0 +1,1098 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "sleef.h" +#include "sleefquad.h" + +#include "misc.h" +#include "qtesterutil.h" + +// + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#include "helperpurec_scalar.h" +#include "qrenamepurec_scalar.h" +#define VARGQUAD Sleef_quad +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#include "helperpurec_scalar.h" +#include "qrenamepurecfma_scalar.h" +#define VARGQUAD Sleef_quad +#endif + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#include "helpersse2.h" +#include "qrenamesse2.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#include "helperavx2_128.h" +#include "qrenameavx2128.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_AVX +#define CONFIG 1 +#include "helperavx.h" +#include "qrenameavx.h" +#define VARGQUAD Sleef_quadx4 +#endif + +#ifdef ENABLE_FMA4 +#define CONFIG 4 +#include "helperavx.h" +#include "qrenamefma4.h" +#define VARGQUAD Sleef_quadx4 +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#include "helperavx2.h" +#include "qrenameavx2.h" +#define VARGQUAD Sleef_quadx4 +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#include "helperavx512f.h" +#include "qrenameavx512f.h" +#define VARGQUAD Sleef_quadx8 +#endif + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#include "helperadvsimd.h" +#include "qrenameadvsimd.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#include "helpersve.h" +#include "qrenamesve.h" +#define VARGQUAD Sleef_svquad +#endif + +#ifdef ENABLE_VSX +#define CONFIG 1 +#include "helperpower_128.h" +#include "qrenamevsx.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#include "helperpower_128.h" +#include "qrenamevsx3.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#include "helpers390x_128.h" +#include "qrenamevxe.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#include "helpers390x_128.h" +#include "qrenamevxe2.h" +#define VARGQUAD Sleef_quadx2 +#endif + +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "qrenamervvm1.h" +#define VARGQUAD Sleef_rvvm1quad +#endif + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#include "qrenamervvm2.h" +#define VARGQUAD Sleef_rvvm2quad +#endif + +// + +#define DENORMAL_DBL_MIN (4.9406564584124654418e-324) + +#define POSITIVE_INFINITY INFINITY +#define NEGATIVE_INFINITY (-INFINITY) + +typedef union { + Sleef_quad q; + xuint128 x; + struct { + uint64_t l, h; + }; +} cnv_t; + +Sleef_quad nexttoward0q(Sleef_quad x, int n) { + cnv_t cx; + cx.q = x; + cx.x = add128(cx.x, xu(n < 0 ? 0 : -1, -(int64_t)n)); + return cx.q; +} + +static VARGQUAD vset(VARGQUAD v, int idx, Sleef_quad d) { return xsetq(v, idx, d); } +static Sleef_quad vget(VARGQUAD v, int idx) { return xgetq(v, idx); } + +vdouble vsetd(vdouble v, int idx, double d) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + a[idx] = d; + return vloadu_vd_p(a); +} + +double vgetd(vdouble v, int idx) { + double a[VECTLENDP]; + vstoreu_v_p_vd(a, v); + return a[idx]; +} + +vmask vsetm(vmask v, int idx, uint64_t d) { + uint64_t a[VECTLENDP]; + vstoreu_v_p_vd((double *)a, vreinterpret_vd_vm(v)); + a[idx] = d; + return vreinterpret_vm_vd(vloadu_vd_p((double *)a)); +} + +int64_t vgeti64(vint64 v, int idx) { + int64_t a[VECTLENDP]; + vstoreu_v_p_vd((double *)a, vreinterpret_vd_vm(vreinterpret_vm_vi64(v))); + return a[idx]; +} + +uint64_t vgetu64(vuint64 v, int idx) { + uint64_t a[VECTLENDP]; + vstoreu_v_p_vd((double *)a, vreinterpret_vd_vm(vreinterpret_vm_vu64(v))); + return a[idx]; +} + +static int vgeti(vint v, int idx) { + int a[VECTLENDP*2]; + vstoreu_v_p_vi(a, v); + return a[idx]; +} + +int main(int argc,char **argv) +{ + mpfr_set_default_prec(1024); + xsrand(time(NULL) + (((int)getpid()) << 12)); + srandom(time(NULL) + (((int)getpid()) << 12)); + + // + + const Sleef_quad oneQ = cast_q_str("1"); + const Sleef_quad oneEMinus300Q = cast_q_str("1e-300"); + const Sleef_quad oneEMinus10Q = cast_q_str("1e-10"); + const Sleef_quad oneEPlus10Q = cast_q_str("1e+10"); + const Sleef_quad oneEMinus100Q = cast_q_str("1e-100"); + const Sleef_quad oneEPlus100Q = cast_q_str("1e+100"); + const Sleef_quad oneEMinus1000Q = cast_q_str("1e-1000"); + const Sleef_quad oneEPlus1000Q = cast_q_str("1e+1000"); + const Sleef_quad quadMin = cast_q_str("3.36210314311209350626267781732175260e-4932"); + const Sleef_quad quadMax = cast_q_str("1.18973149535723176508575932662800702e+4932"); + const Sleef_quad quadDenormMin = cast_q_str("6.475175119438025110924438958227646552e-4966"); +#if defined(ENABLEFLOAT128) + const Sleef_quad M_PI_2Q = cast_q_str("1.5707963267948966192313216916397514"); +#endif + + // + + int cnt, ecnt = 0; + VARGQUAD a0, a1, a2, a3; + vdouble vd0 = vcast_vd_d(0); + Sleef_quad q0, q1, q2, q3, t; + mpfr_t frw, frx, fry, frz; + mpfr_inits(frw, frx, fry, frz, NULL); + +#if !(defined ENABLE_SVE || defined ENABLE_RVVM1 || defined ENABLE_RVVM2) + memset(&a0, 0, sizeof(a0)); + memset(&a1, 0, sizeof(a1)); + memset(&a2, 0, sizeof(a2)); + memset(&a3, 0, sizeof(a3)); +#endif + + for(cnt = 0;ecnt < 1000;cnt++) { + int e = cnt % VECTLENDP; + + // In the following switch-case statement, I am trying to test + // with numbers that tends to trigger bugs. Each case is executed + // once in 128 times of loop execution. + switch(cnt & 127) { + case 127: + q0 = nexttoward0q(quadMin, (xrand() & 63) - 31); + q1 = rndf128x(); + q2 = rndf128x(); + break; + case 126: + q0 = nexttoward0q(quadMax, (xrand() & 31)); + q1 = rndf128x(); + q2 = rndf128x(); + break; + case 125: + q0 = nexttoward0q(quadDenormMin, -(int)(xrand() & 31)); + q1 = rndf128x(); + q2 = rndf128x(); + break; +#if defined(ENABLEFLOAT128) + case 124: + q0 = rndf128x(); + q1 = rndf128x(); + q1 += q0; + q2 = rndf128x(); + break; + case 123: + q0 = rndf128x(); + q1 = rndf128x(); + q1 -= q0; + q2 = rndf128x(); + break; + case 122: + q0 = rndf128x(); + q1 = rndf128x(); + q0 += q1; + q2 = rndf128x(); + break; + case 121: + q0 = rndf128x(); + q1 = rndf128x(); + q0 -= q1; + q2 = rndf128x(); + break; + case 120: + q0 = rndf128x(); + q1 = rndf128x(); + q1 += 1; + q2 = rndf128x(); + break; + case 119: + q0 = rndf128x(); + q1 = rndf128x(); + q0 += 1; + q2 = rndf128x(); + break; + case 118: + q0 = rndf128x(); + q1 = rndf128x(); + q0 += 1; + q1 -= 1; + q2 = rndf128x(); + break; + case 117: + q0 = rndf128x(); + q1 = rndf128x(); + q0 -= 1; + q1 += 1; + q2 = rndf128x(); + break; + case 116: + q0 = rndf128x(); + q1 = rndf128x(); + q1 += copysign(1, q1) * SLEEF_QUAD_MIN; + q2 = rndf128x(); + break; + case 115: + q0 = rndf128x(); + q1 = rndf128x(); + q0 += copysign(1, q0) * SLEEF_QUAD_MIN; + q2 = rndf128x(); + break; + case 114: + q0 = rndf128x(); + q1 = rndf128x(); + q1 -= copysign(1, q1) * SLEEF_QUAD_MIN; + q2 = rndf128x(); + break; + case 113: + q0 = rndf128x(); + q1 = rndf128x(); + q0 -= copysign(1, q0) * SLEEF_QUAD_MIN; + q2 = rndf128x(); + break; +#endif + default: + // Each case in the following switch-case statement is executed + // once in 8 loops. + switch(cnt & 7) { + case 0: + q0 = rndf128(oneEMinus10Q, oneEPlus10Q, 1); + q1 = rndf128(oneEMinus10Q, oneEPlus10Q, 1); + q2 = rndf128(oneEMinus10Q, oneEPlus10Q, 1); + break; + case 1: + q0 = rndf128(oneEMinus100Q, oneEPlus100Q, 1); + q1 = rndf128(oneEMinus100Q, oneEPlus100Q, 1); + q2 = rndf128(oneEMinus100Q, oneEPlus100Q, 1); + break; + case 2: + q0 = rndf128(oneEMinus1000Q, oneEPlus1000Q, 1); + q1 = rndf128(oneEMinus1000Q, oneEPlus1000Q, 1); + q2 = rndf128(oneEMinus1000Q, oneEPlus1000Q, 1); + break; + default: + q0 = rndf128x(); + q1 = rndf128x(); + q2 = rndf128x(); + break; + } + break; + } + + a0 = vset(a0, e, q0); + a1 = vset(a1, e, q1); + a2 = vset(a1, e, q2); + mpfr_set_f128(frx, q0, GMP_RNDN); + mpfr_set_f128(fry, q1, GMP_RNDN); + mpfr_set_f128(frz, q2, GMP_RNDN); + + { + mpfr_add(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xaddq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " add arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_sub(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xsubq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " sub arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_mul(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xmulq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " mul arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_div(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xdivq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " div arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_sqrt(frw, frx, GMP_RNDN); + + double u0 = countULPf128(t = vget(xsqrtq_u05(a0), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " sqrt arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_cbrt(frw, frx, GMP_RNDN); + + double u0 = countULPf128(t = vget(xcbrtq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " cbrt arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_dim(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xfdimq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " fdim arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_hypot(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xhypotq_u05(a0, a1), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " hypot arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_fma(frw, frx, fry, frz, GMP_RNDN); + + double u0 = countULPf128(t = vget(xfmaq_u05(a0, a1, a2), e), frw, 0); + + if (u0 > 0.5000000001) { + printf(ISANAME " fma arg=%s, %s, %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), sprintf128(q2), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_modf(frw, frz, frx, GMP_RNDN); + + a2 = xmodfq(a0, &a3); + double u0 = countULPf128(q2 = vget(a2, e), frz, 0); + double u1 = countULPf128(q3 = vget(a3, e), frw, 0); + + if (u0 > 0 || u1 > 0) { + printf(ISANAME " modf arg=%s ulp=%.20g, %.20g\n", sprintf128(q0), u0, u1); + printf("test = %s, %s\n", sprintf128(q2), sprintf128(q3)); + printf("corr = %s, %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN)), sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + if (cnt % 101 == 0) { + { + mpfr_fmod(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xfmodq(a0, a1), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " fmod arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_remainder(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xremainderq(a0, a1), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " remainder arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + } + + { + mpfr_trunc(frw, frx); + double u0 = countULPf128(t = vget(xtruncq(a0), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " trunc arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_floor(frw, frx); + double u0 = countULPf128(t = vget(xfloorq(a0), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " floor arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_ceil(frw, frx); + double u0 = countULPf128(t = vget(xceilq(a0), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " ceil arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_round(frw, frx); + double u0 = countULPf128(t = vget(xroundq(a0), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " round arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_rint(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xrintq(a0), e), frw, 0); + + if (u0 > 0) { + printf(ISANAME " rint arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + double d = mpfr_get_d(frx, GMP_RNDN); + vd0 = vsetd(vd0, e, d); + t = vget(xcast_from_doubleq(vd0), e); + mpfr_set_d(frw, d, GMP_RNDN); + Sleef_quad q2 = mpfr_get_f128(frw, GMP_RNDN); + + if (memcmp(&t, &q2, sizeof(Sleef_quad)) != 0 && !(isnanf128(t) && isnanf128(q2))) { + printf(ISANAME " cast_from_double arg=%.20g\n", d); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(q2)); + fflush(stdout); ecnt++; + } + } + + { + double td = vgetd(xcast_to_doubleq(a0), e); + double cd = mpfr_get_d(frx, GMP_RNDN); + + if (fabs(cd) >= DBL_MIN && cd != td && !(isnan(td) && isnan(cd))) { + printf(ISANAME " cast_to_double arg=%s\n", sprintf128(q0)); + printf("test = %.20g\n", td); + printf("corr = %.20g\n", cd); + fflush(stdout); ecnt++; + } + } + + { + int64_t i64 = mpfr_get_sj(frx, GMP_RNDN); + vd0 = vreinterpret_vd_vm(vsetm(vreinterpret_vm_vd(vd0), e, i64)); + t = vget(xcast_from_int64q(vreinterpret_vi64_vm(vreinterpret_vm_vd(vd0))), e); + mpfr_set_sj(frw, i64, GMP_RNDN); + Sleef_quad q2 = mpfr_get_f128(frw, GMP_RNDN); + + if (memcmp(&t, &q2, sizeof(Sleef_quad)) != 0) { + printf(ISANAME " cast_from_int64q arg=%lld\n", (long long)i64); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(q2)); + fflush(stdout); ecnt++; + } + } + + { + int64_t td = vgeti64(xcast_to_int64q(a0), e); + int64_t cd = mpfr_get_sj(frx, GMP_RNDZ); + + if (cd != td && !isnan(mpfr_get_d(frx, GMP_RNDN))) { + printf(ISANAME " cast_to_int64q arg=%s\n", sprintf128(q0)); + printf("test = %lld\n", (long long)td); + printf("corr = %lld\n", (long long)cd); + fflush(stdout); ecnt++; + } + } + + { + uint64_t u64 = mpfr_get_uj(frx, GMP_RNDN); + vd0 = vreinterpret_vd_vm(vsetm(vreinterpret_vm_vd(vd0), e, u64)); + t = vget(xcast_from_uint64q(vreinterpret_vu64_vm(vreinterpret_vm_vd(vd0))), e); + mpfr_set_uj(frw, u64, GMP_RNDN); + Sleef_quad q2 = mpfr_get_f128(frw, GMP_RNDN); + + if (memcmp(&t, &q2, sizeof(Sleef_quad)) != 0) { + printf(ISANAME " cast_from_uint64q arg=%llu\n", (unsigned long long)u64); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(q2)); + fflush(stdout); ecnt++; + } + } + + { + uint64_t td = vgetu64(xcast_to_uint64q(a0), e); + uint64_t cd = mpfr_get_uj(frx, GMP_RNDZ); + + if (cd != td && !isnan(mpfr_get_d(frx, GMP_RNDN))) { + printf(ISANAME " cast_to_uint64q arg=%s\n", sprintf128(q0)); + printf("test = %llu\n", (unsigned long long)td); + printf("corr = %llu\n", (unsigned long long)cd); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_less_p(frx, fry); + int ti = vgeti(xicmpltq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpltq arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_greater_p(frx, fry); + int ti = vgeti(xicmpgtq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpgtq arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_lessequal_p(frx, fry); + int ti = vgeti(xicmpleq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpleq arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_greaterequal_p(frx, fry); + int ti = vgeti(xicmpgeq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpgeq arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_equal_p(frx, fry); + int ti = vgeti(xicmpeqq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpeq arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_lessgreater_p(frx, fry); + int ti = vgeti(xicmpneq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmpne arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_cmp(frx, fry); + int ti = vgeti(xicmpq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " icmp arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + + { + int ci = mpfr_unordered_p(frx, fry); + int ti = vgeti(xiunordq(a0, a1), e); + + if (ci != ti) { + printf(ISANAME " iunord arg=%s, %s, test = %d, corr = %d \n", sprintf128(q0), sprintf128(q1), ti, ci); + fflush(stdout); ecnt++; + } + } + +#ifdef ENABLE_PUREC_SCALAR +#if !(defined(ENABLEFLOAT128) && defined(__clang__)) + if ((cnt & 15) == 1) { + char s[64]; + Sleef_quad q1; + + Sleef_snprintf(s, 63, "%.40Qg", a0); + q1 = vget(Sleef_strtoq(s, NULL), e); + if (memcmp(&q0, &q1, sizeof(Sleef_quad)) != 0 && !(isnanf128(q0) && isnanf128(q1))) { + printf("snprintf(Qg)/strtoq arg=%s str=%s test=%s\n", sprintf128(q0), s, sprintf128(q1)); + fflush(stdout); ecnt++; + } + + Sleef_snprintf(s, 63, "%Qa", a0); + q1 = vget(Sleef_strtoq(s, NULL), e); + if (memcmp(&q0, &q1, sizeof(Sleef_quad)) != 0 && !(isnanf128(q0) && isnanf128(q1))) { + printf("snprintf(Qa)/strtoq arg=%s str=%s test=%s\n", sprintf128(q0), s, sprintf128(q1)); + fflush(stdout); ecnt++; + } + } +#else + if ((cnt & 15) == 1) { + char s[64]; + Sleef_quad q1; + + Sleef_snprintf(s, 63, "%.40Pg", &a0); + q1 = vget(Sleef_strtoq(s, NULL), e); + if (memcmp(&q0, &q1, sizeof(Sleef_quad)) != 0 && !(isnanf128(q0) && isnanf128(q1))) { + printf("snprintf(Qg)/strtoq arg=%s str=%s test=%s\n", sprintf128(q0), s, sprintf128(q1)); + fflush(stdout); ecnt++; + } + + Sleef_snprintf(s, 63, "%Pa", &a0); + q1 = vget(Sleef_strtoq(s, NULL), e); + if (memcmp(&q0, &q1, sizeof(Sleef_quad)) != 0 && !(isnanf128(q0) && isnanf128(q1))) { + printf("snprintf(Qa)/strtoq arg=%s str=%s test=%s\n", sprintf128(q0), s, sprintf128(q1)); + fflush(stdout); ecnt++; + } + } +#endif +#endif + + { + mpfr_exp(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xexpq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " exp arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_exp2(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xexp2q_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " exp2 arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_exp10(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xexp10q_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " exp10 arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_expm1(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xexpm1q_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " expm1 arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_log(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xlogq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " log arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_log2(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xlog2q_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " log2 arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_log10(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xlog10q_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " log10 arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_log1p(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xlog1pq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " log1p arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_pow(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xpowq_u10(a0, a1), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " pow arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_sinh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xsinhq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " sinh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_cosh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xcoshq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " cosh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_tanh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xtanhq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " tanh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_asinh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xasinhq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " asinh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_acosh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xacoshq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " acosh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_atanh(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xatanhq_u10(a0), e), frw, 0); + + if (u0 > 0.7) { + printf(ISANAME " atanh arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_atan(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xatanq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " atan arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_atan2(frw, frx, fry, GMP_RNDN); + + double u0 = countULPf128(t = vget(xatan2q_u10(a0, a1), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " atan2 arg=%s %s ulp=%.20g\n", sprintf128(q0), sprintf128(q1), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + q0 = rndf128(oneEMinus300Q, oneQ, 1); + a0 = vset(a0, e, q0); + mpfr_set_f128(frx, q0, GMP_RNDN); + + { + mpfr_asin(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xasinq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " asin arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_acos(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xacosq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " acos arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + +#if defined(ENABLEFLOAT128) + switch(cnt & 31) { + case 0: { + memrand(&q0, sizeof(__float128)); + q0 = q0 * M_PI_2Q; + } + break; + + case 1: { + int t; + memrand(&t, sizeof(int)); + t &= ~((~0UL) << (xrand() & 31)); + q0 = t * M_PI_2Q; + } + break; + + case 2: + q0 = rndf128x(); + break; + + default: + q0 = rndf128(1e-20, 1e+20, 1); + break; + } + + a0 = vset(a0, e, q0); + mpfr_set_f128(frx, q0, GMP_RNDN); +#endif + + { + mpfr_sin(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xsinq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " sin arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_cos(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xcosq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " cos arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + + { + mpfr_tan(frw, frx, GMP_RNDN); + double u0 = countULPf128(t = vget(xtanq_u10(a0), e), frw, 0); + + if (u0 > 0.8) { + printf(ISANAME " tan arg=%s ulp=%.20g\n", sprintf128(q0), u0); + printf("test = %s\n", sprintf128(t)); + printf("corr = %s\n\n", sprintf128(mpfr_get_f128(frw, GMP_RNDN))); + fflush(stdout); ecnt++; + } + } + } +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester3printf.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester3printf.c new file mode 100644 index 0000000000000..58c5c8e20da3b --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad-tester/tester3printf.c @@ -0,0 +1,265 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +#include + +#include "sleefquad.h" + +static void convertEndianness(void *ptr, int len) { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + for(int k=0;k 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 13) +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" + Sleef_registerPrintfHook(); + static char buf[110]; + Sleef_quad q = Sleef_strtoq("3.1415926535897932384626433832795028842", NULL); + + snprintf(buf, 100, "%50.40Pe", &q); + if (strcmp(buf, " 3.1415926535897932384626433832795027974791e+00") != 0) { + fprintf(stderr, "%%50.40Pe %s\n", buf); + exit(-1); + } + snprintf(buf, 100, "%50.40Pf", &q); + if (strcmp(buf, " 3.1415926535897932384626433832795027974791") != 0) { + fprintf(stderr, "%%50.40Pf %s\n", buf); + exit(-1); + } + snprintf(buf, 100, "%50.40Pg", &q); + if (strcmp(buf, " 3.141592653589793238462643383279502797479") != 0) { + fprintf(stderr, "%%50.40Pg %s\n", buf); + exit(-1); + } + snprintf(buf, 100, "%Pa", &q); + if (strcmp(buf, "0x1.921fb54442d18469898cc51701b8p+1") != 0) { + fprintf(stderr, "%%Pa %s\n", buf); + exit(-1); + } +#endif + + // + + FILE *fp = NULL; + + if (argc != 1) { + fp = fopen(argv[1], "r"); + if (fp == NULL) { + fprintf(stderr, "Could not open %s\n", argv[1]); + exit(-1); + } + } + + // + + static char *types[] = { "Pe", "Pf", "Pg", "Pa" }; + + static const char *strvals[] = { + "1.2345678912345678912345e+0Q", + "1.2345678912345678912345e+1Q", + "1.2345678912345678912345e-1Q", + "1.2345678912345678912345e+2Q", + "1.2345678912345678912345e-2Q", + "1.2345678912345678912345e+3Q", + "1.2345678912345678912345e-3Q", + "1.2345678912345678912345e+4Q", + "1.2345678912345678912345e-4Q", + "1.2345678912345678912345e+5Q", + "1.2345678912345678912345e-5Q", + "1.2345678912345678912345e+10Q", + "1.2345678912345678912345e-10Q", + "1.2345678912345678912345e+15Q", + "1.2345678912345678912345e-15Q", + "1.2345678912345678912345e+30Q", + "1.2345678912345678912345e-30Q", + "1.2345678912345678912345e+1000Q", + "1.2345678912345678912345e-1000Q", + "1.2345678912345678912345e-4950Q", + "1.2345678912345678912345e+4920Q", + "3.36210314311209350626267781732175260e-4932", + "1.18973149535723176508575932662800702e+4932", + "6.475175119438025110924438958227646552e-4966", + "0.0Q", "1.0Q", + "1e+1Q", "1e+2Q", "1e+3Q", "1e+4Q", "1e+5Q", "1e+6Q", + "1e-1Q", "1e-2Q", "1e-3Q", "1e-4Q", "1e-5Q", "1e-6Q", + "inf", "nan", + }; + Sleef_quad vals[sizeof(strvals) / sizeof(char *)]; + for(int i=0;i ${QUAD_HEADER_PARAMS_${SIMD}} > ${SIMD_SECTION_FILE} + DEPENDS qmkrename + ) +endforeach() + +file(MAKE_DIRECTORY ${sleef_BINARY_DIR}/include) +sleef_concat_files( + OUTPUT ${SLEEFQUAD_INCLUDE_HEADER} + SOURCES ${SLEEFQUAD_ORG_HEADER} ${SLEEF_HEADER_SIMD_SECTIONS} ${SLEEFQUAD_ORG_FOOTER} +) + +# -------------------------------------------------------------------- +# qmkrename +# qrenameXXX.h for each vector extension +# -------------------------------------------------------------------- +# Helper executable: generates parts of the sleef header file +add_host_executable(qmkrename qmkrename.c) +set_target_properties(qmkrename PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +set(HEADER_FILES_GENERATED "") +foreach(SIMD ${SLEEF_SUPPORTED_QUAD_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + string(TOLOWER ${SIMD} SIMDLC) + set(HEADER_${SIMD} ${CMAKE_CURRENT_BINARY_DIR}/include/qrename${SIMDLC}.h) + list(APPEND HEADER_FILES_GENERATED ${HEADER_${SIMD}}) + + # Generate qmkrename commands + add_custom_command(OUTPUT ${HEADER_${SIMD}} + COMMAND echo Generating qrename${vecarch}.h: qmkrename ${QUAD_RENAME_PARAMS_${SIMD}} + COMMAND $ ${QUAD_RENAME_PARAMS_${SIMD}} > ${HEADER_${SIMD}} + DEPENDS qmkrename + ) + add_custom_target(qrename${SIMD}.h_generated DEPENDS ${HEADER_${SIMD}}) + endif() +endforeach() + +# Generate qrenamecuda.h + +set(HEADER_CUDA ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamecuda.h) +list(APPEND HEADER_FILES_GENERATED ${HEADER_CUDA}) +add_custom_command(OUTPUT ${HEADER_CUDA} + COMMAND echo Generating qrenamecuda.h: qmkrename ${QUAD_RENAME_PARAMS_CUDA} + COMMAND $ ${QUAD_RENAME_PARAMS_CUDA} > ${HEADER_CUDA} + DEPENDS qmkrename + ) +add_custom_target(qrenameCUDA.h_generated DEPENDS ${HEADER_CUDA}) + +# -------------------------------------------------------------------- +# sleefquad_headers +# -------------------------------------------------------------------- +add_custom_target(sleefquad_headers ALL + DEPENDS + ${SLEEFQUAD_INCLUDE_HEADER} + ${HEADER_FILES_GENERATED} +) + +# -------------------------------------------------------------------- +# libsleefquad +# -------------------------------------------------------------------- + +foreach(SIMD ${SLEEF_SUPPORTED_QUAD_EXTENSIONS}) + if(COMPILER_SUPPORTS_${SIMD}) + string(TOLOWER ${SIMD} SIMDLC) + set(OBJECT "sleefquad${SIMDLC}_obj") + add_library(${OBJECT} OBJECT sleefsimdqp.c ${HEADER_${SIMD}}) + + if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(${OBJECT} PRIVATE ENABLE_BUILTIN_MATH=1) + endif() + target_compile_definitions(${OBJECT} PRIVATE ENABLE_${SIMD}=1 DORENAME=1 ${COMMON_TARGET_DEFINITIONS}) + + set_target_properties(${OBJECT} PROPERTIES ${COMMON_TARGET_PROPERTIES}) + add_dependencies(${OBJECT} qrename${SIMD}.h_generated) + target_compile_options(${OBJECT} PRIVATE ${FLAGS_ENABLE_${SIMD}}) + + list(APPEND SLEEFQUAD_OBJECTS $) + endif() +endforeach() + +add_library(sleefquad rempitabqp.c ${SLEEFQUAD_OBJECTS}) + +set_target_properties(sleefquad PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${SLEEFQUAD_INCLUDE_HEADER} + ${COMMON_TARGET_PROPERTIES} +) + +set_target_properties(sleefquad PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +if(LIBM AND ((NOT COMPILER_SUPPORTS_BUILTIN_MATH) OR (SLEEF_ARCH_32BIT AND SLEEF_ARCH_X86))) + target_link_libraries(sleefquad ${LIBM}) +endif() + +# -------------------------------------------------------------------- +# Inline headers +# -------------------------------------------------------------------- + +if(SLEEF_BUILD_INLINE_HEADERS) + if(CMAKE_C_COMPILER_ID MATCHES "Intel") + message(FATAL_ERROR "SLEEF_BUILD_INLINE_HEADERS is not supported with Intel Compiler") + endif() + + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/) + set(INLINE_HEADER_FILES_GENERATED "") + + if (SED_COMMAND) + foreach(SIMD ${SLEEF_SUPPORTED_QUAD_EXTENSIONS} CUDA) + if(COMPILER_SUPPORTS_${SIMD} OR "${SIMD}" STREQUAL "CUDA") + string(TOLOWER ${SIMD} SIMDLC) + + if(CMAKE_CROSSCOMPILING AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_TARGET AND NOT "${SIMD}" STREQUAL "CUDA" ) + set(FLAG_TARGET --target=${CMAKE_C_COMPILER_TARGET}) + endif() + + if ("${SIMD}" STREQUAL "CUDA") + set(TARGET_PP_FLAGS ${FLAG_DEFINE}SLEEF_ALWAYS_INLINE=__device__ + ${FLAG_DEFINE}SLEEF_INLINE=__device__ + ${FLAG_DEFINE}SLEEF_CONST=__device__ + ${FLAG_DEFINE}static=__device__) + set(INLINE_HEADER_ORG ${CMAKE_CURRENT_SOURCE_DIR}/sleefquadinline_cuda_header.h.org) + # Remove redundant __device__ + set(TARGET_REPLACEMENTS -e "s/__device__ __device__/__device__/g" -e "s/__device__ __device__/__device__/g") + set(TARGET_ADDSUFFIX_KEYWORDS double2 double3 float2) + else() + set(TARGET_ADDSUFFIX_KEYWORDS Sleef_rempitabqp) + set(INLINE_HEADER_ORG ${CMAKE_CURRENT_SOURCE_DIR}/sleefquadinline_header.h.org) + endif() + + + set(INLINE_HEADER_FILE ${PROJECT_BINARY_DIR}/include/sleefquadinline_${SIMDLC}.h) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 + + # Preprocess sleefsimddp.c with SLEEF_GENHEADER defined, comments are preserved + COMMAND "${CMAKE_C_COMPILER}" ${FLAG_PREPROCESS} ${FLAG_PRESERVE_COMMENTS} # gcc -E -C + ${FLAG_TARGET} ${FLAGS_ENABLE_${SIMD}} # -msse2 + ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/common ${FLAG_INCLUDE}${PROJECT_SOURCE_DIR}/src/arch # -I/sleef/src/common -I/sleef/src/arch + ${FLAG_INCLUDE}${CMAKE_CURRENT_BINARY_DIR}/include/ # -I/build/src/quad/include + ${FLAG_DEFINE}SLEEF_GENHEADER ${FLAG_DEFINE}ENABLE_${SIMD} ${FLAG_DEFINE}DORENAME # -DSLEEF_GENHEADER -DENABLE_SSE2 -DDORENAME + ${TARGET_PP_FLAGS} + ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimdqp.c > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 # /sleef/src/quad/sleefsimdqp.c > /build/quad/sleefSSE2.h.qtmp1 + + # ${HEADER_${SIMD}} listed here as sleefsimdqp.c includes it for renaming + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sleefsimdqp.c ${HEADER_${SIMD}} + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/qmacroonly${SIMD}.h + + # Remove all lines except those begin with "//@", then remove "//@" + COMMAND ${SED_COMMAND} -e "/^\\/\\/@#.*$/!d" -e "s/^\\/\\/@#/#/g" + ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 + > ${CMAKE_CURRENT_BINARY_DIR}/include/qmacroonly${SIMD}.h + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleefquad${SIMD}.h.c + + # Remove lines beginning with "#" so that the resulting file can be preprocessed again. + COMMAND ${SED_COMMAND} -e "s/^#.*//g" ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 # sed -e "s/^#.*//g" /build/src/quad/sleefSSE2.h.qtmp1 + > ${CMAKE_CURRENT_BINARY_DIR}/sleefquad${SIMD}.h.c # > /build/src/quad/sleefquadSSE2.h.c + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp1 + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp2 + + # Preprocess the intemediate file again to remove comments + COMMAND "${CMAKE_C_COMPILER}" ${FLAG_PREPROCESS} # gcc -E + ${CMAKE_CURRENT_BINARY_DIR}/sleefquad${SIMD}.h.c # /build/src/quad/sleefquadSSE2.h.c + # Remove lines beginning with "#" + | ${SED_COMMAND} -e "s/^#.*//g" + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp2 # > /build/src/quad/sleefSSE2.h.qtmp2 + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleefquad${SIMD}.h.c ${CMAKE_CURRENT_BINARY_DIR}/include/qmacroonly${SIMD}.h + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp4 + + COMMAND ${CMAKE_COMMAND} -E cat + ${INLINE_HEADER_ORG} + ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp2 + | ${SED_COMMAND} + # Embed version number into the header + -e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCH}/g" # "s/SLEEF_VERSION_SLEEF/3.5.0/g" + -e "s/SLEEF_SIMD_SLEEF/${SIMD}/g" # -e "s/SLEEF_SIMD_SLEEF/SSE2/g" + # Substitute "SLEEFSHARP" at the beginning of line with "#" + -e "s/^SLEEFSHARP/#/g" + # Remove SLEEFXXX + -e "s/SLEEFXXX//g" + # Replace multiple empty lines with a single empty line (part 1) + -e "s/^[[:space:]]*$//g" + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp4 + + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sleefquadinline_header.h.org ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp2 + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp8 + + # Replace multiple empty lines with a single empty line + # (part 2 - cannot occur in same command as part 1) + COMMAND ${SED_COMMAND} -e "/^$/N" -e "/^\\n$/D" ${TARGET_REPLACEMENTS} + ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp4 + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp8 + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp4 + VERBATIM + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp9 + + COMMAND $ ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp8 # addSuffix /build/src/quad/sleefSSE2.h.qtmp8 + ${sleef_SOURCE_DIR}/src/common/keywords.txt "_${SIMDLC}_sleefq" # keywords.txt "_sse2_sleefq" + ${TARGET_ADDSUFFIX_KEYWORDS} # Sleef_rempitabdp Sleef_rempitabsp + > ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp9 + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp8 ${sleef_SOURCE_DIR} addSuffix + ) + + sleef_concat_files( + OUTPUT ${INLINE_HEADER_FILE} + SOURCES ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp9 ${CMAKE_CURRENT_SOURCE_DIR}/sleefquadinline_footer.h.org + ) + + list(APPEND INLINE_HEADER_FILES_GENERATED ${INLINE_HEADER_FILE}) + endif(COMPILER_SUPPORTS_${SIMD} OR "${SIMD}" STREQUAL "CUDA") + endforeach() + + add_custom_target(${TARGET_QINLINE_HEADERS} ALL + DEPENDS + ${INLINE_HEADER_FILES_GENERATED} + ) + install( + FILES ${INLINE_HEADER_FILES_GENERATED} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT sleef_Development + ) + endif(SED_COMMAND) +endif(SLEEF_BUILD_INLINE_HEADERS) + + +# -------------------------------------------------------------------- +# qmkdisp +# -------------------------------------------------------------------- +add_host_executable(qmkdisp qmkdisp.c) +set_target_properties(qmkdisp PROPERTIES ${COMMON_TARGET_PROPERTIES}) + +# Target qdispscalar.c + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qdispscalar.c.body + COMMAND $ 1 Sleef_quad double int32_t int64_t uint64_t purec purecfma > ${CMAKE_CURRENT_BINARY_DIR}/qdispscalar.c.body + DEPENDS qmkdisp + ) +sleef_concat_files( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qdispscalar.c + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/qdispscalar.c.org ${CMAKE_CURRENT_BINARY_DIR}/qdispscalar.c.body + ) + +add_custom_target(qdispscalar.c_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/qdispscalar.c) + +# Target renamedspscalar.h + +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspscalar.h + COMMAND $ 1 > ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspscalar.h + DEPENDS qmkrename + ) +add_custom_target(qrenamedspscalar.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspscalar.h) + +# Target qdispscalar_obj + +add_library(qdispscalar_obj OBJECT qdispscalar.c) +set_target_properties(qdispscalar_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) +target_compile_definitions(qdispscalar_obj PRIVATE ${COMMON_TARGET_DEFINITIONS}) +target_include_directories(qdispscalar_obj PRIVATE ${sleef_BINARY_DIR}/include) +add_dependencies(qdispscalar_obj qdispscalar.c_generated qrenamedspscalar.h_generated + sleefquad_headers ${TARGET_LIBSLEEF} ${TARGET_HEADERS}) +target_sources(sleefquad PRIVATE $) + +if(DEFINED QMKDISP_PARAMS_X2) + # Target qdispx2.c + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qdispx2.c.body + COMMAND $ ${QMKDISP_PARAMS_X2} > ${CMAKE_CURRENT_BINARY_DIR}/qdispx2.c.body + DEPENDS qmkdisp + ) + sleef_concat_files( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qdispx2.c + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/qdispx2.c.org ${CMAKE_CURRENT_BINARY_DIR}/qdispx2.c.body + ) + add_custom_target(qdispx2.c_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/qdispx2.c) + + # Target renamedspx2.h + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspx2.h + COMMAND $ 2 > ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspx2.h + DEPENDS qmkrename + ) + add_custom_target(qrenamedspx2.h_generated SOURCES ${CMAKE_CURRENT_BINARY_DIR}/include/qrenamedspx2.h) + + # Target qdispx2_obj + + add_library(qdispx2_obj OBJECT qdispx2.c) + + if(SLEEF_ARCH_X86) + if (COMPILER_SUPPORTS_AVX2) + set(DISPATCHER_DEFINITIONS ${DISPATCHER_DEFINITIONS} ENABLE_AVX2=1) + endif() + endif() + + if(SLEEF_ARCH_PPC64) + target_compile_options(qdispx2_obj PRIVATE ${FLAGS_ENABLE_VSX}) + if (COMPILER_SUPPORTS_VSX3) + set(DISPATCHER_DEFINITIONS ${DISPATCHER_DEFINITIONS} ENABLE_VSX3=1) + endif() + endif() + + if(SLEEF_ARCH_S390X) + target_compile_options(qdispx2_obj PRIVATE ${FLAGS_ENABLE_VXE}) + if (COMPILER_SUPPORTS_VXE2) + set(DISPATCHER_DEFINITIONS ${DISPATCHER_DEFINITIONS} ENABLE_VXE2=1) + endif() + endif() + + set_target_properties(qdispx2_obj PROPERTIES ${COMMON_TARGET_PROPERTIES}) + target_compile_definitions(qdispx2_obj PRIVATE ${COMMON_TARGET_DEFINITIONS} ${DISPATCHER_DEFINITIONS}) + target_include_directories(qdispx2_obj PRIVATE ${sleef_BINARY_DIR}/include) + add_dependencies(qdispx2_obj qdispx2.c_generated qrenamedspx2.h_generated + sleefquad_headers ${TARGET_LIBSLEEF} ${TARGET_HEADERS}) + target_sources(sleefquad PRIVATE $) +endif(DEFINED QMKDISP_PARAMS_X2) + +# -------------------------------------------------------------------- +# Install +# -------------------------------------------------------------------- +# Install libsleef and sleef.h +install( + TARGETS sleefquad + EXPORT sleefTargets + PUBLIC_HEADER # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT sleef_Development + LIBRARY # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Runtime + NAMELINK_COMPONENT sleef_Development + ARCHIVE # + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT sleef_Development + RUNTIME # + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT sleef_Runtime + INCLUDES # + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispatcher.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispatcher.h new file mode 100644 index 0000000000000..67032ce597c77 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispatcher.h @@ -0,0 +1,154 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if (defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER)) && !defined(_MSC_VER) +#define CONST __attribute__((const)) +#else +#define CONST +#endif + +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +static jmp_buf sigjmp; +#define SETJMP(x) setjmp(x) +#define LONGJMP longjmp +#else +static sigjmp_buf sigjmp; +#define SETJMP(x) sigsetjmp(x, 1) +#define LONGJMP siglongjmp +#endif + +static void sighandler(int signum) { + LONGJMP(sigjmp, 1); +} + +static int cpuSupportsExt(void (*tryExt)()) { + static int cache = -1; + if (cache != -1) return cache; + + void (*org); + org = signal(SIGILL, sighandler); + + if (SETJMP(sigjmp) == 0) { + (*tryExt)(); + cache = 1; + } else { + cache = 0; + } + + signal(SIGILL, org); + return cache; +} + +#define DISPATCH_vq_vq(qtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0); \ + static CONST VECTOR_CC qtype dfn(qtype arg0) { \ + qtype CONST VECTOR_CC (*p)(qtype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(qtype arg0) { return (*pfn)(arg0); } + +#define DISPATCH_vq_vq_vq(qtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, qtype arg1); \ + static CONST VECTOR_CC qtype dfn(qtype arg0, qtype arg1) { \ + qtype CONST VECTOR_CC (*p)(qtype arg0, qtype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, qtype arg1) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(qtype arg0, qtype arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_vq_vq_vq_vq(qtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, qtype arg1, qtype arg2); \ + static CONST VECTOR_CC qtype dfn(qtype arg0, qtype arg1, qtype arg2) { \ + qtype CONST VECTOR_CC (*p)(qtype arg0, qtype arg1, qtype arg2) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1, arg2); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, qtype arg1, qtype arg2) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(qtype arg0, qtype arg1, qtype arg2) { return (*pfn)(arg0, arg1, arg2); } + +#define DISPATCH_vq_vq_vx(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, xtype arg1); \ + static CONST VECTOR_CC qtype dfn(qtype arg0, xtype arg1) { \ + qtype CONST VECTOR_CC (*p)(qtype arg0, xtype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, xtype arg1) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(qtype arg0, xtype arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_vq_vq_pvx(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static VECTOR_CC qtype (*pfn)(qtype arg0, xtype *arg1); \ + static VECTOR_CC qtype dfn(qtype arg0, xtype *arg1) { \ + qtype VECTOR_CC (*p)(qtype arg0, xtype *arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static VECTOR_CC qtype (*pfn)(qtype arg0, xtype *arg1) = dfn; \ + EXPORT VECTOR_CC qtype funcName(qtype arg0, xtype *arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_vq_vx(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(xtype arg0); \ + static CONST VECTOR_CC qtype dfn(xtype arg0) { \ + qtype CONST VECTOR_CC (*p)(xtype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(xtype arg0) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(xtype arg0) { return (*pfn)(arg0); } + +#define DISPATCH_vx_vq(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC xtype (*pfn)(qtype arg0); \ + static CONST VECTOR_CC xtype dfn(qtype arg0) { \ + xtype CONST VECTOR_CC (*p)(qtype arg0) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0); \ + } \ + static CONST VECTOR_CC xtype (*pfn)(qtype arg0) = dfn; \ + EXPORT CONST VECTOR_CC xtype funcName(qtype arg0) { return (*pfn)(arg0); } + +#define DISPATCH_vx_vq_vq(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC xtype (*pfn)(qtype arg0, qtype arg1); \ + static CONST VECTOR_CC xtype dfn(qtype arg0, qtype arg1) { \ + xtype CONST VECTOR_CC (*p)(qtype arg0, qtype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC xtype (*pfn)(qtype arg0, qtype arg1) = dfn; \ + EXPORT CONST VECTOR_CC xtype funcName(qtype arg0, qtype arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_q_vq_vx(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC Sleef_quad (*pfn)(qtype arg0, xtype arg1); \ + static CONST VECTOR_CC Sleef_quad dfn(qtype arg0, xtype arg1) { \ + Sleef_quad CONST VECTOR_CC (*p)(qtype arg0, xtype arg1) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1); \ + } \ + static CONST VECTOR_CC Sleef_quad (*pfn)(qtype arg0, xtype arg1) = dfn; \ + EXPORT CONST VECTOR_CC Sleef_quad funcName(qtype arg0, xtype arg1) { return (*pfn)(arg0, arg1); } + +#define DISPATCH_vq_vq_vi_q(qtype, xtype, funcName, pfn, dfn, funcExt0, funcExt1) \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, xtype arg1, Sleef_quad arg2); \ + static CONST VECTOR_CC qtype dfn(qtype arg0, xtype arg1, Sleef_quad arg2) { \ + qtype CONST VECTOR_CC (*p)(qtype arg0, xtype arg1, Sleef_quad arg2) = funcExt0; \ + SUBST_IF_EXT1(funcExt1); \ + pfn = p; \ + return (*pfn)(arg0, arg1, arg2); \ + } \ + static CONST VECTOR_CC qtype (*pfn)(qtype arg0, xtype arg1, Sleef_quad arg2) = dfn; \ + EXPORT CONST VECTOR_CC qtype funcName(qtype arg0, xtype arg1, Sleef_quad arg2) { return (*pfn)(arg0, arg1, arg2); } + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispscalar.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispscalar.c.org new file mode 100644 index 0000000000000..cc2b89133f50d --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispscalar.c.org @@ -0,0 +1,23 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleefquad.h" + +#include "qdispatcher.h" + +NOEXPORT Sleef_quad sleef_cpuid_QUADFMA_0; +static void tryFMA() { sleef_cpuid_QUADFMA_0 = Sleef_sinq1_u10purecfma(sleef_cpuid_QUADFMA_0); } + +#define SUBST_IF_EXT1(funcExt1) if (cpuSupportsExt(tryFMA)) p = funcExt1; + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispx2.c.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispx2.c.org new file mode 100644 index 0000000000000..3ee64a5702d82 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qdispx2.c.org @@ -0,0 +1,39 @@ +// Copyright Naoki Shibata and contributors 2010 - 2023. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "misc.h" + +#define SLEEF_IMPORT_IS_EXPORT +#include "sleefquad.h" + +#include "qdispatcher.h" + +NOEXPORT Sleef_quadx2 sleef_cpuid_EXT; + +#ifdef ENABLE_AVX2 +static void tryEXT1() { sleef_cpuid_EXT = Sleef_sinq2_u10avx2128(sleef_cpuid_EXT); } +#define SUBST_IF_EXT1(funcExt1) if (cpuSupportsExt(tryEXT1)) p = funcExt1; +#endif + +#ifdef ENABLE_VSX3 +static void tryEXT1() { sleef_cpuid_EXT = Sleef_sinq2_u10vsx3(sleef_cpuid_EXT); } +#define SUBST_IF_EXT1(funcExt1) if (cpuSupportsExt(tryEXT1)) p = funcExt1; +#endif + +#ifdef ENABLE_VXE2 +static void tryEXT1() { sleef_cpuid_EXT = Sleef_sinq2_u10vxe2(sleef_cpuid_EXT); } +#define SUBST_IF_EXT1(funcExt1) if (cpuSupportsExt(tryEXT1)) p = funcExt1; +#endif + +#ifndef SUBST_IF_EXT1 +#define SUBST_IF_EXT1(funcExt1) +#endif + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qfuncproto.h b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qfuncproto.h new file mode 100644 index 0000000000000..d52e8f8b93721 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qfuncproto.h @@ -0,0 +1,130 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +typedef struct { + char *name; + int ulp; + int ulpSuffix; + int funcType; + int flags; +} funcSpec; + +/* + ulp : (error bound in ulp) * 10 + + ulpSuffix: + 0 : "" + 1 : "_u10" + 2 : "_u05" + + funcType: + 0 : vargquad func(vargquad); + 1 : vargquad func(vargquad, vargquad); + 2 : vargquad2 func(vargquad); + 3 : vargquad func(vargquad, vint); + 4 : vint func(vargquad); + 5 : vargquad func(vargquad, vargquad, vargquad); + 6 : vargquad2 func(vargquad); + 7 : int func(int); + 8 : void *func(int); + 9 : vint func(vargquad, vargquad); + 10 : vdouble func(vargquad); + 11 : vargquad func(vdouble); + 12 : vargquad func(Sleef_quad); + 13 : vargquad func(vint, Sleef_quad, Sleef_quad); + 14 : vargquad func(Sleef_quad *); + 15 : void func(Sleef_quad *, vargquad); + 16 : Sleef_quad func(vargquad, int); + 17 : vargquad func(vargquad, int, Sleef_quad); + 18 : vint64 func(vargquad); + 19 : vargquad func(vint64); + 20 : vuint64 func(vargquad); + 21 : vargquad func(vuint64); + 22 : vargquad func(vargquad, vint *); + 23 : vargquad func(vargquad, vargquad *); + */ + +funcSpec funcList[] = { + { "add", 5, 2, 1, 0 }, + { "sub", 5, 2, 1, 0 }, + { "mul", 5, 2, 1, 0 }, + { "div", 5, 2, 1, 0 }, + { "neg", -1, 0, 0, 0 }, + { "sqrt", 5, 2, 0, 0 }, + { "cbrt", 10, 1, 0, 0 }, + + { "icmplt", -1, 0, 9, 0 }, + { "icmple", -1, 0, 9, 0 }, + { "icmpgt", -1, 0, 9, 0 }, + { "icmpge", -1, 0, 9, 0 }, + { "icmpeq", -1, 0, 9, 0 }, + { "icmpne", -1, 0, 9, 0 }, + { "icmp" , -1, 0, 9, 0 }, + { "iunord", -1, 0, 9, 0 }, + { "iselect", -1, 0, 13, 0 }, + + { "cast_to_double", -1, 0, 10, 0 }, + { "cast_from_double", -1, 0, 11, 0 }, + { "cast_to_int64", -1, 0, 18, 0 }, + { "cast_from_int64", -1, 0, 19, 0 }, + { "cast_to_uint64", -1, 0, 20, 0 }, + { "cast_from_uint64", -1, 0, 21, 0 }, + { "load", -1, 0, 14, 0 }, + { "store", -1, 0, 15, 0 }, + { "get", -1, 0, 16, 0 }, + { "set", -1, 0, 17, 0 }, + { "splat", -1, 0, 12, 0 }, + + { "sin", 10, 1, 0, 0 }, + { "cos", 10, 1, 0, 0 }, + { "tan", 10, 1, 0, 0 }, + + { "asin", 10, 1, 0, 0 }, + { "acos", 10, 1, 0, 0 }, + { "atan", 10, 1, 0, 0 }, + { "atan2", 10, 1, 1, 0 }, + + { "exp", 10, 1, 0, 0 }, + { "exp2", 10, 1, 0, 0 }, + { "exp10", 10, 1, 0, 0 }, + { "expm1", 10, 1, 0, 0 }, + + { "log", 10, 1, 0, 0 }, + { "log2", 10, 1, 0, 0 }, + { "log10", 10, 1, 0, 0 }, + { "log1p", 10, 1, 0, 0 }, + + { "pow", 10, 1, 1, 0 }, + + { "sinh", 10, 1, 0, 0 }, + { "cosh", 10, 1, 0, 0 }, + { "tanh", 10, 1, 0, 0 }, + + { "asinh", 10, 1, 0, 0 }, + { "acosh", 10, 1, 0, 0 }, + { "atanh", 10, 1, 0, 0 }, + + { "trunc", -1, 0, 0, 0 }, + { "floor", -1, 0, 0, 0 }, + { "ceil", -1, 0, 0, 0 }, + { "round", -1, 0, 0, 0 }, + { "rint", -1, 0, 0, 0 }, + + { "fabs", -1, 0, 0, 0 }, + { "copysign", -1, 0, 1, 0 }, + { "fmax", -1, 0, 1, 0 }, + { "fmin", -1, 0, 1, 0 }, + { "fdim", 5, 2, 1, 0 }, + { "fmod", -1, 0, 1, 0 }, + { "remainder", -1, 0, 1, 0 }, + { "frexp", -1, 0, 22, 0 }, + { "modf", -1, 0, 23, 0 }, + { "hypot", 5, 2, 1, 0 }, + { "ldexp", -1, 0, 3, 0 }, + { "ilogb", -1, 0, 4, 0 }, + { "fma", 5, 2, 5, 0 }, + + { NULL, -1, 0, 0, 0 }, +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qmkdisp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qmkdisp.c new file mode 100644 index 0000000000000..91a9effed3df6 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/qmkdisp.c @@ -0,0 +1,206 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include "qfuncproto.h" + +int main(int argc, char **argv) { + if (argc < 7) { + fprintf(stderr, "Usage : %s [ ...]\n", argv[0]); + fprintf(stderr, "\n"); + exit(-1); + } + + const int wdp = atoi(argv[1]); + const char *vquadname = argv[2], *vdoublename = argv[3]; + const char *vintname = argv[4], *vint64name = argv[5], *vuint64name = argv[6]; + const int isastart = 7, nisa = argc - isastart; + + for(int i=0;funcList[i].name != NULL;i++) { + char ulpSuffix0[100] = "", ulpSuffix1[100] = "_"; + if (funcList[i].ulp >= 0) { + sprintf(ulpSuffix0, "_u%02d", funcList[i].ulp); + sprintf(ulpSuffix1, "_u%02d", funcList[i].ulp); + } + + switch(funcList[i].funcType) { + case 0: + printf("DISPATCH_vq_vq(%s, Sleef_%sq%d%s, pnt_%sq%d%s, disp_%sq%d%s", + vquadname, + funcList[i].name, wdp, ulpSuffix0, + funcList[i].name, wdp, ulpSuffix0, + funcList[i].name, wdp, ulpSuffix0); + for(int j=0;j +#include +#include +#include +#include + +#include "qfuncproto.h" + +int main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Generate a header for renaming functions\n"); + fprintf(stderr, "Usage : %s []\n", argv[0]); + fprintf(stderr, "\n"); + + fprintf(stderr, "Generate a part of header for library functions\n"); + fprintf(stderr, "Usage : %s []\n", argv[0]); + fprintf(stderr, "\n"); + + exit(-1); + } + + static char *ulpSuffixStr[] = { "", "_u10", "_u05" }; + + if (argc == 2 || argc == 3) { + char *wqp = argv[1]; + char *isaname = argc == 2 ? "" : argv[2]; + char *isaub = argc == 3 ? "_" : ""; + + if (strcmp(isaname, "sve") == 0) wqp = "x"; + + for(int i=0;funcList[i].name != NULL;i++) { + if (funcList[i].ulp >= 0) { + printf("#define x%sq%s Sleef_%sq%s_u%02d%s\n", + funcList[i].name, ulpSuffixStr[funcList[i].ulpSuffix], + funcList[i].name, wqp, + funcList[i].ulp, isaname); + } else { + printf("#define x%sq Sleef_%sq%s%s%s\n", funcList[i].name, funcList[i].name, wqp, isaub, isaname); + } + } + } else { + char *wqp = argv[1]; + char *vargquadname = argv[2]; + char *vargquad2name = argv[3]; + char *vdoublename = argv[4]; + //char *vfloatname = argv[5]; + //char *vmaskname = argv[6]; + char *vintname = argv[7]; + char *vint64name = argv[8]; + char *vuint64name = argv[9]; + char *architecture = argv[10]; + char *isaname = argc == 12 ? argv[11] : ""; + char *isaub = argc == 12 ? "_" : ""; + + if (strcmp(isaname, "sve") == 0) wqp = "x"; + + printf("#ifdef %s\n", architecture); + + if (strcmp(vargquadname, "-") != 0) { + for(int i=0;funcList[i].name != NULL;i++) { + switch(funcList[i].funcType) { + case 0: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 1: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s, %s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname, vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, %s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vargquadname); + } + break; + case 2: + case 6: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vargquad2name, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vargquad2name, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 3: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s, %s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname, vintname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, %s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vintname); + } + break; + case 4: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vintname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vintname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 5: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s, %s, %s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname, vargquadname, vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, %s, %s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vargquadname, vargquadname); + } + break; + case 7: + printf("SLEEF_IMPORT SLEEF_CONST int Sleef_%sq%s%s%s(int);\n", funcList[i].name, wqp, isaub, isaname); + break; + case 8: + printf("SLEEF_IMPORT SLEEF_CONST void *Sleef_%sq%s%s%s(int);\n", funcList[i].name, wqp, isaub, isaname); + break; + case 9: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s, %s);\n", + vintname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname, vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, %s);\n", + vintname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vargquadname); + } + break; + case 10: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vdoublename, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vdoublename, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 11: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vdoublename); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vdoublename); + } + break; + case 12: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(Sleef_quad);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname); + break; + case 13: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, Sleef_quad, Sleef_quad);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vintname); + break; + + case 14: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(Sleef_quad *);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname); + break; + case 15: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST void Sleef_%sq%s%s%s(Sleef_quad *, %s);\n", + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + break; + case 16: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST Sleef_quad Sleef_%sq%s%s%s(%s, int);\n", + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + break; + case 17: + assert(funcList[i].ulp == -1); + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s, int, Sleef_quad);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + break; + case 18: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vint64name, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vint64name, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 19: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vint64name); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vint64name); + } + break; + case 20: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vuint64name, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vargquadname); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vuint64name, + funcList[i].name, wqp, + isaub, isaname, + vargquadname); + } + break; + case 21: + if (funcList[i].ulp >= 0) { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s_u%02d%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + funcList[i].ulp, isaname, + vuint64name); + } else { + printf("SLEEF_IMPORT SLEEF_CONST %s Sleef_%sq%s%s%s(%s);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vuint64name); + } + break; + case 22: + { + printf("SLEEF_IMPORT %s Sleef_%sq%s%s%s(%s, %s *);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vintname); + } + break; + case 23: + { + printf("SLEEF_IMPORT %s Sleef_%sq%s%s%s(%s, %s *);\n", + vargquadname, + funcList[i].name, wqp, + isaub, isaname, + vargquadname, vargquadname); + } + break; + } + } + } + + printf("#endif\n"); + } + + exit(0); +} diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/rempitabqp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/rempitabqp.c new file mode 100644 index 0000000000000..add9cdabe7f7e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/rempitabqp.c @@ -0,0 +1,4176 @@ +#include "misc.h" + +NOEXPORT const double Sleef_rempitabqp[] = { + 0.15915494308865163475, 114.12758349655632628, 87.820147804392036051, 27.423136899138626177, + 14.254027919272630243, 85.935026329207175877, 114.27691102886092267, 37.750191829592949944, + 2.4546589403216785286, 111.34725244651053799, 62.908236858707823558, 87.408456635555921821, + 64.604759095473127672, 28.784837529448850546, 51.622219578821386676, 23.484166172853292665, + 126.14843699368429952, 64.497947248710261192, 90.04072758117763442, 79.851150118094665231, + 93.238662576877686661, 47.957378064249496674, 44.495092337878304534, 122.05645651105805882, + 36.728927543368627084, 8.9860062754451064393, 3.1885831643376150168, 117.4925837228220189, + 107.81580297079563024, 72.690177145766938338, 6.3499807085099746473, 64.814470052646356635, + 32.07563458668300882, 48.190104861652798718, 40.78663459321251139, 17.552382976566150319, + 13.621939875218231464, 21.256544246167322854, 57.381995073275902541, 9.6354705119701975491, + 41.499050218579213833, 113.6220945173263317, 79.59452043374767527, 103.64401134191575693, + 123.88471844718515058, 101.4736260631980258, 18.097774968078738311, 85.95650738066615304, + 76.065655079091811785, 37.675427324622432934, 68.676777671174932038, 32.00599382463042275, + 53.77951688189568813, 0.19179906913632294163, 73.478443940475699492, 111.92379273104597814, + 40.996545034144219244, 107.14597675384720787, 124.38805678367862129, 98.636395050234568771, + 103.347364549201302, 101.568637595839391, 98.20809433281829115, 0.21127150943721062504, + 6.4992127331242954824, 115.19938259065020247, 123.67517849772775662, 108.64186459926349926, + 2.9984621451549173798, 4.6062990500759042334, 93.491721027461608173, 49.145381707759952405, + 52.727074269980221288, 71.068700205698405625, 99.034355036987108178, 24.011549219118023757, + 111.50147725937858922, 49.03615573892602697, 53.722402094637800474, 91.897739203315722989, + 18.206447852357086958, 109.32060226575413253, 97.416567328084056498, 19.228490159101056634, + 125.86502164847843233, 68.117931140997825423, 37.659347287717537256, 94.778508877261629095, + 125.23389264055003878, 9.1960193313898344059, 89.79227686872400227, 44.219955035077873617, + 80.594031160762824584, 98.175325535910815233, 9.1060313697525998577, 1.3536325568711617962, + 74.266441315219708486, 112.02497297326408443, 78.441242103348486125, 30.240608034280739957, + 35.887181287234852789, 31.222180933826166438, 111.20435677495697746, 16.961934521656075958, + 75.690011131529900013, 19.857096218624064932, 39.445799316181364702, 89.399067092508630594, + 9.8946251570741878822, 75.790836480315192603, 41.449609204857551958, 16.424785501782025676, + 110.92636979258531937, 35.2268612109037349, 93.553590155912388582, 60.716867816085141385, + 101.8275823641452007, 0.52353978253449895419, 53.558147969339188421, 14.022688405977532966, + 47.412589899395243265, 67.466685592477006139, 20.558449846765142865, 42.477512440153077478, + 78.376983236481464701, 52.194720245763164712, 80.210266588394006249, 10.32282516378472792, + 13.76645060176088009, 65.576818637229735032, 113.30637098982697353, 33.130573191992880311, + 85.595008141503058141, 40.008528567348548677, 76.341531842852418777, 14.979836669819633244, + 71.290441850942443125, 102.19776376600566437, 98.564603420047205873, 14.271847993266419508, + 80.116664932062121807, 19.992192520050593885, 36.609960786536248634, 73.030199955795978894, + 104.99763589425128885, 48.433380696202220861, 57.572455457851901883, 118.88634466403527767, + 44.860695004797889851, 73.750690998633217532, 13.556655583906831453, 88.593745596503140405, + 14.11532725519646192, 43.085424128406884847, 9.7802314795590064023, 30.352614322964655003, + 90.858137878454726888, 85.039140199140092591, 23.407077980155008845, 18.207643349760473939, + 20.440075362967036199, 109.47096555736425216, 66.428168903472396778, 106.84400033217025339, + 91.750582754768402083, 76.596534958600386744, 17.320324285941751441, 49.535734807919652667, + 113.66190455558171379, 61.225422811843600357, 18.669559649624716258, 76.387663934096053708, + 74.178235974148265086, 85.815782102505181683, 122.10498128451581579, 24.799236859667871613, + 123.2972609065072902, 50.72595180519783753, 121.41778173806596897, 114.39462376141091227, + 90.193730781800695695, 3.0683144895410805475, 26.293759879121353151, 46.076575149436393986, + 19.660881336145394016, 25.597005338699091226, 101.31112300279710325, 103.8807629969487607, + 91.892762314044375671, 57.045969595055794343, 110.15196133002973511, 94.689776863833685638, + 49.182032269411138259, 123.69104138236070867, 113.69436034850150463, 117.72063118611185928, + 1.4682589776566601358, 23.970066872989264084, 91.772521428280015243, 32.248277749331464292, + 74.556784206688462291, 120.01798423568834551, 87.713686773899098625, 80.036939679470378906, + 58.663490617163915886, 21.035325459186424268, 79.868647571121982764, 19.982377222022478236, + 57.246738529793219641, 1.9401161782407143619, 7.9883917663682950661, 108.92261904602855793, + 42.957866646069305716, 55.213983339206606615, 85.734177860773343127, 8.1786861732471152209, + 113.8021284014939738, 6.3038078266908996738, 108.74856571221971535, 13.502748231236182619, + 29.736439245178189594, 66.181101124901033472, 14.021098141827678774, 50.432291116485430393, + 71.692326357551792171, 112.62160509388922947, 46.52251733029333991, 70.328927450136689004, + 82.779915324492321815, 114.20617270459479187, 120.00074403454345884, 27.256265592593990732, + 72.206675336365151452, 105.47692570983417681, 90.069591432285960764, 59.451044258996262215, + 6.5436011348210740834, 11.666369110360392369, 127.00500442843986093, 66.781588143319822848, + 101.71752368163652136, 110.83473463953487226, 9.4843589676565898117, 87.965483504598523723, + 32.660788242061244091, 94.484722863278875593, 121.36131720729463268, 27.298648878622771008, + 105.17309219513481366, 68.000137710059789242, 93.444196628861391218, 44.093294898437306983, + 44.109477207573945634, 104.37636018792545656, 16.936308635202294681, 42.461140061379410326, + 48.120956522194319405, 47.03053727519363747, 74.836943859434541082, 76.560959611877478892, + 70.982041261755512096, 106.17278879548030091, 17.240951762454642449, 116.54761581097409362, + 85.489981931084912503, 19.448874795671144966, 68.055698282205412397, 120.54780957969705923, + 79.357897397254419047, 26.784055884931149194, 8.8652342647874320392, 93.554617017987766303, + 36.863637874987034593, 107.36296787388710072, 114.24380599117284874, 57.996031665523332777, + 107.15169167585190735, 6.8493815877518500201, 70.030736486780369887, 104.34439242449298035, + 32.394922227955248673, 72.045712768554949434, 125.99193223337715608, 79.855994894536706852, + 102.91479410954343621, 19.828504664699721616, 19.423237169754429488, 49.419210917687451001, + 51.794468197291280376, 59.485514724419772392, 78.600481083303748164, 75.802543954887369182, + 49.485430251796060475, 125.97828236915302114, 98.782930868979747174, 83.325835802559595322, + 59.946491932565550087, 73.477066622643178562, 89.105636388390848879, 73.372970791053376161, + 18.817599439345940482, 102.06705368556504254, 45.42352350837609265, 23.440921115026867483, + 90.344093902869644808, 17.970589397602452664, 53.956875561776541872, 55.525845976218988653, + 49.46730813278190908, 77.778136706394434441, 43.505807501616800437, 67.471431943824427435, + 84.265864734097704059, 14.933240975493390579, 24.684664495714969235, 126.41874786355037941, + 1.3222032844169007149, 126.01238007772190031, 83.383431563808699138, 113.72324844212562311, + 21.304834404720168095, 62.332525882295158226, 51.597882727459364105, 0.67672862408289802261, + 30.132787537324475124, 27.410108195865177549, 20.656855709145020228, 49.723609964024944929, + 119.05708648653671844, 91.246047016928059747, 84.369696109431970399, 85.591131138298806036, + 14.127644950760441134, 4.2155267645284766331, 24.204889203938364517, 19.661099106528126867, + 82.477870938018895686, 120.89188850888967863, 122.58114253445455688, 120.63265677435265388, + 27.082481923996965634, 29.761974944867688464, 72.461197358730714768, 84.204483040954073658, + 80.890771993039379595, 99.777925805155973649, 91.8974949579933309, 94.518818676227965625, + 126.28205386120316689, 88.787575110411125934, 93.769932165232603438, 79.733441483964270446, + 38.645666720854933374, 115.27208568365676911, 31.268716353544732556, 112.30475518474486307, + 74.891574611563555663, 115.66812160437984858, 18.66350298186080181, 94.633595189065090381, + 109.45983699533462641, 108.68776993196661351, 58.76809135159055586, 61.680897811242175521, + 38.882956551777169807, 45.576713001821190119, 7.4377005918177019339, 120.60427874347078614, + 120.21996894028052338, 47.606037590059713693, 0.31830988618094124831, 100.25516699311629054, + 47.640295608784072101, 54.846273798277252354, 28.508055838548898464, 43.870052658417989733, + 100.55382205772184534, 75.500383659185899887, 4.9093178806469950359, 94.694504893021075986, + 125.81647371741928509, 46.816913271115481621, 1.2095181909462553449, 57.569675058897701092, + 103.24443915764277335, 46.968332345710223308, 124.29687398737223702, 0.99589449742416036315, + 52.081455162358906819, 31.702300236192968441, 58.477325153755373321, 95.914756128498993348, + 88.990184675760247046, 116.11291302211611765, 73.457855086737254169, 17.972012550890212879, + 6.3771663286788680125, 106.98516744564767578, 87.631605941594898468, 17.380354291533876676, + 12.699961417023587273, 1.6289401052927132696, 64.15126917336601764, 96.380209723305597436, + 81.573269186425022781, 35.104765953132300638, 27.243879750436462928, 42.513088492334645707, + 114.76399014655180508, 19.270941023940395098, 82.998100437162065646, 99.244189034656301374, + 31.189040867498988518, 79.288022683835151838, 119.76943689437393914, 74.947252126396051608, + 36.195549936161114601, 43.913014761335944058, 24.131310158183623571, 75.350854649248503847, + 9.3535553423498640768, 64.011987649260845501, 107.55903376379137626, 0.38359813827628386207, + 18.956887880955036962, 95.847585462091956288, 81.993090068292076467, 86.291953507698053727, + 120.77611356736088055, 69.272790100472775521, 78.694729098406241974, 75.137275191682419972, + 68.4161886656365823, 0.42254301887442125008, 12.998425466252228944, 102.39876518130404293, + 119.35035699545915122, 89.283729198526998516, 5.9969242903098347597, 9.2125981001554464456, + 58.983442054923216347, 98.290763415519904811, 105.45414853996408056, 14.137400411400449229, + 70.068710073974216357, 48.023098438239685493, 95.002954518757178448, 98.07231147785205394, + 107.44480418927923893, 55.795478406631445978, 36.412895704717811896, 90.641204531511903042, + 66.833134656168112997, 38.456980318205751246, 123.73004329696050263, 8.2358622819956508465, + 75.318694575438712491, 61.557017754526896169, 122.46778528110007755, 18.392038662783306791, + 51.58455373744800454, 88.439910070159385214, 33.188062321529287146, 68.350651071821630467, + 18.212062739505199715, 2.7072651137459615711, 20.53288263044305495, 96.04994594653180684, + 28.882484206696972251, 60.481216068561479915, 71.774362574469705578, 62.444361867655970855, + 94.408713549913954921, 33.923869043315789895, 23.380022263059800025, 39.714192437248129863, + 78.891598632366367383, 50.798134185017261188, 19.789250314152013743, 23.581672960630385205, + 82.899218409715103917, 32.849571003567689331, 93.852739585170638748, 70.453722421811107779, + 59.107180311824777164, 121.43373563217392075, 75.655164728290401399, 1.0470795650689979084, + 107.11629593867837684, 28.045376811955065932, 94.825179798794124508, 6.9333711849540122785, + 41.116899693530285731, 84.955024880309792934, 28.753966472962929402, 104.3894404915299674, + 32.420533176788012497, 20.64565032756945584, 27.532901203525398159, 3.1536372744631080423, + 98.612741979653947055, 66.261146383989398601, 43.190016283006116282, 80.017057134700735332, + 24.683063685704837553, 29.959673339642904466, 14.580883701888524229, 76.39552753201496671, + 69.129206840094411746, 28.543695986536476994, 32.233329864124243613, 39.984385040101187769, + 73.219921573076135246, 18.060399911595595768, 81.995271788502577692, 96.866761392404441722, + 115.14491091570744175, 109.77268932807055535, 89.721390009599417681, 19.501381997266435064, + 27.113311167817300884, 49.18749119300628081, 28.230654510392923839, 86.170848256813769694, + 19.560462959118012805, 60.705228645932947984, 53.716275756913091755, 42.078280398280185182, + 46.81415596031001769, 36.415286699520947877, 40.880150725937710376, 90.941931114732142305, + 4.8563378069484315347, 85.688000664344144752, 55.501165509540442144, 25.193069917200773489, + 34.640648571883502882, 99.071469615842943313, 99.323809111163427588, 122.45084562368720071, + 37.339119299253070494, 24.775327868195745395, 20.356471948300168151, 43.631564205014001345, + 116.20996256903163157, 49.598473719339381205, 118.5945218130145804, 101.45190361039931304, + 114.83556347613557591, 100.78924752282546251, 52.38746156360139139, 6.136628979082161095, + 52.587519758242706303, 92.153150298872787971, 39.321762672290788032, 51.194010677401820431, + 74.622246005597844487, 79.761525993901159381, 55.785524628088751342, 114.09193919011522667, + 92.303922660063108196, 61.379553727667371277, 98.364064538825914497, 119.38208276472505531, + 99.388720697006647242, 107.44126237222371856, 2.9365179553133202717, 47.940133745982166147, + 55.545042856560030486, 64.496555498666566564, 21.113568413380562561, 112.03596847138032899, + 47.42737354780183523, 32.073879358940757811, 117.32698123432783177, 42.070650918376486516, + 31.737295142243965529, 39.964754444044956472, 114.49347705958643928, 3.8802323564814287238, + 15.976783532740228111, 89.845238092057115864, 85.915733292138611432, 110.42796667841685121, + 43.468355721546686254, 16.357372346497868421, 99.604256802987947594, 12.607615653385437327, + 89.497131424439430702, 27.005496462472365238, 59.472878490360017167, 4.3622022498020669445, + 28.042196283655357547, 100.86458223297449877, 15.384652715107222321, 97.243210187778458931, + 93.045034660590317799, 12.657854900277015986, 37.559830648988281609, 100.41234540919322171, + 112.00148806908691768, 54.512531185191619443, 16.413350672733940883, 82.953851419671991607, + 52.139182864571921527, 118.90208851799252443, 13.087202269642148167, 23.332738220724422717, + 126.01000885688335984, 5.5631762866432836745, 75.435047363276680699, 93.669469279069744516, + 18.968717935316817602, 47.930967009197047446, 65.321576484126126161, 60.969445726561389165, + 114.72263441458926536, 54.597297757249179995, 82.346184390273265308, 8.0002754201232164633, + 58.888393257722782437, 88.186589796874613967, 88.218954415151529247, 80.752720375850913115, + 33.872617270404589362, 84.922280122758820653, 96.241913044388638809, 94.061074550390912918, + 21.673887718872720143, 25.121919223758595763, 13.964082523514662171, 84.34557759096060181, + 34.481903524912922876, 105.09523162195182522, 42.979963862169825006, 38.897749591345927911, + 8.1113965644144627731, 113.09561915939775645, 30.715794794508838095, 53.568111769862298388, + 17.730468529578502057, 59.109234035975532606, 73.727275749977707164, 86.725935747777839424, + 100.48761198234569747, 115.99206333105030353, 86.303383351703814697, 13.698763175507338019, + 12.061472973564377753, 80.688784848985960707, 64.789844455914135324, 16.091425537113536848, + 123.98386446675795014, 31.711989789077051682, 77.829588219086872414, 39.657009329399443232, + 38.846474339508858975, 98.838421835374902003, 103.58893639458256075, 118.97102944884318276, + 29.200962166611134307, 23.605087909774738364, 98.970860503595758928, 123.95656473830968025, + 69.565861737963132327, 38.651671605119190644, 119.89298386513473815, 18.954133245289995102, + 50.211272776785335736, 18.745941582106752321, 37.635198878695518943, 76.134107371130085085, + 90.8470470167521853, 46.881842230057372944, 52.688187805739289615, 35.941178795204905327, + 107.91375112355308374, 111.05169195243797731, 98.934616265567456139, 27.556273412788868882, + 87.011615003237238852, 6.9428638876524928492, 40.531729468195408117, 29.866481950986781158, + 49.369328991433576448, 124.83749572710075881, 2.6444065688374394085, 124.02476015544743859, + 38.766863127621036256, 99.446496884251246229, 42.60966880944033619, 124.66505176459031645, + 103.19576545491872821, 1.3534572481657960452, 60.265575074648950249, 54.820216391730355099, + 41.313711418290040456, 99.447219928053527838, 110.11417297307707486, 54.492094033859757474, + 40.739392218867578777, 43.182262276597612072, 28.255289901520882268, 8.4310535290569532663, + 48.409778407876729034, 39.322198213059891714, 36.95574187604142935, 113.78377701778299524, + 117.16228506891275174, 113.26531354870530777, 54.164963847993931267, 59.523949889739014907, + 16.922394717465067515, 40.408966081911785295, 33.781543986082397169, 71.555851610315585276, + 55.794989915990299778, 61.037637352459569229, 124.56410772240997176, 49.575150220825889846, + 59.539864330468844855, 31.466882967928540893, 77.291333441713504726, 102.54417136731353821, + 62.53743270709310309, 96.609510369493364124, 21.783149223130749306, 103.33624320875969715, + 37.3270059637252416, 61.26719037813381874, 90.919673990672890795, 89.375539863933227025, + 117.53618270318111172, 123.36179562248435104, 77.765913103554339614, 91.153426003642380238, + 14.875401183639041847, 113.20855748694521026, 112.43993788056104677, 95.212075180119427387, + 0.63661977236552047543, 72.510333986232581083, 95.280591217568144202, 109.69254759655450471, + 57.016111677097796928, 87.740105316839617444, 73.107644115447328659, 23.000767318371799774, + 9.8186357612976280507, 61.389009786045789951, 123.63294743483857019, 93.633826542230963241, + 2.4190363818925106898, 115.13935011779904016, 78.488878315285546705, 93.936664691424084594, + 120.59374797474447405, 1.9917889948483207263, 104.16291032471781364, 63.404600472385936882, + 116.95465030751438462, 63.829512257001624675, 49.980369351524132071, 104.22582604423587327, + 18.915710173474508338, 35.944025101780425757, 12.754332657361374004, 85.970334891298989533, + 47.263211883189796936, 34.760708583067753352, 25.399922834047174547, 3.257880210589064518, + 0.30253834673567325808, 64.76041944661483285, 35.146538372850045562, 70.209531906264601275, + 54.487759500872925855, 85.026176984672929393, 101.52798029310361017, 38.541882047884428175, + 37.99620087432776927, 70.488378069312602747, 62.378081735001615016, 30.576045367673941655, + 111.53887378875151626, 21.894504252792103216, 72.391099872322229203, 87.826029522671888117, + 48.262620316370885121, 22.701709298497007694, 18.707110684703366132, 0.023975298525328980759, + 87.118067527582752518, 0.76719627655256772414, 37.913775761913711904, 63.695170924187550554, + 35.986180136587790912, 44.583907015399745433, 113.55222713472539908, 10.54558020094918902, + 29.389458196816121927, 22.274550383368477924, 8.8323773312731646001, 0.84508603774884250015, + 25.996850932508095866, 76.797530362611723831, 110.70071399092194042, 50.567458397053997032, + 11.993848580619669519, 18.425196200310892891, 117.96688410985007067, 68.581526831043447601, + 82.908297079928161111, 28.274800822804536438, 12.137420147948432714, 96.046196876483008964, + 62.005909037517994875, 68.144622955707745859, 86.889608378558477852, 111.59095681326289196, + 72.82579140943926177, 53.282409063027444063, 5.6662693123362259939, 76.91396063641514047, + 119.46008659392100526, 16.471724563994939672, 22.637389150877424981, 123.11403550905743032, + 116.93557056220015511, 36.784077325566613581, 103.16910747489964706, 48.879820140318770427, + 66.376124643062212272, 8.7013021436432609335, 36.424125479010399431, 5.4145302274919231422, + 41.065765260889747879, 64.099891893063613679, 57.764968413393944502, 120.96243213712659781, + 15.548725148939411156, 124.88872373531557969, 60.817427099827909842, 67.84773808663157979, + 46.76004452611960005, 79.428384874499897705, 29.783197264732734766, 101.59626837003452238, + 39.578500628304027487, 47.163345921264408389, 37.798436819430207834, 65.699142007139016641, + 59.705479170344915474, 12.907444843622215558, 118.21436062365319231, 114.86747126435147948, + 23.310329456580802798, 2.0941591301416337956, 86.232591877356753685, 56.090753623913769843, + 61.650359597588249017, 13.866742369908024557, 82.233799387064209441, 41.910049760619585868, + 57.507932945929496782, 80.778880983059934806, 64.841066353576024994, 41.291300655138911679, + 55.065802407050796319, 6.3072745489298540633, 69.225483959311532089, 4.5222927679787972011, + 86.380032566015870543, 32.034114269401470665, 49.366127371409675106, 59.919346679285808932, + 29.161767403780686436, 24.791055064033571398, 10.258413680188823491, 57.087391973072953988, + 64.466659728248487227, 79.968770080206013517, 18.439843146152270492, 36.120799823194829514, + 35.990543577008793363, 65.733522784812521422, 102.28982183141852147, 91.545378656144748675, + 51.442780019198835362, 39.002763994532870129, 54.226622335634601768, 98.374982386012561619, + 56.461309020789485658, 44.341696513627539389, 39.120925918236025609, 121.41045729186589597, + 107.43255151382618351, 84.156560796560370363, 93.62831192062003538, 72.830573399041895755, + 81.760301451879058732, 53.88386222946428461, 9.7126756139005010482, 43.376001328688289504, + 111.00233101908088429, 50.386139834401546977, 69.281297143770643743, 70.142939231689524604, + 70.647618222330493154, 116.90169124737440143, 74.678238598506140988, 49.550655736391490791, + 40.712943896600336302, 87.263128410031640669, 104.41992513806326315, 99.196947438682400389, + 109.18904362603279878, 74.903807220802264055, 101.6711269522747898, 73.578495045650925022, + 104.77492312720278278, 12.27325795816432219, 105.17503951648905058, 56.306300597745575942, + 78.643525344581576064, 102.38802135480727884, 21.244492011199326953, 31.523051987802318763, + 111.57104925618114066, 100.18387838023409131, 56.607845320126216393, 122.75910745533838053, + 68.728129077655466972, 110.7641655294537486, 70.777441394016932463, 86.882524744447437115, + 5.8730359106266405433, 95.880267491964332294, 111.09008571312369895, 0.99311099733313312754, + 42.2271368267647631, 96.071936942760657985, 94.854747095603670459, 64.147758717885153601, + 106.65396246865566354, 84.141301836752973031, 63.474590284487931058, 79.929508888093550922, + 100.98695411917287856, 7.7604647129628574476, 31.953567065484094201, 51.690476184117869707, + 43.831466584280860843, 92.855933356833702419, 86.936711443093372509, 32.71474469299937482, + 71.208513605975895189, 25.215231306774512632, 50.994262848878861405, 54.010992924944730476, + 118.94575698072003433, 8.7244044996041338891, 56.084392567314353073, 73.729164465948997531, + 30.76930543021808262, 66.48642037556055584, 58.090069321180635598, 25.315709800554031972, + 75.119661297980201198, 72.824690818390081404, 96.002976138173835352, 109.02506237038323889, + 32.826701345471519744, 37.907702839343983214, 104.27836572914748103, 109.80417703598504886, + 26.174404539284296334, 46.665476441452483414, 124.02001771376671968, 11.126352573290205328, + 22.870094726556999376, 59.338938558139489032, 37.937435870633635204, 95.861934018397732871, + 2.6431529682522523217, 121.93889145312641631, 101.44526882917853072, 109.19459551450199797, + 36.692368780546530616, 16.000550840246432927, 117.77678651544920285, 48.373179593752865912, + 48.437908830306696473, 33.50544075170182623, 67.745234540812816704, 41.844560245521279285, + 64.483826088780915597, 60.122149100781825837, 43.347775437745440286, 50.243838447517191526, + 27.92816504703296232, 40.691155181921203621, 68.963807049829483731, 82.190463243903650437, + 85.959927724339650013, 77.795499182691855822, 16.222793128832563525, 98.191238318795512896, + 61.43158958901767619, 107.13622353972459678, 35.460937059157004114, 118.21846807195470319, + 19.454551499959052308, 45.451871495559316827, 72.975223964695032919, 103.98412666210424504, + 44.606766703407629393, 27.397526351014676038, 24.122945947132393485, 33.377569697975559393, + 1.5796889118282706477, 32.182851074230711674, 119.96772893351590028, 63.423979578157741344, + 27.659176438173744828, 79.314018658798886463, 77.692948679021355929, 69.676843670753441984, + 79.177872789168759482, 109.94205889768636553, 58.401924333222268615, 47.210175819553114707, + 69.941721007195155835, 119.91312947662299848, 11.131723475926264655, 77.303343210242019268, + 111.78596773026947631, 37.908266490579990204, 100.42254555357067147, 37.491883164213504642, + 75.270397757394675864, 24.268214742263808148, 53.6940940335043706, 93.763684460114745889, + 105.37637561147857923, 71.882357590413448634, 87.827502247109805467, 94.103383904879592592, + 69.869232531134912279, 55.112546825581375742, 46.023230006474477705, 13.885727775304985698, + 81.063458936390816234, 59.732963901973562315, 98.738657982870790875, 121.67499145420151763, + 5.2888131376785167959, 120.04952031089487718, 77.53372625524571049, 70.892993768502492458, + 85.219337618884310359, 121.33010352918427088, 78.39153090983745642, 2.7069144963315920904, + 120.5311501492979005, 109.6404327834607102, 82.62742283658371889, 70.894439856110693654, + 92.228345946154149715, 108.98418806771951495, 81.478784437735157553, 86.364524553195224144, + 56.510579803041764535, 16.862107058113906533, 96.819556815753458068, 78.644396426119783428, + 73.911483752086496679, 99.567554035569628468, 106.32457013782914146, 98.530627097410615534, + 108.32992769598786253, 119.04789977947802981, 33.84478943493013503, 80.81793216382357059, + 67.563087972168432316, 15.111703220631170552, 111.58997983198059956, 122.07527470492277644, + 121.12821544481994351, 99.150300441651779693, 119.07972866093768971, 62.933765935860719765, + 26.582666883430647431, 77.088342734627076425, 125.07486541418984416, 65.219020738986728247, + 43.56629844626513659, 78.672486417519394308, 74.654011927450483199, 122.53438075627127546, + 53.83934798134941957, 50.751079727870092029, 107.07236540636586142, 118.72359124497234006, + 27.531826207112317206, 54.306852007284760475, 29.750802367281721672, 98.417114973894058494, + 96.879875761125731515, 62.424150360242492752, 1.2732395447346789297, 17.020667972468800144, + 62.561182435139926383, 91.385095193109009415, 114.03222335419923184, 47.480210633682872867, + 18.215288230894657318, 46.001534636743599549, 19.637271522595256101, 122.77801957209521788, + 119.26589486968077836, 59.267653084461926483, 4.8380727637886593584, 102.2787002356017183, + 28.977756630574731389, 59.873329382851807168, 113.1874959494889481, 3.9835779897002794314, + 80.325820649435627274, 126.80920094477551174, 105.90930061502876924, 127.65902451400324935, + 99.960738703051902121, 80.451652088471746538, 37.831420346949016675, 71.888050203560851514, + 25.508665314726385986, 43.940669782597979065, 94.526423766379593872, 69.521417166135506704, + 50.799845668094349094, 6.515760421178129036, 0.60507669347498449497, 1.5208388932296657003, + 70.293076745703729102, 12.419063812529202551, 108.97551900174948969, 42.052353969349496765, + 75.055960586207220331, 77.08376409576885635, 75.992401748659176519, 12.976756138625205494, + 124.75616347000323003, 61.152090735351521289, 95.077747577503032517, 43.789008505587844411, + 16.782199744648096384, 47.652059045343776233, 96.525240632741770241, 45.403418596994015388, + 37.414221369406732265, 0.047950597054295940325, 46.236135055165505037, 1.5343925531051354483, + 75.827551523827423807, 127.39034184837510111, 71.972360273175581824, 89.167814030803128844, + 99.104454269450798165, 21.091160401898378041, 58.778916393632243853, 44.549100766736955848, + 17.6647546625463292, 1.6901720754976850003, 51.993701865019829711, 25.595060725227085641, + 93.401427981843880843, 101.13491679410799406, 23.987697161239339039, 36.850392400625423761, + 107.93376821970377932, 9.1630536620905331802, 37.816594159856322221, 56.549601645609072875, + 24.274840295900503406, 64.092393752966017928, 124.01181807503962773, 8.2892459114191296976, + 45.779216757120593684, 95.18191362652942189, 17.65158281887852354, 106.56481812605488813, + 11.332538624676089967, 25.82792127283391892, 110.92017318784201052, 32.943449127989879344, + 45.274778301758487942, 118.22807101811849861, 105.87114112440031022, 73.568154651136865141, + 78.338214949799294118, 97.759640280641178833, 4.7522492861244245432, 17.402604287286521867, + 72.848250958020798862, 10.829060454983846284, 82.131530521783133736, 0.19978378612722735852, + 115.52993682679152698, 113.92486427425319562, 31.097450297882460291, 121.77744747063115938, + 121.63485419965945766, 7.6954761732631595805, 93.520089052242838079, 30.856769748999795411, + 59.566394529469107511, 75.192536740069044754, 79.157001256608054973, 94.326691842528816778, + 75.596873638864053646, 3.3982840142780332826, 119.41095834068983095, 25.814889687248069094, + 108.42872124731002259, 101.73494252870295895, 46.620658913161605597, 4.18831826028690557, + 44.465183754713507369, 112.18150724782753969, 123.30071919517649803, 27.733484739819687093, + 36.467598774128418881, 83.820099521239171736, 115.01586589186263154, 33.557761966123507591, + 1.6821327071520499885, 82.582601310277823359, 110.13160481410159264, 12.614549097863346105, + 10.450967918623064179, 9.0445855359612323809, 44.760065132031741086, 64.06822853880294133, + 98.732254742819350213, 119.83869335857161786, 58.323534807561372872, 49.582110128067142796, + 20.516827360377646983, 114.17478394614954595, 0.93331945650061243214, 31.937540160412027035, + 36.879686292304540984, 72.241599646389659029, 71.981087154021224706, 3.4670455696286808234, + 76.579643662840680918, 55.090757312289497349, 102.88556003839767072, 78.005527989065740258, + 108.45324467127284152, 68.749964772025123239, 112.92261804157897132, 88.683393027255078778, + 78.241851836475689197, 114.82091458373542991, 86.865103027656004997, 40.313121593124378705, + 59.256623841243708739, 17.661146798087429488, 35.520602903758117463, 107.76772445892856922, + 19.425351227801002096, 86.752002657380216988, 94.004662038161768578, 100.77227966880673193, + 10.562594287544925464, 12.285878463382687187, 13.295236444664624287, 105.80338249475244083, + 21.356477197012281977, 99.101311472782981582, 81.425887793204310583, 46.526256820066919317, + 80.839850276130164275, 70.393894877368438756, 90.378087252069235547, 21.807614441608166089, + 75.342253904553217581, 19.156990091305488022, 81.54984625440556556, 24.546515916332282359, + 82.350079032978101168, 112.61260119549478986, 29.287050689166790107, 76.77604270961455768, + 42.488984022398653906, 63.046103975608275505, 95.142098512365919305, 72.36775676046818262, + 113.21569064025607076, 117.51821491068039904, 9.4562581553145719226, 93.528331058911135187, + 13.554882788037502905, 45.76504948889487423, 11.746071821256919065, 63.760534983932302566, + 94.180171426247397903, 1.9862219946662662551, 84.454273653533164179, 64.143873885524953948, + 61.709494191210978897, 0.2955174357739451807, 85.307924937314965064, 40.282603673505946063, + 126.94918056897950009, 31.859017776190739824, 73.973908238345757127, 15.520929425925714895, + 63.907134130968188401, 103.38095236823573941, 87.662933168565359665, 57.711866713671042817, + 45.873422886186745018, 65.429489386002387619, 14.417027211951790377, 50.430462613549025264, + 101.98852569775772281, 108.02198584989309893, 109.89151396144006867, 17.448808999208267778, + 112.16878513463234412, 19.458328931897995062, 61.538610860439803218, 4.9728407511211116798, + 116.1801386423612712, 50.631419601111701922, 22.239322595964040374, 17.649381636783800786, + 64.005952276351308683, 90.050124740766477771, 65.653402690943039488, 75.815405678691604408, + 80.556731458298600046, 91.608354071970097721, 52.348809078568592668, 93.330952882908604806, + 120.04003542753343936, 22.252705146580410656, 45.740189453113998752, 118.67787711627897806, + 75.874871741270908387, 63.723868036795465741, 5.2863059365081426222, 115.8777829062564706, + 74.890537658360699425, 90.389191029003995936, 73.384737561093061231, 32.001101680496503832, + 107.5535730308984057, 96.746359187505731825, 96.875817660613392945, 67.010881503407290438, + 7.4904690816256334074, 83.689120491046196548, 0.96765217756183119491, 120.24429820156365167, + 86.695550875490880571, 100.48767689503438305, 55.856330094065924641, 81.38231036384604522, + 9.9276140996626054402, 36.380926487810938852, 43.919855448682938004, 27.590998365383711644, + 32.445586257668765029, 68.382476637591025792, 122.86317917803899036, 86.272447079449193552, + 70.921874118317646207, 108.43693614390940638, 38.909102999918104615, 90.903742991122271633, + 17.950447929393703816, 79.968253324208490085, 89.213533406815258786, 54.795052702029352076, + 48.24589189426478697, 66.755139395951118786, 3.1593778236565412953, 64.365702148465061327, + 111.93545786703180056, 126.84795915631548269, 55.318352876351127634, 30.628037317601410905, + 27.385897358046349837, 11.353687341510521946, 30.355745578341156943, 91.884117795372731052, + 116.80384866644453723, 94.420351639109867392, 11.883442014393949648, 111.82625895324599696, + 22.263446951856167288, 26.606686420487676514, 95.571935460538952611, 75.816532981163618388, + 72.845091107141342945, 74.983766328430647263, 22.540795514789351728, 48.536429484527616296, + 107.38818806701237918, 59.527368920233129757, 82.75275122296079644, 15.764715180830535246, + 47.655004494223248912, 60.206767809762823163, 11.738465062269824557, 110.22509365116275148, + 92.046460012948955409, 27.771455550613609375, 34.126917872781632468, 119.46592780395076261, + 69.477315965745219728, 115.34998290840303525, 10.577626275360671571, 112.09904062179339235, + 27.067452510495058959, 13.785987537008622894, 42.438675237772258697, 114.66020705837217974, + 28.78306181967491284, 5.4138289926668221597, 113.06230029859943897, 91.280865566925058374, + 37.254845673171075759, 13.788879712225025287, 56.456691892311937409, 89.968376135442667874, + 34.957568875473953085, 44.729049106390448287, 113.02115960608352907, 33.724214116231451044, + 65.639113631510554114, 29.288792852243204834, 19.822967504176631337, 71.135108071142894914, + 84.649140275661920896, 69.061254194824869046, 88.659855391979363048, 110.09579955895605963, + 67.689578869863908039, 33.63586432765077916, 7.1261759443368646316, 30.223406441265979083, + 95.179959663964837091, 116.15054940984919085, 114.25643088964352501, 70.300600883307197364, + 110.15945732187537942, 125.86753187172143953, 53.165333766864932841, 26.176685469257790828, + 122.1497308283833263, 2.4380414779734564945, 87.132596892533911159, 29.344972835042426595, + 21.308023854904604377, 117.06876151254255092, 107.67869596269883914, 101.50215945574382204, + 86.144730812735360814, 109.44718248994468013, 55.063652414224634413, 108.61370401456952095, + 59.501604734567081323, 68.834229947791754967, 65.75975152225146303, 124.8483007204849855, + 2.5464790894693578593, 34.041335944937600289, 125.12236487028349075, 54.770190386221656809, + 100.06444670839846367, 94.960421267365745734, 36.430576461789314635, 92.003069273487199098, + 39.274543045194150181, 117.55603914419407374, 110.53178973936155671, 118.53530616892385297, + 9.6761455275809566956, 76.557400471203436609, 57.955513261149462778, 119.74665876570725231, + 98.374991898977896199, 7.9671559794041968416, 32.651641298874892527, 125.61840188955466147, + 83.818601230061176466, 127.31804902801013668, 71.921477406107442221, 32.903304176943493076, + 75.66284069390167133, 15.776100407121703029, 51.017330629452771973, 87.881339565199596109, + 61.052847532762825722, 11.042834332271013409, 101.59969133618869819, 13.031520842356258072, + 1.2101533869499689899, 3.0416777864629693795, 12.586153491407458205, 24.83812762506204308, + 89.951038003498979378, 84.104707938702631509, 22.11192117241807864, 26.167528191541350679, + 23.984803497318353038, 25.953512277254048968, 121.51232694000646006, 122.30418147070668056, + 62.155495155006065033, 87.578017011175688822, 33.564399489296192769, 95.304118090691190446, + 65.050481265483540483, 90.806837193988030776, 74.82844273881346453, 0.095901194108591880649, + 92.472270110331010073, 3.0687851062139088754, 23.655103047658485593, 126.7806836967538402, + 15.944720546354801627, 50.335628061609895667, 70.20890853890159633, 42.182320803796756081, + 117.55783278726448771, 89.098201533473911695, 35.329509325092658401, 3.3803441509953700006, + 103.98740373003965942, 51.19012145045780926, 58.802855963691399666, 74.269833588215988129, + 47.975394322478678077, 73.700784801254485501, 87.867536439407558646, 18.32610732418106636, + 75.633188319712644443, 113.09920329121814575, 48.549680591804644791, 0.18478750593567383476, + 120.02363615007925546, 16.578491822838259395, 91.558433514244825346, 62.36382725305884378, + 35.303165637760685058, 85.129636252109776251, 22.665077249352179933, 51.655842545671475818, + 93.840346375684021041, 65.886898255979758687, 90.549556603520613862, 108.45614203624063521, + 83.742282248804258415, 19.136309302277368261, 28.676429899602226214, 67.519280561282357667, + 9.5044985722488490865, 34.805208574576681713, 17.696501916041597724, 21.658120909971330548, + 36.263061043566267472, 0.39956757225809269585, 103.05987365358669194, 99.849728548506391235, + 62.19490059576855856, 115.55489494126595673, 115.26970839931891533, 15.39095234652995714, + 59.040178104485676158, 61.713539497999590822, 119.132789058941853, 22.385073480141727487, + 30.314002513219747925, 60.653383685061271535, 23.193747277728107292, 6.796568028559704544, + 110.8219166813796619, 51.629779374499776168, 88.85744249462368316, 75.469885057405917905, + 93.241317826323211193, 8.3766365205738111399, 88.930367509430652717, 96.363014495658717351, + 118.60143839035299607, 55.466969479639374185, 72.935197548260475742, 39.640199042481981451, + 102.03173178372526309, 67.115523932247015182, 3.3642654143077379558, 37.165202620559284696, + 92.263209628203185275, 25.229098195726692211, 20.901935837246128358, 18.089171071922464762, + 89.520130264067120152, 0.13645707760952063836, 69.464509485642338404, 111.67738671714323573, + 116.64706961512274574, 99.164220256134285592, 41.033654720758931944, 100.34956789229909191, + 1.8666389130012248643, 63.87508032082405407, 73.759372584612719947, 16.483199292782956036, + 15.962174308042449411, 6.9340911392609996255, 25.159287325681361835, 110.18151462458263268, + 77.771120076798979426, 28.011055978135118494, 88.906489342549321009, 9.4999295440538844559, + 97.845236083161580609, 49.366786054513795534, 28.483703672955016373, 101.64182916747449781, + 45.730206055312009994, 80.626243186248757411, 118.51324768248741748, 35.322293596174858976, + 71.041205807519872906, 87.53544891785713844, 38.850702455605642172, 45.504005314764071954, + 60.009324076327175135, 73.544559337613463867, 21.125188575089850929, 24.571756926765374374, + 26.590472889332886552, 83.606764989504881669, 42.712954394028201932, 70.202622945569601143, + 34.851775586408621166, 93.052513640137476614, 33.679700552263966529, 12.787789754740515491, + 52.756174504138471093, 43.615228883219970157, 22.684507809106435161, 38.313980182614614023, + 35.09969250881113112, 49.093031832668202696, 36.700158065959840314, 97.225202390989579726, + 58.574101378337218193, 25.552085419229115359, 84.977968044797307812, 126.09220795122018899, + 62.284197024735476589, 16.735513520940003218, 98.431381280515779508, 107.03642982136079809, + 18.912516310632781824, 59.056662117822270375, 27.109765576075005811, 91.53009897778974846, + 23.492143642513838131, 127.52106996786824311, 60.360342852494795807, 3.972443989336170489, + 40.908547307069966337, 0.28774777104990789667, 123.41898838242195779, 0.59103487155152834021, + 42.615849874629930127, 80.565207347015530104, 125.89836113795900019, 63.718035552385117626, + 19.947816476691514254, 31.04185885185142979, 127.81426826194001478, 78.761904736475116806, + 47.32586633713071933, 115.42373342734208563, 91.746845772377128014, 2.8589787720047752373, + 28.834054423903580755, 100.86092522710168851, 75.977051395519083599, 88.043971699789835839, + 91.783027922880137339, 34.897617998420173535, 96.33757026926468825, 38.916657863795990124, + 123.07722172087960644, 9.9456815022458613385, 104.36027728472254239, 101.26283920222340384, + 44.478645191928080749, 35.298763273571239552, 0.011904552706255344674, 52.100249481536593521, + 3.3068053818897169549, 23.630811357386846794, 33.113462916600838071, 55.216708143940195441, + 104.69761815714082331, 58.661905765820847591, 112.08007085506687872, 44.505410293160821311, + 91.480378906231635483, 109.35575423256159411, 23.749743482541816775, 127.44773607359093148, + 10.572611873019923223, 103.75556581251657917, 21.781075316725036828, 52.778382058011629852, + 18.769475122186122462, 64.002203360996645642, 87.107146061800449388, 65.492718375015101628, + 65.75163532123042387, 6.0217630068145808764, 14.980938163254904794, 39.378240982092393097, + 1.9353043551273003686, 112.48859640313094133, 45.391101750985399121, 72.975353790068766102, + 111.71266018813548726, 34.764620727692090441, 19.85522819932521088, 72.761852975621877704, + 87.839710897365876008, 55.181996730767423287, 64.891172515341168037, 8.7649532751856895629, + 117.72635835608161869, 44.544894158902025083, 13.843748236638930393, 88.873872287818812765, + 77.818205999839847209, 53.807485982244543266, 35.900895858791045612, 31.936506648420618149, + 50.427066813630517572, 109.59010540405870415, 96.491783788533211919, 5.5102787919022375718, + 6.3187556473167205695, 0.73140429693376063369, 95.8709157340672391, 125.69591831263096537, + 110.63670575270225527, 61.25607463520282181, 54.771794716092699673, 22.707374683021043893, + 60.711491156685951864, 55.768235590749100083, 105.60769733289271244, 60.840703278219734784, + 23.766884028791537276, 95.652517906491993926, 44.526893903712334577, 53.213372840978991007, + 63.143870921081543202, 23.633065962330874754, 17.69018221428632387, 21.967532656861294527, + 45.081591029578703456, 97.072858969058870571, 86.776376134024758358, 119.05473784046989749, + 37.50550244592159288, 31.529430361661070492, 95.310008988446497824, 120.41353561952564633, + 23.476930124543287093, 92.450187302329140948, 56.092920025897910818, 55.542911101227218751, + 68.253835745566902915, 110.9318556079051632, 10.954631931494077435, 102.69996581680607051, + 21.15525255072498112, 96.198081243586784694, 54.134905020990117919, 27.571975074017245788, + 84.877350475548155373, 101.32041411674435949, 57.56612363934982568, 10.827657985337282298, + 98.124600597202515928, 54.561731133850116748, 74.509691346342151519, 27.577759424450050574, + 112.9133837846275128, 51.936752270885335747, 69.91513775094790617, 89.458098212784534553, + 98.04231921216705814, 67.448428232466540067, 3.2782272630211082287, 58.577585704486409668, + 39.645935008356900653, 14.270216142289427808, 41.29828055132747977, 10.122508389653376071, + 49.319710783962364076, 92.191599117915757233, 7.3791577397278160788, 67.271728655301558319, + 14.252351888673729263, 60.446812882535596145, 62.359919327933312161, 104.30109881970201968, + 100.51286177929068799, 12.601201766618032707, 92.31891464375439682, 123.73506374344287906, + 106.33066753372986568, 52.353370938519219635, 116.2994616567666526, 4.8760829559505509678, + 46.265193785067822319, 58.689945670084853191, 42.616047709812846733, 106.13752302508873981, + 87.357391925401316257, 75.004318911491282051, 44.289461625474359607, 90.894364979889360256, + 110.1273048284529068, 89.227408029139041901, 119.00320946913780062, 9.668459895587147912, + 3.5195030445065640379, 121.69660144096997101, 5.0929581789387157187, 68.082671889878838556, + 122.24472974056698149, 109.5403807724469516, 72.128893416800565319, 61.920842534731491469, + 72.861152923582267249, 56.006138546974398196, 78.549086090391938342, 107.11207828839178546, + 93.063579478726751404, 109.07061233784770593, 19.35229105516555137, 25.114800942406873219, + 115.91102652230256354, 111.49331753141814261, 68.749983797955792397, 15.934311958808393683, + 65.303282597753423033, 123.23680377911296091, 39.63720246012599091, 126.63609805602391134, + 15.842954812214884441, 65.80660835389062413, 23.325681387803342659, 31.552200814243406057, + 102.03466125890918192, 47.762679130399192218, 122.10569506552565144, 22.085668664545664797, + 75.199382672377396375, 26.063041684712516144, 2.4203067738999379799, 6.083355572925938759, + 25.17230698281491641, 49.676255250127724139, 51.902076007001596736, 40.209415877405263018, + 44.223842344836157281, 52.335056383082701359, 47.969606994636706077, 51.907024554511735914, + 115.02465388001655811, 116.60836294141336111, 124.31099031001576805, 47.156034022351377644, + 67.128798978596023517, 62.60823618138601887, 2.1009625309707189444, 53.613674387979699532, + 21.65688547762692906, 0.19180238822082174011, 56.944540220662020147, 6.1375702124278177507, + 47.310206095320609165, 125.56136739350768039, 31.889441092709603254, 100.67125612322342931, + 12.41781707780319266, 84.364641607597150141, 107.11566557453261339, 50.19640306694782339, + 70.659018650185316801, 6.76068830199437798, 79.974807460079318844, 102.38024290091561852, + 117.60571192738643731, 20.539667176431976259, 95.950788644960994134, 19.401569602512608981, + 47.735072878815117292, 36.652214648365770699, 23.266376639428926865, 98.198406582436291501, + 97.099361183609289583, 0.36957501187498564832, 112.04727230015851092, 33.156983645680156769, + 55.116867028489650693, 124.72765450611768756, 70.606331275525008095, 42.259272504219552502, + 45.330154498704359867, 103.31168509134658962, 59.68069275137168006, 3.7737965119631553534, + 53.099113207044865703, 88.912284072484908393, 39.484564497608516831, 38.272618604554736521, + 57.352859799208090408, 7.0385611225647153333, 19.008997144497698173, 69.610417149153363425, + 35.393003832083195448, 43.316241819942661095, 72.526122087132534944, 0.7991351445198233705, + 78.119747307177021867, 71.699457097012782469, 124.3898011915407551, 103.10978988253555144, + 102.53941679863783065, 30.78190469305991428, 118.08035620897135232, 123.42707899600281962, + 110.265578117883706, 44.770146960283454973, 60.62800502643949585, 121.30676737012254307, + 46.387494555456214584, 13.593136057123047067, 93.643833362759323791, 103.25955874900319031, + 49.714884989251004299, 22.939770114815473789, 58.482635652646422386, 16.753273041151260259, + 49.860735018864943413, 64.726028991321072681, 109.20287678070599213, 110.93393895928238635, + 17.870395096520951483, 79.28039808496760088, 76.063463567454164149, 6.2310478644940303639, + 6.7285308286154759116, 74.330405241122207372, 56.52641925640637055, 50.458196391453384422, + 41.803871674492256716, 36.178342143848567503, 51.040260528134240303, 0.27291415522267925553, + 10.929018971288314788, 95.354773434290109435, 105.29413923024912947, 70.328440512268571183, + 82.067309441521501867, 72.699135784598183818, 3.7332778260024497285, 127.75016064165174612, + 19.518745169225439895, 32.966398585565912072, 31.924348616084898822, 13.868182278521999251, + 50.31857465136636165, 92.363029249168903334, 27.542240153597958852, 56.022111956273874966, + 49.812978685098642018, 18.999859088111406891, 67.690472166323161218, 98.733572109027591068, + 56.967407345913670724, 75.283658334948995616, 91.460412110627657967, 33.2524863725011528, + 109.02649536497483496, 70.644587192353355931, 14.08241161504338379, 47.07089783571427688, + 77.701404911211284343, 91.008010629528143909, 120.01864815265798825, 19.089118675226927735, + 42.250377150179701857, 49.143513853530748747, 53.180945778669411084, 39.213529979009763338, + 85.425908788060041843, 12.405245891139202286, 69.703551172820880311, 58.105027280274953227, + 67.359401104527933057, 25.575579509481030982, 105.51234900827694219, 87.230457766439940315, + 45.369015618212870322, 76.627960365229228046, 70.199385017622262239, 98.186063665336405393, + 73.400316131923318608, 66.450404781979159452, 117.14820275667443639, 51.104170838461868698, + 41.955936089598253602, 124.18441590244037798, 124.56839404947095318, 33.471027041883644415, + 68.862762561035196995, 86.072859642721596174, 37.825032621265563648, 118.11332423564454075, + 54.2195311521536496, 55.06019795557949692, 46.984287285031314241, 127.04213993573648622, + 120.72068570498959161, 7.9448879786723409779, 81.817094614139932673, 0.57549554210345377214, + 118.83797676484391559, 1.1820697431030566804, 85.231699749263498234, 33.130414694034698186, + 123.79672227591800038, 127.43607110477023525, 39.895632953383028507, 62.083717703706497559, + 127.62853652388366754, 29.523809472950233612, 94.651732674265076639, 102.84746685468780925, + 55.493691544754256029, 5.7179575440095504746, 57.668108847810799489, 73.721850454207014991, + 23.954102791041805176, 48.087943399583309656, 55.566055845760274678, 69.795235996843985049, + 64.675140538529376499, 77.833315727595618227, 118.15444344175921287, 19.891363004495360656, + 80.720554569448722759, 74.52567840444680769, 88.957290383856161498, 70.597526547142479103, + 0.023809105412510689348, 104.20049896307318704, 6.6136107637794339098, 47.261622714773693588, + 66.226925833201676141, 110.43341628788402886, 81.395236314281646628, 117.32381153164533316, + 96.160141710133757442, 89.010820586325280601, 54.960757812466908945, 90.711508465123188216, + 47.499486965087271528, 126.89547214718186297, 21.145223746043484425, 79.511131625033158343, + 43.562150633450073656, 105.5567641160232597, 37.538950244375882903, 0.0044067219969292636961, + 46.214292123604536755, 2.9854367500338412356, 3.5032706424608477391, 12.043526013629161753, + 29.961876326509809587, 78.756481964184786193, 3.8706087102582387161, 96.977192806261882652, + 90.782203501974436222, 17.950707580141170183, 95.425320376270974521, 69.529241455384180881, + 39.71045639865405974, 17.523705951247393386, 47.679421794731752016, 110.36399346153848455, + 1.7823450306823360734, 17.529906550375017105, 107.45271671216323739, 89.089788317804050166, + 27.687496473281498766, 49.747744575641263509, 27.636411999679694418, 107.61497196448908653, + 71.801791717582091223, 63.873013296841236297, 100.85413362726467312, 91.180210808121046284, + 64.983567577066423837, 11.020557583804475144, 12.637511294633441139, 1.4628085938711592462, + 63.741831468138116179, 123.39183662526556873, 93.273411505404510535, 122.51214927040564362, + 109.54358943218539935, 45.414749366042087786, 121.42298231337190373, 111.53647118150183815, + 83.215394665785424877, 121.68140655643946957, 47.53376805758671253, 63.305035812983987853, + 89.053787807424669154, 106.42674568195798201, 126.2877418421630864, 47.266131924661749508, + 35.380364428572647739, 43.935065313722589053, 90.16318205916104489, 66.14571793812137912, + 45.552752268053154694, 110.10947568093979498, 75.01100489184318576, 63.058860723325778963, + 62.620017976896633627, 112.82707123905129265, 46.953860249090212164, 56.900374604658281896, + 112.18584005179582164, 111.08582220245807548, 8.5076714911374438088, 93.863711215810326394, + 21.909263862991792848, 77.399931633612141013, 42.310505101453600219, 64.396162487173569389, + 108.26981004198023584, 55.143950148038129555, 41.754700951099948725, 74.640828233488718979, + 115.13224727869965136, 21.655315970678202575, 68.249201194405031856, 109.12346226770387148, + 21.019382692684303038, 55.155518848903739126, 97.826767569255025592, 103.87350454177430947, + 11.830275501899450319, 50.916196425572707085, 68.084638424337754259, 6.8968564649330801331, + 6.5564545260422164574, 117.15517140897281934, 79.291870016713801306, 28.540432284578855615, + 82.596561102654959541, 20.245016779306752142, 98.63942156792836613, 56.383198235831514467, + 14.758315479459270136, 6.543457310603116639, 28.504703777347458526, 120.89362576507119229, + 124.7198386558702623, 80.602197639407677343, 73.025723558581375983, 25.202403533239703393, + 56.63782928751243162, 119.4701274868893961, 84.661335067459731363, 104.70674187704207725, + 104.59892331353330519, 9.7521659119011019357, 92.530387570135644637, 117.37989134016970638, + 85.232095419629331445, 84.275046050181117607, 46.714783850806270493, 22.008637822982564103, + 88.578923250952357193, 53.788729959782358492, 92.254609656909451587, 50.45481605828172178, + 110.00641893827560125, 19.336919791174295824, 7.0390060890167660546, 115.39320288194358, + 10.185916357881069416, 8.1653437797613150906, 116.48945948113760096, 91.080761544897541171, + 16.257786833601130638, 123.84168506946662092, 17.722305847164534498, 112.01227709395243437, + 29.098172180787514662, 86.224156576787208905, 58.127158957457140787, 90.141224675695411861, + 38.70458211033110274, 50.229601884817384416, 103.82205304460876505, 94.986635062839923194, + 9.4999675959115847945, 31.868623917620425345, 2.6065651955104840454, 118.47360755822592182, + 79.2744049202556198, 125.27219611204782268, 31.685909624433406861, 3.6132167077812482603, + 46.651362775606685318, 63.104401628490450094, 76.069322517818363849, 95.525358260802022414, + 116.21139013105130289, 44.171337329094967572, 22.39876534475479275, 52.126083369425032288, + 4.8406135477998759598, 12.166711145851877518, 50.344613965629832819, 99.352510500255448278, + 103.80415201400319347, 80.418831754810526036, 88.447684689672314562, 104.67011276616540272, + 95.939213989273412153, 103.81404910902710981, 102.04930776003675419, 105.21672588283036021, + 120.62198062003153609, 94.312068044706393266, 6.2575979571920470335, 125.21647236277203774, + 4.2019250619414378889, 107.22734877595939906, 43.313770955253858119, 0.38360477644164348021, + 113.88908044132404029, 12.275140424855635501, 94.62041219064485631, 123.12273478701536078, + 63.778882185422844486, 73.342512246446858626, 24.835634155610023299, 40.729283215197938262, + 86.231331149065226782, 100.39280613389928476, 13.318037300370633602, 13.521376603992393939, + 31.949614920162275666, 76.760485801834875019, 107.21142385477287462, 41.079334352867590496, + 63.901577289921988267, 38.803139205025217962, 95.470145757630234584, 73.304429296731541399, + 46.532753278861491708, 68.396813164876220981, 66.198722367218579166, 0.73915002375360927545, + 96.094544600317021832, 66.313967291360313538, 110.23373405698293936, 121.4553090122390131, + 13.212662551050016191, 84.518545008439105004, 90.660308997412357712, 78.623370182693179231, + 119.36138550274336012, 7.5475930239263107069, 106.19822641409336939, 49.824568144969816785, + 78.969128995217033662, 76.545237209109473042, 114.70571959841618082, 14.077122245129430667, + 38.017994288999034325, 11.220834298306726851, 70.786007664166390896, 86.63248363988896017, + 17.052244174265069887, 1.5982702890432847198, 28.239494614357681712, 15.398914194029202918, + 120.77960238308514818, 78.219579765074740862, 77.078833597275661305, 61.563809386123466538, + 108.16071241794634261, 118.85415799200927722, 92.531156235767411999, 89.540293920566909947, + 121.25601005288262968, 114.61353474024508614, 92.774989110912429169, 27.186272114249732113, + 59.28766672552228556, 78.519117498006380629, 99.429769978502008598, 45.879540229630947579, + 116.96527130529284477, 33.506546082302520517, 99.721470037733524805, 1.4520579826457833406, + 90.405753561415622244, 93.867877918564772699, 35.740790193045540946, 30.560796169938839739, + 24.126927134908328298, 12.462095728988060728, 13.457061657234589802, 20.660810482244414743, + 113.0528385128127411, 100.91639278290676884, 83.607743348984513432, 72.356684287697135005, + 102.08052105626848061, 0.54582831044535851106, 21.858037942580267554, 62.709546868583856849, + 82.588278460501896916, 12.656881024540780345, 36.134618883046641713, 17.398271569196367636, + 7.4665556520085374359, 127.50032128330349224, 39.03749033845087979, 65.932797171131824143, + 63.848697232169797644, 27.736364557043998502, 100.63714930273636128, 56.726058498337806668, + 55.084480307195917703, 112.04422391254774993, 99.625957370197284035, 37.99971817622645176, + 7.3809443326499604154, 69.467144218055182137, 113.93481469183097943, 22.567316669901629211, + 54.920824221255315933, 66.50497274500594358, 90.052990729953307891, 13.289174384706711862, + 28.16482323008676758, 94.141795671432191739, 27.402809822426206665, 54.016021259059925796, + 112.0372963053159765, 38.17823735045385547, 84.500754300359403715, 98.287027707061497495, + 106.36189155733882217, 78.427059958023164654, 42.851817576120083686, 24.81049178228204255, + 11.407102345641760621, 116.21005456055354443, 6.7188022090558661148, 51.151159018965699943, + 83.024698016557522351, 46.460915532879880629, 90.738031236429378623, 25.25592073046209407, + 12.398770035248162458, 68.372127330676448764, 18.800632263850275194, 4.9008095639619568828, + 106.29640551334887277, 102.2083416769237374, 83.911872179200145183, 120.36883180488439393, + 121.13678809894190636, 66.942054083770926809, 9.7255251220740319695, 44.145719285443192348, + 75.650065242534765275, 108.2266484712890815, 108.4390623043072992, 110.12039591115899384, + 93.96857457006626646, 126.08427987147661042, 113.44137140997918323, 15.889775957348319935, + 35.634189228279865347, 1.1509910842105455231, 109.67595352968783118, 2.3641394862097513396, + 42.463399498526996467, 66.260829388073034352, 119.59344455183963873, 126.8721422095404705, + 79.791265906766057014, 124.1674354074166331, 127.25707304776733508, 59.047618945904105203, + 61.303465348533791257, 77.694933709375618491, 110.98738308950851206, 11.435915088019100949, + 115.33621769562523696, 19.443700908414029982, 47.908205582083610352, 96.175886799166619312, + 111.13211169152418734, 11.590471993691608077, 1.3502810770623909775, 27.666631455194874434, + 108.30888688351842575, 39.78272600899435929, 33.441109138901083497, 21.051356808897253359, + 49.914580767715960974, 13.195053094284958206, 0.047618210828659357503, 80.400997926146374084, + 13.22722152755886782, 94.523245429551025154, 4.4538516664069902617, 92.866832575771695701, + 34.790472628566931235, 106.6476230632943043, 64.320283420271152863, 50.021641172650561202, + 109.92151562493745587, 53.423016930246376432, 94.998973930178181035, 125.79094429436372593, + 42.290447492090606829, 31.022263250066316687, 87.12430126690378529, 83.113528232046519406, + 75.077900488751765806, 0.0088134439938585273921, 92.42858424720907351, 5.9708735000676824711, + 7.0065412849216954783, 24.087052027258323506, 59.923752653023257153, 29.512963928369572386, + 7.7412174205201154109, 65.954385612527403282, 53.564407003948872443, 35.901415160285978345, + 62.85064075254558702, 11.058482910768361762, 79.42091279730811948, 35.047411902494786773, + 95.35884358946714201, 92.727986923076969106, 3.5646900613646721467, 35.059813100753672188, + 86.905433424330112757, 50.179576635608100332, 55.374992946562997531, 99.495489151282527018, + 55.272823999363026815, 87.229943928981811041, 15.603583435164182447, 127.74602659368611057, + 73.708267254532984225, 54.360421616245730547, 1.9671351541328476742, 22.041115167608950287, + 25.275022589266882278, 2.9256171877423184924, 127.48366293627987034, 118.78367325053477543, + 58.546823010812659049, 117.02429854081492522, 91.087178864370798692, 90.829498732087813551, + 114.84596462674744544, 95.07294236300731427, 38.430789331574487733, 115.36281311287893914, + 95.06753611517342506, 126.61007162597161368, 50.107575614852976287, 84.853491363919602009, + 124.57548368432617281, 94.532263849323499016, 70.760728857145295478, 87.870130627448816085, + 52.326364118325727759, 4.2914358762427582406, 91.105504536109947367, 92.218951361883227946, + 22.02200978368637152, 126.11772144665155793, 125.24003595379690523, 97.654142478102585301, + 93.907720498180424329, 113.80074920932020177, 96.371680103595281253, 94.171644404916150961, + 17.015342982278525596, 59.727422431620652787, 43.818527725987223675, 26.799863267224282026, + 84.621010202910838416, 0.79232497435077675618, 88.539620083960471675, 110.28790029607625911, + 83.509401902203535428, 21.281656466981075937, 102.26449455739930272, 43.310631941360043129, + 8.4984023888137016911, 90.246924535407742951, 42.038765385368606076, 110.31103769781111623, + 67.653535138513689162, 79.747009083548618946, 23.660551003798900638, 101.83239285114905215, + 8.1692768486755085178, 13.793712929866160266, 13.112909052088070894, 106.31034281794927665, + 30.583740033427602611, 57.080864569161349209, 37.193122205309919082, 40.490033558617142262, + 69.27884313585673226, 112.76639647166302893, 29.516630958918540273, 13.086914621206233278, + 57.009407554698555032, 113.78725153014602256, 121.43967731174416258, 33.204395278818992665, + 18.051447117162751965, 50.404807066479406785, 113.27565857502850122, 110.94025497378243017, + 41.322670134923100704, 81.413483754087792477, 81.197846627066610381, 19.50433182380584185, + 57.060775140274927253, 106.75978268034305074, 42.464190839262300869, 40.550092100362235215, + 93.429567701612540986, 44.017275645968766185, 49.157846501904714387, 107.57745991956835496, + 56.509219313818903174, 100.90963211656708154, 92.012837876551202498, 38.673839582348591648, + 14.078012178037170088, 102.78640576389079797, 20.371832715762138832, 16.33068755952626816, + 104.9789189622788399, 54.161523089795082342, 32.515573667205899255, 119.68337013893324183, + 35.444611694332706975, 96.024554187904868741, 58.196344361578667304, 44.448313153574417811, + 116.25431791491791955, 52.282449351390823722, 77.40916422066220548, 100.45920376963840681, + 79.644106089221168077, 61.973270125679846387, 18.999935191823169589, 63.737247835240850691, + 5.2131303910246060695, 108.94721511645548162, 30.548809840514877578, 122.54439222409564536, + 63.371819248866813723, 7.2264334155624965206, 93.302725551213370636, 126.20880325698453817, + 24.138645035640365677, 63.050716521607682807, 104.42278026210260577, 88.342674658189935144, + 44.7975306895095855, 104.25216673885006458, 9.6812270955997519195, 24.333422291703755036, + 100.68922793126330362, 70.705021000514534535, 79.608304028010024922, 32.83766350962469005, + 48.895369379348267103, 81.340225532334443415, 63.878427978550462285, 79.628098218057857594, + 76.098615520077146357, 82.43345176566435839, 113.24396124006671016, 60.624136089412786532, + 12.515195914387732046, 122.43294472554407548, 8.4038501238865137566, 86.454697551918798126, + 86.627541910507716238, 0.76720955288692493923, 99.778160882648080587, 24.550280849714908982, + 61.240824381293350598, 118.24546957403072156, 127.55776437084932695, 18.685024492893717252, + 49.671268311220046598, 81.458566430399514502, 44.462662298134091543, 72.785612267798569519, + 26.636074600741267204, 27.042753207984787878, 63.899229840328189312, 25.520971603673388017, + 86.42284770954574924, 82.158668705735180993, 127.80315457984397653, 77.606278410054073902, + 62.940291515264107147, 18.608858593463082798, 93.065506557726621395, 8.7936263297560799401, + 4.3974447344371583313, 1.4783000475108565297, 64.189089200637681643, 4.6279345827242650557, + 92.467468113969516708, 114.9106180244780262, 26.425325102103670361, 41.037090016881847987, + 53.320617994828353403, 29.246740365389996441, 110.72277100548672024, 15.095186047856259393, + 84.39645282818673877, 99.649136289943271549, 29.938257990437705303, 25.090474418222584063, + 101.41143919683236163, 28.154244490258861333, 76.035988577998068649, 22.44166859661709168, + 13.57201532833641977, 45.264967279777920339, 34.104488348530139774, 3.1965405780865694396, + 56.478989228715363424, 30.797828388062043814, 113.55920476617393433, 28.439159530153119704, + 26.157667194551322609, 123.12761877225057106, 88.321424835896323202, 109.70831598402219242, + 57.062312471538461978, 51.080587841137457872, 114.51202010576889734, 101.22706948049381026, + 57.549978221824858338, 54.372544228499464225, 118.5753334510482091, 29.038234996016399236, + 70.859539957004017197, 91.759080459265533136, 105.93054261058568954, 67.013092164608679013, + 71.44294007546704961, 2.9041159652952046599, 52.811507122834882466, 59.735755837129545398, + 71.481580386091081891, 61.121592339877679478, 48.253854269816656597, 24.924191457976121455, + 26.914123314469179604, 41.321620964492467465, 98.10567702562912018, 73.832785565817175666, + 39.215486697972664842, 16.713368575397907989, 76.161042112536961213, 1.0916566208907170221, + 43.716075885160535108, 125.41909373717135168, 37.176556921003793832, 25.31376204908156069, + 72.269237766093283426, 34.796543138392735273, 14.933111304020712851, 127.00064256660698447, + 78.074980676905397559, 3.8655943422636482865, 127.69739446433959529, 55.472729114091634983, + 73.274298605472722556, 113.45211699667561334, 110.16896061439547339, 96.088447825099137845, + 71.251914740394568071, 75.99943635245290352, 14.76188866530355881, 10.934288436114002252, + 99.869629383661958855, 45.134633339803258423, 109.84164844251426985, 5.009945490015525138, + 52.105981459906615783, 26.578348769413423724, 56.32964646017717314, 60.283591342864383478, + 54.80561964485241333, 108.03204251812348957, 96.074592610631952994, 76.356474700911348918, + 41.001508600722445408, 68.574055414126632968, 84.723783114681282314, 28.854119916046329308, + 85.703635152240167372, 49.6209835645640851, 22.814204691287159221, 104.42010912110708887, + 13.43760441811173223, 102.30231803793503786, 38.049396033115044702, 92.921831065763399238, + 53.476062472858757246, 50.511841460924188141, 24.797540070499962894, 8.7442546613528975286, + 37.601264527700550389, 9.8016191279275517445, 84.592811026701383526, 76.41668335385111277, + 39.823744358403928345, 112.73766360977242584, 114.27357619788745069, 5.8841081675418536179, + 19.451050244148063939, 88.291438570890022675, 23.300130485073168529, 88.453296942581800977, + 88.87812460861823638, 92.240791822321625659, 59.937149140136170899, 124.16855974295685883, + 98.882742819958366454, 31.779551914696639869, 71.268378456559730694, 2.301982168424729025, + 91.351907059375662357, 4.7282789724195026793, 84.926798997057630913, 4.5216587761497066822, + 111.18688910368291545, 125.74428441908457899, 31.582531813535752008, 120.33487081483690417, + 126.51414609553467017, 118.09523789180821041, 122.60693069707122049, 27.389867418754874961, + 93.974766179017024115, 22.871830176041839877, 102.67243539125047391, 38.887401816828059964, + 95.816411164170858683, 64.351773598336876603, 94.264223383048374671, 23.180943987383216154, + 2.700562154124781955, 55.333262910393386846, 88.617773767036851496, 79.56545201798871858, + 66.882218277802166995, 42.102713617794506717, 99.829161535431921948, 26.390106188569916412, + 0.095236421660956693813, 32.801995852292748168, 26.454443055121373618, 61.046490859102050308, + 8.9077033328176185023, 57.733665151543391403, 69.580945257137500448, 85.295246126592246583, + 0.64056684054230572656, 100.04328234530476038, 91.843031249874911737, 106.84603386049639084, + 61.99794786036000005, 123.58188858872745186, 84.580894984181213658, 62.044526500136271352, + 46.248602533811208559, 38.227056464096676791, 22.155800977503531612, 0.017626887991355033591, + 56.85716849441814702, 11.941747000135364942, 14.013082569843390957, 48.174104054516647011, + 119.84750530604651431, 59.025927856739144772, 15.482434841043868801, 3.908771225054806564, + 107.12881400789774489, 71.80283032057195669, 125.70128150509117404, 22.116965821540361503, + 30.841825594616238959, 70.094823804993211525, 62.717687178937921999, 57.455973846153938212, + 7.1293801227293442935, 70.119626201510982355, 45.810866848660225514, 100.35915327121620066, + 110.74998589312963304, 70.990978302565054037, 110.54564799872969161, 46.459887857963622082, + 31.207166870332002873, 127.49205318737585912, 19.41653450906596845, 108.72084323249146109, + 3.9342703082656953484, 44.082230335217900574, 50.550045178533764556, 5.8512343754882749636, + 126.96732587256337865, 109.56734650106955087, 117.09364602162895608, 106.04859708163348841, + 54.174357728745235363, 53.65899746417926508, 101.69192925349852885, 62.145884726014628541, + 76.861578663152613444, 102.72562622576151625, 62.135072230350488098, 125.22014325194322737, + 100.21515122970959055, 41.706982727842841996, 121.15096736865598359, 61.064527698650636012, + 13.521457714294228936, 47.74026125489763217, 104.65272823665145552, 8.5828717524891544599, + 54.211009072223532712, 56.437902723766455892, 44.044019567376381019, 124.23544289330675383, + 122.48007190759744844, 67.30828495620880858, 59.815440996364486637, 99.601498418644041521, + 64.743360207194200484, 60.343288809832301922, 34.030685964557051193, 119.45484486324130557, + 87.637055451974447351, 53.599726534452202031, 41.242020405821676832, 1.5846499487051914912, + 49.079240167924581328, 92.575800592156156199, 39.018803804407070857, 42.563312933965789853, + 76.528989114798605442, 86.621263882720086258, 16.996804777631041361, 52.493849070815485902, + 84.07753077074085013, 92.622075395625870442, 7.3070702770310163032, 31.494018167097237892, + 47.321102007601439254, 75.664785702298104297, 16.338553697351017036, 27.587425859732320532, + 26.225818104179779766, 84.620685635898553301, 61.167480066855205223, 114.16172913832269842, + 74.386244410619838163, 80.980067117237922503, 10.5576862717171025, 97.532792943326057866, + 59.033261917837080546, 26.173829242412466556, 114.01881510940074804, 99.574503060295683099, + 114.87935462348832516, 66.40879055763798533, 36.10289423432550393, 100.80961413296245155, + 98.551317150060640415, 93.88050994756486034, 82.645340269849839387, 34.826967508179222932, + 34.395693254133220762, 39.0086636476116837, 114.12155028055349248, 85.519565360686101485, + 84.928381678524601739, 81.100184200728108408, 58.859135403225081973, 88.034551291937532369, + 98.315693003813066753, 87.154919839136709925, 113.01843862764144433, 73.819264233137801057, + 56.025675753102404997, 77.347679164697183296, 28.156024356077978155, 77.57281152778523392, + 40.743665431524277665, 32.661375119056174299, 81.957837924557679798, 108.32304617959016468, + 65.03114733441543649, 111.36674027786648367, 70.889223388669051928, 64.049108375809737481, + 116.39268872315733461, 88.896626307152473601, 104.5086358298358391, 104.56489870278528542, + 26.818328441328048939, 72.918407539280451601, 31.288212178442336153, 123.94654025135969277, + 37.999870383646339178, 127.47449567048170138, 10.426260782052850118, 89.894430232910963241, + 61.097619681033393135, 117.08878444819129072, 126.74363849773362745, 14.45286683112863102, + 58.605451102430379251, 124.41760651396907633, 48.277290071280731354, 126.10143304321900359, + 80.845560524208849529, 48.685349316379870288, 89.595061379022808978, 80.504333477700129151, + 19.362454191199503839, 48.666844583411148051, 73.378455862530245213, 13.410042001032707049, + 31.216608056020049844, 65.675327019249380101, 97.790738758700172184, 34.680451064668886829, + 127.75685595710456255, 31.256196436119353166, 24.197231040157930693, 36.86690353133235476, + 98.487922480133420322, 121.24827217882557306, 25.03039182877910207, 116.86588945108815096, + 16.807700247776665492, 44.909395103841234231, 45.255083821015432477, 1.5344191057774878573, + 71.556321765296161175, 49.100561699429817963, 122.48164876259033917, 108.4909391480650811, + 127.1155287416986539, 37.370048985787434503, 99.342536622443731176, 34.917132860799029004, + 88.925324596271821065, 17.571224535597139038, 53.272149201482534409, 54.085506415969575755, + 127.79845968065637862, 51.041943207350414013, 44.845695419095136458, 36.317337411473999964, + 127.60630915969159105, 27.212556820108147804, 125.88058303052821429, 37.217717186929803574, + 58.13101311545324279, 17.58725265951215988, 8.7948894688743166625, 2.9566000950253510382, + 0.37817840127536328509, 9.2558691654521680903, 56.934936227942671394, 101.8212360489560524, + 52.850650204207340721, 82.074180033763695974, 106.64123598965670681, 58.493480730783630861, + 93.445542010973440483, 30.190372095716156764, 40.79290565637711552, 71.298272579886543099, + 59.876515980875410605, 50.180948836448806105, 74.822878393664723262, 56.308488980521360645, + 24.071977155996137299, 44.88333719323418336, 27.144030656672839541, 90.529934559555840679, + 68.208976697060279548, 6.3930811561731388792, 112.95797845743072685, 61.595656776127725607, + 99.118409532347868662, 56.878319060306239408, 52.315334389106283197, 118.25523754450478009, + 48.642849671796284383, 91.416631968044384848, 114.12462494307692396, 102.16117568227855372, + 101.02404021154143265, 74.454138960987620521, 115.09995644364971668, 108.74508845700256643, + 109.1506669020964182, 58.076469992036436452, 13.719079914011672372, 55.518160918534704251, + 83.861085221175017068, 6.0261843292209960055, 14.88588015093409922, 5.8082319305904093198, + 105.62301424566976493, 119.47151167426272877, 14.963160772182163782, 122.24318467975535896, + 96.507708539633313194, 49.848382915952242911, 53.828246628938359208, 82.643241928988572909, + 68.21135405126187834, 19.665571131634351332, 78.430973395945329685, 33.426737150799453957, + 24.322084225073922426, 2.1833132417814340442, 87.432151770324708195, 122.83818747434270335, + 74.353113842007587664, 50.627524098166759359, 16.538475532186566852, 69.593086276785470545, + 29.86622260804506368, 126.00128513321760693, 28.149961353810795117, 7.7311886845309345517, + 127.39478892867919058, 110.94545822818690795, 18.548597210949083092, 98.904233993354864651, + 92.337921228794584749, 64.176895650201913668, 14.50382948079277412, 23.998872704905807041, + 29.523777330607117619, 21.868576872231642483, 71.739258767323917709, 90.269266679610154824, + 91.683296885028539691, 10.019890980031050276, 104.21196291981323157, 53.156697538826847449, + 112.65929292035434628, 120.56718268572876696, 109.61123928970846464, 88.064085036250617122, + 64.149185221267543966, 24.712949401822697837, 82.003017201448528795, 9.1481108282569039147, + 41.447566229362564627, 57.708239832096296595, 43.407270304480334744, 99.2419671291281702, + 45.628409382577956421, 80.840218242214177735, 26.875208836227102438, 76.604636075870075729, + 76.098792066233727382, 57.843662131526798476, 106.95212494571751449, 101.02368292184837628, + 49.595080140999925788, 17.488509322705795057, 75.202529055401100777, 19.603238255858741468, + 41.18562205340640503, 24.83336670770222554, 79.647488716811494669, 97.475327219548489666, + 100.54715239577490138, 11.768216335083707236, 38.902100488299765857, 48.582877141780045349, + 46.600260970149975037, 48.906593885167239932, 49.756249217240110738, 56.481583644643251318, + 119.87429828027597978, 120.33711948591735563, 69.765485639916732907, 63.559103829396917718, + 14.536756913119461387, 4.6039643368530960288, 54.703814118751324713, 9.4565579448426433373, + 41.853597994115261827, 9.0433175523030513432, 94.373778207369468873, 123.48856883816915797, + 63.165063627075141994, 112.66974162967744633, 125.02829219107297831, 108.19047578362005879, + 117.21386139414244099, 54.779734837513387902, 59.949532358034048229, 45.743660352087317733, + 77.344870782500947826, 77.774803633659757907, 63.632822328345355345, 0.70354719667739118449, + 60.528446766096749343, 46.361887974766432308, 5.4011243082495639101, 110.66652582079041167, + 49.23554753407734097, 31.13090403598107514, 5.7644365556043339893, 84.205427235592651414, + 71.658323070863843895, 52.780212377139832824, 0.19047284332191338763, 65.603991704585496336, + 52.908886110242747236, 122.09298171820410062, 17.815406665635237005, 115.46733030309042078, + 11.161890514278638875, 42.590492253184493165, 1.2811336810882494319, 72.086564690613158746, + 55.686062499753461452, 85.692067720992781688, 123.99589572072363808, 119.1637771774585417, + 41.161789968362427317, 124.0890530002725427, 92.497205067622417118, 76.454112928193353582, + 44.311601955007063225, 0.035253775982710067183, 113.71433698883629404, 23.883494000270729885, + 28.026165139686781913, 96.348208109036932001, 111.69501061209302861, 118.05185571347828954, + 30.964869682087737601, 7.8175424501132511068, 86.257628015799127752, 15.60566064114755136, + 123.40256301018234808, 44.233931643080723006, 61.683651189236115897, 12.189647609986423049, + 125.435374357875844, 114.91194769230787642, 14.258760245462326566, 12.23925240302196471, + 91.621733697324089007, 72.718306542436039308, 93.499971786262904061, 13.981956605133746052, + 93.091295997459383216, 92.919775715927244164, 62.414333740667643724, 126.98410637475171825, + 38.833069018135574879, 89.441686464982922189, 7.8685406165313906968, 88.164460670435801148, + 101.10009035706752911, 11.702468750980187906, 125.93465174513039528, 91.134693002142739715, + 106.18729204326155013, 84.09719416326697683, 108.34871545749047073, 107.31799492836216814, + 75.383858506997057702, 124.29176945203289506, 25.723157326308864867, 77.451252451523032505, + 124.27014446070461418, 122.44028650389009272, 72.430302459419181105, 83.413965455689321971, + 114.30193473731196718, 122.12905539730127202, 27.042915428588457871, 95.48052250979890232, + 81.305456473302911036, 17.16574350497830892, 108.42201814444706542, 112.87580544753291178, + 88.088039134756400017, 120.47088578661714564, 116.96014381519853487, 6.6165699124176171608, + 119.63088199273261125, 71.202996837291721022, 1.4867204143884009682, 120.68657761966460384, + 68.061371929117740365, 110.90968972648624913, 47.274110903948894702, 107.19945306890440406, + 82.484040811643353663, 3.1692998974103829823, 98.158480335852800636, 57.151601184312312398, + 78.037607608814141713, 85.126625867935217684, 25.057978229600848863, 45.242527765440172516, + 33.993609555262082722, 104.98769814163460978, 40.155061541485338239, 57.244150791251740884, + 14.614140554062032606, 62.988036334194475785, 94.642204015206516488, 23.329571404596208595, + 32.677107394702034071, 55.174851719464641064, 52.451636208363197511, 41.241371271797106601, + 122.33496013371404842, 100.32345827664903481, 20.772488821243314305, 33.960134234475845005, + 21.115372543437842978, 67.065585886652115732, 118.06652383567416109, 52.34765848482857109, + 100.03763021880513406, 71.149006120595004177, 101.7587092469802883, 4.8175811152759706602, + 72.20578846865464584, 73.619228265928541077, 69.102634300124918809, 59.761019895133358659, + 37.290680539699678775, 69.653935016358445864, 68.791386508266441524, 78.017327295227005379, + 100.24310056111062295, 43.039130721375840949, 41.856763357052841457, 34.200368401456216816, + 117.71827080645380192, 48.069102583878702717, 68.631386007629771484, 46.309839678277057828, + 98.036877255286526633, 19.638528466275602113, 112.05135150620844797, 26.695358329394366592, + 56.312048712159594288, 27.145623055570467841, 81.487330863048555329, 65.322750238115986576, + 35.915675849118997576, 88.646092359183967346, 2.0622946688345109578, 94.733480555736605311, + 13.778446777341741836, 0.098216751623112941161, 104.78537744631830719, 49.79325261430858518, + 81.017271659675316187, 81.129797405570570845, 53.636656882659735857, 17.836815078560903203, + 62.576424356888310285, 119.89308050271938555, 75.999740767296316335, 126.94899134096340276, + 20.852521564109338215, 51.788860465821926482, 122.19523936207042425, 106.17756889638621942, + 125.48727699546725489, 28.90573366225726204, 117.21090220486439648, 120.83521302793815266, + 96.554580142565100687, 124.20286608644164517, 33.691121048417699058, 97.370698632763378555, + 51.190122758049255935, 33.008666955400258303, 38.724908382399007678, 97.33368916682593408, + 18.756911725060490426, 26.820084002065414097, 62.433216112043737667, 3.3506540385023981798, + 67.581477517400344368, 69.360902129341411637, 127.5137119142091251, 62.512392872238706332, + 48.394462080315861385, 73.733807062668347498, 68.975844960270478623, 114.49654435765114613, + 50.060783657561842119, 105.73177890217630193, 33.615400495553330984, 89.818790207682468463, + 90.510167642030864954, 3.0688382115586136933, 15.11264353059232235, 98.201123398863273906, + 116.96329752518431633, 88.981878296133800177, 126.23105748339730781, 74.740097971578506986, + 70.685073244887462351, 69.834265721601695986, 49.85064919254364213, 35.142449071194278076, + 106.54429840296506882, 108.17101283194278949, 127.59691936131275725, 102.08388641470082803, + 89.691390838190272916, 72.634674822951637907, 127.2126183193831821, 54.425113640219933586, + 123.76116606105642859, 74.435434373859607149, 116.26202623090648558, 35.174505319024319761, + 17.589778937748633325, 5.9132001900507020764, 0.75635680255072657019, 18.511738330904336181, + 113.86987245588898077, 75.6424720979121048, 105.70130040841831942, 36.148360067531029927, + 85.282471979313413613, 116.9869614615708997, 58.891084021946880966, 60.380744191432313528, + 81.585811312757869018, 14.596545159773086198, 119.75303196175082121, 100.36189767290125019, + 21.645756787329446524, 112.61697796104272129, 48.143954311992274597, 89.76667438646836672, + 54.288061313349317061, 53.059869119115319336, 8.4179533941205590963, 12.786162312349915737, + 97.915956914861453697, 123.19131355225908919, 70.236819064695737325, 113.75663812061247882, + 104.63066877821620437, 108.51047508900956018, 97.285699343596206745, 54.833263936092407675, + 100.24924988615748589, 76.322351364560745424, 74.048080423086503288, 20.908277921978879021, + 102.19991288730307133, 89.490176914008770837, 90.301333804192836396, 116.1529399840728729, + 27.438159828023344744, 111.03632183707304648, 39.722170442350034136, 12.052368658441992011, + 29.771760301868198439, 11.616463861184456619, 83.246028491343167843, 110.94302334852545755, + 29.926321544367965544, 116.48636935951435589, 65.015417079266626388, 99.696765831904485822, + 107.6564932578803564, 37.286483857980783796, 8.4227081025237566791, 39.331142263272340642, + 28.86194679189065937, 66.853474301598907914, 48.644168450147844851, 4.3666264835665060673, + 46.86430354065305437, 117.67637494868904469, 20.706227684015175328, 101.25504819633351872, + 33.076951064376771683, 11.186172553570941091, 59.732445216093765339, 124.00257026643521385, + 56.299922707621590234, 15.462377369065507082, 126.78957785736201913, 93.89091645637381589, + 37.097194421901804162, 69.808467986713367281, 56.675842457592807477, 0.35379130040382733569, + 29.007658961585548241, 47.997745409811614081, 59.047554661214235239, 43.737153744466922944, + 15.478517534651473397, 52.538533359223947627, 55.366593770057079382, 20.039781960065738531, + 80.42392583962646313, 106.31339507765733288, 97.318585840712330537, 113.13436537146117189, + 91.222478579420567257, 48.128170072504872223, 0.2983704425350879319, 49.425898803649033653, + 36.006034402897057589, 18.296221656513807829, 82.895132458725129254, 115.41647966419259319, + 86.814540608964307467, 70.483934258256340399, 91.256818765159550821, 33.68043648442835547, + 53.750417672457842855, 25.209272151743789436, 24.197584132467454765, 115.68732426305723493, + 85.904249891438666964, 74.047365843696752563, 99.190160281999851577, 34.977018645415228093, + 22.405058110802201554, 39.206476511717482936, 82.37124410681281006, 49.666733415408089058, + 31.294977433626627317, 66.95065443910061731, 73.094304791549802758, 23.536432670167414472, + 77.804200976599531714, 97.165754283560090698, 93.200521940299950074, 97.813187770334479865, + 99.512498434480221476, 112.96316728929014062, 111.74859656055559753, 112.67423897183834924, + 11.530971279833465815, 127.11820765879383544, 29.073513826238922775, 9.2079286737061920576, + 109.40762823750264943, 18.913115889685286675, 83.707195988230523653, 18.086635104609740665, + 60.747556414742575726, 118.97713767633831594, 126.33012725415392197, 97.339483259358530631, + 122.0565843821495946, 88.380951567243755562, 106.42772278828488197, 109.5594696750267758, + 119.89906471606809646, 91.487320704178273445, 26.68974156500553363, 27.549607267319515813, + 127.26564465669071069, 1.407094393354782369, 121.05689353219349869, 92.723775949532864615, + 10.802248616502765799, 93.333051641580823343, 98.47109506815468194, 62.261808071962150279, + 11.528873111212305957, 40.410854471188940806, 15.316646141727687791, 105.56042475427966565, + 0.38094568664746475406, 3.2079834091709926724, 105.81777222048913245, 116.18596343640820123, + 35.630813331274111988, 102.93466060618084157, 22.32378102855727775, 85.180984506368986331, + 2.5622673621801368427, 16.173129381226317491, 111.37212499951056088, 43.384135441989201354, + 119.99179144145091414, 110.3275543549170834, 82.323579936728492612, 120.17810600054872339, + 56.994410135248472216, 24.908225856386707164, 88.62320391001412645, 0.070507551969058113173, + 99.42867397767258808, 47.766988000541459769, 56.052330279377201805, 64.696416218077501981, + 95.390021224189695204, 108.10371142695657909, 61.929739364175475203, 15.635084900230140192, + 44.515256031598255504, 31.211321282298740698, 118.80512602036469616, 88.467863286161446013, + 123.36730237847223179, 24.379295219976484077, 122.87074871575532597, 101.82389538461575285, + 28.517520490924653132, 24.478504806047567399, 55.243467394651815994, 17.436613084875716595, + 58.999943572525808122, 27.963913210271130083, 58.18259199492240441, 57.839551431854488328, + 124.82866748133892543, 125.9682127495034365, 77.666138036274787737, 50.883372929965844378, + 15.737081233066419372, 48.328921340875240276, 74.200180714135058224, 23.404937501964013791, + 123.86930349026442855, 54.269386004289117409, 84.374584086526738247, 40.194388326537591638, + 88.697430914984579431, 86.635989856727974257, 22.767717013997753384, 120.58353890406579012, + 51.446314652621367713, 26.902504903049702989, 120.54028892141286633, 116.88057300778382341, + 16.860604918842000188, 38.82793091138228192, 100.60386947462757234, 116.25811079460254405, + 54.085830857180553721, 62.961045019601442618, 34.610912946605822071, 34.331487009960255818, + 88.844036288897768827, 97.751610895069461549, 48.176078269516438013, 112.94177157323792926, + 105.92028763039706973, 13.2331398248388723, 111.26176398546886048, 14.405993674583442044, + 2.9734408287804399151, 113.37315523933284567, 8.1227438582391187083, 93.819379452972498257, + 94.548221807901427383, 86.398906137812446104, 36.968081623286707327, 6.3385997948244039435, + 68.316960671705601271, 114.30320236862826278, 28.075215217631921405, 42.253251735870435368, + 50.115956459201697726, 90.485055530880345032, 67.987219110527803423, 81.975396283269219566, + 80.310123082970676478, 114.48830158250348177, 29.228281108124065213, 125.97607266839258955, + 61.284408030413032975, 46.659142809192417189, 65.354214789404068142, 110.34970343892928213, + 104.90327241672639502, 82.482742543597851181, 116.66992026743173483, 72.64691655329806963, + 41.544977642486628611, 67.920268468951690011, 42.230745086879323935, 6.1311717733078694437, + 108.13304767134832218, 104.69531696966078016, 72.075260437613906106, 14.298012241193646332, + 75.517418493960576598, 9.6351622305555792991, 16.411576937312929658, 19.238456531860720133, + 10.205268600249837618, 119.52203979026671732, 74.581361079402995529, 11.307870032720529707, + 9.5827730165365210269, 28.034654590457648737, 72.486201122221245896, 86.078261442751681898, + 83.713526714105682913, 68.400736802916071611, 107.43654161290760385, 96.138205167761043413, + 9.2627720152595429681, 92.619679356557753636, 68.073754510573053267, 39.277056932554842206, + 96.102703012416895945, 53.390716658788733184, 112.62409742431918858, 54.291246111144573661, + 34.974661726100748638, 2.6455004762319731526, 71.83135169824163313, 49.292184718367934693, + 4.1245893376726598945, 61.466961111473210622, 27.556893554683483671, 0.19643350324986386113, + 81.570754892636614386, 99.586505228620808339, 34.034543319354270352, 34.25959481114114169, + 107.27331376531947171, 35.673630157121806405, 125.15284871378025855, 111.78616100544240908, + 23.999481534596270649, 125.89798268192680553, 41.705043128218676429, 103.57772093164749094, + 116.39047872414448648, 84.355137792776076822, 122.97455399093450978, 57.811467324518162059, + 106.42180440973243094, 113.67042605587994331, 65.109160285133839352, 120.40573217288329033, + 67.382242096839036094, 66.74139726552675711, 102.38024551609851187, 66.017333910800516605, + 77.449816764801653335, 66.667378333651868161, 37.513823450120980851, 53.640168004130828194, + 124.86643222408747533, 6.7013080770084343385, 7.1629550348043267149, 10.721804258686461253, + 127.0274238284182502, 125.02478574447741266, 96.788924160635360749, 19.467614125340332976, + 9.9516899205445952248, 100.99308871530229226, 100.12156731512732222, 83.463557804352603853, + 67.230800991110299947, 51.637580415368574904, 53.020335284061729908, 6.1376764231172273867, + 30.225287061188282678, 68.40224679773018579, 105.92659505037227063, 49.963756592271238333, + 124.46211496679825359, 21.48019594316065195, 13.370146489778562682, 11.668531443203391973, + 99.701298385087284259, 70.284898142392194131, 85.088596805933775613, 88.342025663889216958, + 127.19383872262915247, 76.167772829405294033, 51.382781676384183811, 17.269349645906913793, + 126.42523663876636419, 108.85022728044350515, 119.52233212211649516, 20.870868747722852277, + 104.52405246181297116, 70.349010638048639521, 35.17955787549726665, 11.826400380101404153, + 1.5127136051014531404, 37.02347666181231034, 99.739744911781599512, 23.284944195827847579, + 83.402600816836638842, 72.296720135065697832, 42.564943958630465204, 105.9739229231417994, + 117.78216804389376193, 120.76148838286826503, 35.171622625515738036, 29.193090319549810374, + 111.5060639235052804, 72.723795345802500378, 43.291513574662531028, 97.23395592208544258, + 96.287908623988187173, 51.53334877293673344, 108.57612262669863412, 106.11973823823063867, + 16.835906788241118193, 25.572324624703469453, 67.831913829726545373, 118.38262710452181636, + 12.473638129395112628, 99.513276241228595609, 81.261337556436046725, 89.020950178022758337, + 66.57139868719241349, 109.66652787218845333, 72.498499772318609757, 24.644702729125128826, + 20.096160846173006576, 41.816555843961396022, 76.399825774609780638, 50.980353828021179652, + 52.602667608389310772, 104.30587996814574581, 54.876319656050327467, 94.072643674146092962, + 79.444340884700068273, 24.104737316883984022, 59.543520603736396879, 23.232927722372551216, + 38.492056982689973665, 93.8860466970509151, 59.852643088739569066, 104.97273871903234976, + 2.0308341585368907545, 71.393531663812609622, 87.312986515760712791, 74.572967715961567592, + 16.845416205047513358, 78.662284526544681285, 57.723893583784956718, 5.706948603197815828, + 97.288336900295689702, 8.7332529671330121346, 93.728607081309746718, 107.35274989737808937, + 41.412455368033988634, 74.510096392667037435, 66.153902128753543366, 22.372345107141882181, + 119.46489043219116866, 120.00514053287042771, 112.59984541524318047, 30.924754738134652143, + 125.57915571472767624, 59.781832912747631781, 74.194388843807246303, 11.616935973426734563, + 113.35168491518561495, 0.70758260080765467137, 58.015317923171096481, 95.995490819623228163, + 118.09510932242847048, 87.474307488933845889, 30.957035069302946795, 105.07706671844789525, + 110.73318754011415876, 40.07956392013511504, 32.847851679256564239, 84.626790155318303732, + 66.637171681428299053, 98.268730742925981758, 54.444957158841134515, 96.256340145009744447, + 0.5967408850701758638, 98.851797607298067305, 72.012068805794115178, 36.592443313031253638, + 37.790264917453896487, 102.83295932838882436, 45.629081217932252912, 12.967868516516318778, + 54.513637530319101643, 67.360872968856710941, 107.50083534491568571, 50.418544303487578873, + 48.395168264938547509, 103.37464852611810784, 43.808499782880971907, 20.094731687397143105, + 70.380320563999703154, 69.954037290830456186, 44.810116221604403108, 78.41295302343860385, + 36.742488213625620119, 99.333466830816178117, 62.589954867256892612, 5.9013088782048725989, + 18.188609583099605516, 47.072865340338466922, 27.608401953202701407, 66.331508567123819375, + 58.401043880603538128, 67.626375540672597708, 71.024996868964080932, 97.92633457858391921, + 95.497193121114833048, 97.348477943676698487, 23.061942559670569608, 126.23641531758767087, + 58.14702765247784555, 18.415857347416022094, 90.815256475005298853, 37.826231779374211328, + 39.414391976461047307, 36.17327020921948133, 121.49511282948878943, 109.95427535268026986, + 124.66025450831148191, 66.678966518720699241, 116.11316876430282719, 48.761903134491149103, + 84.855445576573401922, 91.118939350057189586, 111.7981294321398309, 54.97464140835654689, + 53.37948313001106726, 55.099214534642669605, 126.53128931338142138, 2.8141887867132027168, + 114.11378706439063535, 57.447551899065729231, 21.604497233009169577, 58.666103283165284665, + 68.942190136309363879, 124.52361614392430056, 23.057746222424611915, 80.821708942377881613, + 30.633292283459013561, 83.120849508559331298, 0.76189137329492950812, 6.4159668183456233237, + 83.635544440981902881, 104.37192687281640247, 71.261626662551861955, 77.869321212361683138, + 44.647562057118193479, 42.361969012737972662, 5.1245347243602736853, 32.346258762456272962, + 94.744249999021121766, 86.768270883982040687, 111.98358288290546625, 92.655108709837804781, + 36.647159873460623203, 112.35621200109744677, 113.98882027049694443, 49.816451712777052308, + 49.2464078200282529, 0.14101510394175420515, 70.85734795534517616, 95.533976001082919538, + 112.10466055875804159, 1.39283243615864194, 62.780042448383028386, 88.207422853913158178, + 123.85947872835095041, 31.270169800460280385, 89.030512063196511008, 62.422642564601119375, + 109.6102520407330303, 48.935726572326530004, 118.73460475694446359, 48.758590439956606133, + 117.74149743151428993, 75.647790769231505692, 57.035040981849306263, 48.957009612095134798, + 110.48693478930363199, 34.87322616975143319, 117.99988714505161624, 55.927826420542260166, + 116.36518398984480882, 115.67910286371261464, 121.65733496268148883, 123.93642549901051098, + 27.332276072549575474, 101.76674585993168876, 31.474162466132838745, 96.65784268175411853, + 20.400361428270116448, 46.80987500393166556, 119.73860698052885709, 108.5387720085818728, + 40.749168173053476494, 80.388776653078821255, 49.394861829972796841, 45.271979713455948513, + 45.535434027999144746, 113.16707780813158024, 102.89262930524273543, 53.805009806103043957, + 113.08057784282937064, 105.76114601556764683, 33.721209837684000377, 77.655861822768201819, + 73.207738949258782668, 104.51622158920508809, 108.17166171436110744, 125.92209003920288524, + 69.221825893211644143, 68.662974019924149616, 49.688072577799175633, 67.503221790138923097, + 96.352156539036514005, 97.8835431464794965, 83.840575260794139467, 26.46627964968138258, + 94.523527970937720966, 28.811987349166884087, 5.9468816575645178091, 98.746310478665691335, + 16.245487716481875395, 59.638758905948634492, 61.096443615806492744, 44.797812275624892209, + 73.936163246573414654, 12.677199589652445866, 8.6339213434148405213, 100.60640473725652555, + 56.15043043526384281, 84.506503471740870737, 100.23191291840703343, 52.970111061764328042, + 7.9744382210592448246, 35.950792566542077111, 32.620246165944990935, 100.97660316500696354, + 58.456562216251768405, 123.9521453367851791, 122.56881606082606595, 93.318285618388472358, + 2.7084295788117742632, 92.699406877862202236, 81.806544833456428023, 36.965485087199340342, + 105.33984053486710764, 17.29383310659613926, 83.0899552849768952, 7.8405369379033800215, + 84.46149017375864787, 12.262343546619376866, 88.266095342700282345, 81.390633939325198298, + 16.150520875227812212, 28.596024482390930643, 23.034836987921153195, 19.270324461111158598, + 32.823153874625859316, 38.476913063721440267, 20.410537200503313215, 111.04407958053707262, + 21.162722158805991057, 22.615740065441059414, 19.165546033073042054, 56.069309180918935454, + 16.972402244446129771, 44.156522885507001774, 39.427053428215003805, 8.8014736058357811999, + 86.873083225818845676, 64.276410335522086825, 18.525544030522723915, 57.23935871311914525, + 8.1475090211461065337, 78.55411386511332239, 64.205406024833791889, 106.78143331758110435, + 97.248194848638377152, 108.58249222228914732, 69.949323452201497275, 5.291000952467584284, + 15.66270339648326626, 98.584369436735869385, 8.2491786753453197889, 122.93392222294642124, + 55.113787109366967343, 0.39286700650336570106, 35.141509785276866751, 71.173010457241616677, + 68.069086638708540704, 68.519189622285921359, 86.546627530638943426, 71.34726031424725079, + 122.30569742756415508, 95.572322010884818155, 47.998963069196179276, 123.79596536385361105, + 83.410086256440990837, 79.155441863298619865, 104.78095744829261093, 40.710275585555791622, + 117.94910798186901957, 115.6229346490399621, 84.84360881946849986, 99.34085211176352459, + 2.2183205702713166829, 112.81146434577021864, 6.7644841936817101669, 5.4827945310571521986, + 76.760491032200661721, 4.0346678216046711896, 26.899633529606944649, 5.3347566673037363216, + 75.027646900241961703, 107.28033600826529437, 121.73286444817495067, 13.402616154016868677, + 14.32591006960865343, 21.443608517376560485, 126.05484765684013837, 122.04957148895846331, + 65.577848321270721499, 38.935228250680665951, 19.903379841092828428, 73.986177430608222494, + 72.243134630258282414, 38.927115608708845684, 6.4616019822205998935, 103.27516083073714981, + 106.04067056812345982, 12.275352846234454773, 60.450574122380203335, 8.8044935954640095588, + 83.853190100744541269, 99.927513184546114644, 120.92422993359650718, 42.9603918863213039, + 26.740292979557125363, 23.337062886410421925, 71.402596770178206498, 12.569796284788026242, + 42.177193611871189205, 48.684051327782071894, 126.38767744526194292, 24.335545658810588066, + 102.76556335276836762, 34.538699291817465564, 124.85047327753636637, 89.700454560890648281, + 111.04466424423299031, 41.741737495449342532, 81.048104923629580298, 12.698021276097279042, + 70.3591157509945333, 23.652800760202808306, 3.0254272102029062808, 74.046953323628258659, + 71.479489823563199025, 46.569888391659333138, 38.805201633676915662, 16.593440270131395664, + 85.129887917264568387, 83.947845846287236782, 107.56433608779116184, 113.52297676573653007, + 70.343245251031476073, 58.386180639103258727, 95.012127847014198778, 17.447590691605000757, + 86.583027149328700034, 66.467911844174523139, 64.575817247976374347, 103.06669754587710486, + 89.152245253400906222, 84.239476476461277343, 33.671813576482236385, 51.144649249410576886, + 7.6638276594567287248, 108.76525420904363273, 24.947276258793863235, 71.026552482460829196, + 34.522675112875731429, 50.041900356049154652, 5.1427973743884649593, 91.333055744380544638, + 16.996999544637219515, 49.289405458250257652, 40.192321692346013151, 83.633111687926430022, + 24.799651549219561275, 101.9607076560423593, 105.20533521678225952, 80.611759936291491613, + 109.75263931210429291, 60.145287348295823904, 30.888681769400136545, 48.209474633767968044, + 119.08704120747279376, 46.465855444745102432, 76.98411396538358531, 59.772093394101830199, + 119.70528617748277611, 81.945477438064699527, 4.0616683170774194878, 14.787063327628857223, + 46.625973031525063561, 21.145935431923135184, 33.690832410098664695, 29.324569053089362569, + 115.44778716756991344, 11.413897206399269635, 66.576673800591379404, 17.466505934269662248, + 59.457214162623131415, 86.705499794756178744, 82.824910736071615247, 21.020192785337712849, + 4.3078042575070867315, 44.744690214287402341, 110.92978086438597529, 112.01028106574449339, + 97.199690830486360937, 61.849509476272942265, 123.15831142945535248, 119.56366582549890154, + 20.388777687614492606, 23.233871946857107105, 98.703369830371229909, 1.4151652016153093427, + 116.03063584634583094, 63.990981639250094304, 108.19021864486057893, 46.948614977867691778, + 61.914070138609531568, 82.154133436899428489, 93.466375080228317529, 80.159127840270230081, + 65.695703358516766457, 41.253580310640245443, 5.2743433628602360841, 68.537461485851963516, + 108.88991431768590701, 64.512680290019488893, 1.1934817701439897064, 69.703595214599772589, + 16.024137611588230357, 73.184886626062507275, 75.580529834911430953, 77.665918656777648721, + 91.258162435864505824, 25.935737033032637555, 109.02727506064184126, 6.72174593771705986, + 87.001670689831371419, 100.83708860697515775, 96.790336529880732996, 78.749297052236215677, + 87.616999565761943813, 40.189463374797924189, 12.760641128003044287, 11.908074581660912372, + 89.620232443212444196, 28.8259060468772077, 73.484976427254878217, 70.666933661632356234, + 125.17990973451378522, 11.802617756409745198, 36.377219166199211031, 94.145730680676933844, + 55.216803906409040792, 4.6630171342476387508, 116.80208776121071423, 7.2527510813488333952, + 14.049993737931799842, 67.8526691571714764, 62.994386242233304074, 66.696955887353396975, + 46.123885119344777195, 124.47283063517534174, 116.2940553049556911, 36.831714694835682167, + 53.630512950010597706, 75.652463558748422656, 78.828783952922094613, 72.34654041844260064, + 114.99022565898121684, 91.908550705364177702, 121.32050901662660181, 5.3579330374450364616, + 104.22633752860565437, 97.523806268985936185, 41.710891153150441824, 54.23787870011801715, + 95.596258864279661793, 109.94928281671309378, 106.75896626002213452, 110.19842906928897719, + 125.06257862676284276, 5.6283775734300434124, 100.2275741287812707, 114.89510379813145846, + 43.208994466018339153, 117.33220656633420731, 9.8843802726223657373, 121.04723228784860112, + 46.115492444852861809, 33.643417884755763225, 61.2665845669216651, 38.241699017118662596, + 1.5237827465898590162, 12.831933636694884626, 39.27108888196744374, 80.743853745636442909, + 14.523253325107361889, 27.738642424723366275, 89.295124114236386959, 84.723938025475945324, + 10.249069448720547371, 64.692517524916183902, 61.488499998045881512, 45.536541767967719352, + 95.967165765814570477, 57.310217419675609563, 73.294319746924884384, 96.712424002198531525, + 99.977640540993888862, 99.632903425554104615, 98.492815640056505799, 0.28203020788714638911, + 13.714695910693990299, 63.067952002169477055, 96.209321117516083177, 2.78566487231728388, + 125.56008489676969475, 48.414845707829954335, 119.71895745670190081, 62.540339600924198749, + 50.061024126393022016, 124.84528512920587673, 91.220504081466060597, 97.871453144656697987, + 109.46920951388892718, 97.517180879916850245, 107.48299486303221784, 23.295581538463011384, + 114.07008196369861253, 97.914019224193907576, 92.973869578607263975, 69.746452339506504359, + 107.99977429010323249, 111.85565284108815831, 104.73036797969325562, 103.35820572742886725, + 115.31466992536661564, 119.87285099802102195, 54.664552145102788927, 75.533491719863377512, + 62.948324932269315468, 65.31568536350823706, 40.800722856540232897, 93.619750007866969099, + 111.47721396106135217, 89.077544017163745593, 81.498336346110590966, 32.77755330615764251, + 98.789723659945593681, 90.543959426911897026, 91.070868056001927471, 98.334155616266798461, + 77.785258610485470854, 107.61001961220972589, 98.161155685662379256, 83.522292031135293655, + 67.442419675371638732, 27.311723645540041616, 18.415477898521203315, 81.032443178413814167, + 88.343323428725852864, 123.84418007840940845, 10.443651786426926265, 9.3259480398482992314, + 99.376145155601989245, 7.0064435802814841736, 64.704313078076665988, 67.767086292962630978, + 39.681150521588278934, 52.932559299366403138, 61.047055941875441931, 57.623974698333768174, + 11.893763315132673597, 69.49262095733138267, 32.490975432963750791, 119.27751781189726898, + 122.19288723161298549, 89.595624551253422396, 19.872326493146829307, 25.354399179304891732, + 17.267842686833319021, 73.2128094745130511, 112.3008608705313236, 41.013006943485379452, + 72.463825836814066861, 105.94022212352865608, 15.948876442118489649, 71.901585133084154222, + 65.240492331893619848, 73.953206330013927072, 116.91312443250717479, 119.90429067357399617, + 117.13763212165576988, 58.636571236776944716, 5.4168591576271865051, 57.398813755728042452, + 35.613089666912856046, 73.930970174402318662, 82.679681069734215271, 34.587666213195916498, + 38.1799105699537904, 15.681073875810398022, 40.922980347517295741, 24.524687093242391711, + 48.532190685404202668, 34.781267878650396597, 32.301041750455624424, 57.192048964781861287, + 46.06967397584230639, 38.540648922222317196, 65.646307749251718633, 76.953826127442880534, + 40.82107440101026441, 94.088159161074145231, 42.325444317611982115, 45.231480130882118829, + 38.331092066146084107, 112.13861836183787091, 33.944804488892259542, 88.313045771014003549, + 78.85410685643000761, 17.602947211675200379, 45.746166451641329331, 0.55282067104417365044, + 37.05108806104544783, 114.4787174262382905, 16.295018042295851046, 29.108227730230282759, + 0.41081204967122175731, 85.562866635165846674, 66.496389697280392284, 89.164984444578294642, + 11.898646904402994551, 10.582001904935168568, 31.3254067929701705, 69.168738873471738771, + 16.498357350694277557, 117.86784444589284249, 110.22757421873393469, 0.78573401300673140213, + 70.28301957055737148, 14.346020914486871334, 8.138173277420719387, 9.0383792445754806977, + 45.093255061281524831, 14.694520628498139558, 116.61139485513194813, 63.144644021769636311, + 95.997926138395996531, 119.59193072771086008, 38.820172512885619653, 30.310883726600877708, + 81.561914896585221868, 81.420551171115221223, 107.89821596374167711, 103.24586929808356217, + 41.687217638940637698, 70.68170422352704918, 4.4366411405462713446, 97.622928691540437285, + 13.528968387363420334, 10.965589062117942376, 25.520982064401323441, 8.0693356432093423791, + 53.799267059213889297, 10.669513334611110622, 22.055293800487561384, 86.560672016534226714, + 115.46572889634990133, 26.805232308033737354, 28.65182013921730686, 42.887217034756758949, + 124.10969531368391472, 116.09914297792056459, 3.1556966425414429978, 77.870456501361331902, + 39.806759682189294836, 19.972354861220082967, 16.486269260516564827, 77.854231217417691369, + 12.923203964444837766, 78.550321661477937596, 84.081341136246919632, 24.550705692468909547, + 120.90114824476040667, 17.608987190931657096, 39.706380201492720516, 71.855026369095867267, + 113.84845986719301436, 85.920783772642607801, 53.480585959114250727, 46.674125772824481828, + 14.805193540356412996, 25.139592569576052483, 84.35438722374237841, 97.368102655567781767, + 124.77535489052388584, 48.67109131762481411, 77.531126705536735244, 69.077398583638569107, + 121.70094655507637071, 51.400909121784934541, 94.089328488465980627, 83.483474990902323043, + 34.096209847259160597, 25.396042552198196063, 12.718231501989066601, 47.305601520405616611, + 6.0508544204094505403, 20.093906647260155296, 14.958979647126398049, 93.139776783318666276, + 77.610403267353831325, 33.186880540266429307, 42.259775834532774752, 39.895691692578111542, + 87.128672175585961668, 99.045953531476698117, 12.686490502062952146, 116.77236127821015543, + 62.024255694028397556, 34.895181383213639492, 45.166054298661038047, 4.9358236883526842576, + 1.1516344959563866723, 78.133395091757847695, 50.304490506805450423, 40.478952952922554687, + 67.343627152964472771, 102.28929849882115377, 15.327655318917095428, 89.530508418087265454, + 49.894552517591364449, 14.053104964921658393, 69.045350225751462858, 100.0838007120983093, + 10.285594748780567897, 54.666111488761089277, 33.993999089274439029, 98.578810916500515305, + 80.384643384695664281, 39.266223375852860045, 49.599303098442760529, 75.921415312088356586, + 82.410670433568157023, 33.223519872586621204, 91.505278624208585825, 120.29057469659164781, + 61.777363538800273091, 96.418949267539574066, 110.17408241494558752, 92.931710889493842842, + 25.968227930767170619, 119.54418678820729838, 111.4105723549691902, 35.890954876129399054, + 8.1233366341548389755, 29.574126655257714447, 93.251946063050127123, 42.291870863846270368, + 67.381664820197329391, 58.649138106182363117, 102.89557433513982687, 22.827794412802177249, + 5.1533476011827588081, 34.933011868539324496, 118.91442832524990081, 45.410999589515995467, + 37.649821472143230494, 42.040385570675425697, 8.615608515014173463, 89.489380428578442661, + 93.859561728775588563, 96.020562131492624758, 66.399381660972721875, 123.69901895254952251, + 118.31662285891434294, 111.12733165099780308, 40.777555375228985213, 46.467743893717852188, + 69.406739660742459819, 2.8303304032342566643, 104.06127169269166188, 127.98196327850382659, + 88.380437289721157867, 93.897229955735383555, 123.82814027722270112, 36.308266873802494956, + 58.932750160460273037, 32.318255680544098141, 3.3914067170335329138, 82.507160621280490886, + 10.548686725724110147, 9.0749229717075650115, 89.779828635375451995, 1.0253605800389777869, + 2.3869635402916173916, 11.407190429199545179, 32.048275223180098692, 18.36977325212865253, + 23.161059669826499885, 27.331837313558935421, 54.516324871729011647, 51.871474066068913089, + 90.054550121283682529, 13.443491875437757699, 46.003341379666380817, 73.674177213953953469, + 65.580673059765103972, 29.498594104476069333, 47.233999131523887627, 80.378926749595848378, + 25.521282256006088573, 23.816149163325462723, 51.240464886424888391, 57.651812093758053379, + 18.969952854513394414, 13.333867323268350447, 122.35981946902757045, 23.605235512819490395, + 72.754438332402060041, 60.291461361353867687, 110.43360781281808158, 9.3260342684989154804, + 105.60417552242142847, 14.50550216269766679, 28.099987475867237663, 7.7053383143429527991, + 125.98877248447024613, 5.393911774706793949, 92.247770238693192368, 120.94566127035432146, + 104.5881106099113822, 73.663429389671364333, 107.26102590002483339, 23.304927117500483291, + 29.657567905847827205, 16.693080836888839258, 101.98045131796607166, 55.817101410731993383, + 114.64101803325320361, 10.715866074893710902, 80.452675057214946719, 67.047612537971872371, + 83.421782306300883647, 108.47575740023967228, 63.192517728562961565, 91.898565633429825539, + 85.517932520047907019, 92.396858138581592357, 122.12515725352568552, 11.256755146863724804, + 72.455148257566179382, 101.79020759626291692, 86.417988932040316286, 106.66441313266841462, + 19.768760545248369453, 114.09446457569720224, 92.230984889705723617, 67.286835769511526451, + 122.5331691338433302, 76.483398034237325191, 3.0475654931797180325, 25.663867273389769252, + 78.542177763938525459, 33.487707491272885818, 29.046506650214723777, 55.47728484945037053, + 50.590248228476411896, 41.447876050951890647, 20.49813889744473272, 1.3850350498323678039, + 122.97699999609176302, 91.073083535939076683, 63.934331531629140954, 114.6204348393548571, + 18.588639493853406748, 65.424848004400701029, 71.955281081991415704, 71.265806851111847209, + 68.985631280113011599, 0.56406041577429277822, 27.429391821387980599, 126.13590400434259209, + 64.418642235032166354, 5.5713297446382057387, 123.1201697935393895, 96.82969141566354665, + 111.43791491340380162, 125.0806792018483975, 100.12204825278968201, 121.69057025841539144, + 54.441008162935759174, 67.742906289317033952, 90.938419027781492332, 67.034361759837338468, + 86.965989726064435672, 46.591163076929660747, 100.14016392740086303, 67.82803844839145313, + 57.947739157218165928, 11.492904679016646696, 87.999548580210102955, 95.711305682179954601, + 81.460735959390149219, 78.716411454861372476, 102.62933985073686927, 111.7457019960420439, + 109.32910429020921583, 23.066983439726755023, 125.89664986454226892, 2.6313707270164741203, + 81.601445713084103772, 59.239500015737576177, 94.95442792212634231, 50.155088034331129165, + 34.996672692221181933, 65.555106612318922998, 69.579447319894825341, 53.087918853827432031, + 54.14173611200749292, 68.668311232537234901, 27.570517220974579686, 87.220039224423089763, + 68.32231137132839649, 39.044584062274225289, 6.8848393507432774641, 54.623447291080083232, + 36.830955797046044609, 34.064886356831266312, 48.686646857455343707, 119.6883601568188169, + 20.887303572853852529, 18.651896079700236442, 70.75229031120397849, 14.012887160566606326, + 1.4086261561569699552, 7.5341725859252619557, 79.362301043176557869, 105.86511859873280628, + 122.09411188375088386, 115.24794939666753635, 23.787526630268985173, 10.985241914662765339, + 64.98195086593113956, 110.55503562379817595, 116.38577446322960895, 51.191249102506844793, + 39.744652986293658614, 50.708798358609783463, 34.535685373670276022, 18.425618949029740179, + 96.601721741062647197, 82.026013886974396883, 16.9276516736317717, 83.880444247057312168, + 31.897752884240617277, 15.803170266171946423, 2.4809846637908776756, 19.906412660031492123, + 105.82624886501798755, 111.80858134715163033, 106.27526424331153976, 117.27314247355388943, + 10.83371831525437301, 114.7976275114560849, 71.226179333829350071, 19.861940348808275303, + 37.359362139468430541, 69.175332426391832996, 76.3598211399075808, 31.362147751620796043, + 81.845960695034591481, 49.049374186484783422, 97.064381370808405336, 69.562535757300793193, + 64.602083500911248848, 114.38409792956372257, 92.139347951684612781, 77.081297844448272372, + 3.2926154985070752446, 25.907652254885761067, 81.642148802024166798, 60.176318322148290463, + 84.650888635223964229, 90.462960261764237657, 76.662184132295806194, 96.277236723675741814, + 67.889608977788157063, 48.626091542031645076, 29.708213712860015221, 35.205894423350400757, + 91.492332903282658663, 1.1056413420883473009, 74.102176122094533639, 100.957434852476581, + 32.590036084591702092, 58.216455460460565519, 0.82162409934608149342, 43.125733270335331326, + 4.992779394564422546, 50.329968889160227263, 23.797293808805989102, 21.164003809870337136, + 62.650813585943978978, 10.337477746943477541, 32.996714701392193092, 107.73568889178932295, + 92.455148437467869371, 1.5714680260171007831, 12.566039141114742961, 28.692041828973742668, + 16.276346554841438774, 18.076758489150961395, 90.186510122563049663, 29.389041256999917096, + 105.22278971026389627, 126.2892880435429106, 63.995852276795631042, 111.18386145542172017, + 77.640345025771239307, 60.621767453205393394, 35.123829793174081715, 34.841102342234080425, + 87.796431927486992208, 78.491738596167124342, 83.374435277884913376, 13.36340844705409836, + 8.8732822810961806681, 67.24585738308087457, 27.057936774726840667, 21.931178124235884752, + 51.041964128802646883, 16.138671286418684758, 107.59853411842777859, 21.339026669222221244, + 44.110587600978760747, 45.121344033072091406, 102.93145779269980267, 53.610464616067474708, + 57.30364027843461372, 85.774434069517155876, 120.21939062737146742, 104.19828595584112918, + 6.3113932850865239743, 27.740913002722663805, 79.613519364378589671, 39.944709722440165933, + 32.972538521036767634, 27.708462434835382737, 25.84640792889331351, 29.100643322959513171, + 40.162682272493839264, 49.101411384941457072, 113.80229648952081334, 35.217974381863314193, + 79.412760402989079012, 15.710052738195372513, 99.696919734389666701, 43.841567545285215601, + 106.96117191822850145, 93.348251545648963656, 29.610387080712825991, 50.279185139155742945, + 40.708774447488394799, 66.736205311139201513, 121.55070978104777168, 97.342182635253266199, + 27.062253411077108467, 10.154797167280776193, 115.40189311015274143, 102.80181824357350706, + 60.178656976935599232, 38.966949981804646086, 68.192419694518321194, 50.792085104396392126, + 25.436463003978133202, 94.611203040811233222, 12.101708840818901081, 40.187813294520310592, + 29.917959294256434077, 58.27955356664097053, 27.220806534707662649, 66.373761080532858614, + 84.519551669065549504, 79.791383385159861064, 46.257344351175561314, 70.091907062953396235, + 25.372981004129542271, 105.54472255642031087, 124.04851138805679511, 69.790362766427278984, + 90.332108597322076093, 9.8716473767053685151, 2.3032689919164113235, 28.266790183515695389, + 100.60898101361090085, 80.957905905848747352, 6.6872543059325835202, 76.578596997642307542, + 30.655310637837828835, 51.061016836174530908, 99.789105035182728898, 28.106209929846954765, + 10.090700451506563695, 72.167601424196618609, 20.571189497561135795, 109.33222297752217855, + 67.987998178552516038, 69.157621833004668588, 32.769286769391328562, 78.532446751705720089, + 99.198606196889159037, 23.842830624180351151, 36.821340867136314046, 66.447039745176880388, + 55.010557248420809628, 112.58114939318329562, 123.55472707760418416, 64.837898535082786111, + 92.34816482989481301, 57.863421778987685684, 51.936455861537979217, 111.08837357641823473, + 94.821144709938380402, 71.781909752258798108, 16.246673268309677951, 59.148253310519066872, + 58.503892126100254245, 84.583741727696178714, 6.7633296403946587816, 117.29827621236836421, + 77.791148670279653743, 45.655588825604354497, 10.306695202365517616, 69.866023737082286971, + 109.82885665049980162, 90.821999179031990934, 75.299642944286460988, 84.080771141350851394, + 17.231217030031984905, 50.978760857160523301, 59.719123457554815104, 64.041124262988887494, + 4.7987633219490817282, 119.398037905102683, 108.63324571783232386, 94.254663301995606162, + 81.555110750457970425, 92.935487787439342355, 10.813479321484919637, 5.6606608064721513074, + 80.122543385386961745, 127.96392655701129115, 48.760874579445953714, 59.794459911474405089, + 119.65628055444540223, 72.616533747604989912, 117.86550032092054607, 64.636511361088196281, + 6.7828134340707038064, 37.014321242560981773, 21.097373451448220294, 18.149845943418768002, + 51.55965727075090399, 2.0507211600779555738, 4.7739270805832347833, 22.814380858399090357, + 64.096550446360197384, 36.73954650425730506, 46.32211933965299977, 54.663674627117870841, + 109.03264974345802329, 103.74294813214146416, 52.109100242567365058, 26.886983750875515398, + 92.006682759336399613, 19.348354427911544917, 3.1613461195302079432, 58.997188208952138666, + 94.467998263051413232, 32.757853499191696756, 51.042564512012177147, 47.632298326650925446, + 102.48092977284977678, 115.30362418751610676, 37.939905709026788827, 26.667734646540338872, + 116.7196389380551409, 47.21047102564261877, 17.508876664804120082, 120.58292272271137335, + 92.867215625636163168, 18.65206853700146894, 83.208351044842856936, 29.011004325395333581, + 56.199974951734475326, 15.410676628689543577, 123.97754496894049225, 10.787823549417225877, + 56.495540477390022716, 113.8913225407122809, 81.176221219826402375, 19.326858779346366646, + 86.522051800049666781, 46.609854235000966582, 59.315135811695654411, 33.386161673781316495, + 75.960902635932143312, 111.63420282146762474, 101.28203606650640722, 21.431732149791059783, + 32.905350114433531417, 6.0952250759473827202, 38.843564612605405273, 88.951514800479344558, + 126.38503545712956111, 55.797131266863289056, 43.035865040099452017, 56.793716277166822692, + 116.25031450705137104, 22.513510293731087586, 16.910296515135996742, 75.580415192529471824, + 44.83597786408427055, 85.328826265336829238, 39.537521090500376886, 100.18892915139804245, + 56.461969779415085213, 6.5736715390266908798, 117.06633826769029838, 24.966796068474650383, + 6.095130986359436065, 51.327734546783176484, 29.084355527877050918, 66.975414982545771636, + 58.093013300429447554, 110.95456969890074106, 101.18049645695282379, 82.895752101903781295, + 40.99627779488946544, 2.7700700996683735866, 117.95399999218716403, 54.146167071878153365, + 127.86866306326191989, 101.24086967870971421, 37.177278987710451474, 2.8496960088050400373, + 15.910562163986469386, 14.531613702227332396, 9.9712625602260231972, 1.1281208315485855564, + 54.858783642779599177, 124.27180800868882216, 0.83728447006433270872, 11.142659489280049456, + 118.24033958708241698, 65.659382831330731278, 94.875829826811241219, 122.16135840370043297, + 72.244096505583001999, 115.38114051683078287, 108.88201632587515633, 7.485812578637705883, + 53.876838055566622643, 6.0687235196783149149, 45.931979452128871344, 93.182326153862959472, + 72.280327854805364041, 7.6560768967829062603, 115.89547831443633186, 22.985809358036931371, + 47.999097160423843889, 63.422611364363547182, 34.921471918783936417, 29.432822909726382932, + 77.258679701477376511, 95.491403992087725783, 90.658208580418431666, 46.133966879457148025, + 123.79329972908453783, 5.2627414540365862194, 35.202891426168207545, 118.47900003147879033, + 61.908855844252684619, 100.31017606866225833, 69.993345384446001844, 3.1102132246414839756, + 11.158894639789650682, 106.17583770765486406, 108.28347222401862382, 9.336622465074469801, + 55.141034441952797351, 46.440078448849817505, 8.6446227426567929797, 78.089168124548450578, + 13.769678701486554928, 109.24689458216016646, 73.661911594092089217, 68.129772713662532624, + 97.373293714914325392, 111.37672031363763381, 41.774607145707705058, 37.303792159404110862, + 13.50458062240795698, 28.025774321133212652, 2.8172523123139399104, 15.06834517185416189, + 30.724602086356753716, 83.730237197469250532, 116.1882237675054057, 102.4958987933350727, + 47.575053260537970345, 21.970483829329168657, 1.9639017318659170996, 93.110071247599989874, + 104.77154892645921791, 102.38249820501368959, 79.489305972587317228, 101.41759671721956693, + 69.071370747340552043, 36.851237898063118337, 65.203443482128932374, 36.052027773948793765, + 33.85530334726718138, 39.760888494114624336, 63.795505768481234554, 31.606340532343892846, + 4.9619693275817553513, 39.812825320066622226, 83.652497730039613089, 95.617162694306898629, + 84.550528486626717495, 106.54628494710777886, 21.667436630512383999, 101.59525502291580779, + 14.452358667658700142, 39.723880697616550606, 74.718724278940499062, 10.350664852787303971, + 24.719642279815161601, 62.724295503245230066, 35.691921390069182962, 98.098748372973204823, + 66.128762741620448651, 11.125071514605224365, 1.2041670018261356745, 100.76819585913108313, + 56.27869590337286354, 26.162595688896544743, 6.5852309970141504891, 51.815304509775160113, + 35.284297604048333596, 120.3526366443002189, 41.301777270451566437, 52.925920523532113293, + 25.324368264595250366, 64.554473447355121607, 7.7792179555763141252, 97.252183084063290153, + 59.416427425720030442, 70.411788846704439493, 54.984665806565317325, 2.2112826841803325806, + 20.204352244192705257, 73.914869704953162, 65.180072169183404185, 116.43291092092113104, + 1.6432481986921629868, 86.251466540670662653, 9.9855587891288450919, 100.65993777832045453, + 47.594587617611978203, 42.328007619740674272, 125.30162717188795796, 20.674955493886955082, + 65.993429402788024163, 87.471377783582283882, 56.910296874935738742, 3.1429360520342015661, + 25.132078282229485922, 57.384083657947485335, 32.552693109682877548, 36.15351697830556077, + 52.373020245126099326, 58.77808251400347217, 82.445579420531430515, 124.5785760870858212, + 127.99170455359490006, 94.36772291084707831, 27.280690051542478614, 121.24353490641078679, + 70.24765958634816343, 69.682204684471798828, 47.592863854977622395, 28.983477192337886663, + 38.748870555769826751, 26.72681689410819672, 17.746564562195999315, 6.4917147661617491394, + 54.115873549453681335, 43.862356248471769504, 102.08392825760529377, 32.277342572841007495, + 87.197068236855557188, 42.678053338444442488, 88.221175201957521494, 90.242688066147820791, + 77.862915585399605334, 107.22092923213494942, 114.60728055687286542, 43.548868139037949732, + 112.43878125474657281, 80.39657191168225836, 12.622786570173047949, 55.481826005448965589, + 31.227038728757179342, 79.889419444880331866, 65.945077042073535267, 55.416924869670765474, + 51.692815857786627021, 58.201286645919026341, 80.325364544987678528, 98.202822769886552123, + 99.604592979041626677, 70.435948763730266364, 30.825520805978158023, 31.420105476394383004, + 71.393839468779333401, 87.683135090574069181, 85.922343836460640887, 58.696503091297927313, + 59.220774161425651982, 100.55837027831148589, 81.417548894980427576, 5.4724106222820410039, + 115.10141956209918135, 66.684365270506532397, 54.124506822154216934, 20.309594334565190366, + 102.80378622030912084, 77.603636487147014122, 120.35731395387119846, 77.933899963612930151, + 8.3848393890366423875, 101.58417020879278425, 50.872926007959904382, 61.222406081622466445, + 24.203417681637802161, 80.375626589040621184, 59.835918588512868155, 116.55910713328194106, + 54.441613069418963278, 4.7475221610693552066, 41.039103338134736987, 31.582766770319722127, + 92.514688702354760608, 12.183814125906792469, 50.74596200826272252, 83.089445112844259711, + 120.0970227761172282, 11.580725532858195947, 52.664217194644152187, 19.74329475341073703, + 4.6065379838328226469, 56.533580367035028758, 73.21796202722543967, 33.915811811697494704, + 13.374508611868805019, 25.157193995284615085, 61.310621275675657671, 102.1220336723526998, + 71.578210070365457796, 56.21241985969390953, 20.181400903016765369, 16.335202848393237218, + 41.142378995125909569, 90.664445955047995085, 7.975996357108670054, 10.315243666009337176, + 65.538573538786295103, 29.064893503415078158, 70.397212393778318074, 47.685661248360702302, + 73.64268173427626607, 4.8940794903537607752, 110.02111449684525724, 97.162298786370229209, + 119.1094541552120063, 1.6757970701692102011, 56.696329659789626021, 115.72684355797537137, + 103.87291172307959641, 94.176747152840107447, 61.642289419880398782, 15.563819504517596215, + 32.493346536619355902, 118.29650662103813374, 117.00778425220414647, 41.167483455392357428, + 13.526659280792955542, 106.5965524247403664, 27.582297340559307486, 91.311177651208708994, + 20.613390404734673211, 11.73204747416821192, 91.657713301003241213, 53.643998358067619847, + 22.599285888576559955, 40.161542282701702788, 34.46243406006396981, 101.9575217143210466, + 119.43824691511326819, 0.08224852597777498886, 9.5975266439018014353, 110.79607581020900398, + 89.266491435668285703, 60.509326603994850302, 35.11022150091957883, 57.870975574878684711, + 21.626958642969839275, 11.321321612947940594, 32.245086770777561469, 127.9278531140225823, + 97.521749158891907427, 119.58891982295244816, 111.31256110889444244, 17.233067495213617804, + 107.73100064184473013, 1.2730227221763925627, 13.565626868141407613, 74.028642485121963546, + 42.194746902896440588, 36.299691886837536003, 103.11931454150180798, 4.1014423201559111476, + 9.5478541611664695665, 45.628761716801818693, 0.19310089272039476782, 73.479093008514610119, + 92.64423867930599954, 109.32734925423937966, 90.065299486919684568, 79.485896264282928314, + 104.21820048513473012, 53.773967501754668774, 56.013365518672799226, 38.696708855823089834, + 6.3226922390604158863, 117.99437641790791531, 60.935996526102826465, 65.515706998383393511, + 102.08512902402435429, 95.264596653305488871, 76.961859545703191543, 102.60724837503221352, + 75.879811418053577654, 53.335469293084315723, 105.4392778761102818, 94.42094205128523754, + 35.017753329611878144, 113.16584544542638469, 57.734431251272326335, 37.304137074006575858, + 38.416702089685713872, 58.022008650790667161, 112.39994990346895065, 30.821353257382725133, + 119.95508993788098451, 21.575647098834451754, 112.99108095478368341, 99.782645081428199774, + 34.352442439652804751, 38.65371755869637127, 45.044103600099333562, 93.219708470001933165, + 118.63027162339130882, 66.772323347566270968, 23.921805271867924603, 95.268405642938887468, + 74.564072133012814447, 42.863464299582119565, 65.810700228867062833, 12.19045015189476544, + 77.687129225214448525, 49.903029600962327095, 124.77007091425912222, 111.59426253372657811, + 86.071730080198904034, 113.58743255433728336, 104.50062901410274208, 45.027020587462175172, + 33.820593030275631463, 23.160830385058943648, 89.671955728172179079, 42.657652530673658475, + 79.07504218100439175, 72.377858302796084899, 112.92393955883017043, 13.147343078057019738, + 106.13267653538059676, 49.933592136949300766, 12.19026197271887213, 102.65546909356635297, + 58.168711055757739814, 5.9508299650915432721, 116.18602660086253309, 93.909139397805120097, + 74.360992913909285562, 37.79150420380756259, 81.99255558977893088, 5.540140199340385152, + 107.90799998437432805, 108.29233414375994471, 127.73732612652747775, 74.481739357419428416, + 74.354557975420902949, 5.6993920176100800745, 31.821124327972938772, 29.063227404454664793, + 19.942525120452046394, 2.2562416630971711129, 109.71756728556283633, 120.54361601737764431, + 1.6745689401286654174, 22.285318978563736891, 108.48067917416847195, 3.3187656626651005354, + 61.751659653626120416, 116.32271680740450392, 16.488193011169641977, 102.76228103366520372, + 89.764032651750312652, 14.971625157275411766, 107.75367611113324529, 12.13744703935662983, + 91.863958904261380667, 58.364652307729556924, 16.560655709610728081, 15.312153793569450499, + 103.79095662887266371, 45.971618716073862743, 95.998194320847687777, 126.84522272872709436, + 69.842943837567872833, 58.865645819456403842, 26.517359402958391001, 62.982807984179089544, + 53.316417160836863331, 92.267933758917934028, 119.58659945816907566, 10.525482908073172439, + 70.405782852340053068, 108.95800006295758067, 123.81771168850900722, 72.62035213732815464, + 11.986690768892003689, 6.2204264492829679511, 22.317789279582939344, 84.351675415313366102, + 88.566944448037247639, 18.673244930148939602, 110.2820688839055947, 92.88015689769963501, + 17.289245485317223938, 28.178336249096901156, 27.539357402976747835, 90.493789164323970908, + 19.323823188187816413, 8.2595454273287032265, 66.746587429832288763, 94.753440627275267616, + 83.549214291415410116, 74.607584318808221724, 27.00916124481591396, 56.051548642266425304, + 5.6345046246278798208, 30.13669034370832378, 61.449204172717145411, 39.460474394942139043, + 104.37644753501444939, 76.991797586670145392, 95.150106521075940691, 43.940967658658337314, + 3.9278034637354721781, 58.220142495203617727, 81.543097852922073798, 76.764996410031017149, + 30.978611945178272435, 74.835193434442771832, 10.142741494681104086, 73.702475796129874652, + 2.4068869642578647472, 72.10405554789758753, 67.710606694534362759, 79.521776988229248673, + 127.59101153696246911, 63.212681064687785693, 9.9239386551635107026, 79.62565064013688243, + 39.304995460082864156, 63.234325388617435237, 41.101056973257072968, 85.092569894215557724, + 43.334873261028405977, 75.190510045831615571, 28.904717335317400284, 79.44776139523673919, + 21.437448557880998123, 20.701329705574607942, 49.439284559630323201, 125.44859100649046013, + 71.383842780142003903, 68.197496745950047625, 4.2575254832408973016, 22.250143029210448731, + 2.4083340036559093278, 73.53639171826216625, 112.55739180674572708, 52.325191377793089487, + 13.170461994028300978, 103.63060901955032023, 70.568595208100305172, 112.70527328860043781, + 82.603554540903132875, 105.85184104706422659, 50.648736529194138711, 1.1089468947102432139, + 15.558435911156266229, 66.504366168126580305, 118.83285485144369886, 12.823577693408878986, + 109.96933161313063465, 4.4225653683606651612, 40.408704488389048493, 19.829739409909961978, + 2.3601443383704463486, 104.86582184184226207, 3.2864963973879639525, 44.502933081341325305, + 19.971117578261328163, 73.319875556644547032, 95.189175235223956406, 84.656015239484986523, + 122.60325434377591591, 41.349910987777548144, 3.9868588055796863046, 46.942755567164567765, + 113.82059374987147748, 6.2858721040684031323, 50.264156564458971843, 114.76816731589497067, + 65.105386219365755096, 72.307033956611121539, 104.74604049025219865, 117.55616502801058232, + 36.891158841066499008, 121.15715217417528038, 127.9834091071934381, 60.735445821694156621, + 54.561380103088595206, 114.48706981282521156, 12.495319172699964838, 11.364409368943597656, + 95.185727709955244791, 57.966954384675773326, 77.497741111539653502, 53.453633788216393441, + 35.49312912439199863, 12.983429532323498279, 108.23174709890736267, 87.724712496947176987, + 76.167856515210587531, 64.554685145685652969, 46.394136473711114377, 85.356106676892522955, + 48.442350403918680968, 52.485376132299279561, 27.725831170802848646, 86.441858464273536811, + 101.21456111374573084, 87.097736278079537442, 96.877562509496783605, 32.79314382336451672, + 25.245573140346095897, 110.96365201089793118, 62.454077457517996663, 31.778838889764301712, + 3.8901540841470705345, 110.83384973934153095, 103.38563171557325404, 116.40257329184169066, + 32.650729089978995034, 68.405645539776742226, 71.209185958086891333, 12.871897527460532729, + 61.651041611956316046, 62.840210952792403987, 14.787678937562304782, 47.366270181151776342, + 43.844687672921281774, 117.39300618259585463, 118.44154832285494194, 73.116740556626609759, + 34.835097789960855152, 10.944821244567719987, 102.20283912420200068, 5.3687305410130647942, + 108.24901364430843387, 40.61918866913401871, 77.60757244062187965, 27.207272974297666224, + 112.71462790774603491, 27.867799927225860301, 16.769678778076922754, 75.168340417585568503, + 101.74585201591980876, 122.44481216324493289, 48.406835363279242301, 32.751253178081242368, + 119.67183717702937429, 105.11821426656388212, 108.88322613883792656, 9.4950443221387104131, + 82.078206676269473974, 63.165533540643082233, 57.029377404709521215, 24.367628251813584939, + 101.49192401652908302, 38.178890225692157401, 112.19404555223445641, 23.161451065716391895, + 105.32843438928830437, 39.48658950682147406, 9.2130759676656452939, 113.06716073407369549, + 18.435924054450879339, 67.831623623394989409, 26.749017223737610038, 50.314387990569230169, + 122.62124255135495332, 76.24406734470903757, 15.156420140730915591, 112.42483971938781906, + 40.362801806033530738, 32.670405696786474437, 82.284757990255457116, 53.32889191009599017, + 15.951992714217340108, 20.63048733202231233, 3.0771470775725902058, 58.129787006833794294, + 12.794424787556636147, 95.371322496725042583, 19.28536346855253214, 9.7881589807111595292, + 92.04222899369415245, 66.324597572744096396, 110.2189083104240126, 3.3515941403384204023, + 113.39265931958289002, 103.45368711595438072, 79.745823446162830805, 60.353494305680214893, + 123.28457883976079756, 31.12763900903519243, 64.986693073242349783, 108.59301324207990547, + 106.01556850440829294, 82.334966910784714855, 27.053318561589549063, 85.19310484948073281, + 55.16459468112225295, 54.622355302417417988, 41.226780809469346423, 23.464094948340061819, + 55.315426602006482426, 107.28799671613523969, 45.198571777153119911, 80.323084565403405577, + 68.924868120131577598, 75.915043428645731183, 110.87649383022653637, 0.16449705195554997772, + 19.195053287807240849, 93.59215162042164593, 50.532982871336571407, 121.0186532079897006, + 70.22044300183915766, 115.74195114975736942, 43.25391728593967855, 22.642643225895881187, + 64.490173541558760917, 127.85570622804880259, 67.043498317787452834, 111.17783964590853429, + 94.625122217788884882, 34.466134990430873586, 87.462001283689460251, 2.5460454443527851254, + 27.131253736286453204, 20.057284970243927091, 84.389493805792881176, 72.599383773678709986, + 78.23862908300361596, 8.2028846403118222952, 19.095708322332939133, 91.257523433603637386, + 0.38620178544442751445, 18.958186017032858217, 57.288477358615637058, 90.654698508482397301, + 52.130598973843007116, 30.971792528569494607, 80.436400970269460231, 107.54793500350933755, + 112.02673103734559845, 77.393417711646179669, 12.645384478124469751, 107.98875283581583062, + 121.87199305220929091, 3.0314139967704250012, 76.170258048052346567, 62.529193306614615722, + 25.923719091410021065, 77.214496750068065012, 23.759622836107155308, 106.67093858617226942, + 82.878555752224201569, 60.841884102570475079, 70.035506659227394266, 98.331690890852769371, + 115.46886250254465267, 74.608274148013151716, 76.833404179371427745, 116.0440173015849723, + 96.799899806937901303, 61.642706514769088244, 111.91017987576196902, 43.151294197672541486, + 97.982161909571004799, 71.565290162856399547, 68.704884879305609502, 77.307435117392742541, + 90.088207200202305103, 58.439416940007504309, 109.26054324678625562, 5.5446466951325419359, + 47.843610543739487184, 62.536811285881412914, 21.128144266025628895, 85.72692859916787711, + 3.6214004577341256663, 24.38090030379316886, 27.374258450428897049, 99.806059201928292168, + 121.54014182852188242, 95.188525067456794204, 44.143460160401446046, 99.174865108678204706, + 81.001258028205484152, 90.054041174924350344, 67.641186060551262926, 46.321660770121525275, + 51.343911456344358157, 85.315305061350954929, 30.150084362012421479, 16.755716605595807778, + 97.847879117660340853, 26.294686156117677456, 84.265353070761193521, 99.867184273898601532, + 24.380523945441382239, 77.310938187132705934, 116.33742211151547963, 11.901659930186724523, + 104.37205320172870415, 59.818278795613878174, 20.721985827818571124, 75.583008407618763158, + 35.98511117955786176, 11.080280398684408283, 87.81599996875229408, 88.584668287523527397, + 127.47465225305859349, 20.96347871484249481, 20.709115950841805898, 11.398784035220160149, + 63.642248655945877545, 58.126454808909329586, 39.885050240904092789, 4.5124833261979802046, + 91.435134571129310643, 113.08723203475528862, 3.3491378802573308349, 44.570637957131111762, + 88.961358348336943891, 6.6375313253302010708, 123.50331930725587881, 104.64543361480900785, + 32.976386022342921933, 77.524562067334045423, 51.528065303500625305, 29.943250314554461511, + 87.507352222266490571, 24.274894078716897639, 55.727917808522761334, 116.72930461545911385, + 33.121311419221456163, 30.624307587142538978, 79.581913257745327428, 91.943237432151363464, + 63.996388641699013533, 125.69044545745782671, 11.685887675135745667, 117.73129163891280768, + 53.034718805916782003, 125.96561596835817909, 106.63283432167736464, 56.535867517839506036, + 111.17319891633815132, 21.050965816149982857, 12.811565704683744116, 89.916000125918799313, + 119.63542337702165241, 17.240704274656309281, 23.973381537784007378, 12.440852898565935902, + 44.635578559169516666, 40.703350830630370183, 49.133888896074495278, 37.346489860301517183, + 92.564137767814827384, 57.76031379539927002, 34.578490970634447876, 56.356672498193802312, + 55.078714805957133649, 52.987578328647941817, 38.647646376375632826, 16.519090854661044432, + 5.4931748596682155039, 61.506881254554173211, 39.098428582834458211, 21.215168637616443448, + 54.018322489631827921, 112.10309728453285061, 11.269009249255759642, 60.273380687416647561, + 122.89840834543429082, 78.920948789887916064, 80.752895070032536751, 25.983595173343928764, + 62.300213042151881382, 87.881935317316674627, 7.8556069274709443562, 116.44028499041087343, + 35.086195705847785575, 25.529992820062034298, 61.95722389036018285, 21.670386868885543663, + 20.285482989365846151, 19.404951592259749305, 4.8137739285193674732, 16.208111095798813039, + 7.4212133890723634977, 31.043553976462135324, 127.18202307392493822, 126.42536212937557139, + 19.847877310330659384, 31.25130128027376486, 78.609990920165728312, 126.46865077723487047, + 82.202113946517783916, 42.185139788431115448, 86.669746522060449934, 22.381020091663231142, + 57.809434670638438547, 30.895522790473478381, 42.874897115761996247, 41.402659411149215885, + 98.878569119264284382, 122.89718201298455824, 14.767685560287645785, 8.3949934919000952505, + 8.5150509664817946032, 44.500286058420897461, 4.8166680073154566344, 19.07278343652797048, + 97.114783613491454162, 104.65038275558617897, 26.340923988060239935, 79.261218039104278432, + 13.137190416204248322, 97.410546577204513596, 37.207109081809903728, 83.703682094128453173, + 101.29747305838827742, 2.2178937894204864278, 31.116871822316170437, 5.0087323362567985896, + 109.66570970288739773, 25.64715538682139595, 91.938663226261269301, 8.8451307367213303223, + 80.817408976778096985, 39.659478819819923956, 4.7202886767445306759, 81.731643683684524149, + 6.572992794775927905, 89.005866162682650611, 39.942235156526294304, 18.639751113292732043, + 62.378350470451550791, 41.312030478973611025, 117.20650868755183183, 82.699821975555096287, + 7.9737176111593726091, 93.885511134332773509, 99.641187499742954969, 12.571744208136806265, + 100.52831312892158167, 101.53633463179357932, 2.210772438735148171, 16.614067913225881057, + 81.492080980508035282, 107.11233005602116464, 73.782317682136635995, 114.31430434835419874, + 127.96681821438687621, 121.47089164338831324, 109.12276020618082839, 100.97413962565042311, + 24.990638345399929676, 22.72881873789083329, 62.371455419910489582, 115.93390876935518463, + 26.995482223079307005, 106.90726757643278688, 70.98625824878399726, 25.966859064650634537, + 88.463494197818363318, 47.449424993897991953, 24.335713030424813041, 1.1093702913713059388, + 92.788272947425866732, 42.712213353785045911, 96.884700807837361936, 104.97075226459855912, + 55.451662341609335272, 44.8837169285507116, 74.429122227495099651, 46.195472556162712863, + 65.75512501899356721, 65.58628764672903344, 50.491146280695829773, 93.927304021795862354, + 124.90815491503599333, 63.557677779528603423, 7.7803081682977790479, 93.667699478686699877, + 78.771263431150146062, 104.80514658368338132, 65.301458179961628048, 8.8112910795571224298, + 14.418371916173782665, 25.743795054921065457, 123.30208322391263209, 125.68042190558480797, + 29.575357875124609563, 94.732540362303552683, 87.689375345846201526, 106.78601236519534723, + 108.88309664571352187, 18.233481113253219519, 69.670195579921710305, 21.889642489139077952, + 76.405678248404001351, 10.737461082029767567, 88.498027288616867736, 81.238377338271675399, + 27.215144881243759301, 54.414545948598970426, 97.429255815492069814, 55.735599854451720603, + 33.539357556157483486, 22.336680835174774984, 75.491704031843255507, 116.88962432648986578, + 96.813670726558484603, 65.502506356166122714, 111.34367435406238656, 82.236428533131402219, + 89.766452277675853111, 18.990088644281058805, 36.156413352538947947, 126.33106708128616447, + 114.05875480941904243, 48.735256503630807856, 74.983848033058166038, 76.35778045138795278, + 96.388091104468912818, 46.322902131436421769, 82.656868778576608747, 78.973179013642948121, + 18.426151935334928567, 98.134321468147390988, 36.871848108905396657, 7.6632472467899788171, + 53.498034447475220077, 100.62877598114209832, 117.24248510271354462, 24.488134689418075141, + 30.312840281465469161, 96.849679438775638118, 80.725603612067061476, 65.340811393576586852, + 36.569515980510914233, 106.65778382019198034, 31.903985428434680216, 41.26097466404462466, + 6.1542941551451804116, 116.25957401366758859, 25.588849575116910273, 62.742644993450085167, + 38.57072693710506428, 19.576317961425957037, 56.084457987391942879, 4.6491951454918307718, + 92.437816620848025195, 6.7031882806804787833, 98.78531863916941802, 78.907374231912399409, + 31.491646892325661611, 120.70698861136406776, 118.56915767952159513, 62.255278018074022839, + 1.9733861464883375447, 89.186026484163448913, 84.031137008820223855, 36.669933821569429711, + 54.106637123182736104, 42.38620969896146562, 110.3291893622445059, 109.24471060483483598, + 82.453561618938692845, 46.928189896680123638, 110.63085320401660283, 86.575993432270479389, + 90.3971435543098778, 32.646169130810449133, 9.8497362402667931747, 23.830086857295100344, + 93.752987660453072749, 0.32899410391109995544, 38.390106575618119678, 59.18430324084329186, + 101.06596574267678079, 114.03730641598303919, 12.440886003681953298, 103.48390229951473884, + 86.5078345718793571, 45.285286451795400353, 0.98034708312115981244, 127.71141245610124315, + 6.0869966355785436463, 94.355679291820706567, 61.250244435577769764, 68.932269980865385151, + 46.924002567378920503, 5.0920908887055702507, 54.262507472572906408, 40.114569940491492162, + 40.778987611589400331, 17.19876754736105795, 28.477258166007231921, 16.40576928062364459, + 38.191416644669516245, 54.515046867207274772, 0.7724035708888550289, 37.916372034065716434, + 114.5769547172349121, 53.309397016964794602, 104.26119794768601423, 61.943585057142627193, + 32.872801940542558441, 87.095870007022313075, 96.053462074694834882, 26.786835423292359337, + 25.290768956252577482, 87.977505671635299223, 115.74398610441858182, 6.0628279935444879811, + 24.340516096104693133, 125.05838661322923144, 51.847438182823680108, 26.428993500136130024, + 47.519245672217948595, 85.341877172348176828, 37.757111504448403139, 121.68376820514458814, + 12.071013318458426511, 68.663381781709176721, 102.93772500509294332, 21.216548296029941412, + 25.666808358746493468, 104.08803460317358258, 65.599799613875802606, 123.28541302954181447, + 95.82035975152393803, 86.302588395348720951, 67.964323819145647576, 15.130580325716437073, + 9.4097697586148569826, 26.61487023478912306, 52.176414400404610205, 116.8788338800186466, + 90.521086493572511245, 11.089293390265083872, 95.687221087478974368, 125.07362257176282583, + 42.256288532054895768, 43.453857198335754219, 7.2428009154682513326, 48.761800607586337719, + 54.748516900861432077, 71.612118403860222315, 115.08028365704740281, 62.377050134913588408, + 88.286920320806530071, 70.349730217360047391, 34.002516056414606282, 52.108082349852338666, + 7.2823721211025258526, 92.643321540243050549, 102.68782291269235429, 42.630610122701909859, + 60.300168724024842959, 33.511433211195253534, 67.695758235320681706, 52.58937231223899289, + 40.530706141526025021, 71.734368547797203064, 48.761047890886402456, 26.621876374269049847, + 104.67484422303095926, 23.803319860377087025, 80.744106403457408305, 119.63655759122775635, + 41.443971655640780227, 23.166016815237526316, 71.970222359115723521, 22.160560797372454545, + 47.631999937508226139, 49.169336575050692772, 126.94930450611718697, 41.92695742968498962, + 41.418231901683611795, 22.797568070440320298, 127.28449731189175509, 116.25290961781865917, + 79.770100481808185577, 9.024966652399598388, 54.870269142262259265, 98.174464069510577247, + 6.6982757605146616697, 89.141275914265861502, 49.922716696673887782, 13.27506265066404012, + 119.0066386145153956, 81.290867229618015699, 65.952772044689481845, 27.049124134668090846, + 103.05613060700125061, 59.886500629112561001, 47.014704444532981142, 48.549788157433795277, + 111.45583561704916065, 105.45860923091822769, 66.242622838442912325, 61.248615174288715934, + 31.163826515494292835, 55.886474864302726928, 127.99277728340166504, 123.38089091491565341, + 23.371775350275129313, 107.46258327782561537, 106.06943761183720198, 123.93123193671999616, + 85.265668643354729284, 113.07173503568265005, 94.346397832676302642, 42.101931632299965713, + 25.62313140937112621, 51.832000251841236604, 111.27084675404330483, 34.481408549312618561, + 47.946763075568014756, 24.881705797131871805, 89.271157118339033332, 81.406701661260740366, + 98.267777792148990557, 74.692979720606672345, 57.128275535629654769, 115.52062759079854004, + 69.156981941268895753, 112.71334499638760462, 110.1574296119142673, 105.97515665729588363, + 77.295292752751265652, 33.038181709322088864, 10.986349719336431008, 123.01376250910834642, + 78.196857165668916423, 42.430337275232886896, 108.03664497926729382, 96.206194569065701216, + 22.538018498511519283, 120.5467613748369331, 117.79681669087221962, 29.841897579779470107, + 33.505790140065073501, 51.967190346687857527, 124.60042608430740074, 47.763870634633349255, + 15.711213854945526691, 104.88056998082174687, 70.172391411695571151, 51.059985640124068595, + 123.9144477807203657, 43.340773737771087326, 40.570965978731692303, 38.809903184519498609, + 9.6275478570387349464, 32.416222191597626079, 14.842426778144726995, 62.087107952927908627, + 126.36404614785351441, 124.85072425875114277, 39.695754620661318768, 62.502602560551167699, + 29.219981840335094603, 124.93730155447337893, 36.404227893035567831, 84.370279576865868876, + 45.339493044120899867, 44.762040183326462284, 115.61886934127687709, 61.791045580946956761, + 85.749794231523992494, 82.805318822302069748, 69.757138238532206742, 117.79436402596911648, + 29.53537112057529157, 16.789986983800190501, 17.030101932963589206, 89.000572116841794923, + 9.6333360146309132688, 38.145566873059578938, 66.229567226986546302, 81.300765511172357947, + 52.681847976124117849, 30.522436078208556864, 26.274380832412134623, 66.821093154409027193, + 74.414218163623445434, 39.407364188260544324, 74.594946116776554845, 4.4357875788409728557, + 62.233743644632340875, 10.017464672517235158, 91.33141940577479545, 51.29431077364642988, + 55.877326452522538602, 17.690261473446298623, 33.63481795355619397, 79.318957639639847912, + 9.4405773534926993307, 35.463287367369048297, 13.145985589555493789, 50.011732325365301222, + 79.884470313052588608, 37.279502226585464086, 124.75670094090310158, 82.624060957950860029, + 106.41301737510730163, 37.399643951110192575, 15.947435222322383197, 59.771022268669184996, + 71.282374999485909939, 25.143488416277250508, 73.056626257846801309, 75.072669263587158639, + 4.4215448774702963419, 33.228135826455400093, 34.984161961019708542, 86.224660112045967253, + 19.564635364276909968, 100.62860869671203545, 127.93363642877739039, 114.94178328678026446, + 90.24552041236529476, 73.948279251300846227, 49.981276690799859352, 45.457637475781666581, + 124.74291083982461714, 103.86781753871036926, 53.990964446162251988, 85.814535152869211743, + 13.97251649756799452, 51.933718129304907052, 48.926988395636726636, 94.898849987795983907, + 48.671426060849626083, 2.2187405827462498564, 57.576545894851733465, 85.4244267075737298, + 65.76940161567836185, 81.941504529197118245, 110.90332468321867054, 89.767433857105061179, + 20.858244454990199301, 92.390945112329063704, 3.5102500379907723982, 3.1725752934580668807, + 100.98229256139529753, 59.854608043595362687, 121.81630983007198665, 127.11535555905720685, + 15.560616336599196075, 59.335398957377037732, 29.542526862303930102, 81.610293167370400624, + 2.6029163599232560955, 17.62258215911424486, 28.836743832347565331, 51.487590109845768893, + 118.60416644782890216, 123.36084381116961595, 59.150715750252857106, 61.465080724610743346, + 47.378750691696041031, 85.572024730394332437, 89.766193291427043732, 36.466962226510077016, + 11.34039115984342061, 43.779284978281793883, 24.811356496808002703, 21.474922164063173113, + 48.996054577237373451, 34.476754676543350797, 54.430289762487518601, 108.82909189720157883, + 66.858511630984139629, 111.47119970890344121, 67.078715112314966973, 44.673361670353187947, + 22.983408063690148992, 105.77924865298336954, 65.627341453120607184, 3.0050127123358834069, + 94.68734870812841109, 36.472857066266442416, 51.532904555351706222, 37.98017728856211761, + 72.312826705081533873, 124.66213416257596691, 100.11750961883808486, 97.470513007265253691, + 21.967696066119970055, 24.71556090277954354, 64.776182208937825635, 92.645804262876481516, + 37.313737557156855473, 29.946358027285896242, 36.852303870673495112, 68.268642936294781975, + 73.743696217810793314, 15.326494493579957634, 106.99606889495407813, 73.257551962287834613, + 106.48497020542708924, 48.976269378836150281, 60.625680562934576301, 65.699358877554914216, + 33.451207224137760932, 2.6816227871531737037, 73.139031961025466444, 85.315567640383960679, + 63.807970856869360432, 82.52194932808924932, 12.308588310293998802, 104.51914802733517718, + 51.177699150233820546, 125.48528998690017033, 77.141453874210128561, 39.152635922851914074, + 112.16891597478388576, 9.2983902909872995224, 56.875633241696050391, 13.406376561364595545, + 69.570637278342474019, 29.814748463824798819, 62.9832937846549612, 113.41397722273177351, + 109.13831535904319026, 124.51055603614804568, 3.9467722929803130683, 50.372052968330535805, + 40.06227401764044771, 73.339867643138859421, 108.21327424636547221, 84.772419397926569218, + 92.658378724492649781, 90.489421209673309932, 36.907123237877385691, 93.856379793363885256, + 93.261706408036843641, 45.151986864544596756, 52.7942871086197556, 65.292338261620898265, + 19.699472480533586349, 47.660173714593838667, 59.505975320906145498, 0.65798820782219991088, + 76.780213151236239355, 118.3686064816902217, 74.131931485357199563, 100.07461283196607837, + 24.881772007367544575, 78.967804599033115664, 45.015669143758714199, 90.570572903590800706, + 1.9606941662459576037, 127.4228249122024863, 12.173993271160725271, 60.711358583641413134, + 122.50048887115917751, 9.8645399617307703011, 93.848005134757841006, 10.184181777411140501, + 108.52501494514581282, 80.229139880982984323, 81.557975223178800661, 34.3975350947221159, + 56.954516332014463842, 32.811538561247289181, 76.38283328933903249, 109.03009373441454954, + 1.5448071417777100578, 75.832744068135070847, 101.15390943446982419, 106.61879403393322718, + 80.522395895372028463, 123.88717011428525439, 65.745603881088754861, 46.191740014048264129, + 64.106924149389669765, 53.573670846584718674, 50.581537912508792942, 47.955011343274236424, + 103.48797220883716363, 12.125655987088975962, 48.681032192213024246, 122.11677322645846289, + 103.69487636564736022, 52.857987000272260047, 95.038491344439535169, 42.683754344696353655, + 75.514223008900444256, 115.36753641028917627, 24.142026636920491001, 9.3267635634219914209, + 77.87545001018588664, 42.433096592059882823, 51.333616717496624915, 80.176069206350803142, + 3.1995992277552431915, 118.57082605908726691, 63.640719503051514039, 44.605176790701079881, + 7.9286476382912951522, 30.261160651432874147, 18.819539517229713965, 53.22974046957824612, + 104.35282880081285839, 105.75766776004093117, 53.042172987145022489, 22.178586780533805722, + 63.374442174961586716, 122.14724514352565166, 84.512577064109791536, 86.907714396671508439, + 14.485601830936502665, 97.523601215172675438, 109.49703380172650213, 15.22423680772408261, + 102.16056731409480562, 124.7541002698308148, 48.573840641616698122, 12.699460434720094781, + 68.005032112829212565, 104.21616469970467733, 14.564744242208689684, 57.286643080489739077, + 77.375645825384708587, 85.261220245403819717, 120.60033744804968592, 67.022866422394145047, + 7.3915164706413634121, 105.17874462447798578, 81.061412283055688022, 15.468737095594406128, + 97.522095781772804912, 53.243752748541737674, 81.349688446061918512, 47.606639720757812029, + 33.488212806918454589, 111.2731151824555127, 82.887943311281560455, 46.332033630478690611, + 15.940444718231447041, 44.321121594744909089, 95.263999875016452279, 98.338673150105023524, + 125.89860901223437395, 83.85391485936997924, 82.836463803367223591, 45.595136140884278575, + 126.56899462378714816, 104.50581923564095632, 31.540200963616371155, 18.049933304799196776, + 109.74053828452815651, 68.348928139021154493, 13.396551521032961318, 50.282551828531723004, + 99.845433393347775564, 26.550125301331718219, 110.01327722903442918, 34.581734459239669377, + 3.9055440893789636903, 54.098248269339819672, 78.11226121400250122, 119.773001258225122, + 94.029408889065962285, 97.099576314871228533, 94.911671234101959271, 82.917218461840093369, + 4.4852456768858246505, 122.49723034857743187, 62.32765303098858567, 111.77294972860909184, + 127.98555456680696807, 118.76178182983130682, 46.743550700553896604, 86.925166555654868716, + 84.138875223678041948, 119.86246387344363029, 42.531337286713096546, 98.143470071368938079, + 60.692795665352605283, 84.203863264599931426, 51.246262818742252421, 103.66400050368611119, + 94.541693508086609654, 68.962817098625237122, 95.893526151136029512, 49.763411594267381588, + 50.542314236681704642, 34.81340332252511871, 68.535555584301619092, 21.385959441213344689, + 114.25655107126294752, 103.04125518160071806, 10.313963882541429484, 97.426689992778847227, + 92.314859223832172574, 83.950313314595405245, 26.590585505502531305, 66.076363418644177727, + 21.972699438676499994, 118.02752501822033082, 28.393714331337832846, 84.86067455046941177, + 88.073289958538225619, 64.412389138131402433, 45.076036997026676545, 113.09352274967750418, + 107.59363338174443925, 59.683795159558940213, 67.011580280130147003, 103.93438069337935303, + 121.20085216861480149, 95.527741269266698509, 31.422427709894691361, 81.761139961647131713, + 12.344782823391142301, 102.11997128025177517, 119.8288955614407314, 86.681547475542174652, + 81.141931957463384606, 77.619806369038997218, 19.255095714077469893, 64.832444383195252158, + 29.684853556289453991, 124.17421590585945523, 124.7280922957106668, 121.70144851750228554, + 79.391509241322637536, 125.0052051211023354, 58.439963680673827184, 121.87460310894675786, + 72.808455786074773641, 40.740559153731737752, 90.678986088241799735, 89.524080366656562546, + 103.23773868255375419, 123.5820911618975515, 43.499588463051622966, 37.610637644607777474, + 11.514276477068051463, 107.58872805193823297, 59.070742241150583141, 33.579973967600381002, + 34.060203865930816391, 50.001144233683589846, 19.266672029261826538, 76.291133746122795856, + 4.4591344539767305832, 34.601531022344715893, 105.3636959522482357, 61.044872156417113729, + 52.548761664827907225, 5.6421863088216923643, 20.828436327246890869, 78.814728376524726627, + 21.189892233553109691, 8.8715751576819457114, 124.46748728926468175, 20.034929345038108295, + 54.662838811549590901, 102.58862154729285976, 111.7546529050450772, 35.380522946892597247, + 67.269635907116025919, 30.637915279279695824, 18.881154706985398661, 70.926574734738096595, + 26.291971179110987578, 100.02346465073424042, 31.768940626105177216, 74.559004453170928173, + 121.51340188180984114, 37.248121915905358037, 84.826034750214603264, 74.799287902220385149, + 31.894870444644766394, 119.54204453734200797, 14.564749998971819878, 50.286976832558138995, + 18.113252515697240597, 22.145338527174317278, 8.8430897549405926839, 66.456271652910800185, + 69.968323922043055063, 44.449320224091934506, 39.129270728557457915, 73.257217393427708885, + 127.86727285755841876, 101.8835665735641669, 52.491040824734227499, 19.896558502601692453, + 99.962553381599718705, 90.91527495156697114, 121.48582167965287226, 79.735635077420738526, + 107.98192889232814196, 43.629070305738423485, 27.94503299513598904, 103.8674362586098141, + 97.853976791277091252, 61.797699975591967814, 97.342852121699252166, 4.4374811654924997129, + 115.15309178970710491, 42.848853415151097579, 3.5388032313603616785, 35.883009058397874469, + 93.806649366440979065, 51.534867714210122358, 41.716488909984036582, 56.781890224658127408, + 7.0205000759815447964, 6.3451505869197717402, 73.964585122790595051, 119.70921608719436335, + 115.63261966014761128, 126.23071111811441369, 31.121232673198392149, 118.67079791475407546, + 59.085053724611498183, 35.220586334740801249, 5.205832719846512191, 35.245164318228489719, + 57.673487664695130661, 102.97518021969517577, 109.20833289566144231, 118.72168762233923189, + 118.30143150050571421, 122.93016144922148669, 94.75750138339572004, 43.144049460792302852, + 51.532386582854087465, 72.933924453020154033, 22.68078231968684122, 87.558569956563587766, + 49.622712993616005406, 42.949844328126346227, 97.992109154474746902, 68.953509353086701594, + 108.86057952497867518, 89.658183794406795641, 5.7170232619719172362, 94.94239941781052039, + 6.1574302246299339458, 89.346723340706375893, 45.966816127383935964, 83.558497305970377056, + 3.2546829062412143685, 6.0100254246754047927, 61.37469741625682218, 72.945714132532884832, + 103.06580911070341244, 75.960354577127873199, 16.625653410166705726, 121.3242683251555718, + 72.235019237679807702, 66.941026014530507382, 43.935392132239940111, 49.431121805562725058, + 1.552364417879289249, 57.291608525752963033, 74.627475114313710947, 59.892716054571792483, + 73.704607741350628203, 8.5372858725932019297, 19.487392435621586628, 30.652988987163553247, + 85.992137789911794243, 18.515103924579307204, 84.969940410854178481, 97.952538757672300562, + 121.25136112587279058, 3.3987177551098284312, 66.902414448275521863, 5.3632455743099853862, + 18.278063922054570867, 42.631135280767921358, 127.61594171374235884, 37.043898656178498641, + 24.617176620591635583, 81.038296054670354351, 102.35539830047127907, 122.97057997380397865, + 26.282907748420257121, 78.305271845707466127, 96.337831949567771517, 18.596780581974599045, + 113.75126648339210078, 26.81275312273282907, 11.141274556684948038, 59.629496927649597637, + 125.96658756931356038, 98.827954445467184996, 90.27663071809001849, 121.02111207229609136, + 7.8935445859606261365, 100.74410593666107161, 80.124548035284533398, 18.679735286281356821, + 88.426548492734582396, 41.544838795856776414, 57.31675744898893754, 52.978842419346619863, + 73.81424647575840936, 59.71275958673140849, 58.523412816073687281, 90.303973729089193512, + 105.58857421724314918, 2.5846765232417965308, 39.398944961067172699, 95.320347429187677335, + 119.011950641812291, 1.3159764156480378006, 25.560426302476116689, 108.73721296338408138, + 20.263862970718037104, 72.149225663932156749, 49.763544014738727128, 29.935609198066231329, + 90.031338287521066377, 53.141145807181601413, 3.9213883324955531862, 126.84564982440497261, + 24.347986542321450543, 121.42271716728646425, 117.00097774231835501, 19.729079923465178581, + 59.696010269515682012, 20.368363554825918982, 89.050029890295263613, 32.458279761969606625, + 35.115950446357601322, 68.795070189444231801, 113.90903266402892768, 65.62307712249821634, + 24.765666578681702958, 90.060187468829099089, 3.0896142835590580944, 23.665488136273779674, + 74.307818868943286361, 85.237588067870092345, 33.044791790747694904, 119.77434022857414675, + 3.4912077621775097214, 92.383480028100166237, 0.21384829877933952957, 107.14734169316943735, + 101.16307582501758588, 95.910022686552110827, 78.975944417674327269, 24.251311974177951925, + 97.36206438442968647, 116.23354645292056375, 79.389752731294720434, 105.71597400054815807, + 62.076982688879070338, 85.367508689396345289, 23.028446017804526491, 102.73507282057835255, + 48.284053273840982001, 18.653527126847620821, 27.75090002037177328, 84.866193184119765647, + 102.66723343499688781, 32.352138412701606285, 6.3991984555141243618, 109.14165211817453383, + 127.28143900610302808, 89.210353581402159762, 15.857295276582590304, 60.522321302865748294, + 37.63907903445942793, 106.45948093916013022, 80.705657601629354758, 83.515335520081862342, + 106.08434597429004498, 44.357173561067611445, 126.74888434992681141, 116.29449028705494129, + 41.025154128223221051, 45.815428793343016878, 28.971203661876643309, 67.047202430348988855, + 90.994067603453004267, 30.448473615451803198, 76.321134628193249227, 121.50820053966162959, + 97.147681283233396243, 25.398920869443827542, 8.0100642256620631088, 80.432329399409354664, + 29.129488484417379368, 114.57328616098311613, 26.751291650773055153, 42.522440490811277414, + 113.20067489610300981, 6.0457328447882900946, 14.783032941286364803, 82.35748924895960954, + 34.122824566111376043, 30.937474191192450235, 67.044191563545609824, 106.48750549708711333, + 34.699376892123837024, 95.213279441515624058, 66.976425613840547157, 94.546230364914663369, + 37.775886622563120909, 92.664067260957381222, 31.880889436462894082, 88.642243189493456157, + 62.527999750036542537, 68.677346300213685026, 123.79721802447238588, 39.707829718743596459, + 37.672927606734447181, 91.190272281772195129, 125.13798924757793429, 81.011638471281912643, + 63.08040192723274231, 36.099866609602031531, 91.481076569059950998, 8.6978562780423089862, + 26.793103042065922637, 100.56510365706708399, 71.690866786695551127, 53.100250602667074418, + 92.026554458068858366, 69.163468918479338754, 7.8110881787579273805, 108.19649653868327732, + 28.224522428008640418, 111.54600251645388198, 60.058817778135562548, 66.199152629746095045, + 61.823342468207556522, 37.834436923680186737, 8.9704913537752872799, 116.99446069715486374, + 124.65530606198080932, 95.545899457221821649, 127.97110913361757412, 109.52356365966261365, + 93.487101401111431187, 45.850333111313375412, 40.277750447359721875, 111.72492774688726058, + 85.062674573429831071, 68.286940142737876158, 121.38559133070884855, 40.407726529199862853, + 102.49252563748814282, 79.328001007375860354, 61.083387016176857287, 9.9256341972541122232, + 63.787052302272059023, 99.526823188534763176, 101.08462847336340928, 69.6268066450538754, + 9.071111168603238184, 42.771918882430327358, 100.51310214252953301, 78.082510363201436121, + 20.627927765086496947, 66.853379985561332433, 56.629718447667983128, 39.90062662919081049, + 53.181171011008700589, 4.1527268372883554548, 43.945398877356637968, 108.05505003644066164, + 56.78742866267930367, 41.721349100942461519, 48.146579917080089217, 0.82477827626280486584, + 90.152073994056991069, 98.187045499358646339, 87.187266763488878496, 119.36759031912151841, + 6.0231605602639319841, 79.868761386762344046, 114.40170433723324095, 63.055482538533397019, + 62.844855419793020701, 35.522279923294263426, 24.689565646785922581, 76.239942560507188318, + 111.65779112288510078, 45.363094951087987283, 34.283863914930407191, 27.239612738077994436, + 38.510191428158577764, 1.6648887663905043155, 59.36970711258254596, 120.34843181172254845, + 121.45618459142497159, 115.40289703500820906, 30.78301848264891305, 122.01041024220467079, + 116.87992736135129235, 115.74920621789715369, 17.616911572149547283, 81.481118307467113482, + 53.357972176487237448, 51.048160733316763071, 78.475477365111146355, 119.164182323795103, + 86.999176926103245933, 75.221275289215554949, 23.028552954139740905, 87.177456103876465932, + 118.14148448230116628, 67.159947935200762004, 68.120407731861632783, 100.00228846736717969, + 38.533344058527291054, 24.582267492245591711, 8.9182689079534611665, 69.203062044693069765, + 82.727391904496471398, 122.08974431283422746, 105.09752332965581445, 11.284372617643384729, + 41.656872654497419717, 29.629456753049453255, 42.379784467106219381, 17.743150315367529402, + 120.9349745785293635, 40.06985869007621659, 109.32567762310281978, 77.177243094589357497, + 95.509305810090154409, 70.761045893788832473, 6.5392718142320518382, 61.275830558559391648, + 37.762309413974435301, 13.85314946947619319, 52.583942358225613134, 72.046929301468480844, + 63.537881252213992411, 21.118008906345494324, 115.02680376361968229, 74.496243831814354053, + 41.652069500432844507, 21.598575804440770298, 63.789740889293170767, 111.08408907468401594, + 29.129499997943639755, 100.57395366511627799, 36.226505031394481193, 44.290677054348634556, + 17.686179509884823347, 4.9125433058252383489, 11.936647844086110126, 88.898640448183869012, + 78.258541457118553808, 18.514434786859055748, 127.73454571512047551, 75.767133147128333803, + 104.982081649468455, 39.793117005207022885, 71.925106763203075388, 53.830549903137580259, + 114.9716433593093825, 31.47127015484511503, 87.963857784656283911, 87.258140611476846971, + 55.890065990275616059, 79.734872517223266186, 67.707953582554182503, 123.59539995118757361, + 66.685704243398504332, 8.8749623309886374045, 102.30618357941420982, 85.697706830302195158, + 7.0776064627207233571, 71.766018116799386917, 59.613298732881958131, 103.06973542842024472, + 83.432977819968073163, 113.56378044931625482, 14.041000151963089593, 12.690301173843181459, + 19.929170245584828081, 111.41843217439236469, 103.26523932029886055, 124.46142223622882739, + 62.242465346400422277, 109.34159582950815093, 118.17010744922299637, 70.441172669481602497, + 10.411665439693024382, 70.490328636456979439, 115.3469753293938993, 77.950360439393989509, + 90.416665791326522594, 109.44337524468210177, 108.6028630010150664, 117.86032289844661136, + 61.515002766791440081, 86.288098921584605705, 103.06477316571181291, 17.867848906040308066, + 45.361564639377320418, 47.117139913127175532, 99.245425987232010812, 85.899688656256330432, + 67.984218308953131782, 9.9070187061770411674, 89.721159049960988341, 51.316367588813591283, + 11.434046523947472451, 61.88479883562104078, 12.31486044926350587, 50.693446681412751786, + 91.933632254771509906, 39.116994611940754112, 6.509365812482428737, 12.020050849350809585, + 122.74939483251728234, 17.891428265069407644, 78.131618221410462866, 23.920709154255746398, + 33.25130682033704943, 114.64853665031478158, 16.470038475363253383, 5.882052029061014764, + 87.870784264479880221, 98.862243611125450116, 3.1047288357585784979, 114.58321705150956404, + 21.254950228627421893, 119.78543210914722295, 19.409215482701256406, 17.074571745186403859, + 38.974784871243173257, 61.305977974330744473, 43.984275579823588487, 37.030207849162252387, + 41.93988082171199494, 67.905077515348239103, 114.50272225174558116, 6.7974355102232948411, + 5.8048288965510437265, 10.726491148619970772, 36.556127844109141733, 85.262270561539480696, + 127.23188342748471769, 74.087797312356997281, 49.234353241186909145, 34.076592109344346682, + 76.710796600946196122, 117.94115994760795729, 52.565815496844152221, 28.610543691418570234, + 64.675663899135543033, 37.193561163952836068, 99.502532966784201562, 53.625506245465658139, + 22.282549113369896077, 119.25899385530283325, 123.93317513863075874, 69.655908890938007971, + 52.553261436183674959, 114.04222414459218271, 15.787089171924890252, 73.488211873325781198, + 32.249096070569066796, 37.35947057256635162, 48.853096985469164792, 83.089677591713552829, + 114.63351489797787508, 105.9576848386968777, 19.628492951516818721, 119.42551917346281698, + 117.04682563215101254, 52.607947458182025002, 83.177148434486298356, 5.1693530464835930616, + 78.797889922137983376, 62.640694858378992649, 110.02390128362458199, 2.6319528312960756011, + 51.120852604955871357, 89.474425926768162753, 40.527725941439712187, 16.298451327864313498, + 99.527088029477454256, 59.871218396136100637, 52.062676575042132754, 106.28229161436320283, + 7.8427766649947443511, 125.69129964880994521, 48.695973084646539064, 114.84543433457656647, + 106.00195548463671003, 39.458159846930357162, 119.39202053903136402, 40.736727109655475942, + 50.100059780590527225, 64.91655952393921325, 70.231900892718840623, 9.5901403788921015803, + 99.818065328061493346, 3.2461542449964326806, 49.531333157367043896, 52.120374937658198178, + 6.1792285671181161888, 47.330976272551197326, 20.615637737890210701, 42.475176135740184691, + 66.089583581499027787, 111.5486804571482935, 6.9824155243586574215, 56.766960056200332474, + 0.42769659756231703795, 86.294683386342512676, 74.326151650038809748, 63.820045373107859632, + 29.951888835348654538, 48.502623948359541828, 66.724128768863010919, 104.46709290584476548, + 30.779505462593078846, 83.431948001096316148, 124.15396537776177865, 42.735017378792690579, + 46.056892035612690961, 77.470145641156705096, 96.568106547681964003, 37.307054253695241641, + 55.501800040747184539, 41.732386368243169272, 77.334466869993775617, 64.70427682540321257, + 12.798396911031886702, 90.28330423635270563, 126.56287801220969413, 50.420707162804319523, + 31.714590553165180609, 121.04464260573149659, 75.27815806892249384, 84.918961878323898418, + 33.411315203262347495, 39.030671040167362662, 84.168691948580089957, 88.714347122138860868, + 125.4977686998572608, 104.58898057410988258, 82.050308256446442101, 91.630857586686033756, + 57.942407323756924598, 6.0944048607016156893, 53.988135206906008534, 60.896947230907244375, + 24.642269256390136434, 115.01640107932689716, 66.295362566466792487, 50.797841738887655083, + 16.020128451327764196, 32.864658798818709329, 58.258976968838396715, 101.14657232196623227, + 53.502583301546110306, 85.044880981626192806, 98.401349792206019629, 12.091465689576580189, + 29.566065882576367585, 36.71497849791921908, 68.245649132222752087, 61.874948382388538448, + 6.0883831270948576275, 84.975010994174226653, 69.398753784251312027, 62.426558883034886094, + 5.9528512276847322937, 61.092460729829326738, 75.551773245129879797, 57.328134521914762445, + 63.761778872929426143, 49.284486378986912314, 125.05599950007672305, 9.3546926004310080316, + 119.59443604894477176, 79.415659437487192918, 75.345855213472532341, 54.380544563548028236, + 122.27597849515950656, 34.023276942563825287, 126.16080385446548462, 72.19973321920770104, + 54.962153138119901996, 17.395712556084617972, 53.586206084135483252, 73.130207314137805952, + 15.381733573391102254, 106.20050120533778681, 56.053108916141354712, 10.326937836958677508, + 15.62217635751949274, 88.392993077366554644, 56.449044856020918814, 95.092005032907763962, + 120.11763555627476308, 4.3983052594921900891, 123.64668493641511304, 75.668873847360373475, + 17.940982707554212539, 105.98892139431336545, 121.31061212396525661, 63.091798914447281277, + 127.94221826723878621, 91.047127319328865269, 58.974202802222862374, 91.700666222626750823, + 80.555500894723081728, 95.449855493778159143, 42.12534914686330012, 8.5738802854793902952, + 114.77118266141769709, 80.815453058403363684, 76.985051274979923619, 30.656002014751720708, + 122.16677403235371457, 19.851268394508224446, 127.57410460454775603, 71.053646377073164331, + 74.169256946730456548, 11.2536132901077508, 18.142222337206476368, 85.543837764864292694, + 73.026204285062704002, 28.165020726402872242, 41.255855530176631873, 5.7067599711226648651, + 113.25943689533596626, 79.801253258381620981, 106.36234202201740118, 8.3054536745767109096, + 87.890797754716913914, 88.110100072881323285, 113.57485732535860734, 83.442698201884923037, + 96.293159834160178434, 1.6495565525292477105, 52.304147988117620116, 68.374090998720930656, + 46.374533526981394971, 110.73518063824303681, 12.046321120531501947, 31.73752277352832607, + 100.8034086744664819, 126.11096507706679404, 125.6897108395860414, 71.044559846588526852, + 49.379131293575483141, 24.479885121018014615, 95.315582245770201553, 90.726189902175974566, + 68.567727829860814381, 54.479225476155988872, 77.020382856317155529, 3.329777532781008631, + 118.7394142251687299, 112.69686362344873487, 114.91236918285358115, 102.80579407001641812, + 61.566036965301464079, 116.02082048441297957, 105.75985472270622267, 103.49841243579430738, + 35.233823144302732544, 34.962236614934226964, 106.7159443529744749, 102.09632146663716412, + 28.950954730225930689, 110.32836464759384398, 45.998353852210129844, 22.442550578431109898, + 46.057105908283119788, 46.354912207756569842, 108.28296896460597054, 6.3198958704051619861, + 8.2408154637269035447, 72.004576934734359384, 77.066688117054582108, 49.164534984491183423, + 17.836537815910560312, 10.406124089389777509, 37.454783808996580774, 116.17948862567209289, + 82.1950466593116289, 22.568745235286769457, 83.313745308994839434, 59.25891350609890651, + 84.759568934212438762, 35.486300630738696782, 113.869949157058727, 80.139717380156071158, + 90.651355246209277539, 26.354486189182352973, 63.018611620183946798, 13.522091787577664945, + 13.078543628464103676, 122.5516611171187833, 75.524618827948870603, 27.706298938952386379, + 105.16788471645486425, 16.093858602936961688, 127.07576250442798482, 42.236017812694626627, + 102.05360752724300255, 20.992487663628708106, 83.304139000865689013, 43.197151608881540596, + 127.57948177858997951, 94.168178149368031882, 58.258999995890917489, 73.147907330232555978, + 72.453010062788962387, 88.581354108697269112, 35.372359019769646693, 9.8250866116504766978, + 23.873295688175858231, 49.797280896371376002, 28.517082914237107616, 37.028869573721749475, + 127.46909143024458899, 23.534266294260305585, 81.964163298936909996, 79.586234010417683749, + 15.850213526406150777, 107.6610998062787985, 101.94328671861876501, 62.942540309693868039, + 47.927715569316205801, 46.516281222953693941, 111.7801319805548701, 31.469745034450170351, + 7.4159071651120029856, 119.19079990237878519, 5.3714084867970086634, 17.749924661980912788, + 76.612367158832057612, 43.395413660604390316, 14.155212925445084693, 15.532036233598773833, + 119.22659746576755424, 78.139470856844127411, 38.865955639939784305, 99.127560898632509634, + 28.082000303926179186, 25.380602347686362918, 39.85834049117329414, 94.836864348788367352, + 78.530478640601359075, 120.92284447245765477, 124.48493069280448253, 90.683191659019939834, + 108.34021489844963071, 12.882345338963204995, 20.823330879389686743, 12.980657272917596856, + 102.69395065879143658, 27.900720878791616997, 52.833331582656683167, 90.88675048936784151, + 89.205726002033770783, 107.72064579689322272, 123.03000553358651814, 44.576197843172849389, + 78.129546331423625816, 35.735697812080616131, 90.723129278754640836, 94.234279826257989043, + 70.490851974467659602, 43.799377312516298844, 7.9684366179062635638, 19.814037412357720314, + 51.442318099921976682, 102.63273517762718257, 22.868093047894944903, 123.76959767124208156, + 24.629720898527011741, 101.38689336282914155, 55.867264509543019813, 78.233989223881508224, + 13.018731624964857474, 24.040101698705257149, 117.49878966503456468, 35.782856530142453266, + 28.263236442820925731, 47.841418308511492796, 66.502613640677736839, 101.29707330062956316, + 32.940076950726506766, 11.764104058125667507, 47.741568528963398421, 69.724487222250900231, + 6.2094576715207949746, 101.16643410301912809, 42.509900457258481765, 111.57086421829444589, + 38.818430965402512811, 34.149143490372807719, 77.949569742486346513, 122.61195594866148895, + 87.968551159647176974, 74.060415698324504774, 83.87976164342762786, 7.8101550307001161855, + 101.00544450349116232, 13.594871020446589682, 11.609657793102087453, 21.452982297239941545, + 73.112255688221921446, 42.52454112308259937, 126.46376685497307335, 20.175594624713994563, + 98.468706482373818289, 68.153184218692331342, 25.421593201896030223, 107.88231989521591458, + 105.13163099368830444, 57.221087382840778446, 1.351327798271086067, 74.387122327909310116, + 71.005065933568403125, 107.25101249093131628, 44.565098226743430132, 110.51798771060930449, + 119.86635027726515546, 11.311817781876015943, 105.1065228723709879, 100.08444828918436542, + 31.574178343853418482, 18.976423746651562396, 64.498192141138133593, 74.718941145132703241, + 97.706193970941967564, 38.179355183430743637, 101.26702979595938814, 83.91536967739375541, + 39.256985903037275421, 110.85103834692927194, 106.09365126430202508, 105.21589491636768798, + 38.354296868972596712, 10.338706092970824102, 29.595779844275966752, 125.28138971676162328, + 92.047802567249163985, 5.2639056625921512023, 102.24170520991538069, 50.948851853536325507, + 81.055451882879424375, 32.596902655732264975, 71.054176058954908513, 119.74243679227220127, + 104.12535315008790349, 84.56458322872640565, 15.685553329993126681, 123.38259929761989042, + 97.391946169296716107, 101.69086866915677092, 84.003910969273420051, 78.916319693864352303, + 110.78404107806272805, 81.473454219310951885, 100.20011956118469243, 1.8331190478820644785, + 12.463801785437681247, 19.180280757787841139, 71.636130656122986693, 6.4923084899928653613, + 99.062666314734087791, 104.24074987531639636, 12.358457134236232378, 94.661952545102394652, + 41.231275475780421402, 84.95035227148400736, 4.1791671630016935524, 95.097360914296586998, + 13.964831048717314843, 113.53392011240066495, 0.85539319512827205472, 44.589366772688663332, + 20.652303300077619497, 127.64009074621571926, 59.903777670697309077, 97.005247896722721634, + 5.4482575377296598163, 80.934185811689530965, 61.559010925189795671, 38.863896002196270274, + 120.30793075552355731, 85.470034757585381158, 92.113784071229019901, 26.940291282317048172, + 65.136213095363928005, 74.614108507390483283, 111.00360008149436908, 83.464772736489976523, + 26.668933739991189213, 1.4085536508064251393, 25.596793822067411384, 52.566608472709049238, + 125.12575602441938827, 100.84141432560863905, 63.429181106333999196, 114.08928521146663115, + 22.556316137848625658, 41.837923756647796836, 66.82263040652469499, 78.061342080338363303, + 40.337383897163817892, 49.428694244281359715, 122.99553739971815958, 81.177961148223403143, + 36.100616512896522181, 55.261715173372067511, 115.8848146475138492, 12.188809721403231379, + 107.97627041381201707, 121.79389446181448875, 49.284538512783910846, 102.0328021586574323, + 4.5907251329335849732, 101.59568347777531017, 32.040256902655528393, 65.729317597637418658, + 116.51795393768043141, 74.293144643932464533, 107.00516660309585859, 42.089761963256023591, + 68.802699584412039258, 24.182931379153160378, 59.13213176515273517, 73.42995699584207614, + 8.4912982644455041736, 123.7498967647770769, 12.176766254193353234, 41.950021988352091284, + 10.797507568502624054, 124.85311776606977219, 11.905702455369464587, 122.18492145966229145, + 23.103546490259759594, 114.65626904382952489, 127.52355774585885229, 98.568972757977462607, + 122.1119990001534461, 18.709385200865654042, 111.18887209789318149, 30.831318874978023814, + 22.691710426945064683, 108.76108912709969445, 116.55195699031901313, 68.046553885131288553, + 124.32160770893460722, 16.399466438415402081, 109.92430627623980399, 34.791425112169235945, + 107.17241216827460448, 18.260414628275611904, 30.763467146785842488, 84.401002410675573628, + 112.10621783228270942, 20.653875673917355016, 31.244352715042623458, 48.785986154733109288, + 112.89808971204547561, 62.184010065819165902, 112.23527111254952615, 8.796610518988018157, + 119.29336987283386406, 23.337747694720746949, 35.881965415112063056, 83.977842788630368887, + 114.62122424793051323, 126.18359782889820053, 127.8844365344812104, 54.094254638657730538, + 117.94840560444936273, 55.401332445257139625, 33.111001789449801436, 62.899710987556318287, + 84.250698293726600241, 17.147760570962418569, 101.54236532283903216, 33.630906116810365347, + 25.970102549959847238, 61.312004029507079395, 116.33354806470742915, 39.702536789020086871, + 127.14820920909915003, 14.10729275414996664, 20.338513893460913096, 22.507226580215501599, + 36.284444674416590715, 43.087675529732223367, 18.052408570125408005, 56.330041452805744484, + 82.511711060353263747, 11.413519942248967709, 98.51887379067557049, 31.60250651676687994, + 84.724684044034802355, 16.610907349157059798, 47.781595509437465807, 48.22020014576628455, + 99.14971465072085266, 38.885396403773484053, 64.586319668320356868, 3.299113105058495421, + 104.60829597623887821, 8.7481819974418613128, 92.74906705396642792, 93.470361276486073621, + 24.092642241063003894, 63.475045547060290119, 73.606817348936601775, 124.22193015413722605, + 123.37942167917572078, 14.089119693177053705, 98.758262587150966283, 48.95977024203966721, + 62.631164491544041084, 53.452379804355587112, 9.1354556597216287628, 108.95845095231561572, + 26.040765712634311058, 6.6595550655656552408, 109.47882845034109778, 97.393727246901107719, + 101.82473836571080028, 77.611588140032836236, 123.13207393060656614, 104.04164096882959711, + 83.519709445416083327, 78.996824871588614769, 70.467646288605465088, 69.924473229872091906, + 85.43188870595258777, 76.192642933274328243, 57.901909460455499357, 92.656729295187687967, + 91.996707704420259688, 44.885101156862219796, 92.114211816566239577, 92.709824415516777663, + 88.565937929211941082, 12.639791740810323972, 16.481630927457445068, 16.009153869472356746, + 26.133376234109164216, 98.329069968982366845, 35.673075631821120623, 20.812248178779555019, + 74.909567617996799527, 104.35897725134782377, 36.390093318623257801, 45.137490470577176893, + 38.627490617989678867, 118.517827012201451, 41.519137868424877524, 70.972601261481031543, + 99.739898314121091971, 32.279434760315780295, 53.302710492418555077, 52.708972378364705946, + 126.0372232403678936, 27.044183575155329891, 26.157087256931845332, 117.10332223424120457, + 23.049237655897741206, 55.412597877908410737, 82.335769432909728494, 32.187717205877561355, + 126.15152500885596965, 84.472035625392891234, 76.107215054486005101, 41.98497532726105419, + 38.608278001731378026, 86.394303217766719172, 127.158963557183597, 60.336356298736063763, + 116.51799999178547296, 18.295814660468749935, 16.906020125581562752, 49.162708217394538224, + 70.744718039539293386, 19.650173223300953396, 47.746591376351716463, 99.594561792742752004, + 57.034165828474215232, 74.057739147447136929, 126.93818286048917798, 47.068532588524249149, + 35.928326597877457971, 31.172468020835367497, 31.700427052815939533, 87.322199612561234972, + 75.886573437237530015, 125.88508061938773608, 95.855431138632411603, 93.032562445911025861, + 95.560263961109740194, 62.939490068900340702, 14.83181433022764395, 110.38159980475757038, + 10.742816973594017327, 35.499849323965463554, 25.224734317664115224, 86.790827321208780631, + 28.310425850890169386, 31.064072467201185646, 110.45319493153874646, 28.278941713688254822, + 77.731911279883206589, 70.255121797265019268, 56.164000607852358371, 50.761204695372725837, + 79.716680982350226259, 61.673728697580372682, 29.060957281206356129, 113.84568894491894753, + 120.96986138561260304, 53.366383318043517647, 88.680429796899261419, 25.76469067792640999, + 41.646661758779373486, 25.961314545838831691, 77.387901317582873162, 55.801441757583233994, + 105.66666316531700431, 53.773500978739320999, 50.411452004071179545, 87.441291593790083425, + 118.06001106717303628, 89.152395686349336756, 28.259092662847251631, 71.471395624164870242, + 53.446258557512919651, 60.468559652519616066, 12.981703948935319204, 87.598754625032597687, + 15.936873235812527128, 39.628074824715440627, 102.88463619984759134, 77.265470355254365131, + 45.736186095793527784, 119.53919534248416312, 49.259441797057661461, 74.773786725658283103, + 111.7345290190896776, 28.467978447763016447, 26.037463249929714948, 48.080203397414152278, + 106.99757933006912936, 71.565713060284906533, 56.526472885641851462, 95.682836617026623571, + 5.0052272813591116574, 74.594146601259126328, 65.880153901453013532, 23.528208116251335014, + 95.483137057930434821, 11.448974444501800463, 12.418915343045227928, 74.332868206038256176, + 85.019800914520601509, 95.141728436588891782, 77.636861930805025622, 68.298286980749253416, + 27.899139484976331005, 117.22391189732661587, 47.937102319297991926, 20.120831396652647527, + 39.759523286855255719, 15.62031006140387035, 74.010889006982324645, 27.189742040893179365, + 23.219315586204174906, 42.905964594483521068, 18.224511376443842892, 85.049082246168836718, + 124.9275337099461467, 40.351189249431627104, 68.937412964751274558, 8.3063684373846626841, + 50.843186403795698425, 87.764639790435467148, 82.263261987376608886, 114.44217476568155689, + 2.7026555965458101127, 20.77424465582225821, 14.010131867140444228, 86.502024981862632558, + 89.130196453490498243, 93.03597542122224695, 111.73270055453031091, 22.623635563755669864, + 82.213045744745613774, 72.168896578368730843, 63.148356687706836965, 37.952847493306762772, + 0.99638428227990516461, 21.437882290269044461, 67.412387941883935127, 76.358710366865125252, + 74.534059591922414256, 39.83073935478751082, 78.51397180607818882, 93.702076693862181855, + 84.187302528607688146, 82.431789832735375967, 76.708593737945193425, 20.677412185941648204, + 59.191559688555571483, 122.56277943352688453, 56.095605134498327971, 10.527811325187940383, + 76.483410419830761384, 101.89770370707628899, 34.110903765758848749, 65.193805311468167929, + 14.108352117913455004, 111.48487358454804053, 80.250706300179444952, 41.129166457452811301, + 31.371106659989891341, 118.76519859524341882, 66.783892338597070193, 75.38173733831717982, + 40.00782193855047808, 29.832639387732342584, 93.568082156129094074, 34.946908438625541748, + 72.400239122369384859, 3.6662380957641289569, 24.927603570875362493, 38.360561515579320258, + 15.272261312245973386, 12.984616979989368701, 70.125332629471813561, 80.481499750632792711, + 24.716914268476102734, 61.323905090204789303, 82.462550951564480783, 41.900704542968014721, + 8.3583343260070250835, 62.194721828593173996, 27.929662097438267665, 99.067840224801329896, + 1.7107863902565441094, 89.178733545377326664, 41.304606600158876972, 127.28018149243143853, + 119.80755534139825613, 66.010495793445443269, 10.896515075462957611, 33.86837162337906193, + 123.11802185037959134, 77.727792004396178527, 112.6158615110507526, 42.940069515174400294, + 56.227568142458039802, 53.880582564637734322, 2.272426190731493989, 21.228217014784604544, + 94.007200162992376136, 38.929545472979953047, 53.337867479982378427, 2.8171073016128502786, + 51.193587644134822767, 105.13321694542173645, 122.25151204884241452, 73.682828651217278093, + 126.85836221267163637, 100.17857042293326231, 45.112632275697251316, 83.67584751329923165, + 5.6452608130530279595, 28.122684160676726606, 80.674767794327635784, 98.85738848856635741, + 117.99107479943995713, 34.355922296446806286, 72.201233025793044362, 110.523430346747773, + 103.76962929502769839, 24.377619442810100736, 87.952540827627672115, 115.5877889236289775, + 98.569077025571459671, 76.065604317314864602, 9.1814502658708079252, 75.191366955550620332, + 64.080513805314694764, 3.4586351952784752939, 105.0359078753645008, 20.586289287868567044, + 86.010333206191717181, 84.179523926515685162, 9.6053991688240785152, 48.365862758306320757, + 118.26426353030910832, 18.859913991684152279, 16.982596528894646326, 119.49979352955415379, + 24.353532508386706468, 83.900043976704182569, 21.595015137008886086, 121.70623553213954438, + 23.811404910742567154, 116.36984291932458291, 46.207092980523157166, 101.31253808766268776, + 127.04711549172134255, 69.137945515958563192, 116.22399800030689221, 37.418770401734946063, + 94.37774419578636298, 61.662637749956047628, 45.383420853893767344, 89.522178254203026881, + 105.10391398064166424, 8.0931077702662150841, 120.64321541786921443, 32.798932876834442141, + 91.848612552479607984, 69.582850224342109868, 86.344824336549208965, 36.520829256551223807, + 61.526934293575322954, 40.802004821354785236, 96.212435664565418847, 41.307751347834710032, + 62.488705430085246917, 97.571972309469856555, 97.796179424090951215, 124.36802013164196978, + 96.470542225099052303, 17.593221037979674293, 110.58673974566772813, 46.675495389441493899, + 71.763930830227764091, 39.955685577264375752, 101.24244849586466444, 124.36719565780003904, + 127.7688730689624208, 108.18850927731909906, 107.89681120889872545, 110.80266489051427925, + 66.222003578899602871, 125.79942197511627455, 40.501396587453200482, 34.295521141928475117, + 75.08473064567806432, 67.261812233620730694, 51.940205099919694476, 122.62400805901779677, + 104.6670961294148583, 79.405073578043811722, 126.29641841819830006, 28.214585508299933281, + 40.677027786921826191, 45.014453160431003198, 72.56888934883318143, 86.175351059464446735, + 36.10481714025081601, 112.66008290561512695, 37.023422120706527494, 22.827039884501573397, + 69.03774758135114098, 63.20501303353739786, 41.44936808806960471, 33.221814698314119596, + 95.563191018874931615, 96.440400291536207078, 70.29942930144170532, 77.770792807550606085, + 1.1726393366407137364, 6.5982262101206288207, 81.216591952477756422, 17.496363994887360604, + 57.49813410793649382, 58.940722552972147241, 48.185284482126007788, 126.95009109412421822, + 19.213634697876841528, 120.44386030827809009, 118.75884335835144157, 28.178239386357745389, + 69.516525174301932566, 97.919540484079334419, 125.26232898308808217, 106.90475960871117422, + 18.270911319446895504, 89.916901904631231446, 52.081531425268622115, 13.31911013113494846, + 90.957656900685833534, 66.787454493805853417, 75.64947673142523854, 27.223176280069310451, + 118.26414786121677025, 80.083281937662832206, 39.039418890835804632, 29.993649743180867517, + 12.935292577214568155, 11.848946459747821791, 42.863777411908813519, 24.385285866548656486, + 115.80381892091463669, 57.313458590379013913, 55.993415408840519376, 89.77020231372807757, + 56.228423633136117132, 57.419648831037193304, 49.131875858423882164, 25.279583481620647945, + 32.963261854914890137, 32.018307738944713492, 52.26675246822196641, 68.65813993796473369, + 71.346151263642241247, 41.624496357562748017, 21.819135235997237032, 80.717954502695647534, + 72.780186637246515602, 90.274980941154353786, 77.254981235982995713, 109.035654024402902, + 83.038275736853393028, 13.945202522965701064, 71.479796628242183942, 64.55886952063156059, + 106.60542098483711015, 105.41794475673304987, 124.07444648073578719, 54.088367150310659781, + 52.314174513867328642, 106.20664446848240914, 46.098475311795482412, 110.82519575582045945, + 36.671538865819456987, 64.375434411758760689, 124.30305001771557727, 40.944071250785782468, + 24.214430108972010203, 83.96995065452210838, 77.216556003466394031, 44.788606435537076322, + 126.31792711436719401, 120.67271259747576551, 105.03599998357094591, 36.59162932093749987, + 33.812040251163125504, 98.325416434792714426, 13.489436079078586772, 39.300346446601906791, + 95.493182752707070904, 71.189123585485504009, 114.06833165695206844, 20.115478294897911837, + 125.87636572097835597, 94.137065177048498299, 71.856653195754915942, 62.344936041670734994, + 63.400854105635517044, 46.644399225126107922, 23.77314687447869801, 123.77016123877911014, + 63.710862277268461185, 58.065124891825689701, 63.120527922219480388, 125.8789801378006814, + 29.663628660458925879, 92.763199609515140764, 21.485633947188034654, 70.999698647930927109, + 50.449468635331868427, 45.581654642417561263, 56.620851701780338772, 62.12814493440600927, + 92.906389863077492919, 56.557883427380147623, 27.463822559770051157, 12.510243594530038536, + 112.32800121570471674, 101.52240939074908965, 31.433361964700452518, 123.34745739516074536, + 58.121914562416350236, 99.691377889841533033, 113.93972277122520609, 106.73276663609067327, + 49.360859593798522837, 51.529381355852819979, 83.293323517558746971, 51.922629091681301361, + 26.775802635165746324, 111.60288351517010597, 83.333326330634008627, 107.547001957478642, + 100.82290400814599707, 46.882583187583804829, 108.12002213434971054, 50.304791372698673513, + 56.518185325698141241, 14.942791248329740483, 106.8925171150258393, 120.93711930503923213, + 25.963407897874276387, 47.197509250065195374, 31.873746471625054255, 79.256149649434519233, + 77.769272399698820664, 26.530940710508730263, 91.472372191590693546, 111.07839068496832624, + 98.5188835941189609, 21.547573451320204185, 95.469058038179355208, 56.935956895526032895, + 52.074926499859429896, 96.160406794831942534, 85.995158660141896689, 15.131426120569813065, + 113.0529457712873409, 63.365673234053247143, 10.010454562721861294, 21.188293202521890635, + 3.7603078029060270637, 47.056416232506308006, 62.966274115860869642, 22.897948889003600925, + 24.837830686094093835, 20.66573641208015033, 42.039601829044840997, 62.283456873181421543, + 27.273723861613689223, 8.5965739614985068329, 55.798278969956299989, 106.44782379465323174, + 95.874204638595983852, 40.241662793305295054, 79.519046573710511439, 31.240620122811378678, + 20.02177801396464929, 54.379484081786358729, 46.438631172408349812, 85.811929188967042137, + 36.449022752891323762, 42.098164492341311416, 121.8550674198922934, 80.702378498866892187, + 9.8748259295025491156, 16.612736874769325368, 101.68637280759503483, 47.529279580874572275, + 36.52652397475685575, 100.88434953136311378, 5.4053111930916202255, 41.54848931164451642, + 28.020263734284526436, 45.004049963728903094, 50.260392906984634465, 58.07195084244813188, + 95.46540110906062182, 45.247271127514977707, 36.426091489494865527, 16.337793156737461686, + 126.29671337541367393, 75.905694986613525543, 1.9927685645598103292, 42.8757645805417269, + 6.8247758837715082336, 24.717420733733888483, 21.068119183844828513, 79.661478709578659618, + 29.027943612160015618, 59.40415338772800169, 40.37460505721901427, 36.863579665474389913, + 25.41718747589038685, 41.354824371883296408, 118.38311937711478095, 117.12555886705376906, + 112.19121026899665594, 21.055622650379518745, 24.966820839665160747, 75.795407414152577985, + 68.221807531521335477, 2.387610622936335858, 28.216704235830547987, 94.969747169099719031, + 32.501412600358889904, 82.258332914905622602, 62.742213319983420661, 109.53039719049047562, + 5.5677846771977783646, 22.763474676634359639, 80.015643877100956161, 59.665278775468323147, + 59.136164312258188147, 69.893816877254721476, 16.800478244738769718, 7.3324761915282579139, + 49.855207141750724986, 76.721123031158640515, 30.544522624491946772, 25.969233959982375382, + 12.250665258947265102, 32.962999501265585423, 49.433828536952205468, 122.64781018041321659, + 36.925101903128961567, 83.801409085936029442, 16.716668652014050167, 124.38944365718634799, + 55.859324194880173309, 70.135680449602659792, 3.4215727805167261977, 50.357467090754653327, + 82.609213200321391923, 126.56036298486651503, 111.61511068280015024, 4.0209915868908865377, + 21.793030150925915223, 67.736743246761761839, 118.23604370076282066, 27.455584008795995032, + 97.231723022101505194, 85.880139030348800588, 112.4551362849160796, 107.76116512927546864, + 4.544852381462987978, 42.456434029572847066, 60.014400325984752271, 77.859090945959906094, + 106.67573495996475685, 5.6342146032257005572, 102.38717528827328351, 82.266433890847110888, + 116.50302409768846701, 19.365657302438194165, 125.71672442534691072, 72.357140845866524614, + 90.225264551398140611, 39.351695026598463301, 11.290521626106055919, 56.24536832135709119, + 33.349535588658909546, 69.714776977136352798, 107.98214959887991427, 68.71184459289725055, + 16.402466051589726703, 93.046860693499183981, 79.53925859005539678, 48.755238885623839451, + 47.905081655258982209, 103.17557784726159298, 69.138154051146557322, 24.131208634629729204, + 18.362900531745253829, 22.382733911104878644, 0.16102761062938952819, 6.9172703905605885666, + 82.071815750729001593, 41.172578575740772067, 44.020666412387072342, 40.359047853031370323, + 19.21079833764815703, 96.731725516616279492, 108.52852706061821664, 37.719827983368304558, + 33.965193057792930631, 110.99958705910830759, 48.707065016777050914, 39.800087953408365138, + 43.19003027402141015, 115.41247106427908875, 47.622809821488772286, 104.73968583864916582, + 92.414185961049952311, 74.625076175329013495, 126.09423098344632308, 10.275891031920764362, + 104.44799600061378442, 74.837540803473530104, 60.755488391572725959, 123.32527549991209526, + 90.766841707791172666, 51.044356508409691742, 82.207827961283328477, 16.186215540536068147, + 113.28643083573842887, 65.59786575367252226, 55.697225104962853948, 11.165700448687857715, + 44.68964867309841793, 73.041658513102447614, 123.05386858715064591, 81.60400964271320845, + 64.424871329130837694, 82.615502695669420063, 124.97741086017413181, 67.143944618943351088, + 67.59235884818554041, 120.73604026328757755, 64.941084450198104605, 35.186442075962986564, + 93.17347949133545626, 93.350990778886625776, 15.527861660455528181, 79.911371154532389482, + 74.484896991732966853, 120.73439131560371607, 127.53774613792847958, 88.37701855464183609, + 87.793622417801088886, 93.605329781032196479, 4.4440071578028437216, 123.5988439502325491, + 81.002793174906400964, 68.591042283860588213, 22.169461291359766619, 6.5236244672414613888, + 103.88041019984302693, 117.24801611803923151, 81.334192258833354572, 30.810147156091261422, + 124.59283683639660012, 56.429171016599866562, 81.354055573843652382, 90.028906320865644375, + 17.137778697670000838, 44.350702118928893469, 72.209634280505269999, 97.320165811230253894, + 74.046844241413054988, 45.654079769006784773, 10.075495162702281959, 126.41002606707479572, + 82.898736176139209419, 66.443629396631877171, 63.126382037753501208, 64.880800583076052135, + 12.598858602887048619, 27.54158561510121217, 2.3452786732814274728, 13.19645242024489562, + 34.433183904955512844, 34.992727989774721209, 114.99626821587298764, 117.88144510594429448, + 96.370568964255653555, 125.90018218824843643, 38.427269395757321035, 112.88772061655981815, + 109.51768671670288313, 56.356478772719128756, 11.033050348607503111, 67.839080968162306817, + 122.52465796617980232, 85.809519217422348447, 36.541822638897428988, 51.833803809262462892, + 104.16306285053724423, 26.6382202622735349, 53.915313801375305047, 5.5749089876153448131, + 23.298953462850477081, 54.446352560142258881, 108.52829572243717848, 32.166563875325664412, + 78.078837781671609264, 59.987299486361735035, 25.87058515442913631, 23.697892919495643582, + 85.727554823817627039, 48.770571733100950951, 103.60763784182927338, 114.62691718075802783, + 111.98683081768467673, 51.54040462745615514, 112.45684726627223426, 114.83929766207438661, + 98.263751716847764328, 50.559166963241295889, 65.926523709829780273, 64.036615477889426984, + 104.5335049364475708, 9.3162798759331053589, 14.692302527284482494, 83.248992715125496034, + 43.638270471998112043, 33.435909005394933047, 17.560373274496669183, 52.549961882312345551, + 26.509962471969629405, 90.071308048809441971, 38.076551473706786055, 27.890405045935040107, + 14.959593256488005864, 1.117739041266759159, 85.210841969677858287, 82.835889513469737722, + 120.14889296147157438, 108.17673430062131956, 104.62834902773829526, 84.413288936964818276, + 92.196950623594602803, 93.650391511640918907, 73.343077731642551953, 0.75086882352115935646, + 120.60610003543115454, 81.888142501571564935, 48.428860217947658384, 39.939901309047854738, + 26.433112006932788063, 89.577212871077790624, 124.63585422873802599, 113.34542519495516899, + 82.07199996714189183, 73.183258641874999739, 67.624080502329888986, 68.650832869585428853, + 26.978872158157173544, 78.600692893207451561, 62.986365505417779787, 14.378247170974645996, + 100.13666331390413688, 40.230956589799461653, 123.75273144196034991, 60.274130354100634577, + 15.713306391509831883, 124.68987208334146999, 126.80170821127103409, 93.288798450252215844, + 47.546293748961033998, 119.54032247755822027, 127.42172455453692237, 116.1302497836513794, + 126.24105584444259875, 123.75796027560136281, 59.327257320921489736, 57.526399219030281529, + 42.971267894379707286, 13.999397295861854218, 100.89893727066373685, 91.163309284835122526, + 113.24170340356067754, 124.25628986881565652, 57.812779726154985838, 113.11576685476029525, + 54.927645119540102314, 25.02048718906371505, 96.656002431413071463, 75.044818781498179305, + 62.866723929404543014, 118.69491479032149073, 116.24382912483633845, 71.382755779686704045, + 99.879445542454050155, 85.465533272181346547, 98.721719187597045675, 103.05876271170927794, + 38.586647035117493942, 103.84525818336260272, 53.551605270335130626, 95.20576703034384991, + 38.666652661271655234, 87.094003914960921975, 73.645808016291994136, 93.765166375171247637, + 88.240044268699421082, 100.60958274539734703, 113.03637065139628248, 29.885582496663118945, + 85.785034230055316584, 113.87423861007846426, 51.926815795748552773, 94.395018500130390748, + 63.747492943253746489, 30.512299298872676445, 27.538544799397641327, 53.061881421021098504, + 54.944744383185025072, 94.15678136994029046, 69.0377671882379218, 43.095146902644046349, + 62.938116076358710416, 113.87191379105206579, 104.14985299972249777, 64.320813589667523047, + 43.990317320283793379, 30.262852241143264109, 98.105891542574681807, 126.73134646810649429, + 20.020909125443722587, 42.376586405043781269, 7.5206156058120541275, 94.112832465012616012, + 125.93254823172173928, 45.79589777800720185, 49.67566137218818767, 41.331472824160300661, + 84.079203658089681994, 124.56691374636284309, 54.547447723227378447, 17.193147922997013666, + 111.59655793991623796, 84.895647589310101466, 63.748409277191967703, 80.483325586614228087, + 31.038093147421022877, 62.481240245622757357, 40.04355602792929858, 108.75896816357271746, + 92.877262344820337603, 43.623858377934084274, 72.898045505782647524, 84.19632898468626081, + 115.71013483978822478, 33.404756997733784374, 19.749651859005098231, 33.225473749542288715, + 75.372745615190069657, 95.05855916174914455, 73.05304794951734948, 73.768699062726227567, + 10.810622386183240451, 83.096978623289032839, 56.040527468569052871, 90.008099927457806189, + 100.52078581396926893, 116.14390168489990174, 62.930802218121243641, 90.494542255029955413, + 72.852182978989731055, 32.675586313478561351, 124.59342675083098584, 23.811389973227051087, + 3.9855371291196206585, 85.751529161083453801, 13.649551767543016467, 49.434841467467776965, + 42.136238367693295004, 31.322957419157319237, 58.055887224320031237, 118.80830677545600338, + 80.74921011443802854, 73.727159330948779825, 50.834374951780773699, 82.709648743770230794, + 108.76623875423319987, 106.25111773411117611, 96.382420537993311882, 42.111245300759037491, + 49.933641679333959473, 23.590814828308793949, 8.443615063042670954, 4.7752212458726717159, + 56.433408471664733952, 61.939494338199438062, 65.002825200721417787, 36.516665829811245203, + 125.4844266399704793, 91.060794380980951246, 11.135569354395556729, 45.526949353272357257, + 32.031287754201912321, 119.33055755093664629, 118.27232862452001427, 11.787633754509442952, + 33.600956489477539435, 14.664952383056515828, 99.710414283505087951, 25.44224606231728103, + 61.089045248983893543, 51.938467919964750763, 24.501330517894530203, 65.925999002531170845, + 98.867657073908048915, 117.29562036082643317, 73.850203806261561112, 39.602818171872058883, + 33.433337304031738313, 120.77888731437269598, 111.7186483897639846, 12.271360899205319583, + 6.8431455610334523953, 100.71493418151294463, 37.218426400646421826, 125.12072596973666805, + 95.230221365600300487, 8.0419831737817730755, 43.586060301855468424, 7.4734864935271616559, + 108.47208740152564133, 54.911168017595628044, 66.463446044206648367, 43.760278060701239156, + 96.910272569835797185, 87.522330258550937288, 9.089704762925975956, 84.912868059145694133, + 120.02880065197314252, 27.718181891923450166, 85.351469919929513708, 11.268429206455039093, + 76.774350576550205005, 36.532867781697859755, 105.00604819537693402, 38.731314604880026309, + 123.43344885069745942, 16.714281691736687208, 52.450529102796281222, 78.703390053196926601, + 22.581043252212111838, 112.49073664271418238, 66.699071177321457071, 11.429553954276343575, + 87.964299197763466509, 9.4236891857945010997, 32.804932103183091385, 58.09372138700200594, + 31.078517180110793561, 97.510477771247678902, 95.810163310521602398, 78.351155694526823936, + 10.276308102293114644, 48.262417269259458408, 36.725801063490507659, 44.765467822209757287, + 0.32205522125877905637, 13.834540781124815112, 36.143631501458003186, 82.345157151481544133, + 88.041332824774144683, 80.718095706062740646, 38.421596675299952039, 65.463451033236196963, + 89.057054121236433275, 75.439655966736609116, 67.930386115589499241, 93.99917411821661517, + 97.414130033554101828, 79.600175906816730276, 86.38006054804645828, 102.8249421285581775, + 95.245619642981182551, 81.479371677301969612, 56.828371922103542602, 21.250152350661664968, + 124.18846196689264616, 20.551782063845166704, 80.895992001231206814, 21.675081606947060209, + 121.5109767831490899, 118.65055099982782849, 53.533683415582345333, 102.08871301682302146, + 36.415655922566656955, 32.372431081075774273, 98.572861671480495716, 3.1957315073450445198, + 111.3944502099257079, 22.331400897375715431, 89.379297346200473839, 18.083317026208533207, + 118.10773717430492979, 35.208019285430054879, 0.84974265826531336643, 37.231005391342478106, + 121.9548217203519016, 6.287889237890340155, 7.1847176963747187983, 113.47208052657879307, + 1.8821689003962092102, 70.372884151929611107, 58.346958982674550498, 58.701981557773251552, + 31.055723320914694341, 31.822742309068416944, 20.969793983469571685, 113.46878263121107011, + 127.07549227586059715, 48.754037109287310159, 47.587244835605815751, 59.210659562064392958, + 8.888014315609325422, 119.19768790046873619, 34.005586349816439906, 9.1820845677211764269, + 44.338922582719533239, 13.047248934486560756, 79.76082039968969184, 106.49603223608210101, + 34.668384517666709144, 61.620294312186160823, 121.18567367279320024, 112.8583420332033711, + 34.708111147690942744, 52.05781264173128875, 34.275557395340001676, 88.701404237861424917, + 16.419268561014177976, 66.640331622464145767, 20.093688482826109976, 91.308159538013569545, + 20.150990325408201898, 124.82005213415322942, 37.797472352282056818, 4.8872587932637543418, + 126.2527640755106404, 1.7616011661521042697, 25.197717205774097238, 55.08317123020242434, + 4.6905573465628549457, 26.392904840489791241, 68.866367809911025688, 69.985455979553080397, + 101.99253643174961326, 107.76289021189222694, 64.741137928514945088, 123.80036437649687286, + 76.85453879151828005, 97.775441233123274287, 91.035373433405766264, 112.71295754543825751, + 22.0661006972186442, 7.6781619363282516133, 117.04931593236324261, 43.619038434844696894, + 73.083645277794857975, 103.66760761852856376, 80.326125701074488461, 53.276440524547069799, + 107.83062760275061009, 11.149817975230689626, 46.597906925700954162, 108.89270512028815574, + 89.056591444874356966, 64.333127750654966803, 28.157675563343218528, 119.97459897272347007, + 51.74117030885827262, 47.395785838994925143, 43.455109647635254078, 97.54114346620553988, + 79.215275683662184747, 101.25383436151969363, 95.973661635369353462, 103.08080925491594826, + 96.913694532548106508, 101.67859532415241119, 68.527503433695528656, 101.11833392648622976, + 3.8530474196631985251, 0.073230955782491946593, 81.067009872895141598, 18.632559751866210718, + 29.384605054572602967, 38.497985430250992067, 87.276540943996224087, 66.871818010789866094, + 35.120746548993338365, 105.0999237646246911, 53.019924943942896789, 52.142616097618883941, + 76.15310294741357211, 55.780810091870080214, 29.919186512976011727, 2.2354780825371562969, + 42.421683939359354554, 37.671779026943113422, 112.29778592294678674, 88.353468601246277103, + 81.256698055480228504, 40.826577873933274532, 56.393901247192843584, 59.300783023285475792, + 18.686155463285103906, 1.5017376470459566917, 113.21220007086594705, 35.77628500314312987, + 96.857720435895316768, 79.879802618095709477, 52.866224013869214104, 51.154425742159219226, + 121.27170845747968997, 98.69085038991397596, 36.143999934287421638, 18.366517283753637457, + 7.2481610046634159517, 9.3016657391708577052, 53.957744316317985067, 29.201385786414903123, + 125.97273101083555957, 28.756494341952929972, 72.27332662780827377, 80.461913179602561286, + 119.50546288392069982, 120.54826070820126915, 31.426612783023301745, 121.37974416668657796, + 125.60341642254570615, 58.577596900504431687, 95.092587497925705975, 111.08064495512007852, + 126.84344910907748272, 104.26049956730639678, 124.48211168888883549, 119.51592055120272562, + 118.65451464184297947, 115.05279843806056306, 85.942535788759414572, 27.998794591727346415, + 73.797874541331111686, 54.32661856967388303, 98.483406807124993065, 120.51257973763131304, + 115.62555945231360965, 98.231533709520590492, 109.85529023908020463, 50.040974378131068079, + 65.312004862829780905, 22.089637562996358611, 125.73344785881272401, 109.38982958064661943, + 104.48765824967631488, 14.765511559377046069, 71.75889108491173829, 42.931066544366331073, + 69.443438375197729329, 78.117525423418555874, 77.173294070238625864, 79.690516366725205444, + 107.10321054067389923, 62.411534060687699821, 77.333305322546948446, 46.188007829925481929, + 19.29161603258762625, 59.530332750346133253, 48.480088537402480142, 73.21916549079833203, + 98.072741302792564966, 59.77116499332987587, 43.570068460114271147, 99.748477220156928524, + 103.85363159150074353, 60.790037000260781497, 127.49498588650749298, 61.02459859774535289, + 55.077089598795282654, 106.12376284204219701, 109.88948876637368812, 60.3135627398842189, + 10.075534376475843601, 86.190293805288092699, 125.87623215272105881, 99.743827582107769558, + 80.29970599944863352, 0.64162717933504609391, 87.980634640567586757, 60.525704482290166197, + 68.211783085153001593, 125.46269293621298857, 40.041818250887445174, 84.753172810087562539, + 15.041231211627746234, 60.225664930028870003, 123.86509646344347857, 91.591795556014403701, + 99.35132274437637534, 82.662945648324239301, 40.158407316183001967, 121.13382749272568617, + 109.09489544645475689, 34.38629584599766531, 95.193115879836113891, 41.791295178620202933, + 127.49681855438757339, 32.966651173228456173, 62.076186294842045754, 124.96248049124551471, + 80.087112055862235138, 89.517936327149072895, 57.754524689640675206, 87.247716755871806527, + 17.796091011568933027, 40.392657969376159599, 103.42026967957644956, 66.809513995467568748, + 39.499303718010196462, 66.450947499088215409, 22.745491230383777292, 62.11711832350192708, + 18.106095899038336938, 19.537398125452455133, 21.621244772370118881, 38.193957246578065678, + 112.08105493714174372, 52.016199854919250356, 73.041571627942175837, 104.28780336979980348, + 125.86160443624612526, 52.989084510063548805, 17.70436595797946211, 65.351172626960760681, + 121.18685350166197168, 47.622779946454102173, 7.9710742582428792957, 43.503058322166907601, + 27.299103535086032934, 98.869682934935553931, 84.272476735386590008, 62.645914838314638473, + 116.11177444864370045, 109.61661355091564474, 33.49842022887969506, 19.45431866189755965, + 101.66874990356518538, 37.419297487544099567, 89.532477508470037719, 84.502235468225990189, + 64.764841075986623764, 84.222490601518074982, 99.867283358667918947, 47.181629656617587898, + 16.887230126085341908, 9.5504424917453434318, 112.8668169433294679, 123.8789886764025141, + 2.0056504014428355731, 73.033331659626128385, 122.96885327994459658, 54.121588761961902492, + 22.271138708791113459, 91.053898706544714514, 64.062575508407462621, 110.66111510187693057, + 108.54465724904002855, 23.575267509018885903, 67.20191297895507887, 29.329904766116669634, + 71.420828567010175902, 50.88449212463456206, 122.17809049796778709, 103.87693583992950153, + 49.002661035792698385, 3.8519980050659796689, 69.735314147819735808, 106.59124072165650432, + 19.700407612523122225, 79.205636343744117767, 66.866674608067114605, 113.55777462874902994, + 95.437296779527969193, 24.542721798410639167, 13.68629112207054277, 73.429868363025889266, + 74.43685280129648163, 122.24145193947697408, 62.460442731200600974, 16.083966347563546151, + 87.172120603710936848, 14.946972987057961291, 88.944174803051282652, 109.82233603519489407, + 4.9268920884132967331, 87.52055612140611629, 65.820545139675232349, 47.044660517101874575, + 18.179409525855589891, 41.825736118295026245, 112.05760130394628504, 55.436363783850538312, + 42.702939839859027416, 22.536858412913716165, 25.548701153100410011, 73.065735563399357488, + 82.012096390753868036, 77.462629209763690596, 118.86689770139491884, 33.428563383473374415, + 104.90105820559620042, 29.406780106393853202, 45.162086504427861655, 96.98147328543200274, + 5.3981423546429141425, 22.859107908556325128, 47.928598395526933018, 18.847378371589002199, + 65.609864206366182771, 116.18744277400401188, 62.1570343602252251, 67.020955542498995783, + 63.620326621046842774, 28.702311389053647872, 20.552616204586229287, 96.524834538518916816, + 73.451602126981015317, 89.530935644419514574, 0.64411044251755811274, 27.669081562249630224, + 72.28726300291964435, 36.690314302966726245, 48.082665649551927345, 33.436191412125481293, + 76.843193350603542058, 2.926902066476031905, 50.114108242476504529, 22.879311933476856211, + 7.8607722311826364603, 59.998348236436868319, 66.828260067111841636, 31.20035181363709853, + 44.760121096096554538, 77.649884257119992981, 62.491239285966003081, 34.958743354603939224, + 113.6567438442070852, 42.500304701326967916, 120.37692393378529232, 41.103564127693971386, + 33.791984002462413628, 43.350163213897758396, 115.02195356630181777, 109.30110199965565698, + 107.06736683116832864, 76.177426033646042924, 72.831311845133313909, 64.744862162155186525, + 69.145723342960991431, 6.3914630146937270183, 94.788900419851415791, 44.66280179475506884, + 50.758594692400947679, 36.166634052420704393, 108.21547434860985959, 70.416038570860109758, + 1.6994853165306267329, 74.46201078268859419, 115.90964344070380321, 12.57577847578068031, + 14.369435392753075575, 98.944161053157586139, 3.7643378007960563991, 12.745768303859222215, + 116.693917965349101, 117.4039631155465031, 62.111446641829388682, 63.645484618136833888, + 41.93958796694278135, 98.937565262425778201, 126.15098455172119429, 97.508074218574620318, + 95.174489671211631503, 118.42131912412878592, 17.776028631222288823, 110.39537580093747238, + 68.011172699632879812, 18.364169135442352854, 88.677845165439066477, 26.094497868976759491, + 31.521640799383021658, 84.992064472164202016, 69.336769035333418287, 123.24058862437595963, + 114.37134734559003846, 97.716684066406742204, 69.416222295381885488, 104.1156252834625775, + 68.551114790683641331, 49.402808475722849835, 32.838537122031993931, 5.2806632449282915331, + 40.18737696565585793, 54.61631907602713909, 40.301980650820041774, 121.64010426830645883, + 75.594944704564113636, 9.7745175865311466623, 124.50552815102128079, 3.5232023323042085394, + 50.395434411548194475, 110.16634246040484868, 9.3811146931257098913, 52.78580968098322046, + 9.7327356198256893549, 11.970911959109798772, 75.985072863502864493, 87.525780423788091866, + 1.4822758570335281547, 119.60072875299738371, 25.709077583040198078, 67.550882466250186553, + 54.070746866815170506, 97.425915090876515023, 44.1322013944372884, 15.356323872660141205, + 106.09863186472648522, 87.238076869693031767, 18.167290555593353929, 79.335215237060765503, + 32.652251402148976922, 106.55288104909777758, 87.661255205501220189, 22.299635950461379252, + 93.195813851405546302, 89.785410240579949459, 50.113182889752351912, 0.66625550130993360654, + 56.315351126690075034, 111.94919794544694014, 103.48234061771654524, 94.791571677989850286, + 86.910219295274146134, 67.082286932414717739, 30.430551367328007473, 74.507668723043025238, + 63.947323270742344903, 78.161618509835534496, 65.827389065099850995, 75.357190648308460368, + 9.0550068673946952913, 74.236667852972459514, 7.7060948393263970502, 0.14646191156862187199, + 34.134019745790283196, 37.265119503732421435, 58.769210109145205934, 76.995970860505622113, + 46.553081887996086152, 5.7436360215797321871, 70.241493097990314709, 82.199847529249382205, + 106.03984988788579358, 104.28523219524140586, 24.30620589482714422, 111.56162018374016043, + 59.838373025952023454, 4.4709561650743125938, 84.843367878718709107, 75.343558053889864823, + 96.59557184589721146, 48.706937202496192185, 34.513396110960457008, 81.653155747866549063, + 112.78780249438568717, 118.60156604657095158, 37.372310926570207812, 3.0034752940955513623, + 98.424400141731894109, 71.552570006289897719, 65.715440871794271516, 31.759605236191418953, + 105.73244802773842821, 102.30885148432207643, 114.54341691496301792, 69.381700779827951919, + 72.287999868574843276, 36.733034567507274915, 14.496322009326831903, 18.60333147834171541, + 107.91548863263597013, 58.402771572833444225, 123.94546202167111915, 57.512988683909497922, + 16.546653255620185519, 32.92382635920876055, 111.01092576784503763, 113.09652141640253831, + 62.853225566050241468, 114.75948833337679389, 123.20683284509141231, 117.15519380101250135, + 62.185174995855049929, 94.161289910243795021, 125.68689821815860341, 80.520999134616431547, + 120.96422337778130895, 111.03184110240908922, 109.30902928368959692, 102.10559687612476409, + 43.885071577518829145, 55.997589183458330808, 19.595749082662223373, 108.65323713935140404, + 68.96681361425362411, 113.02515947526626405, 103.25111890463085729, 68.463067419044818962, + 91.710580478160409257, 100.08194875626577414, 2.6240097256595618092, 44.1792751259963552, + 123.46689571762908599, 90.779659161296876846, 80.975316499352629762, 29.531023118757730117, + 15.517782169823476579, 85.862133088736300124, 10.886876750399096636, 28.235050846840749728, + 26.346588140480889706, 31.381032733454048866, 86.206421081347798463, 124.82306812137903762, + 26.666610645093896892, 92.376015659850963857, 38.583232065175252501, 119.06066550069226651, + 96.960177074808598263, 18.438330981600302039, 68.145482605585129932, 119.54232998665975174, + 87.140136920232180273, 71.496954440317495028, 79.70726318300148705, 121.58007400052520097, + 126.98997177301498596, 122.04919719549070578, 110.15417919759420329, 84.247525684088031994, + 91.778977532747376245, 120.6271254797684378, 20.151068752955325181, 44.380587610579823377, + 123.7524643054457556, 71.487655164219177095, 32.59941199889726704, 1.2832543586737301666, + 47.961269281135173514, 121.05140896458397037, 8.4235661703096411657, 122.92538587242597714, + 80.083636501778528327, 41.506345620175125077, 30.082462423255492467, 120.45132986006137799, + 119.73019292689059512, 55.18359111203244538, 70.702645488756388659, 37.325891296648478601, + 80.316814632369641913, 114.26765498545501032, 90.189790892909513786, 68.772591691998968599, + 62.386231759672227781, 83.582590357244043844, 126.99363710877514677, 65.933302346456912346, + 124.15237258968772949, 121.92496098249466741, 32.174224111728108255, 51.03587265429814579, + 115.50904937928498839, 46.495433511743613053, 35.592182023137866054, 80.785315938755957177, + 78.840539359156537103, 5.6190279909351374954, 78.998607436024030903, 4.9018949981764308177, + 45.490982460767554585, 124.23423664700385416, 36.212191798076673876, 39.074796250904910266, + 43.242489544740237761, 76.387914493159769336, 96.162109874283487443, 104.03239970984213869, + 18.083143255887989653, 80.575606739603244932, 123.72320887249225052, 105.97816902012709761, + 35.408731915962562198, 2.7023452539251593407, 114.37370700332394335, 95.245559892908204347, + 15.942148516485758591, 87.006116644333815202, 54.598207070175703848, 69.73936586987474584, + 40.544953470773180015, 125.29182967663291492, 104.22354889729103888, 91.233227101831289474, + 66.996840457759390119, 38.908637323798757279, 75.337499807130370755, 74.838594975091837114, + 51.064955016943713417, 41.004470936455618357, 1.5296821519768855069, 40.444981203039787943, + 71.734566717335837893, 94.363259313235175796, 33.774460252170683816, 19.100884983494324842, + 97.733633886662573786, 119.7579773528050282, 4.011300802889309125, 18.066663319255894748, + 117.93770655988919316, 108.24317752392380498, 44.542277417585864896, 54.107797413093067007, + 0.12515101681856322102, 93.322230203757499112, 89.089314498080057092, 47.150535018041409785, + 6.4038259579101577401, 58.659809532236977248, 14.841657134020351805, 101.7689842492727621, + 116.35618099593921215, 79.753871679859003052, 98.00532207158539677, 7.7039960101355973165, + 11.470628295643109595, 85.18248144331300864, 39.400815225049882429, 30.411272687491873512, + 5.7333492161378671881, 99.115549257501697866, 62.874593559055938385, 49.085443596821278334, + 27.372582244144723518, 18.859736726055416511, 20.873705602596601238, 116.48290387895394815, + 124.92088546240120195, 32.167932695130730281, 46.344241207421873696, 29.89394597411956056, + 49.888349606106203282, 91.644672070389788132, 9.8537841768302314449, 47.041112242815870559, + 3.6410902793504646979, 94.08932103420374915, 36.358819051711179782, 83.651472236593690468, + 96.115202607892570086, 110.87272756770107662, 85.405879679718054831, 45.073716825827432331, + 51.097402306204458, 18.131471126802352956, 36.024192781511374051, 26.925258419531019172, + 109.73379540278983768, 66.857126766950386809, 81.802116411192400847, 58.813560212787706405, + 90.324173008859361289, 65.96294657086400548, 10.796284709285828285, 45.718215817112650257, + 95.857196791053866036, 37.694756743181642378, 3.21972841273600352, 104.37488554800802376, + 124.31406872045408818, 6.0419110849979915656, 127.24065324209368555, 57.404622778107295744, + 41.105232409176096553, 65.04966907704147161, 18.903204253965668613, 51.061871288839029148, + 1.2882208850351162255, 55.338163124502898427, 16.5745260058392887, 73.380628605933452491, + 96.16533129910385469, 66.872382824254600564, 25.686386701207084116, 5.8538041329520638101, + 100.22821648495300906, 45.758623866953712422, 15.721544462365272921, 119.99669647287737462, + 5.6565201342236832716, 62.400703627274197061, 89.520242192196747055, 27.299768514239985961, + 124.98247857193200616, 69.917486709211516427, 99.313487688414170407, 85.00060940265757381, + 112.75384786757058464, 82.207128255387942772, 67.583968004924827255, 86.700326427799154771, + 102.04390713260727352, 90.602203999314951943, 86.134733662340295268, 24.354852067295723828, + 17.662623690270265797, 1.489724324314011028, 10.291446685921982862, 12.782926029391092015, + 61.577800839702831581, 89.325603589510137681, 101.51718938480189536, 72.333268104845046764, + 88.430948697223357158, 12.832077141720219515, 3.3989706330648914445, 20.92402156538082636, + 103.81928688140760642, 25.15155695156136062, 28.73887078550978913, 69.888322106315172277, + 7.5286756015921127982, 25.491536607722082408, 105.38783593070183997, 106.80792623109300621, + 124.22289328365877736, 127.29096923627366778, 83.879175933889200678, 69.875130524855194381, + 124.30196910344602657, 67.016148437152878614, 62.348979342426900985, 108.84263824825757183, + 35.552057262448215624, 92.790751601878582733, 8.0223453992657596245, 36.728338270888343686, + 49.355690330878132954, 52.188995737953518983, 63.043281598769681295, 41.984128944332042011, + 10.673538070670474553, 118.48117724875555723, 100.74269469118371489, 67.433368132817122387, + 10.832444590767408954, 80.231250566928792978, 9.1022295813672826625, 98.805616951445699669, + 65.677074244063987862, 10.561326489856583066, 80.37475393131171586, 109.23263815205427818, + 80.603961301643721526, 115.28020853661655565, 23.189889409128227271, 19.549035173065931303, + 121.01105630204256158, 7.0464046646084170789, 100.79086882310002693, 92.33268492080969736, + 18.762229386251419783, 105.57161936196644092, 19.46547123965137871, 23.941823918223235523, + 23.970145727009366965, 47.051560847576183733, 2.9645517140706942882, 111.20145750599476742, + 51.418155166084034136, 7.1017649325003731064, 108.14149373363397899, 66.851830181753030047, + 88.2644027888745768, 30.71264774532392039, 84.197263729456608417, 46.476153739386063535, + 36.334581111190345837, 30.670430474121531006, 65.304502804301591823, 85.105762098199193133, + 47.322510411002440378, 44.599271900926396484, 58.391627702814730583, 51.570820481159898918, + 100.22636577950470382, 1.3325110026198672131, 112.63070225338378805, 95.898395890897518257, + 78.964681235436728457, 61.583143355983338552, 45.820438590551930247, 6.1645738648294354789, + 60.861102734659652924, 21.015337446086050477, 127.89464654148832778, 28.323237019674706971, + 3.6547781302033399697, 22.714381296616920736, 18.110013734793028561, 20.473335705944919027, + 15.4121896786527941, 0.29292382313724374399, 68.268039491580566391, 74.530239007464842871, + 117.53842021829404985, 25.991941721011244226, 93.106163775992172305, 11.487272043163102353, + 12.482986195984267397, 36.399695058502402389, 84.079699775775225135, 80.570464390482811723, + 48.61241178965792642, 95.123240367480320856, 119.67674605190404691, 8.9419123301522631664, + 41.686735757441056194, 22.687116107783367625, 65.191143691794422921, 97.41387440499238437, + 69.026792221924551995, 35.306311495736736106, 97.575604988775012316, 109.20313209314190317, + 74.744621853140415624, 6.0069505881947407033, 68.848800283467426198, 15.105140012583433418, + 3.4308817435885430314, 63.519210472386475885, 83.464896055480494397, 76.61770296864779084, + 101.08683382992967381, 10.763401559659541817, 16.575999737149686553, 73.466069135014549829, + 28.992644018653663807, 37.2066629566870688, 87.830977265271940269, 116.80554314567052643, + 119.89092404334223829, 115.02597736781899584, 33.093306511240371037, 65.847652718421159079, + 94.021851535693713231, 98.193042832805076614, 125.70645113210412092, 101.51897666675722576, + 118.4136656901864626, 106.31038760202500271, 124.37034999171373784, 60.32257982049122802, + 123.3737964363208448, 33.041998269236501073, 113.92844675556625589, 94.063682204821816413, + 90.618058567382831825, 76.211193752249528188, 87.770143155037658289, 111.99517836691666162, + 39.191498165328084724, 89.306474278706446057, 9.9336272285108861979, 98.050318950536166085, + 78.502237809265352553, 8.9261348380932759028, 55.421160956324456492, 72.163897512531548273, + 5.2480194513191236183, 88.358550251996348379, 118.93379143526180997, 53.559318322597391671, + 33.950632998705259524, 59.062046237515460234, 31.035564339650591137, 43.724266177472600248, + 21.773753500798193272, 56.470101693681499455, 52.693176280961779412, 62.762065466911735712, + 44.412842162699234905, 121.64613624275807524, 53.333221290191431763, 56.752031319701927714, + 77.166464130354142981, 110.12133100138817099, 65.920354149617196526, 36.876661963204242056, + 8.2909652111738978419, 111.08465997332314146, 46.280273840467998525, 14.993908880638628034, + 31.414526366006612079, 115.16014800105403992, 125.97994354603360989, 116.09839439098504954, + 92.308358395192044554, 40.495051368179701967, 55.557955065498390468, 113.2542509595368756, + 40.302137505910650361, 88.761175221163284732, 119.50492861089514918, 14.97531032843835419, + 65.19882399779453408, 2.5665087173474603333, 95.922538562273985008, 114.10281792916794075, + 16.84713234062292031, 117.85077174485559226, 32.167273003557056654, 83.012691240350250155, + 60.164924846514622914, 112.90265972012639395, 111.46038585378119024, 110.36718222406852874, + 13.405290977512777317, 74.651782593300595181, 32.633629264742921805, 100.53530997091365862, + 52.379581785822665552, 9.5451833839979371987, 124.77246351934809354, 39.165180714491725666, + 125.98727421755393152, 3.8666046929174626712, 120.30474517937909695, 115.84992196498933481, + 64.34844822345621651, 102.07174530859992956, 103.01809875856997678, 92.990867023487226106, + 71.184364046279370086, 33.570631877515552333, 29.681078718313074205, 11.23805598187391297, + 29.997214872048061807, 9.8037899963528616354, 90.981964921538747149, 120.46847329400770832, + 72.424383596153347753, 78.149592501809820533, 86.484979089484113501, 24.77582898632317665, + 64.324219748570612865, 80.064799419684277382, 36.166286511779617285, 33.151213479210127844, + 119.44641774498813902, 83.956338040254195221, 70.817463831925124396, 5.4046905078539566603, + 100.74741400665152469, 62.491119785816408694, 31.884297032975155162, 46.012233288667630404, + 109.19641414035504567, 11.47873173974949168, 81.08990694154999801, 122.58365935326946783, + 80.447097794585715747, 54.466454203666216927, 5.9936809155187802389, 77.817274647601152537, + 22.674999614264379488, 21.677189950183674227, 102.12991003388742683, 82.008941872911236715, + 3.0593643039537710138, 80.889962406083213864, 15.469133434675313765, 60.726518626470351592, + 67.548920504341367632, 38.201769966992287664, 67.467267773328785552, 111.51595470561005641, + 8.02260160577861825, 36.133326638515427476, 107.8754131197820243, 88.486355047847609967, + 89.084554835171729792, 108.21559482618613401, 0.25030203364076442085, 58.644460407518636202, + 50.178628996160114184, 94.30107003608281957, 12.80765191582031548, 117.3196190644739545, + 29.683314268044341588, 75.537968498549162177, 104.71236199188206228, 31.507743359721644083, + 68.010644143170793541, 15.407992020271194633, 22.94125659128985717, 42.36496288662601728, + 78.801630450099764857, 60.822545374983747024, 11.466698432279372355, 70.231098515003395732, + 125.74918711811187677, 98.170887193642556667, 54.745164488289447036, 37.719473452110833023, + 41.747411205196840456, 104.96580775791153428, 121.8417709248024039, 64.335865390261460561, + 92.688482414843747392, 59.78789194823912112, 99.776699212216044543, 55.289344140779576264, + 19.70756835366046289, 94.082224485631741118, 7.2821805587045673747, 60.1786420684074983, + 72.717638103425997542, 39.302944473191018915, 64.23040521578877815, 93.745455135405791225, + 42.811759359436109662, 90.147433651654864661, 102.194804612408916, 36.262942253604705911, + 72.048385563022748102, 53.850516839065676322, 91.46759080558331334, 5.7142535339044115972, + 35.604232822384801693, 117.62712042557905079, 52.648346017722360557, 3.9258931417280109599, + 21.59256941857165657, 91.436431634228938492, 63.714393582107732072, 75.389513486363284755, + 6.4394568254756450187, 80.749771096019685501, 120.62813744090817636, 12.08382216999962111, + 126.4813064841873711, 114.80924555621459149, 82.210464818355831085, 2.0993381540829432197, + 37.806408507931337226, 102.1237425776780583, 2.576441770070232451, 110.67632624900579685, + 33.14905201168221538, 18.76125721187054296, 64.330662598211347358, 5.744765648509201128, + 51.372773402414168231, 11.707608265907765599, 72.456432969906018116, 91.517247733907424845, + 31.44308892473418382, 111.99339294575474923, 11.313040268447366543, 124.8014072545520321, + 51.040484384393494111, 54.599537028483609902, 121.9649571438676503, 11.834973418426670833, + 70.626975376831978792, 42.001218805318785599, 97.507695735144807259, 36.414256510779523524, + 7.1679360098532924894, 45.400652855601947522, 76.087814265218185028, 53.204407998633541865, + 44.269467324680590536, 48.709704134591447655, 35.325247380540531594, 2.9794486486280220561, + 20.582893371843965724, 25.565852058782184031, 123.15560167940930114, 50.651207179023913341, + 75.034378769607428694, 16.666536209693731507, 48.861897394446714316, 25.664154283440439031, + 6.797941266129782889, 41.848043130765290698, 79.638573762815212831, 50.30311390312272124, + 57.477741571023216238, 11.776644212630344555, 15.057351203184225596, 50.983073215447802795, + 82.77567186140731792, 85.615852462189650396, 120.44578656732119271, 126.58193847255097353, + 39.758351867782039335, 11.75026104971402674, 120.60393820689569111, 6.0322968743057572283, + 124.69795868485743995, 89.685276496515143663, 71.104114524900069227, 57.581503203757165466, + 16.044690798531519249, 73.456676541776687372, 98.711380661756265908, 104.37799147590703797, + 126.08656319753936259, 83.968257888664084021, 21.347076141344587086, 108.96235449751475244, + 73.485389382371067768, 6.8667362656342447735, 21.664889181538455887, 32.462501133857585955, + 18.204459162738203304, 69.611233902895037318, 3.3541484881279757246, 21.122652979716804111, + 32.749507862627069699, 90.465276304112194339, 33.207922603291081032, 102.5604170732331113, + 46.379778818256454542, 39.098070346135500586, 114.02211260408512317, 14.092809329220472137, + 73.581737646203691838, 56.66536984161939472, 37.524458772506477544, 83.14323872393288184, + 38.93094247930275742, 47.883647836446471047, 47.94029145401873393, 94.103121695152367465, + 5.9291034281450265553, 94.402915011989534833, 102.83631033216806827, 14.203529865004384192, + 88.28298746727159596, 5.7036603635096980724, 48.528805577749153599, 61.425295490651478758, + 40.394527458913216833, 92.95230747877212707, 72.669162222380691674, 61.340860948246699991, + 2.6090056086068216246, 42.211524196398386266, 94.645020822004880756, 89.198543801852792967, + 116.78325540562946117, 103.14164096232343582, 72.452731559009407647, 2.6650220052433724049, + 97.261404506771214074, 63.796791781798674492, 29.929362470873456914, 123.1662867119666771, + 91.640877181103860494, 12.329147729658870958, 121.72220546931930585, 42.030674892175738933, + 127.78929308297665557, 56.646474039349413943, 7.3095562604066799395, 45.428762593233841471, + 36.220027469586057123, 40.946671411889838055, 30.824379357305588201, 0.58584764627812546678, + 8.5360789831647707615, 21.06047801493332372, 107.07684043658809969, 51.983883442026126431, + 58.212327551984344609, 22.974544086326204706, 24.965972391968534794, 72.799390117008442758, + 40.159399551554088248, 33.140928780965623446, 97.224823579319490818, 62.246480734964279691, + 111.35349210380809382, 17.883824660304526333, 83.373471514882112388, 45.374232215570373228, + 2.3822873835924838204, 66.82774880998840672, 10.053584443849103991, 70.61262299147711019, + 67.151209977553662611, 90.406264186287444318, 21.489243706280831248, 12.013901176393119385, + 9.6976005669348523952, 30.210280025170504814, 6.8617634871770860627, 127.03842094477658975, + 38.929792110964626772, 25.235405937299219659, 74.173667659859347623, 21.526803119319083635, + 33.151999474303011084, 18.932138270029099658, 57.985288037307327613, 74.413325913377775578, + 47.661954530547518516, 105.61108629134469084, 111.78184808668811456, 102.05195473563799169, + 66.186613022484380053, 3.6953054368459561374, 60.043703071391064441, 68.386085665613791207, + 123.41290226421187981, 75.037953333518089494, 108.82733138037656317, 84.620775204053643392, + 120.74069998342747567, 120.64515964098609402, 118.74759287264168961, 66.083996538476640126, + 99.856893511136149755, 60.127364409647270804, 53.236117134769301629, 24.422387504502694355, + 47.540286310078954557, 95.990356733833323233, 78.382996330659807427, 50.612948557412892114, + 19.867254457025410375, 68.100637901075970149, 29.004475618530705106, 17.852269676186551806, + 110.84232191265255096, 16.327795025063096546, 10.496038902641885215, 48.717100503996334737, + 109.86758287052361993, 107.11863664519478334, 67.901265997410519049, 118.12409247503092047, + 62.071128679301182274, 87.448532354945200495, 43.547507001596386544, 112.94020338736299891, + 105.38635256192355882, 125.52413093382347142, 88.825684325402107788, 115.29227248551615048, + 106.66644258038286353, 113.50406263940749341, 26.33292826071192394, 92.242662002779979957, + 3.8407082992343930528, 73.753323926408484112, 16.581930422351433663, 94.169319946646282915, + 92.56054768093599705, 29.987817761277256068, 62.829052732016862137, 102.32029600211171783, + 123.95988709207085776, 104.19678878197373706, 56.616716790384089109, 80.990102736359403934, + 111.11591013100041891, 98.508501919073751196, 80.604275011824938701, 49.522350442330207443, + 111.00985722179029835, 29.95062065688034636, 2.3976479955890681595, 5.1330174346985586453, + 63.845077124551607994, 100.20563585833588149, 33.694264681249478599, 107.70154348971118452, + 64.334546007117751287, 38.025382480700500309, 120.32984969303288381, 97.805319440256425878, + 94.920771707566018449, 92.734364448137057479, 26.810581955029192613, 21.303565186601190362, + 65.267258529489481589, 73.070619941827317234, 104.7591635716453311, 19.090366767999512376, + 121.54492703869618708, 78.330361428987089312, 123.97454843510786304, 7.7332093858385633212, + 112.60949035876183189, 103.6998439299823076, 0.69689644691607099958, 76.143490617203497095, + 78.03619751714359154, 57.981734046978090191, 14.368728092558740173, 67.141263755031104665, + 59.36215743662614841, 22.476111963747825939, 59.994429744096123613, 19.60757999270936125, + 53.963929843081132276, 112.93694658801905462, 16.848767192310333485, 28.299185003623279044, + 44.969958178968227003, 49.551657972649991279, 0.64843949714486370794, 32.129598839368554763, + 72.332573023559234571, 66.302426958423893666, 110.89283548997991602, 39.91267608051202842, + 13.634927663850248791, 10.809381015711551299, 73.494828013303049374, 124.98223957163281739, + 63.768594065950310323, 92.024466577338898787, 90.392828280710091349, 22.95746347950262134, + 34.179813883103633998, 117.16731870654257364, 32.894195589171431493, 108.93290840733243385, + 11.987361831041198457, 27.634549295202305075, 45.349999228528758977, 43.354379900370986434, + 76.259820067778491648, 36.017883745822473429, 6.1187286079111800063, 33.779924812166427728, + 30.93826686935062753, 121.45303725294434116, 7.0978410086827352643, 76.403539933988213306, + 6.9345355466612090822, 95.031909411220112815, 16.0452032115572365, 72.26665327703449293, + 87.750826239567686571, 48.972710095698857913, 50.169109670347097563, 88.431189652372268029, + 0.5006040672815288417, 117.2889208150372724, 100.35725799232386635, 60.60214007216563914, + 25.615303831644268939, 106.63923812894790899, 59.366628536092321156, 23.075936997101962334, + 81.424723983764124569, 63.015486719446926145, 8.0212882863415870816, 30.815984040542389266, + 45.882513182579714339, 84.729925773255672539, 29.603260900199529715, 121.64509074996749405, + 22.933396864562382689, 12.462197030010429444, 123.49837423622739152, 68.341774387285113335, + 109.49032897657889407, 75.438946904221666045, 83.49482241039731889, 81.931615515826706542, + 115.68354184960844577, 0.67173078052655910142, 57.376964829687494785, 119.57578389648188022, + 71.553398424432089087, 110.57868828155915253, 39.415136707324563758, 60.164448971263482235, + 14.564361117409134749, 120.35728413681863458, 17.435276206851995084, 78.605888946385675808, + 0.46081043158119427972, 59.49091027081158245, 85.623518718875857303, 52.294867303313367302, + 76.389609224817832001, 72.525884507213049801, 16.096771126045496203, 107.70103367813499062, + 54.935181611166626681, 11.428507067808823194, 71.208465644773241365, 107.25424085115810158, + 105.29669203544472111, 7.8517862834560219198, 43.185138837146951118, 54.872863268457876984, + 127.42878716421910212, 22.779026972726569511, 12.878913650954928016, 33.499542192043008981, + 113.25627488181635272, 24.167644340002880199, 124.96261296837838017, 101.61849111243282096, + 36.42092963671166217, 4.1986763081658864394, 75.612817015866312431, 76.247485155356116593, + 5.1528835401441028807, 93.352652498011593707, 66.298104023364430759, 37.522514423744723899, + 0.6613251964226947166, 11.489531297018402256, 102.74554680482833646, 23.415216531819169177, + 16.91286593981567421, 55.03449546781484969, 62.886177849472005619, 95.98678589150949847, + 22.626080536898371065, 121.6028145091040642, 102.08096876878698822, 109.19907405697085778, + 115.9299142877353006, 23.669946836856979644, 13.253950753663957585, 84.002437610641209176, + 67.015391470289614517, 72.828513021559047047, 14.335872019706584979, 90.801305711207533022, + 24.175628530436370056, 106.40881599726708373, 88.538934649361181073, 97.41940826918289531, + 70.650494761081063189, 5.9588972972560441121, 41.165786743687931448, 51.131704117568006041, + 118.31120335881860228, 101.30241435805146466, 22.068757539214857388, 33.333072419387463015, + 97.723794788893428631, 51.328308566880878061, 13.595882532259565778, 83.696086261534219375, + 31.277147525630425662, 100.60622780624544248, 114.95548314204643248, 23.55328842526068911, + 30.114702406368451193, 101.96614643089924357, 37.551343722818273818, 43.231704924382938771, + 112.89157313464602339, 125.16387694510194706, 79.51670373556407867, 23.500522099431691458, + 113.20787641379138222, 12.064593748615152435, 121.39591736971851788, 51.370552993033925304, + 14.208229049800138455, 115.16300640751433093, 32.089381597066676477, 18.913353083557012724, + 69.422761323516169796, 80.755982951817713911, 124.17312639508236316, 39.936515777328168042, + 42.69415228269281215, 89.924708995033142855, 18.970778764742135536, 13.733472531268489547, + 43.329778363076911774, 64.925002267715171911, 36.408918325480044587, 11.222467805790074635, + 6.7082969762559514493, 42.245305959433608223, 65.499015725257777376, 52.930552608224388678, + 66.415845206585800042, 77.120834146466222592, 92.759557636512909085, 78.19614069227463915, + 100.04422520817024633, 28.185618658444582252, 19.163475292407383677, 113.33073968323878944, + 75.048917545016593067, 38.286477447865763679, 77.861884958605514839, 95.767295672892942093, + 95.880582908041105838, 60.20624339030473493, 11.858206856293691089, 60.805830023982707644, + 77.672620664336136542, 28.407059730012406362, 48.565974934543191921, 11.407320727019396145, + 97.057611155498307198, 122.85059098130295752, 80.789054917830071645, 57.904614957547892118, + 17.338324444761383347, 122.68172189649339998, 5.2180112172136432491, 84.423048392800410511, + 61.290041644013399491, 50.397087603709223913, 105.56651081126256031, 78.283281924650509609, + 16.905463118018815294, 5.3300440104903827887, 66.522809013542428147, 127.59358356359734898, + 59.858724941750551807, 118.33257342393699219, 55.281754362207720987, 24.658295459321379894, + 115.4444109386386117, 84.061349784355115844, 127.57858616595331114, 113.29294807869882789, + 14.619112520813359879, 90.857525186467682943, 72.440054939172114246, 81.89334282377967611, + 61.648758714611176401, 1.1716952925562509336, 17.072157966329541523, 42.12095602987028542, + 86.153680873176199384, 103.96776688405225286, 116.42465510396868922, 45.949088172652409412, + 49.931944783940707566, 17.598780234016885515, 80.318799103108176496, 66.28185756193488487, + 66.449647158638981637, 124.49296146993219736, 94.706984207616187632, 35.767649320612690644, + 38.746943029764224775, 90.748464431140746456, 4.7645747671886056196, 5.6554976199768134393, + 20.107168887701845961, 13.225245982957858359, 6.3024199551109632012, 52.812528372574888635, + 42.978487412561662495, 24.027802352786238771, 19.39520113386970479, 60.420560050344647607, + 13.723526974357810104, 126.0768418895531795, 77.859584221929253545, 50.470811874602077296, + 20.347335319718695246, 43.05360623863816727, 66.303998948606022168, 37.864276540058199316, + 115.97057607461829321, 20.826651826755551156, 95.323909061098675011, 83.222172582693019649, + 95.563696173379867105, 76.103909471279621357, 4.3732260449687601067, 7.3906108736919122748, + 120.08740614278576686, 8.7721713312312203925, 118.8258045284273976, 22.075906667039816966, + 89.654662760756764328, 41.241550408110924764, 113.48139996685858932, 113.29031928197582602, + 109.4951857452870172, 4.1679930769569182303, 71.713787022272299509, 120.25472881929454161, + 106.47223426953860326, 48.844775009005388711, 95.080572620161547093, 63.980713467670284444, + 28.765992661319614854, 101.22589711482578423, 39.734508914054458728, 8.2012758021519402973, + 58.008951237061410211, 35.70453935237674159, 93.684643825305101927, 32.655590050126193091, + 20.992077805283770431, 97.434201007996307453, 91.735165741050877841, 86.237273290393204661, + 7.802531994824676076, 108.24818495006184094, 124.14225735860600253, 46.897064709890400991, + 87.095014003196411068, 97.880406774729635799, 82.772705123850755626, 123.04826186765058083, + 49.651368650807853555, 102.58454497103593894, 85.332885160769365029, 99.008125278814986814, + 52.665856521427485859, 56.485324005559959915, 7.6814165984724240843, 19.506647852816968225, + 33.163860844706505304, 60.338639893296203809, 57.121095361871994101, 59.975635522554512136, + 125.65810546403736225, 76.64059200422707363, 119.9197741841453535, 80.393577563947474118, + 113.2334335807718162, 33.980205472722445847, 94.231820262004475808, 69.017003838151140371, + 33.208550023649877403, 99.044700884664052865, 94.019714443580596708, 59.901241313760692719, + 4.7952959911781363189, 10.266034869397117291, 127.69015424910685397, 72.411271716671762988, + 67.388529362502595177, 87.403086979426007019, 0.66909201423550257459, 76.050764961404638598, + 112.65969938606940559, 67.610638880516489735, 61.841543415135674877, 57.468728896274114959, + 53.621163910058385227, 42.607130373206018703, 2.5345170589826011565, 18.141239883658272447, + 81.518327143290662207, 38.180733536002662731, 115.08985407739601214, 28.660722857977816602, + 119.94909687021572609, 15.466418771680764621, 97.218980717527301749, 79.3996878599646152, + 1.393792893835779978, 24.286981234410632169, 28.07239503428718308, 115.96346809395618038, + 28.737456185121118324, 6.2825275100622093305, 118.72431487325229682, 44.952223927495651878, + 119.98885948819224723, 39.215159985418722499, 107.92785968616590253, 97.873893176038109232, + 33.69753438462066697, 56.598370007246558089, 89.939916357936454006, 99.103315945299982559, + 1.2968789942897274159, 64.259197678740747506, 16.66514604712210712, 4.6048539168514253106, + 93.785670979959832039, 79.825352161024056841, 27.269855327700497583, 21.618762031426740577, + 18.989656026609736728, 121.96447914326563478, 127.53718813190425863, 56.048933154681435553, + 52.785656561420182697, 45.914926959005242679, 68.359627766210905975, 106.33463741308514727, + 65.788391178346500965, 89.865816814664867707, 23.974723662082396913, 55.26909859040461015, + 90.699998457057517953, 86.708759800745610846, 24.519640135556983296, 72.035767491644946858, + 12.237457215822360013, 67.559849624332855456, 61.87653373870489304, 114.90607450588868232, + 14.195682017369108507, 24.807079867976426613, 13.869071093326056143, 62.063818822440225631, + 32.090406423118110979, 16.53330655407262384, 47.501652479135373142, 97.945420191397715826, + 100.3382193406978331, 48.862379304744536057, 1.0012081345666956622, 106.57784163007818279, + 72.714515984647732694, 121.20428014433127828, 51.230607663292175857, 85.27847625789581798, + 118.73325707218464231, 46.151873994207562646, 34.849447967528249137, 126.03097343889385229, + 16.042576572683174163, 61.631968081084778532, 91.765026365163066657, 41.459851546511345077, + 59.206521800402697409, 115.2901814999349881, 45.866793729124765377, 24.924394060024496866, + 118.99674847245842102, 8.6835487745738646481, 90.980657953161426121, 22.87789380844697007, + 38.989644820798275759, 35.863231031657051062, 103.36708369921689155, 1.3434615610531182028, + 114.75392965937862755, 111.15156779296739842, 15.106796848867816152, 93.157376563118305057, + 78.830273414649127517, 120.32889794252696447, 29.128722234821907477, 112.71456827363726916, + 34.870552413707628148, 29.211777892771351617, 0.92162086316238855943, 118.98182054162680288, + 43.247037437751714606, 104.58973460663037258, 24.77921844963930198, 17.051769014426099602, + 32.193542252094630385, 87.402067356269981246, 109.87036322233325336, 22.857014135621284368, + 14.416931289550120709, 86.508481702319841133, 82.593384070889442228, 15.70357256691204384, + 86.370277674293902237, 109.74572653691939195, 126.85757432843820425, 45.558053945453139022, + 25.757827301909856033, 66.999084384089655941, 98.512549763632705435, 48.335288680009398377, + 121.92522593676039833, 75.236982224865641911, 72.841859273423324339, 8.3973526163354108576, + 23.225634031736262841, 24.494970310712233186, 10.30576708029184374, 58.705304996026825393, + 4.5962080467288615182, 75.045028847489447799, 1.3226503928453894332, 22.979062594040442491, + 77.491093609656672925, 46.830433063638338353, 33.82573187963134842, 110.06899093562969938, + 125.77235569894764922, 63.973571783018996939, 45.252161073800380109, 115.20562901821176638, + 76.161937537577614421, 90.398148113945353543, 103.85982857547060121, 47.339893673713959288, + 26.507901507331553148, 40.00487522128605633, 6.0307829405828670133, 17.657026043118094094, + 28.671744039416807937, 53.602611422415066045, 48.351257060876378091, 84.81763199453780544, + 49.077869298726000125, 66.838816538369428599, 13.300989522162126377, 11.917794594512088224, + 82.331573487375862896, 102.26340823513965006, 108.62240671764084254, 74.60482871610292932, + 44.137515078429714777, 66.666144838778564008, 67.447589577786857262, 102.65661713376175612, + 27.191765064522769535, 39.39217252306843875, 62.554295051264489302, 73.212455612494522939, + 101.91096628409286495, 47.106576850521378219, 60.229404812740540365, 75.932292861798487138, + 75.102687445636547636, 86.46340984876951552, 97.78314626929568476, 122.32775389020753209, + 31.03340747112815734, 47.001044198867020896, 98.415752827582764439, 24.12918749723394285, + 114.79183473943703575, 102.74110598606785061, 28.416458099603914889, 102.32601281502866186, + 64.178763194133352954, 37.826706167117663426, 10.84552264703597757, 33.5119659036390658, + 120.34625279016472632, 79.873031554656336084, 85.388304565389262279, 51.849417990066285711, + 37.941557529484271072, 27.466945062536979094, 86.659556726157461526, 1.8500045354303438216, + 72.817836650960089173, 22.444935611580149271, 13.416593952511902899, 84.490611918870854424, + 2.9980314505155547522, 105.86110521645241533, 4.8316904131752380636, 26.241668292936083162, + 57.519115273029456148, 28.392281384552916279, 72.088450416340492666, 56.371237316889164504, + 38.326950584818405332, 98.661479366481216857, 22.097835090033186134, 76.572954895735165337, + 27.723769917214667657, 63.534591345789522165, 63.761165816082211677, 120.41248678060946986, + 23.716413712587382179, 121.61166004796905327, 27.345241328672273085, 56.814119460024812724, + 97.131949869086383842, 22.814641454042430269, 66.115222311000252375, 117.70118196260955301, + 33.57810983566014329, 115.80922991509578424, 34.676648889526404673, 117.36344379298679996, + 10.436022434430924477, 40.846096785600821022, 122.58008328802679898, 100.7941752074220858, + 83.133021622528758598, 28.566563849301019218, 33.810926236037630588, 10.660088020984403556, + 5.0456180270884942729, 127.18716712719469797, 119.71744988350474159, 108.66514684787398437, + 110.56350872441544197, 49.316590918646397768, 102.88882187728086137, 40.122699568713869667, + 127.15717233191026025, 98.58589615739765577, 29.238225041630357737, 53.715050372939003864, + 16.88010987834786647, 35.786685647559352219, 123.2975174292223528, 2.3433905851125018671, + 34.144315932659083046, 84.241912059744208818, 44.307361746356036747, 79.935533768108143704, + 104.84931020793737844, 91.898176345304818824, 99.863889567881415132, 35.197560468037409009, + 32.637598206219990971, 4.5637151238734077197, 4.899294317281601252, 120.9859229398680327, + 61.413968415232375264, 71.535298641225381289, 77.493886059532087529, 53.496928862281492911, + 9.5291495343772112392, 11.310995239953626879, 40.214337775403691921, 26.450491965915716719, + 12.604839910221926402, 105.62505674514977727, 85.95697482512332499, 48.055604705572477542, + 38.790402267739409581, 120.84112010069293319, 27.447053948719258187, 124.15368377910999698, + 27.719168443858507089, 100.94162374920415459, 40.694670639437390491, 86.107212477279972518, + 4.6079978972120443359, 75.728553080120036611, 103.94115214923658641, 41.65330365351474029, + 62.647818122200988, 38.444345165389677277, 63.127392346763372188, 24.207818942559242714, + 8.7464520899375202134, 14.781221747387462528, 112.17481228557153372, 17.544342662466078764, + 109.6516090568547952, 44.151813334083271911, 51.309325521513528656, 82.483100816225487506, + 98.962799933720816625, 98.58063856395529001, 90.990371490574034397, 8.3359861539174744394, + 15.427574044548236998, 112.5094576385927212, 84.944468539077206515, 97.6895500180144154, + 62.161145240323094185, 127.96142693534056889, 57.531985322642867686, 74.451794229651568457, + 79.469017828108917456, 16.402551604303880595, 116.01790247412282042, 71.409078704757121159, + 59.369287650610203855, 65.311180100252386183, 41.98415561057117884, 66.868402015996252885, + 55.470331482105393661, 44.474546580786409322, 15.605063989652990131, 88.496369900127319852, + 120.28451471721200505, 93.79412941978443996, 46.190028006396460114, 67.760813549462909577, + 37.545410247705149231, 118.09652373530116165, 99.302737301619345089, 77.169089942075515864, + 42.665770321542368038, 70.016250557629973628, 105.33171304285497172, 112.97064801111991983, + 15.362833196944848169, 39.01329570563393645, 66.327721689413010608, 120.67727978659240762, + 114.2421907237439882, 119.95127104511266225, 123.31621092807836249, 25.281184008457785239, + 111.83954836829434498, 32.787155127898586215, 98.466867161543632392, 67.960410945448529674, + 60.463640524012589594, 10.034007676302280743, 66.417100047303392785, 70.089401769331743708, + 60.039428887161193416, 119.80248262752138544, 9.5905919823562726378, 20.53206973879787256, + 127.38030849821734591, 16.822543433347163955, 6.7770587250088283326, 46.806173958852014039, + 1.338184028474643128, 24.101529922812915174, 97.319398772142449161, 7.2212777610329794697, + 123.68308683027134975, 114.93745779254822992, 107.24232782011677045, 85.214260746412037406, + 5.0690341179652023129, 36.282479767320182873, 35.036654286581324413, 76.361467072008963441, + 102.17970815479202429, 57.321445715959271183, 111.89819374043145217, 30.932837543365167221, + 66.437961435058241477, 30.799375719929230399, 2.7875857876715599559, 48.573962468821264338, + 56.144790068578004139, 103.92693618791236077, 57.474912370242236648, 12.56505502012805664, + 109.44862974650459364, 89.904447854994941736, 111.97771897638449445, 78.430319970841082977, + 87.85571937233544304, 67.747786352076218463, 67.395068769241333939, 113.19674001449675416, + 51.87983271587654599, 70.206631890599965118, 2.5937579885830928106, 0.5183953574814950116, + 33.33029209424421424, 9.2097078337064886, 59.571341959923302056, 31.650704322048113681, + 54.539710655400995165, 43.237524062853481155, 37.979312053223111434, 115.92895828653490753, + 127.07437626380851725, 112.09786630936287111, 105.57131312284036539, 91.829853918014123337, + 8.7192555324254499283, 84.669274826173932524, 3.5767823566966399085, 51.731633629329735413, + 47.949447324164793827, 110.53819718081285828, 53.399996914118673885, 45.417519601491221692, + 49.03928027111760457, 16.071534983289893717, 24.474914431648358004, 7.1196992486657109112, + 123.75306747741342406, 101.81214901177736465, 28.391364034738217015, 49.614159735952853225, + 27.738142186652112287, 124.12763764488045126, 64.180812846236221958, 33.066613108145247679, + 95.003304958274384262, 67.89084038279906963, 72.676438681395666208, 97.724758609489072114, + 2.0024162691370293032, 85.155683260160003556, 17.429031969299103366, 114.40856028866255656, + 102.46121532658798969, 42.556952515795273939, 109.46651414436928462, 92.303747988415125292, + 69.698895935060136253, 124.06194687778770458, 32.085153145366348326, 123.26393616217319504, + 55.530052730326133315, 82.919703093022690155, 118.4130436008090328, 102.58036299986997619, + 91.733587458249530755, 49.848788120052631712, 109.99349694491684204, 17.367097549151367275, + 53.961315906322852243, 45.75578761689394014, 77.979289641596551519, 71.726462063317740103, + 78.734167398433783092, 2.6869231221098743845, 101.50785931876089307, 94.303135585934796836, + 30.213593697739270283, 58.314753126240248093, 29.660546829301893013, 112.65779588505392894, + 58.257444469647452934, 97.429136547274538316, 69.741104827415256295, 58.423555785542703234, + 1.8432417263284150977, 109.96364108325360576, 86.49407487550706719, 81.179469213260745164, + 49.55843689927860396, 34.103538028852199204, 64.387084504192898748, 46.804134712543600472, + 91.740726444666506723, 45.714028271242568735, 28.833862579103879398, 45.016963404643320246, + 37.186768141778884456, 31.407145133827725658, 44.740555348591442453, 91.491453073842421873, + 125.7151486568764085, 91.116107890906278044, 51.515654603823350044, 5.9981687681829498615, + 69.02509952726541087, 96.670577360022434732, 115.85045187352443463, 22.4739644497349218, + 17.683718546846648678, 16.794705232670821715, 46.451268063472525682, 48.989940621424466372, + 20.611534160583687481, 117.41060999205365079, 9.1924160934613610152, 22.090057694978895597, + 2.6453007856907788664, 45.958125188084522961, 26.98218721931334585, 93.660866127276676707, + 67.651463759266334819, 92.137981871263036737, 123.54471139789529843, 127.94714356603799388, + 90.504322147604398197, 102.41125803642717074, 24.323875075158866821, 52.796296227894345066, + 79.719657150941202417, 94.679787347427918576, 53.015803014663106296, 80.009750442572112661, + 12.061565881165734027, 35.314052086236188188, 57.343488078833615873, 107.20522284483013209, + 96.702514121756394161, 41.63526398907561088, 98.155738597455638228, 5.6776330767388571985, + 26.601979044324252754, 23.835589189027814427, 36.663146974755363772, 76.526816470282938099, + 89.244813435285323067, 21.20965743220585864, 88.275030156863067532, 5.3322896775607659947, + 6.8951791555773525033, 77.313234267523512244, 54.38353012904553907, 78.7843450461368775, + 125.10859010253261658, 18.424911224992683856, 75.821932568185729906, 94.213153701042756438, + 120.45880962548471871, 23.864585723600612255, 22.205374891276733251, 44.926819697542669019, + 67.5662925385950075, 116.65550778041506419, 62.06681494225631468, 94.00208839773767977, + 68.831505655165528879, 48.258374994471523678, 101.58366947887770948, 77.482211972135701217, + 56.832916199211467756, 76.652025630060961703, 0.35752638826670590788, 75.653412334235326853, + 21.691045294071955141, 67.023931807281769579, 112.69250558033309062, 31.746063109316310147, + 42.776609130778524559, 103.69883598013257142, 75.883115058968542144, 54.933890125077596167, + 45.319113452314923052, 3.7000090708643256221, 17.635673301920178346, 44.889871223160298541, + 26.833187905027443776, 40.981223837741708849, 5.9960629010347474832, 83.722210432904830668, + 9.6633808263504761271, 52.483336585872166324, 115.0382305460589123, 56.784562769109470537, + 16.176900832680985332, 112.74247463377832901, 76.653901169640448643, 69.322958732962433714, + 44.195670180070010247, 25.145909791470330674, 55.447539834429335315, 127.06918269157904433, + 127.52233163216806133, 112.82497356121893972, 47.432827425178402336, 115.22332009593810653, + 54.690482657344546169, 113.62823892005326343, 66.263899738172767684, 45.629282908088498516, + 4.2304446220041427296, 107.40236392521910602, 67.156219671323924558, 103.61845983019156847, + 69.353297779056447325, 106.72688758597359993, 20.872044868861848954, 81.692193571205280023, + 117.16016657605723594, 73.588350414847809589, 38.266043245057517197, 57.133127698602038436, + 67.621852472075261176, 21.320176041968807112, 10.091236054180626525, 126.37433425439303392, + 111.43489976701312116, 89.33029369575160672, 93.12701744883088395, 98.633181837296433514, + 77.777643754561722744, 80.245399137431377312, 126.31434466382415849, 69.17179231479531154, + 58.476450083260715473, 107.43010074587800773, 33.76021975669573294, 71.573371295122342417, + 118.59503485844470561, 4.6867811702250037342, 68.288631865321804071, 40.483824119488417637, + 88.614723492715711473, 31.871067536219925387, 81.698620415878394851, 55.796352690613275627, + 71.727779135762830265, 70.395120936074818019, 65.275196412439981941, 9.1274302477468154393, + 9.7985886345668404829, 113.9718458797360654, 122.82793683046838851, 15.070597282454400556, + 26.987772119064175058, 106.99385772456298582, 19.058299068754422478, 22.621990479907253757, + 80.428675550807383843, 52.900983931831433438, 25.209679820447490783, 83.250113490303192521, + 43.913949650246649981, 96.111209411144955084, 77.58080453548245714, 113.68224020138950436, + 54.894107897442154353, 120.30736755821999395, 55.438336887720652157, 73.883247498408309184, + 81.389341278878418962, 44.214424954559945036, 9.2159957944277266506, 23.457106160243711201, + 79.882304298473172821, 83.30660730702948058, 125.295636244401976, 76.888690330779354554, + 126.25478469352674438, 48.415637885118485428, 17.492904179875040427, 29.562443494778563036, + 96.349624571143067442, 35.088685324935795506, 91.303218113709590398, 88.303626668166543823, + 102.61865104303069529, 36.966201632454612991, 69.925599867445271229, 69.161277127914217999, + 53.980742981148068793, 16.671972307834948879, 30.855148089100111974, 97.018915277189080371, + 41.888937078158051008, 67.3791000360288308, 124.32229048064982635, 127.92285387068113778, + 115.06397064528937335, 20.903588459306774894, 30.938035656217834912, 32.805103208611399168, + 104.03580494824927882, 14.818157409514242318, 118.73857530122404569, 2.6223602005047723651, + 83.96831122114599566, 5.7368040319925057702, 110.94066296421078732, 88.949093161572818644, + 31.21012797930961824, 48.992739800258277683, 112.56902943442764808, 59.588258839568879921, + 92.380056012796558207, 7.5216270989258191548, 75.090820495413936442, 108.19304747060596128, + 70.605474603242328158, 26.338179884151031729, 85.331540643088374054, 12.032501115263585234, + 82.663426085713581415, 97.941296022239839658, 30.725666393889696337, 78.026591411271510879, + 4.6554433788296591956, 113.35455957318845321, 100.48438144749161438, 111.90254209022896248, + 118.63242185615672497, 50.562368016919208458, 95.679096736588689964, 65.57431025580081041, + 68.933734323090902762, 7.9208218908970593475, 120.92728104802517919, 20.068015352608199464, + 4.8342000946104235481, 12.178803538663487416, 120.07885777432602481, 111.60496525504277088, + 19.181183964712545276, 41.064139477599383099, 126.76061699643469183, 33.645086866694327909, + 13.554117450017656665, 93.612347917704028077, 2.676368056949286256, 48.203059845629468327, + 66.638797544284898322, 14.442555522069596918, 119.36617366054633749, 101.87491558510009781, + 86.484655640237178886, 42.428521492824074812, 10.138068235930404626, 72.564959534640365746, + 70.073308573166286806, 24.722934144021564862, 76.359416309584048577, 114.64289143192218035, + 95.79638748086290434, 61.865675086733972421, 4.8759228701164829545, 61.598751439858460799, + 5.5751715753431199118, 97.147924937642528675, 112.28958013715964626, 79.85387237582472153, + 114.9498247404844733, 25.130110040259751258, 90.89725949301282526, 51.80889570999352145, + 95.955437952772626886, 28.860639941685803933, 47.71143874467452406, 7.4955727041560749058, + 6.7901375384863058571, 98.393480028993508313, 103.75966543175672996, 12.413263781199930236, + 5.1875159771661856212, 1.0367907149629900232, 66.660584188488428481, 18.4194156674129772, + 119.14268391984660411, 63.301408644096227363, 109.07942131080199033, 86.47504812570696231, + 75.958624106449860847, 103.85791657307345304, 126.14875252762067248, 96.195732618729380192, + 83.142626245684368769, 55.659707836028246675, 17.438511064854537835, 41.338549652347865049, + 7.153564713393279817, 103.46326725865947083, 95.898894648333225632, 93.076394361625716556, + 106.79999382823734777, 90.835039202982443385, 98.078560542235209141, 32.143069966579787433, + 48.949828863296716008, 14.239398497335059801, 119.50613495483048609, 75.624298023554729298, + 56.78272806947643403, 99.22831947190570645, 55.476284373307862552, 120.2552752897645405, + 0.3616256924724439159, 66.133226216294133337, 62.006609916552406503, 7.7816807656017772388, + 17.352877362794970395, 67.449517218978144228, 4.0048325382776965853, 42.311366520320007112, + 34.858063938601844711, 100.8171205773287511, 76.922430653175979387, 85.113905031594185857, + 90.933028288742207224, 56.607495976833888562, 11.397791870123910485, 120.12389375557540916, + 64.170306290736334631, 118.52787232434639009, 111.06010546065590461, 37.839406186049018288, + 108.82608720162170357, 77.160725999743590364, 55.46717491649906151, 99.697576240108901402, + 91.986993889833684079, 34.73419509830273455, 107.92263181264570449, 91.511575233791518258, + 27.958579283196741017, 15.452924126639118185, 29.468334796867566183, 5.3738462442233867478, + 75.015718637525424128, 60.606271171869593672, 60.427187395478540566, 116.62950625248049619, + 59.321093658607424004, 97.315591770107857883, 116.51488893929854385, 66.85827309455271461, + 11.482209654830512591, 116.84711157108540647, 3.6864834526604681741, 91.927282166510849493, + 44.98814975101777236, 34.358938426521490328, 99.11687379855720792, 68.207076057708036387, + 0.77416900838579749689, 93.608269425090838922, 55.481452889333013445, 91.42805654248513747, + 57.667725158207758795, 90.033926809286640491, 74.373536283557768911, 62.814290267655451316, + 89.481110697186522884, 54.982906147688481724, 123.43029731375645497, 54.232215781812556088, + 103.03130920764670009, 11.996337536369537702, 10.050199054534459719, 65.341154720048507443, + 103.70090374704886926, 44.9479288994698436, 35.367437093693297356, 33.58941046534164343, + 92.902536126945051365, 97.979881242848932743, 41.22306832117101294, 106.82121998410730157, + 18.38483218692272203, 44.180115389957791194, 5.2906015713815577328, 91.916250376169045921, + 53.964374438630329678, 59.321732254556991393, 7.3029275185363076162, 56.275963742529711453, + 119.08942279579423484, 127.89428713207962574, 53.008644295212434372, 76.822516072854341473, + 48.647750150317733642, 105.59259245579232811, 31.439314301886042813, 61.359574694855837151, + 106.03160602932985057, 32.019500885144225322, 24.123131762331468053, 70.628104172472376376, + 114.68697615767086972, 86.410445689663902158, 65.405028243512788322, 83.270527978154859738, + 68.311477194911276456, 11.355266153477714397, 53.203958088648505509, 47.671178378055628855, + 73.326293949514365522, 25.053632940569514176, 50.489626870570646133, 42.41931486441535526, + 48.550060313726135064, 10.664579355121531989, 13.790358311158342985, 26.626468535047024488, + 108.76706025809471612, 29.568690092277392978, 122.21718020506523317, 36.84982244998900569, + 23.643865136375097791, 60.426307402089150855, 112.91761925096943742, 47.72917144720122451, + 44.410749782553466503, 89.853639395088976016, 7.1325850771936529782, 105.31101556083012838, + 124.13362988451626734, 60.004176795478997519, 9.6630113103310577571, 96.516749988946685335, + 75.167338957759056939, 26.964423944271402434, 113.66583239842657349, 25.304051260121923406, + 0.71505277653704979457, 23.306824668470653705, 43.38209058814754826, 6.0478636145671771374, + 97.38501116066618124, 63.492126218632620294, 85.553218261560687097, 79.397671960268780822, + 23.766230117937084287, 109.86778025015519233, 90.638226904629846103, 7.4000181417286512442, + 35.271346603840356693, 89.779742446320597082, 53.666375810054887552, 81.962447675483417697, + 11.992125802073132945, 39.444420865809661336, 19.326761652700952254, 104.96667317174797063, + 102.07646109211782459, 113.56912553821894107, 32.353801665365608642, 97.484949267560295993, + 25.307802339284535265, 10.645917465924867429, 88.391340360140020493, 50.291819582940661348, + 110.89507966886230861, 126.13836538316172664, 127.04466326433976064, 97.649947122437879443, + 94.865654850360442651, 102.44664019187621307, 109.38096531469273032, 99.256477840110164834, + 4.5277994763455353677, 91.258565816176997032, 8.4608892440119234379, 86.804727850441850023, + 6.3124393426514870953, 79.236919660386774922, 10.706595558116532629, 85.453775171947199851, + 41.744089737727335887, 35.384387142414198024, 106.32033315211810987, 19.176700829695619177, + 76.532086490115034394, 114.26625539720771485, 7.2437049441505223513, 42.640352083937614225, + 20.182472108364891028, 124.74866850878970581, 94.869799534029880306, 50.660587391506851418, + 58.254034897665405879, 69.266363674596505007, 27.555287509127083467, 32.490798274866392603, + 124.62868932765195495, 10.343584629590623081, 116.95290016652506893, 86.860201491756015457, + 67.520439513395103859, 15.146742590248322813, 109.19006971688941121, 9.3735623404536454473, + 8.5772637306436081417, 80.967648238980473252, 49.229446985431422945, 63.742135072443488752, + 35.397240831756789703, 111.59270538123018923, 15.455558271529298509, 12.790241872153274016, + 2.5503928248799638823, 18.254860495493630879, 19.597177269137318945, 99.943691759475768777, + 117.65587366093677701, 30.141194564908801112, 53.975544238131988095, 85.987715449125971645, + 38.116598137508844957, 45.243980959818145493, 32.857351101614767686, 105.80196786366286688, + 50.419359640898619546, 38.500226980606385041, 87.82789930049693794, 64.222418822293548146, + 27.16160907096855226, 99.364480402779008728, 109.78821579488794669, 112.61473511643998791, + 110.87667377544494229, 19.766494996820256347, 34.778682557756837923, 88.428849909119890071, + 18.431991588855453301, 46.914212320491060382, 31.764608596949983621, 38.613214614062599139, + 122.59127248880758998, 25.777380661562347086, 124.50956938705348875, 96.831275770236970857, + 34.985808359750080854, 59.12488698956076405, 64.699249142286134884, 70.177370649875228992, + 54.606436227422818774, 48.607253336336725624, 77.237302086061390582, 73.93240326491286396, + 11.851199734894180438, 10.322554255828435998, 107.96148596229613759, 33.343944615669897757, + 61.710296178203861928, 66.037830554378160741, 83.777874156319739996, 6.7582000720612995792, + 120.64458096130329068, 127.84570774136591353, 102.1279412905787467, 41.807176918613549788, + 61.876071312435669824, 65.610206417226436315, 80.071609896498557646, 29.636314819032122614, + 109.47715060244809138, 5.244720401013182709, 39.93662244229199132, 11.473608063988649519, + 93.881325928425212624, 49.898186323145637289, 62.42025595861923648, 97.985479600520193344, + 97.138058868855296168, 119.17651767914139782, 56.760112025593116414, 15.043254197855276288, + 22.181640990831510862, 88.386094941215560539, 13.210949206484656315, 52.676359768305701436, + 42.663081286176748108, 24.065002230530808447, 37.326852171430800809, 67.882592044479679316, + 61.451332787783030653, 28.053182822543021757, 9.31088675766295637, 98.709119146380544407, + 72.968762894986866741, 95.805084180461562937, 109.26484371231344994, 101.12473603384205489, + 63.358193473181017907, 3.1486205116052587982, 9.867468646181805525, 15.841643781797756674, + 113.85456209605035838, 40.136030705216398928, 9.6684001892208470963, 24.35760707733061281, + 112.1577155486556876, 95.209930510085541755, 38.362367929425090551, 82.128278955202404177, + 125.52123399286938366, 67.290173733388655819, 27.108234900038951309, 59.224695835408056155, + 5.352736113898572512, 96.406119691262574634, 5.2775950885697966442, 28.885111044142831815, + 110.73234732109631295, 75.749831170203833608, 44.969311280474357773, 84.857042985648149624, + 20.27613647186444723, 17.129919069284369471, 12.146617146332573611, 49.445868288046767702, + 24.718832619171735132, 101.28578286384799867, 63.59277496172580868, 123.73135017346794484, + 9.7518457402329659089, 123.1975028797169216, 11.150343150689877803, 66.29584987528869533, + 96.579160274322930491, 31.707744751653081039, 101.89964948096894659, 50.260220080523140496, + 53.79451898602565052, 103.61779141999068088, 63.910875905545253772, 57.721279883371607866, + 95.422877489349048119, 14.991145408312149812, 13.580275076976249693, 68.786960057990654605, + 79.519330863513459917, 24.826527562399860471, 10.375031954332371242, 2.0735814299296180252, + 5.3211683769768569618, 36.838831334829592379, 110.28536783969320823, 126.6028172881960927, + 90.158842621607618639, 44.950096251417562598, 23.917248212903359672, 79.715833146150544053, + 124.29750505524498294, 64.391465237462398363, 38.285252491368737537, 111.31941567205649335, + 34.877022129709075671, 82.677099304695730098, 14.307129426790197613, 78.926534517322579632, + 63.797789296670089243, 58.152788723255071091, 85.59998765647833352, 53.670078405968524748, + 68.157121084470418282, 64.286139933159574866, 97.899657726593432017, 28.478796994673757581, + 111.01226990966461017, 23.248596047109458596, 113.56545613895650604, 70.456638943811412901, + 110.95256874661936308, 112.51055057952908101, 0.72325138494852581061, 4.2664524325882666744, + 124.01321983310481301, 15.563361531203554478, 34.705754725593578769, 6.8990344379562884569, + 8.0096650765553931706, 84.622733040640014224, 69.716127877207327401, 73.634241154661140172, + 25.844861306355596753, 42.227810063192009693, 53.866056577484414447, 113.21499195366777712, + 22.795583740251458948, 112.2477875111544563, 0.34061258147630724125, 109.05574464869641815, + 94.120210921311809216, 75.678812372101674555, 89.65217440324704512, 26.321451999487180728, + 110.934349833001761, 71.395152480221440783, 55.973987779667368159, 69.468390196609107079, + 87.84526362529504695, 55.023150467583036516, 55.917158566393482033, 30.905848253278236371, + 58.936669593735132366, 10.747692488450411474, 22.031437275050848257, 121.21254234373918734, + 120.85437479096071911, 105.25901250496099237, 118.64218731721848599, 66.631183540219353745, + 105.02977787860072567, 5.7165461891054292209, 22.96441930966466316, 105.69422314217081293, + 7.3729669053245743271, 55.854564333021698985, 89.97629950203554472, 68.717876853046618635, + 70.233747597118053818, 8.4141521154160727747, 1.5483380167752329726, 59.216538850181677844, + 110.96290577866966487, 54.85611308497027494, 115.33545031641915557, 52.067853618576918961, + 20.747072567115537822, 125.62858053531454061, 50.962221394373045769, 109.96581229538060143, + 118.86059462751290994, 108.46443156362875015, 78.062618415293400176, 23.992675072739075404, + 20.100398109072557418, 2.6823094401006528642, 79.401807494097738527, 89.8958577989396872, + 70.734874187386594713, 67.178820930686924839, 57.805072253893740708, 67.959762485697865486, + 82.446136642345663859, 85.642439968214603141, 36.769664373845444061, 88.360230779915582389, + 10.581203142766753444, 55.832500752338091843, 107.92874887726065936, 118.64346450911398279, + 14.605855037072615232, 112.55192748506306089, 110.17884559159210767, 127.78857426415925147, + 106.01728859042850672, 25.645032145708682947, 97.295500300639105262, 83.18518491158465622, + 62.878628603772085626, 122.71914938971531228, 84.063212058659701142, 64.039001770288450643, + 48.246263524666574085, 13.256208344948390732, 101.37395231534537743, 44.820891379331442295, + 2.8100564870292146225, 38.541055956313357456, 8.6229543898225529119, 22.710532306955428794, + 106.40791617729701102, 95.342356756114895688, 18.652587899028731044, 50.107265881139028352, + 100.97925374114129227, 84.838629728830710519, 97.100120627452270128, 21.329158710243063979, + 27.580716622316685971, 53.252937070097686956, 89.534120516189432237, 59.137380184558423935, + 116.43436041013046633, 73.699644899978011381, 47.287730272750195581, 120.85261480418193969, + 97.835238501938874833, 95.458342894402449019, 88.821499565110570984, 51.707278790177952033, + 14.265170154390943935, 82.622031121663894737, 120.26725976903253468, 120.00835359095799504, + 19.326022620665753493, 65.033499977897008648, 22.334677915518113878, 53.928847888546442846, + 99.331664796853146981, 50.608102520243846811, 1.4301055530740995891, 46.613649336941307411, + 86.76418117629509652, 12.095727229137992254, 66.77002232133236248, 126.98425243726887857, + 43.106436523125012172, 30.795343920537561644, 47.532460235877806554, 91.735560500314022647, + 53.276453809259692207, 14.800036283457302488, 70.542693207684351364, 51.559484892641194165, + 107.33275162011341308, 35.924895350966835395, 23.98425160414626589, 78.888841731619322672, + 38.653523305405542487, 81.933346343499579234, 76.152922184239287162, 99.138251076437882148, + 64.707603330734855263, 66.969898535120591987, 50.615604678569070529, 21.291834931853372836, + 48.782680720280040987, 100.58363916588496068, 93.790159337728255196, 124.27673076632709126, + 126.08932652868315927, 67.299894244879396865, 61.731309700724523282, 76.893280383756064111, + 90.761930629389098613, 70.512955680220329668, 9.0555989526947087143, 54.517131632353994064, + 16.921778488027484855, 45.609455700883700047, 12.624878685306612169, 30.473839320773549844, + 21.413191116236703238, 42.907550343894399703, 83.488179475454671774, 70.768774284832034027, + 84.64066630423621973, 38.353401659394876333, 25.064172980233706767, 100.5325107944154297, + 14.487409888301044703, 85.28070416787522845, 40.364944216733420035, 121.4973370175830496, + 61.739599068059760612, 101.32117478301370284, 116.50806979533444974, 10.532727349193010014, + 55.110575018254166935, 64.981596549736423185, 121.25737865530390991, 20.68716925918488414, + 105.90580033305377583, 45.720402983515668893, 7.0408790267902077176, 30.293485180500283604, + 90.380139433778822422, 18.747124680907290895, 17.154527461290854262, 33.935296477960946504, + 98.45889397086284589, 127.4842701448869775, 70.794481663517217385, 95.185410762460378464, + 30.911116543058597017, 25.580483744306548033, 5.1007856497599277645, 36.509720990987261757, + 39.194354538278275868, 71.887383518955175532, 107.31174732187355403, 60.282389129817602225, + 107.95108847626761417, 43.97543089825194329, 76.233196275017689914, 90.487961919636290986, + 65.71470220323317335, 83.603935727325733751, 100.83871928179723909, 77.000453961216408061, + 47.655798600997513859, 0.44483764458709629253, 54.323218141940742498, 70.728960805558017455, + 91.57643158977953135, 97.229470232883613789, 93.753347550889884587, 39.532989993640512694, + 69.557365115517313825, 48.857699818239780143, 36.863983177710906602, 93.828424640982120764, + 63.529217193899967242, 77.226429228128836257, 117.18254497761517996, 51.554761323128332151, + 121.01913877411061549, 65.662551540473941714, 69.971616719500161707, 118.24977397912516608, + 1.3984982845759077463, 12.354741299750457983, 109.21287245484563755, 97.214506672677089227, + 26.474604172126419144, 19.864806529825727921, 23.702399469788360875, 20.645108511660509976, + 87.922971924592275172, 66.687889231339795515, 123.42059235641136183, 4.0756611087599594612, + 39.555748312639479991, 13.516400144126237137, 113.28916192261021934, 127.69141548273546505, + 76.255882581157493405, 83.614353837227099575, 123.75214262487497763, 3.220412834456510609, + 32.143219792997115292, 59.272629638067883207, 90.954301204896182753, 10.489440802026365418, + 79.873244884583982639, 22.947216127980937017, 59.762651856850425247, 99.796372646291274577, + 124.84051191724211094, 67.970959201044024667, 66.276117737714230316, 110.35303535828279564, + 113.52022405118623283, 30.086508395710552577, 44.363281981666659703, 48.772189882431121077, + 26.421898412969312631, 105.35271953661140287, 85.326162572353496216, 48.130004461061616894, + 74.653704342865239596, 7.7651840889593586326, 122.90266557556606131, 56.106365645086043514, + 18.621773515329550719, 69.418238292764726793, 17.93752578997737146, 63.610168360926763853, + 90.529687424630537862, 74.249472067684109788, 126.71638694636203581, 6.2972410232105175965, + 19.73493729236361105, 31.683287563599151326, 99.709124192100716755, 80.272061410432797857, + 19.336800378441694193, 48.715214154664863599, 96.315431097315013176, 62.41986102017108351, + 76.724735858853819082, 36.256557910408446332, 123.04246798574240529, 6.580347466777311638, + 54.216469800077902619, 118.44939167081611231, 10.705472227800783003, 64.812239382525149267, + 10.555190177139593288, 57.77022208828930161, 93.464694642196263885, 23.499662340407667216, + 89.938622560952353524, 41.714085971296299249, 40.552272943728894461, 34.259838138568738941, + 24.293234292665147223, 98.891736576093535405, 49.437665238347108243, 74.571565727695997339, + 127.18554992345525534, 119.46270034693588968, 19.503691480469569797, 118.3950057594338432, + 22.300686301383393584, 4.5916997505810286384, 65.158320548645860981, 63.415489503309800057, + 75.799298961937893182, 100.52044016104628099, 107.58903797205493902, 79.235582839981361758, + 127.82175181109050754, 115.44255976674685371, 62.845754978698096238, 29.982290816624299623, + 27.160550153956137365, 9.5739201159849471878, 31.038661727026919834, 49.653055124799720943, + 20.750063908664742485, 4.1471628598592360504, 10.642336753953713924, 73.677662669662822736, + 92.570735679390054429, 125.20563457639582339, 52.317685243215237278, 89.900192502835125197, + 47.834496425810357323, 31.431666292304726085, 120.59501011049360386, 0.78293047492479672655, + 76.570504982741113054, 94.638831344112986699, 69.75404425942178932, 37.354198609391460195, + 28.614258853584033204, 29.853069034645159263, 127.59557859334017849, 116.30557744651378016, + 43.19997531295666704, 107.34015681194068748, 8.3142421689444745425, 0.5722798663227877114, + 67.799315453186864033, 56.957593989351153141, 94.024539819329220336, 46.49719209422255517, + 99.130912277916650055, 12.91327788762646378, 93.905137493242364144, 97.021101159058162011, + 1.4465027698970516212, 8.5329048651801713277, 120.02643966620962601, 31.126723062407108955, + 69.411509451187157538, 13.798068875912576914, 16.01933015311442432, 41.245466081283666426, + 11.432255754418292781, 19.268482309322280344, 51.689722612711193506, 84.455620126384019386, + 107.73211315497246687, 98.42998390733555425, 45.591167480506555876, 96.495575022308912594, + 0.6812251629562524613, 90.111489297396474285, 60.24042184262725641, 23.357624744206987089, + 51.30434880649409024, 52.642903998977999436, 93.868699666007159976, 14.790304960442881566, + 111.9479755593383743, 10.936780393221852137, 47.6905272505900939, 110.04630093516607303, + 111.83431713278696407, 61.811696506556472741, 117.87333918747026473, 21.495384976900822949, + 44.062874550105334492, 114.42508468748201267, 113.7087495819250762, 82.518025009925622726, + 109.28437463444060995, 5.2623670804423454683, 82.059555757201451343, 11.433092378210858442, + 45.928838619332964299, 83.388446284341625869, 14.745933810649148654, 111.70912866604703595, + 51.952599004074727418, 9.4357537060968752485, 12.467495194236107636, 16.828304230832145549, + 3.0966760335504659452, 118.43307770036699367, 93.925811557339329738, 109.71222616994418786, + 102.67090063283831114, 104.13570723715383792, 41.494145134234713623, 123.25716107062908122, + 101.92444278874972952, 91.931624590764840832, 109.72118925502945785, 88.928863127261138288, + 28.125236830586800352, 47.985350145478150807, 40.200796218145114835, 5.3646188802049437072, + 30.803614988199115032, 51.791715597883012379, 13.469748374776827404, 6.3576418613738496788, + 115.61014450779111939, 7.9195249713993689511, 36.892273284694965696, 43.284879936429206282, + 73.539328747694526101, 48.720461559831164777, 21.162406285533506889, 111.66500150467982166, + 87.85749775452495669, 109.28692901822796557, 29.211710074148868443, 97.103854970129759749, + 92.357691183187853312, 127.57714852832214092, 84.034577180857013445, 51.290064291421003873, + 66.591000601281848503, 38.37036982316931244, 125.75725720754780923, 117.43829877943426254, + 40.126424117323040264, 0.07800354057690128684, 96.49252704933314817, 26.512416689900419442, + 74.747904630690754857, 89.641782758662884589, 5.6201129740584292449, 77.082111912626714911, + 17.245908779645105824, 45.421064613914495567, 84.815832354597660014, 62.684713512229791377, + 37.305175798057462089, 100.21453176228169468, 73.958507482286222512, 41.677259457665059017, + 66.200241254904540256, 42.658317420486127958, 55.161433244633371942, 106.50587414019901189, + 51.068241032378864475, 118.27476036912048585, 104.86872082026457065, 19.399289799956022762, + 94.575460545504029142, 113.70522960836751736, 67.670477003881387645, 62.916685788808536017, + 49.642999130221141968, 103.41455758035590407, 28.530340308785525849, 37.244062243331427453, + 112.53451953806870733, 112.01670718191599008, 38.652045241335144965, 2.0669999557940172963, + 44.669355831036227755, 107.85769577709652367, 70.663329593706293963, 101.21620504048769362, + 2.8602111061481991783, 93.2272986738862528, 45.528362352590193041, 24.191454458279622486, + 5.5400446426683629397, 125.96850487453775713, 86.212873046250024345, 61.590687841075123288, + 95.064920471759251086, 55.471121000628045294, 106.55290761851938441, 29.600072566918242956, + 13.085386415368702728, 103.11896978528602631, 86.665503240226826165, 71.849790701933670789, + 47.96850320829616976, 29.777683463238645345, 77.307046610814722953, 35.866692687002796447, + 24.305844368482212303, 70.276502152879402274, 1.4152066614733485039, 5.9397970702411839738, + 101.23120935713814106, 42.583669863706745673, 97.565361440563719952, 73.16727833177355933, + 59.58031867546014837, 120.5534615326578205, 124.17865305736995651, 6.5997884897587937303, + 123.46261940145268454, 25.786560767515766202, 53.523861258781835204, 13.025911360440659337, + 18.111197905389417429, 109.03426326470798813, 33.843556976054969709, 91.218911401767400093, + 25.249757370613224339, 60.947678641547099687, 42.826382232473406475, 85.815100687792437384, + 38.976358950912981527, 13.537548569667706033, 41.28133260847243946, 76.706803318789752666, + 50.128345960471051512, 73.0650215888308594, 28.974819776605727384, 42.561408335750456899, + 80.729888433470478049, 114.9946740351660992, 123.4791981361231592, 74.642349566031043651, + 105.01613959066889947, 21.065454698386020027, 110.22115003651197185, 1.963193099476484349, + 114.51475731060781982, 41.374338518373406259, 83.81160066610755166, 91.440805967031337786, + 14.081758053580415435, 60.586970361004205188, 52.760278867557644844, 37.494249361814581789, + 34.309054922581708524, 67.870592955925530987, 68.917787941729329759, 126.96854028977759299, + 13.588963327038072748, 62.370821524920756929, 61.822233086117194034, 51.160967488613096066, + 10.201571299519855529, 73.019441981974523515, 78.388709076560189715, 15.774767037913989043, + 86.623494643747108057, 120.56477825963884243, 87.902176952535228338, 87.950861796507524559, + 24.466392550039017806, 52.975923839276219951, 3.4294044064699846786, 39.207871454655105481, + 73.677438563598116161, 26.000907922432816122, 95.311597201995027717, 0.88967528917419258505, + 108.64643628388512298, 13.45792161111603491, 55.15286317956270068, 66.458940465770865558, + 59.506695101779769175, 79.065979987284663366, 11.11473023103462765, 97.715399636479560286, + 73.727966355425451184, 59.656849281964241527, 127.05843438780357246, 26.452858456261310494, + 106.36508995523035992, 103.10952264626030228, 114.03827754822486895, 3.325103080951521406, + 11.943233439003961394, 108.49954795825033216, 2.7969965691518154927, 24.709482599504553946, + 90.425744909694913076, 66.429013345354178455, 52.949208344252838288, 39.729613059651455842, + 47.40479893957672175, 41.29021702332465793, 47.845943849188188324, 5.3757784626832290087, + 118.84118471282272367, 8.1513222175199189223, 79.111496625278959982, 27.032800288256112253, + 98.578323845224076649, 127.38283096547456807, 24.511765162318624789, 39.228707674457837129, + 119.50428524974995526, 6.440825668913021218, 64.286439585994230583, 118.54525927613940439, + 53.908602409792365506, 20.978881604056368815, 31.746489769167965278, 45.894432255961874034, + 119.52530371370448847, 71.592745292586187134, 121.68102383448785986, 7.9419184020916873123, + 4.5522354754320986103, 92.706070716569229262, 99.040448102372465655, 60.173016791421105154, + 88.726563963333319407, 97.544379764862242155, 52.84379682594226324, 82.705439073226443725, + 42.652325144706992432, 96.260008922126871767, 21.307408685730479192, 15.530368177922355244, + 117.80533115113212261, 112.21273129017208703, 37.243547030662739417, 10.836476585529453587, + 35.87505157995474292, 127.22033672185716568, 53.059374849264713703, 20.498944135371857556, + 125.43277389272407163, 12.594482046421035193, 39.4698745847272221, 63.366575127201940631, + 71.418248384205071488, 32.544122820865595713, 38.673600756883388385, 97.430428309333365178, + 64.630862194630026352, 124.839722040345805, 25.449471717707638163, 72.513115820820530644, + 118.08493597148481058, 13.160694933554623276, 108.43293960015944322, 108.89878334163222462, + 21.410944455605203984, 1.6244787650502985343, 21.110380354279186577, 115.5404441765822412, + 58.92938928439252777, 46.999324680818972411, 51.877245121904707048, 83.428171942592598498, + 81.104545887457788922, 68.519676277137477882, 48.586468585333932424, 69.783473152187070809, + 98.875330476697854465, 21.143131455395632656, 126.37109984691414866, 110.92540069387177937, + 39.007382960942777572, 108.79001151886768639, 44.601372602766787168, 9.1833995011656952556, + 2.3166410972917219624, 126.83097900662323809, 23.598597923879424343, 73.040880322096199961, + 87.178075944113516016, 30.471165679966361495, 127.64350362218465307, 102.88511953349370742, + 125.69150995739619248, 59.964581633248599246, 54.321100307912274729, 19.147840231969894376, + 62.077323454053839669, 99.306110249599441886, 41.500127817329484969, 8.2943257197184721008, + 21.284673507911065826, 19.355325339329283452, 57.141471358783746837, 122.41126915279164677, + 104.63537048643411254, 51.800385005670250393, 95.668992851620714646, 62.863332584613090148, + 113.19002022098720772, 1.5658609498532314319, 25.141009965485864086, 61.277662688229611376, + 11.50808851884357864, 74.70839721878292039, 57.228517707168066408, 59.706138069293956505, + 127.19115718668399495, 104.61115489302756032, 86.399950625916972058, 86.680313623881374951, + 16.628484337888949085, 1.1445597326492134016, 7.5986309063737280667, 113.91518797870594426, + 60.049079638658440672, 92.994384188448748318, 70.26182455583330011, 25.826555775256565539, + 59.810274986488366267, 66.042202318116324022, 2.8930055397941032425, 17.065809730363980634, + 112.05287933241925202, 62.253446124817855889, 10.823018902374315076, 27.596137751825153828, + 32.03866030622884864, 82.490932162567332853, 22.864511508836585563, 38.536964618644560687, + 103.37944522542602499, 40.911240252771676751, 87.464226309948571725, 68.859967814671108499, + 91.18233496101674973, 64.991150044617825188, 1.3624503259161429014, 52.22297859479294857, + 120.48084368525451282, 46.715249488413974177, 102.60869761298818048, 105.28580799795963685, + 59.737399332014319953, 29.58060992088940111, 95.895951118676748592, 21.873560786443704274, + 95.381054501183825778, 92.092601870335784042, 95.668634265573928133, 123.62339301311658346, + 107.74667837494052947, 42.990769953801645897, 88.125749100214306964, 100.85016937496766332, + 99.417499163853790378, 37.036050019854883431, 90.568749268881219905, 10.524734160888328915, + 36.119111514402902685, 22.866184756421716884, 91.857677238669566577, 38.776892568683251739, + 29.491867621301935287, 95.418257332094071899, 103.90519800814945484, 18.871507412193750497, + 24.934990388472215272, 33.656608461664291099, 6.1933520671045698691, 108.86615540073762531, + 59.851623114682297455, 91.424452339892013697, 77.341801265680260258, 80.271414474307675846, + 82.988290268473065225, 118.51432214126180043, 75.848885577503097011, 55.863249181533319643, + 91.442378510062553687, 49.857726254522276577, 56.250473661173600703, 95.970700290956301615, + 80.401592436290229671, 10.729237760409887414, 61.607229976398230065, 103.58343119576602476, + 26.939496749553654809, 12.715283722751337336, 103.22028901558223879, 15.839049942798737902, + 73.784546569389931392, 86.569759872862050543, 19.078657495389052201, 97.440923119662329555, + 42.324812571070651757, 95.330003009363281308, 47.714995509053551359, 90.573858036455931142, + 58.423420148301374866, 66.207709940263157478, 56.715382366379344603, 127.15429705664791982, + 40.069154361714026891, 102.58012858284564572, 5.1820012025636970066, 76.740739646342262859, + 123.51451441509925644, 106.87659755886852508, 80.252848234646080527, 0.15600708115744055249, + 64.985054098666296341, 53.024833379804476863, 21.495809261385147693, 51.283565517325769179, + 11.240225948120496469, 26.164223825253429823, 34.491817559290211648, 90.842129227832629113, + 41.631664709195320029, 125.36942702445958275, 74.610351596118562156, 72.429063524567027343, + 19.917014964572445024, 83.354518915333756013, 4.4004825098090805113, 85.316634840972255915, + 110.32286648927038186, 85.01174828039802378, 102.13648206476136693, 108.54952073824460967, + 81.737441640529141296, 38.798579599915683502, 61.150921091011696262, 99.410459216738672694, + 7.3409540077627752908, 125.83337157761707203, 99.285998260445921915, 78.82911516071180813, + 57.060680617571051698, 74.488124486666492885, 97.069039076141052647, 96.033414363831980154, + 77.30409048267028993, 4.1339999115880345926, 89.338711662076093489, 87.71539155419668532, + 13.326659187416225905, 74.432410080975387245, 5.7204222123000363354, 58.4545973477725056, + 91.056724705180386081, 48.382908916559244972, 11.080089285340363858, 123.93700974907915224, + 44.42574609250004869, 123.18137568215388455, 62.129840943518502172, 110.94224200125972857, + 85.105815237038768828, 59.200145133836485911, 26.170772830741043435, 78.237939570575690595, + 45.331006480457290309, 15.699581403867341578, 95.937006416592339519, 59.555366926480928669, + 26.614093221629445907, 71.733385374005592894, 48.611688736968062585, 12.553004305758804549, + 2.8304133229466970079, 11.879594140486005927, 74.462418714276282117, 85.167339727417129325, + 67.130722881131077884, 18.33455666354711866, 119.16063735092393472, 113.10692306531927898, + 120.35730611473991303, 13.199576979521225439, 118.92523880290536908, 51.573121535031532403, + 107.04772251756367041, 26.051822720881318673, 36.222395810782472836, 90.068526529415976256, + 67.687113952113577398, 54.437822803534800187, 50.499514741226448677, 121.89535728309419937, + 85.652764464950450929, 43.630201375584874768, 77.952717901825963054, 27.075097139335412066, + 82.5626652169485169, 25.413606637579505332, 100.256691920945741, 18.130043177661718801, + 57.949639553211454768, 85.122816671504551778, 33.459776866944594076, 101.98934807033583638, + 118.95839627224995638, 21.28469913206572528, 82.032279181337798946, 42.130909396775678033, + 92.442300073023943696, 3.9263861989566066768, 101.02951462121563964, 82.748677036750450497, + 39.6232013322187413, 54.881611934062675573, 28.16351610716083087, 121.17394072200841038, + 105.52055773511528969, 74.988498723629163578, 68.618109845167055028, 7.7411859118546999525, + 9.8355758834622974973, 125.93708057955518598, 27.177926654076145496, 124.74164304984151386, + 123.64446617223438807, 102.32193497722619213, 20.403142599043349037, 18.038883963952685008, + 28.777418153120379429, 31.549534075831616065, 45.246989287497854093, 113.12955651928132284, + 47.804353905074094655, 47.901723593015049119, 48.932785100078035612, 105.9518476785524399, + 6.8588088129399693571, 78.415742909313848941, 19.354877127196232323, 52.001815844869270222, + 62.623194403990055434, 1.7793505783520231489, 89.292872567770245951, 26.915843222235707799, + 110.30572635912903934, 4.9178809315417311154, 119.01339020356317633, 30.131959974569326732, + 22.229460462072893279, 67.43079927296275855, 19.455932710850902367, 119.31369856393212103, + 126.11686877560714493, 52.905716912526258966, 84.730179910464357818, 78.219045292524242541, + 100.0765550964497379, 6.6502061619030428119, 23.886466878011560766, 88.999095916500664316, + 5.5939931383036309853, 49.41896519901274587, 52.851489819393464131, 4.8580266907083569095, + 105.89841668850567658, 79.459226119302911684, 94.8095978791534435, 82.58043404664931586, + 95.691887698376376648, 10.751556925370095996, 109.68236942564544734, 16.302644435043475823, + 30.222993250557919964, 54.065600576515862485, 69.156647690451791277, 126.76566193094913615, + 49.023530324637249578, 78.457415348919312237, 111.00857049949991051, 12.881651337829680415, + 0.57287917199209914543, 109.09051855227880878, 107.81720481958473101, 41.95776320811273763, + 63.492979538335930556, 91.788864511927386047, 111.05060742741261492, 15.185490585176012246, + 115.36204766897571972, 15.883836804183374625, 9.1044709508678351995, 57.412141433142096503, + 70.08089620474493131, 120.34603358284584829, 49.453127926670276793, 67.08875952972448431, + 105.68759365188816446, 37.410878146452887449, 85.304650289417622844, 64.520017844253743533, + 42.614817371460958384, 31.060736355848348467, 107.61066230226788321, 96.425462580344174057, + 74.487094061325478833, 21.672953171058907174, 71.750103159913123818, 126.44067344371433137, + 106.11874969852942741, 40.99788827074735309, 122.86554778544814326, 25.188964092842070386, + 78.9397491694544442, 126.73315025440751924, 14.836496768410142977, 65.088245641731191427, + 77.347201513770414749, 66.860856618670368334, 1.2617243892636906821, 121.67944408069161, + 50.898943435418914305, 17.026231641644699266, 108.16987194296962116, 26.321389867112884531, + 88.865879200322524412, 89.797566683264449239, 42.821888911210407969, 3.2489575301005970687, + 42.220760708562011132, 103.0808883531644824, 117.85877856878505554, 93.998649361637944821, + 103.75449024381305207, 38.856343885188834975, 34.209091774919215823, 9.0393525542749557644, + 97.172937170671502827, 11.566946304377779597, 69.75066095339570893, 42.286262910794903291, + 124.74219969383193529, 93.850801387743558735, 78.014765921889193123, 89.580023037735372782, + 89.202745205533574335, 18.366799002331390511, 4.6332821945870819036, 125.66195801324647618, + 47.197195847762486665, 18.081760644196037902, 46.356151888227032032, 60.942331359936360968, + 127.28700724437294411, 77.770239066991052823, 123.38301991479238495, 119.92916326649719849, + 108.64220061582454946, 38.295680463939788751, 124.15464690811131732, 70.612220499198883772, + 83.000255634658969939, 16.588651439436944202, 42.569347015822131652, 38.710650678658566903, + 114.28294271757113165, 116.82253830558693153, 81.270740972868225072, 103.60077001134413877, + 63.337985703241429292, 125.72666516922981828, 98.380040441974415444, 3.1317218997064628638, + 50.282019930971728172, 122.55532537645922275, 23.01617703769079526, 21.416794437565840781, + 114.45703541433613282, 119.41227613859155099, 126.38231437337162788, 81.222309786058758618, + 44.799901251837582095, 45.360627247762749903, 33.25696867577789817, 2.2891194652984268032, + 15.197261812751094112, 99.830375957411888521, 120.09815927732051932, 57.988768376901134616, + 12.52364911166660022, 51.653111550513131078, 119.62054997298037051, 4.0844046362326480448, + 5.7860110795882064849, 34.131619460731599247, 96.105758664838504046, 124.50689224963571178, + 21.646037804748630151, 55.192275503650307655, 64.077320612461335259, 36.981864325134665705, + 45.729023017673171125, 77.073929237292759353, 78.75889045085204998, 81.822480505546991481, + 46.928452619900781428, 9.7199356293458549771, 54.364669922037137439, 1.9823000892356503755, + 2.7249006518322858028, 104.44595718958953512, 112.96168737050902564, 93.430498976831586333, + 77.217395225979998941, 82.571615995919273701, 119.47479866402863991, 59.161219841782440199, + 63.791902237353497185, 43.747121572891046526, 62.762109002371289534, 56.185203740675206063, + 63.337268531151494244, 119.2467860262368049, 87.493356749881058931, 85.981539907606929773, + 48.251498200432251906, 73.700338749938964611, 70.834998327707580756, 74.07210003971340484, + 53.13749853776243981, 21.049468321776657831, 72.23822302880580537, 45.732369512847071746, + 55.715354477339133155, 77.553785137366503477, 58.983735242607508553, 62.836514664191781776, + 79.810396016298909672, 37.743014824387500994, 49.869980776944430545, 67.313216923328582197, + 12.386704134212777717, 89.732310801475250628, 119.70324622936823289, 54.848904679787665373, + 26.683602531364158494, 32.542828948618989671, 37.97658053694976843, 109.02864428252723883, + 23.697771155006194022, 111.72649836307027726, 54.884757020125107374, 99.715452509044553153, + 112.50094732235083939, 63.941400581916241208, 32.803184872580459341, 21.458475520819774829, + 123.21445995280009811, 79.166862391532049514, 53.878993499107309617, 25.430567445506312652, + 78.440578031164477579, 31.678099885601113783, 19.569093138783500763, 45.139519745724101085, + 38.157314990781742381, 66.881846239324659109, 84.649625142144941492, 62.660006018726562615, + 95.429991018110740697, 53.147716072911862284, 116.84684029660638771, 4.4154198805263149552, + 113.43076473276232718, 126.30859411329583963, 80.13830872343169176, 77.160257165691291448, + 10.364002405131031992, 25.481479292688163696, 119.02902883020215086, 85.753195117740688147, + 32.505696469292161055, 0.31201416231851908378, 1.9701081973325926811, 106.04966675960895373, + 42.991618522770295385, 102.56713103465153836, 22.480451896240992937, 52.328447650506859645, + 68.983635118584061274, 53.684258455665258225, 83.263329418394278036, 122.73885404892280349, + 21.220703192240762291, 16.858127049134054687, 39.834029929148528026, 38.709037830667512026, + 8.8009650196217990015, 42.63326968194814981, 92.645732978544401703, 42.02349656079968554, + 76.272964129526371835, 89.099041476492857328, 35.474883281058282591, 77.597159199831367005, + 122.3018421820270305, 70.820918433477345388, 14.68190801552918856, 123.66674315523778205, + 70.571996520895481808, 29.65823032142361626, 114.12136123514574138, 20.976248973336623749, + 66.138078152285743272, 64.066828727667598287, 26.60818096534057986, 8.2679998231797071639, + 50.677423324155824957, 47.43078310839337064, 26.653318374836089788, 20.864820161950774491, + 11.440844424600072671, 116.90919469554864918, 54.113449410360772163, 96.765817833118489943, + 22.160178570684365695, 119.87401949815830449, 88.851492185003735358, 118.36275136430776911, + 124.25968188704064232, 93.884484002523095114, 42.211630474077537656, 118.40029026767297182, + 52.34154566148572485, 28.475879141151381191, 90.662012960914580617, 31.399162807738321135, + 63.874012833184679039, 119.11073385296185734, 53.228186443262529792, 15.466770748011185788, + 97.22337747393612517, 25.106008611517609097, 5.6608266458933940157, 23.759188280975649832, + 20.924837428556202212, 42.334679454837896628, 6.2614457622621557675, 36.669113327097875299, + 110.32127470185150742, 98.213846130642195931, 112.71461222947982606, 26.399153959046088858, + 109.85047760581073817, 103.14624307006670278, 86.095445035127340816, 52.103645441762637347, + 72.444791621568583651, 52.137053058835590491, 7.3742279042271547951, 108.87564560706960037, + 100.99902948245653533, 115.79071456619203673, 43.305528929900901858, 87.260402751173387514, + 27.905435803651926108, 54.150194278674462112, 37.125330433897033799, 50.827213275162648642, + 72.513383841891482007, 36.260086355323437601, 115.89927910642654751, 42.245633343009103555, + 66.919553733892826131, 75.978696140675310744, 109.91679254449991276, 42.569398264135088539, + 36.064558362675597891, 84.261818793554994045, 56.884600146047887392, 7.8527723979168513324, + 74.059029242434917251, 37.497354073500900995, 79.246402664437482599, 109.76322386812535115, + 56.327032214325299719, 114.34788144402045873, 83.041115470234217355, 21.976997447261965135, + 9.2362196903341100551, 15.482371823709399905, 19.671151766928232973, 123.87416115911037195, + 54.355853308155928971, 121.48328609968666569, 119.28893234447241412, 76.643869954452384263, + 40.806285198086698074, 36.077767927905370016, 57.554836306240758859, 63.099068151663232129, + 90.493978574999346165, 98.25911303856264567, 95.60870781014818931, 95.803447186030098237, + 97.865570200159709202, 83.903695357104879804, 13.717617625883576693, 28.831485818627697881, + 38.709754254392464645, 104.00363168973854044, 125.24638880798011087, 3.5587011567076842766, + 50.585745135540491901, 0, 92.611452718258078676, 9.8357618630871002097, + 110.02678040712635266, 60.263919949138653465, 44.458920924149424536, 6.8615985459255171008, + 38.911865421705442714, 110.62739712786788004, 124.23373755121428985, 105.81143382505615591, + 41.460359820932353614, 28.43809058505212306, 72.153110192899475805, 13.300412323806085624, + 47.772933756026759511, 49.998191833001328632, 11.187986276607261971, 98.837930398025491741, + 105.70297963878692826, 9.7160533814203517977, 83.796833377014991129, 30.918452238609461347, + 61.61919575831052498, 37.160868093302269699, 63.383775396752753295, 21.503113850743829971, + 91.364738851290894672, 32.605288870086951647, 60.445986501115839928, 108.13120115303536295, + 10.313295380907220533, 125.5313238618982723, 98.047060649278137134, 28.914830697842262452, + 94.017140998999821022, 25.76330267565936083, 1.1457583439878362697, 90.181037104561255546, + 87.634409639169462025, 83.915526416225475259, 126.98595907667549909, 55.577729023858410073, + 94.10121485482522985, 30.370981170355662471, 102.72409533795143943, 31.767673608366749249, + 18.208941901735670399, 114.82428286628783098, 12.1617924094935006, 112.69206716569169657, + 98.906255853344191564, 6.1775190594526065979, 83.375187303776328918, 74.821756292909412878, + 42.609300578838883666, 1.0400356885074870661, 85.229634742921916768, 62.121472711700334912, + 87.22132460453940439, 64.850925160691986093, 20.974188122650957666, 43.345906342121452326, + 15.500206319829885615, 124.88134688743230072, 84.237499397058854811, 81.995776541498344159, + 117.73109557089628652, 50.37792818568777875, 29.879498338912526378, 125.46630050881503848, + 29.672993536823923932, 2.1764912834660208318, 26.694403027544467477, 5.7217132373407366686, + 2.5234487785310193431, 115.35888816138321999, 101.79788687083782861, 34.052463283293036511, + 88.339743885939242318, 52.64277973422940704, 49.731758400648686802, 51.595133366528898478, + 85.643777822420815937, 6.4979150602011941373, 84.441521417127660243, 78.161776706332602771, + 107.71755713757374906, 59.997298723279527621, 79.50898048762610415, 77.712687770377669949, + 68.418183549838431645, 18.078705108553549508, 66.345874341343005653, 23.133892608759197174, + 11.501321906791417859, 84.572525821593444562, 121.48439938766750856, 59.701602775490755448, + 28.029531843782024225, 51.160046075474383542, 50.405490411067148671, 36.733598004662781022, + 9.266564389177801786, 123.32391602649295237, 94.394391695524973329, 36.163521288392075803, + 92.712303776454064064, 121.88466271987635992, 126.57401448874952621, 27.540478133985743625, + 118.76603982958840788, 111.85832653299803496, 89.284401231649098918, 76.591360927883215481, + 120.30929381622627261, 13.224440998401405523, 38.000511269317939878, 33.177302878873888403, + 85.138694031644263305, 77.421301357320771785, 100.56588543514590128, 105.64507661117750104, + 34.541481945740088122, 79.201540022688277531, 126.67597140648649656, 123.45333033846327453, + 68.760080883948830888, 6.2634437994129257277, 100.56403986194709432, 117.11065075291844551, + 46.032354075381590519, 42.83358887513531954, 100.91407082867590361, 110.82455227718673996, + 124.76462874674689374, 34.444619572117517237, 89.599802503675164189, 90.721254495525499806, + 66.51393735155579634, 4.5782389305968536064, 30.394523625505826203, 71.660751914827415021, + 112.19631855464103865, 115.97753675380226923, 25.04729822333320044, 103.30622310102990014, + 111.24109994596074102, 8.1688092724652960896, 11.57202215917641297, 68.263238921466836473, + 64.211517329680646071, 121.01378449927142356, 43.292075609497260302, 110.38455100730425329, + 0.15464122492267051712, 73.963728650269331411, 91.45804603534998023, 26.147858474589156685, + 29.517780901707737939, 35.644961011093982961, 93.856905239801562857, 19.439871258691709954, + 108.72933984407427488, 3.964600178471300751, 5.4498013036682095844, 80.891914379182708217, + 97.92337474102168926, 58.860997953666810645, 26.43479045196363586, 37.14323199184218538, + 110.94959732805727981, 118.3224396835648804, 127.58380447470699437, 87.494243145782093052, + 125.52421800474257907, 112.37040748135041213, 126.67453706230662647, 110.49357205247724778, + 46.986713499765755842, 43.963079815213859547, 96.502996400868141791, 19.400677499881567201, + 13.669996655418799492, 20.14420007942680968, 106.27499707552487962, 42.098936643556953641, + 16.47644605761161074, 91.464739025694143493, 111.43070895468190429, 27.107570274733006954, + 117.96747048521501711, 125.67302932838720153, 31.620792032597819343, 75.486029648775001988, + 99.739961553892499069, 6.6264338466571643949, 24.773408268429193413, 51.464621602954139234, + 111.40649245873646578, 109.69780935957533075, 53.367205062728316989, 65.085657897237979341, + 75.953161073903174838, 90.057288565054477658, 47.395542310016026022, 95.452996726140554529, + 109.76951404025385273, 71.430905018092744285, 97.001894644701678772, 127.88280116383248242, + 65.606369745160918683, 42.916951041643187637, 118.4289199056038342, 30.333724783064099029, + 107.75798699821461923, 50.861134891016263282, 28.881156062328955159, 63.356199771202227566, + 39.138186277567001525, 90.27903949144820217, 76.314629981567122741, 5.763692478652956197, + 41.299250284289882984, 125.32001203745676321, 62.859982036221481394, 106.29543214582736255, + 105.69368059321277542, 8.8308397610562678892, 98.861529465528292349, 124.61718822659531725, + 32.276617446867021499, 26.320514331382582895, 20.728004810262063984, 50.962958585379965371, + 110.05805766040793969, 43.506390235481376294, 65.01139293858432211, 0.62402832463703816757, + 3.9402163946688233409, 84.099333519217907451, 85.983237045544228749, 77.134262069303076714, + 44.960903792481985874, 104.65689530101735727, 9.9672702371681225486, 107.36851691133415443, + 38.526658836792194052, 117.47770809784560697, 42.441406384481524583, 33.716254098268109374, + 79.668059858297056053, 77.418075661335024051, 17.601930039243598003, 85.266539363899937598, + 57.291465957088803407, 84.046993121603009058, 24.545928259056381648, 50.198082952985714655, + 70.949766562120203162, 27.194318399666371988, 116.60368436405769899, 13.641836866954690777, + 29.363816031062015099, 119.33348631047920207, 13.143993041790963616, 59.316460642850870499, + 100.24272247029148275, 41.952497946676885476, 4.2761563045751245227, 0.13365745533519657329, + 53.21636193068115972, 16.535999646359414328, 101.35484664831164991, 94.861566216786741279, + 53.306636749672179576, 41.729640323901548982, 22.88168884920378332, 105.81838939109729836, + 108.2268988207251823, 65.531635666236979887, 44.320357141372369369, 111.74803899632024695, + 49.702984370011108695, 108.7255027286191762, 120.51936377408492262, 59.768968005046190228, + 84.42326094815871329, 108.80058053534594364, 104.6830913229714497, 56.951758282306400361, + 53.324025921829161234, 62.79832561547664227, 127.74802566637299606, 110.22146770592371468, + 106.45637288652505958, 30.933541496026009554, 66.446754947872250341, 50.212017223035218194, + 11.321653291786788031, 47.518376561951299664, 41.849674857112404425, 84.669358909675793257, + 12.522891524524311535, 73.338226654199388577, 92.642549403706652811, 68.42769226128802984, + 97.429224458959652111, 52.798307918095815694, 91.700955211625114316, 78.292486140137043549, + 44.190890070254681632, 104.20729088352891267, 16.889583243137167301, 104.27410611767118098, + 14.748455808457947569, 89.751291214142838726, 73.998058964916708646, 103.58142913238407345, + 86.611057859805441694, 46.520805502346775029, 55.810871607303852215, 108.30038855734892422, + 74.250660867794067599, 101.65442655032893526, 17.026767683782964014, 72.520172710650513181, + 103.79855821285309503, 84.491266686021845089, 5.83910746778929024, 23.957392281354259467, + 91.83358508899982553, 85.138796528270177078, 72.129116725354833761, 40.52363758710998809, + 113.76920029209577478, 15.705544795837340644, 20.118058484869834501, 74.994708147005439969, + 30.492805328878603177, 91.526447736250702292, 112.65406442865423742, 100.69576288804455544, + 38.08223094046843471, 43.95399489452393027, 18.47243938066822011, 30.96474364741879981, + 39.342303533860103926, 119.74832231822074391, 108.71170661631549592, 114.96657219937696937, + 110.57786468894846621, 25.287739908904768527, 81.612570396173396148, 72.155535855810740031, + 115.10967261248151772, 126.19813630333010224, 52.987957150002330309, 68.518226077128929319, + 63.217415620300016599, 63.606894372063834453, 67.731140400323056383, 39.807390714209759608, + 27.435235251767153386, 57.662971637255395763, 77.419508508788567269, 80.007263379480718868, + 122.49277761596022174, 7.1174023134153685533, 101.1714902710809838, 0, + 57.222905436516157351, 19.671523726177838398, 92.053560814252705313, 120.52783989827730693, + 88.917841848298849072, 13.723197091851034202, 77.823730843414523406, 93.254794255739398068, + 120.46747510243221768, 83.622867650112311821, 82.920719641864707228, 56.8761811701078841, + 16.306220385798951611, 26.600824647612171248, 95.545867512053519022, 99.996383666002657264, + 22.37597255321816192, 69.67586079605462146, 83.405959277573856525, 19.432106762844341574, + 39.593666754029982258, 61.836904477218922693, 123.23839151662104996, 74.321736186604539398, + 126.76755079350550659, 43.006227701491297921, 54.729477702581789345, 65.210577740173903294, + 120.89197300223531784, 88.262402306070725899, 20.626590761818079045, 123.06264772380018258, + 68.094121298556274269, 57.829661395688162884, 60.034281997999642044, 51.526605351318721659, + 2.2915166879793105181, 52.362074209126149071, 47.268819278342562029, 39.831052832454588497, + 125.97191815335099818, 111.15545804772045813, 60.202429709650459699, 60.74196234071496292, + 77.448190675902878866, 63.535347216733498499, 36.417883803474978777, 101.64856573257566197, + 24.323584818990639178, 97.384134331387031125, 69.812511706688383128, 12.355038118908851175, + 38.750374607556295814, 21.643512585818825755, 85.218601157677767333, 2.080071377018612111, + 42.459269485843833536, 124.2429454234043078, 46.44264920908244676, 1.7018503213839721866, + 41.948376245301915333, 86.691812684242904652, 31.000412639663409209, 121.76269377486823942, + 40.474998794121347601, 35.991553083000326296, 107.46219114179257303, 100.7558563713755575, + 59.758996677828690736, 122.93260101763007697, 59.345987073647847865, 4.3529825669320416637, + 53.388806055088934954, 11.443426474681473337, 5.0468975570656766649, 102.71777632277007797, + 75.59577374167565722, 68.104926566589711001, 48.679487771878484637, 105.28555946845881408, + 99.463516801297373604, 103.19026673306143493, 43.287555644841631874, 12.995830120406026253, + 40.883042834258958464, 28.323553412668843521, 87.43511427514749812, 119.99459744656269322, + 31.017960975255846279, 27.425375540758977877, 8.8363670996768632904, 36.157410217110736994, + 4.6917486826860113069, 46.267785217518394347, 23.002643813586473698, 41.145051643190527102, + 114.96879877533501713, 119.4032055509815109, 56.05906368756404845, 102.32009215094876708, + 100.81098082213429734, 73.467196009325562045, 18.533128778359241551, 118.64783205298954272, + 60.788783391049946658, 72.327042576787789585, 57.424607552911766106, 115.76932543975635781, + 125.14802897749905242, 55.080956267975125229, 109.53207965918045375, 95.716653065999707906, + 50.568802463301835814, 25.182721855770068942, 112.61858763245254522, 26.448881996802811045, + 76.001022538635879755, 66.354605757751414785, 42.277388063292164588, 26.84260271464518155, + 73.131770870295440545, 83.290153222355002072, 69.082963891483814223, 30.403080045380193042, + 125.3519428129766311, 118.90666067693018704, 9.5201617678976617754, 12.526887598829489434, + 73.128079723897826625, 106.22130150583689101, 92.064708150763181038, 85.667177750274277059, + 73.828141657355445204, 93.649104554377117893, 121.52925749349378748, 68.889239144238672452, + 51.199605007353966357, 53.44250899105463759, 5.0278747031115926802, 9.1564778611937072128, + 60.789047251015290385, 15.321503829658468021, 96.392637109285715269, 103.95507350760453846, + 50.094596446670038858, 78.61244620206343825, 94.482199891921482049, 16.337618544930592179, + 23.144044318356463918, 8.5264778429373109248, 0.42303465936493012123, 114.02756899854284711, + 86.584151218998158583, 92.769102014608506579, 0.30928244984897901304, 19.9274573005423008, + 54.916092070699960459, 52.295716949178313371, 59.035561803415475879, 71.289922022191603901, + 59.713810479603125714, 38.879742517387057887, 89.458679688148549758, 7.9292003569426015019, + 10.899602607340057148, 33.783828758369054412, 67.846749482043378521, 117.72199590733362129, + 52.86958090392727172, 74.286463983688008739, 93.899194656118197599, 108.64487936713339877, + 127.16760894941762672, 46.988486291567824082, 123.04843600948879612, 96.740814962704462232, + 125.34907412461689091, 92.98714410495449556, 93.973426999531511683, 87.926159630431357073, + 65.005992801736283582, 38.801354999763134401, 27.339993310837598983, 40.288400158857257338, + 84.549994151049759239, 84.197873287113907281, 32.95289211522685946, 54.929478051391924964, + 94.861417909363808576, 54.215140549469651887, 107.93494097043367219, 123.34605865677440306, + 63.241584065199276665, 22.972059297553641954, 71.479923107784998138, 13.25286769331432879, + 49.546816536858386826, 102.92924320591191645, 94.812984917476569535, 91.395618719150661491, + 106.73441012546027196, 2.1713157944795966614, 23.906322147809987655, 52.114577130108955316, + 94.791084620035690023, 62.905993452284747036, 91.539028080511343433, 14.861810036189126549, + 66.003789289406995522, 127.76560232766860281, 3.2127394903218373656, 85.833902083290013252, + 108.85783981120766839, 60.667449566131836036, 87.515973996429238468, 101.72226978203252656, + 57.762312124657910317, 126.71239954240445513, 78.276372555137641029, 52.55807898290004232, + 24.629259963134245481, 11.527384957305912394, 82.598500568583403947, 122.64002407491352642, + 125.71996407244660077, 84.590864291658363072, 83.387361186425550841, 17.661679522116173757, + 69.723058931060222676, 121.23437645319063449, 64.553234893734042998, 52.641028662765165791, + 41.456009620524127968, 101.92591717076356872, 92.116115320815879386, 87.012780470966390567, + 2.0227858771686442196, 1.2480566492740763351, 7.8804327893412846606, 40.198667038439452881, + 43.966474091092095478, 26.268524138606153429, 89.921807584967609728, 81.313790602034714539, + 19.934540474339883076, 86.737033822668308858, 77.053317673588026082, 106.95541619569121394, + 84.882812768963049166, 67.432508196539856726, 31.336119716597750084, 26.836151322670048103, + 35.203860078490833985, 42.533078727799875196, 114.58293191418124479, 40.093986243206018116, + 49.091856518112763297, 100.39616590597506729, 13.899533124240406323, 54.388636799336381955, + 105.20736872811539797, 27.283673733909381554, 58.727632062127668178, 110.66697262095840415, + 26.287986083581927232, 118.63292128570537898, 72.485444940582965501, 83.904995893353770953, + 8.5523126091502490453, 0.26731491067039314657, 106.43272386136231944, 33.071999292722466635, + 74.709693296626937808, 61.723132433573482558, 106.61327349934435915, 83.459280647803097963, + 45.763377698411204619, 83.636778782198234694, 88.453797641454002587, 3.0632713324739597738, + 88.640714282748376718, 95.496077992640493903, 99.405968740025855368, 89.451005457241990371, + 113.03872754816984525, 119.53793601009601844, 40.84652189632106456, 89.601161070695525268, + 81.366182645942899399, 113.90351656461280072, 106.64805184365832247, 125.59665123095692252, + 127.49605133274963009, 92.442935411851067329, 84.912745773050119169, 61.867082992055657087, + 4.8935098957445006818, 100.42403444607043639, 22.643306583573576063, 95.036753123902599327, + 83.699349714228446828, 41.338717819351586513, 25.045783049052261049, 18.676453308402415132, + 57.2850988074169436, 8.8553845225796976592, 66.858448917919304222, 105.59661583619526937, + 55.401910423253866611, 28.584972280274087097, 88.381780140513001243, 80.414581767057825346, + 33.779166486277972581, 80.548212235342361964, 29.496911616919533117, 51.50258242828931543, + 19.996117929837055271, 79.162858264771784889, 45.222115719610883389, 93.041611004693550058, + 111.62174321461134241, 88.600777114701486425, 20.501321735591773177, 75.308853100657870527, + 34.053535367569566006, 17.040345421304664342, 79.597116425709828036, 40.982533372043690179, + 11.67821493557858048, 47.914784562712156912, 55.667170178003289038, 42.277593056543992134, + 16.258233450709667522, 81.047275174223614158, 99.538400584191549569, 31.411089591674681287, + 40.236116969743306981, 21.989416294010879938, 60.985610657760844333, 55.052895472505042562, + 97.308128857312112814, 73.391525776089110877, 76.16446188093686942, 87.90798978904786054, + 36.94487876133644022, 61.92948729483759962, 78.68460706772384583, 111.4966446364451258, + 89.423413232634629821, 101.93314439875757671, 93.155729377896932419, 50.575479817813175032, + 35.225140792350430274, 16.311071711625118041, 102.21934522496667341, 124.39627260666020447, + 105.9759143000082986, 9.0364521542578586377, 126.4348312406000332, 127.21378874413130688, + 7.4622808006461127661, 79.614781428419519216, 54.870470503534306772, 115.3259432745144295, + 26.839017017580772517, 32.014526758965075715, 116.98555523192044348, 14.234804626834375085, + 74.342980542165605584, 0, 114.4458108730323147, 39.343047452359314775, + 56.107121628509048605, 113.05567979655825184, 49.835683696597698145, 27.446394183705706382, + 27.647461686832684791, 58.509588511482434114, 112.93495020486807334, 39.245735300228261622, + 37.841439283729414456, 113.7523623402157682, 32.612440771597903222, 53.201649295227980474, + 63.091735024110676022, 71.992767332005314529, 44.751945106439961819, 11.351721592112880899, + 38.81191855514771305, 38.864213525688683148, 79.187333508059964515, 123.67380895444148337, + 118.4767830332457379, 20.643472373212716775, 125.53510158701101318, 86.012455402982595842, + 109.45895540516721667, 2.4211554803514445666, 113.78394600447427365, 48.524804612141451798, + 41.253181523639796069, 118.12529544760400313, 8.1882425971125485376, 115.65932279137632577, + 120.06856399599928409, 103.05321070263744332, 4.5830333759586210363, 104.72414841825229814, + 94.537638556685124058, 79.662105664912814973, 123.94383630670563434, 94.310916095440916251, + 120.4048594193009194, 121.48392468143356382, 26.896381351805757731, 127.070694433466997, + 72.835767606953595532, 75.297131465151323937, 48.647169637984916335, 66.768268662777700229, + 11.625023413376766257, 24.710076237817702349, 77.500749215112591628, 43.287025171641289489, + 42.437202315355534665, 4.160142754037224222, 84.918538971691305051, 120.48589084680861561, + 92.885298418164893519, 3.4037006427679443732, 83.896752490607468644, 45.383625368485809304, + 62.000825279330456397, 115.52538754973647883, 80.949997588242695201, 71.983106166004290571, + 86.924382283588784048, 73.511712742751115002, 119.51799335566101945, 117.86520203526015393, + 118.69197414729569573, 8.7059651338640833274, 106.77761211017786991, 22.886852949362946674, + 10.093795114134991309, 77.435552645543793915, 23.191547483354952419, 8.2098531331794220023, + 97.358975543760607252, 82.57111893692126614, 70.927033602598385187, 78.380533466122869868, + 86.575111289683263749, 25.991660240812052507, 81.766085668517916929, 56.64710682534132502, + 46.870228550298634218, 111.98919489312538644, 62.035921950511692557, 54.850751081517955754, + 17.672734199353726581, 72.314820434221473988, 9.3834973653720226139, 92.535570435036788695, + 46.005287627172947396, 82.290103286384692183, 101.93759755067367223, 110.80641110196302179, + 112.11812737513173488, 76.640184301901172148, 73.621961644272232661, 18.93439201865112409, + 37.06625755672212108, 109.29566410597908543, 121.5775667821035313, 16.65408515357557917, + 114.84921510582717019, 103.5386508795163536, 122.29605795499810483, 110.16191253595388844, + 91.06415931836454547, 63.433306131999415811, 101.13760492660367163, 50.365443711543775862, + 97.237175264905090444, 52.897763993609260069, 24.002045077275397489, 4.7092115155028295703, + 84.554776126584329177, 53.685205429294001078, 18.263541740594519069, 38.580306444713642122, + 10.165927782967628445, 60.806160090764024062, 122.70388562595690018, 109.81332135386037407, + 19.040323535795323551, 25.053775197662616847, 18.256159447799291229, 84.44260301167742, + 56.129416301530000055, 43.334355500552192098, 19.656283314714528387, 59.298209108757873764, + 115.05851498699121294, 9.7784782884773449041, 102.39921001470793271, 106.88501798210927518, + 10.05574940622318536, 18.312955722387414426, 121.57809450203058077, 30.643007659320574021, + 64.785274218575068517, 79.910147015209076926, 100.1891928933437157, 29.224892404130514478, + 60.964399783842964098, 32.675237089861184359, 46.288088636712927837, 17.05295568587462185, + 0.84606931873349822126, 100.0551379970893322, 45.168302437999955146, 57.538204029217013158, + 0.61856489969795802608, 39.8549146010846016, 109.83218414139992092, 104.59143389835662674, + 118.07112360683458974, 14.579844044383207802, 119.42762095920625143, 77.759485034777753754, + 50.917359376297099516, 15.858400713885203004, 21.799205214680114295, 67.567657516741746804, + 7.6934989640903950203, 107.44399181466724258, 105.73916180785818142, 20.572927967379655456, + 59.798389312240033178, 89.289758734270435525, 126.33521789883525344, 93.976972583139286144, + 118.09687201898123021, 65.481629925412562443, 122.6981482492374198, 57.9742882099126291, + 59.946853999066661345, 47.852319260866352124, 2.0119856034725671634, 77.602709999526268803, + 54.679986621675197966, 80.576800317718152655, 41.099988302103156457, 40.395746574227814563, + 65.905784230453718919, 109.85895610278748791, 61.722835818727617152, 108.43028109894294175, + 87.869881940870982362, 118.69211731354880612, 126.48316813039855333, 45.944118595110921888, + 14.959846215569996275, 26.505735386628657579, 99.09363307372041163, 77.858486411827470874, + 61.625969834956777049, 54.791237438304960961, 85.468820250920543913, 4.3426315889591933228, + 47.81264429561997531, 104.22915426022154861, 61.582169240071380045, 125.81198690457313205, + 55.078056161022686865, 29.723620072381891077, 4.0075785788176290225, 127.53120465533720562, + 6.4254789806473127101, 43.667804166583664482, 89.71567962241533678, 121.33489913226731005, + 47.031947992862114916, 75.444539564065053128, 115.52462424931945861, 125.42479908481254824, + 28.552745110275282059, 105.11615796580008464, 49.258519926268490963, 23.054769914615462767, + 37.197001137170445872, 117.28004814983069082, 123.43992814489683951, 41.181728583320364123, + 38.774722372851101682, 35.323359044235985493, 11.446117862124083331, 114.46875290638490696, + 1.1064697874680859968, 105.28205732553033158, 82.912019241051893914, 75.851834341530775419, + 56.232230641635396751, 46.025560941932781134, 4.0455717543372884393, 2.4961132985481526703, + 15.760865578682569321, 80.397334076878905762, 87.932948182184190955, 52.537048277215944836, + 51.843615169938857434, 34.627581204069429077, 39.869080948683404131, 45.474067645340255694, + 26.106635347179690143, 85.910832391386065865, 41.765625537929736311, 6.8650163930797134526, + 62.672239433195500169, 53.672302645340096205, 70.407720156981667969, 85.066157455603388371, + 101.16586382836248958, 80.187972486412036233, 98.183713036229164572, 72.792331811950134579, + 27.799066248480812646, 108.77727359867640189, 82.414737456230795942, 54.567347467818763107, + 117.45526412425897433, 93.3339452419168083, 52.575972167167492444, 109.26584257141439593, + 16.97088988116956898, 39.809991786707541905, 17.104625218300498091, 0.53462982134442427196, + 84.865447722724638879, 66.143998585448571248, 21.419386593253875617, 123.4462648671506031, + 85.226546998692356283, 38.918561295606195927, 91.526755396826047217, 39.273557564400107367, + 48.907595282908005174, 6.1265426649515575264, 49.281428565500391414, 62.992155985284625785, + 70.811937480055348715, 50.90201091448761872, 98.077455096343328478, 111.07587202019203687, + 81.693043792645767098, 51.202322141394688515, 34.732365291889436776, 99.807033129229239421, + 85.296103687320282916, 123.19330246191748301, 126.99210266550289816, 56.885870823705772636, + 41.825491546100238338, 123.73416598411131417, 9.7870197914926393423, 72.848068892140872777, + 45.286613167150790105, 62.073506247808836633, 39.398699428456893656, 82.677435638703173026, + 50.091566098104522098, 37.352906616804830264, 114.5701976148338872, 17.710769045163033297, + 5.7168978358422464225, 83.193231672390538733, 110.80382084650773322, 57.169944560551812174, + 48.763560281029640464, 32.829163534115650691, 67.558332972559583141, 33.096424470684723929, + 58.993823233839066233, 103.00516485657863086, 39.992235859677748522, 30.325716529543569777, + 90.444231439225404756, 58.083222009390738094, 95.243486429226322798, 49.201554229402972851, + 41.002643471187184332, 22.617706201315741055, 68.107070735139132012, 34.080690842612966662, + 31.194232851419656072, 81.965066744087380357, 23.35642987115716096, 95.829569125424313825, + 111.33434035600657808, 84.555186113087984268, 32.516466901422973024, 34.094550348450866295, + 71.076801168383099139, 62.822179183349362575, 80.472233939486613963, 43.978832588021759875, + 121.97122131552168867, 110.1057909450137231, 66.616257714627863606, 18.783051552181859734, + 24.328923761877376819, 47.815979578095721081, 73.889757522672880441, 123.85897458967883722, + 29.369214135451329639, 94.993289272893889574, 50.846826465272897622, 75.866288797518791398, + 58.311458755793864839, 101.15095963562635006, 70.450281584700860549, 32.622143423253874062, + 76.438690449936984805, 120.79254521332404693, 83.951828600016597193, 18.072904308519355254, + 124.86966248120370437, 126.42757748826261377, 14.924561601295863511, 31.229562856839038432, + 109.74094100707225152, 102.65188654902885901, 53.678034035161545034, 64.029053517933789408, + 105.97111046384088695, 28.469609253672388149, 20.685961084334849147, 0, + 100.89162174606462941, 78.68609490471862955, 112.21424325702173519, 98.111359593116503675, + 99.671367393195396289, 54.892788367411412764, 55.294923373665369581, 117.01917702296850621, + 97.869900409736146685, 78.491470600456523243, 75.68287856746246689, 99.504724680431536399, + 65.224881543195806444, 106.40329859045596095, 126.18347004822499002, 15.985534664010629058, + 89.503890212879923638, 22.703443184225761797, 77.6238371102954261, 77.728427051381004276, + 30.374667016123567009, 119.34761790888660471, 108.95356606649147579, 41.286944746429071529, + 123.07020317402566434, 44.024910805968829663, 90.917910810334433336, 4.8423109607065271121, + 99.5678920089485473, 97.049609224282903597, 82.506363047283230117, 108.25059089520800626, + 16.376485194228735054, 103.31864558275628951, 112.13712799200220616, 78.106421405274886638, + 9.1660667519208800513, 81.448296836508234264, 61.075277113373886095, 31.324211329829267925, + 119.88767261341490666, 60.621832190885470482, 112.80971883860547678, 114.96784936286712764, + 53.792762703615153441, 126.14138886693763197, 17.671535213910829043, 22.594262930302647874, + 97.294339275973470649, 5.5365373255554004572, 23.250046826753532514, 49.420152475639042677, + 27.001498430225183256, 86.574050343282578979, 84.874404630711069331, 8.3202855080780864228, + 41.83707794338624808, 112.97178169362086919, 57.770596836329787038, 6.8074012855395267252, + 39.793504981214937288, 90.767250736971618608, 124.00165055866455077, 103.05077509947659564, + 33.899995176489028381, 15.966212332012219122, 45.848764567181206075, 19.023425485505867982, + 111.03598671132567688, 107.73040407052394585, 109.38394829459139146, 17.411930267731804634, + 85.555224220355739817, 45.773705898725893348, 20.187590228273620596, 26.87110529108758783, + 46.383094966709904838, 16.419706266362481983, 66.717951087524852483, 37.14223787384617026, + 13.854067205200408353, 28.761066932249377714, 45.150222579366527498, 51.983320481627742993, + 35.532171337035833858, 113.29421365068265004, 93.740457100600906415, 95.978389786250772886, + 124.07184390102338511, 109.70150216303591151, 35.34546839871109114, 16.629640868442947976, + 18.766994730747683207, 57.071140870073577389, 92.01057525434953277, 36.580206572773022344, + 75.875195101350982441, 93.612822203929681564, 96.236254750267107738, 25.280368603805982275, + 19.243923288544465322, 37.86878403730224818, 74.13251511344788014, 90.591328211961808847, + 115.15513356420706259, 33.308170307154796319, 101.69843021165797836, 79.077301759036345175, + 116.59211590999984764, 92.323825071911414852, 54.12831863672909094, 126.8666122640024696, + 74.275209853207343258, 100.7308874230911897, 66.474350529810180888, 105.79552798721852014, + 48.004090154550794978, 9.4184230310092971195, 41.109552253168658353, 107.37041085858800216, + 36.527083481189038139, 77.160612889427284244, 20.331855565935256891, 121.6123201815316861, + 117.40777125191743835, 91.626642707720748149, 38.080647071590647101, 50.107550395325233694, + 36.512318895602220437, 40.885206023354839999, 112.25883260306000011, 86.668711001104384195, + 39.312566629429056775, 118.59641821751938551, 102.11702997398242587, 19.556956576958327787, + 76.798420029419503408, 85.770035964218550362, 20.111498812446370721, 36.62591144477846683, + 115.15618900406116154, 61.286015318644786021, 1.5705484371537750121, 31.820294030421791831, + 72.378385786687431391, 58.449784808261028957, 121.9287995676859282, 65.350474179722368717, + 92.576177273425855674, 34.105911371749243699, 1.6921386374706344213, 72.110275994178664405, + 90.336604875999910291, 115.07640805843402632, 1.2371297993959160522, 79.709829202172841178, + 91.664368282803479815, 81.182867796716891462, 108.14224721366917947, 29.159688088770053582, + 110.85524191841614083, 27.518970069555507507, 101.83471875259419903, 31.716801427770406008, + 43.598410429363866569, 7.1353150334834936075, 15.386997928184428019, 86.887983629338123137, + 83.478323615716362838, 41.145855934759310912, 119.59677862448370433, 50.579517468544509029, + 124.67043579767414485, 59.953945166282210266, 108.1937440379660984, 2.9632598508287628647, + 117.39629649847483961, 115.9485764198252582, 119.89370799813332269, 95.704638521732704248, + 4.0239712069487723056, 27.205419999052537605, 109.35997324335403391, 33.153600635436305311, + 82.199976604206312913, 80.791493148459267104, 3.8115684609110758174, 91.717912205574975815, + 123.44567163745887228, 88.860562197889521485, 47.739763881745602703, 109.38423462710125023, + 124.96633626079710666, 91.888237190221843775, 29.91969243113999255, 53.011470773260953138, + 70.18726614744446124, 27.716972823654941749, 123.2519396699135541, 109.5824748766135599, + 42.937640501841087826, 8.6852631779183866456, 95.625288591243588598, 80.458308520443097223, + 123.16433848014639807, 123.6239738091462641, 110.15611232204537373, 59.447240144763782155, + 8.0151571576388960239, 127.06240931067441124, 12.85095796129462542, 87.335608333170966944, + 51.431359244834311539, 114.6697982645346201, 94.06389598572786781, 22.889079128133744234, + 103.04924849864255521, 122.84959816962509649, 57.105490220554202097, 82.232315931600169279, + 98.517039852536981925, 46.109539829230925534, 74.394002274344529724, 106.56009629966501961, + 118.87985628979367903, 82.363457166640728246, 77.549444745702203363, 70.646718088471970987, + 22.892235724251804641, 100.93750581276981393, 2.2129395749398099724, 82.564114651064301142, + 37.824038482107425807, 23.703668683061550837, 112.4644612832707935, 92.051121883865562268, + 8.0911435086745768785, 4.9922265970963053405, 31.521731157368776621, 32.794668153761449503, + 47.86589636436838191, 105.07409655443188967, 103.68723033987771487, 69.255162408138858154, + 79.738161897366808262, 90.948135290680511389, 52.213270694363018265, 43.82166478277213173, + 83.531251075859472621, 13.730032786159426905, 125.34447886639100034, 107.34460529068383039, + 12.815440313966973918, 42.132314911210414721, 74.331727656728617148, 32.375944972827710444, + 68.367426072461967124, 17.584663623900269158, 55.598132496965263272, 89.554547197356441757, + 36.829474912461591884, 109.13469493564116419, 106.91052824852158665, 58.667890483833616599, + 105.15194433433862287, 90.531685142828791868, 33.94177976233913796, 79.619983573415083811, + 34.209250436600996181, 1.0692596426924865227, 41.730895445452915737, 4.287997170897142496, + 42.838773186511389213, 118.89252973430484417, 42.453093997384712566, 77.837122591216029832, + 55.053510793652094435, 78.547115128800214734, 97.815190565816010348, 12.253085329903115053, + 98.562857131000782829, 125.98431197057288955, 13.62387496011069743, 101.80402182897887542, + 68.154910192690294934, 94.151744040387711721, 35.386087585291534197, 102.40464428278937703, + 69.46473058378251153, 71.614066258462116821, 42.59220737464420381, 118.38660492383860401, + 125.98420533100579632, 113.77174164741154527, 83.650983092204114655, 119.46833196822262835, + 19.574039582988916663, 17.696137784281745553, 90.573226334301580209, 124.14701249561767327, + 78.797398856917425292, 37.354871277406346053, 100.1831321962090442, 74.705813233613298507, + 101.1403952296677744, 35.421538090326066595, 11.433795671688130824, 38.386463344784715446, + 93.607641693015466444, 114.33988912110362435, 97.527120562059280928, 65.658327068234939361, + 7.1166659451191662811, 66.192848941369447857, 117.98764646768177045, 78.010329713157261722, + 79.984471719355497044, 60.651433059090777533, 52.888462878450809512, 116.16644401878511417, + 62.486972858452645596, 98.403108458805945702, 82.005286942374368664, 45.235412402635120088, + 8.2141414702782640234, 68.161381685225933325, 62.388465702842950122, 35.930133488174760714, + 46.712859742317959899, 63.659138250852265628, 94.668680712016794132, 41.110372226175968535, + 65.032933802845946047, 68.189100696905370569, 14.153602336766198277, 125.64435836670236313, + 32.944467878973227926, 87.957665176047157729, 115.94244263104701531, 92.211581890031084185, + 5.2325154292557272129, 37.566103104363719467, 48.657847523754753638, 95.631959156195080141, + 19.779515045349398861, 119.71794917935767444, 58.738428270906297257, 61.986578545787779149, + 101.69365293054943322, 23.732577595037582796, 116.62291751159136766, 74.301919271256338106, + 12.900563169401721098, 65.244286846511386102, 24.87738089987760759, 113.58509042665173183, + 39.903657200033194385, 36.145808617042348487, 121.73932496241104673, 124.85515497652522754, + 29.849123202591727022, 62.459125713681714842, 91.481882014148141025, 77.303773098057718016, + 107.35606807032672805, 0.058107035871216794476, 83.942220927681773901, 56.939218507344776299, + 41.371922168669698294, 0, 73.78324349213289679, 29.372189809440897079, + 96.428486514047108358, 68.222719186236645328, 71.342734786390792578, 109.78557673482282553, + 110.58984674733437714, 106.03835404594065039, 67.739800819475931348, 28.982941200916684465, + 23.365757134928571759, 71.009449360866710776, 2.4497630863952508662, 84.806597180915559875, + 124.36694009644998005, 31.971069328024896095, 51.007780425759847276, 45.406886368455161573, + 27.24767422059449018, 27.456854102762008552, 60.749334032250771997, 110.6952358177768474, + 89.907132132982951589, 82.573889492861781036, 118.14040634805132868, 88.049821611941297306, + 53.835821620668866672, 9.6846219214166922029, 71.135784017900732579, 66.099218448569445172, + 37.012726094570098212, 88.501181790416012518, 32.752970388461108087, 78.637291165516217006, + 96.274255984008050291, 28.212842810549773276, 18.332133503845398081, 34.896593673016468529, + 122.15055422674777219, 62.648422659662173828, 111.77534522682981333, 121.24366438177457894, + 97.619437677214591531, 101.93569872573425528, 107.58552540723394486, 124.28277773387526395, + 35.343070427821658086, 45.188525860608933726, 66.588678551946941298, 11.073074651110800914, + 46.500093653507065028, 98.840304951278085355, 54.002996860454004491, 45.148100686568795936, + 41.748809261422138661, 16.640571016156172846, 83.674155886776134139, 97.943563387241738383, + 115.54119367265957408, 13.61480257107905345, 79.587009962433512555, 53.534501473946875194, + 120.00330111733273952, 78.101550198953191284, 67.799990352978056762, 31.932424664024438243, + 91.697529134362412151, 38.046850971015373943, 94.071973422654991737, 87.460808141051529674, + 90.767896589182782918, 34.823860535467247246, 43.110448440711479634, 91.547411797451786697, + 40.375180456547241192, 53.742210582175175659, 92.766189933419809677, 32.839412532728601946, + 5.4359021750497049652, 74.284475747692340519, 27.708134410400816705, 57.522133864498755429, + 90.300445158733054996, 103.96664096325548599, 71.064342674075305695, 98.58842730136893806, + 59.480914201205450809, 63.956779572505183751, 120.14368780205040821, 91.403004326071823016, + 70.690936797422182281, 33.259281736885895953, 37.533989461495366413, 114.14228174015079276, + 56.02115050869906554, 73.160413145549682667, 23.75039020270560286, 59.225644407863001106, + 64.472509500534215476, 50.56073720761196455, 38.487846577088930644, 75.737568074608134339, + 20.265030226899398258, 53.182656423927255673, 102.31026712841412518, 66.616340614313230617, + 75.396860423319594702, 30.154603518076328328, 105.18423182000333327, 56.647650143822829705, + 108.25663727346181986, 125.73322452800857718, 20.550419706418324495, 73.461774846186017385, + 4.948701059623999754, 83.591055974437040277, 96.008180309101589955, 18.836846062018594239, + 82.219104506340954686, 86.740821717176004313, 73.054166962381714256, 26.321225778854568489, + 40.663711131874151761, 115.22464036306701018, 106.81554250383851468, 55.253285415441496298, + 76.161294143181294203, 100.21510079065046739, 73.024637791204440873, 81.770412046713317977, + 96.5176652061236382, 45.33742200220876839, 78.625133258861751528, 109.19283643504240899, + 76.234059947964851744, 39.113913153920293553, 25.596840058842644794, 43.540071928437100723, + 40.222997624892741442, 73.251822889560571639, 102.31237800812232308, 122.57203063728957204, + 3.1410968743075500242, 63.640588060847221641, 16.756771573374862783, 116.89956961652569589, + 115.85759913537549437, 2.7009483594483754132, 57.152354546851711348, 68.211822743498487398, + 3.3842772749449068215, 16.220551988360966789, 52.673209752003458561, 102.15281611686805263, + 2.4742595987954700831, 31.419658404349320335, 55.328736565610597609, 34.365735593437420903, + 88.284494427338358946, 58.319376177543745143, 93.710483836832281668, 55.037940139114652993, + 75.669437505188398063, 63.433602855540812016, 87.196820858727733139, 14.270630066966987215, + 30.773995856372494018, 45.775967258679884253, 38.956647231432725675, 82.291711869522259803, + 111.19355724896740867, 101.15903493709265604, 121.3408715953482897, 119.90789033256805851, + 88.387488075932196807, 5.9265197016611637082, 106.7925929969533172, 103.89715283965415438, + 111.78741599627028336, 63.409277043465408497, 8.0479424138975446112, 54.410839998108713189, + 90.719946486708067823, 66.3072012708762486, 36.399953208416263806, 33.582986296918534208, + 7.6231369218257896136, 55.435824411153589608, 118.89134327492138254, 49.72112439577904297, + 95.479527763494843384, 90.76846925420613843, 121.9326725215978513, 55.776474380443687551, + 59.8393848622799851, 106.02294154652554425, 12.374532294888922479, 55.433945647313521476, + 118.50387933983074618, 91.1649497532271198, 85.875281003682175651, 17.37052635584041127, + 63.250577182490815176, 32.916617040889832424, 118.32867696029643412, 119.24794761829616618, + 92.312224644090747461, 118.89448028952756431, 16.030314315281430027, 126.12481862134882249, + 25.701915922592888819, 46.671216666341933887, 102.86271848967226106, 101.33959652907287818, + 60.12779197145573562, 45.778158256271126447, 78.098496997288748389, 117.69919633925019298, + 114.21098044111204217, 36.464631863203976536, 69.034079705073963851, 92.219079658465489047, + 20.788004548692697426, 85.120192599333677208, 109.75971257959099603, 36.726914333285094472, + 27.098889491408044705, 13.293436176943941973, 45.78447144850724726, 73.875011625539627858, + 4.4258791498832579236, 37.128229302128602285, 75.648076964214851614, 47.407337366126739653, + 96.928922566545224981, 56.102243767731124535, 16.182287017349153757, 9.9844531941926106811, + 63.043462314737553243, 65.589336307522899006, 95.731792728740401799, 82.148193108867417322, + 79.374460679759067716, 10.510324816281354288, 31.476323794737254502, 53.896270581361022778, + 104.42654138872603653, 87.643329565547901439, 39.062502151718945242, 27.460065572322491789, + 122.68895773278563865, 86.68921058136766078, 25.630880627933947835, 84.26462982242446742, + 20.663455313457234297, 64.751889945659058867, 8.7348521449239342473, 35.169327247800538316, + 111.19626499393416452, 51.109094394712883513, 73.658949824926821748, 90.269389871285966365, + 85.821056497043173295, 117.33578096767087118, 82.303888668680883711, 53.063370285657583736, + 67.883559524681913899, 31.239967146830167621, 68.418500873201992363, 2.1385192853849730454, + 83.461790890905831475, 8.5759943417942849919, 85.677546373026416404, 109.78505946860968834, + 84.90618799477306311, 27.674245182432059664, 110.10702158730782685, 29.094230257604067447, + 67.630381131632020697, 24.506170659809868084, 69.125714262005203636, 123.9686239411457791, + 27.247749920225032838, 75.608043657961388817, 8.3098203853842278477, 60.303488080775423441, + 70.772175170586706372, 76.809288565582392039, 10.92946116756866104, 15.228132516924233641, + 85.184414749292045599, 108.773209847680846, 123.96841066201523063, 99.543483294826728525, + 39.301966184411867289, 110.9366639364452567, 39.148079165977833327, 35.392275568567129085, + 53.146452668606798397, 120.29402499123898451, 29.594797713834850583, 74.709742554816330085, + 72.36626439242172637, 21.411626467230234994, 74.280790459335548803, 70.843076180652133189, + 22.867591343376261648, 76.77292668957306887, 59.215283386034570867, 100.67977824221088667, + 67.054241124122199835, 3.316654136469878722, 14.233331890241970541, 4.3856978827425336931, + 107.97529293536717887, 28.020659426318161422, 31.968943438710994087, 121.30286611818155507, + 105.776925756905257, 104.33288803757022833, 124.97394571690892917, 68.806216917615529383, + 36.010573884748737328, 90.470824805270240176, 16.428282940560166026, 8.3227633704518666491, + 124.77693140568590024, 71.860266976349521428, 93.425719484635919798, 127.31827650170816923, + 61.337361424033588264, 82.220744452355575049, 2.0658676056955300737, 8.3782013938107411377, + 28.307204673536034534, 123.28871673340472626, 65.88893575795009383, 47.915330352097953437, + 103.8848852620976686, 56.423163780062168371, 10.465030858511454426, 75.132206208727438934, + 97.315695047513145255, 63.263918312390160281, 39.5590300907024357, 111.43589835871534888, + 117.47685654181259451, 123.97315709157919628, 75.387305861098866444, 47.465155190078803571, + 105.24583502318637329, 20.603838542512676213, 25.801126338807080174, 2.4885736930227722041, + 49.754761799758853158, 99.170180853303463664, 79.807314400066388771, 72.291617234088334953, + 115.47864992482573143, 121.71030995305045508, 59.698246405183454044, 124.91825142736706766, + 54.963764028299920028, 26.607546196119074011, 86.712136140653456096, 0.11621407174607156776, + 39.884441855363547802, 113.8784370146895526, 82.743844337343034567, 0, + 19.566486984265793581, 58.744379618885432137, 64.856973028097854694, 8.4454383724769286346, + 14.685469572785223136, 91.571153469649289036, 93.179693494672392262, 84.076708091884938767, + 7.4796016389518626966, 57.965882401833368931, 46.731514269860781496, 14.018898721733421553, + 4.8995261727941397112, 41.613194361834757729, 120.73388019289996009, 63.942138656049792189, + 102.01556085151969455, 90.813772736910323147, 54.49534844118898036, 54.913708205524017103, + 121.49866806450518197, 93.390471635557332775, 51.814264265969541157, 37.147778985727200052, + 108.28081269610629533, 48.099643223882594611, 107.67164324133773334, 19.369243842837022385, + 14.271568035805103136, 4.1984368971388903446, 74.025452189143834403, 49.002363580832025036, + 65.505940776925854152, 29.274582331036071992, 64.548511968016100582, 56.425685621099546552, + 36.664267007690796163, 69.793187346036575036, 116.30110845349554438, 125.29684531932798564, + 95.550690453663264634, 114.48732876355279586, 67.238875354432821041, 75.871397451472148532, + 87.171050814471527701, 120.5655554677505279, 70.686140855643316172, 90.377051721221505431, + 5.177357103893882595, 22.146149302221601829, 93.000187307017768035, 69.680609902556170709, + 108.00599372090800898, 90.296201373137591872, 83.497618522844277322, 33.28114203231598367, + 39.348311773555906257, 67.887126774487114744, 103.08238734531914815, 27.22960514216174488, + 31.174019924867025111, 107.06900294789738837, 112.00660223466911702, 28.203100397910020547, + 7.5999807059561135247, 63.864849328052514466, 55.395058268724824302, 76.093701942034385866, + 60.143946845313621452, 46.921616282106697327, 53.535793178365565836, 69.647721070934494492, + 86.220896881426597247, 55.094823594903573394, 80.750360913094482385, 107.4844211643539893, + 57.532379866839619353, 65.678825065457203891, 10.871804350103047909, 20.568951495384681039, + 55.41626882080163341, 115.04426772900114884, 52.60089031746974797, 79.93328192651460995, + 14.128685348154249368, 69.176854602737876121, 118.96182840241090162, 127.91355914501400548, + 112.2873756041044544, 54.80600865214728401, 13.381873594844364561, 66.518563473771791905, + 75.067978922994370805, 100.28456348030158551, 112.04230101740176906, 18.320826291099365335, + 47.50078040541120572, 118.45128881572964019, 0.94501900106843095273, 101.1214744152239291, + 76.975693154181499267, 23.475136149216268677, 40.530060453798796516, 106.36531284785814933, + 76.620534256831888342, 5.2326812286300992128, 22.793720846639189404, 60.309207036156294635, + 82.368463640006666537, 113.29530028764929739, 88.513274546927277697, 123.46644905601715436, + 41.100839412840286968, 18.92354969237203477, 9.8974021192516374867, 39.182111948877718532, + 64.016360618203179911, 37.673692124040826457, 36.43820901268554735, 45.481643434355646605, + 18.108333924763428513, 52.642451557709136978, 81.3274222637519415, 102.44928072613765835, + 85.631085007677029353, 110.50657083088663057, 24.322588286366226384, 72.430201581304572755, + 18.049275582412519725, 35.540824093430273933, 65.035330412247276399, 90.674844004421174759, + 29.250266517727141036, 90.385672870088455966, 24.468119895929703489, 78.227826307840587106, + 51.193680117685289588, 87.080143856874201447, 80.445995249789120862, 18.503645779124781257, + 76.624756016248284141, 117.14406127457914408, 6.2821937486151000485, 127.28117612169444328, + 33.513543146753363544, 105.79913923305502976, 103.71519827075098874, 5.4018967188967508264, + 114.30470909370706067, 8.4236454869969747961, 6.7685545498898136429, 32.441103976721933577, + 105.3464195040105551, 76.305632233736105263, 4.9485191975909401663, 62.839316808698640671, + 110.65747313122119522, 68.731471186878479784, 48.568988854676717892, 116.63875235509112827, + 59.420967673664563335, 110.07588027823294397, 23.338875010376796126, 126.86720571108526201, + 46.393641717455466278, 28.54126013393397443, 61.547991712744988035, 91.551934517359768506, + 77.91329446286908933, 36.583423739048157586, 94.387114497938455315, 74.318069874188950052, + 114.68174319070021738, 111.815780665139755, 48.774976151864393614, 11.853039403325965395, + 85.585185993910272373, 79.794305679311946733, 95.574831992540566716, 126.81855408693081699, + 16.095884827795089222, 108.82167999622106436, 53.439892973419773625, 4.6144025417524971999, + 72.799906416832527611, 67.165972593837068416, 15.246273843651579227, 110.8716488223108172, + 109.78268654984276509, 99.44224879156172392, 62.959055526993324747, 53.536938508415914839, + 115.8653450431957026, 111.5529487608873751, 119.67876972456360818, 84.045883093051088508, + 24.749064589777844958, 110.86789129463068093, 109.00775867966513033, 54.329899506457877578, + 43.750562007364351302, 34.74105271168082254, 126.50115436498163035, 65.833234081783302827, + 108.65735392059650621, 110.49589523659597035, 56.6244492881851329, 109.78896057905512862, + 32.060628630566498032, 124.24963724269764498, 51.403831845185777638, 93.342433332687505754, + 77.725436979348160094, 74.679193058145756368, 120.25558394291147124, 91.556316512545890873, + 28.196993994581134757, 107.39839267850402393, 100.42196088222408434, 72.929263726411591051, + 10.06815941015156568, 56.438159316930978093, 41.576009097389032831, 42.240385198670992395, + 91.519425159181992058, 73.453828666570188943, 54.19777898281608941, 26.586872353887883946, + 91.568942897018132498, 19.750023251079255715, 8.8517582997665158473, 74.256458604260842549, + 23.296153928429703228, 94.814674732257117284, 65.857845133090449963, 112.20448753546224907, + 32.364574034698307514, 19.968906388385221362, 126.08692462947874446, 3.1786726150494359899, + 63.463585457484441577, 36.296386217738472624, 30.748921359518135432, 21.020649632562708575, + 62.952647589474509005, 107.79254116272568353, 80.853082777455711039, 47.286659131095802877, + 78.125004303437890485, 54.920131144648621557, 117.37791546557491529, 45.378421162735321559, + 51.261761255871533649, 40.52925964484893484, 41.326910626918106573, 1.503779891318117734, + 17.469704289847868495, 70.338654495604714612, 94.392529987868329044, 102.21818878942940501, + 19.317899649857281474, 52.538779742575570708, 43.642112994089984568, 106.67156193534538033, + 36.607777337361767422, 106.12674057131880545, 7.7671190493638277985, 62.479934293663973222, + 8.8370017464039847255, 4.2770385707735840697, 38.92358178181166295, 17.151988683592207963, + 43.355092746056470787, 91.570118937223014655, 41.81237598954612622, 55.348490364867757307, + 92.214043174615653697, 58.188460515211772872, 7.260762263264041394, 49.012341319623374147, + 10.251428524014045252, 119.9372478822915582, 54.495499840453703655, 23.216087315922777634, + 16.619640770768455695, 120.60697616155448486, 13.544350341177050723, 25.618577131164784078, + 21.858922335137322079, 30.456265033852105262, 42.368829498587729177, 89.546419695365329972, + 119.93682132403409923, 71.086966589653457049, 78.603932368827372557, 93.87332787289051339, + 78.296158331955666654, 70.78455113713425817, 106.29290533721723477, 112.58804998247796902, + 59.189595427673339145, 21.419485109636298148, 16.73252878484345274, 42.823252934464107966, + 20.561580918674735585, 13.686152361304266378, 45.735182686756161274, 25.54585337914613774, + 118.43056677207277971, 73.359556484425411327, 6.1084822482443996705, 6.633308272939757444, + 28.466663780483941082, 8.771395765488705365, 87.950585870734357741, 56.041318852636322845, + 63.937886877425626153, 114.60573223636674811, 83.553851513814151986, 80.665776075144094648, + 121.94789143382149632, 9.6124338352310587652, 72.021147769501112634, 52.941649610540480353, + 32.856565881120332051, 16.645526740907371277, 121.55386281137543847, 15.720533952702680836, + 58.851438969275477575, 126.63655300341633847, 122.67472284807081451, 36.441488904711150099, + 4.1317352113910601474, 16.756402787621482275, 56.614409347075707046, 118.57743346681309049, + 3.77787151590018766, 95.830660704199544853, 79.769770524195337202, 112.84632756012433674, + 20.93006171702654683, 22.264412417458515847, 66.63139009502629051, 126.52783662478032056, + 79.118060181408509379, 94.871796717434335733, 106.95371308362882701, 119.94631418316203053, + 22.774611722197732888, 94.930310380161245121, 82.491670046372746583, 41.207677085025352426, + 51.602252677614160348, 4.9771473860455444083, 99.509523599521344295, 70.340361706610565307, + 31.614628800136415521, 16.583234468180307886, 102.95729984965510084, 115.42061990610091016, + 119.39649281037054607, 121.83650285473413533, 109.92752805659984006, 53.215092392241786001, + 45.424272281306912191, 0.23242814349214313552, 79.768883710730733583, 99.756874029382743174, + 37.487688674686069135, 0, 39.132973968531587161, 117.48875923777450225, + 1.7139460561957093887, 16.890876744953857269, 29.37093914557408425, 55.142306939302216051, + 58.359386989348422503, 40.153416183769877534, 14.959203277903725393, 115.93176480366673786, + 93.463028539721562993, 28.037797443466843106, 9.7990523455882794224, 83.226388723673153436, + 113.46776038579992019, 127.88427731210322236, 76.031121703043027082, 53.627545473820646293, + 108.99069688237796072, 109.82741641105167218, 114.99733612901400193, 58.780943271114665549, + 103.62852853193908231, 74.295557971458038082, 88.561625392212590668, 96.199286447768827202, + 87.343286482675466686, 38.738487685674044769, 28.543136071610206272, 8.3968737942814186681, + 20.050904378287668806, 98.004727161667688051, 3.0118815538517083041, 58.549164662075781962, + 1.0970239360322011635, 112.8513712421990931, 73.328534015385230305, 11.586374692076788051, + 104.60221690699472674, 122.59369063865960925, 63.101380907330167247, 100.9746575271092297, + 6.4777507088692800608, 23.742794902947935043, 46.342101628946693381, 113.13111093550469377, + 13.372281711290270323, 52.754103442443010863, 10.35471420778776519, 44.292298604446841637, + 58.000374614039174048, 11.361219805115979398, 88.011987441819655942, 52.592402746278821724, + 38.995237045688554645, 66.56228406463196734, 78.696623547115450492, 7.7742535489778674673, + 78.164774690638296306, 54.459210284323489759, 62.348039849737688201, 86.138005895798414713, + 96.013204469338234048, 56.406200795820041094, 15.199961411912227049, 127.72969865610502893, + 110.79011653745328658, 24.187403884068771731, 120.2878936906272429, 93.843232564213394653, + 107.07158635673476965, 11.295442141872626962, 44.441793762853194494, 110.18964718981078477, + 33.500721826192602748, 86.968842328707978595, 115.06475973368287669, 3.3576501309144077823, + 21.743608700206095818, 41.137902990769362077, 110.8325376416069048, 102.08853545800229767, + 105.20178063494313392, 31.866563853029219899, 28.257370696312136715, 10.353709205479390221, + 109.92365680482544121, 127.82711829003164894, 96.574751208208908793, 109.61201730429456802, + 26.763747189692367101, 5.0371269475472217891, 22.135957845992379589, 72.569126960606809007, + 96.084602034803538118, 36.64165258219873067, 95.001560810826049419, 108.90257763145928038, + 1.8900380021404998843, 74.242948830451496178, 25.951386308362998534, 46.950272298432537355, + 81.060120907601231011, 84.73062569571993663, 25.241068513663776685, 10.465362457260198426, + 45.587441693278378807, 120.61841407231622725, 36.736927280016971054, 98.590600575302232755, + 49.026549093858193373, 118.93289811203430872, 82.201678825680573937, 37.847099384744069539, + 19.794804238503274973, 78.364223897759075044, 0.032721236406359821558, 75.347384248081652913, + 72.8764180253710947, 90.963286868711293209, 36.216667849526857026, 105.28490311542191193, + 34.654844527507520979, 76.898561452278954675, 43.262170015357696684, 93.013141661773261148, + 48.645176572736090748, 16.860403162609145511, 36.09855116482503945, 71.081648186864185845, + 2.0706608244981907774, 53.349688008842349518, 58.50053303545792005, 52.771345740176911931, + 48.936239791863044957, 28.455652615681174211, 102.38736023537421715, 46.160287713752040872, + 32.891990499578241725, 37.007291558253200492, 25.24951203250020626, 106.28812254915828817, + 12.564387497233838076, 126.56235224338888656, 67.027086293510365067, 83.598278466113697505, + 79.430396541501977481, 10.803793437797139632, 100.60941818741412135, 16.847290973993949592, + 13.537109099779627286, 64.882207953447505133, 82.692839008024748182, 24.611264467472210526, + 9.8970383951818803325, 125.67863361740091932, 93.314946262446028413, 9.4629423737569595687, + 97.137977709357073763, 105.27750471018225653, 118.84193534733276465, 92.15176055646588793, + 46.677750020757230232, 125.73441142217052402, 92.787283434910932556, 57.08252026786794886, + 123.09598342549361405, 55.103869034723174991, 27.826588925738178659, 73.16684747809995315, + 60.774228995880548609, 20.636139748381538084, 101.36348638140407274, 95.631561330279510003, + 97.549952303728787228, 23.706078806655568769, 43.170371987824182725, 31.588611358627531445, + 63.149663985084771411, 125.63710817386163399, 32.191769655593816424, 89.643359992442128714, + 106.87978594683954725, 9.2288050835086323787, 17.599812833668693202, 6.3319451876741368324, + 30.492547687306796433, 93.743297644625272369, 91.565373099689168157, 70.884497583123447839, + 125.91811105398664949, 107.07387701683546766, 103.73069008639504318, 95.105897521778388182, + 111.35753944913085434, 40.091766186102177016, 49.498129179559327895, 93.735782589264999842, + 90.01551735933026066, 108.65979901291575516, 87.501124014728702605, 69.482105423365283059, + 125.00230872996689868, 3.6664681635702436324, 89.314707841196650406, 92.991790473191940691, + 113.24889857637390378, 91.577921158110257238, 64.121257261136634042, 120.49927448539528996, + 102.80766369037519326, 58.684866665378649486, 27.450873958699958166, 21.358386116295150714, + 112.51116788582658046, 55.112633025091781747, 56.393987989165907493, 86.796785357011685846, + 72.843921764451806666, 17.858527452823182102, 20.136318820303131361, 112.87631863386195619, + 83.152018194778065663, 84.480770397345622769, 55.038850318367622094, 18.907657333140377887, + 108.39555796563217882, 53.173744707779405871, 55.137885794036264997, 39.50004650215851143, + 17.703516599536669673, 20.512917208521685097, 46.592307856863044435, 61.629349464517872548, + 3.7156902661845379043, 96.408975070924498141, 64.729148069396615028, 39.937812776774080703, + 124.17384925895748893, 6.3573452300988719799, 126.92717091496888315, 72.592772435476945248, + 61.497842719036270864, 42.041299265125417151, 125.90529517895265599, 87.585082325455005048, + 33.706165554911422078, 94.573318262195243733, 28.25000860687578097, 109.84026228930088109, + 106.75583093114983058, 90.756842325470643118, 102.5235225117430673, 81.058519289697869681, + 82.653821253836213145, 3.0075597826362354681, 34.939408579699374968, 12.677308991213067202, + 60.785059975740296068, 76.436377578858810011, 38.635799299714562949, 105.07755948515114142, + 87.284225988183607114, 85.343123870690760668, 73.215554674727172824, 84.253481142637610901, + 15.534238098727655597, 124.95986858732794644, 17.674003492807969451, 8.5540771415471681394, + 77.847163563623325899, 34.303977367184415925, 86.710185492116579553, 55.140237874446029309, + 83.624751979092252441, 110.69698072973915259, 56.428086349231307395, 116.37692103042354574, + 14.521524526528082788, 98.024682639246748295, 20.502857048031728482, 111.8744957645831164, + 108.99099968090740731, 46.432174631845555268, 33.23928154154054937, 113.21395232310896972, + 27.088700682354101446, 51.237154262329568155, 43.717844670274644159, 60.912530067704210524, + 84.737658997179096332, 51.092839390734297922, 111.87364264807183645, 14.173933179310552077, + 29.207864737658383092, 59.746655745784664759, 28.592316663914971286, 13.569102274272154318, + 84.585810674438107526, 97.176099964955938049, 118.37919085534667829, 42.838970219272596296, + 33.465057569686905481, 85.646505868928215932, 41.12316183734947117, 27.372304722608532757, + 91.470365373512322549, 51.09170675829591346, 108.86113354414919741, 18.719112968850822654, + 12.216964496488799341, 13.266616545879514888, 56.933327560967882164, 17.542791530981048709, + 47.901171741468715481, 112.08263770527264569, 127.87577375485489029, 101.2114644727371342, + 39.10770302763194195, 33.331552150291827274, 115.89578286764299264, 19.224867670465755509, + 16.042295539002225269, 105.88329922108096071, 65.713131762240664102, 33.291053481818380533, + 115.10772562275087694, 31.441067905405361671, 117.70287793855459313, 125.27310600683631492, + 117.34944569614162901, 72.882977809422300197, 8.2634704227821202949, 33.512805575242964551, + 113.22881869415505207, 109.15486693362618098, 7.5557430318040132988, 63.661321408402727684, + 31.539541048394312384, 97.692655120248673484, 41.860123434053093661, 44.528824834920669673, + 5.2627801900562189985, 125.0556732495642791, 30.236120362820656737, 61.743593434872309444, + 85.907426167261291994, 111.89262836632406106, 45.549223444399103755, 61.86062076032612822, + 36.983340092745493166, 82.415354170050704852, 103.2045053552283207, 9.9542947720947267953, + 71.019047199046326568, 12.680723413221130613, 63.229257600272831041, 33.16646893636425375, + 77.914599699313839665, 102.84123981220545829, 110.79298562074473011, 115.67300570947190863, + 91.855056113199680112, 106.430184784483572, 90.848544562613824382, 0.46485628698792424984, + 31.537767421465105144, 71.513748058765486348, 74.975377349375776248, 0, + 78.265947937066812301, 106.97751847554900451, 3.4278921123914187774, 33.781753489907714538, + 58.741878291148168501, 110.2846138786044321, 116.71877397869684501, 80.306832367539755069, + 29.918406555811088765, 103.8635296073371137, 58.926057079443125986, 56.075594886933686212, + 19.598104691180196824, 38.45277744734994485, 98.935520771603478352, 127.76855462421008269, + 24.062243406086054165, 107.25509094764493057, 89.981393764759559417, 91.654832822106982348, + 101.99467225802800385, 117.56188654223296908, 79.257057063881802605, 20.591115942919714143, + 49.123250784428819316, 64.398572895541292382, 46.686572965350933373, 77.476975371348089539, + 57.086272143220412545, 16.793747588562837336, 40.10180875657897559, 68.009454323335376102, + 6.0237631077034166083, 117.09832932415156392, 2.1940478720680403057, 97.702742484401824186, + 18.657068030770460609, 23.172749384157214081, 81.204433813993091462, 117.1873812773192185, + 126.20276181466397247, 73.949315054218459409, 12.955501417738560122, 47.485589805895870086, + 92.684203257897024741, 98.262221871009387542, 26.744563422580540646, 105.50820688488602173, + 20.70942841557553038, 88.584597208893683273, 116.0007492280783481, 22.722439610235596774, + 48.023974883639311884, 105.18480549255764345, 77.990474091380747268, 5.1245681292675726581, + 29.393247094230900984, 15.548507097959372913, 28.329549381276592612, 108.91842056864697952, + 124.69607969947901438, 44.276011791600467404, 64.026408938676468097, 112.81240159164008219, + 30.399922823828092078, 127.45939731221369584, 93.580233074906573165, 48.374807768141181441, + 112.57578738125812379, 59.686465128430427285, 86.143172713469539303, 22.590884283745253924, + 88.883587525710026966, 92.379294379621569533, 67.001443652388843475, 45.937684657419595169, + 102.12951946736575337, 6.7153002618288155645, 43.487217400412191637, 82.275805981542362133, + 93.665075283217447577, 76.177070916008233326, 82.403561269886267837, 63.733127706058439799, + 56.514741392624273431, 20.70741841096241842, 91.847313609654520405, 127.65423658006693586, + 65.149502416421455564, 91.224034608589136042, 53.527494379384734202, 10.074253895094443578, + 44.271915691988397157, 17.138253921217255993, 64.169204069607076235, 73.283305164401099319, + 62.003121621655736817, 89.805155262918560766, 3.7800760042846377473, 20.485897660902992357, + 51.902772616725997068, 93.900544596868712688, 34.1202418152061, 41.46125139143987326, + 50.482137027327553369, 20.930724914520396851, 91.174883386560395593, 113.2368281446324545, + 73.473854560037580086, 69.181201150604465511, 98.053098187720024725, 109.86579622407225543, + 36.403357651361147873, 75.694198769488139078, 39.589608477010187926, 28.728447795518150087, + 0.065442472816357621923, 22.694768496166943805, 17.752836050745827379, 53.926573737422586419, + 72.433335699057352031, 82.569806230843823869, 69.309689055018679937, 25.797122904557909351, + 86.524340030719031347, 58.026283323546522297, 97.290353145472181495, 33.720806325218291022, + 72.197102329653716879, 14.163296373728371691, 4.1413216489963815548, 106.69937601768469904, + 117.0010660709158401, 105.54269148035382386, 97.872479583726089913, 56.911305231365986401, + 76.774720470748434309, 92.320575427504081745, 65.783980999156483449, 74.014583116506400984, + 50.499024065004050499, 84.576245098316576332, 25.12877499447131413, 125.12470448678141111, + 6.0541725870243681129, 39.196556932231032988, 30.860793083003954962, 21.607586875597917242, + 73.218836374828242697, 33.694581947987899184, 27.074218199562892551, 1.7644159068986482453, + 37.385678016049496364, 49.222528934944421053, 19.794076790367398644, 123.35726723480547662, + 58.629892524892056827, 18.925884747517557116, 66.275955418717785506, 82.555009420368151041, + 109.68387069466916728, 56.30352111293177586, 93.355500041518098442, 123.46882284434468602, + 57.574566869821865112, 114.1650405357395357, 118.1919668509872281, 110.20773806944634998, + 55.653177851479995297, 18.333694956199906301, 121.54845799176109722, 41.272279496766714146, + 74.726972762811783468, 63.263122660562657984, 67.099904607457574457, 47.412157613311137538, + 86.340743975648365449, 63.177222717255062889, 126.2993279701731808, 123.27421634772326797, + 64.383539311191270826, 51.286719984887895407, 85.759571893679094501, 18.457610167017264757, + 35.199625667337386403, 12.663890375348273665, 60.985095374617230846, 59.486595289254182717, + 55.130746199381974293, 13.768995166250533657, 123.83622210797693697, 86.147754033674573293, + 79.461380172793724341, 62.211795043560414342, 94.715078898261708673, 80.183532372204354033, + 98.996258359122293768, 59.471565178533637663, 52.0310347186641593, 89.319598025835148292, + 47.002248029461043188, 10.964210846734204097, 122.00461745993379736, 7.3329363271441252436, + 50.629415682396938791, 57.983580946387519361, 98.497797152751445537, 55.155842316224152455, + 0.24251452227690606378, 112.99854897079421789, 77.61532738075038651, 117.36973333075729897, + 54.901747917399916332, 42.716772232593939407, 97.022335771653160919, 110.22526605018356349, + 112.78797597833545296, 45.593570714027009672, 17.687843528903613333, 35.717054905646364205, + 40.2726376406099007, 97.752637267727550352, 38.304036389559769304, 40.961540794691245537, + 110.07770063673524419, 37.815314666284393752, 88.791115931264357641, 106.34748941555881174, + 110.27577158807252999, 79.00009300431702286, 35.407033199073339347, 41.025834417043370195, + 93.18461571372608887, 123.2586989290357451, 7.4313805323727137875, 64.81795014185263426, + 1.4582961387932300568, 79.875625553551799385, 120.34769851791497786, 12.714690460201381939, + 125.85434182994140428, 17.185544870953890495, 122.99568543807254173, 84.08259853025447228, + 123.81059035790894995, 47.170164650910010096, 67.412331109826482134, 61.146636524390487466, + 56.500017213755199919, 91.680524578605400166, 85.511661862303299131, 53.513684650944924215, + 77.047045023489772575, 34.11703857939937734, 37.307642507672426291, 6.0151195652724709362, + 69.878817159398749936, 25.354617982426134404, 121.57011995148423011, 24.872755157717620023, + 77.271598599432763876, 82.155118970305920811, 46.568451976370852208, 42.686247741385159316, + 18.431109349457983626, 40.506962285275221802, 31.068476197458949173, 121.91973717465589289, + 35.348006985615938902, 17.108154283097974258, 27.694327127246651798, 68.607954734372469829, + 45.420370984233159106, 110.2804757488956966, 39.24950395818814286, 93.393961459478305187, + 112.85617269846625277, 104.75384206084709149, 29.043049053059803555, 68.049365278493496589, + 41.005714096067094943, 95.748991529169870773, 89.98199936181481462, 92.864349263691110536, + 66.478563083084736718, 98.427904646217939444, 54.177401364708202891, 102.47430852465913631, + 87.435689340549288318, 121.82506013541205903, 41.475317994358192664, 102.18567878147223382, + 95.747285296143672895, 28.347866358621104155, 58.415729475316766184, 119.49331149156932952, + 57.184633327829942573, 27.138204548547946615, 41.171621348879853031, 66.352199929915514076, + 108.75838171069335658, 85.677940438545192592, 66.930115139377448941, 43.293011737856431864, + 82.246323674698942341, 54.744609445220703492, 54.940730747024645098, 102.1834135165954649, + 89.72226708829839481, 37.438225937701645307, 24.433928992977598682, 26.533233091759029776, + 113.86665512193576433, 35.085583061962097418, 95.802343482941068942, 96.165275410548929358, + 127.75154750971341855, 74.422928945474268403, 78.2154060552638839, 66.663104300587292528, + 103.79156573528598528, 38.449735340931511018, 32.084591078008088516, 83.766598442165559391, + 3.4262635244813282043, 66.582106963640399044, 102.21545124550175387, 62.882135810814361321, + 107.40575587711282424, 122.54621201367626782, 106.69889139228689601, 17.765955618844600394, + 16.52694084556424059, 67.025611150489567081, 98.457637388313742122, 90.309733867252361961, + 15.111486063608026598, 127.32264281680545537, 63.079082096792262746, 67.385310240497346967, + 83.720246868106187321, 89.057649669841339346, 10.525560380116075976, 122.11134649912855821, + 60.472240725641313475, 123.48718686974825687, 43.814852334526221966, 95.785256732648122124, + 91.09844688879820751, 123.72124152065225644, 73.966680185494624311, 36.830708340105047682, + 78.409010710456641391, 19.908589544193091569, 14.038094398092653137, 25.361446826442261226, + 126.45851520054566208, 66.332937872732145479, 27.829199398631317308, 77.682479624414554564, + 93.585971241493098205, 103.34601141894745524, 55.710112226402998203, 84.860369568970781984, + 53.697089125227648765, 0.92971257397584849969, 63.075534842933848267, 15.027496117534610676, + 21.950754698755190475, 0, 28.531895874137262581, 85.955036951098009013, + 6.8557842247828375548, 67.563506979815429077, 117.48375658229997498, 92.569227757212502183, + 105.43754795739732799, 32.613664735079510137, 59.836813111625815509, 79.727059214674227405, + 117.85211415888625197, 112.15118977386737242, 39.196209382360393647, 76.90555489470352768, + 69.871041543210594682, 127.53710924842016539, 48.124486812175746309, 86.51018189529349911, + 51.962787529522756813, 55.309665644217602676, 75.989344516059645684, 107.12377308446957613, + 30.514114127763605211, 41.182231885839428287, 98.24650156886127661, 0.79714579108258476481, + 93.373145930705504725, 26.953950742696179077, 114.17254428644082509, 33.587495177125674672, + 80.203617513161589159, 8.018908646670752205, 12.047526215410471195, 106.19665864830312785, + 4.3880957441397185903, 67.405484968803648371, 37.314136061540921219, 46.345498768318066141, + 34.408867627989820903, 106.37476255464207497, 124.40552362933158292, 19.898630108436918817, + 25.911002835477120243, 94.97117961179537815, 57.368406515797687462, 68.524443742018775083, + 53.489126845164719271, 83.016413769772043452, 41.418856831154698739, 49.169194417791004525, + 104.00149845615669619, 45.444879220471193548, 96.047949767282261746, 82.369610985118924873, + 27.980948182761494536, 10.249136258535145316, 58.786494188461801969, 31.097014195918745827, + 56.659098762556823203, 89.836841137297597015, 121.39215939895802876, 88.552023583204572788, + 0.052817877356574172154, 97.624803183280164376, 60.799845647659822134, 126.91879462443102966, + 59.16046614981314633, 96.749615536286000861, 97.151574762516247574, 119.37293025686449255, + 44.286345426939078607, 45.181768567494145827, 49.767175051423691912, 56.758588759246777045, + 6.0028873047776869498, 91.875369314842828317, 76.259038934731506743, 13.430600523657631129, + 86.974434800828021253, 36.551611963088362245, 59.330150566438533133, 24.35414183202010463, + 36.807122539772535674, 127.4662554121168796, 113.02948278524854686, 41.414836821928474819, + 55.69462721931267879, 127.30847316013750969, 2.2990048328465491068, 54.448069217178272083, + 107.0549887587694684, 20.148507790188887157, 88.543831383976794314, 34.276507842438149964, + 0.33840813921779044904, 18.566610328802198637, 124.00624324331511161, 51.610310525837121531, + 7.5601520085692754947, 40.971795321805984713, 103.80554523345563211, 59.801089193737425376, + 68.2404836304122, 82.922502782879746519, 100.96427405465510674, 41.861449829044431681, + 54.349766773124429164, 98.473656289268546971, 18.947709120078798151, 10.362402301212569, + 68.10619637544368743, 91.731592448144510854, 72.806715302725933725, 23.388397538976278156, + 79.179216954020375852, 57.456895591036300175, 0.13088494563271524385, 45.389536992333887611, + 35.505672101491654757, 107.85314747484881082, 16.86667139811834204, 37.139612461691285716, + 10.619378110037359875, 51.59424580911945668, 45.048680061438062694, 116.05256664709668257, + 66.580706290944362991, 67.441612650440220023, 16.394204659307433758, 28.326592747456743382, + 8.2826432979964010883, 85.398752035373036051, 106.00213214183531818, 83.085382960711285705, + 67.744959167452179827, 113.82261046273561078, 25.549440941500506597, 56.641150855011801468, + 3.5679619983166048769, 20.029166233012801968, 100.99804813001173898, 41.152490196633152664, + 50.25754998894626624, 122.24940897356282221, 12.108345174048736226, 78.393113864462065976, + 61.721586166007909924, 43.215173751199472463, 18.437672749656485394, 67.389163895975798368, + 54.148436399125785101, 3.5288318137972964905, 74.771356032098992728, 98.445057869888842106, + 39.588153580738435267, 118.71453446961095324, 117.25978504978411365, 37.851769495038752211, + 4.55191083743920899, 37.11001884073994006, 91.367741389338334557, 112.6070422258671897, + 58.711000083039834863, 118.93764568868937204, 115.1491337396473682, 100.33008107148270938, + 108.38393370197809418, 92.415476138892699964, 111.30635570295999059, 36.66738991240345058, + 115.09691598352219444, 82.544558993537066272, 21.453945525623566937, 126.52624532112895395, + 6.1998092149151489139, 94.824315226625913056, 44.681487951296730898, 126.35444543451376376, + 124.59865594034999958, 118.54843269545017392, 0.76707862238254165277, 102.57343996977942879, + 43.519143787358189002, 36.915220334034529515, 70.399251334674772806, 25.327780750696547329, + 121.97019074923446169, 118.97319057850836543, 110.26149239876394859, 27.537990332504705293, + 119.67244421595751191, 44.295508067352784565, 30.922760345587448683, 124.42359008712446666, + 61.430157796527055325, 32.367064744412346045, 69.992516718244587537, 118.94313035706727533, + 104.06206943733195658, 50.639196051670296583, 94.004496058922086377, 21.928421693472046172, + 116.00923491986759473, 14.665872654288250487, 101.25883136479387758, 115.9671618927786767, + 68.995594305502891075, 110.31168463244830491, 0.48502904455745010637, 97.997097941592073767, + 27.230654761504410999, 106.73946666151459794, 109.80349583479983266, 85.433544465191516792, + 66.044671543309959816, 92.450532100370764965, 97.575951956670905929, 91.187141428054019343, + 35.375687057807226665, 71.434109811292728409, 80.545275281223439379, 67.505274535455100704, + 76.608072779119538609, 81.923081589386129053, 92.155401273470488377, 75.630629332572425483, + 49.582231862532353261, 84.694978831121261464, 92.551543176148697967, 30.00018600863404572, + 70.814066398146678694, 82.051668834090378368, 58.369231427455815719, 118.51739785807149019, + 14.862761064749065554, 1.6359002837052685209, 2.9165922775900980923, 31.751251107107236749, + 112.69539703582995571, 25.429380920406401856, 123.70868365988280857, 34.371089741911418969, + 117.99137087614872144, 40.165197060512582539, 119.62118071581789991, 94.34032930182365817, + 6.8246622196529642679, 122.29327304878097493, 113.00003442751403782, 55.36104915721443831, + 43.023323724606598262, 107.02736930189348641, 26.09409004697954515, 68.234077158798754681, + 74.615285015344852582, 12.030239130548579851, 11.757634318797499873, 50.709235964855906786, + 115.14023990296846023, 49.745510315438878024, 26.543197198869165732, 36.310237940611841623, + 93.136903952741704416, 85.372495482770318631, 36.862218698915967252, 81.013924570550443605, + 62.136952394921536325, 115.83947434931178577, 70.696013971231877804, 34.216308566195948515, + 55.388654254496941576, 9.2159094687449396588, 90.840741968469956191, 92.560951497791393194, + 78.499007916379923699, 58.787922918960248353, 97.712345396936143516, 81.507684121694182977, + 58.086098106123245088, 8.0987305569869931787, 82.011428192137827864, 63.497983058343379525, + 51.963998723633267218, 57.728698527385859052, 4.9571261661731114145, 68.855809292435878888, + 108.35480272942004376, 76.948617049321910599, 46.871378681102214614, 115.65012027082411805, + 82.950635988720023306, 76.371357562948105624, 63.494570592287345789, 56.695732717242208309, + 116.83145895063717035, 110.98662298313865904, 114.36926665565988515, 54.27640909709589323, + 82.34324269776334404, 4.7043998598346661311, 89.516763421390351141, 43.355880877094023162, + 5.8602302787548978813, 86.586023475716501707, 36.492647349397884682, 109.48921889044140698, + 109.88146149405292817, 76.366827033194567775, 51.444534176596789621, 74.876451875403290614, + 48.867857985955197364, 53.066466183521697531, 99.733310243871528655, 70.171166123927832814, + 63.604686965885775862, 64.330550821101496695, 127.50309501943047508, 20.845857890952174785, + 28.430812110531405779, 5.3262086011782230344, 79.583131470571970567, 76.899470681863022037, + 64.169182156019815011, 39.533196884331118781, 6.8525270489662943874, 5.1642139272844360676, + 76.430902491003507748, 125.76427162163236062, 86.811511754229286453, 117.09242402735617361, + 85.397782784573792014, 35.531911237689200789, 33.053881691132119158, 6.0512223009827721398, + 68.915274776631122222, 52.619467734504723921, 30.222972127219691174, 126.64528563361091074, + 126.15816419358816347, 6.7706204809983319137, 39.440493736216012621, 50.115299339682678692, + 21.05112076023578993, 116.22269299825711641, 120.94448145128626493, 118.97437373949651374, + 87.629704669056081912, 63.570513465299882228, 54.196893777600052999, 119.44248304130815086, + 19.933360370989248622, 73.661416680213733343, 28.818021420913282782, 39.817179088386183139, + 28.076188796185306273, 50.722893652888160432, 124.91703040109496214, 4.6658757454642909579, + 55.658398797266272595, 27.364959248832747107, 59.171942482989834389, 78.692022837894910481, + 111.42022445280963439, 41.720739137941563968, 107.39417825045529753, 1.8594251479516969994, + 126.15106968586769653, 30.054992235069221351, 43.901509397514018929, 0, + 57.063791748278163141, 43.910073902196018025, 13.711568449569313088, 7.1270139596344961319, + 106.96751316460358794, 57.138455514428642346, 82.875095914794655982, 65.227329470159020275, + 119.673626223255269, 31.454118429352092789, 107.70422831777614192, 96.302379547734744847, + 78.392418764724425273, 25.811109789410693338, 11.742083086424827343, 127.07421849684033077, + 96.248973624355130596, 45.020363790586998221, 103.92557505904551363, 110.61933128843884333, + 23.978689032122929348, 86.247546168939152267, 61.028228255527210422, 82.364463771682494553, + 68.49300313772255322, 1.5942915821688075084, 58.74629186141100945, 53.907901485395996133, + 100.34508857288165018, 67.174990354254987324, 32.407235026323178317, 16.03781729334150441, + 24.09505243082458037, 84.393317296606255695, 8.7761914882830751594, 6.8109699376072967425, + 74.628272123081842437, 92.690997536636132281, 68.817735255983279785, 84.749525109287787927, + 120.81104725866316585, 39.797260216873837635, 51.822005670957878465, 61.942359223590756301, + 114.7368130315990129, 9.0488874840375501662, 106.97825369033307652, 38.032827539544086903, + 82.837713662309397478, 98.33838883558564703, 80.002996912313392386, 90.889758440946025075, + 64.095899534568161471, 36.739221970237849746, 55.961896365522989072, 20.498272517070290633, + 117.57298837692360394, 62.194028391837491654, 113.31819752511728439, 51.673682274598832009, + 114.7843187979196955, 49.104047166409145575, 0.10563575471678632312, 67.249606366560328752, + 121.59969129532328225, 125.83758924886205932, 118.32093229962993064, 65.499231072575639701, + 66.303149525036133127, 110.7458605137289851, 88.572690853878157213, 90.363537134988291655, + 99.534350102847383823, 113.51717751849355409, 12.005774609559011878, 55.750738629689294612, + 24.518077869463013485, 26.861201047318900237, 45.948869601656042505, 73.10322392617672449, + 118.66030113287706627, 48.70828366404020926, 73.614245079548709327, 126.93251082423739717, + 98.058965570497093722, 82.829673643856949639, 111.38925443862899556, 126.61694632027501939, + 4.5980096656930982135, 108.89613843436018215, 86.109977517538936809, 40.297015580381412292, + 49.087662767953588627, 68.553015684876299929, 0.67681627843558089808, 37.133220657608035253, + 120.01248648663022323, 103.22062105167424306, 15.120304017138550989, 81.943590643615607405, + 79.61109046691126423, 119.60217838747848873, 8.4809672608280379791, 37.845005565763131017, + 73.928548109310213476, 83.722899658088863362, 108.69953354625249631, 68.947312578537093941, + 37.895418240157596301, 20.724804602428775979, 8.2123927508910128381, 55.463184896292659687, + 17.61343060545186745, 46.776795077956194291, 30.358433908040751703, 114.91379118207260035, + 0.26176989126543048769, 90.779073984667775221, 71.011344202986947494, 87.706294949697621632, + 33.73334279623668408, 74.279224923382571433, 21.238756220074719749, 103.18849161823891336, + 90.097360122879763367, 104.10513329419700312, 5.1614125818923639599, 6.8832253008804400451, + 32.788409318614867516, 56.653185494913486764, 16.565286595996440155, 42.797504070749710081, + 84.004264283674274338, 38.170765921426209388, 7.4899183349079976324, 99.645220925471221562, + 51.098881883001013193, 113.28230171002360294, 7.1359239966332097538, 40.058332466029241914, + 73.996096260023477953, 82.304980393266305327, 100.51509997789617046, 116.49881794712564442, + 24.21669034810111043, 28.786227728924131952, 123.44317233201581985, 86.430347502398944926, + 36.875345499316608766, 6.7783277919515967369, 108.2968727982515702, 7.0576636275982309598, + 21.542712064201623434, 68.890115739777684212, 79.176307161480508512, 109.42906893922554445, + 106.51957009956822731, 75.703538990077504423, 9.1038216748784179799, 74.220037681483518099, + 54.735482778680307092, 97.2140844517343794, 117.4220001660833077, 109.87529137738238205, + 102.29826747929837438, 72.660162142969056731, 88.767867403959826333, 56.830952277789037907, + 94.612711405919981189, 73.334779824810539139, 102.19383196704802685, 37.089117987074132543, + 42.907891051250771852, 125.05249064225790789, 12.399618429833935807, 61.648630453251826111, + 89.362975902597099775, 124.70889086903116549, 121.19731188070363714, 109.09686539090034785, + 1.5341572447687212843, 77.146879939558857586, 87.038287574716378003, 73.830440668072697008, + 12.798502669349545613, 50.655561501396732638, 115.94038149847256136, 109.94638115702036885, + 92.522984797527897172, 55.075980665013048565, 111.34488843191502383, 88.591016134705569129, + 61.845520691178535344, 120.84718017424893333, 122.86031559305411065, 64.734129488828330068, + 11.985033436492813053, 109.88626071413818863, 80.124138874663913157, 101.27839210334423115, + 60.008992117844172753, 43.856843386947730323, 104.01846983973518945, 29.331745308580138953, + 74.517662729591393145, 103.93432378556099138, 9.9911886110094201285, 92.62336926489660982, + 0.97005808911853819154, 67.994195883184147533, 54.461309523012459977, 85.478933323032833869, + 91.606991669603303308, 42.867088930386671564, 4.0893430866235576104, 56.901064200745167909, + 67.151903913345449837, 54.374282856108038686, 70.751374115618091309, 14.868219622589094797, + 33.090550562450516736, 7.0105490709138393868, 25.216145558242715197, 35.846163178775896085, + 56.310802546944614733, 23.261258665144850966, 99.164463725068344502, 41.389957662246160908, + 57.103086352297395933, 60.000372017271729419, 13.628132796296995366, 36.103337668180756737, + 116.73846285491526942, 109.03479571614298038, 29.725522129498131108, 3.2718005674105370417, + 5.8331845551801961847, 63.502502214218111476, 97.390794071659911424, 50.858761840816441691, + 119.41736731976561714, 68.742179483826475916, 107.98274175229744287, 80.330394121028803056, + 111.2423614316394378, 60.68065860364731634, 13.649324439309566515, 116.58654609756558784, + 98.000068855028075632, 110.72209831442887662, 86.046647449216834502, 86.054738603786972817, + 52.188180093962728279, 8.4681543176011473406, 21.230570030689705163, 24.060478261097159702, + 23.515268637594999745, 101.41847192971545155, 102.28047980593692046, 99.491020630877756048, + 53.086394397738331463, 72.620475881227321224, 58.27380790548704681, 42.744990965540637262, + 73.724437397835572483, 34.027849141100887209, 124.27390478984671063, 103.67894869862720952, + 13.392027942463755608, 68.43261713239189703, 110.77730850899388315, 18.431818937493517296, + 53.681483936943550361, 57.121902995586424368, 28.998015832759847399, 117.57584583792413468, + 67.42469079387592501, 35.015368243388365954, 116.17219621224649018, 16.197461113977624336, + 36.022856384275655728, 126.99596611668675905, 103.92799744726653444, 115.4573970547717181, + 9.9142523323498608079, 9.7116185848753957544, 88.709605458843725501, 25.897234098643821198, + 93.742757362208067207, 103.30024054165187408, 37.901271977443684591, 24.742715125896211248, + 126.98914118457469158, 113.3914654344880546, 105.66291790127797867, 93.973245966280956054, + 100.73853331131977029, 108.55281819419542444, 36.68648539552668808, 9.4087997196729702409, + 51.033526842780702282, 86.711761754188046325, 11.720460557513433741, 45.172046951433003414, + 72.985294698799407342, 90.978437780886451947, 91.762922988109494327, 24.733654066389135551, + 102.88906835319721722, 21.752903750806581229, 97.735715971910394728, 106.13293236704703304, + 71.466620487746695289, 12.342332247855665628, 127.2093739317751897, 0.66110164220663136803, + 127.00619003886095015, 41.691715781904349569, 56.861624221062811557, 10.652417202360084048, + 31.166262941147579113, 25.798941363729682053, 0.3383643120396300219, 79.066393768662237562, + 13.705054097932588775, 10.328427854572510114, 24.861804982010653475, 123.52854324326835922, + 45.623023508462210884, 106.1848480547159852, 42.795565569147584029, 71.063822475378401577, + 66.107763382264238317, 12.102444601969182258, 9.8305495532622444443, 105.23893546900944784, + 60.445944254443020327, 125.29057126722545945, 124.31632838717632694, 13.541240961996663827, + 78.880987472432025243, 100.23059867936535738, 42.10224152047521784, 104.44538599651787081, + 113.88896290257616783, 109.94874747899666545, 47.259409338112163823, 127.14102693059976446, + 108.39378755520374398, 110.88496608261630172, 39.866720741982135223, 19.322833360427466687, + 57.636042841826565564, 79.634358176772366278, 56.152377592370612547, 101.44578730577995884, + 121.83406080218992429, 9.3317514909285819158, 111.31679759453254519, 54.729918497665494215, + 118.34388496598330676, 29.38404567579345894, 94.840448905619268771, 83.441478275886765914, + 86.788356500910595059, 3.7188502959070319775, 124.30213937173539307, 60.109984470138442703, + 87.803018795028037857, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_footer.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_footer.h.org new file mode 100644 index 0000000000000..8f52779ac498e --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_footer.h.org @@ -0,0 +1,112 @@ + +// + +#if defined(SLEEF_REPLACE_LIBQUADMATH_FUNCS) + +#ifdef SLEEF_QUAD_C + +#define M_Eq SLEEF_QUAD_C(+0x1.5bf0a8b1457695355fb8ac404e7ap+1) +#define M_LOG2Eq SLEEF_QUAD_C(+0x1.71547652b82fe1777d0ffda0d23ap+0) +#define M_LOG10Eq SLEEF_QUAD_C(+0x1.bcb7b1526e50e32a6ab7555f5a68p-2) +#define M_LN2q SLEEF_QUAD_C(+0x1.62e42fefa39ef35793c7673007e6p-1) +#define M_LN10q SLEEF_QUAD_C(+0x1.26bb1bbb5551582dd4adac5705a6p+1) +#define M_PIq SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+1) +#define M_PI_2q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+0) +#define M_PI_4q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p-1) +#define M_1_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-2) +#define M_2_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-1) +#define M_2_SQRTPIq SLEEF_QUAD_C(+0x1.20dd750429b6d11ae3a914fed7fep+0) +#define M_SQRT2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p+0) +#define M_SQRT1_2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p-1) +#define FLT128_MAX SLEEF_QUAD_C(+0x1.ffffffffffffffffffffffffffffp+16383) +#define FLT128_MIN SLEEF_QUAD_C(+0x1p-16382) +#define FLT128_EPSILON SLEEF_QUAD_C(+0x1p-112) +#define FLT128_DENORM_MIN SLEEF_QUAD_C(+0x0.0000000000000000000000000001p-16382) + +#else // #ifdef SLEEF_QUAD_C + +#define M_Eq sleef_q(+0x15bf0a8b14576LL, 0x95355fb8ac404e7aULL, 1) +#define M_LOG2Eq sleef_q(+0x171547652b82fLL, 0xe1777d0ffda0d23aULL, 0) +#define M_LOG10Eq sleef_q(+0x1bcb7b1526e50LL, 0xe32a6ab7555f5a68ULL, -2) +#define M_LN2q sleef_q(+0x162e42fefa39eLL, 0xf35793c7673007e6ULL, -1) +#define M_LN10q sleef_q(+0x126bb1bbb5551LL, 0x582dd4adac5705a6ULL, 1) +#define M_PIq sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 1) +#define M_PI_2q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 0) +#define M_PI_4q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, -1) +#define M_1_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -2) +#define M_2_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -1) +#define M_2_SQRTPIq sleef_q(+0x120dd750429b6LL, 0xd11ae3a914fed7feULL, 0) +#define M_SQRT2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, 0) +#define M_SQRT1_2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, -1) +#define FLT128_MAX sleef_q(+0x1ffffffffffffLL, 0xffffffffffffffffULL, 16383) +#define FLT128_MIN sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -16382) +#define FLT128_EPSILON sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -112) +#define FLT128_DENORM_MIN sleef_q(+0x0000000000000LL, 0x0000000000000001ULL, -16382) + +#endif // #ifdef SLEEF_QUAD_C + +#define FLT128_MANT_DIG 113 +#define FLT128_MIN_EXP (-16381) +#define FLT128_MAX_EXP 16384 +#define FLT128_DIG 33 +#define FLT128_MIN_10_EXP (-4931) +#define FLT128_MAX_10_EXP 4932 + +#endif // #if defined(SLEEF_REPLACE_LIBQUADMATH_FUNCS) + +#ifdef __cplusplus +} // extern "C" + +namespace sleef { +#endif + +#if defined(SLEEF_REPLACE_LIBQUADMATH_FUNCS) || defined(__cplusplus) +static SLEEF_CONST Sleef_quad strtoflt128(const char *str, char **endptr) { return Sleef_strtoq(str, endptr); } +static SLEEF_CONST int quadmath_snprintf(char *str, size_t size, const char *fmt) { return Sleef_snprintf(str, size, fmt); } +static SLEEF_CONST Sleef_quad acosq(Sleef_quad x) { return Sleef_acosq1_u10(x); } +static SLEEF_CONST Sleef_quad acoshq(Sleef_quad x) { return Sleef_acoshq1_u10(x); } +static SLEEF_CONST Sleef_quad asinq(Sleef_quad x) { return Sleef_asinq1_u10(x); } +static SLEEF_CONST Sleef_quad asinhq(Sleef_quad x) { return Sleef_asinhq1_u10(x); } +static SLEEF_CONST Sleef_quad atanq(Sleef_quad x) { return Sleef_atanq1_u10(x); } +static SLEEF_CONST Sleef_quad atanhq(Sleef_quad x) { return Sleef_atanhq1_u10(x); } +static SLEEF_CONST Sleef_quad atan2q(Sleef_quad y, Sleef_quad x) { return Sleef_atan2q1_u10(y, x); } +static SLEEF_CONST Sleef_quad cbrtq(Sleef_quad x) { return Sleef_cbrtq1_u10(x); } +static SLEEF_CONST Sleef_quad ceilq(Sleef_quad x) { return Sleef_ceilq1(x); } +static SLEEF_CONST Sleef_quad copysignq(Sleef_quad x, Sleef_quad y) { return Sleef_copysignq1(x, y); } +static SLEEF_CONST Sleef_quad coshq(Sleef_quad x) { return Sleef_coshq1_u10(x); } +static SLEEF_CONST Sleef_quad cosq(Sleef_quad x) { return Sleef_cosq1_u10(x); } +static SLEEF_CONST Sleef_quad expq(Sleef_quad x) { return Sleef_expq1_u10(x); } +static SLEEF_CONST Sleef_quad expm1q(Sleef_quad x) { return Sleef_expm1q1_u10(x); } +static SLEEF_CONST Sleef_quad fabsq(Sleef_quad x) { return Sleef_fabsq1(x); } +static SLEEF_CONST Sleef_quad fdimq(Sleef_quad x, Sleef_quad y) { return Sleef_fdimq1_u05(x, y); } +static SLEEF_CONST Sleef_quad floorq(Sleef_quad x) { return Sleef_floorq1(x); } +static SLEEF_CONST Sleef_quad fmaq(Sleef_quad x, Sleef_quad y, Sleef_quad z) { return Sleef_fmaq1_u05(x, y, z); } +static SLEEF_CONST Sleef_quad fmaxq(Sleef_quad x, Sleef_quad y) { return Sleef_fmaxq1(x, y); } +static SLEEF_CONST Sleef_quad fminq(Sleef_quad x, Sleef_quad y) { return Sleef_fminq1(x, y); } +static SLEEF_CONST Sleef_quad fmodq(Sleef_quad x, Sleef_quad y) { return Sleef_fmodq1(x, y); } +static SLEEF_CONST Sleef_quad frexpq(Sleef_quad x, int *ptr) { return Sleef_frexpq1(x, ptr); } +static SLEEF_CONST Sleef_quad hypotq(Sleef_quad x, Sleef_quad y) { return Sleef_hypotq1_u05(x, y); } +static SLEEF_CONST int ilogbq(Sleef_quad x) { return Sleef_ilogbq1(x); } +static SLEEF_CONST Sleef_quad ldexpq(Sleef_quad x, int e) { return Sleef_ldexpq1(x, e); } +static SLEEF_CONST Sleef_quad logq(Sleef_quad x) { return Sleef_logq1_u10(x); } +static SLEEF_CONST Sleef_quad log10q(Sleef_quad x) { return Sleef_log10q1_u10(x); } +static SLEEF_CONST Sleef_quad log2q(Sleef_quad x) { return Sleef_log2q1_u10(x); } +static SLEEF_CONST Sleef_quad log1pq(Sleef_quad x) { return Sleef_log1pq1_u10(x); } +static SLEEF_CONST Sleef_quad modfq(Sleef_quad x, Sleef_quad *ptr) { return Sleef_modfq1(x, ptr); } +static SLEEF_CONST Sleef_quad powq(Sleef_quad x, Sleef_quad y) { return Sleef_powq1_u10(x, y); } +static SLEEF_CONST Sleef_quad remainderq(Sleef_quad x, Sleef_quad y) { return Sleef_remainderq1(x, y); } +static SLEEF_CONST Sleef_quad rintq(Sleef_quad x) { return Sleef_rintq1(x); } +static SLEEF_CONST Sleef_quad roundq(Sleef_quad x) { return Sleef_roundq1(x); } +static SLEEF_CONST Sleef_quad sinhq(Sleef_quad x) { return Sleef_sinhq1_u10(x); } +static SLEEF_CONST Sleef_quad sinq(Sleef_quad x) { return Sleef_sinq1_u10(x); } +static SLEEF_CONST Sleef_quad sqrtq(Sleef_quad x) { return Sleef_sqrtq1_u05(x); } +static SLEEF_CONST Sleef_quad tanq(Sleef_quad x) { return Sleef_tanq1_u10(x); } +static SLEEF_CONST Sleef_quad tanhq(Sleef_quad x) { return Sleef_tanhq1_u10(x); } +static SLEEF_CONST Sleef_quad truncq(Sleef_quad x) { return Sleef_truncq1(x); } + +#ifdef __cplusplus +} // namespace sleef +#endif +#endif // #if defined(SLEEF_REPLACE_LIBQUADMATH_FUNCS) || defined(__cplusplus) + +#endif // #ifndef __SLEEFQUAD_H__ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_header.h.org.in b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_header.h.org.in new file mode 100644 index 0000000000000..f38cd7eb79f80 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquad_header.h.org.in @@ -0,0 +1,247 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __SLEEFQUAD_H__ +#define __SLEEFQUAD_H__ + +#define SLEEF_VERSION_MAJOR @SLEEF_VERSION_MAJOR@ +#define SLEEF_VERSION_MINOR @SLEEF_VERSION_MINOR@ +#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCH@ + +#include "sleef.h" +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#ifdef SLEEF_IMPORT_IS_EXPORT +#define SLEEF_IMPORT __declspec(dllexport) +#else // #ifdef SLEEF_IMPORT_IS_EXPORT +#define SLEEF_IMPORT __declspec(dllimport) +#if (defined(_MSC_VER)) +#pragma comment(lib,"sleefquad.lib") +#endif // #if (defined(_MSC_VER)) +#endif // #ifdef SLEEF_IMPORT_IS_EXPORT +#else // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) +#define SLEEF_IMPORT +#endif // #if (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(_MSC_VER)) && !defined(SLEEF_STATIC_LIBS) + +// + +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_CONST __attribute__((const)) +#define SLEEF_INLINE __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_CONST +#define SLEEF_INLINE __forceinline +#endif + +// + +#if (defined(__SIZEOF_FLOAT128__) && __SIZEOF_FLOAT128__ == 16) || (defined(__linux__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(__PPC64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 8) +#define SLEEF_FLOAT128_IS_IEEEQP +#endif + +#if !defined(SLEEF_FLOAT128_IS_IEEEQP) && defined(__SIZEOF_LONG_DOUBLE__) && __SIZEOF_LONG_DOUBLE__ == 16 && (defined(__aarch64__) || defined(__zarch__)) +#define SLEEF_LONGDOUBLE_IS_IEEEQP +#endif + +#if !defined(Sleef_quad_DEFINED) +#define Sleef_quad_DEFINED +typedef struct { uint64_t x, y; } Sleef_uint64_2t; +#if defined(SLEEF_FLOAT128_IS_IEEEQP) +typedef __float128 Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## Q) +#elif defined(SLEEF_LONGDOUBLE_IS_IEEEQP) +typedef long double Sleef_quad; +#define SLEEF_QUAD_C(x) (x ## L) +#else +typedef Sleef_uint64_2t Sleef_quad; +#endif +#endif + +// + +#if !defined(Sleef_quadx1_DEFINED) +#define Sleef_quadx1_DEFINED +typedef struct { + uint64_t x, y; +} Sleef_quadx1; +#endif + +#if !defined(Sleef_quadx2_DEFINED) + +#if defined(__SSE2__) +#define Sleef_quadx2_DEFINED +typedef struct { + __m128i x, y; +} Sleef_quadx2; +#endif + +#if defined(__aarch64__) +#define Sleef_quadx2_DEFINED +typedef struct { + uint32x4_t x, y; +} Sleef_quadx2; +#endif + +#if defined(__VSX__) +#define Sleef_quadx2_DEFINED +typedef struct { + __vector unsigned int x, y; +} Sleef_quadx2; +#endif + +#if defined(__VX__) && (defined(__VECTOR_KEYWORD_SUPPORTED__) || defined(__VEC__)) +#define Sleef_quadx2_DEFINED +typedef struct { + __vector unsigned long long x, y; +} Sleef_quadx2; +#endif + +#endif // #if !defined(Sleef_quadx2_DEFINED) + +#if !defined(Sleef_rvvm1quad_DEFINED) +#if defined(__riscv) && defined(__riscv_v) +#define Sleef_rvvm1quadDEFINED +typedef vuint64m1x2_t Sleef_rvvm1quad; +#endif +#endif + +#if !defined(Sleef_rvvm2quad_DEFINED) +#if defined(__riscv) && defined(__riscv_v) +#define Sleef_rvvm2quadDEFINED +typedef vuint64m2x2_t Sleef_rvvm2quad; +#endif +#endif + +#if !defined(Sleef_quadx4_DEFINED) +#if defined(__AVX__) +#define Sleef_quadx4_DEFINED +typedef struct { + __m256i x, y; +} Sleef_quadx4; +#endif +#endif + +#if !defined(Sleef_quadx8_DEFINED) +#if defined(__AVX512F__) +#define Sleef_quadx8_DEFINED +typedef struct { + __m512i x, y; +} Sleef_quadx8; +#endif +#endif + +#if !defined(Sleef_svquad_DEFINED) +#if defined(__ARM_FEATURE_SVE) +#define Sleef_svquad_DEFINED +typedef svfloat64x2_t Sleef_svquad; +#endif +#endif + +// + +#if !defined(SLEEF_Q_DEFINED) +#define SLEEF_Q_DEFINED +static inline Sleef_quad sleef_q(int64_t H, uint64_t L, int E) { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + struct { uint64_t h, l; } c; +#else + struct { uint64_t l, h; } c; +#endif + c.h = (((int64_t)(H) < 0 ? 1ULL : 0ULL) << 63) | + ((0x7fff & (uint64_t)((E) + 16383)) << 48) | + ((int64_t)(H) < 0 ? -(int64_t)(H) : (int64_t)(H) & 0xffffffffffffULL); + c.l = (uint64_t)(L); + + Sleef_quad q; + memcpy(&q, &c, 16); + return q; +} +#endif + +// + +#ifdef SLEEF_QUAD_C + +#define SLEEF_M_Eq SLEEF_QUAD_C(+0x1.5bf0a8b1457695355fb8ac404e7ap+1) +#define SLEEF_M_LOG2Eq SLEEF_QUAD_C(+0x1.71547652b82fe1777d0ffda0d23ap+0) +#define SLEEF_M_LOG10Eq SLEEF_QUAD_C(+0x1.bcb7b1526e50e32a6ab7555f5a68p-2) +#define SLEEF_M_LN2q SLEEF_QUAD_C(+0x1.62e42fefa39ef35793c7673007e6p-1) +#define SLEEF_M_LN10q SLEEF_QUAD_C(+0x1.26bb1bbb5551582dd4adac5705a6p+1) +#define SLEEF_M_PIq SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+1) +#define SLEEF_M_PI_2q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+0) +#define SLEEF_M_PI_4q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p-1) +#define SLEEF_M_1_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-2) +#define SLEEF_M_2_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-1) +#define SLEEF_M_2_SQRTPIq SLEEF_QUAD_C(+0x1.20dd750429b6d11ae3a914fed7fep+0) +#define SLEEF_M_SQRT2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p+0) +#define SLEEF_M_SQRT3q SLEEF_QUAD_C(+0x1.bb67ae8584caa73b25742d7078b8p+0) +#define SLEEF_M_INV_SQRT3q SLEEF_QUAD_C(+0x1.279a74590331c4d218f81e4afb25p-1) +#define SLEEF_M_SQRT1_2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p-1) +#define SLEEF_M_INV_SQRTPIq SLEEF_QUAD_C(+0x1.20dd750429b6d11ae3a914fed7fep-1) +#define SLEEF_M_EGAMMAq SLEEF_QUAD_C(+0x1.2788cfc6fb618f49a37c7f0202a6p-1) +#define SLEEF_M_PHIq SLEEF_QUAD_C(+0x1.9e3779b97f4a7c15f39cc0605ceep+0) +#define SLEEF_QUAD_MAX SLEEF_QUAD_C(+0x1.ffffffffffffffffffffffffffffp+16383) +#define SLEEF_QUAD_MIN SLEEF_QUAD_C(+0x1p-16382) +#define SLEEF_QUAD_EPSILON SLEEF_QUAD_C(+0x1p-112) +#define SLEEF_QUAD_DENORM_MIN SLEEF_QUAD_C(+0x0.0000000000000000000000000001p-16382) + +#else // #ifdef SLEEF_QUAD_C + +#define SLEEF_M_Eq sleef_q(+0x15bf0a8b14576LL, 0x95355fb8ac404e7aULL, 1) +#define SLEEF_M_LOG2Eq sleef_q(+0x171547652b82fLL, 0xe1777d0ffda0d23aULL, 0) +#define SLEEF_M_LOG10Eq sleef_q(+0x1bcb7b1526e50LL, 0xe32a6ab7555f5a68ULL, -2) +#define SLEEF_M_LN2q sleef_q(+0x162e42fefa39eLL, 0xf35793c7673007e6ULL, -1) +#define SLEEF_M_LN10q sleef_q(+0x126bb1bbb5551LL, 0x582dd4adac5705a6ULL, 1) +#define SLEEF_M_PIq sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 1) +#define SLEEF_M_PI_2q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 0) +#define SLEEF_M_PI_4q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, -1) +#define SLEEF_M_1_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -2) +#define SLEEF_M_2_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -1) +#define SLEEF_M_2_SQRTPIq sleef_q(+0x120dd750429b6LL, 0xd11ae3a914fed7feULL, 0) +#define SLEEF_M_SQRT2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, 0) +#define SLEEF_M_SQRT3q sleef_q(+0x1bb67ae8584caLL, 0xa73b25742d7078b8ULL, 0) +#define SLEEF_M_INV_SQRT3q sleef_q(+0x1279a74590331LL, 0xc4d218f81e4afb25ULL, -1) +#define SLEEF_M_SQRT1_2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, -1) +#define SLEEF_M_INV_SQRTPIq sleef_q(+0x120dd750429b6LL, 0xd11ae3a914fed7feULL, -1) +#define SLEEF_M_EGAMMAq sleef_q(+0x12788cfc6fb61LL, 0x8f49a37c7f0202a6ULL, -1) +#define SLEEF_M_PHIq sleef_q(+0x19e3779b97f4aLL, 0x7c15f39cc0605ceeULL, 0) +#define SLEEF_QUAD_MAX sleef_q(+0x1ffffffffffffLL, 0xffffffffffffffffULL, 16383) +#define SLEEF_QUAD_MIN sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -16382) +#define SLEEF_QUAD_EPSILON sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -112) +#define SLEEF_QUAD_DENORM_MIN sleef_q(+0x0000000000000LL, 0x0000000000000001ULL, -16382) + +#endif // #ifdef SLEEF_QUAD_C + +#define SLEEF_QUAD_MANT_DIG 113 +#define SLEEF_QUAD_MIN_EXP (-16381) +#define SLEEF_QUAD_MAX_EXP 16384 +#define SLEEF_QUAD_DIG 33 +#define SLEEF_QUAD_MIN_10_EXP (-4931) +#define SLEEF_QUAD_MAX_10_EXP 4932 + +// + +#include +#include + +SLEEF_IMPORT Sleef_quad Sleef_strtoq(const char *str, char **endptr); + +SLEEF_IMPORT int Sleef_fprintf(FILE *fp, const char *fmt, ...); +SLEEF_IMPORT int Sleef_vfprintf(FILE *fp, const char *fmt, va_list ap); +SLEEF_IMPORT int Sleef_printf(const char *fmt, ...); +SLEEF_IMPORT int Sleef_vprintf(const char *fmt, va_list ap); +SLEEF_IMPORT int Sleef_snprintf(char *str, size_t size, const char *fmt, ...); +SLEEF_IMPORT int Sleef_vsnprintf(char *str, size_t size, const char *fmt, va_list ap); + +SLEEF_IMPORT int Sleef_registerPrintfHook(); +SLEEF_IMPORT void Sleef_unregisterPrintfHook(); + +// diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_cuda_header.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_cuda_header.h.org new file mode 100644 index 0000000000000..e6626edc4ddd6 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_cuda_header.h.org @@ -0,0 +1,4196 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF SLEEF_VERSION_SLEEF + +// Use --fmad=false option to compile this file +// Include cmath, cfloat and cstdint before including this file + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +__device__ const double Sleef_rempitabqp[] = { + 0.15915494308865163475, 114.12758349655632628, 87.820147804392036051, 27.423136899138626177, + 14.254027919272630243, 85.935026329207175877, 114.27691102886092267, 37.750191829592949944, + 2.4546589403216785286, 111.34725244651053799, 62.908236858707823558, 87.408456635555921821, + 64.604759095473127672, 28.784837529448850546, 51.622219578821386676, 23.484166172853292665, + 126.14843699368429952, 64.497947248710261192, 90.04072758117763442, 79.851150118094665231, + 93.238662576877686661, 47.957378064249496674, 44.495092337878304534, 122.05645651105805882, + 36.728927543368627084, 8.9860062754451064393, 3.1885831643376150168, 117.4925837228220189, + 107.81580297079563024, 72.690177145766938338, 6.3499807085099746473, 64.814470052646356635, + 32.07563458668300882, 48.190104861652798718, 40.78663459321251139, 17.552382976566150319, + 13.621939875218231464, 21.256544246167322854, 57.381995073275902541, 9.6354705119701975491, + 41.499050218579213833, 113.6220945173263317, 79.59452043374767527, 103.64401134191575693, + 123.88471844718515058, 101.4736260631980258, 18.097774968078738311, 85.95650738066615304, + 76.065655079091811785, 37.675427324622432934, 68.676777671174932038, 32.00599382463042275, + 53.77951688189568813, 0.19179906913632294163, 73.478443940475699492, 111.92379273104597814, + 40.996545034144219244, 107.14597675384720787, 124.38805678367862129, 98.636395050234568771, + 103.347364549201302, 101.568637595839391, 98.20809433281829115, 0.21127150943721062504, + 6.4992127331242954824, 115.19938259065020247, 123.67517849772775662, 108.64186459926349926, + 2.9984621451549173798, 4.6062990500759042334, 93.491721027461608173, 49.145381707759952405, + 52.727074269980221288, 71.068700205698405625, 99.034355036987108178, 24.011549219118023757, + 111.50147725937858922, 49.03615573892602697, 53.722402094637800474, 91.897739203315722989, + 18.206447852357086958, 109.32060226575413253, 97.416567328084056498, 19.228490159101056634, + 125.86502164847843233, 68.117931140997825423, 37.659347287717537256, 94.778508877261629095, + 125.23389264055003878, 9.1960193313898344059, 89.79227686872400227, 44.219955035077873617, + 80.594031160762824584, 98.175325535910815233, 9.1060313697525998577, 1.3536325568711617962, + 74.266441315219708486, 112.02497297326408443, 78.441242103348486125, 30.240608034280739957, + 35.887181287234852789, 31.222180933826166438, 111.20435677495697746, 16.961934521656075958, + 75.690011131529900013, 19.857096218624064932, 39.445799316181364702, 89.399067092508630594, + 9.8946251570741878822, 75.790836480315192603, 41.449609204857551958, 16.424785501782025676, + 110.92636979258531937, 35.2268612109037349, 93.553590155912388582, 60.716867816085141385, + 101.8275823641452007, 0.52353978253449895419, 53.558147969339188421, 14.022688405977532966, + 47.412589899395243265, 67.466685592477006139, 20.558449846765142865, 42.477512440153077478, + 78.376983236481464701, 52.194720245763164712, 80.210266588394006249, 10.32282516378472792, + 13.76645060176088009, 65.576818637229735032, 113.30637098982697353, 33.130573191992880311, + 85.595008141503058141, 40.008528567348548677, 76.341531842852418777, 14.979836669819633244, + 71.290441850942443125, 102.19776376600566437, 98.564603420047205873, 14.271847993266419508, + 80.116664932062121807, 19.992192520050593885, 36.609960786536248634, 73.030199955795978894, + 104.99763589425128885, 48.433380696202220861, 57.572455457851901883, 118.88634466403527767, + 44.860695004797889851, 73.750690998633217532, 13.556655583906831453, 88.593745596503140405, + 14.11532725519646192, 43.085424128406884847, 9.7802314795590064023, 30.352614322964655003, + 90.858137878454726888, 85.039140199140092591, 23.407077980155008845, 18.207643349760473939, + 20.440075362967036199, 109.47096555736425216, 66.428168903472396778, 106.84400033217025339, + 91.750582754768402083, 76.596534958600386744, 17.320324285941751441, 49.535734807919652667, + 113.66190455558171379, 61.225422811843600357, 18.669559649624716258, 76.387663934096053708, + 74.178235974148265086, 85.815782102505181683, 122.10498128451581579, 24.799236859667871613, + 123.2972609065072902, 50.72595180519783753, 121.41778173806596897, 114.39462376141091227, + 90.193730781800695695, 3.0683144895410805475, 26.293759879121353151, 46.076575149436393986, + 19.660881336145394016, 25.597005338699091226, 101.31112300279710325, 103.8807629969487607, + 91.892762314044375671, 57.045969595055794343, 110.15196133002973511, 94.689776863833685638, + 49.182032269411138259, 123.69104138236070867, 113.69436034850150463, 117.72063118611185928, + 1.4682589776566601358, 23.970066872989264084, 91.772521428280015243, 32.248277749331464292, + 74.556784206688462291, 120.01798423568834551, 87.713686773899098625, 80.036939679470378906, + 58.663490617163915886, 21.035325459186424268, 79.868647571121982764, 19.982377222022478236, + 57.246738529793219641, 1.9401161782407143619, 7.9883917663682950661, 108.92261904602855793, + 42.957866646069305716, 55.213983339206606615, 85.734177860773343127, 8.1786861732471152209, + 113.8021284014939738, 6.3038078266908996738, 108.74856571221971535, 13.502748231236182619, + 29.736439245178189594, 66.181101124901033472, 14.021098141827678774, 50.432291116485430393, + 71.692326357551792171, 112.62160509388922947, 46.52251733029333991, 70.328927450136689004, + 82.779915324492321815, 114.20617270459479187, 120.00074403454345884, 27.256265592593990732, + 72.206675336365151452, 105.47692570983417681, 90.069591432285960764, 59.451044258996262215, + 6.5436011348210740834, 11.666369110360392369, 127.00500442843986093, 66.781588143319822848, + 101.71752368163652136, 110.83473463953487226, 9.4843589676565898117, 87.965483504598523723, + 32.660788242061244091, 94.484722863278875593, 121.36131720729463268, 27.298648878622771008, + 105.17309219513481366, 68.000137710059789242, 93.444196628861391218, 44.093294898437306983, + 44.109477207573945634, 104.37636018792545656, 16.936308635202294681, 42.461140061379410326, + 48.120956522194319405, 47.03053727519363747, 74.836943859434541082, 76.560959611877478892, + 70.982041261755512096, 106.17278879548030091, 17.240951762454642449, 116.54761581097409362, + 85.489981931084912503, 19.448874795671144966, 68.055698282205412397, 120.54780957969705923, + 79.357897397254419047, 26.784055884931149194, 8.8652342647874320392, 93.554617017987766303, + 36.863637874987034593, 107.36296787388710072, 114.24380599117284874, 57.996031665523332777, + 107.15169167585190735, 6.8493815877518500201, 70.030736486780369887, 104.34439242449298035, + 32.394922227955248673, 72.045712768554949434, 125.99193223337715608, 79.855994894536706852, + 102.91479410954343621, 19.828504664699721616, 19.423237169754429488, 49.419210917687451001, + 51.794468197291280376, 59.485514724419772392, 78.600481083303748164, 75.802543954887369182, + 49.485430251796060475, 125.97828236915302114, 98.782930868979747174, 83.325835802559595322, + 59.946491932565550087, 73.477066622643178562, 89.105636388390848879, 73.372970791053376161, + 18.817599439345940482, 102.06705368556504254, 45.42352350837609265, 23.440921115026867483, + 90.344093902869644808, 17.970589397602452664, 53.956875561776541872, 55.525845976218988653, + 49.46730813278190908, 77.778136706394434441, 43.505807501616800437, 67.471431943824427435, + 84.265864734097704059, 14.933240975493390579, 24.684664495714969235, 126.41874786355037941, + 1.3222032844169007149, 126.01238007772190031, 83.383431563808699138, 113.72324844212562311, + 21.304834404720168095, 62.332525882295158226, 51.597882727459364105, 0.67672862408289802261, + 30.132787537324475124, 27.410108195865177549, 20.656855709145020228, 49.723609964024944929, + 119.05708648653671844, 91.246047016928059747, 84.369696109431970399, 85.591131138298806036, + 14.127644950760441134, 4.2155267645284766331, 24.204889203938364517, 19.661099106528126867, + 82.477870938018895686, 120.89188850888967863, 122.58114253445455688, 120.63265677435265388, + 27.082481923996965634, 29.761974944867688464, 72.461197358730714768, 84.204483040954073658, + 80.890771993039379595, 99.777925805155973649, 91.8974949579933309, 94.518818676227965625, + 126.28205386120316689, 88.787575110411125934, 93.769932165232603438, 79.733441483964270446, + 38.645666720854933374, 115.27208568365676911, 31.268716353544732556, 112.30475518474486307, + 74.891574611563555663, 115.66812160437984858, 18.66350298186080181, 94.633595189065090381, + 109.45983699533462641, 108.68776993196661351, 58.76809135159055586, 61.680897811242175521, + 38.882956551777169807, 45.576713001821190119, 7.4377005918177019339, 120.60427874347078614, + 120.21996894028052338, 47.606037590059713693, 0.31830988618094124831, 100.25516699311629054, + 47.640295608784072101, 54.846273798277252354, 28.508055838548898464, 43.870052658417989733, + 100.55382205772184534, 75.500383659185899887, 4.9093178806469950359, 94.694504893021075986, + 125.81647371741928509, 46.816913271115481621, 1.2095181909462553449, 57.569675058897701092, + 103.24443915764277335, 46.968332345710223308, 124.29687398737223702, 0.99589449742416036315, + 52.081455162358906819, 31.702300236192968441, 58.477325153755373321, 95.914756128498993348, + 88.990184675760247046, 116.11291302211611765, 73.457855086737254169, 17.972012550890212879, + 6.3771663286788680125, 106.98516744564767578, 87.631605941594898468, 17.380354291533876676, + 12.699961417023587273, 1.6289401052927132696, 64.15126917336601764, 96.380209723305597436, + 81.573269186425022781, 35.104765953132300638, 27.243879750436462928, 42.513088492334645707, + 114.76399014655180508, 19.270941023940395098, 82.998100437162065646, 99.244189034656301374, + 31.189040867498988518, 79.288022683835151838, 119.76943689437393914, 74.947252126396051608, + 36.195549936161114601, 43.913014761335944058, 24.131310158183623571, 75.350854649248503847, + 9.3535553423498640768, 64.011987649260845501, 107.55903376379137626, 0.38359813827628386207, + 18.956887880955036962, 95.847585462091956288, 81.993090068292076467, 86.291953507698053727, + 120.77611356736088055, 69.272790100472775521, 78.694729098406241974, 75.137275191682419972, + 68.4161886656365823, 0.42254301887442125008, 12.998425466252228944, 102.39876518130404293, + 119.35035699545915122, 89.283729198526998516, 5.9969242903098347597, 9.2125981001554464456, + 58.983442054923216347, 98.290763415519904811, 105.45414853996408056, 14.137400411400449229, + 70.068710073974216357, 48.023098438239685493, 95.002954518757178448, 98.07231147785205394, + 107.44480418927923893, 55.795478406631445978, 36.412895704717811896, 90.641204531511903042, + 66.833134656168112997, 38.456980318205751246, 123.73004329696050263, 8.2358622819956508465, + 75.318694575438712491, 61.557017754526896169, 122.46778528110007755, 18.392038662783306791, + 51.58455373744800454, 88.439910070159385214, 33.188062321529287146, 68.350651071821630467, + 18.212062739505199715, 2.7072651137459615711, 20.53288263044305495, 96.04994594653180684, + 28.882484206696972251, 60.481216068561479915, 71.774362574469705578, 62.444361867655970855, + 94.408713549913954921, 33.923869043315789895, 23.380022263059800025, 39.714192437248129863, + 78.891598632366367383, 50.798134185017261188, 19.789250314152013743, 23.581672960630385205, + 82.899218409715103917, 32.849571003567689331, 93.852739585170638748, 70.453722421811107779, + 59.107180311824777164, 121.43373563217392075, 75.655164728290401399, 1.0470795650689979084, + 107.11629593867837684, 28.045376811955065932, 94.825179798794124508, 6.9333711849540122785, + 41.116899693530285731, 84.955024880309792934, 28.753966472962929402, 104.3894404915299674, + 32.420533176788012497, 20.64565032756945584, 27.532901203525398159, 3.1536372744631080423, + 98.612741979653947055, 66.261146383989398601, 43.190016283006116282, 80.017057134700735332, + 24.683063685704837553, 29.959673339642904466, 14.580883701888524229, 76.39552753201496671, + 69.129206840094411746, 28.543695986536476994, 32.233329864124243613, 39.984385040101187769, + 73.219921573076135246, 18.060399911595595768, 81.995271788502577692, 96.866761392404441722, + 115.14491091570744175, 109.77268932807055535, 89.721390009599417681, 19.501381997266435064, + 27.113311167817300884, 49.18749119300628081, 28.230654510392923839, 86.170848256813769694, + 19.560462959118012805, 60.705228645932947984, 53.716275756913091755, 42.078280398280185182, + 46.81415596031001769, 36.415286699520947877, 40.880150725937710376, 90.941931114732142305, + 4.8563378069484315347, 85.688000664344144752, 55.501165509540442144, 25.193069917200773489, + 34.640648571883502882, 99.071469615842943313, 99.323809111163427588, 122.45084562368720071, + 37.339119299253070494, 24.775327868195745395, 20.356471948300168151, 43.631564205014001345, + 116.20996256903163157, 49.598473719339381205, 118.5945218130145804, 101.45190361039931304, + 114.83556347613557591, 100.78924752282546251, 52.38746156360139139, 6.136628979082161095, + 52.587519758242706303, 92.153150298872787971, 39.321762672290788032, 51.194010677401820431, + 74.622246005597844487, 79.761525993901159381, 55.785524628088751342, 114.09193919011522667, + 92.303922660063108196, 61.379553727667371277, 98.364064538825914497, 119.38208276472505531, + 99.388720697006647242, 107.44126237222371856, 2.9365179553133202717, 47.940133745982166147, + 55.545042856560030486, 64.496555498666566564, 21.113568413380562561, 112.03596847138032899, + 47.42737354780183523, 32.073879358940757811, 117.32698123432783177, 42.070650918376486516, + 31.737295142243965529, 39.964754444044956472, 114.49347705958643928, 3.8802323564814287238, + 15.976783532740228111, 89.845238092057115864, 85.915733292138611432, 110.42796667841685121, + 43.468355721546686254, 16.357372346497868421, 99.604256802987947594, 12.607615653385437327, + 89.497131424439430702, 27.005496462472365238, 59.472878490360017167, 4.3622022498020669445, + 28.042196283655357547, 100.86458223297449877, 15.384652715107222321, 97.243210187778458931, + 93.045034660590317799, 12.657854900277015986, 37.559830648988281609, 100.41234540919322171, + 112.00148806908691768, 54.512531185191619443, 16.413350672733940883, 82.953851419671991607, + 52.139182864571921527, 118.90208851799252443, 13.087202269642148167, 23.332738220724422717, + 126.01000885688335984, 5.5631762866432836745, 75.435047363276680699, 93.669469279069744516, + 18.968717935316817602, 47.930967009197047446, 65.321576484126126161, 60.969445726561389165, + 114.72263441458926536, 54.597297757249179995, 82.346184390273265308, 8.0002754201232164633, + 58.888393257722782437, 88.186589796874613967, 88.218954415151529247, 80.752720375850913115, + 33.872617270404589362, 84.922280122758820653, 96.241913044388638809, 94.061074550390912918, + 21.673887718872720143, 25.121919223758595763, 13.964082523514662171, 84.34557759096060181, + 34.481903524912922876, 105.09523162195182522, 42.979963862169825006, 38.897749591345927911, + 8.1113965644144627731, 113.09561915939775645, 30.715794794508838095, 53.568111769862298388, + 17.730468529578502057, 59.109234035975532606, 73.727275749977707164, 86.725935747777839424, + 100.48761198234569747, 115.99206333105030353, 86.303383351703814697, 13.698763175507338019, + 12.061472973564377753, 80.688784848985960707, 64.789844455914135324, 16.091425537113536848, + 123.98386446675795014, 31.711989789077051682, 77.829588219086872414, 39.657009329399443232, + 38.846474339508858975, 98.838421835374902003, 103.58893639458256075, 118.97102944884318276, + 29.200962166611134307, 23.605087909774738364, 98.970860503595758928, 123.95656473830968025, + 69.565861737963132327, 38.651671605119190644, 119.89298386513473815, 18.954133245289995102, + 50.211272776785335736, 18.745941582106752321, 37.635198878695518943, 76.134107371130085085, + 90.8470470167521853, 46.881842230057372944, 52.688187805739289615, 35.941178795204905327, + 107.91375112355308374, 111.05169195243797731, 98.934616265567456139, 27.556273412788868882, + 87.011615003237238852, 6.9428638876524928492, 40.531729468195408117, 29.866481950986781158, + 49.369328991433576448, 124.83749572710075881, 2.6444065688374394085, 124.02476015544743859, + 38.766863127621036256, 99.446496884251246229, 42.60966880944033619, 124.66505176459031645, + 103.19576545491872821, 1.3534572481657960452, 60.265575074648950249, 54.820216391730355099, + 41.313711418290040456, 99.447219928053527838, 110.11417297307707486, 54.492094033859757474, + 40.739392218867578777, 43.182262276597612072, 28.255289901520882268, 8.4310535290569532663, + 48.409778407876729034, 39.322198213059891714, 36.95574187604142935, 113.78377701778299524, + 117.16228506891275174, 113.26531354870530777, 54.164963847993931267, 59.523949889739014907, + 16.922394717465067515, 40.408966081911785295, 33.781543986082397169, 71.555851610315585276, + 55.794989915990299778, 61.037637352459569229, 124.56410772240997176, 49.575150220825889846, + 59.539864330468844855, 31.466882967928540893, 77.291333441713504726, 102.54417136731353821, + 62.53743270709310309, 96.609510369493364124, 21.783149223130749306, 103.33624320875969715, + 37.3270059637252416, 61.26719037813381874, 90.919673990672890795, 89.375539863933227025, + 117.53618270318111172, 123.36179562248435104, 77.765913103554339614, 91.153426003642380238, + 14.875401183639041847, 113.20855748694521026, 112.43993788056104677, 95.212075180119427387, + 0.63661977236552047543, 72.510333986232581083, 95.280591217568144202, 109.69254759655450471, + 57.016111677097796928, 87.740105316839617444, 73.107644115447328659, 23.000767318371799774, + 9.8186357612976280507, 61.389009786045789951, 123.63294743483857019, 93.633826542230963241, + 2.4190363818925106898, 115.13935011779904016, 78.488878315285546705, 93.936664691424084594, + 120.59374797474447405, 1.9917889948483207263, 104.16291032471781364, 63.404600472385936882, + 116.95465030751438462, 63.829512257001624675, 49.980369351524132071, 104.22582604423587327, + 18.915710173474508338, 35.944025101780425757, 12.754332657361374004, 85.970334891298989533, + 47.263211883189796936, 34.760708583067753352, 25.399922834047174547, 3.257880210589064518, + 0.30253834673567325808, 64.76041944661483285, 35.146538372850045562, 70.209531906264601275, + 54.487759500872925855, 85.026176984672929393, 101.52798029310361017, 38.541882047884428175, + 37.99620087432776927, 70.488378069312602747, 62.378081735001615016, 30.576045367673941655, + 111.53887378875151626, 21.894504252792103216, 72.391099872322229203, 87.826029522671888117, + 48.262620316370885121, 22.701709298497007694, 18.707110684703366132, 0.023975298525328980759, + 87.118067527582752518, 0.76719627655256772414, 37.913775761913711904, 63.695170924187550554, + 35.986180136587790912, 44.583907015399745433, 113.55222713472539908, 10.54558020094918902, + 29.389458196816121927, 22.274550383368477924, 8.8323773312731646001, 0.84508603774884250015, + 25.996850932508095866, 76.797530362611723831, 110.70071399092194042, 50.567458397053997032, + 11.993848580619669519, 18.425196200310892891, 117.96688410985007067, 68.581526831043447601, + 82.908297079928161111, 28.274800822804536438, 12.137420147948432714, 96.046196876483008964, + 62.005909037517994875, 68.144622955707745859, 86.889608378558477852, 111.59095681326289196, + 72.82579140943926177, 53.282409063027444063, 5.6662693123362259939, 76.91396063641514047, + 119.46008659392100526, 16.471724563994939672, 22.637389150877424981, 123.11403550905743032, + 116.93557056220015511, 36.784077325566613581, 103.16910747489964706, 48.879820140318770427, + 66.376124643062212272, 8.7013021436432609335, 36.424125479010399431, 5.4145302274919231422, + 41.065765260889747879, 64.099891893063613679, 57.764968413393944502, 120.96243213712659781, + 15.548725148939411156, 124.88872373531557969, 60.817427099827909842, 67.84773808663157979, + 46.76004452611960005, 79.428384874499897705, 29.783197264732734766, 101.59626837003452238, + 39.578500628304027487, 47.163345921264408389, 37.798436819430207834, 65.699142007139016641, + 59.705479170344915474, 12.907444843622215558, 118.21436062365319231, 114.86747126435147948, + 23.310329456580802798, 2.0941591301416337956, 86.232591877356753685, 56.090753623913769843, + 61.650359597588249017, 13.866742369908024557, 82.233799387064209441, 41.910049760619585868, + 57.507932945929496782, 80.778880983059934806, 64.841066353576024994, 41.291300655138911679, + 55.065802407050796319, 6.3072745489298540633, 69.225483959311532089, 4.5222927679787972011, + 86.380032566015870543, 32.034114269401470665, 49.366127371409675106, 59.919346679285808932, + 29.161767403780686436, 24.791055064033571398, 10.258413680188823491, 57.087391973072953988, + 64.466659728248487227, 79.968770080206013517, 18.439843146152270492, 36.120799823194829514, + 35.990543577008793363, 65.733522784812521422, 102.28982183141852147, 91.545378656144748675, + 51.442780019198835362, 39.002763994532870129, 54.226622335634601768, 98.374982386012561619, + 56.461309020789485658, 44.341696513627539389, 39.120925918236025609, 121.41045729186589597, + 107.43255151382618351, 84.156560796560370363, 93.62831192062003538, 72.830573399041895755, + 81.760301451879058732, 53.88386222946428461, 9.7126756139005010482, 43.376001328688289504, + 111.00233101908088429, 50.386139834401546977, 69.281297143770643743, 70.142939231689524604, + 70.647618222330493154, 116.90169124737440143, 74.678238598506140988, 49.550655736391490791, + 40.712943896600336302, 87.263128410031640669, 104.41992513806326315, 99.196947438682400389, + 109.18904362603279878, 74.903807220802264055, 101.6711269522747898, 73.578495045650925022, + 104.77492312720278278, 12.27325795816432219, 105.17503951648905058, 56.306300597745575942, + 78.643525344581576064, 102.38802135480727884, 21.244492011199326953, 31.523051987802318763, + 111.57104925618114066, 100.18387838023409131, 56.607845320126216393, 122.75910745533838053, + 68.728129077655466972, 110.7641655294537486, 70.777441394016932463, 86.882524744447437115, + 5.8730359106266405433, 95.880267491964332294, 111.09008571312369895, 0.99311099733313312754, + 42.2271368267647631, 96.071936942760657985, 94.854747095603670459, 64.147758717885153601, + 106.65396246865566354, 84.141301836752973031, 63.474590284487931058, 79.929508888093550922, + 100.98695411917287856, 7.7604647129628574476, 31.953567065484094201, 51.690476184117869707, + 43.831466584280860843, 92.855933356833702419, 86.936711443093372509, 32.71474469299937482, + 71.208513605975895189, 25.215231306774512632, 50.994262848878861405, 54.010992924944730476, + 118.94575698072003433, 8.7244044996041338891, 56.084392567314353073, 73.729164465948997531, + 30.76930543021808262, 66.48642037556055584, 58.090069321180635598, 25.315709800554031972, + 75.119661297980201198, 72.824690818390081404, 96.002976138173835352, 109.02506237038323889, + 32.826701345471519744, 37.907702839343983214, 104.27836572914748103, 109.80417703598504886, + 26.174404539284296334, 46.665476441452483414, 124.02001771376671968, 11.126352573290205328, + 22.870094726556999376, 59.338938558139489032, 37.937435870633635204, 95.861934018397732871, + 2.6431529682522523217, 121.93889145312641631, 101.44526882917853072, 109.19459551450199797, + 36.692368780546530616, 16.000550840246432927, 117.77678651544920285, 48.373179593752865912, + 48.437908830306696473, 33.50544075170182623, 67.745234540812816704, 41.844560245521279285, + 64.483826088780915597, 60.122149100781825837, 43.347775437745440286, 50.243838447517191526, + 27.92816504703296232, 40.691155181921203621, 68.963807049829483731, 82.190463243903650437, + 85.959927724339650013, 77.795499182691855822, 16.222793128832563525, 98.191238318795512896, + 61.43158958901767619, 107.13622353972459678, 35.460937059157004114, 118.21846807195470319, + 19.454551499959052308, 45.451871495559316827, 72.975223964695032919, 103.98412666210424504, + 44.606766703407629393, 27.397526351014676038, 24.122945947132393485, 33.377569697975559393, + 1.5796889118282706477, 32.182851074230711674, 119.96772893351590028, 63.423979578157741344, + 27.659176438173744828, 79.314018658798886463, 77.692948679021355929, 69.676843670753441984, + 79.177872789168759482, 109.94205889768636553, 58.401924333222268615, 47.210175819553114707, + 69.941721007195155835, 119.91312947662299848, 11.131723475926264655, 77.303343210242019268, + 111.78596773026947631, 37.908266490579990204, 100.42254555357067147, 37.491883164213504642, + 75.270397757394675864, 24.268214742263808148, 53.6940940335043706, 93.763684460114745889, + 105.37637561147857923, 71.882357590413448634, 87.827502247109805467, 94.103383904879592592, + 69.869232531134912279, 55.112546825581375742, 46.023230006474477705, 13.885727775304985698, + 81.063458936390816234, 59.732963901973562315, 98.738657982870790875, 121.67499145420151763, + 5.2888131376785167959, 120.04952031089487718, 77.53372625524571049, 70.892993768502492458, + 85.219337618884310359, 121.33010352918427088, 78.39153090983745642, 2.7069144963315920904, + 120.5311501492979005, 109.6404327834607102, 82.62742283658371889, 70.894439856110693654, + 92.228345946154149715, 108.98418806771951495, 81.478784437735157553, 86.364524553195224144, + 56.510579803041764535, 16.862107058113906533, 96.819556815753458068, 78.644396426119783428, + 73.911483752086496679, 99.567554035569628468, 106.32457013782914146, 98.530627097410615534, + 108.32992769598786253, 119.04789977947802981, 33.84478943493013503, 80.81793216382357059, + 67.563087972168432316, 15.111703220631170552, 111.58997983198059956, 122.07527470492277644, + 121.12821544481994351, 99.150300441651779693, 119.07972866093768971, 62.933765935860719765, + 26.582666883430647431, 77.088342734627076425, 125.07486541418984416, 65.219020738986728247, + 43.56629844626513659, 78.672486417519394308, 74.654011927450483199, 122.53438075627127546, + 53.83934798134941957, 50.751079727870092029, 107.07236540636586142, 118.72359124497234006, + 27.531826207112317206, 54.306852007284760475, 29.750802367281721672, 98.417114973894058494, + 96.879875761125731515, 62.424150360242492752, 1.2732395447346789297, 17.020667972468800144, + 62.561182435139926383, 91.385095193109009415, 114.03222335419923184, 47.480210633682872867, + 18.215288230894657318, 46.001534636743599549, 19.637271522595256101, 122.77801957209521788, + 119.26589486968077836, 59.267653084461926483, 4.8380727637886593584, 102.2787002356017183, + 28.977756630574731389, 59.873329382851807168, 113.1874959494889481, 3.9835779897002794314, + 80.325820649435627274, 126.80920094477551174, 105.90930061502876924, 127.65902451400324935, + 99.960738703051902121, 80.451652088471746538, 37.831420346949016675, 71.888050203560851514, + 25.508665314726385986, 43.940669782597979065, 94.526423766379593872, 69.521417166135506704, + 50.799845668094349094, 6.515760421178129036, 0.60507669347498449497, 1.5208388932296657003, + 70.293076745703729102, 12.419063812529202551, 108.97551900174948969, 42.052353969349496765, + 75.055960586207220331, 77.08376409576885635, 75.992401748659176519, 12.976756138625205494, + 124.75616347000323003, 61.152090735351521289, 95.077747577503032517, 43.789008505587844411, + 16.782199744648096384, 47.652059045343776233, 96.525240632741770241, 45.403418596994015388, + 37.414221369406732265, 0.047950597054295940325, 46.236135055165505037, 1.5343925531051354483, + 75.827551523827423807, 127.39034184837510111, 71.972360273175581824, 89.167814030803128844, + 99.104454269450798165, 21.091160401898378041, 58.778916393632243853, 44.549100766736955848, + 17.6647546625463292, 1.6901720754976850003, 51.993701865019829711, 25.595060725227085641, + 93.401427981843880843, 101.13491679410799406, 23.987697161239339039, 36.850392400625423761, + 107.93376821970377932, 9.1630536620905331802, 37.816594159856322221, 56.549601645609072875, + 24.274840295900503406, 64.092393752966017928, 124.01181807503962773, 8.2892459114191296976, + 45.779216757120593684, 95.18191362652942189, 17.65158281887852354, 106.56481812605488813, + 11.332538624676089967, 25.82792127283391892, 110.92017318784201052, 32.943449127989879344, + 45.274778301758487942, 118.22807101811849861, 105.87114112440031022, 73.568154651136865141, + 78.338214949799294118, 97.759640280641178833, 4.7522492861244245432, 17.402604287286521867, + 72.848250958020798862, 10.829060454983846284, 82.131530521783133736, 0.19978378612722735852, + 115.52993682679152698, 113.92486427425319562, 31.097450297882460291, 121.77744747063115938, + 121.63485419965945766, 7.6954761732631595805, 93.520089052242838079, 30.856769748999795411, + 59.566394529469107511, 75.192536740069044754, 79.157001256608054973, 94.326691842528816778, + 75.596873638864053646, 3.3982840142780332826, 119.41095834068983095, 25.814889687248069094, + 108.42872124731002259, 101.73494252870295895, 46.620658913161605597, 4.18831826028690557, + 44.465183754713507369, 112.18150724782753969, 123.30071919517649803, 27.733484739819687093, + 36.467598774128418881, 83.820099521239171736, 115.01586589186263154, 33.557761966123507591, + 1.6821327071520499885, 82.582601310277823359, 110.13160481410159264, 12.614549097863346105, + 10.450967918623064179, 9.0445855359612323809, 44.760065132031741086, 64.06822853880294133, + 98.732254742819350213, 119.83869335857161786, 58.323534807561372872, 49.582110128067142796, + 20.516827360377646983, 114.17478394614954595, 0.93331945650061243214, 31.937540160412027035, + 36.879686292304540984, 72.241599646389659029, 71.981087154021224706, 3.4670455696286808234, + 76.579643662840680918, 55.090757312289497349, 102.88556003839767072, 78.005527989065740258, + 108.45324467127284152, 68.749964772025123239, 112.92261804157897132, 88.683393027255078778, + 78.241851836475689197, 114.82091458373542991, 86.865103027656004997, 40.313121593124378705, + 59.256623841243708739, 17.661146798087429488, 35.520602903758117463, 107.76772445892856922, + 19.425351227801002096, 86.752002657380216988, 94.004662038161768578, 100.77227966880673193, + 10.562594287544925464, 12.285878463382687187, 13.295236444664624287, 105.80338249475244083, + 21.356477197012281977, 99.101311472782981582, 81.425887793204310583, 46.526256820066919317, + 80.839850276130164275, 70.393894877368438756, 90.378087252069235547, 21.807614441608166089, + 75.342253904553217581, 19.156990091305488022, 81.54984625440556556, 24.546515916332282359, + 82.350079032978101168, 112.61260119549478986, 29.287050689166790107, 76.77604270961455768, + 42.488984022398653906, 63.046103975608275505, 95.142098512365919305, 72.36775676046818262, + 113.21569064025607076, 117.51821491068039904, 9.4562581553145719226, 93.528331058911135187, + 13.554882788037502905, 45.76504948889487423, 11.746071821256919065, 63.760534983932302566, + 94.180171426247397903, 1.9862219946662662551, 84.454273653533164179, 64.143873885524953948, + 61.709494191210978897, 0.2955174357739451807, 85.307924937314965064, 40.282603673505946063, + 126.94918056897950009, 31.859017776190739824, 73.973908238345757127, 15.520929425925714895, + 63.907134130968188401, 103.38095236823573941, 87.662933168565359665, 57.711866713671042817, + 45.873422886186745018, 65.429489386002387619, 14.417027211951790377, 50.430462613549025264, + 101.98852569775772281, 108.02198584989309893, 109.89151396144006867, 17.448808999208267778, + 112.16878513463234412, 19.458328931897995062, 61.538610860439803218, 4.9728407511211116798, + 116.1801386423612712, 50.631419601111701922, 22.239322595964040374, 17.649381636783800786, + 64.005952276351308683, 90.050124740766477771, 65.653402690943039488, 75.815405678691604408, + 80.556731458298600046, 91.608354071970097721, 52.348809078568592668, 93.330952882908604806, + 120.04003542753343936, 22.252705146580410656, 45.740189453113998752, 118.67787711627897806, + 75.874871741270908387, 63.723868036795465741, 5.2863059365081426222, 115.8777829062564706, + 74.890537658360699425, 90.389191029003995936, 73.384737561093061231, 32.001101680496503832, + 107.5535730308984057, 96.746359187505731825, 96.875817660613392945, 67.010881503407290438, + 7.4904690816256334074, 83.689120491046196548, 0.96765217756183119491, 120.24429820156365167, + 86.695550875490880571, 100.48767689503438305, 55.856330094065924641, 81.38231036384604522, + 9.9276140996626054402, 36.380926487810938852, 43.919855448682938004, 27.590998365383711644, + 32.445586257668765029, 68.382476637591025792, 122.86317917803899036, 86.272447079449193552, + 70.921874118317646207, 108.43693614390940638, 38.909102999918104615, 90.903742991122271633, + 17.950447929393703816, 79.968253324208490085, 89.213533406815258786, 54.795052702029352076, + 48.24589189426478697, 66.755139395951118786, 3.1593778236565412953, 64.365702148465061327, + 111.93545786703180056, 126.84795915631548269, 55.318352876351127634, 30.628037317601410905, + 27.385897358046349837, 11.353687341510521946, 30.355745578341156943, 91.884117795372731052, + 116.80384866644453723, 94.420351639109867392, 11.883442014393949648, 111.82625895324599696, + 22.263446951856167288, 26.606686420487676514, 95.571935460538952611, 75.816532981163618388, + 72.845091107141342945, 74.983766328430647263, 22.540795514789351728, 48.536429484527616296, + 107.38818806701237918, 59.527368920233129757, 82.75275122296079644, 15.764715180830535246, + 47.655004494223248912, 60.206767809762823163, 11.738465062269824557, 110.22509365116275148, + 92.046460012948955409, 27.771455550613609375, 34.126917872781632468, 119.46592780395076261, + 69.477315965745219728, 115.34998290840303525, 10.577626275360671571, 112.09904062179339235, + 27.067452510495058959, 13.785987537008622894, 42.438675237772258697, 114.66020705837217974, + 28.78306181967491284, 5.4138289926668221597, 113.06230029859943897, 91.280865566925058374, + 37.254845673171075759, 13.788879712225025287, 56.456691892311937409, 89.968376135442667874, + 34.957568875473953085, 44.729049106390448287, 113.02115960608352907, 33.724214116231451044, + 65.639113631510554114, 29.288792852243204834, 19.822967504176631337, 71.135108071142894914, + 84.649140275661920896, 69.061254194824869046, 88.659855391979363048, 110.09579955895605963, + 67.689578869863908039, 33.63586432765077916, 7.1261759443368646316, 30.223406441265979083, + 95.179959663964837091, 116.15054940984919085, 114.25643088964352501, 70.300600883307197364, + 110.15945732187537942, 125.86753187172143953, 53.165333766864932841, 26.176685469257790828, + 122.1497308283833263, 2.4380414779734564945, 87.132596892533911159, 29.344972835042426595, + 21.308023854904604377, 117.06876151254255092, 107.67869596269883914, 101.50215945574382204, + 86.144730812735360814, 109.44718248994468013, 55.063652414224634413, 108.61370401456952095, + 59.501604734567081323, 68.834229947791754967, 65.75975152225146303, 124.8483007204849855, + 2.5464790894693578593, 34.041335944937600289, 125.12236487028349075, 54.770190386221656809, + 100.06444670839846367, 94.960421267365745734, 36.430576461789314635, 92.003069273487199098, + 39.274543045194150181, 117.55603914419407374, 110.53178973936155671, 118.53530616892385297, + 9.6761455275809566956, 76.557400471203436609, 57.955513261149462778, 119.74665876570725231, + 98.374991898977896199, 7.9671559794041968416, 32.651641298874892527, 125.61840188955466147, + 83.818601230061176466, 127.31804902801013668, 71.921477406107442221, 32.903304176943493076, + 75.66284069390167133, 15.776100407121703029, 51.017330629452771973, 87.881339565199596109, + 61.052847532762825722, 11.042834332271013409, 101.59969133618869819, 13.031520842356258072, + 1.2101533869499689899, 3.0416777864629693795, 12.586153491407458205, 24.83812762506204308, + 89.951038003498979378, 84.104707938702631509, 22.11192117241807864, 26.167528191541350679, + 23.984803497318353038, 25.953512277254048968, 121.51232694000646006, 122.30418147070668056, + 62.155495155006065033, 87.578017011175688822, 33.564399489296192769, 95.304118090691190446, + 65.050481265483540483, 90.806837193988030776, 74.82844273881346453, 0.095901194108591880649, + 92.472270110331010073, 3.0687851062139088754, 23.655103047658485593, 126.7806836967538402, + 15.944720546354801627, 50.335628061609895667, 70.20890853890159633, 42.182320803796756081, + 117.55783278726448771, 89.098201533473911695, 35.329509325092658401, 3.3803441509953700006, + 103.98740373003965942, 51.19012145045780926, 58.802855963691399666, 74.269833588215988129, + 47.975394322478678077, 73.700784801254485501, 87.867536439407558646, 18.32610732418106636, + 75.633188319712644443, 113.09920329121814575, 48.549680591804644791, 0.18478750593567383476, + 120.02363615007925546, 16.578491822838259395, 91.558433514244825346, 62.36382725305884378, + 35.303165637760685058, 85.129636252109776251, 22.665077249352179933, 51.655842545671475818, + 93.840346375684021041, 65.886898255979758687, 90.549556603520613862, 108.45614203624063521, + 83.742282248804258415, 19.136309302277368261, 28.676429899602226214, 67.519280561282357667, + 9.5044985722488490865, 34.805208574576681713, 17.696501916041597724, 21.658120909971330548, + 36.263061043566267472, 0.39956757225809269585, 103.05987365358669194, 99.849728548506391235, + 62.19490059576855856, 115.55489494126595673, 115.26970839931891533, 15.39095234652995714, + 59.040178104485676158, 61.713539497999590822, 119.132789058941853, 22.385073480141727487, + 30.314002513219747925, 60.653383685061271535, 23.193747277728107292, 6.796568028559704544, + 110.8219166813796619, 51.629779374499776168, 88.85744249462368316, 75.469885057405917905, + 93.241317826323211193, 8.3766365205738111399, 88.930367509430652717, 96.363014495658717351, + 118.60143839035299607, 55.466969479639374185, 72.935197548260475742, 39.640199042481981451, + 102.03173178372526309, 67.115523932247015182, 3.3642654143077379558, 37.165202620559284696, + 92.263209628203185275, 25.229098195726692211, 20.901935837246128358, 18.089171071922464762, + 89.520130264067120152, 0.13645707760952063836, 69.464509485642338404, 111.67738671714323573, + 116.64706961512274574, 99.164220256134285592, 41.033654720758931944, 100.34956789229909191, + 1.8666389130012248643, 63.87508032082405407, 73.759372584612719947, 16.483199292782956036, + 15.962174308042449411, 6.9340911392609996255, 25.159287325681361835, 110.18151462458263268, + 77.771120076798979426, 28.011055978135118494, 88.906489342549321009, 9.4999295440538844559, + 97.845236083161580609, 49.366786054513795534, 28.483703672955016373, 101.64182916747449781, + 45.730206055312009994, 80.626243186248757411, 118.51324768248741748, 35.322293596174858976, + 71.041205807519872906, 87.53544891785713844, 38.850702455605642172, 45.504005314764071954, + 60.009324076327175135, 73.544559337613463867, 21.125188575089850929, 24.571756926765374374, + 26.590472889332886552, 83.606764989504881669, 42.712954394028201932, 70.202622945569601143, + 34.851775586408621166, 93.052513640137476614, 33.679700552263966529, 12.787789754740515491, + 52.756174504138471093, 43.615228883219970157, 22.684507809106435161, 38.313980182614614023, + 35.09969250881113112, 49.093031832668202696, 36.700158065959840314, 97.225202390989579726, + 58.574101378337218193, 25.552085419229115359, 84.977968044797307812, 126.09220795122018899, + 62.284197024735476589, 16.735513520940003218, 98.431381280515779508, 107.03642982136079809, + 18.912516310632781824, 59.056662117822270375, 27.109765576075005811, 91.53009897778974846, + 23.492143642513838131, 127.52106996786824311, 60.360342852494795807, 3.972443989336170489, + 40.908547307069966337, 0.28774777104990789667, 123.41898838242195779, 0.59103487155152834021, + 42.615849874629930127, 80.565207347015530104, 125.89836113795900019, 63.718035552385117626, + 19.947816476691514254, 31.04185885185142979, 127.81426826194001478, 78.761904736475116806, + 47.32586633713071933, 115.42373342734208563, 91.746845772377128014, 2.8589787720047752373, + 28.834054423903580755, 100.86092522710168851, 75.977051395519083599, 88.043971699789835839, + 91.783027922880137339, 34.897617998420173535, 96.33757026926468825, 38.916657863795990124, + 123.07722172087960644, 9.9456815022458613385, 104.36027728472254239, 101.26283920222340384, + 44.478645191928080749, 35.298763273571239552, 0.011904552706255344674, 52.100249481536593521, + 3.3068053818897169549, 23.630811357386846794, 33.113462916600838071, 55.216708143940195441, + 104.69761815714082331, 58.661905765820847591, 112.08007085506687872, 44.505410293160821311, + 91.480378906231635483, 109.35575423256159411, 23.749743482541816775, 127.44773607359093148, + 10.572611873019923223, 103.75556581251657917, 21.781075316725036828, 52.778382058011629852, + 18.769475122186122462, 64.002203360996645642, 87.107146061800449388, 65.492718375015101628, + 65.75163532123042387, 6.0217630068145808764, 14.980938163254904794, 39.378240982092393097, + 1.9353043551273003686, 112.48859640313094133, 45.391101750985399121, 72.975353790068766102, + 111.71266018813548726, 34.764620727692090441, 19.85522819932521088, 72.761852975621877704, + 87.839710897365876008, 55.181996730767423287, 64.891172515341168037, 8.7649532751856895629, + 117.72635835608161869, 44.544894158902025083, 13.843748236638930393, 88.873872287818812765, + 77.818205999839847209, 53.807485982244543266, 35.900895858791045612, 31.936506648420618149, + 50.427066813630517572, 109.59010540405870415, 96.491783788533211919, 5.5102787919022375718, + 6.3187556473167205695, 0.73140429693376063369, 95.8709157340672391, 125.69591831263096537, + 110.63670575270225527, 61.25607463520282181, 54.771794716092699673, 22.707374683021043893, + 60.711491156685951864, 55.768235590749100083, 105.60769733289271244, 60.840703278219734784, + 23.766884028791537276, 95.652517906491993926, 44.526893903712334577, 53.213372840978991007, + 63.143870921081543202, 23.633065962330874754, 17.69018221428632387, 21.967532656861294527, + 45.081591029578703456, 97.072858969058870571, 86.776376134024758358, 119.05473784046989749, + 37.50550244592159288, 31.529430361661070492, 95.310008988446497824, 120.41353561952564633, + 23.476930124543287093, 92.450187302329140948, 56.092920025897910818, 55.542911101227218751, + 68.253835745566902915, 110.9318556079051632, 10.954631931494077435, 102.69996581680607051, + 21.15525255072498112, 96.198081243586784694, 54.134905020990117919, 27.571975074017245788, + 84.877350475548155373, 101.32041411674435949, 57.56612363934982568, 10.827657985337282298, + 98.124600597202515928, 54.561731133850116748, 74.509691346342151519, 27.577759424450050574, + 112.9133837846275128, 51.936752270885335747, 69.91513775094790617, 89.458098212784534553, + 98.04231921216705814, 67.448428232466540067, 3.2782272630211082287, 58.577585704486409668, + 39.645935008356900653, 14.270216142289427808, 41.29828055132747977, 10.122508389653376071, + 49.319710783962364076, 92.191599117915757233, 7.3791577397278160788, 67.271728655301558319, + 14.252351888673729263, 60.446812882535596145, 62.359919327933312161, 104.30109881970201968, + 100.51286177929068799, 12.601201766618032707, 92.31891464375439682, 123.73506374344287906, + 106.33066753372986568, 52.353370938519219635, 116.2994616567666526, 4.8760829559505509678, + 46.265193785067822319, 58.689945670084853191, 42.616047709812846733, 106.13752302508873981, + 87.357391925401316257, 75.004318911491282051, 44.289461625474359607, 90.894364979889360256, + 110.1273048284529068, 89.227408029139041901, 119.00320946913780062, 9.668459895587147912, + 3.5195030445065640379, 121.69660144096997101, 5.0929581789387157187, 68.082671889878838556, + 122.24472974056698149, 109.5403807724469516, 72.128893416800565319, 61.920842534731491469, + 72.861152923582267249, 56.006138546974398196, 78.549086090391938342, 107.11207828839178546, + 93.063579478726751404, 109.07061233784770593, 19.35229105516555137, 25.114800942406873219, + 115.91102652230256354, 111.49331753141814261, 68.749983797955792397, 15.934311958808393683, + 65.303282597753423033, 123.23680377911296091, 39.63720246012599091, 126.63609805602391134, + 15.842954812214884441, 65.80660835389062413, 23.325681387803342659, 31.552200814243406057, + 102.03466125890918192, 47.762679130399192218, 122.10569506552565144, 22.085668664545664797, + 75.199382672377396375, 26.063041684712516144, 2.4203067738999379799, 6.083355572925938759, + 25.17230698281491641, 49.676255250127724139, 51.902076007001596736, 40.209415877405263018, + 44.223842344836157281, 52.335056383082701359, 47.969606994636706077, 51.907024554511735914, + 115.02465388001655811, 116.60836294141336111, 124.31099031001576805, 47.156034022351377644, + 67.128798978596023517, 62.60823618138601887, 2.1009625309707189444, 53.613674387979699532, + 21.65688547762692906, 0.19180238822082174011, 56.944540220662020147, 6.1375702124278177507, + 47.310206095320609165, 125.56136739350768039, 31.889441092709603254, 100.67125612322342931, + 12.41781707780319266, 84.364641607597150141, 107.11566557453261339, 50.19640306694782339, + 70.659018650185316801, 6.76068830199437798, 79.974807460079318844, 102.38024290091561852, + 117.60571192738643731, 20.539667176431976259, 95.950788644960994134, 19.401569602512608981, + 47.735072878815117292, 36.652214648365770699, 23.266376639428926865, 98.198406582436291501, + 97.099361183609289583, 0.36957501187498564832, 112.04727230015851092, 33.156983645680156769, + 55.116867028489650693, 124.72765450611768756, 70.606331275525008095, 42.259272504219552502, + 45.330154498704359867, 103.31168509134658962, 59.68069275137168006, 3.7737965119631553534, + 53.099113207044865703, 88.912284072484908393, 39.484564497608516831, 38.272618604554736521, + 57.352859799208090408, 7.0385611225647153333, 19.008997144497698173, 69.610417149153363425, + 35.393003832083195448, 43.316241819942661095, 72.526122087132534944, 0.7991351445198233705, + 78.119747307177021867, 71.699457097012782469, 124.3898011915407551, 103.10978988253555144, + 102.53941679863783065, 30.78190469305991428, 118.08035620897135232, 123.42707899600281962, + 110.265578117883706, 44.770146960283454973, 60.62800502643949585, 121.30676737012254307, + 46.387494555456214584, 13.593136057123047067, 93.643833362759323791, 103.25955874900319031, + 49.714884989251004299, 22.939770114815473789, 58.482635652646422386, 16.753273041151260259, + 49.860735018864943413, 64.726028991321072681, 109.20287678070599213, 110.93393895928238635, + 17.870395096520951483, 79.28039808496760088, 76.063463567454164149, 6.2310478644940303639, + 6.7285308286154759116, 74.330405241122207372, 56.52641925640637055, 50.458196391453384422, + 41.803871674492256716, 36.178342143848567503, 51.040260528134240303, 0.27291415522267925553, + 10.929018971288314788, 95.354773434290109435, 105.29413923024912947, 70.328440512268571183, + 82.067309441521501867, 72.699135784598183818, 3.7332778260024497285, 127.75016064165174612, + 19.518745169225439895, 32.966398585565912072, 31.924348616084898822, 13.868182278521999251, + 50.31857465136636165, 92.363029249168903334, 27.542240153597958852, 56.022111956273874966, + 49.812978685098642018, 18.999859088111406891, 67.690472166323161218, 98.733572109027591068, + 56.967407345913670724, 75.283658334948995616, 91.460412110627657967, 33.2524863725011528, + 109.02649536497483496, 70.644587192353355931, 14.08241161504338379, 47.07089783571427688, + 77.701404911211284343, 91.008010629528143909, 120.01864815265798825, 19.089118675226927735, + 42.250377150179701857, 49.143513853530748747, 53.180945778669411084, 39.213529979009763338, + 85.425908788060041843, 12.405245891139202286, 69.703551172820880311, 58.105027280274953227, + 67.359401104527933057, 25.575579509481030982, 105.51234900827694219, 87.230457766439940315, + 45.369015618212870322, 76.627960365229228046, 70.199385017622262239, 98.186063665336405393, + 73.400316131923318608, 66.450404781979159452, 117.14820275667443639, 51.104170838461868698, + 41.955936089598253602, 124.18441590244037798, 124.56839404947095318, 33.471027041883644415, + 68.862762561035196995, 86.072859642721596174, 37.825032621265563648, 118.11332423564454075, + 54.2195311521536496, 55.06019795557949692, 46.984287285031314241, 127.04213993573648622, + 120.72068570498959161, 7.9448879786723409779, 81.817094614139932673, 0.57549554210345377214, + 118.83797676484391559, 1.1820697431030566804, 85.231699749263498234, 33.130414694034698186, + 123.79672227591800038, 127.43607110477023525, 39.895632953383028507, 62.083717703706497559, + 127.62853652388366754, 29.523809472950233612, 94.651732674265076639, 102.84746685468780925, + 55.493691544754256029, 5.7179575440095504746, 57.668108847810799489, 73.721850454207014991, + 23.954102791041805176, 48.087943399583309656, 55.566055845760274678, 69.795235996843985049, + 64.675140538529376499, 77.833315727595618227, 118.15444344175921287, 19.891363004495360656, + 80.720554569448722759, 74.52567840444680769, 88.957290383856161498, 70.597526547142479103, + 0.023809105412510689348, 104.20049896307318704, 6.6136107637794339098, 47.261622714773693588, + 66.226925833201676141, 110.43341628788402886, 81.395236314281646628, 117.32381153164533316, + 96.160141710133757442, 89.010820586325280601, 54.960757812466908945, 90.711508465123188216, + 47.499486965087271528, 126.89547214718186297, 21.145223746043484425, 79.511131625033158343, + 43.562150633450073656, 105.5567641160232597, 37.538950244375882903, 0.0044067219969292636961, + 46.214292123604536755, 2.9854367500338412356, 3.5032706424608477391, 12.043526013629161753, + 29.961876326509809587, 78.756481964184786193, 3.8706087102582387161, 96.977192806261882652, + 90.782203501974436222, 17.950707580141170183, 95.425320376270974521, 69.529241455384180881, + 39.71045639865405974, 17.523705951247393386, 47.679421794731752016, 110.36399346153848455, + 1.7823450306823360734, 17.529906550375017105, 107.45271671216323739, 89.089788317804050166, + 27.687496473281498766, 49.747744575641263509, 27.636411999679694418, 107.61497196448908653, + 71.801791717582091223, 63.873013296841236297, 100.85413362726467312, 91.180210808121046284, + 64.983567577066423837, 11.020557583804475144, 12.637511294633441139, 1.4628085938711592462, + 63.741831468138116179, 123.39183662526556873, 93.273411505404510535, 122.51214927040564362, + 109.54358943218539935, 45.414749366042087786, 121.42298231337190373, 111.53647118150183815, + 83.215394665785424877, 121.68140655643946957, 47.53376805758671253, 63.305035812983987853, + 89.053787807424669154, 106.42674568195798201, 126.2877418421630864, 47.266131924661749508, + 35.380364428572647739, 43.935065313722589053, 90.16318205916104489, 66.14571793812137912, + 45.552752268053154694, 110.10947568093979498, 75.01100489184318576, 63.058860723325778963, + 62.620017976896633627, 112.82707123905129265, 46.953860249090212164, 56.900374604658281896, + 112.18584005179582164, 111.08582220245807548, 8.5076714911374438088, 93.863711215810326394, + 21.909263862991792848, 77.399931633612141013, 42.310505101453600219, 64.396162487173569389, + 108.26981004198023584, 55.143950148038129555, 41.754700951099948725, 74.640828233488718979, + 115.13224727869965136, 21.655315970678202575, 68.249201194405031856, 109.12346226770387148, + 21.019382692684303038, 55.155518848903739126, 97.826767569255025592, 103.87350454177430947, + 11.830275501899450319, 50.916196425572707085, 68.084638424337754259, 6.8968564649330801331, + 6.5564545260422164574, 117.15517140897281934, 79.291870016713801306, 28.540432284578855615, + 82.596561102654959541, 20.245016779306752142, 98.63942156792836613, 56.383198235831514467, + 14.758315479459270136, 6.543457310603116639, 28.504703777347458526, 120.89362576507119229, + 124.7198386558702623, 80.602197639407677343, 73.025723558581375983, 25.202403533239703393, + 56.63782928751243162, 119.4701274868893961, 84.661335067459731363, 104.70674187704207725, + 104.59892331353330519, 9.7521659119011019357, 92.530387570135644637, 117.37989134016970638, + 85.232095419629331445, 84.275046050181117607, 46.714783850806270493, 22.008637822982564103, + 88.578923250952357193, 53.788729959782358492, 92.254609656909451587, 50.45481605828172178, + 110.00641893827560125, 19.336919791174295824, 7.0390060890167660546, 115.39320288194358, + 10.185916357881069416, 8.1653437797613150906, 116.48945948113760096, 91.080761544897541171, + 16.257786833601130638, 123.84168506946662092, 17.722305847164534498, 112.01227709395243437, + 29.098172180787514662, 86.224156576787208905, 58.127158957457140787, 90.141224675695411861, + 38.70458211033110274, 50.229601884817384416, 103.82205304460876505, 94.986635062839923194, + 9.4999675959115847945, 31.868623917620425345, 2.6065651955104840454, 118.47360755822592182, + 79.2744049202556198, 125.27219611204782268, 31.685909624433406861, 3.6132167077812482603, + 46.651362775606685318, 63.104401628490450094, 76.069322517818363849, 95.525358260802022414, + 116.21139013105130289, 44.171337329094967572, 22.39876534475479275, 52.126083369425032288, + 4.8406135477998759598, 12.166711145851877518, 50.344613965629832819, 99.352510500255448278, + 103.80415201400319347, 80.418831754810526036, 88.447684689672314562, 104.67011276616540272, + 95.939213989273412153, 103.81404910902710981, 102.04930776003675419, 105.21672588283036021, + 120.62198062003153609, 94.312068044706393266, 6.2575979571920470335, 125.21647236277203774, + 4.2019250619414378889, 107.22734877595939906, 43.313770955253858119, 0.38360477644164348021, + 113.88908044132404029, 12.275140424855635501, 94.62041219064485631, 123.12273478701536078, + 63.778882185422844486, 73.342512246446858626, 24.835634155610023299, 40.729283215197938262, + 86.231331149065226782, 100.39280613389928476, 13.318037300370633602, 13.521376603992393939, + 31.949614920162275666, 76.760485801834875019, 107.21142385477287462, 41.079334352867590496, + 63.901577289921988267, 38.803139205025217962, 95.470145757630234584, 73.304429296731541399, + 46.532753278861491708, 68.396813164876220981, 66.198722367218579166, 0.73915002375360927545, + 96.094544600317021832, 66.313967291360313538, 110.23373405698293936, 121.4553090122390131, + 13.212662551050016191, 84.518545008439105004, 90.660308997412357712, 78.623370182693179231, + 119.36138550274336012, 7.5475930239263107069, 106.19822641409336939, 49.824568144969816785, + 78.969128995217033662, 76.545237209109473042, 114.70571959841618082, 14.077122245129430667, + 38.017994288999034325, 11.220834298306726851, 70.786007664166390896, 86.63248363988896017, + 17.052244174265069887, 1.5982702890432847198, 28.239494614357681712, 15.398914194029202918, + 120.77960238308514818, 78.219579765074740862, 77.078833597275661305, 61.563809386123466538, + 108.16071241794634261, 118.85415799200927722, 92.531156235767411999, 89.540293920566909947, + 121.25601005288262968, 114.61353474024508614, 92.774989110912429169, 27.186272114249732113, + 59.28766672552228556, 78.519117498006380629, 99.429769978502008598, 45.879540229630947579, + 116.96527130529284477, 33.506546082302520517, 99.721470037733524805, 1.4520579826457833406, + 90.405753561415622244, 93.867877918564772699, 35.740790193045540946, 30.560796169938839739, + 24.126927134908328298, 12.462095728988060728, 13.457061657234589802, 20.660810482244414743, + 113.0528385128127411, 100.91639278290676884, 83.607743348984513432, 72.356684287697135005, + 102.08052105626848061, 0.54582831044535851106, 21.858037942580267554, 62.709546868583856849, + 82.588278460501896916, 12.656881024540780345, 36.134618883046641713, 17.398271569196367636, + 7.4665556520085374359, 127.50032128330349224, 39.03749033845087979, 65.932797171131824143, + 63.848697232169797644, 27.736364557043998502, 100.63714930273636128, 56.726058498337806668, + 55.084480307195917703, 112.04422391254774993, 99.625957370197284035, 37.99971817622645176, + 7.3809443326499604154, 69.467144218055182137, 113.93481469183097943, 22.567316669901629211, + 54.920824221255315933, 66.50497274500594358, 90.052990729953307891, 13.289174384706711862, + 28.16482323008676758, 94.141795671432191739, 27.402809822426206665, 54.016021259059925796, + 112.0372963053159765, 38.17823735045385547, 84.500754300359403715, 98.287027707061497495, + 106.36189155733882217, 78.427059958023164654, 42.851817576120083686, 24.81049178228204255, + 11.407102345641760621, 116.21005456055354443, 6.7188022090558661148, 51.151159018965699943, + 83.024698016557522351, 46.460915532879880629, 90.738031236429378623, 25.25592073046209407, + 12.398770035248162458, 68.372127330676448764, 18.800632263850275194, 4.9008095639619568828, + 106.29640551334887277, 102.2083416769237374, 83.911872179200145183, 120.36883180488439393, + 121.13678809894190636, 66.942054083770926809, 9.7255251220740319695, 44.145719285443192348, + 75.650065242534765275, 108.2266484712890815, 108.4390623043072992, 110.12039591115899384, + 93.96857457006626646, 126.08427987147661042, 113.44137140997918323, 15.889775957348319935, + 35.634189228279865347, 1.1509910842105455231, 109.67595352968783118, 2.3641394862097513396, + 42.463399498526996467, 66.260829388073034352, 119.59344455183963873, 126.8721422095404705, + 79.791265906766057014, 124.1674354074166331, 127.25707304776733508, 59.047618945904105203, + 61.303465348533791257, 77.694933709375618491, 110.98738308950851206, 11.435915088019100949, + 115.33621769562523696, 19.443700908414029982, 47.908205582083610352, 96.175886799166619312, + 111.13211169152418734, 11.590471993691608077, 1.3502810770623909775, 27.666631455194874434, + 108.30888688351842575, 39.78272600899435929, 33.441109138901083497, 21.051356808897253359, + 49.914580767715960974, 13.195053094284958206, 0.047618210828659357503, 80.400997926146374084, + 13.22722152755886782, 94.523245429551025154, 4.4538516664069902617, 92.866832575771695701, + 34.790472628566931235, 106.6476230632943043, 64.320283420271152863, 50.021641172650561202, + 109.92151562493745587, 53.423016930246376432, 94.998973930178181035, 125.79094429436372593, + 42.290447492090606829, 31.022263250066316687, 87.12430126690378529, 83.113528232046519406, + 75.077900488751765806, 0.0088134439938585273921, 92.42858424720907351, 5.9708735000676824711, + 7.0065412849216954783, 24.087052027258323506, 59.923752653023257153, 29.512963928369572386, + 7.7412174205201154109, 65.954385612527403282, 53.564407003948872443, 35.901415160285978345, + 62.85064075254558702, 11.058482910768361762, 79.42091279730811948, 35.047411902494786773, + 95.35884358946714201, 92.727986923076969106, 3.5646900613646721467, 35.059813100753672188, + 86.905433424330112757, 50.179576635608100332, 55.374992946562997531, 99.495489151282527018, + 55.272823999363026815, 87.229943928981811041, 15.603583435164182447, 127.74602659368611057, + 73.708267254532984225, 54.360421616245730547, 1.9671351541328476742, 22.041115167608950287, + 25.275022589266882278, 2.9256171877423184924, 127.48366293627987034, 118.78367325053477543, + 58.546823010812659049, 117.02429854081492522, 91.087178864370798692, 90.829498732087813551, + 114.84596462674744544, 95.07294236300731427, 38.430789331574487733, 115.36281311287893914, + 95.06753611517342506, 126.61007162597161368, 50.107575614852976287, 84.853491363919602009, + 124.57548368432617281, 94.532263849323499016, 70.760728857145295478, 87.870130627448816085, + 52.326364118325727759, 4.2914358762427582406, 91.105504536109947367, 92.218951361883227946, + 22.02200978368637152, 126.11772144665155793, 125.24003595379690523, 97.654142478102585301, + 93.907720498180424329, 113.80074920932020177, 96.371680103595281253, 94.171644404916150961, + 17.015342982278525596, 59.727422431620652787, 43.818527725987223675, 26.799863267224282026, + 84.621010202910838416, 0.79232497435077675618, 88.539620083960471675, 110.28790029607625911, + 83.509401902203535428, 21.281656466981075937, 102.26449455739930272, 43.310631941360043129, + 8.4984023888137016911, 90.246924535407742951, 42.038765385368606076, 110.31103769781111623, + 67.653535138513689162, 79.747009083548618946, 23.660551003798900638, 101.83239285114905215, + 8.1692768486755085178, 13.793712929866160266, 13.112909052088070894, 106.31034281794927665, + 30.583740033427602611, 57.080864569161349209, 37.193122205309919082, 40.490033558617142262, + 69.27884313585673226, 112.76639647166302893, 29.516630958918540273, 13.086914621206233278, + 57.009407554698555032, 113.78725153014602256, 121.43967731174416258, 33.204395278818992665, + 18.051447117162751965, 50.404807066479406785, 113.27565857502850122, 110.94025497378243017, + 41.322670134923100704, 81.413483754087792477, 81.197846627066610381, 19.50433182380584185, + 57.060775140274927253, 106.75978268034305074, 42.464190839262300869, 40.550092100362235215, + 93.429567701612540986, 44.017275645968766185, 49.157846501904714387, 107.57745991956835496, + 56.509219313818903174, 100.90963211656708154, 92.012837876551202498, 38.673839582348591648, + 14.078012178037170088, 102.78640576389079797, 20.371832715762138832, 16.33068755952626816, + 104.9789189622788399, 54.161523089795082342, 32.515573667205899255, 119.68337013893324183, + 35.444611694332706975, 96.024554187904868741, 58.196344361578667304, 44.448313153574417811, + 116.25431791491791955, 52.282449351390823722, 77.40916422066220548, 100.45920376963840681, + 79.644106089221168077, 61.973270125679846387, 18.999935191823169589, 63.737247835240850691, + 5.2131303910246060695, 108.94721511645548162, 30.548809840514877578, 122.54439222409564536, + 63.371819248866813723, 7.2264334155624965206, 93.302725551213370636, 126.20880325698453817, + 24.138645035640365677, 63.050716521607682807, 104.42278026210260577, 88.342674658189935144, + 44.7975306895095855, 104.25216673885006458, 9.6812270955997519195, 24.333422291703755036, + 100.68922793126330362, 70.705021000514534535, 79.608304028010024922, 32.83766350962469005, + 48.895369379348267103, 81.340225532334443415, 63.878427978550462285, 79.628098218057857594, + 76.098615520077146357, 82.43345176566435839, 113.24396124006671016, 60.624136089412786532, + 12.515195914387732046, 122.43294472554407548, 8.4038501238865137566, 86.454697551918798126, + 86.627541910507716238, 0.76720955288692493923, 99.778160882648080587, 24.550280849714908982, + 61.240824381293350598, 118.24546957403072156, 127.55776437084932695, 18.685024492893717252, + 49.671268311220046598, 81.458566430399514502, 44.462662298134091543, 72.785612267798569519, + 26.636074600741267204, 27.042753207984787878, 63.899229840328189312, 25.520971603673388017, + 86.42284770954574924, 82.158668705735180993, 127.80315457984397653, 77.606278410054073902, + 62.940291515264107147, 18.608858593463082798, 93.065506557726621395, 8.7936263297560799401, + 4.3974447344371583313, 1.4783000475108565297, 64.189089200637681643, 4.6279345827242650557, + 92.467468113969516708, 114.9106180244780262, 26.425325102103670361, 41.037090016881847987, + 53.320617994828353403, 29.246740365389996441, 110.72277100548672024, 15.095186047856259393, + 84.39645282818673877, 99.649136289943271549, 29.938257990437705303, 25.090474418222584063, + 101.41143919683236163, 28.154244490258861333, 76.035988577998068649, 22.44166859661709168, + 13.57201532833641977, 45.264967279777920339, 34.104488348530139774, 3.1965405780865694396, + 56.478989228715363424, 30.797828388062043814, 113.55920476617393433, 28.439159530153119704, + 26.157667194551322609, 123.12761877225057106, 88.321424835896323202, 109.70831598402219242, + 57.062312471538461978, 51.080587841137457872, 114.51202010576889734, 101.22706948049381026, + 57.549978221824858338, 54.372544228499464225, 118.5753334510482091, 29.038234996016399236, + 70.859539957004017197, 91.759080459265533136, 105.93054261058568954, 67.013092164608679013, + 71.44294007546704961, 2.9041159652952046599, 52.811507122834882466, 59.735755837129545398, + 71.481580386091081891, 61.121592339877679478, 48.253854269816656597, 24.924191457976121455, + 26.914123314469179604, 41.321620964492467465, 98.10567702562912018, 73.832785565817175666, + 39.215486697972664842, 16.713368575397907989, 76.161042112536961213, 1.0916566208907170221, + 43.716075885160535108, 125.41909373717135168, 37.176556921003793832, 25.31376204908156069, + 72.269237766093283426, 34.796543138392735273, 14.933111304020712851, 127.00064256660698447, + 78.074980676905397559, 3.8655943422636482865, 127.69739446433959529, 55.472729114091634983, + 73.274298605472722556, 113.45211699667561334, 110.16896061439547339, 96.088447825099137845, + 71.251914740394568071, 75.99943635245290352, 14.76188866530355881, 10.934288436114002252, + 99.869629383661958855, 45.134633339803258423, 109.84164844251426985, 5.009945490015525138, + 52.105981459906615783, 26.578348769413423724, 56.32964646017717314, 60.283591342864383478, + 54.80561964485241333, 108.03204251812348957, 96.074592610631952994, 76.356474700911348918, + 41.001508600722445408, 68.574055414126632968, 84.723783114681282314, 28.854119916046329308, + 85.703635152240167372, 49.6209835645640851, 22.814204691287159221, 104.42010912110708887, + 13.43760441811173223, 102.30231803793503786, 38.049396033115044702, 92.921831065763399238, + 53.476062472858757246, 50.511841460924188141, 24.797540070499962894, 8.7442546613528975286, + 37.601264527700550389, 9.8016191279275517445, 84.592811026701383526, 76.41668335385111277, + 39.823744358403928345, 112.73766360977242584, 114.27357619788745069, 5.8841081675418536179, + 19.451050244148063939, 88.291438570890022675, 23.300130485073168529, 88.453296942581800977, + 88.87812460861823638, 92.240791822321625659, 59.937149140136170899, 124.16855974295685883, + 98.882742819958366454, 31.779551914696639869, 71.268378456559730694, 2.301982168424729025, + 91.351907059375662357, 4.7282789724195026793, 84.926798997057630913, 4.5216587761497066822, + 111.18688910368291545, 125.74428441908457899, 31.582531813535752008, 120.33487081483690417, + 126.51414609553467017, 118.09523789180821041, 122.60693069707122049, 27.389867418754874961, + 93.974766179017024115, 22.871830176041839877, 102.67243539125047391, 38.887401816828059964, + 95.816411164170858683, 64.351773598336876603, 94.264223383048374671, 23.180943987383216154, + 2.700562154124781955, 55.333262910393386846, 88.617773767036851496, 79.56545201798871858, + 66.882218277802166995, 42.102713617794506717, 99.829161535431921948, 26.390106188569916412, + 0.095236421660956693813, 32.801995852292748168, 26.454443055121373618, 61.046490859102050308, + 8.9077033328176185023, 57.733665151543391403, 69.580945257137500448, 85.295246126592246583, + 0.64056684054230572656, 100.04328234530476038, 91.843031249874911737, 106.84603386049639084, + 61.99794786036000005, 123.58188858872745186, 84.580894984181213658, 62.044526500136271352, + 46.248602533811208559, 38.227056464096676791, 22.155800977503531612, 0.017626887991355033591, + 56.85716849441814702, 11.941747000135364942, 14.013082569843390957, 48.174104054516647011, + 119.84750530604651431, 59.025927856739144772, 15.482434841043868801, 3.908771225054806564, + 107.12881400789774489, 71.80283032057195669, 125.70128150509117404, 22.116965821540361503, + 30.841825594616238959, 70.094823804993211525, 62.717687178937921999, 57.455973846153938212, + 7.1293801227293442935, 70.119626201510982355, 45.810866848660225514, 100.35915327121620066, + 110.74998589312963304, 70.990978302565054037, 110.54564799872969161, 46.459887857963622082, + 31.207166870332002873, 127.49205318737585912, 19.41653450906596845, 108.72084323249146109, + 3.9342703082656953484, 44.082230335217900574, 50.550045178533764556, 5.8512343754882749636, + 126.96732587256337865, 109.56734650106955087, 117.09364602162895608, 106.04859708163348841, + 54.174357728745235363, 53.65899746417926508, 101.69192925349852885, 62.145884726014628541, + 76.861578663152613444, 102.72562622576151625, 62.135072230350488098, 125.22014325194322737, + 100.21515122970959055, 41.706982727842841996, 121.15096736865598359, 61.064527698650636012, + 13.521457714294228936, 47.74026125489763217, 104.65272823665145552, 8.5828717524891544599, + 54.211009072223532712, 56.437902723766455892, 44.044019567376381019, 124.23544289330675383, + 122.48007190759744844, 67.30828495620880858, 59.815440996364486637, 99.601498418644041521, + 64.743360207194200484, 60.343288809832301922, 34.030685964557051193, 119.45484486324130557, + 87.637055451974447351, 53.599726534452202031, 41.242020405821676832, 1.5846499487051914912, + 49.079240167924581328, 92.575800592156156199, 39.018803804407070857, 42.563312933965789853, + 76.528989114798605442, 86.621263882720086258, 16.996804777631041361, 52.493849070815485902, + 84.07753077074085013, 92.622075395625870442, 7.3070702770310163032, 31.494018167097237892, + 47.321102007601439254, 75.664785702298104297, 16.338553697351017036, 27.587425859732320532, + 26.225818104179779766, 84.620685635898553301, 61.167480066855205223, 114.16172913832269842, + 74.386244410619838163, 80.980067117237922503, 10.5576862717171025, 97.532792943326057866, + 59.033261917837080546, 26.173829242412466556, 114.01881510940074804, 99.574503060295683099, + 114.87935462348832516, 66.40879055763798533, 36.10289423432550393, 100.80961413296245155, + 98.551317150060640415, 93.88050994756486034, 82.645340269849839387, 34.826967508179222932, + 34.395693254133220762, 39.0086636476116837, 114.12155028055349248, 85.519565360686101485, + 84.928381678524601739, 81.100184200728108408, 58.859135403225081973, 88.034551291937532369, + 98.315693003813066753, 87.154919839136709925, 113.01843862764144433, 73.819264233137801057, + 56.025675753102404997, 77.347679164697183296, 28.156024356077978155, 77.57281152778523392, + 40.743665431524277665, 32.661375119056174299, 81.957837924557679798, 108.32304617959016468, + 65.03114733441543649, 111.36674027786648367, 70.889223388669051928, 64.049108375809737481, + 116.39268872315733461, 88.896626307152473601, 104.5086358298358391, 104.56489870278528542, + 26.818328441328048939, 72.918407539280451601, 31.288212178442336153, 123.94654025135969277, + 37.999870383646339178, 127.47449567048170138, 10.426260782052850118, 89.894430232910963241, + 61.097619681033393135, 117.08878444819129072, 126.74363849773362745, 14.45286683112863102, + 58.605451102430379251, 124.41760651396907633, 48.277290071280731354, 126.10143304321900359, + 80.845560524208849529, 48.685349316379870288, 89.595061379022808978, 80.504333477700129151, + 19.362454191199503839, 48.666844583411148051, 73.378455862530245213, 13.410042001032707049, + 31.216608056020049844, 65.675327019249380101, 97.790738758700172184, 34.680451064668886829, + 127.75685595710456255, 31.256196436119353166, 24.197231040157930693, 36.86690353133235476, + 98.487922480133420322, 121.24827217882557306, 25.03039182877910207, 116.86588945108815096, + 16.807700247776665492, 44.909395103841234231, 45.255083821015432477, 1.5344191057774878573, + 71.556321765296161175, 49.100561699429817963, 122.48164876259033917, 108.4909391480650811, + 127.1155287416986539, 37.370048985787434503, 99.342536622443731176, 34.917132860799029004, + 88.925324596271821065, 17.571224535597139038, 53.272149201482534409, 54.085506415969575755, + 127.79845968065637862, 51.041943207350414013, 44.845695419095136458, 36.317337411473999964, + 127.60630915969159105, 27.212556820108147804, 125.88058303052821429, 37.217717186929803574, + 58.13101311545324279, 17.58725265951215988, 8.7948894688743166625, 2.9566000950253510382, + 0.37817840127536328509, 9.2558691654521680903, 56.934936227942671394, 101.8212360489560524, + 52.850650204207340721, 82.074180033763695974, 106.64123598965670681, 58.493480730783630861, + 93.445542010973440483, 30.190372095716156764, 40.79290565637711552, 71.298272579886543099, + 59.876515980875410605, 50.180948836448806105, 74.822878393664723262, 56.308488980521360645, + 24.071977155996137299, 44.88333719323418336, 27.144030656672839541, 90.529934559555840679, + 68.208976697060279548, 6.3930811561731388792, 112.95797845743072685, 61.595656776127725607, + 99.118409532347868662, 56.878319060306239408, 52.315334389106283197, 118.25523754450478009, + 48.642849671796284383, 91.416631968044384848, 114.12462494307692396, 102.16117568227855372, + 101.02404021154143265, 74.454138960987620521, 115.09995644364971668, 108.74508845700256643, + 109.1506669020964182, 58.076469992036436452, 13.719079914011672372, 55.518160918534704251, + 83.861085221175017068, 6.0261843292209960055, 14.88588015093409922, 5.8082319305904093198, + 105.62301424566976493, 119.47151167426272877, 14.963160772182163782, 122.24318467975535896, + 96.507708539633313194, 49.848382915952242911, 53.828246628938359208, 82.643241928988572909, + 68.21135405126187834, 19.665571131634351332, 78.430973395945329685, 33.426737150799453957, + 24.322084225073922426, 2.1833132417814340442, 87.432151770324708195, 122.83818747434270335, + 74.353113842007587664, 50.627524098166759359, 16.538475532186566852, 69.593086276785470545, + 29.86622260804506368, 126.00128513321760693, 28.149961353810795117, 7.7311886845309345517, + 127.39478892867919058, 110.94545822818690795, 18.548597210949083092, 98.904233993354864651, + 92.337921228794584749, 64.176895650201913668, 14.50382948079277412, 23.998872704905807041, + 29.523777330607117619, 21.868576872231642483, 71.739258767323917709, 90.269266679610154824, + 91.683296885028539691, 10.019890980031050276, 104.21196291981323157, 53.156697538826847449, + 112.65929292035434628, 120.56718268572876696, 109.61123928970846464, 88.064085036250617122, + 64.149185221267543966, 24.712949401822697837, 82.003017201448528795, 9.1481108282569039147, + 41.447566229362564627, 57.708239832096296595, 43.407270304480334744, 99.2419671291281702, + 45.628409382577956421, 80.840218242214177735, 26.875208836227102438, 76.604636075870075729, + 76.098792066233727382, 57.843662131526798476, 106.95212494571751449, 101.02368292184837628, + 49.595080140999925788, 17.488509322705795057, 75.202529055401100777, 19.603238255858741468, + 41.18562205340640503, 24.83336670770222554, 79.647488716811494669, 97.475327219548489666, + 100.54715239577490138, 11.768216335083707236, 38.902100488299765857, 48.582877141780045349, + 46.600260970149975037, 48.906593885167239932, 49.756249217240110738, 56.481583644643251318, + 119.87429828027597978, 120.33711948591735563, 69.765485639916732907, 63.559103829396917718, + 14.536756913119461387, 4.6039643368530960288, 54.703814118751324713, 9.4565579448426433373, + 41.853597994115261827, 9.0433175523030513432, 94.373778207369468873, 123.48856883816915797, + 63.165063627075141994, 112.66974162967744633, 125.02829219107297831, 108.19047578362005879, + 117.21386139414244099, 54.779734837513387902, 59.949532358034048229, 45.743660352087317733, + 77.344870782500947826, 77.774803633659757907, 63.632822328345355345, 0.70354719667739118449, + 60.528446766096749343, 46.361887974766432308, 5.4011243082495639101, 110.66652582079041167, + 49.23554753407734097, 31.13090403598107514, 5.7644365556043339893, 84.205427235592651414, + 71.658323070863843895, 52.780212377139832824, 0.19047284332191338763, 65.603991704585496336, + 52.908886110242747236, 122.09298171820410062, 17.815406665635237005, 115.46733030309042078, + 11.161890514278638875, 42.590492253184493165, 1.2811336810882494319, 72.086564690613158746, + 55.686062499753461452, 85.692067720992781688, 123.99589572072363808, 119.1637771774585417, + 41.161789968362427317, 124.0890530002725427, 92.497205067622417118, 76.454112928193353582, + 44.311601955007063225, 0.035253775982710067183, 113.71433698883629404, 23.883494000270729885, + 28.026165139686781913, 96.348208109036932001, 111.69501061209302861, 118.05185571347828954, + 30.964869682087737601, 7.8175424501132511068, 86.257628015799127752, 15.60566064114755136, + 123.40256301018234808, 44.233931643080723006, 61.683651189236115897, 12.189647609986423049, + 125.435374357875844, 114.91194769230787642, 14.258760245462326566, 12.23925240302196471, + 91.621733697324089007, 72.718306542436039308, 93.499971786262904061, 13.981956605133746052, + 93.091295997459383216, 92.919775715927244164, 62.414333740667643724, 126.98410637475171825, + 38.833069018135574879, 89.441686464982922189, 7.8685406165313906968, 88.164460670435801148, + 101.10009035706752911, 11.702468750980187906, 125.93465174513039528, 91.134693002142739715, + 106.18729204326155013, 84.09719416326697683, 108.34871545749047073, 107.31799492836216814, + 75.383858506997057702, 124.29176945203289506, 25.723157326308864867, 77.451252451523032505, + 124.27014446070461418, 122.44028650389009272, 72.430302459419181105, 83.413965455689321971, + 114.30193473731196718, 122.12905539730127202, 27.042915428588457871, 95.48052250979890232, + 81.305456473302911036, 17.16574350497830892, 108.42201814444706542, 112.87580544753291178, + 88.088039134756400017, 120.47088578661714564, 116.96014381519853487, 6.6165699124176171608, + 119.63088199273261125, 71.202996837291721022, 1.4867204143884009682, 120.68657761966460384, + 68.061371929117740365, 110.90968972648624913, 47.274110903948894702, 107.19945306890440406, + 82.484040811643353663, 3.1692998974103829823, 98.158480335852800636, 57.151601184312312398, + 78.037607608814141713, 85.126625867935217684, 25.057978229600848863, 45.242527765440172516, + 33.993609555262082722, 104.98769814163460978, 40.155061541485338239, 57.244150791251740884, + 14.614140554062032606, 62.988036334194475785, 94.642204015206516488, 23.329571404596208595, + 32.677107394702034071, 55.174851719464641064, 52.451636208363197511, 41.241371271797106601, + 122.33496013371404842, 100.32345827664903481, 20.772488821243314305, 33.960134234475845005, + 21.115372543437842978, 67.065585886652115732, 118.06652383567416109, 52.34765848482857109, + 100.03763021880513406, 71.149006120595004177, 101.7587092469802883, 4.8175811152759706602, + 72.20578846865464584, 73.619228265928541077, 69.102634300124918809, 59.761019895133358659, + 37.290680539699678775, 69.653935016358445864, 68.791386508266441524, 78.017327295227005379, + 100.24310056111062295, 43.039130721375840949, 41.856763357052841457, 34.200368401456216816, + 117.71827080645380192, 48.069102583878702717, 68.631386007629771484, 46.309839678277057828, + 98.036877255286526633, 19.638528466275602113, 112.05135150620844797, 26.695358329394366592, + 56.312048712159594288, 27.145623055570467841, 81.487330863048555329, 65.322750238115986576, + 35.915675849118997576, 88.646092359183967346, 2.0622946688345109578, 94.733480555736605311, + 13.778446777341741836, 0.098216751623112941161, 104.78537744631830719, 49.79325261430858518, + 81.017271659675316187, 81.129797405570570845, 53.636656882659735857, 17.836815078560903203, + 62.576424356888310285, 119.89308050271938555, 75.999740767296316335, 126.94899134096340276, + 20.852521564109338215, 51.788860465821926482, 122.19523936207042425, 106.17756889638621942, + 125.48727699546725489, 28.90573366225726204, 117.21090220486439648, 120.83521302793815266, + 96.554580142565100687, 124.20286608644164517, 33.691121048417699058, 97.370698632763378555, + 51.190122758049255935, 33.008666955400258303, 38.724908382399007678, 97.33368916682593408, + 18.756911725060490426, 26.820084002065414097, 62.433216112043737667, 3.3506540385023981798, + 67.581477517400344368, 69.360902129341411637, 127.5137119142091251, 62.512392872238706332, + 48.394462080315861385, 73.733807062668347498, 68.975844960270478623, 114.49654435765114613, + 50.060783657561842119, 105.73177890217630193, 33.615400495553330984, 89.818790207682468463, + 90.510167642030864954, 3.0688382115586136933, 15.11264353059232235, 98.201123398863273906, + 116.96329752518431633, 88.981878296133800177, 126.23105748339730781, 74.740097971578506986, + 70.685073244887462351, 69.834265721601695986, 49.85064919254364213, 35.142449071194278076, + 106.54429840296506882, 108.17101283194278949, 127.59691936131275725, 102.08388641470082803, + 89.691390838190272916, 72.634674822951637907, 127.2126183193831821, 54.425113640219933586, + 123.76116606105642859, 74.435434373859607149, 116.26202623090648558, 35.174505319024319761, + 17.589778937748633325, 5.9132001900507020764, 0.75635680255072657019, 18.511738330904336181, + 113.86987245588898077, 75.6424720979121048, 105.70130040841831942, 36.148360067531029927, + 85.282471979313413613, 116.9869614615708997, 58.891084021946880966, 60.380744191432313528, + 81.585811312757869018, 14.596545159773086198, 119.75303196175082121, 100.36189767290125019, + 21.645756787329446524, 112.61697796104272129, 48.143954311992274597, 89.76667438646836672, + 54.288061313349317061, 53.059869119115319336, 8.4179533941205590963, 12.786162312349915737, + 97.915956914861453697, 123.19131355225908919, 70.236819064695737325, 113.75663812061247882, + 104.63066877821620437, 108.51047508900956018, 97.285699343596206745, 54.833263936092407675, + 100.24924988615748589, 76.322351364560745424, 74.048080423086503288, 20.908277921978879021, + 102.19991288730307133, 89.490176914008770837, 90.301333804192836396, 116.1529399840728729, + 27.438159828023344744, 111.03632183707304648, 39.722170442350034136, 12.052368658441992011, + 29.771760301868198439, 11.616463861184456619, 83.246028491343167843, 110.94302334852545755, + 29.926321544367965544, 116.48636935951435589, 65.015417079266626388, 99.696765831904485822, + 107.6564932578803564, 37.286483857980783796, 8.4227081025237566791, 39.331142263272340642, + 28.86194679189065937, 66.853474301598907914, 48.644168450147844851, 4.3666264835665060673, + 46.86430354065305437, 117.67637494868904469, 20.706227684015175328, 101.25504819633351872, + 33.076951064376771683, 11.186172553570941091, 59.732445216093765339, 124.00257026643521385, + 56.299922707621590234, 15.462377369065507082, 126.78957785736201913, 93.89091645637381589, + 37.097194421901804162, 69.808467986713367281, 56.675842457592807477, 0.35379130040382733569, + 29.007658961585548241, 47.997745409811614081, 59.047554661214235239, 43.737153744466922944, + 15.478517534651473397, 52.538533359223947627, 55.366593770057079382, 20.039781960065738531, + 80.42392583962646313, 106.31339507765733288, 97.318585840712330537, 113.13436537146117189, + 91.222478579420567257, 48.128170072504872223, 0.2983704425350879319, 49.425898803649033653, + 36.006034402897057589, 18.296221656513807829, 82.895132458725129254, 115.41647966419259319, + 86.814540608964307467, 70.483934258256340399, 91.256818765159550821, 33.68043648442835547, + 53.750417672457842855, 25.209272151743789436, 24.197584132467454765, 115.68732426305723493, + 85.904249891438666964, 74.047365843696752563, 99.190160281999851577, 34.977018645415228093, + 22.405058110802201554, 39.206476511717482936, 82.37124410681281006, 49.666733415408089058, + 31.294977433626627317, 66.95065443910061731, 73.094304791549802758, 23.536432670167414472, + 77.804200976599531714, 97.165754283560090698, 93.200521940299950074, 97.813187770334479865, + 99.512498434480221476, 112.96316728929014062, 111.74859656055559753, 112.67423897183834924, + 11.530971279833465815, 127.11820765879383544, 29.073513826238922775, 9.2079286737061920576, + 109.40762823750264943, 18.913115889685286675, 83.707195988230523653, 18.086635104609740665, + 60.747556414742575726, 118.97713767633831594, 126.33012725415392197, 97.339483259358530631, + 122.0565843821495946, 88.380951567243755562, 106.42772278828488197, 109.5594696750267758, + 119.89906471606809646, 91.487320704178273445, 26.68974156500553363, 27.549607267319515813, + 127.26564465669071069, 1.407094393354782369, 121.05689353219349869, 92.723775949532864615, + 10.802248616502765799, 93.333051641580823343, 98.47109506815468194, 62.261808071962150279, + 11.528873111212305957, 40.410854471188940806, 15.316646141727687791, 105.56042475427966565, + 0.38094568664746475406, 3.2079834091709926724, 105.81777222048913245, 116.18596343640820123, + 35.630813331274111988, 102.93466060618084157, 22.32378102855727775, 85.180984506368986331, + 2.5622673621801368427, 16.173129381226317491, 111.37212499951056088, 43.384135441989201354, + 119.99179144145091414, 110.3275543549170834, 82.323579936728492612, 120.17810600054872339, + 56.994410135248472216, 24.908225856386707164, 88.62320391001412645, 0.070507551969058113173, + 99.42867397767258808, 47.766988000541459769, 56.052330279377201805, 64.696416218077501981, + 95.390021224189695204, 108.10371142695657909, 61.929739364175475203, 15.635084900230140192, + 44.515256031598255504, 31.211321282298740698, 118.80512602036469616, 88.467863286161446013, + 123.36730237847223179, 24.379295219976484077, 122.87074871575532597, 101.82389538461575285, + 28.517520490924653132, 24.478504806047567399, 55.243467394651815994, 17.436613084875716595, + 58.999943572525808122, 27.963913210271130083, 58.18259199492240441, 57.839551431854488328, + 124.82866748133892543, 125.9682127495034365, 77.666138036274787737, 50.883372929965844378, + 15.737081233066419372, 48.328921340875240276, 74.200180714135058224, 23.404937501964013791, + 123.86930349026442855, 54.269386004289117409, 84.374584086526738247, 40.194388326537591638, + 88.697430914984579431, 86.635989856727974257, 22.767717013997753384, 120.58353890406579012, + 51.446314652621367713, 26.902504903049702989, 120.54028892141286633, 116.88057300778382341, + 16.860604918842000188, 38.82793091138228192, 100.60386947462757234, 116.25811079460254405, + 54.085830857180553721, 62.961045019601442618, 34.610912946605822071, 34.331487009960255818, + 88.844036288897768827, 97.751610895069461549, 48.176078269516438013, 112.94177157323792926, + 105.92028763039706973, 13.2331398248388723, 111.26176398546886048, 14.405993674583442044, + 2.9734408287804399151, 113.37315523933284567, 8.1227438582391187083, 93.819379452972498257, + 94.548221807901427383, 86.398906137812446104, 36.968081623286707327, 6.3385997948244039435, + 68.316960671705601271, 114.30320236862826278, 28.075215217631921405, 42.253251735870435368, + 50.115956459201697726, 90.485055530880345032, 67.987219110527803423, 81.975396283269219566, + 80.310123082970676478, 114.48830158250348177, 29.228281108124065213, 125.97607266839258955, + 61.284408030413032975, 46.659142809192417189, 65.354214789404068142, 110.34970343892928213, + 104.90327241672639502, 82.482742543597851181, 116.66992026743173483, 72.64691655329806963, + 41.544977642486628611, 67.920268468951690011, 42.230745086879323935, 6.1311717733078694437, + 108.13304767134832218, 104.69531696966078016, 72.075260437613906106, 14.298012241193646332, + 75.517418493960576598, 9.6351622305555792991, 16.411576937312929658, 19.238456531860720133, + 10.205268600249837618, 119.52203979026671732, 74.581361079402995529, 11.307870032720529707, + 9.5827730165365210269, 28.034654590457648737, 72.486201122221245896, 86.078261442751681898, + 83.713526714105682913, 68.400736802916071611, 107.43654161290760385, 96.138205167761043413, + 9.2627720152595429681, 92.619679356557753636, 68.073754510573053267, 39.277056932554842206, + 96.102703012416895945, 53.390716658788733184, 112.62409742431918858, 54.291246111144573661, + 34.974661726100748638, 2.6455004762319731526, 71.83135169824163313, 49.292184718367934693, + 4.1245893376726598945, 61.466961111473210622, 27.556893554683483671, 0.19643350324986386113, + 81.570754892636614386, 99.586505228620808339, 34.034543319354270352, 34.25959481114114169, + 107.27331376531947171, 35.673630157121806405, 125.15284871378025855, 111.78616100544240908, + 23.999481534596270649, 125.89798268192680553, 41.705043128218676429, 103.57772093164749094, + 116.39047872414448648, 84.355137792776076822, 122.97455399093450978, 57.811467324518162059, + 106.42180440973243094, 113.67042605587994331, 65.109160285133839352, 120.40573217288329033, + 67.382242096839036094, 66.74139726552675711, 102.38024551609851187, 66.017333910800516605, + 77.449816764801653335, 66.667378333651868161, 37.513823450120980851, 53.640168004130828194, + 124.86643222408747533, 6.7013080770084343385, 7.1629550348043267149, 10.721804258686461253, + 127.0274238284182502, 125.02478574447741266, 96.788924160635360749, 19.467614125340332976, + 9.9516899205445952248, 100.99308871530229226, 100.12156731512732222, 83.463557804352603853, + 67.230800991110299947, 51.637580415368574904, 53.020335284061729908, 6.1376764231172273867, + 30.225287061188282678, 68.40224679773018579, 105.92659505037227063, 49.963756592271238333, + 124.46211496679825359, 21.48019594316065195, 13.370146489778562682, 11.668531443203391973, + 99.701298385087284259, 70.284898142392194131, 85.088596805933775613, 88.342025663889216958, + 127.19383872262915247, 76.167772829405294033, 51.382781676384183811, 17.269349645906913793, + 126.42523663876636419, 108.85022728044350515, 119.52233212211649516, 20.870868747722852277, + 104.52405246181297116, 70.349010638048639521, 35.17955787549726665, 11.826400380101404153, + 1.5127136051014531404, 37.02347666181231034, 99.739744911781599512, 23.284944195827847579, + 83.402600816836638842, 72.296720135065697832, 42.564943958630465204, 105.9739229231417994, + 117.78216804389376193, 120.76148838286826503, 35.171622625515738036, 29.193090319549810374, + 111.5060639235052804, 72.723795345802500378, 43.291513574662531028, 97.23395592208544258, + 96.287908623988187173, 51.53334877293673344, 108.57612262669863412, 106.11973823823063867, + 16.835906788241118193, 25.572324624703469453, 67.831913829726545373, 118.38262710452181636, + 12.473638129395112628, 99.513276241228595609, 81.261337556436046725, 89.020950178022758337, + 66.57139868719241349, 109.66652787218845333, 72.498499772318609757, 24.644702729125128826, + 20.096160846173006576, 41.816555843961396022, 76.399825774609780638, 50.980353828021179652, + 52.602667608389310772, 104.30587996814574581, 54.876319656050327467, 94.072643674146092962, + 79.444340884700068273, 24.104737316883984022, 59.543520603736396879, 23.232927722372551216, + 38.492056982689973665, 93.8860466970509151, 59.852643088739569066, 104.97273871903234976, + 2.0308341585368907545, 71.393531663812609622, 87.312986515760712791, 74.572967715961567592, + 16.845416205047513358, 78.662284526544681285, 57.723893583784956718, 5.706948603197815828, + 97.288336900295689702, 8.7332529671330121346, 93.728607081309746718, 107.35274989737808937, + 41.412455368033988634, 74.510096392667037435, 66.153902128753543366, 22.372345107141882181, + 119.46489043219116866, 120.00514053287042771, 112.59984541524318047, 30.924754738134652143, + 125.57915571472767624, 59.781832912747631781, 74.194388843807246303, 11.616935973426734563, + 113.35168491518561495, 0.70758260080765467137, 58.015317923171096481, 95.995490819623228163, + 118.09510932242847048, 87.474307488933845889, 30.957035069302946795, 105.07706671844789525, + 110.73318754011415876, 40.07956392013511504, 32.847851679256564239, 84.626790155318303732, + 66.637171681428299053, 98.268730742925981758, 54.444957158841134515, 96.256340145009744447, + 0.5967408850701758638, 98.851797607298067305, 72.012068805794115178, 36.592443313031253638, + 37.790264917453896487, 102.83295932838882436, 45.629081217932252912, 12.967868516516318778, + 54.513637530319101643, 67.360872968856710941, 107.50083534491568571, 50.418544303487578873, + 48.395168264938547509, 103.37464852611810784, 43.808499782880971907, 20.094731687397143105, + 70.380320563999703154, 69.954037290830456186, 44.810116221604403108, 78.41295302343860385, + 36.742488213625620119, 99.333466830816178117, 62.589954867256892612, 5.9013088782048725989, + 18.188609583099605516, 47.072865340338466922, 27.608401953202701407, 66.331508567123819375, + 58.401043880603538128, 67.626375540672597708, 71.024996868964080932, 97.92633457858391921, + 95.497193121114833048, 97.348477943676698487, 23.061942559670569608, 126.23641531758767087, + 58.14702765247784555, 18.415857347416022094, 90.815256475005298853, 37.826231779374211328, + 39.414391976461047307, 36.17327020921948133, 121.49511282948878943, 109.95427535268026986, + 124.66025450831148191, 66.678966518720699241, 116.11316876430282719, 48.761903134491149103, + 84.855445576573401922, 91.118939350057189586, 111.7981294321398309, 54.97464140835654689, + 53.37948313001106726, 55.099214534642669605, 126.53128931338142138, 2.8141887867132027168, + 114.11378706439063535, 57.447551899065729231, 21.604497233009169577, 58.666103283165284665, + 68.942190136309363879, 124.52361614392430056, 23.057746222424611915, 80.821708942377881613, + 30.633292283459013561, 83.120849508559331298, 0.76189137329492950812, 6.4159668183456233237, + 83.635544440981902881, 104.37192687281640247, 71.261626662551861955, 77.869321212361683138, + 44.647562057118193479, 42.361969012737972662, 5.1245347243602736853, 32.346258762456272962, + 94.744249999021121766, 86.768270883982040687, 111.98358288290546625, 92.655108709837804781, + 36.647159873460623203, 112.35621200109744677, 113.98882027049694443, 49.816451712777052308, + 49.2464078200282529, 0.14101510394175420515, 70.85734795534517616, 95.533976001082919538, + 112.10466055875804159, 1.39283243615864194, 62.780042448383028386, 88.207422853913158178, + 123.85947872835095041, 31.270169800460280385, 89.030512063196511008, 62.422642564601119375, + 109.6102520407330303, 48.935726572326530004, 118.73460475694446359, 48.758590439956606133, + 117.74149743151428993, 75.647790769231505692, 57.035040981849306263, 48.957009612095134798, + 110.48693478930363199, 34.87322616975143319, 117.99988714505161624, 55.927826420542260166, + 116.36518398984480882, 115.67910286371261464, 121.65733496268148883, 123.93642549901051098, + 27.332276072549575474, 101.76674585993168876, 31.474162466132838745, 96.65784268175411853, + 20.400361428270116448, 46.80987500393166556, 119.73860698052885709, 108.5387720085818728, + 40.749168173053476494, 80.388776653078821255, 49.394861829972796841, 45.271979713455948513, + 45.535434027999144746, 113.16707780813158024, 102.89262930524273543, 53.805009806103043957, + 113.08057784282937064, 105.76114601556764683, 33.721209837684000377, 77.655861822768201819, + 73.207738949258782668, 104.51622158920508809, 108.17166171436110744, 125.92209003920288524, + 69.221825893211644143, 68.662974019924149616, 49.688072577799175633, 67.503221790138923097, + 96.352156539036514005, 97.8835431464794965, 83.840575260794139467, 26.46627964968138258, + 94.523527970937720966, 28.811987349166884087, 5.9468816575645178091, 98.746310478665691335, + 16.245487716481875395, 59.638758905948634492, 61.096443615806492744, 44.797812275624892209, + 73.936163246573414654, 12.677199589652445866, 8.6339213434148405213, 100.60640473725652555, + 56.15043043526384281, 84.506503471740870737, 100.23191291840703343, 52.970111061764328042, + 7.9744382210592448246, 35.950792566542077111, 32.620246165944990935, 100.97660316500696354, + 58.456562216251768405, 123.9521453367851791, 122.56881606082606595, 93.318285618388472358, + 2.7084295788117742632, 92.699406877862202236, 81.806544833456428023, 36.965485087199340342, + 105.33984053486710764, 17.29383310659613926, 83.0899552849768952, 7.8405369379033800215, + 84.46149017375864787, 12.262343546619376866, 88.266095342700282345, 81.390633939325198298, + 16.150520875227812212, 28.596024482390930643, 23.034836987921153195, 19.270324461111158598, + 32.823153874625859316, 38.476913063721440267, 20.410537200503313215, 111.04407958053707262, + 21.162722158805991057, 22.615740065441059414, 19.165546033073042054, 56.069309180918935454, + 16.972402244446129771, 44.156522885507001774, 39.427053428215003805, 8.8014736058357811999, + 86.873083225818845676, 64.276410335522086825, 18.525544030522723915, 57.23935871311914525, + 8.1475090211461065337, 78.55411386511332239, 64.205406024833791889, 106.78143331758110435, + 97.248194848638377152, 108.58249222228914732, 69.949323452201497275, 5.291000952467584284, + 15.66270339648326626, 98.584369436735869385, 8.2491786753453197889, 122.93392222294642124, + 55.113787109366967343, 0.39286700650336570106, 35.141509785276866751, 71.173010457241616677, + 68.069086638708540704, 68.519189622285921359, 86.546627530638943426, 71.34726031424725079, + 122.30569742756415508, 95.572322010884818155, 47.998963069196179276, 123.79596536385361105, + 83.410086256440990837, 79.155441863298619865, 104.78095744829261093, 40.710275585555791622, + 117.94910798186901957, 115.6229346490399621, 84.84360881946849986, 99.34085211176352459, + 2.2183205702713166829, 112.81146434577021864, 6.7644841936817101669, 5.4827945310571521986, + 76.760491032200661721, 4.0346678216046711896, 26.899633529606944649, 5.3347566673037363216, + 75.027646900241961703, 107.28033600826529437, 121.73286444817495067, 13.402616154016868677, + 14.32591006960865343, 21.443608517376560485, 126.05484765684013837, 122.04957148895846331, + 65.577848321270721499, 38.935228250680665951, 19.903379841092828428, 73.986177430608222494, + 72.243134630258282414, 38.927115608708845684, 6.4616019822205998935, 103.27516083073714981, + 106.04067056812345982, 12.275352846234454773, 60.450574122380203335, 8.8044935954640095588, + 83.853190100744541269, 99.927513184546114644, 120.92422993359650718, 42.9603918863213039, + 26.740292979557125363, 23.337062886410421925, 71.402596770178206498, 12.569796284788026242, + 42.177193611871189205, 48.684051327782071894, 126.38767744526194292, 24.335545658810588066, + 102.76556335276836762, 34.538699291817465564, 124.85047327753636637, 89.700454560890648281, + 111.04466424423299031, 41.741737495449342532, 81.048104923629580298, 12.698021276097279042, + 70.3591157509945333, 23.652800760202808306, 3.0254272102029062808, 74.046953323628258659, + 71.479489823563199025, 46.569888391659333138, 38.805201633676915662, 16.593440270131395664, + 85.129887917264568387, 83.947845846287236782, 107.56433608779116184, 113.52297676573653007, + 70.343245251031476073, 58.386180639103258727, 95.012127847014198778, 17.447590691605000757, + 86.583027149328700034, 66.467911844174523139, 64.575817247976374347, 103.06669754587710486, + 89.152245253400906222, 84.239476476461277343, 33.671813576482236385, 51.144649249410576886, + 7.6638276594567287248, 108.76525420904363273, 24.947276258793863235, 71.026552482460829196, + 34.522675112875731429, 50.041900356049154652, 5.1427973743884649593, 91.333055744380544638, + 16.996999544637219515, 49.289405458250257652, 40.192321692346013151, 83.633111687926430022, + 24.799651549219561275, 101.9607076560423593, 105.20533521678225952, 80.611759936291491613, + 109.75263931210429291, 60.145287348295823904, 30.888681769400136545, 48.209474633767968044, + 119.08704120747279376, 46.465855444745102432, 76.98411396538358531, 59.772093394101830199, + 119.70528617748277611, 81.945477438064699527, 4.0616683170774194878, 14.787063327628857223, + 46.625973031525063561, 21.145935431923135184, 33.690832410098664695, 29.324569053089362569, + 115.44778716756991344, 11.413897206399269635, 66.576673800591379404, 17.466505934269662248, + 59.457214162623131415, 86.705499794756178744, 82.824910736071615247, 21.020192785337712849, + 4.3078042575070867315, 44.744690214287402341, 110.92978086438597529, 112.01028106574449339, + 97.199690830486360937, 61.849509476272942265, 123.15831142945535248, 119.56366582549890154, + 20.388777687614492606, 23.233871946857107105, 98.703369830371229909, 1.4151652016153093427, + 116.03063584634583094, 63.990981639250094304, 108.19021864486057893, 46.948614977867691778, + 61.914070138609531568, 82.154133436899428489, 93.466375080228317529, 80.159127840270230081, + 65.695703358516766457, 41.253580310640245443, 5.2743433628602360841, 68.537461485851963516, + 108.88991431768590701, 64.512680290019488893, 1.1934817701439897064, 69.703595214599772589, + 16.024137611588230357, 73.184886626062507275, 75.580529834911430953, 77.665918656777648721, + 91.258162435864505824, 25.935737033032637555, 109.02727506064184126, 6.72174593771705986, + 87.001670689831371419, 100.83708860697515775, 96.790336529880732996, 78.749297052236215677, + 87.616999565761943813, 40.189463374797924189, 12.760641128003044287, 11.908074581660912372, + 89.620232443212444196, 28.8259060468772077, 73.484976427254878217, 70.666933661632356234, + 125.17990973451378522, 11.802617756409745198, 36.377219166199211031, 94.145730680676933844, + 55.216803906409040792, 4.6630171342476387508, 116.80208776121071423, 7.2527510813488333952, + 14.049993737931799842, 67.8526691571714764, 62.994386242233304074, 66.696955887353396975, + 46.123885119344777195, 124.47283063517534174, 116.2940553049556911, 36.831714694835682167, + 53.630512950010597706, 75.652463558748422656, 78.828783952922094613, 72.34654041844260064, + 114.99022565898121684, 91.908550705364177702, 121.32050901662660181, 5.3579330374450364616, + 104.22633752860565437, 97.523806268985936185, 41.710891153150441824, 54.23787870011801715, + 95.596258864279661793, 109.94928281671309378, 106.75896626002213452, 110.19842906928897719, + 125.06257862676284276, 5.6283775734300434124, 100.2275741287812707, 114.89510379813145846, + 43.208994466018339153, 117.33220656633420731, 9.8843802726223657373, 121.04723228784860112, + 46.115492444852861809, 33.643417884755763225, 61.2665845669216651, 38.241699017118662596, + 1.5237827465898590162, 12.831933636694884626, 39.27108888196744374, 80.743853745636442909, + 14.523253325107361889, 27.738642424723366275, 89.295124114236386959, 84.723938025475945324, + 10.249069448720547371, 64.692517524916183902, 61.488499998045881512, 45.536541767967719352, + 95.967165765814570477, 57.310217419675609563, 73.294319746924884384, 96.712424002198531525, + 99.977640540993888862, 99.632903425554104615, 98.492815640056505799, 0.28203020788714638911, + 13.714695910693990299, 63.067952002169477055, 96.209321117516083177, 2.78566487231728388, + 125.56008489676969475, 48.414845707829954335, 119.71895745670190081, 62.540339600924198749, + 50.061024126393022016, 124.84528512920587673, 91.220504081466060597, 97.871453144656697987, + 109.46920951388892718, 97.517180879916850245, 107.48299486303221784, 23.295581538463011384, + 114.07008196369861253, 97.914019224193907576, 92.973869578607263975, 69.746452339506504359, + 107.99977429010323249, 111.85565284108815831, 104.73036797969325562, 103.35820572742886725, + 115.31466992536661564, 119.87285099802102195, 54.664552145102788927, 75.533491719863377512, + 62.948324932269315468, 65.31568536350823706, 40.800722856540232897, 93.619750007866969099, + 111.47721396106135217, 89.077544017163745593, 81.498336346110590966, 32.77755330615764251, + 98.789723659945593681, 90.543959426911897026, 91.070868056001927471, 98.334155616266798461, + 77.785258610485470854, 107.61001961220972589, 98.161155685662379256, 83.522292031135293655, + 67.442419675371638732, 27.311723645540041616, 18.415477898521203315, 81.032443178413814167, + 88.343323428725852864, 123.84418007840940845, 10.443651786426926265, 9.3259480398482992314, + 99.376145155601989245, 7.0064435802814841736, 64.704313078076665988, 67.767086292962630978, + 39.681150521588278934, 52.932559299366403138, 61.047055941875441931, 57.623974698333768174, + 11.893763315132673597, 69.49262095733138267, 32.490975432963750791, 119.27751781189726898, + 122.19288723161298549, 89.595624551253422396, 19.872326493146829307, 25.354399179304891732, + 17.267842686833319021, 73.2128094745130511, 112.3008608705313236, 41.013006943485379452, + 72.463825836814066861, 105.94022212352865608, 15.948876442118489649, 71.901585133084154222, + 65.240492331893619848, 73.953206330013927072, 116.91312443250717479, 119.90429067357399617, + 117.13763212165576988, 58.636571236776944716, 5.4168591576271865051, 57.398813755728042452, + 35.613089666912856046, 73.930970174402318662, 82.679681069734215271, 34.587666213195916498, + 38.1799105699537904, 15.681073875810398022, 40.922980347517295741, 24.524687093242391711, + 48.532190685404202668, 34.781267878650396597, 32.301041750455624424, 57.192048964781861287, + 46.06967397584230639, 38.540648922222317196, 65.646307749251718633, 76.953826127442880534, + 40.82107440101026441, 94.088159161074145231, 42.325444317611982115, 45.231480130882118829, + 38.331092066146084107, 112.13861836183787091, 33.944804488892259542, 88.313045771014003549, + 78.85410685643000761, 17.602947211675200379, 45.746166451641329331, 0.55282067104417365044, + 37.05108806104544783, 114.4787174262382905, 16.295018042295851046, 29.108227730230282759, + 0.41081204967122175731, 85.562866635165846674, 66.496389697280392284, 89.164984444578294642, + 11.898646904402994551, 10.582001904935168568, 31.3254067929701705, 69.168738873471738771, + 16.498357350694277557, 117.86784444589284249, 110.22757421873393469, 0.78573401300673140213, + 70.28301957055737148, 14.346020914486871334, 8.138173277420719387, 9.0383792445754806977, + 45.093255061281524831, 14.694520628498139558, 116.61139485513194813, 63.144644021769636311, + 95.997926138395996531, 119.59193072771086008, 38.820172512885619653, 30.310883726600877708, + 81.561914896585221868, 81.420551171115221223, 107.89821596374167711, 103.24586929808356217, + 41.687217638940637698, 70.68170422352704918, 4.4366411405462713446, 97.622928691540437285, + 13.528968387363420334, 10.965589062117942376, 25.520982064401323441, 8.0693356432093423791, + 53.799267059213889297, 10.669513334611110622, 22.055293800487561384, 86.560672016534226714, + 115.46572889634990133, 26.805232308033737354, 28.65182013921730686, 42.887217034756758949, + 124.10969531368391472, 116.09914297792056459, 3.1556966425414429978, 77.870456501361331902, + 39.806759682189294836, 19.972354861220082967, 16.486269260516564827, 77.854231217417691369, + 12.923203964444837766, 78.550321661477937596, 84.081341136246919632, 24.550705692468909547, + 120.90114824476040667, 17.608987190931657096, 39.706380201492720516, 71.855026369095867267, + 113.84845986719301436, 85.920783772642607801, 53.480585959114250727, 46.674125772824481828, + 14.805193540356412996, 25.139592569576052483, 84.35438722374237841, 97.368102655567781767, + 124.77535489052388584, 48.67109131762481411, 77.531126705536735244, 69.077398583638569107, + 121.70094655507637071, 51.400909121784934541, 94.089328488465980627, 83.483474990902323043, + 34.096209847259160597, 25.396042552198196063, 12.718231501989066601, 47.305601520405616611, + 6.0508544204094505403, 20.093906647260155296, 14.958979647126398049, 93.139776783318666276, + 77.610403267353831325, 33.186880540266429307, 42.259775834532774752, 39.895691692578111542, + 87.128672175585961668, 99.045953531476698117, 12.686490502062952146, 116.77236127821015543, + 62.024255694028397556, 34.895181383213639492, 45.166054298661038047, 4.9358236883526842576, + 1.1516344959563866723, 78.133395091757847695, 50.304490506805450423, 40.478952952922554687, + 67.343627152964472771, 102.28929849882115377, 15.327655318917095428, 89.530508418087265454, + 49.894552517591364449, 14.053104964921658393, 69.045350225751462858, 100.0838007120983093, + 10.285594748780567897, 54.666111488761089277, 33.993999089274439029, 98.578810916500515305, + 80.384643384695664281, 39.266223375852860045, 49.599303098442760529, 75.921415312088356586, + 82.410670433568157023, 33.223519872586621204, 91.505278624208585825, 120.29057469659164781, + 61.777363538800273091, 96.418949267539574066, 110.17408241494558752, 92.931710889493842842, + 25.968227930767170619, 119.54418678820729838, 111.4105723549691902, 35.890954876129399054, + 8.1233366341548389755, 29.574126655257714447, 93.251946063050127123, 42.291870863846270368, + 67.381664820197329391, 58.649138106182363117, 102.89557433513982687, 22.827794412802177249, + 5.1533476011827588081, 34.933011868539324496, 118.91442832524990081, 45.410999589515995467, + 37.649821472143230494, 42.040385570675425697, 8.615608515014173463, 89.489380428578442661, + 93.859561728775588563, 96.020562131492624758, 66.399381660972721875, 123.69901895254952251, + 118.31662285891434294, 111.12733165099780308, 40.777555375228985213, 46.467743893717852188, + 69.406739660742459819, 2.8303304032342566643, 104.06127169269166188, 127.98196327850382659, + 88.380437289721157867, 93.897229955735383555, 123.82814027722270112, 36.308266873802494956, + 58.932750160460273037, 32.318255680544098141, 3.3914067170335329138, 82.507160621280490886, + 10.548686725724110147, 9.0749229717075650115, 89.779828635375451995, 1.0253605800389777869, + 2.3869635402916173916, 11.407190429199545179, 32.048275223180098692, 18.36977325212865253, + 23.161059669826499885, 27.331837313558935421, 54.516324871729011647, 51.871474066068913089, + 90.054550121283682529, 13.443491875437757699, 46.003341379666380817, 73.674177213953953469, + 65.580673059765103972, 29.498594104476069333, 47.233999131523887627, 80.378926749595848378, + 25.521282256006088573, 23.816149163325462723, 51.240464886424888391, 57.651812093758053379, + 18.969952854513394414, 13.333867323268350447, 122.35981946902757045, 23.605235512819490395, + 72.754438332402060041, 60.291461361353867687, 110.43360781281808158, 9.3260342684989154804, + 105.60417552242142847, 14.50550216269766679, 28.099987475867237663, 7.7053383143429527991, + 125.98877248447024613, 5.393911774706793949, 92.247770238693192368, 120.94566127035432146, + 104.5881106099113822, 73.663429389671364333, 107.26102590002483339, 23.304927117500483291, + 29.657567905847827205, 16.693080836888839258, 101.98045131796607166, 55.817101410731993383, + 114.64101803325320361, 10.715866074893710902, 80.452675057214946719, 67.047612537971872371, + 83.421782306300883647, 108.47575740023967228, 63.192517728562961565, 91.898565633429825539, + 85.517932520047907019, 92.396858138581592357, 122.12515725352568552, 11.256755146863724804, + 72.455148257566179382, 101.79020759626291692, 86.417988932040316286, 106.66441313266841462, + 19.768760545248369453, 114.09446457569720224, 92.230984889705723617, 67.286835769511526451, + 122.5331691338433302, 76.483398034237325191, 3.0475654931797180325, 25.663867273389769252, + 78.542177763938525459, 33.487707491272885818, 29.046506650214723777, 55.47728484945037053, + 50.590248228476411896, 41.447876050951890647, 20.49813889744473272, 1.3850350498323678039, + 122.97699999609176302, 91.073083535939076683, 63.934331531629140954, 114.6204348393548571, + 18.588639493853406748, 65.424848004400701029, 71.955281081991415704, 71.265806851111847209, + 68.985631280113011599, 0.56406041577429277822, 27.429391821387980599, 126.13590400434259209, + 64.418642235032166354, 5.5713297446382057387, 123.1201697935393895, 96.82969141566354665, + 111.43791491340380162, 125.0806792018483975, 100.12204825278968201, 121.69057025841539144, + 54.441008162935759174, 67.742906289317033952, 90.938419027781492332, 67.034361759837338468, + 86.965989726064435672, 46.591163076929660747, 100.14016392740086303, 67.82803844839145313, + 57.947739157218165928, 11.492904679016646696, 87.999548580210102955, 95.711305682179954601, + 81.460735959390149219, 78.716411454861372476, 102.62933985073686927, 111.7457019960420439, + 109.32910429020921583, 23.066983439726755023, 125.89664986454226892, 2.6313707270164741203, + 81.601445713084103772, 59.239500015737576177, 94.95442792212634231, 50.155088034331129165, + 34.996672692221181933, 65.555106612318922998, 69.579447319894825341, 53.087918853827432031, + 54.14173611200749292, 68.668311232537234901, 27.570517220974579686, 87.220039224423089763, + 68.32231137132839649, 39.044584062274225289, 6.8848393507432774641, 54.623447291080083232, + 36.830955797046044609, 34.064886356831266312, 48.686646857455343707, 119.6883601568188169, + 20.887303572853852529, 18.651896079700236442, 70.75229031120397849, 14.012887160566606326, + 1.4086261561569699552, 7.5341725859252619557, 79.362301043176557869, 105.86511859873280628, + 122.09411188375088386, 115.24794939666753635, 23.787526630268985173, 10.985241914662765339, + 64.98195086593113956, 110.55503562379817595, 116.38577446322960895, 51.191249102506844793, + 39.744652986293658614, 50.708798358609783463, 34.535685373670276022, 18.425618949029740179, + 96.601721741062647197, 82.026013886974396883, 16.9276516736317717, 83.880444247057312168, + 31.897752884240617277, 15.803170266171946423, 2.4809846637908776756, 19.906412660031492123, + 105.82624886501798755, 111.80858134715163033, 106.27526424331153976, 117.27314247355388943, + 10.83371831525437301, 114.7976275114560849, 71.226179333829350071, 19.861940348808275303, + 37.359362139468430541, 69.175332426391832996, 76.3598211399075808, 31.362147751620796043, + 81.845960695034591481, 49.049374186484783422, 97.064381370808405336, 69.562535757300793193, + 64.602083500911248848, 114.38409792956372257, 92.139347951684612781, 77.081297844448272372, + 3.2926154985070752446, 25.907652254885761067, 81.642148802024166798, 60.176318322148290463, + 84.650888635223964229, 90.462960261764237657, 76.662184132295806194, 96.277236723675741814, + 67.889608977788157063, 48.626091542031645076, 29.708213712860015221, 35.205894423350400757, + 91.492332903282658663, 1.1056413420883473009, 74.102176122094533639, 100.957434852476581, + 32.590036084591702092, 58.216455460460565519, 0.82162409934608149342, 43.125733270335331326, + 4.992779394564422546, 50.329968889160227263, 23.797293808805989102, 21.164003809870337136, + 62.650813585943978978, 10.337477746943477541, 32.996714701392193092, 107.73568889178932295, + 92.455148437467869371, 1.5714680260171007831, 12.566039141114742961, 28.692041828973742668, + 16.276346554841438774, 18.076758489150961395, 90.186510122563049663, 29.389041256999917096, + 105.22278971026389627, 126.2892880435429106, 63.995852276795631042, 111.18386145542172017, + 77.640345025771239307, 60.621767453205393394, 35.123829793174081715, 34.841102342234080425, + 87.796431927486992208, 78.491738596167124342, 83.374435277884913376, 13.36340844705409836, + 8.8732822810961806681, 67.24585738308087457, 27.057936774726840667, 21.931178124235884752, + 51.041964128802646883, 16.138671286418684758, 107.59853411842777859, 21.339026669222221244, + 44.110587600978760747, 45.121344033072091406, 102.93145779269980267, 53.610464616067474708, + 57.30364027843461372, 85.774434069517155876, 120.21939062737146742, 104.19828595584112918, + 6.3113932850865239743, 27.740913002722663805, 79.613519364378589671, 39.944709722440165933, + 32.972538521036767634, 27.708462434835382737, 25.84640792889331351, 29.100643322959513171, + 40.162682272493839264, 49.101411384941457072, 113.80229648952081334, 35.217974381863314193, + 79.412760402989079012, 15.710052738195372513, 99.696919734389666701, 43.841567545285215601, + 106.96117191822850145, 93.348251545648963656, 29.610387080712825991, 50.279185139155742945, + 40.708774447488394799, 66.736205311139201513, 121.55070978104777168, 97.342182635253266199, + 27.062253411077108467, 10.154797167280776193, 115.40189311015274143, 102.80181824357350706, + 60.178656976935599232, 38.966949981804646086, 68.192419694518321194, 50.792085104396392126, + 25.436463003978133202, 94.611203040811233222, 12.101708840818901081, 40.187813294520310592, + 29.917959294256434077, 58.27955356664097053, 27.220806534707662649, 66.373761080532858614, + 84.519551669065549504, 79.791383385159861064, 46.257344351175561314, 70.091907062953396235, + 25.372981004129542271, 105.54472255642031087, 124.04851138805679511, 69.790362766427278984, + 90.332108597322076093, 9.8716473767053685151, 2.3032689919164113235, 28.266790183515695389, + 100.60898101361090085, 80.957905905848747352, 6.6872543059325835202, 76.578596997642307542, + 30.655310637837828835, 51.061016836174530908, 99.789105035182728898, 28.106209929846954765, + 10.090700451506563695, 72.167601424196618609, 20.571189497561135795, 109.33222297752217855, + 67.987998178552516038, 69.157621833004668588, 32.769286769391328562, 78.532446751705720089, + 99.198606196889159037, 23.842830624180351151, 36.821340867136314046, 66.447039745176880388, + 55.010557248420809628, 112.58114939318329562, 123.55472707760418416, 64.837898535082786111, + 92.34816482989481301, 57.863421778987685684, 51.936455861537979217, 111.08837357641823473, + 94.821144709938380402, 71.781909752258798108, 16.246673268309677951, 59.148253310519066872, + 58.503892126100254245, 84.583741727696178714, 6.7633296403946587816, 117.29827621236836421, + 77.791148670279653743, 45.655588825604354497, 10.306695202365517616, 69.866023737082286971, + 109.82885665049980162, 90.821999179031990934, 75.299642944286460988, 84.080771141350851394, + 17.231217030031984905, 50.978760857160523301, 59.719123457554815104, 64.041124262988887494, + 4.7987633219490817282, 119.398037905102683, 108.63324571783232386, 94.254663301995606162, + 81.555110750457970425, 92.935487787439342355, 10.813479321484919637, 5.6606608064721513074, + 80.122543385386961745, 127.96392655701129115, 48.760874579445953714, 59.794459911474405089, + 119.65628055444540223, 72.616533747604989912, 117.86550032092054607, 64.636511361088196281, + 6.7828134340707038064, 37.014321242560981773, 21.097373451448220294, 18.149845943418768002, + 51.55965727075090399, 2.0507211600779555738, 4.7739270805832347833, 22.814380858399090357, + 64.096550446360197384, 36.73954650425730506, 46.32211933965299977, 54.663674627117870841, + 109.03264974345802329, 103.74294813214146416, 52.109100242567365058, 26.886983750875515398, + 92.006682759336399613, 19.348354427911544917, 3.1613461195302079432, 58.997188208952138666, + 94.467998263051413232, 32.757853499191696756, 51.042564512012177147, 47.632298326650925446, + 102.48092977284977678, 115.30362418751610676, 37.939905709026788827, 26.667734646540338872, + 116.7196389380551409, 47.21047102564261877, 17.508876664804120082, 120.58292272271137335, + 92.867215625636163168, 18.65206853700146894, 83.208351044842856936, 29.011004325395333581, + 56.199974951734475326, 15.410676628689543577, 123.97754496894049225, 10.787823549417225877, + 56.495540477390022716, 113.8913225407122809, 81.176221219826402375, 19.326858779346366646, + 86.522051800049666781, 46.609854235000966582, 59.315135811695654411, 33.386161673781316495, + 75.960902635932143312, 111.63420282146762474, 101.28203606650640722, 21.431732149791059783, + 32.905350114433531417, 6.0952250759473827202, 38.843564612605405273, 88.951514800479344558, + 126.38503545712956111, 55.797131266863289056, 43.035865040099452017, 56.793716277166822692, + 116.25031450705137104, 22.513510293731087586, 16.910296515135996742, 75.580415192529471824, + 44.83597786408427055, 85.328826265336829238, 39.537521090500376886, 100.18892915139804245, + 56.461969779415085213, 6.5736715390266908798, 117.06633826769029838, 24.966796068474650383, + 6.095130986359436065, 51.327734546783176484, 29.084355527877050918, 66.975414982545771636, + 58.093013300429447554, 110.95456969890074106, 101.18049645695282379, 82.895752101903781295, + 40.99627779488946544, 2.7700700996683735866, 117.95399999218716403, 54.146167071878153365, + 127.86866306326191989, 101.24086967870971421, 37.177278987710451474, 2.8496960088050400373, + 15.910562163986469386, 14.531613702227332396, 9.9712625602260231972, 1.1281208315485855564, + 54.858783642779599177, 124.27180800868882216, 0.83728447006433270872, 11.142659489280049456, + 118.24033958708241698, 65.659382831330731278, 94.875829826811241219, 122.16135840370043297, + 72.244096505583001999, 115.38114051683078287, 108.88201632587515633, 7.485812578637705883, + 53.876838055566622643, 6.0687235196783149149, 45.931979452128871344, 93.182326153862959472, + 72.280327854805364041, 7.6560768967829062603, 115.89547831443633186, 22.985809358036931371, + 47.999097160423843889, 63.422611364363547182, 34.921471918783936417, 29.432822909726382932, + 77.258679701477376511, 95.491403992087725783, 90.658208580418431666, 46.133966879457148025, + 123.79329972908453783, 5.2627414540365862194, 35.202891426168207545, 118.47900003147879033, + 61.908855844252684619, 100.31017606866225833, 69.993345384446001844, 3.1102132246414839756, + 11.158894639789650682, 106.17583770765486406, 108.28347222401862382, 9.336622465074469801, + 55.141034441952797351, 46.440078448849817505, 8.6446227426567929797, 78.089168124548450578, + 13.769678701486554928, 109.24689458216016646, 73.661911594092089217, 68.129772713662532624, + 97.373293714914325392, 111.37672031363763381, 41.774607145707705058, 37.303792159404110862, + 13.50458062240795698, 28.025774321133212652, 2.8172523123139399104, 15.06834517185416189, + 30.724602086356753716, 83.730237197469250532, 116.1882237675054057, 102.4958987933350727, + 47.575053260537970345, 21.970483829329168657, 1.9639017318659170996, 93.110071247599989874, + 104.77154892645921791, 102.38249820501368959, 79.489305972587317228, 101.41759671721956693, + 69.071370747340552043, 36.851237898063118337, 65.203443482128932374, 36.052027773948793765, + 33.85530334726718138, 39.760888494114624336, 63.795505768481234554, 31.606340532343892846, + 4.9619693275817553513, 39.812825320066622226, 83.652497730039613089, 95.617162694306898629, + 84.550528486626717495, 106.54628494710777886, 21.667436630512383999, 101.59525502291580779, + 14.452358667658700142, 39.723880697616550606, 74.718724278940499062, 10.350664852787303971, + 24.719642279815161601, 62.724295503245230066, 35.691921390069182962, 98.098748372973204823, + 66.128762741620448651, 11.125071514605224365, 1.2041670018261356745, 100.76819585913108313, + 56.27869590337286354, 26.162595688896544743, 6.5852309970141504891, 51.815304509775160113, + 35.284297604048333596, 120.3526366443002189, 41.301777270451566437, 52.925920523532113293, + 25.324368264595250366, 64.554473447355121607, 7.7792179555763141252, 97.252183084063290153, + 59.416427425720030442, 70.411788846704439493, 54.984665806565317325, 2.2112826841803325806, + 20.204352244192705257, 73.914869704953162, 65.180072169183404185, 116.43291092092113104, + 1.6432481986921629868, 86.251466540670662653, 9.9855587891288450919, 100.65993777832045453, + 47.594587617611978203, 42.328007619740674272, 125.30162717188795796, 20.674955493886955082, + 65.993429402788024163, 87.471377783582283882, 56.910296874935738742, 3.1429360520342015661, + 25.132078282229485922, 57.384083657947485335, 32.552693109682877548, 36.15351697830556077, + 52.373020245126099326, 58.77808251400347217, 82.445579420531430515, 124.5785760870858212, + 127.99170455359490006, 94.36772291084707831, 27.280690051542478614, 121.24353490641078679, + 70.24765958634816343, 69.682204684471798828, 47.592863854977622395, 28.983477192337886663, + 38.748870555769826751, 26.72681689410819672, 17.746564562195999315, 6.4917147661617491394, + 54.115873549453681335, 43.862356248471769504, 102.08392825760529377, 32.277342572841007495, + 87.197068236855557188, 42.678053338444442488, 88.221175201957521494, 90.242688066147820791, + 77.862915585399605334, 107.22092923213494942, 114.60728055687286542, 43.548868139037949732, + 112.43878125474657281, 80.39657191168225836, 12.622786570173047949, 55.481826005448965589, + 31.227038728757179342, 79.889419444880331866, 65.945077042073535267, 55.416924869670765474, + 51.692815857786627021, 58.201286645919026341, 80.325364544987678528, 98.202822769886552123, + 99.604592979041626677, 70.435948763730266364, 30.825520805978158023, 31.420105476394383004, + 71.393839468779333401, 87.683135090574069181, 85.922343836460640887, 58.696503091297927313, + 59.220774161425651982, 100.55837027831148589, 81.417548894980427576, 5.4724106222820410039, + 115.10141956209918135, 66.684365270506532397, 54.124506822154216934, 20.309594334565190366, + 102.80378622030912084, 77.603636487147014122, 120.35731395387119846, 77.933899963612930151, + 8.3848393890366423875, 101.58417020879278425, 50.872926007959904382, 61.222406081622466445, + 24.203417681637802161, 80.375626589040621184, 59.835918588512868155, 116.55910713328194106, + 54.441613069418963278, 4.7475221610693552066, 41.039103338134736987, 31.582766770319722127, + 92.514688702354760608, 12.183814125906792469, 50.74596200826272252, 83.089445112844259711, + 120.0970227761172282, 11.580725532858195947, 52.664217194644152187, 19.74329475341073703, + 4.6065379838328226469, 56.533580367035028758, 73.21796202722543967, 33.915811811697494704, + 13.374508611868805019, 25.157193995284615085, 61.310621275675657671, 102.1220336723526998, + 71.578210070365457796, 56.21241985969390953, 20.181400903016765369, 16.335202848393237218, + 41.142378995125909569, 90.664445955047995085, 7.975996357108670054, 10.315243666009337176, + 65.538573538786295103, 29.064893503415078158, 70.397212393778318074, 47.685661248360702302, + 73.64268173427626607, 4.8940794903537607752, 110.02111449684525724, 97.162298786370229209, + 119.1094541552120063, 1.6757970701692102011, 56.696329659789626021, 115.72684355797537137, + 103.87291172307959641, 94.176747152840107447, 61.642289419880398782, 15.563819504517596215, + 32.493346536619355902, 118.29650662103813374, 117.00778425220414647, 41.167483455392357428, + 13.526659280792955542, 106.5965524247403664, 27.582297340559307486, 91.311177651208708994, + 20.613390404734673211, 11.73204747416821192, 91.657713301003241213, 53.643998358067619847, + 22.599285888576559955, 40.161542282701702788, 34.46243406006396981, 101.9575217143210466, + 119.43824691511326819, 0.08224852597777498886, 9.5975266439018014353, 110.79607581020900398, + 89.266491435668285703, 60.509326603994850302, 35.11022150091957883, 57.870975574878684711, + 21.626958642969839275, 11.321321612947940594, 32.245086770777561469, 127.9278531140225823, + 97.521749158891907427, 119.58891982295244816, 111.31256110889444244, 17.233067495213617804, + 107.73100064184473013, 1.2730227221763925627, 13.565626868141407613, 74.028642485121963546, + 42.194746902896440588, 36.299691886837536003, 103.11931454150180798, 4.1014423201559111476, + 9.5478541611664695665, 45.628761716801818693, 0.19310089272039476782, 73.479093008514610119, + 92.64423867930599954, 109.32734925423937966, 90.065299486919684568, 79.485896264282928314, + 104.21820048513473012, 53.773967501754668774, 56.013365518672799226, 38.696708855823089834, + 6.3226922390604158863, 117.99437641790791531, 60.935996526102826465, 65.515706998383393511, + 102.08512902402435429, 95.264596653305488871, 76.961859545703191543, 102.60724837503221352, + 75.879811418053577654, 53.335469293084315723, 105.4392778761102818, 94.42094205128523754, + 35.017753329611878144, 113.16584544542638469, 57.734431251272326335, 37.304137074006575858, + 38.416702089685713872, 58.022008650790667161, 112.39994990346895065, 30.821353257382725133, + 119.95508993788098451, 21.575647098834451754, 112.99108095478368341, 99.782645081428199774, + 34.352442439652804751, 38.65371755869637127, 45.044103600099333562, 93.219708470001933165, + 118.63027162339130882, 66.772323347566270968, 23.921805271867924603, 95.268405642938887468, + 74.564072133012814447, 42.863464299582119565, 65.810700228867062833, 12.19045015189476544, + 77.687129225214448525, 49.903029600962327095, 124.77007091425912222, 111.59426253372657811, + 86.071730080198904034, 113.58743255433728336, 104.50062901410274208, 45.027020587462175172, + 33.820593030275631463, 23.160830385058943648, 89.671955728172179079, 42.657652530673658475, + 79.07504218100439175, 72.377858302796084899, 112.92393955883017043, 13.147343078057019738, + 106.13267653538059676, 49.933592136949300766, 12.19026197271887213, 102.65546909356635297, + 58.168711055757739814, 5.9508299650915432721, 116.18602660086253309, 93.909139397805120097, + 74.360992913909285562, 37.79150420380756259, 81.99255558977893088, 5.540140199340385152, + 107.90799998437432805, 108.29233414375994471, 127.73732612652747775, 74.481739357419428416, + 74.354557975420902949, 5.6993920176100800745, 31.821124327972938772, 29.063227404454664793, + 19.942525120452046394, 2.2562416630971711129, 109.71756728556283633, 120.54361601737764431, + 1.6745689401286654174, 22.285318978563736891, 108.48067917416847195, 3.3187656626651005354, + 61.751659653626120416, 116.32271680740450392, 16.488193011169641977, 102.76228103366520372, + 89.764032651750312652, 14.971625157275411766, 107.75367611113324529, 12.13744703935662983, + 91.863958904261380667, 58.364652307729556924, 16.560655709610728081, 15.312153793569450499, + 103.79095662887266371, 45.971618716073862743, 95.998194320847687777, 126.84522272872709436, + 69.842943837567872833, 58.865645819456403842, 26.517359402958391001, 62.982807984179089544, + 53.316417160836863331, 92.267933758917934028, 119.58659945816907566, 10.525482908073172439, + 70.405782852340053068, 108.95800006295758067, 123.81771168850900722, 72.62035213732815464, + 11.986690768892003689, 6.2204264492829679511, 22.317789279582939344, 84.351675415313366102, + 88.566944448037247639, 18.673244930148939602, 110.2820688839055947, 92.88015689769963501, + 17.289245485317223938, 28.178336249096901156, 27.539357402976747835, 90.493789164323970908, + 19.323823188187816413, 8.2595454273287032265, 66.746587429832288763, 94.753440627275267616, + 83.549214291415410116, 74.607584318808221724, 27.00916124481591396, 56.051548642266425304, + 5.6345046246278798208, 30.13669034370832378, 61.449204172717145411, 39.460474394942139043, + 104.37644753501444939, 76.991797586670145392, 95.150106521075940691, 43.940967658658337314, + 3.9278034637354721781, 58.220142495203617727, 81.543097852922073798, 76.764996410031017149, + 30.978611945178272435, 74.835193434442771832, 10.142741494681104086, 73.702475796129874652, + 2.4068869642578647472, 72.10405554789758753, 67.710606694534362759, 79.521776988229248673, + 127.59101153696246911, 63.212681064687785693, 9.9239386551635107026, 79.62565064013688243, + 39.304995460082864156, 63.234325388617435237, 41.101056973257072968, 85.092569894215557724, + 43.334873261028405977, 75.190510045831615571, 28.904717335317400284, 79.44776139523673919, + 21.437448557880998123, 20.701329705574607942, 49.439284559630323201, 125.44859100649046013, + 71.383842780142003903, 68.197496745950047625, 4.2575254832408973016, 22.250143029210448731, + 2.4083340036559093278, 73.53639171826216625, 112.55739180674572708, 52.325191377793089487, + 13.170461994028300978, 103.63060901955032023, 70.568595208100305172, 112.70527328860043781, + 82.603554540903132875, 105.85184104706422659, 50.648736529194138711, 1.1089468947102432139, + 15.558435911156266229, 66.504366168126580305, 118.83285485144369886, 12.823577693408878986, + 109.96933161313063465, 4.4225653683606651612, 40.408704488389048493, 19.829739409909961978, + 2.3601443383704463486, 104.86582184184226207, 3.2864963973879639525, 44.502933081341325305, + 19.971117578261328163, 73.319875556644547032, 95.189175235223956406, 84.656015239484986523, + 122.60325434377591591, 41.349910987777548144, 3.9868588055796863046, 46.942755567164567765, + 113.82059374987147748, 6.2858721040684031323, 50.264156564458971843, 114.76816731589497067, + 65.105386219365755096, 72.307033956611121539, 104.74604049025219865, 117.55616502801058232, + 36.891158841066499008, 121.15715217417528038, 127.9834091071934381, 60.735445821694156621, + 54.561380103088595206, 114.48706981282521156, 12.495319172699964838, 11.364409368943597656, + 95.185727709955244791, 57.966954384675773326, 77.497741111539653502, 53.453633788216393441, + 35.49312912439199863, 12.983429532323498279, 108.23174709890736267, 87.724712496947176987, + 76.167856515210587531, 64.554685145685652969, 46.394136473711114377, 85.356106676892522955, + 48.442350403918680968, 52.485376132299279561, 27.725831170802848646, 86.441858464273536811, + 101.21456111374573084, 87.097736278079537442, 96.877562509496783605, 32.79314382336451672, + 25.245573140346095897, 110.96365201089793118, 62.454077457517996663, 31.778838889764301712, + 3.8901540841470705345, 110.83384973934153095, 103.38563171557325404, 116.40257329184169066, + 32.650729089978995034, 68.405645539776742226, 71.209185958086891333, 12.871897527460532729, + 61.651041611956316046, 62.840210952792403987, 14.787678937562304782, 47.366270181151776342, + 43.844687672921281774, 117.39300618259585463, 118.44154832285494194, 73.116740556626609759, + 34.835097789960855152, 10.944821244567719987, 102.20283912420200068, 5.3687305410130647942, + 108.24901364430843387, 40.61918866913401871, 77.60757244062187965, 27.207272974297666224, + 112.71462790774603491, 27.867799927225860301, 16.769678778076922754, 75.168340417585568503, + 101.74585201591980876, 122.44481216324493289, 48.406835363279242301, 32.751253178081242368, + 119.67183717702937429, 105.11821426656388212, 108.88322613883792656, 9.4950443221387104131, + 82.078206676269473974, 63.165533540643082233, 57.029377404709521215, 24.367628251813584939, + 101.49192401652908302, 38.178890225692157401, 112.19404555223445641, 23.161451065716391895, + 105.32843438928830437, 39.48658950682147406, 9.2130759676656452939, 113.06716073407369549, + 18.435924054450879339, 67.831623623394989409, 26.749017223737610038, 50.314387990569230169, + 122.62124255135495332, 76.24406734470903757, 15.156420140730915591, 112.42483971938781906, + 40.362801806033530738, 32.670405696786474437, 82.284757990255457116, 53.32889191009599017, + 15.951992714217340108, 20.63048733202231233, 3.0771470775725902058, 58.129787006833794294, + 12.794424787556636147, 95.371322496725042583, 19.28536346855253214, 9.7881589807111595292, + 92.04222899369415245, 66.324597572744096396, 110.2189083104240126, 3.3515941403384204023, + 113.39265931958289002, 103.45368711595438072, 79.745823446162830805, 60.353494305680214893, + 123.28457883976079756, 31.12763900903519243, 64.986693073242349783, 108.59301324207990547, + 106.01556850440829294, 82.334966910784714855, 27.053318561589549063, 85.19310484948073281, + 55.16459468112225295, 54.622355302417417988, 41.226780809469346423, 23.464094948340061819, + 55.315426602006482426, 107.28799671613523969, 45.198571777153119911, 80.323084565403405577, + 68.924868120131577598, 75.915043428645731183, 110.87649383022653637, 0.16449705195554997772, + 19.195053287807240849, 93.59215162042164593, 50.532982871336571407, 121.0186532079897006, + 70.22044300183915766, 115.74195114975736942, 43.25391728593967855, 22.642643225895881187, + 64.490173541558760917, 127.85570622804880259, 67.043498317787452834, 111.17783964590853429, + 94.625122217788884882, 34.466134990430873586, 87.462001283689460251, 2.5460454443527851254, + 27.131253736286453204, 20.057284970243927091, 84.389493805792881176, 72.599383773678709986, + 78.23862908300361596, 8.2028846403118222952, 19.095708322332939133, 91.257523433603637386, + 0.38620178544442751445, 18.958186017032858217, 57.288477358615637058, 90.654698508482397301, + 52.130598973843007116, 30.971792528569494607, 80.436400970269460231, 107.54793500350933755, + 112.02673103734559845, 77.393417711646179669, 12.645384478124469751, 107.98875283581583062, + 121.87199305220929091, 3.0314139967704250012, 76.170258048052346567, 62.529193306614615722, + 25.923719091410021065, 77.214496750068065012, 23.759622836107155308, 106.67093858617226942, + 82.878555752224201569, 60.841884102570475079, 70.035506659227394266, 98.331690890852769371, + 115.46886250254465267, 74.608274148013151716, 76.833404179371427745, 116.0440173015849723, + 96.799899806937901303, 61.642706514769088244, 111.91017987576196902, 43.151294197672541486, + 97.982161909571004799, 71.565290162856399547, 68.704884879305609502, 77.307435117392742541, + 90.088207200202305103, 58.439416940007504309, 109.26054324678625562, 5.5446466951325419359, + 47.843610543739487184, 62.536811285881412914, 21.128144266025628895, 85.72692859916787711, + 3.6214004577341256663, 24.38090030379316886, 27.374258450428897049, 99.806059201928292168, + 121.54014182852188242, 95.188525067456794204, 44.143460160401446046, 99.174865108678204706, + 81.001258028205484152, 90.054041174924350344, 67.641186060551262926, 46.321660770121525275, + 51.343911456344358157, 85.315305061350954929, 30.150084362012421479, 16.755716605595807778, + 97.847879117660340853, 26.294686156117677456, 84.265353070761193521, 99.867184273898601532, + 24.380523945441382239, 77.310938187132705934, 116.33742211151547963, 11.901659930186724523, + 104.37205320172870415, 59.818278795613878174, 20.721985827818571124, 75.583008407618763158, + 35.98511117955786176, 11.080280398684408283, 87.81599996875229408, 88.584668287523527397, + 127.47465225305859349, 20.96347871484249481, 20.709115950841805898, 11.398784035220160149, + 63.642248655945877545, 58.126454808909329586, 39.885050240904092789, 4.5124833261979802046, + 91.435134571129310643, 113.08723203475528862, 3.3491378802573308349, 44.570637957131111762, + 88.961358348336943891, 6.6375313253302010708, 123.50331930725587881, 104.64543361480900785, + 32.976386022342921933, 77.524562067334045423, 51.528065303500625305, 29.943250314554461511, + 87.507352222266490571, 24.274894078716897639, 55.727917808522761334, 116.72930461545911385, + 33.121311419221456163, 30.624307587142538978, 79.581913257745327428, 91.943237432151363464, + 63.996388641699013533, 125.69044545745782671, 11.685887675135745667, 117.73129163891280768, + 53.034718805916782003, 125.96561596835817909, 106.63283432167736464, 56.535867517839506036, + 111.17319891633815132, 21.050965816149982857, 12.811565704683744116, 89.916000125918799313, + 119.63542337702165241, 17.240704274656309281, 23.973381537784007378, 12.440852898565935902, + 44.635578559169516666, 40.703350830630370183, 49.133888896074495278, 37.346489860301517183, + 92.564137767814827384, 57.76031379539927002, 34.578490970634447876, 56.356672498193802312, + 55.078714805957133649, 52.987578328647941817, 38.647646376375632826, 16.519090854661044432, + 5.4931748596682155039, 61.506881254554173211, 39.098428582834458211, 21.215168637616443448, + 54.018322489631827921, 112.10309728453285061, 11.269009249255759642, 60.273380687416647561, + 122.89840834543429082, 78.920948789887916064, 80.752895070032536751, 25.983595173343928764, + 62.300213042151881382, 87.881935317316674627, 7.8556069274709443562, 116.44028499041087343, + 35.086195705847785575, 25.529992820062034298, 61.95722389036018285, 21.670386868885543663, + 20.285482989365846151, 19.404951592259749305, 4.8137739285193674732, 16.208111095798813039, + 7.4212133890723634977, 31.043553976462135324, 127.18202307392493822, 126.42536212937557139, + 19.847877310330659384, 31.25130128027376486, 78.609990920165728312, 126.46865077723487047, + 82.202113946517783916, 42.185139788431115448, 86.669746522060449934, 22.381020091663231142, + 57.809434670638438547, 30.895522790473478381, 42.874897115761996247, 41.402659411149215885, + 98.878569119264284382, 122.89718201298455824, 14.767685560287645785, 8.3949934919000952505, + 8.5150509664817946032, 44.500286058420897461, 4.8166680073154566344, 19.07278343652797048, + 97.114783613491454162, 104.65038275558617897, 26.340923988060239935, 79.261218039104278432, + 13.137190416204248322, 97.410546577204513596, 37.207109081809903728, 83.703682094128453173, + 101.29747305838827742, 2.2178937894204864278, 31.116871822316170437, 5.0087323362567985896, + 109.66570970288739773, 25.64715538682139595, 91.938663226261269301, 8.8451307367213303223, + 80.817408976778096985, 39.659478819819923956, 4.7202886767445306759, 81.731643683684524149, + 6.572992794775927905, 89.005866162682650611, 39.942235156526294304, 18.639751113292732043, + 62.378350470451550791, 41.312030478973611025, 117.20650868755183183, 82.699821975555096287, + 7.9737176111593726091, 93.885511134332773509, 99.641187499742954969, 12.571744208136806265, + 100.52831312892158167, 101.53633463179357932, 2.210772438735148171, 16.614067913225881057, + 81.492080980508035282, 107.11233005602116464, 73.782317682136635995, 114.31430434835419874, + 127.96681821438687621, 121.47089164338831324, 109.12276020618082839, 100.97413962565042311, + 24.990638345399929676, 22.72881873789083329, 62.371455419910489582, 115.93390876935518463, + 26.995482223079307005, 106.90726757643278688, 70.98625824878399726, 25.966859064650634537, + 88.463494197818363318, 47.449424993897991953, 24.335713030424813041, 1.1093702913713059388, + 92.788272947425866732, 42.712213353785045911, 96.884700807837361936, 104.97075226459855912, + 55.451662341609335272, 44.8837169285507116, 74.429122227495099651, 46.195472556162712863, + 65.75512501899356721, 65.58628764672903344, 50.491146280695829773, 93.927304021795862354, + 124.90815491503599333, 63.557677779528603423, 7.7803081682977790479, 93.667699478686699877, + 78.771263431150146062, 104.80514658368338132, 65.301458179961628048, 8.8112910795571224298, + 14.418371916173782665, 25.743795054921065457, 123.30208322391263209, 125.68042190558480797, + 29.575357875124609563, 94.732540362303552683, 87.689375345846201526, 106.78601236519534723, + 108.88309664571352187, 18.233481113253219519, 69.670195579921710305, 21.889642489139077952, + 76.405678248404001351, 10.737461082029767567, 88.498027288616867736, 81.238377338271675399, + 27.215144881243759301, 54.414545948598970426, 97.429255815492069814, 55.735599854451720603, + 33.539357556157483486, 22.336680835174774984, 75.491704031843255507, 116.88962432648986578, + 96.813670726558484603, 65.502506356166122714, 111.34367435406238656, 82.236428533131402219, + 89.766452277675853111, 18.990088644281058805, 36.156413352538947947, 126.33106708128616447, + 114.05875480941904243, 48.735256503630807856, 74.983848033058166038, 76.35778045138795278, + 96.388091104468912818, 46.322902131436421769, 82.656868778576608747, 78.973179013642948121, + 18.426151935334928567, 98.134321468147390988, 36.871848108905396657, 7.6632472467899788171, + 53.498034447475220077, 100.62877598114209832, 117.24248510271354462, 24.488134689418075141, + 30.312840281465469161, 96.849679438775638118, 80.725603612067061476, 65.340811393576586852, + 36.569515980510914233, 106.65778382019198034, 31.903985428434680216, 41.26097466404462466, + 6.1542941551451804116, 116.25957401366758859, 25.588849575116910273, 62.742644993450085167, + 38.57072693710506428, 19.576317961425957037, 56.084457987391942879, 4.6491951454918307718, + 92.437816620848025195, 6.7031882806804787833, 98.78531863916941802, 78.907374231912399409, + 31.491646892325661611, 120.70698861136406776, 118.56915767952159513, 62.255278018074022839, + 1.9733861464883375447, 89.186026484163448913, 84.031137008820223855, 36.669933821569429711, + 54.106637123182736104, 42.38620969896146562, 110.3291893622445059, 109.24471060483483598, + 82.453561618938692845, 46.928189896680123638, 110.63085320401660283, 86.575993432270479389, + 90.3971435543098778, 32.646169130810449133, 9.8497362402667931747, 23.830086857295100344, + 93.752987660453072749, 0.32899410391109995544, 38.390106575618119678, 59.18430324084329186, + 101.06596574267678079, 114.03730641598303919, 12.440886003681953298, 103.48390229951473884, + 86.5078345718793571, 45.285286451795400353, 0.98034708312115981244, 127.71141245610124315, + 6.0869966355785436463, 94.355679291820706567, 61.250244435577769764, 68.932269980865385151, + 46.924002567378920503, 5.0920908887055702507, 54.262507472572906408, 40.114569940491492162, + 40.778987611589400331, 17.19876754736105795, 28.477258166007231921, 16.40576928062364459, + 38.191416644669516245, 54.515046867207274772, 0.7724035708888550289, 37.916372034065716434, + 114.5769547172349121, 53.309397016964794602, 104.26119794768601423, 61.943585057142627193, + 32.872801940542558441, 87.095870007022313075, 96.053462074694834882, 26.786835423292359337, + 25.290768956252577482, 87.977505671635299223, 115.74398610441858182, 6.0628279935444879811, + 24.340516096104693133, 125.05838661322923144, 51.847438182823680108, 26.428993500136130024, + 47.519245672217948595, 85.341877172348176828, 37.757111504448403139, 121.68376820514458814, + 12.071013318458426511, 68.663381781709176721, 102.93772500509294332, 21.216548296029941412, + 25.666808358746493468, 104.08803460317358258, 65.599799613875802606, 123.28541302954181447, + 95.82035975152393803, 86.302588395348720951, 67.964323819145647576, 15.130580325716437073, + 9.4097697586148569826, 26.61487023478912306, 52.176414400404610205, 116.8788338800186466, + 90.521086493572511245, 11.089293390265083872, 95.687221087478974368, 125.07362257176282583, + 42.256288532054895768, 43.453857198335754219, 7.2428009154682513326, 48.761800607586337719, + 54.748516900861432077, 71.612118403860222315, 115.08028365704740281, 62.377050134913588408, + 88.286920320806530071, 70.349730217360047391, 34.002516056414606282, 52.108082349852338666, + 7.2823721211025258526, 92.643321540243050549, 102.68782291269235429, 42.630610122701909859, + 60.300168724024842959, 33.511433211195253534, 67.695758235320681706, 52.58937231223899289, + 40.530706141526025021, 71.734368547797203064, 48.761047890886402456, 26.621876374269049847, + 104.67484422303095926, 23.803319860377087025, 80.744106403457408305, 119.63655759122775635, + 41.443971655640780227, 23.166016815237526316, 71.970222359115723521, 22.160560797372454545, + 47.631999937508226139, 49.169336575050692772, 126.94930450611718697, 41.92695742968498962, + 41.418231901683611795, 22.797568070440320298, 127.28449731189175509, 116.25290961781865917, + 79.770100481808185577, 9.024966652399598388, 54.870269142262259265, 98.174464069510577247, + 6.6982757605146616697, 89.141275914265861502, 49.922716696673887782, 13.27506265066404012, + 119.0066386145153956, 81.290867229618015699, 65.952772044689481845, 27.049124134668090846, + 103.05613060700125061, 59.886500629112561001, 47.014704444532981142, 48.549788157433795277, + 111.45583561704916065, 105.45860923091822769, 66.242622838442912325, 61.248615174288715934, + 31.163826515494292835, 55.886474864302726928, 127.99277728340166504, 123.38089091491565341, + 23.371775350275129313, 107.46258327782561537, 106.06943761183720198, 123.93123193671999616, + 85.265668643354729284, 113.07173503568265005, 94.346397832676302642, 42.101931632299965713, + 25.62313140937112621, 51.832000251841236604, 111.27084675404330483, 34.481408549312618561, + 47.946763075568014756, 24.881705797131871805, 89.271157118339033332, 81.406701661260740366, + 98.267777792148990557, 74.692979720606672345, 57.128275535629654769, 115.52062759079854004, + 69.156981941268895753, 112.71334499638760462, 110.1574296119142673, 105.97515665729588363, + 77.295292752751265652, 33.038181709322088864, 10.986349719336431008, 123.01376250910834642, + 78.196857165668916423, 42.430337275232886896, 108.03664497926729382, 96.206194569065701216, + 22.538018498511519283, 120.5467613748369331, 117.79681669087221962, 29.841897579779470107, + 33.505790140065073501, 51.967190346687857527, 124.60042608430740074, 47.763870634633349255, + 15.711213854945526691, 104.88056998082174687, 70.172391411695571151, 51.059985640124068595, + 123.9144477807203657, 43.340773737771087326, 40.570965978731692303, 38.809903184519498609, + 9.6275478570387349464, 32.416222191597626079, 14.842426778144726995, 62.087107952927908627, + 126.36404614785351441, 124.85072425875114277, 39.695754620661318768, 62.502602560551167699, + 29.219981840335094603, 124.93730155447337893, 36.404227893035567831, 84.370279576865868876, + 45.339493044120899867, 44.762040183326462284, 115.61886934127687709, 61.791045580946956761, + 85.749794231523992494, 82.805318822302069748, 69.757138238532206742, 117.79436402596911648, + 29.53537112057529157, 16.789986983800190501, 17.030101932963589206, 89.000572116841794923, + 9.6333360146309132688, 38.145566873059578938, 66.229567226986546302, 81.300765511172357947, + 52.681847976124117849, 30.522436078208556864, 26.274380832412134623, 66.821093154409027193, + 74.414218163623445434, 39.407364188260544324, 74.594946116776554845, 4.4357875788409728557, + 62.233743644632340875, 10.017464672517235158, 91.33141940577479545, 51.29431077364642988, + 55.877326452522538602, 17.690261473446298623, 33.63481795355619397, 79.318957639639847912, + 9.4405773534926993307, 35.463287367369048297, 13.145985589555493789, 50.011732325365301222, + 79.884470313052588608, 37.279502226585464086, 124.75670094090310158, 82.624060957950860029, + 106.41301737510730163, 37.399643951110192575, 15.947435222322383197, 59.771022268669184996, + 71.282374999485909939, 25.143488416277250508, 73.056626257846801309, 75.072669263587158639, + 4.4215448774702963419, 33.228135826455400093, 34.984161961019708542, 86.224660112045967253, + 19.564635364276909968, 100.62860869671203545, 127.93363642877739039, 114.94178328678026446, + 90.24552041236529476, 73.948279251300846227, 49.981276690799859352, 45.457637475781666581, + 124.74291083982461714, 103.86781753871036926, 53.990964446162251988, 85.814535152869211743, + 13.97251649756799452, 51.933718129304907052, 48.926988395636726636, 94.898849987795983907, + 48.671426060849626083, 2.2187405827462498564, 57.576545894851733465, 85.4244267075737298, + 65.76940161567836185, 81.941504529197118245, 110.90332468321867054, 89.767433857105061179, + 20.858244454990199301, 92.390945112329063704, 3.5102500379907723982, 3.1725752934580668807, + 100.98229256139529753, 59.854608043595362687, 121.81630983007198665, 127.11535555905720685, + 15.560616336599196075, 59.335398957377037732, 29.542526862303930102, 81.610293167370400624, + 2.6029163599232560955, 17.62258215911424486, 28.836743832347565331, 51.487590109845768893, + 118.60416644782890216, 123.36084381116961595, 59.150715750252857106, 61.465080724610743346, + 47.378750691696041031, 85.572024730394332437, 89.766193291427043732, 36.466962226510077016, + 11.34039115984342061, 43.779284978281793883, 24.811356496808002703, 21.474922164063173113, + 48.996054577237373451, 34.476754676543350797, 54.430289762487518601, 108.82909189720157883, + 66.858511630984139629, 111.47119970890344121, 67.078715112314966973, 44.673361670353187947, + 22.983408063690148992, 105.77924865298336954, 65.627341453120607184, 3.0050127123358834069, + 94.68734870812841109, 36.472857066266442416, 51.532904555351706222, 37.98017728856211761, + 72.312826705081533873, 124.66213416257596691, 100.11750961883808486, 97.470513007265253691, + 21.967696066119970055, 24.71556090277954354, 64.776182208937825635, 92.645804262876481516, + 37.313737557156855473, 29.946358027285896242, 36.852303870673495112, 68.268642936294781975, + 73.743696217810793314, 15.326494493579957634, 106.99606889495407813, 73.257551962287834613, + 106.48497020542708924, 48.976269378836150281, 60.625680562934576301, 65.699358877554914216, + 33.451207224137760932, 2.6816227871531737037, 73.139031961025466444, 85.315567640383960679, + 63.807970856869360432, 82.52194932808924932, 12.308588310293998802, 104.51914802733517718, + 51.177699150233820546, 125.48528998690017033, 77.141453874210128561, 39.152635922851914074, + 112.16891597478388576, 9.2983902909872995224, 56.875633241696050391, 13.406376561364595545, + 69.570637278342474019, 29.814748463824798819, 62.9832937846549612, 113.41397722273177351, + 109.13831535904319026, 124.51055603614804568, 3.9467722929803130683, 50.372052968330535805, + 40.06227401764044771, 73.339867643138859421, 108.21327424636547221, 84.772419397926569218, + 92.658378724492649781, 90.489421209673309932, 36.907123237877385691, 93.856379793363885256, + 93.261706408036843641, 45.151986864544596756, 52.7942871086197556, 65.292338261620898265, + 19.699472480533586349, 47.660173714593838667, 59.505975320906145498, 0.65798820782219991088, + 76.780213151236239355, 118.3686064816902217, 74.131931485357199563, 100.07461283196607837, + 24.881772007367544575, 78.967804599033115664, 45.015669143758714199, 90.570572903590800706, + 1.9606941662459576037, 127.4228249122024863, 12.173993271160725271, 60.711358583641413134, + 122.50048887115917751, 9.8645399617307703011, 93.848005134757841006, 10.184181777411140501, + 108.52501494514581282, 80.229139880982984323, 81.557975223178800661, 34.3975350947221159, + 56.954516332014463842, 32.811538561247289181, 76.38283328933903249, 109.03009373441454954, + 1.5448071417777100578, 75.832744068135070847, 101.15390943446982419, 106.61879403393322718, + 80.522395895372028463, 123.88717011428525439, 65.745603881088754861, 46.191740014048264129, + 64.106924149389669765, 53.573670846584718674, 50.581537912508792942, 47.955011343274236424, + 103.48797220883716363, 12.125655987088975962, 48.681032192213024246, 122.11677322645846289, + 103.69487636564736022, 52.857987000272260047, 95.038491344439535169, 42.683754344696353655, + 75.514223008900444256, 115.36753641028917627, 24.142026636920491001, 9.3267635634219914209, + 77.87545001018588664, 42.433096592059882823, 51.333616717496624915, 80.176069206350803142, + 3.1995992277552431915, 118.57082605908726691, 63.640719503051514039, 44.605176790701079881, + 7.9286476382912951522, 30.261160651432874147, 18.819539517229713965, 53.22974046957824612, + 104.35282880081285839, 105.75766776004093117, 53.042172987145022489, 22.178586780533805722, + 63.374442174961586716, 122.14724514352565166, 84.512577064109791536, 86.907714396671508439, + 14.485601830936502665, 97.523601215172675438, 109.49703380172650213, 15.22423680772408261, + 102.16056731409480562, 124.7541002698308148, 48.573840641616698122, 12.699460434720094781, + 68.005032112829212565, 104.21616469970467733, 14.564744242208689684, 57.286643080489739077, + 77.375645825384708587, 85.261220245403819717, 120.60033744804968592, 67.022866422394145047, + 7.3915164706413634121, 105.17874462447798578, 81.061412283055688022, 15.468737095594406128, + 97.522095781772804912, 53.243752748541737674, 81.349688446061918512, 47.606639720757812029, + 33.488212806918454589, 111.2731151824555127, 82.887943311281560455, 46.332033630478690611, + 15.940444718231447041, 44.321121594744909089, 95.263999875016452279, 98.338673150105023524, + 125.89860901223437395, 83.85391485936997924, 82.836463803367223591, 45.595136140884278575, + 126.56899462378714816, 104.50581923564095632, 31.540200963616371155, 18.049933304799196776, + 109.74053828452815651, 68.348928139021154493, 13.396551521032961318, 50.282551828531723004, + 99.845433393347775564, 26.550125301331718219, 110.01327722903442918, 34.581734459239669377, + 3.9055440893789636903, 54.098248269339819672, 78.11226121400250122, 119.773001258225122, + 94.029408889065962285, 97.099576314871228533, 94.911671234101959271, 82.917218461840093369, + 4.4852456768858246505, 122.49723034857743187, 62.32765303098858567, 111.77294972860909184, + 127.98555456680696807, 118.76178182983130682, 46.743550700553896604, 86.925166555654868716, + 84.138875223678041948, 119.86246387344363029, 42.531337286713096546, 98.143470071368938079, + 60.692795665352605283, 84.203863264599931426, 51.246262818742252421, 103.66400050368611119, + 94.541693508086609654, 68.962817098625237122, 95.893526151136029512, 49.763411594267381588, + 50.542314236681704642, 34.81340332252511871, 68.535555584301619092, 21.385959441213344689, + 114.25655107126294752, 103.04125518160071806, 10.313963882541429484, 97.426689992778847227, + 92.314859223832172574, 83.950313314595405245, 26.590585505502531305, 66.076363418644177727, + 21.972699438676499994, 118.02752501822033082, 28.393714331337832846, 84.86067455046941177, + 88.073289958538225619, 64.412389138131402433, 45.076036997026676545, 113.09352274967750418, + 107.59363338174443925, 59.683795159558940213, 67.011580280130147003, 103.93438069337935303, + 121.20085216861480149, 95.527741269266698509, 31.422427709894691361, 81.761139961647131713, + 12.344782823391142301, 102.11997128025177517, 119.8288955614407314, 86.681547475542174652, + 81.141931957463384606, 77.619806369038997218, 19.255095714077469893, 64.832444383195252158, + 29.684853556289453991, 124.17421590585945523, 124.7280922957106668, 121.70144851750228554, + 79.391509241322637536, 125.0052051211023354, 58.439963680673827184, 121.87460310894675786, + 72.808455786074773641, 40.740559153731737752, 90.678986088241799735, 89.524080366656562546, + 103.23773868255375419, 123.5820911618975515, 43.499588463051622966, 37.610637644607777474, + 11.514276477068051463, 107.58872805193823297, 59.070742241150583141, 33.579973967600381002, + 34.060203865930816391, 50.001144233683589846, 19.266672029261826538, 76.291133746122795856, + 4.4591344539767305832, 34.601531022344715893, 105.3636959522482357, 61.044872156417113729, + 52.548761664827907225, 5.6421863088216923643, 20.828436327246890869, 78.814728376524726627, + 21.189892233553109691, 8.8715751576819457114, 124.46748728926468175, 20.034929345038108295, + 54.662838811549590901, 102.58862154729285976, 111.7546529050450772, 35.380522946892597247, + 67.269635907116025919, 30.637915279279695824, 18.881154706985398661, 70.926574734738096595, + 26.291971179110987578, 100.02346465073424042, 31.768940626105177216, 74.559004453170928173, + 121.51340188180984114, 37.248121915905358037, 84.826034750214603264, 74.799287902220385149, + 31.894870444644766394, 119.54204453734200797, 14.564749998971819878, 50.286976832558138995, + 18.113252515697240597, 22.145338527174317278, 8.8430897549405926839, 66.456271652910800185, + 69.968323922043055063, 44.449320224091934506, 39.129270728557457915, 73.257217393427708885, + 127.86727285755841876, 101.8835665735641669, 52.491040824734227499, 19.896558502601692453, + 99.962553381599718705, 90.91527495156697114, 121.48582167965287226, 79.735635077420738526, + 107.98192889232814196, 43.629070305738423485, 27.94503299513598904, 103.8674362586098141, + 97.853976791277091252, 61.797699975591967814, 97.342852121699252166, 4.4374811654924997129, + 115.15309178970710491, 42.848853415151097579, 3.5388032313603616785, 35.883009058397874469, + 93.806649366440979065, 51.534867714210122358, 41.716488909984036582, 56.781890224658127408, + 7.0205000759815447964, 6.3451505869197717402, 73.964585122790595051, 119.70921608719436335, + 115.63261966014761128, 126.23071111811441369, 31.121232673198392149, 118.67079791475407546, + 59.085053724611498183, 35.220586334740801249, 5.205832719846512191, 35.245164318228489719, + 57.673487664695130661, 102.97518021969517577, 109.20833289566144231, 118.72168762233923189, + 118.30143150050571421, 122.93016144922148669, 94.75750138339572004, 43.144049460792302852, + 51.532386582854087465, 72.933924453020154033, 22.68078231968684122, 87.558569956563587766, + 49.622712993616005406, 42.949844328126346227, 97.992109154474746902, 68.953509353086701594, + 108.86057952497867518, 89.658183794406795641, 5.7170232619719172362, 94.94239941781052039, + 6.1574302246299339458, 89.346723340706375893, 45.966816127383935964, 83.558497305970377056, + 3.2546829062412143685, 6.0100254246754047927, 61.37469741625682218, 72.945714132532884832, + 103.06580911070341244, 75.960354577127873199, 16.625653410166705726, 121.3242683251555718, + 72.235019237679807702, 66.941026014530507382, 43.935392132239940111, 49.431121805562725058, + 1.552364417879289249, 57.291608525752963033, 74.627475114313710947, 59.892716054571792483, + 73.704607741350628203, 8.5372858725932019297, 19.487392435621586628, 30.652988987163553247, + 85.992137789911794243, 18.515103924579307204, 84.969940410854178481, 97.952538757672300562, + 121.25136112587279058, 3.3987177551098284312, 66.902414448275521863, 5.3632455743099853862, + 18.278063922054570867, 42.631135280767921358, 127.61594171374235884, 37.043898656178498641, + 24.617176620591635583, 81.038296054670354351, 102.35539830047127907, 122.97057997380397865, + 26.282907748420257121, 78.305271845707466127, 96.337831949567771517, 18.596780581974599045, + 113.75126648339210078, 26.81275312273282907, 11.141274556684948038, 59.629496927649597637, + 125.96658756931356038, 98.827954445467184996, 90.27663071809001849, 121.02111207229609136, + 7.8935445859606261365, 100.74410593666107161, 80.124548035284533398, 18.679735286281356821, + 88.426548492734582396, 41.544838795856776414, 57.31675744898893754, 52.978842419346619863, + 73.81424647575840936, 59.71275958673140849, 58.523412816073687281, 90.303973729089193512, + 105.58857421724314918, 2.5846765232417965308, 39.398944961067172699, 95.320347429187677335, + 119.011950641812291, 1.3159764156480378006, 25.560426302476116689, 108.73721296338408138, + 20.263862970718037104, 72.149225663932156749, 49.763544014738727128, 29.935609198066231329, + 90.031338287521066377, 53.141145807181601413, 3.9213883324955531862, 126.84564982440497261, + 24.347986542321450543, 121.42271716728646425, 117.00097774231835501, 19.729079923465178581, + 59.696010269515682012, 20.368363554825918982, 89.050029890295263613, 32.458279761969606625, + 35.115950446357601322, 68.795070189444231801, 113.90903266402892768, 65.62307712249821634, + 24.765666578681702958, 90.060187468829099089, 3.0896142835590580944, 23.665488136273779674, + 74.307818868943286361, 85.237588067870092345, 33.044791790747694904, 119.77434022857414675, + 3.4912077621775097214, 92.383480028100166237, 0.21384829877933952957, 107.14734169316943735, + 101.16307582501758588, 95.910022686552110827, 78.975944417674327269, 24.251311974177951925, + 97.36206438442968647, 116.23354645292056375, 79.389752731294720434, 105.71597400054815807, + 62.076982688879070338, 85.367508689396345289, 23.028446017804526491, 102.73507282057835255, + 48.284053273840982001, 18.653527126847620821, 27.75090002037177328, 84.866193184119765647, + 102.66723343499688781, 32.352138412701606285, 6.3991984555141243618, 109.14165211817453383, + 127.28143900610302808, 89.210353581402159762, 15.857295276582590304, 60.522321302865748294, + 37.63907903445942793, 106.45948093916013022, 80.705657601629354758, 83.515335520081862342, + 106.08434597429004498, 44.357173561067611445, 126.74888434992681141, 116.29449028705494129, + 41.025154128223221051, 45.815428793343016878, 28.971203661876643309, 67.047202430348988855, + 90.994067603453004267, 30.448473615451803198, 76.321134628193249227, 121.50820053966162959, + 97.147681283233396243, 25.398920869443827542, 8.0100642256620631088, 80.432329399409354664, + 29.129488484417379368, 114.57328616098311613, 26.751291650773055153, 42.522440490811277414, + 113.20067489610300981, 6.0457328447882900946, 14.783032941286364803, 82.35748924895960954, + 34.122824566111376043, 30.937474191192450235, 67.044191563545609824, 106.48750549708711333, + 34.699376892123837024, 95.213279441515624058, 66.976425613840547157, 94.546230364914663369, + 37.775886622563120909, 92.664067260957381222, 31.880889436462894082, 88.642243189493456157, + 62.527999750036542537, 68.677346300213685026, 123.79721802447238588, 39.707829718743596459, + 37.672927606734447181, 91.190272281772195129, 125.13798924757793429, 81.011638471281912643, + 63.08040192723274231, 36.099866609602031531, 91.481076569059950998, 8.6978562780423089862, + 26.793103042065922637, 100.56510365706708399, 71.690866786695551127, 53.100250602667074418, + 92.026554458068858366, 69.163468918479338754, 7.8110881787579273805, 108.19649653868327732, + 28.224522428008640418, 111.54600251645388198, 60.058817778135562548, 66.199152629746095045, + 61.823342468207556522, 37.834436923680186737, 8.9704913537752872799, 116.99446069715486374, + 124.65530606198080932, 95.545899457221821649, 127.97110913361757412, 109.52356365966261365, + 93.487101401111431187, 45.850333111313375412, 40.277750447359721875, 111.72492774688726058, + 85.062674573429831071, 68.286940142737876158, 121.38559133070884855, 40.407726529199862853, + 102.49252563748814282, 79.328001007375860354, 61.083387016176857287, 9.9256341972541122232, + 63.787052302272059023, 99.526823188534763176, 101.08462847336340928, 69.6268066450538754, + 9.071111168603238184, 42.771918882430327358, 100.51310214252953301, 78.082510363201436121, + 20.627927765086496947, 66.853379985561332433, 56.629718447667983128, 39.90062662919081049, + 53.181171011008700589, 4.1527268372883554548, 43.945398877356637968, 108.05505003644066164, + 56.78742866267930367, 41.721349100942461519, 48.146579917080089217, 0.82477827626280486584, + 90.152073994056991069, 98.187045499358646339, 87.187266763488878496, 119.36759031912151841, + 6.0231605602639319841, 79.868761386762344046, 114.40170433723324095, 63.055482538533397019, + 62.844855419793020701, 35.522279923294263426, 24.689565646785922581, 76.239942560507188318, + 111.65779112288510078, 45.363094951087987283, 34.283863914930407191, 27.239612738077994436, + 38.510191428158577764, 1.6648887663905043155, 59.36970711258254596, 120.34843181172254845, + 121.45618459142497159, 115.40289703500820906, 30.78301848264891305, 122.01041024220467079, + 116.87992736135129235, 115.74920621789715369, 17.616911572149547283, 81.481118307467113482, + 53.357972176487237448, 51.048160733316763071, 78.475477365111146355, 119.164182323795103, + 86.999176926103245933, 75.221275289215554949, 23.028552954139740905, 87.177456103876465932, + 118.14148448230116628, 67.159947935200762004, 68.120407731861632783, 100.00228846736717969, + 38.533344058527291054, 24.582267492245591711, 8.9182689079534611665, 69.203062044693069765, + 82.727391904496471398, 122.08974431283422746, 105.09752332965581445, 11.284372617643384729, + 41.656872654497419717, 29.629456753049453255, 42.379784467106219381, 17.743150315367529402, + 120.9349745785293635, 40.06985869007621659, 109.32567762310281978, 77.177243094589357497, + 95.509305810090154409, 70.761045893788832473, 6.5392718142320518382, 61.275830558559391648, + 37.762309413974435301, 13.85314946947619319, 52.583942358225613134, 72.046929301468480844, + 63.537881252213992411, 21.118008906345494324, 115.02680376361968229, 74.496243831814354053, + 41.652069500432844507, 21.598575804440770298, 63.789740889293170767, 111.08408907468401594, + 29.129499997943639755, 100.57395366511627799, 36.226505031394481193, 44.290677054348634556, + 17.686179509884823347, 4.9125433058252383489, 11.936647844086110126, 88.898640448183869012, + 78.258541457118553808, 18.514434786859055748, 127.73454571512047551, 75.767133147128333803, + 104.982081649468455, 39.793117005207022885, 71.925106763203075388, 53.830549903137580259, + 114.9716433593093825, 31.47127015484511503, 87.963857784656283911, 87.258140611476846971, + 55.890065990275616059, 79.734872517223266186, 67.707953582554182503, 123.59539995118757361, + 66.685704243398504332, 8.8749623309886374045, 102.30618357941420982, 85.697706830302195158, + 7.0776064627207233571, 71.766018116799386917, 59.613298732881958131, 103.06973542842024472, + 83.432977819968073163, 113.56378044931625482, 14.041000151963089593, 12.690301173843181459, + 19.929170245584828081, 111.41843217439236469, 103.26523932029886055, 124.46142223622882739, + 62.242465346400422277, 109.34159582950815093, 118.17010744922299637, 70.441172669481602497, + 10.411665439693024382, 70.490328636456979439, 115.3469753293938993, 77.950360439393989509, + 90.416665791326522594, 109.44337524468210177, 108.6028630010150664, 117.86032289844661136, + 61.515002766791440081, 86.288098921584605705, 103.06477316571181291, 17.867848906040308066, + 45.361564639377320418, 47.117139913127175532, 99.245425987232010812, 85.899688656256330432, + 67.984218308953131782, 9.9070187061770411674, 89.721159049960988341, 51.316367588813591283, + 11.434046523947472451, 61.88479883562104078, 12.31486044926350587, 50.693446681412751786, + 91.933632254771509906, 39.116994611940754112, 6.509365812482428737, 12.020050849350809585, + 122.74939483251728234, 17.891428265069407644, 78.131618221410462866, 23.920709154255746398, + 33.25130682033704943, 114.64853665031478158, 16.470038475363253383, 5.882052029061014764, + 87.870784264479880221, 98.862243611125450116, 3.1047288357585784979, 114.58321705150956404, + 21.254950228627421893, 119.78543210914722295, 19.409215482701256406, 17.074571745186403859, + 38.974784871243173257, 61.305977974330744473, 43.984275579823588487, 37.030207849162252387, + 41.93988082171199494, 67.905077515348239103, 114.50272225174558116, 6.7974355102232948411, + 5.8048288965510437265, 10.726491148619970772, 36.556127844109141733, 85.262270561539480696, + 127.23188342748471769, 74.087797312356997281, 49.234353241186909145, 34.076592109344346682, + 76.710796600946196122, 117.94115994760795729, 52.565815496844152221, 28.610543691418570234, + 64.675663899135543033, 37.193561163952836068, 99.502532966784201562, 53.625506245465658139, + 22.282549113369896077, 119.25899385530283325, 123.93317513863075874, 69.655908890938007971, + 52.553261436183674959, 114.04222414459218271, 15.787089171924890252, 73.488211873325781198, + 32.249096070569066796, 37.35947057256635162, 48.853096985469164792, 83.089677591713552829, + 114.63351489797787508, 105.9576848386968777, 19.628492951516818721, 119.42551917346281698, + 117.04682563215101254, 52.607947458182025002, 83.177148434486298356, 5.1693530464835930616, + 78.797889922137983376, 62.640694858378992649, 110.02390128362458199, 2.6319528312960756011, + 51.120852604955871357, 89.474425926768162753, 40.527725941439712187, 16.298451327864313498, + 99.527088029477454256, 59.871218396136100637, 52.062676575042132754, 106.28229161436320283, + 7.8427766649947443511, 125.69129964880994521, 48.695973084646539064, 114.84543433457656647, + 106.00195548463671003, 39.458159846930357162, 119.39202053903136402, 40.736727109655475942, + 50.100059780590527225, 64.91655952393921325, 70.231900892718840623, 9.5901403788921015803, + 99.818065328061493346, 3.2461542449964326806, 49.531333157367043896, 52.120374937658198178, + 6.1792285671181161888, 47.330976272551197326, 20.615637737890210701, 42.475176135740184691, + 66.089583581499027787, 111.5486804571482935, 6.9824155243586574215, 56.766960056200332474, + 0.42769659756231703795, 86.294683386342512676, 74.326151650038809748, 63.820045373107859632, + 29.951888835348654538, 48.502623948359541828, 66.724128768863010919, 104.46709290584476548, + 30.779505462593078846, 83.431948001096316148, 124.15396537776177865, 42.735017378792690579, + 46.056892035612690961, 77.470145641156705096, 96.568106547681964003, 37.307054253695241641, + 55.501800040747184539, 41.732386368243169272, 77.334466869993775617, 64.70427682540321257, + 12.798396911031886702, 90.28330423635270563, 126.56287801220969413, 50.420707162804319523, + 31.714590553165180609, 121.04464260573149659, 75.27815806892249384, 84.918961878323898418, + 33.411315203262347495, 39.030671040167362662, 84.168691948580089957, 88.714347122138860868, + 125.4977686998572608, 104.58898057410988258, 82.050308256446442101, 91.630857586686033756, + 57.942407323756924598, 6.0944048607016156893, 53.988135206906008534, 60.896947230907244375, + 24.642269256390136434, 115.01640107932689716, 66.295362566466792487, 50.797841738887655083, + 16.020128451327764196, 32.864658798818709329, 58.258976968838396715, 101.14657232196623227, + 53.502583301546110306, 85.044880981626192806, 98.401349792206019629, 12.091465689576580189, + 29.566065882576367585, 36.71497849791921908, 68.245649132222752087, 61.874948382388538448, + 6.0883831270948576275, 84.975010994174226653, 69.398753784251312027, 62.426558883034886094, + 5.9528512276847322937, 61.092460729829326738, 75.551773245129879797, 57.328134521914762445, + 63.761778872929426143, 49.284486378986912314, 125.05599950007672305, 9.3546926004310080316, + 119.59443604894477176, 79.415659437487192918, 75.345855213472532341, 54.380544563548028236, + 122.27597849515950656, 34.023276942563825287, 126.16080385446548462, 72.19973321920770104, + 54.962153138119901996, 17.395712556084617972, 53.586206084135483252, 73.130207314137805952, + 15.381733573391102254, 106.20050120533778681, 56.053108916141354712, 10.326937836958677508, + 15.62217635751949274, 88.392993077366554644, 56.449044856020918814, 95.092005032907763962, + 120.11763555627476308, 4.3983052594921900891, 123.64668493641511304, 75.668873847360373475, + 17.940982707554212539, 105.98892139431336545, 121.31061212396525661, 63.091798914447281277, + 127.94221826723878621, 91.047127319328865269, 58.974202802222862374, 91.700666222626750823, + 80.555500894723081728, 95.449855493778159143, 42.12534914686330012, 8.5738802854793902952, + 114.77118266141769709, 80.815453058403363684, 76.985051274979923619, 30.656002014751720708, + 122.16677403235371457, 19.851268394508224446, 127.57410460454775603, 71.053646377073164331, + 74.169256946730456548, 11.2536132901077508, 18.142222337206476368, 85.543837764864292694, + 73.026204285062704002, 28.165020726402872242, 41.255855530176631873, 5.7067599711226648651, + 113.25943689533596626, 79.801253258381620981, 106.36234202201740118, 8.3054536745767109096, + 87.890797754716913914, 88.110100072881323285, 113.57485732535860734, 83.442698201884923037, + 96.293159834160178434, 1.6495565525292477105, 52.304147988117620116, 68.374090998720930656, + 46.374533526981394971, 110.73518063824303681, 12.046321120531501947, 31.73752277352832607, + 100.8034086744664819, 126.11096507706679404, 125.6897108395860414, 71.044559846588526852, + 49.379131293575483141, 24.479885121018014615, 95.315582245770201553, 90.726189902175974566, + 68.567727829860814381, 54.479225476155988872, 77.020382856317155529, 3.329777532781008631, + 118.7394142251687299, 112.69686362344873487, 114.91236918285358115, 102.80579407001641812, + 61.566036965301464079, 116.02082048441297957, 105.75985472270622267, 103.49841243579430738, + 35.233823144302732544, 34.962236614934226964, 106.7159443529744749, 102.09632146663716412, + 28.950954730225930689, 110.32836464759384398, 45.998353852210129844, 22.442550578431109898, + 46.057105908283119788, 46.354912207756569842, 108.28296896460597054, 6.3198958704051619861, + 8.2408154637269035447, 72.004576934734359384, 77.066688117054582108, 49.164534984491183423, + 17.836537815910560312, 10.406124089389777509, 37.454783808996580774, 116.17948862567209289, + 82.1950466593116289, 22.568745235286769457, 83.313745308994839434, 59.25891350609890651, + 84.759568934212438762, 35.486300630738696782, 113.869949157058727, 80.139717380156071158, + 90.651355246209277539, 26.354486189182352973, 63.018611620183946798, 13.522091787577664945, + 13.078543628464103676, 122.5516611171187833, 75.524618827948870603, 27.706298938952386379, + 105.16788471645486425, 16.093858602936961688, 127.07576250442798482, 42.236017812694626627, + 102.05360752724300255, 20.992487663628708106, 83.304139000865689013, 43.197151608881540596, + 127.57948177858997951, 94.168178149368031882, 58.258999995890917489, 73.147907330232555978, + 72.453010062788962387, 88.581354108697269112, 35.372359019769646693, 9.8250866116504766978, + 23.873295688175858231, 49.797280896371376002, 28.517082914237107616, 37.028869573721749475, + 127.46909143024458899, 23.534266294260305585, 81.964163298936909996, 79.586234010417683749, + 15.850213526406150777, 107.6610998062787985, 101.94328671861876501, 62.942540309693868039, + 47.927715569316205801, 46.516281222953693941, 111.7801319805548701, 31.469745034450170351, + 7.4159071651120029856, 119.19079990237878519, 5.3714084867970086634, 17.749924661980912788, + 76.612367158832057612, 43.395413660604390316, 14.155212925445084693, 15.532036233598773833, + 119.22659746576755424, 78.139470856844127411, 38.865955639939784305, 99.127560898632509634, + 28.082000303926179186, 25.380602347686362918, 39.85834049117329414, 94.836864348788367352, + 78.530478640601359075, 120.92284447245765477, 124.48493069280448253, 90.683191659019939834, + 108.34021489844963071, 12.882345338963204995, 20.823330879389686743, 12.980657272917596856, + 102.69395065879143658, 27.900720878791616997, 52.833331582656683167, 90.88675048936784151, + 89.205726002033770783, 107.72064579689322272, 123.03000553358651814, 44.576197843172849389, + 78.129546331423625816, 35.735697812080616131, 90.723129278754640836, 94.234279826257989043, + 70.490851974467659602, 43.799377312516298844, 7.9684366179062635638, 19.814037412357720314, + 51.442318099921976682, 102.63273517762718257, 22.868093047894944903, 123.76959767124208156, + 24.629720898527011741, 101.38689336282914155, 55.867264509543019813, 78.233989223881508224, + 13.018731624964857474, 24.040101698705257149, 117.49878966503456468, 35.782856530142453266, + 28.263236442820925731, 47.841418308511492796, 66.502613640677736839, 101.29707330062956316, + 32.940076950726506766, 11.764104058125667507, 47.741568528963398421, 69.724487222250900231, + 6.2094576715207949746, 101.16643410301912809, 42.509900457258481765, 111.57086421829444589, + 38.818430965402512811, 34.149143490372807719, 77.949569742486346513, 122.61195594866148895, + 87.968551159647176974, 74.060415698324504774, 83.87976164342762786, 7.8101550307001161855, + 101.00544450349116232, 13.594871020446589682, 11.609657793102087453, 21.452982297239941545, + 73.112255688221921446, 42.52454112308259937, 126.46376685497307335, 20.175594624713994563, + 98.468706482373818289, 68.153184218692331342, 25.421593201896030223, 107.88231989521591458, + 105.13163099368830444, 57.221087382840778446, 1.351327798271086067, 74.387122327909310116, + 71.005065933568403125, 107.25101249093131628, 44.565098226743430132, 110.51798771060930449, + 119.86635027726515546, 11.311817781876015943, 105.1065228723709879, 100.08444828918436542, + 31.574178343853418482, 18.976423746651562396, 64.498192141138133593, 74.718941145132703241, + 97.706193970941967564, 38.179355183430743637, 101.26702979595938814, 83.91536967739375541, + 39.256985903037275421, 110.85103834692927194, 106.09365126430202508, 105.21589491636768798, + 38.354296868972596712, 10.338706092970824102, 29.595779844275966752, 125.28138971676162328, + 92.047802567249163985, 5.2639056625921512023, 102.24170520991538069, 50.948851853536325507, + 81.055451882879424375, 32.596902655732264975, 71.054176058954908513, 119.74243679227220127, + 104.12535315008790349, 84.56458322872640565, 15.685553329993126681, 123.38259929761989042, + 97.391946169296716107, 101.69086866915677092, 84.003910969273420051, 78.916319693864352303, + 110.78404107806272805, 81.473454219310951885, 100.20011956118469243, 1.8331190478820644785, + 12.463801785437681247, 19.180280757787841139, 71.636130656122986693, 6.4923084899928653613, + 99.062666314734087791, 104.24074987531639636, 12.358457134236232378, 94.661952545102394652, + 41.231275475780421402, 84.95035227148400736, 4.1791671630016935524, 95.097360914296586998, + 13.964831048717314843, 113.53392011240066495, 0.85539319512827205472, 44.589366772688663332, + 20.652303300077619497, 127.64009074621571926, 59.903777670697309077, 97.005247896722721634, + 5.4482575377296598163, 80.934185811689530965, 61.559010925189795671, 38.863896002196270274, + 120.30793075552355731, 85.470034757585381158, 92.113784071229019901, 26.940291282317048172, + 65.136213095363928005, 74.614108507390483283, 111.00360008149436908, 83.464772736489976523, + 26.668933739991189213, 1.4085536508064251393, 25.596793822067411384, 52.566608472709049238, + 125.12575602441938827, 100.84141432560863905, 63.429181106333999196, 114.08928521146663115, + 22.556316137848625658, 41.837923756647796836, 66.82263040652469499, 78.061342080338363303, + 40.337383897163817892, 49.428694244281359715, 122.99553739971815958, 81.177961148223403143, + 36.100616512896522181, 55.261715173372067511, 115.8848146475138492, 12.188809721403231379, + 107.97627041381201707, 121.79389446181448875, 49.284538512783910846, 102.0328021586574323, + 4.5907251329335849732, 101.59568347777531017, 32.040256902655528393, 65.729317597637418658, + 116.51795393768043141, 74.293144643932464533, 107.00516660309585859, 42.089761963256023591, + 68.802699584412039258, 24.182931379153160378, 59.13213176515273517, 73.42995699584207614, + 8.4912982644455041736, 123.7498967647770769, 12.176766254193353234, 41.950021988352091284, + 10.797507568502624054, 124.85311776606977219, 11.905702455369464587, 122.18492145966229145, + 23.103546490259759594, 114.65626904382952489, 127.52355774585885229, 98.568972757977462607, + 122.1119990001534461, 18.709385200865654042, 111.18887209789318149, 30.831318874978023814, + 22.691710426945064683, 108.76108912709969445, 116.55195699031901313, 68.046553885131288553, + 124.32160770893460722, 16.399466438415402081, 109.92430627623980399, 34.791425112169235945, + 107.17241216827460448, 18.260414628275611904, 30.763467146785842488, 84.401002410675573628, + 112.10621783228270942, 20.653875673917355016, 31.244352715042623458, 48.785986154733109288, + 112.89808971204547561, 62.184010065819165902, 112.23527111254952615, 8.796610518988018157, + 119.29336987283386406, 23.337747694720746949, 35.881965415112063056, 83.977842788630368887, + 114.62122424793051323, 126.18359782889820053, 127.8844365344812104, 54.094254638657730538, + 117.94840560444936273, 55.401332445257139625, 33.111001789449801436, 62.899710987556318287, + 84.250698293726600241, 17.147760570962418569, 101.54236532283903216, 33.630906116810365347, + 25.970102549959847238, 61.312004029507079395, 116.33354806470742915, 39.702536789020086871, + 127.14820920909915003, 14.10729275414996664, 20.338513893460913096, 22.507226580215501599, + 36.284444674416590715, 43.087675529732223367, 18.052408570125408005, 56.330041452805744484, + 82.511711060353263747, 11.413519942248967709, 98.51887379067557049, 31.60250651676687994, + 84.724684044034802355, 16.610907349157059798, 47.781595509437465807, 48.22020014576628455, + 99.14971465072085266, 38.885396403773484053, 64.586319668320356868, 3.299113105058495421, + 104.60829597623887821, 8.7481819974418613128, 92.74906705396642792, 93.470361276486073621, + 24.092642241063003894, 63.475045547060290119, 73.606817348936601775, 124.22193015413722605, + 123.37942167917572078, 14.089119693177053705, 98.758262587150966283, 48.95977024203966721, + 62.631164491544041084, 53.452379804355587112, 9.1354556597216287628, 108.95845095231561572, + 26.040765712634311058, 6.6595550655656552408, 109.47882845034109778, 97.393727246901107719, + 101.82473836571080028, 77.611588140032836236, 123.13207393060656614, 104.04164096882959711, + 83.519709445416083327, 78.996824871588614769, 70.467646288605465088, 69.924473229872091906, + 85.43188870595258777, 76.192642933274328243, 57.901909460455499357, 92.656729295187687967, + 91.996707704420259688, 44.885101156862219796, 92.114211816566239577, 92.709824415516777663, + 88.565937929211941082, 12.639791740810323972, 16.481630927457445068, 16.009153869472356746, + 26.133376234109164216, 98.329069968982366845, 35.673075631821120623, 20.812248178779555019, + 74.909567617996799527, 104.35897725134782377, 36.390093318623257801, 45.137490470577176893, + 38.627490617989678867, 118.517827012201451, 41.519137868424877524, 70.972601261481031543, + 99.739898314121091971, 32.279434760315780295, 53.302710492418555077, 52.708972378364705946, + 126.0372232403678936, 27.044183575155329891, 26.157087256931845332, 117.10332223424120457, + 23.049237655897741206, 55.412597877908410737, 82.335769432909728494, 32.187717205877561355, + 126.15152500885596965, 84.472035625392891234, 76.107215054486005101, 41.98497532726105419, + 38.608278001731378026, 86.394303217766719172, 127.158963557183597, 60.336356298736063763, + 116.51799999178547296, 18.295814660468749935, 16.906020125581562752, 49.162708217394538224, + 70.744718039539293386, 19.650173223300953396, 47.746591376351716463, 99.594561792742752004, + 57.034165828474215232, 74.057739147447136929, 126.93818286048917798, 47.068532588524249149, + 35.928326597877457971, 31.172468020835367497, 31.700427052815939533, 87.322199612561234972, + 75.886573437237530015, 125.88508061938773608, 95.855431138632411603, 93.032562445911025861, + 95.560263961109740194, 62.939490068900340702, 14.83181433022764395, 110.38159980475757038, + 10.742816973594017327, 35.499849323965463554, 25.224734317664115224, 86.790827321208780631, + 28.310425850890169386, 31.064072467201185646, 110.45319493153874646, 28.278941713688254822, + 77.731911279883206589, 70.255121797265019268, 56.164000607852358371, 50.761204695372725837, + 79.716680982350226259, 61.673728697580372682, 29.060957281206356129, 113.84568894491894753, + 120.96986138561260304, 53.366383318043517647, 88.680429796899261419, 25.76469067792640999, + 41.646661758779373486, 25.961314545838831691, 77.387901317582873162, 55.801441757583233994, + 105.66666316531700431, 53.773500978739320999, 50.411452004071179545, 87.441291593790083425, + 118.06001106717303628, 89.152395686349336756, 28.259092662847251631, 71.471395624164870242, + 53.446258557512919651, 60.468559652519616066, 12.981703948935319204, 87.598754625032597687, + 15.936873235812527128, 39.628074824715440627, 102.88463619984759134, 77.265470355254365131, + 45.736186095793527784, 119.53919534248416312, 49.259441797057661461, 74.773786725658283103, + 111.7345290190896776, 28.467978447763016447, 26.037463249929714948, 48.080203397414152278, + 106.99757933006912936, 71.565713060284906533, 56.526472885641851462, 95.682836617026623571, + 5.0052272813591116574, 74.594146601259126328, 65.880153901453013532, 23.528208116251335014, + 95.483137057930434821, 11.448974444501800463, 12.418915343045227928, 74.332868206038256176, + 85.019800914520601509, 95.141728436588891782, 77.636861930805025622, 68.298286980749253416, + 27.899139484976331005, 117.22391189732661587, 47.937102319297991926, 20.120831396652647527, + 39.759523286855255719, 15.62031006140387035, 74.010889006982324645, 27.189742040893179365, + 23.219315586204174906, 42.905964594483521068, 18.224511376443842892, 85.049082246168836718, + 124.9275337099461467, 40.351189249431627104, 68.937412964751274558, 8.3063684373846626841, + 50.843186403795698425, 87.764639790435467148, 82.263261987376608886, 114.44217476568155689, + 2.7026555965458101127, 20.77424465582225821, 14.010131867140444228, 86.502024981862632558, + 89.130196453490498243, 93.03597542122224695, 111.73270055453031091, 22.623635563755669864, + 82.213045744745613774, 72.168896578368730843, 63.148356687706836965, 37.952847493306762772, + 0.99638428227990516461, 21.437882290269044461, 67.412387941883935127, 76.358710366865125252, + 74.534059591922414256, 39.83073935478751082, 78.51397180607818882, 93.702076693862181855, + 84.187302528607688146, 82.431789832735375967, 76.708593737945193425, 20.677412185941648204, + 59.191559688555571483, 122.56277943352688453, 56.095605134498327971, 10.527811325187940383, + 76.483410419830761384, 101.89770370707628899, 34.110903765758848749, 65.193805311468167929, + 14.108352117913455004, 111.48487358454804053, 80.250706300179444952, 41.129166457452811301, + 31.371106659989891341, 118.76519859524341882, 66.783892338597070193, 75.38173733831717982, + 40.00782193855047808, 29.832639387732342584, 93.568082156129094074, 34.946908438625541748, + 72.400239122369384859, 3.6662380957641289569, 24.927603570875362493, 38.360561515579320258, + 15.272261312245973386, 12.984616979989368701, 70.125332629471813561, 80.481499750632792711, + 24.716914268476102734, 61.323905090204789303, 82.462550951564480783, 41.900704542968014721, + 8.3583343260070250835, 62.194721828593173996, 27.929662097438267665, 99.067840224801329896, + 1.7107863902565441094, 89.178733545377326664, 41.304606600158876972, 127.28018149243143853, + 119.80755534139825613, 66.010495793445443269, 10.896515075462957611, 33.86837162337906193, + 123.11802185037959134, 77.727792004396178527, 112.6158615110507526, 42.940069515174400294, + 56.227568142458039802, 53.880582564637734322, 2.272426190731493989, 21.228217014784604544, + 94.007200162992376136, 38.929545472979953047, 53.337867479982378427, 2.8171073016128502786, + 51.193587644134822767, 105.13321694542173645, 122.25151204884241452, 73.682828651217278093, + 126.85836221267163637, 100.17857042293326231, 45.112632275697251316, 83.67584751329923165, + 5.6452608130530279595, 28.122684160676726606, 80.674767794327635784, 98.85738848856635741, + 117.99107479943995713, 34.355922296446806286, 72.201233025793044362, 110.523430346747773, + 103.76962929502769839, 24.377619442810100736, 87.952540827627672115, 115.5877889236289775, + 98.569077025571459671, 76.065604317314864602, 9.1814502658708079252, 75.191366955550620332, + 64.080513805314694764, 3.4586351952784752939, 105.0359078753645008, 20.586289287868567044, + 86.010333206191717181, 84.179523926515685162, 9.6053991688240785152, 48.365862758306320757, + 118.26426353030910832, 18.859913991684152279, 16.982596528894646326, 119.49979352955415379, + 24.353532508386706468, 83.900043976704182569, 21.595015137008886086, 121.70623553213954438, + 23.811404910742567154, 116.36984291932458291, 46.207092980523157166, 101.31253808766268776, + 127.04711549172134255, 69.137945515958563192, 116.22399800030689221, 37.418770401734946063, + 94.37774419578636298, 61.662637749956047628, 45.383420853893767344, 89.522178254203026881, + 105.10391398064166424, 8.0931077702662150841, 120.64321541786921443, 32.798932876834442141, + 91.848612552479607984, 69.582850224342109868, 86.344824336549208965, 36.520829256551223807, + 61.526934293575322954, 40.802004821354785236, 96.212435664565418847, 41.307751347834710032, + 62.488705430085246917, 97.571972309469856555, 97.796179424090951215, 124.36802013164196978, + 96.470542225099052303, 17.593221037979674293, 110.58673974566772813, 46.675495389441493899, + 71.763930830227764091, 39.955685577264375752, 101.24244849586466444, 124.36719565780003904, + 127.7688730689624208, 108.18850927731909906, 107.89681120889872545, 110.80266489051427925, + 66.222003578899602871, 125.79942197511627455, 40.501396587453200482, 34.295521141928475117, + 75.08473064567806432, 67.261812233620730694, 51.940205099919694476, 122.62400805901779677, + 104.6670961294148583, 79.405073578043811722, 126.29641841819830006, 28.214585508299933281, + 40.677027786921826191, 45.014453160431003198, 72.56888934883318143, 86.175351059464446735, + 36.10481714025081601, 112.66008290561512695, 37.023422120706527494, 22.827039884501573397, + 69.03774758135114098, 63.20501303353739786, 41.44936808806960471, 33.221814698314119596, + 95.563191018874931615, 96.440400291536207078, 70.29942930144170532, 77.770792807550606085, + 1.1726393366407137364, 6.5982262101206288207, 81.216591952477756422, 17.496363994887360604, + 57.49813410793649382, 58.940722552972147241, 48.185284482126007788, 126.95009109412421822, + 19.213634697876841528, 120.44386030827809009, 118.75884335835144157, 28.178239386357745389, + 69.516525174301932566, 97.919540484079334419, 125.26232898308808217, 106.90475960871117422, + 18.270911319446895504, 89.916901904631231446, 52.081531425268622115, 13.31911013113494846, + 90.957656900685833534, 66.787454493805853417, 75.64947673142523854, 27.223176280069310451, + 118.26414786121677025, 80.083281937662832206, 39.039418890835804632, 29.993649743180867517, + 12.935292577214568155, 11.848946459747821791, 42.863777411908813519, 24.385285866548656486, + 115.80381892091463669, 57.313458590379013913, 55.993415408840519376, 89.77020231372807757, + 56.228423633136117132, 57.419648831037193304, 49.131875858423882164, 25.279583481620647945, + 32.963261854914890137, 32.018307738944713492, 52.26675246822196641, 68.65813993796473369, + 71.346151263642241247, 41.624496357562748017, 21.819135235997237032, 80.717954502695647534, + 72.780186637246515602, 90.274980941154353786, 77.254981235982995713, 109.035654024402902, + 83.038275736853393028, 13.945202522965701064, 71.479796628242183942, 64.55886952063156059, + 106.60542098483711015, 105.41794475673304987, 124.07444648073578719, 54.088367150310659781, + 52.314174513867328642, 106.20664446848240914, 46.098475311795482412, 110.82519575582045945, + 36.671538865819456987, 64.375434411758760689, 124.30305001771557727, 40.944071250785782468, + 24.214430108972010203, 83.96995065452210838, 77.216556003466394031, 44.788606435537076322, + 126.31792711436719401, 120.67271259747576551, 105.03599998357094591, 36.59162932093749987, + 33.812040251163125504, 98.325416434792714426, 13.489436079078586772, 39.300346446601906791, + 95.493182752707070904, 71.189123585485504009, 114.06833165695206844, 20.115478294897911837, + 125.87636572097835597, 94.137065177048498299, 71.856653195754915942, 62.344936041670734994, + 63.400854105635517044, 46.644399225126107922, 23.77314687447869801, 123.77016123877911014, + 63.710862277268461185, 58.065124891825689701, 63.120527922219480388, 125.8789801378006814, + 29.663628660458925879, 92.763199609515140764, 21.485633947188034654, 70.999698647930927109, + 50.449468635331868427, 45.581654642417561263, 56.620851701780338772, 62.12814493440600927, + 92.906389863077492919, 56.557883427380147623, 27.463822559770051157, 12.510243594530038536, + 112.32800121570471674, 101.52240939074908965, 31.433361964700452518, 123.34745739516074536, + 58.121914562416350236, 99.691377889841533033, 113.93972277122520609, 106.73276663609067327, + 49.360859593798522837, 51.529381355852819979, 83.293323517558746971, 51.922629091681301361, + 26.775802635165746324, 111.60288351517010597, 83.333326330634008627, 107.547001957478642, + 100.82290400814599707, 46.882583187583804829, 108.12002213434971054, 50.304791372698673513, + 56.518185325698141241, 14.942791248329740483, 106.8925171150258393, 120.93711930503923213, + 25.963407897874276387, 47.197509250065195374, 31.873746471625054255, 79.256149649434519233, + 77.769272399698820664, 26.530940710508730263, 91.472372191590693546, 111.07839068496832624, + 98.5188835941189609, 21.547573451320204185, 95.469058038179355208, 56.935956895526032895, + 52.074926499859429896, 96.160406794831942534, 85.995158660141896689, 15.131426120569813065, + 113.0529457712873409, 63.365673234053247143, 10.010454562721861294, 21.188293202521890635, + 3.7603078029060270637, 47.056416232506308006, 62.966274115860869642, 22.897948889003600925, + 24.837830686094093835, 20.66573641208015033, 42.039601829044840997, 62.283456873181421543, + 27.273723861613689223, 8.5965739614985068329, 55.798278969956299989, 106.44782379465323174, + 95.874204638595983852, 40.241662793305295054, 79.519046573710511439, 31.240620122811378678, + 20.02177801396464929, 54.379484081786358729, 46.438631172408349812, 85.811929188967042137, + 36.449022752891323762, 42.098164492341311416, 121.8550674198922934, 80.702378498866892187, + 9.8748259295025491156, 16.612736874769325368, 101.68637280759503483, 47.529279580874572275, + 36.52652397475685575, 100.88434953136311378, 5.4053111930916202255, 41.54848931164451642, + 28.020263734284526436, 45.004049963728903094, 50.260392906984634465, 58.07195084244813188, + 95.46540110906062182, 45.247271127514977707, 36.426091489494865527, 16.337793156737461686, + 126.29671337541367393, 75.905694986613525543, 1.9927685645598103292, 42.8757645805417269, + 6.8247758837715082336, 24.717420733733888483, 21.068119183844828513, 79.661478709578659618, + 29.027943612160015618, 59.40415338772800169, 40.37460505721901427, 36.863579665474389913, + 25.41718747589038685, 41.354824371883296408, 118.38311937711478095, 117.12555886705376906, + 112.19121026899665594, 21.055622650379518745, 24.966820839665160747, 75.795407414152577985, + 68.221807531521335477, 2.387610622936335858, 28.216704235830547987, 94.969747169099719031, + 32.501412600358889904, 82.258332914905622602, 62.742213319983420661, 109.53039719049047562, + 5.5677846771977783646, 22.763474676634359639, 80.015643877100956161, 59.665278775468323147, + 59.136164312258188147, 69.893816877254721476, 16.800478244738769718, 7.3324761915282579139, + 49.855207141750724986, 76.721123031158640515, 30.544522624491946772, 25.969233959982375382, + 12.250665258947265102, 32.962999501265585423, 49.433828536952205468, 122.64781018041321659, + 36.925101903128961567, 83.801409085936029442, 16.716668652014050167, 124.38944365718634799, + 55.859324194880173309, 70.135680449602659792, 3.4215727805167261977, 50.357467090754653327, + 82.609213200321391923, 126.56036298486651503, 111.61511068280015024, 4.0209915868908865377, + 21.793030150925915223, 67.736743246761761839, 118.23604370076282066, 27.455584008795995032, + 97.231723022101505194, 85.880139030348800588, 112.4551362849160796, 107.76116512927546864, + 4.544852381462987978, 42.456434029572847066, 60.014400325984752271, 77.859090945959906094, + 106.67573495996475685, 5.6342146032257005572, 102.38717528827328351, 82.266433890847110888, + 116.50302409768846701, 19.365657302438194165, 125.71672442534691072, 72.357140845866524614, + 90.225264551398140611, 39.351695026598463301, 11.290521626106055919, 56.24536832135709119, + 33.349535588658909546, 69.714776977136352798, 107.98214959887991427, 68.71184459289725055, + 16.402466051589726703, 93.046860693499183981, 79.53925859005539678, 48.755238885623839451, + 47.905081655258982209, 103.17557784726159298, 69.138154051146557322, 24.131208634629729204, + 18.362900531745253829, 22.382733911104878644, 0.16102761062938952819, 6.9172703905605885666, + 82.071815750729001593, 41.172578575740772067, 44.020666412387072342, 40.359047853031370323, + 19.21079833764815703, 96.731725516616279492, 108.52852706061821664, 37.719827983368304558, + 33.965193057792930631, 110.99958705910830759, 48.707065016777050914, 39.800087953408365138, + 43.19003027402141015, 115.41247106427908875, 47.622809821488772286, 104.73968583864916582, + 92.414185961049952311, 74.625076175329013495, 126.09423098344632308, 10.275891031920764362, + 104.44799600061378442, 74.837540803473530104, 60.755488391572725959, 123.32527549991209526, + 90.766841707791172666, 51.044356508409691742, 82.207827961283328477, 16.186215540536068147, + 113.28643083573842887, 65.59786575367252226, 55.697225104962853948, 11.165700448687857715, + 44.68964867309841793, 73.041658513102447614, 123.05386858715064591, 81.60400964271320845, + 64.424871329130837694, 82.615502695669420063, 124.97741086017413181, 67.143944618943351088, + 67.59235884818554041, 120.73604026328757755, 64.941084450198104605, 35.186442075962986564, + 93.17347949133545626, 93.350990778886625776, 15.527861660455528181, 79.911371154532389482, + 74.484896991732966853, 120.73439131560371607, 127.53774613792847958, 88.37701855464183609, + 87.793622417801088886, 93.605329781032196479, 4.4440071578028437216, 123.5988439502325491, + 81.002793174906400964, 68.591042283860588213, 22.169461291359766619, 6.5236244672414613888, + 103.88041019984302693, 117.24801611803923151, 81.334192258833354572, 30.810147156091261422, + 124.59283683639660012, 56.429171016599866562, 81.354055573843652382, 90.028906320865644375, + 17.137778697670000838, 44.350702118928893469, 72.209634280505269999, 97.320165811230253894, + 74.046844241413054988, 45.654079769006784773, 10.075495162702281959, 126.41002606707479572, + 82.898736176139209419, 66.443629396631877171, 63.126382037753501208, 64.880800583076052135, + 12.598858602887048619, 27.54158561510121217, 2.3452786732814274728, 13.19645242024489562, + 34.433183904955512844, 34.992727989774721209, 114.99626821587298764, 117.88144510594429448, + 96.370568964255653555, 125.90018218824843643, 38.427269395757321035, 112.88772061655981815, + 109.51768671670288313, 56.356478772719128756, 11.033050348607503111, 67.839080968162306817, + 122.52465796617980232, 85.809519217422348447, 36.541822638897428988, 51.833803809262462892, + 104.16306285053724423, 26.6382202622735349, 53.915313801375305047, 5.5749089876153448131, + 23.298953462850477081, 54.446352560142258881, 108.52829572243717848, 32.166563875325664412, + 78.078837781671609264, 59.987299486361735035, 25.87058515442913631, 23.697892919495643582, + 85.727554823817627039, 48.770571733100950951, 103.60763784182927338, 114.62691718075802783, + 111.98683081768467673, 51.54040462745615514, 112.45684726627223426, 114.83929766207438661, + 98.263751716847764328, 50.559166963241295889, 65.926523709829780273, 64.036615477889426984, + 104.5335049364475708, 9.3162798759331053589, 14.692302527284482494, 83.248992715125496034, + 43.638270471998112043, 33.435909005394933047, 17.560373274496669183, 52.549961882312345551, + 26.509962471969629405, 90.071308048809441971, 38.076551473706786055, 27.890405045935040107, + 14.959593256488005864, 1.117739041266759159, 85.210841969677858287, 82.835889513469737722, + 120.14889296147157438, 108.17673430062131956, 104.62834902773829526, 84.413288936964818276, + 92.196950623594602803, 93.650391511640918907, 73.343077731642551953, 0.75086882352115935646, + 120.60610003543115454, 81.888142501571564935, 48.428860217947658384, 39.939901309047854738, + 26.433112006932788063, 89.577212871077790624, 124.63585422873802599, 113.34542519495516899, + 82.07199996714189183, 73.183258641874999739, 67.624080502329888986, 68.650832869585428853, + 26.978872158157173544, 78.600692893207451561, 62.986365505417779787, 14.378247170974645996, + 100.13666331390413688, 40.230956589799461653, 123.75273144196034991, 60.274130354100634577, + 15.713306391509831883, 124.68987208334146999, 126.80170821127103409, 93.288798450252215844, + 47.546293748961033998, 119.54032247755822027, 127.42172455453692237, 116.1302497836513794, + 126.24105584444259875, 123.75796027560136281, 59.327257320921489736, 57.526399219030281529, + 42.971267894379707286, 13.999397295861854218, 100.89893727066373685, 91.163309284835122526, + 113.24170340356067754, 124.25628986881565652, 57.812779726154985838, 113.11576685476029525, + 54.927645119540102314, 25.02048718906371505, 96.656002431413071463, 75.044818781498179305, + 62.866723929404543014, 118.69491479032149073, 116.24382912483633845, 71.382755779686704045, + 99.879445542454050155, 85.465533272181346547, 98.721719187597045675, 103.05876271170927794, + 38.586647035117493942, 103.84525818336260272, 53.551605270335130626, 95.20576703034384991, + 38.666652661271655234, 87.094003914960921975, 73.645808016291994136, 93.765166375171247637, + 88.240044268699421082, 100.60958274539734703, 113.03637065139628248, 29.885582496663118945, + 85.785034230055316584, 113.87423861007846426, 51.926815795748552773, 94.395018500130390748, + 63.747492943253746489, 30.512299298872676445, 27.538544799397641327, 53.061881421021098504, + 54.944744383185025072, 94.15678136994029046, 69.0377671882379218, 43.095146902644046349, + 62.938116076358710416, 113.87191379105206579, 104.14985299972249777, 64.320813589667523047, + 43.990317320283793379, 30.262852241143264109, 98.105891542574681807, 126.73134646810649429, + 20.020909125443722587, 42.376586405043781269, 7.5206156058120541275, 94.112832465012616012, + 125.93254823172173928, 45.79589777800720185, 49.67566137218818767, 41.331472824160300661, + 84.079203658089681994, 124.56691374636284309, 54.547447723227378447, 17.193147922997013666, + 111.59655793991623796, 84.895647589310101466, 63.748409277191967703, 80.483325586614228087, + 31.038093147421022877, 62.481240245622757357, 40.04355602792929858, 108.75896816357271746, + 92.877262344820337603, 43.623858377934084274, 72.898045505782647524, 84.19632898468626081, + 115.71013483978822478, 33.404756997733784374, 19.749651859005098231, 33.225473749542288715, + 75.372745615190069657, 95.05855916174914455, 73.05304794951734948, 73.768699062726227567, + 10.810622386183240451, 83.096978623289032839, 56.040527468569052871, 90.008099927457806189, + 100.52078581396926893, 116.14390168489990174, 62.930802218121243641, 90.494542255029955413, + 72.852182978989731055, 32.675586313478561351, 124.59342675083098584, 23.811389973227051087, + 3.9855371291196206585, 85.751529161083453801, 13.649551767543016467, 49.434841467467776965, + 42.136238367693295004, 31.322957419157319237, 58.055887224320031237, 118.80830677545600338, + 80.74921011443802854, 73.727159330948779825, 50.834374951780773699, 82.709648743770230794, + 108.76623875423319987, 106.25111773411117611, 96.382420537993311882, 42.111245300759037491, + 49.933641679333959473, 23.590814828308793949, 8.443615063042670954, 4.7752212458726717159, + 56.433408471664733952, 61.939494338199438062, 65.002825200721417787, 36.516665829811245203, + 125.4844266399704793, 91.060794380980951246, 11.135569354395556729, 45.526949353272357257, + 32.031287754201912321, 119.33055755093664629, 118.27232862452001427, 11.787633754509442952, + 33.600956489477539435, 14.664952383056515828, 99.710414283505087951, 25.44224606231728103, + 61.089045248983893543, 51.938467919964750763, 24.501330517894530203, 65.925999002531170845, + 98.867657073908048915, 117.29562036082643317, 73.850203806261561112, 39.602818171872058883, + 33.433337304031738313, 120.77888731437269598, 111.7186483897639846, 12.271360899205319583, + 6.8431455610334523953, 100.71493418151294463, 37.218426400646421826, 125.12072596973666805, + 95.230221365600300487, 8.0419831737817730755, 43.586060301855468424, 7.4734864935271616559, + 108.47208740152564133, 54.911168017595628044, 66.463446044206648367, 43.760278060701239156, + 96.910272569835797185, 87.522330258550937288, 9.089704762925975956, 84.912868059145694133, + 120.02880065197314252, 27.718181891923450166, 85.351469919929513708, 11.268429206455039093, + 76.774350576550205005, 36.532867781697859755, 105.00604819537693402, 38.731314604880026309, + 123.43344885069745942, 16.714281691736687208, 52.450529102796281222, 78.703390053196926601, + 22.581043252212111838, 112.49073664271418238, 66.699071177321457071, 11.429553954276343575, + 87.964299197763466509, 9.4236891857945010997, 32.804932103183091385, 58.09372138700200594, + 31.078517180110793561, 97.510477771247678902, 95.810163310521602398, 78.351155694526823936, + 10.276308102293114644, 48.262417269259458408, 36.725801063490507659, 44.765467822209757287, + 0.32205522125877905637, 13.834540781124815112, 36.143631501458003186, 82.345157151481544133, + 88.041332824774144683, 80.718095706062740646, 38.421596675299952039, 65.463451033236196963, + 89.057054121236433275, 75.439655966736609116, 67.930386115589499241, 93.99917411821661517, + 97.414130033554101828, 79.600175906816730276, 86.38006054804645828, 102.8249421285581775, + 95.245619642981182551, 81.479371677301969612, 56.828371922103542602, 21.250152350661664968, + 124.18846196689264616, 20.551782063845166704, 80.895992001231206814, 21.675081606947060209, + 121.5109767831490899, 118.65055099982782849, 53.533683415582345333, 102.08871301682302146, + 36.415655922566656955, 32.372431081075774273, 98.572861671480495716, 3.1957315073450445198, + 111.3944502099257079, 22.331400897375715431, 89.379297346200473839, 18.083317026208533207, + 118.10773717430492979, 35.208019285430054879, 0.84974265826531336643, 37.231005391342478106, + 121.9548217203519016, 6.287889237890340155, 7.1847176963747187983, 113.47208052657879307, + 1.8821689003962092102, 70.372884151929611107, 58.346958982674550498, 58.701981557773251552, + 31.055723320914694341, 31.822742309068416944, 20.969793983469571685, 113.46878263121107011, + 127.07549227586059715, 48.754037109287310159, 47.587244835605815751, 59.210659562064392958, + 8.888014315609325422, 119.19768790046873619, 34.005586349816439906, 9.1820845677211764269, + 44.338922582719533239, 13.047248934486560756, 79.76082039968969184, 106.49603223608210101, + 34.668384517666709144, 61.620294312186160823, 121.18567367279320024, 112.8583420332033711, + 34.708111147690942744, 52.05781264173128875, 34.275557395340001676, 88.701404237861424917, + 16.419268561014177976, 66.640331622464145767, 20.093688482826109976, 91.308159538013569545, + 20.150990325408201898, 124.82005213415322942, 37.797472352282056818, 4.8872587932637543418, + 126.2527640755106404, 1.7616011661521042697, 25.197717205774097238, 55.08317123020242434, + 4.6905573465628549457, 26.392904840489791241, 68.866367809911025688, 69.985455979553080397, + 101.99253643174961326, 107.76289021189222694, 64.741137928514945088, 123.80036437649687286, + 76.85453879151828005, 97.775441233123274287, 91.035373433405766264, 112.71295754543825751, + 22.0661006972186442, 7.6781619363282516133, 117.04931593236324261, 43.619038434844696894, + 73.083645277794857975, 103.66760761852856376, 80.326125701074488461, 53.276440524547069799, + 107.83062760275061009, 11.149817975230689626, 46.597906925700954162, 108.89270512028815574, + 89.056591444874356966, 64.333127750654966803, 28.157675563343218528, 119.97459897272347007, + 51.74117030885827262, 47.395785838994925143, 43.455109647635254078, 97.54114346620553988, + 79.215275683662184747, 101.25383436151969363, 95.973661635369353462, 103.08080925491594826, + 96.913694532548106508, 101.67859532415241119, 68.527503433695528656, 101.11833392648622976, + 3.8530474196631985251, 0.073230955782491946593, 81.067009872895141598, 18.632559751866210718, + 29.384605054572602967, 38.497985430250992067, 87.276540943996224087, 66.871818010789866094, + 35.120746548993338365, 105.0999237646246911, 53.019924943942896789, 52.142616097618883941, + 76.15310294741357211, 55.780810091870080214, 29.919186512976011727, 2.2354780825371562969, + 42.421683939359354554, 37.671779026943113422, 112.29778592294678674, 88.353468601246277103, + 81.256698055480228504, 40.826577873933274532, 56.393901247192843584, 59.300783023285475792, + 18.686155463285103906, 1.5017376470459566917, 113.21220007086594705, 35.77628500314312987, + 96.857720435895316768, 79.879802618095709477, 52.866224013869214104, 51.154425742159219226, + 121.27170845747968997, 98.69085038991397596, 36.143999934287421638, 18.366517283753637457, + 7.2481610046634159517, 9.3016657391708577052, 53.957744316317985067, 29.201385786414903123, + 125.97273101083555957, 28.756494341952929972, 72.27332662780827377, 80.461913179602561286, + 119.50546288392069982, 120.54826070820126915, 31.426612783023301745, 121.37974416668657796, + 125.60341642254570615, 58.577596900504431687, 95.092587497925705975, 111.08064495512007852, + 126.84344910907748272, 104.26049956730639678, 124.48211168888883549, 119.51592055120272562, + 118.65451464184297947, 115.05279843806056306, 85.942535788759414572, 27.998794591727346415, + 73.797874541331111686, 54.32661856967388303, 98.483406807124993065, 120.51257973763131304, + 115.62555945231360965, 98.231533709520590492, 109.85529023908020463, 50.040974378131068079, + 65.312004862829780905, 22.089637562996358611, 125.73344785881272401, 109.38982958064661943, + 104.48765824967631488, 14.765511559377046069, 71.75889108491173829, 42.931066544366331073, + 69.443438375197729329, 78.117525423418555874, 77.173294070238625864, 79.690516366725205444, + 107.10321054067389923, 62.411534060687699821, 77.333305322546948446, 46.188007829925481929, + 19.29161603258762625, 59.530332750346133253, 48.480088537402480142, 73.21916549079833203, + 98.072741302792564966, 59.77116499332987587, 43.570068460114271147, 99.748477220156928524, + 103.85363159150074353, 60.790037000260781497, 127.49498588650749298, 61.02459859774535289, + 55.077089598795282654, 106.12376284204219701, 109.88948876637368812, 60.3135627398842189, + 10.075534376475843601, 86.190293805288092699, 125.87623215272105881, 99.743827582107769558, + 80.29970599944863352, 0.64162717933504609391, 87.980634640567586757, 60.525704482290166197, + 68.211783085153001593, 125.46269293621298857, 40.041818250887445174, 84.753172810087562539, + 15.041231211627746234, 60.225664930028870003, 123.86509646344347857, 91.591795556014403701, + 99.35132274437637534, 82.662945648324239301, 40.158407316183001967, 121.13382749272568617, + 109.09489544645475689, 34.38629584599766531, 95.193115879836113891, 41.791295178620202933, + 127.49681855438757339, 32.966651173228456173, 62.076186294842045754, 124.96248049124551471, + 80.087112055862235138, 89.517936327149072895, 57.754524689640675206, 87.247716755871806527, + 17.796091011568933027, 40.392657969376159599, 103.42026967957644956, 66.809513995467568748, + 39.499303718010196462, 66.450947499088215409, 22.745491230383777292, 62.11711832350192708, + 18.106095899038336938, 19.537398125452455133, 21.621244772370118881, 38.193957246578065678, + 112.08105493714174372, 52.016199854919250356, 73.041571627942175837, 104.28780336979980348, + 125.86160443624612526, 52.989084510063548805, 17.70436595797946211, 65.351172626960760681, + 121.18685350166197168, 47.622779946454102173, 7.9710742582428792957, 43.503058322166907601, + 27.299103535086032934, 98.869682934935553931, 84.272476735386590008, 62.645914838314638473, + 116.11177444864370045, 109.61661355091564474, 33.49842022887969506, 19.45431866189755965, + 101.66874990356518538, 37.419297487544099567, 89.532477508470037719, 84.502235468225990189, + 64.764841075986623764, 84.222490601518074982, 99.867283358667918947, 47.181629656617587898, + 16.887230126085341908, 9.5504424917453434318, 112.8668169433294679, 123.8789886764025141, + 2.0056504014428355731, 73.033331659626128385, 122.96885327994459658, 54.121588761961902492, + 22.271138708791113459, 91.053898706544714514, 64.062575508407462621, 110.66111510187693057, + 108.54465724904002855, 23.575267509018885903, 67.20191297895507887, 29.329904766116669634, + 71.420828567010175902, 50.88449212463456206, 122.17809049796778709, 103.87693583992950153, + 49.002661035792698385, 3.8519980050659796689, 69.735314147819735808, 106.59124072165650432, + 19.700407612523122225, 79.205636343744117767, 66.866674608067114605, 113.55777462874902994, + 95.437296779527969193, 24.542721798410639167, 13.68629112207054277, 73.429868363025889266, + 74.43685280129648163, 122.24145193947697408, 62.460442731200600974, 16.083966347563546151, + 87.172120603710936848, 14.946972987057961291, 88.944174803051282652, 109.82233603519489407, + 4.9268920884132967331, 87.52055612140611629, 65.820545139675232349, 47.044660517101874575, + 18.179409525855589891, 41.825736118295026245, 112.05760130394628504, 55.436363783850538312, + 42.702939839859027416, 22.536858412913716165, 25.548701153100410011, 73.065735563399357488, + 82.012096390753868036, 77.462629209763690596, 118.86689770139491884, 33.428563383473374415, + 104.90105820559620042, 29.406780106393853202, 45.162086504427861655, 96.98147328543200274, + 5.3981423546429141425, 22.859107908556325128, 47.928598395526933018, 18.847378371589002199, + 65.609864206366182771, 116.18744277400401188, 62.1570343602252251, 67.020955542498995783, + 63.620326621046842774, 28.702311389053647872, 20.552616204586229287, 96.524834538518916816, + 73.451602126981015317, 89.530935644419514574, 0.64411044251755811274, 27.669081562249630224, + 72.28726300291964435, 36.690314302966726245, 48.082665649551927345, 33.436191412125481293, + 76.843193350603542058, 2.926902066476031905, 50.114108242476504529, 22.879311933476856211, + 7.8607722311826364603, 59.998348236436868319, 66.828260067111841636, 31.20035181363709853, + 44.760121096096554538, 77.649884257119992981, 62.491239285966003081, 34.958743354603939224, + 113.6567438442070852, 42.500304701326967916, 120.37692393378529232, 41.103564127693971386, + 33.791984002462413628, 43.350163213897758396, 115.02195356630181777, 109.30110199965565698, + 107.06736683116832864, 76.177426033646042924, 72.831311845133313909, 64.744862162155186525, + 69.145723342960991431, 6.3914630146937270183, 94.788900419851415791, 44.66280179475506884, + 50.758594692400947679, 36.166634052420704393, 108.21547434860985959, 70.416038570860109758, + 1.6994853165306267329, 74.46201078268859419, 115.90964344070380321, 12.57577847578068031, + 14.369435392753075575, 98.944161053157586139, 3.7643378007960563991, 12.745768303859222215, + 116.693917965349101, 117.4039631155465031, 62.111446641829388682, 63.645484618136833888, + 41.93958796694278135, 98.937565262425778201, 126.15098455172119429, 97.508074218574620318, + 95.174489671211631503, 118.42131912412878592, 17.776028631222288823, 110.39537580093747238, + 68.011172699632879812, 18.364169135442352854, 88.677845165439066477, 26.094497868976759491, + 31.521640799383021658, 84.992064472164202016, 69.336769035333418287, 123.24058862437595963, + 114.37134734559003846, 97.716684066406742204, 69.416222295381885488, 104.1156252834625775, + 68.551114790683641331, 49.402808475722849835, 32.838537122031993931, 5.2806632449282915331, + 40.18737696565585793, 54.61631907602713909, 40.301980650820041774, 121.64010426830645883, + 75.594944704564113636, 9.7745175865311466623, 124.50552815102128079, 3.5232023323042085394, + 50.395434411548194475, 110.16634246040484868, 9.3811146931257098913, 52.78580968098322046, + 9.7327356198256893549, 11.970911959109798772, 75.985072863502864493, 87.525780423788091866, + 1.4822758570335281547, 119.60072875299738371, 25.709077583040198078, 67.550882466250186553, + 54.070746866815170506, 97.425915090876515023, 44.1322013944372884, 15.356323872660141205, + 106.09863186472648522, 87.238076869693031767, 18.167290555593353929, 79.335215237060765503, + 32.652251402148976922, 106.55288104909777758, 87.661255205501220189, 22.299635950461379252, + 93.195813851405546302, 89.785410240579949459, 50.113182889752351912, 0.66625550130993360654, + 56.315351126690075034, 111.94919794544694014, 103.48234061771654524, 94.791571677989850286, + 86.910219295274146134, 67.082286932414717739, 30.430551367328007473, 74.507668723043025238, + 63.947323270742344903, 78.161618509835534496, 65.827389065099850995, 75.357190648308460368, + 9.0550068673946952913, 74.236667852972459514, 7.7060948393263970502, 0.14646191156862187199, + 34.134019745790283196, 37.265119503732421435, 58.769210109145205934, 76.995970860505622113, + 46.553081887996086152, 5.7436360215797321871, 70.241493097990314709, 82.199847529249382205, + 106.03984988788579358, 104.28523219524140586, 24.30620589482714422, 111.56162018374016043, + 59.838373025952023454, 4.4709561650743125938, 84.843367878718709107, 75.343558053889864823, + 96.59557184589721146, 48.706937202496192185, 34.513396110960457008, 81.653155747866549063, + 112.78780249438568717, 118.60156604657095158, 37.372310926570207812, 3.0034752940955513623, + 98.424400141731894109, 71.552570006289897719, 65.715440871794271516, 31.759605236191418953, + 105.73244802773842821, 102.30885148432207643, 114.54341691496301792, 69.381700779827951919, + 72.287999868574843276, 36.733034567507274915, 14.496322009326831903, 18.60333147834171541, + 107.91548863263597013, 58.402771572833444225, 123.94546202167111915, 57.512988683909497922, + 16.546653255620185519, 32.92382635920876055, 111.01092576784503763, 113.09652141640253831, + 62.853225566050241468, 114.75948833337679389, 123.20683284509141231, 117.15519380101250135, + 62.185174995855049929, 94.161289910243795021, 125.68689821815860341, 80.520999134616431547, + 120.96422337778130895, 111.03184110240908922, 109.30902928368959692, 102.10559687612476409, + 43.885071577518829145, 55.997589183458330808, 19.595749082662223373, 108.65323713935140404, + 68.96681361425362411, 113.02515947526626405, 103.25111890463085729, 68.463067419044818962, + 91.710580478160409257, 100.08194875626577414, 2.6240097256595618092, 44.1792751259963552, + 123.46689571762908599, 90.779659161296876846, 80.975316499352629762, 29.531023118757730117, + 15.517782169823476579, 85.862133088736300124, 10.886876750399096636, 28.235050846840749728, + 26.346588140480889706, 31.381032733454048866, 86.206421081347798463, 124.82306812137903762, + 26.666610645093896892, 92.376015659850963857, 38.583232065175252501, 119.06066550069226651, + 96.960177074808598263, 18.438330981600302039, 68.145482605585129932, 119.54232998665975174, + 87.140136920232180273, 71.496954440317495028, 79.70726318300148705, 121.58007400052520097, + 126.98997177301498596, 122.04919719549070578, 110.15417919759420329, 84.247525684088031994, + 91.778977532747376245, 120.6271254797684378, 20.151068752955325181, 44.380587610579823377, + 123.7524643054457556, 71.487655164219177095, 32.59941199889726704, 1.2832543586737301666, + 47.961269281135173514, 121.05140896458397037, 8.4235661703096411657, 122.92538587242597714, + 80.083636501778528327, 41.506345620175125077, 30.082462423255492467, 120.45132986006137799, + 119.73019292689059512, 55.18359111203244538, 70.702645488756388659, 37.325891296648478601, + 80.316814632369641913, 114.26765498545501032, 90.189790892909513786, 68.772591691998968599, + 62.386231759672227781, 83.582590357244043844, 126.99363710877514677, 65.933302346456912346, + 124.15237258968772949, 121.92496098249466741, 32.174224111728108255, 51.03587265429814579, + 115.50904937928498839, 46.495433511743613053, 35.592182023137866054, 80.785315938755957177, + 78.840539359156537103, 5.6190279909351374954, 78.998607436024030903, 4.9018949981764308177, + 45.490982460767554585, 124.23423664700385416, 36.212191798076673876, 39.074796250904910266, + 43.242489544740237761, 76.387914493159769336, 96.162109874283487443, 104.03239970984213869, + 18.083143255887989653, 80.575606739603244932, 123.72320887249225052, 105.97816902012709761, + 35.408731915962562198, 2.7023452539251593407, 114.37370700332394335, 95.245559892908204347, + 15.942148516485758591, 87.006116644333815202, 54.598207070175703848, 69.73936586987474584, + 40.544953470773180015, 125.29182967663291492, 104.22354889729103888, 91.233227101831289474, + 66.996840457759390119, 38.908637323798757279, 75.337499807130370755, 74.838594975091837114, + 51.064955016943713417, 41.004470936455618357, 1.5296821519768855069, 40.444981203039787943, + 71.734566717335837893, 94.363259313235175796, 33.774460252170683816, 19.100884983494324842, + 97.733633886662573786, 119.7579773528050282, 4.011300802889309125, 18.066663319255894748, + 117.93770655988919316, 108.24317752392380498, 44.542277417585864896, 54.107797413093067007, + 0.12515101681856322102, 93.322230203757499112, 89.089314498080057092, 47.150535018041409785, + 6.4038259579101577401, 58.659809532236977248, 14.841657134020351805, 101.7689842492727621, + 116.35618099593921215, 79.753871679859003052, 98.00532207158539677, 7.7039960101355973165, + 11.470628295643109595, 85.18248144331300864, 39.400815225049882429, 30.411272687491873512, + 5.7333492161378671881, 99.115549257501697866, 62.874593559055938385, 49.085443596821278334, + 27.372582244144723518, 18.859736726055416511, 20.873705602596601238, 116.48290387895394815, + 124.92088546240120195, 32.167932695130730281, 46.344241207421873696, 29.89394597411956056, + 49.888349606106203282, 91.644672070389788132, 9.8537841768302314449, 47.041112242815870559, + 3.6410902793504646979, 94.08932103420374915, 36.358819051711179782, 83.651472236593690468, + 96.115202607892570086, 110.87272756770107662, 85.405879679718054831, 45.073716825827432331, + 51.097402306204458, 18.131471126802352956, 36.024192781511374051, 26.925258419531019172, + 109.73379540278983768, 66.857126766950386809, 81.802116411192400847, 58.813560212787706405, + 90.324173008859361289, 65.96294657086400548, 10.796284709285828285, 45.718215817112650257, + 95.857196791053866036, 37.694756743181642378, 3.21972841273600352, 104.37488554800802376, + 124.31406872045408818, 6.0419110849979915656, 127.24065324209368555, 57.404622778107295744, + 41.105232409176096553, 65.04966907704147161, 18.903204253965668613, 51.061871288839029148, + 1.2882208850351162255, 55.338163124502898427, 16.5745260058392887, 73.380628605933452491, + 96.16533129910385469, 66.872382824254600564, 25.686386701207084116, 5.8538041329520638101, + 100.22821648495300906, 45.758623866953712422, 15.721544462365272921, 119.99669647287737462, + 5.6565201342236832716, 62.400703627274197061, 89.520242192196747055, 27.299768514239985961, + 124.98247857193200616, 69.917486709211516427, 99.313487688414170407, 85.00060940265757381, + 112.75384786757058464, 82.207128255387942772, 67.583968004924827255, 86.700326427799154771, + 102.04390713260727352, 90.602203999314951943, 86.134733662340295268, 24.354852067295723828, + 17.662623690270265797, 1.489724324314011028, 10.291446685921982862, 12.782926029391092015, + 61.577800839702831581, 89.325603589510137681, 101.51718938480189536, 72.333268104845046764, + 88.430948697223357158, 12.832077141720219515, 3.3989706330648914445, 20.92402156538082636, + 103.81928688140760642, 25.15155695156136062, 28.73887078550978913, 69.888322106315172277, + 7.5286756015921127982, 25.491536607722082408, 105.38783593070183997, 106.80792623109300621, + 124.22289328365877736, 127.29096923627366778, 83.879175933889200678, 69.875130524855194381, + 124.30196910344602657, 67.016148437152878614, 62.348979342426900985, 108.84263824825757183, + 35.552057262448215624, 92.790751601878582733, 8.0223453992657596245, 36.728338270888343686, + 49.355690330878132954, 52.188995737953518983, 63.043281598769681295, 41.984128944332042011, + 10.673538070670474553, 118.48117724875555723, 100.74269469118371489, 67.433368132817122387, + 10.832444590767408954, 80.231250566928792978, 9.1022295813672826625, 98.805616951445699669, + 65.677074244063987862, 10.561326489856583066, 80.37475393131171586, 109.23263815205427818, + 80.603961301643721526, 115.28020853661655565, 23.189889409128227271, 19.549035173065931303, + 121.01105630204256158, 7.0464046646084170789, 100.79086882310002693, 92.33268492080969736, + 18.762229386251419783, 105.57161936196644092, 19.46547123965137871, 23.941823918223235523, + 23.970145727009366965, 47.051560847576183733, 2.9645517140706942882, 111.20145750599476742, + 51.418155166084034136, 7.1017649325003731064, 108.14149373363397899, 66.851830181753030047, + 88.2644027888745768, 30.71264774532392039, 84.197263729456608417, 46.476153739386063535, + 36.334581111190345837, 30.670430474121531006, 65.304502804301591823, 85.105762098199193133, + 47.322510411002440378, 44.599271900926396484, 58.391627702814730583, 51.570820481159898918, + 100.22636577950470382, 1.3325110026198672131, 112.63070225338378805, 95.898395890897518257, + 78.964681235436728457, 61.583143355983338552, 45.820438590551930247, 6.1645738648294354789, + 60.861102734659652924, 21.015337446086050477, 127.89464654148832778, 28.323237019674706971, + 3.6547781302033399697, 22.714381296616920736, 18.110013734793028561, 20.473335705944919027, + 15.4121896786527941, 0.29292382313724374399, 68.268039491580566391, 74.530239007464842871, + 117.53842021829404985, 25.991941721011244226, 93.106163775992172305, 11.487272043163102353, + 12.482986195984267397, 36.399695058502402389, 84.079699775775225135, 80.570464390482811723, + 48.61241178965792642, 95.123240367480320856, 119.67674605190404691, 8.9419123301522631664, + 41.686735757441056194, 22.687116107783367625, 65.191143691794422921, 97.41387440499238437, + 69.026792221924551995, 35.306311495736736106, 97.575604988775012316, 109.20313209314190317, + 74.744621853140415624, 6.0069505881947407033, 68.848800283467426198, 15.105140012583433418, + 3.4308817435885430314, 63.519210472386475885, 83.464896055480494397, 76.61770296864779084, + 101.08683382992967381, 10.763401559659541817, 16.575999737149686553, 73.466069135014549829, + 28.992644018653663807, 37.2066629566870688, 87.830977265271940269, 116.80554314567052643, + 119.89092404334223829, 115.02597736781899584, 33.093306511240371037, 65.847652718421159079, + 94.021851535693713231, 98.193042832805076614, 125.70645113210412092, 101.51897666675722576, + 118.4136656901864626, 106.31038760202500271, 124.37034999171373784, 60.32257982049122802, + 123.3737964363208448, 33.041998269236501073, 113.92844675556625589, 94.063682204821816413, + 90.618058567382831825, 76.211193752249528188, 87.770143155037658289, 111.99517836691666162, + 39.191498165328084724, 89.306474278706446057, 9.9336272285108861979, 98.050318950536166085, + 78.502237809265352553, 8.9261348380932759028, 55.421160956324456492, 72.163897512531548273, + 5.2480194513191236183, 88.358550251996348379, 118.93379143526180997, 53.559318322597391671, + 33.950632998705259524, 59.062046237515460234, 31.035564339650591137, 43.724266177472600248, + 21.773753500798193272, 56.470101693681499455, 52.693176280961779412, 62.762065466911735712, + 44.412842162699234905, 121.64613624275807524, 53.333221290191431763, 56.752031319701927714, + 77.166464130354142981, 110.12133100138817099, 65.920354149617196526, 36.876661963204242056, + 8.2909652111738978419, 111.08465997332314146, 46.280273840467998525, 14.993908880638628034, + 31.414526366006612079, 115.16014800105403992, 125.97994354603360989, 116.09839439098504954, + 92.308358395192044554, 40.495051368179701967, 55.557955065498390468, 113.2542509595368756, + 40.302137505910650361, 88.761175221163284732, 119.50492861089514918, 14.97531032843835419, + 65.19882399779453408, 2.5665087173474603333, 95.922538562273985008, 114.10281792916794075, + 16.84713234062292031, 117.85077174485559226, 32.167273003557056654, 83.012691240350250155, + 60.164924846514622914, 112.90265972012639395, 111.46038585378119024, 110.36718222406852874, + 13.405290977512777317, 74.651782593300595181, 32.633629264742921805, 100.53530997091365862, + 52.379581785822665552, 9.5451833839979371987, 124.77246351934809354, 39.165180714491725666, + 125.98727421755393152, 3.8666046929174626712, 120.30474517937909695, 115.84992196498933481, + 64.34844822345621651, 102.07174530859992956, 103.01809875856997678, 92.990867023487226106, + 71.184364046279370086, 33.570631877515552333, 29.681078718313074205, 11.23805598187391297, + 29.997214872048061807, 9.8037899963528616354, 90.981964921538747149, 120.46847329400770832, + 72.424383596153347753, 78.149592501809820533, 86.484979089484113501, 24.77582898632317665, + 64.324219748570612865, 80.064799419684277382, 36.166286511779617285, 33.151213479210127844, + 119.44641774498813902, 83.956338040254195221, 70.817463831925124396, 5.4046905078539566603, + 100.74741400665152469, 62.491119785816408694, 31.884297032975155162, 46.012233288667630404, + 109.19641414035504567, 11.47873173974949168, 81.08990694154999801, 122.58365935326946783, + 80.447097794585715747, 54.466454203666216927, 5.9936809155187802389, 77.817274647601152537, + 22.674999614264379488, 21.677189950183674227, 102.12991003388742683, 82.008941872911236715, + 3.0593643039537710138, 80.889962406083213864, 15.469133434675313765, 60.726518626470351592, + 67.548920504341367632, 38.201769966992287664, 67.467267773328785552, 111.51595470561005641, + 8.02260160577861825, 36.133326638515427476, 107.8754131197820243, 88.486355047847609967, + 89.084554835171729792, 108.21559482618613401, 0.25030203364076442085, 58.644460407518636202, + 50.178628996160114184, 94.30107003608281957, 12.80765191582031548, 117.3196190644739545, + 29.683314268044341588, 75.537968498549162177, 104.71236199188206228, 31.507743359721644083, + 68.010644143170793541, 15.407992020271194633, 22.94125659128985717, 42.36496288662601728, + 78.801630450099764857, 60.822545374983747024, 11.466698432279372355, 70.231098515003395732, + 125.74918711811187677, 98.170887193642556667, 54.745164488289447036, 37.719473452110833023, + 41.747411205196840456, 104.96580775791153428, 121.8417709248024039, 64.335865390261460561, + 92.688482414843747392, 59.78789194823912112, 99.776699212216044543, 55.289344140779576264, + 19.70756835366046289, 94.082224485631741118, 7.2821805587045673747, 60.1786420684074983, + 72.717638103425997542, 39.302944473191018915, 64.23040521578877815, 93.745455135405791225, + 42.811759359436109662, 90.147433651654864661, 102.194804612408916, 36.262942253604705911, + 72.048385563022748102, 53.850516839065676322, 91.46759080558331334, 5.7142535339044115972, + 35.604232822384801693, 117.62712042557905079, 52.648346017722360557, 3.9258931417280109599, + 21.59256941857165657, 91.436431634228938492, 63.714393582107732072, 75.389513486363284755, + 6.4394568254756450187, 80.749771096019685501, 120.62813744090817636, 12.08382216999962111, + 126.4813064841873711, 114.80924555621459149, 82.210464818355831085, 2.0993381540829432197, + 37.806408507931337226, 102.1237425776780583, 2.576441770070232451, 110.67632624900579685, + 33.14905201168221538, 18.76125721187054296, 64.330662598211347358, 5.744765648509201128, + 51.372773402414168231, 11.707608265907765599, 72.456432969906018116, 91.517247733907424845, + 31.44308892473418382, 111.99339294575474923, 11.313040268447366543, 124.8014072545520321, + 51.040484384393494111, 54.599537028483609902, 121.9649571438676503, 11.834973418426670833, + 70.626975376831978792, 42.001218805318785599, 97.507695735144807259, 36.414256510779523524, + 7.1679360098532924894, 45.400652855601947522, 76.087814265218185028, 53.204407998633541865, + 44.269467324680590536, 48.709704134591447655, 35.325247380540531594, 2.9794486486280220561, + 20.582893371843965724, 25.565852058782184031, 123.15560167940930114, 50.651207179023913341, + 75.034378769607428694, 16.666536209693731507, 48.861897394446714316, 25.664154283440439031, + 6.797941266129782889, 41.848043130765290698, 79.638573762815212831, 50.30311390312272124, + 57.477741571023216238, 11.776644212630344555, 15.057351203184225596, 50.983073215447802795, + 82.77567186140731792, 85.615852462189650396, 120.44578656732119271, 126.58193847255097353, + 39.758351867782039335, 11.75026104971402674, 120.60393820689569111, 6.0322968743057572283, + 124.69795868485743995, 89.685276496515143663, 71.104114524900069227, 57.581503203757165466, + 16.044690798531519249, 73.456676541776687372, 98.711380661756265908, 104.37799147590703797, + 126.08656319753936259, 83.968257888664084021, 21.347076141344587086, 108.96235449751475244, + 73.485389382371067768, 6.8667362656342447735, 21.664889181538455887, 32.462501133857585955, + 18.204459162738203304, 69.611233902895037318, 3.3541484881279757246, 21.122652979716804111, + 32.749507862627069699, 90.465276304112194339, 33.207922603291081032, 102.5604170732331113, + 46.379778818256454542, 39.098070346135500586, 114.02211260408512317, 14.092809329220472137, + 73.581737646203691838, 56.66536984161939472, 37.524458772506477544, 83.14323872393288184, + 38.93094247930275742, 47.883647836446471047, 47.94029145401873393, 94.103121695152367465, + 5.9291034281450265553, 94.402915011989534833, 102.83631033216806827, 14.203529865004384192, + 88.28298746727159596, 5.7036603635096980724, 48.528805577749153599, 61.425295490651478758, + 40.394527458913216833, 92.95230747877212707, 72.669162222380691674, 61.340860948246699991, + 2.6090056086068216246, 42.211524196398386266, 94.645020822004880756, 89.198543801852792967, + 116.78325540562946117, 103.14164096232343582, 72.452731559009407647, 2.6650220052433724049, + 97.261404506771214074, 63.796791781798674492, 29.929362470873456914, 123.1662867119666771, + 91.640877181103860494, 12.329147729658870958, 121.72220546931930585, 42.030674892175738933, + 127.78929308297665557, 56.646474039349413943, 7.3095562604066799395, 45.428762593233841471, + 36.220027469586057123, 40.946671411889838055, 30.824379357305588201, 0.58584764627812546678, + 8.5360789831647707615, 21.06047801493332372, 107.07684043658809969, 51.983883442026126431, + 58.212327551984344609, 22.974544086326204706, 24.965972391968534794, 72.799390117008442758, + 40.159399551554088248, 33.140928780965623446, 97.224823579319490818, 62.246480734964279691, + 111.35349210380809382, 17.883824660304526333, 83.373471514882112388, 45.374232215570373228, + 2.3822873835924838204, 66.82774880998840672, 10.053584443849103991, 70.61262299147711019, + 67.151209977553662611, 90.406264186287444318, 21.489243706280831248, 12.013901176393119385, + 9.6976005669348523952, 30.210280025170504814, 6.8617634871770860627, 127.03842094477658975, + 38.929792110964626772, 25.235405937299219659, 74.173667659859347623, 21.526803119319083635, + 33.151999474303011084, 18.932138270029099658, 57.985288037307327613, 74.413325913377775578, + 47.661954530547518516, 105.61108629134469084, 111.78184808668811456, 102.05195473563799169, + 66.186613022484380053, 3.6953054368459561374, 60.043703071391064441, 68.386085665613791207, + 123.41290226421187981, 75.037953333518089494, 108.82733138037656317, 84.620775204053643392, + 120.74069998342747567, 120.64515964098609402, 118.74759287264168961, 66.083996538476640126, + 99.856893511136149755, 60.127364409647270804, 53.236117134769301629, 24.422387504502694355, + 47.540286310078954557, 95.990356733833323233, 78.382996330659807427, 50.612948557412892114, + 19.867254457025410375, 68.100637901075970149, 29.004475618530705106, 17.852269676186551806, + 110.84232191265255096, 16.327795025063096546, 10.496038902641885215, 48.717100503996334737, + 109.86758287052361993, 107.11863664519478334, 67.901265997410519049, 118.12409247503092047, + 62.071128679301182274, 87.448532354945200495, 43.547507001596386544, 112.94020338736299891, + 105.38635256192355882, 125.52413093382347142, 88.825684325402107788, 115.29227248551615048, + 106.66644258038286353, 113.50406263940749341, 26.33292826071192394, 92.242662002779979957, + 3.8407082992343930528, 73.753323926408484112, 16.581930422351433663, 94.169319946646282915, + 92.56054768093599705, 29.987817761277256068, 62.829052732016862137, 102.32029600211171783, + 123.95988709207085776, 104.19678878197373706, 56.616716790384089109, 80.990102736359403934, + 111.11591013100041891, 98.508501919073751196, 80.604275011824938701, 49.522350442330207443, + 111.00985722179029835, 29.95062065688034636, 2.3976479955890681595, 5.1330174346985586453, + 63.845077124551607994, 100.20563585833588149, 33.694264681249478599, 107.70154348971118452, + 64.334546007117751287, 38.025382480700500309, 120.32984969303288381, 97.805319440256425878, + 94.920771707566018449, 92.734364448137057479, 26.810581955029192613, 21.303565186601190362, + 65.267258529489481589, 73.070619941827317234, 104.7591635716453311, 19.090366767999512376, + 121.54492703869618708, 78.330361428987089312, 123.97454843510786304, 7.7332093858385633212, + 112.60949035876183189, 103.6998439299823076, 0.69689644691607099958, 76.143490617203497095, + 78.03619751714359154, 57.981734046978090191, 14.368728092558740173, 67.141263755031104665, + 59.36215743662614841, 22.476111963747825939, 59.994429744096123613, 19.60757999270936125, + 53.963929843081132276, 112.93694658801905462, 16.848767192310333485, 28.299185003623279044, + 44.969958178968227003, 49.551657972649991279, 0.64843949714486370794, 32.129598839368554763, + 72.332573023559234571, 66.302426958423893666, 110.89283548997991602, 39.91267608051202842, + 13.634927663850248791, 10.809381015711551299, 73.494828013303049374, 124.98223957163281739, + 63.768594065950310323, 92.024466577338898787, 90.392828280710091349, 22.95746347950262134, + 34.179813883103633998, 117.16731870654257364, 32.894195589171431493, 108.93290840733243385, + 11.987361831041198457, 27.634549295202305075, 45.349999228528758977, 43.354379900370986434, + 76.259820067778491648, 36.017883745822473429, 6.1187286079111800063, 33.779924812166427728, + 30.93826686935062753, 121.45303725294434116, 7.0978410086827352643, 76.403539933988213306, + 6.9345355466612090822, 95.031909411220112815, 16.0452032115572365, 72.26665327703449293, + 87.750826239567686571, 48.972710095698857913, 50.169109670347097563, 88.431189652372268029, + 0.5006040672815288417, 117.2889208150372724, 100.35725799232386635, 60.60214007216563914, + 25.615303831644268939, 106.63923812894790899, 59.366628536092321156, 23.075936997101962334, + 81.424723983764124569, 63.015486719446926145, 8.0212882863415870816, 30.815984040542389266, + 45.882513182579714339, 84.729925773255672539, 29.603260900199529715, 121.64509074996749405, + 22.933396864562382689, 12.462197030010429444, 123.49837423622739152, 68.341774387285113335, + 109.49032897657889407, 75.438946904221666045, 83.49482241039731889, 81.931615515826706542, + 115.68354184960844577, 0.67173078052655910142, 57.376964829687494785, 119.57578389648188022, + 71.553398424432089087, 110.57868828155915253, 39.415136707324563758, 60.164448971263482235, + 14.564361117409134749, 120.35728413681863458, 17.435276206851995084, 78.605888946385675808, + 0.46081043158119427972, 59.49091027081158245, 85.623518718875857303, 52.294867303313367302, + 76.389609224817832001, 72.525884507213049801, 16.096771126045496203, 107.70103367813499062, + 54.935181611166626681, 11.428507067808823194, 71.208465644773241365, 107.25424085115810158, + 105.29669203544472111, 7.8517862834560219198, 43.185138837146951118, 54.872863268457876984, + 127.42878716421910212, 22.779026972726569511, 12.878913650954928016, 33.499542192043008981, + 113.25627488181635272, 24.167644340002880199, 124.96261296837838017, 101.61849111243282096, + 36.42092963671166217, 4.1986763081658864394, 75.612817015866312431, 76.247485155356116593, + 5.1528835401441028807, 93.352652498011593707, 66.298104023364430759, 37.522514423744723899, + 0.6613251964226947166, 11.489531297018402256, 102.74554680482833646, 23.415216531819169177, + 16.91286593981567421, 55.03449546781484969, 62.886177849472005619, 95.98678589150949847, + 22.626080536898371065, 121.6028145091040642, 102.08096876878698822, 109.19907405697085778, + 115.9299142877353006, 23.669946836856979644, 13.253950753663957585, 84.002437610641209176, + 67.015391470289614517, 72.828513021559047047, 14.335872019706584979, 90.801305711207533022, + 24.175628530436370056, 106.40881599726708373, 88.538934649361181073, 97.41940826918289531, + 70.650494761081063189, 5.9588972972560441121, 41.165786743687931448, 51.131704117568006041, + 118.31120335881860228, 101.30241435805146466, 22.068757539214857388, 33.333072419387463015, + 97.723794788893428631, 51.328308566880878061, 13.595882532259565778, 83.696086261534219375, + 31.277147525630425662, 100.60622780624544248, 114.95548314204643248, 23.55328842526068911, + 30.114702406368451193, 101.96614643089924357, 37.551343722818273818, 43.231704924382938771, + 112.89157313464602339, 125.16387694510194706, 79.51670373556407867, 23.500522099431691458, + 113.20787641379138222, 12.064593748615152435, 121.39591736971851788, 51.370552993033925304, + 14.208229049800138455, 115.16300640751433093, 32.089381597066676477, 18.913353083557012724, + 69.422761323516169796, 80.755982951817713911, 124.17312639508236316, 39.936515777328168042, + 42.69415228269281215, 89.924708995033142855, 18.970778764742135536, 13.733472531268489547, + 43.329778363076911774, 64.925002267715171911, 36.408918325480044587, 11.222467805790074635, + 6.7082969762559514493, 42.245305959433608223, 65.499015725257777376, 52.930552608224388678, + 66.415845206585800042, 77.120834146466222592, 92.759557636512909085, 78.19614069227463915, + 100.04422520817024633, 28.185618658444582252, 19.163475292407383677, 113.33073968323878944, + 75.048917545016593067, 38.286477447865763679, 77.861884958605514839, 95.767295672892942093, + 95.880582908041105838, 60.20624339030473493, 11.858206856293691089, 60.805830023982707644, + 77.672620664336136542, 28.407059730012406362, 48.565974934543191921, 11.407320727019396145, + 97.057611155498307198, 122.85059098130295752, 80.789054917830071645, 57.904614957547892118, + 17.338324444761383347, 122.68172189649339998, 5.2180112172136432491, 84.423048392800410511, + 61.290041644013399491, 50.397087603709223913, 105.56651081126256031, 78.283281924650509609, + 16.905463118018815294, 5.3300440104903827887, 66.522809013542428147, 127.59358356359734898, + 59.858724941750551807, 118.33257342393699219, 55.281754362207720987, 24.658295459321379894, + 115.4444109386386117, 84.061349784355115844, 127.57858616595331114, 113.29294807869882789, + 14.619112520813359879, 90.857525186467682943, 72.440054939172114246, 81.89334282377967611, + 61.648758714611176401, 1.1716952925562509336, 17.072157966329541523, 42.12095602987028542, + 86.153680873176199384, 103.96776688405225286, 116.42465510396868922, 45.949088172652409412, + 49.931944783940707566, 17.598780234016885515, 80.318799103108176496, 66.28185756193488487, + 66.449647158638981637, 124.49296146993219736, 94.706984207616187632, 35.767649320612690644, + 38.746943029764224775, 90.748464431140746456, 4.7645747671886056196, 5.6554976199768134393, + 20.107168887701845961, 13.225245982957858359, 6.3024199551109632012, 52.812528372574888635, + 42.978487412561662495, 24.027802352786238771, 19.39520113386970479, 60.420560050344647607, + 13.723526974357810104, 126.0768418895531795, 77.859584221929253545, 50.470811874602077296, + 20.347335319718695246, 43.05360623863816727, 66.303998948606022168, 37.864276540058199316, + 115.97057607461829321, 20.826651826755551156, 95.323909061098675011, 83.222172582693019649, + 95.563696173379867105, 76.103909471279621357, 4.3732260449687601067, 7.3906108736919122748, + 120.08740614278576686, 8.7721713312312203925, 118.8258045284273976, 22.075906667039816966, + 89.654662760756764328, 41.241550408110924764, 113.48139996685858932, 113.29031928197582602, + 109.4951857452870172, 4.1679930769569182303, 71.713787022272299509, 120.25472881929454161, + 106.47223426953860326, 48.844775009005388711, 95.080572620161547093, 63.980713467670284444, + 28.765992661319614854, 101.22589711482578423, 39.734508914054458728, 8.2012758021519402973, + 58.008951237061410211, 35.70453935237674159, 93.684643825305101927, 32.655590050126193091, + 20.992077805283770431, 97.434201007996307453, 91.735165741050877841, 86.237273290393204661, + 7.802531994824676076, 108.24818495006184094, 124.14225735860600253, 46.897064709890400991, + 87.095014003196411068, 97.880406774729635799, 82.772705123850755626, 123.04826186765058083, + 49.651368650807853555, 102.58454497103593894, 85.332885160769365029, 99.008125278814986814, + 52.665856521427485859, 56.485324005559959915, 7.6814165984724240843, 19.506647852816968225, + 33.163860844706505304, 60.338639893296203809, 57.121095361871994101, 59.975635522554512136, + 125.65810546403736225, 76.64059200422707363, 119.9197741841453535, 80.393577563947474118, + 113.2334335807718162, 33.980205472722445847, 94.231820262004475808, 69.017003838151140371, + 33.208550023649877403, 99.044700884664052865, 94.019714443580596708, 59.901241313760692719, + 4.7952959911781363189, 10.266034869397117291, 127.69015424910685397, 72.411271716671762988, + 67.388529362502595177, 87.403086979426007019, 0.66909201423550257459, 76.050764961404638598, + 112.65969938606940559, 67.610638880516489735, 61.841543415135674877, 57.468728896274114959, + 53.621163910058385227, 42.607130373206018703, 2.5345170589826011565, 18.141239883658272447, + 81.518327143290662207, 38.180733536002662731, 115.08985407739601214, 28.660722857977816602, + 119.94909687021572609, 15.466418771680764621, 97.218980717527301749, 79.3996878599646152, + 1.393792893835779978, 24.286981234410632169, 28.07239503428718308, 115.96346809395618038, + 28.737456185121118324, 6.2825275100622093305, 118.72431487325229682, 44.952223927495651878, + 119.98885948819224723, 39.215159985418722499, 107.92785968616590253, 97.873893176038109232, + 33.69753438462066697, 56.598370007246558089, 89.939916357936454006, 99.103315945299982559, + 1.2968789942897274159, 64.259197678740747506, 16.66514604712210712, 4.6048539168514253106, + 93.785670979959832039, 79.825352161024056841, 27.269855327700497583, 21.618762031426740577, + 18.989656026609736728, 121.96447914326563478, 127.53718813190425863, 56.048933154681435553, + 52.785656561420182697, 45.914926959005242679, 68.359627766210905975, 106.33463741308514727, + 65.788391178346500965, 89.865816814664867707, 23.974723662082396913, 55.26909859040461015, + 90.699998457057517953, 86.708759800745610846, 24.519640135556983296, 72.035767491644946858, + 12.237457215822360013, 67.559849624332855456, 61.87653373870489304, 114.90607450588868232, + 14.195682017369108507, 24.807079867976426613, 13.869071093326056143, 62.063818822440225631, + 32.090406423118110979, 16.53330655407262384, 47.501652479135373142, 97.945420191397715826, + 100.3382193406978331, 48.862379304744536057, 1.0012081345666956622, 106.57784163007818279, + 72.714515984647732694, 121.20428014433127828, 51.230607663292175857, 85.27847625789581798, + 118.73325707218464231, 46.151873994207562646, 34.849447967528249137, 126.03097343889385229, + 16.042576572683174163, 61.631968081084778532, 91.765026365163066657, 41.459851546511345077, + 59.206521800402697409, 115.2901814999349881, 45.866793729124765377, 24.924394060024496866, + 118.99674847245842102, 8.6835487745738646481, 90.980657953161426121, 22.87789380844697007, + 38.989644820798275759, 35.863231031657051062, 103.36708369921689155, 1.3434615610531182028, + 114.75392965937862755, 111.15156779296739842, 15.106796848867816152, 93.157376563118305057, + 78.830273414649127517, 120.32889794252696447, 29.128722234821907477, 112.71456827363726916, + 34.870552413707628148, 29.211777892771351617, 0.92162086316238855943, 118.98182054162680288, + 43.247037437751714606, 104.58973460663037258, 24.77921844963930198, 17.051769014426099602, + 32.193542252094630385, 87.402067356269981246, 109.87036322233325336, 22.857014135621284368, + 14.416931289550120709, 86.508481702319841133, 82.593384070889442228, 15.70357256691204384, + 86.370277674293902237, 109.74572653691939195, 126.85757432843820425, 45.558053945453139022, + 25.757827301909856033, 66.999084384089655941, 98.512549763632705435, 48.335288680009398377, + 121.92522593676039833, 75.236982224865641911, 72.841859273423324339, 8.3973526163354108576, + 23.225634031736262841, 24.494970310712233186, 10.30576708029184374, 58.705304996026825393, + 4.5962080467288615182, 75.045028847489447799, 1.3226503928453894332, 22.979062594040442491, + 77.491093609656672925, 46.830433063638338353, 33.82573187963134842, 110.06899093562969938, + 125.77235569894764922, 63.973571783018996939, 45.252161073800380109, 115.20562901821176638, + 76.161937537577614421, 90.398148113945353543, 103.85982857547060121, 47.339893673713959288, + 26.507901507331553148, 40.00487522128605633, 6.0307829405828670133, 17.657026043118094094, + 28.671744039416807937, 53.602611422415066045, 48.351257060876378091, 84.81763199453780544, + 49.077869298726000125, 66.838816538369428599, 13.300989522162126377, 11.917794594512088224, + 82.331573487375862896, 102.26340823513965006, 108.62240671764084254, 74.60482871610292932, + 44.137515078429714777, 66.666144838778564008, 67.447589577786857262, 102.65661713376175612, + 27.191765064522769535, 39.39217252306843875, 62.554295051264489302, 73.212455612494522939, + 101.91096628409286495, 47.106576850521378219, 60.229404812740540365, 75.932292861798487138, + 75.102687445636547636, 86.46340984876951552, 97.78314626929568476, 122.32775389020753209, + 31.03340747112815734, 47.001044198867020896, 98.415752827582764439, 24.12918749723394285, + 114.79183473943703575, 102.74110598606785061, 28.416458099603914889, 102.32601281502866186, + 64.178763194133352954, 37.826706167117663426, 10.84552264703597757, 33.5119659036390658, + 120.34625279016472632, 79.873031554656336084, 85.388304565389262279, 51.849417990066285711, + 37.941557529484271072, 27.466945062536979094, 86.659556726157461526, 1.8500045354303438216, + 72.817836650960089173, 22.444935611580149271, 13.416593952511902899, 84.490611918870854424, + 2.9980314505155547522, 105.86110521645241533, 4.8316904131752380636, 26.241668292936083162, + 57.519115273029456148, 28.392281384552916279, 72.088450416340492666, 56.371237316889164504, + 38.326950584818405332, 98.661479366481216857, 22.097835090033186134, 76.572954895735165337, + 27.723769917214667657, 63.534591345789522165, 63.761165816082211677, 120.41248678060946986, + 23.716413712587382179, 121.61166004796905327, 27.345241328672273085, 56.814119460024812724, + 97.131949869086383842, 22.814641454042430269, 66.115222311000252375, 117.70118196260955301, + 33.57810983566014329, 115.80922991509578424, 34.676648889526404673, 117.36344379298679996, + 10.436022434430924477, 40.846096785600821022, 122.58008328802679898, 100.7941752074220858, + 83.133021622528758598, 28.566563849301019218, 33.810926236037630588, 10.660088020984403556, + 5.0456180270884942729, 127.18716712719469797, 119.71744988350474159, 108.66514684787398437, + 110.56350872441544197, 49.316590918646397768, 102.88882187728086137, 40.122699568713869667, + 127.15717233191026025, 98.58589615739765577, 29.238225041630357737, 53.715050372939003864, + 16.88010987834786647, 35.786685647559352219, 123.2975174292223528, 2.3433905851125018671, + 34.144315932659083046, 84.241912059744208818, 44.307361746356036747, 79.935533768108143704, + 104.84931020793737844, 91.898176345304818824, 99.863889567881415132, 35.197560468037409009, + 32.637598206219990971, 4.5637151238734077197, 4.899294317281601252, 120.9859229398680327, + 61.413968415232375264, 71.535298641225381289, 77.493886059532087529, 53.496928862281492911, + 9.5291495343772112392, 11.310995239953626879, 40.214337775403691921, 26.450491965915716719, + 12.604839910221926402, 105.62505674514977727, 85.95697482512332499, 48.055604705572477542, + 38.790402267739409581, 120.84112010069293319, 27.447053948719258187, 124.15368377910999698, + 27.719168443858507089, 100.94162374920415459, 40.694670639437390491, 86.107212477279972518, + 4.6079978972120443359, 75.728553080120036611, 103.94115214923658641, 41.65330365351474029, + 62.647818122200988, 38.444345165389677277, 63.127392346763372188, 24.207818942559242714, + 8.7464520899375202134, 14.781221747387462528, 112.17481228557153372, 17.544342662466078764, + 109.6516090568547952, 44.151813334083271911, 51.309325521513528656, 82.483100816225487506, + 98.962799933720816625, 98.58063856395529001, 90.990371490574034397, 8.3359861539174744394, + 15.427574044548236998, 112.5094576385927212, 84.944468539077206515, 97.6895500180144154, + 62.161145240323094185, 127.96142693534056889, 57.531985322642867686, 74.451794229651568457, + 79.469017828108917456, 16.402551604303880595, 116.01790247412282042, 71.409078704757121159, + 59.369287650610203855, 65.311180100252386183, 41.98415561057117884, 66.868402015996252885, + 55.470331482105393661, 44.474546580786409322, 15.605063989652990131, 88.496369900127319852, + 120.28451471721200505, 93.79412941978443996, 46.190028006396460114, 67.760813549462909577, + 37.545410247705149231, 118.09652373530116165, 99.302737301619345089, 77.169089942075515864, + 42.665770321542368038, 70.016250557629973628, 105.33171304285497172, 112.97064801111991983, + 15.362833196944848169, 39.01329570563393645, 66.327721689413010608, 120.67727978659240762, + 114.2421907237439882, 119.95127104511266225, 123.31621092807836249, 25.281184008457785239, + 111.83954836829434498, 32.787155127898586215, 98.466867161543632392, 67.960410945448529674, + 60.463640524012589594, 10.034007676302280743, 66.417100047303392785, 70.089401769331743708, + 60.039428887161193416, 119.80248262752138544, 9.5905919823562726378, 20.53206973879787256, + 127.38030849821734591, 16.822543433347163955, 6.7770587250088283326, 46.806173958852014039, + 1.338184028474643128, 24.101529922812915174, 97.319398772142449161, 7.2212777610329794697, + 123.68308683027134975, 114.93745779254822992, 107.24232782011677045, 85.214260746412037406, + 5.0690341179652023129, 36.282479767320182873, 35.036654286581324413, 76.361467072008963441, + 102.17970815479202429, 57.321445715959271183, 111.89819374043145217, 30.932837543365167221, + 66.437961435058241477, 30.799375719929230399, 2.7875857876715599559, 48.573962468821264338, + 56.144790068578004139, 103.92693618791236077, 57.474912370242236648, 12.56505502012805664, + 109.44862974650459364, 89.904447854994941736, 111.97771897638449445, 78.430319970841082977, + 87.85571937233544304, 67.747786352076218463, 67.395068769241333939, 113.19674001449675416, + 51.87983271587654599, 70.206631890599965118, 2.5937579885830928106, 0.5183953574814950116, + 33.33029209424421424, 9.2097078337064886, 59.571341959923302056, 31.650704322048113681, + 54.539710655400995165, 43.237524062853481155, 37.979312053223111434, 115.92895828653490753, + 127.07437626380851725, 112.09786630936287111, 105.57131312284036539, 91.829853918014123337, + 8.7192555324254499283, 84.669274826173932524, 3.5767823566966399085, 51.731633629329735413, + 47.949447324164793827, 110.53819718081285828, 53.399996914118673885, 45.417519601491221692, + 49.03928027111760457, 16.071534983289893717, 24.474914431648358004, 7.1196992486657109112, + 123.75306747741342406, 101.81214901177736465, 28.391364034738217015, 49.614159735952853225, + 27.738142186652112287, 124.12763764488045126, 64.180812846236221958, 33.066613108145247679, + 95.003304958274384262, 67.89084038279906963, 72.676438681395666208, 97.724758609489072114, + 2.0024162691370293032, 85.155683260160003556, 17.429031969299103366, 114.40856028866255656, + 102.46121532658798969, 42.556952515795273939, 109.46651414436928462, 92.303747988415125292, + 69.698895935060136253, 124.06194687778770458, 32.085153145366348326, 123.26393616217319504, + 55.530052730326133315, 82.919703093022690155, 118.4130436008090328, 102.58036299986997619, + 91.733587458249530755, 49.848788120052631712, 109.99349694491684204, 17.367097549151367275, + 53.961315906322852243, 45.75578761689394014, 77.979289641596551519, 71.726462063317740103, + 78.734167398433783092, 2.6869231221098743845, 101.50785931876089307, 94.303135585934796836, + 30.213593697739270283, 58.314753126240248093, 29.660546829301893013, 112.65779588505392894, + 58.257444469647452934, 97.429136547274538316, 69.741104827415256295, 58.423555785542703234, + 1.8432417263284150977, 109.96364108325360576, 86.49407487550706719, 81.179469213260745164, + 49.55843689927860396, 34.103538028852199204, 64.387084504192898748, 46.804134712543600472, + 91.740726444666506723, 45.714028271242568735, 28.833862579103879398, 45.016963404643320246, + 37.186768141778884456, 31.407145133827725658, 44.740555348591442453, 91.491453073842421873, + 125.7151486568764085, 91.116107890906278044, 51.515654603823350044, 5.9981687681829498615, + 69.02509952726541087, 96.670577360022434732, 115.85045187352443463, 22.4739644497349218, + 17.683718546846648678, 16.794705232670821715, 46.451268063472525682, 48.989940621424466372, + 20.611534160583687481, 117.41060999205365079, 9.1924160934613610152, 22.090057694978895597, + 2.6453007856907788664, 45.958125188084522961, 26.98218721931334585, 93.660866127276676707, + 67.651463759266334819, 92.137981871263036737, 123.54471139789529843, 127.94714356603799388, + 90.504322147604398197, 102.41125803642717074, 24.323875075158866821, 52.796296227894345066, + 79.719657150941202417, 94.679787347427918576, 53.015803014663106296, 80.009750442572112661, + 12.061565881165734027, 35.314052086236188188, 57.343488078833615873, 107.20522284483013209, + 96.702514121756394161, 41.63526398907561088, 98.155738597455638228, 5.6776330767388571985, + 26.601979044324252754, 23.835589189027814427, 36.663146974755363772, 76.526816470282938099, + 89.244813435285323067, 21.20965743220585864, 88.275030156863067532, 5.3322896775607659947, + 6.8951791555773525033, 77.313234267523512244, 54.38353012904553907, 78.7843450461368775, + 125.10859010253261658, 18.424911224992683856, 75.821932568185729906, 94.213153701042756438, + 120.45880962548471871, 23.864585723600612255, 22.205374891276733251, 44.926819697542669019, + 67.5662925385950075, 116.65550778041506419, 62.06681494225631468, 94.00208839773767977, + 68.831505655165528879, 48.258374994471523678, 101.58366947887770948, 77.482211972135701217, + 56.832916199211467756, 76.652025630060961703, 0.35752638826670590788, 75.653412334235326853, + 21.691045294071955141, 67.023931807281769579, 112.69250558033309062, 31.746063109316310147, + 42.776609130778524559, 103.69883598013257142, 75.883115058968542144, 54.933890125077596167, + 45.319113452314923052, 3.7000090708643256221, 17.635673301920178346, 44.889871223160298541, + 26.833187905027443776, 40.981223837741708849, 5.9960629010347474832, 83.722210432904830668, + 9.6633808263504761271, 52.483336585872166324, 115.0382305460589123, 56.784562769109470537, + 16.176900832680985332, 112.74247463377832901, 76.653901169640448643, 69.322958732962433714, + 44.195670180070010247, 25.145909791470330674, 55.447539834429335315, 127.06918269157904433, + 127.52233163216806133, 112.82497356121893972, 47.432827425178402336, 115.22332009593810653, + 54.690482657344546169, 113.62823892005326343, 66.263899738172767684, 45.629282908088498516, + 4.2304446220041427296, 107.40236392521910602, 67.156219671323924558, 103.61845983019156847, + 69.353297779056447325, 106.72688758597359993, 20.872044868861848954, 81.692193571205280023, + 117.16016657605723594, 73.588350414847809589, 38.266043245057517197, 57.133127698602038436, + 67.621852472075261176, 21.320176041968807112, 10.091236054180626525, 126.37433425439303392, + 111.43489976701312116, 89.33029369575160672, 93.12701744883088395, 98.633181837296433514, + 77.777643754561722744, 80.245399137431377312, 126.31434466382415849, 69.17179231479531154, + 58.476450083260715473, 107.43010074587800773, 33.76021975669573294, 71.573371295122342417, + 118.59503485844470561, 4.6867811702250037342, 68.288631865321804071, 40.483824119488417637, + 88.614723492715711473, 31.871067536219925387, 81.698620415878394851, 55.796352690613275627, + 71.727779135762830265, 70.395120936074818019, 65.275196412439981941, 9.1274302477468154393, + 9.7985886345668404829, 113.9718458797360654, 122.82793683046838851, 15.070597282454400556, + 26.987772119064175058, 106.99385772456298582, 19.058299068754422478, 22.621990479907253757, + 80.428675550807383843, 52.900983931831433438, 25.209679820447490783, 83.250113490303192521, + 43.913949650246649981, 96.111209411144955084, 77.58080453548245714, 113.68224020138950436, + 54.894107897442154353, 120.30736755821999395, 55.438336887720652157, 73.883247498408309184, + 81.389341278878418962, 44.214424954559945036, 9.2159957944277266506, 23.457106160243711201, + 79.882304298473172821, 83.30660730702948058, 125.295636244401976, 76.888690330779354554, + 126.25478469352674438, 48.415637885118485428, 17.492904179875040427, 29.562443494778563036, + 96.349624571143067442, 35.088685324935795506, 91.303218113709590398, 88.303626668166543823, + 102.61865104303069529, 36.966201632454612991, 69.925599867445271229, 69.161277127914217999, + 53.980742981148068793, 16.671972307834948879, 30.855148089100111974, 97.018915277189080371, + 41.888937078158051008, 67.3791000360288308, 124.32229048064982635, 127.92285387068113778, + 115.06397064528937335, 20.903588459306774894, 30.938035656217834912, 32.805103208611399168, + 104.03580494824927882, 14.818157409514242318, 118.73857530122404569, 2.6223602005047723651, + 83.96831122114599566, 5.7368040319925057702, 110.94066296421078732, 88.949093161572818644, + 31.21012797930961824, 48.992739800258277683, 112.56902943442764808, 59.588258839568879921, + 92.380056012796558207, 7.5216270989258191548, 75.090820495413936442, 108.19304747060596128, + 70.605474603242328158, 26.338179884151031729, 85.331540643088374054, 12.032501115263585234, + 82.663426085713581415, 97.941296022239839658, 30.725666393889696337, 78.026591411271510879, + 4.6554433788296591956, 113.35455957318845321, 100.48438144749161438, 111.90254209022896248, + 118.63242185615672497, 50.562368016919208458, 95.679096736588689964, 65.57431025580081041, + 68.933734323090902762, 7.9208218908970593475, 120.92728104802517919, 20.068015352608199464, + 4.8342000946104235481, 12.178803538663487416, 120.07885777432602481, 111.60496525504277088, + 19.181183964712545276, 41.064139477599383099, 126.76061699643469183, 33.645086866694327909, + 13.554117450017656665, 93.612347917704028077, 2.676368056949286256, 48.203059845629468327, + 66.638797544284898322, 14.442555522069596918, 119.36617366054633749, 101.87491558510009781, + 86.484655640237178886, 42.428521492824074812, 10.138068235930404626, 72.564959534640365746, + 70.073308573166286806, 24.722934144021564862, 76.359416309584048577, 114.64289143192218035, + 95.79638748086290434, 61.865675086733972421, 4.8759228701164829545, 61.598751439858460799, + 5.5751715753431199118, 97.147924937642528675, 112.28958013715964626, 79.85387237582472153, + 114.9498247404844733, 25.130110040259751258, 90.89725949301282526, 51.80889570999352145, + 95.955437952772626886, 28.860639941685803933, 47.71143874467452406, 7.4955727041560749058, + 6.7901375384863058571, 98.393480028993508313, 103.75966543175672996, 12.413263781199930236, + 5.1875159771661856212, 1.0367907149629900232, 66.660584188488428481, 18.4194156674129772, + 119.14268391984660411, 63.301408644096227363, 109.07942131080199033, 86.47504812570696231, + 75.958624106449860847, 103.85791657307345304, 126.14875252762067248, 96.195732618729380192, + 83.142626245684368769, 55.659707836028246675, 17.438511064854537835, 41.338549652347865049, + 7.153564713393279817, 103.46326725865947083, 95.898894648333225632, 93.076394361625716556, + 106.79999382823734777, 90.835039202982443385, 98.078560542235209141, 32.143069966579787433, + 48.949828863296716008, 14.239398497335059801, 119.50613495483048609, 75.624298023554729298, + 56.78272806947643403, 99.22831947190570645, 55.476284373307862552, 120.2552752897645405, + 0.3616256924724439159, 66.133226216294133337, 62.006609916552406503, 7.7816807656017772388, + 17.352877362794970395, 67.449517218978144228, 4.0048325382776965853, 42.311366520320007112, + 34.858063938601844711, 100.8171205773287511, 76.922430653175979387, 85.113905031594185857, + 90.933028288742207224, 56.607495976833888562, 11.397791870123910485, 120.12389375557540916, + 64.170306290736334631, 118.52787232434639009, 111.06010546065590461, 37.839406186049018288, + 108.82608720162170357, 77.160725999743590364, 55.46717491649906151, 99.697576240108901402, + 91.986993889833684079, 34.73419509830273455, 107.92263181264570449, 91.511575233791518258, + 27.958579283196741017, 15.452924126639118185, 29.468334796867566183, 5.3738462442233867478, + 75.015718637525424128, 60.606271171869593672, 60.427187395478540566, 116.62950625248049619, + 59.321093658607424004, 97.315591770107857883, 116.51488893929854385, 66.85827309455271461, + 11.482209654830512591, 116.84711157108540647, 3.6864834526604681741, 91.927282166510849493, + 44.98814975101777236, 34.358938426521490328, 99.11687379855720792, 68.207076057708036387, + 0.77416900838579749689, 93.608269425090838922, 55.481452889333013445, 91.42805654248513747, + 57.667725158207758795, 90.033926809286640491, 74.373536283557768911, 62.814290267655451316, + 89.481110697186522884, 54.982906147688481724, 123.43029731375645497, 54.232215781812556088, + 103.03130920764670009, 11.996337536369537702, 10.050199054534459719, 65.341154720048507443, + 103.70090374704886926, 44.9479288994698436, 35.367437093693297356, 33.58941046534164343, + 92.902536126945051365, 97.979881242848932743, 41.22306832117101294, 106.82121998410730157, + 18.38483218692272203, 44.180115389957791194, 5.2906015713815577328, 91.916250376169045921, + 53.964374438630329678, 59.321732254556991393, 7.3029275185363076162, 56.275963742529711453, + 119.08942279579423484, 127.89428713207962574, 53.008644295212434372, 76.822516072854341473, + 48.647750150317733642, 105.59259245579232811, 31.439314301886042813, 61.359574694855837151, + 106.03160602932985057, 32.019500885144225322, 24.123131762331468053, 70.628104172472376376, + 114.68697615767086972, 86.410445689663902158, 65.405028243512788322, 83.270527978154859738, + 68.311477194911276456, 11.355266153477714397, 53.203958088648505509, 47.671178378055628855, + 73.326293949514365522, 25.053632940569514176, 50.489626870570646133, 42.41931486441535526, + 48.550060313726135064, 10.664579355121531989, 13.790358311158342985, 26.626468535047024488, + 108.76706025809471612, 29.568690092277392978, 122.21718020506523317, 36.84982244998900569, + 23.643865136375097791, 60.426307402089150855, 112.91761925096943742, 47.72917144720122451, + 44.410749782553466503, 89.853639395088976016, 7.1325850771936529782, 105.31101556083012838, + 124.13362988451626734, 60.004176795478997519, 9.6630113103310577571, 96.516749988946685335, + 75.167338957759056939, 26.964423944271402434, 113.66583239842657349, 25.304051260121923406, + 0.71505277653704979457, 23.306824668470653705, 43.38209058814754826, 6.0478636145671771374, + 97.38501116066618124, 63.492126218632620294, 85.553218261560687097, 79.397671960268780822, + 23.766230117937084287, 109.86778025015519233, 90.638226904629846103, 7.4000181417286512442, + 35.271346603840356693, 89.779742446320597082, 53.666375810054887552, 81.962447675483417697, + 11.992125802073132945, 39.444420865809661336, 19.326761652700952254, 104.96667317174797063, + 102.07646109211782459, 113.56912553821894107, 32.353801665365608642, 97.484949267560295993, + 25.307802339284535265, 10.645917465924867429, 88.391340360140020493, 50.291819582940661348, + 110.89507966886230861, 126.13836538316172664, 127.04466326433976064, 97.649947122437879443, + 94.865654850360442651, 102.44664019187621307, 109.38096531469273032, 99.256477840110164834, + 4.5277994763455353677, 91.258565816176997032, 8.4608892440119234379, 86.804727850441850023, + 6.3124393426514870953, 79.236919660386774922, 10.706595558116532629, 85.453775171947199851, + 41.744089737727335887, 35.384387142414198024, 106.32033315211810987, 19.176700829695619177, + 76.532086490115034394, 114.26625539720771485, 7.2437049441505223513, 42.640352083937614225, + 20.182472108364891028, 124.74866850878970581, 94.869799534029880306, 50.660587391506851418, + 58.254034897665405879, 69.266363674596505007, 27.555287509127083467, 32.490798274866392603, + 124.62868932765195495, 10.343584629590623081, 116.95290016652506893, 86.860201491756015457, + 67.520439513395103859, 15.146742590248322813, 109.19006971688941121, 9.3735623404536454473, + 8.5772637306436081417, 80.967648238980473252, 49.229446985431422945, 63.742135072443488752, + 35.397240831756789703, 111.59270538123018923, 15.455558271529298509, 12.790241872153274016, + 2.5503928248799638823, 18.254860495493630879, 19.597177269137318945, 99.943691759475768777, + 117.65587366093677701, 30.141194564908801112, 53.975544238131988095, 85.987715449125971645, + 38.116598137508844957, 45.243980959818145493, 32.857351101614767686, 105.80196786366286688, + 50.419359640898619546, 38.500226980606385041, 87.82789930049693794, 64.222418822293548146, + 27.16160907096855226, 99.364480402779008728, 109.78821579488794669, 112.61473511643998791, + 110.87667377544494229, 19.766494996820256347, 34.778682557756837923, 88.428849909119890071, + 18.431991588855453301, 46.914212320491060382, 31.764608596949983621, 38.613214614062599139, + 122.59127248880758998, 25.777380661562347086, 124.50956938705348875, 96.831275770236970857, + 34.985808359750080854, 59.12488698956076405, 64.699249142286134884, 70.177370649875228992, + 54.606436227422818774, 48.607253336336725624, 77.237302086061390582, 73.93240326491286396, + 11.851199734894180438, 10.322554255828435998, 107.96148596229613759, 33.343944615669897757, + 61.710296178203861928, 66.037830554378160741, 83.777874156319739996, 6.7582000720612995792, + 120.64458096130329068, 127.84570774136591353, 102.1279412905787467, 41.807176918613549788, + 61.876071312435669824, 65.610206417226436315, 80.071609896498557646, 29.636314819032122614, + 109.47715060244809138, 5.244720401013182709, 39.93662244229199132, 11.473608063988649519, + 93.881325928425212624, 49.898186323145637289, 62.42025595861923648, 97.985479600520193344, + 97.138058868855296168, 119.17651767914139782, 56.760112025593116414, 15.043254197855276288, + 22.181640990831510862, 88.386094941215560539, 13.210949206484656315, 52.676359768305701436, + 42.663081286176748108, 24.065002230530808447, 37.326852171430800809, 67.882592044479679316, + 61.451332787783030653, 28.053182822543021757, 9.31088675766295637, 98.709119146380544407, + 72.968762894986866741, 95.805084180461562937, 109.26484371231344994, 101.12473603384205489, + 63.358193473181017907, 3.1486205116052587982, 9.867468646181805525, 15.841643781797756674, + 113.85456209605035838, 40.136030705216398928, 9.6684001892208470963, 24.35760707733061281, + 112.1577155486556876, 95.209930510085541755, 38.362367929425090551, 82.128278955202404177, + 125.52123399286938366, 67.290173733388655819, 27.108234900038951309, 59.224695835408056155, + 5.352736113898572512, 96.406119691262574634, 5.2775950885697966442, 28.885111044142831815, + 110.73234732109631295, 75.749831170203833608, 44.969311280474357773, 84.857042985648149624, + 20.27613647186444723, 17.129919069284369471, 12.146617146332573611, 49.445868288046767702, + 24.718832619171735132, 101.28578286384799867, 63.59277496172580868, 123.73135017346794484, + 9.7518457402329659089, 123.1975028797169216, 11.150343150689877803, 66.29584987528869533, + 96.579160274322930491, 31.707744751653081039, 101.89964948096894659, 50.260220080523140496, + 53.79451898602565052, 103.61779141999068088, 63.910875905545253772, 57.721279883371607866, + 95.422877489349048119, 14.991145408312149812, 13.580275076976249693, 68.786960057990654605, + 79.519330863513459917, 24.826527562399860471, 10.375031954332371242, 2.0735814299296180252, + 5.3211683769768569618, 36.838831334829592379, 110.28536783969320823, 126.6028172881960927, + 90.158842621607618639, 44.950096251417562598, 23.917248212903359672, 79.715833146150544053, + 124.29750505524498294, 64.391465237462398363, 38.285252491368737537, 111.31941567205649335, + 34.877022129709075671, 82.677099304695730098, 14.307129426790197613, 78.926534517322579632, + 63.797789296670089243, 58.152788723255071091, 85.59998765647833352, 53.670078405968524748, + 68.157121084470418282, 64.286139933159574866, 97.899657726593432017, 28.478796994673757581, + 111.01226990966461017, 23.248596047109458596, 113.56545613895650604, 70.456638943811412901, + 110.95256874661936308, 112.51055057952908101, 0.72325138494852581061, 4.2664524325882666744, + 124.01321983310481301, 15.563361531203554478, 34.705754725593578769, 6.8990344379562884569, + 8.0096650765553931706, 84.622733040640014224, 69.716127877207327401, 73.634241154661140172, + 25.844861306355596753, 42.227810063192009693, 53.866056577484414447, 113.21499195366777712, + 22.795583740251458948, 112.2477875111544563, 0.34061258147630724125, 109.05574464869641815, + 94.120210921311809216, 75.678812372101674555, 89.65217440324704512, 26.321451999487180728, + 110.934349833001761, 71.395152480221440783, 55.973987779667368159, 69.468390196609107079, + 87.84526362529504695, 55.023150467583036516, 55.917158566393482033, 30.905848253278236371, + 58.936669593735132366, 10.747692488450411474, 22.031437275050848257, 121.21254234373918734, + 120.85437479096071911, 105.25901250496099237, 118.64218731721848599, 66.631183540219353745, + 105.02977787860072567, 5.7165461891054292209, 22.96441930966466316, 105.69422314217081293, + 7.3729669053245743271, 55.854564333021698985, 89.97629950203554472, 68.717876853046618635, + 70.233747597118053818, 8.4141521154160727747, 1.5483380167752329726, 59.216538850181677844, + 110.96290577866966487, 54.85611308497027494, 115.33545031641915557, 52.067853618576918961, + 20.747072567115537822, 125.62858053531454061, 50.962221394373045769, 109.96581229538060143, + 118.86059462751290994, 108.46443156362875015, 78.062618415293400176, 23.992675072739075404, + 20.100398109072557418, 2.6823094401006528642, 79.401807494097738527, 89.8958577989396872, + 70.734874187386594713, 67.178820930686924839, 57.805072253893740708, 67.959762485697865486, + 82.446136642345663859, 85.642439968214603141, 36.769664373845444061, 88.360230779915582389, + 10.581203142766753444, 55.832500752338091843, 107.92874887726065936, 118.64346450911398279, + 14.605855037072615232, 112.55192748506306089, 110.17884559159210767, 127.78857426415925147, + 106.01728859042850672, 25.645032145708682947, 97.295500300639105262, 83.18518491158465622, + 62.878628603772085626, 122.71914938971531228, 84.063212058659701142, 64.039001770288450643, + 48.246263524666574085, 13.256208344948390732, 101.37395231534537743, 44.820891379331442295, + 2.8100564870292146225, 38.541055956313357456, 8.6229543898225529119, 22.710532306955428794, + 106.40791617729701102, 95.342356756114895688, 18.652587899028731044, 50.107265881139028352, + 100.97925374114129227, 84.838629728830710519, 97.100120627452270128, 21.329158710243063979, + 27.580716622316685971, 53.252937070097686956, 89.534120516189432237, 59.137380184558423935, + 116.43436041013046633, 73.699644899978011381, 47.287730272750195581, 120.85261480418193969, + 97.835238501938874833, 95.458342894402449019, 88.821499565110570984, 51.707278790177952033, + 14.265170154390943935, 82.622031121663894737, 120.26725976903253468, 120.00835359095799504, + 19.326022620665753493, 65.033499977897008648, 22.334677915518113878, 53.928847888546442846, + 99.331664796853146981, 50.608102520243846811, 1.4301055530740995891, 46.613649336941307411, + 86.76418117629509652, 12.095727229137992254, 66.77002232133236248, 126.98425243726887857, + 43.106436523125012172, 30.795343920537561644, 47.532460235877806554, 91.735560500314022647, + 53.276453809259692207, 14.800036283457302488, 70.542693207684351364, 51.559484892641194165, + 107.33275162011341308, 35.924895350966835395, 23.98425160414626589, 78.888841731619322672, + 38.653523305405542487, 81.933346343499579234, 76.152922184239287162, 99.138251076437882148, + 64.707603330734855263, 66.969898535120591987, 50.615604678569070529, 21.291834931853372836, + 48.782680720280040987, 100.58363916588496068, 93.790159337728255196, 124.27673076632709126, + 126.08932652868315927, 67.299894244879396865, 61.731309700724523282, 76.893280383756064111, + 90.761930629389098613, 70.512955680220329668, 9.0555989526947087143, 54.517131632353994064, + 16.921778488027484855, 45.609455700883700047, 12.624878685306612169, 30.473839320773549844, + 21.413191116236703238, 42.907550343894399703, 83.488179475454671774, 70.768774284832034027, + 84.64066630423621973, 38.353401659394876333, 25.064172980233706767, 100.5325107944154297, + 14.487409888301044703, 85.28070416787522845, 40.364944216733420035, 121.4973370175830496, + 61.739599068059760612, 101.32117478301370284, 116.50806979533444974, 10.532727349193010014, + 55.110575018254166935, 64.981596549736423185, 121.25737865530390991, 20.68716925918488414, + 105.90580033305377583, 45.720402983515668893, 7.0408790267902077176, 30.293485180500283604, + 90.380139433778822422, 18.747124680907290895, 17.154527461290854262, 33.935296477960946504, + 98.45889397086284589, 127.4842701448869775, 70.794481663517217385, 95.185410762460378464, + 30.911116543058597017, 25.580483744306548033, 5.1007856497599277645, 36.509720990987261757, + 39.194354538278275868, 71.887383518955175532, 107.31174732187355403, 60.282389129817602225, + 107.95108847626761417, 43.97543089825194329, 76.233196275017689914, 90.487961919636290986, + 65.71470220323317335, 83.603935727325733751, 100.83871928179723909, 77.000453961216408061, + 47.655798600997513859, 0.44483764458709629253, 54.323218141940742498, 70.728960805558017455, + 91.57643158977953135, 97.229470232883613789, 93.753347550889884587, 39.532989993640512694, + 69.557365115517313825, 48.857699818239780143, 36.863983177710906602, 93.828424640982120764, + 63.529217193899967242, 77.226429228128836257, 117.18254497761517996, 51.554761323128332151, + 121.01913877411061549, 65.662551540473941714, 69.971616719500161707, 118.24977397912516608, + 1.3984982845759077463, 12.354741299750457983, 109.21287245484563755, 97.214506672677089227, + 26.474604172126419144, 19.864806529825727921, 23.702399469788360875, 20.645108511660509976, + 87.922971924592275172, 66.687889231339795515, 123.42059235641136183, 4.0756611087599594612, + 39.555748312639479991, 13.516400144126237137, 113.28916192261021934, 127.69141548273546505, + 76.255882581157493405, 83.614353837227099575, 123.75214262487497763, 3.220412834456510609, + 32.143219792997115292, 59.272629638067883207, 90.954301204896182753, 10.489440802026365418, + 79.873244884583982639, 22.947216127980937017, 59.762651856850425247, 99.796372646291274577, + 124.84051191724211094, 67.970959201044024667, 66.276117737714230316, 110.35303535828279564, + 113.52022405118623283, 30.086508395710552577, 44.363281981666659703, 48.772189882431121077, + 26.421898412969312631, 105.35271953661140287, 85.326162572353496216, 48.130004461061616894, + 74.653704342865239596, 7.7651840889593586326, 122.90266557556606131, 56.106365645086043514, + 18.621773515329550719, 69.418238292764726793, 17.93752578997737146, 63.610168360926763853, + 90.529687424630537862, 74.249472067684109788, 126.71638694636203581, 6.2972410232105175965, + 19.73493729236361105, 31.683287563599151326, 99.709124192100716755, 80.272061410432797857, + 19.336800378441694193, 48.715214154664863599, 96.315431097315013176, 62.41986102017108351, + 76.724735858853819082, 36.256557910408446332, 123.04246798574240529, 6.580347466777311638, + 54.216469800077902619, 118.44939167081611231, 10.705472227800783003, 64.812239382525149267, + 10.555190177139593288, 57.77022208828930161, 93.464694642196263885, 23.499662340407667216, + 89.938622560952353524, 41.714085971296299249, 40.552272943728894461, 34.259838138568738941, + 24.293234292665147223, 98.891736576093535405, 49.437665238347108243, 74.571565727695997339, + 127.18554992345525534, 119.46270034693588968, 19.503691480469569797, 118.3950057594338432, + 22.300686301383393584, 4.5916997505810286384, 65.158320548645860981, 63.415489503309800057, + 75.799298961937893182, 100.52044016104628099, 107.58903797205493902, 79.235582839981361758, + 127.82175181109050754, 115.44255976674685371, 62.845754978698096238, 29.982290816624299623, + 27.160550153956137365, 9.5739201159849471878, 31.038661727026919834, 49.653055124799720943, + 20.750063908664742485, 4.1471628598592360504, 10.642336753953713924, 73.677662669662822736, + 92.570735679390054429, 125.20563457639582339, 52.317685243215237278, 89.900192502835125197, + 47.834496425810357323, 31.431666292304726085, 120.59501011049360386, 0.78293047492479672655, + 76.570504982741113054, 94.638831344112986699, 69.75404425942178932, 37.354198609391460195, + 28.614258853584033204, 29.853069034645159263, 127.59557859334017849, 116.30557744651378016, + 43.19997531295666704, 107.34015681194068748, 8.3142421689444745425, 0.5722798663227877114, + 67.799315453186864033, 56.957593989351153141, 94.024539819329220336, 46.49719209422255517, + 99.130912277916650055, 12.91327788762646378, 93.905137493242364144, 97.021101159058162011, + 1.4465027698970516212, 8.5329048651801713277, 120.02643966620962601, 31.126723062407108955, + 69.411509451187157538, 13.798068875912576914, 16.01933015311442432, 41.245466081283666426, + 11.432255754418292781, 19.268482309322280344, 51.689722612711193506, 84.455620126384019386, + 107.73211315497246687, 98.42998390733555425, 45.591167480506555876, 96.495575022308912594, + 0.6812251629562524613, 90.111489297396474285, 60.24042184262725641, 23.357624744206987089, + 51.30434880649409024, 52.642903998977999436, 93.868699666007159976, 14.790304960442881566, + 111.9479755593383743, 10.936780393221852137, 47.6905272505900939, 110.04630093516607303, + 111.83431713278696407, 61.811696506556472741, 117.87333918747026473, 21.495384976900822949, + 44.062874550105334492, 114.42508468748201267, 113.7087495819250762, 82.518025009925622726, + 109.28437463444060995, 5.2623670804423454683, 82.059555757201451343, 11.433092378210858442, + 45.928838619332964299, 83.388446284341625869, 14.745933810649148654, 111.70912866604703595, + 51.952599004074727418, 9.4357537060968752485, 12.467495194236107636, 16.828304230832145549, + 3.0966760335504659452, 118.43307770036699367, 93.925811557339329738, 109.71222616994418786, + 102.67090063283831114, 104.13570723715383792, 41.494145134234713623, 123.25716107062908122, + 101.92444278874972952, 91.931624590764840832, 109.72118925502945785, 88.928863127261138288, + 28.125236830586800352, 47.985350145478150807, 40.200796218145114835, 5.3646188802049437072, + 30.803614988199115032, 51.791715597883012379, 13.469748374776827404, 6.3576418613738496788, + 115.61014450779111939, 7.9195249713993689511, 36.892273284694965696, 43.284879936429206282, + 73.539328747694526101, 48.720461559831164777, 21.162406285533506889, 111.66500150467982166, + 87.85749775452495669, 109.28692901822796557, 29.211710074148868443, 97.103854970129759749, + 92.357691183187853312, 127.57714852832214092, 84.034577180857013445, 51.290064291421003873, + 66.591000601281848503, 38.37036982316931244, 125.75725720754780923, 117.43829877943426254, + 40.126424117323040264, 0.07800354057690128684, 96.49252704933314817, 26.512416689900419442, + 74.747904630690754857, 89.641782758662884589, 5.6201129740584292449, 77.082111912626714911, + 17.245908779645105824, 45.421064613914495567, 84.815832354597660014, 62.684713512229791377, + 37.305175798057462089, 100.21453176228169468, 73.958507482286222512, 41.677259457665059017, + 66.200241254904540256, 42.658317420486127958, 55.161433244633371942, 106.50587414019901189, + 51.068241032378864475, 118.27476036912048585, 104.86872082026457065, 19.399289799956022762, + 94.575460545504029142, 113.70522960836751736, 67.670477003881387645, 62.916685788808536017, + 49.642999130221141968, 103.41455758035590407, 28.530340308785525849, 37.244062243331427453, + 112.53451953806870733, 112.01670718191599008, 38.652045241335144965, 2.0669999557940172963, + 44.669355831036227755, 107.85769577709652367, 70.663329593706293963, 101.21620504048769362, + 2.8602111061481991783, 93.2272986738862528, 45.528362352590193041, 24.191454458279622486, + 5.5400446426683629397, 125.96850487453775713, 86.212873046250024345, 61.590687841075123288, + 95.064920471759251086, 55.471121000628045294, 106.55290761851938441, 29.600072566918242956, + 13.085386415368702728, 103.11896978528602631, 86.665503240226826165, 71.849790701933670789, + 47.96850320829616976, 29.777683463238645345, 77.307046610814722953, 35.866692687002796447, + 24.305844368482212303, 70.276502152879402274, 1.4152066614733485039, 5.9397970702411839738, + 101.23120935713814106, 42.583669863706745673, 97.565361440563719952, 73.16727833177355933, + 59.58031867546014837, 120.5534615326578205, 124.17865305736995651, 6.5997884897587937303, + 123.46261940145268454, 25.786560767515766202, 53.523861258781835204, 13.025911360440659337, + 18.111197905389417429, 109.03426326470798813, 33.843556976054969709, 91.218911401767400093, + 25.249757370613224339, 60.947678641547099687, 42.826382232473406475, 85.815100687792437384, + 38.976358950912981527, 13.537548569667706033, 41.28133260847243946, 76.706803318789752666, + 50.128345960471051512, 73.0650215888308594, 28.974819776605727384, 42.561408335750456899, + 80.729888433470478049, 114.9946740351660992, 123.4791981361231592, 74.642349566031043651, + 105.01613959066889947, 21.065454698386020027, 110.22115003651197185, 1.963193099476484349, + 114.51475731060781982, 41.374338518373406259, 83.81160066610755166, 91.440805967031337786, + 14.081758053580415435, 60.586970361004205188, 52.760278867557644844, 37.494249361814581789, + 34.309054922581708524, 67.870592955925530987, 68.917787941729329759, 126.96854028977759299, + 13.588963327038072748, 62.370821524920756929, 61.822233086117194034, 51.160967488613096066, + 10.201571299519855529, 73.019441981974523515, 78.388709076560189715, 15.774767037913989043, + 86.623494643747108057, 120.56477825963884243, 87.902176952535228338, 87.950861796507524559, + 24.466392550039017806, 52.975923839276219951, 3.4294044064699846786, 39.207871454655105481, + 73.677438563598116161, 26.000907922432816122, 95.311597201995027717, 0.88967528917419258505, + 108.64643628388512298, 13.45792161111603491, 55.15286317956270068, 66.458940465770865558, + 59.506695101779769175, 79.065979987284663366, 11.11473023103462765, 97.715399636479560286, + 73.727966355425451184, 59.656849281964241527, 127.05843438780357246, 26.452858456261310494, + 106.36508995523035992, 103.10952264626030228, 114.03827754822486895, 3.325103080951521406, + 11.943233439003961394, 108.49954795825033216, 2.7969965691518154927, 24.709482599504553946, + 90.425744909694913076, 66.429013345354178455, 52.949208344252838288, 39.729613059651455842, + 47.40479893957672175, 41.29021702332465793, 47.845943849188188324, 5.3757784626832290087, + 118.84118471282272367, 8.1513222175199189223, 79.111496625278959982, 27.032800288256112253, + 98.578323845224076649, 127.38283096547456807, 24.511765162318624789, 39.228707674457837129, + 119.50428524974995526, 6.440825668913021218, 64.286439585994230583, 118.54525927613940439, + 53.908602409792365506, 20.978881604056368815, 31.746489769167965278, 45.894432255961874034, + 119.52530371370448847, 71.592745292586187134, 121.68102383448785986, 7.9419184020916873123, + 4.5522354754320986103, 92.706070716569229262, 99.040448102372465655, 60.173016791421105154, + 88.726563963333319407, 97.544379764862242155, 52.84379682594226324, 82.705439073226443725, + 42.652325144706992432, 96.260008922126871767, 21.307408685730479192, 15.530368177922355244, + 117.80533115113212261, 112.21273129017208703, 37.243547030662739417, 10.836476585529453587, + 35.87505157995474292, 127.22033672185716568, 53.059374849264713703, 20.498944135371857556, + 125.43277389272407163, 12.594482046421035193, 39.4698745847272221, 63.366575127201940631, + 71.418248384205071488, 32.544122820865595713, 38.673600756883388385, 97.430428309333365178, + 64.630862194630026352, 124.839722040345805, 25.449471717707638163, 72.513115820820530644, + 118.08493597148481058, 13.160694933554623276, 108.43293960015944322, 108.89878334163222462, + 21.410944455605203984, 1.6244787650502985343, 21.110380354279186577, 115.5404441765822412, + 58.92938928439252777, 46.999324680818972411, 51.877245121904707048, 83.428171942592598498, + 81.104545887457788922, 68.519676277137477882, 48.586468585333932424, 69.783473152187070809, + 98.875330476697854465, 21.143131455395632656, 126.37109984691414866, 110.92540069387177937, + 39.007382960942777572, 108.79001151886768639, 44.601372602766787168, 9.1833995011656952556, + 2.3166410972917219624, 126.83097900662323809, 23.598597923879424343, 73.040880322096199961, + 87.178075944113516016, 30.471165679966361495, 127.64350362218465307, 102.88511953349370742, + 125.69150995739619248, 59.964581633248599246, 54.321100307912274729, 19.147840231969894376, + 62.077323454053839669, 99.306110249599441886, 41.500127817329484969, 8.2943257197184721008, + 21.284673507911065826, 19.355325339329283452, 57.141471358783746837, 122.41126915279164677, + 104.63537048643411254, 51.800385005670250393, 95.668992851620714646, 62.863332584613090148, + 113.19002022098720772, 1.5658609498532314319, 25.141009965485864086, 61.277662688229611376, + 11.50808851884357864, 74.70839721878292039, 57.228517707168066408, 59.706138069293956505, + 127.19115718668399495, 104.61115489302756032, 86.399950625916972058, 86.680313623881374951, + 16.628484337888949085, 1.1445597326492134016, 7.5986309063737280667, 113.91518797870594426, + 60.049079638658440672, 92.994384188448748318, 70.26182455583330011, 25.826555775256565539, + 59.810274986488366267, 66.042202318116324022, 2.8930055397941032425, 17.065809730363980634, + 112.05287933241925202, 62.253446124817855889, 10.823018902374315076, 27.596137751825153828, + 32.03866030622884864, 82.490932162567332853, 22.864511508836585563, 38.536964618644560687, + 103.37944522542602499, 40.911240252771676751, 87.464226309948571725, 68.859967814671108499, + 91.18233496101674973, 64.991150044617825188, 1.3624503259161429014, 52.22297859479294857, + 120.48084368525451282, 46.715249488413974177, 102.60869761298818048, 105.28580799795963685, + 59.737399332014319953, 29.58060992088940111, 95.895951118676748592, 21.873560786443704274, + 95.381054501183825778, 92.092601870335784042, 95.668634265573928133, 123.62339301311658346, + 107.74667837494052947, 42.990769953801645897, 88.125749100214306964, 100.85016937496766332, + 99.417499163853790378, 37.036050019854883431, 90.568749268881219905, 10.524734160888328915, + 36.119111514402902685, 22.866184756421716884, 91.857677238669566577, 38.776892568683251739, + 29.491867621301935287, 95.418257332094071899, 103.90519800814945484, 18.871507412193750497, + 24.934990388472215272, 33.656608461664291099, 6.1933520671045698691, 108.86615540073762531, + 59.851623114682297455, 91.424452339892013697, 77.341801265680260258, 80.271414474307675846, + 82.988290268473065225, 118.51432214126180043, 75.848885577503097011, 55.863249181533319643, + 91.442378510062553687, 49.857726254522276577, 56.250473661173600703, 95.970700290956301615, + 80.401592436290229671, 10.729237760409887414, 61.607229976398230065, 103.58343119576602476, + 26.939496749553654809, 12.715283722751337336, 103.22028901558223879, 15.839049942798737902, + 73.784546569389931392, 86.569759872862050543, 19.078657495389052201, 97.440923119662329555, + 42.324812571070651757, 95.330003009363281308, 47.714995509053551359, 90.573858036455931142, + 58.423420148301374866, 66.207709940263157478, 56.715382366379344603, 127.15429705664791982, + 40.069154361714026891, 102.58012858284564572, 5.1820012025636970066, 76.740739646342262859, + 123.51451441509925644, 106.87659755886852508, 80.252848234646080527, 0.15600708115744055249, + 64.985054098666296341, 53.024833379804476863, 21.495809261385147693, 51.283565517325769179, + 11.240225948120496469, 26.164223825253429823, 34.491817559290211648, 90.842129227832629113, + 41.631664709195320029, 125.36942702445958275, 74.610351596118562156, 72.429063524567027343, + 19.917014964572445024, 83.354518915333756013, 4.4004825098090805113, 85.316634840972255915, + 110.32286648927038186, 85.01174828039802378, 102.13648206476136693, 108.54952073824460967, + 81.737441640529141296, 38.798579599915683502, 61.150921091011696262, 99.410459216738672694, + 7.3409540077627752908, 125.83337157761707203, 99.285998260445921915, 78.82911516071180813, + 57.060680617571051698, 74.488124486666492885, 97.069039076141052647, 96.033414363831980154, + 77.30409048267028993, 4.1339999115880345926, 89.338711662076093489, 87.71539155419668532, + 13.326659187416225905, 74.432410080975387245, 5.7204222123000363354, 58.4545973477725056, + 91.056724705180386081, 48.382908916559244972, 11.080089285340363858, 123.93700974907915224, + 44.42574609250004869, 123.18137568215388455, 62.129840943518502172, 110.94224200125972857, + 85.105815237038768828, 59.200145133836485911, 26.170772830741043435, 78.237939570575690595, + 45.331006480457290309, 15.699581403867341578, 95.937006416592339519, 59.555366926480928669, + 26.614093221629445907, 71.733385374005592894, 48.611688736968062585, 12.553004305758804549, + 2.8304133229466970079, 11.879594140486005927, 74.462418714276282117, 85.167339727417129325, + 67.130722881131077884, 18.33455666354711866, 119.16063735092393472, 113.10692306531927898, + 120.35730611473991303, 13.199576979521225439, 118.92523880290536908, 51.573121535031532403, + 107.04772251756367041, 26.051822720881318673, 36.222395810782472836, 90.068526529415976256, + 67.687113952113577398, 54.437822803534800187, 50.499514741226448677, 121.89535728309419937, + 85.652764464950450929, 43.630201375584874768, 77.952717901825963054, 27.075097139335412066, + 82.5626652169485169, 25.413606637579505332, 100.256691920945741, 18.130043177661718801, + 57.949639553211454768, 85.122816671504551778, 33.459776866944594076, 101.98934807033583638, + 118.95839627224995638, 21.28469913206572528, 82.032279181337798946, 42.130909396775678033, + 92.442300073023943696, 3.9263861989566066768, 101.02951462121563964, 82.748677036750450497, + 39.6232013322187413, 54.881611934062675573, 28.16351610716083087, 121.17394072200841038, + 105.52055773511528969, 74.988498723629163578, 68.618109845167055028, 7.7411859118546999525, + 9.8355758834622974973, 125.93708057955518598, 27.177926654076145496, 124.74164304984151386, + 123.64446617223438807, 102.32193497722619213, 20.403142599043349037, 18.038883963952685008, + 28.777418153120379429, 31.549534075831616065, 45.246989287497854093, 113.12955651928132284, + 47.804353905074094655, 47.901723593015049119, 48.932785100078035612, 105.9518476785524399, + 6.8588088129399693571, 78.415742909313848941, 19.354877127196232323, 52.001815844869270222, + 62.623194403990055434, 1.7793505783520231489, 89.292872567770245951, 26.915843222235707799, + 110.30572635912903934, 4.9178809315417311154, 119.01339020356317633, 30.131959974569326732, + 22.229460462072893279, 67.43079927296275855, 19.455932710850902367, 119.31369856393212103, + 126.11686877560714493, 52.905716912526258966, 84.730179910464357818, 78.219045292524242541, + 100.0765550964497379, 6.6502061619030428119, 23.886466878011560766, 88.999095916500664316, + 5.5939931383036309853, 49.41896519901274587, 52.851489819393464131, 4.8580266907083569095, + 105.89841668850567658, 79.459226119302911684, 94.8095978791534435, 82.58043404664931586, + 95.691887698376376648, 10.751556925370095996, 109.68236942564544734, 16.302644435043475823, + 30.222993250557919964, 54.065600576515862485, 69.156647690451791277, 126.76566193094913615, + 49.023530324637249578, 78.457415348919312237, 111.00857049949991051, 12.881651337829680415, + 0.57287917199209914543, 109.09051855227880878, 107.81720481958473101, 41.95776320811273763, + 63.492979538335930556, 91.788864511927386047, 111.05060742741261492, 15.185490585176012246, + 115.36204766897571972, 15.883836804183374625, 9.1044709508678351995, 57.412141433142096503, + 70.08089620474493131, 120.34603358284584829, 49.453127926670276793, 67.08875952972448431, + 105.68759365188816446, 37.410878146452887449, 85.304650289417622844, 64.520017844253743533, + 42.614817371460958384, 31.060736355848348467, 107.61066230226788321, 96.425462580344174057, + 74.487094061325478833, 21.672953171058907174, 71.750103159913123818, 126.44067344371433137, + 106.11874969852942741, 40.99788827074735309, 122.86554778544814326, 25.188964092842070386, + 78.9397491694544442, 126.73315025440751924, 14.836496768410142977, 65.088245641731191427, + 77.347201513770414749, 66.860856618670368334, 1.2617243892636906821, 121.67944408069161, + 50.898943435418914305, 17.026231641644699266, 108.16987194296962116, 26.321389867112884531, + 88.865879200322524412, 89.797566683264449239, 42.821888911210407969, 3.2489575301005970687, + 42.220760708562011132, 103.0808883531644824, 117.85877856878505554, 93.998649361637944821, + 103.75449024381305207, 38.856343885188834975, 34.209091774919215823, 9.0393525542749557644, + 97.172937170671502827, 11.566946304377779597, 69.75066095339570893, 42.286262910794903291, + 124.74219969383193529, 93.850801387743558735, 78.014765921889193123, 89.580023037735372782, + 89.202745205533574335, 18.366799002331390511, 4.6332821945870819036, 125.66195801324647618, + 47.197195847762486665, 18.081760644196037902, 46.356151888227032032, 60.942331359936360968, + 127.28700724437294411, 77.770239066991052823, 123.38301991479238495, 119.92916326649719849, + 108.64220061582454946, 38.295680463939788751, 124.15464690811131732, 70.612220499198883772, + 83.000255634658969939, 16.588651439436944202, 42.569347015822131652, 38.710650678658566903, + 114.28294271757113165, 116.82253830558693153, 81.270740972868225072, 103.60077001134413877, + 63.337985703241429292, 125.72666516922981828, 98.380040441974415444, 3.1317218997064628638, + 50.282019930971728172, 122.55532537645922275, 23.01617703769079526, 21.416794437565840781, + 114.45703541433613282, 119.41227613859155099, 126.38231437337162788, 81.222309786058758618, + 44.799901251837582095, 45.360627247762749903, 33.25696867577789817, 2.2891194652984268032, + 15.197261812751094112, 99.830375957411888521, 120.09815927732051932, 57.988768376901134616, + 12.52364911166660022, 51.653111550513131078, 119.62054997298037051, 4.0844046362326480448, + 5.7860110795882064849, 34.131619460731599247, 96.105758664838504046, 124.50689224963571178, + 21.646037804748630151, 55.192275503650307655, 64.077320612461335259, 36.981864325134665705, + 45.729023017673171125, 77.073929237292759353, 78.75889045085204998, 81.822480505546991481, + 46.928452619900781428, 9.7199356293458549771, 54.364669922037137439, 1.9823000892356503755, + 2.7249006518322858028, 104.44595718958953512, 112.96168737050902564, 93.430498976831586333, + 77.217395225979998941, 82.571615995919273701, 119.47479866402863991, 59.161219841782440199, + 63.791902237353497185, 43.747121572891046526, 62.762109002371289534, 56.185203740675206063, + 63.337268531151494244, 119.2467860262368049, 87.493356749881058931, 85.981539907606929773, + 48.251498200432251906, 73.700338749938964611, 70.834998327707580756, 74.07210003971340484, + 53.13749853776243981, 21.049468321776657831, 72.23822302880580537, 45.732369512847071746, + 55.715354477339133155, 77.553785137366503477, 58.983735242607508553, 62.836514664191781776, + 79.810396016298909672, 37.743014824387500994, 49.869980776944430545, 67.313216923328582197, + 12.386704134212777717, 89.732310801475250628, 119.70324622936823289, 54.848904679787665373, + 26.683602531364158494, 32.542828948618989671, 37.97658053694976843, 109.02864428252723883, + 23.697771155006194022, 111.72649836307027726, 54.884757020125107374, 99.715452509044553153, + 112.50094732235083939, 63.941400581916241208, 32.803184872580459341, 21.458475520819774829, + 123.21445995280009811, 79.166862391532049514, 53.878993499107309617, 25.430567445506312652, + 78.440578031164477579, 31.678099885601113783, 19.569093138783500763, 45.139519745724101085, + 38.157314990781742381, 66.881846239324659109, 84.649625142144941492, 62.660006018726562615, + 95.429991018110740697, 53.147716072911862284, 116.84684029660638771, 4.4154198805263149552, + 113.43076473276232718, 126.30859411329583963, 80.13830872343169176, 77.160257165691291448, + 10.364002405131031992, 25.481479292688163696, 119.02902883020215086, 85.753195117740688147, + 32.505696469292161055, 0.31201416231851908378, 1.9701081973325926811, 106.04966675960895373, + 42.991618522770295385, 102.56713103465153836, 22.480451896240992937, 52.328447650506859645, + 68.983635118584061274, 53.684258455665258225, 83.263329418394278036, 122.73885404892280349, + 21.220703192240762291, 16.858127049134054687, 39.834029929148528026, 38.709037830667512026, + 8.8009650196217990015, 42.63326968194814981, 92.645732978544401703, 42.02349656079968554, + 76.272964129526371835, 89.099041476492857328, 35.474883281058282591, 77.597159199831367005, + 122.3018421820270305, 70.820918433477345388, 14.68190801552918856, 123.66674315523778205, + 70.571996520895481808, 29.65823032142361626, 114.12136123514574138, 20.976248973336623749, + 66.138078152285743272, 64.066828727667598287, 26.60818096534057986, 8.2679998231797071639, + 50.677423324155824957, 47.43078310839337064, 26.653318374836089788, 20.864820161950774491, + 11.440844424600072671, 116.90919469554864918, 54.113449410360772163, 96.765817833118489943, + 22.160178570684365695, 119.87401949815830449, 88.851492185003735358, 118.36275136430776911, + 124.25968188704064232, 93.884484002523095114, 42.211630474077537656, 118.40029026767297182, + 52.34154566148572485, 28.475879141151381191, 90.662012960914580617, 31.399162807738321135, + 63.874012833184679039, 119.11073385296185734, 53.228186443262529792, 15.466770748011185788, + 97.22337747393612517, 25.106008611517609097, 5.6608266458933940157, 23.759188280975649832, + 20.924837428556202212, 42.334679454837896628, 6.2614457622621557675, 36.669113327097875299, + 110.32127470185150742, 98.213846130642195931, 112.71461222947982606, 26.399153959046088858, + 109.85047760581073817, 103.14624307006670278, 86.095445035127340816, 52.103645441762637347, + 72.444791621568583651, 52.137053058835590491, 7.3742279042271547951, 108.87564560706960037, + 100.99902948245653533, 115.79071456619203673, 43.305528929900901858, 87.260402751173387514, + 27.905435803651926108, 54.150194278674462112, 37.125330433897033799, 50.827213275162648642, + 72.513383841891482007, 36.260086355323437601, 115.89927910642654751, 42.245633343009103555, + 66.919553733892826131, 75.978696140675310744, 109.91679254449991276, 42.569398264135088539, + 36.064558362675597891, 84.261818793554994045, 56.884600146047887392, 7.8527723979168513324, + 74.059029242434917251, 37.497354073500900995, 79.246402664437482599, 109.76322386812535115, + 56.327032214325299719, 114.34788144402045873, 83.041115470234217355, 21.976997447261965135, + 9.2362196903341100551, 15.482371823709399905, 19.671151766928232973, 123.87416115911037195, + 54.355853308155928971, 121.48328609968666569, 119.28893234447241412, 76.643869954452384263, + 40.806285198086698074, 36.077767927905370016, 57.554836306240758859, 63.099068151663232129, + 90.493978574999346165, 98.25911303856264567, 95.60870781014818931, 95.803447186030098237, + 97.865570200159709202, 83.903695357104879804, 13.717617625883576693, 28.831485818627697881, + 38.709754254392464645, 104.00363168973854044, 125.24638880798011087, 3.5587011567076842766, + 50.585745135540491901, 0, 92.611452718258078676, 9.8357618630871002097, + 110.02678040712635266, 60.263919949138653465, 44.458920924149424536, 6.8615985459255171008, + 38.911865421705442714, 110.62739712786788004, 124.23373755121428985, 105.81143382505615591, + 41.460359820932353614, 28.43809058505212306, 72.153110192899475805, 13.300412323806085624, + 47.772933756026759511, 49.998191833001328632, 11.187986276607261971, 98.837930398025491741, + 105.70297963878692826, 9.7160533814203517977, 83.796833377014991129, 30.918452238609461347, + 61.61919575831052498, 37.160868093302269699, 63.383775396752753295, 21.503113850743829971, + 91.364738851290894672, 32.605288870086951647, 60.445986501115839928, 108.13120115303536295, + 10.313295380907220533, 125.5313238618982723, 98.047060649278137134, 28.914830697842262452, + 94.017140998999821022, 25.76330267565936083, 1.1457583439878362697, 90.181037104561255546, + 87.634409639169462025, 83.915526416225475259, 126.98595907667549909, 55.577729023858410073, + 94.10121485482522985, 30.370981170355662471, 102.72409533795143943, 31.767673608366749249, + 18.208941901735670399, 114.82428286628783098, 12.1617924094935006, 112.69206716569169657, + 98.906255853344191564, 6.1775190594526065979, 83.375187303776328918, 74.821756292909412878, + 42.609300578838883666, 1.0400356885074870661, 85.229634742921916768, 62.121472711700334912, + 87.22132460453940439, 64.850925160691986093, 20.974188122650957666, 43.345906342121452326, + 15.500206319829885615, 124.88134688743230072, 84.237499397058854811, 81.995776541498344159, + 117.73109557089628652, 50.37792818568777875, 29.879498338912526378, 125.46630050881503848, + 29.672993536823923932, 2.1764912834660208318, 26.694403027544467477, 5.7217132373407366686, + 2.5234487785310193431, 115.35888816138321999, 101.79788687083782861, 34.052463283293036511, + 88.339743885939242318, 52.64277973422940704, 49.731758400648686802, 51.595133366528898478, + 85.643777822420815937, 6.4979150602011941373, 84.441521417127660243, 78.161776706332602771, + 107.71755713757374906, 59.997298723279527621, 79.50898048762610415, 77.712687770377669949, + 68.418183549838431645, 18.078705108553549508, 66.345874341343005653, 23.133892608759197174, + 11.501321906791417859, 84.572525821593444562, 121.48439938766750856, 59.701602775490755448, + 28.029531843782024225, 51.160046075474383542, 50.405490411067148671, 36.733598004662781022, + 9.266564389177801786, 123.32391602649295237, 94.394391695524973329, 36.163521288392075803, + 92.712303776454064064, 121.88466271987635992, 126.57401448874952621, 27.540478133985743625, + 118.76603982958840788, 111.85832653299803496, 89.284401231649098918, 76.591360927883215481, + 120.30929381622627261, 13.224440998401405523, 38.000511269317939878, 33.177302878873888403, + 85.138694031644263305, 77.421301357320771785, 100.56588543514590128, 105.64507661117750104, + 34.541481945740088122, 79.201540022688277531, 126.67597140648649656, 123.45333033846327453, + 68.760080883948830888, 6.2634437994129257277, 100.56403986194709432, 117.11065075291844551, + 46.032354075381590519, 42.83358887513531954, 100.91407082867590361, 110.82455227718673996, + 124.76462874674689374, 34.444619572117517237, 89.599802503675164189, 90.721254495525499806, + 66.51393735155579634, 4.5782389305968536064, 30.394523625505826203, 71.660751914827415021, + 112.19631855464103865, 115.97753675380226923, 25.04729822333320044, 103.30622310102990014, + 111.24109994596074102, 8.1688092724652960896, 11.57202215917641297, 68.263238921466836473, + 64.211517329680646071, 121.01378449927142356, 43.292075609497260302, 110.38455100730425329, + 0.15464122492267051712, 73.963728650269331411, 91.45804603534998023, 26.147858474589156685, + 29.517780901707737939, 35.644961011093982961, 93.856905239801562857, 19.439871258691709954, + 108.72933984407427488, 3.964600178471300751, 5.4498013036682095844, 80.891914379182708217, + 97.92337474102168926, 58.860997953666810645, 26.43479045196363586, 37.14323199184218538, + 110.94959732805727981, 118.3224396835648804, 127.58380447470699437, 87.494243145782093052, + 125.52421800474257907, 112.37040748135041213, 126.67453706230662647, 110.49357205247724778, + 46.986713499765755842, 43.963079815213859547, 96.502996400868141791, 19.400677499881567201, + 13.669996655418799492, 20.14420007942680968, 106.27499707552487962, 42.098936643556953641, + 16.47644605761161074, 91.464739025694143493, 111.43070895468190429, 27.107570274733006954, + 117.96747048521501711, 125.67302932838720153, 31.620792032597819343, 75.486029648775001988, + 99.739961553892499069, 6.6264338466571643949, 24.773408268429193413, 51.464621602954139234, + 111.40649245873646578, 109.69780935957533075, 53.367205062728316989, 65.085657897237979341, + 75.953161073903174838, 90.057288565054477658, 47.395542310016026022, 95.452996726140554529, + 109.76951404025385273, 71.430905018092744285, 97.001894644701678772, 127.88280116383248242, + 65.606369745160918683, 42.916951041643187637, 118.4289199056038342, 30.333724783064099029, + 107.75798699821461923, 50.861134891016263282, 28.881156062328955159, 63.356199771202227566, + 39.138186277567001525, 90.27903949144820217, 76.314629981567122741, 5.763692478652956197, + 41.299250284289882984, 125.32001203745676321, 62.859982036221481394, 106.29543214582736255, + 105.69368059321277542, 8.8308397610562678892, 98.861529465528292349, 124.61718822659531725, + 32.276617446867021499, 26.320514331382582895, 20.728004810262063984, 50.962958585379965371, + 110.05805766040793969, 43.506390235481376294, 65.01139293858432211, 0.62402832463703816757, + 3.9402163946688233409, 84.099333519217907451, 85.983237045544228749, 77.134262069303076714, + 44.960903792481985874, 104.65689530101735727, 9.9672702371681225486, 107.36851691133415443, + 38.526658836792194052, 117.47770809784560697, 42.441406384481524583, 33.716254098268109374, + 79.668059858297056053, 77.418075661335024051, 17.601930039243598003, 85.266539363899937598, + 57.291465957088803407, 84.046993121603009058, 24.545928259056381648, 50.198082952985714655, + 70.949766562120203162, 27.194318399666371988, 116.60368436405769899, 13.641836866954690777, + 29.363816031062015099, 119.33348631047920207, 13.143993041790963616, 59.316460642850870499, + 100.24272247029148275, 41.952497946676885476, 4.2761563045751245227, 0.13365745533519657329, + 53.21636193068115972, 16.535999646359414328, 101.35484664831164991, 94.861566216786741279, + 53.306636749672179576, 41.729640323901548982, 22.88168884920378332, 105.81838939109729836, + 108.2268988207251823, 65.531635666236979887, 44.320357141372369369, 111.74803899632024695, + 49.702984370011108695, 108.7255027286191762, 120.51936377408492262, 59.768968005046190228, + 84.42326094815871329, 108.80058053534594364, 104.6830913229714497, 56.951758282306400361, + 53.324025921829161234, 62.79832561547664227, 127.74802566637299606, 110.22146770592371468, + 106.45637288652505958, 30.933541496026009554, 66.446754947872250341, 50.212017223035218194, + 11.321653291786788031, 47.518376561951299664, 41.849674857112404425, 84.669358909675793257, + 12.522891524524311535, 73.338226654199388577, 92.642549403706652811, 68.42769226128802984, + 97.429224458959652111, 52.798307918095815694, 91.700955211625114316, 78.292486140137043549, + 44.190890070254681632, 104.20729088352891267, 16.889583243137167301, 104.27410611767118098, + 14.748455808457947569, 89.751291214142838726, 73.998058964916708646, 103.58142913238407345, + 86.611057859805441694, 46.520805502346775029, 55.810871607303852215, 108.30038855734892422, + 74.250660867794067599, 101.65442655032893526, 17.026767683782964014, 72.520172710650513181, + 103.79855821285309503, 84.491266686021845089, 5.83910746778929024, 23.957392281354259467, + 91.83358508899982553, 85.138796528270177078, 72.129116725354833761, 40.52363758710998809, + 113.76920029209577478, 15.705544795837340644, 20.118058484869834501, 74.994708147005439969, + 30.492805328878603177, 91.526447736250702292, 112.65406442865423742, 100.69576288804455544, + 38.08223094046843471, 43.95399489452393027, 18.47243938066822011, 30.96474364741879981, + 39.342303533860103926, 119.74832231822074391, 108.71170661631549592, 114.96657219937696937, + 110.57786468894846621, 25.287739908904768527, 81.612570396173396148, 72.155535855810740031, + 115.10967261248151772, 126.19813630333010224, 52.987957150002330309, 68.518226077128929319, + 63.217415620300016599, 63.606894372063834453, 67.731140400323056383, 39.807390714209759608, + 27.435235251767153386, 57.662971637255395763, 77.419508508788567269, 80.007263379480718868, + 122.49277761596022174, 7.1174023134153685533, 101.1714902710809838, 0, + 57.222905436516157351, 19.671523726177838398, 92.053560814252705313, 120.52783989827730693, + 88.917841848298849072, 13.723197091851034202, 77.823730843414523406, 93.254794255739398068, + 120.46747510243221768, 83.622867650112311821, 82.920719641864707228, 56.8761811701078841, + 16.306220385798951611, 26.600824647612171248, 95.545867512053519022, 99.996383666002657264, + 22.37597255321816192, 69.67586079605462146, 83.405959277573856525, 19.432106762844341574, + 39.593666754029982258, 61.836904477218922693, 123.23839151662104996, 74.321736186604539398, + 126.76755079350550659, 43.006227701491297921, 54.729477702581789345, 65.210577740173903294, + 120.89197300223531784, 88.262402306070725899, 20.626590761818079045, 123.06264772380018258, + 68.094121298556274269, 57.829661395688162884, 60.034281997999642044, 51.526605351318721659, + 2.2915166879793105181, 52.362074209126149071, 47.268819278342562029, 39.831052832454588497, + 125.97191815335099818, 111.15545804772045813, 60.202429709650459699, 60.74196234071496292, + 77.448190675902878866, 63.535347216733498499, 36.417883803474978777, 101.64856573257566197, + 24.323584818990639178, 97.384134331387031125, 69.812511706688383128, 12.355038118908851175, + 38.750374607556295814, 21.643512585818825755, 85.218601157677767333, 2.080071377018612111, + 42.459269485843833536, 124.2429454234043078, 46.44264920908244676, 1.7018503213839721866, + 41.948376245301915333, 86.691812684242904652, 31.000412639663409209, 121.76269377486823942, + 40.474998794121347601, 35.991553083000326296, 107.46219114179257303, 100.7558563713755575, + 59.758996677828690736, 122.93260101763007697, 59.345987073647847865, 4.3529825669320416637, + 53.388806055088934954, 11.443426474681473337, 5.0468975570656766649, 102.71777632277007797, + 75.59577374167565722, 68.104926566589711001, 48.679487771878484637, 105.28555946845881408, + 99.463516801297373604, 103.19026673306143493, 43.287555644841631874, 12.995830120406026253, + 40.883042834258958464, 28.323553412668843521, 87.43511427514749812, 119.99459744656269322, + 31.017960975255846279, 27.425375540758977877, 8.8363670996768632904, 36.157410217110736994, + 4.6917486826860113069, 46.267785217518394347, 23.002643813586473698, 41.145051643190527102, + 114.96879877533501713, 119.4032055509815109, 56.05906368756404845, 102.32009215094876708, + 100.81098082213429734, 73.467196009325562045, 18.533128778359241551, 118.64783205298954272, + 60.788783391049946658, 72.327042576787789585, 57.424607552911766106, 115.76932543975635781, + 125.14802897749905242, 55.080956267975125229, 109.53207965918045375, 95.716653065999707906, + 50.568802463301835814, 25.182721855770068942, 112.61858763245254522, 26.448881996802811045, + 76.001022538635879755, 66.354605757751414785, 42.277388063292164588, 26.84260271464518155, + 73.131770870295440545, 83.290153222355002072, 69.082963891483814223, 30.403080045380193042, + 125.3519428129766311, 118.90666067693018704, 9.5201617678976617754, 12.526887598829489434, + 73.128079723897826625, 106.22130150583689101, 92.064708150763181038, 85.667177750274277059, + 73.828141657355445204, 93.649104554377117893, 121.52925749349378748, 68.889239144238672452, + 51.199605007353966357, 53.44250899105463759, 5.0278747031115926802, 9.1564778611937072128, + 60.789047251015290385, 15.321503829658468021, 96.392637109285715269, 103.95507350760453846, + 50.094596446670038858, 78.61244620206343825, 94.482199891921482049, 16.337618544930592179, + 23.144044318356463918, 8.5264778429373109248, 0.42303465936493012123, 114.02756899854284711, + 86.584151218998158583, 92.769102014608506579, 0.30928244984897901304, 19.9274573005423008, + 54.916092070699960459, 52.295716949178313371, 59.035561803415475879, 71.289922022191603901, + 59.713810479603125714, 38.879742517387057887, 89.458679688148549758, 7.9292003569426015019, + 10.899602607340057148, 33.783828758369054412, 67.846749482043378521, 117.72199590733362129, + 52.86958090392727172, 74.286463983688008739, 93.899194656118197599, 108.64487936713339877, + 127.16760894941762672, 46.988486291567824082, 123.04843600948879612, 96.740814962704462232, + 125.34907412461689091, 92.98714410495449556, 93.973426999531511683, 87.926159630431357073, + 65.005992801736283582, 38.801354999763134401, 27.339993310837598983, 40.288400158857257338, + 84.549994151049759239, 84.197873287113907281, 32.95289211522685946, 54.929478051391924964, + 94.861417909363808576, 54.215140549469651887, 107.93494097043367219, 123.34605865677440306, + 63.241584065199276665, 22.972059297553641954, 71.479923107784998138, 13.25286769331432879, + 49.546816536858386826, 102.92924320591191645, 94.812984917476569535, 91.395618719150661491, + 106.73441012546027196, 2.1713157944795966614, 23.906322147809987655, 52.114577130108955316, + 94.791084620035690023, 62.905993452284747036, 91.539028080511343433, 14.861810036189126549, + 66.003789289406995522, 127.76560232766860281, 3.2127394903218373656, 85.833902083290013252, + 108.85783981120766839, 60.667449566131836036, 87.515973996429238468, 101.72226978203252656, + 57.762312124657910317, 126.71239954240445513, 78.276372555137641029, 52.55807898290004232, + 24.629259963134245481, 11.527384957305912394, 82.598500568583403947, 122.64002407491352642, + 125.71996407244660077, 84.590864291658363072, 83.387361186425550841, 17.661679522116173757, + 69.723058931060222676, 121.23437645319063449, 64.553234893734042998, 52.641028662765165791, + 41.456009620524127968, 101.92591717076356872, 92.116115320815879386, 87.012780470966390567, + 2.0227858771686442196, 1.2480566492740763351, 7.8804327893412846606, 40.198667038439452881, + 43.966474091092095478, 26.268524138606153429, 89.921807584967609728, 81.313790602034714539, + 19.934540474339883076, 86.737033822668308858, 77.053317673588026082, 106.95541619569121394, + 84.882812768963049166, 67.432508196539856726, 31.336119716597750084, 26.836151322670048103, + 35.203860078490833985, 42.533078727799875196, 114.58293191418124479, 40.093986243206018116, + 49.091856518112763297, 100.39616590597506729, 13.899533124240406323, 54.388636799336381955, + 105.20736872811539797, 27.283673733909381554, 58.727632062127668178, 110.66697262095840415, + 26.287986083581927232, 118.63292128570537898, 72.485444940582965501, 83.904995893353770953, + 8.5523126091502490453, 0.26731491067039314657, 106.43272386136231944, 33.071999292722466635, + 74.709693296626937808, 61.723132433573482558, 106.61327349934435915, 83.459280647803097963, + 45.763377698411204619, 83.636778782198234694, 88.453797641454002587, 3.0632713324739597738, + 88.640714282748376718, 95.496077992640493903, 99.405968740025855368, 89.451005457241990371, + 113.03872754816984525, 119.53793601009601844, 40.84652189632106456, 89.601161070695525268, + 81.366182645942899399, 113.90351656461280072, 106.64805184365832247, 125.59665123095692252, + 127.49605133274963009, 92.442935411851067329, 84.912745773050119169, 61.867082992055657087, + 4.8935098957445006818, 100.42403444607043639, 22.643306583573576063, 95.036753123902599327, + 83.699349714228446828, 41.338717819351586513, 25.045783049052261049, 18.676453308402415132, + 57.2850988074169436, 8.8553845225796976592, 66.858448917919304222, 105.59661583619526937, + 55.401910423253866611, 28.584972280274087097, 88.381780140513001243, 80.414581767057825346, + 33.779166486277972581, 80.548212235342361964, 29.496911616919533117, 51.50258242828931543, + 19.996117929837055271, 79.162858264771784889, 45.222115719610883389, 93.041611004693550058, + 111.62174321461134241, 88.600777114701486425, 20.501321735591773177, 75.308853100657870527, + 34.053535367569566006, 17.040345421304664342, 79.597116425709828036, 40.982533372043690179, + 11.67821493557858048, 47.914784562712156912, 55.667170178003289038, 42.277593056543992134, + 16.258233450709667522, 81.047275174223614158, 99.538400584191549569, 31.411089591674681287, + 40.236116969743306981, 21.989416294010879938, 60.985610657760844333, 55.052895472505042562, + 97.308128857312112814, 73.391525776089110877, 76.16446188093686942, 87.90798978904786054, + 36.94487876133644022, 61.92948729483759962, 78.68460706772384583, 111.4966446364451258, + 89.423413232634629821, 101.93314439875757671, 93.155729377896932419, 50.575479817813175032, + 35.225140792350430274, 16.311071711625118041, 102.21934522496667341, 124.39627260666020447, + 105.9759143000082986, 9.0364521542578586377, 126.4348312406000332, 127.21378874413130688, + 7.4622808006461127661, 79.614781428419519216, 54.870470503534306772, 115.3259432745144295, + 26.839017017580772517, 32.014526758965075715, 116.98555523192044348, 14.234804626834375085, + 74.342980542165605584, 0, 114.4458108730323147, 39.343047452359314775, + 56.107121628509048605, 113.05567979655825184, 49.835683696597698145, 27.446394183705706382, + 27.647461686832684791, 58.509588511482434114, 112.93495020486807334, 39.245735300228261622, + 37.841439283729414456, 113.7523623402157682, 32.612440771597903222, 53.201649295227980474, + 63.091735024110676022, 71.992767332005314529, 44.751945106439961819, 11.351721592112880899, + 38.81191855514771305, 38.864213525688683148, 79.187333508059964515, 123.67380895444148337, + 118.4767830332457379, 20.643472373212716775, 125.53510158701101318, 86.012455402982595842, + 109.45895540516721667, 2.4211554803514445666, 113.78394600447427365, 48.524804612141451798, + 41.253181523639796069, 118.12529544760400313, 8.1882425971125485376, 115.65932279137632577, + 120.06856399599928409, 103.05321070263744332, 4.5830333759586210363, 104.72414841825229814, + 94.537638556685124058, 79.662105664912814973, 123.94383630670563434, 94.310916095440916251, + 120.4048594193009194, 121.48392468143356382, 26.896381351805757731, 127.070694433466997, + 72.835767606953595532, 75.297131465151323937, 48.647169637984916335, 66.768268662777700229, + 11.625023413376766257, 24.710076237817702349, 77.500749215112591628, 43.287025171641289489, + 42.437202315355534665, 4.160142754037224222, 84.918538971691305051, 120.48589084680861561, + 92.885298418164893519, 3.4037006427679443732, 83.896752490607468644, 45.383625368485809304, + 62.000825279330456397, 115.52538754973647883, 80.949997588242695201, 71.983106166004290571, + 86.924382283588784048, 73.511712742751115002, 119.51799335566101945, 117.86520203526015393, + 118.69197414729569573, 8.7059651338640833274, 106.77761211017786991, 22.886852949362946674, + 10.093795114134991309, 77.435552645543793915, 23.191547483354952419, 8.2098531331794220023, + 97.358975543760607252, 82.57111893692126614, 70.927033602598385187, 78.380533466122869868, + 86.575111289683263749, 25.991660240812052507, 81.766085668517916929, 56.64710682534132502, + 46.870228550298634218, 111.98919489312538644, 62.035921950511692557, 54.850751081517955754, + 17.672734199353726581, 72.314820434221473988, 9.3834973653720226139, 92.535570435036788695, + 46.005287627172947396, 82.290103286384692183, 101.93759755067367223, 110.80641110196302179, + 112.11812737513173488, 76.640184301901172148, 73.621961644272232661, 18.93439201865112409, + 37.06625755672212108, 109.29566410597908543, 121.5775667821035313, 16.65408515357557917, + 114.84921510582717019, 103.5386508795163536, 122.29605795499810483, 110.16191253595388844, + 91.06415931836454547, 63.433306131999415811, 101.13760492660367163, 50.365443711543775862, + 97.237175264905090444, 52.897763993609260069, 24.002045077275397489, 4.7092115155028295703, + 84.554776126584329177, 53.685205429294001078, 18.263541740594519069, 38.580306444713642122, + 10.165927782967628445, 60.806160090764024062, 122.70388562595690018, 109.81332135386037407, + 19.040323535795323551, 25.053775197662616847, 18.256159447799291229, 84.44260301167742, + 56.129416301530000055, 43.334355500552192098, 19.656283314714528387, 59.298209108757873764, + 115.05851498699121294, 9.7784782884773449041, 102.39921001470793271, 106.88501798210927518, + 10.05574940622318536, 18.312955722387414426, 121.57809450203058077, 30.643007659320574021, + 64.785274218575068517, 79.910147015209076926, 100.1891928933437157, 29.224892404130514478, + 60.964399783842964098, 32.675237089861184359, 46.288088636712927837, 17.05295568587462185, + 0.84606931873349822126, 100.0551379970893322, 45.168302437999955146, 57.538204029217013158, + 0.61856489969795802608, 39.8549146010846016, 109.83218414139992092, 104.59143389835662674, + 118.07112360683458974, 14.579844044383207802, 119.42762095920625143, 77.759485034777753754, + 50.917359376297099516, 15.858400713885203004, 21.799205214680114295, 67.567657516741746804, + 7.6934989640903950203, 107.44399181466724258, 105.73916180785818142, 20.572927967379655456, + 59.798389312240033178, 89.289758734270435525, 126.33521789883525344, 93.976972583139286144, + 118.09687201898123021, 65.481629925412562443, 122.6981482492374198, 57.9742882099126291, + 59.946853999066661345, 47.852319260866352124, 2.0119856034725671634, 77.602709999526268803, + 54.679986621675197966, 80.576800317718152655, 41.099988302103156457, 40.395746574227814563, + 65.905784230453718919, 109.85895610278748791, 61.722835818727617152, 108.43028109894294175, + 87.869881940870982362, 118.69211731354880612, 126.48316813039855333, 45.944118595110921888, + 14.959846215569996275, 26.505735386628657579, 99.09363307372041163, 77.858486411827470874, + 61.625969834956777049, 54.791237438304960961, 85.468820250920543913, 4.3426315889591933228, + 47.81264429561997531, 104.22915426022154861, 61.582169240071380045, 125.81198690457313205, + 55.078056161022686865, 29.723620072381891077, 4.0075785788176290225, 127.53120465533720562, + 6.4254789806473127101, 43.667804166583664482, 89.71567962241533678, 121.33489913226731005, + 47.031947992862114916, 75.444539564065053128, 115.52462424931945861, 125.42479908481254824, + 28.552745110275282059, 105.11615796580008464, 49.258519926268490963, 23.054769914615462767, + 37.197001137170445872, 117.28004814983069082, 123.43992814489683951, 41.181728583320364123, + 38.774722372851101682, 35.323359044235985493, 11.446117862124083331, 114.46875290638490696, + 1.1064697874680859968, 105.28205732553033158, 82.912019241051893914, 75.851834341530775419, + 56.232230641635396751, 46.025560941932781134, 4.0455717543372884393, 2.4961132985481526703, + 15.760865578682569321, 80.397334076878905762, 87.932948182184190955, 52.537048277215944836, + 51.843615169938857434, 34.627581204069429077, 39.869080948683404131, 45.474067645340255694, + 26.106635347179690143, 85.910832391386065865, 41.765625537929736311, 6.8650163930797134526, + 62.672239433195500169, 53.672302645340096205, 70.407720156981667969, 85.066157455603388371, + 101.16586382836248958, 80.187972486412036233, 98.183713036229164572, 72.792331811950134579, + 27.799066248480812646, 108.77727359867640189, 82.414737456230795942, 54.567347467818763107, + 117.45526412425897433, 93.3339452419168083, 52.575972167167492444, 109.26584257141439593, + 16.97088988116956898, 39.809991786707541905, 17.104625218300498091, 0.53462982134442427196, + 84.865447722724638879, 66.143998585448571248, 21.419386593253875617, 123.4462648671506031, + 85.226546998692356283, 38.918561295606195927, 91.526755396826047217, 39.273557564400107367, + 48.907595282908005174, 6.1265426649515575264, 49.281428565500391414, 62.992155985284625785, + 70.811937480055348715, 50.90201091448761872, 98.077455096343328478, 111.07587202019203687, + 81.693043792645767098, 51.202322141394688515, 34.732365291889436776, 99.807033129229239421, + 85.296103687320282916, 123.19330246191748301, 126.99210266550289816, 56.885870823705772636, + 41.825491546100238338, 123.73416598411131417, 9.7870197914926393423, 72.848068892140872777, + 45.286613167150790105, 62.073506247808836633, 39.398699428456893656, 82.677435638703173026, + 50.091566098104522098, 37.352906616804830264, 114.5701976148338872, 17.710769045163033297, + 5.7168978358422464225, 83.193231672390538733, 110.80382084650773322, 57.169944560551812174, + 48.763560281029640464, 32.829163534115650691, 67.558332972559583141, 33.096424470684723929, + 58.993823233839066233, 103.00516485657863086, 39.992235859677748522, 30.325716529543569777, + 90.444231439225404756, 58.083222009390738094, 95.243486429226322798, 49.201554229402972851, + 41.002643471187184332, 22.617706201315741055, 68.107070735139132012, 34.080690842612966662, + 31.194232851419656072, 81.965066744087380357, 23.35642987115716096, 95.829569125424313825, + 111.33434035600657808, 84.555186113087984268, 32.516466901422973024, 34.094550348450866295, + 71.076801168383099139, 62.822179183349362575, 80.472233939486613963, 43.978832588021759875, + 121.97122131552168867, 110.1057909450137231, 66.616257714627863606, 18.783051552181859734, + 24.328923761877376819, 47.815979578095721081, 73.889757522672880441, 123.85897458967883722, + 29.369214135451329639, 94.993289272893889574, 50.846826465272897622, 75.866288797518791398, + 58.311458755793864839, 101.15095963562635006, 70.450281584700860549, 32.622143423253874062, + 76.438690449936984805, 120.79254521332404693, 83.951828600016597193, 18.072904308519355254, + 124.86966248120370437, 126.42757748826261377, 14.924561601295863511, 31.229562856839038432, + 109.74094100707225152, 102.65188654902885901, 53.678034035161545034, 64.029053517933789408, + 105.97111046384088695, 28.469609253672388149, 20.685961084334849147, 0, + 100.89162174606462941, 78.68609490471862955, 112.21424325702173519, 98.111359593116503675, + 99.671367393195396289, 54.892788367411412764, 55.294923373665369581, 117.01917702296850621, + 97.869900409736146685, 78.491470600456523243, 75.68287856746246689, 99.504724680431536399, + 65.224881543195806444, 106.40329859045596095, 126.18347004822499002, 15.985534664010629058, + 89.503890212879923638, 22.703443184225761797, 77.6238371102954261, 77.728427051381004276, + 30.374667016123567009, 119.34761790888660471, 108.95356606649147579, 41.286944746429071529, + 123.07020317402566434, 44.024910805968829663, 90.917910810334433336, 4.8423109607065271121, + 99.5678920089485473, 97.049609224282903597, 82.506363047283230117, 108.25059089520800626, + 16.376485194228735054, 103.31864558275628951, 112.13712799200220616, 78.106421405274886638, + 9.1660667519208800513, 81.448296836508234264, 61.075277113373886095, 31.324211329829267925, + 119.88767261341490666, 60.621832190885470482, 112.80971883860547678, 114.96784936286712764, + 53.792762703615153441, 126.14138886693763197, 17.671535213910829043, 22.594262930302647874, + 97.294339275973470649, 5.5365373255554004572, 23.250046826753532514, 49.420152475639042677, + 27.001498430225183256, 86.574050343282578979, 84.874404630711069331, 8.3202855080780864228, + 41.83707794338624808, 112.97178169362086919, 57.770596836329787038, 6.8074012855395267252, + 39.793504981214937288, 90.767250736971618608, 124.00165055866455077, 103.05077509947659564, + 33.899995176489028381, 15.966212332012219122, 45.848764567181206075, 19.023425485505867982, + 111.03598671132567688, 107.73040407052394585, 109.38394829459139146, 17.411930267731804634, + 85.555224220355739817, 45.773705898725893348, 20.187590228273620596, 26.87110529108758783, + 46.383094966709904838, 16.419706266362481983, 66.717951087524852483, 37.14223787384617026, + 13.854067205200408353, 28.761066932249377714, 45.150222579366527498, 51.983320481627742993, + 35.532171337035833858, 113.29421365068265004, 93.740457100600906415, 95.978389786250772886, + 124.07184390102338511, 109.70150216303591151, 35.34546839871109114, 16.629640868442947976, + 18.766994730747683207, 57.071140870073577389, 92.01057525434953277, 36.580206572773022344, + 75.875195101350982441, 93.612822203929681564, 96.236254750267107738, 25.280368603805982275, + 19.243923288544465322, 37.86878403730224818, 74.13251511344788014, 90.591328211961808847, + 115.15513356420706259, 33.308170307154796319, 101.69843021165797836, 79.077301759036345175, + 116.59211590999984764, 92.323825071911414852, 54.12831863672909094, 126.8666122640024696, + 74.275209853207343258, 100.7308874230911897, 66.474350529810180888, 105.79552798721852014, + 48.004090154550794978, 9.4184230310092971195, 41.109552253168658353, 107.37041085858800216, + 36.527083481189038139, 77.160612889427284244, 20.331855565935256891, 121.6123201815316861, + 117.40777125191743835, 91.626642707720748149, 38.080647071590647101, 50.107550395325233694, + 36.512318895602220437, 40.885206023354839999, 112.25883260306000011, 86.668711001104384195, + 39.312566629429056775, 118.59641821751938551, 102.11702997398242587, 19.556956576958327787, + 76.798420029419503408, 85.770035964218550362, 20.111498812446370721, 36.62591144477846683, + 115.15618900406116154, 61.286015318644786021, 1.5705484371537750121, 31.820294030421791831, + 72.378385786687431391, 58.449784808261028957, 121.9287995676859282, 65.350474179722368717, + 92.576177273425855674, 34.105911371749243699, 1.6921386374706344213, 72.110275994178664405, + 90.336604875999910291, 115.07640805843402632, 1.2371297993959160522, 79.709829202172841178, + 91.664368282803479815, 81.182867796716891462, 108.14224721366917947, 29.159688088770053582, + 110.85524191841614083, 27.518970069555507507, 101.83471875259419903, 31.716801427770406008, + 43.598410429363866569, 7.1353150334834936075, 15.386997928184428019, 86.887983629338123137, + 83.478323615716362838, 41.145855934759310912, 119.59677862448370433, 50.579517468544509029, + 124.67043579767414485, 59.953945166282210266, 108.1937440379660984, 2.9632598508287628647, + 117.39629649847483961, 115.9485764198252582, 119.89370799813332269, 95.704638521732704248, + 4.0239712069487723056, 27.205419999052537605, 109.35997324335403391, 33.153600635436305311, + 82.199976604206312913, 80.791493148459267104, 3.8115684609110758174, 91.717912205574975815, + 123.44567163745887228, 88.860562197889521485, 47.739763881745602703, 109.38423462710125023, + 124.96633626079710666, 91.888237190221843775, 29.91969243113999255, 53.011470773260953138, + 70.18726614744446124, 27.716972823654941749, 123.2519396699135541, 109.5824748766135599, + 42.937640501841087826, 8.6852631779183866456, 95.625288591243588598, 80.458308520443097223, + 123.16433848014639807, 123.6239738091462641, 110.15611232204537373, 59.447240144763782155, + 8.0151571576388960239, 127.06240931067441124, 12.85095796129462542, 87.335608333170966944, + 51.431359244834311539, 114.6697982645346201, 94.06389598572786781, 22.889079128133744234, + 103.04924849864255521, 122.84959816962509649, 57.105490220554202097, 82.232315931600169279, + 98.517039852536981925, 46.109539829230925534, 74.394002274344529724, 106.56009629966501961, + 118.87985628979367903, 82.363457166640728246, 77.549444745702203363, 70.646718088471970987, + 22.892235724251804641, 100.93750581276981393, 2.2129395749398099724, 82.564114651064301142, + 37.824038482107425807, 23.703668683061550837, 112.4644612832707935, 92.051121883865562268, + 8.0911435086745768785, 4.9922265970963053405, 31.521731157368776621, 32.794668153761449503, + 47.86589636436838191, 105.07409655443188967, 103.68723033987771487, 69.255162408138858154, + 79.738161897366808262, 90.948135290680511389, 52.213270694363018265, 43.82166478277213173, + 83.531251075859472621, 13.730032786159426905, 125.34447886639100034, 107.34460529068383039, + 12.815440313966973918, 42.132314911210414721, 74.331727656728617148, 32.375944972827710444, + 68.367426072461967124, 17.584663623900269158, 55.598132496965263272, 89.554547197356441757, + 36.829474912461591884, 109.13469493564116419, 106.91052824852158665, 58.667890483833616599, + 105.15194433433862287, 90.531685142828791868, 33.94177976233913796, 79.619983573415083811, + 34.209250436600996181, 1.0692596426924865227, 41.730895445452915737, 4.287997170897142496, + 42.838773186511389213, 118.89252973430484417, 42.453093997384712566, 77.837122591216029832, + 55.053510793652094435, 78.547115128800214734, 97.815190565816010348, 12.253085329903115053, + 98.562857131000782829, 125.98431197057288955, 13.62387496011069743, 101.80402182897887542, + 68.154910192690294934, 94.151744040387711721, 35.386087585291534197, 102.40464428278937703, + 69.46473058378251153, 71.614066258462116821, 42.59220737464420381, 118.38660492383860401, + 125.98420533100579632, 113.77174164741154527, 83.650983092204114655, 119.46833196822262835, + 19.574039582988916663, 17.696137784281745553, 90.573226334301580209, 124.14701249561767327, + 78.797398856917425292, 37.354871277406346053, 100.1831321962090442, 74.705813233613298507, + 101.1403952296677744, 35.421538090326066595, 11.433795671688130824, 38.386463344784715446, + 93.607641693015466444, 114.33988912110362435, 97.527120562059280928, 65.658327068234939361, + 7.1166659451191662811, 66.192848941369447857, 117.98764646768177045, 78.010329713157261722, + 79.984471719355497044, 60.651433059090777533, 52.888462878450809512, 116.16644401878511417, + 62.486972858452645596, 98.403108458805945702, 82.005286942374368664, 45.235412402635120088, + 8.2141414702782640234, 68.161381685225933325, 62.388465702842950122, 35.930133488174760714, + 46.712859742317959899, 63.659138250852265628, 94.668680712016794132, 41.110372226175968535, + 65.032933802845946047, 68.189100696905370569, 14.153602336766198277, 125.64435836670236313, + 32.944467878973227926, 87.957665176047157729, 115.94244263104701531, 92.211581890031084185, + 5.2325154292557272129, 37.566103104363719467, 48.657847523754753638, 95.631959156195080141, + 19.779515045349398861, 119.71794917935767444, 58.738428270906297257, 61.986578545787779149, + 101.69365293054943322, 23.732577595037582796, 116.62291751159136766, 74.301919271256338106, + 12.900563169401721098, 65.244286846511386102, 24.87738089987760759, 113.58509042665173183, + 39.903657200033194385, 36.145808617042348487, 121.73932496241104673, 124.85515497652522754, + 29.849123202591727022, 62.459125713681714842, 91.481882014148141025, 77.303773098057718016, + 107.35606807032672805, 0.058107035871216794476, 83.942220927681773901, 56.939218507344776299, + 41.371922168669698294, 0, 73.78324349213289679, 29.372189809440897079, + 96.428486514047108358, 68.222719186236645328, 71.342734786390792578, 109.78557673482282553, + 110.58984674733437714, 106.03835404594065039, 67.739800819475931348, 28.982941200916684465, + 23.365757134928571759, 71.009449360866710776, 2.4497630863952508662, 84.806597180915559875, + 124.36694009644998005, 31.971069328024896095, 51.007780425759847276, 45.406886368455161573, + 27.24767422059449018, 27.456854102762008552, 60.749334032250771997, 110.6952358177768474, + 89.907132132982951589, 82.573889492861781036, 118.14040634805132868, 88.049821611941297306, + 53.835821620668866672, 9.6846219214166922029, 71.135784017900732579, 66.099218448569445172, + 37.012726094570098212, 88.501181790416012518, 32.752970388461108087, 78.637291165516217006, + 96.274255984008050291, 28.212842810549773276, 18.332133503845398081, 34.896593673016468529, + 122.15055422674777219, 62.648422659662173828, 111.77534522682981333, 121.24366438177457894, + 97.619437677214591531, 101.93569872573425528, 107.58552540723394486, 124.28277773387526395, + 35.343070427821658086, 45.188525860608933726, 66.588678551946941298, 11.073074651110800914, + 46.500093653507065028, 98.840304951278085355, 54.002996860454004491, 45.148100686568795936, + 41.748809261422138661, 16.640571016156172846, 83.674155886776134139, 97.943563387241738383, + 115.54119367265957408, 13.61480257107905345, 79.587009962433512555, 53.534501473946875194, + 120.00330111733273952, 78.101550198953191284, 67.799990352978056762, 31.932424664024438243, + 91.697529134362412151, 38.046850971015373943, 94.071973422654991737, 87.460808141051529674, + 90.767896589182782918, 34.823860535467247246, 43.110448440711479634, 91.547411797451786697, + 40.375180456547241192, 53.742210582175175659, 92.766189933419809677, 32.839412532728601946, + 5.4359021750497049652, 74.284475747692340519, 27.708134410400816705, 57.522133864498755429, + 90.300445158733054996, 103.96664096325548599, 71.064342674075305695, 98.58842730136893806, + 59.480914201205450809, 63.956779572505183751, 120.14368780205040821, 91.403004326071823016, + 70.690936797422182281, 33.259281736885895953, 37.533989461495366413, 114.14228174015079276, + 56.02115050869906554, 73.160413145549682667, 23.75039020270560286, 59.225644407863001106, + 64.472509500534215476, 50.56073720761196455, 38.487846577088930644, 75.737568074608134339, + 20.265030226899398258, 53.182656423927255673, 102.31026712841412518, 66.616340614313230617, + 75.396860423319594702, 30.154603518076328328, 105.18423182000333327, 56.647650143822829705, + 108.25663727346181986, 125.73322452800857718, 20.550419706418324495, 73.461774846186017385, + 4.948701059623999754, 83.591055974437040277, 96.008180309101589955, 18.836846062018594239, + 82.219104506340954686, 86.740821717176004313, 73.054166962381714256, 26.321225778854568489, + 40.663711131874151761, 115.22464036306701018, 106.81554250383851468, 55.253285415441496298, + 76.161294143181294203, 100.21510079065046739, 73.024637791204440873, 81.770412046713317977, + 96.5176652061236382, 45.33742200220876839, 78.625133258861751528, 109.19283643504240899, + 76.234059947964851744, 39.113913153920293553, 25.596840058842644794, 43.540071928437100723, + 40.222997624892741442, 73.251822889560571639, 102.31237800812232308, 122.57203063728957204, + 3.1410968743075500242, 63.640588060847221641, 16.756771573374862783, 116.89956961652569589, + 115.85759913537549437, 2.7009483594483754132, 57.152354546851711348, 68.211822743498487398, + 3.3842772749449068215, 16.220551988360966789, 52.673209752003458561, 102.15281611686805263, + 2.4742595987954700831, 31.419658404349320335, 55.328736565610597609, 34.365735593437420903, + 88.284494427338358946, 58.319376177543745143, 93.710483836832281668, 55.037940139114652993, + 75.669437505188398063, 63.433602855540812016, 87.196820858727733139, 14.270630066966987215, + 30.773995856372494018, 45.775967258679884253, 38.956647231432725675, 82.291711869522259803, + 111.19355724896740867, 101.15903493709265604, 121.3408715953482897, 119.90789033256805851, + 88.387488075932196807, 5.9265197016611637082, 106.7925929969533172, 103.89715283965415438, + 111.78741599627028336, 63.409277043465408497, 8.0479424138975446112, 54.410839998108713189, + 90.719946486708067823, 66.3072012708762486, 36.399953208416263806, 33.582986296918534208, + 7.6231369218257896136, 55.435824411153589608, 118.89134327492138254, 49.72112439577904297, + 95.479527763494843384, 90.76846925420613843, 121.9326725215978513, 55.776474380443687551, + 59.8393848622799851, 106.02294154652554425, 12.374532294888922479, 55.433945647313521476, + 118.50387933983074618, 91.1649497532271198, 85.875281003682175651, 17.37052635584041127, + 63.250577182490815176, 32.916617040889832424, 118.32867696029643412, 119.24794761829616618, + 92.312224644090747461, 118.89448028952756431, 16.030314315281430027, 126.12481862134882249, + 25.701915922592888819, 46.671216666341933887, 102.86271848967226106, 101.33959652907287818, + 60.12779197145573562, 45.778158256271126447, 78.098496997288748389, 117.69919633925019298, + 114.21098044111204217, 36.464631863203976536, 69.034079705073963851, 92.219079658465489047, + 20.788004548692697426, 85.120192599333677208, 109.75971257959099603, 36.726914333285094472, + 27.098889491408044705, 13.293436176943941973, 45.78447144850724726, 73.875011625539627858, + 4.4258791498832579236, 37.128229302128602285, 75.648076964214851614, 47.407337366126739653, + 96.928922566545224981, 56.102243767731124535, 16.182287017349153757, 9.9844531941926106811, + 63.043462314737553243, 65.589336307522899006, 95.731792728740401799, 82.148193108867417322, + 79.374460679759067716, 10.510324816281354288, 31.476323794737254502, 53.896270581361022778, + 104.42654138872603653, 87.643329565547901439, 39.062502151718945242, 27.460065572322491789, + 122.68895773278563865, 86.68921058136766078, 25.630880627933947835, 84.26462982242446742, + 20.663455313457234297, 64.751889945659058867, 8.7348521449239342473, 35.169327247800538316, + 111.19626499393416452, 51.109094394712883513, 73.658949824926821748, 90.269389871285966365, + 85.821056497043173295, 117.33578096767087118, 82.303888668680883711, 53.063370285657583736, + 67.883559524681913899, 31.239967146830167621, 68.418500873201992363, 2.1385192853849730454, + 83.461790890905831475, 8.5759943417942849919, 85.677546373026416404, 109.78505946860968834, + 84.90618799477306311, 27.674245182432059664, 110.10702158730782685, 29.094230257604067447, + 67.630381131632020697, 24.506170659809868084, 69.125714262005203636, 123.9686239411457791, + 27.247749920225032838, 75.608043657961388817, 8.3098203853842278477, 60.303488080775423441, + 70.772175170586706372, 76.809288565582392039, 10.92946116756866104, 15.228132516924233641, + 85.184414749292045599, 108.773209847680846, 123.96841066201523063, 99.543483294826728525, + 39.301966184411867289, 110.9366639364452567, 39.148079165977833327, 35.392275568567129085, + 53.146452668606798397, 120.29402499123898451, 29.594797713834850583, 74.709742554816330085, + 72.36626439242172637, 21.411626467230234994, 74.280790459335548803, 70.843076180652133189, + 22.867591343376261648, 76.77292668957306887, 59.215283386034570867, 100.67977824221088667, + 67.054241124122199835, 3.316654136469878722, 14.233331890241970541, 4.3856978827425336931, + 107.97529293536717887, 28.020659426318161422, 31.968943438710994087, 121.30286611818155507, + 105.776925756905257, 104.33288803757022833, 124.97394571690892917, 68.806216917615529383, + 36.010573884748737328, 90.470824805270240176, 16.428282940560166026, 8.3227633704518666491, + 124.77693140568590024, 71.860266976349521428, 93.425719484635919798, 127.31827650170816923, + 61.337361424033588264, 82.220744452355575049, 2.0658676056955300737, 8.3782013938107411377, + 28.307204673536034534, 123.28871673340472626, 65.88893575795009383, 47.915330352097953437, + 103.8848852620976686, 56.423163780062168371, 10.465030858511454426, 75.132206208727438934, + 97.315695047513145255, 63.263918312390160281, 39.5590300907024357, 111.43589835871534888, + 117.47685654181259451, 123.97315709157919628, 75.387305861098866444, 47.465155190078803571, + 105.24583502318637329, 20.603838542512676213, 25.801126338807080174, 2.4885736930227722041, + 49.754761799758853158, 99.170180853303463664, 79.807314400066388771, 72.291617234088334953, + 115.47864992482573143, 121.71030995305045508, 59.698246405183454044, 124.91825142736706766, + 54.963764028299920028, 26.607546196119074011, 86.712136140653456096, 0.11621407174607156776, + 39.884441855363547802, 113.8784370146895526, 82.743844337343034567, 0, + 19.566486984265793581, 58.744379618885432137, 64.856973028097854694, 8.4454383724769286346, + 14.685469572785223136, 91.571153469649289036, 93.179693494672392262, 84.076708091884938767, + 7.4796016389518626966, 57.965882401833368931, 46.731514269860781496, 14.018898721733421553, + 4.8995261727941397112, 41.613194361834757729, 120.73388019289996009, 63.942138656049792189, + 102.01556085151969455, 90.813772736910323147, 54.49534844118898036, 54.913708205524017103, + 121.49866806450518197, 93.390471635557332775, 51.814264265969541157, 37.147778985727200052, + 108.28081269610629533, 48.099643223882594611, 107.67164324133773334, 19.369243842837022385, + 14.271568035805103136, 4.1984368971388903446, 74.025452189143834403, 49.002363580832025036, + 65.505940776925854152, 29.274582331036071992, 64.548511968016100582, 56.425685621099546552, + 36.664267007690796163, 69.793187346036575036, 116.30110845349554438, 125.29684531932798564, + 95.550690453663264634, 114.48732876355279586, 67.238875354432821041, 75.871397451472148532, + 87.171050814471527701, 120.5655554677505279, 70.686140855643316172, 90.377051721221505431, + 5.177357103893882595, 22.146149302221601829, 93.000187307017768035, 69.680609902556170709, + 108.00599372090800898, 90.296201373137591872, 83.497618522844277322, 33.28114203231598367, + 39.348311773555906257, 67.887126774487114744, 103.08238734531914815, 27.22960514216174488, + 31.174019924867025111, 107.06900294789738837, 112.00660223466911702, 28.203100397910020547, + 7.5999807059561135247, 63.864849328052514466, 55.395058268724824302, 76.093701942034385866, + 60.143946845313621452, 46.921616282106697327, 53.535793178365565836, 69.647721070934494492, + 86.220896881426597247, 55.094823594903573394, 80.750360913094482385, 107.4844211643539893, + 57.532379866839619353, 65.678825065457203891, 10.871804350103047909, 20.568951495384681039, + 55.41626882080163341, 115.04426772900114884, 52.60089031746974797, 79.93328192651460995, + 14.128685348154249368, 69.176854602737876121, 118.96182840241090162, 127.91355914501400548, + 112.2873756041044544, 54.80600865214728401, 13.381873594844364561, 66.518563473771791905, + 75.067978922994370805, 100.28456348030158551, 112.04230101740176906, 18.320826291099365335, + 47.50078040541120572, 118.45128881572964019, 0.94501900106843095273, 101.1214744152239291, + 76.975693154181499267, 23.475136149216268677, 40.530060453798796516, 106.36531284785814933, + 76.620534256831888342, 5.2326812286300992128, 22.793720846639189404, 60.309207036156294635, + 82.368463640006666537, 113.29530028764929739, 88.513274546927277697, 123.46644905601715436, + 41.100839412840286968, 18.92354969237203477, 9.8974021192516374867, 39.182111948877718532, + 64.016360618203179911, 37.673692124040826457, 36.43820901268554735, 45.481643434355646605, + 18.108333924763428513, 52.642451557709136978, 81.3274222637519415, 102.44928072613765835, + 85.631085007677029353, 110.50657083088663057, 24.322588286366226384, 72.430201581304572755, + 18.049275582412519725, 35.540824093430273933, 65.035330412247276399, 90.674844004421174759, + 29.250266517727141036, 90.385672870088455966, 24.468119895929703489, 78.227826307840587106, + 51.193680117685289588, 87.080143856874201447, 80.445995249789120862, 18.503645779124781257, + 76.624756016248284141, 117.14406127457914408, 6.2821937486151000485, 127.28117612169444328, + 33.513543146753363544, 105.79913923305502976, 103.71519827075098874, 5.4018967188967508264, + 114.30470909370706067, 8.4236454869969747961, 6.7685545498898136429, 32.441103976721933577, + 105.3464195040105551, 76.305632233736105263, 4.9485191975909401663, 62.839316808698640671, + 110.65747313122119522, 68.731471186878479784, 48.568988854676717892, 116.63875235509112827, + 59.420967673664563335, 110.07588027823294397, 23.338875010376796126, 126.86720571108526201, + 46.393641717455466278, 28.54126013393397443, 61.547991712744988035, 91.551934517359768506, + 77.91329446286908933, 36.583423739048157586, 94.387114497938455315, 74.318069874188950052, + 114.68174319070021738, 111.815780665139755, 48.774976151864393614, 11.853039403325965395, + 85.585185993910272373, 79.794305679311946733, 95.574831992540566716, 126.81855408693081699, + 16.095884827795089222, 108.82167999622106436, 53.439892973419773625, 4.6144025417524971999, + 72.799906416832527611, 67.165972593837068416, 15.246273843651579227, 110.8716488223108172, + 109.78268654984276509, 99.44224879156172392, 62.959055526993324747, 53.536938508415914839, + 115.8653450431957026, 111.5529487608873751, 119.67876972456360818, 84.045883093051088508, + 24.749064589777844958, 110.86789129463068093, 109.00775867966513033, 54.329899506457877578, + 43.750562007364351302, 34.74105271168082254, 126.50115436498163035, 65.833234081783302827, + 108.65735392059650621, 110.49589523659597035, 56.6244492881851329, 109.78896057905512862, + 32.060628630566498032, 124.24963724269764498, 51.403831845185777638, 93.342433332687505754, + 77.725436979348160094, 74.679193058145756368, 120.25558394291147124, 91.556316512545890873, + 28.196993994581134757, 107.39839267850402393, 100.42196088222408434, 72.929263726411591051, + 10.06815941015156568, 56.438159316930978093, 41.576009097389032831, 42.240385198670992395, + 91.519425159181992058, 73.453828666570188943, 54.19777898281608941, 26.586872353887883946, + 91.568942897018132498, 19.750023251079255715, 8.8517582997665158473, 74.256458604260842549, + 23.296153928429703228, 94.814674732257117284, 65.857845133090449963, 112.20448753546224907, + 32.364574034698307514, 19.968906388385221362, 126.08692462947874446, 3.1786726150494359899, + 63.463585457484441577, 36.296386217738472624, 30.748921359518135432, 21.020649632562708575, + 62.952647589474509005, 107.79254116272568353, 80.853082777455711039, 47.286659131095802877, + 78.125004303437890485, 54.920131144648621557, 117.37791546557491529, 45.378421162735321559, + 51.261761255871533649, 40.52925964484893484, 41.326910626918106573, 1.503779891318117734, + 17.469704289847868495, 70.338654495604714612, 94.392529987868329044, 102.21818878942940501, + 19.317899649857281474, 52.538779742575570708, 43.642112994089984568, 106.67156193534538033, + 36.607777337361767422, 106.12674057131880545, 7.7671190493638277985, 62.479934293663973222, + 8.8370017464039847255, 4.2770385707735840697, 38.92358178181166295, 17.151988683592207963, + 43.355092746056470787, 91.570118937223014655, 41.81237598954612622, 55.348490364867757307, + 92.214043174615653697, 58.188460515211772872, 7.260762263264041394, 49.012341319623374147, + 10.251428524014045252, 119.9372478822915582, 54.495499840453703655, 23.216087315922777634, + 16.619640770768455695, 120.60697616155448486, 13.544350341177050723, 25.618577131164784078, + 21.858922335137322079, 30.456265033852105262, 42.368829498587729177, 89.546419695365329972, + 119.93682132403409923, 71.086966589653457049, 78.603932368827372557, 93.87332787289051339, + 78.296158331955666654, 70.78455113713425817, 106.29290533721723477, 112.58804998247796902, + 59.189595427673339145, 21.419485109636298148, 16.73252878484345274, 42.823252934464107966, + 20.561580918674735585, 13.686152361304266378, 45.735182686756161274, 25.54585337914613774, + 118.43056677207277971, 73.359556484425411327, 6.1084822482443996705, 6.633308272939757444, + 28.466663780483941082, 8.771395765488705365, 87.950585870734357741, 56.041318852636322845, + 63.937886877425626153, 114.60573223636674811, 83.553851513814151986, 80.665776075144094648, + 121.94789143382149632, 9.6124338352310587652, 72.021147769501112634, 52.941649610540480353, + 32.856565881120332051, 16.645526740907371277, 121.55386281137543847, 15.720533952702680836, + 58.851438969275477575, 126.63655300341633847, 122.67472284807081451, 36.441488904711150099, + 4.1317352113910601474, 16.756402787621482275, 56.614409347075707046, 118.57743346681309049, + 3.77787151590018766, 95.830660704199544853, 79.769770524195337202, 112.84632756012433674, + 20.93006171702654683, 22.264412417458515847, 66.63139009502629051, 126.52783662478032056, + 79.118060181408509379, 94.871796717434335733, 106.95371308362882701, 119.94631418316203053, + 22.774611722197732888, 94.930310380161245121, 82.491670046372746583, 41.207677085025352426, + 51.602252677614160348, 4.9771473860455444083, 99.509523599521344295, 70.340361706610565307, + 31.614628800136415521, 16.583234468180307886, 102.95729984965510084, 115.42061990610091016, + 119.39649281037054607, 121.83650285473413533, 109.92752805659984006, 53.215092392241786001, + 45.424272281306912191, 0.23242814349214313552, 79.768883710730733583, 99.756874029382743174, + 37.487688674686069135, 0, 39.132973968531587161, 117.48875923777450225, + 1.7139460561957093887, 16.890876744953857269, 29.37093914557408425, 55.142306939302216051, + 58.359386989348422503, 40.153416183769877534, 14.959203277903725393, 115.93176480366673786, + 93.463028539721562993, 28.037797443466843106, 9.7990523455882794224, 83.226388723673153436, + 113.46776038579992019, 127.88427731210322236, 76.031121703043027082, 53.627545473820646293, + 108.99069688237796072, 109.82741641105167218, 114.99733612901400193, 58.780943271114665549, + 103.62852853193908231, 74.295557971458038082, 88.561625392212590668, 96.199286447768827202, + 87.343286482675466686, 38.738487685674044769, 28.543136071610206272, 8.3968737942814186681, + 20.050904378287668806, 98.004727161667688051, 3.0118815538517083041, 58.549164662075781962, + 1.0970239360322011635, 112.8513712421990931, 73.328534015385230305, 11.586374692076788051, + 104.60221690699472674, 122.59369063865960925, 63.101380907330167247, 100.9746575271092297, + 6.4777507088692800608, 23.742794902947935043, 46.342101628946693381, 113.13111093550469377, + 13.372281711290270323, 52.754103442443010863, 10.35471420778776519, 44.292298604446841637, + 58.000374614039174048, 11.361219805115979398, 88.011987441819655942, 52.592402746278821724, + 38.995237045688554645, 66.56228406463196734, 78.696623547115450492, 7.7742535489778674673, + 78.164774690638296306, 54.459210284323489759, 62.348039849737688201, 86.138005895798414713, + 96.013204469338234048, 56.406200795820041094, 15.199961411912227049, 127.72969865610502893, + 110.79011653745328658, 24.187403884068771731, 120.2878936906272429, 93.843232564213394653, + 107.07158635673476965, 11.295442141872626962, 44.441793762853194494, 110.18964718981078477, + 33.500721826192602748, 86.968842328707978595, 115.06475973368287669, 3.3576501309144077823, + 21.743608700206095818, 41.137902990769362077, 110.8325376416069048, 102.08853545800229767, + 105.20178063494313392, 31.866563853029219899, 28.257370696312136715, 10.353709205479390221, + 109.92365680482544121, 127.82711829003164894, 96.574751208208908793, 109.61201730429456802, + 26.763747189692367101, 5.0371269475472217891, 22.135957845992379589, 72.569126960606809007, + 96.084602034803538118, 36.64165258219873067, 95.001560810826049419, 108.90257763145928038, + 1.8900380021404998843, 74.242948830451496178, 25.951386308362998534, 46.950272298432537355, + 81.060120907601231011, 84.73062569571993663, 25.241068513663776685, 10.465362457260198426, + 45.587441693278378807, 120.61841407231622725, 36.736927280016971054, 98.590600575302232755, + 49.026549093858193373, 118.93289811203430872, 82.201678825680573937, 37.847099384744069539, + 19.794804238503274973, 78.364223897759075044, 0.032721236406359821558, 75.347384248081652913, + 72.8764180253710947, 90.963286868711293209, 36.216667849526857026, 105.28490311542191193, + 34.654844527507520979, 76.898561452278954675, 43.262170015357696684, 93.013141661773261148, + 48.645176572736090748, 16.860403162609145511, 36.09855116482503945, 71.081648186864185845, + 2.0706608244981907774, 53.349688008842349518, 58.50053303545792005, 52.771345740176911931, + 48.936239791863044957, 28.455652615681174211, 102.38736023537421715, 46.160287713752040872, + 32.891990499578241725, 37.007291558253200492, 25.24951203250020626, 106.28812254915828817, + 12.564387497233838076, 126.56235224338888656, 67.027086293510365067, 83.598278466113697505, + 79.430396541501977481, 10.803793437797139632, 100.60941818741412135, 16.847290973993949592, + 13.537109099779627286, 64.882207953447505133, 82.692839008024748182, 24.611264467472210526, + 9.8970383951818803325, 125.67863361740091932, 93.314946262446028413, 9.4629423737569595687, + 97.137977709357073763, 105.27750471018225653, 118.84193534733276465, 92.15176055646588793, + 46.677750020757230232, 125.73441142217052402, 92.787283434910932556, 57.08252026786794886, + 123.09598342549361405, 55.103869034723174991, 27.826588925738178659, 73.16684747809995315, + 60.774228995880548609, 20.636139748381538084, 101.36348638140407274, 95.631561330279510003, + 97.549952303728787228, 23.706078806655568769, 43.170371987824182725, 31.588611358627531445, + 63.149663985084771411, 125.63710817386163399, 32.191769655593816424, 89.643359992442128714, + 106.87978594683954725, 9.2288050835086323787, 17.599812833668693202, 6.3319451876741368324, + 30.492547687306796433, 93.743297644625272369, 91.565373099689168157, 70.884497583123447839, + 125.91811105398664949, 107.07387701683546766, 103.73069008639504318, 95.105897521778388182, + 111.35753944913085434, 40.091766186102177016, 49.498129179559327895, 93.735782589264999842, + 90.01551735933026066, 108.65979901291575516, 87.501124014728702605, 69.482105423365283059, + 125.00230872996689868, 3.6664681635702436324, 89.314707841196650406, 92.991790473191940691, + 113.24889857637390378, 91.577921158110257238, 64.121257261136634042, 120.49927448539528996, + 102.80766369037519326, 58.684866665378649486, 27.450873958699958166, 21.358386116295150714, + 112.51116788582658046, 55.112633025091781747, 56.393987989165907493, 86.796785357011685846, + 72.843921764451806666, 17.858527452823182102, 20.136318820303131361, 112.87631863386195619, + 83.152018194778065663, 84.480770397345622769, 55.038850318367622094, 18.907657333140377887, + 108.39555796563217882, 53.173744707779405871, 55.137885794036264997, 39.50004650215851143, + 17.703516599536669673, 20.512917208521685097, 46.592307856863044435, 61.629349464517872548, + 3.7156902661845379043, 96.408975070924498141, 64.729148069396615028, 39.937812776774080703, + 124.17384925895748893, 6.3573452300988719799, 126.92717091496888315, 72.592772435476945248, + 61.497842719036270864, 42.041299265125417151, 125.90529517895265599, 87.585082325455005048, + 33.706165554911422078, 94.573318262195243733, 28.25000860687578097, 109.84026228930088109, + 106.75583093114983058, 90.756842325470643118, 102.5235225117430673, 81.058519289697869681, + 82.653821253836213145, 3.0075597826362354681, 34.939408579699374968, 12.677308991213067202, + 60.785059975740296068, 76.436377578858810011, 38.635799299714562949, 105.07755948515114142, + 87.284225988183607114, 85.343123870690760668, 73.215554674727172824, 84.253481142637610901, + 15.534238098727655597, 124.95986858732794644, 17.674003492807969451, 8.5540771415471681394, + 77.847163563623325899, 34.303977367184415925, 86.710185492116579553, 55.140237874446029309, + 83.624751979092252441, 110.69698072973915259, 56.428086349231307395, 116.37692103042354574, + 14.521524526528082788, 98.024682639246748295, 20.502857048031728482, 111.8744957645831164, + 108.99099968090740731, 46.432174631845555268, 33.23928154154054937, 113.21395232310896972, + 27.088700682354101446, 51.237154262329568155, 43.717844670274644159, 60.912530067704210524, + 84.737658997179096332, 51.092839390734297922, 111.87364264807183645, 14.173933179310552077, + 29.207864737658383092, 59.746655745784664759, 28.592316663914971286, 13.569102274272154318, + 84.585810674438107526, 97.176099964955938049, 118.37919085534667829, 42.838970219272596296, + 33.465057569686905481, 85.646505868928215932, 41.12316183734947117, 27.372304722608532757, + 91.470365373512322549, 51.09170675829591346, 108.86113354414919741, 18.719112968850822654, + 12.216964496488799341, 13.266616545879514888, 56.933327560967882164, 17.542791530981048709, + 47.901171741468715481, 112.08263770527264569, 127.87577375485489029, 101.2114644727371342, + 39.10770302763194195, 33.331552150291827274, 115.89578286764299264, 19.224867670465755509, + 16.042295539002225269, 105.88329922108096071, 65.713131762240664102, 33.291053481818380533, + 115.10772562275087694, 31.441067905405361671, 117.70287793855459313, 125.27310600683631492, + 117.34944569614162901, 72.882977809422300197, 8.2634704227821202949, 33.512805575242964551, + 113.22881869415505207, 109.15486693362618098, 7.5557430318040132988, 63.661321408402727684, + 31.539541048394312384, 97.692655120248673484, 41.860123434053093661, 44.528824834920669673, + 5.2627801900562189985, 125.0556732495642791, 30.236120362820656737, 61.743593434872309444, + 85.907426167261291994, 111.89262836632406106, 45.549223444399103755, 61.86062076032612822, + 36.983340092745493166, 82.415354170050704852, 103.2045053552283207, 9.9542947720947267953, + 71.019047199046326568, 12.680723413221130613, 63.229257600272831041, 33.16646893636425375, + 77.914599699313839665, 102.84123981220545829, 110.79298562074473011, 115.67300570947190863, + 91.855056113199680112, 106.430184784483572, 90.848544562613824382, 0.46485628698792424984, + 31.537767421465105144, 71.513748058765486348, 74.975377349375776248, 0, + 78.265947937066812301, 106.97751847554900451, 3.4278921123914187774, 33.781753489907714538, + 58.741878291148168501, 110.2846138786044321, 116.71877397869684501, 80.306832367539755069, + 29.918406555811088765, 103.8635296073371137, 58.926057079443125986, 56.075594886933686212, + 19.598104691180196824, 38.45277744734994485, 98.935520771603478352, 127.76855462421008269, + 24.062243406086054165, 107.25509094764493057, 89.981393764759559417, 91.654832822106982348, + 101.99467225802800385, 117.56188654223296908, 79.257057063881802605, 20.591115942919714143, + 49.123250784428819316, 64.398572895541292382, 46.686572965350933373, 77.476975371348089539, + 57.086272143220412545, 16.793747588562837336, 40.10180875657897559, 68.009454323335376102, + 6.0237631077034166083, 117.09832932415156392, 2.1940478720680403057, 97.702742484401824186, + 18.657068030770460609, 23.172749384157214081, 81.204433813993091462, 117.1873812773192185, + 126.20276181466397247, 73.949315054218459409, 12.955501417738560122, 47.485589805895870086, + 92.684203257897024741, 98.262221871009387542, 26.744563422580540646, 105.50820688488602173, + 20.70942841557553038, 88.584597208893683273, 116.0007492280783481, 22.722439610235596774, + 48.023974883639311884, 105.18480549255764345, 77.990474091380747268, 5.1245681292675726581, + 29.393247094230900984, 15.548507097959372913, 28.329549381276592612, 108.91842056864697952, + 124.69607969947901438, 44.276011791600467404, 64.026408938676468097, 112.81240159164008219, + 30.399922823828092078, 127.45939731221369584, 93.580233074906573165, 48.374807768141181441, + 112.57578738125812379, 59.686465128430427285, 86.143172713469539303, 22.590884283745253924, + 88.883587525710026966, 92.379294379621569533, 67.001443652388843475, 45.937684657419595169, + 102.12951946736575337, 6.7153002618288155645, 43.487217400412191637, 82.275805981542362133, + 93.665075283217447577, 76.177070916008233326, 82.403561269886267837, 63.733127706058439799, + 56.514741392624273431, 20.70741841096241842, 91.847313609654520405, 127.65423658006693586, + 65.149502416421455564, 91.224034608589136042, 53.527494379384734202, 10.074253895094443578, + 44.271915691988397157, 17.138253921217255993, 64.169204069607076235, 73.283305164401099319, + 62.003121621655736817, 89.805155262918560766, 3.7800760042846377473, 20.485897660902992357, + 51.902772616725997068, 93.900544596868712688, 34.1202418152061, 41.46125139143987326, + 50.482137027327553369, 20.930724914520396851, 91.174883386560395593, 113.2368281446324545, + 73.473854560037580086, 69.181201150604465511, 98.053098187720024725, 109.86579622407225543, + 36.403357651361147873, 75.694198769488139078, 39.589608477010187926, 28.728447795518150087, + 0.065442472816357621923, 22.694768496166943805, 17.752836050745827379, 53.926573737422586419, + 72.433335699057352031, 82.569806230843823869, 69.309689055018679937, 25.797122904557909351, + 86.524340030719031347, 58.026283323546522297, 97.290353145472181495, 33.720806325218291022, + 72.197102329653716879, 14.163296373728371691, 4.1413216489963815548, 106.69937601768469904, + 117.0010660709158401, 105.54269148035382386, 97.872479583726089913, 56.911305231365986401, + 76.774720470748434309, 92.320575427504081745, 65.783980999156483449, 74.014583116506400984, + 50.499024065004050499, 84.576245098316576332, 25.12877499447131413, 125.12470448678141111, + 6.0541725870243681129, 39.196556932231032988, 30.860793083003954962, 21.607586875597917242, + 73.218836374828242697, 33.694581947987899184, 27.074218199562892551, 1.7644159068986482453, + 37.385678016049496364, 49.222528934944421053, 19.794076790367398644, 123.35726723480547662, + 58.629892524892056827, 18.925884747517557116, 66.275955418717785506, 82.555009420368151041, + 109.68387069466916728, 56.30352111293177586, 93.355500041518098442, 123.46882284434468602, + 57.574566869821865112, 114.1650405357395357, 118.1919668509872281, 110.20773806944634998, + 55.653177851479995297, 18.333694956199906301, 121.54845799176109722, 41.272279496766714146, + 74.726972762811783468, 63.263122660562657984, 67.099904607457574457, 47.412157613311137538, + 86.340743975648365449, 63.177222717255062889, 126.2993279701731808, 123.27421634772326797, + 64.383539311191270826, 51.286719984887895407, 85.759571893679094501, 18.457610167017264757, + 35.199625667337386403, 12.663890375348273665, 60.985095374617230846, 59.486595289254182717, + 55.130746199381974293, 13.768995166250533657, 123.83622210797693697, 86.147754033674573293, + 79.461380172793724341, 62.211795043560414342, 94.715078898261708673, 80.183532372204354033, + 98.996258359122293768, 59.471565178533637663, 52.0310347186641593, 89.319598025835148292, + 47.002248029461043188, 10.964210846734204097, 122.00461745993379736, 7.3329363271441252436, + 50.629415682396938791, 57.983580946387519361, 98.497797152751445537, 55.155842316224152455, + 0.24251452227690606378, 112.99854897079421789, 77.61532738075038651, 117.36973333075729897, + 54.901747917399916332, 42.716772232593939407, 97.022335771653160919, 110.22526605018356349, + 112.78797597833545296, 45.593570714027009672, 17.687843528903613333, 35.717054905646364205, + 40.2726376406099007, 97.752637267727550352, 38.304036389559769304, 40.961540794691245537, + 110.07770063673524419, 37.815314666284393752, 88.791115931264357641, 106.34748941555881174, + 110.27577158807252999, 79.00009300431702286, 35.407033199073339347, 41.025834417043370195, + 93.18461571372608887, 123.2586989290357451, 7.4313805323727137875, 64.81795014185263426, + 1.4582961387932300568, 79.875625553551799385, 120.34769851791497786, 12.714690460201381939, + 125.85434182994140428, 17.185544870953890495, 122.99568543807254173, 84.08259853025447228, + 123.81059035790894995, 47.170164650910010096, 67.412331109826482134, 61.146636524390487466, + 56.500017213755199919, 91.680524578605400166, 85.511661862303299131, 53.513684650944924215, + 77.047045023489772575, 34.11703857939937734, 37.307642507672426291, 6.0151195652724709362, + 69.878817159398749936, 25.354617982426134404, 121.57011995148423011, 24.872755157717620023, + 77.271598599432763876, 82.155118970305920811, 46.568451976370852208, 42.686247741385159316, + 18.431109349457983626, 40.506962285275221802, 31.068476197458949173, 121.91973717465589289, + 35.348006985615938902, 17.108154283097974258, 27.694327127246651798, 68.607954734372469829, + 45.420370984233159106, 110.2804757488956966, 39.24950395818814286, 93.393961459478305187, + 112.85617269846625277, 104.75384206084709149, 29.043049053059803555, 68.049365278493496589, + 41.005714096067094943, 95.748991529169870773, 89.98199936181481462, 92.864349263691110536, + 66.478563083084736718, 98.427904646217939444, 54.177401364708202891, 102.47430852465913631, + 87.435689340549288318, 121.82506013541205903, 41.475317994358192664, 102.18567878147223382, + 95.747285296143672895, 28.347866358621104155, 58.415729475316766184, 119.49331149156932952, + 57.184633327829942573, 27.138204548547946615, 41.171621348879853031, 66.352199929915514076, + 108.75838171069335658, 85.677940438545192592, 66.930115139377448941, 43.293011737856431864, + 82.246323674698942341, 54.744609445220703492, 54.940730747024645098, 102.1834135165954649, + 89.72226708829839481, 37.438225937701645307, 24.433928992977598682, 26.533233091759029776, + 113.86665512193576433, 35.085583061962097418, 95.802343482941068942, 96.165275410548929358, + 127.75154750971341855, 74.422928945474268403, 78.2154060552638839, 66.663104300587292528, + 103.79156573528598528, 38.449735340931511018, 32.084591078008088516, 83.766598442165559391, + 3.4262635244813282043, 66.582106963640399044, 102.21545124550175387, 62.882135810814361321, + 107.40575587711282424, 122.54621201367626782, 106.69889139228689601, 17.765955618844600394, + 16.52694084556424059, 67.025611150489567081, 98.457637388313742122, 90.309733867252361961, + 15.111486063608026598, 127.32264281680545537, 63.079082096792262746, 67.385310240497346967, + 83.720246868106187321, 89.057649669841339346, 10.525560380116075976, 122.11134649912855821, + 60.472240725641313475, 123.48718686974825687, 43.814852334526221966, 95.785256732648122124, + 91.09844688879820751, 123.72124152065225644, 73.966680185494624311, 36.830708340105047682, + 78.409010710456641391, 19.908589544193091569, 14.038094398092653137, 25.361446826442261226, + 126.45851520054566208, 66.332937872732145479, 27.829199398631317308, 77.682479624414554564, + 93.585971241493098205, 103.34601141894745524, 55.710112226402998203, 84.860369568970781984, + 53.697089125227648765, 0.92971257397584849969, 63.075534842933848267, 15.027496117534610676, + 21.950754698755190475, 0, 28.531895874137262581, 85.955036951098009013, + 6.8557842247828375548, 67.563506979815429077, 117.48375658229997498, 92.569227757212502183, + 105.43754795739732799, 32.613664735079510137, 59.836813111625815509, 79.727059214674227405, + 117.85211415888625197, 112.15118977386737242, 39.196209382360393647, 76.90555489470352768, + 69.871041543210594682, 127.53710924842016539, 48.124486812175746309, 86.51018189529349911, + 51.962787529522756813, 55.309665644217602676, 75.989344516059645684, 107.12377308446957613, + 30.514114127763605211, 41.182231885839428287, 98.24650156886127661, 0.79714579108258476481, + 93.373145930705504725, 26.953950742696179077, 114.17254428644082509, 33.587495177125674672, + 80.203617513161589159, 8.018908646670752205, 12.047526215410471195, 106.19665864830312785, + 4.3880957441397185903, 67.405484968803648371, 37.314136061540921219, 46.345498768318066141, + 34.408867627989820903, 106.37476255464207497, 124.40552362933158292, 19.898630108436918817, + 25.911002835477120243, 94.97117961179537815, 57.368406515797687462, 68.524443742018775083, + 53.489126845164719271, 83.016413769772043452, 41.418856831154698739, 49.169194417791004525, + 104.00149845615669619, 45.444879220471193548, 96.047949767282261746, 82.369610985118924873, + 27.980948182761494536, 10.249136258535145316, 58.786494188461801969, 31.097014195918745827, + 56.659098762556823203, 89.836841137297597015, 121.39215939895802876, 88.552023583204572788, + 0.052817877356574172154, 97.624803183280164376, 60.799845647659822134, 126.91879462443102966, + 59.16046614981314633, 96.749615536286000861, 97.151574762516247574, 119.37293025686449255, + 44.286345426939078607, 45.181768567494145827, 49.767175051423691912, 56.758588759246777045, + 6.0028873047776869498, 91.875369314842828317, 76.259038934731506743, 13.430600523657631129, + 86.974434800828021253, 36.551611963088362245, 59.330150566438533133, 24.35414183202010463, + 36.807122539772535674, 127.4662554121168796, 113.02948278524854686, 41.414836821928474819, + 55.69462721931267879, 127.30847316013750969, 2.2990048328465491068, 54.448069217178272083, + 107.0549887587694684, 20.148507790188887157, 88.543831383976794314, 34.276507842438149964, + 0.33840813921779044904, 18.566610328802198637, 124.00624324331511161, 51.610310525837121531, + 7.5601520085692754947, 40.971795321805984713, 103.80554523345563211, 59.801089193737425376, + 68.2404836304122, 82.922502782879746519, 100.96427405465510674, 41.861449829044431681, + 54.349766773124429164, 98.473656289268546971, 18.947709120078798151, 10.362402301212569, + 68.10619637544368743, 91.731592448144510854, 72.806715302725933725, 23.388397538976278156, + 79.179216954020375852, 57.456895591036300175, 0.13088494563271524385, 45.389536992333887611, + 35.505672101491654757, 107.85314747484881082, 16.86667139811834204, 37.139612461691285716, + 10.619378110037359875, 51.59424580911945668, 45.048680061438062694, 116.05256664709668257, + 66.580706290944362991, 67.441612650440220023, 16.394204659307433758, 28.326592747456743382, + 8.2826432979964010883, 85.398752035373036051, 106.00213214183531818, 83.085382960711285705, + 67.744959167452179827, 113.82261046273561078, 25.549440941500506597, 56.641150855011801468, + 3.5679619983166048769, 20.029166233012801968, 100.99804813001173898, 41.152490196633152664, + 50.25754998894626624, 122.24940897356282221, 12.108345174048736226, 78.393113864462065976, + 61.721586166007909924, 43.215173751199472463, 18.437672749656485394, 67.389163895975798368, + 54.148436399125785101, 3.5288318137972964905, 74.771356032098992728, 98.445057869888842106, + 39.588153580738435267, 118.71453446961095324, 117.25978504978411365, 37.851769495038752211, + 4.55191083743920899, 37.11001884073994006, 91.367741389338334557, 112.6070422258671897, + 58.711000083039834863, 118.93764568868937204, 115.1491337396473682, 100.33008107148270938, + 108.38393370197809418, 92.415476138892699964, 111.30635570295999059, 36.66738991240345058, + 115.09691598352219444, 82.544558993537066272, 21.453945525623566937, 126.52624532112895395, + 6.1998092149151489139, 94.824315226625913056, 44.681487951296730898, 126.35444543451376376, + 124.59865594034999958, 118.54843269545017392, 0.76707862238254165277, 102.57343996977942879, + 43.519143787358189002, 36.915220334034529515, 70.399251334674772806, 25.327780750696547329, + 121.97019074923446169, 118.97319057850836543, 110.26149239876394859, 27.537990332504705293, + 119.67244421595751191, 44.295508067352784565, 30.922760345587448683, 124.42359008712446666, + 61.430157796527055325, 32.367064744412346045, 69.992516718244587537, 118.94313035706727533, + 104.06206943733195658, 50.639196051670296583, 94.004496058922086377, 21.928421693472046172, + 116.00923491986759473, 14.665872654288250487, 101.25883136479387758, 115.9671618927786767, + 68.995594305502891075, 110.31168463244830491, 0.48502904455745010637, 97.997097941592073767, + 27.230654761504410999, 106.73946666151459794, 109.80349583479983266, 85.433544465191516792, + 66.044671543309959816, 92.450532100370764965, 97.575951956670905929, 91.187141428054019343, + 35.375687057807226665, 71.434109811292728409, 80.545275281223439379, 67.505274535455100704, + 76.608072779119538609, 81.923081589386129053, 92.155401273470488377, 75.630629332572425483, + 49.582231862532353261, 84.694978831121261464, 92.551543176148697967, 30.00018600863404572, + 70.814066398146678694, 82.051668834090378368, 58.369231427455815719, 118.51739785807149019, + 14.862761064749065554, 1.6359002837052685209, 2.9165922775900980923, 31.751251107107236749, + 112.69539703582995571, 25.429380920406401856, 123.70868365988280857, 34.371089741911418969, + 117.99137087614872144, 40.165197060512582539, 119.62118071581789991, 94.34032930182365817, + 6.8246622196529642679, 122.29327304878097493, 113.00003442751403782, 55.36104915721443831, + 43.023323724606598262, 107.02736930189348641, 26.09409004697954515, 68.234077158798754681, + 74.615285015344852582, 12.030239130548579851, 11.757634318797499873, 50.709235964855906786, + 115.14023990296846023, 49.745510315438878024, 26.543197198869165732, 36.310237940611841623, + 93.136903952741704416, 85.372495482770318631, 36.862218698915967252, 81.013924570550443605, + 62.136952394921536325, 115.83947434931178577, 70.696013971231877804, 34.216308566195948515, + 55.388654254496941576, 9.2159094687449396588, 90.840741968469956191, 92.560951497791393194, + 78.499007916379923699, 58.787922918960248353, 97.712345396936143516, 81.507684121694182977, + 58.086098106123245088, 8.0987305569869931787, 82.011428192137827864, 63.497983058343379525, + 51.963998723633267218, 57.728698527385859052, 4.9571261661731114145, 68.855809292435878888, + 108.35480272942004376, 76.948617049321910599, 46.871378681102214614, 115.65012027082411805, + 82.950635988720023306, 76.371357562948105624, 63.494570592287345789, 56.695732717242208309, + 116.83145895063717035, 110.98662298313865904, 114.36926665565988515, 54.27640909709589323, + 82.34324269776334404, 4.7043998598346661311, 89.516763421390351141, 43.355880877094023162, + 5.8602302787548978813, 86.586023475716501707, 36.492647349397884682, 109.48921889044140698, + 109.88146149405292817, 76.366827033194567775, 51.444534176596789621, 74.876451875403290614, + 48.867857985955197364, 53.066466183521697531, 99.733310243871528655, 70.171166123927832814, + 63.604686965885775862, 64.330550821101496695, 127.50309501943047508, 20.845857890952174785, + 28.430812110531405779, 5.3262086011782230344, 79.583131470571970567, 76.899470681863022037, + 64.169182156019815011, 39.533196884331118781, 6.8525270489662943874, 5.1642139272844360676, + 76.430902491003507748, 125.76427162163236062, 86.811511754229286453, 117.09242402735617361, + 85.397782784573792014, 35.531911237689200789, 33.053881691132119158, 6.0512223009827721398, + 68.915274776631122222, 52.619467734504723921, 30.222972127219691174, 126.64528563361091074, + 126.15816419358816347, 6.7706204809983319137, 39.440493736216012621, 50.115299339682678692, + 21.05112076023578993, 116.22269299825711641, 120.94448145128626493, 118.97437373949651374, + 87.629704669056081912, 63.570513465299882228, 54.196893777600052999, 119.44248304130815086, + 19.933360370989248622, 73.661416680213733343, 28.818021420913282782, 39.817179088386183139, + 28.076188796185306273, 50.722893652888160432, 124.91703040109496214, 4.6658757454642909579, + 55.658398797266272595, 27.364959248832747107, 59.171942482989834389, 78.692022837894910481, + 111.42022445280963439, 41.720739137941563968, 107.39417825045529753, 1.8594251479516969994, + 126.15106968586769653, 30.054992235069221351, 43.901509397514018929, 0, + 57.063791748278163141, 43.910073902196018025, 13.711568449569313088, 7.1270139596344961319, + 106.96751316460358794, 57.138455514428642346, 82.875095914794655982, 65.227329470159020275, + 119.673626223255269, 31.454118429352092789, 107.70422831777614192, 96.302379547734744847, + 78.392418764724425273, 25.811109789410693338, 11.742083086424827343, 127.07421849684033077, + 96.248973624355130596, 45.020363790586998221, 103.92557505904551363, 110.61933128843884333, + 23.978689032122929348, 86.247546168939152267, 61.028228255527210422, 82.364463771682494553, + 68.49300313772255322, 1.5942915821688075084, 58.74629186141100945, 53.907901485395996133, + 100.34508857288165018, 67.174990354254987324, 32.407235026323178317, 16.03781729334150441, + 24.09505243082458037, 84.393317296606255695, 8.7761914882830751594, 6.8109699376072967425, + 74.628272123081842437, 92.690997536636132281, 68.817735255983279785, 84.749525109287787927, + 120.81104725866316585, 39.797260216873837635, 51.822005670957878465, 61.942359223590756301, + 114.7368130315990129, 9.0488874840375501662, 106.97825369033307652, 38.032827539544086903, + 82.837713662309397478, 98.33838883558564703, 80.002996912313392386, 90.889758440946025075, + 64.095899534568161471, 36.739221970237849746, 55.961896365522989072, 20.498272517070290633, + 117.57298837692360394, 62.194028391837491654, 113.31819752511728439, 51.673682274598832009, + 114.7843187979196955, 49.104047166409145575, 0.10563575471678632312, 67.249606366560328752, + 121.59969129532328225, 125.83758924886205932, 118.32093229962993064, 65.499231072575639701, + 66.303149525036133127, 110.7458605137289851, 88.572690853878157213, 90.363537134988291655, + 99.534350102847383823, 113.51717751849355409, 12.005774609559011878, 55.750738629689294612, + 24.518077869463013485, 26.861201047318900237, 45.948869601656042505, 73.10322392617672449, + 118.66030113287706627, 48.70828366404020926, 73.614245079548709327, 126.93251082423739717, + 98.058965570497093722, 82.829673643856949639, 111.38925443862899556, 126.61694632027501939, + 4.5980096656930982135, 108.89613843436018215, 86.109977517538936809, 40.297015580381412292, + 49.087662767953588627, 68.553015684876299929, 0.67681627843558089808, 37.133220657608035253, + 120.01248648663022323, 103.22062105167424306, 15.120304017138550989, 81.943590643615607405, + 79.61109046691126423, 119.60217838747848873, 8.4809672608280379791, 37.845005565763131017, + 73.928548109310213476, 83.722899658088863362, 108.69953354625249631, 68.947312578537093941, + 37.895418240157596301, 20.724804602428775979, 8.2123927508910128381, 55.463184896292659687, + 17.61343060545186745, 46.776795077956194291, 30.358433908040751703, 114.91379118207260035, + 0.26176989126543048769, 90.779073984667775221, 71.011344202986947494, 87.706294949697621632, + 33.73334279623668408, 74.279224923382571433, 21.238756220074719749, 103.18849161823891336, + 90.097360122879763367, 104.10513329419700312, 5.1614125818923639599, 6.8832253008804400451, + 32.788409318614867516, 56.653185494913486764, 16.565286595996440155, 42.797504070749710081, + 84.004264283674274338, 38.170765921426209388, 7.4899183349079976324, 99.645220925471221562, + 51.098881883001013193, 113.28230171002360294, 7.1359239966332097538, 40.058332466029241914, + 73.996096260023477953, 82.304980393266305327, 100.51509997789617046, 116.49881794712564442, + 24.21669034810111043, 28.786227728924131952, 123.44317233201581985, 86.430347502398944926, + 36.875345499316608766, 6.7783277919515967369, 108.2968727982515702, 7.0576636275982309598, + 21.542712064201623434, 68.890115739777684212, 79.176307161480508512, 109.42906893922554445, + 106.51957009956822731, 75.703538990077504423, 9.1038216748784179799, 74.220037681483518099, + 54.735482778680307092, 97.2140844517343794, 117.4220001660833077, 109.87529137738238205, + 102.29826747929837438, 72.660162142969056731, 88.767867403959826333, 56.830952277789037907, + 94.612711405919981189, 73.334779824810539139, 102.19383196704802685, 37.089117987074132543, + 42.907891051250771852, 125.05249064225790789, 12.399618429833935807, 61.648630453251826111, + 89.362975902597099775, 124.70889086903116549, 121.19731188070363714, 109.09686539090034785, + 1.5341572447687212843, 77.146879939558857586, 87.038287574716378003, 73.830440668072697008, + 12.798502669349545613, 50.655561501396732638, 115.94038149847256136, 109.94638115702036885, + 92.522984797527897172, 55.075980665013048565, 111.34488843191502383, 88.591016134705569129, + 61.845520691178535344, 120.84718017424893333, 122.86031559305411065, 64.734129488828330068, + 11.985033436492813053, 109.88626071413818863, 80.124138874663913157, 101.27839210334423115, + 60.008992117844172753, 43.856843386947730323, 104.01846983973518945, 29.331745308580138953, + 74.517662729591393145, 103.93432378556099138, 9.9911886110094201285, 92.62336926489660982, + 0.97005808911853819154, 67.994195883184147533, 54.461309523012459977, 85.478933323032833869, + 91.606991669603303308, 42.867088930386671564, 4.0893430866235576104, 56.901064200745167909, + 67.151903913345449837, 54.374282856108038686, 70.751374115618091309, 14.868219622589094797, + 33.090550562450516736, 7.0105490709138393868, 25.216145558242715197, 35.846163178775896085, + 56.310802546944614733, 23.261258665144850966, 99.164463725068344502, 41.389957662246160908, + 57.103086352297395933, 60.000372017271729419, 13.628132796296995366, 36.103337668180756737, + 116.73846285491526942, 109.03479571614298038, 29.725522129498131108, 3.2718005674105370417, + 5.8331845551801961847, 63.502502214218111476, 97.390794071659911424, 50.858761840816441691, + 119.41736731976561714, 68.742179483826475916, 107.98274175229744287, 80.330394121028803056, + 111.2423614316394378, 60.68065860364731634, 13.649324439309566515, 116.58654609756558784, + 98.000068855028075632, 110.72209831442887662, 86.046647449216834502, 86.054738603786972817, + 52.188180093962728279, 8.4681543176011473406, 21.230570030689705163, 24.060478261097159702, + 23.515268637594999745, 101.41847192971545155, 102.28047980593692046, 99.491020630877756048, + 53.086394397738331463, 72.620475881227321224, 58.27380790548704681, 42.744990965540637262, + 73.724437397835572483, 34.027849141100887209, 124.27390478984671063, 103.67894869862720952, + 13.392027942463755608, 68.43261713239189703, 110.77730850899388315, 18.431818937493517296, + 53.681483936943550361, 57.121902995586424368, 28.998015832759847399, 117.57584583792413468, + 67.42469079387592501, 35.015368243388365954, 116.17219621224649018, 16.197461113977624336, + 36.022856384275655728, 126.99596611668675905, 103.92799744726653444, 115.4573970547717181, + 9.9142523323498608079, 9.7116185848753957544, 88.709605458843725501, 25.897234098643821198, + 93.742757362208067207, 103.30024054165187408, 37.901271977443684591, 24.742715125896211248, + 126.98914118457469158, 113.3914654344880546, 105.66291790127797867, 93.973245966280956054, + 100.73853331131977029, 108.55281819419542444, 36.68648539552668808, 9.4087997196729702409, + 51.033526842780702282, 86.711761754188046325, 11.720460557513433741, 45.172046951433003414, + 72.985294698799407342, 90.978437780886451947, 91.762922988109494327, 24.733654066389135551, + 102.88906835319721722, 21.752903750806581229, 97.735715971910394728, 106.13293236704703304, + 71.466620487746695289, 12.342332247855665628, 127.2093739317751897, 0.66110164220663136803, + 127.00619003886095015, 41.691715781904349569, 56.861624221062811557, 10.652417202360084048, + 31.166262941147579113, 25.798941363729682053, 0.3383643120396300219, 79.066393768662237562, + 13.705054097932588775, 10.328427854572510114, 24.861804982010653475, 123.52854324326835922, + 45.623023508462210884, 106.1848480547159852, 42.795565569147584029, 71.063822475378401577, + 66.107763382264238317, 12.102444601969182258, 9.8305495532622444443, 105.23893546900944784, + 60.445944254443020327, 125.29057126722545945, 124.31632838717632694, 13.541240961996663827, + 78.880987472432025243, 100.23059867936535738, 42.10224152047521784, 104.44538599651787081, + 113.88896290257616783, 109.94874747899666545, 47.259409338112163823, 127.14102693059976446, + 108.39378755520374398, 110.88496608261630172, 39.866720741982135223, 19.322833360427466687, + 57.636042841826565564, 79.634358176772366278, 56.152377592370612547, 101.44578730577995884, + 121.83406080218992429, 9.3317514909285819158, 111.31679759453254519, 54.729918497665494215, + 118.34388496598330676, 29.38404567579345894, 94.840448905619268771, 83.441478275886765914, + 86.788356500910595059, 3.7188502959070319775, 124.30213937173539307, 60.109984470138442703, + 87.803018795028037857, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, +}; diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_footer.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_footer.h.org new file mode 100644 index 0000000000000..3e7b362ec8203 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_footer.h.org @@ -0,0 +1,78 @@ + +#if !defined(SLEEF_Q_DEFINED) +#define SLEEF_Q_DEFINED +static inline Sleef_quad sleef_q(int64_t H, uint64_t L, int E) { +#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + struct { uint64_t h, l; } c; +#else + struct { uint64_t l, h; } c; +#endif + c.h = (((int64_t)(H) < 0 ? 1ULL : 0ULL) << 63) | + ((0x7fff & (uint64_t)((E) + 16383)) << 48) | + ((int64_t)(H) < 0 ? -(int64_t)(H) : (int64_t)(H) & 0xffffffffffffULL); + c.l = (uint64_t)(L); + + Sleef_quad q; + memcpy(&q, &c, 16); + return q; +} +#endif + +#ifdef SLEEF_QUAD_C + +#define SLEEF_M_Eq SLEEF_QUAD_C(+0x1.5bf0a8b1457695355fb8ac404e7ap+1) +#define SLEEF_M_LOG2Eq SLEEF_QUAD_C(+0x1.71547652b82fe1777d0ffda0d23ap+0) +#define SLEEF_M_LOG10Eq SLEEF_QUAD_C(+0x1.bcb7b1526e50e32a6ab7555f5a68p-2) +#define SLEEF_M_LN2q SLEEF_QUAD_C(+0x1.62e42fefa39ef35793c7673007e6p-1) +#define SLEEF_M_LN10q SLEEF_QUAD_C(+0x1.26bb1bbb5551582dd4adac5705a6p+1) +#define SLEEF_M_PIq SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+1) +#define SLEEF_M_PI_2q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p+0) +#define SLEEF_M_PI_4q SLEEF_QUAD_C(+0x1.921fb54442d18469898cc51701b8p-1) +#define SLEEF_M_1_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-2) +#define SLEEF_M_2_PIq SLEEF_QUAD_C(+0x1.45f306dc9c882a53f84eafa3ea6ap-1) +#define SLEEF_M_2_SQRTPIq SLEEF_QUAD_C(+0x1.20dd750429b6d11ae3a914fed7fep+0) +#define SLEEF_M_SQRT2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p+0) +#define SLEEF_M_SQRT3q SLEEF_QUAD_C(+0x1.bb67ae8584caa73b25742d7078b8p+0) +#define SLEEF_M_INV_SQRT3q SLEEF_QUAD_C(+0x1.279a74590331c4d218f81e4afb25p-1) +#define SLEEF_M_SQRT1_2q SLEEF_QUAD_C(+0x1.6a09e667f3bcc908b2fb1366ea95p-1) +#define SLEEF_M_INV_SQRTPIq SLEEF_QUAD_C(+0x1.20dd750429b6d11ae3a914fed7fep-1) +#define SLEEF_M_EGAMMAq SLEEF_QUAD_C(+0x1.2788cfc6fb618f49a37c7f0202a6p-1) +#define SLEEF_M_PHIq SLEEF_QUAD_C(+0x1.9e3779b97f4a7c15f39cc0605ceep+0) +#define SLEEF_QUAD_MAX SLEEF_QUAD_C(+0x1.ffffffffffffffffffffffffffffp+16383) +#define SLEEF_QUAD_MIN SLEEF_QUAD_C(+0x1p-16382) +#define SLEEF_QUAD_EPSILON SLEEF_QUAD_C(+0x1p-112) +#define SLEEF_QUAD_DENORM_MIN SLEEF_QUAD_C(+0x0.0000000000000000000000000001p-16382) + +#else // #ifdef SLEEF_QUAD_C + +#define SLEEF_M_Eq sleef_q(+0x15bf0a8b14576LL, 0x95355fb8ac404e7aULL, 1) +#define SLEEF_M_LOG2Eq sleef_q(+0x171547652b82fLL, 0xe1777d0ffda0d23aULL, 0) +#define SLEEF_M_LOG10Eq sleef_q(+0x1bcb7b1526e50LL, 0xe32a6ab7555f5a68ULL, -2) +#define SLEEF_M_LN2q sleef_q(+0x162e42fefa39eLL, 0xf35793c7673007e6ULL, -1) +#define SLEEF_M_LN10q sleef_q(+0x126bb1bbb5551LL, 0x582dd4adac5705a6ULL, 1) +#define SLEEF_M_PIq sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 1) +#define SLEEF_M_PI_2q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, 0) +#define SLEEF_M_PI_4q sleef_q(+0x1921fb54442d1LL, 0x8469898cc51701b8ULL, -1) +#define SLEEF_M_1_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -2) +#define SLEEF_M_2_PIq sleef_q(+0x145f306dc9c88LL, 0x2a53f84eafa3ea6aULL, -1) +#define SLEEF_M_2_SQRTPIq sleef_q(+0x120dd750429b6LL, 0xd11ae3a914fed7feULL, 0) +#define SLEEF_M_SQRT2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, 0) +#define SLEEF_M_SQRT3q sleef_q(+0x1bb67ae8584caLL, 0xa73b25742d7078b8ULL, 0) +#define SLEEF_M_INV_SQRT3q sleef_q(+0x1279a74590331LL, 0xc4d218f81e4afb25ULL, -1) +#define SLEEF_M_SQRT1_2q sleef_q(+0x16a09e667f3bcLL, 0xc908b2fb1366ea95ULL, -1) +#define SLEEF_M_INV_SQRTPIq sleef_q(+0x120dd750429b6LL, 0xd11ae3a914fed7feULL, -1) +#define SLEEF_M_EGAMMAq sleef_q(+0x12788cfc6fb61LL, 0x8f49a37c7f0202a6ULL, -1) +#define SLEEF_M_PHIq sleef_q(+0x19e3779b97f4aLL, 0x7c15f39cc0605ceeULL, 0) +#define SLEEF_QUAD_MAX sleef_q(+0x1ffffffffffffLL, 0xffffffffffffffffULL, 16383) +#define SLEEF_QUAD_MIN sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -16382) +#define SLEEF_QUAD_EPSILON sleef_q(+0x1000000000000LL, 0x0000000000000000ULL, -112) +#define SLEEF_QUAD_DENORM_MIN sleef_q(+0x0000000000000LL, 0x0000000000000001ULL, -16382) + +#endif // #ifdef SLEEF_QUAD_C + +#define SLEEF_QUAD_MANT_DIG 113 +#define SLEEF_QUAD_MIN_EXP (-16381) +#define SLEEF_QUAD_MAX_EXP 16384 +#define SLEEF_QUAD_DIG 33 +#define SLEEF_QUAD_MIN_10_EXP (-4931) +#define SLEEF_QUAD_MAX_10_EXP 4932 diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_header.h.org b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_header.h.org new file mode 100644 index 0000000000000..2001d577aec32 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefquadinline_header.h.org @@ -0,0 +1,4216 @@ +// Copyright Naoki Shibata and contributors 2010 - 2021. +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +// This file is generated by SLEEF SLEEF_VERSION_SLEEF + +#ifndef SLEEF_ALWAYS_INLINE +#if defined (__GNUC__) || defined (__clang__) || defined(__INTEL_COMPILER) +#define SLEEF_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define SLEEF_ALWAYS_INLINE inline __forceinline +#else +#define SLEEF_ALWAYS_INLINE inline +#endif +#endif + +#ifndef SLEEF_INLINE +#define SLEEF_INLINE static inline +#endif + +#ifndef SLEEF_CONST +#define SLEEF_CONST +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifndef SLEEF_FP_ILOGB0 +#define SLEEF_FP_ILOGB0 ((int)0x80000000) +#endif + +#ifndef SLEEF_FP_ILOGBNAN +#define SLEEF_FP_ILOGBNAN ((int)2147483647) +#endif + +#define SLEEFQUADINLINE_SLEEF_SIMD_SLEEF_H_INCLUDED + +#ifndef __SLEEF_QREMPITAB__ +#define __SLEEF_QREMPITAB__ +static const double Sleef_rempitabqp[] = { + 0.15915494308865163475, 114.12758349655632628, 87.820147804392036051, 27.423136899138626177, + 14.254027919272630243, 85.935026329207175877, 114.27691102886092267, 37.750191829592949944, + 2.4546589403216785286, 111.34725244651053799, 62.908236858707823558, 87.408456635555921821, + 64.604759095473127672, 28.784837529448850546, 51.622219578821386676, 23.484166172853292665, + 126.14843699368429952, 64.497947248710261192, 90.04072758117763442, 79.851150118094665231, + 93.238662576877686661, 47.957378064249496674, 44.495092337878304534, 122.05645651105805882, + 36.728927543368627084, 8.9860062754451064393, 3.1885831643376150168, 117.4925837228220189, + 107.81580297079563024, 72.690177145766938338, 6.3499807085099746473, 64.814470052646356635, + 32.07563458668300882, 48.190104861652798718, 40.78663459321251139, 17.552382976566150319, + 13.621939875218231464, 21.256544246167322854, 57.381995073275902541, 9.6354705119701975491, + 41.499050218579213833, 113.6220945173263317, 79.59452043374767527, 103.64401134191575693, + 123.88471844718515058, 101.4736260631980258, 18.097774968078738311, 85.95650738066615304, + 76.065655079091811785, 37.675427324622432934, 68.676777671174932038, 32.00599382463042275, + 53.77951688189568813, 0.19179906913632294163, 73.478443940475699492, 111.92379273104597814, + 40.996545034144219244, 107.14597675384720787, 124.38805678367862129, 98.636395050234568771, + 103.347364549201302, 101.568637595839391, 98.20809433281829115, 0.21127150943721062504, + 6.4992127331242954824, 115.19938259065020247, 123.67517849772775662, 108.64186459926349926, + 2.9984621451549173798, 4.6062990500759042334, 93.491721027461608173, 49.145381707759952405, + 52.727074269980221288, 71.068700205698405625, 99.034355036987108178, 24.011549219118023757, + 111.50147725937858922, 49.03615573892602697, 53.722402094637800474, 91.897739203315722989, + 18.206447852357086958, 109.32060226575413253, 97.416567328084056498, 19.228490159101056634, + 125.86502164847843233, 68.117931140997825423, 37.659347287717537256, 94.778508877261629095, + 125.23389264055003878, 9.1960193313898344059, 89.79227686872400227, 44.219955035077873617, + 80.594031160762824584, 98.175325535910815233, 9.1060313697525998577, 1.3536325568711617962, + 74.266441315219708486, 112.02497297326408443, 78.441242103348486125, 30.240608034280739957, + 35.887181287234852789, 31.222180933826166438, 111.20435677495697746, 16.961934521656075958, + 75.690011131529900013, 19.857096218624064932, 39.445799316181364702, 89.399067092508630594, + 9.8946251570741878822, 75.790836480315192603, 41.449609204857551958, 16.424785501782025676, + 110.92636979258531937, 35.2268612109037349, 93.553590155912388582, 60.716867816085141385, + 101.8275823641452007, 0.52353978253449895419, 53.558147969339188421, 14.022688405977532966, + 47.412589899395243265, 67.466685592477006139, 20.558449846765142865, 42.477512440153077478, + 78.376983236481464701, 52.194720245763164712, 80.210266588394006249, 10.32282516378472792, + 13.76645060176088009, 65.576818637229735032, 113.30637098982697353, 33.130573191992880311, + 85.595008141503058141, 40.008528567348548677, 76.341531842852418777, 14.979836669819633244, + 71.290441850942443125, 102.19776376600566437, 98.564603420047205873, 14.271847993266419508, + 80.116664932062121807, 19.992192520050593885, 36.609960786536248634, 73.030199955795978894, + 104.99763589425128885, 48.433380696202220861, 57.572455457851901883, 118.88634466403527767, + 44.860695004797889851, 73.750690998633217532, 13.556655583906831453, 88.593745596503140405, + 14.11532725519646192, 43.085424128406884847, 9.7802314795590064023, 30.352614322964655003, + 90.858137878454726888, 85.039140199140092591, 23.407077980155008845, 18.207643349760473939, + 20.440075362967036199, 109.47096555736425216, 66.428168903472396778, 106.84400033217025339, + 91.750582754768402083, 76.596534958600386744, 17.320324285941751441, 49.535734807919652667, + 113.66190455558171379, 61.225422811843600357, 18.669559649624716258, 76.387663934096053708, + 74.178235974148265086, 85.815782102505181683, 122.10498128451581579, 24.799236859667871613, + 123.2972609065072902, 50.72595180519783753, 121.41778173806596897, 114.39462376141091227, + 90.193730781800695695, 3.0683144895410805475, 26.293759879121353151, 46.076575149436393986, + 19.660881336145394016, 25.597005338699091226, 101.31112300279710325, 103.8807629969487607, + 91.892762314044375671, 57.045969595055794343, 110.15196133002973511, 94.689776863833685638, + 49.182032269411138259, 123.69104138236070867, 113.69436034850150463, 117.72063118611185928, + 1.4682589776566601358, 23.970066872989264084, 91.772521428280015243, 32.248277749331464292, + 74.556784206688462291, 120.01798423568834551, 87.713686773899098625, 80.036939679470378906, + 58.663490617163915886, 21.035325459186424268, 79.868647571121982764, 19.982377222022478236, + 57.246738529793219641, 1.9401161782407143619, 7.9883917663682950661, 108.92261904602855793, + 42.957866646069305716, 55.213983339206606615, 85.734177860773343127, 8.1786861732471152209, + 113.8021284014939738, 6.3038078266908996738, 108.74856571221971535, 13.502748231236182619, + 29.736439245178189594, 66.181101124901033472, 14.021098141827678774, 50.432291116485430393, + 71.692326357551792171, 112.62160509388922947, 46.52251733029333991, 70.328927450136689004, + 82.779915324492321815, 114.20617270459479187, 120.00074403454345884, 27.256265592593990732, + 72.206675336365151452, 105.47692570983417681, 90.069591432285960764, 59.451044258996262215, + 6.5436011348210740834, 11.666369110360392369, 127.00500442843986093, 66.781588143319822848, + 101.71752368163652136, 110.83473463953487226, 9.4843589676565898117, 87.965483504598523723, + 32.660788242061244091, 94.484722863278875593, 121.36131720729463268, 27.298648878622771008, + 105.17309219513481366, 68.000137710059789242, 93.444196628861391218, 44.093294898437306983, + 44.109477207573945634, 104.37636018792545656, 16.936308635202294681, 42.461140061379410326, + 48.120956522194319405, 47.03053727519363747, 74.836943859434541082, 76.560959611877478892, + 70.982041261755512096, 106.17278879548030091, 17.240951762454642449, 116.54761581097409362, + 85.489981931084912503, 19.448874795671144966, 68.055698282205412397, 120.54780957969705923, + 79.357897397254419047, 26.784055884931149194, 8.8652342647874320392, 93.554617017987766303, + 36.863637874987034593, 107.36296787388710072, 114.24380599117284874, 57.996031665523332777, + 107.15169167585190735, 6.8493815877518500201, 70.030736486780369887, 104.34439242449298035, + 32.394922227955248673, 72.045712768554949434, 125.99193223337715608, 79.855994894536706852, + 102.91479410954343621, 19.828504664699721616, 19.423237169754429488, 49.419210917687451001, + 51.794468197291280376, 59.485514724419772392, 78.600481083303748164, 75.802543954887369182, + 49.485430251796060475, 125.97828236915302114, 98.782930868979747174, 83.325835802559595322, + 59.946491932565550087, 73.477066622643178562, 89.105636388390848879, 73.372970791053376161, + 18.817599439345940482, 102.06705368556504254, 45.42352350837609265, 23.440921115026867483, + 90.344093902869644808, 17.970589397602452664, 53.956875561776541872, 55.525845976218988653, + 49.46730813278190908, 77.778136706394434441, 43.505807501616800437, 67.471431943824427435, + 84.265864734097704059, 14.933240975493390579, 24.684664495714969235, 126.41874786355037941, + 1.3222032844169007149, 126.01238007772190031, 83.383431563808699138, 113.72324844212562311, + 21.304834404720168095, 62.332525882295158226, 51.597882727459364105, 0.67672862408289802261, + 30.132787537324475124, 27.410108195865177549, 20.656855709145020228, 49.723609964024944929, + 119.05708648653671844, 91.246047016928059747, 84.369696109431970399, 85.591131138298806036, + 14.127644950760441134, 4.2155267645284766331, 24.204889203938364517, 19.661099106528126867, + 82.477870938018895686, 120.89188850888967863, 122.58114253445455688, 120.63265677435265388, + 27.082481923996965634, 29.761974944867688464, 72.461197358730714768, 84.204483040954073658, + 80.890771993039379595, 99.777925805155973649, 91.8974949579933309, 94.518818676227965625, + 126.28205386120316689, 88.787575110411125934, 93.769932165232603438, 79.733441483964270446, + 38.645666720854933374, 115.27208568365676911, 31.268716353544732556, 112.30475518474486307, + 74.891574611563555663, 115.66812160437984858, 18.66350298186080181, 94.633595189065090381, + 109.45983699533462641, 108.68776993196661351, 58.76809135159055586, 61.680897811242175521, + 38.882956551777169807, 45.576713001821190119, 7.4377005918177019339, 120.60427874347078614, + 120.21996894028052338, 47.606037590059713693, 0.31830988618094124831, 100.25516699311629054, + 47.640295608784072101, 54.846273798277252354, 28.508055838548898464, 43.870052658417989733, + 100.55382205772184534, 75.500383659185899887, 4.9093178806469950359, 94.694504893021075986, + 125.81647371741928509, 46.816913271115481621, 1.2095181909462553449, 57.569675058897701092, + 103.24443915764277335, 46.968332345710223308, 124.29687398737223702, 0.99589449742416036315, + 52.081455162358906819, 31.702300236192968441, 58.477325153755373321, 95.914756128498993348, + 88.990184675760247046, 116.11291302211611765, 73.457855086737254169, 17.972012550890212879, + 6.3771663286788680125, 106.98516744564767578, 87.631605941594898468, 17.380354291533876676, + 12.699961417023587273, 1.6289401052927132696, 64.15126917336601764, 96.380209723305597436, + 81.573269186425022781, 35.104765953132300638, 27.243879750436462928, 42.513088492334645707, + 114.76399014655180508, 19.270941023940395098, 82.998100437162065646, 99.244189034656301374, + 31.189040867498988518, 79.288022683835151838, 119.76943689437393914, 74.947252126396051608, + 36.195549936161114601, 43.913014761335944058, 24.131310158183623571, 75.350854649248503847, + 9.3535553423498640768, 64.011987649260845501, 107.55903376379137626, 0.38359813827628386207, + 18.956887880955036962, 95.847585462091956288, 81.993090068292076467, 86.291953507698053727, + 120.77611356736088055, 69.272790100472775521, 78.694729098406241974, 75.137275191682419972, + 68.4161886656365823, 0.42254301887442125008, 12.998425466252228944, 102.39876518130404293, + 119.35035699545915122, 89.283729198526998516, 5.9969242903098347597, 9.2125981001554464456, + 58.983442054923216347, 98.290763415519904811, 105.45414853996408056, 14.137400411400449229, + 70.068710073974216357, 48.023098438239685493, 95.002954518757178448, 98.07231147785205394, + 107.44480418927923893, 55.795478406631445978, 36.412895704717811896, 90.641204531511903042, + 66.833134656168112997, 38.456980318205751246, 123.73004329696050263, 8.2358622819956508465, + 75.318694575438712491, 61.557017754526896169, 122.46778528110007755, 18.392038662783306791, + 51.58455373744800454, 88.439910070159385214, 33.188062321529287146, 68.350651071821630467, + 18.212062739505199715, 2.7072651137459615711, 20.53288263044305495, 96.04994594653180684, + 28.882484206696972251, 60.481216068561479915, 71.774362574469705578, 62.444361867655970855, + 94.408713549913954921, 33.923869043315789895, 23.380022263059800025, 39.714192437248129863, + 78.891598632366367383, 50.798134185017261188, 19.789250314152013743, 23.581672960630385205, + 82.899218409715103917, 32.849571003567689331, 93.852739585170638748, 70.453722421811107779, + 59.107180311824777164, 121.43373563217392075, 75.655164728290401399, 1.0470795650689979084, + 107.11629593867837684, 28.045376811955065932, 94.825179798794124508, 6.9333711849540122785, + 41.116899693530285731, 84.955024880309792934, 28.753966472962929402, 104.3894404915299674, + 32.420533176788012497, 20.64565032756945584, 27.532901203525398159, 3.1536372744631080423, + 98.612741979653947055, 66.261146383989398601, 43.190016283006116282, 80.017057134700735332, + 24.683063685704837553, 29.959673339642904466, 14.580883701888524229, 76.39552753201496671, + 69.129206840094411746, 28.543695986536476994, 32.233329864124243613, 39.984385040101187769, + 73.219921573076135246, 18.060399911595595768, 81.995271788502577692, 96.866761392404441722, + 115.14491091570744175, 109.77268932807055535, 89.721390009599417681, 19.501381997266435064, + 27.113311167817300884, 49.18749119300628081, 28.230654510392923839, 86.170848256813769694, + 19.560462959118012805, 60.705228645932947984, 53.716275756913091755, 42.078280398280185182, + 46.81415596031001769, 36.415286699520947877, 40.880150725937710376, 90.941931114732142305, + 4.8563378069484315347, 85.688000664344144752, 55.501165509540442144, 25.193069917200773489, + 34.640648571883502882, 99.071469615842943313, 99.323809111163427588, 122.45084562368720071, + 37.339119299253070494, 24.775327868195745395, 20.356471948300168151, 43.631564205014001345, + 116.20996256903163157, 49.598473719339381205, 118.5945218130145804, 101.45190361039931304, + 114.83556347613557591, 100.78924752282546251, 52.38746156360139139, 6.136628979082161095, + 52.587519758242706303, 92.153150298872787971, 39.321762672290788032, 51.194010677401820431, + 74.622246005597844487, 79.761525993901159381, 55.785524628088751342, 114.09193919011522667, + 92.303922660063108196, 61.379553727667371277, 98.364064538825914497, 119.38208276472505531, + 99.388720697006647242, 107.44126237222371856, 2.9365179553133202717, 47.940133745982166147, + 55.545042856560030486, 64.496555498666566564, 21.113568413380562561, 112.03596847138032899, + 47.42737354780183523, 32.073879358940757811, 117.32698123432783177, 42.070650918376486516, + 31.737295142243965529, 39.964754444044956472, 114.49347705958643928, 3.8802323564814287238, + 15.976783532740228111, 89.845238092057115864, 85.915733292138611432, 110.42796667841685121, + 43.468355721546686254, 16.357372346497868421, 99.604256802987947594, 12.607615653385437327, + 89.497131424439430702, 27.005496462472365238, 59.472878490360017167, 4.3622022498020669445, + 28.042196283655357547, 100.86458223297449877, 15.384652715107222321, 97.243210187778458931, + 93.045034660590317799, 12.657854900277015986, 37.559830648988281609, 100.41234540919322171, + 112.00148806908691768, 54.512531185191619443, 16.413350672733940883, 82.953851419671991607, + 52.139182864571921527, 118.90208851799252443, 13.087202269642148167, 23.332738220724422717, + 126.01000885688335984, 5.5631762866432836745, 75.435047363276680699, 93.669469279069744516, + 18.968717935316817602, 47.930967009197047446, 65.321576484126126161, 60.969445726561389165, + 114.72263441458926536, 54.597297757249179995, 82.346184390273265308, 8.0002754201232164633, + 58.888393257722782437, 88.186589796874613967, 88.218954415151529247, 80.752720375850913115, + 33.872617270404589362, 84.922280122758820653, 96.241913044388638809, 94.061074550390912918, + 21.673887718872720143, 25.121919223758595763, 13.964082523514662171, 84.34557759096060181, + 34.481903524912922876, 105.09523162195182522, 42.979963862169825006, 38.897749591345927911, + 8.1113965644144627731, 113.09561915939775645, 30.715794794508838095, 53.568111769862298388, + 17.730468529578502057, 59.109234035975532606, 73.727275749977707164, 86.725935747777839424, + 100.48761198234569747, 115.99206333105030353, 86.303383351703814697, 13.698763175507338019, + 12.061472973564377753, 80.688784848985960707, 64.789844455914135324, 16.091425537113536848, + 123.98386446675795014, 31.711989789077051682, 77.829588219086872414, 39.657009329399443232, + 38.846474339508858975, 98.838421835374902003, 103.58893639458256075, 118.97102944884318276, + 29.200962166611134307, 23.605087909774738364, 98.970860503595758928, 123.95656473830968025, + 69.565861737963132327, 38.651671605119190644, 119.89298386513473815, 18.954133245289995102, + 50.211272776785335736, 18.745941582106752321, 37.635198878695518943, 76.134107371130085085, + 90.8470470167521853, 46.881842230057372944, 52.688187805739289615, 35.941178795204905327, + 107.91375112355308374, 111.05169195243797731, 98.934616265567456139, 27.556273412788868882, + 87.011615003237238852, 6.9428638876524928492, 40.531729468195408117, 29.866481950986781158, + 49.369328991433576448, 124.83749572710075881, 2.6444065688374394085, 124.02476015544743859, + 38.766863127621036256, 99.446496884251246229, 42.60966880944033619, 124.66505176459031645, + 103.19576545491872821, 1.3534572481657960452, 60.265575074648950249, 54.820216391730355099, + 41.313711418290040456, 99.447219928053527838, 110.11417297307707486, 54.492094033859757474, + 40.739392218867578777, 43.182262276597612072, 28.255289901520882268, 8.4310535290569532663, + 48.409778407876729034, 39.322198213059891714, 36.95574187604142935, 113.78377701778299524, + 117.16228506891275174, 113.26531354870530777, 54.164963847993931267, 59.523949889739014907, + 16.922394717465067515, 40.408966081911785295, 33.781543986082397169, 71.555851610315585276, + 55.794989915990299778, 61.037637352459569229, 124.56410772240997176, 49.575150220825889846, + 59.539864330468844855, 31.466882967928540893, 77.291333441713504726, 102.54417136731353821, + 62.53743270709310309, 96.609510369493364124, 21.783149223130749306, 103.33624320875969715, + 37.3270059637252416, 61.26719037813381874, 90.919673990672890795, 89.375539863933227025, + 117.53618270318111172, 123.36179562248435104, 77.765913103554339614, 91.153426003642380238, + 14.875401183639041847, 113.20855748694521026, 112.43993788056104677, 95.212075180119427387, + 0.63661977236552047543, 72.510333986232581083, 95.280591217568144202, 109.69254759655450471, + 57.016111677097796928, 87.740105316839617444, 73.107644115447328659, 23.000767318371799774, + 9.8186357612976280507, 61.389009786045789951, 123.63294743483857019, 93.633826542230963241, + 2.4190363818925106898, 115.13935011779904016, 78.488878315285546705, 93.936664691424084594, + 120.59374797474447405, 1.9917889948483207263, 104.16291032471781364, 63.404600472385936882, + 116.95465030751438462, 63.829512257001624675, 49.980369351524132071, 104.22582604423587327, + 18.915710173474508338, 35.944025101780425757, 12.754332657361374004, 85.970334891298989533, + 47.263211883189796936, 34.760708583067753352, 25.399922834047174547, 3.257880210589064518, + 0.30253834673567325808, 64.76041944661483285, 35.146538372850045562, 70.209531906264601275, + 54.487759500872925855, 85.026176984672929393, 101.52798029310361017, 38.541882047884428175, + 37.99620087432776927, 70.488378069312602747, 62.378081735001615016, 30.576045367673941655, + 111.53887378875151626, 21.894504252792103216, 72.391099872322229203, 87.826029522671888117, + 48.262620316370885121, 22.701709298497007694, 18.707110684703366132, 0.023975298525328980759, + 87.118067527582752518, 0.76719627655256772414, 37.913775761913711904, 63.695170924187550554, + 35.986180136587790912, 44.583907015399745433, 113.55222713472539908, 10.54558020094918902, + 29.389458196816121927, 22.274550383368477924, 8.8323773312731646001, 0.84508603774884250015, + 25.996850932508095866, 76.797530362611723831, 110.70071399092194042, 50.567458397053997032, + 11.993848580619669519, 18.425196200310892891, 117.96688410985007067, 68.581526831043447601, + 82.908297079928161111, 28.274800822804536438, 12.137420147948432714, 96.046196876483008964, + 62.005909037517994875, 68.144622955707745859, 86.889608378558477852, 111.59095681326289196, + 72.82579140943926177, 53.282409063027444063, 5.6662693123362259939, 76.91396063641514047, + 119.46008659392100526, 16.471724563994939672, 22.637389150877424981, 123.11403550905743032, + 116.93557056220015511, 36.784077325566613581, 103.16910747489964706, 48.879820140318770427, + 66.376124643062212272, 8.7013021436432609335, 36.424125479010399431, 5.4145302274919231422, + 41.065765260889747879, 64.099891893063613679, 57.764968413393944502, 120.96243213712659781, + 15.548725148939411156, 124.88872373531557969, 60.817427099827909842, 67.84773808663157979, + 46.76004452611960005, 79.428384874499897705, 29.783197264732734766, 101.59626837003452238, + 39.578500628304027487, 47.163345921264408389, 37.798436819430207834, 65.699142007139016641, + 59.705479170344915474, 12.907444843622215558, 118.21436062365319231, 114.86747126435147948, + 23.310329456580802798, 2.0941591301416337956, 86.232591877356753685, 56.090753623913769843, + 61.650359597588249017, 13.866742369908024557, 82.233799387064209441, 41.910049760619585868, + 57.507932945929496782, 80.778880983059934806, 64.841066353576024994, 41.291300655138911679, + 55.065802407050796319, 6.3072745489298540633, 69.225483959311532089, 4.5222927679787972011, + 86.380032566015870543, 32.034114269401470665, 49.366127371409675106, 59.919346679285808932, + 29.161767403780686436, 24.791055064033571398, 10.258413680188823491, 57.087391973072953988, + 64.466659728248487227, 79.968770080206013517, 18.439843146152270492, 36.120799823194829514, + 35.990543577008793363, 65.733522784812521422, 102.28982183141852147, 91.545378656144748675, + 51.442780019198835362, 39.002763994532870129, 54.226622335634601768, 98.374982386012561619, + 56.461309020789485658, 44.341696513627539389, 39.120925918236025609, 121.41045729186589597, + 107.43255151382618351, 84.156560796560370363, 93.62831192062003538, 72.830573399041895755, + 81.760301451879058732, 53.88386222946428461, 9.7126756139005010482, 43.376001328688289504, + 111.00233101908088429, 50.386139834401546977, 69.281297143770643743, 70.142939231689524604, + 70.647618222330493154, 116.90169124737440143, 74.678238598506140988, 49.550655736391490791, + 40.712943896600336302, 87.263128410031640669, 104.41992513806326315, 99.196947438682400389, + 109.18904362603279878, 74.903807220802264055, 101.6711269522747898, 73.578495045650925022, + 104.77492312720278278, 12.27325795816432219, 105.17503951648905058, 56.306300597745575942, + 78.643525344581576064, 102.38802135480727884, 21.244492011199326953, 31.523051987802318763, + 111.57104925618114066, 100.18387838023409131, 56.607845320126216393, 122.75910745533838053, + 68.728129077655466972, 110.7641655294537486, 70.777441394016932463, 86.882524744447437115, + 5.8730359106266405433, 95.880267491964332294, 111.09008571312369895, 0.99311099733313312754, + 42.2271368267647631, 96.071936942760657985, 94.854747095603670459, 64.147758717885153601, + 106.65396246865566354, 84.141301836752973031, 63.474590284487931058, 79.929508888093550922, + 100.98695411917287856, 7.7604647129628574476, 31.953567065484094201, 51.690476184117869707, + 43.831466584280860843, 92.855933356833702419, 86.936711443093372509, 32.71474469299937482, + 71.208513605975895189, 25.215231306774512632, 50.994262848878861405, 54.010992924944730476, + 118.94575698072003433, 8.7244044996041338891, 56.084392567314353073, 73.729164465948997531, + 30.76930543021808262, 66.48642037556055584, 58.090069321180635598, 25.315709800554031972, + 75.119661297980201198, 72.824690818390081404, 96.002976138173835352, 109.02506237038323889, + 32.826701345471519744, 37.907702839343983214, 104.27836572914748103, 109.80417703598504886, + 26.174404539284296334, 46.665476441452483414, 124.02001771376671968, 11.126352573290205328, + 22.870094726556999376, 59.338938558139489032, 37.937435870633635204, 95.861934018397732871, + 2.6431529682522523217, 121.93889145312641631, 101.44526882917853072, 109.19459551450199797, + 36.692368780546530616, 16.000550840246432927, 117.77678651544920285, 48.373179593752865912, + 48.437908830306696473, 33.50544075170182623, 67.745234540812816704, 41.844560245521279285, + 64.483826088780915597, 60.122149100781825837, 43.347775437745440286, 50.243838447517191526, + 27.92816504703296232, 40.691155181921203621, 68.963807049829483731, 82.190463243903650437, + 85.959927724339650013, 77.795499182691855822, 16.222793128832563525, 98.191238318795512896, + 61.43158958901767619, 107.13622353972459678, 35.460937059157004114, 118.21846807195470319, + 19.454551499959052308, 45.451871495559316827, 72.975223964695032919, 103.98412666210424504, + 44.606766703407629393, 27.397526351014676038, 24.122945947132393485, 33.377569697975559393, + 1.5796889118282706477, 32.182851074230711674, 119.96772893351590028, 63.423979578157741344, + 27.659176438173744828, 79.314018658798886463, 77.692948679021355929, 69.676843670753441984, + 79.177872789168759482, 109.94205889768636553, 58.401924333222268615, 47.210175819553114707, + 69.941721007195155835, 119.91312947662299848, 11.131723475926264655, 77.303343210242019268, + 111.78596773026947631, 37.908266490579990204, 100.42254555357067147, 37.491883164213504642, + 75.270397757394675864, 24.268214742263808148, 53.6940940335043706, 93.763684460114745889, + 105.37637561147857923, 71.882357590413448634, 87.827502247109805467, 94.103383904879592592, + 69.869232531134912279, 55.112546825581375742, 46.023230006474477705, 13.885727775304985698, + 81.063458936390816234, 59.732963901973562315, 98.738657982870790875, 121.67499145420151763, + 5.2888131376785167959, 120.04952031089487718, 77.53372625524571049, 70.892993768502492458, + 85.219337618884310359, 121.33010352918427088, 78.39153090983745642, 2.7069144963315920904, + 120.5311501492979005, 109.6404327834607102, 82.62742283658371889, 70.894439856110693654, + 92.228345946154149715, 108.98418806771951495, 81.478784437735157553, 86.364524553195224144, + 56.510579803041764535, 16.862107058113906533, 96.819556815753458068, 78.644396426119783428, + 73.911483752086496679, 99.567554035569628468, 106.32457013782914146, 98.530627097410615534, + 108.32992769598786253, 119.04789977947802981, 33.84478943493013503, 80.81793216382357059, + 67.563087972168432316, 15.111703220631170552, 111.58997983198059956, 122.07527470492277644, + 121.12821544481994351, 99.150300441651779693, 119.07972866093768971, 62.933765935860719765, + 26.582666883430647431, 77.088342734627076425, 125.07486541418984416, 65.219020738986728247, + 43.56629844626513659, 78.672486417519394308, 74.654011927450483199, 122.53438075627127546, + 53.83934798134941957, 50.751079727870092029, 107.07236540636586142, 118.72359124497234006, + 27.531826207112317206, 54.306852007284760475, 29.750802367281721672, 98.417114973894058494, + 96.879875761125731515, 62.424150360242492752, 1.2732395447346789297, 17.020667972468800144, + 62.561182435139926383, 91.385095193109009415, 114.03222335419923184, 47.480210633682872867, + 18.215288230894657318, 46.001534636743599549, 19.637271522595256101, 122.77801957209521788, + 119.26589486968077836, 59.267653084461926483, 4.8380727637886593584, 102.2787002356017183, + 28.977756630574731389, 59.873329382851807168, 113.1874959494889481, 3.9835779897002794314, + 80.325820649435627274, 126.80920094477551174, 105.90930061502876924, 127.65902451400324935, + 99.960738703051902121, 80.451652088471746538, 37.831420346949016675, 71.888050203560851514, + 25.508665314726385986, 43.940669782597979065, 94.526423766379593872, 69.521417166135506704, + 50.799845668094349094, 6.515760421178129036, 0.60507669347498449497, 1.5208388932296657003, + 70.293076745703729102, 12.419063812529202551, 108.97551900174948969, 42.052353969349496765, + 75.055960586207220331, 77.08376409576885635, 75.992401748659176519, 12.976756138625205494, + 124.75616347000323003, 61.152090735351521289, 95.077747577503032517, 43.789008505587844411, + 16.782199744648096384, 47.652059045343776233, 96.525240632741770241, 45.403418596994015388, + 37.414221369406732265, 0.047950597054295940325, 46.236135055165505037, 1.5343925531051354483, + 75.827551523827423807, 127.39034184837510111, 71.972360273175581824, 89.167814030803128844, + 99.104454269450798165, 21.091160401898378041, 58.778916393632243853, 44.549100766736955848, + 17.6647546625463292, 1.6901720754976850003, 51.993701865019829711, 25.595060725227085641, + 93.401427981843880843, 101.13491679410799406, 23.987697161239339039, 36.850392400625423761, + 107.93376821970377932, 9.1630536620905331802, 37.816594159856322221, 56.549601645609072875, + 24.274840295900503406, 64.092393752966017928, 124.01181807503962773, 8.2892459114191296976, + 45.779216757120593684, 95.18191362652942189, 17.65158281887852354, 106.56481812605488813, + 11.332538624676089967, 25.82792127283391892, 110.92017318784201052, 32.943449127989879344, + 45.274778301758487942, 118.22807101811849861, 105.87114112440031022, 73.568154651136865141, + 78.338214949799294118, 97.759640280641178833, 4.7522492861244245432, 17.402604287286521867, + 72.848250958020798862, 10.829060454983846284, 82.131530521783133736, 0.19978378612722735852, + 115.52993682679152698, 113.92486427425319562, 31.097450297882460291, 121.77744747063115938, + 121.63485419965945766, 7.6954761732631595805, 93.520089052242838079, 30.856769748999795411, + 59.566394529469107511, 75.192536740069044754, 79.157001256608054973, 94.326691842528816778, + 75.596873638864053646, 3.3982840142780332826, 119.41095834068983095, 25.814889687248069094, + 108.42872124731002259, 101.73494252870295895, 46.620658913161605597, 4.18831826028690557, + 44.465183754713507369, 112.18150724782753969, 123.30071919517649803, 27.733484739819687093, + 36.467598774128418881, 83.820099521239171736, 115.01586589186263154, 33.557761966123507591, + 1.6821327071520499885, 82.582601310277823359, 110.13160481410159264, 12.614549097863346105, + 10.450967918623064179, 9.0445855359612323809, 44.760065132031741086, 64.06822853880294133, + 98.732254742819350213, 119.83869335857161786, 58.323534807561372872, 49.582110128067142796, + 20.516827360377646983, 114.17478394614954595, 0.93331945650061243214, 31.937540160412027035, + 36.879686292304540984, 72.241599646389659029, 71.981087154021224706, 3.4670455696286808234, + 76.579643662840680918, 55.090757312289497349, 102.88556003839767072, 78.005527989065740258, + 108.45324467127284152, 68.749964772025123239, 112.92261804157897132, 88.683393027255078778, + 78.241851836475689197, 114.82091458373542991, 86.865103027656004997, 40.313121593124378705, + 59.256623841243708739, 17.661146798087429488, 35.520602903758117463, 107.76772445892856922, + 19.425351227801002096, 86.752002657380216988, 94.004662038161768578, 100.77227966880673193, + 10.562594287544925464, 12.285878463382687187, 13.295236444664624287, 105.80338249475244083, + 21.356477197012281977, 99.101311472782981582, 81.425887793204310583, 46.526256820066919317, + 80.839850276130164275, 70.393894877368438756, 90.378087252069235547, 21.807614441608166089, + 75.342253904553217581, 19.156990091305488022, 81.54984625440556556, 24.546515916332282359, + 82.350079032978101168, 112.61260119549478986, 29.287050689166790107, 76.77604270961455768, + 42.488984022398653906, 63.046103975608275505, 95.142098512365919305, 72.36775676046818262, + 113.21569064025607076, 117.51821491068039904, 9.4562581553145719226, 93.528331058911135187, + 13.554882788037502905, 45.76504948889487423, 11.746071821256919065, 63.760534983932302566, + 94.180171426247397903, 1.9862219946662662551, 84.454273653533164179, 64.143873885524953948, + 61.709494191210978897, 0.2955174357739451807, 85.307924937314965064, 40.282603673505946063, + 126.94918056897950009, 31.859017776190739824, 73.973908238345757127, 15.520929425925714895, + 63.907134130968188401, 103.38095236823573941, 87.662933168565359665, 57.711866713671042817, + 45.873422886186745018, 65.429489386002387619, 14.417027211951790377, 50.430462613549025264, + 101.98852569775772281, 108.02198584989309893, 109.89151396144006867, 17.448808999208267778, + 112.16878513463234412, 19.458328931897995062, 61.538610860439803218, 4.9728407511211116798, + 116.1801386423612712, 50.631419601111701922, 22.239322595964040374, 17.649381636783800786, + 64.005952276351308683, 90.050124740766477771, 65.653402690943039488, 75.815405678691604408, + 80.556731458298600046, 91.608354071970097721, 52.348809078568592668, 93.330952882908604806, + 120.04003542753343936, 22.252705146580410656, 45.740189453113998752, 118.67787711627897806, + 75.874871741270908387, 63.723868036795465741, 5.2863059365081426222, 115.8777829062564706, + 74.890537658360699425, 90.389191029003995936, 73.384737561093061231, 32.001101680496503832, + 107.5535730308984057, 96.746359187505731825, 96.875817660613392945, 67.010881503407290438, + 7.4904690816256334074, 83.689120491046196548, 0.96765217756183119491, 120.24429820156365167, + 86.695550875490880571, 100.48767689503438305, 55.856330094065924641, 81.38231036384604522, + 9.9276140996626054402, 36.380926487810938852, 43.919855448682938004, 27.590998365383711644, + 32.445586257668765029, 68.382476637591025792, 122.86317917803899036, 86.272447079449193552, + 70.921874118317646207, 108.43693614390940638, 38.909102999918104615, 90.903742991122271633, + 17.950447929393703816, 79.968253324208490085, 89.213533406815258786, 54.795052702029352076, + 48.24589189426478697, 66.755139395951118786, 3.1593778236565412953, 64.365702148465061327, + 111.93545786703180056, 126.84795915631548269, 55.318352876351127634, 30.628037317601410905, + 27.385897358046349837, 11.353687341510521946, 30.355745578341156943, 91.884117795372731052, + 116.80384866644453723, 94.420351639109867392, 11.883442014393949648, 111.82625895324599696, + 22.263446951856167288, 26.606686420487676514, 95.571935460538952611, 75.816532981163618388, + 72.845091107141342945, 74.983766328430647263, 22.540795514789351728, 48.536429484527616296, + 107.38818806701237918, 59.527368920233129757, 82.75275122296079644, 15.764715180830535246, + 47.655004494223248912, 60.206767809762823163, 11.738465062269824557, 110.22509365116275148, + 92.046460012948955409, 27.771455550613609375, 34.126917872781632468, 119.46592780395076261, + 69.477315965745219728, 115.34998290840303525, 10.577626275360671571, 112.09904062179339235, + 27.067452510495058959, 13.785987537008622894, 42.438675237772258697, 114.66020705837217974, + 28.78306181967491284, 5.4138289926668221597, 113.06230029859943897, 91.280865566925058374, + 37.254845673171075759, 13.788879712225025287, 56.456691892311937409, 89.968376135442667874, + 34.957568875473953085, 44.729049106390448287, 113.02115960608352907, 33.724214116231451044, + 65.639113631510554114, 29.288792852243204834, 19.822967504176631337, 71.135108071142894914, + 84.649140275661920896, 69.061254194824869046, 88.659855391979363048, 110.09579955895605963, + 67.689578869863908039, 33.63586432765077916, 7.1261759443368646316, 30.223406441265979083, + 95.179959663964837091, 116.15054940984919085, 114.25643088964352501, 70.300600883307197364, + 110.15945732187537942, 125.86753187172143953, 53.165333766864932841, 26.176685469257790828, + 122.1497308283833263, 2.4380414779734564945, 87.132596892533911159, 29.344972835042426595, + 21.308023854904604377, 117.06876151254255092, 107.67869596269883914, 101.50215945574382204, + 86.144730812735360814, 109.44718248994468013, 55.063652414224634413, 108.61370401456952095, + 59.501604734567081323, 68.834229947791754967, 65.75975152225146303, 124.8483007204849855, + 2.5464790894693578593, 34.041335944937600289, 125.12236487028349075, 54.770190386221656809, + 100.06444670839846367, 94.960421267365745734, 36.430576461789314635, 92.003069273487199098, + 39.274543045194150181, 117.55603914419407374, 110.53178973936155671, 118.53530616892385297, + 9.6761455275809566956, 76.557400471203436609, 57.955513261149462778, 119.74665876570725231, + 98.374991898977896199, 7.9671559794041968416, 32.651641298874892527, 125.61840188955466147, + 83.818601230061176466, 127.31804902801013668, 71.921477406107442221, 32.903304176943493076, + 75.66284069390167133, 15.776100407121703029, 51.017330629452771973, 87.881339565199596109, + 61.052847532762825722, 11.042834332271013409, 101.59969133618869819, 13.031520842356258072, + 1.2101533869499689899, 3.0416777864629693795, 12.586153491407458205, 24.83812762506204308, + 89.951038003498979378, 84.104707938702631509, 22.11192117241807864, 26.167528191541350679, + 23.984803497318353038, 25.953512277254048968, 121.51232694000646006, 122.30418147070668056, + 62.155495155006065033, 87.578017011175688822, 33.564399489296192769, 95.304118090691190446, + 65.050481265483540483, 90.806837193988030776, 74.82844273881346453, 0.095901194108591880649, + 92.472270110331010073, 3.0687851062139088754, 23.655103047658485593, 126.7806836967538402, + 15.944720546354801627, 50.335628061609895667, 70.20890853890159633, 42.182320803796756081, + 117.55783278726448771, 89.098201533473911695, 35.329509325092658401, 3.3803441509953700006, + 103.98740373003965942, 51.19012145045780926, 58.802855963691399666, 74.269833588215988129, + 47.975394322478678077, 73.700784801254485501, 87.867536439407558646, 18.32610732418106636, + 75.633188319712644443, 113.09920329121814575, 48.549680591804644791, 0.18478750593567383476, + 120.02363615007925546, 16.578491822838259395, 91.558433514244825346, 62.36382725305884378, + 35.303165637760685058, 85.129636252109776251, 22.665077249352179933, 51.655842545671475818, + 93.840346375684021041, 65.886898255979758687, 90.549556603520613862, 108.45614203624063521, + 83.742282248804258415, 19.136309302277368261, 28.676429899602226214, 67.519280561282357667, + 9.5044985722488490865, 34.805208574576681713, 17.696501916041597724, 21.658120909971330548, + 36.263061043566267472, 0.39956757225809269585, 103.05987365358669194, 99.849728548506391235, + 62.19490059576855856, 115.55489494126595673, 115.26970839931891533, 15.39095234652995714, + 59.040178104485676158, 61.713539497999590822, 119.132789058941853, 22.385073480141727487, + 30.314002513219747925, 60.653383685061271535, 23.193747277728107292, 6.796568028559704544, + 110.8219166813796619, 51.629779374499776168, 88.85744249462368316, 75.469885057405917905, + 93.241317826323211193, 8.3766365205738111399, 88.930367509430652717, 96.363014495658717351, + 118.60143839035299607, 55.466969479639374185, 72.935197548260475742, 39.640199042481981451, + 102.03173178372526309, 67.115523932247015182, 3.3642654143077379558, 37.165202620559284696, + 92.263209628203185275, 25.229098195726692211, 20.901935837246128358, 18.089171071922464762, + 89.520130264067120152, 0.13645707760952063836, 69.464509485642338404, 111.67738671714323573, + 116.64706961512274574, 99.164220256134285592, 41.033654720758931944, 100.34956789229909191, + 1.8666389130012248643, 63.87508032082405407, 73.759372584612719947, 16.483199292782956036, + 15.962174308042449411, 6.9340911392609996255, 25.159287325681361835, 110.18151462458263268, + 77.771120076798979426, 28.011055978135118494, 88.906489342549321009, 9.4999295440538844559, + 97.845236083161580609, 49.366786054513795534, 28.483703672955016373, 101.64182916747449781, + 45.730206055312009994, 80.626243186248757411, 118.51324768248741748, 35.322293596174858976, + 71.041205807519872906, 87.53544891785713844, 38.850702455605642172, 45.504005314764071954, + 60.009324076327175135, 73.544559337613463867, 21.125188575089850929, 24.571756926765374374, + 26.590472889332886552, 83.606764989504881669, 42.712954394028201932, 70.202622945569601143, + 34.851775586408621166, 93.052513640137476614, 33.679700552263966529, 12.787789754740515491, + 52.756174504138471093, 43.615228883219970157, 22.684507809106435161, 38.313980182614614023, + 35.09969250881113112, 49.093031832668202696, 36.700158065959840314, 97.225202390989579726, + 58.574101378337218193, 25.552085419229115359, 84.977968044797307812, 126.09220795122018899, + 62.284197024735476589, 16.735513520940003218, 98.431381280515779508, 107.03642982136079809, + 18.912516310632781824, 59.056662117822270375, 27.109765576075005811, 91.53009897778974846, + 23.492143642513838131, 127.52106996786824311, 60.360342852494795807, 3.972443989336170489, + 40.908547307069966337, 0.28774777104990789667, 123.41898838242195779, 0.59103487155152834021, + 42.615849874629930127, 80.565207347015530104, 125.89836113795900019, 63.718035552385117626, + 19.947816476691514254, 31.04185885185142979, 127.81426826194001478, 78.761904736475116806, + 47.32586633713071933, 115.42373342734208563, 91.746845772377128014, 2.8589787720047752373, + 28.834054423903580755, 100.86092522710168851, 75.977051395519083599, 88.043971699789835839, + 91.783027922880137339, 34.897617998420173535, 96.33757026926468825, 38.916657863795990124, + 123.07722172087960644, 9.9456815022458613385, 104.36027728472254239, 101.26283920222340384, + 44.478645191928080749, 35.298763273571239552, 0.011904552706255344674, 52.100249481536593521, + 3.3068053818897169549, 23.630811357386846794, 33.113462916600838071, 55.216708143940195441, + 104.69761815714082331, 58.661905765820847591, 112.08007085506687872, 44.505410293160821311, + 91.480378906231635483, 109.35575423256159411, 23.749743482541816775, 127.44773607359093148, + 10.572611873019923223, 103.75556581251657917, 21.781075316725036828, 52.778382058011629852, + 18.769475122186122462, 64.002203360996645642, 87.107146061800449388, 65.492718375015101628, + 65.75163532123042387, 6.0217630068145808764, 14.980938163254904794, 39.378240982092393097, + 1.9353043551273003686, 112.48859640313094133, 45.391101750985399121, 72.975353790068766102, + 111.71266018813548726, 34.764620727692090441, 19.85522819932521088, 72.761852975621877704, + 87.839710897365876008, 55.181996730767423287, 64.891172515341168037, 8.7649532751856895629, + 117.72635835608161869, 44.544894158902025083, 13.843748236638930393, 88.873872287818812765, + 77.818205999839847209, 53.807485982244543266, 35.900895858791045612, 31.936506648420618149, + 50.427066813630517572, 109.59010540405870415, 96.491783788533211919, 5.5102787919022375718, + 6.3187556473167205695, 0.73140429693376063369, 95.8709157340672391, 125.69591831263096537, + 110.63670575270225527, 61.25607463520282181, 54.771794716092699673, 22.707374683021043893, + 60.711491156685951864, 55.768235590749100083, 105.60769733289271244, 60.840703278219734784, + 23.766884028791537276, 95.652517906491993926, 44.526893903712334577, 53.213372840978991007, + 63.143870921081543202, 23.633065962330874754, 17.69018221428632387, 21.967532656861294527, + 45.081591029578703456, 97.072858969058870571, 86.776376134024758358, 119.05473784046989749, + 37.50550244592159288, 31.529430361661070492, 95.310008988446497824, 120.41353561952564633, + 23.476930124543287093, 92.450187302329140948, 56.092920025897910818, 55.542911101227218751, + 68.253835745566902915, 110.9318556079051632, 10.954631931494077435, 102.69996581680607051, + 21.15525255072498112, 96.198081243586784694, 54.134905020990117919, 27.571975074017245788, + 84.877350475548155373, 101.32041411674435949, 57.56612363934982568, 10.827657985337282298, + 98.124600597202515928, 54.561731133850116748, 74.509691346342151519, 27.577759424450050574, + 112.9133837846275128, 51.936752270885335747, 69.91513775094790617, 89.458098212784534553, + 98.04231921216705814, 67.448428232466540067, 3.2782272630211082287, 58.577585704486409668, + 39.645935008356900653, 14.270216142289427808, 41.29828055132747977, 10.122508389653376071, + 49.319710783962364076, 92.191599117915757233, 7.3791577397278160788, 67.271728655301558319, + 14.252351888673729263, 60.446812882535596145, 62.359919327933312161, 104.30109881970201968, + 100.51286177929068799, 12.601201766618032707, 92.31891464375439682, 123.73506374344287906, + 106.33066753372986568, 52.353370938519219635, 116.2994616567666526, 4.8760829559505509678, + 46.265193785067822319, 58.689945670084853191, 42.616047709812846733, 106.13752302508873981, + 87.357391925401316257, 75.004318911491282051, 44.289461625474359607, 90.894364979889360256, + 110.1273048284529068, 89.227408029139041901, 119.00320946913780062, 9.668459895587147912, + 3.5195030445065640379, 121.69660144096997101, 5.0929581789387157187, 68.082671889878838556, + 122.24472974056698149, 109.5403807724469516, 72.128893416800565319, 61.920842534731491469, + 72.861152923582267249, 56.006138546974398196, 78.549086090391938342, 107.11207828839178546, + 93.063579478726751404, 109.07061233784770593, 19.35229105516555137, 25.114800942406873219, + 115.91102652230256354, 111.49331753141814261, 68.749983797955792397, 15.934311958808393683, + 65.303282597753423033, 123.23680377911296091, 39.63720246012599091, 126.63609805602391134, + 15.842954812214884441, 65.80660835389062413, 23.325681387803342659, 31.552200814243406057, + 102.03466125890918192, 47.762679130399192218, 122.10569506552565144, 22.085668664545664797, + 75.199382672377396375, 26.063041684712516144, 2.4203067738999379799, 6.083355572925938759, + 25.17230698281491641, 49.676255250127724139, 51.902076007001596736, 40.209415877405263018, + 44.223842344836157281, 52.335056383082701359, 47.969606994636706077, 51.907024554511735914, + 115.02465388001655811, 116.60836294141336111, 124.31099031001576805, 47.156034022351377644, + 67.128798978596023517, 62.60823618138601887, 2.1009625309707189444, 53.613674387979699532, + 21.65688547762692906, 0.19180238822082174011, 56.944540220662020147, 6.1375702124278177507, + 47.310206095320609165, 125.56136739350768039, 31.889441092709603254, 100.67125612322342931, + 12.41781707780319266, 84.364641607597150141, 107.11566557453261339, 50.19640306694782339, + 70.659018650185316801, 6.76068830199437798, 79.974807460079318844, 102.38024290091561852, + 117.60571192738643731, 20.539667176431976259, 95.950788644960994134, 19.401569602512608981, + 47.735072878815117292, 36.652214648365770699, 23.266376639428926865, 98.198406582436291501, + 97.099361183609289583, 0.36957501187498564832, 112.04727230015851092, 33.156983645680156769, + 55.116867028489650693, 124.72765450611768756, 70.606331275525008095, 42.259272504219552502, + 45.330154498704359867, 103.31168509134658962, 59.68069275137168006, 3.7737965119631553534, + 53.099113207044865703, 88.912284072484908393, 39.484564497608516831, 38.272618604554736521, + 57.352859799208090408, 7.0385611225647153333, 19.008997144497698173, 69.610417149153363425, + 35.393003832083195448, 43.316241819942661095, 72.526122087132534944, 0.7991351445198233705, + 78.119747307177021867, 71.699457097012782469, 124.3898011915407551, 103.10978988253555144, + 102.53941679863783065, 30.78190469305991428, 118.08035620897135232, 123.42707899600281962, + 110.265578117883706, 44.770146960283454973, 60.62800502643949585, 121.30676737012254307, + 46.387494555456214584, 13.593136057123047067, 93.643833362759323791, 103.25955874900319031, + 49.714884989251004299, 22.939770114815473789, 58.482635652646422386, 16.753273041151260259, + 49.860735018864943413, 64.726028991321072681, 109.20287678070599213, 110.93393895928238635, + 17.870395096520951483, 79.28039808496760088, 76.063463567454164149, 6.2310478644940303639, + 6.7285308286154759116, 74.330405241122207372, 56.52641925640637055, 50.458196391453384422, + 41.803871674492256716, 36.178342143848567503, 51.040260528134240303, 0.27291415522267925553, + 10.929018971288314788, 95.354773434290109435, 105.29413923024912947, 70.328440512268571183, + 82.067309441521501867, 72.699135784598183818, 3.7332778260024497285, 127.75016064165174612, + 19.518745169225439895, 32.966398585565912072, 31.924348616084898822, 13.868182278521999251, + 50.31857465136636165, 92.363029249168903334, 27.542240153597958852, 56.022111956273874966, + 49.812978685098642018, 18.999859088111406891, 67.690472166323161218, 98.733572109027591068, + 56.967407345913670724, 75.283658334948995616, 91.460412110627657967, 33.2524863725011528, + 109.02649536497483496, 70.644587192353355931, 14.08241161504338379, 47.07089783571427688, + 77.701404911211284343, 91.008010629528143909, 120.01864815265798825, 19.089118675226927735, + 42.250377150179701857, 49.143513853530748747, 53.180945778669411084, 39.213529979009763338, + 85.425908788060041843, 12.405245891139202286, 69.703551172820880311, 58.105027280274953227, + 67.359401104527933057, 25.575579509481030982, 105.51234900827694219, 87.230457766439940315, + 45.369015618212870322, 76.627960365229228046, 70.199385017622262239, 98.186063665336405393, + 73.400316131923318608, 66.450404781979159452, 117.14820275667443639, 51.104170838461868698, + 41.955936089598253602, 124.18441590244037798, 124.56839404947095318, 33.471027041883644415, + 68.862762561035196995, 86.072859642721596174, 37.825032621265563648, 118.11332423564454075, + 54.2195311521536496, 55.06019795557949692, 46.984287285031314241, 127.04213993573648622, + 120.72068570498959161, 7.9448879786723409779, 81.817094614139932673, 0.57549554210345377214, + 118.83797676484391559, 1.1820697431030566804, 85.231699749263498234, 33.130414694034698186, + 123.79672227591800038, 127.43607110477023525, 39.895632953383028507, 62.083717703706497559, + 127.62853652388366754, 29.523809472950233612, 94.651732674265076639, 102.84746685468780925, + 55.493691544754256029, 5.7179575440095504746, 57.668108847810799489, 73.721850454207014991, + 23.954102791041805176, 48.087943399583309656, 55.566055845760274678, 69.795235996843985049, + 64.675140538529376499, 77.833315727595618227, 118.15444344175921287, 19.891363004495360656, + 80.720554569448722759, 74.52567840444680769, 88.957290383856161498, 70.597526547142479103, + 0.023809105412510689348, 104.20049896307318704, 6.6136107637794339098, 47.261622714773693588, + 66.226925833201676141, 110.43341628788402886, 81.395236314281646628, 117.32381153164533316, + 96.160141710133757442, 89.010820586325280601, 54.960757812466908945, 90.711508465123188216, + 47.499486965087271528, 126.89547214718186297, 21.145223746043484425, 79.511131625033158343, + 43.562150633450073656, 105.5567641160232597, 37.538950244375882903, 0.0044067219969292636961, + 46.214292123604536755, 2.9854367500338412356, 3.5032706424608477391, 12.043526013629161753, + 29.961876326509809587, 78.756481964184786193, 3.8706087102582387161, 96.977192806261882652, + 90.782203501974436222, 17.950707580141170183, 95.425320376270974521, 69.529241455384180881, + 39.71045639865405974, 17.523705951247393386, 47.679421794731752016, 110.36399346153848455, + 1.7823450306823360734, 17.529906550375017105, 107.45271671216323739, 89.089788317804050166, + 27.687496473281498766, 49.747744575641263509, 27.636411999679694418, 107.61497196448908653, + 71.801791717582091223, 63.873013296841236297, 100.85413362726467312, 91.180210808121046284, + 64.983567577066423837, 11.020557583804475144, 12.637511294633441139, 1.4628085938711592462, + 63.741831468138116179, 123.39183662526556873, 93.273411505404510535, 122.51214927040564362, + 109.54358943218539935, 45.414749366042087786, 121.42298231337190373, 111.53647118150183815, + 83.215394665785424877, 121.68140655643946957, 47.53376805758671253, 63.305035812983987853, + 89.053787807424669154, 106.42674568195798201, 126.2877418421630864, 47.266131924661749508, + 35.380364428572647739, 43.935065313722589053, 90.16318205916104489, 66.14571793812137912, + 45.552752268053154694, 110.10947568093979498, 75.01100489184318576, 63.058860723325778963, + 62.620017976896633627, 112.82707123905129265, 46.953860249090212164, 56.900374604658281896, + 112.18584005179582164, 111.08582220245807548, 8.5076714911374438088, 93.863711215810326394, + 21.909263862991792848, 77.399931633612141013, 42.310505101453600219, 64.396162487173569389, + 108.26981004198023584, 55.143950148038129555, 41.754700951099948725, 74.640828233488718979, + 115.13224727869965136, 21.655315970678202575, 68.249201194405031856, 109.12346226770387148, + 21.019382692684303038, 55.155518848903739126, 97.826767569255025592, 103.87350454177430947, + 11.830275501899450319, 50.916196425572707085, 68.084638424337754259, 6.8968564649330801331, + 6.5564545260422164574, 117.15517140897281934, 79.291870016713801306, 28.540432284578855615, + 82.596561102654959541, 20.245016779306752142, 98.63942156792836613, 56.383198235831514467, + 14.758315479459270136, 6.543457310603116639, 28.504703777347458526, 120.89362576507119229, + 124.7198386558702623, 80.602197639407677343, 73.025723558581375983, 25.202403533239703393, + 56.63782928751243162, 119.4701274868893961, 84.661335067459731363, 104.70674187704207725, + 104.59892331353330519, 9.7521659119011019357, 92.530387570135644637, 117.37989134016970638, + 85.232095419629331445, 84.275046050181117607, 46.714783850806270493, 22.008637822982564103, + 88.578923250952357193, 53.788729959782358492, 92.254609656909451587, 50.45481605828172178, + 110.00641893827560125, 19.336919791174295824, 7.0390060890167660546, 115.39320288194358, + 10.185916357881069416, 8.1653437797613150906, 116.48945948113760096, 91.080761544897541171, + 16.257786833601130638, 123.84168506946662092, 17.722305847164534498, 112.01227709395243437, + 29.098172180787514662, 86.224156576787208905, 58.127158957457140787, 90.141224675695411861, + 38.70458211033110274, 50.229601884817384416, 103.82205304460876505, 94.986635062839923194, + 9.4999675959115847945, 31.868623917620425345, 2.6065651955104840454, 118.47360755822592182, + 79.2744049202556198, 125.27219611204782268, 31.685909624433406861, 3.6132167077812482603, + 46.651362775606685318, 63.104401628490450094, 76.069322517818363849, 95.525358260802022414, + 116.21139013105130289, 44.171337329094967572, 22.39876534475479275, 52.126083369425032288, + 4.8406135477998759598, 12.166711145851877518, 50.344613965629832819, 99.352510500255448278, + 103.80415201400319347, 80.418831754810526036, 88.447684689672314562, 104.67011276616540272, + 95.939213989273412153, 103.81404910902710981, 102.04930776003675419, 105.21672588283036021, + 120.62198062003153609, 94.312068044706393266, 6.2575979571920470335, 125.21647236277203774, + 4.2019250619414378889, 107.22734877595939906, 43.313770955253858119, 0.38360477644164348021, + 113.88908044132404029, 12.275140424855635501, 94.62041219064485631, 123.12273478701536078, + 63.778882185422844486, 73.342512246446858626, 24.835634155610023299, 40.729283215197938262, + 86.231331149065226782, 100.39280613389928476, 13.318037300370633602, 13.521376603992393939, + 31.949614920162275666, 76.760485801834875019, 107.21142385477287462, 41.079334352867590496, + 63.901577289921988267, 38.803139205025217962, 95.470145757630234584, 73.304429296731541399, + 46.532753278861491708, 68.396813164876220981, 66.198722367218579166, 0.73915002375360927545, + 96.094544600317021832, 66.313967291360313538, 110.23373405698293936, 121.4553090122390131, + 13.212662551050016191, 84.518545008439105004, 90.660308997412357712, 78.623370182693179231, + 119.36138550274336012, 7.5475930239263107069, 106.19822641409336939, 49.824568144969816785, + 78.969128995217033662, 76.545237209109473042, 114.70571959841618082, 14.077122245129430667, + 38.017994288999034325, 11.220834298306726851, 70.786007664166390896, 86.63248363988896017, + 17.052244174265069887, 1.5982702890432847198, 28.239494614357681712, 15.398914194029202918, + 120.77960238308514818, 78.219579765074740862, 77.078833597275661305, 61.563809386123466538, + 108.16071241794634261, 118.85415799200927722, 92.531156235767411999, 89.540293920566909947, + 121.25601005288262968, 114.61353474024508614, 92.774989110912429169, 27.186272114249732113, + 59.28766672552228556, 78.519117498006380629, 99.429769978502008598, 45.879540229630947579, + 116.96527130529284477, 33.506546082302520517, 99.721470037733524805, 1.4520579826457833406, + 90.405753561415622244, 93.867877918564772699, 35.740790193045540946, 30.560796169938839739, + 24.126927134908328298, 12.462095728988060728, 13.457061657234589802, 20.660810482244414743, + 113.0528385128127411, 100.91639278290676884, 83.607743348984513432, 72.356684287697135005, + 102.08052105626848061, 0.54582831044535851106, 21.858037942580267554, 62.709546868583856849, + 82.588278460501896916, 12.656881024540780345, 36.134618883046641713, 17.398271569196367636, + 7.4665556520085374359, 127.50032128330349224, 39.03749033845087979, 65.932797171131824143, + 63.848697232169797644, 27.736364557043998502, 100.63714930273636128, 56.726058498337806668, + 55.084480307195917703, 112.04422391254774993, 99.625957370197284035, 37.99971817622645176, + 7.3809443326499604154, 69.467144218055182137, 113.93481469183097943, 22.567316669901629211, + 54.920824221255315933, 66.50497274500594358, 90.052990729953307891, 13.289174384706711862, + 28.16482323008676758, 94.141795671432191739, 27.402809822426206665, 54.016021259059925796, + 112.0372963053159765, 38.17823735045385547, 84.500754300359403715, 98.287027707061497495, + 106.36189155733882217, 78.427059958023164654, 42.851817576120083686, 24.81049178228204255, + 11.407102345641760621, 116.21005456055354443, 6.7188022090558661148, 51.151159018965699943, + 83.024698016557522351, 46.460915532879880629, 90.738031236429378623, 25.25592073046209407, + 12.398770035248162458, 68.372127330676448764, 18.800632263850275194, 4.9008095639619568828, + 106.29640551334887277, 102.2083416769237374, 83.911872179200145183, 120.36883180488439393, + 121.13678809894190636, 66.942054083770926809, 9.7255251220740319695, 44.145719285443192348, + 75.650065242534765275, 108.2266484712890815, 108.4390623043072992, 110.12039591115899384, + 93.96857457006626646, 126.08427987147661042, 113.44137140997918323, 15.889775957348319935, + 35.634189228279865347, 1.1509910842105455231, 109.67595352968783118, 2.3641394862097513396, + 42.463399498526996467, 66.260829388073034352, 119.59344455183963873, 126.8721422095404705, + 79.791265906766057014, 124.1674354074166331, 127.25707304776733508, 59.047618945904105203, + 61.303465348533791257, 77.694933709375618491, 110.98738308950851206, 11.435915088019100949, + 115.33621769562523696, 19.443700908414029982, 47.908205582083610352, 96.175886799166619312, + 111.13211169152418734, 11.590471993691608077, 1.3502810770623909775, 27.666631455194874434, + 108.30888688351842575, 39.78272600899435929, 33.441109138901083497, 21.051356808897253359, + 49.914580767715960974, 13.195053094284958206, 0.047618210828659357503, 80.400997926146374084, + 13.22722152755886782, 94.523245429551025154, 4.4538516664069902617, 92.866832575771695701, + 34.790472628566931235, 106.6476230632943043, 64.320283420271152863, 50.021641172650561202, + 109.92151562493745587, 53.423016930246376432, 94.998973930178181035, 125.79094429436372593, + 42.290447492090606829, 31.022263250066316687, 87.12430126690378529, 83.113528232046519406, + 75.077900488751765806, 0.0088134439938585273921, 92.42858424720907351, 5.9708735000676824711, + 7.0065412849216954783, 24.087052027258323506, 59.923752653023257153, 29.512963928369572386, + 7.7412174205201154109, 65.954385612527403282, 53.564407003948872443, 35.901415160285978345, + 62.85064075254558702, 11.058482910768361762, 79.42091279730811948, 35.047411902494786773, + 95.35884358946714201, 92.727986923076969106, 3.5646900613646721467, 35.059813100753672188, + 86.905433424330112757, 50.179576635608100332, 55.374992946562997531, 99.495489151282527018, + 55.272823999363026815, 87.229943928981811041, 15.603583435164182447, 127.74602659368611057, + 73.708267254532984225, 54.360421616245730547, 1.9671351541328476742, 22.041115167608950287, + 25.275022589266882278, 2.9256171877423184924, 127.48366293627987034, 118.78367325053477543, + 58.546823010812659049, 117.02429854081492522, 91.087178864370798692, 90.829498732087813551, + 114.84596462674744544, 95.07294236300731427, 38.430789331574487733, 115.36281311287893914, + 95.06753611517342506, 126.61007162597161368, 50.107575614852976287, 84.853491363919602009, + 124.57548368432617281, 94.532263849323499016, 70.760728857145295478, 87.870130627448816085, + 52.326364118325727759, 4.2914358762427582406, 91.105504536109947367, 92.218951361883227946, + 22.02200978368637152, 126.11772144665155793, 125.24003595379690523, 97.654142478102585301, + 93.907720498180424329, 113.80074920932020177, 96.371680103595281253, 94.171644404916150961, + 17.015342982278525596, 59.727422431620652787, 43.818527725987223675, 26.799863267224282026, + 84.621010202910838416, 0.79232497435077675618, 88.539620083960471675, 110.28790029607625911, + 83.509401902203535428, 21.281656466981075937, 102.26449455739930272, 43.310631941360043129, + 8.4984023888137016911, 90.246924535407742951, 42.038765385368606076, 110.31103769781111623, + 67.653535138513689162, 79.747009083548618946, 23.660551003798900638, 101.83239285114905215, + 8.1692768486755085178, 13.793712929866160266, 13.112909052088070894, 106.31034281794927665, + 30.583740033427602611, 57.080864569161349209, 37.193122205309919082, 40.490033558617142262, + 69.27884313585673226, 112.76639647166302893, 29.516630958918540273, 13.086914621206233278, + 57.009407554698555032, 113.78725153014602256, 121.43967731174416258, 33.204395278818992665, + 18.051447117162751965, 50.404807066479406785, 113.27565857502850122, 110.94025497378243017, + 41.322670134923100704, 81.413483754087792477, 81.197846627066610381, 19.50433182380584185, + 57.060775140274927253, 106.75978268034305074, 42.464190839262300869, 40.550092100362235215, + 93.429567701612540986, 44.017275645968766185, 49.157846501904714387, 107.57745991956835496, + 56.509219313818903174, 100.90963211656708154, 92.012837876551202498, 38.673839582348591648, + 14.078012178037170088, 102.78640576389079797, 20.371832715762138832, 16.33068755952626816, + 104.9789189622788399, 54.161523089795082342, 32.515573667205899255, 119.68337013893324183, + 35.444611694332706975, 96.024554187904868741, 58.196344361578667304, 44.448313153574417811, + 116.25431791491791955, 52.282449351390823722, 77.40916422066220548, 100.45920376963840681, + 79.644106089221168077, 61.973270125679846387, 18.999935191823169589, 63.737247835240850691, + 5.2131303910246060695, 108.94721511645548162, 30.548809840514877578, 122.54439222409564536, + 63.371819248866813723, 7.2264334155624965206, 93.302725551213370636, 126.20880325698453817, + 24.138645035640365677, 63.050716521607682807, 104.42278026210260577, 88.342674658189935144, + 44.7975306895095855, 104.25216673885006458, 9.6812270955997519195, 24.333422291703755036, + 100.68922793126330362, 70.705021000514534535, 79.608304028010024922, 32.83766350962469005, + 48.895369379348267103, 81.340225532334443415, 63.878427978550462285, 79.628098218057857594, + 76.098615520077146357, 82.43345176566435839, 113.24396124006671016, 60.624136089412786532, + 12.515195914387732046, 122.43294472554407548, 8.4038501238865137566, 86.454697551918798126, + 86.627541910507716238, 0.76720955288692493923, 99.778160882648080587, 24.550280849714908982, + 61.240824381293350598, 118.24546957403072156, 127.55776437084932695, 18.685024492893717252, + 49.671268311220046598, 81.458566430399514502, 44.462662298134091543, 72.785612267798569519, + 26.636074600741267204, 27.042753207984787878, 63.899229840328189312, 25.520971603673388017, + 86.42284770954574924, 82.158668705735180993, 127.80315457984397653, 77.606278410054073902, + 62.940291515264107147, 18.608858593463082798, 93.065506557726621395, 8.7936263297560799401, + 4.3974447344371583313, 1.4783000475108565297, 64.189089200637681643, 4.6279345827242650557, + 92.467468113969516708, 114.9106180244780262, 26.425325102103670361, 41.037090016881847987, + 53.320617994828353403, 29.246740365389996441, 110.72277100548672024, 15.095186047856259393, + 84.39645282818673877, 99.649136289943271549, 29.938257990437705303, 25.090474418222584063, + 101.41143919683236163, 28.154244490258861333, 76.035988577998068649, 22.44166859661709168, + 13.57201532833641977, 45.264967279777920339, 34.104488348530139774, 3.1965405780865694396, + 56.478989228715363424, 30.797828388062043814, 113.55920476617393433, 28.439159530153119704, + 26.157667194551322609, 123.12761877225057106, 88.321424835896323202, 109.70831598402219242, + 57.062312471538461978, 51.080587841137457872, 114.51202010576889734, 101.22706948049381026, + 57.549978221824858338, 54.372544228499464225, 118.5753334510482091, 29.038234996016399236, + 70.859539957004017197, 91.759080459265533136, 105.93054261058568954, 67.013092164608679013, + 71.44294007546704961, 2.9041159652952046599, 52.811507122834882466, 59.735755837129545398, + 71.481580386091081891, 61.121592339877679478, 48.253854269816656597, 24.924191457976121455, + 26.914123314469179604, 41.321620964492467465, 98.10567702562912018, 73.832785565817175666, + 39.215486697972664842, 16.713368575397907989, 76.161042112536961213, 1.0916566208907170221, + 43.716075885160535108, 125.41909373717135168, 37.176556921003793832, 25.31376204908156069, + 72.269237766093283426, 34.796543138392735273, 14.933111304020712851, 127.00064256660698447, + 78.074980676905397559, 3.8655943422636482865, 127.69739446433959529, 55.472729114091634983, + 73.274298605472722556, 113.45211699667561334, 110.16896061439547339, 96.088447825099137845, + 71.251914740394568071, 75.99943635245290352, 14.76188866530355881, 10.934288436114002252, + 99.869629383661958855, 45.134633339803258423, 109.84164844251426985, 5.009945490015525138, + 52.105981459906615783, 26.578348769413423724, 56.32964646017717314, 60.283591342864383478, + 54.80561964485241333, 108.03204251812348957, 96.074592610631952994, 76.356474700911348918, + 41.001508600722445408, 68.574055414126632968, 84.723783114681282314, 28.854119916046329308, + 85.703635152240167372, 49.6209835645640851, 22.814204691287159221, 104.42010912110708887, + 13.43760441811173223, 102.30231803793503786, 38.049396033115044702, 92.921831065763399238, + 53.476062472858757246, 50.511841460924188141, 24.797540070499962894, 8.7442546613528975286, + 37.601264527700550389, 9.8016191279275517445, 84.592811026701383526, 76.41668335385111277, + 39.823744358403928345, 112.73766360977242584, 114.27357619788745069, 5.8841081675418536179, + 19.451050244148063939, 88.291438570890022675, 23.300130485073168529, 88.453296942581800977, + 88.87812460861823638, 92.240791822321625659, 59.937149140136170899, 124.16855974295685883, + 98.882742819958366454, 31.779551914696639869, 71.268378456559730694, 2.301982168424729025, + 91.351907059375662357, 4.7282789724195026793, 84.926798997057630913, 4.5216587761497066822, + 111.18688910368291545, 125.74428441908457899, 31.582531813535752008, 120.33487081483690417, + 126.51414609553467017, 118.09523789180821041, 122.60693069707122049, 27.389867418754874961, + 93.974766179017024115, 22.871830176041839877, 102.67243539125047391, 38.887401816828059964, + 95.816411164170858683, 64.351773598336876603, 94.264223383048374671, 23.180943987383216154, + 2.700562154124781955, 55.333262910393386846, 88.617773767036851496, 79.56545201798871858, + 66.882218277802166995, 42.102713617794506717, 99.829161535431921948, 26.390106188569916412, + 0.095236421660956693813, 32.801995852292748168, 26.454443055121373618, 61.046490859102050308, + 8.9077033328176185023, 57.733665151543391403, 69.580945257137500448, 85.295246126592246583, + 0.64056684054230572656, 100.04328234530476038, 91.843031249874911737, 106.84603386049639084, + 61.99794786036000005, 123.58188858872745186, 84.580894984181213658, 62.044526500136271352, + 46.248602533811208559, 38.227056464096676791, 22.155800977503531612, 0.017626887991355033591, + 56.85716849441814702, 11.941747000135364942, 14.013082569843390957, 48.174104054516647011, + 119.84750530604651431, 59.025927856739144772, 15.482434841043868801, 3.908771225054806564, + 107.12881400789774489, 71.80283032057195669, 125.70128150509117404, 22.116965821540361503, + 30.841825594616238959, 70.094823804993211525, 62.717687178937921999, 57.455973846153938212, + 7.1293801227293442935, 70.119626201510982355, 45.810866848660225514, 100.35915327121620066, + 110.74998589312963304, 70.990978302565054037, 110.54564799872969161, 46.459887857963622082, + 31.207166870332002873, 127.49205318737585912, 19.41653450906596845, 108.72084323249146109, + 3.9342703082656953484, 44.082230335217900574, 50.550045178533764556, 5.8512343754882749636, + 126.96732587256337865, 109.56734650106955087, 117.09364602162895608, 106.04859708163348841, + 54.174357728745235363, 53.65899746417926508, 101.69192925349852885, 62.145884726014628541, + 76.861578663152613444, 102.72562622576151625, 62.135072230350488098, 125.22014325194322737, + 100.21515122970959055, 41.706982727842841996, 121.15096736865598359, 61.064527698650636012, + 13.521457714294228936, 47.74026125489763217, 104.65272823665145552, 8.5828717524891544599, + 54.211009072223532712, 56.437902723766455892, 44.044019567376381019, 124.23544289330675383, + 122.48007190759744844, 67.30828495620880858, 59.815440996364486637, 99.601498418644041521, + 64.743360207194200484, 60.343288809832301922, 34.030685964557051193, 119.45484486324130557, + 87.637055451974447351, 53.599726534452202031, 41.242020405821676832, 1.5846499487051914912, + 49.079240167924581328, 92.575800592156156199, 39.018803804407070857, 42.563312933965789853, + 76.528989114798605442, 86.621263882720086258, 16.996804777631041361, 52.493849070815485902, + 84.07753077074085013, 92.622075395625870442, 7.3070702770310163032, 31.494018167097237892, + 47.321102007601439254, 75.664785702298104297, 16.338553697351017036, 27.587425859732320532, + 26.225818104179779766, 84.620685635898553301, 61.167480066855205223, 114.16172913832269842, + 74.386244410619838163, 80.980067117237922503, 10.5576862717171025, 97.532792943326057866, + 59.033261917837080546, 26.173829242412466556, 114.01881510940074804, 99.574503060295683099, + 114.87935462348832516, 66.40879055763798533, 36.10289423432550393, 100.80961413296245155, + 98.551317150060640415, 93.88050994756486034, 82.645340269849839387, 34.826967508179222932, + 34.395693254133220762, 39.0086636476116837, 114.12155028055349248, 85.519565360686101485, + 84.928381678524601739, 81.100184200728108408, 58.859135403225081973, 88.034551291937532369, + 98.315693003813066753, 87.154919839136709925, 113.01843862764144433, 73.819264233137801057, + 56.025675753102404997, 77.347679164697183296, 28.156024356077978155, 77.57281152778523392, + 40.743665431524277665, 32.661375119056174299, 81.957837924557679798, 108.32304617959016468, + 65.03114733441543649, 111.36674027786648367, 70.889223388669051928, 64.049108375809737481, + 116.39268872315733461, 88.896626307152473601, 104.5086358298358391, 104.56489870278528542, + 26.818328441328048939, 72.918407539280451601, 31.288212178442336153, 123.94654025135969277, + 37.999870383646339178, 127.47449567048170138, 10.426260782052850118, 89.894430232910963241, + 61.097619681033393135, 117.08878444819129072, 126.74363849773362745, 14.45286683112863102, + 58.605451102430379251, 124.41760651396907633, 48.277290071280731354, 126.10143304321900359, + 80.845560524208849529, 48.685349316379870288, 89.595061379022808978, 80.504333477700129151, + 19.362454191199503839, 48.666844583411148051, 73.378455862530245213, 13.410042001032707049, + 31.216608056020049844, 65.675327019249380101, 97.790738758700172184, 34.680451064668886829, + 127.75685595710456255, 31.256196436119353166, 24.197231040157930693, 36.86690353133235476, + 98.487922480133420322, 121.24827217882557306, 25.03039182877910207, 116.86588945108815096, + 16.807700247776665492, 44.909395103841234231, 45.255083821015432477, 1.5344191057774878573, + 71.556321765296161175, 49.100561699429817963, 122.48164876259033917, 108.4909391480650811, + 127.1155287416986539, 37.370048985787434503, 99.342536622443731176, 34.917132860799029004, + 88.925324596271821065, 17.571224535597139038, 53.272149201482534409, 54.085506415969575755, + 127.79845968065637862, 51.041943207350414013, 44.845695419095136458, 36.317337411473999964, + 127.60630915969159105, 27.212556820108147804, 125.88058303052821429, 37.217717186929803574, + 58.13101311545324279, 17.58725265951215988, 8.7948894688743166625, 2.9566000950253510382, + 0.37817840127536328509, 9.2558691654521680903, 56.934936227942671394, 101.8212360489560524, + 52.850650204207340721, 82.074180033763695974, 106.64123598965670681, 58.493480730783630861, + 93.445542010973440483, 30.190372095716156764, 40.79290565637711552, 71.298272579886543099, + 59.876515980875410605, 50.180948836448806105, 74.822878393664723262, 56.308488980521360645, + 24.071977155996137299, 44.88333719323418336, 27.144030656672839541, 90.529934559555840679, + 68.208976697060279548, 6.3930811561731388792, 112.95797845743072685, 61.595656776127725607, + 99.118409532347868662, 56.878319060306239408, 52.315334389106283197, 118.25523754450478009, + 48.642849671796284383, 91.416631968044384848, 114.12462494307692396, 102.16117568227855372, + 101.02404021154143265, 74.454138960987620521, 115.09995644364971668, 108.74508845700256643, + 109.1506669020964182, 58.076469992036436452, 13.719079914011672372, 55.518160918534704251, + 83.861085221175017068, 6.0261843292209960055, 14.88588015093409922, 5.8082319305904093198, + 105.62301424566976493, 119.47151167426272877, 14.963160772182163782, 122.24318467975535896, + 96.507708539633313194, 49.848382915952242911, 53.828246628938359208, 82.643241928988572909, + 68.21135405126187834, 19.665571131634351332, 78.430973395945329685, 33.426737150799453957, + 24.322084225073922426, 2.1833132417814340442, 87.432151770324708195, 122.83818747434270335, + 74.353113842007587664, 50.627524098166759359, 16.538475532186566852, 69.593086276785470545, + 29.86622260804506368, 126.00128513321760693, 28.149961353810795117, 7.7311886845309345517, + 127.39478892867919058, 110.94545822818690795, 18.548597210949083092, 98.904233993354864651, + 92.337921228794584749, 64.176895650201913668, 14.50382948079277412, 23.998872704905807041, + 29.523777330607117619, 21.868576872231642483, 71.739258767323917709, 90.269266679610154824, + 91.683296885028539691, 10.019890980031050276, 104.21196291981323157, 53.156697538826847449, + 112.65929292035434628, 120.56718268572876696, 109.61123928970846464, 88.064085036250617122, + 64.149185221267543966, 24.712949401822697837, 82.003017201448528795, 9.1481108282569039147, + 41.447566229362564627, 57.708239832096296595, 43.407270304480334744, 99.2419671291281702, + 45.628409382577956421, 80.840218242214177735, 26.875208836227102438, 76.604636075870075729, + 76.098792066233727382, 57.843662131526798476, 106.95212494571751449, 101.02368292184837628, + 49.595080140999925788, 17.488509322705795057, 75.202529055401100777, 19.603238255858741468, + 41.18562205340640503, 24.83336670770222554, 79.647488716811494669, 97.475327219548489666, + 100.54715239577490138, 11.768216335083707236, 38.902100488299765857, 48.582877141780045349, + 46.600260970149975037, 48.906593885167239932, 49.756249217240110738, 56.481583644643251318, + 119.87429828027597978, 120.33711948591735563, 69.765485639916732907, 63.559103829396917718, + 14.536756913119461387, 4.6039643368530960288, 54.703814118751324713, 9.4565579448426433373, + 41.853597994115261827, 9.0433175523030513432, 94.373778207369468873, 123.48856883816915797, + 63.165063627075141994, 112.66974162967744633, 125.02829219107297831, 108.19047578362005879, + 117.21386139414244099, 54.779734837513387902, 59.949532358034048229, 45.743660352087317733, + 77.344870782500947826, 77.774803633659757907, 63.632822328345355345, 0.70354719667739118449, + 60.528446766096749343, 46.361887974766432308, 5.4011243082495639101, 110.66652582079041167, + 49.23554753407734097, 31.13090403598107514, 5.7644365556043339893, 84.205427235592651414, + 71.658323070863843895, 52.780212377139832824, 0.19047284332191338763, 65.603991704585496336, + 52.908886110242747236, 122.09298171820410062, 17.815406665635237005, 115.46733030309042078, + 11.161890514278638875, 42.590492253184493165, 1.2811336810882494319, 72.086564690613158746, + 55.686062499753461452, 85.692067720992781688, 123.99589572072363808, 119.1637771774585417, + 41.161789968362427317, 124.0890530002725427, 92.497205067622417118, 76.454112928193353582, + 44.311601955007063225, 0.035253775982710067183, 113.71433698883629404, 23.883494000270729885, + 28.026165139686781913, 96.348208109036932001, 111.69501061209302861, 118.05185571347828954, + 30.964869682087737601, 7.8175424501132511068, 86.257628015799127752, 15.60566064114755136, + 123.40256301018234808, 44.233931643080723006, 61.683651189236115897, 12.189647609986423049, + 125.435374357875844, 114.91194769230787642, 14.258760245462326566, 12.23925240302196471, + 91.621733697324089007, 72.718306542436039308, 93.499971786262904061, 13.981956605133746052, + 93.091295997459383216, 92.919775715927244164, 62.414333740667643724, 126.98410637475171825, + 38.833069018135574879, 89.441686464982922189, 7.8685406165313906968, 88.164460670435801148, + 101.10009035706752911, 11.702468750980187906, 125.93465174513039528, 91.134693002142739715, + 106.18729204326155013, 84.09719416326697683, 108.34871545749047073, 107.31799492836216814, + 75.383858506997057702, 124.29176945203289506, 25.723157326308864867, 77.451252451523032505, + 124.27014446070461418, 122.44028650389009272, 72.430302459419181105, 83.413965455689321971, + 114.30193473731196718, 122.12905539730127202, 27.042915428588457871, 95.48052250979890232, + 81.305456473302911036, 17.16574350497830892, 108.42201814444706542, 112.87580544753291178, + 88.088039134756400017, 120.47088578661714564, 116.96014381519853487, 6.6165699124176171608, + 119.63088199273261125, 71.202996837291721022, 1.4867204143884009682, 120.68657761966460384, + 68.061371929117740365, 110.90968972648624913, 47.274110903948894702, 107.19945306890440406, + 82.484040811643353663, 3.1692998974103829823, 98.158480335852800636, 57.151601184312312398, + 78.037607608814141713, 85.126625867935217684, 25.057978229600848863, 45.242527765440172516, + 33.993609555262082722, 104.98769814163460978, 40.155061541485338239, 57.244150791251740884, + 14.614140554062032606, 62.988036334194475785, 94.642204015206516488, 23.329571404596208595, + 32.677107394702034071, 55.174851719464641064, 52.451636208363197511, 41.241371271797106601, + 122.33496013371404842, 100.32345827664903481, 20.772488821243314305, 33.960134234475845005, + 21.115372543437842978, 67.065585886652115732, 118.06652383567416109, 52.34765848482857109, + 100.03763021880513406, 71.149006120595004177, 101.7587092469802883, 4.8175811152759706602, + 72.20578846865464584, 73.619228265928541077, 69.102634300124918809, 59.761019895133358659, + 37.290680539699678775, 69.653935016358445864, 68.791386508266441524, 78.017327295227005379, + 100.24310056111062295, 43.039130721375840949, 41.856763357052841457, 34.200368401456216816, + 117.71827080645380192, 48.069102583878702717, 68.631386007629771484, 46.309839678277057828, + 98.036877255286526633, 19.638528466275602113, 112.05135150620844797, 26.695358329394366592, + 56.312048712159594288, 27.145623055570467841, 81.487330863048555329, 65.322750238115986576, + 35.915675849118997576, 88.646092359183967346, 2.0622946688345109578, 94.733480555736605311, + 13.778446777341741836, 0.098216751623112941161, 104.78537744631830719, 49.79325261430858518, + 81.017271659675316187, 81.129797405570570845, 53.636656882659735857, 17.836815078560903203, + 62.576424356888310285, 119.89308050271938555, 75.999740767296316335, 126.94899134096340276, + 20.852521564109338215, 51.788860465821926482, 122.19523936207042425, 106.17756889638621942, + 125.48727699546725489, 28.90573366225726204, 117.21090220486439648, 120.83521302793815266, + 96.554580142565100687, 124.20286608644164517, 33.691121048417699058, 97.370698632763378555, + 51.190122758049255935, 33.008666955400258303, 38.724908382399007678, 97.33368916682593408, + 18.756911725060490426, 26.820084002065414097, 62.433216112043737667, 3.3506540385023981798, + 67.581477517400344368, 69.360902129341411637, 127.5137119142091251, 62.512392872238706332, + 48.394462080315861385, 73.733807062668347498, 68.975844960270478623, 114.49654435765114613, + 50.060783657561842119, 105.73177890217630193, 33.615400495553330984, 89.818790207682468463, + 90.510167642030864954, 3.0688382115586136933, 15.11264353059232235, 98.201123398863273906, + 116.96329752518431633, 88.981878296133800177, 126.23105748339730781, 74.740097971578506986, + 70.685073244887462351, 69.834265721601695986, 49.85064919254364213, 35.142449071194278076, + 106.54429840296506882, 108.17101283194278949, 127.59691936131275725, 102.08388641470082803, + 89.691390838190272916, 72.634674822951637907, 127.2126183193831821, 54.425113640219933586, + 123.76116606105642859, 74.435434373859607149, 116.26202623090648558, 35.174505319024319761, + 17.589778937748633325, 5.9132001900507020764, 0.75635680255072657019, 18.511738330904336181, + 113.86987245588898077, 75.6424720979121048, 105.70130040841831942, 36.148360067531029927, + 85.282471979313413613, 116.9869614615708997, 58.891084021946880966, 60.380744191432313528, + 81.585811312757869018, 14.596545159773086198, 119.75303196175082121, 100.36189767290125019, + 21.645756787329446524, 112.61697796104272129, 48.143954311992274597, 89.76667438646836672, + 54.288061313349317061, 53.059869119115319336, 8.4179533941205590963, 12.786162312349915737, + 97.915956914861453697, 123.19131355225908919, 70.236819064695737325, 113.75663812061247882, + 104.63066877821620437, 108.51047508900956018, 97.285699343596206745, 54.833263936092407675, + 100.24924988615748589, 76.322351364560745424, 74.048080423086503288, 20.908277921978879021, + 102.19991288730307133, 89.490176914008770837, 90.301333804192836396, 116.1529399840728729, + 27.438159828023344744, 111.03632183707304648, 39.722170442350034136, 12.052368658441992011, + 29.771760301868198439, 11.616463861184456619, 83.246028491343167843, 110.94302334852545755, + 29.926321544367965544, 116.48636935951435589, 65.015417079266626388, 99.696765831904485822, + 107.6564932578803564, 37.286483857980783796, 8.4227081025237566791, 39.331142263272340642, + 28.86194679189065937, 66.853474301598907914, 48.644168450147844851, 4.3666264835665060673, + 46.86430354065305437, 117.67637494868904469, 20.706227684015175328, 101.25504819633351872, + 33.076951064376771683, 11.186172553570941091, 59.732445216093765339, 124.00257026643521385, + 56.299922707621590234, 15.462377369065507082, 126.78957785736201913, 93.89091645637381589, + 37.097194421901804162, 69.808467986713367281, 56.675842457592807477, 0.35379130040382733569, + 29.007658961585548241, 47.997745409811614081, 59.047554661214235239, 43.737153744466922944, + 15.478517534651473397, 52.538533359223947627, 55.366593770057079382, 20.039781960065738531, + 80.42392583962646313, 106.31339507765733288, 97.318585840712330537, 113.13436537146117189, + 91.222478579420567257, 48.128170072504872223, 0.2983704425350879319, 49.425898803649033653, + 36.006034402897057589, 18.296221656513807829, 82.895132458725129254, 115.41647966419259319, + 86.814540608964307467, 70.483934258256340399, 91.256818765159550821, 33.68043648442835547, + 53.750417672457842855, 25.209272151743789436, 24.197584132467454765, 115.68732426305723493, + 85.904249891438666964, 74.047365843696752563, 99.190160281999851577, 34.977018645415228093, + 22.405058110802201554, 39.206476511717482936, 82.37124410681281006, 49.666733415408089058, + 31.294977433626627317, 66.95065443910061731, 73.094304791549802758, 23.536432670167414472, + 77.804200976599531714, 97.165754283560090698, 93.200521940299950074, 97.813187770334479865, + 99.512498434480221476, 112.96316728929014062, 111.74859656055559753, 112.67423897183834924, + 11.530971279833465815, 127.11820765879383544, 29.073513826238922775, 9.2079286737061920576, + 109.40762823750264943, 18.913115889685286675, 83.707195988230523653, 18.086635104609740665, + 60.747556414742575726, 118.97713767633831594, 126.33012725415392197, 97.339483259358530631, + 122.0565843821495946, 88.380951567243755562, 106.42772278828488197, 109.5594696750267758, + 119.89906471606809646, 91.487320704178273445, 26.68974156500553363, 27.549607267319515813, + 127.26564465669071069, 1.407094393354782369, 121.05689353219349869, 92.723775949532864615, + 10.802248616502765799, 93.333051641580823343, 98.47109506815468194, 62.261808071962150279, + 11.528873111212305957, 40.410854471188940806, 15.316646141727687791, 105.56042475427966565, + 0.38094568664746475406, 3.2079834091709926724, 105.81777222048913245, 116.18596343640820123, + 35.630813331274111988, 102.93466060618084157, 22.32378102855727775, 85.180984506368986331, + 2.5622673621801368427, 16.173129381226317491, 111.37212499951056088, 43.384135441989201354, + 119.99179144145091414, 110.3275543549170834, 82.323579936728492612, 120.17810600054872339, + 56.994410135248472216, 24.908225856386707164, 88.62320391001412645, 0.070507551969058113173, + 99.42867397767258808, 47.766988000541459769, 56.052330279377201805, 64.696416218077501981, + 95.390021224189695204, 108.10371142695657909, 61.929739364175475203, 15.635084900230140192, + 44.515256031598255504, 31.211321282298740698, 118.80512602036469616, 88.467863286161446013, + 123.36730237847223179, 24.379295219976484077, 122.87074871575532597, 101.82389538461575285, + 28.517520490924653132, 24.478504806047567399, 55.243467394651815994, 17.436613084875716595, + 58.999943572525808122, 27.963913210271130083, 58.18259199492240441, 57.839551431854488328, + 124.82866748133892543, 125.9682127495034365, 77.666138036274787737, 50.883372929965844378, + 15.737081233066419372, 48.328921340875240276, 74.200180714135058224, 23.404937501964013791, + 123.86930349026442855, 54.269386004289117409, 84.374584086526738247, 40.194388326537591638, + 88.697430914984579431, 86.635989856727974257, 22.767717013997753384, 120.58353890406579012, + 51.446314652621367713, 26.902504903049702989, 120.54028892141286633, 116.88057300778382341, + 16.860604918842000188, 38.82793091138228192, 100.60386947462757234, 116.25811079460254405, + 54.085830857180553721, 62.961045019601442618, 34.610912946605822071, 34.331487009960255818, + 88.844036288897768827, 97.751610895069461549, 48.176078269516438013, 112.94177157323792926, + 105.92028763039706973, 13.2331398248388723, 111.26176398546886048, 14.405993674583442044, + 2.9734408287804399151, 113.37315523933284567, 8.1227438582391187083, 93.819379452972498257, + 94.548221807901427383, 86.398906137812446104, 36.968081623286707327, 6.3385997948244039435, + 68.316960671705601271, 114.30320236862826278, 28.075215217631921405, 42.253251735870435368, + 50.115956459201697726, 90.485055530880345032, 67.987219110527803423, 81.975396283269219566, + 80.310123082970676478, 114.48830158250348177, 29.228281108124065213, 125.97607266839258955, + 61.284408030413032975, 46.659142809192417189, 65.354214789404068142, 110.34970343892928213, + 104.90327241672639502, 82.482742543597851181, 116.66992026743173483, 72.64691655329806963, + 41.544977642486628611, 67.920268468951690011, 42.230745086879323935, 6.1311717733078694437, + 108.13304767134832218, 104.69531696966078016, 72.075260437613906106, 14.298012241193646332, + 75.517418493960576598, 9.6351622305555792991, 16.411576937312929658, 19.238456531860720133, + 10.205268600249837618, 119.52203979026671732, 74.581361079402995529, 11.307870032720529707, + 9.5827730165365210269, 28.034654590457648737, 72.486201122221245896, 86.078261442751681898, + 83.713526714105682913, 68.400736802916071611, 107.43654161290760385, 96.138205167761043413, + 9.2627720152595429681, 92.619679356557753636, 68.073754510573053267, 39.277056932554842206, + 96.102703012416895945, 53.390716658788733184, 112.62409742431918858, 54.291246111144573661, + 34.974661726100748638, 2.6455004762319731526, 71.83135169824163313, 49.292184718367934693, + 4.1245893376726598945, 61.466961111473210622, 27.556893554683483671, 0.19643350324986386113, + 81.570754892636614386, 99.586505228620808339, 34.034543319354270352, 34.25959481114114169, + 107.27331376531947171, 35.673630157121806405, 125.15284871378025855, 111.78616100544240908, + 23.999481534596270649, 125.89798268192680553, 41.705043128218676429, 103.57772093164749094, + 116.39047872414448648, 84.355137792776076822, 122.97455399093450978, 57.811467324518162059, + 106.42180440973243094, 113.67042605587994331, 65.109160285133839352, 120.40573217288329033, + 67.382242096839036094, 66.74139726552675711, 102.38024551609851187, 66.017333910800516605, + 77.449816764801653335, 66.667378333651868161, 37.513823450120980851, 53.640168004130828194, + 124.86643222408747533, 6.7013080770084343385, 7.1629550348043267149, 10.721804258686461253, + 127.0274238284182502, 125.02478574447741266, 96.788924160635360749, 19.467614125340332976, + 9.9516899205445952248, 100.99308871530229226, 100.12156731512732222, 83.463557804352603853, + 67.230800991110299947, 51.637580415368574904, 53.020335284061729908, 6.1376764231172273867, + 30.225287061188282678, 68.40224679773018579, 105.92659505037227063, 49.963756592271238333, + 124.46211496679825359, 21.48019594316065195, 13.370146489778562682, 11.668531443203391973, + 99.701298385087284259, 70.284898142392194131, 85.088596805933775613, 88.342025663889216958, + 127.19383872262915247, 76.167772829405294033, 51.382781676384183811, 17.269349645906913793, + 126.42523663876636419, 108.85022728044350515, 119.52233212211649516, 20.870868747722852277, + 104.52405246181297116, 70.349010638048639521, 35.17955787549726665, 11.826400380101404153, + 1.5127136051014531404, 37.02347666181231034, 99.739744911781599512, 23.284944195827847579, + 83.402600816836638842, 72.296720135065697832, 42.564943958630465204, 105.9739229231417994, + 117.78216804389376193, 120.76148838286826503, 35.171622625515738036, 29.193090319549810374, + 111.5060639235052804, 72.723795345802500378, 43.291513574662531028, 97.23395592208544258, + 96.287908623988187173, 51.53334877293673344, 108.57612262669863412, 106.11973823823063867, + 16.835906788241118193, 25.572324624703469453, 67.831913829726545373, 118.38262710452181636, + 12.473638129395112628, 99.513276241228595609, 81.261337556436046725, 89.020950178022758337, + 66.57139868719241349, 109.66652787218845333, 72.498499772318609757, 24.644702729125128826, + 20.096160846173006576, 41.816555843961396022, 76.399825774609780638, 50.980353828021179652, + 52.602667608389310772, 104.30587996814574581, 54.876319656050327467, 94.072643674146092962, + 79.444340884700068273, 24.104737316883984022, 59.543520603736396879, 23.232927722372551216, + 38.492056982689973665, 93.8860466970509151, 59.852643088739569066, 104.97273871903234976, + 2.0308341585368907545, 71.393531663812609622, 87.312986515760712791, 74.572967715961567592, + 16.845416205047513358, 78.662284526544681285, 57.723893583784956718, 5.706948603197815828, + 97.288336900295689702, 8.7332529671330121346, 93.728607081309746718, 107.35274989737808937, + 41.412455368033988634, 74.510096392667037435, 66.153902128753543366, 22.372345107141882181, + 119.46489043219116866, 120.00514053287042771, 112.59984541524318047, 30.924754738134652143, + 125.57915571472767624, 59.781832912747631781, 74.194388843807246303, 11.616935973426734563, + 113.35168491518561495, 0.70758260080765467137, 58.015317923171096481, 95.995490819623228163, + 118.09510932242847048, 87.474307488933845889, 30.957035069302946795, 105.07706671844789525, + 110.73318754011415876, 40.07956392013511504, 32.847851679256564239, 84.626790155318303732, + 66.637171681428299053, 98.268730742925981758, 54.444957158841134515, 96.256340145009744447, + 0.5967408850701758638, 98.851797607298067305, 72.012068805794115178, 36.592443313031253638, + 37.790264917453896487, 102.83295932838882436, 45.629081217932252912, 12.967868516516318778, + 54.513637530319101643, 67.360872968856710941, 107.50083534491568571, 50.418544303487578873, + 48.395168264938547509, 103.37464852611810784, 43.808499782880971907, 20.094731687397143105, + 70.380320563999703154, 69.954037290830456186, 44.810116221604403108, 78.41295302343860385, + 36.742488213625620119, 99.333466830816178117, 62.589954867256892612, 5.9013088782048725989, + 18.188609583099605516, 47.072865340338466922, 27.608401953202701407, 66.331508567123819375, + 58.401043880603538128, 67.626375540672597708, 71.024996868964080932, 97.92633457858391921, + 95.497193121114833048, 97.348477943676698487, 23.061942559670569608, 126.23641531758767087, + 58.14702765247784555, 18.415857347416022094, 90.815256475005298853, 37.826231779374211328, + 39.414391976461047307, 36.17327020921948133, 121.49511282948878943, 109.95427535268026986, + 124.66025450831148191, 66.678966518720699241, 116.11316876430282719, 48.761903134491149103, + 84.855445576573401922, 91.118939350057189586, 111.7981294321398309, 54.97464140835654689, + 53.37948313001106726, 55.099214534642669605, 126.53128931338142138, 2.8141887867132027168, + 114.11378706439063535, 57.447551899065729231, 21.604497233009169577, 58.666103283165284665, + 68.942190136309363879, 124.52361614392430056, 23.057746222424611915, 80.821708942377881613, + 30.633292283459013561, 83.120849508559331298, 0.76189137329492950812, 6.4159668183456233237, + 83.635544440981902881, 104.37192687281640247, 71.261626662551861955, 77.869321212361683138, + 44.647562057118193479, 42.361969012737972662, 5.1245347243602736853, 32.346258762456272962, + 94.744249999021121766, 86.768270883982040687, 111.98358288290546625, 92.655108709837804781, + 36.647159873460623203, 112.35621200109744677, 113.98882027049694443, 49.816451712777052308, + 49.2464078200282529, 0.14101510394175420515, 70.85734795534517616, 95.533976001082919538, + 112.10466055875804159, 1.39283243615864194, 62.780042448383028386, 88.207422853913158178, + 123.85947872835095041, 31.270169800460280385, 89.030512063196511008, 62.422642564601119375, + 109.6102520407330303, 48.935726572326530004, 118.73460475694446359, 48.758590439956606133, + 117.74149743151428993, 75.647790769231505692, 57.035040981849306263, 48.957009612095134798, + 110.48693478930363199, 34.87322616975143319, 117.99988714505161624, 55.927826420542260166, + 116.36518398984480882, 115.67910286371261464, 121.65733496268148883, 123.93642549901051098, + 27.332276072549575474, 101.76674585993168876, 31.474162466132838745, 96.65784268175411853, + 20.400361428270116448, 46.80987500393166556, 119.73860698052885709, 108.5387720085818728, + 40.749168173053476494, 80.388776653078821255, 49.394861829972796841, 45.271979713455948513, + 45.535434027999144746, 113.16707780813158024, 102.89262930524273543, 53.805009806103043957, + 113.08057784282937064, 105.76114601556764683, 33.721209837684000377, 77.655861822768201819, + 73.207738949258782668, 104.51622158920508809, 108.17166171436110744, 125.92209003920288524, + 69.221825893211644143, 68.662974019924149616, 49.688072577799175633, 67.503221790138923097, + 96.352156539036514005, 97.8835431464794965, 83.840575260794139467, 26.46627964968138258, + 94.523527970937720966, 28.811987349166884087, 5.9468816575645178091, 98.746310478665691335, + 16.245487716481875395, 59.638758905948634492, 61.096443615806492744, 44.797812275624892209, + 73.936163246573414654, 12.677199589652445866, 8.6339213434148405213, 100.60640473725652555, + 56.15043043526384281, 84.506503471740870737, 100.23191291840703343, 52.970111061764328042, + 7.9744382210592448246, 35.950792566542077111, 32.620246165944990935, 100.97660316500696354, + 58.456562216251768405, 123.9521453367851791, 122.56881606082606595, 93.318285618388472358, + 2.7084295788117742632, 92.699406877862202236, 81.806544833456428023, 36.965485087199340342, + 105.33984053486710764, 17.29383310659613926, 83.0899552849768952, 7.8405369379033800215, + 84.46149017375864787, 12.262343546619376866, 88.266095342700282345, 81.390633939325198298, + 16.150520875227812212, 28.596024482390930643, 23.034836987921153195, 19.270324461111158598, + 32.823153874625859316, 38.476913063721440267, 20.410537200503313215, 111.04407958053707262, + 21.162722158805991057, 22.615740065441059414, 19.165546033073042054, 56.069309180918935454, + 16.972402244446129771, 44.156522885507001774, 39.427053428215003805, 8.8014736058357811999, + 86.873083225818845676, 64.276410335522086825, 18.525544030522723915, 57.23935871311914525, + 8.1475090211461065337, 78.55411386511332239, 64.205406024833791889, 106.78143331758110435, + 97.248194848638377152, 108.58249222228914732, 69.949323452201497275, 5.291000952467584284, + 15.66270339648326626, 98.584369436735869385, 8.2491786753453197889, 122.93392222294642124, + 55.113787109366967343, 0.39286700650336570106, 35.141509785276866751, 71.173010457241616677, + 68.069086638708540704, 68.519189622285921359, 86.546627530638943426, 71.34726031424725079, + 122.30569742756415508, 95.572322010884818155, 47.998963069196179276, 123.79596536385361105, + 83.410086256440990837, 79.155441863298619865, 104.78095744829261093, 40.710275585555791622, + 117.94910798186901957, 115.6229346490399621, 84.84360881946849986, 99.34085211176352459, + 2.2183205702713166829, 112.81146434577021864, 6.7644841936817101669, 5.4827945310571521986, + 76.760491032200661721, 4.0346678216046711896, 26.899633529606944649, 5.3347566673037363216, + 75.027646900241961703, 107.28033600826529437, 121.73286444817495067, 13.402616154016868677, + 14.32591006960865343, 21.443608517376560485, 126.05484765684013837, 122.04957148895846331, + 65.577848321270721499, 38.935228250680665951, 19.903379841092828428, 73.986177430608222494, + 72.243134630258282414, 38.927115608708845684, 6.4616019822205998935, 103.27516083073714981, + 106.04067056812345982, 12.275352846234454773, 60.450574122380203335, 8.8044935954640095588, + 83.853190100744541269, 99.927513184546114644, 120.92422993359650718, 42.9603918863213039, + 26.740292979557125363, 23.337062886410421925, 71.402596770178206498, 12.569796284788026242, + 42.177193611871189205, 48.684051327782071894, 126.38767744526194292, 24.335545658810588066, + 102.76556335276836762, 34.538699291817465564, 124.85047327753636637, 89.700454560890648281, + 111.04466424423299031, 41.741737495449342532, 81.048104923629580298, 12.698021276097279042, + 70.3591157509945333, 23.652800760202808306, 3.0254272102029062808, 74.046953323628258659, + 71.479489823563199025, 46.569888391659333138, 38.805201633676915662, 16.593440270131395664, + 85.129887917264568387, 83.947845846287236782, 107.56433608779116184, 113.52297676573653007, + 70.343245251031476073, 58.386180639103258727, 95.012127847014198778, 17.447590691605000757, + 86.583027149328700034, 66.467911844174523139, 64.575817247976374347, 103.06669754587710486, + 89.152245253400906222, 84.239476476461277343, 33.671813576482236385, 51.144649249410576886, + 7.6638276594567287248, 108.76525420904363273, 24.947276258793863235, 71.026552482460829196, + 34.522675112875731429, 50.041900356049154652, 5.1427973743884649593, 91.333055744380544638, + 16.996999544637219515, 49.289405458250257652, 40.192321692346013151, 83.633111687926430022, + 24.799651549219561275, 101.9607076560423593, 105.20533521678225952, 80.611759936291491613, + 109.75263931210429291, 60.145287348295823904, 30.888681769400136545, 48.209474633767968044, + 119.08704120747279376, 46.465855444745102432, 76.98411396538358531, 59.772093394101830199, + 119.70528617748277611, 81.945477438064699527, 4.0616683170774194878, 14.787063327628857223, + 46.625973031525063561, 21.145935431923135184, 33.690832410098664695, 29.324569053089362569, + 115.44778716756991344, 11.413897206399269635, 66.576673800591379404, 17.466505934269662248, + 59.457214162623131415, 86.705499794756178744, 82.824910736071615247, 21.020192785337712849, + 4.3078042575070867315, 44.744690214287402341, 110.92978086438597529, 112.01028106574449339, + 97.199690830486360937, 61.849509476272942265, 123.15831142945535248, 119.56366582549890154, + 20.388777687614492606, 23.233871946857107105, 98.703369830371229909, 1.4151652016153093427, + 116.03063584634583094, 63.990981639250094304, 108.19021864486057893, 46.948614977867691778, + 61.914070138609531568, 82.154133436899428489, 93.466375080228317529, 80.159127840270230081, + 65.695703358516766457, 41.253580310640245443, 5.2743433628602360841, 68.537461485851963516, + 108.88991431768590701, 64.512680290019488893, 1.1934817701439897064, 69.703595214599772589, + 16.024137611588230357, 73.184886626062507275, 75.580529834911430953, 77.665918656777648721, + 91.258162435864505824, 25.935737033032637555, 109.02727506064184126, 6.72174593771705986, + 87.001670689831371419, 100.83708860697515775, 96.790336529880732996, 78.749297052236215677, + 87.616999565761943813, 40.189463374797924189, 12.760641128003044287, 11.908074581660912372, + 89.620232443212444196, 28.8259060468772077, 73.484976427254878217, 70.666933661632356234, + 125.17990973451378522, 11.802617756409745198, 36.377219166199211031, 94.145730680676933844, + 55.216803906409040792, 4.6630171342476387508, 116.80208776121071423, 7.2527510813488333952, + 14.049993737931799842, 67.8526691571714764, 62.994386242233304074, 66.696955887353396975, + 46.123885119344777195, 124.47283063517534174, 116.2940553049556911, 36.831714694835682167, + 53.630512950010597706, 75.652463558748422656, 78.828783952922094613, 72.34654041844260064, + 114.99022565898121684, 91.908550705364177702, 121.32050901662660181, 5.3579330374450364616, + 104.22633752860565437, 97.523806268985936185, 41.710891153150441824, 54.23787870011801715, + 95.596258864279661793, 109.94928281671309378, 106.75896626002213452, 110.19842906928897719, + 125.06257862676284276, 5.6283775734300434124, 100.2275741287812707, 114.89510379813145846, + 43.208994466018339153, 117.33220656633420731, 9.8843802726223657373, 121.04723228784860112, + 46.115492444852861809, 33.643417884755763225, 61.2665845669216651, 38.241699017118662596, + 1.5237827465898590162, 12.831933636694884626, 39.27108888196744374, 80.743853745636442909, + 14.523253325107361889, 27.738642424723366275, 89.295124114236386959, 84.723938025475945324, + 10.249069448720547371, 64.692517524916183902, 61.488499998045881512, 45.536541767967719352, + 95.967165765814570477, 57.310217419675609563, 73.294319746924884384, 96.712424002198531525, + 99.977640540993888862, 99.632903425554104615, 98.492815640056505799, 0.28203020788714638911, + 13.714695910693990299, 63.067952002169477055, 96.209321117516083177, 2.78566487231728388, + 125.56008489676969475, 48.414845707829954335, 119.71895745670190081, 62.540339600924198749, + 50.061024126393022016, 124.84528512920587673, 91.220504081466060597, 97.871453144656697987, + 109.46920951388892718, 97.517180879916850245, 107.48299486303221784, 23.295581538463011384, + 114.07008196369861253, 97.914019224193907576, 92.973869578607263975, 69.746452339506504359, + 107.99977429010323249, 111.85565284108815831, 104.73036797969325562, 103.35820572742886725, + 115.31466992536661564, 119.87285099802102195, 54.664552145102788927, 75.533491719863377512, + 62.948324932269315468, 65.31568536350823706, 40.800722856540232897, 93.619750007866969099, + 111.47721396106135217, 89.077544017163745593, 81.498336346110590966, 32.77755330615764251, + 98.789723659945593681, 90.543959426911897026, 91.070868056001927471, 98.334155616266798461, + 77.785258610485470854, 107.61001961220972589, 98.161155685662379256, 83.522292031135293655, + 67.442419675371638732, 27.311723645540041616, 18.415477898521203315, 81.032443178413814167, + 88.343323428725852864, 123.84418007840940845, 10.443651786426926265, 9.3259480398482992314, + 99.376145155601989245, 7.0064435802814841736, 64.704313078076665988, 67.767086292962630978, + 39.681150521588278934, 52.932559299366403138, 61.047055941875441931, 57.623974698333768174, + 11.893763315132673597, 69.49262095733138267, 32.490975432963750791, 119.27751781189726898, + 122.19288723161298549, 89.595624551253422396, 19.872326493146829307, 25.354399179304891732, + 17.267842686833319021, 73.2128094745130511, 112.3008608705313236, 41.013006943485379452, + 72.463825836814066861, 105.94022212352865608, 15.948876442118489649, 71.901585133084154222, + 65.240492331893619848, 73.953206330013927072, 116.91312443250717479, 119.90429067357399617, + 117.13763212165576988, 58.636571236776944716, 5.4168591576271865051, 57.398813755728042452, + 35.613089666912856046, 73.930970174402318662, 82.679681069734215271, 34.587666213195916498, + 38.1799105699537904, 15.681073875810398022, 40.922980347517295741, 24.524687093242391711, + 48.532190685404202668, 34.781267878650396597, 32.301041750455624424, 57.192048964781861287, + 46.06967397584230639, 38.540648922222317196, 65.646307749251718633, 76.953826127442880534, + 40.82107440101026441, 94.088159161074145231, 42.325444317611982115, 45.231480130882118829, + 38.331092066146084107, 112.13861836183787091, 33.944804488892259542, 88.313045771014003549, + 78.85410685643000761, 17.602947211675200379, 45.746166451641329331, 0.55282067104417365044, + 37.05108806104544783, 114.4787174262382905, 16.295018042295851046, 29.108227730230282759, + 0.41081204967122175731, 85.562866635165846674, 66.496389697280392284, 89.164984444578294642, + 11.898646904402994551, 10.582001904935168568, 31.3254067929701705, 69.168738873471738771, + 16.498357350694277557, 117.86784444589284249, 110.22757421873393469, 0.78573401300673140213, + 70.28301957055737148, 14.346020914486871334, 8.138173277420719387, 9.0383792445754806977, + 45.093255061281524831, 14.694520628498139558, 116.61139485513194813, 63.144644021769636311, + 95.997926138395996531, 119.59193072771086008, 38.820172512885619653, 30.310883726600877708, + 81.561914896585221868, 81.420551171115221223, 107.89821596374167711, 103.24586929808356217, + 41.687217638940637698, 70.68170422352704918, 4.4366411405462713446, 97.622928691540437285, + 13.528968387363420334, 10.965589062117942376, 25.520982064401323441, 8.0693356432093423791, + 53.799267059213889297, 10.669513334611110622, 22.055293800487561384, 86.560672016534226714, + 115.46572889634990133, 26.805232308033737354, 28.65182013921730686, 42.887217034756758949, + 124.10969531368391472, 116.09914297792056459, 3.1556966425414429978, 77.870456501361331902, + 39.806759682189294836, 19.972354861220082967, 16.486269260516564827, 77.854231217417691369, + 12.923203964444837766, 78.550321661477937596, 84.081341136246919632, 24.550705692468909547, + 120.90114824476040667, 17.608987190931657096, 39.706380201492720516, 71.855026369095867267, + 113.84845986719301436, 85.920783772642607801, 53.480585959114250727, 46.674125772824481828, + 14.805193540356412996, 25.139592569576052483, 84.35438722374237841, 97.368102655567781767, + 124.77535489052388584, 48.67109131762481411, 77.531126705536735244, 69.077398583638569107, + 121.70094655507637071, 51.400909121784934541, 94.089328488465980627, 83.483474990902323043, + 34.096209847259160597, 25.396042552198196063, 12.718231501989066601, 47.305601520405616611, + 6.0508544204094505403, 20.093906647260155296, 14.958979647126398049, 93.139776783318666276, + 77.610403267353831325, 33.186880540266429307, 42.259775834532774752, 39.895691692578111542, + 87.128672175585961668, 99.045953531476698117, 12.686490502062952146, 116.77236127821015543, + 62.024255694028397556, 34.895181383213639492, 45.166054298661038047, 4.9358236883526842576, + 1.1516344959563866723, 78.133395091757847695, 50.304490506805450423, 40.478952952922554687, + 67.343627152964472771, 102.28929849882115377, 15.327655318917095428, 89.530508418087265454, + 49.894552517591364449, 14.053104964921658393, 69.045350225751462858, 100.0838007120983093, + 10.285594748780567897, 54.666111488761089277, 33.993999089274439029, 98.578810916500515305, + 80.384643384695664281, 39.266223375852860045, 49.599303098442760529, 75.921415312088356586, + 82.410670433568157023, 33.223519872586621204, 91.505278624208585825, 120.29057469659164781, + 61.777363538800273091, 96.418949267539574066, 110.17408241494558752, 92.931710889493842842, + 25.968227930767170619, 119.54418678820729838, 111.4105723549691902, 35.890954876129399054, + 8.1233366341548389755, 29.574126655257714447, 93.251946063050127123, 42.291870863846270368, + 67.381664820197329391, 58.649138106182363117, 102.89557433513982687, 22.827794412802177249, + 5.1533476011827588081, 34.933011868539324496, 118.91442832524990081, 45.410999589515995467, + 37.649821472143230494, 42.040385570675425697, 8.615608515014173463, 89.489380428578442661, + 93.859561728775588563, 96.020562131492624758, 66.399381660972721875, 123.69901895254952251, + 118.31662285891434294, 111.12733165099780308, 40.777555375228985213, 46.467743893717852188, + 69.406739660742459819, 2.8303304032342566643, 104.06127169269166188, 127.98196327850382659, + 88.380437289721157867, 93.897229955735383555, 123.82814027722270112, 36.308266873802494956, + 58.932750160460273037, 32.318255680544098141, 3.3914067170335329138, 82.507160621280490886, + 10.548686725724110147, 9.0749229717075650115, 89.779828635375451995, 1.0253605800389777869, + 2.3869635402916173916, 11.407190429199545179, 32.048275223180098692, 18.36977325212865253, + 23.161059669826499885, 27.331837313558935421, 54.516324871729011647, 51.871474066068913089, + 90.054550121283682529, 13.443491875437757699, 46.003341379666380817, 73.674177213953953469, + 65.580673059765103972, 29.498594104476069333, 47.233999131523887627, 80.378926749595848378, + 25.521282256006088573, 23.816149163325462723, 51.240464886424888391, 57.651812093758053379, + 18.969952854513394414, 13.333867323268350447, 122.35981946902757045, 23.605235512819490395, + 72.754438332402060041, 60.291461361353867687, 110.43360781281808158, 9.3260342684989154804, + 105.60417552242142847, 14.50550216269766679, 28.099987475867237663, 7.7053383143429527991, + 125.98877248447024613, 5.393911774706793949, 92.247770238693192368, 120.94566127035432146, + 104.5881106099113822, 73.663429389671364333, 107.26102590002483339, 23.304927117500483291, + 29.657567905847827205, 16.693080836888839258, 101.98045131796607166, 55.817101410731993383, + 114.64101803325320361, 10.715866074893710902, 80.452675057214946719, 67.047612537971872371, + 83.421782306300883647, 108.47575740023967228, 63.192517728562961565, 91.898565633429825539, + 85.517932520047907019, 92.396858138581592357, 122.12515725352568552, 11.256755146863724804, + 72.455148257566179382, 101.79020759626291692, 86.417988932040316286, 106.66441313266841462, + 19.768760545248369453, 114.09446457569720224, 92.230984889705723617, 67.286835769511526451, + 122.5331691338433302, 76.483398034237325191, 3.0475654931797180325, 25.663867273389769252, + 78.542177763938525459, 33.487707491272885818, 29.046506650214723777, 55.47728484945037053, + 50.590248228476411896, 41.447876050951890647, 20.49813889744473272, 1.3850350498323678039, + 122.97699999609176302, 91.073083535939076683, 63.934331531629140954, 114.6204348393548571, + 18.588639493853406748, 65.424848004400701029, 71.955281081991415704, 71.265806851111847209, + 68.985631280113011599, 0.56406041577429277822, 27.429391821387980599, 126.13590400434259209, + 64.418642235032166354, 5.5713297446382057387, 123.1201697935393895, 96.82969141566354665, + 111.43791491340380162, 125.0806792018483975, 100.12204825278968201, 121.69057025841539144, + 54.441008162935759174, 67.742906289317033952, 90.938419027781492332, 67.034361759837338468, + 86.965989726064435672, 46.591163076929660747, 100.14016392740086303, 67.82803844839145313, + 57.947739157218165928, 11.492904679016646696, 87.999548580210102955, 95.711305682179954601, + 81.460735959390149219, 78.716411454861372476, 102.62933985073686927, 111.7457019960420439, + 109.32910429020921583, 23.066983439726755023, 125.89664986454226892, 2.6313707270164741203, + 81.601445713084103772, 59.239500015737576177, 94.95442792212634231, 50.155088034331129165, + 34.996672692221181933, 65.555106612318922998, 69.579447319894825341, 53.087918853827432031, + 54.14173611200749292, 68.668311232537234901, 27.570517220974579686, 87.220039224423089763, + 68.32231137132839649, 39.044584062274225289, 6.8848393507432774641, 54.623447291080083232, + 36.830955797046044609, 34.064886356831266312, 48.686646857455343707, 119.6883601568188169, + 20.887303572853852529, 18.651896079700236442, 70.75229031120397849, 14.012887160566606326, + 1.4086261561569699552, 7.5341725859252619557, 79.362301043176557869, 105.86511859873280628, + 122.09411188375088386, 115.24794939666753635, 23.787526630268985173, 10.985241914662765339, + 64.98195086593113956, 110.55503562379817595, 116.38577446322960895, 51.191249102506844793, + 39.744652986293658614, 50.708798358609783463, 34.535685373670276022, 18.425618949029740179, + 96.601721741062647197, 82.026013886974396883, 16.9276516736317717, 83.880444247057312168, + 31.897752884240617277, 15.803170266171946423, 2.4809846637908776756, 19.906412660031492123, + 105.82624886501798755, 111.80858134715163033, 106.27526424331153976, 117.27314247355388943, + 10.83371831525437301, 114.7976275114560849, 71.226179333829350071, 19.861940348808275303, + 37.359362139468430541, 69.175332426391832996, 76.3598211399075808, 31.362147751620796043, + 81.845960695034591481, 49.049374186484783422, 97.064381370808405336, 69.562535757300793193, + 64.602083500911248848, 114.38409792956372257, 92.139347951684612781, 77.081297844448272372, + 3.2926154985070752446, 25.907652254885761067, 81.642148802024166798, 60.176318322148290463, + 84.650888635223964229, 90.462960261764237657, 76.662184132295806194, 96.277236723675741814, + 67.889608977788157063, 48.626091542031645076, 29.708213712860015221, 35.205894423350400757, + 91.492332903282658663, 1.1056413420883473009, 74.102176122094533639, 100.957434852476581, + 32.590036084591702092, 58.216455460460565519, 0.82162409934608149342, 43.125733270335331326, + 4.992779394564422546, 50.329968889160227263, 23.797293808805989102, 21.164003809870337136, + 62.650813585943978978, 10.337477746943477541, 32.996714701392193092, 107.73568889178932295, + 92.455148437467869371, 1.5714680260171007831, 12.566039141114742961, 28.692041828973742668, + 16.276346554841438774, 18.076758489150961395, 90.186510122563049663, 29.389041256999917096, + 105.22278971026389627, 126.2892880435429106, 63.995852276795631042, 111.18386145542172017, + 77.640345025771239307, 60.621767453205393394, 35.123829793174081715, 34.841102342234080425, + 87.796431927486992208, 78.491738596167124342, 83.374435277884913376, 13.36340844705409836, + 8.8732822810961806681, 67.24585738308087457, 27.057936774726840667, 21.931178124235884752, + 51.041964128802646883, 16.138671286418684758, 107.59853411842777859, 21.339026669222221244, + 44.110587600978760747, 45.121344033072091406, 102.93145779269980267, 53.610464616067474708, + 57.30364027843461372, 85.774434069517155876, 120.21939062737146742, 104.19828595584112918, + 6.3113932850865239743, 27.740913002722663805, 79.613519364378589671, 39.944709722440165933, + 32.972538521036767634, 27.708462434835382737, 25.84640792889331351, 29.100643322959513171, + 40.162682272493839264, 49.101411384941457072, 113.80229648952081334, 35.217974381863314193, + 79.412760402989079012, 15.710052738195372513, 99.696919734389666701, 43.841567545285215601, + 106.96117191822850145, 93.348251545648963656, 29.610387080712825991, 50.279185139155742945, + 40.708774447488394799, 66.736205311139201513, 121.55070978104777168, 97.342182635253266199, + 27.062253411077108467, 10.154797167280776193, 115.40189311015274143, 102.80181824357350706, + 60.178656976935599232, 38.966949981804646086, 68.192419694518321194, 50.792085104396392126, + 25.436463003978133202, 94.611203040811233222, 12.101708840818901081, 40.187813294520310592, + 29.917959294256434077, 58.27955356664097053, 27.220806534707662649, 66.373761080532858614, + 84.519551669065549504, 79.791383385159861064, 46.257344351175561314, 70.091907062953396235, + 25.372981004129542271, 105.54472255642031087, 124.04851138805679511, 69.790362766427278984, + 90.332108597322076093, 9.8716473767053685151, 2.3032689919164113235, 28.266790183515695389, + 100.60898101361090085, 80.957905905848747352, 6.6872543059325835202, 76.578596997642307542, + 30.655310637837828835, 51.061016836174530908, 99.789105035182728898, 28.106209929846954765, + 10.090700451506563695, 72.167601424196618609, 20.571189497561135795, 109.33222297752217855, + 67.987998178552516038, 69.157621833004668588, 32.769286769391328562, 78.532446751705720089, + 99.198606196889159037, 23.842830624180351151, 36.821340867136314046, 66.447039745176880388, + 55.010557248420809628, 112.58114939318329562, 123.55472707760418416, 64.837898535082786111, + 92.34816482989481301, 57.863421778987685684, 51.936455861537979217, 111.08837357641823473, + 94.821144709938380402, 71.781909752258798108, 16.246673268309677951, 59.148253310519066872, + 58.503892126100254245, 84.583741727696178714, 6.7633296403946587816, 117.29827621236836421, + 77.791148670279653743, 45.655588825604354497, 10.306695202365517616, 69.866023737082286971, + 109.82885665049980162, 90.821999179031990934, 75.299642944286460988, 84.080771141350851394, + 17.231217030031984905, 50.978760857160523301, 59.719123457554815104, 64.041124262988887494, + 4.7987633219490817282, 119.398037905102683, 108.63324571783232386, 94.254663301995606162, + 81.555110750457970425, 92.935487787439342355, 10.813479321484919637, 5.6606608064721513074, + 80.122543385386961745, 127.96392655701129115, 48.760874579445953714, 59.794459911474405089, + 119.65628055444540223, 72.616533747604989912, 117.86550032092054607, 64.636511361088196281, + 6.7828134340707038064, 37.014321242560981773, 21.097373451448220294, 18.149845943418768002, + 51.55965727075090399, 2.0507211600779555738, 4.7739270805832347833, 22.814380858399090357, + 64.096550446360197384, 36.73954650425730506, 46.32211933965299977, 54.663674627117870841, + 109.03264974345802329, 103.74294813214146416, 52.109100242567365058, 26.886983750875515398, + 92.006682759336399613, 19.348354427911544917, 3.1613461195302079432, 58.997188208952138666, + 94.467998263051413232, 32.757853499191696756, 51.042564512012177147, 47.632298326650925446, + 102.48092977284977678, 115.30362418751610676, 37.939905709026788827, 26.667734646540338872, + 116.7196389380551409, 47.21047102564261877, 17.508876664804120082, 120.58292272271137335, + 92.867215625636163168, 18.65206853700146894, 83.208351044842856936, 29.011004325395333581, + 56.199974951734475326, 15.410676628689543577, 123.97754496894049225, 10.787823549417225877, + 56.495540477390022716, 113.8913225407122809, 81.176221219826402375, 19.326858779346366646, + 86.522051800049666781, 46.609854235000966582, 59.315135811695654411, 33.386161673781316495, + 75.960902635932143312, 111.63420282146762474, 101.28203606650640722, 21.431732149791059783, + 32.905350114433531417, 6.0952250759473827202, 38.843564612605405273, 88.951514800479344558, + 126.38503545712956111, 55.797131266863289056, 43.035865040099452017, 56.793716277166822692, + 116.25031450705137104, 22.513510293731087586, 16.910296515135996742, 75.580415192529471824, + 44.83597786408427055, 85.328826265336829238, 39.537521090500376886, 100.18892915139804245, + 56.461969779415085213, 6.5736715390266908798, 117.06633826769029838, 24.966796068474650383, + 6.095130986359436065, 51.327734546783176484, 29.084355527877050918, 66.975414982545771636, + 58.093013300429447554, 110.95456969890074106, 101.18049645695282379, 82.895752101903781295, + 40.99627779488946544, 2.7700700996683735866, 117.95399999218716403, 54.146167071878153365, + 127.86866306326191989, 101.24086967870971421, 37.177278987710451474, 2.8496960088050400373, + 15.910562163986469386, 14.531613702227332396, 9.9712625602260231972, 1.1281208315485855564, + 54.858783642779599177, 124.27180800868882216, 0.83728447006433270872, 11.142659489280049456, + 118.24033958708241698, 65.659382831330731278, 94.875829826811241219, 122.16135840370043297, + 72.244096505583001999, 115.38114051683078287, 108.88201632587515633, 7.485812578637705883, + 53.876838055566622643, 6.0687235196783149149, 45.931979452128871344, 93.182326153862959472, + 72.280327854805364041, 7.6560768967829062603, 115.89547831443633186, 22.985809358036931371, + 47.999097160423843889, 63.422611364363547182, 34.921471918783936417, 29.432822909726382932, + 77.258679701477376511, 95.491403992087725783, 90.658208580418431666, 46.133966879457148025, + 123.79329972908453783, 5.2627414540365862194, 35.202891426168207545, 118.47900003147879033, + 61.908855844252684619, 100.31017606866225833, 69.993345384446001844, 3.1102132246414839756, + 11.158894639789650682, 106.17583770765486406, 108.28347222401862382, 9.336622465074469801, + 55.141034441952797351, 46.440078448849817505, 8.6446227426567929797, 78.089168124548450578, + 13.769678701486554928, 109.24689458216016646, 73.661911594092089217, 68.129772713662532624, + 97.373293714914325392, 111.37672031363763381, 41.774607145707705058, 37.303792159404110862, + 13.50458062240795698, 28.025774321133212652, 2.8172523123139399104, 15.06834517185416189, + 30.724602086356753716, 83.730237197469250532, 116.1882237675054057, 102.4958987933350727, + 47.575053260537970345, 21.970483829329168657, 1.9639017318659170996, 93.110071247599989874, + 104.77154892645921791, 102.38249820501368959, 79.489305972587317228, 101.41759671721956693, + 69.071370747340552043, 36.851237898063118337, 65.203443482128932374, 36.052027773948793765, + 33.85530334726718138, 39.760888494114624336, 63.795505768481234554, 31.606340532343892846, + 4.9619693275817553513, 39.812825320066622226, 83.652497730039613089, 95.617162694306898629, + 84.550528486626717495, 106.54628494710777886, 21.667436630512383999, 101.59525502291580779, + 14.452358667658700142, 39.723880697616550606, 74.718724278940499062, 10.350664852787303971, + 24.719642279815161601, 62.724295503245230066, 35.691921390069182962, 98.098748372973204823, + 66.128762741620448651, 11.125071514605224365, 1.2041670018261356745, 100.76819585913108313, + 56.27869590337286354, 26.162595688896544743, 6.5852309970141504891, 51.815304509775160113, + 35.284297604048333596, 120.3526366443002189, 41.301777270451566437, 52.925920523532113293, + 25.324368264595250366, 64.554473447355121607, 7.7792179555763141252, 97.252183084063290153, + 59.416427425720030442, 70.411788846704439493, 54.984665806565317325, 2.2112826841803325806, + 20.204352244192705257, 73.914869704953162, 65.180072169183404185, 116.43291092092113104, + 1.6432481986921629868, 86.251466540670662653, 9.9855587891288450919, 100.65993777832045453, + 47.594587617611978203, 42.328007619740674272, 125.30162717188795796, 20.674955493886955082, + 65.993429402788024163, 87.471377783582283882, 56.910296874935738742, 3.1429360520342015661, + 25.132078282229485922, 57.384083657947485335, 32.552693109682877548, 36.15351697830556077, + 52.373020245126099326, 58.77808251400347217, 82.445579420531430515, 124.5785760870858212, + 127.99170455359490006, 94.36772291084707831, 27.280690051542478614, 121.24353490641078679, + 70.24765958634816343, 69.682204684471798828, 47.592863854977622395, 28.983477192337886663, + 38.748870555769826751, 26.72681689410819672, 17.746564562195999315, 6.4917147661617491394, + 54.115873549453681335, 43.862356248471769504, 102.08392825760529377, 32.277342572841007495, + 87.197068236855557188, 42.678053338444442488, 88.221175201957521494, 90.242688066147820791, + 77.862915585399605334, 107.22092923213494942, 114.60728055687286542, 43.548868139037949732, + 112.43878125474657281, 80.39657191168225836, 12.622786570173047949, 55.481826005448965589, + 31.227038728757179342, 79.889419444880331866, 65.945077042073535267, 55.416924869670765474, + 51.692815857786627021, 58.201286645919026341, 80.325364544987678528, 98.202822769886552123, + 99.604592979041626677, 70.435948763730266364, 30.825520805978158023, 31.420105476394383004, + 71.393839468779333401, 87.683135090574069181, 85.922343836460640887, 58.696503091297927313, + 59.220774161425651982, 100.55837027831148589, 81.417548894980427576, 5.4724106222820410039, + 115.10141956209918135, 66.684365270506532397, 54.124506822154216934, 20.309594334565190366, + 102.80378622030912084, 77.603636487147014122, 120.35731395387119846, 77.933899963612930151, + 8.3848393890366423875, 101.58417020879278425, 50.872926007959904382, 61.222406081622466445, + 24.203417681637802161, 80.375626589040621184, 59.835918588512868155, 116.55910713328194106, + 54.441613069418963278, 4.7475221610693552066, 41.039103338134736987, 31.582766770319722127, + 92.514688702354760608, 12.183814125906792469, 50.74596200826272252, 83.089445112844259711, + 120.0970227761172282, 11.580725532858195947, 52.664217194644152187, 19.74329475341073703, + 4.6065379838328226469, 56.533580367035028758, 73.21796202722543967, 33.915811811697494704, + 13.374508611868805019, 25.157193995284615085, 61.310621275675657671, 102.1220336723526998, + 71.578210070365457796, 56.21241985969390953, 20.181400903016765369, 16.335202848393237218, + 41.142378995125909569, 90.664445955047995085, 7.975996357108670054, 10.315243666009337176, + 65.538573538786295103, 29.064893503415078158, 70.397212393778318074, 47.685661248360702302, + 73.64268173427626607, 4.8940794903537607752, 110.02111449684525724, 97.162298786370229209, + 119.1094541552120063, 1.6757970701692102011, 56.696329659789626021, 115.72684355797537137, + 103.87291172307959641, 94.176747152840107447, 61.642289419880398782, 15.563819504517596215, + 32.493346536619355902, 118.29650662103813374, 117.00778425220414647, 41.167483455392357428, + 13.526659280792955542, 106.5965524247403664, 27.582297340559307486, 91.311177651208708994, + 20.613390404734673211, 11.73204747416821192, 91.657713301003241213, 53.643998358067619847, + 22.599285888576559955, 40.161542282701702788, 34.46243406006396981, 101.9575217143210466, + 119.43824691511326819, 0.08224852597777498886, 9.5975266439018014353, 110.79607581020900398, + 89.266491435668285703, 60.509326603994850302, 35.11022150091957883, 57.870975574878684711, + 21.626958642969839275, 11.321321612947940594, 32.245086770777561469, 127.9278531140225823, + 97.521749158891907427, 119.58891982295244816, 111.31256110889444244, 17.233067495213617804, + 107.73100064184473013, 1.2730227221763925627, 13.565626868141407613, 74.028642485121963546, + 42.194746902896440588, 36.299691886837536003, 103.11931454150180798, 4.1014423201559111476, + 9.5478541611664695665, 45.628761716801818693, 0.19310089272039476782, 73.479093008514610119, + 92.64423867930599954, 109.32734925423937966, 90.065299486919684568, 79.485896264282928314, + 104.21820048513473012, 53.773967501754668774, 56.013365518672799226, 38.696708855823089834, + 6.3226922390604158863, 117.99437641790791531, 60.935996526102826465, 65.515706998383393511, + 102.08512902402435429, 95.264596653305488871, 76.961859545703191543, 102.60724837503221352, + 75.879811418053577654, 53.335469293084315723, 105.4392778761102818, 94.42094205128523754, + 35.017753329611878144, 113.16584544542638469, 57.734431251272326335, 37.304137074006575858, + 38.416702089685713872, 58.022008650790667161, 112.39994990346895065, 30.821353257382725133, + 119.95508993788098451, 21.575647098834451754, 112.99108095478368341, 99.782645081428199774, + 34.352442439652804751, 38.65371755869637127, 45.044103600099333562, 93.219708470001933165, + 118.63027162339130882, 66.772323347566270968, 23.921805271867924603, 95.268405642938887468, + 74.564072133012814447, 42.863464299582119565, 65.810700228867062833, 12.19045015189476544, + 77.687129225214448525, 49.903029600962327095, 124.77007091425912222, 111.59426253372657811, + 86.071730080198904034, 113.58743255433728336, 104.50062901410274208, 45.027020587462175172, + 33.820593030275631463, 23.160830385058943648, 89.671955728172179079, 42.657652530673658475, + 79.07504218100439175, 72.377858302796084899, 112.92393955883017043, 13.147343078057019738, + 106.13267653538059676, 49.933592136949300766, 12.19026197271887213, 102.65546909356635297, + 58.168711055757739814, 5.9508299650915432721, 116.18602660086253309, 93.909139397805120097, + 74.360992913909285562, 37.79150420380756259, 81.99255558977893088, 5.540140199340385152, + 107.90799998437432805, 108.29233414375994471, 127.73732612652747775, 74.481739357419428416, + 74.354557975420902949, 5.6993920176100800745, 31.821124327972938772, 29.063227404454664793, + 19.942525120452046394, 2.2562416630971711129, 109.71756728556283633, 120.54361601737764431, + 1.6745689401286654174, 22.285318978563736891, 108.48067917416847195, 3.3187656626651005354, + 61.751659653626120416, 116.32271680740450392, 16.488193011169641977, 102.76228103366520372, + 89.764032651750312652, 14.971625157275411766, 107.75367611113324529, 12.13744703935662983, + 91.863958904261380667, 58.364652307729556924, 16.560655709610728081, 15.312153793569450499, + 103.79095662887266371, 45.971618716073862743, 95.998194320847687777, 126.84522272872709436, + 69.842943837567872833, 58.865645819456403842, 26.517359402958391001, 62.982807984179089544, + 53.316417160836863331, 92.267933758917934028, 119.58659945816907566, 10.525482908073172439, + 70.405782852340053068, 108.95800006295758067, 123.81771168850900722, 72.62035213732815464, + 11.986690768892003689, 6.2204264492829679511, 22.317789279582939344, 84.351675415313366102, + 88.566944448037247639, 18.673244930148939602, 110.2820688839055947, 92.88015689769963501, + 17.289245485317223938, 28.178336249096901156, 27.539357402976747835, 90.493789164323970908, + 19.323823188187816413, 8.2595454273287032265, 66.746587429832288763, 94.753440627275267616, + 83.549214291415410116, 74.607584318808221724, 27.00916124481591396, 56.051548642266425304, + 5.6345046246278798208, 30.13669034370832378, 61.449204172717145411, 39.460474394942139043, + 104.37644753501444939, 76.991797586670145392, 95.150106521075940691, 43.940967658658337314, + 3.9278034637354721781, 58.220142495203617727, 81.543097852922073798, 76.764996410031017149, + 30.978611945178272435, 74.835193434442771832, 10.142741494681104086, 73.702475796129874652, + 2.4068869642578647472, 72.10405554789758753, 67.710606694534362759, 79.521776988229248673, + 127.59101153696246911, 63.212681064687785693, 9.9239386551635107026, 79.62565064013688243, + 39.304995460082864156, 63.234325388617435237, 41.101056973257072968, 85.092569894215557724, + 43.334873261028405977, 75.190510045831615571, 28.904717335317400284, 79.44776139523673919, + 21.437448557880998123, 20.701329705574607942, 49.439284559630323201, 125.44859100649046013, + 71.383842780142003903, 68.197496745950047625, 4.2575254832408973016, 22.250143029210448731, + 2.4083340036559093278, 73.53639171826216625, 112.55739180674572708, 52.325191377793089487, + 13.170461994028300978, 103.63060901955032023, 70.568595208100305172, 112.70527328860043781, + 82.603554540903132875, 105.85184104706422659, 50.648736529194138711, 1.1089468947102432139, + 15.558435911156266229, 66.504366168126580305, 118.83285485144369886, 12.823577693408878986, + 109.96933161313063465, 4.4225653683606651612, 40.408704488389048493, 19.829739409909961978, + 2.3601443383704463486, 104.86582184184226207, 3.2864963973879639525, 44.502933081341325305, + 19.971117578261328163, 73.319875556644547032, 95.189175235223956406, 84.656015239484986523, + 122.60325434377591591, 41.349910987777548144, 3.9868588055796863046, 46.942755567164567765, + 113.82059374987147748, 6.2858721040684031323, 50.264156564458971843, 114.76816731589497067, + 65.105386219365755096, 72.307033956611121539, 104.74604049025219865, 117.55616502801058232, + 36.891158841066499008, 121.15715217417528038, 127.9834091071934381, 60.735445821694156621, + 54.561380103088595206, 114.48706981282521156, 12.495319172699964838, 11.364409368943597656, + 95.185727709955244791, 57.966954384675773326, 77.497741111539653502, 53.453633788216393441, + 35.49312912439199863, 12.983429532323498279, 108.23174709890736267, 87.724712496947176987, + 76.167856515210587531, 64.554685145685652969, 46.394136473711114377, 85.356106676892522955, + 48.442350403918680968, 52.485376132299279561, 27.725831170802848646, 86.441858464273536811, + 101.21456111374573084, 87.097736278079537442, 96.877562509496783605, 32.79314382336451672, + 25.245573140346095897, 110.96365201089793118, 62.454077457517996663, 31.778838889764301712, + 3.8901540841470705345, 110.83384973934153095, 103.38563171557325404, 116.40257329184169066, + 32.650729089978995034, 68.405645539776742226, 71.209185958086891333, 12.871897527460532729, + 61.651041611956316046, 62.840210952792403987, 14.787678937562304782, 47.366270181151776342, + 43.844687672921281774, 117.39300618259585463, 118.44154832285494194, 73.116740556626609759, + 34.835097789960855152, 10.944821244567719987, 102.20283912420200068, 5.3687305410130647942, + 108.24901364430843387, 40.61918866913401871, 77.60757244062187965, 27.207272974297666224, + 112.71462790774603491, 27.867799927225860301, 16.769678778076922754, 75.168340417585568503, + 101.74585201591980876, 122.44481216324493289, 48.406835363279242301, 32.751253178081242368, + 119.67183717702937429, 105.11821426656388212, 108.88322613883792656, 9.4950443221387104131, + 82.078206676269473974, 63.165533540643082233, 57.029377404709521215, 24.367628251813584939, + 101.49192401652908302, 38.178890225692157401, 112.19404555223445641, 23.161451065716391895, + 105.32843438928830437, 39.48658950682147406, 9.2130759676656452939, 113.06716073407369549, + 18.435924054450879339, 67.831623623394989409, 26.749017223737610038, 50.314387990569230169, + 122.62124255135495332, 76.24406734470903757, 15.156420140730915591, 112.42483971938781906, + 40.362801806033530738, 32.670405696786474437, 82.284757990255457116, 53.32889191009599017, + 15.951992714217340108, 20.63048733202231233, 3.0771470775725902058, 58.129787006833794294, + 12.794424787556636147, 95.371322496725042583, 19.28536346855253214, 9.7881589807111595292, + 92.04222899369415245, 66.324597572744096396, 110.2189083104240126, 3.3515941403384204023, + 113.39265931958289002, 103.45368711595438072, 79.745823446162830805, 60.353494305680214893, + 123.28457883976079756, 31.12763900903519243, 64.986693073242349783, 108.59301324207990547, + 106.01556850440829294, 82.334966910784714855, 27.053318561589549063, 85.19310484948073281, + 55.16459468112225295, 54.622355302417417988, 41.226780809469346423, 23.464094948340061819, + 55.315426602006482426, 107.28799671613523969, 45.198571777153119911, 80.323084565403405577, + 68.924868120131577598, 75.915043428645731183, 110.87649383022653637, 0.16449705195554997772, + 19.195053287807240849, 93.59215162042164593, 50.532982871336571407, 121.0186532079897006, + 70.22044300183915766, 115.74195114975736942, 43.25391728593967855, 22.642643225895881187, + 64.490173541558760917, 127.85570622804880259, 67.043498317787452834, 111.17783964590853429, + 94.625122217788884882, 34.466134990430873586, 87.462001283689460251, 2.5460454443527851254, + 27.131253736286453204, 20.057284970243927091, 84.389493805792881176, 72.599383773678709986, + 78.23862908300361596, 8.2028846403118222952, 19.095708322332939133, 91.257523433603637386, + 0.38620178544442751445, 18.958186017032858217, 57.288477358615637058, 90.654698508482397301, + 52.130598973843007116, 30.971792528569494607, 80.436400970269460231, 107.54793500350933755, + 112.02673103734559845, 77.393417711646179669, 12.645384478124469751, 107.98875283581583062, + 121.87199305220929091, 3.0314139967704250012, 76.170258048052346567, 62.529193306614615722, + 25.923719091410021065, 77.214496750068065012, 23.759622836107155308, 106.67093858617226942, + 82.878555752224201569, 60.841884102570475079, 70.035506659227394266, 98.331690890852769371, + 115.46886250254465267, 74.608274148013151716, 76.833404179371427745, 116.0440173015849723, + 96.799899806937901303, 61.642706514769088244, 111.91017987576196902, 43.151294197672541486, + 97.982161909571004799, 71.565290162856399547, 68.704884879305609502, 77.307435117392742541, + 90.088207200202305103, 58.439416940007504309, 109.26054324678625562, 5.5446466951325419359, + 47.843610543739487184, 62.536811285881412914, 21.128144266025628895, 85.72692859916787711, + 3.6214004577341256663, 24.38090030379316886, 27.374258450428897049, 99.806059201928292168, + 121.54014182852188242, 95.188525067456794204, 44.143460160401446046, 99.174865108678204706, + 81.001258028205484152, 90.054041174924350344, 67.641186060551262926, 46.321660770121525275, + 51.343911456344358157, 85.315305061350954929, 30.150084362012421479, 16.755716605595807778, + 97.847879117660340853, 26.294686156117677456, 84.265353070761193521, 99.867184273898601532, + 24.380523945441382239, 77.310938187132705934, 116.33742211151547963, 11.901659930186724523, + 104.37205320172870415, 59.818278795613878174, 20.721985827818571124, 75.583008407618763158, + 35.98511117955786176, 11.080280398684408283, 87.81599996875229408, 88.584668287523527397, + 127.47465225305859349, 20.96347871484249481, 20.709115950841805898, 11.398784035220160149, + 63.642248655945877545, 58.126454808909329586, 39.885050240904092789, 4.5124833261979802046, + 91.435134571129310643, 113.08723203475528862, 3.3491378802573308349, 44.570637957131111762, + 88.961358348336943891, 6.6375313253302010708, 123.50331930725587881, 104.64543361480900785, + 32.976386022342921933, 77.524562067334045423, 51.528065303500625305, 29.943250314554461511, + 87.507352222266490571, 24.274894078716897639, 55.727917808522761334, 116.72930461545911385, + 33.121311419221456163, 30.624307587142538978, 79.581913257745327428, 91.943237432151363464, + 63.996388641699013533, 125.69044545745782671, 11.685887675135745667, 117.73129163891280768, + 53.034718805916782003, 125.96561596835817909, 106.63283432167736464, 56.535867517839506036, + 111.17319891633815132, 21.050965816149982857, 12.811565704683744116, 89.916000125918799313, + 119.63542337702165241, 17.240704274656309281, 23.973381537784007378, 12.440852898565935902, + 44.635578559169516666, 40.703350830630370183, 49.133888896074495278, 37.346489860301517183, + 92.564137767814827384, 57.76031379539927002, 34.578490970634447876, 56.356672498193802312, + 55.078714805957133649, 52.987578328647941817, 38.647646376375632826, 16.519090854661044432, + 5.4931748596682155039, 61.506881254554173211, 39.098428582834458211, 21.215168637616443448, + 54.018322489631827921, 112.10309728453285061, 11.269009249255759642, 60.273380687416647561, + 122.89840834543429082, 78.920948789887916064, 80.752895070032536751, 25.983595173343928764, + 62.300213042151881382, 87.881935317316674627, 7.8556069274709443562, 116.44028499041087343, + 35.086195705847785575, 25.529992820062034298, 61.95722389036018285, 21.670386868885543663, + 20.285482989365846151, 19.404951592259749305, 4.8137739285193674732, 16.208111095798813039, + 7.4212133890723634977, 31.043553976462135324, 127.18202307392493822, 126.42536212937557139, + 19.847877310330659384, 31.25130128027376486, 78.609990920165728312, 126.46865077723487047, + 82.202113946517783916, 42.185139788431115448, 86.669746522060449934, 22.381020091663231142, + 57.809434670638438547, 30.895522790473478381, 42.874897115761996247, 41.402659411149215885, + 98.878569119264284382, 122.89718201298455824, 14.767685560287645785, 8.3949934919000952505, + 8.5150509664817946032, 44.500286058420897461, 4.8166680073154566344, 19.07278343652797048, + 97.114783613491454162, 104.65038275558617897, 26.340923988060239935, 79.261218039104278432, + 13.137190416204248322, 97.410546577204513596, 37.207109081809903728, 83.703682094128453173, + 101.29747305838827742, 2.2178937894204864278, 31.116871822316170437, 5.0087323362567985896, + 109.66570970288739773, 25.64715538682139595, 91.938663226261269301, 8.8451307367213303223, + 80.817408976778096985, 39.659478819819923956, 4.7202886767445306759, 81.731643683684524149, + 6.572992794775927905, 89.005866162682650611, 39.942235156526294304, 18.639751113292732043, + 62.378350470451550791, 41.312030478973611025, 117.20650868755183183, 82.699821975555096287, + 7.9737176111593726091, 93.885511134332773509, 99.641187499742954969, 12.571744208136806265, + 100.52831312892158167, 101.53633463179357932, 2.210772438735148171, 16.614067913225881057, + 81.492080980508035282, 107.11233005602116464, 73.782317682136635995, 114.31430434835419874, + 127.96681821438687621, 121.47089164338831324, 109.12276020618082839, 100.97413962565042311, + 24.990638345399929676, 22.72881873789083329, 62.371455419910489582, 115.93390876935518463, + 26.995482223079307005, 106.90726757643278688, 70.98625824878399726, 25.966859064650634537, + 88.463494197818363318, 47.449424993897991953, 24.335713030424813041, 1.1093702913713059388, + 92.788272947425866732, 42.712213353785045911, 96.884700807837361936, 104.97075226459855912, + 55.451662341609335272, 44.8837169285507116, 74.429122227495099651, 46.195472556162712863, + 65.75512501899356721, 65.58628764672903344, 50.491146280695829773, 93.927304021795862354, + 124.90815491503599333, 63.557677779528603423, 7.7803081682977790479, 93.667699478686699877, + 78.771263431150146062, 104.80514658368338132, 65.301458179961628048, 8.8112910795571224298, + 14.418371916173782665, 25.743795054921065457, 123.30208322391263209, 125.68042190558480797, + 29.575357875124609563, 94.732540362303552683, 87.689375345846201526, 106.78601236519534723, + 108.88309664571352187, 18.233481113253219519, 69.670195579921710305, 21.889642489139077952, + 76.405678248404001351, 10.737461082029767567, 88.498027288616867736, 81.238377338271675399, + 27.215144881243759301, 54.414545948598970426, 97.429255815492069814, 55.735599854451720603, + 33.539357556157483486, 22.336680835174774984, 75.491704031843255507, 116.88962432648986578, + 96.813670726558484603, 65.502506356166122714, 111.34367435406238656, 82.236428533131402219, + 89.766452277675853111, 18.990088644281058805, 36.156413352538947947, 126.33106708128616447, + 114.05875480941904243, 48.735256503630807856, 74.983848033058166038, 76.35778045138795278, + 96.388091104468912818, 46.322902131436421769, 82.656868778576608747, 78.973179013642948121, + 18.426151935334928567, 98.134321468147390988, 36.871848108905396657, 7.6632472467899788171, + 53.498034447475220077, 100.62877598114209832, 117.24248510271354462, 24.488134689418075141, + 30.312840281465469161, 96.849679438775638118, 80.725603612067061476, 65.340811393576586852, + 36.569515980510914233, 106.65778382019198034, 31.903985428434680216, 41.26097466404462466, + 6.1542941551451804116, 116.25957401366758859, 25.588849575116910273, 62.742644993450085167, + 38.57072693710506428, 19.576317961425957037, 56.084457987391942879, 4.6491951454918307718, + 92.437816620848025195, 6.7031882806804787833, 98.78531863916941802, 78.907374231912399409, + 31.491646892325661611, 120.70698861136406776, 118.56915767952159513, 62.255278018074022839, + 1.9733861464883375447, 89.186026484163448913, 84.031137008820223855, 36.669933821569429711, + 54.106637123182736104, 42.38620969896146562, 110.3291893622445059, 109.24471060483483598, + 82.453561618938692845, 46.928189896680123638, 110.63085320401660283, 86.575993432270479389, + 90.3971435543098778, 32.646169130810449133, 9.8497362402667931747, 23.830086857295100344, + 93.752987660453072749, 0.32899410391109995544, 38.390106575618119678, 59.18430324084329186, + 101.06596574267678079, 114.03730641598303919, 12.440886003681953298, 103.48390229951473884, + 86.5078345718793571, 45.285286451795400353, 0.98034708312115981244, 127.71141245610124315, + 6.0869966355785436463, 94.355679291820706567, 61.250244435577769764, 68.932269980865385151, + 46.924002567378920503, 5.0920908887055702507, 54.262507472572906408, 40.114569940491492162, + 40.778987611589400331, 17.19876754736105795, 28.477258166007231921, 16.40576928062364459, + 38.191416644669516245, 54.515046867207274772, 0.7724035708888550289, 37.916372034065716434, + 114.5769547172349121, 53.309397016964794602, 104.26119794768601423, 61.943585057142627193, + 32.872801940542558441, 87.095870007022313075, 96.053462074694834882, 26.786835423292359337, + 25.290768956252577482, 87.977505671635299223, 115.74398610441858182, 6.0628279935444879811, + 24.340516096104693133, 125.05838661322923144, 51.847438182823680108, 26.428993500136130024, + 47.519245672217948595, 85.341877172348176828, 37.757111504448403139, 121.68376820514458814, + 12.071013318458426511, 68.663381781709176721, 102.93772500509294332, 21.216548296029941412, + 25.666808358746493468, 104.08803460317358258, 65.599799613875802606, 123.28541302954181447, + 95.82035975152393803, 86.302588395348720951, 67.964323819145647576, 15.130580325716437073, + 9.4097697586148569826, 26.61487023478912306, 52.176414400404610205, 116.8788338800186466, + 90.521086493572511245, 11.089293390265083872, 95.687221087478974368, 125.07362257176282583, + 42.256288532054895768, 43.453857198335754219, 7.2428009154682513326, 48.761800607586337719, + 54.748516900861432077, 71.612118403860222315, 115.08028365704740281, 62.377050134913588408, + 88.286920320806530071, 70.349730217360047391, 34.002516056414606282, 52.108082349852338666, + 7.2823721211025258526, 92.643321540243050549, 102.68782291269235429, 42.630610122701909859, + 60.300168724024842959, 33.511433211195253534, 67.695758235320681706, 52.58937231223899289, + 40.530706141526025021, 71.734368547797203064, 48.761047890886402456, 26.621876374269049847, + 104.67484422303095926, 23.803319860377087025, 80.744106403457408305, 119.63655759122775635, + 41.443971655640780227, 23.166016815237526316, 71.970222359115723521, 22.160560797372454545, + 47.631999937508226139, 49.169336575050692772, 126.94930450611718697, 41.92695742968498962, + 41.418231901683611795, 22.797568070440320298, 127.28449731189175509, 116.25290961781865917, + 79.770100481808185577, 9.024966652399598388, 54.870269142262259265, 98.174464069510577247, + 6.6982757605146616697, 89.141275914265861502, 49.922716696673887782, 13.27506265066404012, + 119.0066386145153956, 81.290867229618015699, 65.952772044689481845, 27.049124134668090846, + 103.05613060700125061, 59.886500629112561001, 47.014704444532981142, 48.549788157433795277, + 111.45583561704916065, 105.45860923091822769, 66.242622838442912325, 61.248615174288715934, + 31.163826515494292835, 55.886474864302726928, 127.99277728340166504, 123.38089091491565341, + 23.371775350275129313, 107.46258327782561537, 106.06943761183720198, 123.93123193671999616, + 85.265668643354729284, 113.07173503568265005, 94.346397832676302642, 42.101931632299965713, + 25.62313140937112621, 51.832000251841236604, 111.27084675404330483, 34.481408549312618561, + 47.946763075568014756, 24.881705797131871805, 89.271157118339033332, 81.406701661260740366, + 98.267777792148990557, 74.692979720606672345, 57.128275535629654769, 115.52062759079854004, + 69.156981941268895753, 112.71334499638760462, 110.1574296119142673, 105.97515665729588363, + 77.295292752751265652, 33.038181709322088864, 10.986349719336431008, 123.01376250910834642, + 78.196857165668916423, 42.430337275232886896, 108.03664497926729382, 96.206194569065701216, + 22.538018498511519283, 120.5467613748369331, 117.79681669087221962, 29.841897579779470107, + 33.505790140065073501, 51.967190346687857527, 124.60042608430740074, 47.763870634633349255, + 15.711213854945526691, 104.88056998082174687, 70.172391411695571151, 51.059985640124068595, + 123.9144477807203657, 43.340773737771087326, 40.570965978731692303, 38.809903184519498609, + 9.6275478570387349464, 32.416222191597626079, 14.842426778144726995, 62.087107952927908627, + 126.36404614785351441, 124.85072425875114277, 39.695754620661318768, 62.502602560551167699, + 29.219981840335094603, 124.93730155447337893, 36.404227893035567831, 84.370279576865868876, + 45.339493044120899867, 44.762040183326462284, 115.61886934127687709, 61.791045580946956761, + 85.749794231523992494, 82.805318822302069748, 69.757138238532206742, 117.79436402596911648, + 29.53537112057529157, 16.789986983800190501, 17.030101932963589206, 89.000572116841794923, + 9.6333360146309132688, 38.145566873059578938, 66.229567226986546302, 81.300765511172357947, + 52.681847976124117849, 30.522436078208556864, 26.274380832412134623, 66.821093154409027193, + 74.414218163623445434, 39.407364188260544324, 74.594946116776554845, 4.4357875788409728557, + 62.233743644632340875, 10.017464672517235158, 91.33141940577479545, 51.29431077364642988, + 55.877326452522538602, 17.690261473446298623, 33.63481795355619397, 79.318957639639847912, + 9.4405773534926993307, 35.463287367369048297, 13.145985589555493789, 50.011732325365301222, + 79.884470313052588608, 37.279502226585464086, 124.75670094090310158, 82.624060957950860029, + 106.41301737510730163, 37.399643951110192575, 15.947435222322383197, 59.771022268669184996, + 71.282374999485909939, 25.143488416277250508, 73.056626257846801309, 75.072669263587158639, + 4.4215448774702963419, 33.228135826455400093, 34.984161961019708542, 86.224660112045967253, + 19.564635364276909968, 100.62860869671203545, 127.93363642877739039, 114.94178328678026446, + 90.24552041236529476, 73.948279251300846227, 49.981276690799859352, 45.457637475781666581, + 124.74291083982461714, 103.86781753871036926, 53.990964446162251988, 85.814535152869211743, + 13.97251649756799452, 51.933718129304907052, 48.926988395636726636, 94.898849987795983907, + 48.671426060849626083, 2.2187405827462498564, 57.576545894851733465, 85.4244267075737298, + 65.76940161567836185, 81.941504529197118245, 110.90332468321867054, 89.767433857105061179, + 20.858244454990199301, 92.390945112329063704, 3.5102500379907723982, 3.1725752934580668807, + 100.98229256139529753, 59.854608043595362687, 121.81630983007198665, 127.11535555905720685, + 15.560616336599196075, 59.335398957377037732, 29.542526862303930102, 81.610293167370400624, + 2.6029163599232560955, 17.62258215911424486, 28.836743832347565331, 51.487590109845768893, + 118.60416644782890216, 123.36084381116961595, 59.150715750252857106, 61.465080724610743346, + 47.378750691696041031, 85.572024730394332437, 89.766193291427043732, 36.466962226510077016, + 11.34039115984342061, 43.779284978281793883, 24.811356496808002703, 21.474922164063173113, + 48.996054577237373451, 34.476754676543350797, 54.430289762487518601, 108.82909189720157883, + 66.858511630984139629, 111.47119970890344121, 67.078715112314966973, 44.673361670353187947, + 22.983408063690148992, 105.77924865298336954, 65.627341453120607184, 3.0050127123358834069, + 94.68734870812841109, 36.472857066266442416, 51.532904555351706222, 37.98017728856211761, + 72.312826705081533873, 124.66213416257596691, 100.11750961883808486, 97.470513007265253691, + 21.967696066119970055, 24.71556090277954354, 64.776182208937825635, 92.645804262876481516, + 37.313737557156855473, 29.946358027285896242, 36.852303870673495112, 68.268642936294781975, + 73.743696217810793314, 15.326494493579957634, 106.99606889495407813, 73.257551962287834613, + 106.48497020542708924, 48.976269378836150281, 60.625680562934576301, 65.699358877554914216, + 33.451207224137760932, 2.6816227871531737037, 73.139031961025466444, 85.315567640383960679, + 63.807970856869360432, 82.52194932808924932, 12.308588310293998802, 104.51914802733517718, + 51.177699150233820546, 125.48528998690017033, 77.141453874210128561, 39.152635922851914074, + 112.16891597478388576, 9.2983902909872995224, 56.875633241696050391, 13.406376561364595545, + 69.570637278342474019, 29.814748463824798819, 62.9832937846549612, 113.41397722273177351, + 109.13831535904319026, 124.51055603614804568, 3.9467722929803130683, 50.372052968330535805, + 40.06227401764044771, 73.339867643138859421, 108.21327424636547221, 84.772419397926569218, + 92.658378724492649781, 90.489421209673309932, 36.907123237877385691, 93.856379793363885256, + 93.261706408036843641, 45.151986864544596756, 52.7942871086197556, 65.292338261620898265, + 19.699472480533586349, 47.660173714593838667, 59.505975320906145498, 0.65798820782219991088, + 76.780213151236239355, 118.3686064816902217, 74.131931485357199563, 100.07461283196607837, + 24.881772007367544575, 78.967804599033115664, 45.015669143758714199, 90.570572903590800706, + 1.9606941662459576037, 127.4228249122024863, 12.173993271160725271, 60.711358583641413134, + 122.50048887115917751, 9.8645399617307703011, 93.848005134757841006, 10.184181777411140501, + 108.52501494514581282, 80.229139880982984323, 81.557975223178800661, 34.3975350947221159, + 56.954516332014463842, 32.811538561247289181, 76.38283328933903249, 109.03009373441454954, + 1.5448071417777100578, 75.832744068135070847, 101.15390943446982419, 106.61879403393322718, + 80.522395895372028463, 123.88717011428525439, 65.745603881088754861, 46.191740014048264129, + 64.106924149389669765, 53.573670846584718674, 50.581537912508792942, 47.955011343274236424, + 103.48797220883716363, 12.125655987088975962, 48.681032192213024246, 122.11677322645846289, + 103.69487636564736022, 52.857987000272260047, 95.038491344439535169, 42.683754344696353655, + 75.514223008900444256, 115.36753641028917627, 24.142026636920491001, 9.3267635634219914209, + 77.87545001018588664, 42.433096592059882823, 51.333616717496624915, 80.176069206350803142, + 3.1995992277552431915, 118.57082605908726691, 63.640719503051514039, 44.605176790701079881, + 7.9286476382912951522, 30.261160651432874147, 18.819539517229713965, 53.22974046957824612, + 104.35282880081285839, 105.75766776004093117, 53.042172987145022489, 22.178586780533805722, + 63.374442174961586716, 122.14724514352565166, 84.512577064109791536, 86.907714396671508439, + 14.485601830936502665, 97.523601215172675438, 109.49703380172650213, 15.22423680772408261, + 102.16056731409480562, 124.7541002698308148, 48.573840641616698122, 12.699460434720094781, + 68.005032112829212565, 104.21616469970467733, 14.564744242208689684, 57.286643080489739077, + 77.375645825384708587, 85.261220245403819717, 120.60033744804968592, 67.022866422394145047, + 7.3915164706413634121, 105.17874462447798578, 81.061412283055688022, 15.468737095594406128, + 97.522095781772804912, 53.243752748541737674, 81.349688446061918512, 47.606639720757812029, + 33.488212806918454589, 111.2731151824555127, 82.887943311281560455, 46.332033630478690611, + 15.940444718231447041, 44.321121594744909089, 95.263999875016452279, 98.338673150105023524, + 125.89860901223437395, 83.85391485936997924, 82.836463803367223591, 45.595136140884278575, + 126.56899462378714816, 104.50581923564095632, 31.540200963616371155, 18.049933304799196776, + 109.74053828452815651, 68.348928139021154493, 13.396551521032961318, 50.282551828531723004, + 99.845433393347775564, 26.550125301331718219, 110.01327722903442918, 34.581734459239669377, + 3.9055440893789636903, 54.098248269339819672, 78.11226121400250122, 119.773001258225122, + 94.029408889065962285, 97.099576314871228533, 94.911671234101959271, 82.917218461840093369, + 4.4852456768858246505, 122.49723034857743187, 62.32765303098858567, 111.77294972860909184, + 127.98555456680696807, 118.76178182983130682, 46.743550700553896604, 86.925166555654868716, + 84.138875223678041948, 119.86246387344363029, 42.531337286713096546, 98.143470071368938079, + 60.692795665352605283, 84.203863264599931426, 51.246262818742252421, 103.66400050368611119, + 94.541693508086609654, 68.962817098625237122, 95.893526151136029512, 49.763411594267381588, + 50.542314236681704642, 34.81340332252511871, 68.535555584301619092, 21.385959441213344689, + 114.25655107126294752, 103.04125518160071806, 10.313963882541429484, 97.426689992778847227, + 92.314859223832172574, 83.950313314595405245, 26.590585505502531305, 66.076363418644177727, + 21.972699438676499994, 118.02752501822033082, 28.393714331337832846, 84.86067455046941177, + 88.073289958538225619, 64.412389138131402433, 45.076036997026676545, 113.09352274967750418, + 107.59363338174443925, 59.683795159558940213, 67.011580280130147003, 103.93438069337935303, + 121.20085216861480149, 95.527741269266698509, 31.422427709894691361, 81.761139961647131713, + 12.344782823391142301, 102.11997128025177517, 119.8288955614407314, 86.681547475542174652, + 81.141931957463384606, 77.619806369038997218, 19.255095714077469893, 64.832444383195252158, + 29.684853556289453991, 124.17421590585945523, 124.7280922957106668, 121.70144851750228554, + 79.391509241322637536, 125.0052051211023354, 58.439963680673827184, 121.87460310894675786, + 72.808455786074773641, 40.740559153731737752, 90.678986088241799735, 89.524080366656562546, + 103.23773868255375419, 123.5820911618975515, 43.499588463051622966, 37.610637644607777474, + 11.514276477068051463, 107.58872805193823297, 59.070742241150583141, 33.579973967600381002, + 34.060203865930816391, 50.001144233683589846, 19.266672029261826538, 76.291133746122795856, + 4.4591344539767305832, 34.601531022344715893, 105.3636959522482357, 61.044872156417113729, + 52.548761664827907225, 5.6421863088216923643, 20.828436327246890869, 78.814728376524726627, + 21.189892233553109691, 8.8715751576819457114, 124.46748728926468175, 20.034929345038108295, + 54.662838811549590901, 102.58862154729285976, 111.7546529050450772, 35.380522946892597247, + 67.269635907116025919, 30.637915279279695824, 18.881154706985398661, 70.926574734738096595, + 26.291971179110987578, 100.02346465073424042, 31.768940626105177216, 74.559004453170928173, + 121.51340188180984114, 37.248121915905358037, 84.826034750214603264, 74.799287902220385149, + 31.894870444644766394, 119.54204453734200797, 14.564749998971819878, 50.286976832558138995, + 18.113252515697240597, 22.145338527174317278, 8.8430897549405926839, 66.456271652910800185, + 69.968323922043055063, 44.449320224091934506, 39.129270728557457915, 73.257217393427708885, + 127.86727285755841876, 101.8835665735641669, 52.491040824734227499, 19.896558502601692453, + 99.962553381599718705, 90.91527495156697114, 121.48582167965287226, 79.735635077420738526, + 107.98192889232814196, 43.629070305738423485, 27.94503299513598904, 103.8674362586098141, + 97.853976791277091252, 61.797699975591967814, 97.342852121699252166, 4.4374811654924997129, + 115.15309178970710491, 42.848853415151097579, 3.5388032313603616785, 35.883009058397874469, + 93.806649366440979065, 51.534867714210122358, 41.716488909984036582, 56.781890224658127408, + 7.0205000759815447964, 6.3451505869197717402, 73.964585122790595051, 119.70921608719436335, + 115.63261966014761128, 126.23071111811441369, 31.121232673198392149, 118.67079791475407546, + 59.085053724611498183, 35.220586334740801249, 5.205832719846512191, 35.245164318228489719, + 57.673487664695130661, 102.97518021969517577, 109.20833289566144231, 118.72168762233923189, + 118.30143150050571421, 122.93016144922148669, 94.75750138339572004, 43.144049460792302852, + 51.532386582854087465, 72.933924453020154033, 22.68078231968684122, 87.558569956563587766, + 49.622712993616005406, 42.949844328126346227, 97.992109154474746902, 68.953509353086701594, + 108.86057952497867518, 89.658183794406795641, 5.7170232619719172362, 94.94239941781052039, + 6.1574302246299339458, 89.346723340706375893, 45.966816127383935964, 83.558497305970377056, + 3.2546829062412143685, 6.0100254246754047927, 61.37469741625682218, 72.945714132532884832, + 103.06580911070341244, 75.960354577127873199, 16.625653410166705726, 121.3242683251555718, + 72.235019237679807702, 66.941026014530507382, 43.935392132239940111, 49.431121805562725058, + 1.552364417879289249, 57.291608525752963033, 74.627475114313710947, 59.892716054571792483, + 73.704607741350628203, 8.5372858725932019297, 19.487392435621586628, 30.652988987163553247, + 85.992137789911794243, 18.515103924579307204, 84.969940410854178481, 97.952538757672300562, + 121.25136112587279058, 3.3987177551098284312, 66.902414448275521863, 5.3632455743099853862, + 18.278063922054570867, 42.631135280767921358, 127.61594171374235884, 37.043898656178498641, + 24.617176620591635583, 81.038296054670354351, 102.35539830047127907, 122.97057997380397865, + 26.282907748420257121, 78.305271845707466127, 96.337831949567771517, 18.596780581974599045, + 113.75126648339210078, 26.81275312273282907, 11.141274556684948038, 59.629496927649597637, + 125.96658756931356038, 98.827954445467184996, 90.27663071809001849, 121.02111207229609136, + 7.8935445859606261365, 100.74410593666107161, 80.124548035284533398, 18.679735286281356821, + 88.426548492734582396, 41.544838795856776414, 57.31675744898893754, 52.978842419346619863, + 73.81424647575840936, 59.71275958673140849, 58.523412816073687281, 90.303973729089193512, + 105.58857421724314918, 2.5846765232417965308, 39.398944961067172699, 95.320347429187677335, + 119.011950641812291, 1.3159764156480378006, 25.560426302476116689, 108.73721296338408138, + 20.263862970718037104, 72.149225663932156749, 49.763544014738727128, 29.935609198066231329, + 90.031338287521066377, 53.141145807181601413, 3.9213883324955531862, 126.84564982440497261, + 24.347986542321450543, 121.42271716728646425, 117.00097774231835501, 19.729079923465178581, + 59.696010269515682012, 20.368363554825918982, 89.050029890295263613, 32.458279761969606625, + 35.115950446357601322, 68.795070189444231801, 113.90903266402892768, 65.62307712249821634, + 24.765666578681702958, 90.060187468829099089, 3.0896142835590580944, 23.665488136273779674, + 74.307818868943286361, 85.237588067870092345, 33.044791790747694904, 119.77434022857414675, + 3.4912077621775097214, 92.383480028100166237, 0.21384829877933952957, 107.14734169316943735, + 101.16307582501758588, 95.910022686552110827, 78.975944417674327269, 24.251311974177951925, + 97.36206438442968647, 116.23354645292056375, 79.389752731294720434, 105.71597400054815807, + 62.076982688879070338, 85.367508689396345289, 23.028446017804526491, 102.73507282057835255, + 48.284053273840982001, 18.653527126847620821, 27.75090002037177328, 84.866193184119765647, + 102.66723343499688781, 32.352138412701606285, 6.3991984555141243618, 109.14165211817453383, + 127.28143900610302808, 89.210353581402159762, 15.857295276582590304, 60.522321302865748294, + 37.63907903445942793, 106.45948093916013022, 80.705657601629354758, 83.515335520081862342, + 106.08434597429004498, 44.357173561067611445, 126.74888434992681141, 116.29449028705494129, + 41.025154128223221051, 45.815428793343016878, 28.971203661876643309, 67.047202430348988855, + 90.994067603453004267, 30.448473615451803198, 76.321134628193249227, 121.50820053966162959, + 97.147681283233396243, 25.398920869443827542, 8.0100642256620631088, 80.432329399409354664, + 29.129488484417379368, 114.57328616098311613, 26.751291650773055153, 42.522440490811277414, + 113.20067489610300981, 6.0457328447882900946, 14.783032941286364803, 82.35748924895960954, + 34.122824566111376043, 30.937474191192450235, 67.044191563545609824, 106.48750549708711333, + 34.699376892123837024, 95.213279441515624058, 66.976425613840547157, 94.546230364914663369, + 37.775886622563120909, 92.664067260957381222, 31.880889436462894082, 88.642243189493456157, + 62.527999750036542537, 68.677346300213685026, 123.79721802447238588, 39.707829718743596459, + 37.672927606734447181, 91.190272281772195129, 125.13798924757793429, 81.011638471281912643, + 63.08040192723274231, 36.099866609602031531, 91.481076569059950998, 8.6978562780423089862, + 26.793103042065922637, 100.56510365706708399, 71.690866786695551127, 53.100250602667074418, + 92.026554458068858366, 69.163468918479338754, 7.8110881787579273805, 108.19649653868327732, + 28.224522428008640418, 111.54600251645388198, 60.058817778135562548, 66.199152629746095045, + 61.823342468207556522, 37.834436923680186737, 8.9704913537752872799, 116.99446069715486374, + 124.65530606198080932, 95.545899457221821649, 127.97110913361757412, 109.52356365966261365, + 93.487101401111431187, 45.850333111313375412, 40.277750447359721875, 111.72492774688726058, + 85.062674573429831071, 68.286940142737876158, 121.38559133070884855, 40.407726529199862853, + 102.49252563748814282, 79.328001007375860354, 61.083387016176857287, 9.9256341972541122232, + 63.787052302272059023, 99.526823188534763176, 101.08462847336340928, 69.6268066450538754, + 9.071111168603238184, 42.771918882430327358, 100.51310214252953301, 78.082510363201436121, + 20.627927765086496947, 66.853379985561332433, 56.629718447667983128, 39.90062662919081049, + 53.181171011008700589, 4.1527268372883554548, 43.945398877356637968, 108.05505003644066164, + 56.78742866267930367, 41.721349100942461519, 48.146579917080089217, 0.82477827626280486584, + 90.152073994056991069, 98.187045499358646339, 87.187266763488878496, 119.36759031912151841, + 6.0231605602639319841, 79.868761386762344046, 114.40170433723324095, 63.055482538533397019, + 62.844855419793020701, 35.522279923294263426, 24.689565646785922581, 76.239942560507188318, + 111.65779112288510078, 45.363094951087987283, 34.283863914930407191, 27.239612738077994436, + 38.510191428158577764, 1.6648887663905043155, 59.36970711258254596, 120.34843181172254845, + 121.45618459142497159, 115.40289703500820906, 30.78301848264891305, 122.01041024220467079, + 116.87992736135129235, 115.74920621789715369, 17.616911572149547283, 81.481118307467113482, + 53.357972176487237448, 51.048160733316763071, 78.475477365111146355, 119.164182323795103, + 86.999176926103245933, 75.221275289215554949, 23.028552954139740905, 87.177456103876465932, + 118.14148448230116628, 67.159947935200762004, 68.120407731861632783, 100.00228846736717969, + 38.533344058527291054, 24.582267492245591711, 8.9182689079534611665, 69.203062044693069765, + 82.727391904496471398, 122.08974431283422746, 105.09752332965581445, 11.284372617643384729, + 41.656872654497419717, 29.629456753049453255, 42.379784467106219381, 17.743150315367529402, + 120.9349745785293635, 40.06985869007621659, 109.32567762310281978, 77.177243094589357497, + 95.509305810090154409, 70.761045893788832473, 6.5392718142320518382, 61.275830558559391648, + 37.762309413974435301, 13.85314946947619319, 52.583942358225613134, 72.046929301468480844, + 63.537881252213992411, 21.118008906345494324, 115.02680376361968229, 74.496243831814354053, + 41.652069500432844507, 21.598575804440770298, 63.789740889293170767, 111.08408907468401594, + 29.129499997943639755, 100.57395366511627799, 36.226505031394481193, 44.290677054348634556, + 17.686179509884823347, 4.9125433058252383489, 11.936647844086110126, 88.898640448183869012, + 78.258541457118553808, 18.514434786859055748, 127.73454571512047551, 75.767133147128333803, + 104.982081649468455, 39.793117005207022885, 71.925106763203075388, 53.830549903137580259, + 114.9716433593093825, 31.47127015484511503, 87.963857784656283911, 87.258140611476846971, + 55.890065990275616059, 79.734872517223266186, 67.707953582554182503, 123.59539995118757361, + 66.685704243398504332, 8.8749623309886374045, 102.30618357941420982, 85.697706830302195158, + 7.0776064627207233571, 71.766018116799386917, 59.613298732881958131, 103.06973542842024472, + 83.432977819968073163, 113.56378044931625482, 14.041000151963089593, 12.690301173843181459, + 19.929170245584828081, 111.41843217439236469, 103.26523932029886055, 124.46142223622882739, + 62.242465346400422277, 109.34159582950815093, 118.17010744922299637, 70.441172669481602497, + 10.411665439693024382, 70.490328636456979439, 115.3469753293938993, 77.950360439393989509, + 90.416665791326522594, 109.44337524468210177, 108.6028630010150664, 117.86032289844661136, + 61.515002766791440081, 86.288098921584605705, 103.06477316571181291, 17.867848906040308066, + 45.361564639377320418, 47.117139913127175532, 99.245425987232010812, 85.899688656256330432, + 67.984218308953131782, 9.9070187061770411674, 89.721159049960988341, 51.316367588813591283, + 11.434046523947472451, 61.88479883562104078, 12.31486044926350587, 50.693446681412751786, + 91.933632254771509906, 39.116994611940754112, 6.509365812482428737, 12.020050849350809585, + 122.74939483251728234, 17.891428265069407644, 78.131618221410462866, 23.920709154255746398, + 33.25130682033704943, 114.64853665031478158, 16.470038475363253383, 5.882052029061014764, + 87.870784264479880221, 98.862243611125450116, 3.1047288357585784979, 114.58321705150956404, + 21.254950228627421893, 119.78543210914722295, 19.409215482701256406, 17.074571745186403859, + 38.974784871243173257, 61.305977974330744473, 43.984275579823588487, 37.030207849162252387, + 41.93988082171199494, 67.905077515348239103, 114.50272225174558116, 6.7974355102232948411, + 5.8048288965510437265, 10.726491148619970772, 36.556127844109141733, 85.262270561539480696, + 127.23188342748471769, 74.087797312356997281, 49.234353241186909145, 34.076592109344346682, + 76.710796600946196122, 117.94115994760795729, 52.565815496844152221, 28.610543691418570234, + 64.675663899135543033, 37.193561163952836068, 99.502532966784201562, 53.625506245465658139, + 22.282549113369896077, 119.25899385530283325, 123.93317513863075874, 69.655908890938007971, + 52.553261436183674959, 114.04222414459218271, 15.787089171924890252, 73.488211873325781198, + 32.249096070569066796, 37.35947057256635162, 48.853096985469164792, 83.089677591713552829, + 114.63351489797787508, 105.9576848386968777, 19.628492951516818721, 119.42551917346281698, + 117.04682563215101254, 52.607947458182025002, 83.177148434486298356, 5.1693530464835930616, + 78.797889922137983376, 62.640694858378992649, 110.02390128362458199, 2.6319528312960756011, + 51.120852604955871357, 89.474425926768162753, 40.527725941439712187, 16.298451327864313498, + 99.527088029477454256, 59.871218396136100637, 52.062676575042132754, 106.28229161436320283, + 7.8427766649947443511, 125.69129964880994521, 48.695973084646539064, 114.84543433457656647, + 106.00195548463671003, 39.458159846930357162, 119.39202053903136402, 40.736727109655475942, + 50.100059780590527225, 64.91655952393921325, 70.231900892718840623, 9.5901403788921015803, + 99.818065328061493346, 3.2461542449964326806, 49.531333157367043896, 52.120374937658198178, + 6.1792285671181161888, 47.330976272551197326, 20.615637737890210701, 42.475176135740184691, + 66.089583581499027787, 111.5486804571482935, 6.9824155243586574215, 56.766960056200332474, + 0.42769659756231703795, 86.294683386342512676, 74.326151650038809748, 63.820045373107859632, + 29.951888835348654538, 48.502623948359541828, 66.724128768863010919, 104.46709290584476548, + 30.779505462593078846, 83.431948001096316148, 124.15396537776177865, 42.735017378792690579, + 46.056892035612690961, 77.470145641156705096, 96.568106547681964003, 37.307054253695241641, + 55.501800040747184539, 41.732386368243169272, 77.334466869993775617, 64.70427682540321257, + 12.798396911031886702, 90.28330423635270563, 126.56287801220969413, 50.420707162804319523, + 31.714590553165180609, 121.04464260573149659, 75.27815806892249384, 84.918961878323898418, + 33.411315203262347495, 39.030671040167362662, 84.168691948580089957, 88.714347122138860868, + 125.4977686998572608, 104.58898057410988258, 82.050308256446442101, 91.630857586686033756, + 57.942407323756924598, 6.0944048607016156893, 53.988135206906008534, 60.896947230907244375, + 24.642269256390136434, 115.01640107932689716, 66.295362566466792487, 50.797841738887655083, + 16.020128451327764196, 32.864658798818709329, 58.258976968838396715, 101.14657232196623227, + 53.502583301546110306, 85.044880981626192806, 98.401349792206019629, 12.091465689576580189, + 29.566065882576367585, 36.71497849791921908, 68.245649132222752087, 61.874948382388538448, + 6.0883831270948576275, 84.975010994174226653, 69.398753784251312027, 62.426558883034886094, + 5.9528512276847322937, 61.092460729829326738, 75.551773245129879797, 57.328134521914762445, + 63.761778872929426143, 49.284486378986912314, 125.05599950007672305, 9.3546926004310080316, + 119.59443604894477176, 79.415659437487192918, 75.345855213472532341, 54.380544563548028236, + 122.27597849515950656, 34.023276942563825287, 126.16080385446548462, 72.19973321920770104, + 54.962153138119901996, 17.395712556084617972, 53.586206084135483252, 73.130207314137805952, + 15.381733573391102254, 106.20050120533778681, 56.053108916141354712, 10.326937836958677508, + 15.62217635751949274, 88.392993077366554644, 56.449044856020918814, 95.092005032907763962, + 120.11763555627476308, 4.3983052594921900891, 123.64668493641511304, 75.668873847360373475, + 17.940982707554212539, 105.98892139431336545, 121.31061212396525661, 63.091798914447281277, + 127.94221826723878621, 91.047127319328865269, 58.974202802222862374, 91.700666222626750823, + 80.555500894723081728, 95.449855493778159143, 42.12534914686330012, 8.5738802854793902952, + 114.77118266141769709, 80.815453058403363684, 76.985051274979923619, 30.656002014751720708, + 122.16677403235371457, 19.851268394508224446, 127.57410460454775603, 71.053646377073164331, + 74.169256946730456548, 11.2536132901077508, 18.142222337206476368, 85.543837764864292694, + 73.026204285062704002, 28.165020726402872242, 41.255855530176631873, 5.7067599711226648651, + 113.25943689533596626, 79.801253258381620981, 106.36234202201740118, 8.3054536745767109096, + 87.890797754716913914, 88.110100072881323285, 113.57485732535860734, 83.442698201884923037, + 96.293159834160178434, 1.6495565525292477105, 52.304147988117620116, 68.374090998720930656, + 46.374533526981394971, 110.73518063824303681, 12.046321120531501947, 31.73752277352832607, + 100.8034086744664819, 126.11096507706679404, 125.6897108395860414, 71.044559846588526852, + 49.379131293575483141, 24.479885121018014615, 95.315582245770201553, 90.726189902175974566, + 68.567727829860814381, 54.479225476155988872, 77.020382856317155529, 3.329777532781008631, + 118.7394142251687299, 112.69686362344873487, 114.91236918285358115, 102.80579407001641812, + 61.566036965301464079, 116.02082048441297957, 105.75985472270622267, 103.49841243579430738, + 35.233823144302732544, 34.962236614934226964, 106.7159443529744749, 102.09632146663716412, + 28.950954730225930689, 110.32836464759384398, 45.998353852210129844, 22.442550578431109898, + 46.057105908283119788, 46.354912207756569842, 108.28296896460597054, 6.3198958704051619861, + 8.2408154637269035447, 72.004576934734359384, 77.066688117054582108, 49.164534984491183423, + 17.836537815910560312, 10.406124089389777509, 37.454783808996580774, 116.17948862567209289, + 82.1950466593116289, 22.568745235286769457, 83.313745308994839434, 59.25891350609890651, + 84.759568934212438762, 35.486300630738696782, 113.869949157058727, 80.139717380156071158, + 90.651355246209277539, 26.354486189182352973, 63.018611620183946798, 13.522091787577664945, + 13.078543628464103676, 122.5516611171187833, 75.524618827948870603, 27.706298938952386379, + 105.16788471645486425, 16.093858602936961688, 127.07576250442798482, 42.236017812694626627, + 102.05360752724300255, 20.992487663628708106, 83.304139000865689013, 43.197151608881540596, + 127.57948177858997951, 94.168178149368031882, 58.258999995890917489, 73.147907330232555978, + 72.453010062788962387, 88.581354108697269112, 35.372359019769646693, 9.8250866116504766978, + 23.873295688175858231, 49.797280896371376002, 28.517082914237107616, 37.028869573721749475, + 127.46909143024458899, 23.534266294260305585, 81.964163298936909996, 79.586234010417683749, + 15.850213526406150777, 107.6610998062787985, 101.94328671861876501, 62.942540309693868039, + 47.927715569316205801, 46.516281222953693941, 111.7801319805548701, 31.469745034450170351, + 7.4159071651120029856, 119.19079990237878519, 5.3714084867970086634, 17.749924661980912788, + 76.612367158832057612, 43.395413660604390316, 14.155212925445084693, 15.532036233598773833, + 119.22659746576755424, 78.139470856844127411, 38.865955639939784305, 99.127560898632509634, + 28.082000303926179186, 25.380602347686362918, 39.85834049117329414, 94.836864348788367352, + 78.530478640601359075, 120.92284447245765477, 124.48493069280448253, 90.683191659019939834, + 108.34021489844963071, 12.882345338963204995, 20.823330879389686743, 12.980657272917596856, + 102.69395065879143658, 27.900720878791616997, 52.833331582656683167, 90.88675048936784151, + 89.205726002033770783, 107.72064579689322272, 123.03000553358651814, 44.576197843172849389, + 78.129546331423625816, 35.735697812080616131, 90.723129278754640836, 94.234279826257989043, + 70.490851974467659602, 43.799377312516298844, 7.9684366179062635638, 19.814037412357720314, + 51.442318099921976682, 102.63273517762718257, 22.868093047894944903, 123.76959767124208156, + 24.629720898527011741, 101.38689336282914155, 55.867264509543019813, 78.233989223881508224, + 13.018731624964857474, 24.040101698705257149, 117.49878966503456468, 35.782856530142453266, + 28.263236442820925731, 47.841418308511492796, 66.502613640677736839, 101.29707330062956316, + 32.940076950726506766, 11.764104058125667507, 47.741568528963398421, 69.724487222250900231, + 6.2094576715207949746, 101.16643410301912809, 42.509900457258481765, 111.57086421829444589, + 38.818430965402512811, 34.149143490372807719, 77.949569742486346513, 122.61195594866148895, + 87.968551159647176974, 74.060415698324504774, 83.87976164342762786, 7.8101550307001161855, + 101.00544450349116232, 13.594871020446589682, 11.609657793102087453, 21.452982297239941545, + 73.112255688221921446, 42.52454112308259937, 126.46376685497307335, 20.175594624713994563, + 98.468706482373818289, 68.153184218692331342, 25.421593201896030223, 107.88231989521591458, + 105.13163099368830444, 57.221087382840778446, 1.351327798271086067, 74.387122327909310116, + 71.005065933568403125, 107.25101249093131628, 44.565098226743430132, 110.51798771060930449, + 119.86635027726515546, 11.311817781876015943, 105.1065228723709879, 100.08444828918436542, + 31.574178343853418482, 18.976423746651562396, 64.498192141138133593, 74.718941145132703241, + 97.706193970941967564, 38.179355183430743637, 101.26702979595938814, 83.91536967739375541, + 39.256985903037275421, 110.85103834692927194, 106.09365126430202508, 105.21589491636768798, + 38.354296868972596712, 10.338706092970824102, 29.595779844275966752, 125.28138971676162328, + 92.047802567249163985, 5.2639056625921512023, 102.24170520991538069, 50.948851853536325507, + 81.055451882879424375, 32.596902655732264975, 71.054176058954908513, 119.74243679227220127, + 104.12535315008790349, 84.56458322872640565, 15.685553329993126681, 123.38259929761989042, + 97.391946169296716107, 101.69086866915677092, 84.003910969273420051, 78.916319693864352303, + 110.78404107806272805, 81.473454219310951885, 100.20011956118469243, 1.8331190478820644785, + 12.463801785437681247, 19.180280757787841139, 71.636130656122986693, 6.4923084899928653613, + 99.062666314734087791, 104.24074987531639636, 12.358457134236232378, 94.661952545102394652, + 41.231275475780421402, 84.95035227148400736, 4.1791671630016935524, 95.097360914296586998, + 13.964831048717314843, 113.53392011240066495, 0.85539319512827205472, 44.589366772688663332, + 20.652303300077619497, 127.64009074621571926, 59.903777670697309077, 97.005247896722721634, + 5.4482575377296598163, 80.934185811689530965, 61.559010925189795671, 38.863896002196270274, + 120.30793075552355731, 85.470034757585381158, 92.113784071229019901, 26.940291282317048172, + 65.136213095363928005, 74.614108507390483283, 111.00360008149436908, 83.464772736489976523, + 26.668933739991189213, 1.4085536508064251393, 25.596793822067411384, 52.566608472709049238, + 125.12575602441938827, 100.84141432560863905, 63.429181106333999196, 114.08928521146663115, + 22.556316137848625658, 41.837923756647796836, 66.82263040652469499, 78.061342080338363303, + 40.337383897163817892, 49.428694244281359715, 122.99553739971815958, 81.177961148223403143, + 36.100616512896522181, 55.261715173372067511, 115.8848146475138492, 12.188809721403231379, + 107.97627041381201707, 121.79389446181448875, 49.284538512783910846, 102.0328021586574323, + 4.5907251329335849732, 101.59568347777531017, 32.040256902655528393, 65.729317597637418658, + 116.51795393768043141, 74.293144643932464533, 107.00516660309585859, 42.089761963256023591, + 68.802699584412039258, 24.182931379153160378, 59.13213176515273517, 73.42995699584207614, + 8.4912982644455041736, 123.7498967647770769, 12.176766254193353234, 41.950021988352091284, + 10.797507568502624054, 124.85311776606977219, 11.905702455369464587, 122.18492145966229145, + 23.103546490259759594, 114.65626904382952489, 127.52355774585885229, 98.568972757977462607, + 122.1119990001534461, 18.709385200865654042, 111.18887209789318149, 30.831318874978023814, + 22.691710426945064683, 108.76108912709969445, 116.55195699031901313, 68.046553885131288553, + 124.32160770893460722, 16.399466438415402081, 109.92430627623980399, 34.791425112169235945, + 107.17241216827460448, 18.260414628275611904, 30.763467146785842488, 84.401002410675573628, + 112.10621783228270942, 20.653875673917355016, 31.244352715042623458, 48.785986154733109288, + 112.89808971204547561, 62.184010065819165902, 112.23527111254952615, 8.796610518988018157, + 119.29336987283386406, 23.337747694720746949, 35.881965415112063056, 83.977842788630368887, + 114.62122424793051323, 126.18359782889820053, 127.8844365344812104, 54.094254638657730538, + 117.94840560444936273, 55.401332445257139625, 33.111001789449801436, 62.899710987556318287, + 84.250698293726600241, 17.147760570962418569, 101.54236532283903216, 33.630906116810365347, + 25.970102549959847238, 61.312004029507079395, 116.33354806470742915, 39.702536789020086871, + 127.14820920909915003, 14.10729275414996664, 20.338513893460913096, 22.507226580215501599, + 36.284444674416590715, 43.087675529732223367, 18.052408570125408005, 56.330041452805744484, + 82.511711060353263747, 11.413519942248967709, 98.51887379067557049, 31.60250651676687994, + 84.724684044034802355, 16.610907349157059798, 47.781595509437465807, 48.22020014576628455, + 99.14971465072085266, 38.885396403773484053, 64.586319668320356868, 3.299113105058495421, + 104.60829597623887821, 8.7481819974418613128, 92.74906705396642792, 93.470361276486073621, + 24.092642241063003894, 63.475045547060290119, 73.606817348936601775, 124.22193015413722605, + 123.37942167917572078, 14.089119693177053705, 98.758262587150966283, 48.95977024203966721, + 62.631164491544041084, 53.452379804355587112, 9.1354556597216287628, 108.95845095231561572, + 26.040765712634311058, 6.6595550655656552408, 109.47882845034109778, 97.393727246901107719, + 101.82473836571080028, 77.611588140032836236, 123.13207393060656614, 104.04164096882959711, + 83.519709445416083327, 78.996824871588614769, 70.467646288605465088, 69.924473229872091906, + 85.43188870595258777, 76.192642933274328243, 57.901909460455499357, 92.656729295187687967, + 91.996707704420259688, 44.885101156862219796, 92.114211816566239577, 92.709824415516777663, + 88.565937929211941082, 12.639791740810323972, 16.481630927457445068, 16.009153869472356746, + 26.133376234109164216, 98.329069968982366845, 35.673075631821120623, 20.812248178779555019, + 74.909567617996799527, 104.35897725134782377, 36.390093318623257801, 45.137490470577176893, + 38.627490617989678867, 118.517827012201451, 41.519137868424877524, 70.972601261481031543, + 99.739898314121091971, 32.279434760315780295, 53.302710492418555077, 52.708972378364705946, + 126.0372232403678936, 27.044183575155329891, 26.157087256931845332, 117.10332223424120457, + 23.049237655897741206, 55.412597877908410737, 82.335769432909728494, 32.187717205877561355, + 126.15152500885596965, 84.472035625392891234, 76.107215054486005101, 41.98497532726105419, + 38.608278001731378026, 86.394303217766719172, 127.158963557183597, 60.336356298736063763, + 116.51799999178547296, 18.295814660468749935, 16.906020125581562752, 49.162708217394538224, + 70.744718039539293386, 19.650173223300953396, 47.746591376351716463, 99.594561792742752004, + 57.034165828474215232, 74.057739147447136929, 126.93818286048917798, 47.068532588524249149, + 35.928326597877457971, 31.172468020835367497, 31.700427052815939533, 87.322199612561234972, + 75.886573437237530015, 125.88508061938773608, 95.855431138632411603, 93.032562445911025861, + 95.560263961109740194, 62.939490068900340702, 14.83181433022764395, 110.38159980475757038, + 10.742816973594017327, 35.499849323965463554, 25.224734317664115224, 86.790827321208780631, + 28.310425850890169386, 31.064072467201185646, 110.45319493153874646, 28.278941713688254822, + 77.731911279883206589, 70.255121797265019268, 56.164000607852358371, 50.761204695372725837, + 79.716680982350226259, 61.673728697580372682, 29.060957281206356129, 113.84568894491894753, + 120.96986138561260304, 53.366383318043517647, 88.680429796899261419, 25.76469067792640999, + 41.646661758779373486, 25.961314545838831691, 77.387901317582873162, 55.801441757583233994, + 105.66666316531700431, 53.773500978739320999, 50.411452004071179545, 87.441291593790083425, + 118.06001106717303628, 89.152395686349336756, 28.259092662847251631, 71.471395624164870242, + 53.446258557512919651, 60.468559652519616066, 12.981703948935319204, 87.598754625032597687, + 15.936873235812527128, 39.628074824715440627, 102.88463619984759134, 77.265470355254365131, + 45.736186095793527784, 119.53919534248416312, 49.259441797057661461, 74.773786725658283103, + 111.7345290190896776, 28.467978447763016447, 26.037463249929714948, 48.080203397414152278, + 106.99757933006912936, 71.565713060284906533, 56.526472885641851462, 95.682836617026623571, + 5.0052272813591116574, 74.594146601259126328, 65.880153901453013532, 23.528208116251335014, + 95.483137057930434821, 11.448974444501800463, 12.418915343045227928, 74.332868206038256176, + 85.019800914520601509, 95.141728436588891782, 77.636861930805025622, 68.298286980749253416, + 27.899139484976331005, 117.22391189732661587, 47.937102319297991926, 20.120831396652647527, + 39.759523286855255719, 15.62031006140387035, 74.010889006982324645, 27.189742040893179365, + 23.219315586204174906, 42.905964594483521068, 18.224511376443842892, 85.049082246168836718, + 124.9275337099461467, 40.351189249431627104, 68.937412964751274558, 8.3063684373846626841, + 50.843186403795698425, 87.764639790435467148, 82.263261987376608886, 114.44217476568155689, + 2.7026555965458101127, 20.77424465582225821, 14.010131867140444228, 86.502024981862632558, + 89.130196453490498243, 93.03597542122224695, 111.73270055453031091, 22.623635563755669864, + 82.213045744745613774, 72.168896578368730843, 63.148356687706836965, 37.952847493306762772, + 0.99638428227990516461, 21.437882290269044461, 67.412387941883935127, 76.358710366865125252, + 74.534059591922414256, 39.83073935478751082, 78.51397180607818882, 93.702076693862181855, + 84.187302528607688146, 82.431789832735375967, 76.708593737945193425, 20.677412185941648204, + 59.191559688555571483, 122.56277943352688453, 56.095605134498327971, 10.527811325187940383, + 76.483410419830761384, 101.89770370707628899, 34.110903765758848749, 65.193805311468167929, + 14.108352117913455004, 111.48487358454804053, 80.250706300179444952, 41.129166457452811301, + 31.371106659989891341, 118.76519859524341882, 66.783892338597070193, 75.38173733831717982, + 40.00782193855047808, 29.832639387732342584, 93.568082156129094074, 34.946908438625541748, + 72.400239122369384859, 3.6662380957641289569, 24.927603570875362493, 38.360561515579320258, + 15.272261312245973386, 12.984616979989368701, 70.125332629471813561, 80.481499750632792711, + 24.716914268476102734, 61.323905090204789303, 82.462550951564480783, 41.900704542968014721, + 8.3583343260070250835, 62.194721828593173996, 27.929662097438267665, 99.067840224801329896, + 1.7107863902565441094, 89.178733545377326664, 41.304606600158876972, 127.28018149243143853, + 119.80755534139825613, 66.010495793445443269, 10.896515075462957611, 33.86837162337906193, + 123.11802185037959134, 77.727792004396178527, 112.6158615110507526, 42.940069515174400294, + 56.227568142458039802, 53.880582564637734322, 2.272426190731493989, 21.228217014784604544, + 94.007200162992376136, 38.929545472979953047, 53.337867479982378427, 2.8171073016128502786, + 51.193587644134822767, 105.13321694542173645, 122.25151204884241452, 73.682828651217278093, + 126.85836221267163637, 100.17857042293326231, 45.112632275697251316, 83.67584751329923165, + 5.6452608130530279595, 28.122684160676726606, 80.674767794327635784, 98.85738848856635741, + 117.99107479943995713, 34.355922296446806286, 72.201233025793044362, 110.523430346747773, + 103.76962929502769839, 24.377619442810100736, 87.952540827627672115, 115.5877889236289775, + 98.569077025571459671, 76.065604317314864602, 9.1814502658708079252, 75.191366955550620332, + 64.080513805314694764, 3.4586351952784752939, 105.0359078753645008, 20.586289287868567044, + 86.010333206191717181, 84.179523926515685162, 9.6053991688240785152, 48.365862758306320757, + 118.26426353030910832, 18.859913991684152279, 16.982596528894646326, 119.49979352955415379, + 24.353532508386706468, 83.900043976704182569, 21.595015137008886086, 121.70623553213954438, + 23.811404910742567154, 116.36984291932458291, 46.207092980523157166, 101.31253808766268776, + 127.04711549172134255, 69.137945515958563192, 116.22399800030689221, 37.418770401734946063, + 94.37774419578636298, 61.662637749956047628, 45.383420853893767344, 89.522178254203026881, + 105.10391398064166424, 8.0931077702662150841, 120.64321541786921443, 32.798932876834442141, + 91.848612552479607984, 69.582850224342109868, 86.344824336549208965, 36.520829256551223807, + 61.526934293575322954, 40.802004821354785236, 96.212435664565418847, 41.307751347834710032, + 62.488705430085246917, 97.571972309469856555, 97.796179424090951215, 124.36802013164196978, + 96.470542225099052303, 17.593221037979674293, 110.58673974566772813, 46.675495389441493899, + 71.763930830227764091, 39.955685577264375752, 101.24244849586466444, 124.36719565780003904, + 127.7688730689624208, 108.18850927731909906, 107.89681120889872545, 110.80266489051427925, + 66.222003578899602871, 125.79942197511627455, 40.501396587453200482, 34.295521141928475117, + 75.08473064567806432, 67.261812233620730694, 51.940205099919694476, 122.62400805901779677, + 104.6670961294148583, 79.405073578043811722, 126.29641841819830006, 28.214585508299933281, + 40.677027786921826191, 45.014453160431003198, 72.56888934883318143, 86.175351059464446735, + 36.10481714025081601, 112.66008290561512695, 37.023422120706527494, 22.827039884501573397, + 69.03774758135114098, 63.20501303353739786, 41.44936808806960471, 33.221814698314119596, + 95.563191018874931615, 96.440400291536207078, 70.29942930144170532, 77.770792807550606085, + 1.1726393366407137364, 6.5982262101206288207, 81.216591952477756422, 17.496363994887360604, + 57.49813410793649382, 58.940722552972147241, 48.185284482126007788, 126.95009109412421822, + 19.213634697876841528, 120.44386030827809009, 118.75884335835144157, 28.178239386357745389, + 69.516525174301932566, 97.919540484079334419, 125.26232898308808217, 106.90475960871117422, + 18.270911319446895504, 89.916901904631231446, 52.081531425268622115, 13.31911013113494846, + 90.957656900685833534, 66.787454493805853417, 75.64947673142523854, 27.223176280069310451, + 118.26414786121677025, 80.083281937662832206, 39.039418890835804632, 29.993649743180867517, + 12.935292577214568155, 11.848946459747821791, 42.863777411908813519, 24.385285866548656486, + 115.80381892091463669, 57.313458590379013913, 55.993415408840519376, 89.77020231372807757, + 56.228423633136117132, 57.419648831037193304, 49.131875858423882164, 25.279583481620647945, + 32.963261854914890137, 32.018307738944713492, 52.26675246822196641, 68.65813993796473369, + 71.346151263642241247, 41.624496357562748017, 21.819135235997237032, 80.717954502695647534, + 72.780186637246515602, 90.274980941154353786, 77.254981235982995713, 109.035654024402902, + 83.038275736853393028, 13.945202522965701064, 71.479796628242183942, 64.55886952063156059, + 106.60542098483711015, 105.41794475673304987, 124.07444648073578719, 54.088367150310659781, + 52.314174513867328642, 106.20664446848240914, 46.098475311795482412, 110.82519575582045945, + 36.671538865819456987, 64.375434411758760689, 124.30305001771557727, 40.944071250785782468, + 24.214430108972010203, 83.96995065452210838, 77.216556003466394031, 44.788606435537076322, + 126.31792711436719401, 120.67271259747576551, 105.03599998357094591, 36.59162932093749987, + 33.812040251163125504, 98.325416434792714426, 13.489436079078586772, 39.300346446601906791, + 95.493182752707070904, 71.189123585485504009, 114.06833165695206844, 20.115478294897911837, + 125.87636572097835597, 94.137065177048498299, 71.856653195754915942, 62.344936041670734994, + 63.400854105635517044, 46.644399225126107922, 23.77314687447869801, 123.77016123877911014, + 63.710862277268461185, 58.065124891825689701, 63.120527922219480388, 125.8789801378006814, + 29.663628660458925879, 92.763199609515140764, 21.485633947188034654, 70.999698647930927109, + 50.449468635331868427, 45.581654642417561263, 56.620851701780338772, 62.12814493440600927, + 92.906389863077492919, 56.557883427380147623, 27.463822559770051157, 12.510243594530038536, + 112.32800121570471674, 101.52240939074908965, 31.433361964700452518, 123.34745739516074536, + 58.121914562416350236, 99.691377889841533033, 113.93972277122520609, 106.73276663609067327, + 49.360859593798522837, 51.529381355852819979, 83.293323517558746971, 51.922629091681301361, + 26.775802635165746324, 111.60288351517010597, 83.333326330634008627, 107.547001957478642, + 100.82290400814599707, 46.882583187583804829, 108.12002213434971054, 50.304791372698673513, + 56.518185325698141241, 14.942791248329740483, 106.8925171150258393, 120.93711930503923213, + 25.963407897874276387, 47.197509250065195374, 31.873746471625054255, 79.256149649434519233, + 77.769272399698820664, 26.530940710508730263, 91.472372191590693546, 111.07839068496832624, + 98.5188835941189609, 21.547573451320204185, 95.469058038179355208, 56.935956895526032895, + 52.074926499859429896, 96.160406794831942534, 85.995158660141896689, 15.131426120569813065, + 113.0529457712873409, 63.365673234053247143, 10.010454562721861294, 21.188293202521890635, + 3.7603078029060270637, 47.056416232506308006, 62.966274115860869642, 22.897948889003600925, + 24.837830686094093835, 20.66573641208015033, 42.039601829044840997, 62.283456873181421543, + 27.273723861613689223, 8.5965739614985068329, 55.798278969956299989, 106.44782379465323174, + 95.874204638595983852, 40.241662793305295054, 79.519046573710511439, 31.240620122811378678, + 20.02177801396464929, 54.379484081786358729, 46.438631172408349812, 85.811929188967042137, + 36.449022752891323762, 42.098164492341311416, 121.8550674198922934, 80.702378498866892187, + 9.8748259295025491156, 16.612736874769325368, 101.68637280759503483, 47.529279580874572275, + 36.52652397475685575, 100.88434953136311378, 5.4053111930916202255, 41.54848931164451642, + 28.020263734284526436, 45.004049963728903094, 50.260392906984634465, 58.07195084244813188, + 95.46540110906062182, 45.247271127514977707, 36.426091489494865527, 16.337793156737461686, + 126.29671337541367393, 75.905694986613525543, 1.9927685645598103292, 42.8757645805417269, + 6.8247758837715082336, 24.717420733733888483, 21.068119183844828513, 79.661478709578659618, + 29.027943612160015618, 59.40415338772800169, 40.37460505721901427, 36.863579665474389913, + 25.41718747589038685, 41.354824371883296408, 118.38311937711478095, 117.12555886705376906, + 112.19121026899665594, 21.055622650379518745, 24.966820839665160747, 75.795407414152577985, + 68.221807531521335477, 2.387610622936335858, 28.216704235830547987, 94.969747169099719031, + 32.501412600358889904, 82.258332914905622602, 62.742213319983420661, 109.53039719049047562, + 5.5677846771977783646, 22.763474676634359639, 80.015643877100956161, 59.665278775468323147, + 59.136164312258188147, 69.893816877254721476, 16.800478244738769718, 7.3324761915282579139, + 49.855207141750724986, 76.721123031158640515, 30.544522624491946772, 25.969233959982375382, + 12.250665258947265102, 32.962999501265585423, 49.433828536952205468, 122.64781018041321659, + 36.925101903128961567, 83.801409085936029442, 16.716668652014050167, 124.38944365718634799, + 55.859324194880173309, 70.135680449602659792, 3.4215727805167261977, 50.357467090754653327, + 82.609213200321391923, 126.56036298486651503, 111.61511068280015024, 4.0209915868908865377, + 21.793030150925915223, 67.736743246761761839, 118.23604370076282066, 27.455584008795995032, + 97.231723022101505194, 85.880139030348800588, 112.4551362849160796, 107.76116512927546864, + 4.544852381462987978, 42.456434029572847066, 60.014400325984752271, 77.859090945959906094, + 106.67573495996475685, 5.6342146032257005572, 102.38717528827328351, 82.266433890847110888, + 116.50302409768846701, 19.365657302438194165, 125.71672442534691072, 72.357140845866524614, + 90.225264551398140611, 39.351695026598463301, 11.290521626106055919, 56.24536832135709119, + 33.349535588658909546, 69.714776977136352798, 107.98214959887991427, 68.71184459289725055, + 16.402466051589726703, 93.046860693499183981, 79.53925859005539678, 48.755238885623839451, + 47.905081655258982209, 103.17557784726159298, 69.138154051146557322, 24.131208634629729204, + 18.362900531745253829, 22.382733911104878644, 0.16102761062938952819, 6.9172703905605885666, + 82.071815750729001593, 41.172578575740772067, 44.020666412387072342, 40.359047853031370323, + 19.21079833764815703, 96.731725516616279492, 108.52852706061821664, 37.719827983368304558, + 33.965193057792930631, 110.99958705910830759, 48.707065016777050914, 39.800087953408365138, + 43.19003027402141015, 115.41247106427908875, 47.622809821488772286, 104.73968583864916582, + 92.414185961049952311, 74.625076175329013495, 126.09423098344632308, 10.275891031920764362, + 104.44799600061378442, 74.837540803473530104, 60.755488391572725959, 123.32527549991209526, + 90.766841707791172666, 51.044356508409691742, 82.207827961283328477, 16.186215540536068147, + 113.28643083573842887, 65.59786575367252226, 55.697225104962853948, 11.165700448687857715, + 44.68964867309841793, 73.041658513102447614, 123.05386858715064591, 81.60400964271320845, + 64.424871329130837694, 82.615502695669420063, 124.97741086017413181, 67.143944618943351088, + 67.59235884818554041, 120.73604026328757755, 64.941084450198104605, 35.186442075962986564, + 93.17347949133545626, 93.350990778886625776, 15.527861660455528181, 79.911371154532389482, + 74.484896991732966853, 120.73439131560371607, 127.53774613792847958, 88.37701855464183609, + 87.793622417801088886, 93.605329781032196479, 4.4440071578028437216, 123.5988439502325491, + 81.002793174906400964, 68.591042283860588213, 22.169461291359766619, 6.5236244672414613888, + 103.88041019984302693, 117.24801611803923151, 81.334192258833354572, 30.810147156091261422, + 124.59283683639660012, 56.429171016599866562, 81.354055573843652382, 90.028906320865644375, + 17.137778697670000838, 44.350702118928893469, 72.209634280505269999, 97.320165811230253894, + 74.046844241413054988, 45.654079769006784773, 10.075495162702281959, 126.41002606707479572, + 82.898736176139209419, 66.443629396631877171, 63.126382037753501208, 64.880800583076052135, + 12.598858602887048619, 27.54158561510121217, 2.3452786732814274728, 13.19645242024489562, + 34.433183904955512844, 34.992727989774721209, 114.99626821587298764, 117.88144510594429448, + 96.370568964255653555, 125.90018218824843643, 38.427269395757321035, 112.88772061655981815, + 109.51768671670288313, 56.356478772719128756, 11.033050348607503111, 67.839080968162306817, + 122.52465796617980232, 85.809519217422348447, 36.541822638897428988, 51.833803809262462892, + 104.16306285053724423, 26.6382202622735349, 53.915313801375305047, 5.5749089876153448131, + 23.298953462850477081, 54.446352560142258881, 108.52829572243717848, 32.166563875325664412, + 78.078837781671609264, 59.987299486361735035, 25.87058515442913631, 23.697892919495643582, + 85.727554823817627039, 48.770571733100950951, 103.60763784182927338, 114.62691718075802783, + 111.98683081768467673, 51.54040462745615514, 112.45684726627223426, 114.83929766207438661, + 98.263751716847764328, 50.559166963241295889, 65.926523709829780273, 64.036615477889426984, + 104.5335049364475708, 9.3162798759331053589, 14.692302527284482494, 83.248992715125496034, + 43.638270471998112043, 33.435909005394933047, 17.560373274496669183, 52.549961882312345551, + 26.509962471969629405, 90.071308048809441971, 38.076551473706786055, 27.890405045935040107, + 14.959593256488005864, 1.117739041266759159, 85.210841969677858287, 82.835889513469737722, + 120.14889296147157438, 108.17673430062131956, 104.62834902773829526, 84.413288936964818276, + 92.196950623594602803, 93.650391511640918907, 73.343077731642551953, 0.75086882352115935646, + 120.60610003543115454, 81.888142501571564935, 48.428860217947658384, 39.939901309047854738, + 26.433112006932788063, 89.577212871077790624, 124.63585422873802599, 113.34542519495516899, + 82.07199996714189183, 73.183258641874999739, 67.624080502329888986, 68.650832869585428853, + 26.978872158157173544, 78.600692893207451561, 62.986365505417779787, 14.378247170974645996, + 100.13666331390413688, 40.230956589799461653, 123.75273144196034991, 60.274130354100634577, + 15.713306391509831883, 124.68987208334146999, 126.80170821127103409, 93.288798450252215844, + 47.546293748961033998, 119.54032247755822027, 127.42172455453692237, 116.1302497836513794, + 126.24105584444259875, 123.75796027560136281, 59.327257320921489736, 57.526399219030281529, + 42.971267894379707286, 13.999397295861854218, 100.89893727066373685, 91.163309284835122526, + 113.24170340356067754, 124.25628986881565652, 57.812779726154985838, 113.11576685476029525, + 54.927645119540102314, 25.02048718906371505, 96.656002431413071463, 75.044818781498179305, + 62.866723929404543014, 118.69491479032149073, 116.24382912483633845, 71.382755779686704045, + 99.879445542454050155, 85.465533272181346547, 98.721719187597045675, 103.05876271170927794, + 38.586647035117493942, 103.84525818336260272, 53.551605270335130626, 95.20576703034384991, + 38.666652661271655234, 87.094003914960921975, 73.645808016291994136, 93.765166375171247637, + 88.240044268699421082, 100.60958274539734703, 113.03637065139628248, 29.885582496663118945, + 85.785034230055316584, 113.87423861007846426, 51.926815795748552773, 94.395018500130390748, + 63.747492943253746489, 30.512299298872676445, 27.538544799397641327, 53.061881421021098504, + 54.944744383185025072, 94.15678136994029046, 69.0377671882379218, 43.095146902644046349, + 62.938116076358710416, 113.87191379105206579, 104.14985299972249777, 64.320813589667523047, + 43.990317320283793379, 30.262852241143264109, 98.105891542574681807, 126.73134646810649429, + 20.020909125443722587, 42.376586405043781269, 7.5206156058120541275, 94.112832465012616012, + 125.93254823172173928, 45.79589777800720185, 49.67566137218818767, 41.331472824160300661, + 84.079203658089681994, 124.56691374636284309, 54.547447723227378447, 17.193147922997013666, + 111.59655793991623796, 84.895647589310101466, 63.748409277191967703, 80.483325586614228087, + 31.038093147421022877, 62.481240245622757357, 40.04355602792929858, 108.75896816357271746, + 92.877262344820337603, 43.623858377934084274, 72.898045505782647524, 84.19632898468626081, + 115.71013483978822478, 33.404756997733784374, 19.749651859005098231, 33.225473749542288715, + 75.372745615190069657, 95.05855916174914455, 73.05304794951734948, 73.768699062726227567, + 10.810622386183240451, 83.096978623289032839, 56.040527468569052871, 90.008099927457806189, + 100.52078581396926893, 116.14390168489990174, 62.930802218121243641, 90.494542255029955413, + 72.852182978989731055, 32.675586313478561351, 124.59342675083098584, 23.811389973227051087, + 3.9855371291196206585, 85.751529161083453801, 13.649551767543016467, 49.434841467467776965, + 42.136238367693295004, 31.322957419157319237, 58.055887224320031237, 118.80830677545600338, + 80.74921011443802854, 73.727159330948779825, 50.834374951780773699, 82.709648743770230794, + 108.76623875423319987, 106.25111773411117611, 96.382420537993311882, 42.111245300759037491, + 49.933641679333959473, 23.590814828308793949, 8.443615063042670954, 4.7752212458726717159, + 56.433408471664733952, 61.939494338199438062, 65.002825200721417787, 36.516665829811245203, + 125.4844266399704793, 91.060794380980951246, 11.135569354395556729, 45.526949353272357257, + 32.031287754201912321, 119.33055755093664629, 118.27232862452001427, 11.787633754509442952, + 33.600956489477539435, 14.664952383056515828, 99.710414283505087951, 25.44224606231728103, + 61.089045248983893543, 51.938467919964750763, 24.501330517894530203, 65.925999002531170845, + 98.867657073908048915, 117.29562036082643317, 73.850203806261561112, 39.602818171872058883, + 33.433337304031738313, 120.77888731437269598, 111.7186483897639846, 12.271360899205319583, + 6.8431455610334523953, 100.71493418151294463, 37.218426400646421826, 125.12072596973666805, + 95.230221365600300487, 8.0419831737817730755, 43.586060301855468424, 7.4734864935271616559, + 108.47208740152564133, 54.911168017595628044, 66.463446044206648367, 43.760278060701239156, + 96.910272569835797185, 87.522330258550937288, 9.089704762925975956, 84.912868059145694133, + 120.02880065197314252, 27.718181891923450166, 85.351469919929513708, 11.268429206455039093, + 76.774350576550205005, 36.532867781697859755, 105.00604819537693402, 38.731314604880026309, + 123.43344885069745942, 16.714281691736687208, 52.450529102796281222, 78.703390053196926601, + 22.581043252212111838, 112.49073664271418238, 66.699071177321457071, 11.429553954276343575, + 87.964299197763466509, 9.4236891857945010997, 32.804932103183091385, 58.09372138700200594, + 31.078517180110793561, 97.510477771247678902, 95.810163310521602398, 78.351155694526823936, + 10.276308102293114644, 48.262417269259458408, 36.725801063490507659, 44.765467822209757287, + 0.32205522125877905637, 13.834540781124815112, 36.143631501458003186, 82.345157151481544133, + 88.041332824774144683, 80.718095706062740646, 38.421596675299952039, 65.463451033236196963, + 89.057054121236433275, 75.439655966736609116, 67.930386115589499241, 93.99917411821661517, + 97.414130033554101828, 79.600175906816730276, 86.38006054804645828, 102.8249421285581775, + 95.245619642981182551, 81.479371677301969612, 56.828371922103542602, 21.250152350661664968, + 124.18846196689264616, 20.551782063845166704, 80.895992001231206814, 21.675081606947060209, + 121.5109767831490899, 118.65055099982782849, 53.533683415582345333, 102.08871301682302146, + 36.415655922566656955, 32.372431081075774273, 98.572861671480495716, 3.1957315073450445198, + 111.3944502099257079, 22.331400897375715431, 89.379297346200473839, 18.083317026208533207, + 118.10773717430492979, 35.208019285430054879, 0.84974265826531336643, 37.231005391342478106, + 121.9548217203519016, 6.287889237890340155, 7.1847176963747187983, 113.47208052657879307, + 1.8821689003962092102, 70.372884151929611107, 58.346958982674550498, 58.701981557773251552, + 31.055723320914694341, 31.822742309068416944, 20.969793983469571685, 113.46878263121107011, + 127.07549227586059715, 48.754037109287310159, 47.587244835605815751, 59.210659562064392958, + 8.888014315609325422, 119.19768790046873619, 34.005586349816439906, 9.1820845677211764269, + 44.338922582719533239, 13.047248934486560756, 79.76082039968969184, 106.49603223608210101, + 34.668384517666709144, 61.620294312186160823, 121.18567367279320024, 112.8583420332033711, + 34.708111147690942744, 52.05781264173128875, 34.275557395340001676, 88.701404237861424917, + 16.419268561014177976, 66.640331622464145767, 20.093688482826109976, 91.308159538013569545, + 20.150990325408201898, 124.82005213415322942, 37.797472352282056818, 4.8872587932637543418, + 126.2527640755106404, 1.7616011661521042697, 25.197717205774097238, 55.08317123020242434, + 4.6905573465628549457, 26.392904840489791241, 68.866367809911025688, 69.985455979553080397, + 101.99253643174961326, 107.76289021189222694, 64.741137928514945088, 123.80036437649687286, + 76.85453879151828005, 97.775441233123274287, 91.035373433405766264, 112.71295754543825751, + 22.0661006972186442, 7.6781619363282516133, 117.04931593236324261, 43.619038434844696894, + 73.083645277794857975, 103.66760761852856376, 80.326125701074488461, 53.276440524547069799, + 107.83062760275061009, 11.149817975230689626, 46.597906925700954162, 108.89270512028815574, + 89.056591444874356966, 64.333127750654966803, 28.157675563343218528, 119.97459897272347007, + 51.74117030885827262, 47.395785838994925143, 43.455109647635254078, 97.54114346620553988, + 79.215275683662184747, 101.25383436151969363, 95.973661635369353462, 103.08080925491594826, + 96.913694532548106508, 101.67859532415241119, 68.527503433695528656, 101.11833392648622976, + 3.8530474196631985251, 0.073230955782491946593, 81.067009872895141598, 18.632559751866210718, + 29.384605054572602967, 38.497985430250992067, 87.276540943996224087, 66.871818010789866094, + 35.120746548993338365, 105.0999237646246911, 53.019924943942896789, 52.142616097618883941, + 76.15310294741357211, 55.780810091870080214, 29.919186512976011727, 2.2354780825371562969, + 42.421683939359354554, 37.671779026943113422, 112.29778592294678674, 88.353468601246277103, + 81.256698055480228504, 40.826577873933274532, 56.393901247192843584, 59.300783023285475792, + 18.686155463285103906, 1.5017376470459566917, 113.21220007086594705, 35.77628500314312987, + 96.857720435895316768, 79.879802618095709477, 52.866224013869214104, 51.154425742159219226, + 121.27170845747968997, 98.69085038991397596, 36.143999934287421638, 18.366517283753637457, + 7.2481610046634159517, 9.3016657391708577052, 53.957744316317985067, 29.201385786414903123, + 125.97273101083555957, 28.756494341952929972, 72.27332662780827377, 80.461913179602561286, + 119.50546288392069982, 120.54826070820126915, 31.426612783023301745, 121.37974416668657796, + 125.60341642254570615, 58.577596900504431687, 95.092587497925705975, 111.08064495512007852, + 126.84344910907748272, 104.26049956730639678, 124.48211168888883549, 119.51592055120272562, + 118.65451464184297947, 115.05279843806056306, 85.942535788759414572, 27.998794591727346415, + 73.797874541331111686, 54.32661856967388303, 98.483406807124993065, 120.51257973763131304, + 115.62555945231360965, 98.231533709520590492, 109.85529023908020463, 50.040974378131068079, + 65.312004862829780905, 22.089637562996358611, 125.73344785881272401, 109.38982958064661943, + 104.48765824967631488, 14.765511559377046069, 71.75889108491173829, 42.931066544366331073, + 69.443438375197729329, 78.117525423418555874, 77.173294070238625864, 79.690516366725205444, + 107.10321054067389923, 62.411534060687699821, 77.333305322546948446, 46.188007829925481929, + 19.29161603258762625, 59.530332750346133253, 48.480088537402480142, 73.21916549079833203, + 98.072741302792564966, 59.77116499332987587, 43.570068460114271147, 99.748477220156928524, + 103.85363159150074353, 60.790037000260781497, 127.49498588650749298, 61.02459859774535289, + 55.077089598795282654, 106.12376284204219701, 109.88948876637368812, 60.3135627398842189, + 10.075534376475843601, 86.190293805288092699, 125.87623215272105881, 99.743827582107769558, + 80.29970599944863352, 0.64162717933504609391, 87.980634640567586757, 60.525704482290166197, + 68.211783085153001593, 125.46269293621298857, 40.041818250887445174, 84.753172810087562539, + 15.041231211627746234, 60.225664930028870003, 123.86509646344347857, 91.591795556014403701, + 99.35132274437637534, 82.662945648324239301, 40.158407316183001967, 121.13382749272568617, + 109.09489544645475689, 34.38629584599766531, 95.193115879836113891, 41.791295178620202933, + 127.49681855438757339, 32.966651173228456173, 62.076186294842045754, 124.96248049124551471, + 80.087112055862235138, 89.517936327149072895, 57.754524689640675206, 87.247716755871806527, + 17.796091011568933027, 40.392657969376159599, 103.42026967957644956, 66.809513995467568748, + 39.499303718010196462, 66.450947499088215409, 22.745491230383777292, 62.11711832350192708, + 18.106095899038336938, 19.537398125452455133, 21.621244772370118881, 38.193957246578065678, + 112.08105493714174372, 52.016199854919250356, 73.041571627942175837, 104.28780336979980348, + 125.86160443624612526, 52.989084510063548805, 17.70436595797946211, 65.351172626960760681, + 121.18685350166197168, 47.622779946454102173, 7.9710742582428792957, 43.503058322166907601, + 27.299103535086032934, 98.869682934935553931, 84.272476735386590008, 62.645914838314638473, + 116.11177444864370045, 109.61661355091564474, 33.49842022887969506, 19.45431866189755965, + 101.66874990356518538, 37.419297487544099567, 89.532477508470037719, 84.502235468225990189, + 64.764841075986623764, 84.222490601518074982, 99.867283358667918947, 47.181629656617587898, + 16.887230126085341908, 9.5504424917453434318, 112.8668169433294679, 123.8789886764025141, + 2.0056504014428355731, 73.033331659626128385, 122.96885327994459658, 54.121588761961902492, + 22.271138708791113459, 91.053898706544714514, 64.062575508407462621, 110.66111510187693057, + 108.54465724904002855, 23.575267509018885903, 67.20191297895507887, 29.329904766116669634, + 71.420828567010175902, 50.88449212463456206, 122.17809049796778709, 103.87693583992950153, + 49.002661035792698385, 3.8519980050659796689, 69.735314147819735808, 106.59124072165650432, + 19.700407612523122225, 79.205636343744117767, 66.866674608067114605, 113.55777462874902994, + 95.437296779527969193, 24.542721798410639167, 13.68629112207054277, 73.429868363025889266, + 74.43685280129648163, 122.24145193947697408, 62.460442731200600974, 16.083966347563546151, + 87.172120603710936848, 14.946972987057961291, 88.944174803051282652, 109.82233603519489407, + 4.9268920884132967331, 87.52055612140611629, 65.820545139675232349, 47.044660517101874575, + 18.179409525855589891, 41.825736118295026245, 112.05760130394628504, 55.436363783850538312, + 42.702939839859027416, 22.536858412913716165, 25.548701153100410011, 73.065735563399357488, + 82.012096390753868036, 77.462629209763690596, 118.86689770139491884, 33.428563383473374415, + 104.90105820559620042, 29.406780106393853202, 45.162086504427861655, 96.98147328543200274, + 5.3981423546429141425, 22.859107908556325128, 47.928598395526933018, 18.847378371589002199, + 65.609864206366182771, 116.18744277400401188, 62.1570343602252251, 67.020955542498995783, + 63.620326621046842774, 28.702311389053647872, 20.552616204586229287, 96.524834538518916816, + 73.451602126981015317, 89.530935644419514574, 0.64411044251755811274, 27.669081562249630224, + 72.28726300291964435, 36.690314302966726245, 48.082665649551927345, 33.436191412125481293, + 76.843193350603542058, 2.926902066476031905, 50.114108242476504529, 22.879311933476856211, + 7.8607722311826364603, 59.998348236436868319, 66.828260067111841636, 31.20035181363709853, + 44.760121096096554538, 77.649884257119992981, 62.491239285966003081, 34.958743354603939224, + 113.6567438442070852, 42.500304701326967916, 120.37692393378529232, 41.103564127693971386, + 33.791984002462413628, 43.350163213897758396, 115.02195356630181777, 109.30110199965565698, + 107.06736683116832864, 76.177426033646042924, 72.831311845133313909, 64.744862162155186525, + 69.145723342960991431, 6.3914630146937270183, 94.788900419851415791, 44.66280179475506884, + 50.758594692400947679, 36.166634052420704393, 108.21547434860985959, 70.416038570860109758, + 1.6994853165306267329, 74.46201078268859419, 115.90964344070380321, 12.57577847578068031, + 14.369435392753075575, 98.944161053157586139, 3.7643378007960563991, 12.745768303859222215, + 116.693917965349101, 117.4039631155465031, 62.111446641829388682, 63.645484618136833888, + 41.93958796694278135, 98.937565262425778201, 126.15098455172119429, 97.508074218574620318, + 95.174489671211631503, 118.42131912412878592, 17.776028631222288823, 110.39537580093747238, + 68.011172699632879812, 18.364169135442352854, 88.677845165439066477, 26.094497868976759491, + 31.521640799383021658, 84.992064472164202016, 69.336769035333418287, 123.24058862437595963, + 114.37134734559003846, 97.716684066406742204, 69.416222295381885488, 104.1156252834625775, + 68.551114790683641331, 49.402808475722849835, 32.838537122031993931, 5.2806632449282915331, + 40.18737696565585793, 54.61631907602713909, 40.301980650820041774, 121.64010426830645883, + 75.594944704564113636, 9.7745175865311466623, 124.50552815102128079, 3.5232023323042085394, + 50.395434411548194475, 110.16634246040484868, 9.3811146931257098913, 52.78580968098322046, + 9.7327356198256893549, 11.970911959109798772, 75.985072863502864493, 87.525780423788091866, + 1.4822758570335281547, 119.60072875299738371, 25.709077583040198078, 67.550882466250186553, + 54.070746866815170506, 97.425915090876515023, 44.1322013944372884, 15.356323872660141205, + 106.09863186472648522, 87.238076869693031767, 18.167290555593353929, 79.335215237060765503, + 32.652251402148976922, 106.55288104909777758, 87.661255205501220189, 22.299635950461379252, + 93.195813851405546302, 89.785410240579949459, 50.113182889752351912, 0.66625550130993360654, + 56.315351126690075034, 111.94919794544694014, 103.48234061771654524, 94.791571677989850286, + 86.910219295274146134, 67.082286932414717739, 30.430551367328007473, 74.507668723043025238, + 63.947323270742344903, 78.161618509835534496, 65.827389065099850995, 75.357190648308460368, + 9.0550068673946952913, 74.236667852972459514, 7.7060948393263970502, 0.14646191156862187199, + 34.134019745790283196, 37.265119503732421435, 58.769210109145205934, 76.995970860505622113, + 46.553081887996086152, 5.7436360215797321871, 70.241493097990314709, 82.199847529249382205, + 106.03984988788579358, 104.28523219524140586, 24.30620589482714422, 111.56162018374016043, + 59.838373025952023454, 4.4709561650743125938, 84.843367878718709107, 75.343558053889864823, + 96.59557184589721146, 48.706937202496192185, 34.513396110960457008, 81.653155747866549063, + 112.78780249438568717, 118.60156604657095158, 37.372310926570207812, 3.0034752940955513623, + 98.424400141731894109, 71.552570006289897719, 65.715440871794271516, 31.759605236191418953, + 105.73244802773842821, 102.30885148432207643, 114.54341691496301792, 69.381700779827951919, + 72.287999868574843276, 36.733034567507274915, 14.496322009326831903, 18.60333147834171541, + 107.91548863263597013, 58.402771572833444225, 123.94546202167111915, 57.512988683909497922, + 16.546653255620185519, 32.92382635920876055, 111.01092576784503763, 113.09652141640253831, + 62.853225566050241468, 114.75948833337679389, 123.20683284509141231, 117.15519380101250135, + 62.185174995855049929, 94.161289910243795021, 125.68689821815860341, 80.520999134616431547, + 120.96422337778130895, 111.03184110240908922, 109.30902928368959692, 102.10559687612476409, + 43.885071577518829145, 55.997589183458330808, 19.595749082662223373, 108.65323713935140404, + 68.96681361425362411, 113.02515947526626405, 103.25111890463085729, 68.463067419044818962, + 91.710580478160409257, 100.08194875626577414, 2.6240097256595618092, 44.1792751259963552, + 123.46689571762908599, 90.779659161296876846, 80.975316499352629762, 29.531023118757730117, + 15.517782169823476579, 85.862133088736300124, 10.886876750399096636, 28.235050846840749728, + 26.346588140480889706, 31.381032733454048866, 86.206421081347798463, 124.82306812137903762, + 26.666610645093896892, 92.376015659850963857, 38.583232065175252501, 119.06066550069226651, + 96.960177074808598263, 18.438330981600302039, 68.145482605585129932, 119.54232998665975174, + 87.140136920232180273, 71.496954440317495028, 79.70726318300148705, 121.58007400052520097, + 126.98997177301498596, 122.04919719549070578, 110.15417919759420329, 84.247525684088031994, + 91.778977532747376245, 120.6271254797684378, 20.151068752955325181, 44.380587610579823377, + 123.7524643054457556, 71.487655164219177095, 32.59941199889726704, 1.2832543586737301666, + 47.961269281135173514, 121.05140896458397037, 8.4235661703096411657, 122.92538587242597714, + 80.083636501778528327, 41.506345620175125077, 30.082462423255492467, 120.45132986006137799, + 119.73019292689059512, 55.18359111203244538, 70.702645488756388659, 37.325891296648478601, + 80.316814632369641913, 114.26765498545501032, 90.189790892909513786, 68.772591691998968599, + 62.386231759672227781, 83.582590357244043844, 126.99363710877514677, 65.933302346456912346, + 124.15237258968772949, 121.92496098249466741, 32.174224111728108255, 51.03587265429814579, + 115.50904937928498839, 46.495433511743613053, 35.592182023137866054, 80.785315938755957177, + 78.840539359156537103, 5.6190279909351374954, 78.998607436024030903, 4.9018949981764308177, + 45.490982460767554585, 124.23423664700385416, 36.212191798076673876, 39.074796250904910266, + 43.242489544740237761, 76.387914493159769336, 96.162109874283487443, 104.03239970984213869, + 18.083143255887989653, 80.575606739603244932, 123.72320887249225052, 105.97816902012709761, + 35.408731915962562198, 2.7023452539251593407, 114.37370700332394335, 95.245559892908204347, + 15.942148516485758591, 87.006116644333815202, 54.598207070175703848, 69.73936586987474584, + 40.544953470773180015, 125.29182967663291492, 104.22354889729103888, 91.233227101831289474, + 66.996840457759390119, 38.908637323798757279, 75.337499807130370755, 74.838594975091837114, + 51.064955016943713417, 41.004470936455618357, 1.5296821519768855069, 40.444981203039787943, + 71.734566717335837893, 94.363259313235175796, 33.774460252170683816, 19.100884983494324842, + 97.733633886662573786, 119.7579773528050282, 4.011300802889309125, 18.066663319255894748, + 117.93770655988919316, 108.24317752392380498, 44.542277417585864896, 54.107797413093067007, + 0.12515101681856322102, 93.322230203757499112, 89.089314498080057092, 47.150535018041409785, + 6.4038259579101577401, 58.659809532236977248, 14.841657134020351805, 101.7689842492727621, + 116.35618099593921215, 79.753871679859003052, 98.00532207158539677, 7.7039960101355973165, + 11.470628295643109595, 85.18248144331300864, 39.400815225049882429, 30.411272687491873512, + 5.7333492161378671881, 99.115549257501697866, 62.874593559055938385, 49.085443596821278334, + 27.372582244144723518, 18.859736726055416511, 20.873705602596601238, 116.48290387895394815, + 124.92088546240120195, 32.167932695130730281, 46.344241207421873696, 29.89394597411956056, + 49.888349606106203282, 91.644672070389788132, 9.8537841768302314449, 47.041112242815870559, + 3.6410902793504646979, 94.08932103420374915, 36.358819051711179782, 83.651472236593690468, + 96.115202607892570086, 110.87272756770107662, 85.405879679718054831, 45.073716825827432331, + 51.097402306204458, 18.131471126802352956, 36.024192781511374051, 26.925258419531019172, + 109.73379540278983768, 66.857126766950386809, 81.802116411192400847, 58.813560212787706405, + 90.324173008859361289, 65.96294657086400548, 10.796284709285828285, 45.718215817112650257, + 95.857196791053866036, 37.694756743181642378, 3.21972841273600352, 104.37488554800802376, + 124.31406872045408818, 6.0419110849979915656, 127.24065324209368555, 57.404622778107295744, + 41.105232409176096553, 65.04966907704147161, 18.903204253965668613, 51.061871288839029148, + 1.2882208850351162255, 55.338163124502898427, 16.5745260058392887, 73.380628605933452491, + 96.16533129910385469, 66.872382824254600564, 25.686386701207084116, 5.8538041329520638101, + 100.22821648495300906, 45.758623866953712422, 15.721544462365272921, 119.99669647287737462, + 5.6565201342236832716, 62.400703627274197061, 89.520242192196747055, 27.299768514239985961, + 124.98247857193200616, 69.917486709211516427, 99.313487688414170407, 85.00060940265757381, + 112.75384786757058464, 82.207128255387942772, 67.583968004924827255, 86.700326427799154771, + 102.04390713260727352, 90.602203999314951943, 86.134733662340295268, 24.354852067295723828, + 17.662623690270265797, 1.489724324314011028, 10.291446685921982862, 12.782926029391092015, + 61.577800839702831581, 89.325603589510137681, 101.51718938480189536, 72.333268104845046764, + 88.430948697223357158, 12.832077141720219515, 3.3989706330648914445, 20.92402156538082636, + 103.81928688140760642, 25.15155695156136062, 28.73887078550978913, 69.888322106315172277, + 7.5286756015921127982, 25.491536607722082408, 105.38783593070183997, 106.80792623109300621, + 124.22289328365877736, 127.29096923627366778, 83.879175933889200678, 69.875130524855194381, + 124.30196910344602657, 67.016148437152878614, 62.348979342426900985, 108.84263824825757183, + 35.552057262448215624, 92.790751601878582733, 8.0223453992657596245, 36.728338270888343686, + 49.355690330878132954, 52.188995737953518983, 63.043281598769681295, 41.984128944332042011, + 10.673538070670474553, 118.48117724875555723, 100.74269469118371489, 67.433368132817122387, + 10.832444590767408954, 80.231250566928792978, 9.1022295813672826625, 98.805616951445699669, + 65.677074244063987862, 10.561326489856583066, 80.37475393131171586, 109.23263815205427818, + 80.603961301643721526, 115.28020853661655565, 23.189889409128227271, 19.549035173065931303, + 121.01105630204256158, 7.0464046646084170789, 100.79086882310002693, 92.33268492080969736, + 18.762229386251419783, 105.57161936196644092, 19.46547123965137871, 23.941823918223235523, + 23.970145727009366965, 47.051560847576183733, 2.9645517140706942882, 111.20145750599476742, + 51.418155166084034136, 7.1017649325003731064, 108.14149373363397899, 66.851830181753030047, + 88.2644027888745768, 30.71264774532392039, 84.197263729456608417, 46.476153739386063535, + 36.334581111190345837, 30.670430474121531006, 65.304502804301591823, 85.105762098199193133, + 47.322510411002440378, 44.599271900926396484, 58.391627702814730583, 51.570820481159898918, + 100.22636577950470382, 1.3325110026198672131, 112.63070225338378805, 95.898395890897518257, + 78.964681235436728457, 61.583143355983338552, 45.820438590551930247, 6.1645738648294354789, + 60.861102734659652924, 21.015337446086050477, 127.89464654148832778, 28.323237019674706971, + 3.6547781302033399697, 22.714381296616920736, 18.110013734793028561, 20.473335705944919027, + 15.4121896786527941, 0.29292382313724374399, 68.268039491580566391, 74.530239007464842871, + 117.53842021829404985, 25.991941721011244226, 93.106163775992172305, 11.487272043163102353, + 12.482986195984267397, 36.399695058502402389, 84.079699775775225135, 80.570464390482811723, + 48.61241178965792642, 95.123240367480320856, 119.67674605190404691, 8.9419123301522631664, + 41.686735757441056194, 22.687116107783367625, 65.191143691794422921, 97.41387440499238437, + 69.026792221924551995, 35.306311495736736106, 97.575604988775012316, 109.20313209314190317, + 74.744621853140415624, 6.0069505881947407033, 68.848800283467426198, 15.105140012583433418, + 3.4308817435885430314, 63.519210472386475885, 83.464896055480494397, 76.61770296864779084, + 101.08683382992967381, 10.763401559659541817, 16.575999737149686553, 73.466069135014549829, + 28.992644018653663807, 37.2066629566870688, 87.830977265271940269, 116.80554314567052643, + 119.89092404334223829, 115.02597736781899584, 33.093306511240371037, 65.847652718421159079, + 94.021851535693713231, 98.193042832805076614, 125.70645113210412092, 101.51897666675722576, + 118.4136656901864626, 106.31038760202500271, 124.37034999171373784, 60.32257982049122802, + 123.3737964363208448, 33.041998269236501073, 113.92844675556625589, 94.063682204821816413, + 90.618058567382831825, 76.211193752249528188, 87.770143155037658289, 111.99517836691666162, + 39.191498165328084724, 89.306474278706446057, 9.9336272285108861979, 98.050318950536166085, + 78.502237809265352553, 8.9261348380932759028, 55.421160956324456492, 72.163897512531548273, + 5.2480194513191236183, 88.358550251996348379, 118.93379143526180997, 53.559318322597391671, + 33.950632998705259524, 59.062046237515460234, 31.035564339650591137, 43.724266177472600248, + 21.773753500798193272, 56.470101693681499455, 52.693176280961779412, 62.762065466911735712, + 44.412842162699234905, 121.64613624275807524, 53.333221290191431763, 56.752031319701927714, + 77.166464130354142981, 110.12133100138817099, 65.920354149617196526, 36.876661963204242056, + 8.2909652111738978419, 111.08465997332314146, 46.280273840467998525, 14.993908880638628034, + 31.414526366006612079, 115.16014800105403992, 125.97994354603360989, 116.09839439098504954, + 92.308358395192044554, 40.495051368179701967, 55.557955065498390468, 113.2542509595368756, + 40.302137505910650361, 88.761175221163284732, 119.50492861089514918, 14.97531032843835419, + 65.19882399779453408, 2.5665087173474603333, 95.922538562273985008, 114.10281792916794075, + 16.84713234062292031, 117.85077174485559226, 32.167273003557056654, 83.012691240350250155, + 60.164924846514622914, 112.90265972012639395, 111.46038585378119024, 110.36718222406852874, + 13.405290977512777317, 74.651782593300595181, 32.633629264742921805, 100.53530997091365862, + 52.379581785822665552, 9.5451833839979371987, 124.77246351934809354, 39.165180714491725666, + 125.98727421755393152, 3.8666046929174626712, 120.30474517937909695, 115.84992196498933481, + 64.34844822345621651, 102.07174530859992956, 103.01809875856997678, 92.990867023487226106, + 71.184364046279370086, 33.570631877515552333, 29.681078718313074205, 11.23805598187391297, + 29.997214872048061807, 9.8037899963528616354, 90.981964921538747149, 120.46847329400770832, + 72.424383596153347753, 78.149592501809820533, 86.484979089484113501, 24.77582898632317665, + 64.324219748570612865, 80.064799419684277382, 36.166286511779617285, 33.151213479210127844, + 119.44641774498813902, 83.956338040254195221, 70.817463831925124396, 5.4046905078539566603, + 100.74741400665152469, 62.491119785816408694, 31.884297032975155162, 46.012233288667630404, + 109.19641414035504567, 11.47873173974949168, 81.08990694154999801, 122.58365935326946783, + 80.447097794585715747, 54.466454203666216927, 5.9936809155187802389, 77.817274647601152537, + 22.674999614264379488, 21.677189950183674227, 102.12991003388742683, 82.008941872911236715, + 3.0593643039537710138, 80.889962406083213864, 15.469133434675313765, 60.726518626470351592, + 67.548920504341367632, 38.201769966992287664, 67.467267773328785552, 111.51595470561005641, + 8.02260160577861825, 36.133326638515427476, 107.8754131197820243, 88.486355047847609967, + 89.084554835171729792, 108.21559482618613401, 0.25030203364076442085, 58.644460407518636202, + 50.178628996160114184, 94.30107003608281957, 12.80765191582031548, 117.3196190644739545, + 29.683314268044341588, 75.537968498549162177, 104.71236199188206228, 31.507743359721644083, + 68.010644143170793541, 15.407992020271194633, 22.94125659128985717, 42.36496288662601728, + 78.801630450099764857, 60.822545374983747024, 11.466698432279372355, 70.231098515003395732, + 125.74918711811187677, 98.170887193642556667, 54.745164488289447036, 37.719473452110833023, + 41.747411205196840456, 104.96580775791153428, 121.8417709248024039, 64.335865390261460561, + 92.688482414843747392, 59.78789194823912112, 99.776699212216044543, 55.289344140779576264, + 19.70756835366046289, 94.082224485631741118, 7.2821805587045673747, 60.1786420684074983, + 72.717638103425997542, 39.302944473191018915, 64.23040521578877815, 93.745455135405791225, + 42.811759359436109662, 90.147433651654864661, 102.194804612408916, 36.262942253604705911, + 72.048385563022748102, 53.850516839065676322, 91.46759080558331334, 5.7142535339044115972, + 35.604232822384801693, 117.62712042557905079, 52.648346017722360557, 3.9258931417280109599, + 21.59256941857165657, 91.436431634228938492, 63.714393582107732072, 75.389513486363284755, + 6.4394568254756450187, 80.749771096019685501, 120.62813744090817636, 12.08382216999962111, + 126.4813064841873711, 114.80924555621459149, 82.210464818355831085, 2.0993381540829432197, + 37.806408507931337226, 102.1237425776780583, 2.576441770070232451, 110.67632624900579685, + 33.14905201168221538, 18.76125721187054296, 64.330662598211347358, 5.744765648509201128, + 51.372773402414168231, 11.707608265907765599, 72.456432969906018116, 91.517247733907424845, + 31.44308892473418382, 111.99339294575474923, 11.313040268447366543, 124.8014072545520321, + 51.040484384393494111, 54.599537028483609902, 121.9649571438676503, 11.834973418426670833, + 70.626975376831978792, 42.001218805318785599, 97.507695735144807259, 36.414256510779523524, + 7.1679360098532924894, 45.400652855601947522, 76.087814265218185028, 53.204407998633541865, + 44.269467324680590536, 48.709704134591447655, 35.325247380540531594, 2.9794486486280220561, + 20.582893371843965724, 25.565852058782184031, 123.15560167940930114, 50.651207179023913341, + 75.034378769607428694, 16.666536209693731507, 48.861897394446714316, 25.664154283440439031, + 6.797941266129782889, 41.848043130765290698, 79.638573762815212831, 50.30311390312272124, + 57.477741571023216238, 11.776644212630344555, 15.057351203184225596, 50.983073215447802795, + 82.77567186140731792, 85.615852462189650396, 120.44578656732119271, 126.58193847255097353, + 39.758351867782039335, 11.75026104971402674, 120.60393820689569111, 6.0322968743057572283, + 124.69795868485743995, 89.685276496515143663, 71.104114524900069227, 57.581503203757165466, + 16.044690798531519249, 73.456676541776687372, 98.711380661756265908, 104.37799147590703797, + 126.08656319753936259, 83.968257888664084021, 21.347076141344587086, 108.96235449751475244, + 73.485389382371067768, 6.8667362656342447735, 21.664889181538455887, 32.462501133857585955, + 18.204459162738203304, 69.611233902895037318, 3.3541484881279757246, 21.122652979716804111, + 32.749507862627069699, 90.465276304112194339, 33.207922603291081032, 102.5604170732331113, + 46.379778818256454542, 39.098070346135500586, 114.02211260408512317, 14.092809329220472137, + 73.581737646203691838, 56.66536984161939472, 37.524458772506477544, 83.14323872393288184, + 38.93094247930275742, 47.883647836446471047, 47.94029145401873393, 94.103121695152367465, + 5.9291034281450265553, 94.402915011989534833, 102.83631033216806827, 14.203529865004384192, + 88.28298746727159596, 5.7036603635096980724, 48.528805577749153599, 61.425295490651478758, + 40.394527458913216833, 92.95230747877212707, 72.669162222380691674, 61.340860948246699991, + 2.6090056086068216246, 42.211524196398386266, 94.645020822004880756, 89.198543801852792967, + 116.78325540562946117, 103.14164096232343582, 72.452731559009407647, 2.6650220052433724049, + 97.261404506771214074, 63.796791781798674492, 29.929362470873456914, 123.1662867119666771, + 91.640877181103860494, 12.329147729658870958, 121.72220546931930585, 42.030674892175738933, + 127.78929308297665557, 56.646474039349413943, 7.3095562604066799395, 45.428762593233841471, + 36.220027469586057123, 40.946671411889838055, 30.824379357305588201, 0.58584764627812546678, + 8.5360789831647707615, 21.06047801493332372, 107.07684043658809969, 51.983883442026126431, + 58.212327551984344609, 22.974544086326204706, 24.965972391968534794, 72.799390117008442758, + 40.159399551554088248, 33.140928780965623446, 97.224823579319490818, 62.246480734964279691, + 111.35349210380809382, 17.883824660304526333, 83.373471514882112388, 45.374232215570373228, + 2.3822873835924838204, 66.82774880998840672, 10.053584443849103991, 70.61262299147711019, + 67.151209977553662611, 90.406264186287444318, 21.489243706280831248, 12.013901176393119385, + 9.6976005669348523952, 30.210280025170504814, 6.8617634871770860627, 127.03842094477658975, + 38.929792110964626772, 25.235405937299219659, 74.173667659859347623, 21.526803119319083635, + 33.151999474303011084, 18.932138270029099658, 57.985288037307327613, 74.413325913377775578, + 47.661954530547518516, 105.61108629134469084, 111.78184808668811456, 102.05195473563799169, + 66.186613022484380053, 3.6953054368459561374, 60.043703071391064441, 68.386085665613791207, + 123.41290226421187981, 75.037953333518089494, 108.82733138037656317, 84.620775204053643392, + 120.74069998342747567, 120.64515964098609402, 118.74759287264168961, 66.083996538476640126, + 99.856893511136149755, 60.127364409647270804, 53.236117134769301629, 24.422387504502694355, + 47.540286310078954557, 95.990356733833323233, 78.382996330659807427, 50.612948557412892114, + 19.867254457025410375, 68.100637901075970149, 29.004475618530705106, 17.852269676186551806, + 110.84232191265255096, 16.327795025063096546, 10.496038902641885215, 48.717100503996334737, + 109.86758287052361993, 107.11863664519478334, 67.901265997410519049, 118.12409247503092047, + 62.071128679301182274, 87.448532354945200495, 43.547507001596386544, 112.94020338736299891, + 105.38635256192355882, 125.52413093382347142, 88.825684325402107788, 115.29227248551615048, + 106.66644258038286353, 113.50406263940749341, 26.33292826071192394, 92.242662002779979957, + 3.8407082992343930528, 73.753323926408484112, 16.581930422351433663, 94.169319946646282915, + 92.56054768093599705, 29.987817761277256068, 62.829052732016862137, 102.32029600211171783, + 123.95988709207085776, 104.19678878197373706, 56.616716790384089109, 80.990102736359403934, + 111.11591013100041891, 98.508501919073751196, 80.604275011824938701, 49.522350442330207443, + 111.00985722179029835, 29.95062065688034636, 2.3976479955890681595, 5.1330174346985586453, + 63.845077124551607994, 100.20563585833588149, 33.694264681249478599, 107.70154348971118452, + 64.334546007117751287, 38.025382480700500309, 120.32984969303288381, 97.805319440256425878, + 94.920771707566018449, 92.734364448137057479, 26.810581955029192613, 21.303565186601190362, + 65.267258529489481589, 73.070619941827317234, 104.7591635716453311, 19.090366767999512376, + 121.54492703869618708, 78.330361428987089312, 123.97454843510786304, 7.7332093858385633212, + 112.60949035876183189, 103.6998439299823076, 0.69689644691607099958, 76.143490617203497095, + 78.03619751714359154, 57.981734046978090191, 14.368728092558740173, 67.141263755031104665, + 59.36215743662614841, 22.476111963747825939, 59.994429744096123613, 19.60757999270936125, + 53.963929843081132276, 112.93694658801905462, 16.848767192310333485, 28.299185003623279044, + 44.969958178968227003, 49.551657972649991279, 0.64843949714486370794, 32.129598839368554763, + 72.332573023559234571, 66.302426958423893666, 110.89283548997991602, 39.91267608051202842, + 13.634927663850248791, 10.809381015711551299, 73.494828013303049374, 124.98223957163281739, + 63.768594065950310323, 92.024466577338898787, 90.392828280710091349, 22.95746347950262134, + 34.179813883103633998, 117.16731870654257364, 32.894195589171431493, 108.93290840733243385, + 11.987361831041198457, 27.634549295202305075, 45.349999228528758977, 43.354379900370986434, + 76.259820067778491648, 36.017883745822473429, 6.1187286079111800063, 33.779924812166427728, + 30.93826686935062753, 121.45303725294434116, 7.0978410086827352643, 76.403539933988213306, + 6.9345355466612090822, 95.031909411220112815, 16.0452032115572365, 72.26665327703449293, + 87.750826239567686571, 48.972710095698857913, 50.169109670347097563, 88.431189652372268029, + 0.5006040672815288417, 117.2889208150372724, 100.35725799232386635, 60.60214007216563914, + 25.615303831644268939, 106.63923812894790899, 59.366628536092321156, 23.075936997101962334, + 81.424723983764124569, 63.015486719446926145, 8.0212882863415870816, 30.815984040542389266, + 45.882513182579714339, 84.729925773255672539, 29.603260900199529715, 121.64509074996749405, + 22.933396864562382689, 12.462197030010429444, 123.49837423622739152, 68.341774387285113335, + 109.49032897657889407, 75.438946904221666045, 83.49482241039731889, 81.931615515826706542, + 115.68354184960844577, 0.67173078052655910142, 57.376964829687494785, 119.57578389648188022, + 71.553398424432089087, 110.57868828155915253, 39.415136707324563758, 60.164448971263482235, + 14.564361117409134749, 120.35728413681863458, 17.435276206851995084, 78.605888946385675808, + 0.46081043158119427972, 59.49091027081158245, 85.623518718875857303, 52.294867303313367302, + 76.389609224817832001, 72.525884507213049801, 16.096771126045496203, 107.70103367813499062, + 54.935181611166626681, 11.428507067808823194, 71.208465644773241365, 107.25424085115810158, + 105.29669203544472111, 7.8517862834560219198, 43.185138837146951118, 54.872863268457876984, + 127.42878716421910212, 22.779026972726569511, 12.878913650954928016, 33.499542192043008981, + 113.25627488181635272, 24.167644340002880199, 124.96261296837838017, 101.61849111243282096, + 36.42092963671166217, 4.1986763081658864394, 75.612817015866312431, 76.247485155356116593, + 5.1528835401441028807, 93.352652498011593707, 66.298104023364430759, 37.522514423744723899, + 0.6613251964226947166, 11.489531297018402256, 102.74554680482833646, 23.415216531819169177, + 16.91286593981567421, 55.03449546781484969, 62.886177849472005619, 95.98678589150949847, + 22.626080536898371065, 121.6028145091040642, 102.08096876878698822, 109.19907405697085778, + 115.9299142877353006, 23.669946836856979644, 13.253950753663957585, 84.002437610641209176, + 67.015391470289614517, 72.828513021559047047, 14.335872019706584979, 90.801305711207533022, + 24.175628530436370056, 106.40881599726708373, 88.538934649361181073, 97.41940826918289531, + 70.650494761081063189, 5.9588972972560441121, 41.165786743687931448, 51.131704117568006041, + 118.31120335881860228, 101.30241435805146466, 22.068757539214857388, 33.333072419387463015, + 97.723794788893428631, 51.328308566880878061, 13.595882532259565778, 83.696086261534219375, + 31.277147525630425662, 100.60622780624544248, 114.95548314204643248, 23.55328842526068911, + 30.114702406368451193, 101.96614643089924357, 37.551343722818273818, 43.231704924382938771, + 112.89157313464602339, 125.16387694510194706, 79.51670373556407867, 23.500522099431691458, + 113.20787641379138222, 12.064593748615152435, 121.39591736971851788, 51.370552993033925304, + 14.208229049800138455, 115.16300640751433093, 32.089381597066676477, 18.913353083557012724, + 69.422761323516169796, 80.755982951817713911, 124.17312639508236316, 39.936515777328168042, + 42.69415228269281215, 89.924708995033142855, 18.970778764742135536, 13.733472531268489547, + 43.329778363076911774, 64.925002267715171911, 36.408918325480044587, 11.222467805790074635, + 6.7082969762559514493, 42.245305959433608223, 65.499015725257777376, 52.930552608224388678, + 66.415845206585800042, 77.120834146466222592, 92.759557636512909085, 78.19614069227463915, + 100.04422520817024633, 28.185618658444582252, 19.163475292407383677, 113.33073968323878944, + 75.048917545016593067, 38.286477447865763679, 77.861884958605514839, 95.767295672892942093, + 95.880582908041105838, 60.20624339030473493, 11.858206856293691089, 60.805830023982707644, + 77.672620664336136542, 28.407059730012406362, 48.565974934543191921, 11.407320727019396145, + 97.057611155498307198, 122.85059098130295752, 80.789054917830071645, 57.904614957547892118, + 17.338324444761383347, 122.68172189649339998, 5.2180112172136432491, 84.423048392800410511, + 61.290041644013399491, 50.397087603709223913, 105.56651081126256031, 78.283281924650509609, + 16.905463118018815294, 5.3300440104903827887, 66.522809013542428147, 127.59358356359734898, + 59.858724941750551807, 118.33257342393699219, 55.281754362207720987, 24.658295459321379894, + 115.4444109386386117, 84.061349784355115844, 127.57858616595331114, 113.29294807869882789, + 14.619112520813359879, 90.857525186467682943, 72.440054939172114246, 81.89334282377967611, + 61.648758714611176401, 1.1716952925562509336, 17.072157966329541523, 42.12095602987028542, + 86.153680873176199384, 103.96776688405225286, 116.42465510396868922, 45.949088172652409412, + 49.931944783940707566, 17.598780234016885515, 80.318799103108176496, 66.28185756193488487, + 66.449647158638981637, 124.49296146993219736, 94.706984207616187632, 35.767649320612690644, + 38.746943029764224775, 90.748464431140746456, 4.7645747671886056196, 5.6554976199768134393, + 20.107168887701845961, 13.225245982957858359, 6.3024199551109632012, 52.812528372574888635, + 42.978487412561662495, 24.027802352786238771, 19.39520113386970479, 60.420560050344647607, + 13.723526974357810104, 126.0768418895531795, 77.859584221929253545, 50.470811874602077296, + 20.347335319718695246, 43.05360623863816727, 66.303998948606022168, 37.864276540058199316, + 115.97057607461829321, 20.826651826755551156, 95.323909061098675011, 83.222172582693019649, + 95.563696173379867105, 76.103909471279621357, 4.3732260449687601067, 7.3906108736919122748, + 120.08740614278576686, 8.7721713312312203925, 118.8258045284273976, 22.075906667039816966, + 89.654662760756764328, 41.241550408110924764, 113.48139996685858932, 113.29031928197582602, + 109.4951857452870172, 4.1679930769569182303, 71.713787022272299509, 120.25472881929454161, + 106.47223426953860326, 48.844775009005388711, 95.080572620161547093, 63.980713467670284444, + 28.765992661319614854, 101.22589711482578423, 39.734508914054458728, 8.2012758021519402973, + 58.008951237061410211, 35.70453935237674159, 93.684643825305101927, 32.655590050126193091, + 20.992077805283770431, 97.434201007996307453, 91.735165741050877841, 86.237273290393204661, + 7.802531994824676076, 108.24818495006184094, 124.14225735860600253, 46.897064709890400991, + 87.095014003196411068, 97.880406774729635799, 82.772705123850755626, 123.04826186765058083, + 49.651368650807853555, 102.58454497103593894, 85.332885160769365029, 99.008125278814986814, + 52.665856521427485859, 56.485324005559959915, 7.6814165984724240843, 19.506647852816968225, + 33.163860844706505304, 60.338639893296203809, 57.121095361871994101, 59.975635522554512136, + 125.65810546403736225, 76.64059200422707363, 119.9197741841453535, 80.393577563947474118, + 113.2334335807718162, 33.980205472722445847, 94.231820262004475808, 69.017003838151140371, + 33.208550023649877403, 99.044700884664052865, 94.019714443580596708, 59.901241313760692719, + 4.7952959911781363189, 10.266034869397117291, 127.69015424910685397, 72.411271716671762988, + 67.388529362502595177, 87.403086979426007019, 0.66909201423550257459, 76.050764961404638598, + 112.65969938606940559, 67.610638880516489735, 61.841543415135674877, 57.468728896274114959, + 53.621163910058385227, 42.607130373206018703, 2.5345170589826011565, 18.141239883658272447, + 81.518327143290662207, 38.180733536002662731, 115.08985407739601214, 28.660722857977816602, + 119.94909687021572609, 15.466418771680764621, 97.218980717527301749, 79.3996878599646152, + 1.393792893835779978, 24.286981234410632169, 28.07239503428718308, 115.96346809395618038, + 28.737456185121118324, 6.2825275100622093305, 118.72431487325229682, 44.952223927495651878, + 119.98885948819224723, 39.215159985418722499, 107.92785968616590253, 97.873893176038109232, + 33.69753438462066697, 56.598370007246558089, 89.939916357936454006, 99.103315945299982559, + 1.2968789942897274159, 64.259197678740747506, 16.66514604712210712, 4.6048539168514253106, + 93.785670979959832039, 79.825352161024056841, 27.269855327700497583, 21.618762031426740577, + 18.989656026609736728, 121.96447914326563478, 127.53718813190425863, 56.048933154681435553, + 52.785656561420182697, 45.914926959005242679, 68.359627766210905975, 106.33463741308514727, + 65.788391178346500965, 89.865816814664867707, 23.974723662082396913, 55.26909859040461015, + 90.699998457057517953, 86.708759800745610846, 24.519640135556983296, 72.035767491644946858, + 12.237457215822360013, 67.559849624332855456, 61.87653373870489304, 114.90607450588868232, + 14.195682017369108507, 24.807079867976426613, 13.869071093326056143, 62.063818822440225631, + 32.090406423118110979, 16.53330655407262384, 47.501652479135373142, 97.945420191397715826, + 100.3382193406978331, 48.862379304744536057, 1.0012081345666956622, 106.57784163007818279, + 72.714515984647732694, 121.20428014433127828, 51.230607663292175857, 85.27847625789581798, + 118.73325707218464231, 46.151873994207562646, 34.849447967528249137, 126.03097343889385229, + 16.042576572683174163, 61.631968081084778532, 91.765026365163066657, 41.459851546511345077, + 59.206521800402697409, 115.2901814999349881, 45.866793729124765377, 24.924394060024496866, + 118.99674847245842102, 8.6835487745738646481, 90.980657953161426121, 22.87789380844697007, + 38.989644820798275759, 35.863231031657051062, 103.36708369921689155, 1.3434615610531182028, + 114.75392965937862755, 111.15156779296739842, 15.106796848867816152, 93.157376563118305057, + 78.830273414649127517, 120.32889794252696447, 29.128722234821907477, 112.71456827363726916, + 34.870552413707628148, 29.211777892771351617, 0.92162086316238855943, 118.98182054162680288, + 43.247037437751714606, 104.58973460663037258, 24.77921844963930198, 17.051769014426099602, + 32.193542252094630385, 87.402067356269981246, 109.87036322233325336, 22.857014135621284368, + 14.416931289550120709, 86.508481702319841133, 82.593384070889442228, 15.70357256691204384, + 86.370277674293902237, 109.74572653691939195, 126.85757432843820425, 45.558053945453139022, + 25.757827301909856033, 66.999084384089655941, 98.512549763632705435, 48.335288680009398377, + 121.92522593676039833, 75.236982224865641911, 72.841859273423324339, 8.3973526163354108576, + 23.225634031736262841, 24.494970310712233186, 10.30576708029184374, 58.705304996026825393, + 4.5962080467288615182, 75.045028847489447799, 1.3226503928453894332, 22.979062594040442491, + 77.491093609656672925, 46.830433063638338353, 33.82573187963134842, 110.06899093562969938, + 125.77235569894764922, 63.973571783018996939, 45.252161073800380109, 115.20562901821176638, + 76.161937537577614421, 90.398148113945353543, 103.85982857547060121, 47.339893673713959288, + 26.507901507331553148, 40.00487522128605633, 6.0307829405828670133, 17.657026043118094094, + 28.671744039416807937, 53.602611422415066045, 48.351257060876378091, 84.81763199453780544, + 49.077869298726000125, 66.838816538369428599, 13.300989522162126377, 11.917794594512088224, + 82.331573487375862896, 102.26340823513965006, 108.62240671764084254, 74.60482871610292932, + 44.137515078429714777, 66.666144838778564008, 67.447589577786857262, 102.65661713376175612, + 27.191765064522769535, 39.39217252306843875, 62.554295051264489302, 73.212455612494522939, + 101.91096628409286495, 47.106576850521378219, 60.229404812740540365, 75.932292861798487138, + 75.102687445636547636, 86.46340984876951552, 97.78314626929568476, 122.32775389020753209, + 31.03340747112815734, 47.001044198867020896, 98.415752827582764439, 24.12918749723394285, + 114.79183473943703575, 102.74110598606785061, 28.416458099603914889, 102.32601281502866186, + 64.178763194133352954, 37.826706167117663426, 10.84552264703597757, 33.5119659036390658, + 120.34625279016472632, 79.873031554656336084, 85.388304565389262279, 51.849417990066285711, + 37.941557529484271072, 27.466945062536979094, 86.659556726157461526, 1.8500045354303438216, + 72.817836650960089173, 22.444935611580149271, 13.416593952511902899, 84.490611918870854424, + 2.9980314505155547522, 105.86110521645241533, 4.8316904131752380636, 26.241668292936083162, + 57.519115273029456148, 28.392281384552916279, 72.088450416340492666, 56.371237316889164504, + 38.326950584818405332, 98.661479366481216857, 22.097835090033186134, 76.572954895735165337, + 27.723769917214667657, 63.534591345789522165, 63.761165816082211677, 120.41248678060946986, + 23.716413712587382179, 121.61166004796905327, 27.345241328672273085, 56.814119460024812724, + 97.131949869086383842, 22.814641454042430269, 66.115222311000252375, 117.70118196260955301, + 33.57810983566014329, 115.80922991509578424, 34.676648889526404673, 117.36344379298679996, + 10.436022434430924477, 40.846096785600821022, 122.58008328802679898, 100.7941752074220858, + 83.133021622528758598, 28.566563849301019218, 33.810926236037630588, 10.660088020984403556, + 5.0456180270884942729, 127.18716712719469797, 119.71744988350474159, 108.66514684787398437, + 110.56350872441544197, 49.316590918646397768, 102.88882187728086137, 40.122699568713869667, + 127.15717233191026025, 98.58589615739765577, 29.238225041630357737, 53.715050372939003864, + 16.88010987834786647, 35.786685647559352219, 123.2975174292223528, 2.3433905851125018671, + 34.144315932659083046, 84.241912059744208818, 44.307361746356036747, 79.935533768108143704, + 104.84931020793737844, 91.898176345304818824, 99.863889567881415132, 35.197560468037409009, + 32.637598206219990971, 4.5637151238734077197, 4.899294317281601252, 120.9859229398680327, + 61.413968415232375264, 71.535298641225381289, 77.493886059532087529, 53.496928862281492911, + 9.5291495343772112392, 11.310995239953626879, 40.214337775403691921, 26.450491965915716719, + 12.604839910221926402, 105.62505674514977727, 85.95697482512332499, 48.055604705572477542, + 38.790402267739409581, 120.84112010069293319, 27.447053948719258187, 124.15368377910999698, + 27.719168443858507089, 100.94162374920415459, 40.694670639437390491, 86.107212477279972518, + 4.6079978972120443359, 75.728553080120036611, 103.94115214923658641, 41.65330365351474029, + 62.647818122200988, 38.444345165389677277, 63.127392346763372188, 24.207818942559242714, + 8.7464520899375202134, 14.781221747387462528, 112.17481228557153372, 17.544342662466078764, + 109.6516090568547952, 44.151813334083271911, 51.309325521513528656, 82.483100816225487506, + 98.962799933720816625, 98.58063856395529001, 90.990371490574034397, 8.3359861539174744394, + 15.427574044548236998, 112.5094576385927212, 84.944468539077206515, 97.6895500180144154, + 62.161145240323094185, 127.96142693534056889, 57.531985322642867686, 74.451794229651568457, + 79.469017828108917456, 16.402551604303880595, 116.01790247412282042, 71.409078704757121159, + 59.369287650610203855, 65.311180100252386183, 41.98415561057117884, 66.868402015996252885, + 55.470331482105393661, 44.474546580786409322, 15.605063989652990131, 88.496369900127319852, + 120.28451471721200505, 93.79412941978443996, 46.190028006396460114, 67.760813549462909577, + 37.545410247705149231, 118.09652373530116165, 99.302737301619345089, 77.169089942075515864, + 42.665770321542368038, 70.016250557629973628, 105.33171304285497172, 112.97064801111991983, + 15.362833196944848169, 39.01329570563393645, 66.327721689413010608, 120.67727978659240762, + 114.2421907237439882, 119.95127104511266225, 123.31621092807836249, 25.281184008457785239, + 111.83954836829434498, 32.787155127898586215, 98.466867161543632392, 67.960410945448529674, + 60.463640524012589594, 10.034007676302280743, 66.417100047303392785, 70.089401769331743708, + 60.039428887161193416, 119.80248262752138544, 9.5905919823562726378, 20.53206973879787256, + 127.38030849821734591, 16.822543433347163955, 6.7770587250088283326, 46.806173958852014039, + 1.338184028474643128, 24.101529922812915174, 97.319398772142449161, 7.2212777610329794697, + 123.68308683027134975, 114.93745779254822992, 107.24232782011677045, 85.214260746412037406, + 5.0690341179652023129, 36.282479767320182873, 35.036654286581324413, 76.361467072008963441, + 102.17970815479202429, 57.321445715959271183, 111.89819374043145217, 30.932837543365167221, + 66.437961435058241477, 30.799375719929230399, 2.7875857876715599559, 48.573962468821264338, + 56.144790068578004139, 103.92693618791236077, 57.474912370242236648, 12.56505502012805664, + 109.44862974650459364, 89.904447854994941736, 111.97771897638449445, 78.430319970841082977, + 87.85571937233544304, 67.747786352076218463, 67.395068769241333939, 113.19674001449675416, + 51.87983271587654599, 70.206631890599965118, 2.5937579885830928106, 0.5183953574814950116, + 33.33029209424421424, 9.2097078337064886, 59.571341959923302056, 31.650704322048113681, + 54.539710655400995165, 43.237524062853481155, 37.979312053223111434, 115.92895828653490753, + 127.07437626380851725, 112.09786630936287111, 105.57131312284036539, 91.829853918014123337, + 8.7192555324254499283, 84.669274826173932524, 3.5767823566966399085, 51.731633629329735413, + 47.949447324164793827, 110.53819718081285828, 53.399996914118673885, 45.417519601491221692, + 49.03928027111760457, 16.071534983289893717, 24.474914431648358004, 7.1196992486657109112, + 123.75306747741342406, 101.81214901177736465, 28.391364034738217015, 49.614159735952853225, + 27.738142186652112287, 124.12763764488045126, 64.180812846236221958, 33.066613108145247679, + 95.003304958274384262, 67.89084038279906963, 72.676438681395666208, 97.724758609489072114, + 2.0024162691370293032, 85.155683260160003556, 17.429031969299103366, 114.40856028866255656, + 102.46121532658798969, 42.556952515795273939, 109.46651414436928462, 92.303747988415125292, + 69.698895935060136253, 124.06194687778770458, 32.085153145366348326, 123.26393616217319504, + 55.530052730326133315, 82.919703093022690155, 118.4130436008090328, 102.58036299986997619, + 91.733587458249530755, 49.848788120052631712, 109.99349694491684204, 17.367097549151367275, + 53.961315906322852243, 45.75578761689394014, 77.979289641596551519, 71.726462063317740103, + 78.734167398433783092, 2.6869231221098743845, 101.50785931876089307, 94.303135585934796836, + 30.213593697739270283, 58.314753126240248093, 29.660546829301893013, 112.65779588505392894, + 58.257444469647452934, 97.429136547274538316, 69.741104827415256295, 58.423555785542703234, + 1.8432417263284150977, 109.96364108325360576, 86.49407487550706719, 81.179469213260745164, + 49.55843689927860396, 34.103538028852199204, 64.387084504192898748, 46.804134712543600472, + 91.740726444666506723, 45.714028271242568735, 28.833862579103879398, 45.016963404643320246, + 37.186768141778884456, 31.407145133827725658, 44.740555348591442453, 91.491453073842421873, + 125.7151486568764085, 91.116107890906278044, 51.515654603823350044, 5.9981687681829498615, + 69.02509952726541087, 96.670577360022434732, 115.85045187352443463, 22.4739644497349218, + 17.683718546846648678, 16.794705232670821715, 46.451268063472525682, 48.989940621424466372, + 20.611534160583687481, 117.41060999205365079, 9.1924160934613610152, 22.090057694978895597, + 2.6453007856907788664, 45.958125188084522961, 26.98218721931334585, 93.660866127276676707, + 67.651463759266334819, 92.137981871263036737, 123.54471139789529843, 127.94714356603799388, + 90.504322147604398197, 102.41125803642717074, 24.323875075158866821, 52.796296227894345066, + 79.719657150941202417, 94.679787347427918576, 53.015803014663106296, 80.009750442572112661, + 12.061565881165734027, 35.314052086236188188, 57.343488078833615873, 107.20522284483013209, + 96.702514121756394161, 41.63526398907561088, 98.155738597455638228, 5.6776330767388571985, + 26.601979044324252754, 23.835589189027814427, 36.663146974755363772, 76.526816470282938099, + 89.244813435285323067, 21.20965743220585864, 88.275030156863067532, 5.3322896775607659947, + 6.8951791555773525033, 77.313234267523512244, 54.38353012904553907, 78.7843450461368775, + 125.10859010253261658, 18.424911224992683856, 75.821932568185729906, 94.213153701042756438, + 120.45880962548471871, 23.864585723600612255, 22.205374891276733251, 44.926819697542669019, + 67.5662925385950075, 116.65550778041506419, 62.06681494225631468, 94.00208839773767977, + 68.831505655165528879, 48.258374994471523678, 101.58366947887770948, 77.482211972135701217, + 56.832916199211467756, 76.652025630060961703, 0.35752638826670590788, 75.653412334235326853, + 21.691045294071955141, 67.023931807281769579, 112.69250558033309062, 31.746063109316310147, + 42.776609130778524559, 103.69883598013257142, 75.883115058968542144, 54.933890125077596167, + 45.319113452314923052, 3.7000090708643256221, 17.635673301920178346, 44.889871223160298541, + 26.833187905027443776, 40.981223837741708849, 5.9960629010347474832, 83.722210432904830668, + 9.6633808263504761271, 52.483336585872166324, 115.0382305460589123, 56.784562769109470537, + 16.176900832680985332, 112.74247463377832901, 76.653901169640448643, 69.322958732962433714, + 44.195670180070010247, 25.145909791470330674, 55.447539834429335315, 127.06918269157904433, + 127.52233163216806133, 112.82497356121893972, 47.432827425178402336, 115.22332009593810653, + 54.690482657344546169, 113.62823892005326343, 66.263899738172767684, 45.629282908088498516, + 4.2304446220041427296, 107.40236392521910602, 67.156219671323924558, 103.61845983019156847, + 69.353297779056447325, 106.72688758597359993, 20.872044868861848954, 81.692193571205280023, + 117.16016657605723594, 73.588350414847809589, 38.266043245057517197, 57.133127698602038436, + 67.621852472075261176, 21.320176041968807112, 10.091236054180626525, 126.37433425439303392, + 111.43489976701312116, 89.33029369575160672, 93.12701744883088395, 98.633181837296433514, + 77.777643754561722744, 80.245399137431377312, 126.31434466382415849, 69.17179231479531154, + 58.476450083260715473, 107.43010074587800773, 33.76021975669573294, 71.573371295122342417, + 118.59503485844470561, 4.6867811702250037342, 68.288631865321804071, 40.483824119488417637, + 88.614723492715711473, 31.871067536219925387, 81.698620415878394851, 55.796352690613275627, + 71.727779135762830265, 70.395120936074818019, 65.275196412439981941, 9.1274302477468154393, + 9.7985886345668404829, 113.9718458797360654, 122.82793683046838851, 15.070597282454400556, + 26.987772119064175058, 106.99385772456298582, 19.058299068754422478, 22.621990479907253757, + 80.428675550807383843, 52.900983931831433438, 25.209679820447490783, 83.250113490303192521, + 43.913949650246649981, 96.111209411144955084, 77.58080453548245714, 113.68224020138950436, + 54.894107897442154353, 120.30736755821999395, 55.438336887720652157, 73.883247498408309184, + 81.389341278878418962, 44.214424954559945036, 9.2159957944277266506, 23.457106160243711201, + 79.882304298473172821, 83.30660730702948058, 125.295636244401976, 76.888690330779354554, + 126.25478469352674438, 48.415637885118485428, 17.492904179875040427, 29.562443494778563036, + 96.349624571143067442, 35.088685324935795506, 91.303218113709590398, 88.303626668166543823, + 102.61865104303069529, 36.966201632454612991, 69.925599867445271229, 69.161277127914217999, + 53.980742981148068793, 16.671972307834948879, 30.855148089100111974, 97.018915277189080371, + 41.888937078158051008, 67.3791000360288308, 124.32229048064982635, 127.92285387068113778, + 115.06397064528937335, 20.903588459306774894, 30.938035656217834912, 32.805103208611399168, + 104.03580494824927882, 14.818157409514242318, 118.73857530122404569, 2.6223602005047723651, + 83.96831122114599566, 5.7368040319925057702, 110.94066296421078732, 88.949093161572818644, + 31.21012797930961824, 48.992739800258277683, 112.56902943442764808, 59.588258839568879921, + 92.380056012796558207, 7.5216270989258191548, 75.090820495413936442, 108.19304747060596128, + 70.605474603242328158, 26.338179884151031729, 85.331540643088374054, 12.032501115263585234, + 82.663426085713581415, 97.941296022239839658, 30.725666393889696337, 78.026591411271510879, + 4.6554433788296591956, 113.35455957318845321, 100.48438144749161438, 111.90254209022896248, + 118.63242185615672497, 50.562368016919208458, 95.679096736588689964, 65.57431025580081041, + 68.933734323090902762, 7.9208218908970593475, 120.92728104802517919, 20.068015352608199464, + 4.8342000946104235481, 12.178803538663487416, 120.07885777432602481, 111.60496525504277088, + 19.181183964712545276, 41.064139477599383099, 126.76061699643469183, 33.645086866694327909, + 13.554117450017656665, 93.612347917704028077, 2.676368056949286256, 48.203059845629468327, + 66.638797544284898322, 14.442555522069596918, 119.36617366054633749, 101.87491558510009781, + 86.484655640237178886, 42.428521492824074812, 10.138068235930404626, 72.564959534640365746, + 70.073308573166286806, 24.722934144021564862, 76.359416309584048577, 114.64289143192218035, + 95.79638748086290434, 61.865675086733972421, 4.8759228701164829545, 61.598751439858460799, + 5.5751715753431199118, 97.147924937642528675, 112.28958013715964626, 79.85387237582472153, + 114.9498247404844733, 25.130110040259751258, 90.89725949301282526, 51.80889570999352145, + 95.955437952772626886, 28.860639941685803933, 47.71143874467452406, 7.4955727041560749058, + 6.7901375384863058571, 98.393480028993508313, 103.75966543175672996, 12.413263781199930236, + 5.1875159771661856212, 1.0367907149629900232, 66.660584188488428481, 18.4194156674129772, + 119.14268391984660411, 63.301408644096227363, 109.07942131080199033, 86.47504812570696231, + 75.958624106449860847, 103.85791657307345304, 126.14875252762067248, 96.195732618729380192, + 83.142626245684368769, 55.659707836028246675, 17.438511064854537835, 41.338549652347865049, + 7.153564713393279817, 103.46326725865947083, 95.898894648333225632, 93.076394361625716556, + 106.79999382823734777, 90.835039202982443385, 98.078560542235209141, 32.143069966579787433, + 48.949828863296716008, 14.239398497335059801, 119.50613495483048609, 75.624298023554729298, + 56.78272806947643403, 99.22831947190570645, 55.476284373307862552, 120.2552752897645405, + 0.3616256924724439159, 66.133226216294133337, 62.006609916552406503, 7.7816807656017772388, + 17.352877362794970395, 67.449517218978144228, 4.0048325382776965853, 42.311366520320007112, + 34.858063938601844711, 100.8171205773287511, 76.922430653175979387, 85.113905031594185857, + 90.933028288742207224, 56.607495976833888562, 11.397791870123910485, 120.12389375557540916, + 64.170306290736334631, 118.52787232434639009, 111.06010546065590461, 37.839406186049018288, + 108.82608720162170357, 77.160725999743590364, 55.46717491649906151, 99.697576240108901402, + 91.986993889833684079, 34.73419509830273455, 107.92263181264570449, 91.511575233791518258, + 27.958579283196741017, 15.452924126639118185, 29.468334796867566183, 5.3738462442233867478, + 75.015718637525424128, 60.606271171869593672, 60.427187395478540566, 116.62950625248049619, + 59.321093658607424004, 97.315591770107857883, 116.51488893929854385, 66.85827309455271461, + 11.482209654830512591, 116.84711157108540647, 3.6864834526604681741, 91.927282166510849493, + 44.98814975101777236, 34.358938426521490328, 99.11687379855720792, 68.207076057708036387, + 0.77416900838579749689, 93.608269425090838922, 55.481452889333013445, 91.42805654248513747, + 57.667725158207758795, 90.033926809286640491, 74.373536283557768911, 62.814290267655451316, + 89.481110697186522884, 54.982906147688481724, 123.43029731375645497, 54.232215781812556088, + 103.03130920764670009, 11.996337536369537702, 10.050199054534459719, 65.341154720048507443, + 103.70090374704886926, 44.9479288994698436, 35.367437093693297356, 33.58941046534164343, + 92.902536126945051365, 97.979881242848932743, 41.22306832117101294, 106.82121998410730157, + 18.38483218692272203, 44.180115389957791194, 5.2906015713815577328, 91.916250376169045921, + 53.964374438630329678, 59.321732254556991393, 7.3029275185363076162, 56.275963742529711453, + 119.08942279579423484, 127.89428713207962574, 53.008644295212434372, 76.822516072854341473, + 48.647750150317733642, 105.59259245579232811, 31.439314301886042813, 61.359574694855837151, + 106.03160602932985057, 32.019500885144225322, 24.123131762331468053, 70.628104172472376376, + 114.68697615767086972, 86.410445689663902158, 65.405028243512788322, 83.270527978154859738, + 68.311477194911276456, 11.355266153477714397, 53.203958088648505509, 47.671178378055628855, + 73.326293949514365522, 25.053632940569514176, 50.489626870570646133, 42.41931486441535526, + 48.550060313726135064, 10.664579355121531989, 13.790358311158342985, 26.626468535047024488, + 108.76706025809471612, 29.568690092277392978, 122.21718020506523317, 36.84982244998900569, + 23.643865136375097791, 60.426307402089150855, 112.91761925096943742, 47.72917144720122451, + 44.410749782553466503, 89.853639395088976016, 7.1325850771936529782, 105.31101556083012838, + 124.13362988451626734, 60.004176795478997519, 9.6630113103310577571, 96.516749988946685335, + 75.167338957759056939, 26.964423944271402434, 113.66583239842657349, 25.304051260121923406, + 0.71505277653704979457, 23.306824668470653705, 43.38209058814754826, 6.0478636145671771374, + 97.38501116066618124, 63.492126218632620294, 85.553218261560687097, 79.397671960268780822, + 23.766230117937084287, 109.86778025015519233, 90.638226904629846103, 7.4000181417286512442, + 35.271346603840356693, 89.779742446320597082, 53.666375810054887552, 81.962447675483417697, + 11.992125802073132945, 39.444420865809661336, 19.326761652700952254, 104.96667317174797063, + 102.07646109211782459, 113.56912553821894107, 32.353801665365608642, 97.484949267560295993, + 25.307802339284535265, 10.645917465924867429, 88.391340360140020493, 50.291819582940661348, + 110.89507966886230861, 126.13836538316172664, 127.04466326433976064, 97.649947122437879443, + 94.865654850360442651, 102.44664019187621307, 109.38096531469273032, 99.256477840110164834, + 4.5277994763455353677, 91.258565816176997032, 8.4608892440119234379, 86.804727850441850023, + 6.3124393426514870953, 79.236919660386774922, 10.706595558116532629, 85.453775171947199851, + 41.744089737727335887, 35.384387142414198024, 106.32033315211810987, 19.176700829695619177, + 76.532086490115034394, 114.26625539720771485, 7.2437049441505223513, 42.640352083937614225, + 20.182472108364891028, 124.74866850878970581, 94.869799534029880306, 50.660587391506851418, + 58.254034897665405879, 69.266363674596505007, 27.555287509127083467, 32.490798274866392603, + 124.62868932765195495, 10.343584629590623081, 116.95290016652506893, 86.860201491756015457, + 67.520439513395103859, 15.146742590248322813, 109.19006971688941121, 9.3735623404536454473, + 8.5772637306436081417, 80.967648238980473252, 49.229446985431422945, 63.742135072443488752, + 35.397240831756789703, 111.59270538123018923, 15.455558271529298509, 12.790241872153274016, + 2.5503928248799638823, 18.254860495493630879, 19.597177269137318945, 99.943691759475768777, + 117.65587366093677701, 30.141194564908801112, 53.975544238131988095, 85.987715449125971645, + 38.116598137508844957, 45.243980959818145493, 32.857351101614767686, 105.80196786366286688, + 50.419359640898619546, 38.500226980606385041, 87.82789930049693794, 64.222418822293548146, + 27.16160907096855226, 99.364480402779008728, 109.78821579488794669, 112.61473511643998791, + 110.87667377544494229, 19.766494996820256347, 34.778682557756837923, 88.428849909119890071, + 18.431991588855453301, 46.914212320491060382, 31.764608596949983621, 38.613214614062599139, + 122.59127248880758998, 25.777380661562347086, 124.50956938705348875, 96.831275770236970857, + 34.985808359750080854, 59.12488698956076405, 64.699249142286134884, 70.177370649875228992, + 54.606436227422818774, 48.607253336336725624, 77.237302086061390582, 73.93240326491286396, + 11.851199734894180438, 10.322554255828435998, 107.96148596229613759, 33.343944615669897757, + 61.710296178203861928, 66.037830554378160741, 83.777874156319739996, 6.7582000720612995792, + 120.64458096130329068, 127.84570774136591353, 102.1279412905787467, 41.807176918613549788, + 61.876071312435669824, 65.610206417226436315, 80.071609896498557646, 29.636314819032122614, + 109.47715060244809138, 5.244720401013182709, 39.93662244229199132, 11.473608063988649519, + 93.881325928425212624, 49.898186323145637289, 62.42025595861923648, 97.985479600520193344, + 97.138058868855296168, 119.17651767914139782, 56.760112025593116414, 15.043254197855276288, + 22.181640990831510862, 88.386094941215560539, 13.210949206484656315, 52.676359768305701436, + 42.663081286176748108, 24.065002230530808447, 37.326852171430800809, 67.882592044479679316, + 61.451332787783030653, 28.053182822543021757, 9.31088675766295637, 98.709119146380544407, + 72.968762894986866741, 95.805084180461562937, 109.26484371231344994, 101.12473603384205489, + 63.358193473181017907, 3.1486205116052587982, 9.867468646181805525, 15.841643781797756674, + 113.85456209605035838, 40.136030705216398928, 9.6684001892208470963, 24.35760707733061281, + 112.1577155486556876, 95.209930510085541755, 38.362367929425090551, 82.128278955202404177, + 125.52123399286938366, 67.290173733388655819, 27.108234900038951309, 59.224695835408056155, + 5.352736113898572512, 96.406119691262574634, 5.2775950885697966442, 28.885111044142831815, + 110.73234732109631295, 75.749831170203833608, 44.969311280474357773, 84.857042985648149624, + 20.27613647186444723, 17.129919069284369471, 12.146617146332573611, 49.445868288046767702, + 24.718832619171735132, 101.28578286384799867, 63.59277496172580868, 123.73135017346794484, + 9.7518457402329659089, 123.1975028797169216, 11.150343150689877803, 66.29584987528869533, + 96.579160274322930491, 31.707744751653081039, 101.89964948096894659, 50.260220080523140496, + 53.79451898602565052, 103.61779141999068088, 63.910875905545253772, 57.721279883371607866, + 95.422877489349048119, 14.991145408312149812, 13.580275076976249693, 68.786960057990654605, + 79.519330863513459917, 24.826527562399860471, 10.375031954332371242, 2.0735814299296180252, + 5.3211683769768569618, 36.838831334829592379, 110.28536783969320823, 126.6028172881960927, + 90.158842621607618639, 44.950096251417562598, 23.917248212903359672, 79.715833146150544053, + 124.29750505524498294, 64.391465237462398363, 38.285252491368737537, 111.31941567205649335, + 34.877022129709075671, 82.677099304695730098, 14.307129426790197613, 78.926534517322579632, + 63.797789296670089243, 58.152788723255071091, 85.59998765647833352, 53.670078405968524748, + 68.157121084470418282, 64.286139933159574866, 97.899657726593432017, 28.478796994673757581, + 111.01226990966461017, 23.248596047109458596, 113.56545613895650604, 70.456638943811412901, + 110.95256874661936308, 112.51055057952908101, 0.72325138494852581061, 4.2664524325882666744, + 124.01321983310481301, 15.563361531203554478, 34.705754725593578769, 6.8990344379562884569, + 8.0096650765553931706, 84.622733040640014224, 69.716127877207327401, 73.634241154661140172, + 25.844861306355596753, 42.227810063192009693, 53.866056577484414447, 113.21499195366777712, + 22.795583740251458948, 112.2477875111544563, 0.34061258147630724125, 109.05574464869641815, + 94.120210921311809216, 75.678812372101674555, 89.65217440324704512, 26.321451999487180728, + 110.934349833001761, 71.395152480221440783, 55.973987779667368159, 69.468390196609107079, + 87.84526362529504695, 55.023150467583036516, 55.917158566393482033, 30.905848253278236371, + 58.936669593735132366, 10.747692488450411474, 22.031437275050848257, 121.21254234373918734, + 120.85437479096071911, 105.25901250496099237, 118.64218731721848599, 66.631183540219353745, + 105.02977787860072567, 5.7165461891054292209, 22.96441930966466316, 105.69422314217081293, + 7.3729669053245743271, 55.854564333021698985, 89.97629950203554472, 68.717876853046618635, + 70.233747597118053818, 8.4141521154160727747, 1.5483380167752329726, 59.216538850181677844, + 110.96290577866966487, 54.85611308497027494, 115.33545031641915557, 52.067853618576918961, + 20.747072567115537822, 125.62858053531454061, 50.962221394373045769, 109.96581229538060143, + 118.86059462751290994, 108.46443156362875015, 78.062618415293400176, 23.992675072739075404, + 20.100398109072557418, 2.6823094401006528642, 79.401807494097738527, 89.8958577989396872, + 70.734874187386594713, 67.178820930686924839, 57.805072253893740708, 67.959762485697865486, + 82.446136642345663859, 85.642439968214603141, 36.769664373845444061, 88.360230779915582389, + 10.581203142766753444, 55.832500752338091843, 107.92874887726065936, 118.64346450911398279, + 14.605855037072615232, 112.55192748506306089, 110.17884559159210767, 127.78857426415925147, + 106.01728859042850672, 25.645032145708682947, 97.295500300639105262, 83.18518491158465622, + 62.878628603772085626, 122.71914938971531228, 84.063212058659701142, 64.039001770288450643, + 48.246263524666574085, 13.256208344948390732, 101.37395231534537743, 44.820891379331442295, + 2.8100564870292146225, 38.541055956313357456, 8.6229543898225529119, 22.710532306955428794, + 106.40791617729701102, 95.342356756114895688, 18.652587899028731044, 50.107265881139028352, + 100.97925374114129227, 84.838629728830710519, 97.100120627452270128, 21.329158710243063979, + 27.580716622316685971, 53.252937070097686956, 89.534120516189432237, 59.137380184558423935, + 116.43436041013046633, 73.699644899978011381, 47.287730272750195581, 120.85261480418193969, + 97.835238501938874833, 95.458342894402449019, 88.821499565110570984, 51.707278790177952033, + 14.265170154390943935, 82.622031121663894737, 120.26725976903253468, 120.00835359095799504, + 19.326022620665753493, 65.033499977897008648, 22.334677915518113878, 53.928847888546442846, + 99.331664796853146981, 50.608102520243846811, 1.4301055530740995891, 46.613649336941307411, + 86.76418117629509652, 12.095727229137992254, 66.77002232133236248, 126.98425243726887857, + 43.106436523125012172, 30.795343920537561644, 47.532460235877806554, 91.735560500314022647, + 53.276453809259692207, 14.800036283457302488, 70.542693207684351364, 51.559484892641194165, + 107.33275162011341308, 35.924895350966835395, 23.98425160414626589, 78.888841731619322672, + 38.653523305405542487, 81.933346343499579234, 76.152922184239287162, 99.138251076437882148, + 64.707603330734855263, 66.969898535120591987, 50.615604678569070529, 21.291834931853372836, + 48.782680720280040987, 100.58363916588496068, 93.790159337728255196, 124.27673076632709126, + 126.08932652868315927, 67.299894244879396865, 61.731309700724523282, 76.893280383756064111, + 90.761930629389098613, 70.512955680220329668, 9.0555989526947087143, 54.517131632353994064, + 16.921778488027484855, 45.609455700883700047, 12.624878685306612169, 30.473839320773549844, + 21.413191116236703238, 42.907550343894399703, 83.488179475454671774, 70.768774284832034027, + 84.64066630423621973, 38.353401659394876333, 25.064172980233706767, 100.5325107944154297, + 14.487409888301044703, 85.28070416787522845, 40.364944216733420035, 121.4973370175830496, + 61.739599068059760612, 101.32117478301370284, 116.50806979533444974, 10.532727349193010014, + 55.110575018254166935, 64.981596549736423185, 121.25737865530390991, 20.68716925918488414, + 105.90580033305377583, 45.720402983515668893, 7.0408790267902077176, 30.293485180500283604, + 90.380139433778822422, 18.747124680907290895, 17.154527461290854262, 33.935296477960946504, + 98.45889397086284589, 127.4842701448869775, 70.794481663517217385, 95.185410762460378464, + 30.911116543058597017, 25.580483744306548033, 5.1007856497599277645, 36.509720990987261757, + 39.194354538278275868, 71.887383518955175532, 107.31174732187355403, 60.282389129817602225, + 107.95108847626761417, 43.97543089825194329, 76.233196275017689914, 90.487961919636290986, + 65.71470220323317335, 83.603935727325733751, 100.83871928179723909, 77.000453961216408061, + 47.655798600997513859, 0.44483764458709629253, 54.323218141940742498, 70.728960805558017455, + 91.57643158977953135, 97.229470232883613789, 93.753347550889884587, 39.532989993640512694, + 69.557365115517313825, 48.857699818239780143, 36.863983177710906602, 93.828424640982120764, + 63.529217193899967242, 77.226429228128836257, 117.18254497761517996, 51.554761323128332151, + 121.01913877411061549, 65.662551540473941714, 69.971616719500161707, 118.24977397912516608, + 1.3984982845759077463, 12.354741299750457983, 109.21287245484563755, 97.214506672677089227, + 26.474604172126419144, 19.864806529825727921, 23.702399469788360875, 20.645108511660509976, + 87.922971924592275172, 66.687889231339795515, 123.42059235641136183, 4.0756611087599594612, + 39.555748312639479991, 13.516400144126237137, 113.28916192261021934, 127.69141548273546505, + 76.255882581157493405, 83.614353837227099575, 123.75214262487497763, 3.220412834456510609, + 32.143219792997115292, 59.272629638067883207, 90.954301204896182753, 10.489440802026365418, + 79.873244884583982639, 22.947216127980937017, 59.762651856850425247, 99.796372646291274577, + 124.84051191724211094, 67.970959201044024667, 66.276117737714230316, 110.35303535828279564, + 113.52022405118623283, 30.086508395710552577, 44.363281981666659703, 48.772189882431121077, + 26.421898412969312631, 105.35271953661140287, 85.326162572353496216, 48.130004461061616894, + 74.653704342865239596, 7.7651840889593586326, 122.90266557556606131, 56.106365645086043514, + 18.621773515329550719, 69.418238292764726793, 17.93752578997737146, 63.610168360926763853, + 90.529687424630537862, 74.249472067684109788, 126.71638694636203581, 6.2972410232105175965, + 19.73493729236361105, 31.683287563599151326, 99.709124192100716755, 80.272061410432797857, + 19.336800378441694193, 48.715214154664863599, 96.315431097315013176, 62.41986102017108351, + 76.724735858853819082, 36.256557910408446332, 123.04246798574240529, 6.580347466777311638, + 54.216469800077902619, 118.44939167081611231, 10.705472227800783003, 64.812239382525149267, + 10.555190177139593288, 57.77022208828930161, 93.464694642196263885, 23.499662340407667216, + 89.938622560952353524, 41.714085971296299249, 40.552272943728894461, 34.259838138568738941, + 24.293234292665147223, 98.891736576093535405, 49.437665238347108243, 74.571565727695997339, + 127.18554992345525534, 119.46270034693588968, 19.503691480469569797, 118.3950057594338432, + 22.300686301383393584, 4.5916997505810286384, 65.158320548645860981, 63.415489503309800057, + 75.799298961937893182, 100.52044016104628099, 107.58903797205493902, 79.235582839981361758, + 127.82175181109050754, 115.44255976674685371, 62.845754978698096238, 29.982290816624299623, + 27.160550153956137365, 9.5739201159849471878, 31.038661727026919834, 49.653055124799720943, + 20.750063908664742485, 4.1471628598592360504, 10.642336753953713924, 73.677662669662822736, + 92.570735679390054429, 125.20563457639582339, 52.317685243215237278, 89.900192502835125197, + 47.834496425810357323, 31.431666292304726085, 120.59501011049360386, 0.78293047492479672655, + 76.570504982741113054, 94.638831344112986699, 69.75404425942178932, 37.354198609391460195, + 28.614258853584033204, 29.853069034645159263, 127.59557859334017849, 116.30557744651378016, + 43.19997531295666704, 107.34015681194068748, 8.3142421689444745425, 0.5722798663227877114, + 67.799315453186864033, 56.957593989351153141, 94.024539819329220336, 46.49719209422255517, + 99.130912277916650055, 12.91327788762646378, 93.905137493242364144, 97.021101159058162011, + 1.4465027698970516212, 8.5329048651801713277, 120.02643966620962601, 31.126723062407108955, + 69.411509451187157538, 13.798068875912576914, 16.01933015311442432, 41.245466081283666426, + 11.432255754418292781, 19.268482309322280344, 51.689722612711193506, 84.455620126384019386, + 107.73211315497246687, 98.42998390733555425, 45.591167480506555876, 96.495575022308912594, + 0.6812251629562524613, 90.111489297396474285, 60.24042184262725641, 23.357624744206987089, + 51.30434880649409024, 52.642903998977999436, 93.868699666007159976, 14.790304960442881566, + 111.9479755593383743, 10.936780393221852137, 47.6905272505900939, 110.04630093516607303, + 111.83431713278696407, 61.811696506556472741, 117.87333918747026473, 21.495384976900822949, + 44.062874550105334492, 114.42508468748201267, 113.7087495819250762, 82.518025009925622726, + 109.28437463444060995, 5.2623670804423454683, 82.059555757201451343, 11.433092378210858442, + 45.928838619332964299, 83.388446284341625869, 14.745933810649148654, 111.70912866604703595, + 51.952599004074727418, 9.4357537060968752485, 12.467495194236107636, 16.828304230832145549, + 3.0966760335504659452, 118.43307770036699367, 93.925811557339329738, 109.71222616994418786, + 102.67090063283831114, 104.13570723715383792, 41.494145134234713623, 123.25716107062908122, + 101.92444278874972952, 91.931624590764840832, 109.72118925502945785, 88.928863127261138288, + 28.125236830586800352, 47.985350145478150807, 40.200796218145114835, 5.3646188802049437072, + 30.803614988199115032, 51.791715597883012379, 13.469748374776827404, 6.3576418613738496788, + 115.61014450779111939, 7.9195249713993689511, 36.892273284694965696, 43.284879936429206282, + 73.539328747694526101, 48.720461559831164777, 21.162406285533506889, 111.66500150467982166, + 87.85749775452495669, 109.28692901822796557, 29.211710074148868443, 97.103854970129759749, + 92.357691183187853312, 127.57714852832214092, 84.034577180857013445, 51.290064291421003873, + 66.591000601281848503, 38.37036982316931244, 125.75725720754780923, 117.43829877943426254, + 40.126424117323040264, 0.07800354057690128684, 96.49252704933314817, 26.512416689900419442, + 74.747904630690754857, 89.641782758662884589, 5.6201129740584292449, 77.082111912626714911, + 17.245908779645105824, 45.421064613914495567, 84.815832354597660014, 62.684713512229791377, + 37.305175798057462089, 100.21453176228169468, 73.958507482286222512, 41.677259457665059017, + 66.200241254904540256, 42.658317420486127958, 55.161433244633371942, 106.50587414019901189, + 51.068241032378864475, 118.27476036912048585, 104.86872082026457065, 19.399289799956022762, + 94.575460545504029142, 113.70522960836751736, 67.670477003881387645, 62.916685788808536017, + 49.642999130221141968, 103.41455758035590407, 28.530340308785525849, 37.244062243331427453, + 112.53451953806870733, 112.01670718191599008, 38.652045241335144965, 2.0669999557940172963, + 44.669355831036227755, 107.85769577709652367, 70.663329593706293963, 101.21620504048769362, + 2.8602111061481991783, 93.2272986738862528, 45.528362352590193041, 24.191454458279622486, + 5.5400446426683629397, 125.96850487453775713, 86.212873046250024345, 61.590687841075123288, + 95.064920471759251086, 55.471121000628045294, 106.55290761851938441, 29.600072566918242956, + 13.085386415368702728, 103.11896978528602631, 86.665503240226826165, 71.849790701933670789, + 47.96850320829616976, 29.777683463238645345, 77.307046610814722953, 35.866692687002796447, + 24.305844368482212303, 70.276502152879402274, 1.4152066614733485039, 5.9397970702411839738, + 101.23120935713814106, 42.583669863706745673, 97.565361440563719952, 73.16727833177355933, + 59.58031867546014837, 120.5534615326578205, 124.17865305736995651, 6.5997884897587937303, + 123.46261940145268454, 25.786560767515766202, 53.523861258781835204, 13.025911360440659337, + 18.111197905389417429, 109.03426326470798813, 33.843556976054969709, 91.218911401767400093, + 25.249757370613224339, 60.947678641547099687, 42.826382232473406475, 85.815100687792437384, + 38.976358950912981527, 13.537548569667706033, 41.28133260847243946, 76.706803318789752666, + 50.128345960471051512, 73.0650215888308594, 28.974819776605727384, 42.561408335750456899, + 80.729888433470478049, 114.9946740351660992, 123.4791981361231592, 74.642349566031043651, + 105.01613959066889947, 21.065454698386020027, 110.22115003651197185, 1.963193099476484349, + 114.51475731060781982, 41.374338518373406259, 83.81160066610755166, 91.440805967031337786, + 14.081758053580415435, 60.586970361004205188, 52.760278867557644844, 37.494249361814581789, + 34.309054922581708524, 67.870592955925530987, 68.917787941729329759, 126.96854028977759299, + 13.588963327038072748, 62.370821524920756929, 61.822233086117194034, 51.160967488613096066, + 10.201571299519855529, 73.019441981974523515, 78.388709076560189715, 15.774767037913989043, + 86.623494643747108057, 120.56477825963884243, 87.902176952535228338, 87.950861796507524559, + 24.466392550039017806, 52.975923839276219951, 3.4294044064699846786, 39.207871454655105481, + 73.677438563598116161, 26.000907922432816122, 95.311597201995027717, 0.88967528917419258505, + 108.64643628388512298, 13.45792161111603491, 55.15286317956270068, 66.458940465770865558, + 59.506695101779769175, 79.065979987284663366, 11.11473023103462765, 97.715399636479560286, + 73.727966355425451184, 59.656849281964241527, 127.05843438780357246, 26.452858456261310494, + 106.36508995523035992, 103.10952264626030228, 114.03827754822486895, 3.325103080951521406, + 11.943233439003961394, 108.49954795825033216, 2.7969965691518154927, 24.709482599504553946, + 90.425744909694913076, 66.429013345354178455, 52.949208344252838288, 39.729613059651455842, + 47.40479893957672175, 41.29021702332465793, 47.845943849188188324, 5.3757784626832290087, + 118.84118471282272367, 8.1513222175199189223, 79.111496625278959982, 27.032800288256112253, + 98.578323845224076649, 127.38283096547456807, 24.511765162318624789, 39.228707674457837129, + 119.50428524974995526, 6.440825668913021218, 64.286439585994230583, 118.54525927613940439, + 53.908602409792365506, 20.978881604056368815, 31.746489769167965278, 45.894432255961874034, + 119.52530371370448847, 71.592745292586187134, 121.68102383448785986, 7.9419184020916873123, + 4.5522354754320986103, 92.706070716569229262, 99.040448102372465655, 60.173016791421105154, + 88.726563963333319407, 97.544379764862242155, 52.84379682594226324, 82.705439073226443725, + 42.652325144706992432, 96.260008922126871767, 21.307408685730479192, 15.530368177922355244, + 117.80533115113212261, 112.21273129017208703, 37.243547030662739417, 10.836476585529453587, + 35.87505157995474292, 127.22033672185716568, 53.059374849264713703, 20.498944135371857556, + 125.43277389272407163, 12.594482046421035193, 39.4698745847272221, 63.366575127201940631, + 71.418248384205071488, 32.544122820865595713, 38.673600756883388385, 97.430428309333365178, + 64.630862194630026352, 124.839722040345805, 25.449471717707638163, 72.513115820820530644, + 118.08493597148481058, 13.160694933554623276, 108.43293960015944322, 108.89878334163222462, + 21.410944455605203984, 1.6244787650502985343, 21.110380354279186577, 115.5404441765822412, + 58.92938928439252777, 46.999324680818972411, 51.877245121904707048, 83.428171942592598498, + 81.104545887457788922, 68.519676277137477882, 48.586468585333932424, 69.783473152187070809, + 98.875330476697854465, 21.143131455395632656, 126.37109984691414866, 110.92540069387177937, + 39.007382960942777572, 108.79001151886768639, 44.601372602766787168, 9.1833995011656952556, + 2.3166410972917219624, 126.83097900662323809, 23.598597923879424343, 73.040880322096199961, + 87.178075944113516016, 30.471165679966361495, 127.64350362218465307, 102.88511953349370742, + 125.69150995739619248, 59.964581633248599246, 54.321100307912274729, 19.147840231969894376, + 62.077323454053839669, 99.306110249599441886, 41.500127817329484969, 8.2943257197184721008, + 21.284673507911065826, 19.355325339329283452, 57.141471358783746837, 122.41126915279164677, + 104.63537048643411254, 51.800385005670250393, 95.668992851620714646, 62.863332584613090148, + 113.19002022098720772, 1.5658609498532314319, 25.141009965485864086, 61.277662688229611376, + 11.50808851884357864, 74.70839721878292039, 57.228517707168066408, 59.706138069293956505, + 127.19115718668399495, 104.61115489302756032, 86.399950625916972058, 86.680313623881374951, + 16.628484337888949085, 1.1445597326492134016, 7.5986309063737280667, 113.91518797870594426, + 60.049079638658440672, 92.994384188448748318, 70.26182455583330011, 25.826555775256565539, + 59.810274986488366267, 66.042202318116324022, 2.8930055397941032425, 17.065809730363980634, + 112.05287933241925202, 62.253446124817855889, 10.823018902374315076, 27.596137751825153828, + 32.03866030622884864, 82.490932162567332853, 22.864511508836585563, 38.536964618644560687, + 103.37944522542602499, 40.911240252771676751, 87.464226309948571725, 68.859967814671108499, + 91.18233496101674973, 64.991150044617825188, 1.3624503259161429014, 52.22297859479294857, + 120.48084368525451282, 46.715249488413974177, 102.60869761298818048, 105.28580799795963685, + 59.737399332014319953, 29.58060992088940111, 95.895951118676748592, 21.873560786443704274, + 95.381054501183825778, 92.092601870335784042, 95.668634265573928133, 123.62339301311658346, + 107.74667837494052947, 42.990769953801645897, 88.125749100214306964, 100.85016937496766332, + 99.417499163853790378, 37.036050019854883431, 90.568749268881219905, 10.524734160888328915, + 36.119111514402902685, 22.866184756421716884, 91.857677238669566577, 38.776892568683251739, + 29.491867621301935287, 95.418257332094071899, 103.90519800814945484, 18.871507412193750497, + 24.934990388472215272, 33.656608461664291099, 6.1933520671045698691, 108.86615540073762531, + 59.851623114682297455, 91.424452339892013697, 77.341801265680260258, 80.271414474307675846, + 82.988290268473065225, 118.51432214126180043, 75.848885577503097011, 55.863249181533319643, + 91.442378510062553687, 49.857726254522276577, 56.250473661173600703, 95.970700290956301615, + 80.401592436290229671, 10.729237760409887414, 61.607229976398230065, 103.58343119576602476, + 26.939496749553654809, 12.715283722751337336, 103.22028901558223879, 15.839049942798737902, + 73.784546569389931392, 86.569759872862050543, 19.078657495389052201, 97.440923119662329555, + 42.324812571070651757, 95.330003009363281308, 47.714995509053551359, 90.573858036455931142, + 58.423420148301374866, 66.207709940263157478, 56.715382366379344603, 127.15429705664791982, + 40.069154361714026891, 102.58012858284564572, 5.1820012025636970066, 76.740739646342262859, + 123.51451441509925644, 106.87659755886852508, 80.252848234646080527, 0.15600708115744055249, + 64.985054098666296341, 53.024833379804476863, 21.495809261385147693, 51.283565517325769179, + 11.240225948120496469, 26.164223825253429823, 34.491817559290211648, 90.842129227832629113, + 41.631664709195320029, 125.36942702445958275, 74.610351596118562156, 72.429063524567027343, + 19.917014964572445024, 83.354518915333756013, 4.4004825098090805113, 85.316634840972255915, + 110.32286648927038186, 85.01174828039802378, 102.13648206476136693, 108.54952073824460967, + 81.737441640529141296, 38.798579599915683502, 61.150921091011696262, 99.410459216738672694, + 7.3409540077627752908, 125.83337157761707203, 99.285998260445921915, 78.82911516071180813, + 57.060680617571051698, 74.488124486666492885, 97.069039076141052647, 96.033414363831980154, + 77.30409048267028993, 4.1339999115880345926, 89.338711662076093489, 87.71539155419668532, + 13.326659187416225905, 74.432410080975387245, 5.7204222123000363354, 58.4545973477725056, + 91.056724705180386081, 48.382908916559244972, 11.080089285340363858, 123.93700974907915224, + 44.42574609250004869, 123.18137568215388455, 62.129840943518502172, 110.94224200125972857, + 85.105815237038768828, 59.200145133836485911, 26.170772830741043435, 78.237939570575690595, + 45.331006480457290309, 15.699581403867341578, 95.937006416592339519, 59.555366926480928669, + 26.614093221629445907, 71.733385374005592894, 48.611688736968062585, 12.553004305758804549, + 2.8304133229466970079, 11.879594140486005927, 74.462418714276282117, 85.167339727417129325, + 67.130722881131077884, 18.33455666354711866, 119.16063735092393472, 113.10692306531927898, + 120.35730611473991303, 13.199576979521225439, 118.92523880290536908, 51.573121535031532403, + 107.04772251756367041, 26.051822720881318673, 36.222395810782472836, 90.068526529415976256, + 67.687113952113577398, 54.437822803534800187, 50.499514741226448677, 121.89535728309419937, + 85.652764464950450929, 43.630201375584874768, 77.952717901825963054, 27.075097139335412066, + 82.5626652169485169, 25.413606637579505332, 100.256691920945741, 18.130043177661718801, + 57.949639553211454768, 85.122816671504551778, 33.459776866944594076, 101.98934807033583638, + 118.95839627224995638, 21.28469913206572528, 82.032279181337798946, 42.130909396775678033, + 92.442300073023943696, 3.9263861989566066768, 101.02951462121563964, 82.748677036750450497, + 39.6232013322187413, 54.881611934062675573, 28.16351610716083087, 121.17394072200841038, + 105.52055773511528969, 74.988498723629163578, 68.618109845167055028, 7.7411859118546999525, + 9.8355758834622974973, 125.93708057955518598, 27.177926654076145496, 124.74164304984151386, + 123.64446617223438807, 102.32193497722619213, 20.403142599043349037, 18.038883963952685008, + 28.777418153120379429, 31.549534075831616065, 45.246989287497854093, 113.12955651928132284, + 47.804353905074094655, 47.901723593015049119, 48.932785100078035612, 105.9518476785524399, + 6.8588088129399693571, 78.415742909313848941, 19.354877127196232323, 52.001815844869270222, + 62.623194403990055434, 1.7793505783520231489, 89.292872567770245951, 26.915843222235707799, + 110.30572635912903934, 4.9178809315417311154, 119.01339020356317633, 30.131959974569326732, + 22.229460462072893279, 67.43079927296275855, 19.455932710850902367, 119.31369856393212103, + 126.11686877560714493, 52.905716912526258966, 84.730179910464357818, 78.219045292524242541, + 100.0765550964497379, 6.6502061619030428119, 23.886466878011560766, 88.999095916500664316, + 5.5939931383036309853, 49.41896519901274587, 52.851489819393464131, 4.8580266907083569095, + 105.89841668850567658, 79.459226119302911684, 94.8095978791534435, 82.58043404664931586, + 95.691887698376376648, 10.751556925370095996, 109.68236942564544734, 16.302644435043475823, + 30.222993250557919964, 54.065600576515862485, 69.156647690451791277, 126.76566193094913615, + 49.023530324637249578, 78.457415348919312237, 111.00857049949991051, 12.881651337829680415, + 0.57287917199209914543, 109.09051855227880878, 107.81720481958473101, 41.95776320811273763, + 63.492979538335930556, 91.788864511927386047, 111.05060742741261492, 15.185490585176012246, + 115.36204766897571972, 15.883836804183374625, 9.1044709508678351995, 57.412141433142096503, + 70.08089620474493131, 120.34603358284584829, 49.453127926670276793, 67.08875952972448431, + 105.68759365188816446, 37.410878146452887449, 85.304650289417622844, 64.520017844253743533, + 42.614817371460958384, 31.060736355848348467, 107.61066230226788321, 96.425462580344174057, + 74.487094061325478833, 21.672953171058907174, 71.750103159913123818, 126.44067344371433137, + 106.11874969852942741, 40.99788827074735309, 122.86554778544814326, 25.188964092842070386, + 78.9397491694544442, 126.73315025440751924, 14.836496768410142977, 65.088245641731191427, + 77.347201513770414749, 66.860856618670368334, 1.2617243892636906821, 121.67944408069161, + 50.898943435418914305, 17.026231641644699266, 108.16987194296962116, 26.321389867112884531, + 88.865879200322524412, 89.797566683264449239, 42.821888911210407969, 3.2489575301005970687, + 42.220760708562011132, 103.0808883531644824, 117.85877856878505554, 93.998649361637944821, + 103.75449024381305207, 38.856343885188834975, 34.209091774919215823, 9.0393525542749557644, + 97.172937170671502827, 11.566946304377779597, 69.75066095339570893, 42.286262910794903291, + 124.74219969383193529, 93.850801387743558735, 78.014765921889193123, 89.580023037735372782, + 89.202745205533574335, 18.366799002331390511, 4.6332821945870819036, 125.66195801324647618, + 47.197195847762486665, 18.081760644196037902, 46.356151888227032032, 60.942331359936360968, + 127.28700724437294411, 77.770239066991052823, 123.38301991479238495, 119.92916326649719849, + 108.64220061582454946, 38.295680463939788751, 124.15464690811131732, 70.612220499198883772, + 83.000255634658969939, 16.588651439436944202, 42.569347015822131652, 38.710650678658566903, + 114.28294271757113165, 116.82253830558693153, 81.270740972868225072, 103.60077001134413877, + 63.337985703241429292, 125.72666516922981828, 98.380040441974415444, 3.1317218997064628638, + 50.282019930971728172, 122.55532537645922275, 23.01617703769079526, 21.416794437565840781, + 114.45703541433613282, 119.41227613859155099, 126.38231437337162788, 81.222309786058758618, + 44.799901251837582095, 45.360627247762749903, 33.25696867577789817, 2.2891194652984268032, + 15.197261812751094112, 99.830375957411888521, 120.09815927732051932, 57.988768376901134616, + 12.52364911166660022, 51.653111550513131078, 119.62054997298037051, 4.0844046362326480448, + 5.7860110795882064849, 34.131619460731599247, 96.105758664838504046, 124.50689224963571178, + 21.646037804748630151, 55.192275503650307655, 64.077320612461335259, 36.981864325134665705, + 45.729023017673171125, 77.073929237292759353, 78.75889045085204998, 81.822480505546991481, + 46.928452619900781428, 9.7199356293458549771, 54.364669922037137439, 1.9823000892356503755, + 2.7249006518322858028, 104.44595718958953512, 112.96168737050902564, 93.430498976831586333, + 77.217395225979998941, 82.571615995919273701, 119.47479866402863991, 59.161219841782440199, + 63.791902237353497185, 43.747121572891046526, 62.762109002371289534, 56.185203740675206063, + 63.337268531151494244, 119.2467860262368049, 87.493356749881058931, 85.981539907606929773, + 48.251498200432251906, 73.700338749938964611, 70.834998327707580756, 74.07210003971340484, + 53.13749853776243981, 21.049468321776657831, 72.23822302880580537, 45.732369512847071746, + 55.715354477339133155, 77.553785137366503477, 58.983735242607508553, 62.836514664191781776, + 79.810396016298909672, 37.743014824387500994, 49.869980776944430545, 67.313216923328582197, + 12.386704134212777717, 89.732310801475250628, 119.70324622936823289, 54.848904679787665373, + 26.683602531364158494, 32.542828948618989671, 37.97658053694976843, 109.02864428252723883, + 23.697771155006194022, 111.72649836307027726, 54.884757020125107374, 99.715452509044553153, + 112.50094732235083939, 63.941400581916241208, 32.803184872580459341, 21.458475520819774829, + 123.21445995280009811, 79.166862391532049514, 53.878993499107309617, 25.430567445506312652, + 78.440578031164477579, 31.678099885601113783, 19.569093138783500763, 45.139519745724101085, + 38.157314990781742381, 66.881846239324659109, 84.649625142144941492, 62.660006018726562615, + 95.429991018110740697, 53.147716072911862284, 116.84684029660638771, 4.4154198805263149552, + 113.43076473276232718, 126.30859411329583963, 80.13830872343169176, 77.160257165691291448, + 10.364002405131031992, 25.481479292688163696, 119.02902883020215086, 85.753195117740688147, + 32.505696469292161055, 0.31201416231851908378, 1.9701081973325926811, 106.04966675960895373, + 42.991618522770295385, 102.56713103465153836, 22.480451896240992937, 52.328447650506859645, + 68.983635118584061274, 53.684258455665258225, 83.263329418394278036, 122.73885404892280349, + 21.220703192240762291, 16.858127049134054687, 39.834029929148528026, 38.709037830667512026, + 8.8009650196217990015, 42.63326968194814981, 92.645732978544401703, 42.02349656079968554, + 76.272964129526371835, 89.099041476492857328, 35.474883281058282591, 77.597159199831367005, + 122.3018421820270305, 70.820918433477345388, 14.68190801552918856, 123.66674315523778205, + 70.571996520895481808, 29.65823032142361626, 114.12136123514574138, 20.976248973336623749, + 66.138078152285743272, 64.066828727667598287, 26.60818096534057986, 8.2679998231797071639, + 50.677423324155824957, 47.43078310839337064, 26.653318374836089788, 20.864820161950774491, + 11.440844424600072671, 116.90919469554864918, 54.113449410360772163, 96.765817833118489943, + 22.160178570684365695, 119.87401949815830449, 88.851492185003735358, 118.36275136430776911, + 124.25968188704064232, 93.884484002523095114, 42.211630474077537656, 118.40029026767297182, + 52.34154566148572485, 28.475879141151381191, 90.662012960914580617, 31.399162807738321135, + 63.874012833184679039, 119.11073385296185734, 53.228186443262529792, 15.466770748011185788, + 97.22337747393612517, 25.106008611517609097, 5.6608266458933940157, 23.759188280975649832, + 20.924837428556202212, 42.334679454837896628, 6.2614457622621557675, 36.669113327097875299, + 110.32127470185150742, 98.213846130642195931, 112.71461222947982606, 26.399153959046088858, + 109.85047760581073817, 103.14624307006670278, 86.095445035127340816, 52.103645441762637347, + 72.444791621568583651, 52.137053058835590491, 7.3742279042271547951, 108.87564560706960037, + 100.99902948245653533, 115.79071456619203673, 43.305528929900901858, 87.260402751173387514, + 27.905435803651926108, 54.150194278674462112, 37.125330433897033799, 50.827213275162648642, + 72.513383841891482007, 36.260086355323437601, 115.89927910642654751, 42.245633343009103555, + 66.919553733892826131, 75.978696140675310744, 109.91679254449991276, 42.569398264135088539, + 36.064558362675597891, 84.261818793554994045, 56.884600146047887392, 7.8527723979168513324, + 74.059029242434917251, 37.497354073500900995, 79.246402664437482599, 109.76322386812535115, + 56.327032214325299719, 114.34788144402045873, 83.041115470234217355, 21.976997447261965135, + 9.2362196903341100551, 15.482371823709399905, 19.671151766928232973, 123.87416115911037195, + 54.355853308155928971, 121.48328609968666569, 119.28893234447241412, 76.643869954452384263, + 40.806285198086698074, 36.077767927905370016, 57.554836306240758859, 63.099068151663232129, + 90.493978574999346165, 98.25911303856264567, 95.60870781014818931, 95.803447186030098237, + 97.865570200159709202, 83.903695357104879804, 13.717617625883576693, 28.831485818627697881, + 38.709754254392464645, 104.00363168973854044, 125.24638880798011087, 3.5587011567076842766, + 50.585745135540491901, 0, 92.611452718258078676, 9.8357618630871002097, + 110.02678040712635266, 60.263919949138653465, 44.458920924149424536, 6.8615985459255171008, + 38.911865421705442714, 110.62739712786788004, 124.23373755121428985, 105.81143382505615591, + 41.460359820932353614, 28.43809058505212306, 72.153110192899475805, 13.300412323806085624, + 47.772933756026759511, 49.998191833001328632, 11.187986276607261971, 98.837930398025491741, + 105.70297963878692826, 9.7160533814203517977, 83.796833377014991129, 30.918452238609461347, + 61.61919575831052498, 37.160868093302269699, 63.383775396752753295, 21.503113850743829971, + 91.364738851290894672, 32.605288870086951647, 60.445986501115839928, 108.13120115303536295, + 10.313295380907220533, 125.5313238618982723, 98.047060649278137134, 28.914830697842262452, + 94.017140998999821022, 25.76330267565936083, 1.1457583439878362697, 90.181037104561255546, + 87.634409639169462025, 83.915526416225475259, 126.98595907667549909, 55.577729023858410073, + 94.10121485482522985, 30.370981170355662471, 102.72409533795143943, 31.767673608366749249, + 18.208941901735670399, 114.82428286628783098, 12.1617924094935006, 112.69206716569169657, + 98.906255853344191564, 6.1775190594526065979, 83.375187303776328918, 74.821756292909412878, + 42.609300578838883666, 1.0400356885074870661, 85.229634742921916768, 62.121472711700334912, + 87.22132460453940439, 64.850925160691986093, 20.974188122650957666, 43.345906342121452326, + 15.500206319829885615, 124.88134688743230072, 84.237499397058854811, 81.995776541498344159, + 117.73109557089628652, 50.37792818568777875, 29.879498338912526378, 125.46630050881503848, + 29.672993536823923932, 2.1764912834660208318, 26.694403027544467477, 5.7217132373407366686, + 2.5234487785310193431, 115.35888816138321999, 101.79788687083782861, 34.052463283293036511, + 88.339743885939242318, 52.64277973422940704, 49.731758400648686802, 51.595133366528898478, + 85.643777822420815937, 6.4979150602011941373, 84.441521417127660243, 78.161776706332602771, + 107.71755713757374906, 59.997298723279527621, 79.50898048762610415, 77.712687770377669949, + 68.418183549838431645, 18.078705108553549508, 66.345874341343005653, 23.133892608759197174, + 11.501321906791417859, 84.572525821593444562, 121.48439938766750856, 59.701602775490755448, + 28.029531843782024225, 51.160046075474383542, 50.405490411067148671, 36.733598004662781022, + 9.266564389177801786, 123.32391602649295237, 94.394391695524973329, 36.163521288392075803, + 92.712303776454064064, 121.88466271987635992, 126.57401448874952621, 27.540478133985743625, + 118.76603982958840788, 111.85832653299803496, 89.284401231649098918, 76.591360927883215481, + 120.30929381622627261, 13.224440998401405523, 38.000511269317939878, 33.177302878873888403, + 85.138694031644263305, 77.421301357320771785, 100.56588543514590128, 105.64507661117750104, + 34.541481945740088122, 79.201540022688277531, 126.67597140648649656, 123.45333033846327453, + 68.760080883948830888, 6.2634437994129257277, 100.56403986194709432, 117.11065075291844551, + 46.032354075381590519, 42.83358887513531954, 100.91407082867590361, 110.82455227718673996, + 124.76462874674689374, 34.444619572117517237, 89.599802503675164189, 90.721254495525499806, + 66.51393735155579634, 4.5782389305968536064, 30.394523625505826203, 71.660751914827415021, + 112.19631855464103865, 115.97753675380226923, 25.04729822333320044, 103.30622310102990014, + 111.24109994596074102, 8.1688092724652960896, 11.57202215917641297, 68.263238921466836473, + 64.211517329680646071, 121.01378449927142356, 43.292075609497260302, 110.38455100730425329, + 0.15464122492267051712, 73.963728650269331411, 91.45804603534998023, 26.147858474589156685, + 29.517780901707737939, 35.644961011093982961, 93.856905239801562857, 19.439871258691709954, + 108.72933984407427488, 3.964600178471300751, 5.4498013036682095844, 80.891914379182708217, + 97.92337474102168926, 58.860997953666810645, 26.43479045196363586, 37.14323199184218538, + 110.94959732805727981, 118.3224396835648804, 127.58380447470699437, 87.494243145782093052, + 125.52421800474257907, 112.37040748135041213, 126.67453706230662647, 110.49357205247724778, + 46.986713499765755842, 43.963079815213859547, 96.502996400868141791, 19.400677499881567201, + 13.669996655418799492, 20.14420007942680968, 106.27499707552487962, 42.098936643556953641, + 16.47644605761161074, 91.464739025694143493, 111.43070895468190429, 27.107570274733006954, + 117.96747048521501711, 125.67302932838720153, 31.620792032597819343, 75.486029648775001988, + 99.739961553892499069, 6.6264338466571643949, 24.773408268429193413, 51.464621602954139234, + 111.40649245873646578, 109.69780935957533075, 53.367205062728316989, 65.085657897237979341, + 75.953161073903174838, 90.057288565054477658, 47.395542310016026022, 95.452996726140554529, + 109.76951404025385273, 71.430905018092744285, 97.001894644701678772, 127.88280116383248242, + 65.606369745160918683, 42.916951041643187637, 118.4289199056038342, 30.333724783064099029, + 107.75798699821461923, 50.861134891016263282, 28.881156062328955159, 63.356199771202227566, + 39.138186277567001525, 90.27903949144820217, 76.314629981567122741, 5.763692478652956197, + 41.299250284289882984, 125.32001203745676321, 62.859982036221481394, 106.29543214582736255, + 105.69368059321277542, 8.8308397610562678892, 98.861529465528292349, 124.61718822659531725, + 32.276617446867021499, 26.320514331382582895, 20.728004810262063984, 50.962958585379965371, + 110.05805766040793969, 43.506390235481376294, 65.01139293858432211, 0.62402832463703816757, + 3.9402163946688233409, 84.099333519217907451, 85.983237045544228749, 77.134262069303076714, + 44.960903792481985874, 104.65689530101735727, 9.9672702371681225486, 107.36851691133415443, + 38.526658836792194052, 117.47770809784560697, 42.441406384481524583, 33.716254098268109374, + 79.668059858297056053, 77.418075661335024051, 17.601930039243598003, 85.266539363899937598, + 57.291465957088803407, 84.046993121603009058, 24.545928259056381648, 50.198082952985714655, + 70.949766562120203162, 27.194318399666371988, 116.60368436405769899, 13.641836866954690777, + 29.363816031062015099, 119.33348631047920207, 13.143993041790963616, 59.316460642850870499, + 100.24272247029148275, 41.952497946676885476, 4.2761563045751245227, 0.13365745533519657329, + 53.21636193068115972, 16.535999646359414328, 101.35484664831164991, 94.861566216786741279, + 53.306636749672179576, 41.729640323901548982, 22.88168884920378332, 105.81838939109729836, + 108.2268988207251823, 65.531635666236979887, 44.320357141372369369, 111.74803899632024695, + 49.702984370011108695, 108.7255027286191762, 120.51936377408492262, 59.768968005046190228, + 84.42326094815871329, 108.80058053534594364, 104.6830913229714497, 56.951758282306400361, + 53.324025921829161234, 62.79832561547664227, 127.74802566637299606, 110.22146770592371468, + 106.45637288652505958, 30.933541496026009554, 66.446754947872250341, 50.212017223035218194, + 11.321653291786788031, 47.518376561951299664, 41.849674857112404425, 84.669358909675793257, + 12.522891524524311535, 73.338226654199388577, 92.642549403706652811, 68.42769226128802984, + 97.429224458959652111, 52.798307918095815694, 91.700955211625114316, 78.292486140137043549, + 44.190890070254681632, 104.20729088352891267, 16.889583243137167301, 104.27410611767118098, + 14.748455808457947569, 89.751291214142838726, 73.998058964916708646, 103.58142913238407345, + 86.611057859805441694, 46.520805502346775029, 55.810871607303852215, 108.30038855734892422, + 74.250660867794067599, 101.65442655032893526, 17.026767683782964014, 72.520172710650513181, + 103.79855821285309503, 84.491266686021845089, 5.83910746778929024, 23.957392281354259467, + 91.83358508899982553, 85.138796528270177078, 72.129116725354833761, 40.52363758710998809, + 113.76920029209577478, 15.705544795837340644, 20.118058484869834501, 74.994708147005439969, + 30.492805328878603177, 91.526447736250702292, 112.65406442865423742, 100.69576288804455544, + 38.08223094046843471, 43.95399489452393027, 18.47243938066822011, 30.96474364741879981, + 39.342303533860103926, 119.74832231822074391, 108.71170661631549592, 114.96657219937696937, + 110.57786468894846621, 25.287739908904768527, 81.612570396173396148, 72.155535855810740031, + 115.10967261248151772, 126.19813630333010224, 52.987957150002330309, 68.518226077128929319, + 63.217415620300016599, 63.606894372063834453, 67.731140400323056383, 39.807390714209759608, + 27.435235251767153386, 57.662971637255395763, 77.419508508788567269, 80.007263379480718868, + 122.49277761596022174, 7.1174023134153685533, 101.1714902710809838, 0, + 57.222905436516157351, 19.671523726177838398, 92.053560814252705313, 120.52783989827730693, + 88.917841848298849072, 13.723197091851034202, 77.823730843414523406, 93.254794255739398068, + 120.46747510243221768, 83.622867650112311821, 82.920719641864707228, 56.8761811701078841, + 16.306220385798951611, 26.600824647612171248, 95.545867512053519022, 99.996383666002657264, + 22.37597255321816192, 69.67586079605462146, 83.405959277573856525, 19.432106762844341574, + 39.593666754029982258, 61.836904477218922693, 123.23839151662104996, 74.321736186604539398, + 126.76755079350550659, 43.006227701491297921, 54.729477702581789345, 65.210577740173903294, + 120.89197300223531784, 88.262402306070725899, 20.626590761818079045, 123.06264772380018258, + 68.094121298556274269, 57.829661395688162884, 60.034281997999642044, 51.526605351318721659, + 2.2915166879793105181, 52.362074209126149071, 47.268819278342562029, 39.831052832454588497, + 125.97191815335099818, 111.15545804772045813, 60.202429709650459699, 60.74196234071496292, + 77.448190675902878866, 63.535347216733498499, 36.417883803474978777, 101.64856573257566197, + 24.323584818990639178, 97.384134331387031125, 69.812511706688383128, 12.355038118908851175, + 38.750374607556295814, 21.643512585818825755, 85.218601157677767333, 2.080071377018612111, + 42.459269485843833536, 124.2429454234043078, 46.44264920908244676, 1.7018503213839721866, + 41.948376245301915333, 86.691812684242904652, 31.000412639663409209, 121.76269377486823942, + 40.474998794121347601, 35.991553083000326296, 107.46219114179257303, 100.7558563713755575, + 59.758996677828690736, 122.93260101763007697, 59.345987073647847865, 4.3529825669320416637, + 53.388806055088934954, 11.443426474681473337, 5.0468975570656766649, 102.71777632277007797, + 75.59577374167565722, 68.104926566589711001, 48.679487771878484637, 105.28555946845881408, + 99.463516801297373604, 103.19026673306143493, 43.287555644841631874, 12.995830120406026253, + 40.883042834258958464, 28.323553412668843521, 87.43511427514749812, 119.99459744656269322, + 31.017960975255846279, 27.425375540758977877, 8.8363670996768632904, 36.157410217110736994, + 4.6917486826860113069, 46.267785217518394347, 23.002643813586473698, 41.145051643190527102, + 114.96879877533501713, 119.4032055509815109, 56.05906368756404845, 102.32009215094876708, + 100.81098082213429734, 73.467196009325562045, 18.533128778359241551, 118.64783205298954272, + 60.788783391049946658, 72.327042576787789585, 57.424607552911766106, 115.76932543975635781, + 125.14802897749905242, 55.080956267975125229, 109.53207965918045375, 95.716653065999707906, + 50.568802463301835814, 25.182721855770068942, 112.61858763245254522, 26.448881996802811045, + 76.001022538635879755, 66.354605757751414785, 42.277388063292164588, 26.84260271464518155, + 73.131770870295440545, 83.290153222355002072, 69.082963891483814223, 30.403080045380193042, + 125.3519428129766311, 118.90666067693018704, 9.5201617678976617754, 12.526887598829489434, + 73.128079723897826625, 106.22130150583689101, 92.064708150763181038, 85.667177750274277059, + 73.828141657355445204, 93.649104554377117893, 121.52925749349378748, 68.889239144238672452, + 51.199605007353966357, 53.44250899105463759, 5.0278747031115926802, 9.1564778611937072128, + 60.789047251015290385, 15.321503829658468021, 96.392637109285715269, 103.95507350760453846, + 50.094596446670038858, 78.61244620206343825, 94.482199891921482049, 16.337618544930592179, + 23.144044318356463918, 8.5264778429373109248, 0.42303465936493012123, 114.02756899854284711, + 86.584151218998158583, 92.769102014608506579, 0.30928244984897901304, 19.9274573005423008, + 54.916092070699960459, 52.295716949178313371, 59.035561803415475879, 71.289922022191603901, + 59.713810479603125714, 38.879742517387057887, 89.458679688148549758, 7.9292003569426015019, + 10.899602607340057148, 33.783828758369054412, 67.846749482043378521, 117.72199590733362129, + 52.86958090392727172, 74.286463983688008739, 93.899194656118197599, 108.64487936713339877, + 127.16760894941762672, 46.988486291567824082, 123.04843600948879612, 96.740814962704462232, + 125.34907412461689091, 92.98714410495449556, 93.973426999531511683, 87.926159630431357073, + 65.005992801736283582, 38.801354999763134401, 27.339993310837598983, 40.288400158857257338, + 84.549994151049759239, 84.197873287113907281, 32.95289211522685946, 54.929478051391924964, + 94.861417909363808576, 54.215140549469651887, 107.93494097043367219, 123.34605865677440306, + 63.241584065199276665, 22.972059297553641954, 71.479923107784998138, 13.25286769331432879, + 49.546816536858386826, 102.92924320591191645, 94.812984917476569535, 91.395618719150661491, + 106.73441012546027196, 2.1713157944795966614, 23.906322147809987655, 52.114577130108955316, + 94.791084620035690023, 62.905993452284747036, 91.539028080511343433, 14.861810036189126549, + 66.003789289406995522, 127.76560232766860281, 3.2127394903218373656, 85.833902083290013252, + 108.85783981120766839, 60.667449566131836036, 87.515973996429238468, 101.72226978203252656, + 57.762312124657910317, 126.71239954240445513, 78.276372555137641029, 52.55807898290004232, + 24.629259963134245481, 11.527384957305912394, 82.598500568583403947, 122.64002407491352642, + 125.71996407244660077, 84.590864291658363072, 83.387361186425550841, 17.661679522116173757, + 69.723058931060222676, 121.23437645319063449, 64.553234893734042998, 52.641028662765165791, + 41.456009620524127968, 101.92591717076356872, 92.116115320815879386, 87.012780470966390567, + 2.0227858771686442196, 1.2480566492740763351, 7.8804327893412846606, 40.198667038439452881, + 43.966474091092095478, 26.268524138606153429, 89.921807584967609728, 81.313790602034714539, + 19.934540474339883076, 86.737033822668308858, 77.053317673588026082, 106.95541619569121394, + 84.882812768963049166, 67.432508196539856726, 31.336119716597750084, 26.836151322670048103, + 35.203860078490833985, 42.533078727799875196, 114.58293191418124479, 40.093986243206018116, + 49.091856518112763297, 100.39616590597506729, 13.899533124240406323, 54.388636799336381955, + 105.20736872811539797, 27.283673733909381554, 58.727632062127668178, 110.66697262095840415, + 26.287986083581927232, 118.63292128570537898, 72.485444940582965501, 83.904995893353770953, + 8.5523126091502490453, 0.26731491067039314657, 106.43272386136231944, 33.071999292722466635, + 74.709693296626937808, 61.723132433573482558, 106.61327349934435915, 83.459280647803097963, + 45.763377698411204619, 83.636778782198234694, 88.453797641454002587, 3.0632713324739597738, + 88.640714282748376718, 95.496077992640493903, 99.405968740025855368, 89.451005457241990371, + 113.03872754816984525, 119.53793601009601844, 40.84652189632106456, 89.601161070695525268, + 81.366182645942899399, 113.90351656461280072, 106.64805184365832247, 125.59665123095692252, + 127.49605133274963009, 92.442935411851067329, 84.912745773050119169, 61.867082992055657087, + 4.8935098957445006818, 100.42403444607043639, 22.643306583573576063, 95.036753123902599327, + 83.699349714228446828, 41.338717819351586513, 25.045783049052261049, 18.676453308402415132, + 57.2850988074169436, 8.8553845225796976592, 66.858448917919304222, 105.59661583619526937, + 55.401910423253866611, 28.584972280274087097, 88.381780140513001243, 80.414581767057825346, + 33.779166486277972581, 80.548212235342361964, 29.496911616919533117, 51.50258242828931543, + 19.996117929837055271, 79.162858264771784889, 45.222115719610883389, 93.041611004693550058, + 111.62174321461134241, 88.600777114701486425, 20.501321735591773177, 75.308853100657870527, + 34.053535367569566006, 17.040345421304664342, 79.597116425709828036, 40.982533372043690179, + 11.67821493557858048, 47.914784562712156912, 55.667170178003289038, 42.277593056543992134, + 16.258233450709667522, 81.047275174223614158, 99.538400584191549569, 31.411089591674681287, + 40.236116969743306981, 21.989416294010879938, 60.985610657760844333, 55.052895472505042562, + 97.308128857312112814, 73.391525776089110877, 76.16446188093686942, 87.90798978904786054, + 36.94487876133644022, 61.92948729483759962, 78.68460706772384583, 111.4966446364451258, + 89.423413232634629821, 101.93314439875757671, 93.155729377896932419, 50.575479817813175032, + 35.225140792350430274, 16.311071711625118041, 102.21934522496667341, 124.39627260666020447, + 105.9759143000082986, 9.0364521542578586377, 126.4348312406000332, 127.21378874413130688, + 7.4622808006461127661, 79.614781428419519216, 54.870470503534306772, 115.3259432745144295, + 26.839017017580772517, 32.014526758965075715, 116.98555523192044348, 14.234804626834375085, + 74.342980542165605584, 0, 114.4458108730323147, 39.343047452359314775, + 56.107121628509048605, 113.05567979655825184, 49.835683696597698145, 27.446394183705706382, + 27.647461686832684791, 58.509588511482434114, 112.93495020486807334, 39.245735300228261622, + 37.841439283729414456, 113.7523623402157682, 32.612440771597903222, 53.201649295227980474, + 63.091735024110676022, 71.992767332005314529, 44.751945106439961819, 11.351721592112880899, + 38.81191855514771305, 38.864213525688683148, 79.187333508059964515, 123.67380895444148337, + 118.4767830332457379, 20.643472373212716775, 125.53510158701101318, 86.012455402982595842, + 109.45895540516721667, 2.4211554803514445666, 113.78394600447427365, 48.524804612141451798, + 41.253181523639796069, 118.12529544760400313, 8.1882425971125485376, 115.65932279137632577, + 120.06856399599928409, 103.05321070263744332, 4.5830333759586210363, 104.72414841825229814, + 94.537638556685124058, 79.662105664912814973, 123.94383630670563434, 94.310916095440916251, + 120.4048594193009194, 121.48392468143356382, 26.896381351805757731, 127.070694433466997, + 72.835767606953595532, 75.297131465151323937, 48.647169637984916335, 66.768268662777700229, + 11.625023413376766257, 24.710076237817702349, 77.500749215112591628, 43.287025171641289489, + 42.437202315355534665, 4.160142754037224222, 84.918538971691305051, 120.48589084680861561, + 92.885298418164893519, 3.4037006427679443732, 83.896752490607468644, 45.383625368485809304, + 62.000825279330456397, 115.52538754973647883, 80.949997588242695201, 71.983106166004290571, + 86.924382283588784048, 73.511712742751115002, 119.51799335566101945, 117.86520203526015393, + 118.69197414729569573, 8.7059651338640833274, 106.77761211017786991, 22.886852949362946674, + 10.093795114134991309, 77.435552645543793915, 23.191547483354952419, 8.2098531331794220023, + 97.358975543760607252, 82.57111893692126614, 70.927033602598385187, 78.380533466122869868, + 86.575111289683263749, 25.991660240812052507, 81.766085668517916929, 56.64710682534132502, + 46.870228550298634218, 111.98919489312538644, 62.035921950511692557, 54.850751081517955754, + 17.672734199353726581, 72.314820434221473988, 9.3834973653720226139, 92.535570435036788695, + 46.005287627172947396, 82.290103286384692183, 101.93759755067367223, 110.80641110196302179, + 112.11812737513173488, 76.640184301901172148, 73.621961644272232661, 18.93439201865112409, + 37.06625755672212108, 109.29566410597908543, 121.5775667821035313, 16.65408515357557917, + 114.84921510582717019, 103.5386508795163536, 122.29605795499810483, 110.16191253595388844, + 91.06415931836454547, 63.433306131999415811, 101.13760492660367163, 50.365443711543775862, + 97.237175264905090444, 52.897763993609260069, 24.002045077275397489, 4.7092115155028295703, + 84.554776126584329177, 53.685205429294001078, 18.263541740594519069, 38.580306444713642122, + 10.165927782967628445, 60.806160090764024062, 122.70388562595690018, 109.81332135386037407, + 19.040323535795323551, 25.053775197662616847, 18.256159447799291229, 84.44260301167742, + 56.129416301530000055, 43.334355500552192098, 19.656283314714528387, 59.298209108757873764, + 115.05851498699121294, 9.7784782884773449041, 102.39921001470793271, 106.88501798210927518, + 10.05574940622318536, 18.312955722387414426, 121.57809450203058077, 30.643007659320574021, + 64.785274218575068517, 79.910147015209076926, 100.1891928933437157, 29.224892404130514478, + 60.964399783842964098, 32.675237089861184359, 46.288088636712927837, 17.05295568587462185, + 0.84606931873349822126, 100.0551379970893322, 45.168302437999955146, 57.538204029217013158, + 0.61856489969795802608, 39.8549146010846016, 109.83218414139992092, 104.59143389835662674, + 118.07112360683458974, 14.579844044383207802, 119.42762095920625143, 77.759485034777753754, + 50.917359376297099516, 15.858400713885203004, 21.799205214680114295, 67.567657516741746804, + 7.6934989640903950203, 107.44399181466724258, 105.73916180785818142, 20.572927967379655456, + 59.798389312240033178, 89.289758734270435525, 126.33521789883525344, 93.976972583139286144, + 118.09687201898123021, 65.481629925412562443, 122.6981482492374198, 57.9742882099126291, + 59.946853999066661345, 47.852319260866352124, 2.0119856034725671634, 77.602709999526268803, + 54.679986621675197966, 80.576800317718152655, 41.099988302103156457, 40.395746574227814563, + 65.905784230453718919, 109.85895610278748791, 61.722835818727617152, 108.43028109894294175, + 87.869881940870982362, 118.69211731354880612, 126.48316813039855333, 45.944118595110921888, + 14.959846215569996275, 26.505735386628657579, 99.09363307372041163, 77.858486411827470874, + 61.625969834956777049, 54.791237438304960961, 85.468820250920543913, 4.3426315889591933228, + 47.81264429561997531, 104.22915426022154861, 61.582169240071380045, 125.81198690457313205, + 55.078056161022686865, 29.723620072381891077, 4.0075785788176290225, 127.53120465533720562, + 6.4254789806473127101, 43.667804166583664482, 89.71567962241533678, 121.33489913226731005, + 47.031947992862114916, 75.444539564065053128, 115.52462424931945861, 125.42479908481254824, + 28.552745110275282059, 105.11615796580008464, 49.258519926268490963, 23.054769914615462767, + 37.197001137170445872, 117.28004814983069082, 123.43992814489683951, 41.181728583320364123, + 38.774722372851101682, 35.323359044235985493, 11.446117862124083331, 114.46875290638490696, + 1.1064697874680859968, 105.28205732553033158, 82.912019241051893914, 75.851834341530775419, + 56.232230641635396751, 46.025560941932781134, 4.0455717543372884393, 2.4961132985481526703, + 15.760865578682569321, 80.397334076878905762, 87.932948182184190955, 52.537048277215944836, + 51.843615169938857434, 34.627581204069429077, 39.869080948683404131, 45.474067645340255694, + 26.106635347179690143, 85.910832391386065865, 41.765625537929736311, 6.8650163930797134526, + 62.672239433195500169, 53.672302645340096205, 70.407720156981667969, 85.066157455603388371, + 101.16586382836248958, 80.187972486412036233, 98.183713036229164572, 72.792331811950134579, + 27.799066248480812646, 108.77727359867640189, 82.414737456230795942, 54.567347467818763107, + 117.45526412425897433, 93.3339452419168083, 52.575972167167492444, 109.26584257141439593, + 16.97088988116956898, 39.809991786707541905, 17.104625218300498091, 0.53462982134442427196, + 84.865447722724638879, 66.143998585448571248, 21.419386593253875617, 123.4462648671506031, + 85.226546998692356283, 38.918561295606195927, 91.526755396826047217, 39.273557564400107367, + 48.907595282908005174, 6.1265426649515575264, 49.281428565500391414, 62.992155985284625785, + 70.811937480055348715, 50.90201091448761872, 98.077455096343328478, 111.07587202019203687, + 81.693043792645767098, 51.202322141394688515, 34.732365291889436776, 99.807033129229239421, + 85.296103687320282916, 123.19330246191748301, 126.99210266550289816, 56.885870823705772636, + 41.825491546100238338, 123.73416598411131417, 9.7870197914926393423, 72.848068892140872777, + 45.286613167150790105, 62.073506247808836633, 39.398699428456893656, 82.677435638703173026, + 50.091566098104522098, 37.352906616804830264, 114.5701976148338872, 17.710769045163033297, + 5.7168978358422464225, 83.193231672390538733, 110.80382084650773322, 57.169944560551812174, + 48.763560281029640464, 32.829163534115650691, 67.558332972559583141, 33.096424470684723929, + 58.993823233839066233, 103.00516485657863086, 39.992235859677748522, 30.325716529543569777, + 90.444231439225404756, 58.083222009390738094, 95.243486429226322798, 49.201554229402972851, + 41.002643471187184332, 22.617706201315741055, 68.107070735139132012, 34.080690842612966662, + 31.194232851419656072, 81.965066744087380357, 23.35642987115716096, 95.829569125424313825, + 111.33434035600657808, 84.555186113087984268, 32.516466901422973024, 34.094550348450866295, + 71.076801168383099139, 62.822179183349362575, 80.472233939486613963, 43.978832588021759875, + 121.97122131552168867, 110.1057909450137231, 66.616257714627863606, 18.783051552181859734, + 24.328923761877376819, 47.815979578095721081, 73.889757522672880441, 123.85897458967883722, + 29.369214135451329639, 94.993289272893889574, 50.846826465272897622, 75.866288797518791398, + 58.311458755793864839, 101.15095963562635006, 70.450281584700860549, 32.622143423253874062, + 76.438690449936984805, 120.79254521332404693, 83.951828600016597193, 18.072904308519355254, + 124.86966248120370437, 126.42757748826261377, 14.924561601295863511, 31.229562856839038432, + 109.74094100707225152, 102.65188654902885901, 53.678034035161545034, 64.029053517933789408, + 105.97111046384088695, 28.469609253672388149, 20.685961084334849147, 0, + 100.89162174606462941, 78.68609490471862955, 112.21424325702173519, 98.111359593116503675, + 99.671367393195396289, 54.892788367411412764, 55.294923373665369581, 117.01917702296850621, + 97.869900409736146685, 78.491470600456523243, 75.68287856746246689, 99.504724680431536399, + 65.224881543195806444, 106.40329859045596095, 126.18347004822499002, 15.985534664010629058, + 89.503890212879923638, 22.703443184225761797, 77.6238371102954261, 77.728427051381004276, + 30.374667016123567009, 119.34761790888660471, 108.95356606649147579, 41.286944746429071529, + 123.07020317402566434, 44.024910805968829663, 90.917910810334433336, 4.8423109607065271121, + 99.5678920089485473, 97.049609224282903597, 82.506363047283230117, 108.25059089520800626, + 16.376485194228735054, 103.31864558275628951, 112.13712799200220616, 78.106421405274886638, + 9.1660667519208800513, 81.448296836508234264, 61.075277113373886095, 31.324211329829267925, + 119.88767261341490666, 60.621832190885470482, 112.80971883860547678, 114.96784936286712764, + 53.792762703615153441, 126.14138886693763197, 17.671535213910829043, 22.594262930302647874, + 97.294339275973470649, 5.5365373255554004572, 23.250046826753532514, 49.420152475639042677, + 27.001498430225183256, 86.574050343282578979, 84.874404630711069331, 8.3202855080780864228, + 41.83707794338624808, 112.97178169362086919, 57.770596836329787038, 6.8074012855395267252, + 39.793504981214937288, 90.767250736971618608, 124.00165055866455077, 103.05077509947659564, + 33.899995176489028381, 15.966212332012219122, 45.848764567181206075, 19.023425485505867982, + 111.03598671132567688, 107.73040407052394585, 109.38394829459139146, 17.411930267731804634, + 85.555224220355739817, 45.773705898725893348, 20.187590228273620596, 26.87110529108758783, + 46.383094966709904838, 16.419706266362481983, 66.717951087524852483, 37.14223787384617026, + 13.854067205200408353, 28.761066932249377714, 45.150222579366527498, 51.983320481627742993, + 35.532171337035833858, 113.29421365068265004, 93.740457100600906415, 95.978389786250772886, + 124.07184390102338511, 109.70150216303591151, 35.34546839871109114, 16.629640868442947976, + 18.766994730747683207, 57.071140870073577389, 92.01057525434953277, 36.580206572773022344, + 75.875195101350982441, 93.612822203929681564, 96.236254750267107738, 25.280368603805982275, + 19.243923288544465322, 37.86878403730224818, 74.13251511344788014, 90.591328211961808847, + 115.15513356420706259, 33.308170307154796319, 101.69843021165797836, 79.077301759036345175, + 116.59211590999984764, 92.323825071911414852, 54.12831863672909094, 126.8666122640024696, + 74.275209853207343258, 100.7308874230911897, 66.474350529810180888, 105.79552798721852014, + 48.004090154550794978, 9.4184230310092971195, 41.109552253168658353, 107.37041085858800216, + 36.527083481189038139, 77.160612889427284244, 20.331855565935256891, 121.6123201815316861, + 117.40777125191743835, 91.626642707720748149, 38.080647071590647101, 50.107550395325233694, + 36.512318895602220437, 40.885206023354839999, 112.25883260306000011, 86.668711001104384195, + 39.312566629429056775, 118.59641821751938551, 102.11702997398242587, 19.556956576958327787, + 76.798420029419503408, 85.770035964218550362, 20.111498812446370721, 36.62591144477846683, + 115.15618900406116154, 61.286015318644786021, 1.5705484371537750121, 31.820294030421791831, + 72.378385786687431391, 58.449784808261028957, 121.9287995676859282, 65.350474179722368717, + 92.576177273425855674, 34.105911371749243699, 1.6921386374706344213, 72.110275994178664405, + 90.336604875999910291, 115.07640805843402632, 1.2371297993959160522, 79.709829202172841178, + 91.664368282803479815, 81.182867796716891462, 108.14224721366917947, 29.159688088770053582, + 110.85524191841614083, 27.518970069555507507, 101.83471875259419903, 31.716801427770406008, + 43.598410429363866569, 7.1353150334834936075, 15.386997928184428019, 86.887983629338123137, + 83.478323615716362838, 41.145855934759310912, 119.59677862448370433, 50.579517468544509029, + 124.67043579767414485, 59.953945166282210266, 108.1937440379660984, 2.9632598508287628647, + 117.39629649847483961, 115.9485764198252582, 119.89370799813332269, 95.704638521732704248, + 4.0239712069487723056, 27.205419999052537605, 109.35997324335403391, 33.153600635436305311, + 82.199976604206312913, 80.791493148459267104, 3.8115684609110758174, 91.717912205574975815, + 123.44567163745887228, 88.860562197889521485, 47.739763881745602703, 109.38423462710125023, + 124.96633626079710666, 91.888237190221843775, 29.91969243113999255, 53.011470773260953138, + 70.18726614744446124, 27.716972823654941749, 123.2519396699135541, 109.5824748766135599, + 42.937640501841087826, 8.6852631779183866456, 95.625288591243588598, 80.458308520443097223, + 123.16433848014639807, 123.6239738091462641, 110.15611232204537373, 59.447240144763782155, + 8.0151571576388960239, 127.06240931067441124, 12.85095796129462542, 87.335608333170966944, + 51.431359244834311539, 114.6697982645346201, 94.06389598572786781, 22.889079128133744234, + 103.04924849864255521, 122.84959816962509649, 57.105490220554202097, 82.232315931600169279, + 98.517039852536981925, 46.109539829230925534, 74.394002274344529724, 106.56009629966501961, + 118.87985628979367903, 82.363457166640728246, 77.549444745702203363, 70.646718088471970987, + 22.892235724251804641, 100.93750581276981393, 2.2129395749398099724, 82.564114651064301142, + 37.824038482107425807, 23.703668683061550837, 112.4644612832707935, 92.051121883865562268, + 8.0911435086745768785, 4.9922265970963053405, 31.521731157368776621, 32.794668153761449503, + 47.86589636436838191, 105.07409655443188967, 103.68723033987771487, 69.255162408138858154, + 79.738161897366808262, 90.948135290680511389, 52.213270694363018265, 43.82166478277213173, + 83.531251075859472621, 13.730032786159426905, 125.34447886639100034, 107.34460529068383039, + 12.815440313966973918, 42.132314911210414721, 74.331727656728617148, 32.375944972827710444, + 68.367426072461967124, 17.584663623900269158, 55.598132496965263272, 89.554547197356441757, + 36.829474912461591884, 109.13469493564116419, 106.91052824852158665, 58.667890483833616599, + 105.15194433433862287, 90.531685142828791868, 33.94177976233913796, 79.619983573415083811, + 34.209250436600996181, 1.0692596426924865227, 41.730895445452915737, 4.287997170897142496, + 42.838773186511389213, 118.89252973430484417, 42.453093997384712566, 77.837122591216029832, + 55.053510793652094435, 78.547115128800214734, 97.815190565816010348, 12.253085329903115053, + 98.562857131000782829, 125.98431197057288955, 13.62387496011069743, 101.80402182897887542, + 68.154910192690294934, 94.151744040387711721, 35.386087585291534197, 102.40464428278937703, + 69.46473058378251153, 71.614066258462116821, 42.59220737464420381, 118.38660492383860401, + 125.98420533100579632, 113.77174164741154527, 83.650983092204114655, 119.46833196822262835, + 19.574039582988916663, 17.696137784281745553, 90.573226334301580209, 124.14701249561767327, + 78.797398856917425292, 37.354871277406346053, 100.1831321962090442, 74.705813233613298507, + 101.1403952296677744, 35.421538090326066595, 11.433795671688130824, 38.386463344784715446, + 93.607641693015466444, 114.33988912110362435, 97.527120562059280928, 65.658327068234939361, + 7.1166659451191662811, 66.192848941369447857, 117.98764646768177045, 78.010329713157261722, + 79.984471719355497044, 60.651433059090777533, 52.888462878450809512, 116.16644401878511417, + 62.486972858452645596, 98.403108458805945702, 82.005286942374368664, 45.235412402635120088, + 8.2141414702782640234, 68.161381685225933325, 62.388465702842950122, 35.930133488174760714, + 46.712859742317959899, 63.659138250852265628, 94.668680712016794132, 41.110372226175968535, + 65.032933802845946047, 68.189100696905370569, 14.153602336766198277, 125.64435836670236313, + 32.944467878973227926, 87.957665176047157729, 115.94244263104701531, 92.211581890031084185, + 5.2325154292557272129, 37.566103104363719467, 48.657847523754753638, 95.631959156195080141, + 19.779515045349398861, 119.71794917935767444, 58.738428270906297257, 61.986578545787779149, + 101.69365293054943322, 23.732577595037582796, 116.62291751159136766, 74.301919271256338106, + 12.900563169401721098, 65.244286846511386102, 24.87738089987760759, 113.58509042665173183, + 39.903657200033194385, 36.145808617042348487, 121.73932496241104673, 124.85515497652522754, + 29.849123202591727022, 62.459125713681714842, 91.481882014148141025, 77.303773098057718016, + 107.35606807032672805, 0.058107035871216794476, 83.942220927681773901, 56.939218507344776299, + 41.371922168669698294, 0, 73.78324349213289679, 29.372189809440897079, + 96.428486514047108358, 68.222719186236645328, 71.342734786390792578, 109.78557673482282553, + 110.58984674733437714, 106.03835404594065039, 67.739800819475931348, 28.982941200916684465, + 23.365757134928571759, 71.009449360866710776, 2.4497630863952508662, 84.806597180915559875, + 124.36694009644998005, 31.971069328024896095, 51.007780425759847276, 45.406886368455161573, + 27.24767422059449018, 27.456854102762008552, 60.749334032250771997, 110.6952358177768474, + 89.907132132982951589, 82.573889492861781036, 118.14040634805132868, 88.049821611941297306, + 53.835821620668866672, 9.6846219214166922029, 71.135784017900732579, 66.099218448569445172, + 37.012726094570098212, 88.501181790416012518, 32.752970388461108087, 78.637291165516217006, + 96.274255984008050291, 28.212842810549773276, 18.332133503845398081, 34.896593673016468529, + 122.15055422674777219, 62.648422659662173828, 111.77534522682981333, 121.24366438177457894, + 97.619437677214591531, 101.93569872573425528, 107.58552540723394486, 124.28277773387526395, + 35.343070427821658086, 45.188525860608933726, 66.588678551946941298, 11.073074651110800914, + 46.500093653507065028, 98.840304951278085355, 54.002996860454004491, 45.148100686568795936, + 41.748809261422138661, 16.640571016156172846, 83.674155886776134139, 97.943563387241738383, + 115.54119367265957408, 13.61480257107905345, 79.587009962433512555, 53.534501473946875194, + 120.00330111733273952, 78.101550198953191284, 67.799990352978056762, 31.932424664024438243, + 91.697529134362412151, 38.046850971015373943, 94.071973422654991737, 87.460808141051529674, + 90.767896589182782918, 34.823860535467247246, 43.110448440711479634, 91.547411797451786697, + 40.375180456547241192, 53.742210582175175659, 92.766189933419809677, 32.839412532728601946, + 5.4359021750497049652, 74.284475747692340519, 27.708134410400816705, 57.522133864498755429, + 90.300445158733054996, 103.96664096325548599, 71.064342674075305695, 98.58842730136893806, + 59.480914201205450809, 63.956779572505183751, 120.14368780205040821, 91.403004326071823016, + 70.690936797422182281, 33.259281736885895953, 37.533989461495366413, 114.14228174015079276, + 56.02115050869906554, 73.160413145549682667, 23.75039020270560286, 59.225644407863001106, + 64.472509500534215476, 50.56073720761196455, 38.487846577088930644, 75.737568074608134339, + 20.265030226899398258, 53.182656423927255673, 102.31026712841412518, 66.616340614313230617, + 75.396860423319594702, 30.154603518076328328, 105.18423182000333327, 56.647650143822829705, + 108.25663727346181986, 125.73322452800857718, 20.550419706418324495, 73.461774846186017385, + 4.948701059623999754, 83.591055974437040277, 96.008180309101589955, 18.836846062018594239, + 82.219104506340954686, 86.740821717176004313, 73.054166962381714256, 26.321225778854568489, + 40.663711131874151761, 115.22464036306701018, 106.81554250383851468, 55.253285415441496298, + 76.161294143181294203, 100.21510079065046739, 73.024637791204440873, 81.770412046713317977, + 96.5176652061236382, 45.33742200220876839, 78.625133258861751528, 109.19283643504240899, + 76.234059947964851744, 39.113913153920293553, 25.596840058842644794, 43.540071928437100723, + 40.222997624892741442, 73.251822889560571639, 102.31237800812232308, 122.57203063728957204, + 3.1410968743075500242, 63.640588060847221641, 16.756771573374862783, 116.89956961652569589, + 115.85759913537549437, 2.7009483594483754132, 57.152354546851711348, 68.211822743498487398, + 3.3842772749449068215, 16.220551988360966789, 52.673209752003458561, 102.15281611686805263, + 2.4742595987954700831, 31.419658404349320335, 55.328736565610597609, 34.365735593437420903, + 88.284494427338358946, 58.319376177543745143, 93.710483836832281668, 55.037940139114652993, + 75.669437505188398063, 63.433602855540812016, 87.196820858727733139, 14.270630066966987215, + 30.773995856372494018, 45.775967258679884253, 38.956647231432725675, 82.291711869522259803, + 111.19355724896740867, 101.15903493709265604, 121.3408715953482897, 119.90789033256805851, + 88.387488075932196807, 5.9265197016611637082, 106.7925929969533172, 103.89715283965415438, + 111.78741599627028336, 63.409277043465408497, 8.0479424138975446112, 54.410839998108713189, + 90.719946486708067823, 66.3072012708762486, 36.399953208416263806, 33.582986296918534208, + 7.6231369218257896136, 55.435824411153589608, 118.89134327492138254, 49.72112439577904297, + 95.479527763494843384, 90.76846925420613843, 121.9326725215978513, 55.776474380443687551, + 59.8393848622799851, 106.02294154652554425, 12.374532294888922479, 55.433945647313521476, + 118.50387933983074618, 91.1649497532271198, 85.875281003682175651, 17.37052635584041127, + 63.250577182490815176, 32.916617040889832424, 118.32867696029643412, 119.24794761829616618, + 92.312224644090747461, 118.89448028952756431, 16.030314315281430027, 126.12481862134882249, + 25.701915922592888819, 46.671216666341933887, 102.86271848967226106, 101.33959652907287818, + 60.12779197145573562, 45.778158256271126447, 78.098496997288748389, 117.69919633925019298, + 114.21098044111204217, 36.464631863203976536, 69.034079705073963851, 92.219079658465489047, + 20.788004548692697426, 85.120192599333677208, 109.75971257959099603, 36.726914333285094472, + 27.098889491408044705, 13.293436176943941973, 45.78447144850724726, 73.875011625539627858, + 4.4258791498832579236, 37.128229302128602285, 75.648076964214851614, 47.407337366126739653, + 96.928922566545224981, 56.102243767731124535, 16.182287017349153757, 9.9844531941926106811, + 63.043462314737553243, 65.589336307522899006, 95.731792728740401799, 82.148193108867417322, + 79.374460679759067716, 10.510324816281354288, 31.476323794737254502, 53.896270581361022778, + 104.42654138872603653, 87.643329565547901439, 39.062502151718945242, 27.460065572322491789, + 122.68895773278563865, 86.68921058136766078, 25.630880627933947835, 84.26462982242446742, + 20.663455313457234297, 64.751889945659058867, 8.7348521449239342473, 35.169327247800538316, + 111.19626499393416452, 51.109094394712883513, 73.658949824926821748, 90.269389871285966365, + 85.821056497043173295, 117.33578096767087118, 82.303888668680883711, 53.063370285657583736, + 67.883559524681913899, 31.239967146830167621, 68.418500873201992363, 2.1385192853849730454, + 83.461790890905831475, 8.5759943417942849919, 85.677546373026416404, 109.78505946860968834, + 84.90618799477306311, 27.674245182432059664, 110.10702158730782685, 29.094230257604067447, + 67.630381131632020697, 24.506170659809868084, 69.125714262005203636, 123.9686239411457791, + 27.247749920225032838, 75.608043657961388817, 8.3098203853842278477, 60.303488080775423441, + 70.772175170586706372, 76.809288565582392039, 10.92946116756866104, 15.228132516924233641, + 85.184414749292045599, 108.773209847680846, 123.96841066201523063, 99.543483294826728525, + 39.301966184411867289, 110.9366639364452567, 39.148079165977833327, 35.392275568567129085, + 53.146452668606798397, 120.29402499123898451, 29.594797713834850583, 74.709742554816330085, + 72.36626439242172637, 21.411626467230234994, 74.280790459335548803, 70.843076180652133189, + 22.867591343376261648, 76.77292668957306887, 59.215283386034570867, 100.67977824221088667, + 67.054241124122199835, 3.316654136469878722, 14.233331890241970541, 4.3856978827425336931, + 107.97529293536717887, 28.020659426318161422, 31.968943438710994087, 121.30286611818155507, + 105.776925756905257, 104.33288803757022833, 124.97394571690892917, 68.806216917615529383, + 36.010573884748737328, 90.470824805270240176, 16.428282940560166026, 8.3227633704518666491, + 124.77693140568590024, 71.860266976349521428, 93.425719484635919798, 127.31827650170816923, + 61.337361424033588264, 82.220744452355575049, 2.0658676056955300737, 8.3782013938107411377, + 28.307204673536034534, 123.28871673340472626, 65.88893575795009383, 47.915330352097953437, + 103.8848852620976686, 56.423163780062168371, 10.465030858511454426, 75.132206208727438934, + 97.315695047513145255, 63.263918312390160281, 39.5590300907024357, 111.43589835871534888, + 117.47685654181259451, 123.97315709157919628, 75.387305861098866444, 47.465155190078803571, + 105.24583502318637329, 20.603838542512676213, 25.801126338807080174, 2.4885736930227722041, + 49.754761799758853158, 99.170180853303463664, 79.807314400066388771, 72.291617234088334953, + 115.47864992482573143, 121.71030995305045508, 59.698246405183454044, 124.91825142736706766, + 54.963764028299920028, 26.607546196119074011, 86.712136140653456096, 0.11621407174607156776, + 39.884441855363547802, 113.8784370146895526, 82.743844337343034567, 0, + 19.566486984265793581, 58.744379618885432137, 64.856973028097854694, 8.4454383724769286346, + 14.685469572785223136, 91.571153469649289036, 93.179693494672392262, 84.076708091884938767, + 7.4796016389518626966, 57.965882401833368931, 46.731514269860781496, 14.018898721733421553, + 4.8995261727941397112, 41.613194361834757729, 120.73388019289996009, 63.942138656049792189, + 102.01556085151969455, 90.813772736910323147, 54.49534844118898036, 54.913708205524017103, + 121.49866806450518197, 93.390471635557332775, 51.814264265969541157, 37.147778985727200052, + 108.28081269610629533, 48.099643223882594611, 107.67164324133773334, 19.369243842837022385, + 14.271568035805103136, 4.1984368971388903446, 74.025452189143834403, 49.002363580832025036, + 65.505940776925854152, 29.274582331036071992, 64.548511968016100582, 56.425685621099546552, + 36.664267007690796163, 69.793187346036575036, 116.30110845349554438, 125.29684531932798564, + 95.550690453663264634, 114.48732876355279586, 67.238875354432821041, 75.871397451472148532, + 87.171050814471527701, 120.5655554677505279, 70.686140855643316172, 90.377051721221505431, + 5.177357103893882595, 22.146149302221601829, 93.000187307017768035, 69.680609902556170709, + 108.00599372090800898, 90.296201373137591872, 83.497618522844277322, 33.28114203231598367, + 39.348311773555906257, 67.887126774487114744, 103.08238734531914815, 27.22960514216174488, + 31.174019924867025111, 107.06900294789738837, 112.00660223466911702, 28.203100397910020547, + 7.5999807059561135247, 63.864849328052514466, 55.395058268724824302, 76.093701942034385866, + 60.143946845313621452, 46.921616282106697327, 53.535793178365565836, 69.647721070934494492, + 86.220896881426597247, 55.094823594903573394, 80.750360913094482385, 107.4844211643539893, + 57.532379866839619353, 65.678825065457203891, 10.871804350103047909, 20.568951495384681039, + 55.41626882080163341, 115.04426772900114884, 52.60089031746974797, 79.93328192651460995, + 14.128685348154249368, 69.176854602737876121, 118.96182840241090162, 127.91355914501400548, + 112.2873756041044544, 54.80600865214728401, 13.381873594844364561, 66.518563473771791905, + 75.067978922994370805, 100.28456348030158551, 112.04230101740176906, 18.320826291099365335, + 47.50078040541120572, 118.45128881572964019, 0.94501900106843095273, 101.1214744152239291, + 76.975693154181499267, 23.475136149216268677, 40.530060453798796516, 106.36531284785814933, + 76.620534256831888342, 5.2326812286300992128, 22.793720846639189404, 60.309207036156294635, + 82.368463640006666537, 113.29530028764929739, 88.513274546927277697, 123.46644905601715436, + 41.100839412840286968, 18.92354969237203477, 9.8974021192516374867, 39.182111948877718532, + 64.016360618203179911, 37.673692124040826457, 36.43820901268554735, 45.481643434355646605, + 18.108333924763428513, 52.642451557709136978, 81.3274222637519415, 102.44928072613765835, + 85.631085007677029353, 110.50657083088663057, 24.322588286366226384, 72.430201581304572755, + 18.049275582412519725, 35.540824093430273933, 65.035330412247276399, 90.674844004421174759, + 29.250266517727141036, 90.385672870088455966, 24.468119895929703489, 78.227826307840587106, + 51.193680117685289588, 87.080143856874201447, 80.445995249789120862, 18.503645779124781257, + 76.624756016248284141, 117.14406127457914408, 6.2821937486151000485, 127.28117612169444328, + 33.513543146753363544, 105.79913923305502976, 103.71519827075098874, 5.4018967188967508264, + 114.30470909370706067, 8.4236454869969747961, 6.7685545498898136429, 32.441103976721933577, + 105.3464195040105551, 76.305632233736105263, 4.9485191975909401663, 62.839316808698640671, + 110.65747313122119522, 68.731471186878479784, 48.568988854676717892, 116.63875235509112827, + 59.420967673664563335, 110.07588027823294397, 23.338875010376796126, 126.86720571108526201, + 46.393641717455466278, 28.54126013393397443, 61.547991712744988035, 91.551934517359768506, + 77.91329446286908933, 36.583423739048157586, 94.387114497938455315, 74.318069874188950052, + 114.68174319070021738, 111.815780665139755, 48.774976151864393614, 11.853039403325965395, + 85.585185993910272373, 79.794305679311946733, 95.574831992540566716, 126.81855408693081699, + 16.095884827795089222, 108.82167999622106436, 53.439892973419773625, 4.6144025417524971999, + 72.799906416832527611, 67.165972593837068416, 15.246273843651579227, 110.8716488223108172, + 109.78268654984276509, 99.44224879156172392, 62.959055526993324747, 53.536938508415914839, + 115.8653450431957026, 111.5529487608873751, 119.67876972456360818, 84.045883093051088508, + 24.749064589777844958, 110.86789129463068093, 109.00775867966513033, 54.329899506457877578, + 43.750562007364351302, 34.74105271168082254, 126.50115436498163035, 65.833234081783302827, + 108.65735392059650621, 110.49589523659597035, 56.6244492881851329, 109.78896057905512862, + 32.060628630566498032, 124.24963724269764498, 51.403831845185777638, 93.342433332687505754, + 77.725436979348160094, 74.679193058145756368, 120.25558394291147124, 91.556316512545890873, + 28.196993994581134757, 107.39839267850402393, 100.42196088222408434, 72.929263726411591051, + 10.06815941015156568, 56.438159316930978093, 41.576009097389032831, 42.240385198670992395, + 91.519425159181992058, 73.453828666570188943, 54.19777898281608941, 26.586872353887883946, + 91.568942897018132498, 19.750023251079255715, 8.8517582997665158473, 74.256458604260842549, + 23.296153928429703228, 94.814674732257117284, 65.857845133090449963, 112.20448753546224907, + 32.364574034698307514, 19.968906388385221362, 126.08692462947874446, 3.1786726150494359899, + 63.463585457484441577, 36.296386217738472624, 30.748921359518135432, 21.020649632562708575, + 62.952647589474509005, 107.79254116272568353, 80.853082777455711039, 47.286659131095802877, + 78.125004303437890485, 54.920131144648621557, 117.37791546557491529, 45.378421162735321559, + 51.261761255871533649, 40.52925964484893484, 41.326910626918106573, 1.503779891318117734, + 17.469704289847868495, 70.338654495604714612, 94.392529987868329044, 102.21818878942940501, + 19.317899649857281474, 52.538779742575570708, 43.642112994089984568, 106.67156193534538033, + 36.607777337361767422, 106.12674057131880545, 7.7671190493638277985, 62.479934293663973222, + 8.8370017464039847255, 4.2770385707735840697, 38.92358178181166295, 17.151988683592207963, + 43.355092746056470787, 91.570118937223014655, 41.81237598954612622, 55.348490364867757307, + 92.214043174615653697, 58.188460515211772872, 7.260762263264041394, 49.012341319623374147, + 10.251428524014045252, 119.9372478822915582, 54.495499840453703655, 23.216087315922777634, + 16.619640770768455695, 120.60697616155448486, 13.544350341177050723, 25.618577131164784078, + 21.858922335137322079, 30.456265033852105262, 42.368829498587729177, 89.546419695365329972, + 119.93682132403409923, 71.086966589653457049, 78.603932368827372557, 93.87332787289051339, + 78.296158331955666654, 70.78455113713425817, 106.29290533721723477, 112.58804998247796902, + 59.189595427673339145, 21.419485109636298148, 16.73252878484345274, 42.823252934464107966, + 20.561580918674735585, 13.686152361304266378, 45.735182686756161274, 25.54585337914613774, + 118.43056677207277971, 73.359556484425411327, 6.1084822482443996705, 6.633308272939757444, + 28.466663780483941082, 8.771395765488705365, 87.950585870734357741, 56.041318852636322845, + 63.937886877425626153, 114.60573223636674811, 83.553851513814151986, 80.665776075144094648, + 121.94789143382149632, 9.6124338352310587652, 72.021147769501112634, 52.941649610540480353, + 32.856565881120332051, 16.645526740907371277, 121.55386281137543847, 15.720533952702680836, + 58.851438969275477575, 126.63655300341633847, 122.67472284807081451, 36.441488904711150099, + 4.1317352113910601474, 16.756402787621482275, 56.614409347075707046, 118.57743346681309049, + 3.77787151590018766, 95.830660704199544853, 79.769770524195337202, 112.84632756012433674, + 20.93006171702654683, 22.264412417458515847, 66.63139009502629051, 126.52783662478032056, + 79.118060181408509379, 94.871796717434335733, 106.95371308362882701, 119.94631418316203053, + 22.774611722197732888, 94.930310380161245121, 82.491670046372746583, 41.207677085025352426, + 51.602252677614160348, 4.9771473860455444083, 99.509523599521344295, 70.340361706610565307, + 31.614628800136415521, 16.583234468180307886, 102.95729984965510084, 115.42061990610091016, + 119.39649281037054607, 121.83650285473413533, 109.92752805659984006, 53.215092392241786001, + 45.424272281306912191, 0.23242814349214313552, 79.768883710730733583, 99.756874029382743174, + 37.487688674686069135, 0, 39.132973968531587161, 117.48875923777450225, + 1.7139460561957093887, 16.890876744953857269, 29.37093914557408425, 55.142306939302216051, + 58.359386989348422503, 40.153416183769877534, 14.959203277903725393, 115.93176480366673786, + 93.463028539721562993, 28.037797443466843106, 9.7990523455882794224, 83.226388723673153436, + 113.46776038579992019, 127.88427731210322236, 76.031121703043027082, 53.627545473820646293, + 108.99069688237796072, 109.82741641105167218, 114.99733612901400193, 58.780943271114665549, + 103.62852853193908231, 74.295557971458038082, 88.561625392212590668, 96.199286447768827202, + 87.343286482675466686, 38.738487685674044769, 28.543136071610206272, 8.3968737942814186681, + 20.050904378287668806, 98.004727161667688051, 3.0118815538517083041, 58.549164662075781962, + 1.0970239360322011635, 112.8513712421990931, 73.328534015385230305, 11.586374692076788051, + 104.60221690699472674, 122.59369063865960925, 63.101380907330167247, 100.9746575271092297, + 6.4777507088692800608, 23.742794902947935043, 46.342101628946693381, 113.13111093550469377, + 13.372281711290270323, 52.754103442443010863, 10.35471420778776519, 44.292298604446841637, + 58.000374614039174048, 11.361219805115979398, 88.011987441819655942, 52.592402746278821724, + 38.995237045688554645, 66.56228406463196734, 78.696623547115450492, 7.7742535489778674673, + 78.164774690638296306, 54.459210284323489759, 62.348039849737688201, 86.138005895798414713, + 96.013204469338234048, 56.406200795820041094, 15.199961411912227049, 127.72969865610502893, + 110.79011653745328658, 24.187403884068771731, 120.2878936906272429, 93.843232564213394653, + 107.07158635673476965, 11.295442141872626962, 44.441793762853194494, 110.18964718981078477, + 33.500721826192602748, 86.968842328707978595, 115.06475973368287669, 3.3576501309144077823, + 21.743608700206095818, 41.137902990769362077, 110.8325376416069048, 102.08853545800229767, + 105.20178063494313392, 31.866563853029219899, 28.257370696312136715, 10.353709205479390221, + 109.92365680482544121, 127.82711829003164894, 96.574751208208908793, 109.61201730429456802, + 26.763747189692367101, 5.0371269475472217891, 22.135957845992379589, 72.569126960606809007, + 96.084602034803538118, 36.64165258219873067, 95.001560810826049419, 108.90257763145928038, + 1.8900380021404998843, 74.242948830451496178, 25.951386308362998534, 46.950272298432537355, + 81.060120907601231011, 84.73062569571993663, 25.241068513663776685, 10.465362457260198426, + 45.587441693278378807, 120.61841407231622725, 36.736927280016971054, 98.590600575302232755, + 49.026549093858193373, 118.93289811203430872, 82.201678825680573937, 37.847099384744069539, + 19.794804238503274973, 78.364223897759075044, 0.032721236406359821558, 75.347384248081652913, + 72.8764180253710947, 90.963286868711293209, 36.216667849526857026, 105.28490311542191193, + 34.654844527507520979, 76.898561452278954675, 43.262170015357696684, 93.013141661773261148, + 48.645176572736090748, 16.860403162609145511, 36.09855116482503945, 71.081648186864185845, + 2.0706608244981907774, 53.349688008842349518, 58.50053303545792005, 52.771345740176911931, + 48.936239791863044957, 28.455652615681174211, 102.38736023537421715, 46.160287713752040872, + 32.891990499578241725, 37.007291558253200492, 25.24951203250020626, 106.28812254915828817, + 12.564387497233838076, 126.56235224338888656, 67.027086293510365067, 83.598278466113697505, + 79.430396541501977481, 10.803793437797139632, 100.60941818741412135, 16.847290973993949592, + 13.537109099779627286, 64.882207953447505133, 82.692839008024748182, 24.611264467472210526, + 9.8970383951818803325, 125.67863361740091932, 93.314946262446028413, 9.4629423737569595687, + 97.137977709357073763, 105.27750471018225653, 118.84193534733276465, 92.15176055646588793, + 46.677750020757230232, 125.73441142217052402, 92.787283434910932556, 57.08252026786794886, + 123.09598342549361405, 55.103869034723174991, 27.826588925738178659, 73.16684747809995315, + 60.774228995880548609, 20.636139748381538084, 101.36348638140407274, 95.631561330279510003, + 97.549952303728787228, 23.706078806655568769, 43.170371987824182725, 31.588611358627531445, + 63.149663985084771411, 125.63710817386163399, 32.191769655593816424, 89.643359992442128714, + 106.87978594683954725, 9.2288050835086323787, 17.599812833668693202, 6.3319451876741368324, + 30.492547687306796433, 93.743297644625272369, 91.565373099689168157, 70.884497583123447839, + 125.91811105398664949, 107.07387701683546766, 103.73069008639504318, 95.105897521778388182, + 111.35753944913085434, 40.091766186102177016, 49.498129179559327895, 93.735782589264999842, + 90.01551735933026066, 108.65979901291575516, 87.501124014728702605, 69.482105423365283059, + 125.00230872996689868, 3.6664681635702436324, 89.314707841196650406, 92.991790473191940691, + 113.24889857637390378, 91.577921158110257238, 64.121257261136634042, 120.49927448539528996, + 102.80766369037519326, 58.684866665378649486, 27.450873958699958166, 21.358386116295150714, + 112.51116788582658046, 55.112633025091781747, 56.393987989165907493, 86.796785357011685846, + 72.843921764451806666, 17.858527452823182102, 20.136318820303131361, 112.87631863386195619, + 83.152018194778065663, 84.480770397345622769, 55.038850318367622094, 18.907657333140377887, + 108.39555796563217882, 53.173744707779405871, 55.137885794036264997, 39.50004650215851143, + 17.703516599536669673, 20.512917208521685097, 46.592307856863044435, 61.629349464517872548, + 3.7156902661845379043, 96.408975070924498141, 64.729148069396615028, 39.937812776774080703, + 124.17384925895748893, 6.3573452300988719799, 126.92717091496888315, 72.592772435476945248, + 61.497842719036270864, 42.041299265125417151, 125.90529517895265599, 87.585082325455005048, + 33.706165554911422078, 94.573318262195243733, 28.25000860687578097, 109.84026228930088109, + 106.75583093114983058, 90.756842325470643118, 102.5235225117430673, 81.058519289697869681, + 82.653821253836213145, 3.0075597826362354681, 34.939408579699374968, 12.677308991213067202, + 60.785059975740296068, 76.436377578858810011, 38.635799299714562949, 105.07755948515114142, + 87.284225988183607114, 85.343123870690760668, 73.215554674727172824, 84.253481142637610901, + 15.534238098727655597, 124.95986858732794644, 17.674003492807969451, 8.5540771415471681394, + 77.847163563623325899, 34.303977367184415925, 86.710185492116579553, 55.140237874446029309, + 83.624751979092252441, 110.69698072973915259, 56.428086349231307395, 116.37692103042354574, + 14.521524526528082788, 98.024682639246748295, 20.502857048031728482, 111.8744957645831164, + 108.99099968090740731, 46.432174631845555268, 33.23928154154054937, 113.21395232310896972, + 27.088700682354101446, 51.237154262329568155, 43.717844670274644159, 60.912530067704210524, + 84.737658997179096332, 51.092839390734297922, 111.87364264807183645, 14.173933179310552077, + 29.207864737658383092, 59.746655745784664759, 28.592316663914971286, 13.569102274272154318, + 84.585810674438107526, 97.176099964955938049, 118.37919085534667829, 42.838970219272596296, + 33.465057569686905481, 85.646505868928215932, 41.12316183734947117, 27.372304722608532757, + 91.470365373512322549, 51.09170675829591346, 108.86113354414919741, 18.719112968850822654, + 12.216964496488799341, 13.266616545879514888, 56.933327560967882164, 17.542791530981048709, + 47.901171741468715481, 112.08263770527264569, 127.87577375485489029, 101.2114644727371342, + 39.10770302763194195, 33.331552150291827274, 115.89578286764299264, 19.224867670465755509, + 16.042295539002225269, 105.88329922108096071, 65.713131762240664102, 33.291053481818380533, + 115.10772562275087694, 31.441067905405361671, 117.70287793855459313, 125.27310600683631492, + 117.34944569614162901, 72.882977809422300197, 8.2634704227821202949, 33.512805575242964551, + 113.22881869415505207, 109.15486693362618098, 7.5557430318040132988, 63.661321408402727684, + 31.539541048394312384, 97.692655120248673484, 41.860123434053093661, 44.528824834920669673, + 5.2627801900562189985, 125.0556732495642791, 30.236120362820656737, 61.743593434872309444, + 85.907426167261291994, 111.89262836632406106, 45.549223444399103755, 61.86062076032612822, + 36.983340092745493166, 82.415354170050704852, 103.2045053552283207, 9.9542947720947267953, + 71.019047199046326568, 12.680723413221130613, 63.229257600272831041, 33.16646893636425375, + 77.914599699313839665, 102.84123981220545829, 110.79298562074473011, 115.67300570947190863, + 91.855056113199680112, 106.430184784483572, 90.848544562613824382, 0.46485628698792424984, + 31.537767421465105144, 71.513748058765486348, 74.975377349375776248, 0, + 78.265947937066812301, 106.97751847554900451, 3.4278921123914187774, 33.781753489907714538, + 58.741878291148168501, 110.2846138786044321, 116.71877397869684501, 80.306832367539755069, + 29.918406555811088765, 103.8635296073371137, 58.926057079443125986, 56.075594886933686212, + 19.598104691180196824, 38.45277744734994485, 98.935520771603478352, 127.76855462421008269, + 24.062243406086054165, 107.25509094764493057, 89.981393764759559417, 91.654832822106982348, + 101.99467225802800385, 117.56188654223296908, 79.257057063881802605, 20.591115942919714143, + 49.123250784428819316, 64.398572895541292382, 46.686572965350933373, 77.476975371348089539, + 57.086272143220412545, 16.793747588562837336, 40.10180875657897559, 68.009454323335376102, + 6.0237631077034166083, 117.09832932415156392, 2.1940478720680403057, 97.702742484401824186, + 18.657068030770460609, 23.172749384157214081, 81.204433813993091462, 117.1873812773192185, + 126.20276181466397247, 73.949315054218459409, 12.955501417738560122, 47.485589805895870086, + 92.684203257897024741, 98.262221871009387542, 26.744563422580540646, 105.50820688488602173, + 20.70942841557553038, 88.584597208893683273, 116.0007492280783481, 22.722439610235596774, + 48.023974883639311884, 105.18480549255764345, 77.990474091380747268, 5.1245681292675726581, + 29.393247094230900984, 15.548507097959372913, 28.329549381276592612, 108.91842056864697952, + 124.69607969947901438, 44.276011791600467404, 64.026408938676468097, 112.81240159164008219, + 30.399922823828092078, 127.45939731221369584, 93.580233074906573165, 48.374807768141181441, + 112.57578738125812379, 59.686465128430427285, 86.143172713469539303, 22.590884283745253924, + 88.883587525710026966, 92.379294379621569533, 67.001443652388843475, 45.937684657419595169, + 102.12951946736575337, 6.7153002618288155645, 43.487217400412191637, 82.275805981542362133, + 93.665075283217447577, 76.177070916008233326, 82.403561269886267837, 63.733127706058439799, + 56.514741392624273431, 20.70741841096241842, 91.847313609654520405, 127.65423658006693586, + 65.149502416421455564, 91.224034608589136042, 53.527494379384734202, 10.074253895094443578, + 44.271915691988397157, 17.138253921217255993, 64.169204069607076235, 73.283305164401099319, + 62.003121621655736817, 89.805155262918560766, 3.7800760042846377473, 20.485897660902992357, + 51.902772616725997068, 93.900544596868712688, 34.1202418152061, 41.46125139143987326, + 50.482137027327553369, 20.930724914520396851, 91.174883386560395593, 113.2368281446324545, + 73.473854560037580086, 69.181201150604465511, 98.053098187720024725, 109.86579622407225543, + 36.403357651361147873, 75.694198769488139078, 39.589608477010187926, 28.728447795518150087, + 0.065442472816357621923, 22.694768496166943805, 17.752836050745827379, 53.926573737422586419, + 72.433335699057352031, 82.569806230843823869, 69.309689055018679937, 25.797122904557909351, + 86.524340030719031347, 58.026283323546522297, 97.290353145472181495, 33.720806325218291022, + 72.197102329653716879, 14.163296373728371691, 4.1413216489963815548, 106.69937601768469904, + 117.0010660709158401, 105.54269148035382386, 97.872479583726089913, 56.911305231365986401, + 76.774720470748434309, 92.320575427504081745, 65.783980999156483449, 74.014583116506400984, + 50.499024065004050499, 84.576245098316576332, 25.12877499447131413, 125.12470448678141111, + 6.0541725870243681129, 39.196556932231032988, 30.860793083003954962, 21.607586875597917242, + 73.218836374828242697, 33.694581947987899184, 27.074218199562892551, 1.7644159068986482453, + 37.385678016049496364, 49.222528934944421053, 19.794076790367398644, 123.35726723480547662, + 58.629892524892056827, 18.925884747517557116, 66.275955418717785506, 82.555009420368151041, + 109.68387069466916728, 56.30352111293177586, 93.355500041518098442, 123.46882284434468602, + 57.574566869821865112, 114.1650405357395357, 118.1919668509872281, 110.20773806944634998, + 55.653177851479995297, 18.333694956199906301, 121.54845799176109722, 41.272279496766714146, + 74.726972762811783468, 63.263122660562657984, 67.099904607457574457, 47.412157613311137538, + 86.340743975648365449, 63.177222717255062889, 126.2993279701731808, 123.27421634772326797, + 64.383539311191270826, 51.286719984887895407, 85.759571893679094501, 18.457610167017264757, + 35.199625667337386403, 12.663890375348273665, 60.985095374617230846, 59.486595289254182717, + 55.130746199381974293, 13.768995166250533657, 123.83622210797693697, 86.147754033674573293, + 79.461380172793724341, 62.211795043560414342, 94.715078898261708673, 80.183532372204354033, + 98.996258359122293768, 59.471565178533637663, 52.0310347186641593, 89.319598025835148292, + 47.002248029461043188, 10.964210846734204097, 122.00461745993379736, 7.3329363271441252436, + 50.629415682396938791, 57.983580946387519361, 98.497797152751445537, 55.155842316224152455, + 0.24251452227690606378, 112.99854897079421789, 77.61532738075038651, 117.36973333075729897, + 54.901747917399916332, 42.716772232593939407, 97.022335771653160919, 110.22526605018356349, + 112.78797597833545296, 45.593570714027009672, 17.687843528903613333, 35.717054905646364205, + 40.2726376406099007, 97.752637267727550352, 38.304036389559769304, 40.961540794691245537, + 110.07770063673524419, 37.815314666284393752, 88.791115931264357641, 106.34748941555881174, + 110.27577158807252999, 79.00009300431702286, 35.407033199073339347, 41.025834417043370195, + 93.18461571372608887, 123.2586989290357451, 7.4313805323727137875, 64.81795014185263426, + 1.4582961387932300568, 79.875625553551799385, 120.34769851791497786, 12.714690460201381939, + 125.85434182994140428, 17.185544870953890495, 122.99568543807254173, 84.08259853025447228, + 123.81059035790894995, 47.170164650910010096, 67.412331109826482134, 61.146636524390487466, + 56.500017213755199919, 91.680524578605400166, 85.511661862303299131, 53.513684650944924215, + 77.047045023489772575, 34.11703857939937734, 37.307642507672426291, 6.0151195652724709362, + 69.878817159398749936, 25.354617982426134404, 121.57011995148423011, 24.872755157717620023, + 77.271598599432763876, 82.155118970305920811, 46.568451976370852208, 42.686247741385159316, + 18.431109349457983626, 40.506962285275221802, 31.068476197458949173, 121.91973717465589289, + 35.348006985615938902, 17.108154283097974258, 27.694327127246651798, 68.607954734372469829, + 45.420370984233159106, 110.2804757488956966, 39.24950395818814286, 93.393961459478305187, + 112.85617269846625277, 104.75384206084709149, 29.043049053059803555, 68.049365278493496589, + 41.005714096067094943, 95.748991529169870773, 89.98199936181481462, 92.864349263691110536, + 66.478563083084736718, 98.427904646217939444, 54.177401364708202891, 102.47430852465913631, + 87.435689340549288318, 121.82506013541205903, 41.475317994358192664, 102.18567878147223382, + 95.747285296143672895, 28.347866358621104155, 58.415729475316766184, 119.49331149156932952, + 57.184633327829942573, 27.138204548547946615, 41.171621348879853031, 66.352199929915514076, + 108.75838171069335658, 85.677940438545192592, 66.930115139377448941, 43.293011737856431864, + 82.246323674698942341, 54.744609445220703492, 54.940730747024645098, 102.1834135165954649, + 89.72226708829839481, 37.438225937701645307, 24.433928992977598682, 26.533233091759029776, + 113.86665512193576433, 35.085583061962097418, 95.802343482941068942, 96.165275410548929358, + 127.75154750971341855, 74.422928945474268403, 78.2154060552638839, 66.663104300587292528, + 103.79156573528598528, 38.449735340931511018, 32.084591078008088516, 83.766598442165559391, + 3.4262635244813282043, 66.582106963640399044, 102.21545124550175387, 62.882135810814361321, + 107.40575587711282424, 122.54621201367626782, 106.69889139228689601, 17.765955618844600394, + 16.52694084556424059, 67.025611150489567081, 98.457637388313742122, 90.309733867252361961, + 15.111486063608026598, 127.32264281680545537, 63.079082096792262746, 67.385310240497346967, + 83.720246868106187321, 89.057649669841339346, 10.525560380116075976, 122.11134649912855821, + 60.472240725641313475, 123.48718686974825687, 43.814852334526221966, 95.785256732648122124, + 91.09844688879820751, 123.72124152065225644, 73.966680185494624311, 36.830708340105047682, + 78.409010710456641391, 19.908589544193091569, 14.038094398092653137, 25.361446826442261226, + 126.45851520054566208, 66.332937872732145479, 27.829199398631317308, 77.682479624414554564, + 93.585971241493098205, 103.34601141894745524, 55.710112226402998203, 84.860369568970781984, + 53.697089125227648765, 0.92971257397584849969, 63.075534842933848267, 15.027496117534610676, + 21.950754698755190475, 0, 28.531895874137262581, 85.955036951098009013, + 6.8557842247828375548, 67.563506979815429077, 117.48375658229997498, 92.569227757212502183, + 105.43754795739732799, 32.613664735079510137, 59.836813111625815509, 79.727059214674227405, + 117.85211415888625197, 112.15118977386737242, 39.196209382360393647, 76.90555489470352768, + 69.871041543210594682, 127.53710924842016539, 48.124486812175746309, 86.51018189529349911, + 51.962787529522756813, 55.309665644217602676, 75.989344516059645684, 107.12377308446957613, + 30.514114127763605211, 41.182231885839428287, 98.24650156886127661, 0.79714579108258476481, + 93.373145930705504725, 26.953950742696179077, 114.17254428644082509, 33.587495177125674672, + 80.203617513161589159, 8.018908646670752205, 12.047526215410471195, 106.19665864830312785, + 4.3880957441397185903, 67.405484968803648371, 37.314136061540921219, 46.345498768318066141, + 34.408867627989820903, 106.37476255464207497, 124.40552362933158292, 19.898630108436918817, + 25.911002835477120243, 94.97117961179537815, 57.368406515797687462, 68.524443742018775083, + 53.489126845164719271, 83.016413769772043452, 41.418856831154698739, 49.169194417791004525, + 104.00149845615669619, 45.444879220471193548, 96.047949767282261746, 82.369610985118924873, + 27.980948182761494536, 10.249136258535145316, 58.786494188461801969, 31.097014195918745827, + 56.659098762556823203, 89.836841137297597015, 121.39215939895802876, 88.552023583204572788, + 0.052817877356574172154, 97.624803183280164376, 60.799845647659822134, 126.91879462443102966, + 59.16046614981314633, 96.749615536286000861, 97.151574762516247574, 119.37293025686449255, + 44.286345426939078607, 45.181768567494145827, 49.767175051423691912, 56.758588759246777045, + 6.0028873047776869498, 91.875369314842828317, 76.259038934731506743, 13.430600523657631129, + 86.974434800828021253, 36.551611963088362245, 59.330150566438533133, 24.35414183202010463, + 36.807122539772535674, 127.4662554121168796, 113.02948278524854686, 41.414836821928474819, + 55.69462721931267879, 127.30847316013750969, 2.2990048328465491068, 54.448069217178272083, + 107.0549887587694684, 20.148507790188887157, 88.543831383976794314, 34.276507842438149964, + 0.33840813921779044904, 18.566610328802198637, 124.00624324331511161, 51.610310525837121531, + 7.5601520085692754947, 40.971795321805984713, 103.80554523345563211, 59.801089193737425376, + 68.2404836304122, 82.922502782879746519, 100.96427405465510674, 41.861449829044431681, + 54.349766773124429164, 98.473656289268546971, 18.947709120078798151, 10.362402301212569, + 68.10619637544368743, 91.731592448144510854, 72.806715302725933725, 23.388397538976278156, + 79.179216954020375852, 57.456895591036300175, 0.13088494563271524385, 45.389536992333887611, + 35.505672101491654757, 107.85314747484881082, 16.86667139811834204, 37.139612461691285716, + 10.619378110037359875, 51.59424580911945668, 45.048680061438062694, 116.05256664709668257, + 66.580706290944362991, 67.441612650440220023, 16.394204659307433758, 28.326592747456743382, + 8.2826432979964010883, 85.398752035373036051, 106.00213214183531818, 83.085382960711285705, + 67.744959167452179827, 113.82261046273561078, 25.549440941500506597, 56.641150855011801468, + 3.5679619983166048769, 20.029166233012801968, 100.99804813001173898, 41.152490196633152664, + 50.25754998894626624, 122.24940897356282221, 12.108345174048736226, 78.393113864462065976, + 61.721586166007909924, 43.215173751199472463, 18.437672749656485394, 67.389163895975798368, + 54.148436399125785101, 3.5288318137972964905, 74.771356032098992728, 98.445057869888842106, + 39.588153580738435267, 118.71453446961095324, 117.25978504978411365, 37.851769495038752211, + 4.55191083743920899, 37.11001884073994006, 91.367741389338334557, 112.6070422258671897, + 58.711000083039834863, 118.93764568868937204, 115.1491337396473682, 100.33008107148270938, + 108.38393370197809418, 92.415476138892699964, 111.30635570295999059, 36.66738991240345058, + 115.09691598352219444, 82.544558993537066272, 21.453945525623566937, 126.52624532112895395, + 6.1998092149151489139, 94.824315226625913056, 44.681487951296730898, 126.35444543451376376, + 124.59865594034999958, 118.54843269545017392, 0.76707862238254165277, 102.57343996977942879, + 43.519143787358189002, 36.915220334034529515, 70.399251334674772806, 25.327780750696547329, + 121.97019074923446169, 118.97319057850836543, 110.26149239876394859, 27.537990332504705293, + 119.67244421595751191, 44.295508067352784565, 30.922760345587448683, 124.42359008712446666, + 61.430157796527055325, 32.367064744412346045, 69.992516718244587537, 118.94313035706727533, + 104.06206943733195658, 50.639196051670296583, 94.004496058922086377, 21.928421693472046172, + 116.00923491986759473, 14.665872654288250487, 101.25883136479387758, 115.9671618927786767, + 68.995594305502891075, 110.31168463244830491, 0.48502904455745010637, 97.997097941592073767, + 27.230654761504410999, 106.73946666151459794, 109.80349583479983266, 85.433544465191516792, + 66.044671543309959816, 92.450532100370764965, 97.575951956670905929, 91.187141428054019343, + 35.375687057807226665, 71.434109811292728409, 80.545275281223439379, 67.505274535455100704, + 76.608072779119538609, 81.923081589386129053, 92.155401273470488377, 75.630629332572425483, + 49.582231862532353261, 84.694978831121261464, 92.551543176148697967, 30.00018600863404572, + 70.814066398146678694, 82.051668834090378368, 58.369231427455815719, 118.51739785807149019, + 14.862761064749065554, 1.6359002837052685209, 2.9165922775900980923, 31.751251107107236749, + 112.69539703582995571, 25.429380920406401856, 123.70868365988280857, 34.371089741911418969, + 117.99137087614872144, 40.165197060512582539, 119.62118071581789991, 94.34032930182365817, + 6.8246622196529642679, 122.29327304878097493, 113.00003442751403782, 55.36104915721443831, + 43.023323724606598262, 107.02736930189348641, 26.09409004697954515, 68.234077158798754681, + 74.615285015344852582, 12.030239130548579851, 11.757634318797499873, 50.709235964855906786, + 115.14023990296846023, 49.745510315438878024, 26.543197198869165732, 36.310237940611841623, + 93.136903952741704416, 85.372495482770318631, 36.862218698915967252, 81.013924570550443605, + 62.136952394921536325, 115.83947434931178577, 70.696013971231877804, 34.216308566195948515, + 55.388654254496941576, 9.2159094687449396588, 90.840741968469956191, 92.560951497791393194, + 78.499007916379923699, 58.787922918960248353, 97.712345396936143516, 81.507684121694182977, + 58.086098106123245088, 8.0987305569869931787, 82.011428192137827864, 63.497983058343379525, + 51.963998723633267218, 57.728698527385859052, 4.9571261661731114145, 68.855809292435878888, + 108.35480272942004376, 76.948617049321910599, 46.871378681102214614, 115.65012027082411805, + 82.950635988720023306, 76.371357562948105624, 63.494570592287345789, 56.695732717242208309, + 116.83145895063717035, 110.98662298313865904, 114.36926665565988515, 54.27640909709589323, + 82.34324269776334404, 4.7043998598346661311, 89.516763421390351141, 43.355880877094023162, + 5.8602302787548978813, 86.586023475716501707, 36.492647349397884682, 109.48921889044140698, + 109.88146149405292817, 76.366827033194567775, 51.444534176596789621, 74.876451875403290614, + 48.867857985955197364, 53.066466183521697531, 99.733310243871528655, 70.171166123927832814, + 63.604686965885775862, 64.330550821101496695, 127.50309501943047508, 20.845857890952174785, + 28.430812110531405779, 5.3262086011782230344, 79.583131470571970567, 76.899470681863022037, + 64.169182156019815011, 39.533196884331118781, 6.8525270489662943874, 5.1642139272844360676, + 76.430902491003507748, 125.76427162163236062, 86.811511754229286453, 117.09242402735617361, + 85.397782784573792014, 35.531911237689200789, 33.053881691132119158, 6.0512223009827721398, + 68.915274776631122222, 52.619467734504723921, 30.222972127219691174, 126.64528563361091074, + 126.15816419358816347, 6.7706204809983319137, 39.440493736216012621, 50.115299339682678692, + 21.05112076023578993, 116.22269299825711641, 120.94448145128626493, 118.97437373949651374, + 87.629704669056081912, 63.570513465299882228, 54.196893777600052999, 119.44248304130815086, + 19.933360370989248622, 73.661416680213733343, 28.818021420913282782, 39.817179088386183139, + 28.076188796185306273, 50.722893652888160432, 124.91703040109496214, 4.6658757454642909579, + 55.658398797266272595, 27.364959248832747107, 59.171942482989834389, 78.692022837894910481, + 111.42022445280963439, 41.720739137941563968, 107.39417825045529753, 1.8594251479516969994, + 126.15106968586769653, 30.054992235069221351, 43.901509397514018929, 0, + 57.063791748278163141, 43.910073902196018025, 13.711568449569313088, 7.1270139596344961319, + 106.96751316460358794, 57.138455514428642346, 82.875095914794655982, 65.227329470159020275, + 119.673626223255269, 31.454118429352092789, 107.70422831777614192, 96.302379547734744847, + 78.392418764724425273, 25.811109789410693338, 11.742083086424827343, 127.07421849684033077, + 96.248973624355130596, 45.020363790586998221, 103.92557505904551363, 110.61933128843884333, + 23.978689032122929348, 86.247546168939152267, 61.028228255527210422, 82.364463771682494553, + 68.49300313772255322, 1.5942915821688075084, 58.74629186141100945, 53.907901485395996133, + 100.34508857288165018, 67.174990354254987324, 32.407235026323178317, 16.03781729334150441, + 24.09505243082458037, 84.393317296606255695, 8.7761914882830751594, 6.8109699376072967425, + 74.628272123081842437, 92.690997536636132281, 68.817735255983279785, 84.749525109287787927, + 120.81104725866316585, 39.797260216873837635, 51.822005670957878465, 61.942359223590756301, + 114.7368130315990129, 9.0488874840375501662, 106.97825369033307652, 38.032827539544086903, + 82.837713662309397478, 98.33838883558564703, 80.002996912313392386, 90.889758440946025075, + 64.095899534568161471, 36.739221970237849746, 55.961896365522989072, 20.498272517070290633, + 117.57298837692360394, 62.194028391837491654, 113.31819752511728439, 51.673682274598832009, + 114.7843187979196955, 49.104047166409145575, 0.10563575471678632312, 67.249606366560328752, + 121.59969129532328225, 125.83758924886205932, 118.32093229962993064, 65.499231072575639701, + 66.303149525036133127, 110.7458605137289851, 88.572690853878157213, 90.363537134988291655, + 99.534350102847383823, 113.51717751849355409, 12.005774609559011878, 55.750738629689294612, + 24.518077869463013485, 26.861201047318900237, 45.948869601656042505, 73.10322392617672449, + 118.66030113287706627, 48.70828366404020926, 73.614245079548709327, 126.93251082423739717, + 98.058965570497093722, 82.829673643856949639, 111.38925443862899556, 126.61694632027501939, + 4.5980096656930982135, 108.89613843436018215, 86.109977517538936809, 40.297015580381412292, + 49.087662767953588627, 68.553015684876299929, 0.67681627843558089808, 37.133220657608035253, + 120.01248648663022323, 103.22062105167424306, 15.120304017138550989, 81.943590643615607405, + 79.61109046691126423, 119.60217838747848873, 8.4809672608280379791, 37.845005565763131017, + 73.928548109310213476, 83.722899658088863362, 108.69953354625249631, 68.947312578537093941, + 37.895418240157596301, 20.724804602428775979, 8.2123927508910128381, 55.463184896292659687, + 17.61343060545186745, 46.776795077956194291, 30.358433908040751703, 114.91379118207260035, + 0.26176989126543048769, 90.779073984667775221, 71.011344202986947494, 87.706294949697621632, + 33.73334279623668408, 74.279224923382571433, 21.238756220074719749, 103.18849161823891336, + 90.097360122879763367, 104.10513329419700312, 5.1614125818923639599, 6.8832253008804400451, + 32.788409318614867516, 56.653185494913486764, 16.565286595996440155, 42.797504070749710081, + 84.004264283674274338, 38.170765921426209388, 7.4899183349079976324, 99.645220925471221562, + 51.098881883001013193, 113.28230171002360294, 7.1359239966332097538, 40.058332466029241914, + 73.996096260023477953, 82.304980393266305327, 100.51509997789617046, 116.49881794712564442, + 24.21669034810111043, 28.786227728924131952, 123.44317233201581985, 86.430347502398944926, + 36.875345499316608766, 6.7783277919515967369, 108.2968727982515702, 7.0576636275982309598, + 21.542712064201623434, 68.890115739777684212, 79.176307161480508512, 109.42906893922554445, + 106.51957009956822731, 75.703538990077504423, 9.1038216748784179799, 74.220037681483518099, + 54.735482778680307092, 97.2140844517343794, 117.4220001660833077, 109.87529137738238205, + 102.29826747929837438, 72.660162142969056731, 88.767867403959826333, 56.830952277789037907, + 94.612711405919981189, 73.334779824810539139, 102.19383196704802685, 37.089117987074132543, + 42.907891051250771852, 125.05249064225790789, 12.399618429833935807, 61.648630453251826111, + 89.362975902597099775, 124.70889086903116549, 121.19731188070363714, 109.09686539090034785, + 1.5341572447687212843, 77.146879939558857586, 87.038287574716378003, 73.830440668072697008, + 12.798502669349545613, 50.655561501396732638, 115.94038149847256136, 109.94638115702036885, + 92.522984797527897172, 55.075980665013048565, 111.34488843191502383, 88.591016134705569129, + 61.845520691178535344, 120.84718017424893333, 122.86031559305411065, 64.734129488828330068, + 11.985033436492813053, 109.88626071413818863, 80.124138874663913157, 101.27839210334423115, + 60.008992117844172753, 43.856843386947730323, 104.01846983973518945, 29.331745308580138953, + 74.517662729591393145, 103.93432378556099138, 9.9911886110094201285, 92.62336926489660982, + 0.97005808911853819154, 67.994195883184147533, 54.461309523012459977, 85.478933323032833869, + 91.606991669603303308, 42.867088930386671564, 4.0893430866235576104, 56.901064200745167909, + 67.151903913345449837, 54.374282856108038686, 70.751374115618091309, 14.868219622589094797, + 33.090550562450516736, 7.0105490709138393868, 25.216145558242715197, 35.846163178775896085, + 56.310802546944614733, 23.261258665144850966, 99.164463725068344502, 41.389957662246160908, + 57.103086352297395933, 60.000372017271729419, 13.628132796296995366, 36.103337668180756737, + 116.73846285491526942, 109.03479571614298038, 29.725522129498131108, 3.2718005674105370417, + 5.8331845551801961847, 63.502502214218111476, 97.390794071659911424, 50.858761840816441691, + 119.41736731976561714, 68.742179483826475916, 107.98274175229744287, 80.330394121028803056, + 111.2423614316394378, 60.68065860364731634, 13.649324439309566515, 116.58654609756558784, + 98.000068855028075632, 110.72209831442887662, 86.046647449216834502, 86.054738603786972817, + 52.188180093962728279, 8.4681543176011473406, 21.230570030689705163, 24.060478261097159702, + 23.515268637594999745, 101.41847192971545155, 102.28047980593692046, 99.491020630877756048, + 53.086394397738331463, 72.620475881227321224, 58.27380790548704681, 42.744990965540637262, + 73.724437397835572483, 34.027849141100887209, 124.27390478984671063, 103.67894869862720952, + 13.392027942463755608, 68.43261713239189703, 110.77730850899388315, 18.431818937493517296, + 53.681483936943550361, 57.121902995586424368, 28.998015832759847399, 117.57584583792413468, + 67.42469079387592501, 35.015368243388365954, 116.17219621224649018, 16.197461113977624336, + 36.022856384275655728, 126.99596611668675905, 103.92799744726653444, 115.4573970547717181, + 9.9142523323498608079, 9.7116185848753957544, 88.709605458843725501, 25.897234098643821198, + 93.742757362208067207, 103.30024054165187408, 37.901271977443684591, 24.742715125896211248, + 126.98914118457469158, 113.3914654344880546, 105.66291790127797867, 93.973245966280956054, + 100.73853331131977029, 108.55281819419542444, 36.68648539552668808, 9.4087997196729702409, + 51.033526842780702282, 86.711761754188046325, 11.720460557513433741, 45.172046951433003414, + 72.985294698799407342, 90.978437780886451947, 91.762922988109494327, 24.733654066389135551, + 102.88906835319721722, 21.752903750806581229, 97.735715971910394728, 106.13293236704703304, + 71.466620487746695289, 12.342332247855665628, 127.2093739317751897, 0.66110164220663136803, + 127.00619003886095015, 41.691715781904349569, 56.861624221062811557, 10.652417202360084048, + 31.166262941147579113, 25.798941363729682053, 0.3383643120396300219, 79.066393768662237562, + 13.705054097932588775, 10.328427854572510114, 24.861804982010653475, 123.52854324326835922, + 45.623023508462210884, 106.1848480547159852, 42.795565569147584029, 71.063822475378401577, + 66.107763382264238317, 12.102444601969182258, 9.8305495532622444443, 105.23893546900944784, + 60.445944254443020327, 125.29057126722545945, 124.31632838717632694, 13.541240961996663827, + 78.880987472432025243, 100.23059867936535738, 42.10224152047521784, 104.44538599651787081, + 113.88896290257616783, 109.94874747899666545, 47.259409338112163823, 127.14102693059976446, + 108.39378755520374398, 110.88496608261630172, 39.866720741982135223, 19.322833360427466687, + 57.636042841826565564, 79.634358176772366278, 56.152377592370612547, 101.44578730577995884, + 121.83406080218992429, 9.3317514909285819158, 111.31679759453254519, 54.729918497665494215, + 118.34388496598330676, 29.38404567579345894, 94.840448905619268771, 83.441478275886765914, + 86.788356500910595059, 3.7188502959070319775, 124.30213937173539307, 60.109984470138442703, + 87.803018795028037857, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + }; +#endif // #ifndef __SLEEF_QREMPITAB__ diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefsimdqp.c b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefsimdqp.c new file mode 100644 index 0000000000000..781b55132a20f --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/src/quad/sleefsimdqp.c @@ -0,0 +1,4521 @@ +// Copyright Naoki Shibata and contributors 2010 - 2024. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Always use -ffp-contract=off option to compile SLEEF. + +#if !defined(SLEEF_GENHEADER) +#include +#include +#include +#include +#endif + +#include "quaddef.h" +#include "misc.h" + +#ifndef SLEEF_ENABLE_CUDA +extern const double Sleef_rempitabqp[]; +#endif + +#define __SLEEFSIMDQP_C__ + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma fp_contract (off) +#else +#pragma STDC FP_CONTRACT OFF +#endif + +#ifdef ENABLE_PUREC_SCALAR +#define CONFIG 1 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "qrenamepurec_scalar.h" +#endif +#endif + +#ifdef ENABLE_PURECFMA_SCALAR +#define CONFIG 2 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "qrenamepurecfma_scalar.h" +#endif + +#if defined(_MSC_VER) && !defined (__clang__) +#pragma optimize("", off) +#endif +#endif + +#ifdef SLEEF_ENABLE_CUDA +#define CONFIG 3 +#include "helperpurec_scalar.h" +#ifdef DORENAME +#include "qrenamecuda.h" +#endif +typedef vquad Sleef_quadx1; +#endif + +#ifdef ENABLE_SSE2 +#define CONFIG 2 +#include "helpersse2.h" +#ifdef DORENAME +#include "qrenamesse2.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +#ifdef ENABLE_AVX2128 +#define CONFIG 1 +#include "helperavx2_128.h" +#ifdef DORENAME +#include "qrenameavx2128.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +#ifdef ENABLE_AVX2 +#define CONFIG 1 +#include "helperavx2.h" +#ifdef DORENAME +#include "qrenameavx2.h" +#endif +typedef vquad Sleef_quadx4; +#endif + +#ifdef ENABLE_AVX512F +#define CONFIG 1 +#include "helperavx512f.h" +#ifdef DORENAME +#include "qrenameavx512f.h" +#endif +typedef vquad Sleef_quadx8; +#endif + +#ifdef ENABLE_ADVSIMD +#define CONFIG 1 +#include "helperadvsimd.h" +#ifdef DORENAME +#include "qrenameadvsimd.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +#ifdef ENABLE_SVE +#define CONFIG 1 +#include "helpersve.h" +#ifdef DORENAME +#include "qrenamesve.h" +#endif +typedef vquad Sleef_svquad; +#endif + +#ifdef ENABLE_VSX +#define CONFIG 1 +#include "helperpower_128.h" +#ifdef DORENAME +#include "qrenamevsx.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +#ifdef ENABLE_VSX3 +#define CONFIG 3 +#include "helperpower_128.h" +#ifdef DORENAME +#include "qrenamevsx3.h" +#endif +#endif + +#ifdef ENABLE_VXE +#define CONFIG 140 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "qrenamevxe.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +#ifdef ENABLE_VXE2 +#define CONFIG 150 +#include "helpers390x_128.h" +#ifdef DORENAME +#include "qrenamevxe2.h" +#endif +typedef vquad Sleef_quadx2; +#endif + +// RISC-V +#ifdef ENABLE_RVVM1 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "qrenamervvm1.h" +#endif +typedef vquad Sleef_rvvm1quad; +#endif + +#ifdef ENABLE_RVVM2 +#define CONFIG 1 +#define ENABLE_RVV_DP +#include "helperrvv.h" +#ifdef DORENAME +#include "qrenamervvm2.h" +#endif +typedef vquad Sleef_rvvm2quad; +#endif + +#include "dd.h" +#include "commonfuncs.h" + +// + +static INLINE CONST VECTOR_CC vopmask isnonfinite_vo_vq(vquad a) { + return veq64_vo_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); +} + +static INLINE CONST VECTOR_CC vopmask isnonfinite_vo_vq_vq(vquad a, vquad b) { + vmask ma = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + vmask mb = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(b), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + return veq64_vo_vm_vm(vand_vm_vm_vm(ma, mb), vcast_vm_u64(0)); +} + +static INLINE CONST VECTOR_CC vopmask isnonfinite_vo_vq_vq_vq(vquad a, vquad b, vquad c) { + vmask ma = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + vmask mb = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(b), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + vmask mc = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(c), vcast_vm_u64(UINT64_C(0x7fff000000000000))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + return veq64_vo_vm_vm(vand_vm_vm_vm(vand_vm_vm_vm(ma, mb), mc), vcast_vm_u64(0)); +} + +static INLINE CONST VECTOR_CC vopmask isinf_vo_vq(vquad a) { + vopmask o = veq64_vo_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0x7fffffffffffffff))), vcast_vm_u64(UINT64_C(0x7fff000000000000))); + return vand_vo_vo_vo(o, veq64_vo_vm_vm(vqgetx_vm_vq(a), vcast_vm_u64(0))); +} + +static INLINE CONST VECTOR_CC vopmask ispinf_vo_vq(vquad a) { + return vand_vo_vo_vo(veq64_vo_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0x7fff000000000000))), veq64_vo_vm_vm(vqgetx_vm_vq(a), vcast_vm_u64(0))); +} + +static INLINE CONST VECTOR_CC vopmask isminf_vo_vq(vquad a) { + return vand_vo_vo_vo(veq64_vo_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(UINT64_C(0xffff000000000000))), veq64_vo_vm_vm(vqgetx_vm_vq(a), vcast_vm_u64(0))); +} + +static INLINE CONST VECTOR_CC vopmask isnan_vo_vq(vquad a) { + return vandnot_vo_vo_vo(isinf_vo_vq(a), isnonfinite_vo_vq(a)); +} + +static INLINE CONST VECTOR_CC vopmask iszero_vo_vq(vquad a) { + return veq64_vo_vm_vm(vor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(a), vcast_vm_u64(~UINT64_C(0x8000000000000000))), vqgetx_vm_vq(a)), vcast_vm_i64(0)); +} + +static INLINE CONST VECTOR_CC vquad mulsign_vq_vq_vq(vquad a, vquad b) { + vmask m = vxor_vm_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(b), vcast_vm_u64(UINT64_C(0x8000000000000000))), vqgety_vm_vq(a)); + return vqsety_vq_vq_vm(a, m); +} + +static INLINE CONST VECTOR_CC vquad cmpcnv_vq_vq(vquad x) { + vquad t = vqsetxy_vq_vm_vm(vxor_vm_vm_vm(vqgetx_vm_vq(x), vcast_vm_u64(UINT64_C(0xffffffffffffffff))), + vxor_vm_vm_vm(vqgety_vm_vq(x), vcast_vm_u64(UINT64_C(0x7fffffffffffffff)))); + t = vqsetx_vq_vq_vm(t, vadd64_vm_vm_vm(vqgetx_vm_vq(t), vcast_vm_i64(1))); + t = vqsety_vq_vq_vm(t, vadd64_vm_vm_vm(vqgety_vm_vq(t), vand_vm_vo64_vm(veq64_vo_vm_vm(vqgetx_vm_vq(t), vcast_vm_i64(0)), vcast_vm_i64(1)))); + + return sel_vq_vo_vq_vq(veq64_vo_vm_vm(vand_vm_vm_vm(vqgety_vm_vq(x), vcast_vm_u64(UINT64_C(0x8000000000000000))), vcast_vm_u64(UINT64_C(0x8000000000000000))), + t, x); +} + +// double3 functions ------------------------------------------------------------------------------------------------------------ + +static INLINE CONST VECTOR_CC vdouble3 cast_vd3_vd_vd_vd(vdouble d0, vdouble d1, vdouble d2) { + return vd3setxyz_vd3_vd_vd_vd(d0, d1, d2); +} + +static INLINE CONST VECTOR_CC vdouble3 cast_vd3_d_d_d(double d0, double d1, double d2) { + return vd3setxyz_vd3_vd_vd_vd(vcast_vd_d(d0), vcast_vd_d(d1), vcast_vd_d(d2)); +} + +static INLINE CONST VECTOR_CC vdouble3 mulsign_vd3_vd3_vd(vdouble3 d, vdouble s) { + return cast_vd3_vd_vd_vd(vmulsign_vd_vd_vd(vd3getx_vd_vd3(d), s), vmulsign_vd_vd_vd(vd3gety_vd_vd3(d), s), vmulsign_vd_vd_vd(vd3getz_vd_vd3(d), s)); +} + +static INLINE CONST VECTOR_CC vdouble3 abs_vd3_vd3(vdouble3 d) { return mulsign_vd3_vd3_vd(d, vd3getx_vd_vd3(d)); } + +static INLINE CONST VECTOR_CC vdouble3 sel_vd3_vo_vd3_vd3(vopmask m, vdouble3 x, vdouble3 y) { + return vd3setxyz_vd3_vd_vd_vd(vsel_vd_vo_vd_vd(m, vd3getx_vd_vd3(x), vd3getx_vd_vd3(y)), + vsel_vd_vo_vd_vd(m, vd3gety_vd_vd3(x), vd3gety_vd_vd3(y)), + vsel_vd_vo_vd_vd(m, vd3getz_vd_vd3(x), vd3getz_vd_vd3(y))); +} + +// TD algorithms are based on Y. Hida et al., Library for double-double and quad-double arithmetic (2007). +static INLINE CONST VECTOR_CC vdouble2 twosum_vd2_vd_vd(vdouble x, vdouble y) { + vdouble rx = vadd_vd_vd_vd(x, y); + vdouble v = vsub_vd_vd_vd(rx, x); + return vd2setxy_vd2_vd_vd(rx, vadd_vd_vd_vd(vsub_vd_vd_vd(x, vsub_vd_vd_vd(rx, v)), vsub_vd_vd_vd(y, v))); +} + +static INLINE CONST VECTOR_CC vdouble2 twosub_vd2_vd_vd(vdouble x, vdouble y) { + vdouble rx = vsub_vd_vd_vd(x, y); + vdouble v = vsub_vd_vd_vd(rx, x); + return vd2setxy_vd2_vd_vd(rx, vsub_vd_vd_vd(vsub_vd_vd_vd(x, vsub_vd_vd_vd(rx, v)), vadd_vd_vd_vd(y, v))); +} + +static INLINE CONST VECTOR_CC vdouble2 twosumx_vd2_vd_vd_vd(vdouble x, vdouble y, vdouble s) { + vdouble rx = vmla_vd_vd_vd_vd(y, s, x); + vdouble v = vsub_vd_vd_vd(rx, x); + return vd2setxy_vd2_vd_vd(rx, vadd_vd_vd_vd(vsub_vd_vd_vd(x, vsub_vd_vd_vd(rx, v)), vmlapn_vd_vd_vd_vd(y, s, v))); +} + +static INLINE CONST VECTOR_CC vdouble2 twosubx_vd2_vd_vd_vd(vdouble x, vdouble y, vdouble s) { + vdouble rx = vmlanp_vd_vd_vd_vd(y, s, x); + vdouble v = vsub_vd_vd_vd(rx, x); + return vd2setxy_vd2_vd_vd(rx, vsub_vd_vd_vd(vsub_vd_vd_vd(x, vsub_vd_vd_vd(rx, v)), vmla_vd_vd_vd_vd(y, s, v))); +} + +static INLINE CONST VECTOR_CC vdouble2 quicktwosum_vd2_vd_vd(vdouble x, vdouble y) { + vdouble rx = vadd_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(rx, vadd_vd_vd_vd(vsub_vd_vd_vd(x, rx), y)); +} + +static INLINE CONST VECTOR_CC vdouble2 twoprod_vd2_vd_vd(vdouble x, vdouble y) { +#ifdef ENABLE_FMA_DP + vdouble rx = vmul_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(rx, vfmapn_vd_vd_vd_vd(x, y, rx)); +#else + vdouble xh = vmul_vd_vd_vd(x, vcast_vd_d((1 << 27)+1)); + xh = vsub_vd_vd_vd(xh, vsub_vd_vd_vd(xh, x)); + vdouble xl = vsub_vd_vd_vd(x, xh); + vdouble yh = vmul_vd_vd_vd(y, vcast_vd_d((1 << 27)+1)); + yh = vsub_vd_vd_vd(yh, vsub_vd_vd_vd(yh, y)); + vdouble yl = vsub_vd_vd_vd(y, yh); + + vdouble rx = vmul_vd_vd_vd(x, y); + return vd2setxy_vd2_vd_vd(rx, vadd_vd_5vd(vmul_vd_vd_vd(xh, yh), vneg_vd_vd(rx), vmul_vd_vd_vd(xl, yh), vmul_vd_vd_vd(xh, yl), vmul_vd_vd_vd(xl, yl))); +#endif +} + +static INLINE CONST VECTOR_CC vdouble3 scale_vd3_vd3_vd(vdouble3 d, vdouble s) { + return cast_vd3_vd_vd_vd(vmul_vd_vd_vd(vd3getx_vd_vd3(d), s), vmul_vd_vd_vd(vd3gety_vd_vd3(d), s), vmul_vd_vd_vd(vd3getz_vd_vd3(d), s)); +} + +static INLINE CONST VECTOR_CC vdouble3 scale_vd3_vd3_d(vdouble3 d, double s) { return scale_vd3_vd3_vd(d, vcast_vd_d(s)); } + +static INLINE CONST VECTOR_CC vdouble3 quickrenormalize_vd3_vd3(vdouble3 td) { + vdouble2 u = quicktwosum_vd2_vd_vd(vd3getx_vd_vd3(td), vd3gety_vd_vd3(td)); + vdouble2 v = quicktwosum_vd2_vd_vd(vd2gety_vd_vd2(u), vd3getz_vd_vd3(td)); + return cast_vd3_vd_vd_vd(vd2getx_vd_vd2(u), vd2getx_vd_vd2(v), vd2gety_vd_vd2(v)); +} + +static INLINE CONST VECTOR_CC vdouble3 normalize_vd3_vd3(vdouble3 td) { + vdouble2 u = quicktwosum_vd2_vd_vd(vd3getx_vd_vd3(td), vd3gety_vd_vd3(td)); + vdouble2 v = quicktwosum_vd2_vd_vd(vd2gety_vd_vd2(u), vd3getz_vd_vd3(td)); + td = vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(u), vd2getx_vd_vd2(v), vd2gety_vd_vd2(v)); + u = quicktwosum_vd2_vd_vd(vd3getx_vd_vd3(td), vd3gety_vd_vd3(td)); + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(u), vd2gety_vd_vd2(u), vd3getz_vd_vd3(td)); +} + +static INLINE CONST VECTOR_CC vdouble3 add2_vd3_vd3_vd3(vdouble3 x, vdouble3 y) { + vdouble2 d0 = twosum_vd2_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twosum_vd2_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_4vd(vd3getz_vd_vd3(x), vd3getz_vd_vd3(y), vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3)))); +} + +static INLINE CONST VECTOR_CC vdouble3 sub2_vd3_vd3_vd3(vdouble3 x, vdouble3 y) { + vdouble2 d0 = twosub_vd2_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twosub_vd2_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_4vd(vd3getz_vd_vd3(x), vneg_vd_vd(vd3getz_vd_vd3(y)), vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3)))); +} + +static INLINE CONST VECTOR_CC vdouble3 add2_vd3_vd2_vd3(vdouble2 x, vdouble3 y) { + vdouble2 d0 = twosum_vd2_vd_vd(vd2getx_vd_vd2(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twosum_vd2_vd_vd(vd2gety_vd_vd2(x), vd3gety_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_3vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3), vd3getz_vd_vd3(y)))); +} + +static INLINE CONST VECTOR_CC vdouble3 add_vd3_vd2_vd3(vdouble2 x, vdouble3 y) { + vdouble2 d0 = twosum_vd2_vd_vd(vd2getx_vd_vd2(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twosum_vd2_vd_vd(vd2gety_vd_vd2(x), vd3gety_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_3vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3), vd3getz_vd_vd3(y))); +} + +static INLINE CONST VECTOR_CC vdouble3 add2_vd3_vd_vd3(vdouble x, vdouble3 y) { + vdouble2 d0 = twosum_vd2_vd_vd(x, vd3getx_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd3gety_vd_vd3(y)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_vd_vd(vd2gety_vd_vd2(d3), vd3getz_vd_vd3(y)))); +} + +static INLINE CONST VECTOR_CC vdouble3 add_vd3_vd_vd3(vdouble x, vdouble3 y) { + vdouble2 d0 = twosum_vd2_vd_vd(x, vd3getx_vd_vd3(y)); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd3gety_vd_vd3(y)); + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_vd_vd(vd2gety_vd_vd2(d3), vd3getz_vd_vd3(y))); +} + +static INLINE CONST VECTOR_CC vdouble3 scaleadd2_vd3_vd3_vd3_vd(vdouble3 x, vdouble3 y, vdouble s) { + vdouble2 d0 = twosumx_vd2_vd_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y), s); + vdouble2 d1 = twosumx_vd2_vd_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y), s); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_3vd(vmla_vd_vd_vd_vd(vd3getz_vd_vd3(y), s, vd3getz_vd_vd3(x)), vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3)))); +} + +static INLINE CONST VECTOR_CC vdouble3 scalesub2_vd3_vd3_vd3_vd(vdouble3 x, vdouble3 y, vdouble s) { + vdouble2 d0 = twosubx_vd2_vd_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y), s); + vdouble2 d1 = twosubx_vd2_vd_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y), s); + vdouble2 d3 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d3), vadd_vd_3vd(vmlanp_vd_vd_vd_vd(vd3getz_vd_vd3(y), s, vd3getz_vd_vd3(x)), vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d3)))); +} + +static INLINE CONST VECTOR_CC vdouble3 mul2_vd3_vd3_vd3(vdouble3 x, vdouble3 y) { + vdouble2 d0 = twoprod_vd2_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twoprod_vd2_vd_vd(vd3getx_vd_vd3(x), vd3gety_vd_vd3(y)); + vdouble2 d2 = twoprod_vd2_vd_vd(vd3gety_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + vdouble2 d5 = twosum_vd2_vd_vd(vd2getx_vd_vd2(d4), vd2getx_vd_vd2(d2)); + + vdouble t2 = vadd_vd_3vd(vmla_vd_vd_vd_vd(vd3getz_vd_vd3(x), vd3getx_vd_vd3(y), vmla_vd_vd_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y), vmla_vd_vd_vd_vd(vd3getx_vd_vd3(x), vd3getz_vd_vd3(y), vadd_vd_vd_vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d2))))), vd2gety_vd_vd2(d4), vd2gety_vd_vd2(d5)); + + return normalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d5), t2)); +} + +static INLINE CONST VECTOR_CC vdouble3 mul_vd3_vd3_vd3(vdouble3 x, vdouble3 y) { + vdouble2 d0 = twoprod_vd2_vd_vd(vd3getx_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twoprod_vd2_vd_vd(vd3getx_vd_vd3(x), vd3gety_vd_vd3(y)); + vdouble2 d2 = twoprod_vd2_vd_vd(vd3gety_vd_vd3(x), vd3getx_vd_vd3(y)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + vdouble2 d5 = twosum_vd2_vd_vd(vd2getx_vd_vd2(d4), vd2getx_vd_vd2(d2)); + + vdouble t2 = vadd_vd_3vd(vmla_vd_vd_vd_vd(vd3getz_vd_vd3(x), vd3getx_vd_vd3(y), vmla_vd_vd_vd_vd(vd3gety_vd_vd3(x), vd3gety_vd_vd3(y), vmla_vd_vd_vd_vd(vd3getx_vd_vd3(x), vd3getz_vd_vd3(y), vadd_vd_vd_vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d2))))), vd2gety_vd_vd2(d4), vd2gety_vd_vd2(d5)); + + return quickrenormalize_vd3_vd3(vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d5), t2)); +} + +static INLINE CONST VECTOR_CC vdouble3 squ_vd3_vd3(vdouble3 x) { return mul_vd3_vd3_vd3(x, x); } + +static INLINE CONST VECTOR_CC vdouble3 mul_vd3_vd2_vd3(vdouble2 x, vdouble3 y) { + vdouble2 d0 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(x), vd3getx_vd_vd3(y)); + vdouble2 d1 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(x), vd3gety_vd_vd3(y)); + vdouble2 d2 = twoprod_vd2_vd_vd(vd2gety_vd_vd2(x), vd3getx_vd_vd3(y)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + vdouble2 d5 = twosum_vd2_vd_vd(vd2getx_vd_vd2(d4), vd2getx_vd_vd2(d2)); + + vdouble t2 = vadd_vd_3vd(vmla_vd_vd_vd_vd(vd2gety_vd_vd2(x), vd3gety_vd_vd3(y), vmla_vd_vd_vd_vd(vd2getx_vd_vd2(x), vd3getz_vd_vd3(y), vadd_vd_vd_vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d2)))), vd2gety_vd_vd2(d4), vd2gety_vd_vd2(d5)); + + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d5), t2); +} + +static INLINE CONST VECTOR_CC vdouble3 mul_vd3_vd3_vd2(vdouble3 x, vdouble2 y) { + vdouble2 d0 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(y), vd3getx_vd_vd3(x)); + vdouble2 d1 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(y), vd3gety_vd_vd3(x)); + vdouble2 d2 = twoprod_vd2_vd_vd(vd2gety_vd_vd2(y), vd3getx_vd_vd3(x)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + vdouble2 d5 = twosum_vd2_vd_vd(vd2getx_vd_vd2(d4), vd2getx_vd_vd2(d2)); + + vdouble t2 = vadd_vd_3vd(vmla_vd_vd_vd_vd(vd2gety_vd_vd2(y), vd3gety_vd_vd3(x), vmla_vd_vd_vd_vd(vd2getx_vd_vd2(y), vd3getz_vd_vd3(x), vadd_vd_vd_vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d2)))), vd2gety_vd_vd2(d4), vd2gety_vd_vd2(d5)); + + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d5), t2); +} + +static INLINE CONST VECTOR_CC vdouble3 mul_vd3_vd3_vd(vdouble3 x, vdouble y) { + vdouble2 d0 = twoprod_vd2_vd_vd(y, vd3getx_vd_vd3(x)); + vdouble2 d1 = twoprod_vd2_vd_vd(y, vd3gety_vd_vd3(x)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d4), vadd_vd_vd_vd(vmla_vd_vd_vd_vd(y, vd3getz_vd_vd3(x), vd2gety_vd_vd2(d1)), vd2gety_vd_vd2(d4))); +} + +static INLINE CONST VECTOR_CC vdouble3 mul_vd3_vd2_vd2(vdouble2 x, vdouble2 y) { + vdouble2 d0 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(x), vd2getx_vd_vd2(y)); + vdouble2 d1 = twoprod_vd2_vd_vd(vd2getx_vd_vd2(x), vd2gety_vd_vd2(y)); + vdouble2 d2 = twoprod_vd2_vd_vd(vd2gety_vd_vd2(x), vd2getx_vd_vd2(y)); + vdouble2 d4 = twosum_vd2_vd_vd(vd2gety_vd_vd2(d0), vd2getx_vd_vd2(d1)); + vdouble2 d5 = twosum_vd2_vd_vd(vd2getx_vd_vd2(d4), vd2getx_vd_vd2(d2)); + + vdouble t2 = vadd_vd_3vd(vmla_vd_vd_vd_vd(vd2gety_vd_vd2(x), vd2gety_vd_vd2(y), vadd_vd_vd_vd(vd2gety_vd_vd2(d1), vd2gety_vd_vd2(d2))), vd2gety_vd_vd2(d4), vd2gety_vd_vd2(d5)); + + return vd3setxyz_vd3_vd_vd_vd(vd2getx_vd_vd2(d0), vd2getx_vd_vd2(d5), t2); +} + +static INLINE CONST VECTOR_CC vdouble3 div2_vd3_vd3_vd3(vdouble3 n, vdouble3 q) { + vdouble2 d = ddrec_vd2_vd2(vcast_vd2_vd_vd(vd3getx_vd_vd3(q), vd3gety_vd_vd3(q))); + return mul2_vd3_vd3_vd3(n, add_vd3_vd2_vd3(d, mul_vd3_vd2_vd3(ddscale_vd2_vd2_d(d, -1), + add_vd3_vd_vd3(vcast_vd_d(-1), mul_vd3_vd2_vd3(d, q))))); +} + +static INLINE CONST VECTOR_CC vdouble3 div_vd3_vd3_vd3(vdouble3 n, vdouble3 q) { + vdouble2 d = ddrec_vd2_vd2(vcast_vd2_vd_vd(vd3getx_vd_vd3(q), vd3gety_vd_vd3(q))); + return mul_vd3_vd3_vd3(n, add_vd3_vd2_vd3(d, mul_vd3_vd2_vd3(ddscale_vd2_vd2_d(d, -1), + add_vd3_vd_vd3(vcast_vd_d(-1), mul_vd3_vd2_vd3(d, q))))); +} + +static INLINE CONST VECTOR_CC vdouble3 rec_vd3_vd3(vdouble3 q) { + vdouble2 d = ddrec_vd2_vd2(vcast_vd2_vd_vd(vd3getx_vd_vd3(q), vd3gety_vd_vd3(q))); + return add2_vd3_vd2_vd3(d, mul_vd3_vd2_vd3(ddscale_vd2_vd2_d(d, -1), + add_vd3_vd_vd3(vcast_vd_d(-1), mul_vd3_vd2_vd3(d, q)))); +} + +static INLINE CONST VECTOR_CC vdouble3 rec_vd3_vd2(vdouble2 q) { + vdouble2 d = ddrec_vd2_vd2(vcast_vd2_vd_vd(vd2getx_vd_vd2(q), vd2gety_vd_vd2(q))); + return add2_vd3_vd2_vd3(d, mul_vd3_vd2_vd3(ddscale_vd2_vd2_d(d, -1), + add_vd3_vd_vd3(vcast_vd_d(-1), mul_vd3_vd2_vd2(d, q)))); +} + +static INLINE CONST VECTOR_CC vdouble3 sqrt_vd3_vd3(vdouble3 d) { + vdouble2 t = ddsqrt_vd2_vd2(vcast_vd2_vd_vd(vd3getx_vd_vd3(d), vd3gety_vd_vd3(d))); + vdouble3 r = mul2_vd3_vd3_vd3(add2_vd3_vd3_vd3(d, mul_vd3_vd2_vd2(t, t)), rec_vd3_vd2(t)); + r = sel_vd3_vo_vd3_vd3(veq_vo_vd_vd(vd3getx_vd_vd3(d), vcast_vd_d(0)), cast_vd3_d_d_d(0, 0, 0), scale_vd3_vd3_d(r, 0.5)); + return r; +} + +static INLINE CONST VECTOR_CC vdouble3 neg_vd3_vd3(vdouble3 d) { + return vd3setxyz_vd3_vd_vd_vd(vneg_vd_vd(vd3getx_vd_vd3(d)), + vneg_vd_vd(vd3gety_vd_vd3(d)), + vneg_vd_vd(vd3getz_vd_vd3(d))); +} + +// + +static INLINE CONST VECTOR_CC vdouble poly2d(vdouble x, double c1, double c0) { return vmla_vd_vd_vd_vd(x, vcast_vd_d(c1), vcast_vd_d(c0)); } +static INLINE CONST VECTOR_CC vdouble poly3d(vdouble x, double c2, double c1, double c0) { return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(x, x), vcast_vd_d(c2), poly2d(x, c1, c0)); } +static INLINE CONST VECTOR_CC vdouble poly4d(vdouble x, double c3, double c2, double c1, double c0) { + return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(x, x), poly2d(x, c3, c2), poly2d(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble poly5d(vdouble x, double c4, double c3, double c2, double c1, double c0) { + return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(x, x),vmul_vd_vd_vd(x, x)), vcast_vd_d(c4), poly4d(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble poly6d(vdouble x, double c5, double c4, double c3, double c2, double c1, double c0) { + return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(x, x),vmul_vd_vd_vd(x, x)), poly2d(x, c5, c4), poly4d(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble poly7d(vdouble x, double c6, double c5, double c4, double c3, double c2, double c1, double c0) { + return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(x, x),vmul_vd_vd_vd(x, x)), poly3d(x, c6, c5, c4), poly4d(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble poly8d(vdouble x, double c7, double c6, double c5, double c4, double c3, double c2, double c1, double c0) { + return vmla_vd_vd_vd_vd(vmul_vd_vd_vd(vmul_vd_vd_vd(x, x),vmul_vd_vd_vd(x, x)), poly4d(x, c7, c6, c5, c4), poly4d(x, c3, c2, c1, c0)); +} + +// + +static INLINE CONST VECTOR_CC vdouble2 poly2dd_b(vdouble2 x, double2 c1, double2 c0) { return ddmla_vd2_vd2_vd2_vd2(x, vcast_vd2_d2(c1), vcast_vd2_d2(c0)); } +static INLINE CONST VECTOR_CC vdouble2 poly2dd(vdouble2 x, vdouble c1, double2 c0) { return ddmla_vd2_vd2_vd2_vd2(x, vcast_vd2_vd_vd(c1, vcast_vd_d(0)), vcast_vd2_d2(c0)); } +static INLINE CONST VECTOR_CC vdouble2 poly3dd_b(vdouble2 x, double2 c2, double2 c1, double2 c0) { return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(x), vcast_vd2_d2(c2), poly2dd_b(x, c1, c0)); } +static INLINE CONST VECTOR_CC vdouble2 poly3dd(vdouble2 x, vdouble c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(x), vcast_vd2_vd_vd(c2, vcast_vd_d(0)), poly2dd_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly4dd_b(vdouble2 x, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(x), poly2dd_b(x, c3, c2), poly2dd_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly4dd(vdouble2 x, vdouble c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(x), poly2dd(x, c3, c2), poly2dd_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly5dd_b(vdouble2 x, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), vcast_vd2_d2(c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly5dd(vdouble2 x, vdouble c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), vcast_vd2_vd_vd(c4, vcast_vd_d(0)), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly6dd_b(vdouble2 x, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly2dd_b(x, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly6dd(vdouble2 x, vdouble c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly2dd(x, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly7dd_b(vdouble2 x, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly3dd_b(x, c6, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly7dd(vdouble2 x, vdouble c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly3dd(x, c6, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly8dd_b(vdouble2 x, double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly4dd_b(x, c7, c6, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly8dd(vdouble2 x, vdouble c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)), poly4dd(x, c7, c6, c5, c4), poly4dd_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly9dd_b(vdouble2 x, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), vcast_vd2_d2(c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly9dd(vdouble2 x, vdouble c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), vcast_vd2_vd_vd(c8, vcast_vd_d(0)), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly10dd_b(vdouble2 x, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly2dd_b(x, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly10dd(vdouble2 x, vdouble c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly2dd(x, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly11dd_b(vdouble2 x, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly3dd_b(x, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly11dd(vdouble2 x, vdouble c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly3dd(x, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly12dd_b(vdouble2 x, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly4dd_b(x, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly12dd(vdouble2 x, vdouble c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly4dd(x, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly13dd_b(vdouble2 x, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly5dd_b(x, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly13dd(vdouble2 x, vdouble c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly5dd(x, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly14dd_b(vdouble2 x, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly6dd_b(x, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly14dd(vdouble2 x, vdouble c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly6dd(x, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly15dd_b(vdouble2 x, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly7dd_b(x, c14, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly15dd(vdouble2 x, vdouble c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly7dd(x, c14, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly16dd_b(vdouble2 x, double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly8dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly16dd(vdouble2 x, vdouble c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x))), poly8dd(x, c15, c14, c13, c12, c11, c10, c9, c8), poly8dd_b(x, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly17dd_b(vdouble2 x, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), vcast_vd2_d2(c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly17dd(vdouble2 x, vdouble c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), vcast_vd2_vd_vd(c16, vcast_vd_d(0)), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly18dd_b(vdouble2 x, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly2dd_b(x, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly18dd(vdouble2 x, vdouble c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly2dd(x, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly19dd_b(vdouble2 x, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly3dd_b(x, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly19dd(vdouble2 x, vdouble c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly3dd(x, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly20dd_b(vdouble2 x, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly4dd_b(x, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly20dd(vdouble2 x, vdouble c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly4dd(x, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly21dd_b(vdouble2 x, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly5dd_b(x, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly21dd(vdouble2 x, vdouble c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly5dd(x, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly22dd_b(vdouble2 x, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly6dd_b(x, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly22dd(vdouble2 x, vdouble c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly6dd(x, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly23dd_b(vdouble2 x, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly7dd_b(x, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly23dd(vdouble2 x, vdouble c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly7dd(x, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly24dd_b(vdouble2 x, double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly8dd_b(x, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly24dd(vdouble2 x, vdouble c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly8dd(x, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly25dd_b(vdouble2 x, double2 c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly9dd_b(x, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly25dd(vdouble2 x, vdouble c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly9dd(x, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly26dd_b(vdouble2 x, double2 c25, double2 c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly10dd_b(x, c25, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly26dd(vdouble2 x, vdouble c25, double2 c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly10dd(x, c25, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly27dd_b(vdouble2 x, double2 c26, double2 c25, double2 c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly11dd_b(x, c26, c25, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble2 poly27dd(vdouble2 x, vdouble c26, double2 c25, double2 c24, + double2 c23, double2 c22, double2 c21, double2 c20, double2 c19, double2 c18, double2 c17, double2 c16, + double2 c15, double2 c14, double2 c13, double2 c12, double2 c11, double2 c10, double2 c9, double2 c8, + double2 c7, double2 c6, double2 c5, double2 c4, double2 c3, double2 c2, double2 c1, double2 c0) { + return ddmla_vd2_vd2_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(ddsqu_vd2_vd2(x)))), poly11dd(x, c26, c25, c24, c23, c22, c21, c20, c19, c18, c17, c16), + poly16dd_b(x, c15, c14, c13, c12, c11, c10, c9, c8, c7, c6, c5, c4, c3, c2, c1, c0)); +} + +// + +#ifndef SLEEF_ENABLE_CUDA +typedef struct { + double x, y, z; +} double3; +#endif + +static INLINE CONST VECTOR_CC vdouble3 cast_vd3_d3(double3 td) { + return vd3setxyz_vd3_vd_vd_vd(vcast_vd_d(td.x), vcast_vd_d(td.y), vcast_vd_d(td.z)); +} + +static INLINE CONST double3 td(double x, double y, double z) { + double3 ret = { x, y, z }; + return ret; +} + +static INLINE CONST VECTOR_CC vdouble3 mla_vd3_vd3_vd3_vd3(vdouble3 x, vdouble3 y, vdouble3 z) { return add2_vd3_vd3_vd3(z, mul_vd3_vd3_vd3(x, y)); } +static INLINE CONST VECTOR_CC vdouble3 poly2td_b(vdouble3 x, double3 c1, double3 c0) { + if (c0.y == 0 && c0.z == 0) { + if (c1.x == 1 && c1.y == 0 && c1.z == 0) return add2_vd3_vd_vd3(vcast_vd_d(c0.x), x); + return add2_vd3_vd_vd3(vcast_vd_d(c0.x), mul_vd3_vd3_vd3(x, cast_vd3_d3(c1))); + } + return mla_vd3_vd3_vd3_vd3(x, cast_vd3_d3(c1), cast_vd3_d3(c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly2td(vdouble3 x, vdouble2 c1, double3 c0) { + return add2_vd3_vd3_vd3(cast_vd3_d3(c0), mul_vd3_vd3_vd2(x, c1)); +} +static INLINE CONST VECTOR_CC vdouble3 poly3td_b(vdouble3 x, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(x), cast_vd3_d3(c2), poly2td_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly3td(vdouble3 x, vdouble2 c2, double3 c1, double3 c0) { + return add2_vd3_vd3_vd3(poly2td_b(x, c1, c0), mul_vd3_vd3_vd2(squ_vd3_vd3(x), c2)); +} +static INLINE CONST VECTOR_CC vdouble3 poly4td_b(vdouble3 x, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(x), poly2td_b(x, c3, c2), poly2td_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly4td(vdouble3 x, vdouble2 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(x), poly2td(x, c3, c2), poly2td_b(x, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly5td_b(vdouble3 x, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), cast_vd3_d3(c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly5td(vdouble3 x, vdouble2 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return add2_vd3_vd3_vd3(poly4td_b(x, c3, c2, c1, c0), mul_vd3_vd3_vd2(squ_vd3_vd3(squ_vd3_vd3(x)), c4)); +} +static INLINE CONST VECTOR_CC vdouble3 poly6td_b(vdouble3 x, double3 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly2td_b(x, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly6td(vdouble3 x, vdouble2 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly2td(x, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly7td_b(vdouble3 x, double3 c6, double3 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly3td_b(x, c6, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly7td(vdouble3 x, vdouble2 c6, double3 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly3td(x, c6, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly8td_b(vdouble3 x, double3 c7, double3 c6, double3 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly4td_b(x, c7, c6, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} +static INLINE CONST VECTOR_CC vdouble3 poly8td(vdouble3 x, vdouble2 c7, double3 c6, double3 c5, double3 c4, double3 c3, double3 c2, double3 c1, double3 c0) { + return mla_vd3_vd3_vd3_vd3(squ_vd3_vd3(squ_vd3_vd3(x)), poly4td(x, c7, c6, c5, c4), poly4td_b(x, c3, c2, c1, c0)); +} + +// TDX functions ------------------------------------------------------------------------------------------------------------ + +// TDX Cast operators + +static INLINE CONST VECTOR_CC tdx cast_tdx_vd(vdouble d) { + tdx r = tdxsetexyz_tdx_vm_vd_vd_vd(vilogbk_vm_vd(d), d, vcast_vd_d(0), vcast_vd_d(0)); + r = tdxsetx_tdx_tdx_vd(r, vsel_vd_vo_vd_vd(visnonfinite_vo_vd(tdxgetd3x_vd_tdx(r)), tdxgetd3x_vd_tdx(r), vldexp2_vd_vd_vm(tdxgetd3x_vd_tdx(r), vneg64_vm_vm(tdxgete_vm_tdx(r))))); + r = tdxsete_tdx_tdx_vm(r, vadd64_vm_vm_vm(tdxgete_vm_tdx(r), vcast_vm_i64(16383))); + return r; +} + +static INLINE CONST VECTOR_CC tdx cast_tdx_d(double d) { + return cast_tdx_vd(vcast_vd_d(d)); +} + +static INLINE CONST VECTOR_CC tdx cast_tdx_vd3(vdouble3 d) { + vmask re = vilogbk_vm_vd(vd3getx_vd_vd3(d)); + vdouble3 rd3 = vd3setxyz_vd3_vd_vd_vd(vldexp2_vd_vd_vm(vd3getx_vd_vd3(d), vneg64_vm_vm(re)), + vldexp2_vd_vd_vm(vd3gety_vd_vd3(d), vneg64_vm_vm(re)), + vldexp2_vd_vd_vm(vd3getz_vd_vd3(d), vneg64_vm_vm(re))); + re = vadd64_vm_vm_vm(re, vcast_vm_i64(16383)); + return tdxseted3_tdx_vm_vd3(re, rd3); +} + +static INLINE CONST VECTOR_CC tdx cast_tdx_d_d_d(double d0, double d1, double d2) { + return cast_tdx_vd3(cast_vd3_d_d_d(d0, d1, d2)); +} + +static INLINE CONST VECTOR_CC tdx fastcast_tdx_vd3(vdouble3 d) { + vmask re = vadd64_vm_vm_vm(vilogb2k_vm_vd(vd3getx_vd_vd3(d)), vcast_vm_i64(16383)); + vdouble t = vldexp3_vd_vd_vm(vcast_vd_d(0.5), vneg64_vm_vm(re)); + return tdxsetexyz_tdx_vm_vd_vd_vd(re, + vmul_vd_vd_vd(vd3getx_vd_vd3(d), t), + vmul_vd_vd_vd(vd3gety_vd_vd3(d), t), + vmul_vd_vd_vd(vd3getz_vd_vd3(d), t)); +} + +static INLINE CONST VECTOR_CC vdouble cast_vd_tdx(tdx t) { + vdouble ret = vldexp2_vd_vd_vm(tdxgetd3x_vd_tdx(t), vadd64_vm_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(-16383))); + + vopmask o = vor_vo_vo_vo(veq_vo_vd_vd(tdxgetd3x_vd_tdx(t), vcast_vd_d(0)), + vlt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(16383 - 0x500))); + ret = vsel_vd_vo_vd_vd(o, vmulsign_vd_vd_vd(vcast_vd_d(0), tdxgetd3x_vd_tdx(t)), ret); + + o = vgt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(16383 + 0x400)); + ret = vsel_vd_vo_vd_vd(o, vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), tdxgetd3x_vd_tdx(t)), ret); + + return vsel_vd_vo_vd_vd(visnonfinite_vo_vd(tdxgetd3x_vd_tdx(t)), tdxgetd3x_vd_tdx(t), ret); +} + +static INLINE CONST VECTOR_CC vdouble3 cast_vd3_tdx(tdx t) { + vmask e = vadd64_vm_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(-16383)); + vdouble3 r = cast_vd3_vd_vd_vd(vldexp2_vd_vd_vm(tdxgetd3x_vd_tdx(t), e), + vldexp2_vd_vd_vm(tdxgetd3y_vd_tdx(t), e), + vldexp2_vd_vd_vm(tdxgetd3z_vd_tdx(t), e)); + + vopmask o = vor_vo_vo_vo(veq_vo_vd_vd(tdxgetd3x_vd_tdx(t), vcast_vd_d(0)), + vlt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(16383 - 0x500))); + r = sel_vd3_vo_vd3_vd3(o, cast_vd3_vd_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(0), tdxgetd3x_vd_tdx(t)), vcast_vd_d(0), vcast_vd_d(0)), r); + + o = vgt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(16383 + 0x400)); + r = sel_vd3_vo_vd3_vd3(o, cast_vd3_vd_vd_vd(vmulsign_vd_vd_vd(vcast_vd_d(SLEEF_INFINITY), tdxgetd3x_vd_tdx(t)), vcast_vd_d(0), vcast_vd_d(0)), r); + + r = sel_vd3_vo_vd3_vd3(visnonfinite_vo_vd(tdxgetd3x_vd_tdx(t)), tdxgetd3_vd3_tdx(t), r); + + return r; +} + +// TDX Compare and select functions + +static INLINE CONST VECTOR_CC tdx sel_tdx_vo_tdx_tdx(vopmask o, tdx x, tdx y) { + return tdxseted3_tdx_vm_vd3(vsel_vm_vo64_vm_vm(o, tdxgete_vm_tdx(x), tdxgete_vm_tdx(y)), + sel_vd3_vo_vd3_vd3(o, tdxgetd3_vd3_tdx(x), tdxgetd3_vd3_tdx(y))); +} + +static INLINE CONST VECTOR_CC vmask cmp_vm_tdx_tdx(tdx t0, tdx t1) { + vmask r = vcast_vm_i64(0); + r = vsel_vm_vo64_vm_vm(vlt_vo_vd_vd(tdxgetd3z_vd_tdx(t0), tdxgetd3z_vd_tdx(t1)), vcast_vm_i64(-1), r); + r = vsel_vm_vo64_vm_vm(vgt_vo_vd_vd(tdxgetd3z_vd_tdx(t0), tdxgetd3z_vd_tdx(t1)), vcast_vm_i64( 1), r); + r = vsel_vm_vo64_vm_vm(vlt_vo_vd_vd(tdxgetd3y_vd_tdx(t0), tdxgetd3y_vd_tdx(t1)), vcast_vm_i64(-1), r); + r = vsel_vm_vo64_vm_vm(vgt_vo_vd_vd(tdxgetd3y_vd_tdx(t0), tdxgetd3y_vd_tdx(t1)), vcast_vm_i64( 1), r); + r = vsel_vm_vo64_vm_vm(vlt_vo_vd_vd(tdxgetd3x_vd_tdx(t0), tdxgetd3x_vd_tdx(t1)), vcast_vm_i64(-1), r); + r = vsel_vm_vo64_vm_vm(vgt_vo_vd_vd(tdxgetd3x_vd_tdx(t0), tdxgetd3x_vd_tdx(t1)), vcast_vm_i64( 1), r); + r = vsel_vm_vo64_vm_vm(vand_vo_vo_vo(vgt64_vo_vm_vm(tdxgete_vm_tdx(t1), tdxgete_vm_tdx(t0)), + veq64_vo_vm_vm(vsignbit_vm_vd(tdxgetd3x_vd_tdx(t0)), vsignbit_vm_vd(tdxgetd3x_vd_tdx(t1)))), + vsel_vm_vo64_vm_vm(vsignbit_vo_vd(tdxgetd3x_vd_tdx(t0)), vcast_vm_i64(+1), vcast_vm_i64(-1)), r); + r = vsel_vm_vo64_vm_vm(vand_vo_vo_vo(vgt64_vo_vm_vm(tdxgete_vm_tdx(t0), tdxgete_vm_tdx(t1)), + veq64_vo_vm_vm(vsignbit_vm_vd(tdxgetd3x_vd_tdx(t0)), vsignbit_vm_vd(tdxgetd3x_vd_tdx(t1)))), + vsel_vm_vo64_vm_vm(vsignbit_vo_vd(tdxgetd3x_vd_tdx(t0)), vcast_vm_i64(-1), vcast_vm_i64(+1)), r); + r = vsel_vm_vo64_vm_vm(vand_vo_vo_vo(veq_vo_vd_vd(tdxgetd3x_vd_tdx(t0), vcast_vd_d(0)), veq_vo_vd_vd(tdxgetd3x_vd_tdx(t1), vcast_vd_d(0))), + vcast_vm_i64( 0), r); + r = vsel_vm_vo64_vm_vm(vand_vo_vo_vo(vlt_vo_vd_vd(tdxgetd3x_vd_tdx(t0), vcast_vd_d(0)), vge_vo_vd_vd(tdxgetd3x_vd_tdx(t1), vcast_vd_d(0))), + vcast_vm_i64(-1), r); + r = vsel_vm_vo64_vm_vm(vand_vo_vo_vo(vge_vo_vd_vd(tdxgetd3x_vd_tdx(t0), vcast_vd_d(0)), vlt_vo_vd_vd(tdxgetd3x_vd_tdx(t1), vcast_vd_d(0))), + vcast_vm_i64( 1), r); + return r; +} + +static INLINE CONST VECTOR_CC vopmask signbit_vo_tdx(tdx x) { + return vsignbit_vo_vd(tdxgetd3x_vd_tdx(x)); +} + +static INLINE CONST VECTOR_CC vopmask isnan_vo_tdx(tdx x) { + return visnan_vo_vd(tdxgetd3x_vd_tdx(x)); +} + +static INLINE CONST VECTOR_CC vopmask isinf_vo_tdx(tdx x) { + return visinf_vo_vd(tdxgetd3x_vd_tdx(x)); +} + +static INLINE CONST VECTOR_CC vopmask iszero_vo_tdx(tdx x) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), veq_vo_vd_vd(tdxgetd3x_vd_tdx(x), vcast_vd_d(0))); +} + +static INLINE CONST VECTOR_CC vopmask eq_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), veq64_vo_vm_vm(cmp_vm_tdx_tdx(x, y), vcast_vm_i64(0))); +} + +static INLINE CONST VECTOR_CC vopmask neq_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), vnot_vo64_vo64(veq64_vo_vm_vm(cmp_vm_tdx_tdx(x, y), vcast_vm_i64(0)))); +} + +static INLINE CONST VECTOR_CC vopmask gt_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), vgt64_vo_vm_vm(cmp_vm_tdx_tdx(x, y), vcast_vm_i64(0))); +} + +static INLINE CONST VECTOR_CC vopmask lt_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), vgt64_vo_vm_vm(cmp_vm_tdx_tdx(y, x), vcast_vm_i64(0))); +} + +static INLINE CONST VECTOR_CC vopmask ge_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), vgt64_vo_vm_vm(cmp_vm_tdx_tdx(x, y), vcast_vm_i64(-1))); +} + +static INLINE CONST VECTOR_CC vopmask le_vo_tdx_tdx(tdx x, tdx y) { + return vandnot_vo_vo_vo(visnan_vo_vd(tdxgetd3x_vd_tdx(x)), vgt64_vo_vm_vm(cmp_vm_tdx_tdx(y, x), vcast_vm_i64(-1))); +} + +static INLINE CONST VECTOR_CC vopmask isint_vo_tdx(tdx t) { + vdouble3 d = cast_vd3_tdx(t); + vopmask o0 = vand_vo_vo_vo(vlt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(15400)), vneq_vo_vd_vd(tdxgetd3x_vd_tdx(t), vcast_vd_d(0))); + vopmask o1 = vor_vo_vo_vo(vgt64_vo_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(17000)), + vand_vo_vo_vo(vand_vo_vo_vo(visint_vo_vd(vd3getx_vd_vd3(d)), visint_vo_vd(vd3gety_vd_vd3(d))), + visint_vo_vd(vd3getz_vd_vd3(d)))); + return vandnot_vo_vo_vo(o0, o1); +} + +static INLINE CONST VECTOR_CC vopmask isodd_vo_tdx(tdx t) { + t = tdxsete_tdx_tdx_vm(t, vadd64_vm_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(-1))); + return vnot_vo64_vo64(isint_vo_tdx(t)); +} + +// TDX Arithmetic functions + +static INLINE CONST VECTOR_CC tdx neg_tdx_tdx(tdx x) { + return tdxsetd3_tdx_tdx_vd3(x, neg_vd3_vd3(tdxgetd3_vd3_tdx(x))); +} + +static INLINE CONST VECTOR_CC tdx abs_tdx_tdx(tdx x) { + return tdxsetd3_tdx_tdx_vd3(x, abs_vd3_vd3(tdxgetd3_vd3_tdx(x))); +} + +static INLINE CONST VECTOR_CC tdx mulsign_tdx_tdx_vd(tdx x, vdouble d) { + return tdxsetd3_tdx_tdx_vd3(x, mulsign_vd3_vd3_vd(tdxgetd3_vd3_tdx(x), d)); +} + +static INLINE CONST VECTOR_CC vmask ilogb_vm_tdx(tdx t) { + vmask e = vadd64_vm_vm_vm(tdxgete_vm_tdx(t), vcast_vm_i64(-16383)); + e = vsel_vm_vo64_vm_vm(vor_vo_vo_vo(veq_vo_vd_vd(tdxgetd3x_vd_tdx(t), vcast_vd_d(1.0)), vlt_vo_vd_vd(tdxgetd3y_vd_tdx(t), vcast_vd_d(0))), + vadd64_vm_vm_vm(e, vcast_vm_i64(-1)), e); + return e; +} + +static INLINE CONST VECTOR_CC tdx add_tdx_tdx_tdx(tdx dd0, tdx dd1) { // finite numbers only + vmask ed = vsub64_vm_vm_vm(tdxgete_vm_tdx(dd1), tdxgete_vm_tdx(dd0)); + vdouble t = vldexp3_vd_vd_vm(vcast_vd_d(1), ed); + + vdouble3 rd3 = scaleadd2_vd3_vd3_vd3_vd(tdxgetd3_vd3_tdx(dd0), tdxgetd3_vd3_tdx(dd1), t); + tdx r = tdxseted3_tdx_vm_vd3(vilogb2k_vm_vd(vd3getx_vd_vd3(rd3)), rd3); + t = vldexp3_vd_vd_vm(vcast_vd_d(1), vneg64_vm_vm(tdxgete_vm_tdx(r))); + + vopmask o = veq_vo_vd_vd(tdxgetd3x_vd_tdx(dd0), vcast_vd_d(0)); + r = tdxsete_tdx_tdx_vm(r, vsel_vm_vo64_vm_vm(o, tdxgete_vm_tdx(dd1), vadd64_vm_vm_vm(tdxgete_vm_tdx(r), tdxgete_vm_tdx(dd0)))); + r = tdxsetd3_tdx_tdx_vd3(r, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(r), t)); + + r = sel_tdx_vo_tdx_tdx(vgt64_vo_vm_vm(ed, vcast_vm_i64(200)), dd1, r); + r = sel_tdx_vo_tdx_tdx(vgt64_vo_vm_vm(vcast_vm_i64(-200), ed), dd0, r); + + return r; +} + +static INLINE CONST VECTOR_CC tdx sub_tdx_tdx_tdx(tdx dd0, tdx dd1) { + vmask ed = vsub64_vm_vm_vm(tdxgete_vm_tdx(dd1), tdxgete_vm_tdx(dd0)); + vdouble t = vldexp3_vd_vd_vm(vcast_vd_d(1), ed); + + vdouble3 rd3 = scalesub2_vd3_vd3_vd3_vd(tdxgetd3_vd3_tdx(dd0), tdxgetd3_vd3_tdx(dd1), t); + tdx r = tdxseted3_tdx_vm_vd3(vilogb2k_vm_vd(vd3getx_vd_vd3(rd3)), rd3); + t = vldexp3_vd_vd_vm(vcast_vd_d(1), vneg64_vm_vm(tdxgete_vm_tdx(r))); + + vopmask o = veq_vo_vd_vd(tdxgetd3x_vd_tdx(dd0), vcast_vd_d(0)); + r = tdxsete_tdx_tdx_vm(r, vsel_vm_vo64_vm_vm(o, tdxgete_vm_tdx(dd1), vadd64_vm_vm_vm(tdxgete_vm_tdx(r), tdxgete_vm_tdx(dd0)))); + r = tdxsetd3_tdx_tdx_vd3(r, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(r), t)); + + r = sel_tdx_vo_tdx_tdx(vgt64_vo_vm_vm(ed, vcast_vm_i64(200)), neg_tdx_tdx(dd1), r); + r = sel_tdx_vo_tdx_tdx(vgt64_vo_vm_vm(vcast_vm_i64(-200), ed), dd0, r); + + return r; +} + +static INLINE CONST VECTOR_CC tdx mul_tdx_tdx_tdx(tdx dd0, tdx dd1) { + vdouble3 rd3 = mul2_vd3_vd3_vd3(tdxgetd3_vd3_tdx(dd0), tdxgetd3_vd3_tdx(dd1)); + tdx r = tdxseted3_tdx_vm_vd3(vilogb2k_vm_vd(vd3getx_vd_vd3(rd3)), rd3); + vdouble t = vldexp3_vd_vd_vm(vcast_vd_d(1), vneg64_vm_vm(tdxgete_vm_tdx(r))); + r = tdxsetd3_tdx_tdx_vd3(r, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(r), t)); + vmask e = vadd64_vm_vm_vm(vadd64_vm_vm_vm(vadd64_vm_vm_vm(tdxgete_vm_tdx(dd0), tdxgete_vm_tdx(dd1)), vcast_vm_i64(-16383)), tdxgete_vm_tdx(r)); + e = vsel_vm_vo64_vm_vm(veq_vo_vd_vd(tdxgetd3x_vd_tdx(r), vcast_vd_d(0)), vcast_vm_i64(0), e); + r = tdxsete_tdx_tdx_vm(r, e); + return r; +} + +static INLINE CONST VECTOR_CC tdx div_tdx_tdx_tdx(tdx dd0, tdx dd1) { + vdouble3 rd3 = div2_vd3_vd3_vd3(tdxgetd3_vd3_tdx(dd0), tdxgetd3_vd3_tdx(dd1)); + tdx r = tdxseted3_tdx_vm_vd3(vilogb2k_vm_vd(vd3getx_vd_vd3(rd3)), rd3); + vdouble t = vldexp3_vd_vd_vm(vcast_vd_d(1), vneg64_vm_vm(tdxgete_vm_tdx(r))); + r = tdxsetd3_tdx_tdx_vd3(r, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(r), t)); + vmask e = vadd64_vm_vm_vm(vadd64_vm_vm_vm(vsub64_vm_vm_vm(tdxgete_vm_tdx(dd0), tdxgete_vm_tdx(dd1)), vcast_vm_i64(16383)), tdxgete_vm_tdx(r)); + e = vsel_vm_vo64_vm_vm(veq_vo_vd_vd(tdxgetd3x_vd_tdx(r), vcast_vd_d(0)), vcast_vm_i64(0), e); + r = tdxsete_tdx_tdx_vm(r, e); + return r; +} + +// TDX math functions + +static INLINE CONST VECTOR_CC tdx sqrt_tdx_tdx(tdx dd0) { + vopmask o = veq64_vo_vm_vm(vand_vm_vm_vm(tdxgete_vm_tdx(dd0), vcast_vm_i64(1)), vcast_vm_i64(1)); + dd0 = tdxsetd3_tdx_tdx_vd3(dd0, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(dd0), vsel_vd_vo_vd_vd(o, vcast_vd_d(1), vcast_vd_d(2)))); + vdouble3 rd3 = sqrt_vd3_vd3(tdxgetd3_vd3_tdx(dd0)); + tdx r = tdxseted3_tdx_vm_vd3(vilogb2k_vm_vd(vd3getx_vd_vd3(rd3)), rd3); + r = tdxsetd3_tdx_tdx_vd3(r, scale_vd3_vd3_vd(tdxgetd3_vd3_tdx(r), vldexp3_vd_vd_vm(vcast_vd_d(1), vneg64_vm_vm(tdxgete_vm_tdx(r))))); + r = tdxsete_tdx_tdx_vm(r, vadd64_vm_vm_vm(vsub64_vm_vm_vm(vsrl64_vm_vm_i(vadd64_vm_vm_vm(tdxgete_vm_tdx(dd0), vcast_vm_i64(16383+(1 << 21))), 1), vcast_vm_i64(1 << 20)), + tdxgete_vm_tdx(r))); + o = vneq_vo_vd_vd(tdxgetd3x_vd_tdx(dd0), vcast_vd_d(0)); + return tdxsetxyz_tdx_tdx_vd_vd_vd(r, + vreinterpret_vd_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(tdxgetd3x_vd_tdx(r)))), + vreinterpret_vd_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(tdxgetd3y_vd_tdx(r)))), + vreinterpret_vd_vm(vand_vm_vo64_vm(o, vreinterpret_vm_vd(tdxgetd3z_vd_tdx(r))))); +} + +static INLINE CONST VECTOR_CC tdx cbrt_tdx_tdx(tdx d) { + vmask e = vadd64_vm_vm_vm(tdxgete_vm_tdx(d), vcast_vm_i64(-16382)); + d = tdxsete_tdx_tdx_vm(d, vsub64_vm_vm_vm(tdxgete_vm_tdx(d), e)); + + vdouble t = vadd_vd_vd_vd(vcast_vd_vm(e), vcast_vd_d(60000)); + vint qu = vtruncate_vi_vd(vmul_vd_vd_vd(t, vcast_vd_d(1.0/3.0))); + vint re = vtruncate_vi_vd(vsub_vd_vd_vd(t, vmul_vd_vd_vd(vcast_vd_vi(qu), vcast_vd_d(3)))); + + tdx q = cast_tdx_d(1); + q = sel_tdx_vo_tdx_tdx(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(1))), + cast_tdx_d_d_d(1.2599210498948731907, -2.5899333753005069177e-17, 9.7278081561563724019e-34), q); + q = sel_tdx_vo_tdx_tdx(vcast_vo64_vo32(veq_vo_vi_vi(re, vcast_vi_i(2))), + cast_tdx_d_d_d(1.5874010519681995834, -1.0869008194197822986e-16, 9.380961956715938535e-34), q); + q = tdxsete_tdx_tdx_vm(q, vadd64_vm_vm_vm(tdxgete_vm_tdx(q), vcast_vm_vi(vsub_vi_vi_vi(qu, vcast_vi_i(20000))))); + q = mulsign_tdx_tdx_vd(q, tdxgetd3x_vd_tdx(d)); + + vdouble3 d3 = abs_vd3_vd3(cast_vd3_tdx(d)); + + vdouble x = vcast_vd_d(-0.640245898480692909870982), y; + x = vmla_vd_vd_vd_vd(x, vd3getx_vd_vd3(d3), vcast_vd_d(2.96155103020039511818595)); + x = vmla_vd_vd_vd_vd(x, vd3getx_vd_vd3(d3), vcast_vd_d(-5.73353060922947843636166)); + x = vmla_vd_vd_vd_vd(x, vd3getx_vd_vd3(d3), vcast_vd_d(6.03990368989458747961407)); + x = vmla_vd_vd_vd_vd(x, vd3getx_vd_vd3(d3), vcast_vd_d(-3.85841935510444988821632)); + x = vmla_vd_vd_vd_vd(x, vd3getx_vd_vd3(d3), vcast_vd_d(2.2307275302496609725722)); + + y = vmul_vd_vd_vd(x, x); y = vmul_vd_vd_vd(y, y); + x = vsub_vd_vd_vd(x, vmul_vd_vd_vd(vmlapn_vd_vd_vd_vd(vd3getx_vd_vd3(d3), y, x), vcast_vd_d(1.0 / 3.0))); + y = vmul_vd_vd_vd(x, x); y = vmul_vd_vd_vd(y, y); + x = vsub_vd_vd_vd(x, vmul_vd_vd_vd(vmlapn_vd_vd_vd_vd(vd3getx_vd_vd3(d3), y, x), vcast_vd_d(1.0 / 3.0))); + + vdouble2 y2 = ddmul_vd2_vd_vd(x, x); + y2 = ddsqu_vd2_vd2(y2); + vdouble2 x2 = vcast_vd2_vd_vd(vd3getx_vd_vd3(d3), vd3gety_vd_vd3(d3)); + x2 = ddadd_vd2_vd_vd2(x, ddmul_vd2_vd2_vd2(ddadd2_vd2_vd2_vd(ddmul_vd2_vd2_vd2(x2, y2), vneg_vd_vd(x)), + vcast_vd2_d_d(-0.33333333333333331483, -1.8503717077085941313e-17))); + + vdouble3 y3 = mul_vd3_vd3_vd3(d3, mul_vd3_vd2_vd2(x2, x2)); + vdouble3 x3 = cast_vd3_d_d_d(-0.66666666666666662966, -3.7007434154171882626e-17, -2.0543252740130514626e-33); + x3 = mul_vd3_vd3_vd3(mul_vd3_vd3_vd3(x3, y3), add2_vd3_vd_vd3(vcast_vd_d(-1), mul_vd3_vd2_vd3(x2, y3))); + y3 = add2_vd3_vd3_vd3(y3, x3); + + return sel_tdx_vo_tdx_tdx(vor_vo_vo_vo(isinf_vo_tdx(d), iszero_vo_tdx(d)), d, mul_tdx_tdx_tdx(q, cast_tdx_vd3(y3))); +} + +static CONST VECTOR_CC tdi_t rempio2q(tdx a) { + const int N = 8, B = 8; + const int NCOL = 53-B, NROW = (16385+(53-B)*N-106)/NCOL+1; + + vmask e = ilogb_vm_tdx(a); + e = vsel_vm_vo64_vm_vm(vgt64_vo_vm_vm(e, vcast_vm_i64(106)), e, vcast_vm_i64(106)); + a = tdxsete_tdx_tdx_vm(a, vadd64_vm_vm_vm(tdxgete_vm_tdx(a), vsub64_vm_vm_vm(vcast_vm_i64(106), e))); + + vdouble row = vtruncate_vd_vd(vmul_vd_vd_vd(vcast_vd_vm(vsub64_vm_vm_vm(e, vcast_vm_i64(106))), vcast_vd_d(1.0 / NCOL))); // (e - 106) / NCOL; + vdouble col = vsub_vd_vd_vd(vcast_vd_vm(vsub64_vm_vm_vm(e, vcast_vm_i64(106))), vmul_vd_vd_vd(row, vcast_vd_d(NCOL))); // (e - 106) % NCOL; + vint p = vtruncate_vi_vd(vmla_vd_vd_vd_vd(col, vcast_vd_d(NROW), row)); + + vint q = vcast_vi_i(0); + vdouble3 d = normalize_vd3_vd3(cast_vd3_tdx(a)), x = cast_vd3_d_d_d(0, 0, 0); + + for(int i=0;i +#include +#include +#include +#include +#include +#endif + +static const tdx exp10tab[14] = { + { 16386, { 1.25, 0, 0 } }, // 10 + { 16389, { 1.5625, 0, 0 } }, // 100 + { 16396, { 1.220703125, 0, 0 } }, // 10000 + { 16409, { 1.490116119384765625, 0, 0 } }, // 1e+08 + { 16436, { 1.1102230246251565404, 0, 0 } }, // 1e+16 + { 16489, { 1.2325951644078310121, -6.6143055845634601483e-17, 0 } }, // 1e+32 + { 16595, { 1.519290839321567832, -3.2391917291561477915e-17, -1.8687814275678753633e-33 } }, // 1e+64 + { 16808, { 1.1541223272232170594, -8.6760553787903265289e-17, -5.7759618887794337486e-33 } }, // 1e+128 + { 17233, { 1.3319983461951343529, -4.0129993161716667573e-17, -4.1720927621797370111e-34 } }, // 1e+256 + { 18083, { 1.7742195942665728303, 4.9309343678620668082e-17, 1.3386888736008621608e-34 } }, // 1e+512 + { 19784, { 1.5739275843397213528, -1.0848584040002990893e-16, 4.3586291506346591213e-33 } }, // 1e+1024 + { 23186, { 1.2386240203727352238, -5.8476062413608067671e-17, -2.0006771920677486581e-33 } }, // 1e+2048 + { 29989, { 1.5341894638443178689, -1.0973609479387666102e-17, -6.5816871252891901643e-34 } }, // 1e+4096 + { 43596, { 1.1768686554854577153, 3.0579788864750933707e-17, -2.6771867381968692559e-34 } }, // 1e+8192 +}; + +static CONST tdx exp10i(int n) { + int neg = 0; + if (n < 0) { neg = 1; n = -n; } + tdx r = cast_tdx_d(1); + for(int i=0;i<14;i++) + if ((n & (1 << i)) != 0) r = mul_tdx_tdx_tdx(r, exp10tab[i]); + if (neg) r = div_tdx_tdx_tdx(cast_tdx_d(1), r); + return r; +} + +static CONST int ilog10(tdx t) { + int r = 0, p = 1; + if ((int)cmp_vm_tdx_tdx(t, cast_tdx_d(1)) < 0) { + t = div_tdx_tdx_tdx(cast_tdx_d(1), t); + p = -1; + } + for(int i=12;i>=0;i--) { + int c = cmp_vm_tdx_tdx(t, exp10tab[i]); + if ((p > 0 && c >= 0) || (p < 0 && c > 0)) { + t = div_tdx_tdx_tdx(t, exp10tab[i]); + r |= (1 << i); + } + } + if (p < 0) r++; + return r * p; +} + +static CONST vquad xsll128(vquad m, int c) { + if (c == 0) return m; + if (c >= 128) return imdvq_vq_vm_vm(0, 0); + + if (c < 64) { + return imdvq_vq_vm_vm(vsll64_vm_vm_i(vqgetx_vm_vq(m), c), + vor_vm_vm_vm(vsll64_vm_vm_i(vqgety_vm_vq(m), c), vsrl64_vm_vm_i(vqgetx_vm_vq(m), 64 - c))); + } + + return imdvq_vq_vm_vm(0, vsll64_vm_vm_i(vqgetx_vm_vq(m), c - 64)); +} + +static CONST vquad xsrl128(vquad m, int c) { + if (c == 0) return m; + if (c >= 128) return imdvq_vq_vm_vm(0, 0); + + if (c < 64) { + return imdvq_vq_vm_vm(vor_vm_vm_vm(vsrl64_vm_vm_i(vqgetx_vm_vq(m), c), vsll64_vm_vm_i(vqgety_vm_vq(m), 64 - c)), + vsrl64_vm_vm_i(vqgety_vm_vq(m), c)); + } + + return imdvq_vq_vm_vm(vsrl64_vm_vm_i(vqgety_vm_vq(m), c - 64), 0); +} + +static int xclz128(vquad m) { + int n = m.y == 0 ? 128 : 64; + uint64_t u = m.y == 0 ? m.x : m.y, v; + v = u >> 32; if (v != 0) { n -= 32; u = v; } + v = u >> 16; if (v != 0) { n -= 16; u = v; } + v = u >> 8; if (v != 0) { n -= 8; u = v; } + v = u >> 4; if (v != 0) { n -= 4; u = v; } + v = u >> 2; if (v != 0) { n -= 2; u = v; } + v = u >> 1; if (v != 0) return n - 2; + return n - u; +} + +// Float128 string functions + +EXPORT vargquad Sleef_strtoq(const char *str, const char **endptr) { + while(isspace((int)*str)) str++; + const char *p = str; + + int positive = 1, bp = 0, e = 0, mf = 0; + tdx n = cast_tdx_d(0), d = cast_tdx_d(1); + + if (*p == '-') { + positive = 0; + p++; + } else if (*p == '+') p++; + + if (tolower(p[0]) == 'n' && tolower(p[1]) == 'a' && tolower(p[2]) == 'n') { + if (endptr != NULL) *endptr = p+3; + vquad r = { vcast_vm_i64(-1), vcast_vm_u64(UINT64_C(0x7fffffffffffffff)) }; + r.y |= ((uint64_t)!positive) << 63; + return cast_aq_vq(r); + } + + if (tolower(p[0]) == 'i' && tolower(p[1]) == 'n' && tolower(p[2]) == 'f') { + if (endptr != NULL) *endptr = p+3; + if (tolower(p[3]) == 'i' && tolower(p[4]) == 'n' && tolower(p[5]) == 'i' && + tolower(p[6]) == 't' && tolower(p[7]) == 'y' && endptr != NULL) *endptr = p+8; + vquad r = { vcast_vm_i64(0), vcast_vm_u64(UINT64_C(0x7fff000000000000)) }; + r.y |= ((uint64_t)!positive) << 63; + return cast_aq_vq(r); + } + + if (*p == '0' && *(p+1) == 'x') { + p += 2; + vquad m = { 0, 0 }; + int pp = 0; + + while(*p != '\0') { + int d = 0; + if (('0' <= *p && *p <= '9')) { + d = *p++ - '0'; + } else if ('a' <= *p && *p <= 'f') { + d = *p++ - 'a' + 10; + } else if ('A' <= *p && *p <= 'F') { + d = *p++ - 'A' + 10; + } else if (*p == '.') { + if (bp) break; + bp = 1; + p++; + continue; + } else break; + + mf = 1; + m = xsll128(m, 4); + m.x += d; + pp += bp * 4; + if (m.y >> 60) break; + } + + while(('0' <= *p && *p <= '9') || ('a' <= *p && *p <= 'f') || ('A' <= *p && *p <= 'F')) p++; + if (*p == '.' && !bp) p++; + while(('0' <= *p && *p <= '9') || ('a' <= *p && *p <= 'f') || ('A' <= *p && *p <= 'F')) p++; + + if (*p == 'p' || *p == 'P') { + char *q; + e = strtol(p+1, &q, 10); + if (p+1 == q || isspace((int)*(p+1))) { + e = 0; + } else { + p = q; + } + } + + int nsl = xclz128(m) - 15; + e = e - pp - nsl + 0x3fff + 112; + + if (e <= 0 || nsl == 128 - 15) { + nsl += e - 1; + e = 0; + } + + if (nsl >= 0) { + m = xsll128(m, nsl); + } else { + if (-nsl-1 < 64) { + uint64_t u = m.x + ((1ULL) << (-nsl - 1)); + if (u < m.x) m.y++; + m.x = u; + } else { + m.y += ((1ULL) << (-nsl - 1 - 64)); + } + m = xsrl128(m, -nsl); + } + + m.y &= 0x0000ffffffffffff; + m.y |= (((uint64_t)!positive) << 63) | ((((uint64_t)e) & 0x7fff) << 48); + + if (endptr != NULL) *endptr = p; + return cast_aq_vq(m); + } + + while(*p != '\0') { + if ('0' <= *p && *p <= '9') { + n = add_tdx_tdx_tdx(mul_tdx_tdx_tdx(n, cast_tdx_d(10)), cast_tdx_d(*p - '0')); + if (bp) d = mul_tdx_tdx_tdx(d, cast_tdx_d(10)); + p++; + mf = 1; + continue; + } + + if (*p == '.') { + if (bp) break; + bp = 1; + p++; + continue; + } + + if (*p == 'e' || *p == 'E') { + char *q; + e = strtol(p+1, &q, 10); + if (p+1 == q || isspace((int)*(p+1))) { + e = 0; + } else { + p = q; + } + } + + break; + } + + if (!mf && !bp) { + if (endptr != NULL) *endptr = str; + vquad r = { vcast_vm_i64(0), vcast_vm_i64(0) }; + return cast_aq_vq(r); + } + + n = div_tdx_tdx_tdx(n, d); + if (e > 0) n = mul_tdx_tdx_tdx(n, exp10i(+e)); + if (e < 0) n = div_tdx_tdx_tdx(n, exp10i(-e)); + if (!positive) n = neg_tdx_tdx(n); + + if (endptr != NULL) *endptr = p; + + return cast_aq_vq(cast_vq_tdx(n)); +} + +// + +#define FLAG_SIGN (1 << 0) +#define FLAG_BLANK (1 << 1) +#define FLAG_ALT (1 << 2) +#define FLAG_LEFT (1 << 3) +#define FLAG_ZERO (1 << 4) +#define FLAG_UPPER (1 << 5) + +static int snprintquad(char *buf, size_t bufsize, vargquad argvalue, int typespec, int width, int precision, int flags) { + if (width > bufsize) width = bufsize; + + vquad c128 = cast_vq_aq(argvalue); + + char *ptr = buf; + char prefix = 0; + int length = 0, flag_rtz = 0; + + assert(typespec == 'e' || typespec == 'f' || typespec == 'g'); + + if ((c128.y & UINT64_C(0x8000000000000000)) != 0) { + c128.y ^= UINT64_C(0x8000000000000000); + prefix = '-'; + } else if (flags & FLAG_SIGN) { + prefix = '+'; + } else if (flags & FLAG_BLANK) { + prefix = ' '; + } + + tdx value = cast_tdx_vq(c128); + + if (isnan_vo_vq(c128)) { + if (prefix) *ptr++ = prefix; + ptr += snprintf(ptr, buf + bufsize - ptr, (flags & FLAG_UPPER) ? "NAN" : "nan"); + flags &= ~FLAG_ZERO; + } else if (isinf_vo_vq(c128)) { + if (prefix) *ptr++ = prefix; + ptr += snprintf(ptr, buf + bufsize - ptr, (flags & FLAG_UPPER) ? "INF" : "inf"); + flags &= ~FLAG_ZERO; + } else { + if (precision < 0) precision = 6; + if (precision > bufsize/2 - 10) precision = bufsize/2 - 10; + if (typespec == 'g' && precision > 0) precision--; + + tdx rounder = mul_tdx_tdx_tdx(cast_tdx_d(0.5), exp10i(-precision)); + + if (typespec == 'f') value = add_tdx_tdx_tdx(value, rounder); + + int exp = 0, e2 = 0; + if (!iszero_vo_vq(c128)) { + exp = ilog10(value); + value = mul_tdx_tdx_tdx(value, exp10i(-exp)); + } + + int flag_exp = typespec == 'e'; + + if (typespec != 'f') { + value = add_tdx_tdx_tdx(value, rounder); + } + + if ((int)cmp_vm_tdx_tdx(value, cast_tdx_d(10.0)) >= 0) { + value = div_tdx_tdx_tdx(value, cast_tdx_d(10)); + exp++; + } + + if (typespec == 'g') { + flag_rtz = !(flags & FLAG_ALT); + if (exp < -4 || exp > precision) { + typespec = 'e'; + } else { + precision = precision - exp; + typespec = 'f'; + } + } + + if (typespec != 'e') e2 = exp; + + int flag_dp = (precision > 0) | (flags & FLAG_ALT); + + if (prefix) *ptr++ = prefix; + + if (e2 < 0) { + *ptr++ = '0'; + } else { + for(;e2>=0;e2--) { + int digit = (int)cast_vd_tdx(value); + if ((int)cmp_vm_tdx_tdx(value, cast_tdx_d(digit)) < 0) digit--; + if (ptr - buf >= (ptrdiff_t)bufsize-1) { *ptr = '\0'; return -1; } + *ptr++ = digit + '0'; + value = mul_tdx_tdx_tdx(add_tdx_tdx_tdx(value, cast_tdx_d(-digit)), cast_tdx_d(10)); + } + } + + if (flag_dp) { + if (ptr - buf >= (ptrdiff_t)bufsize-1) { *ptr = '\0'; return -1; } + *ptr++ = '.'; + } + + for(e2++;e2 < 0 && precision > 0;precision--, e2++) { + if (ptr - buf >= (ptrdiff_t)bufsize-1) { *ptr = '\0'; return -1; } + *ptr++ = '0'; + } + + while (precision-- > 0) { + int digit = (int)cast_vd_tdx(value); + if ((int)cmp_vm_tdx_tdx(value, cast_tdx_d(digit)) < 0) digit--; + if (ptr - buf >= (ptrdiff_t)bufsize-1) { *ptr = '\0'; return -1; } + *ptr++ = digit + '0'; + value = mul_tdx_tdx_tdx(add_tdx_tdx_tdx(value, cast_tdx_d(-digit)), cast_tdx_d(10)); + } + + if (flag_rtz && flag_dp) { + while(ptr[-1] == '0') *(--ptr) = 0; + assert(ptr > buf); + if (ptr[-1] == '.') *(--ptr) = 0; + } + + if (flag_exp || (typespec == 'e' && exp)) { + if (ptr - buf >= (ptrdiff_t)bufsize-8) { *ptr = '\0'; return -1; } + *ptr++ = (flags & FLAG_UPPER) ? 'E' : 'e'; + if (exp < 0){ + *ptr++ = '-'; exp = -exp; + } else { + *ptr++ = '+'; + } + if (exp >= 1000) { + *ptr++ = exp / 1000 + '0'; + exp %= 1000; + *ptr++ = exp / 100 + '0'; + exp %= 100; + } else if (exp >= 100) { + *ptr++ = exp / 100 + '0'; + exp %= 100; + } + *ptr++ = exp / 10 + '0'; + *ptr++ = exp % 10 + '0'; + } + } + + *ptr = 0; + + length = ptr - buf; + ptr = buf; + + if (!(flags & FLAG_LEFT) && length < width) { + int i; + int nPad = width - length; + for(i=width; i>=nPad; i--) { + ptr[i] = ptr[i-nPad]; + } + i = prefix != 0 && (flags & FLAG_ZERO); + while (nPad--) { + ptr[i++] = (flags & FLAG_ZERO) ? '0' : ' '; + } + length = width; + } + + if (flags & FLAG_LEFT) { + while (length < width) { + ptr[length++] = ' '; + } + ptr[length] = '\0'; + } + + return length; +} + +static int snprintquadhex(char *buf, size_t bufsize, vargquad argvalue, int width, int precision, int flags) { + if (width > bufsize) width = bufsize; + char *bufend = buf + bufsize, *ptr = buf; + + vquad c128 = cast_vq_aq(argvalue); + + int mainpos = 0; + + if (c128.y >> 63) { + ptr += snprintf(ptr, bufend - ptr, "-"); + } else if (flags & FLAG_SIGN) { + ptr += snprintf(ptr, bufend - ptr, "+"); + } else if (flags & FLAG_BLANK) { + ptr += snprintf(ptr, bufend - ptr, " "); + } + + if (isnan_vo_vq(c128)) { + ptr += snprintf(ptr, bufend - ptr, (flags & FLAG_UPPER) ? "NAN" : "nan"); + flags &= ~FLAG_ZERO; + } else if (isinf_vo_vq(c128)) { + ptr += snprintf(ptr, bufend - ptr, (flags & FLAG_UPPER) ? "INF" : "inf"); + flags &= ~FLAG_ZERO; + } else { + int iszero = iszero_vo_vq(c128); + if (precision >= 0 && precision < 28) { + int s = (28 - precision) * 4 - 1; + if (s < 64) { + uint64_t u = c128.x + (((uint64_t)1) << s); + if (u < c128.x) c128.y++; + c128.x = u; + } else { + c128.y += ((uint64_t)1) << (s - 64); + } + } + + int exp = (c128.y >> 48) & 0x7fff; + uint64_t h = c128.y << 16, l = c128.x; + + ptr += snprintf(ptr, bufend - ptr, (flags & FLAG_UPPER) ? "0X" :"0x"); + mainpos = ptr - buf; + ptr += snprintf(ptr, bufend - ptr, exp != 0 ? "1" : "0"); + + if ((!(h == 0 && l == 0 && precision < 0) && precision != 0) || (flags & FLAG_ALT)) ptr += snprintf(ptr, bufend - ptr, "."); + + const char *digits = (flags & FLAG_UPPER) ? "0123456789ABCDEF" : "0123456789abcdef"; + + int niter = (precision < 0 || precision > 28) ? 28 : precision; + + for(int i=0;i<12 && i < niter;i++) { + if (h == 0 && l == 0 && precision < 0) break; + ptr += snprintf(ptr, bufend - ptr, "%c", digits[(h >> 60) & 0xf]); + h <<= 4; + } + + for(int i=0;i<16 && i < niter-12;i++) { + if (l == 0 && precision < 0) break; + ptr += snprintf(ptr, bufend - ptr, "%c", digits[(l >> 60) & 0xf]); + l <<= 4; + } + + if (exp == 0) exp++; + if (iszero) exp = 0x3fff; + + ptr += snprintf(ptr, bufend - ptr, "%c%+d", (flags & FLAG_UPPER) ? 'P' : 'p', exp - 0x3fff); + } + + int length = ptr - buf; + ptr = buf; + + if (!(flags & FLAG_ZERO)) mainpos = 0; + + if (!(flags & FLAG_LEFT) && length < width) { + int i; + int nPad = width - length; + for(i=width;i-nPad>=mainpos; i--) { + ptr[i] = ptr[i-nPad]; + } + i = mainpos; + while (nPad--) { + ptr[i++] = (flags & FLAG_ZERO) ? '0' : ' '; + } + length = width; + } + + if (flags & FLAG_LEFT) { + while (length < width) { + ptr[length++] = ' '; + } + ptr[length] = '\0'; + } + + return length; +} + +#define XBUFSIZE 5000 + +static int xvprintf(size_t (*consumer)(const char *ptr, size_t size, void *arg), void *arg, const char *fmt, va_list ap) { + char *xbuf = (char *)malloc(XBUFSIZE+10); + + int outlen = 0, errorflag = 0; + + while(*fmt != '\0' && !errorflag) { + // Copy the format string until a '%' is read + + if (*fmt != '%') { + do { + outlen += (*consumer)(fmt++, 1, arg); + } while(*fmt != '%' && *fmt != '\0'); + + if (*fmt == '\0') break; + } + + const char *subfmtstart = fmt; + + if ((*++fmt) == '\0') { + errorflag = 1; + outlen += (*consumer)("%", 1, arg); + break; + } + + // Read flags + + int flags = 0, done = 0; + do { + switch(*fmt) { + case '-': flags |= FLAG_LEFT; break; + case '+': flags |= FLAG_SIGN; break; + case ' ': flags |= FLAG_BLANK; break; + case '#': flags |= FLAG_ALT; break; + case '0': flags |= FLAG_ZERO; break; + default: done = 1; break; + } + } while(!done && (*++fmt) != 0); + + // Read width + + int width = 0; + + if (*fmt == '*') { + width = va_arg(ap, int); + if (width < 0) { + flags |= FLAG_LEFT; + width = -width; + } + fmt++; + } else { + while(*fmt >= '0' && *fmt <= '9') { + width = width*10 + *fmt - '0'; + fmt++; + } + } + + // Read precision + + int precision = -1; + + if (*fmt == '.') { + precision = 0; + fmt++; + if (*fmt == '*') { + precision = va_arg(ap, int); + if (precision < 0) precision = -precision; + fmt++; + } else { + while(*fmt >= '0' && *fmt <= '9') { + precision = precision*10 + *fmt - '0'; + fmt++; + } + } + } + + // Read size prefix + + int flag_quad = 0, flag_ptrquad = 0; + int size_prefix = 0, subfmt_processed = 0; + + if (*fmt == 'Q') { + flag_quad = 1; + fmt++; + } else if (*fmt == 'P') { + flag_ptrquad = 1; + fmt++; + } else { + int pl = 0; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'j' || *fmt == 'z' || *fmt == 't' || *fmt == 'L') { + size_prefix = *fmt; + pl = 1; + } + if ((*fmt == 'h' && *(fmt+1) == 'h') || (*fmt == 'l' && *(fmt+1) == 'l')) { + size_prefix = *fmt + 256 * *(fmt+1); + pl = 2; + } + fmt += pl; + } + + // Call type-specific function + + va_list ap2; + va_copy(ap2, ap); + + switch(*fmt) { + case 'E': case 'F': case 'G': case 'A': + flags |= FLAG_UPPER; + // fall through + case 'e': case 'f': case 'g': case 'a': + { + vargquad value; + if (flag_quad || flag_ptrquad) { + if (flag_quad) { + value = va_arg(ap, vargquad); + } else { + value = *(vargquad *)va_arg(ap, vargquad *); + } + if (tolower(*fmt) == 'a') { + snprintquadhex(xbuf, XBUFSIZE, value, width, precision, flags); + } else { + snprintquad(xbuf, XBUFSIZE, value, tolower(*fmt), width, precision, flags); + } + outlen += (*consumer)(xbuf, strlen(xbuf), arg); + subfmt_processed = 1; + break; + } + + if (size_prefix == 0) { // double and long double + va_arg(ap, double); + } else if (size_prefix == 'L') { + va_arg(ap, long double); + } else errorflag = 1; + } + break; + + case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': + { + switch(size_prefix) { + case 0: case 'h': case 'h' + 256*'h': va_arg(ap, int); break; + case 'l': va_arg(ap, long int); break; + case 'j': va_arg(ap, intmax_t); break; + case 'z': va_arg(ap, size_t); break; + case 't': va_arg(ap, ptrdiff_t); break; + case 'l' + 256*'l': va_arg(ap, long long int); break; + default: errorflag = 1; break; + } + } + break; + + case 'c': + if (size_prefix == 0) { + va_arg(ap, int); + } else +#if 0 + if (size_prefix == 'l') { + va_arg(ap, wint_t); // wint_t is not defined + } else +#endif + errorflag = 1; + break; + + case 's': + if (size_prefix == 0 || size_prefix == 'l') { + va_arg(ap, void *); + } else errorflag = 1; + break; + + case 'p': case 'n': + { + if ((*fmt == 'p' && size_prefix != 0) || size_prefix == 'L') { errorflag = 1; break; } + va_arg(ap, void *); + } + break; + + default: + errorflag = 1; + } + + if (!subfmt_processed) { + char *subfmt = (char *)malloc(fmt - subfmtstart + 2); + memcpy(subfmt, subfmtstart, fmt - subfmtstart + 1); + subfmt[fmt - subfmtstart + 1] = 0; + int ret = vsnprintf(xbuf, XBUFSIZE, subfmt, ap2); + free(subfmt); + if (ret < 0) { errorflag = 1; break; } + outlen += (*consumer)(xbuf, strlen(xbuf), arg); + } + + fmt++; + } + + free(xbuf); + + return errorflag ? -1 : outlen; +} + +// + +typedef struct { FILE *fp; } stream_consumer_t; + +static size_t stream_consumer(const char *ptr, size_t size, void *varg) { + stream_consumer_t *arg = (stream_consumer_t *)varg; + return fwrite(ptr, size, 1, arg->fp); +} + +EXPORT int Sleef_vfprintf(FILE *fp, const char *fmt, va_list ap) { + stream_consumer_t arg = { fp }; + return xvprintf(stream_consumer, &arg, fmt, ap); +} + +EXPORT int Sleef_vprintf(const char *fmt, va_list ap) { return Sleef_vfprintf(stdout, fmt, ap); } + +EXPORT int Sleef_fprintf(FILE *fp, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + int ret = Sleef_vfprintf(fp, fmt, ap); + va_end(ap); + return ret; +} + +EXPORT int Sleef_printf(const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + int ret = Sleef_vfprintf(stdout, fmt, ap); + va_end(ap); + return ret; +} + +typedef struct { + char *buf; + size_t pos, size; +} buf_consumer_t; + +static size_t buf_consumer(const char *ptr, size_t size, void *varg) { + buf_consumer_t *arg = (buf_consumer_t *)varg; + + size_t p = 0; + while(p < size) { + if (arg->pos >= arg->size - 1) break; + arg->buf[arg->pos++] = ptr[p++]; + } + + arg->buf[arg->pos] = '\0'; + + return p; +} + +EXPORT int Sleef_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) { + buf_consumer_t arg = { str, 0, size }; + return xvprintf(buf_consumer, &arg, fmt, ap); +} + +EXPORT int Sleef_snprintf(char *str, size_t size, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + int ret = Sleef_vsnprintf(str, size, fmt, ap); + va_end(ap); + return ret; +} + +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 13) +#include + +static int pa_quad = -1, printf_Qmodifier = -1, printf_Pmodifier = -1; + +static void Sleef_quad_va(void *ptr, va_list *ap) { + *(Sleef_quad *)ptr = va_arg(*ap, Sleef_quad); +} + +static int printf_arginfo(const struct printf_info *info, size_t n, int *argtypes, int *s) { + if (info->user & printf_Qmodifier) { + argtypes[0] = pa_quad; + return 1; + } else if (info->user & printf_Pmodifier) { + argtypes[0] = PA_FLAG_PTR | pa_quad; + return 1; + } + return -1; +} + +static int printf_output(FILE *fp, const struct printf_info *info, const void *const *args) { + if (!(info->user & printf_Qmodifier || info->user & printf_Pmodifier)) return -2; + + int flags = 0; + if (info->showsign) flags |= FLAG_SIGN; + if (info->space) flags |= FLAG_BLANK; + if (info->alt) flags |= FLAG_ALT; + if (info->left) flags |= FLAG_LEFT; + if (isupper(info->spec)) flags |= FLAG_UPPER; + + vargquad q = **(const vargquad **)args[0]; + + char *xbuf = (char *)malloc(XBUFSIZE+10); + + int len = 0; + if (tolower(info->spec) == 'a') { + len = snprintquadhex(xbuf, XBUFSIZE, q, info->width, info->prec, flags); + } else { + len = snprintquad(xbuf, XBUFSIZE, q, tolower(info->spec), info->width, info->prec, flags); + } + + size_t wlen = fwrite(xbuf, len, 1, fp); + + free(xbuf); + + return (int)wlen; +} + +EXPORT int Sleef_registerPrintfHook() { + printf_Qmodifier = register_printf_modifier(L"Q"); + printf_Pmodifier = register_printf_modifier(L"P"); + if (printf_Qmodifier == -1 || printf_Pmodifier == -1) return -1; + + pa_quad = register_printf_type(Sleef_quad_va); + if (pa_quad == -1) return -2; + + if (register_printf_specifier('a', printf_output, printf_arginfo)) return -3; + if (register_printf_specifier('e', printf_output, printf_arginfo)) return -4; + if (register_printf_specifier('f', printf_output, printf_arginfo)) return -5; + if (register_printf_specifier('g', printf_output, printf_arginfo)) return -6; + if (register_printf_specifier('A', printf_output, printf_arginfo)) return -7; + if (register_printf_specifier('E', printf_output, printf_arginfo)) return -8; + if (register_printf_specifier('F', printf_output, printf_arginfo)) return -9; + if (register_printf_specifier('G', printf_output, printf_arginfo)) return -10; + + return 0; +} + +EXPORT void Sleef_unregisterPrintfHook() { + register_printf_specifier('a', NULL, NULL); + register_printf_specifier('e', NULL, NULL); + register_printf_specifier('f', NULL, NULL); + register_printf_specifier('g', NULL, NULL); + register_printf_specifier('A', NULL, NULL); + register_printf_specifier('E', NULL, NULL); + register_printf_specifier('F', NULL, NULL); + register_printf_specifier('G', NULL, NULL); +} +#endif // #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 13) + +#endif // #ifdef ENABLE_PUREC_SCALAR + +// Functions for debugging ------------------------------------------------------------------------------------------------------------ + +#ifdef ENABLE_MAIN +// gcc -DENABLE_MAIN -DENABLEFLOAT128 -Wno-attributes -I../libm -I../quad-tester -I../common -I../arch -DUSEMPFR -DENABLE_AVX2 -mavx2 -mfma sleefsimdqp.c rempitabqp.c ../common/common.c ../quad-tester/qtesterutil.c -lm -lmpfr +// gcc-10.2.0 -DENABLE_MAIN -Wno-attributes -I../libm -I../quad-tester -I../common -I../arch -DUSEMPFR -DENABLE_SVE -march=armv8-a+sve sleefsimdqp.c rempitabqp.c ../common/common.c ../quad-tester/qtesterutil.c -lm -lmpfr +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qtesterutil.h" + +#if 0 +int main(int argc, char **argv) { + Sleef_quad q0 = atof(argv[1]); + + int lane = 0; + vargquad a0; + memset(&a0, 0, sizeof(vargquad)); + a0 = xsetq(a0, lane, q0); + + tdx t = cast_tdx_vq(cast_vq_aq(a0)); + + printvdouble("t.d3.x", t.d3.x); +} +#endif + +#if 1 +int main(int argc, char **argv) { + xsrand(time(NULL) + (int)getpid()); + int lane = xrand() % VECTLENDP; + printf("lane = %d\n", lane); + + char s[200]; + double ad[32]; + mpfr_set_default_prec(18000); + mpfr_t fr0, fr1, fr2, fr3; + mpfr_inits(fr0, fr1, fr2, fr3, NULL); + + mpfr_set_d(fr0, 0, GMP_RNDN); + if (argc >= 2) mpfr_set_str(fr0, argv[1], 10, GMP_RNDN); + Sleef_quad q0 = mpfr_get_f128(fr0, GMP_RNDN); + mpfr_set_f128(fr0, q0, GMP_RNDN); + if (argc >= 2) printf("arg0 : %s\n", sprintfr(fr0)); + vargquad a0; +#if 0 + memrand(&a0, sizeof(vargquad)); +#elif 0 + memset(&a0, 0, sizeof(vargquad)); +#endif + a0 = xsetq(a0, lane, q0); + + mpfr_set_d(fr1, 0, GMP_RNDN); + if (argc >= 3) mpfr_set_str(fr1, argv[2], 10, GMP_RNDN); + Sleef_quad q1 = mpfr_get_f128(fr1, GMP_RNDN); + mpfr_set_f128(fr1, q1, GMP_RNDN); + if (argc >= 3) printf("arg1 : %s\n", sprintfr(fr1)); + vargquad a1; +#if 0 + memrand(&a1, sizeof(vargquad)); +#elif 0 + memset(&a1, 0, sizeof(vargquad)); +#endif + a1 = xsetq(a1, lane, q1); + + mpfr_set_d(fr2, 0, GMP_RNDN); + if (argc >= 4) mpfr_set_str(fr2, argv[3], 10, GMP_RNDN); + Sleef_quad q2 = mpfr_get_f128(fr2, GMP_RNDN); + mpfr_set_f128(fr2, q2, GMP_RNDN); + if (argc >= 4) printf("arg2 : %s\n", sprintfr(fr2)); + vargquad a2; +#if 0 + memrand(&a2, sizeof(vargquad)); +#elif 0 + memset(&a2, 0, sizeof(vargquad)); +#endif + a2 = xsetq(a2, lane, q2); + + // + + vargquad a3; + +#if 0 + a3 = xaddq_u05(a0, a1); + mpfr_add(fr3, fr0, fr1, GMP_RNDN); + + printf("\nadd\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xsubq_u05(a0, a1); + mpfr_sub(fr3, fr0, fr1, GMP_RNDN); + + printf("\nsub\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xmulq_u05(a0, a1); + mpfr_mul(fr3, fr0, fr1, GMP_RNDN); + + printf("\nmul\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xdivq_u05(a0, a1); + mpfr_div(fr3, fr0, fr1, GMP_RNDN); + + printf("\ndiv\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xsqrtq_u05(a0); + mpfr_sqrt(fr3, fr0, GMP_RNDN); + + printf("\nsqrt\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xsinq_u10(a0); + mpfr_sin(fr3, fr0, GMP_RNDN); + + printf("\nsin\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfabsq(a0); + mpfr_abs(fr3, fr0, GMP_RNDN); + + printf("\nfabs\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xcopysignq(a0, a1); + mpfr_copysign(fr3, fr0, fr1, GMP_RNDN); + + printf("\ncopysign\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfmaxq(a0, a1); + mpfr_max(fr3, fr0, fr1, GMP_RNDN); + + printf("\nmax\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfminq(a0, a1); + mpfr_min(fr3, fr0, fr1, GMP_RNDN); + + printf("\nmin\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfdimq_u05(a0, a1); + mpfr_dim(fr3, fr0, fr1, GMP_RNDN); + + printf("\nfdim\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xsinhq_u10(a0); + mpfr_sinh(fr3, fr0, GMP_RNDN); + + printf("\nsinh\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xcoshq_u10(a0); + mpfr_cosh(fr3, fr0, GMP_RNDN); + + printf("\ncosh\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xtanhq_u10(a0); + mpfr_tanh(fr3, fr0, GMP_RNDN); + + printf("\ntanh\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xatan2q_u10(a0, a1); + mpfr_atan2(fr3, fr0, fr1, GMP_RNDN); + + printf("\natan2\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xpowq_u10(a0, a1); + mpfr_pow(fr3, fr0, fr1, GMP_RNDN); + + printf("\npow\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xtruncq(a0); + mpfr_trunc(fr3, fr0); + + printf("\ntrunc\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfloorq(a0); + mpfr_floor(fr3, fr0); + + printf("\nfloor\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xceilq(a0); + mpfr_ceil(fr3, fr0); + + printf("\nceil\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xfmodq(a0, a1); + mpfr_fmod(fr3, fr0, fr1, GMP_RNDN); + + printf("\nfmod\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xremainderq(a0, a1); + mpfr_remainder(fr3, fr0, fr1, GMP_RNDN); + + printf("\nremainder\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xcbrtq_u10(a0); + mpfr_cbrt(fr3, fr0, GMP_RNDN); + + printf("\ncbrt\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 1 + a3 = xfmaq_u05(a0, a1, a2); + mpfr_fma(fr3, fr0, fr1, fr2, GMP_RNDN); + + printf("\nfma\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + a3 = xhypotq_u05(a0, a1); + mpfr_hypot(fr3, fr0, fr1, GMP_RNDN); + + printf("\nhypot\n"); + mpfr_set_f128(fr3, mpfr_get_f128(fr3, GMP_RNDN), GMP_RNDN); + printf("corr : %s\n", sprintfr(fr3)); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + +#if 0 + vint vi = xilogbq(a0); + + printf("\nilogb\n"); + printf("corr : %d\n", ilogb((double)q0)); + printf("test : %d\n", vi); +#endif + +#if 0 + a3 = xldexpq(a0, vcast_vi_i(atoi(argv[2]))); + + printf("\nldexp\n"); + printf("corr : %.20g\n", ldexp((double)q0, atoi(argv[2]))); + mpfr_set_f128(fr3, xgetq(a3, lane), GMP_RNDN); + printf("test : %s\n", sprintfr(fr3)); +#endif + mpfr_clears(fr0, fr1, fr2, fr3, NULL); +} +#endif +#endif diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-gcc.cmake new file mode 100644 index 0000000000000..c3594551ee1c9 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-gcc.cmake @@ -0,0 +1,11 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "aarch64") + +SET(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu /usr/include/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu /lib/aarch64-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES aarch64-linux-gnu-gcc-11 aarch64-linux-gnu-gcc-8 aarch64-linux-gnu-gcc-7 aarch64-linux-gnu-gcc-6 aarch64-linux-gnu-gcc-5 aarch64-linux-gnu-gcc) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-llvm.cmake new file mode 100644 index 0000000000000..d9c11ae0096dd --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/aarch64-llvm.cmake @@ -0,0 +1,12 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "aarch64") + +SET(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu /usr/include/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu /lib/aarch64-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES clang-17 clang-16 clang-15 clang-14 clang-13 clang) +set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-gcc.cmake new file mode 100644 index 0000000000000..24e160b965bd0 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-gcc.cmake @@ -0,0 +1,11 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "armhf") + +SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf /usr/include/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf) + +find_program(CMAKE_C_COMPILER NAMES arm-linux-gnueabihf-gcc-11 arm-linux-gnueabihf-gcc-8 arm-linux-gnueabihf-gcc-7 arm-linux-gnueabihf-gcc-6 arm-linux-gnueabihf-gcc-5 arm-linux-gnueabihf-gcc) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-llvm.cmake new file mode 100644 index 0000000000000..6c157289e4104 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/armhf-llvm.cmake @@ -0,0 +1,12 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "armhf") + +SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf /usr/include/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf) + +find_program(CMAKE_C_COMPILER NAMES clang-17 clang-16 clang-15 clang-14 clang-13 clang) +set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-gcc.cmake new file mode 100644 index 0000000000000..07ea294d37878 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-gcc.cmake @@ -0,0 +1 @@ +find_program(CMAKE_C_COMPILER gcc) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-llvm.cmake new file mode 100644 index 0000000000000..6f8e7121afa89 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/native-llvm.cmake @@ -0,0 +1 @@ +find_program(CMAKE_C_COMPILER NAMES clang-17 clang-16 clang-15 clang-14 clang-13 clang) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-gcc.cmake new file mode 100644 index 0000000000000..7d6c96ae20326 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-gcc.cmake @@ -0,0 +1,13 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "ppc64") + +SET(CMAKE_FIND_ROOT_PATH /usr/powerpc64le-linux-gnu /usr/include/powerpc64le-linux-gnu /usr/lib/powerpc64le-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES powerpc64le-linux-gnu-gcc-11 powerpc64le-linux-gnu-gcc ppc64el-cc) + +SET(CMAKE_AR /usr/powerpc64le-linux-gnu/bin/ar) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-llvm.cmake new file mode 100644 index 0000000000000..531b36f35f895 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/ppc64el-llvm.cmake @@ -0,0 +1,14 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "ppc64") + +SET(CMAKE_FIND_ROOT_PATH /usr/powerpc64le-linux-gnu /usr/include/powerpc64le-linux-gnu /usr/lib/powerpc64le-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES clang-17 clang-16 clang-15 clang-14 clang-13 clang) +set(CMAKE_C_COMPILER_TARGET powerpc64le-linux-gnu) + +SET(CMAKE_AR /usr/powerpc64le-linux-gnu/bin/ar) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-gcc.cmake new file mode 100644 index 0000000000000..b08409987eba4 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-gcc.cmake @@ -0,0 +1,11 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "riscv64") + +SET(CMAKE_FIND_ROOT_PATH /usr/riscv64-linux-gnu /usr/include/riscv64-linux-gnu /usr/lib/riscv64-linux-gnu /lib/riscv64-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES riscv64-linux-gnu-gcc-14 riscv64-linux-gnu-gcc) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-llvm.cmake new file mode 100644 index 0000000000000..1821770a50b19 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/riscv64-llvm.cmake @@ -0,0 +1,12 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "riscv64") + +SET(CMAKE_FIND_ROOT_PATH /usr/riscv64-linux-gnu /usr/include/riscv64-linux-gnu /usr/lib/riscv64-linux-gnu /lib/riscv64-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES clang-17 clang) +set(CMAKE_C_COMPILER_TARGET riscv64-linux-gnu) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-gcc.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-gcc.cmake new file mode 100644 index 0000000000000..4aa9f12cfb185 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-gcc.cmake @@ -0,0 +1,11 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "s390x") + +SET(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu /usr/include/s390x-linux-gnu /usr/lib/s390x-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES s390x-linux-gnu-gcc-11 s390x-linux-gnu-gcc) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-llvm.cmake b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-llvm.cmake new file mode 100644 index 0000000000000..ca5e96878d1d3 --- /dev/null +++ b/src/jdk.incubator.vector/linux/native/libsleef/upstream/toolchains/s390x-llvm.cmake @@ -0,0 +1,12 @@ +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Linux") +SET (CMAKE_SYSTEM_PROCESSOR "s390x") + +SET(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu /usr/include/s390x-linux-gnu /usr/lib/s390x-linux-gnu) + +find_program(CMAKE_C_COMPILER NAMES clang-17 clang-16 clang-15 clang-14 clang-13 clang) +set(CMAKE_C_COMPILER_TARGET s390x-linux-gnu) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index 9a1fef061e3f4..d25a7c974a5cf 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -104,12 +104,15 @@ static JVMCICompilerFactory getCompilerFactory(HotSpotJVMCIRuntime runtime) { } } if (factory == null) { + String reason; if (Services.IS_IN_NATIVE_IMAGE) { - throw runtime.exitHotSpotWithMessage(1, "JVMCI compiler '%s' not found in JVMCI native library.%n" + + reason = String.format("JVMCI compiler '%s' not found in JVMCI native library.%n" + "Use -XX:-UseJVMCINativeLibrary when specifying a JVMCI compiler available on a class path with %s.%n", compilerName, compPropertyName); + } else { + reason = String.format("JVMCI compiler '%s' specified by %s not found%n", compilerName, compPropertyName); } - throw runtime.exitHotSpotWithMessage(1, "JVMCI compiler '%s' specified by %s not found%n", compilerName, compPropertyName); + factory = new DummyCompilerFactory(reason, runtime); } } } else { diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java index 6163ef8264772..551568ca86f21 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java +++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2024, 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 @@ -251,7 +251,7 @@ private static File createTempFileInSameDirectoryAs(File file) * Starts main program with the specified arguments. */ @SuppressWarnings({"removal"}) - public synchronized boolean run(String args[]) { + public synchronized boolean run(String[] args) { ok = true; if (!parseArgs(args)) { return false; @@ -366,11 +366,9 @@ public synchronized boolean run(String args[]) { if (fname != null) { list(fname, files); } else { - InputStream in = new FileInputStream(FileDescriptor.in); - try { - list(new BufferedInputStream(in), files); - } finally { - in.close(); + try (InputStream in = new FileInputStream(FileDescriptor.in); + BufferedInputStream bis = new BufferedInputStream(in)) { + list(bis, files); } } } else if (xflag) { @@ -386,18 +384,12 @@ public synchronized boolean run(String args[]) { // latter can handle it. String[] files = filesMapToFiles(filesMap); - if (fname != null && files != null) { + if (fname != null) { extract(fname, files); } else { - InputStream in = (fname == null) - ? new FileInputStream(FileDescriptor.in) - : new FileInputStream(fname); - try { - if (!extract(new BufferedInputStream(in), files) && fname != null) { - extract(fname, files); - } - } finally { - in.close(); + try (InputStream in = new FileInputStream(FileDescriptor.in); + BufferedInputStream bis = new BufferedInputStream(in)) { + extract(bis, files); } } } else if (iflag) { @@ -503,7 +495,7 @@ Stream filesToEntryNames(Map.Entry fileEntries) { /** * Parses command line arguments. */ - boolean parseArgs(String args[]) { + boolean parseArgs(String[] args) { /* Preprocess and expand @file arguments */ try { args = CommandLine.parse(args); @@ -935,118 +927,116 @@ boolean update(InputStream in, OutputStream out, Map moduleInfos, JarIndex jarIndex) throws IOException { - ZipInputStream zis = new ZipInputStream(in); - ZipOutputStream zos = new JarOutputStream(out); - ZipEntry e = null; - boolean foundManifest = false; boolean updateOk = true; + try (ZipInputStream zis = new ZipInputStream(in); + ZipOutputStream zos = new JarOutputStream(out)) { - // All actual entries added/updated/existing, in the jar file (excl manifest - // and module-info.class ). - Set jentries = new HashSet<>(); - - if (jarIndex != null) { - addIndex(jarIndex, zos); - } + if (jarIndex != null) { + addIndex(jarIndex, zos); + } + ZipEntry e = null; + boolean foundManifest = false; + // All actual entries added/updated/existing, in the jar file (excl manifest + // and module-info.class ). + Set jentries = new HashSet<>(); - // put the old entries first, replace if necessary - while ((e = zis.getNextEntry()) != null) { - String name = e.getName(); + // put the old entries first, replace if necessary + while ((e = zis.getNextEntry()) != null) { + String name = e.getName(); - boolean isManifestEntry = equalsIgnoreCase(name, MANIFEST_NAME); - boolean isModuleInfoEntry = isModuleInfoEntry(name); + boolean isManifestEntry = equalsIgnoreCase(name, MANIFEST_NAME); + boolean isModuleInfoEntry = isModuleInfoEntry(name); - if ((jarIndex != null && equalsIgnoreCase(name, INDEX_NAME)) - || (Mflag && isManifestEntry)) { - continue; - } else if (isManifestEntry && ((newManifest != null) || + if ((jarIndex != null && equalsIgnoreCase(name, INDEX_NAME)) + || (Mflag && isManifestEntry)) { + continue; + } else if (isManifestEntry && ((newManifest != null) || (ename != null) || isMultiRelease)) { - foundManifest = true; - if (newManifest != null) { - // Don't read from the newManifest InputStream, as we - // might need it below, and we can't re-read the same data - // twice. - try (FileInputStream fis = new FileInputStream(mname)) { - if (isAmbiguousMainClass(new Manifest(fis))) { - return false; + foundManifest = true; + if (newManifest != null) { + // Don't read from the newManifest InputStream, as we + // might need it below, and we can't re-read the same data + // twice. + try (FileInputStream fis = new FileInputStream(mname)) { + if (isAmbiguousMainClass(new Manifest(fis))) { + return false; + } } } - } - // Update the manifest. - Manifest old = new Manifest(zis); - if (newManifest != null) { - old.read(newManifest); - } - if (!updateManifest(old, zos)) { - return false; - } - } else if (moduleInfos != null && isModuleInfoEntry) { - moduleInfos.putIfAbsent(name, new StreamedModuleInfoEntry(name, zis.readAllBytes(), e.getLastModifiedTime())); - } else { - boolean isDir = e.isDirectory(); - if (!entryMap.containsKey(name)) { // copy the old stuff - // do our own compression - ZipEntry e2 = new ZipEntry(name); - e2.setMethod(e.getMethod()); - setZipEntryTime(e2, e.getTime()); - e2.setComment(e.getComment()); - e2.setExtra(e.getExtra()); - if (e.getMethod() == ZipEntry.STORED) { - e2.setSize(e.getSize()); - e2.setCrc(e.getCrc()); + // Update the manifest. + Manifest old = new Manifest(zis); + if (newManifest != null) { + old.read(newManifest); + } + if (!updateManifest(old, zos)) { + return false; + } + } else if (moduleInfos != null && isModuleInfoEntry) { + moduleInfos.putIfAbsent(name, new StreamedModuleInfoEntry(name, zis.readAllBytes(), e.getLastModifiedTime())); + } else { + boolean isDir = e.isDirectory(); + if (!entryMap.containsKey(name)) { // copy the old stuff + // do our own compression + ZipEntry e2 = new ZipEntry(name); + e2.setMethod(e.getMethod()); + setZipEntryTime(e2, e.getTime()); + e2.setComment(e.getComment()); + e2.setExtra(e.getExtra()); + if (e.getMethod() == ZipEntry.STORED) { + e2.setSize(e.getSize()); + e2.setCrc(e.getCrc()); + } + zos.putNextEntry(e2); + copy(zis, zos); + } else { // replace with the new files + Entry ent = entryMap.get(name); + addFile(zos, ent); + entryMap.remove(name); + entries.remove(ent); + isDir = ent.isDir; + } + if (!isDir) { + jentries.add(name); } - zos.putNextEntry(e2); - copy(zis, zos); - } else { // replace with the new files - Entry ent = entryMap.get(name); - addFile(zos, ent); - entryMap.remove(name); - entries.remove(ent); - isDir = ent.isDir; - } - if (!isDir) { - jentries.add(name); } } - } - // add the remaining new files - for (Entry entry : entries) { - addFile(zos, entry); - if (!entry.isDir) { - jentries.add(entry.name); + // add the remaining new files + for (Entry entry : entries) { + addFile(zos, entry); + if (!entry.isDir) { + jentries.add(entry.name); + } } - } - if (!foundManifest) { - if (newManifest != null) { - Manifest m = new Manifest(newManifest); - updateOk = !isAmbiguousMainClass(m); - if (updateOk) { - if (!updateManifest(m, zos)) { + if (!foundManifest) { + if (newManifest != null) { + Manifest m = new Manifest(newManifest); + updateOk = !isAmbiguousMainClass(m); + if (updateOk) { + if (!updateManifest(m, zos)) { + updateOk = false; + } + } + } else if (ename != null) { + if (!updateManifest(new Manifest(), zos)) { updateOk = false; } } - } else if (ename != null) { - if (!updateManifest(new Manifest(), zos)) { + } + if (updateOk) { + if (moduleInfos != null && !moduleInfos.isEmpty()) { + Set pkgs = new HashSet<>(); + jentries.forEach(je -> addPackageIfNamed(pkgs, je)); + addExtendedModuleAttributes(moduleInfos, pkgs); + updateOk = checkModuleInfo(moduleInfos.get(MODULE_INFO), jentries); + updateModuleInfo(moduleInfos, zos); + // TODO: check manifest main classes, etc + } else if (moduleVersion != null || modulesToHash != null) { + error(getMsg("error.module.options.without.info")); updateOk = false; } } } - if (updateOk) { - if (moduleInfos != null && !moduleInfos.isEmpty()) { - Set pkgs = new HashSet<>(); - jentries.forEach( je -> addPackageIfNamed(pkgs, je)); - addExtendedModuleAttributes(moduleInfos, pkgs); - updateOk = checkModuleInfo(moduleInfos.get(MODULE_INFO), jentries); - updateModuleInfo(moduleInfos, zos); - // TODO: check manifest main classes, etc - } else if (moduleVersion != null || modulesToHash != null) { - error(getMsg("error.module.options.without.info")); - updateOk = false; - } - } - zis.close(); - zos.close(); return updateOk; } @@ -1374,19 +1364,12 @@ void updateLastModifiedTime(Set zes) throws IOException { /** * Extracts specified entries from JAR file. - * - * @return whether entries were found and successfully extracted - * (indicating this was a zip file without "leading garbage") */ - boolean extract(InputStream in, String files[]) throws IOException { + void extract(InputStream in, String[] files) throws IOException { ZipInputStream zis = new ZipInputStream(in); ZipEntry e; - // Set of all directory entries specified in archive. Disallows - // null entries. Disallows all entries if using pre-6.0 behavior. - boolean entriesFound = false; Set dirs = newDirSet(); while ((e = zis.getNextEntry()) != null) { - entriesFound = true; if (files == null) { dirs.add(extractFile(zis, e)); } else { @@ -1405,32 +1388,31 @@ boolean extract(InputStream in, String files[]) throws IOException { // instead of during, because creating a file in a directory changes // that directory's timestamp. updateLastModifiedTime(dirs); - - return entriesFound; } /** * Extracts specified entries from JAR file, via ZipFile. */ - void extract(String fname, String files[]) throws IOException { - ZipFile zf = new ZipFile(fname); - Set dirs = newDirSet(); - Enumeration zes = zf.entries(); - while (zes.hasMoreElements()) { - ZipEntry e = zes.nextElement(); - if (files == null) { - dirs.add(extractFile(zf.getInputStream(e), e)); - } else { - String name = e.getName(); - for (String file : files) { - if (name.startsWith(file)) { - dirs.add(extractFile(zf.getInputStream(e), e)); - break; + void extract(String fname, String[] files) throws IOException { + final Set dirs; + try (ZipFile zf = new ZipFile(fname)) { + dirs = newDirSet(); + Enumeration zes = zf.entries(); + while (zes.hasMoreElements()) { + ZipEntry e = zes.nextElement(); + if (files == null) { + dirs.add(extractFile(zf.getInputStream(e), e)); + } else { + String name = e.getName(); + for (String file : files) { + if (name.startsWith(file)) { + dirs.add(extractFile(zf.getInputStream(e), e)); + break; + } } } } } - zf.close(); updateLastModifiedTime(dirs); } @@ -1505,7 +1487,7 @@ ZipEntry extractFile(InputStream is, ZipEntry e) throws IOException { /** * Lists contents of JAR file. */ - void list(InputStream in, String files[]) throws IOException { + void list(InputStream in, String[] files) throws IOException { ZipInputStream zis = new ZipInputStream(in); ZipEntry e; while ((e = zis.getNextEntry()) != null) { @@ -1523,13 +1505,13 @@ void list(InputStream in, String files[]) throws IOException { /** * Lists contents of JAR file, via ZipFile. */ - void list(String fname, String files[]) throws IOException { - ZipFile zf = new ZipFile(fname); - Enumeration zes = zf.entries(); - while (zes.hasMoreElements()) { - printEntry(zes.nextElement(), files); + void list(String fname, String[] files) throws IOException { + try (ZipFile zf = new ZipFile(fname)) { + Enumeration zes = zf.entries(); + while (zes.hasMoreElements()) { + printEntry(zes.nextElement(), files); + } } - zf.close(); } /** @@ -1572,10 +1554,8 @@ List getJarPath(String jar) throws IOException { // class path attribute will give us jar file name with // '/' as separators, so we need to change them to the // appropriate one before we open the jar file. - JarFile rf = new JarFile(jar.replace('/', File.separatorChar)); - - if (rf != null) { - Manifest man = rf.getManifest(); + try (JarFile jarFile = new JarFile(jar.replace('/', File.separatorChar))) { + Manifest man = jarFile.getManifest(); if (man != null) { Attributes attr = man.getMainAttributes(); if (attr != null) { @@ -1596,7 +1576,6 @@ List getJarPath(String jar) throws IOException { } } } - rf.close(); return files; } @@ -1703,7 +1682,7 @@ void warn(String s) { /** * Main routine to start program. */ - public static void main(String args[]) { + public static void main(String[] args) { Main jartool = new Main(System.out, System.err, "jar"); System.exit(jartool.run(args) ? 0 : 1); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java index 82cac37012b75..69db8f0800c77 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java @@ -36,7 +36,10 @@ /** * This doclet generates HTML-formatted documentation for the specified modules, - * packages and types. + * packages and types. It is the doclet that is used by the + * javadoc tool + * and the {@linkplain javax.tools.ToolProvider#getSystemDocumentationTool + * system documentation tool} when no other doclet is specified to be used. * *

          User-Defined Taglets

          * diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java index fcf9ed121662c..acdd6c45f6ed4 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -980,7 +980,6 @@ public static void main(String argv[]) throws MissingResourceException { return; } else if ( // Standard VM options passed on - token.equals("-v") || token.startsWith("-v:") || // -v[:...] token.startsWith("-verbose") || // -verbose[:...] token.startsWith("-D") || // -classpath handled below @@ -988,12 +987,9 @@ public static void main(String argv[]) throws MissingResourceException { token.startsWith("-X") || // Old-style options (These should remain in place as long as // the standard VM accepts them) - token.equals("-noasyncgc") || token.equals("-prof") || token.equals("-verify") || token.equals("-verifyremote") || - token.equals("-verbosegc") || - token.startsWith("-ms") || token.startsWith("-mx") || - token.startsWith("-ss") || token.startsWith("-oss") ) { + token.equals("-verbosegc")) { javaArgs = addArgument(javaArgs, token); } else if (token.startsWith("-R")) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java index d0b95df848474..516d094b5daa8 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java @@ -30,7 +30,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; -import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -288,41 +287,4 @@ protected final String exampleDirectory() { return "/directory/recordings"; } } - - static String expandFilename(String filename) { - if (filename == null || filename.indexOf('%') == -1) { - return filename; - } - - String pid = null; - String time = null; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < filename.length(); i++) { - char c = filename.charAt(i); - if (c == '%' && i < filename.length() - 1) { - char nc = filename.charAt(i + 1); - if (nc == '%') { // %% ==> % - sb.append('%'); - i++; - } else if (nc == 'p') { - if (pid == null) { - pid = JVM.getPid(); - } - sb.append(pid); - i++; - } else if (nc == 't') { - if (time == null) { - time = ValueFormatter.formatDateTime(LocalDateTime.now()); - } - sb.append(time); - i++; - } else { - sb.append('%'); - } - } else { - sb.append(c); - } - } - return sb.toString(); - } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java index c14ce6025ce9b..151456745b0ac 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/ArgumentParser.java @@ -25,14 +25,18 @@ package jdk.jfr.internal.dcmd; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringJoiner; + +import jdk.jfr.internal.JVM; import jdk.jfr.internal.util.SpellChecker; import jdk.jfr.internal.util.TimespanUnit; +import jdk.jfr.internal.util.ValueFormatter; final class ArgumentParser { private final Map options = new HashMap<>(); @@ -221,15 +225,59 @@ private String readText(String abortChars) { private Object value(String name, String type, String text) { return switch (type) { - case "JULONG" -> parseLong(name, text); + case "INT" -> parseLong(name, text); case "STRING", "STRING SET" -> text == null ? "" : text; case "BOOLEAN" -> parseBoolean(name, text); case "NANOTIME" -> parseNanotime(name, text); case "MEMORY SIZE" -> parseMemorySize(name, text); + case "FILE" -> text == null ? "" : parseFilename(text); default -> throw new InternalError("Unknown type: " + type); }; } + /** + * Expands filename arguments replacing '%p' with the PID + * and '%t' with the time in 'yyyy_MM_dd_HH_mm_ss' format. + * @param filename a filename to be expanded + * @return filename with expanded arguments + */ + private String parseFilename(String filename) { + if (filename == null || filename.indexOf('%') == -1) { + return filename; + } + + String pid = null; + String time = null; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < filename.length(); i++) { + char c = filename.charAt(i); + if (c == '%' && i < filename.length() - 1) { + char nc = filename.charAt(i + 1); + if (nc == '%') { // %% ==> % + sb.append('%'); + i++; + } else if (nc == 'p') { + if (pid == null) { + pid = JVM.getPid(); + } + sb.append(pid); + i++; + } else if (nc == 't') { + if (time == null) { + time = ValueFormatter.formatDateTime(LocalDateTime.now()); + } + sb.append(time); + i++; + } else { + sb.append('%'); + } + } else { + sb.append(c); + } + } + return sb.toString(); + } + private Long parseLong(String name, String text) { if (text == null) { throw new IllegalArgumentException("Parsing error long value: syntax error, value is null"); @@ -361,4 +409,4 @@ void checkSpelling(Set excludeSet) { } } } -} \ No newline at end of file +} diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java index 605eb4bc745d7..7f68ba7ee7951 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java @@ -55,7 +55,7 @@ final class DCmdDump extends AbstractDCmd { public void execute(ArgumentParser parser) throws DCmdException { parser.checkUnknownArguments(); String name = parser.getOption("name"); - String filename = expandFilename(parser.getOption("filename")); + String filename = parser.getOption("filename"); Long maxAge = parser.getOption("maxage"); Long maxSize = parser.getOption("maxsize"); String begin = parser.getOption("begin"); @@ -230,14 +230,14 @@ public String[] getHelp() { dumped. If no filename is given, a filename is generated from the PID and the current date. The filename may also be a directory in which case, the filename is generated from the PID and the current date in - the specified directory. (STRING, no default value) + the specified directory. (FILE, no default value) Note: If a filename is given, '%%p' in the filename will be replaced by the PID, and '%%t' will be replaced by the time in 'yyyy_MM_dd_HH_mm_ss' format. maxage (Optional) Length of time for dumping the flight recording data to a - file. (INTEGER followed by 's' for seconds 'm' for minutes or 'h' for + file. (INT followed by 's' for seconds 'm' for minutes or 'h' for hours, no default value) maxsize (Optional) Maximum size for the amount of data to dump from a flight @@ -284,7 +284,7 @@ public Argument[] getArgumentInfos() { "STRING", false, true, null, false), new Argument("filename", "Copy recording data to file, e.g. \\\"" + exampleFilename() + "\\\"", - "STRING", false, true, null, false), + "FILE", false, true, null, false), new Argument("maxage", "Maximum duration to dump, in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, true, null, false), diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdQuery.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdQuery.java index 4c296d8a78fa7..b2e9aecda3889 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdQuery.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdQuery.java @@ -141,7 +141,7 @@ private String getOptions() { Options: - maxage (Optional) Length of time for the query to span. (INTEGER followed by + maxage (Optional) Length of time for the query to span. (INT followed by 's' for seconds 'm' for minutes or 'h' for hours, no default value) maxsize (Optional) Maximum size for the query to span in bytes if one of @@ -154,7 +154,7 @@ private String getOptions() { verbose (Optional) Display additional information about the query execution. (BOOLEAN, false) - width (Optional) Maximum number of horizontal characters. (BOOLEAN, false)"""; + width (Optional) Maximum number of horizontal characters. (INT, default value is 100)"""; } @Override @@ -170,7 +170,7 @@ public Argument[] getArgumentInfos() { null, false), new Argument("verbose", "Display additional information about the query execution", "BOOLEAN", false, true, "false", false), - new Argument("width", "Maximum number of horizontal characters", "JULONG", false, true, "100", + new Argument("width", "Maximum number of horizontal characters", "INT", false, true, "100", false), }; } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java index d115b9f5b62dc..26c095541b6aa 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java @@ -80,7 +80,7 @@ public void execute(ArgumentParser parser) throws DCmdException { Long delay = parser.getOption("delay"); Long duration = parser.getOption("duration"); Boolean disk = parser.getOption("disk"); - String path = expandFilename(parser.getOption("filename")); + String path = parser.getOption("filename"); Long maxAge = parser.getOption("maxage"); Long maxSize = parser.getOption("maxsize"); Long flush = parser.getOption("flush-interval"); @@ -353,7 +353,7 @@ private static String helpTemplate() { Options: delay (Optional) Length of time to wait before starting to record - (INTEGER followed by 's' for seconds 'm' for minutes or h' for + (INT followed by 's' for seconds 'm' for minutes or h' for hours, 0s) disk (Optional) Flag for also writing the data to disk while recording @@ -368,7 +368,7 @@ Virtual Machine (JVM) shuts down. If set to 'true' and no value id-1-2021_09_14_09_00.jfr) (BOOLEAN, false) duration (Optional) Length of time to record. Note that 0s means forever - (INTEGER followed by 's' for seconds 'm' for minutes or 'h' for + (INT followed by 's' for seconds 'm' for minutes or 'h' for hours, 0s) filename (Optional) Name of the file to which the flight recording data is @@ -377,7 +377,7 @@ Virtual Machine (JVM) shuts down. If set to 'true' and no value placed in the directory where the process was started. The filename may also be a directory in which case, the filename is generated from the PID and the current date in the specified - directory. (STRING, no default value) + directory. (FILE, no default value) Note: If a filename is given, '%p' in the filename will be replaced by the PID, and '%t' will be replaced by the time in @@ -385,7 +385,7 @@ Virtual Machine (JVM) shuts down. If set to 'true' and no value maxage (Optional) Maximum time to keep the recorded data on disk. This parameter is valid only when the disk parameter is set to true. - Note 0s means forever. (INTEGER followed by 's' for seconds 'm' + Note 0s means forever. (INT followed by 's' for seconds 'm' for minutes or 'h' for hours, 0s) maxsize (Optional) Maximum size of the data to keep on disk in bytes if @@ -501,7 +501,7 @@ public Argument[] getArgumentInfos() { "BOOLEAN", false, true, "true", false), new Argument("filename", "Resulting recording filename, e.g. \\\"" + exampleFilename() + "\\\"", - "STRING", false, true, "hotspot-pid-xxxxx-id-y-YYYY_MM_dd_HH_mm_ss.jfr", false), + "FILE", false, true, "hotspot-pid-xxxxx-id-y-YYYY_MM_dd_HH_mm_ss.jfr", false), new Argument("maxage", "Maximum time to keep recorded data (on disk) in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, true, "0", false), diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java index 92d2d28b4721a..5cf983645c65c 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java @@ -44,7 +44,7 @@ final class DCmdStop extends AbstractDCmd { protected void execute(ArgumentParser parser) throws DCmdException { parser.checkUnknownArguments(); String name = parser.getOption("name"); - String filename = expandFilename(parser.getOption("filename")); + String filename = parser.getOption("filename"); try { Recording recording = findRecording(name); WriteableUserPath path = PrivateAccess.getInstance().getPlatformRecording(recording).getDestination(); @@ -80,7 +80,7 @@ public String[] getHelp() { filename (Optional) Name of the file to which the recording is written when the recording is stopped. If no path is provided, the data from the recording - is discarded. (STRING, no default value) + is discarded. (FILE, no default value) Note: If a path is given, '%%p' in the path will be replaced by the PID, and '%%t' will be replaced by the time in 'yyyy_MM_dd_HH_mm_ss' format. @@ -107,7 +107,7 @@ public Argument[] getArgumentInfos() { "STRING", true, true, null, false), new Argument("filename", "Copy recording data to file, e.g. \\\"" + exampleFilename() + "\\\"", - "STRING", false, true, null, false) + "FILE", false, true, null, false) }; } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdView.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdView.java index 1d6f6e3dd2398..8d1c45b64c989 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdView.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdView.java @@ -108,9 +108,9 @@ public String getOptions() { return """ Options: - cell-height (Optional) Maximum number of rows in a table cell. (INTEGER, no default value) + cell-height (Optional) Maximum number of rows in a table cell. (INT, no default value) - maxage (Optional) Length of time for the view to span. (INTEGER followed by + maxage (Optional) Length of time for the view to span. (INT followed by 's' for seconds 'm' for minutes or 'h' for hours, default value is 10m) maxsize (Optional) Maximum size for the view to span in bytes if one of @@ -127,7 +127,7 @@ public String getOptions() { See list below for available views. (STRING, no default value) width (Optional) The width of the view in characters - (INTEGER, no default value)"""; + (INT, default value is 100)"""; } public String getExamples() { @@ -136,7 +136,7 @@ public String getExamples() { $ jcmd JFR.view gc - $ jcmd JFR.view width=160 hot-methods $ jcmd JFR.view verbose=true allocation-by-class @@ -154,7 +154,7 @@ public Argument[] getArgumentInfos() { return new Argument[] { new Argument("cell-height", "Maximum heigth of a table cell", - "JULONG", false, true, "1", false), + "INT", false, true, "1", false), new Argument("maxage", "Maximum duration of data to view, in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, true, "10m", false), @@ -172,7 +172,7 @@ public Argument[] getArgumentInfos() { "STRING", true, false, null, false), new Argument("width", "Maximum number of horizontal characters", - "JULONG", false, true, "100", false) + "INT", false, true, "100", false) }; } } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java index bed20ec1190ea..2e37a5c91af32 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -24,36 +24,64 @@ */ package jdk.jpackage.internal; +import java.util.ArrayList; +import java.util.List; +import java.util.ListResourceBundle; +import java.util.Map; import jdk.internal.util.OperatingSystem; import java.util.ResourceBundle; +import static java.util.stream.Collectors.toMap; +import java.util.stream.Stream; class I18N { static String getString(String key) { - if (PLATFORM.containsKey(key)) { - return PLATFORM.getString(key); - } - return SHARED.getString(key); + return BUNDLE.getString(key); } - private static final ResourceBundle SHARED = ResourceBundle.getBundle( - "jdk.jpackage.internal.resources.MainResources"); + private static class MultiResourceBundle extends ListResourceBundle { + + MultiResourceBundle(ResourceBundle... bundles) { + contents = Stream.of(bundles).map(bundle -> { + return bundle.keySet().stream().map(key -> { + return Map.entry(key, bundle.getObject(key)); + }); + }).flatMap(x -> x).collect(toMap(Map.Entry::getKey, Map.Entry::getValue, (o, n) -> { + // Override old value with the new one + return n; + })).entrySet().stream().map(e -> { + return new Object[]{e.getKey(), e.getValue()}; + }).toArray(Object[][]::new); + } + + @Override + protected Object[][] getContents() { + return contents; + } + + private final Object[][] contents; + } - private static final ResourceBundle PLATFORM; + private static final MultiResourceBundle BUNDLE; static { + List bundleNames = new ArrayList<>(); + + bundleNames.add("jdk.jpackage.internal.resources.MainResources"); + if (OperatingSystem.isLinux()) { - PLATFORM = ResourceBundle.getBundle( - "jdk.jpackage.internal.resources.LinuxResources"); + bundleNames.add("jdk.jpackage.internal.resources.LinuxResources"); } else if (OperatingSystem.isWindows()) { - PLATFORM = ResourceBundle.getBundle( - "jdk.jpackage.internal.resources.WinResources"); + bundleNames.add("jdk.jpackage.internal.resources.WinResources"); + bundleNames.add("jdk.jpackage.internal.resources.WinResourcesNoL10N"); } else if (OperatingSystem.isMacOS()) { - PLATFORM = ResourceBundle.getBundle( - "jdk.jpackage.internal.resources.MacResources"); + bundleNames.add("jdk.jpackage.internal.resources.MacResources"); } else { throw new IllegalStateException("Unknown platform"); } + + BUNDLE = new MultiResourceBundle(bundleNames.stream().map(ResourceBundle::getBundle) + .toArray(ResourceBundle[]::new)); } } diff --git a/src/jdk.jpackage/share/man/jpackage.1 b/src/jdk.jpackage/share/man/jpackage.1 index 13d9c41c31d6a..09d340ec03399 100644 --- a/src/jdk.jpackage/share/man/jpackage.1 +++ b/src/jdk.jpackage/share/man/jpackage.1 @@ -111,6 +111,16 @@ Path where generated output file is placed Defaults to the current working directory. .RE .TP +\f[V]--resource-dir\f[R] \f[I]path\f[R] +Path to override jpackage resources +.RS +.PP +(absolute path or relative to the current directory) +.PP +Icons, template files, and other resources of jpackage can be +over-ridden by adding replacement resources to this directory. +.RE +.TP \f[V]--temp\f[R] \f[I]directory\f[R] Path of a new or empty directory used to create temporary files .RS @@ -207,9 +217,9 @@ of key, value pairs .PP The keys \[dq]module\[dq], \[dq]main-jar\[dq], \[dq]main-class\[dq], \[dq]description\[dq], \[dq]arguments\[dq], \[dq]java-options\[dq], -\[dq]app-version\[dq], \[dq]icon\[dq], \[dq]launcher-as-service\[dq], -\[dq]win-console\[dq], \[dq]win-shortcut\[dq], \[dq]win-menu\[dq], -\[dq]linux-app-category\[dq], and \[dq]linux-shortcut\[dq] can be used. +\[dq]icon\[dq], \[dq]launcher-as-service\[dq], \[dq]win-console\[dq], +\[dq]win-shortcut\[dq], \[dq]win-menu\[dq], and \[dq]linux-shortcut\[dq] +can be used. .PP These options are added to, or used to overwrite, the original command line options to build an additional alternative launcher. @@ -260,7 +270,7 @@ When this option is specified, the main module will be linked in the Java runtime image. Either --module or --main-jar option can be specified but not both. .RE -.SS Platform dependent option for creating the application launcher: +.SS Platform dependent options for creating the application launcher: .SS Windows platform options (available only when running on Windows): .TP \f[V]--win-console\f[R] @@ -357,16 +367,6 @@ Path to the license file (absolute path or relative to the current directory) .RE .TP -\f[V]--resource-dir\f[R] \f[I]path\f[R] -Path to override jpackage resources -.RS -.PP -(absolute path or relative to the current directory) -.PP -Icons, template files, and other resources of jpackage can be -over-ridden by adding replacement resources to this directory. -.RE -.TP \f[V]--runtime-image\f[R] \f[I]path\f[R] Path of the predefined runtime image to install .RS diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties index 5843a750adea9..9e7504364d35a 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties @@ -35,7 +35,6 @@ resource.setup-icon=setup dialog icon resource.post-app-image-script=script to run after application image is populated resource.post-msi-script=script to run after msi file for exe installer is created resource.wxl-file=WiX localization file -resource.wxl-file-name=MsiInstallerStrings_en.wxl resource.main-wix-file=Main WiX project file resource.overrides-wix-file=Overrides WiX project file resource.shortcutpromptdlg-wix-file=Shortcut prompt dialog WiX project file diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N.properties new file mode 100644 index 0000000000000..9bb545b942fe2 --- /dev/null +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N.properties @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024, 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. +# +# + + +resource.wxl-file-name=MsiInstallerStrings_en.wxl diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_de.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_de.properties new file mode 100644 index 0000000000000..aa3aebf8cc482 --- /dev/null +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_de.properties @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024, 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. +# +# + + +resource.wxl-file-name=MsiInstallerStrings_de.wxl diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_ja.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_ja.properties new file mode 100644 index 0000000000000..3162e29f4ca9c --- /dev/null +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_ja.properties @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024, 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. +# +# + + +resource.wxl-file-name=MsiInstallerStrings_ja.wxl diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_zh_CN.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_zh_CN.properties new file mode 100644 index 0000000000000..cc96dba78dbdb --- /dev/null +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResourcesNoL10N_zh_CN.properties @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024, 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. +# +# + + +resource.wxl-file-name=MsiInstallerStrings_zh_CN.wxl diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_de.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_de.properties index e0c15bfb8fba2..a7212d9640a7a 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_de.properties +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_de.properties @@ -35,7 +35,6 @@ resource.setup-icon=Symbol für Dialogfeld "Setup" resource.post-app-image-script=Auszuführendes Skript nach dem Auffüllen des Anwendungsimages resource.post-msi-script=Auszuführendes Skript nach dem Erstellen der MSI-Datei für das EXE-Installationsprogramm resource.wxl-file=WiX-Lokalisierungsdatei -resource.wxl-file-name=MsiInstallerStrings_de.wxl resource.main-wix-file=Haupt-WiX-Projektdatei resource.overrides-wix-file=Überschreibt WiX-Projektdatei resource.shortcutpromptdlg-wix-file=Dialogfeld für Verknüpfungs-Prompt der WiX-Projektdatei diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties index e0bcd18c81103..352aab7a4934b 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties @@ -35,7 +35,6 @@ resource.setup-icon=設定ダイアログ・アイコン resource.post-app-image-script=アプリケーション・イメージを移入した後に実行するスクリプト resource.post-msi-script=exeインストーラのmsiファイルが作成された後に実行するスクリプト resource.wxl-file=WiXローカリゼーション・ファイル -resource.wxl-file-name=MsiInstallerStrings_ja.wxl resource.main-wix-file=メインWiXプロジェクト・ファイル resource.overrides-wix-file=WiXプロジェクト・ファイルのオーバーライド resource.shortcutpromptdlg-wix-file=ショートカット・プロンプト・ダイアログWiXプロジェクト・ファイル diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties index e2b8bd37135f4..a8d4a4471d6d0 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties @@ -35,7 +35,6 @@ resource.setup-icon=设置对话框图标 resource.post-app-image-script=要在填充应用程序映像之后运行的脚本 resource.post-msi-script=在为 exe 安装程序创建 msi 文件之后要运行的脚本 resource.wxl-file=WiX 本地化文件 -resource.wxl-file-name=MsiInstallerStrings_zh_CN.wxl resource.main-wix-file=主 WiX 项目文件 resource.overrides-wix-file=覆盖 WiX 项目文件 resource.shortcutpromptdlg-wix-file=快捷方式提示对话框 WiX 项目文件 diff --git a/src/utils/hsdis/binutils/hsdis-binutils.c b/src/utils/hsdis/binutils/hsdis-binutils.c index fda6a53a6d369..3e3362cac94ea 100644 --- a/src/utils/hsdis/binutils/hsdis-binutils.c +++ b/src/utils/hsdis/binutils/hsdis-binutils.c @@ -61,14 +61,10 @@ #include #include +#include #include "hsdis.h" -#ifndef bool -#define bool int -#define true 1 -#define false 0 -#endif /*bool*/ /* short names for stuff in hsdis.h */ typedef decode_instructions_event_callback_ftype event_callback_t; diff --git a/test/hotspot/gtest/gc/shared/test_oopStorageSet.cpp b/test/hotspot/gtest/gc/shared/test_oopStorageSet.cpp index c8ada2574c0e7..947ff120d15fe 100644 --- a/test/hotspot/gtest/gc/shared/test_oopStorageSet.cpp +++ b/test/hotspot/gtest/gc/shared/test_oopStorageSet.cpp @@ -23,15 +23,21 @@ */ #include "precompiled.hpp" -#include "gc/shared/oopStorage.hpp" +#include "gc/shared/oopStorage.inline.hpp" #include "gc/shared/oopStorageSet.hpp" #include "memory/allocation.inline.hpp" +#include "runtime/interfaceSupport.inline.hpp" +#include "runtime/vmOperations.hpp" +#include "runtime/vmThread.hpp" #include "utilities/debug.hpp" #include "utilities/enumIterator.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "unittest.hpp" +using ::testing::HasSubstr; +using ::testing::Not; + class OopStorageSetTest : public ::testing::Test { protected: // Returns index of s in storages, or size if not found. @@ -83,6 +89,8 @@ class OopStorageSetTest : public ::testing::Test { EnumRange(), &OopStorageSet::fill_all); } + + class VM_PrintAtSafepoint; }; TEST_VM_F(OopStorageSetTest, strong_iteration) { @@ -96,3 +104,77 @@ TEST_VM_F(OopStorageSetTest, weak_iteration) { TEST_VM_F(OopStorageSetTest, all_iteration) { test_all_iteration(); } + +class OopStorageSetTest::VM_PrintAtSafepoint : public VM_GTestExecuteAtSafepoint { +private: + class PrintContainingClosure : public Closure { + public: + void do_oop(oop* addr) { + // Direct slot hit. + { + stringStream ss; + bool printed = OopStorageSet::print_containing(addr, &ss); + ASSERT_TRUE(printed); + ASSERT_THAT(ss.freeze(), HasSubstr("is a pointer")); + ASSERT_THAT(ss.freeze(), HasSubstr("into block")); + ASSERT_THAT(ss.freeze(), HasSubstr("in oop storage")); + ASSERT_THAT(ss.freeze(), Not(HasSubstr("(unaligned)"))); + } + + // Unaligned pointer to adjacent slot, should still be in oop storage range. + { + char* unaligned_addr = (char*)addr + 1; + stringStream ss; + bool printed = OopStorageSet::print_containing(unaligned_addr, &ss); + ASSERT_TRUE(printed); + ASSERT_THAT(ss.freeze(), HasSubstr("is a pointer")); + ASSERT_THAT(ss.freeze(), HasSubstr("into block")); + ASSERT_THAT(ss.freeze(), HasSubstr("in oop storage")); + ASSERT_THAT(ss.freeze(), HasSubstr("(unaligned)")); + } + } + }; + +public: + void doit() { + PrintContainingClosure cl; + for (OopStorage* storage : OopStorageSet::Range()) { + storage->oops_do(&cl); + } + } +}; + +TEST_VM_F(OopStorageSetTest, print_containing) { + // nullptrs print nothing + { + stringStream ss; + bool printed = OopStorageSet::print_containing(nullptr, &ss); + ASSERT_FALSE(printed); + EXPECT_STREQ("", ss.freeze()); + } + + // Goofy values print nothing: unaligned out of storage pointer. + { + stringStream ss; + bool printed = OopStorageSet::print_containing((char*)0x1, &ss); + ASSERT_FALSE(printed); + EXPECT_STREQ("", ss.freeze()); + } + + // Goofy values print nothing: aligned out of storage pointer. + { + stringStream ss; + bool printed = OopStorageSet::print_containing((char*)alignof(oop), &ss); + ASSERT_FALSE(printed); + EXPECT_STREQ("", ss.freeze()); + } + + // All slot addresses should print well. + { + VM_PrintAtSafepoint op; + { + ThreadInVMfromNative invm(JavaThread::current()); + VMThread::execute(&op); + } + } +} diff --git a/test/hotspot/gtest/gc/z/test_zForwarding.cpp b/test/hotspot/gtest/gc/z/test_zForwarding.cpp index 622c6d9d8f4a0..ff2b3ee01e1cc 100644 --- a/test/hotspot/gtest/gc/z/test_zForwarding.cpp +++ b/test/hotspot/gtest/gc/z/test_zForwarding.cpp @@ -225,7 +225,7 @@ class ZForwardingTest : public Test { const ZPhysicalMemory pmem(ZPhysicalMemorySegment(zoffset(0), ZPageSizeSmall, true)); ZPage page(ZPageType::small, vmem, pmem); - page.reset(ZPageAge::eden, ZPageResetType::Allocation); + page.reset(ZPageAge::eden); const size_t object_size = 16; const zaddress object = page.alloc_object(object_size); diff --git a/test/hotspot/gtest/nmt/test_arrayWithFreeList.cpp b/test/hotspot/gtest/nmt/test_arrayWithFreeList.cpp index a2110e9e22e87..e1b008505826e 100644 --- a/test/hotspot/gtest/nmt/test_arrayWithFreeList.cpp +++ b/test/hotspot/gtest/nmt/test_arrayWithFreeList.cpp @@ -74,7 +74,7 @@ struct LL { // That's a very fancy word that means that a templated type like Foo can be passed around like only Foo at first // and then be 'applied' to some E. Think of it like passing around a lambda or function pointer, but on a template level, // where Foo is a function that can be called on some type with the return type being Foo. -template class Allocator> +template class Allocator> struct LL2 { struct Node; using NodeAllocator = Allocator; diff --git a/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp b/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp index f735022ea2b66..84ed28589520a 100644 --- a/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023 SAP SE. All rights reserved. - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -33,10 +33,10 @@ #include "unittest.hpp" // Check NMT header for integrity, as well as expected type and size. -static void check_expected_malloc_header(const void* payload, MEMFLAGS type, size_t size) { +static void check_expected_malloc_header(const void* payload, MemTag mem_tag, size_t size) { const MallocHeader* hdr = MallocHeader::resolve_checked(payload); EXPECT_EQ(hdr->size(), size); - EXPECT_EQ(hdr->flags(), type); + EXPECT_EQ(hdr->mem_tag(), mem_tag); } // ASAN complains about allocating very large sizes diff --git a/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp b/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp index 7f6000b1212fb..c054ed0e67624 100644 --- a/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp @@ -42,9 +42,9 @@ static bool compare_limits(const malloclimit* a, const malloclimit* b) { static bool compare_sets(const MallocLimitSet* a, const MallocLimitSet* b) { if (compare_limits(a->global_limit(), b->global_limit())) { - for (int i = 0; i < mt_number_of_types; i++) { - if (!compare_limits(a->category_limit(NMTUtil::index_to_flag(i)), - b->category_limit(NMTUtil::index_to_flag(i)))) { + for (int i = 0; i < mt_number_of_tags; i++) { + if (!compare_limits(a->category_limit(NMTUtil::index_to_tag(i)), + b->category_limit(NMTUtil::index_to_tag(i)))) { return false; } } @@ -96,11 +96,11 @@ TEST(NMT, MallocLimitPerCategory) { TEST(NMT, MallocLimitCategoryEnumNames) { MallocLimitSet expected; stringStream option; - for (int i = 0; i < mt_number_of_types; i++) { - MEMFLAGS f = NMTUtil::index_to_flag(i); - if (f != MEMFLAGS::mtNone) { - expected.set_category_limit(f, (i + 1) * M, MallocLimitMode::trigger_fatal); - option.print("%s%s:%dM", (i > 0 ? "," : ""), NMTUtil::flag_to_enum_name(f), i + 1); + for (int i = 0; i < mt_number_of_tags; i++) { + MemTag mem_tag = NMTUtil::index_to_tag(i); + if (mem_tag != MemTag::mtNone) { + expected.set_category_limit(mem_tag, (i + 1) * M, MallocLimitMode::trigger_fatal); + option.print("%s%s:%dM", (i > 0 ? "," : ""), NMTUtil::tag_to_enum_name(mem_tag), i + 1); } } test(option.base(), expected); @@ -109,11 +109,11 @@ TEST(NMT, MallocLimitCategoryEnumNames) { TEST(NMT, MallocLimitAllCategoriesHaveHumanReadableNames) { MallocLimitSet expected; stringStream option; - for (int i = 0; i < mt_number_of_types; i++) { - MEMFLAGS f = NMTUtil::index_to_flag(i); - if (f != MEMFLAGS::mtNone) { - expected.set_category_limit(f, (i + 1) * M, MallocLimitMode::trigger_fatal); - option.print("%s%s:%dM", (i > 0 ? "," : ""), NMTUtil::flag_to_name(f), i + 1); + for (int i = 0; i < mt_number_of_tags; i++) { + MemTag mem_tag = NMTUtil::index_to_tag(i); + if (mem_tag != MemTag::mtNone) { + expected.set_category_limit(mem_tag, (i + 1) * M, MallocLimitMode::trigger_fatal); + option.print("%s%s:%dM", (i > 0 ? "," : ""), NMTUtil::tag_to_name(mem_tag), i + 1); } } test(option.base(), expected); diff --git a/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp b/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp index 0708ce5f3000a..b5f8899034675 100644 --- a/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 SAP SE. All rights reserved. - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "nmt/nmtCommon.hpp" #include "nmt/memTracker.hpp" #include "nmt/virtualMemoryTracker.hpp" #include "runtime/os.hpp" @@ -33,12 +34,12 @@ TEST_VM(NMT, ReservedRegionCopy) { address dummy1 = (address)0x10000000; NativeCallStack stack1(&dummy1, 1); ReservedMemoryRegion region1(dummy1, os::vm_page_size(), stack1, mtThreadStack); - VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region1.flag()); + VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region1.mem_tag()); region1.add_committed_region(dummy1, os::vm_page_size(), stack1); address dummy2 = (address)0x20000000; NativeCallStack stack2(&dummy2, 1); ReservedMemoryRegion region2(dummy2, os::vm_page_size(), stack2, mtCode); - VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region2.flag()); + VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region2.mem_tag()); region2.add_committed_region(dummy2, os::vm_page_size(), stack2); region2 = region1; @@ -46,7 +47,7 @@ TEST_VM(NMT, ReservedRegionCopy) { CommittedRegionIterator itr = region2.iterate_committed_regions(); const CommittedMemoryRegion* rgn = itr.next(); ASSERT_EQ(rgn->base(), dummy1); // Now we should see dummy1 - ASSERT_EQ(region2.flag(), mtThreadStack); // Should be correct flag + ASSERT_EQ(region2.mem_tag(), mtThreadStack); // Should be correct memory tag ASSERT_EQ(region2.call_stack()->get_frame(0), dummy1); // Check the stack rgn = itr.next(); ASSERT_EQ(rgn, (const CommittedMemoryRegion*)nullptr); // and nothing else diff --git a/test/hotspot/gtest/nmt/test_nmt_totals.cpp b/test/hotspot/gtest/nmt/test_nmt_totals.cpp index bf2c1397e7def..01ffc7c0ce3ac 100644 --- a/test/hotspot/gtest/nmt/test_nmt_totals.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_totals.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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 @@ -89,8 +89,8 @@ TEST_VM(NMTNumbers, totals) { void* p[NUM_ALLOCS]; for (int i = 0; i < NUM_ALLOCS; i ++) { // spread over categories - int category = i % (mt_number_of_types - 1); - p[i] = NEW_C_HEAP_ARRAY(char, ALLOC_SIZE, (MEMFLAGS)category); + int category = i % (mt_number_of_tags - 1); + p[i] = NEW_C_HEAP_ARRAY(char, ALLOC_SIZE, (MemTag)category); } const totals_t t2 = get_totals(); diff --git a/test/hotspot/gtest/nmt/test_vmatree.cpp b/test/hotspot/gtest/nmt/test_vmatree.cpp index 1c1bc31b5b498..08b4340ae4fb7 100644 --- a/test/hotspot/gtest/nmt/test_vmatree.cpp +++ b/test/hotspot/gtest/nmt/test_vmatree.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "memory/allocation.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "nmt/nmtNativeCallStackStorage.hpp" #include "nmt/vmatree.hpp" #include "runtime/os.hpp" @@ -214,7 +214,7 @@ TEST_VM_F(NMTVMATreeTest, LowLevel) { treap(tree).visit_in_order([&](Node* x) { EXPECT_TRUE(x->key() == 0 || x->key() == 100); if (x->key() == 0) { - EXPECT_EQ(x->val().out.regiondata().flag, mtTest); + EXPECT_EQ(x->val().out.regiondata().mem_tag, mtTest); } }); @@ -240,6 +240,7 @@ TEST_VM_F(NMTVMATreeTest, LowLevel) { EXPECT_EQ(nullptr, treap_root(tree)); } + { // A committed region inside of/replacing a reserved region // should replace the reserved region's metadata. Tree::RegionData rd{si[0], mtNMT}; @@ -249,10 +250,10 @@ TEST_VM_F(NMTVMATreeTest, LowLevel) { tree.commit_mapping(0, 100, rd2); treap(tree).visit_range_in_order(0, 99999, [&](Node* x) { if (x->key() == 0) { - EXPECT_EQ(mtTest, x->val().out.regiondata().flag); + EXPECT_EQ(mtTest, x->val().out.regiondata().mem_tag); } if (x->key() == 100) { - EXPECT_EQ(mtTest, x->val().in.regiondata().flag); + EXPECT_EQ(mtTest, x->val().in.regiondata().mem_tag); } }); } @@ -274,11 +275,11 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { Tree::RegionData rd2(NCS::StackIndex(), mtNMT); Tree tree; VMATree::SummaryDiff all_diff = tree.reserve_mapping(0, 100, rd); - VMATree::SingleDiff diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(100, diff.reserve); all_diff = tree.reserve_mapping(50, 25, rd2); - diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; - VMATree::SingleDiff diff2 = all_diff.flag[NMTUtil::flag_to_index(mtNMT)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff2 = all_diff.tag[NMTUtil::tag_to_index(mtNMT)]; EXPECT_EQ(-25, diff.reserve); EXPECT_EQ(25, diff2.reserve); } @@ -286,31 +287,31 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { Tree::RegionData rd(NCS::StackIndex(), mtTest); Tree tree; VMATree::SummaryDiff all_diff = tree.reserve_mapping(0, 100, rd); - VMATree::SingleDiff diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(100, diff.reserve); all_diff = tree.release_mapping(0, 100); - diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(-100, diff.reserve); } { // Convert some of a released mapping to a committed one Tree::RegionData rd(NCS::StackIndex(), mtTest); Tree tree; VMATree::SummaryDiff all_diff = tree.reserve_mapping(0, 100, rd); - VMATree::SingleDiff diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(diff.reserve, 100); all_diff = tree.commit_mapping(0, 100, rd); - diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(0, diff.reserve); EXPECT_EQ(100, diff.commit); } - { // Adjacent reserved mappings with same flag + { // Adjacent reserved mappings with same type Tree::RegionData rd(NCS::StackIndex(), mtTest); Tree tree; VMATree::SummaryDiff all_diff = tree.reserve_mapping(0, 100, rd); - VMATree::SingleDiff diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(diff.reserve, 100); all_diff = tree.reserve_mapping(100, 100, rd); - diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(100, diff.reserve); } { // Adjacent reserved mappings with different flags @@ -318,12 +319,12 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { Tree::RegionData rd2(NCS::StackIndex(), mtNMT); Tree tree; VMATree::SummaryDiff all_diff = tree.reserve_mapping(0, 100, rd); - VMATree::SingleDiff diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(diff.reserve, 100); all_diff = tree.reserve_mapping(100, 100, rd2); - diff = all_diff.flag[NMTUtil::flag_to_index(mtTest)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; EXPECT_EQ(0, diff.reserve); - diff = all_diff.flag[NMTUtil::flag_to_index(mtNMT)]; + diff = all_diff.tag[NMTUtil::tag_to_index(mtNMT)]; EXPECT_EQ(100, diff.reserve); } @@ -334,27 +335,27 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { tree.commit_mapping(128, 128, rd); tree.commit_mapping(512, 128, rd); VMATree::SummaryDiff diff = tree.commit_mapping(0, 1024, rd); - EXPECT_EQ(768, diff.flag[NMTUtil::flag_to_index(mtTest)].commit); - EXPECT_EQ(768, diff.flag[NMTUtil::flag_to_index(mtTest)].reserve); + EXPECT_EQ(768, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(768, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); } } // Exceedingly simple tracker for page-granular allocations // Use it for testing consistency with VMATree. -struct SimpleVMATracker : public CHeapObj { + struct SimpleVMATracker : public CHeapObj { const size_t page_size = 4096; - enum Type { Reserved, Committed, Free }; + enum Kind { Reserved, Committed, Free }; struct Info { - Type type; - MEMFLAGS flag; + Kind kind; + MemTag mem_tag; NativeCallStack stack; - Info() : type(Free), flag(mtNone), stack() {} + Info() : kind(Free), mem_tag(mtNone), stack() {} - Info(Type type, NativeCallStack stack, MEMFLAGS flag) - : type(type), flag(flag), stack(stack) {} + Info(Kind kind, NativeCallStack stack, MemTag mem_tag) + : kind(kind), mem_tag(mem_tag), stack(stack) {} bool eq(Info other) { - return flag == other.flag && stack.equals(other.stack); + return kind == other.kind && stack.equals(other.stack); } }; // Page (4KiB) granular array @@ -368,7 +369,7 @@ struct SimpleVMATracker : public CHeapObj { } } - VMATree::SummaryDiff do_it(Type type, size_t start, size_t size, NativeCallStack stack, MEMFLAGS flag) { + VMATree::SummaryDiff do_it(Kind kind, size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { assert(is_aligned(size, page_size) && is_aligned(start, page_size), "page alignment"); VMATree::SummaryDiff diff; @@ -377,23 +378,23 @@ struct SimpleVMATracker : public CHeapObj { const size_t end_idx = start_idx + page_count; assert(end_idx < SimpleVMATracker::num_pages, ""); - Info new_info(type, stack, flag); + Info new_info(kind, stack, mem_tag); for (size_t i = start_idx; i < end_idx; i++) { Info& old_info = pages[i]; // Register diff - if (old_info.type == Reserved) { - diff.flag[(int)old_info.flag].reserve -= page_size; - } else if (old_info.type == Committed) { - diff.flag[(int)old_info.flag].reserve -= page_size; - diff.flag[(int)old_info.flag].commit -= page_size; + if (old_info.kind == Reserved) { + diff.tag[(int)old_info.mem_tag].reserve -= page_size; + } else if (old_info.kind == Committed) { + diff.tag[(int)old_info.mem_tag].reserve -= page_size; + diff.tag[(int)old_info.mem_tag].commit -= page_size; } - if (type == Reserved) { - diff.flag[(int)new_info.flag].reserve += page_size; - } else if(type == Committed) { - diff.flag[(int)new_info.flag].reserve += page_size; - diff.flag[(int)new_info.flag].commit += page_size; + if (kind == Reserved) { + diff.tag[(int)new_info.mem_tag].reserve += page_size; + } else if (kind == Committed) { + diff.tag[(int)new_info.mem_tag].reserve += page_size; + diff.tag[(int)new_info.mem_tag].commit += page_size; } // Overwrite old one with new pages[i] = new_info; @@ -401,12 +402,12 @@ struct SimpleVMATracker : public CHeapObj { return diff; } - VMATree::SummaryDiff reserve(size_t start, size_t size, NativeCallStack stack, MEMFLAGS flag) { - return do_it(Reserved, start, size, stack, flag); + VMATree::SummaryDiff reserve(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { + return do_it(Reserved, start, size, stack, mem_tag); } - VMATree::SummaryDiff commit(size_t start, size_t size, NativeCallStack stack, MEMFLAGS flag) { - return do_it(Committed, start, size, stack, flag); + VMATree::SummaryDiff commit(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { + return do_it(Committed, start, size, stack, mem_tag); } VMATree::SummaryDiff release(size_t start, size_t size) { @@ -423,7 +424,7 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { const size_t page_size = tr->page_size; VMATree tree; NCS ncss(true); - constexpr const int candidates_len_flags = 4; + constexpr const int candidates_len_tags = 4; constexpr const int candidates_len_stacks = 2; NativeCallStack candidate_stacks[candidates_len_stacks] = { @@ -431,7 +432,7 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { make_stack(0xB), }; - const MEMFLAGS candidate_flags[candidates_len_flags] = { + const MemTag candidate_tags[candidates_len_tags] = { mtNMT, mtTest, }; @@ -455,30 +456,30 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { const size_t start = page_start * page_size; const size_t size = num_pages * page_size; - const MEMFLAGS flag = candidate_flags[os::random() % candidates_len_flags]; + const MemTag mem_tag = candidate_tags[os::random() % candidates_len_tags]; const NativeCallStack stack = candidate_stacks[os::random() % candidates_len_stacks]; const NCS::StackIndex si = ncss.push(stack); - VMATree::RegionData data(si, flag); + VMATree::RegionData data(si, mem_tag); - const SimpleVMATracker::Type type = (SimpleVMATracker::Type)(os::random() % 3); + const SimpleVMATracker::Kind kind = (SimpleVMATracker::Kind)(os::random() % 3); VMATree::SummaryDiff tree_diff; VMATree::SummaryDiff simple_diff; - if (type == SimpleVMATracker::Reserved) { - simple_diff = tr->reserve(start, size, stack, flag); + if (kind == SimpleVMATracker::Reserved) { + simple_diff = tr->reserve(start, size, stack, mem_tag); tree_diff = tree.reserve_mapping(start, size, data); - } else if (type == SimpleVMATracker::Committed) { - simple_diff = tr->commit(start, size, stack, flag); + } else if (kind == SimpleVMATracker::Committed) { + simple_diff = tr->commit(start, size, stack, mem_tag); tree_diff = tree.commit_mapping(start, size, data); } else { simple_diff = tr->release(start, size); tree_diff = tree.release_mapping(start, size); } - for (int j = 0; j < mt_number_of_types; j++) { - VMATree::SingleDiff td = tree_diff.flag[j]; - VMATree::SingleDiff sd = simple_diff.flag[j]; + for (int j = 0; j < mt_number_of_tags; j++) { + VMATree::SingleDiff td = tree_diff.tag[j]; + VMATree::SingleDiff sd = simple_diff.tag[j]; ASSERT_EQ(td.reserve, sd.reserve); ASSERT_EQ(td.commit, sd.commit); } @@ -489,7 +490,7 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { size_t j = 0; while (j < SimpleVMATracker::num_pages) { while (j < SimpleVMATracker::num_pages && - tr->pages[j].type == SimpleVMATracker::Free) { + tr->pages[j].kind == SimpleVMATracker::Free) { j++; } @@ -520,8 +521,8 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { ASSERT_TRUE(starti.stack.equals(start_stack)); ASSERT_TRUE(endi.stack.equals(end_stack)); - ASSERT_EQ(starti.flag, startn->val().out.flag()); - ASSERT_EQ(endi.flag, endn->val().in.flag()); + ASSERT_EQ(starti.mem_tag, startn->val().out.mem_tag()); + ASSERT_EQ(endi.mem_tag, endn->val().in.mem_tag()); } } } diff --git a/test/hotspot/gtest/oops/test_compressedKlass.cpp b/test/hotspot/gtest/oops/test_compressedKlass.cpp new file mode 100644 index 0000000000000..b2fc5064581b9 --- /dev/null +++ b/test/hotspot/gtest/oops/test_compressedKlass.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. All rights reserved. + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "oops/compressedKlass.inline.hpp" +#include "utilities/globalDefinitions.hpp" + +#include "unittest.hpp" + +TEST_VM(CompressedKlass, basics) { + if (!UseCompressedClassPointers) { + return; + } + ASSERT_LE((address)0, CompressedKlassPointers::base()); + ASSERT_LE(CompressedKlassPointers::base(), CompressedKlassPointers::klass_range_start()); + ASSERT_LT(CompressedKlassPointers::klass_range_start(), CompressedKlassPointers::klass_range_end()); + ASSERT_LE(CompressedKlassPointers::klass_range_end(), CompressedKlassPointers::encoding_range_end()); + switch (CompressedKlassPointers::shift()) { + case 0: + ASSERT_EQ(CompressedKlassPointers::encoding_range_end() - CompressedKlassPointers::base(), (ptrdiff_t)(4 * G)); + break; + case 3: + ASSERT_EQ(CompressedKlassPointers::encoding_range_end() - CompressedKlassPointers::base(), (ptrdiff_t)(32 * G)); + break; + default: + ShouldNotReachHere(); + } +} + +TEST_VM(CompressedKlass, test_too_low_address) { + if (!UseCompressedClassPointers) { + return; + } + address really_low = (address) 32; + ASSERT_FALSE(CompressedKlassPointers::is_encodable(really_low)); + address low = CompressedKlassPointers::klass_range_start() - 1; + ASSERT_FALSE(CompressedKlassPointers::is_encodable(low)); +} + +TEST_VM(CompressedKlass, test_too_high_address) { + if (!UseCompressedClassPointers) { + return; + } + address really_high = (address) UINTPTR_MAX; + ASSERT_FALSE(CompressedKlassPointers::is_encodable(really_high)); + address high = CompressedKlassPointers::klass_range_end(); + ASSERT_FALSE(CompressedKlassPointers::is_encodable(high)); +} + +TEST_VM(CompressedKlass, test_good_address) { + if (!UseCompressedClassPointers) { + return; + } + address addr = CompressedKlassPointers::klass_range_start(); + ASSERT_TRUE(CompressedKlassPointers::is_encodable(addr)); + addr = CompressedKlassPointers::klass_range_end() - 1; + ASSERT_TRUE(CompressedKlassPointers::is_encodable(addr)); +} diff --git a/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp b/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp index 0f054a3bd7293..f2af6372aa49e 100644 --- a/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp +++ b/test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp @@ -75,7 +75,7 @@ class TestController : public CgroupController { char* _path; public: TestController(char* p): _path(p) {} - char* subsystem_path() override { + const char* subsystem_path() override { return _path; }; bool is_read_only() override { @@ -470,4 +470,88 @@ TEST(cgroupTest, set_cgroupv2_subsystem_path) { } } +TEST(cgroupTest, cgroupv2_is_hierarchy_walk_needed) { + bool controller_read_only = false; // value irrelevant; + CgroupV2Controller* test = new CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/" /* cgroup_path */, + controller_read_only); + EXPECT_FALSE(test->needs_hierarchy_adjustment()); + test = new CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/bar" /* cgroup_path */, + controller_read_only); + EXPECT_TRUE(test->needs_hierarchy_adjustment()); + test = new CgroupV2Controller((char*)"/sys/fs/cgroup/b", + (char*)"/a/b" /* cgroup_path */, + controller_read_only); + EXPECT_TRUE(test->needs_hierarchy_adjustment()); + + CgroupCpuController* test2 = new CgroupV2CpuController(CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/" /* cgroup_path */, + controller_read_only)); + EXPECT_FALSE(test2->needs_hierarchy_adjustment()); + test2 = new CgroupV2CpuController(CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/bar" /* cgroup_path */, + controller_read_only)); + EXPECT_TRUE(test2->needs_hierarchy_adjustment()); + test2 = new CgroupV2CpuController(CgroupV2Controller((char*)"/sys/fs/cgroup/b", + (char*)"/a/b" /* cgroup_path */, + controller_read_only)); + EXPECT_TRUE(test2->needs_hierarchy_adjustment()); + + CgroupMemoryController* test3 = new CgroupV2MemoryController(CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/" /* cgroup_path */, + controller_read_only)); + EXPECT_FALSE(test3->needs_hierarchy_adjustment()); + test3 = new CgroupV2MemoryController(CgroupV2Controller((char*)"/sys/fs/cgroup", + (char*)"/bar" /* cgroup_path */, + controller_read_only)); + EXPECT_TRUE(test3->needs_hierarchy_adjustment()); + test3 = new CgroupV2MemoryController(CgroupV2Controller((char*)"/sys/fs/cgroup/b", + (char*)"/a/b" /* cgroup_path */, + controller_read_only)); + EXPECT_TRUE(test3->needs_hierarchy_adjustment()); +} + +TEST(cgroupTest, cgroupv1_is_hierarchy_walk_needed) { + bool controller_read_only = true; // shouldn't matter; + CgroupV1Controller* test = new CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/sys/fs/cgroup/memory" /* mount_path */, + controller_read_only); + test->set_subsystem_path((char*)"/a/b/c"); + EXPECT_FALSE(test->needs_hierarchy_adjustment()); + test->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test->needs_hierarchy_adjustment()); + test = new CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/"/* mount_path */, + controller_read_only); + test->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test->needs_hierarchy_adjustment()); + + CgroupCpuController* test2 = new CgroupV1CpuController(CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/sys/fs/cgroup/memory" /* mount_path */, + controller_read_only)); + static_cast(test2)->set_subsystem_path((char*)"/a/b/c"); + EXPECT_FALSE(test2->needs_hierarchy_adjustment()); + static_cast(test2)->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test2->needs_hierarchy_adjustment()); + test2 = new CgroupV1CpuController(CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/"/* mount_path */, + controller_read_only)); + static_cast(test2)->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test2->needs_hierarchy_adjustment()); + + CgroupMemoryController* test3 = new CgroupV1MemoryController(CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/sys/fs/cgroup/memory" /* mount_path */, + controller_read_only)); + static_cast(test3)->set_subsystem_path((char*)"/a/b/c"); + EXPECT_FALSE(test3->needs_hierarchy_adjustment()); + static_cast(test3)->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test3->needs_hierarchy_adjustment()); + test3 = new CgroupV1MemoryController(CgroupV1Controller((char*)"/a/b/c" /* root */, + (char*)"/"/* mount_path */, + controller_read_only)); + static_cast(test3)->set_subsystem_path((char*)"/"); + EXPECT_TRUE(test3->needs_hierarchy_adjustment()); +} + #endif // LINUX diff --git a/test/hotspot/gtest/utilities/test_growableArray.cpp b/test/hotspot/gtest/utilities/test_growableArray.cpp index 74eb354cb2ee2..cc8d49cd6b57f 100644 --- a/test/hotspot/gtest/utilities/test_growableArray.cpp +++ b/test/hotspot/gtest/utilities/test_growableArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -35,8 +35,8 @@ struct WithEmbeddedArray { // Arena allocated data array WithEmbeddedArray(Arena* arena, int initial_max) : _a(arena, initial_max, 0, 0) {} // CHeap allocated data array - WithEmbeddedArray(int initial_max, MEMFLAGS memflags) : _a(initial_max, memflags) { - assert(memflags != mtNone, "test requirement"); + WithEmbeddedArray(int initial_max, MemTag mem_tag) : _a(initial_max, mem_tag) { + assert(mem_tag != mtNone, "test requirement"); } WithEmbeddedArray(const GrowableArray& other) : _a(other) {} }; diff --git a/test/hotspot/gtest/utilities/test_resourceHash.cpp b/test/hotspot/gtest/utilities/test_resourceHash.cpp index 9124f4b977ccf..e9834ef6e2e0e 100644 --- a/test/hotspot/gtest/utilities/test_resourceHash.cpp +++ b/test/hotspot/gtest/utilities/test_resourceHash.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "classfile/symbolTable.hpp" +#include "nmt/nmtCommon.hpp" #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "oops/symbolHandle.hpp" @@ -35,7 +36,7 @@ class CommonResourceHashtableTest : public ::testing::Test { protected: typedef void* K; typedef uintx V; - const static MEMFLAGS MEM_TYPE = mtInternal; + const static MemTag MEM_TAG = mtInternal; static unsigned identity_hash(const K& k) { return (unsigned) (uintptr_t) k; @@ -93,7 +94,7 @@ class SmallResourceHashtableTest : public CommonResourceHashtableTest { static void test(V step) { EqualityTestIter et; - ResourceHashtable rh; + ResourceHashtable rh; ASSERT_FALSE(rh.contains(as_K(step))); @@ -225,7 +226,7 @@ class GenericResourceHashtableTest : public CommonResourceHashtableTest { static void test(unsigned num_elements = SIZE) { EqualityTestIter et; - ResourceHashtable rh; + ResourceHashtable rh; for (uintptr_t i = 0; i < num_elements; ++i) { ASSERT_TRUE(rh.put(as_K(i), i)); diff --git a/test/hotspot/gtest/utilities/test_utf8.cpp b/test/hotspot/gtest/utilities/test_utf8.cpp index 80f6671207bbd..1636862f7675b 100644 --- a/test/hotspot/gtest/utilities/test_utf8.cpp +++ b/test/hotspot/gtest/utilities/test_utf8.cpp @@ -22,7 +22,7 @@ */ #include "precompiled.hpp" -#include "nmt/memflags.hpp" +#include "nmt/memTag.hpp" #include "runtime/os.hpp" #include "utilities/utf8.hpp" #include "unittest.hpp" diff --git a/test/hotspot/jtreg/ProblemList-Xcomp.txt b/test/hotspot/jtreg/ProblemList-Xcomp.txt index 9d91cad1ddeae..384374b4f76ce 100644 --- a/test/hotspot/jtreg/ProblemList-Xcomp.txt +++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt @@ -51,3 +51,5 @@ vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 829 vmTestbase/nsk/stress/thread/thread006.java 8321476 linux-all gc/arguments/TestNewSizeFlags.java 8299116 macosx-aarch64 + +runtime/condy/escapeAnalysis/TestEscapeCondy.java 8339694 generic-all diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 2086bc2ed054b..bec3f64c7d8c2 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -43,6 +43,7 @@ # :hotspot_compiler +applications/ctw/modules/java_base.java 8340683 generic-all compiler/ciReplay/TestSAServer.java 8029528 generic-all compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all @@ -115,7 +116,6 @@ runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64 runtime/StackGuardPages/TestStackGuardPagesNative.java 8303612 linux-all runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le -runtime/Thread/TestAlwaysPreTouchStacks.java 8335167 macosx-aarch64 runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8241075 linux-all,windows-x64 applications/jcstress/copy.java 8229852 linux-all @@ -136,6 +136,8 @@ serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest serviceability/jvmti/vthread/GetSetLocalTest/GetSetLocalTest.java 8286836 generic-all serviceability/jvmti/vthread/CarrierThreadEventNotification/CarrierThreadEventNotification.java 8333681 generic-all serviceability/dcmd/gc/RunFinalizationTest.java 8227120 generic-all +serviceability/dcmd/vm/SystemDumpMapTest.java 8340401 windows-all +serviceability/dcmd/vm/SystemMapTest.java 8340401 windows-all serviceability/sa/ClhsdbCDSCore.java 8267433,8318754 macosx-x64,macosx-aarch64 serviceability/sa/ClhsdbFindPC.java#xcomp-core 8267433,8318754 macosx-x64,macosx-aarch64 diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 5f4c52186a7ef..74540b6ad45dc 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -87,6 +87,7 @@ requires.properties= \ vm.musl \ vm.flagless \ docker.support \ + systemd.support \ jdk.containerized # Minimum jtreg version diff --git a/test/hotspot/jtreg/compiler/arguments/TestStressOptions.java b/test/hotspot/jtreg/compiler/arguments/TestStressOptions.java index 544f84c9b2726..ccf4822e6769b 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestStressOptions.java +++ b/test/hotspot/jtreg/compiler/arguments/TestStressOptions.java @@ -24,7 +24,7 @@ /* * @test * @key stress randomness - * @bug 8252219 8256535 8317349 + * @bug 8252219 8256535 8317349 8319879 8335334 * @requires vm.compiler2.enabled * @summary Tests that different combinations of stress options and * -XX:StressSeed=N are accepted. @@ -48,6 +48,14 @@ * compiler.arguments.TestStressOptions * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+StressMacroExpansion -XX:StressSeed=42 * compiler.arguments.TestStressOptions + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+StressIncrementalInlining + * compiler.arguments.TestStressOptions + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+StressIncrementalInlining -XX:StressSeed=42 + * compiler.arguments.TestStressOptions + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+StressUnstableIfTraps + * compiler.arguments.TestStressOptions + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+StressUnstableIfTraps -XX:StressSeed=42 + * compiler.arguments.TestStressOptions */ package compiler.arguments; diff --git a/test/hotspot/jtreg/compiler/c2/TestDivModNodes.java b/test/hotspot/jtreg/compiler/c2/TestDivModNodes.java new file mode 100644 index 0000000000000..be7cf0a383661 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestDivModNodes.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2024 Red Hat and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2; + +import compiler.lib.ir_framework.*; +import compiler.lib.ir_framework.Test; + +import java.util.Random; + +/* + * @test + * @bug 8332442 + * @summary Test that DIV and MOD nodes are converted into DIVMOD where possible + * @library /test/lib / + * @run driver compiler.c2.TestDivModNodes + */ +public class TestDivModNodes { + private static final Random RANDOM = AbstractInfo.getRandom(); + + private static int intQuotient; + private static int intRemainder; + private static long longQuotient; + private static long longRemainder; + + public static void main(String[] args) { + TestFramework.runWithFlags("-XX:-UseDivMod"); + TestFramework.runWithFlags("-XX:+UseDivMod"); + } + + private static int nextNonZeroInt() { + int i; + do { + i = RANDOM.nextInt(); + } while (i == 0); + return i; + } + + private static long nextNonZeroLong() { + long i; + do { + i = RANDOM.nextLong(); + } while (i == 0); + return i; + } + + @Test + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"x64", "true"}, + counts = {IRNode.DIV_MOD_I, "1"}, + failOn = {IRNode.DIV_I, IRNode.MOD_I}) + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"aarch64", "true"}, + counts = {IRNode.DIV_I, "1", IRNode.MUL_I, "1", IRNode.SUB_I, "1"}, + failOn = {IRNode.MOD_I}) + @IR(applyIf = {"UseDivMod", "false"}, + counts = {IRNode.DIV_I, "1", IRNode.MOD_I, "1"}) + private static void testSignedIntDivMod(int dividend, int divisor) { + intQuotient = dividend / divisor; + intRemainder = dividend % divisor; + } + + @Run(test = "testSignedIntDivMod") + private static void runSignedIntDivMod() { + int dividend = RANDOM.nextInt(); + int divisor = nextNonZeroInt(); + testSignedIntDivMod(dividend, divisor); + + verifyResult(dividend, divisor, + intQuotient, intRemainder, + dividend / divisor, dividend % divisor); + } + + + @Test + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"x64", "true"}, + counts = {IRNode.DIV_MOD_L, "1"}, + failOn = {IRNode.DIV_L, IRNode.MOD_L}) + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"aarch64", "true"}, + counts = {IRNode.DIV_L, "1", IRNode.MUL_L, "1", IRNode.SUB_L, "1"}, + failOn = {IRNode.MOD_L}) + @IR(applyIf = {"UseDivMod", "false"}, + counts = {IRNode.DIV_L, "1", IRNode.MOD_L, "1"}) + private static void testSignedLongDivMod(long dividend, long divisor) { + longQuotient = dividend / divisor; + longRemainder = dividend % divisor; + } + + @Run(test = "testSignedLongDivMod") + private static void runSignedLongDivMod() { + long dividend = RANDOM.nextLong(); + long divisor = nextNonZeroLong(); + testSignedLongDivMod(dividend, divisor); + + verifyResult(dividend, divisor, + longQuotient, longRemainder, + dividend / divisor, dividend % divisor); + } + + @Test + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"x64", "true"}, + counts = {IRNode.UDIV_MOD_I, "1"}, + failOn = {IRNode.UDIV_I, IRNode.UMOD_I}) + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"aarch64", "true"}, + counts = {IRNode.UDIV_I, "1", IRNode.MUL_I, "1", IRNode.SUB_I, "1"}, + failOn = {IRNode.UMOD_I}) + @IR(applyIf = {"UseDivMod", "false"}, + counts = {IRNode.UDIV_I, "1", IRNode.UMOD_I, "1"}) + private static void testUnsignedIntDivMod(int dividend, int divisor) { + intQuotient = Integer.divideUnsigned(dividend, divisor); // intrinsified on x86 + intRemainder = Integer.remainderUnsigned(dividend, divisor); // intrinsified on x86 + } + + @Run(test = "testUnsignedIntDivMod") + private static void runUnsignedIntDivMod() { + int dividend = RANDOM.nextInt(); + int divisor = nextNonZeroInt(); + testUnsignedIntDivMod(dividend, divisor); + + verifyResult(dividend, divisor, + intQuotient, intRemainder, + Integer.divideUnsigned(dividend, divisor), Integer.remainderUnsigned(dividend, divisor)); + } + + @Test + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"x64", "true"}, + counts = {IRNode.UDIV_MOD_L, "1"}, + failOn = {IRNode.UDIV_L, IRNode.UMOD_L}) + @IR(applyIf = {"UseDivMod", "true"}, applyIfPlatform = {"aarch64", "true"}, + counts = {IRNode.UDIV_L, "1", IRNode.MUL_L, "1", IRNode.SUB_L, "1"}, + failOn = {IRNode.MOD_L}) + @IR(applyIf = {"UseDivMod", "false"}, + counts = {IRNode.UDIV_L, "1", IRNode.UMOD_L, "1"}) + private static void testUnsignedLongDivMod(long dividend, long divisor) { + longQuotient = Long.divideUnsigned(dividend, divisor); // intrinsified on x86 + longRemainder = Long.remainderUnsigned(dividend, divisor); // intrinsified on x86 + } + + @Run(test = "testUnsignedLongDivMod") + private static void runUnsignedLongDivMod() { + long dividend = RANDOM.nextLong(); + long divisor = nextNonZeroLong(); + testUnsignedLongDivMod(dividend, divisor); + + verifyResult(dividend, divisor, + longQuotient, longRemainder, + Long.divideUnsigned(dividend, divisor), Long.remainderUnsigned(dividend, divisor)); + } + + private static void verifyResult(T dividend, T divisor, + T quotient, T remainder, + T expectedQ, T expectedR) { + if (!expectedQ.equals(quotient) || !expectedR.equals(remainder)) { + throw new AssertionError(String.format("Mismatched result from %d / %d. " + + "Expected: quotient = %d remainder = %d, " + + "but got: quotient = %d remainder = %d", + dividend, divisor, expectedQ, expectedR, quotient, remainder)); + } + } +} diff --git a/test/hotspot/jtreg/compiler/c2/irTests/AndINodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/AndINodeIdealizationTests.java index f20c28e321db1..1e90c22ddabc3 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/AndINodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/AndINodeIdealizationTests.java @@ -27,7 +27,8 @@ /* * @test - * @bug 8297384 + * @bug 8297384 8335444 + * @key randomness * @summary Test that Ideal transformations of AndINode* are being performed as expected. * @library /test/lib / * @run driver compiler.c2.irTests.AndINodeIdealizationTests @@ -38,7 +39,7 @@ public static void main(String[] args) { TestFramework.run(); } - @Run(test = { "test1", "test2" }) + @Run(test = { "test1", "test2", "test3", "test4", "test5", "test6", "test7", "test8", "test9", "test10" }) public void runMethod() { int a = RunInfo.getRandom().nextInt(); int b = RunInfo.getRandom().nextInt(); @@ -47,7 +48,12 @@ public void runMethod() { int max = Integer.MAX_VALUE; assertResult(0, 0); + assertResult(10, 20); + assertResult(10, -20); + assertResult(-10, 20); + assertResult(-10, -20); assertResult(a, b); + assertResult(b, a); assertResult(min, min); assertResult(max, max); } @@ -56,6 +62,14 @@ public void runMethod() { public void assertResult(int a, int b) { Asserts.assertEQ((0 - a) & 1, test1(a)); Asserts.assertEQ((~a) & (~b), test2(a, b)); + Asserts.assertEQ((a & 15) >= 0, test3(a, b)); + Asserts.assertEQ((a & 15) > 15, test4(a, b)); + Asserts.assertEQ((a & (b >>> 1)) >= 0, test5(a, b)); + Asserts.assertEQ((a & (b >>> 30)) > 3, test6(a, b)); + Asserts.assertEQ(((byte)a & -8) >= -128, test7(a, b)); + Asserts.assertEQ(((byte)a & -8) <= 127, test8(a, b)); + Asserts.assertEQ(((a & 255) & (char)b) > 255, test9(a, b)); + Asserts.assertEQ((((a & 1) - 3) & ((b & 2) - 10)) > -8, test10(a, b)); } @Test @@ -74,4 +88,60 @@ public int test1(int x) { public int test2(int a, int b) { return (~a) & (~b); } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & 15 => [0, 15] + public boolean test3(int a, int b) { + return (a & 15) >= 0; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & 15 => [0, 15] + public boolean test4(int a, int b) { + return (a & 15) > 15; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & [0, int_max] => [0, int_max] + public boolean test5(int a, int b) { + return (a & (b >>> 1)) >= 0; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & [0, 3] => [0, 3] + public boolean test6(int a, int b) { + return (a & (b >>> 30)) > 3; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks [-128, 127] & -8 => [-128, 127] + public boolean test7(int a, int b) { + return ((byte)a & -8) >= -128; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks [-128, 127] & -8 => [-128, 127] + public boolean test8(int a, int b) { + return ((byte)a & -8) <= 127; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks that [0, 255] & [0, 65535] => [0, 255] + public boolean test9(int a, int b) { + return ((a & 255) & (char)b) > 255; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks that [-3, -2] & [-10, -8] => [-16, -8] + public boolean test10(int a, int b) { + return (((a & 1) - 3) & ((b & 2) - 10)) > -8; + } } diff --git a/test/hotspot/jtreg/compiler/c2/irTests/AndLNodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/AndLNodeIdealizationTests.java index 9aa1b62be9743..a32172b20153a 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/AndLNodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/AndLNodeIdealizationTests.java @@ -27,7 +27,8 @@ /* * @test - * @bug 8322589 + * @bug 8322589 8335444 + * @key randomness * @summary Test that Ideal transformations of AndLNode* are being performed as expected. * @library /test/lib / * @run driver compiler.c2.irTests.AndLNodeIdealizationTests @@ -38,7 +39,7 @@ public static void main(String[] args) { TestFramework.run(); } - @Run(test = { "test1" }) + @Run(test = { "test1", "test2", "test3", "test4", "test5", "test6", "test7", "test8", "test9" }) public void runMethod() { long a = RunInfo.getRandom().nextLong(); long b = RunInfo.getRandom().nextLong(); @@ -47,7 +48,12 @@ public void runMethod() { long max = Long.MAX_VALUE; assertResult(0, 0); + assertResult(10, 20); + assertResult(10, -20); + assertResult(-10, 20); + assertResult(-10, -20); assertResult(a, b); + assertResult(b, a); assertResult(min, min); assertResult(max, max); } @@ -55,6 +61,14 @@ public void runMethod() { @DontCompile public void assertResult(long a, long b) { Asserts.assertEQ((~a) & (~b), test1(a, b)); + Asserts.assertEQ((a & 15) >= 0, test2(a, b)); + Asserts.assertEQ((a & 15) > 15, test3(a, b)); + Asserts.assertEQ((a & (b >>> 1)) >= 0, test4(a, b)); + Asserts.assertEQ((a & (b >>> 62)) > 3, test5(a, b)); + Asserts.assertEQ(((byte)a & -8L) >= -128, test6(a, b)); + Asserts.assertEQ(((byte)a & -8L) <= 127, test7(a, b)); + Asserts.assertEQ(((a & 255) & (char)b) > 255, test8(a, b)); + Asserts.assertEQ((((a & 1) - 3) & ((b & 2) - 10)) > -8, test9(a, b)); } @Test @@ -65,4 +79,60 @@ public void assertResult(long a, long b) { public long test1(long a, long b) { return (~a) & (~b); } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & 15 => [0, 15] + public boolean test2(long a, long b) { + return (a & 15) >= 0; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & 15 => [0, 15] + public boolean test3(long a, long b) { + return (a & 15) > 15; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & [0, long_max] => [0, long_max] + public boolean test4(long a, long b) { + return (a & (b >>> 1)) >= 0; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks a & [0, 3] => [0, 3] + public boolean test5(long a, long b) { + return (a & (b >>> 62)) > 3; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks [-128, 127] & -8 => [-128, 127] + public boolean test6(long a, long b) { + return ((byte)a & -8L) >= -128; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks [-128, 127] & -8 => [-128, 127] + public boolean test7(long a, long b) { + return ((byte)a & -8L) <= 127; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks that [0, 255] & [0, 65535] => [0, 255] + public boolean test8(long a, long b) { + return ((a & 255) & (char)b) > 255; + } + + @Test + @IR(failOn = { IRNode.AND }) + // Checks that [-3, -2] & [-10, -8] => [-16, -8] + public boolean test9(long a, long b) { + return (((a & 1) - 3) & ((b & 2) - 10)) > -8; + } } diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestPrunedExHandler.java b/test/hotspot/jtreg/compiler/c2/irTests/TestPrunedExHandler.java index 9b91375acb73e..b5a27f3f714b3 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestPrunedExHandler.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestPrunedExHandler.java @@ -29,6 +29,7 @@ * @test * @bug 8267532 * @summary check that uncommon trap is generated for unhandled catch block + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @library /test/lib / * @requires vm.opt.DeoptimizeALot != true * @run driver compiler.c2.irTests.TestPrunedExHandler diff --git a/test/hotspot/jtreg/compiler/calls/TestManyArgs.java b/test/hotspot/jtreg/compiler/calls/TestManyArgs.java new file mode 100644 index 0000000000000..fbd9c13d7c9b7 --- /dev/null +++ b/test/hotspot/jtreg/compiler/calls/TestManyArgs.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @summary Pass values on stack. + * @requires os.arch == "riscv64" + * @run main/native compiler.calls.TestManyArgs + */ + +package compiler.calls; + +public class TestManyArgs { + static { + System.loadLibrary("TestManyArgs"); + } + + native static void scramblestack(); + + native static int checkargs(int arg0, short arg1, byte arg2, + int arg3, short arg4, byte arg5, + int arg6, short arg7, byte arg8, + int arg9, short arg10, byte arg11); + + static int compiledbridge(int arg0, short arg1, byte arg2, + int arg3, short arg4, byte arg5, + int arg6, short arg7, byte arg8, + int arg9, short arg10, byte arg11) { + return checkargs(arg0, arg1, arg2, arg3, arg4, arg5, + arg6, arg7, arg8, arg9, arg10, arg11); + } + + static public void main(String[] args) { + scramblestack(); + for (int i = 0; i < 20000; i++) { + int res = compiledbridge((int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf, + (int)0xf, (short)0xf, (byte)0xf); + if (res != 0) { + throw new RuntimeException("Test failed"); + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c b/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c new file mode 100644 index 0000000000000..8836c79e43ea1 --- /dev/null +++ b/test/hotspot/jtreg/compiler/calls/libTestManyArgs.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "jni.h" + +#ifdef riscv64 +/* RV64 ABI pass all integers as 64-bit, in registers or on stack + * As compiler may choose to load smaller width than 64-bit if passed on stack, + * this test may not find any bugs. + * Therefore we trick the compiler todo 64-bit loads, + * by saying these args are jlongs. + */ +JNIEXPORT jint JNICALL Java_compiler_calls_TestManyArgs_checkargs(JNIEnv* env, jclass jclazz, + jlong arg0, jlong arg1, jlong arg2, + jlong arg3, jlong arg4, jlong arg5, + jlong arg6, jlong arg7, jlong arg8, + jlong arg9, jlong arg10, jlong arg11) +#else +JNIEXPORT jint JNICALL Java_compiler_calls_TestManyArgs_checkargs(JNIEnv* env, jclass jclazz, + jint arg0, jshort arg1, jbyte arg2, + jint arg3, jshort arg4, jbyte arg5, + jint arg6, jshort arg7, jbyte arg8, + jint arg9, jshort arg10, jbyte arg11) +#endif +{ + if (arg0 != 0xf) return 1; + if (arg1 != 0xf) return 1; + if (arg2 != 0xf) return 1; + if (arg3 != 0xf) return 1; + if (arg4 != 0xf) return 1; + if (arg5 != 0xf) return 1; + if (arg6 != 0xf) return 1; + if (arg7 != 0xf) return 1; + if (arg8 != 0xf) return 1; + if (arg9 != 0xf) return 1; + if (arg10 != 0xf) return 1; + if (arg11 != 0xf) return 1; + return 0; +} + +JNIEXPORT +void JNICALL Java_compiler_calls_TestManyArgs_scramblestack(JNIEnv* env, jclass jclazz) +{ + volatile char stack[12*8]; + for (unsigned int i = 0; i < sizeof(stack); i++) { + stack[i] = (char)0xff; + } +} diff --git a/test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java b/test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java index 068da4100bd69..87ce9a313a8b8 100644 --- a/test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java +++ b/test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java @@ -24,6 +24,7 @@ /* * @test * @requires !vm.graal.enabled + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * java.base/jdk.internal.vm.annotation diff --git a/test/hotspot/jtreg/compiler/cha/TypeProfileFinalMethod.java b/test/hotspot/jtreg/compiler/cha/TypeProfileFinalMethod.java new file mode 100644 index 0000000000000..a81ba53af52c7 --- /dev/null +++ b/test/hotspot/jtreg/compiler/cha/TypeProfileFinalMethod.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary test c1 to record type profile with CHA optimization + * @requires vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4) + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run driver compiler.cha.TypeProfileFinalMethod + */ +package compiler.cha; + +import java.io.File; +import java.util.regex.Pattern; +import java.util.regex.Matcher; +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.whitebox.WhiteBox; + +public class TypeProfileFinalMethod { + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-Xbootclasspath/a:.", + "-Xbatch", "-XX:-UseOnStackReplacement", + "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", + "-XX:Tier3InvocationThreshold=200", "-XX:Tier4InvocationThreshold=5000", + Launcher.class.getName()); + OutputAnalyzer output = ProcessTools.executeProcess(pb); + System.out.println("debug output"); + System.out.println(output.getOutput()); + System.out.println("debug output end"); + output.shouldHaveExitValue(0); + output.shouldNotContain("failed to inline: virtual call"); + Pattern pattern = Pattern.compile("Child1::m.* inline "); + Matcher matcher = pattern.matcher(output.getOutput()); + int matchCnt = 0; + while (matcher.find()) { + matchCnt++; + } + Asserts.assertEquals(matchCnt, 2); // inline Child1::m() twice + } + + static class Launcher { + public static void main(String[] args) throws Exception { + addCompilerDirectives(); + int cnt = 5300; + // warmup test1 to be compiled with c1 and c2 + // and only compile test2 with c1 + for (int i = 0; i < cnt; i++) { + test1(i); + } + for (int i = 0; i < cnt; i++) { + test2(i); + } + Parent c = new TypeProfileFinalMethod.Child2(); + System.out.println("======== break CHA"); + // trigger c2 to compile test2 + for (int i = 0; i < 100; i++) { + test2(i); + } + } + + static void addCompilerDirectives() { + WhiteBox WB = WhiteBox.getWhiteBox(); + // do not inline getInstance() for test1() and test2() + String directive = "[{ match: [\"" + Launcher.class.getName() + "::test1\"]," + + "inline:[\"-" + Launcher.class.getName()+"::getInstance()\"] }]"; + WB.addCompilerDirective(directive); + + directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," + + "inline:[\"-" + Launcher.class.getName()+"::getInstance()\"] }]"; + WB.addCompilerDirective(directive); + + // do not inline test1() for test2() in c1 compilation + directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," + + "c1: { inline:[\"-" + Launcher.class.getName()+"::test1()\"] } }]"; + WB.addCompilerDirective(directive); + + // print inline tree for checking + directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," + + "c2: { PrintInlining: true } }]"; + WB.addCompilerDirective(directive); + } + + static int test1(int i) { + int ret = 0; + Parent ix = getInstance(); + if (i<200) { + return ix.m(); + } + for (int j = 0; j < 50; j++) { + ret += ix.m(); // the callsite we are interesting + } + return ret; + } + + static int test2(int i) { + return test1(i); + } + + static Parent getInstance() { + return new TypeProfileFinalMethod.Child1(); + } + } + + static abstract class Parent { + abstract public int m(); + } + + final static class Child1 extends Parent { + public int m() { + return 1; + } + } + + final static class Child2 extends Parent { + public int m() { + return 2; + } + } +} + + diff --git a/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage.java b/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage.java new file mode 100644 index 0000000000000..b8db6581b611c --- /dev/null +++ b/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage.java @@ -0,0 +1,2443 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8333258 + * @summary C2: high memory usage in PhaseCFG::insert_anti_dependences() + * @run main/othervm -XX:CompileOnly=TestAntiDependenciesHighMemUsage::test1 -Xcomp TestAntiDependenciesHighMemUsage + */ + +public class TestAntiDependenciesHighMemUsage { + + public static void main(String[] args) { + test1(0); + } + + private static int test1(int i) { + int v = field0000 + + field0001 + + field0002 + + field0003 + + field0004 + + field0005 + + field0006 + + field0007 + + field0008 + + field0009 + + field0010 + + field0011 + + field0012 + + field0013 + + field0014 + + field0015 + + field0016 + + field0017 + + field0018 + + field0019 + + field0020 + + field0021 + + field0022 + + field0023 + + field0024 + + field0025 + + field0026 + + field0027 + + field0028 + + field0029 + + field0030 + + field0031 + + field0032 + + field0033 + + field0034 + + field0035 + + field0036 + + field0037 + + field0038 + + field0039 + + field0040 + + field0041 + + field0042 + + field0043 + + field0044 + + field0045 + + field0046 + + field0047 + + field0048 + + field0049 + + field0050 + + field0051 + + field0052 + + field0053 + + field0054 + + field0055 + + field0056 + + field0057 + + field0058 + + field0059; + + switch (i) { + case -2140710406: + field0000 = 42; + field0001 = 42; + field0002 = 42; + field0003 = 42; + field0004 = 42; + field0005 = 42; + field0006 = 42; + field0007 = 42; + field0008 = 42; + field0009 = 42; + field0010 = 42; + field0011 = 42; + field0012 = 42; + field0013 = 42; + field0014 = 42; + field0015 = 42; + field0016 = 42; + field0017 = 42; + field0018 = 42; + field0019 = 42; + field0020 = 42; + field0021 = 42; + field0022 = 42; + field0023 = 42; + field0024 = 42; + field0025 = 42; + field0026 = 42; + field0027 = 42; + field0028 = 42; + field0029 = 42; + field0030 = 42; + field0031 = 42; + field0032 = 42; + field0033 = 42; + field0034 = 42; + field0035 = 42; + field0036 = 42; + field0037 = 42; + field0038 = 42; + field0039 = 42; + field0040 = 42; + field0041 = 42; + field0042 = 42; + field0043 = 42; + field0044 = 42; + field0045 = 42; + field0046 = 42; + field0047 = 42; + field0048 = 42; + field0049 = 42; + field0050 = 42; + field0051 = 42; + field0052 = 42; + field0053 = 42; + field0054 = 42; + field0055 = 42; + field0056 = 42; + field0057 = 42; + field0058 = 42; + field0059 = 42; + field0060 = 42; + field0061 = 42; + field0062 = 42; + field0063 = 42; + field0064 = 42; + field0065 = 42; + field0066 = 42; + field0067 = 42; + field0068 = 42; + field0069 = 42; + field0070 = 42; + field0071 = 42; + field0072 = 42; + field0073 = 42; + field0074 = 42; + field0075 = 42; + field0076 = 42; + field0077 = 42; + field0078 = 42; + field0079 = 42; + field0080 = 42; + field0081 = 42; + field0082 = 42; + field0083 = 42; + field0084 = 42; + field0085 = 42; + field0086 = 42; + field0087 = 42; + field0088 = 42; + field0089 = 42; + field0090 = 42; + field0091 = 42; + field0092 = 42; + field0093 = 42; + field0094 = 42; + field0095 = 42; + field0096 = 42; + field0097 = 42; + field0098 = 42; + field0099 = 42; + field0100 = 42; + field0101 = 42; + field0102 = 42; + field0103 = 42; + field0104 = 42; + field0105 = 42; + field0106 = 42; + field0107 = 42; + field0108 = 42; + field0109 = 42; + field0110 = 42; + field0111 = 42; + field0112 = 42; + field0113 = 42; + field0114 = 42; + field0115 = 42; + field0116 = 42; + field0117 = 42; + field0118 = 42; + field0119 = 42; + field0120 = 42; + field0121 = 42; + field0122 = 42; + field0123 = 42; + field0124 = 42; + field0125 = 42; + field0126 = 42; + field0127 = 42; + field0128 = 42; + field0129 = 42; + field0130 = 42; + field0131 = 42; + field0132 = 42; + field0133 = 42; + field0134 = 42; + field0135 = 42; + field0136 = 42; + field0137 = 42; + field0138 = 42; + field0139 = 42; + field0140 = 42; + field0141 = 42; + field0142 = 42; + field0143 = 42; + field0144 = 42; + field0145 = 42; + field0146 = 42; + field0147 = 42; + field0148 = 42; + field0149 = 42; + field0150 = 42; + field0151 = 42; + field0152 = 42; + field0153 = 42; + field0154 = 42; + field0155 = 42; + field0156 = 42; + field0157 = 42; + field0158 = 42; + field0159 = 42; + field0160 = 42; + field0161 = 42; + field0162 = 42; + field0163 = 42; + field0164 = 42; + field0165 = 42; + field0166 = 42; + field0167 = 42; + field0168 = 42; + field0169 = 42; + field0170 = 42; + field0171 = 42; + field0172 = 42; + field0173 = 42; + field0174 = 42; + field0175 = 42; + field0176 = 42; + field0177 = 42; + field0178 = 42; + field0179 = 42; + field0180 = 42; + field0181 = 42; + field0182 = 42; + field0183 = 42; + field0184 = 42; + field0185 = 42; + field0186 = 42; + field0187 = 42; + field0188 = 42; + field0189 = 42; + field0190 = 42; + field0191 = 42; + field0192 = 42; + field0193 = 42; + field0194 = 42; + field0195 = 42; + field0196 = 42; + field0197 = 42; + field0198 = 42; + field0199 = 42; + field0200 = 42; + field0201 = 42; + field0202 = 42; + field0203 = 42; + field0204 = 42; + field0205 = 42; + field0206 = 42; + field0207 = 42; + field0208 = 42; + field0209 = 42; + field0210 = 42; + field0211 = 42; + field0212 = 42; + field0213 = 42; + field0214 = 42; + field0215 = 42; + field0216 = 42; + field0217 = 42; + field0218 = 42; + field0219 = 42; + field0220 = 42; + field0221 = 42; + field0222 = 42; + field0223 = 42; + field0224 = 42; + field0225 = 42; + field0226 = 42; + field0227 = 42; + field0228 = 42; + field0229 = 42; + field0230 = 42; + field0231 = 42; + field0232 = 42; + field0233 = 42; + field0234 = 42; + field0235 = 42; + field0236 = 42; + field0237 = 42; + field0238 = 42; + field0239 = 42; + field0240 = 42; + field0241 = 42; + field0242 = 42; + field0243 = 42; + field0244 = 42; + field0245 = 42; + field0246 = 42; + field0247 = 42; + field0248 = 42; + field0249 = 42; + field0250 = 42; + field0251 = 42; + field0252 = 42; + field0253 = 42; + field0254 = 42; + field0255 = 42; + field0256 = 42; + field0257 = 42; + field0258 = 42; + field0259 = 42; + field0260 = 42; + field0261 = 42; + field0262 = 42; + field0263 = 42; + field0264 = 42; + field0265 = 42; + field0266 = 42; + field0267 = 42; + field0268 = 42; + field0269 = 42; + field0270 = 42; + field0271 = 42; + field0272 = 42; + field0273 = 42; + field0274 = 42; + field0275 = 42; + field0276 = 42; + field0277 = 42; + field0278 = 42; + field0279 = 42; + field0280 = 42; + field0281 = 42; + field0282 = 42; + field0283 = 42; + field0284 = 42; + field0285 = 42; + field0286 = 42; + field0287 = 42; + field0288 = 42; + field0289 = 42; + field0290 = 42; + field0291 = 42; + field0292 = 42; + field0293 = 42; + field0294 = 42; + field0295 = 42; + field0296 = 42; + field0297 = 42; + field0298 = 42; + field0299 = 42; + field0300 = 42; + field0301 = 42; + field0302 = 42; + field0303 = 42; + field0304 = 42; + field0305 = 42; + field0306 = 42; + field0307 = 42; + field0308 = 42; + field0309 = 42; + field0310 = 42; + field0311 = 42; + field0312 = 42; + field0313 = 42; + field0314 = 42; + field0315 = 42; + field0316 = 42; + field0317 = 42; + field0318 = 42; + field0319 = 42; + field0320 = 42; + field0321 = 42; + field0322 = 42; + field0323 = 42; + field0324 = 42; + field0325 = 42; + field0326 = 42; + field0327 = 42; + field0328 = 42; + field0329 = 42; + field0330 = 42; + field0331 = 42; + field0332 = 42; + field0333 = 42; + field0334 = 42; + field0335 = 42; + field0336 = 42; + field0337 = 42; + field0338 = 42; + field0339 = 42; + field0340 = 42; + field0341 = 42; + field0342 = 42; + field0343 = 42; + field0344 = 42; + field0345 = 42; + field0346 = 42; + field0347 = 42; + field0348 = 42; + field0349 = 42; + field0350 = 42; + field0351 = 42; + field0352 = 42; + field0353 = 42; + field0354 = 42; + field0355 = 42; + field0356 = 42; + field0357 = 42; + field0358 = 42; + field0359 = 42; + field0360 = 42; + field0361 = 42; + field0362 = 42; + field0363 = 42; + field0364 = 42; + field0365 = 42; + field0366 = 42; + field0367 = 42; + field0368 = 42; + field0369 = 42; + field0370 = 42; + field0371 = 42; + field0372 = 42; + field0373 = 42; + field0374 = 42; + field0375 = 42; + field0376 = 42; + field0377 = 42; + field0378 = 42; + field0379 = 42; + field0380 = 42; + field0381 = 42; + field0382 = 42; + field0383 = 42; + field0384 = 42; + field0385 = 42; + field0386 = 42; + field0387 = 42; + field0388 = 42; + field0389 = 42; + field0390 = 42; + field0391 = 42; + field0392 = 42; + field0393 = 42; + field0394 = 42; + field0395 = 42; + field0396 = 42; + field0397 = 42; + field0398 = 42; + field0399 = 42; + field0400 = 42; + field0401 = 42; + field0402 = 42; + field0403 = 42; + field0404 = 42; + field0405 = 42; + field0406 = 42; + field0407 = 42; + field0408 = 42; + field0409 = 42; + field0410 = 42; + field0411 = 42; + field0412 = 42; + field0413 = 42; + field0414 = 42; + field0415 = 42; + field0416 = 42; + field0417 = 42; + field0418 = 42; + field0419 = 42; + field0420 = 42; + field0421 = 42; + field0422 = 42; + field0423 = 42; + field0424 = 42; + field0425 = 42; + field0426 = 42; + field0427 = 42; + field0428 = 42; + field0429 = 42; + field0430 = 42; + field0431 = 42; + field0432 = 42; + field0433 = 42; + field0434 = 42; + field0435 = 42; + field0436 = 42; + field0437 = 42; + field0438 = 42; + field0439 = 42; + field0440 = 42; + field0441 = 42; + field0442 = 42; + field0443 = 42; + field0444 = 42; + field0445 = 42; + field0446 = 42; + field0447 = 42; + field0448 = 42; + field0449 = 42; + field0450 = 42; + field0451 = 42; + field0452 = 42; + field0453 = 42; + field0454 = 42; + field0455 = 42; + field0456 = 42; + field0457 = 42; + field0458 = 42; + field0459 = 42; + field0460 = 42; + field0461 = 42; + field0462 = 42; + field0463 = 42; + field0464 = 42; + field0465 = 42; + field0466 = 42; + field0467 = 42; + field0468 = 42; + field0469 = 42; + field0470 = 42; + field0471 = 42; + field0472 = 42; + field0473 = 42; + field0474 = 42; + field0475 = 42; + field0476 = 42; + field0477 = 42; + field0478 = 42; + field0479 = 42; + field0480 = 42; + field0481 = 42; + field0482 = 42; + field0483 = 42; + field0484 = 42; + field0485 = 42; + field0486 = 42; + field0487 = 42; + field0488 = 42; + field0489 = 42; + field0490 = 42; + field0491 = 42; + field0492 = 42; + field0493 = 42; + field0494 = 42; + field0495 = 42; + field0496 = 42; + field0497 = 42; + field0498 = 42; + field0499 = 42; + field0500 = 42; + field0501 = 42; + field0502 = 42; + field0503 = 42; + field0504 = 42; + field0505 = 42; + field0506 = 42; + field0507 = 42; + field0508 = 42; + field0509 = 42; + field0510 = 42; + field0511 = 42; + field0512 = 42; + field0513 = 42; + field0514 = 42; + field0515 = 42; + field0516 = 42; + field0517 = 42; + field0518 = 42; + field0519 = 42; + field0520 = 42; + field0521 = 42; + field0522 = 42; + field0523 = 42; + field0524 = 42; + field0525 = 42; + field0526 = 42; + field0527 = 42; + field0528 = 42; + field0529 = 42; + field0530 = 42; + field0531 = 42; + field0532 = 42; + field0533 = 42; + field0534 = 42; + field0535 = 42; + field0536 = 42; + field0537 = 42; + field0538 = 42; + field0539 = 42; + field0540 = 42; + field0541 = 42; + field0542 = 42; + field0543 = 42; + field0544 = 42; + field0545 = 42; + field0546 = 42; + field0547 = 42; + field0548 = 42; + field0549 = 42; + field0550 = 42; + field0551 = 42; + field0552 = 42; + field0553 = 42; + field0554 = 42; + field0555 = 42; + field0556 = 42; + field0557 = 42; + field0558 = 42; + field0559 = 42; + field0560 = 42; + field0561 = 42; + field0562 = 42; + field0563 = 42; + field0564 = 42; + field0565 = 42; + field0566 = 42; + field0567 = 42; + field0568 = 42; + field0569 = 42; + field0570 = 42; + field0571 = 42; + field0572 = 42; + field0573 = 42; + field0574 = 42; + field0575 = 42; + field0576 = 42; + field0577 = 42; + field0578 = 42; + field0579 = 42; + field0580 = 42; + field0581 = 42; + field0582 = 42; + field0583 = 42; + field0584 = 42; + field0585 = 42; + field0586 = 42; + field0587 = 42; + field0588 = 42; + field0589 = 42; + field0590 = 42; + field0591 = 42; + field0592 = 42; + field0593 = 42; + field0594 = 42; + field0595 = 42; + field0596 = 42; + field0597 = 42; + field0598 = 42; + field0599 = 42; + field0600 = 42; + field0601 = 42; + field0602 = 42; + field0603 = 42; + field0604 = 42; + field0605 = 42; + field0606 = 42; + field0607 = 42; + field0608 = 42; + field0609 = 42; + field0610 = 42; + field0611 = 42; + field0612 = 42; + field0613 = 42; + field0614 = 42; + field0615 = 42; + field0616 = 42; + field0617 = 42; + field0618 = 42; + field0619 = 42; + field0620 = 42; + field0621 = 42; + field0622 = 42; + field0623 = 42; + field0624 = 42; + field0625 = 42; + field0626 = 42; + field0627 = 42; + field0628 = 42; + field0629 = 42; + field0630 = 42; + field0631 = 42; + field0632 = 42; + field0633 = 42; + field0634 = 42; + field0635 = 42; + field0636 = 42; + field0637 = 42; + field0638 = 42; + field0639 = 42; + field0640 = 42; + field0641 = 42; + field0642 = 42; + field0643 = 42; + field0644 = 42; + field0645 = 42; + field0646 = 42; + field0647 = 42; + field0648 = 42; + field0649 = 42; + field0650 = 42; + field0651 = 42; + field0652 = 42; + field0653 = 42; + field0654 = 42; + field0655 = 42; + field0656 = 42; + field0657 = 42; + field0658 = 42; + field0659 = 42; + field0660 = 42; + field0661 = 42; + field0662 = 42; + field0663 = 42; + field0664 = 42; + field0665 = 42; + field0666 = 42; + field0667 = 42; + field0668 = 42; + field0669 = 42; + field0670 = 42; + field0671 = 42; + field0672 = 42; + field0673 = 42; + field0674 = 42; + field0675 = 42; + field0676 = 42; + field0677 = 42; + field0678 = 42; + field0679 = 42; + field0680 = 42; + field0681 = 42; + field0682 = 42; + field0683 = 42; + field0684 = 42; + field0685 = 42; + field0686 = 42; + field0687 = 42; + field0688 = 42; + field0689 = 42; + field0690 = 42; + field0691 = 42; + field0692 = 42; + field0693 = 42; + field0694 = 42; + field0695 = 42; + field0696 = 42; + field0697 = 42; + field0698 = 42; + field0699 = 42; + field0700 = 42; + field0701 = 42; + field0702 = 42; + field0703 = 42; + field0704 = 42; + field0705 = 42; + field0706 = 42; + field0707 = 42; + field0708 = 42; + field0709 = 42; + field0710 = 42; + field0711 = 42; + field0712 = 42; + field0713 = 42; + field0714 = 42; + field0715 = 42; + field0716 = 42; + field0717 = 42; + field0718 = 42; + field0719 = 42; + field0720 = 42; + field0721 = 42; + field0722 = 42; + field0723 = 42; + field0724 = 42; + field0725 = 42; + field0726 = 42; + field0727 = 42; + field0728 = 42; + field0729 = 42; + field0730 = 42; + field0731 = 42; + field0732 = 42; + field0733 = 42; + field0734 = 42; + field0735 = 42; + field0736 = 42; + field0737 = 42; + field0738 = 42; + field0739 = 42; + field0740 = 42; + field0741 = 42; + field0742 = 42; + field0743 = 42; + field0744 = 42; + field0745 = 42; + field0746 = 42; + field0747 = 42; + field0748 = 42; + field0749 = 42; + field0750 = 42; + field0751 = 42; + field0752 = 42; + field0753 = 42; + field0754 = 42; + field0755 = 42; + field0756 = 42; + field0757 = 42; + field0758 = 42; + field0759 = 42; + field0760 = 42; + field0761 = 42; + field0762 = 42; + field0763 = 42; + field0764 = 42; + field0765 = 42; + field0766 = 42; + field0767 = 42; + field0768 = 42; + field0769 = 42; + field0770 = 42; + field0771 = 42; + field0772 = 42; + field0773 = 42; + field0774 = 42; + field0775 = 42; + field0776 = 42; + field0777 = 42; + field0778 = 42; + field0779 = 42; + field0780 = 42; + field0781 = 42; + field0782 = 42; + field0783 = 42; + field0784 = 42; + field0785 = 42; + field0786 = 42; + field0787 = 42; + field0788 = 42; + field0789 = 42; + field0790 = 42; + field0791 = 42; + field0792 = 42; + field0793 = 42; + field0794 = 42; + field0795 = 42; + field0796 = 42; + field0797 = 42; + field0798 = 42; + field0799 = 42; + field0800 = 42; + field0801 = 42; + field0802 = 42; + field0803 = 42; + field0804 = 42; + field0805 = 42; + field0806 = 42; + field0807 = 42; + field0808 = 42; + field0809 = 42; + field0810 = 42; + field0811 = 42; + field0812 = 42; + field0813 = 42; + field0814 = 42; + field0815 = 42; + field0816 = 42; + field0817 = 42; + field0818 = 42; + field0819 = 42; + field0820 = 42; + field0821 = 42; + field0822 = 42; + field0823 = 42; + field0824 = 42; + field0825 = 42; + field0826 = 42; + field0827 = 42; + field0828 = 42; + field0829 = 42; + field0830 = 42; + field0831 = 42; + field0832 = 42; + field0833 = 42; + field0834 = 42; + field0835 = 42; + field0836 = 42; + field0837 = 42; + field0838 = 42; + field0839 = 42; + field0840 = 42; + field0841 = 42; + field0842 = 42; + field0843 = 42; + field0844 = 42; + field0845 = 42; + field0846 = 42; + field0847 = 42; + field0848 = 42; + field0849 = 42; + field0850 = 42; + field0851 = 42; + field0852 = 42; + field0853 = 42; + field0854 = 42; + field0855 = 42; + field0856 = 42; + field0857 = 42; + field0858 = 42; + field0859 = 42; + field0860 = 42; + field0861 = 42; + field0862 = 42; + field0863 = 42; + field0864 = 42; + field0865 = 42; + field0866 = 42; + field0867 = 42; + field0868 = 42; + field0869 = 42; + field0870 = 42; + field0871 = 42; + field0872 = 42; + field0873 = 42; + field0874 = 42; + field0875 = 42; + field0876 = 42; + field0877 = 42; + field0878 = 42; + field0879 = 42; + field0880 = 42; + field0881 = 42; + field0882 = 42; + field0883 = 42; + field0884 = 42; + field0885 = 42; + field0886 = 42; + field0887 = 42; + field0888 = 42; + field0889 = 42; + field0890 = 42; + field0891 = 42; + field0892 = 42; + field0893 = 42; + field0894 = 42; + field0895 = 42; + field0896 = 42; + field0897 = 42; + field0898 = 42; + field0899 = 42; + field0900 = 42; + field0901 = 42; + field0902 = 42; + field0903 = 42; + field0904 = 42; + field0905 = 42; + field0906 = 42; + field0907 = 42; + field0908 = 42; + field0909 = 42; + field0910 = 42; + field0911 = 42; + field0912 = 42; + field0913 = 42; + field0914 = 42; + field0915 = 42; + field0916 = 42; + field0917 = 42; + field0918 = 42; + field0919 = 42; + field0920 = 42; + field0921 = 42; + field0922 = 42; + field0923 = 42; + field0924 = 42; + field0925 = 42; + field0926 = 42; + field0927 = 42; + field0928 = 42; + field0929 = 42; + field0930 = 42; + field0931 = 42; + field0932 = 42; + field0933 = 42; + field0934 = 42; + field0935 = 42; + field0936 = 42; + field0937 = 42; + field0938 = 42; + field0939 = 42; + field0940 = 42; + field0941 = 42; + field0942 = 42; + field0943 = 42; + field0944 = 42; + field0945 = 42; + field0946 = 42; + field0947 = 42; + field0948 = 42; + field0949 = 42; + field0950 = 42; + field0951 = 42; + field0952 = 42; + field0953 = 42; + field0954 = 42; + field0955 = 42; + field0956 = 42; + field0957 = 42; + field0958 = 42; + field0959 = 42; + field0960 = 42; + field0961 = 42; + field0962 = 42; + field0963 = 42; + field0964 = 42; + field0965 = 42; + field0966 = 42; + field0967 = 42; + field0968 = 42; + field0969 = 42; + field0970 = 42; + field0971 = 42; + field0972 = 42; + field0973 = 42; + field0974 = 42; + field0975 = 42; + field0976 = 42; + field0977 = 42; + field0978 = 42; + field0979 = 42; + field0980 = 42; + field0981 = 42; + field0982 = 42; + field0983 = 42; + field0984 = 42; + field0985 = 42; + field0986 = 42; + field0987 = 42; + field0988 = 42; + field0989 = 42; + field0990 = 42; + field0991 = 42; + field0992 = 42; + field0993 = 42; + field0994 = 42; + field0995 = 42; + field0996 = 42; + field0997 = 42; + field0998 = 42; + field0999 = 42; + break; + case -2097348800: + break; + case -2068224216: + break; + case -2037697382: + break; + case -2004863454: + break; + case -1927368268: + break; + case -1907858975: + break; + case -1907849355: + break; + case -1874423303: + break; + case -1842766326: + break; + case -1789797270: + break; + case -1760959152: + break; + case -1691992770: + break; + case -1678813190: + break; + case -1605049009: + break; + case -1476174894: + break; + case -1377846581: + break; + case -1345530543: + break; + case -1307317230: + break; + case -1268501092: + break; + case -1220360021: + break; + case -1217415016: + break; + case -1216012752: + break; + case -1202791344: + break; + case -1197000094: + break; + case -1153521791: + break; + case -1136815094: + break; + case -1122842661: + break; + case -1097468803: + break; + case -1093178557: + break; + case -1087398572: + break; + case -1008013583: + break; + case -1001676601: + break; + case -949306426: + break; + case -912457023: + break; + case -891985903: + break; + case -883723257: + break; + case -871422185: + break; + case -766867181: + break; + case -766422255: + break; + case -650580623: + break; + case -633276745: + break; + case -632949857: + break; + case -621058352: + break; + case -616289146: + break; + case -589453283: + break; + case -555387838: + break; + case -540546990: + break; + case -526550005: + break; + case -502303438: + break; + case -408244884: + break; + case -367870439: + break; + case -342579923: + break; + case -330210563: + break; + case -329624856: + break; + case -302536977: + break; + case -287122936: + break; + case -236322890: + break; + case -227407685: + break; + case -218088061: + break; + case -180371167: + break; + case -131262666: + break; + case -5812857: + break; + case 3355: + break; + case 65759: + break; + case 110026: + break; + case 116076: + break; + case 2192268: + break; + case 2224947: + break; + case 2368702: + break; + case 2394661: + break; + case 2579998: + break; + case 2599333: + break; + case 3059181: + break; + case 3076014: + break; + case 3560141: + break; + case 3601339: + break; + case 8777024: + break; + case 28778089: + break; + case 29963587: + break; + case 57185780: + break; + case 57208314: + break; + case 57320750: + break; + case 63955982: + break; + case 64711720: + break; + case 65189916: + break; + case 65298671: + break; + case 69076575: + break; + case 74219460: + break; + case 74526880: + break; + case 78727453: + break; + case 78733291: + break; + case 192873343: + break; + case 194378184: + break; + case 246938863: + break; + case 269058788: + break; + case 289362821: + break; + case 325021616: + break; + case 353103893: + break; + case 369315063: + break; + case 375032009: + break; + case 383030819: + break; + case 438421327: + break; + case 487334413: + break; + case 491858238: + break; + case 505523517: + break; + case 516961236: + break; + case 665843328: + break; + case 671337916: + break; + case 737478748: + break; + case 738893626: + break; + case 745969447: + break; + case 770498827: + break; + case 776138553: + break; + case 828944778: + break; + case 846088000: + break; + case 850563927: + break; + case 851278306: + break; + case 873235173: + break; + case 908763827: + break; + case 933423720: + break; + case 973193329: + break; + case 997117913: + break; + case 1071332590: + break; + case 1076953756: + break; + case 1078812459: + break; + case 1133777670: + break; + case 1142656251: + break; + case 1145198778: + break; + case 1247831734: + break; + case 1260711798: + break; + case 1287805733: + break; + case 1312904398: + break; + case 1343242579: + break; + case 1391410207: + break; + case 1401244028: + break; + case 1410262602: + break; + case 1414192097: + break; + case 1428236656: + break; + case 1445374288: + break; + case 1488475261: + break; + case 1542263633: + break; + case 1592332600: + break; + case 1600636622: + break; + case 1627523232: + break; + case 1681397778: + break; + case 1721380104: + break; + case 1728372347: + break; + case 1733332192: + break; + case 1767264297: + break; + case 1790214156: + break; + case 1792749467: + break; + case 1805746613: + break; + case 1824308900: + break; + case 1830861979: + break; + case 1841735333: + break; + case 1922784394: + break; + case 1957570017: + break; + case 1958052158: + break; + case 1958247177: + break; + case 1965687765: + break; + case 1989867553: + break; + case 2000952482: + break; + case 2023747466: + break; + case 2043677302: + break; + case 2052815575: + break; + case 2082457694: + break; + case 2093211201: + break; + default: + break; + } + + return v; + } + + private static int field0000; + private static int field0001; + private static int field0002; + private static int field0003; + private static int field0004; + private static int field0005; + private static int field0006; + private static int field0007; + private static int field0008; + private static int field0009; + private static int field0010; + private static int field0011; + private static int field0012; + private static int field0013; + private static int field0014; + private static int field0015; + private static int field0016; + private static int field0017; + private static int field0018; + private static int field0019; + private static int field0020; + private static int field0021; + private static int field0022; + private static int field0023; + private static int field0024; + private static int field0025; + private static int field0026; + private static int field0027; + private static int field0028; + private static int field0029; + private static int field0030; + private static int field0031; + private static int field0032; + private static int field0033; + private static int field0034; + private static int field0035; + private static int field0036; + private static int field0037; + private static int field0038; + private static int field0039; + private static int field0040; + private static int field0041; + private static int field0042; + private static int field0043; + private static int field0044; + private static int field0045; + private static int field0046; + private static int field0047; + private static int field0048; + private static int field0049; + private static int field0050; + private static int field0051; + private static int field0052; + private static int field0053; + private static int field0054; + private static int field0055; + private static int field0056; + private static int field0057; + private static int field0058; + private static int field0059; + private static int field0060; + private static int field0061; + private static int field0062; + private static int field0063; + private static int field0064; + private static int field0065; + private static int field0066; + private static int field0067; + private static int field0068; + private static int field0069; + private static int field0070; + private static int field0071; + private static int field0072; + private static int field0073; + private static int field0074; + private static int field0075; + private static int field0076; + private static int field0077; + private static int field0078; + private static int field0079; + private static int field0080; + private static int field0081; + private static int field0082; + private static int field0083; + private static int field0084; + private static int field0085; + private static int field0086; + private static int field0087; + private static int field0088; + private static int field0089; + private static int field0090; + private static int field0091; + private static int field0092; + private static int field0093; + private static int field0094; + private static int field0095; + private static int field0096; + private static int field0097; + private static int field0098; + private static int field0099; + private static int field0100; + private static int field0101; + private static int field0102; + private static int field0103; + private static int field0104; + private static int field0105; + private static int field0106; + private static int field0107; + private static int field0108; + private static int field0109; + private static int field0110; + private static int field0111; + private static int field0112; + private static int field0113; + private static int field0114; + private static int field0115; + private static int field0116; + private static int field0117; + private static int field0118; + private static int field0119; + private static int field0120; + private static int field0121; + private static int field0122; + private static int field0123; + private static int field0124; + private static int field0125; + private static int field0126; + private static int field0127; + private static int field0128; + private static int field0129; + private static int field0130; + private static int field0131; + private static int field0132; + private static int field0133; + private static int field0134; + private static int field0135; + private static int field0136; + private static int field0137; + private static int field0138; + private static int field0139; + private static int field0140; + private static int field0141; + private static int field0142; + private static int field0143; + private static int field0144; + private static int field0145; + private static int field0146; + private static int field0147; + private static int field0148; + private static int field0149; + private static int field0150; + private static int field0151; + private static int field0152; + private static int field0153; + private static int field0154; + private static int field0155; + private static int field0156; + private static int field0157; + private static int field0158; + private static int field0159; + private static int field0160; + private static int field0161; + private static int field0162; + private static int field0163; + private static int field0164; + private static int field0165; + private static int field0166; + private static int field0167; + private static int field0168; + private static int field0169; + private static int field0170; + private static int field0171; + private static int field0172; + private static int field0173; + private static int field0174; + private static int field0175; + private static int field0176; + private static int field0177; + private static int field0178; + private static int field0179; + private static int field0180; + private static int field0181; + private static int field0182; + private static int field0183; + private static int field0184; + private static int field0185; + private static int field0186; + private static int field0187; + private static int field0188; + private static int field0189; + private static int field0190; + private static int field0191; + private static int field0192; + private static int field0193; + private static int field0194; + private static int field0195; + private static int field0196; + private static int field0197; + private static int field0198; + private static int field0199; + private static int field0200; + private static int field0201; + private static int field0202; + private static int field0203; + private static int field0204; + private static int field0205; + private static int field0206; + private static int field0207; + private static int field0208; + private static int field0209; + private static int field0210; + private static int field0211; + private static int field0212; + private static int field0213; + private static int field0214; + private static int field0215; + private static int field0216; + private static int field0217; + private static int field0218; + private static int field0219; + private static int field0220; + private static int field0221; + private static int field0222; + private static int field0223; + private static int field0224; + private static int field0225; + private static int field0226; + private static int field0227; + private static int field0228; + private static int field0229; + private static int field0230; + private static int field0231; + private static int field0232; + private static int field0233; + private static int field0234; + private static int field0235; + private static int field0236; + private static int field0237; + private static int field0238; + private static int field0239; + private static int field0240; + private static int field0241; + private static int field0242; + private static int field0243; + private static int field0244; + private static int field0245; + private static int field0246; + private static int field0247; + private static int field0248; + private static int field0249; + private static int field0250; + private static int field0251; + private static int field0252; + private static int field0253; + private static int field0254; + private static int field0255; + private static int field0256; + private static int field0257; + private static int field0258; + private static int field0259; + private static int field0260; + private static int field0261; + private static int field0262; + private static int field0263; + private static int field0264; + private static int field0265; + private static int field0266; + private static int field0267; + private static int field0268; + private static int field0269; + private static int field0270; + private static int field0271; + private static int field0272; + private static int field0273; + private static int field0274; + private static int field0275; + private static int field0276; + private static int field0277; + private static int field0278; + private static int field0279; + private static int field0280; + private static int field0281; + private static int field0282; + private static int field0283; + private static int field0284; + private static int field0285; + private static int field0286; + private static int field0287; + private static int field0288; + private static int field0289; + private static int field0290; + private static int field0291; + private static int field0292; + private static int field0293; + private static int field0294; + private static int field0295; + private static int field0296; + private static int field0297; + private static int field0298; + private static int field0299; + private static int field0300; + private static int field0301; + private static int field0302; + private static int field0303; + private static int field0304; + private static int field0305; + private static int field0306; + private static int field0307; + private static int field0308; + private static int field0309; + private static int field0310; + private static int field0311; + private static int field0312; + private static int field0313; + private static int field0314; + private static int field0315; + private static int field0316; + private static int field0317; + private static int field0318; + private static int field0319; + private static int field0320; + private static int field0321; + private static int field0322; + private static int field0323; + private static int field0324; + private static int field0325; + private static int field0326; + private static int field0327; + private static int field0328; + private static int field0329; + private static int field0330; + private static int field0331; + private static int field0332; + private static int field0333; + private static int field0334; + private static int field0335; + private static int field0336; + private static int field0337; + private static int field0338; + private static int field0339; + private static int field0340; + private static int field0341; + private static int field0342; + private static int field0343; + private static int field0344; + private static int field0345; + private static int field0346; + private static int field0347; + private static int field0348; + private static int field0349; + private static int field0350; + private static int field0351; + private static int field0352; + private static int field0353; + private static int field0354; + private static int field0355; + private static int field0356; + private static int field0357; + private static int field0358; + private static int field0359; + private static int field0360; + private static int field0361; + private static int field0362; + private static int field0363; + private static int field0364; + private static int field0365; + private static int field0366; + private static int field0367; + private static int field0368; + private static int field0369; + private static int field0370; + private static int field0371; + private static int field0372; + private static int field0373; + private static int field0374; + private static int field0375; + private static int field0376; + private static int field0377; + private static int field0378; + private static int field0379; + private static int field0380; + private static int field0381; + private static int field0382; + private static int field0383; + private static int field0384; + private static int field0385; + private static int field0386; + private static int field0387; + private static int field0388; + private static int field0389; + private static int field0390; + private static int field0391; + private static int field0392; + private static int field0393; + private static int field0394; + private static int field0395; + private static int field0396; + private static int field0397; + private static int field0398; + private static int field0399; + private static int field0400; + private static int field0401; + private static int field0402; + private static int field0403; + private static int field0404; + private static int field0405; + private static int field0406; + private static int field0407; + private static int field0408; + private static int field0409; + private static int field0410; + private static int field0411; + private static int field0412; + private static int field0413; + private static int field0414; + private static int field0415; + private static int field0416; + private static int field0417; + private static int field0418; + private static int field0419; + private static int field0420; + private static int field0421; + private static int field0422; + private static int field0423; + private static int field0424; + private static int field0425; + private static int field0426; + private static int field0427; + private static int field0428; + private static int field0429; + private static int field0430; + private static int field0431; + private static int field0432; + private static int field0433; + private static int field0434; + private static int field0435; + private static int field0436; + private static int field0437; + private static int field0438; + private static int field0439; + private static int field0440; + private static int field0441; + private static int field0442; + private static int field0443; + private static int field0444; + private static int field0445; + private static int field0446; + private static int field0447; + private static int field0448; + private static int field0449; + private static int field0450; + private static int field0451; + private static int field0452; + private static int field0453; + private static int field0454; + private static int field0455; + private static int field0456; + private static int field0457; + private static int field0458; + private static int field0459; + private static int field0460; + private static int field0461; + private static int field0462; + private static int field0463; + private static int field0464; + private static int field0465; + private static int field0466; + private static int field0467; + private static int field0468; + private static int field0469; + private static int field0470; + private static int field0471; + private static int field0472; + private static int field0473; + private static int field0474; + private static int field0475; + private static int field0476; + private static int field0477; + private static int field0478; + private static int field0479; + private static int field0480; + private static int field0481; + private static int field0482; + private static int field0483; + private static int field0484; + private static int field0485; + private static int field0486; + private static int field0487; + private static int field0488; + private static int field0489; + private static int field0490; + private static int field0491; + private static int field0492; + private static int field0493; + private static int field0494; + private static int field0495; + private static int field0496; + private static int field0497; + private static int field0498; + private static int field0499; + private static int field0500; + private static int field0501; + private static int field0502; + private static int field0503; + private static int field0504; + private static int field0505; + private static int field0506; + private static int field0507; + private static int field0508; + private static int field0509; + private static int field0510; + private static int field0511; + private static int field0512; + private static int field0513; + private static int field0514; + private static int field0515; + private static int field0516; + private static int field0517; + private static int field0518; + private static int field0519; + private static int field0520; + private static int field0521; + private static int field0522; + private static int field0523; + private static int field0524; + private static int field0525; + private static int field0526; + private static int field0527; + private static int field0528; + private static int field0529; + private static int field0530; + private static int field0531; + private static int field0532; + private static int field0533; + private static int field0534; + private static int field0535; + private static int field0536; + private static int field0537; + private static int field0538; + private static int field0539; + private static int field0540; + private static int field0541; + private static int field0542; + private static int field0543; + private static int field0544; + private static int field0545; + private static int field0546; + private static int field0547; + private static int field0548; + private static int field0549; + private static int field0550; + private static int field0551; + private static int field0552; + private static int field0553; + private static int field0554; + private static int field0555; + private static int field0556; + private static int field0557; + private static int field0558; + private static int field0559; + private static int field0560; + private static int field0561; + private static int field0562; + private static int field0563; + private static int field0564; + private static int field0565; + private static int field0566; + private static int field0567; + private static int field0568; + private static int field0569; + private static int field0570; + private static int field0571; + private static int field0572; + private static int field0573; + private static int field0574; + private static int field0575; + private static int field0576; + private static int field0577; + private static int field0578; + private static int field0579; + private static int field0580; + private static int field0581; + private static int field0582; + private static int field0583; + private static int field0584; + private static int field0585; + private static int field0586; + private static int field0587; + private static int field0588; + private static int field0589; + private static int field0590; + private static int field0591; + private static int field0592; + private static int field0593; + private static int field0594; + private static int field0595; + private static int field0596; + private static int field0597; + private static int field0598; + private static int field0599; + private static int field0600; + private static int field0601; + private static int field0602; + private static int field0603; + private static int field0604; + private static int field0605; + private static int field0606; + private static int field0607; + private static int field0608; + private static int field0609; + private static int field0610; + private static int field0611; + private static int field0612; + private static int field0613; + private static int field0614; + private static int field0615; + private static int field0616; + private static int field0617; + private static int field0618; + private static int field0619; + private static int field0620; + private static int field0621; + private static int field0622; + private static int field0623; + private static int field0624; + private static int field0625; + private static int field0626; + private static int field0627; + private static int field0628; + private static int field0629; + private static int field0630; + private static int field0631; + private static int field0632; + private static int field0633; + private static int field0634; + private static int field0635; + private static int field0636; + private static int field0637; + private static int field0638; + private static int field0639; + private static int field0640; + private static int field0641; + private static int field0642; + private static int field0643; + private static int field0644; + private static int field0645; + private static int field0646; + private static int field0647; + private static int field0648; + private static int field0649; + private static int field0650; + private static int field0651; + private static int field0652; + private static int field0653; + private static int field0654; + private static int field0655; + private static int field0656; + private static int field0657; + private static int field0658; + private static int field0659; + private static int field0660; + private static int field0661; + private static int field0662; + private static int field0663; + private static int field0664; + private static int field0665; + private static int field0666; + private static int field0667; + private static int field0668; + private static int field0669; + private static int field0670; + private static int field0671; + private static int field0672; + private static int field0673; + private static int field0674; + private static int field0675; + private static int field0676; + private static int field0677; + private static int field0678; + private static int field0679; + private static int field0680; + private static int field0681; + private static int field0682; + private static int field0683; + private static int field0684; + private static int field0685; + private static int field0686; + private static int field0687; + private static int field0688; + private static int field0689; + private static int field0690; + private static int field0691; + private static int field0692; + private static int field0693; + private static int field0694; + private static int field0695; + private static int field0696; + private static int field0697; + private static int field0698; + private static int field0699; + private static int field0700; + private static int field0701; + private static int field0702; + private static int field0703; + private static int field0704; + private static int field0705; + private static int field0706; + private static int field0707; + private static int field0708; + private static int field0709; + private static int field0710; + private static int field0711; + private static int field0712; + private static int field0713; + private static int field0714; + private static int field0715; + private static int field0716; + private static int field0717; + private static int field0718; + private static int field0719; + private static int field0720; + private static int field0721; + private static int field0722; + private static int field0723; + private static int field0724; + private static int field0725; + private static int field0726; + private static int field0727; + private static int field0728; + private static int field0729; + private static int field0730; + private static int field0731; + private static int field0732; + private static int field0733; + private static int field0734; + private static int field0735; + private static int field0736; + private static int field0737; + private static int field0738; + private static int field0739; + private static int field0740; + private static int field0741; + private static int field0742; + private static int field0743; + private static int field0744; + private static int field0745; + private static int field0746; + private static int field0747; + private static int field0748; + private static int field0749; + private static int field0750; + private static int field0751; + private static int field0752; + private static int field0753; + private static int field0754; + private static int field0755; + private static int field0756; + private static int field0757; + private static int field0758; + private static int field0759; + private static int field0760; + private static int field0761; + private static int field0762; + private static int field0763; + private static int field0764; + private static int field0765; + private static int field0766; + private static int field0767; + private static int field0768; + private static int field0769; + private static int field0770; + private static int field0771; + private static int field0772; + private static int field0773; + private static int field0774; + private static int field0775; + private static int field0776; + private static int field0777; + private static int field0778; + private static int field0779; + private static int field0780; + private static int field0781; + private static int field0782; + private static int field0783; + private static int field0784; + private static int field0785; + private static int field0786; + private static int field0787; + private static int field0788; + private static int field0789; + private static int field0790; + private static int field0791; + private static int field0792; + private static int field0793; + private static int field0794; + private static int field0795; + private static int field0796; + private static int field0797; + private static int field0798; + private static int field0799; + private static int field0800; + private static int field0801; + private static int field0802; + private static int field0803; + private static int field0804; + private static int field0805; + private static int field0806; + private static int field0807; + private static int field0808; + private static int field0809; + private static int field0810; + private static int field0811; + private static int field0812; + private static int field0813; + private static int field0814; + private static int field0815; + private static int field0816; + private static int field0817; + private static int field0818; + private static int field0819; + private static int field0820; + private static int field0821; + private static int field0822; + private static int field0823; + private static int field0824; + private static int field0825; + private static int field0826; + private static int field0827; + private static int field0828; + private static int field0829; + private static int field0830; + private static int field0831; + private static int field0832; + private static int field0833; + private static int field0834; + private static int field0835; + private static int field0836; + private static int field0837; + private static int field0838; + private static int field0839; + private static int field0840; + private static int field0841; + private static int field0842; + private static int field0843; + private static int field0844; + private static int field0845; + private static int field0846; + private static int field0847; + private static int field0848; + private static int field0849; + private static int field0850; + private static int field0851; + private static int field0852; + private static int field0853; + private static int field0854; + private static int field0855; + private static int field0856; + private static int field0857; + private static int field0858; + private static int field0859; + private static int field0860; + private static int field0861; + private static int field0862; + private static int field0863; + private static int field0864; + private static int field0865; + private static int field0866; + private static int field0867; + private static int field0868; + private static int field0869; + private static int field0870; + private static int field0871; + private static int field0872; + private static int field0873; + private static int field0874; + private static int field0875; + private static int field0876; + private static int field0877; + private static int field0878; + private static int field0879; + private static int field0880; + private static int field0881; + private static int field0882; + private static int field0883; + private static int field0884; + private static int field0885; + private static int field0886; + private static int field0887; + private static int field0888; + private static int field0889; + private static int field0890; + private static int field0891; + private static int field0892; + private static int field0893; + private static int field0894; + private static int field0895; + private static int field0896; + private static int field0897; + private static int field0898; + private static int field0899; + private static int field0900; + private static int field0901; + private static int field0902; + private static int field0903; + private static int field0904; + private static int field0905; + private static int field0906; + private static int field0907; + private static int field0908; + private static int field0909; + private static int field0910; + private static int field0911; + private static int field0912; + private static int field0913; + private static int field0914; + private static int field0915; + private static int field0916; + private static int field0917; + private static int field0918; + private static int field0919; + private static int field0920; + private static int field0921; + private static int field0922; + private static int field0923; + private static int field0924; + private static int field0925; + private static int field0926; + private static int field0927; + private static int field0928; + private static int field0929; + private static int field0930; + private static int field0931; + private static int field0932; + private static int field0933; + private static int field0934; + private static int field0935; + private static int field0936; + private static int field0937; + private static int field0938; + private static int field0939; + private static int field0940; + private static int field0941; + private static int field0942; + private static int field0943; + private static int field0944; + private static int field0945; + private static int field0946; + private static int field0947; + private static int field0948; + private static int field0949; + private static int field0950; + private static int field0951; + private static int field0952; + private static int field0953; + private static int field0954; + private static int field0955; + private static int field0956; + private static int field0957; + private static int field0958; + private static int field0959; + private static int field0960; + private static int field0961; + private static int field0962; + private static int field0963; + private static int field0964; + private static int field0965; + private static int field0966; + private static int field0967; + private static int field0968; + private static int field0969; + private static int field0970; + private static int field0971; + private static int field0972; + private static int field0973; + private static int field0974; + private static int field0975; + private static int field0976; + private static int field0977; + private static int field0978; + private static int field0979; + private static int field0980; + private static int field0981; + private static int field0982; + private static int field0983; + private static int field0984; + private static int field0985; + private static int field0986; + private static int field0987; + private static int field0988; + private static int field0989; + private static int field0990; + private static int field0991; + private static int field0992; + private static int field0993; + private static int field0994; + private static int field0995; + private static int field0996; + private static int field0997; + private static int field0998; + private static int field0999; +} diff --git a/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage2.java b/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage2.java new file mode 100644 index 0000000000000..3f7dbf9918bb0 --- /dev/null +++ b/test/hotspot/jtreg/compiler/codegen/TestAntiDependenciesHighMemUsage2.java @@ -0,0 +1,8444 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8333258 + * @summary C2: high memory usage in PhaseCFG::insert_anti_dependences() + * @run main/othervm -XX:CompileOnly=TestAntiDependenciesHighMemUsage2::test1 -XX:-ClipInlining + * -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:-UseOnStackReplacement TestAntiDependenciesHighMemUsage2 + */ + +public class TestAntiDependenciesHighMemUsage2 { + + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + test1(); + } + } + + private static void test1_field0000() { + int v = field0000; + v += field0001; + v += field0002; + v += field0003; + v += field0004; + v += field0005; + v += field0006; + v += field0007; + v += field0008; + v += field0009; + v += field0010; + v += field0011; + v += field0012; + v += field0013; + v += field0014; + v += field0015; + v += field0016; + v += field0017; + v += field0018; + v += field0019; + v += field0020; + v += field0021; + v += field0022; + v += field0023; + v += field0024; + v += field0025; + v += field0026; + v += field0027; + v += field0028; + v += field0029; + v += field0030; + v += field0031; + v += field0032; + v += field0033; + v += field0034; + v += field0035; + v += field0036; + v += field0037; + v += field0038; + v += field0039; + v += field0040; + v += field0041; + v += field0042; + v += field0043; + v += field0044; + v += field0045; + v += field0046; + v += field0047; + v += field0048; + v += field0049; + field0049 = v; + } + + private static void test1_field0050() { + int v = field0050; + v += field0051; + v += field0052; + v += field0053; + v += field0054; + v += field0055; + v += field0056; + v += field0057; + v += field0058; + v += field0059; + v += field0060; + v += field0061; + v += field0062; + v += field0063; + v += field0064; + v += field0065; + v += field0066; + v += field0067; + v += field0068; + v += field0069; + v += field0070; + v += field0071; + v += field0072; + v += field0073; + v += field0074; + v += field0075; + v += field0076; + v += field0077; + v += field0078; + v += field0079; + v += field0080; + v += field0081; + v += field0082; + v += field0083; + v += field0084; + v += field0085; + v += field0086; + v += field0087; + v += field0088; + v += field0089; + v += field0090; + v += field0091; + v += field0092; + v += field0093; + v += field0094; + v += field0095; + v += field0096; + v += field0097; + v += field0098; + v += field0099; + field0099 = v; + } + + private static void test1_field0100() { + int v = field0100; + v += field0101; + v += field0102; + v += field0103; + v += field0104; + v += field0105; + v += field0106; + v += field0107; + v += field0108; + v += field0109; + v += field0110; + v += field0111; + v += field0112; + v += field0113; + v += field0114; + v += field0115; + v += field0116; + v += field0117; + v += field0118; + v += field0119; + v += field0120; + v += field0121; + v += field0122; + v += field0123; + v += field0124; + v += field0125; + v += field0126; + v += field0127; + v += field0128; + v += field0129; + v += field0130; + v += field0131; + v += field0132; + v += field0133; + v += field0134; + v += field0135; + v += field0136; + v += field0137; + v += field0138; + v += field0139; + v += field0140; + v += field0141; + v += field0142; + v += field0143; + v += field0144; + v += field0145; + v += field0146; + v += field0147; + v += field0148; + v += field0149; + field0149 = v; + } + + private static void test1_field0150() { + int v = field0150; + v += field0151; + v += field0152; + v += field0153; + v += field0154; + v += field0155; + v += field0156; + v += field0157; + v += field0158; + v += field0159; + v += field0160; + v += field0161; + v += field0162; + v += field0163; + v += field0164; + v += field0165; + v += field0166; + v += field0167; + v += field0168; + v += field0169; + v += field0170; + v += field0171; + v += field0172; + v += field0173; + v += field0174; + v += field0175; + v += field0176; + v += field0177; + v += field0178; + v += field0179; + v += field0180; + v += field0181; + v += field0182; + v += field0183; + v += field0184; + v += field0185; + v += field0186; + v += field0187; + v += field0188; + v += field0189; + v += field0190; + v += field0191; + v += field0192; + v += field0193; + v += field0194; + v += field0195; + v += field0196; + v += field0197; + v += field0198; + v += field0199; + field0199 = v; + } + + private static void test1_field0200() { + int v = field0200; + v += field0201; + v += field0202; + v += field0203; + v += field0204; + v += field0205; + v += field0206; + v += field0207; + v += field0208; + v += field0209; + v += field0210; + v += field0211; + v += field0212; + v += field0213; + v += field0214; + v += field0215; + v += field0216; + v += field0217; + v += field0218; + v += field0219; + v += field0220; + v += field0221; + v += field0222; + v += field0223; + v += field0224; + v += field0225; + v += field0226; + v += field0227; + v += field0228; + v += field0229; + v += field0230; + v += field0231; + v += field0232; + v += field0233; + v += field0234; + v += field0235; + v += field0236; + v += field0237; + v += field0238; + v += field0239; + v += field0240; + v += field0241; + v += field0242; + v += field0243; + v += field0244; + v += field0245; + v += field0246; + v += field0247; + v += field0248; + v += field0249; + field0249 = v; + } + + private static void test1_field0250() { + int v = field0250; + v += field0251; + v += field0252; + v += field0253; + v += field0254; + v += field0255; + v += field0256; + v += field0257; + v += field0258; + v += field0259; + v += field0260; + v += field0261; + v += field0262; + v += field0263; + v += field0264; + v += field0265; + v += field0266; + v += field0267; + v += field0268; + v += field0269; + v += field0270; + v += field0271; + v += field0272; + v += field0273; + v += field0274; + v += field0275; + v += field0276; + v += field0277; + v += field0278; + v += field0279; + v += field0280; + v += field0281; + v += field0282; + v += field0283; + v += field0284; + v += field0285; + v += field0286; + v += field0287; + v += field0288; + v += field0289; + v += field0290; + v += field0291; + v += field0292; + v += field0293; + v += field0294; + v += field0295; + v += field0296; + v += field0297; + v += field0298; + v += field0299; + field0299 = v; + } + + private static void test1_field0300() { + int v = field0300; + v += field0301; + v += field0302; + v += field0303; + v += field0304; + v += field0305; + v += field0306; + v += field0307; + v += field0308; + v += field0309; + v += field0310; + v += field0311; + v += field0312; + v += field0313; + v += field0314; + v += field0315; + v += field0316; + v += field0317; + v += field0318; + v += field0319; + v += field0320; + v += field0321; + v += field0322; + v += field0323; + v += field0324; + v += field0325; + v += field0326; + v += field0327; + v += field0328; + v += field0329; + v += field0330; + v += field0331; + v += field0332; + v += field0333; + v += field0334; + v += field0335; + v += field0336; + v += field0337; + v += field0338; + v += field0339; + v += field0340; + v += field0341; + v += field0342; + v += field0343; + v += field0344; + v += field0345; + v += field0346; + v += field0347; + v += field0348; + v += field0349; + field0349 = v; + } + + private static void test1_field0350() { + int v = field0350; + v += field0351; + v += field0352; + v += field0353; + v += field0354; + v += field0355; + v += field0356; + v += field0357; + v += field0358; + v += field0359; + v += field0360; + v += field0361; + v += field0362; + v += field0363; + v += field0364; + v += field0365; + v += field0366; + v += field0367; + v += field0368; + v += field0369; + v += field0370; + v += field0371; + v += field0372; + v += field0373; + v += field0374; + v += field0375; + v += field0376; + v += field0377; + v += field0378; + v += field0379; + v += field0380; + v += field0381; + v += field0382; + v += field0383; + v += field0384; + v += field0385; + v += field0386; + v += field0387; + v += field0388; + v += field0389; + v += field0390; + v += field0391; + v += field0392; + v += field0393; + v += field0394; + v += field0395; + v += field0396; + v += field0397; + v += field0398; + v += field0399; + field0399 = v; + } + + private static void test1_field0400() { + int v = field0400; + v += field0401; + v += field0402; + v += field0403; + v += field0404; + v += field0405; + v += field0406; + v += field0407; + v += field0408; + v += field0409; + v += field0410; + v += field0411; + v += field0412; + v += field0413; + v += field0414; + v += field0415; + v += field0416; + v += field0417; + v += field0418; + v += field0419; + v += field0420; + v += field0421; + v += field0422; + v += field0423; + v += field0424; + v += field0425; + v += field0426; + v += field0427; + v += field0428; + v += field0429; + v += field0430; + v += field0431; + v += field0432; + v += field0433; + v += field0434; + v += field0435; + v += field0436; + v += field0437; + v += field0438; + v += field0439; + v += field0440; + v += field0441; + v += field0442; + v += field0443; + v += field0444; + v += field0445; + v += field0446; + v += field0447; + v += field0448; + v += field0449; + field0449 = v; + } + + private static void test1_field0450() { + int v = field0450; + v += field0451; + v += field0452; + v += field0453; + v += field0454; + v += field0455; + v += field0456; + v += field0457; + v += field0458; + v += field0459; + v += field0460; + v += field0461; + v += field0462; + v += field0463; + v += field0464; + v += field0465; + v += field0466; + v += field0467; + v += field0468; + v += field0469; + v += field0470; + v += field0471; + v += field0472; + v += field0473; + v += field0474; + v += field0475; + v += field0476; + v += field0477; + v += field0478; + v += field0479; + v += field0480; + v += field0481; + v += field0482; + v += field0483; + v += field0484; + v += field0485; + v += field0486; + v += field0487; + v += field0488; + v += field0489; + v += field0490; + v += field0491; + v += field0492; + v += field0493; + v += field0494; + v += field0495; + v += field0496; + v += field0497; + v += field0498; + v += field0499; + field0499 = v; + } + + private static void test1_field0500() { + int v = field0500; + v += field0501; + v += field0502; + v += field0503; + v += field0504; + v += field0505; + v += field0506; + v += field0507; + v += field0508; + v += field0509; + v += field0510; + v += field0511; + v += field0512; + v += field0513; + v += field0514; + v += field0515; + v += field0516; + v += field0517; + v += field0518; + v += field0519; + v += field0520; + v += field0521; + v += field0522; + v += field0523; + v += field0524; + v += field0525; + v += field0526; + v += field0527; + v += field0528; + v += field0529; + v += field0530; + v += field0531; + v += field0532; + v += field0533; + v += field0534; + v += field0535; + v += field0536; + v += field0537; + v += field0538; + v += field0539; + v += field0540; + v += field0541; + v += field0542; + v += field0543; + v += field0544; + v += field0545; + v += field0546; + v += field0547; + v += field0548; + v += field0549; + field0549 = v; + } + + private static void test1_field0550() { + int v = field0550; + v += field0551; + v += field0552; + v += field0553; + v += field0554; + v += field0555; + v += field0556; + v += field0557; + v += field0558; + v += field0559; + v += field0560; + v += field0561; + v += field0562; + v += field0563; + v += field0564; + v += field0565; + v += field0566; + v += field0567; + v += field0568; + v += field0569; + v += field0570; + v += field0571; + v += field0572; + v += field0573; + v += field0574; + v += field0575; + v += field0576; + v += field0577; + v += field0578; + v += field0579; + v += field0580; + v += field0581; + v += field0582; + v += field0583; + v += field0584; + v += field0585; + v += field0586; + v += field0587; + v += field0588; + v += field0589; + v += field0590; + v += field0591; + v += field0592; + v += field0593; + v += field0594; + v += field0595; + v += field0596; + v += field0597; + v += field0598; + v += field0599; + field0599 = v; + } + + private static void test1_field0600() { + int v = field0600; + v += field0601; + v += field0602; + v += field0603; + v += field0604; + v += field0605; + v += field0606; + v += field0607; + v += field0608; + v += field0609; + v += field0610; + v += field0611; + v += field0612; + v += field0613; + v += field0614; + v += field0615; + v += field0616; + v += field0617; + v += field0618; + v += field0619; + v += field0620; + v += field0621; + v += field0622; + v += field0623; + v += field0624; + v += field0625; + v += field0626; + v += field0627; + v += field0628; + v += field0629; + v += field0630; + v += field0631; + v += field0632; + v += field0633; + v += field0634; + v += field0635; + v += field0636; + v += field0637; + v += field0638; + v += field0639; + v += field0640; + v += field0641; + v += field0642; + v += field0643; + v += field0644; + v += field0645; + v += field0646; + v += field0647; + v += field0648; + v += field0649; + field0649 = v; + } + + private static void test1_field0650() { + int v = field0650; + v += field0651; + v += field0652; + v += field0653; + v += field0654; + v += field0655; + v += field0656; + v += field0657; + v += field0658; + v += field0659; + v += field0660; + v += field0661; + v += field0662; + v += field0663; + v += field0664; + v += field0665; + v += field0666; + v += field0667; + v += field0668; + v += field0669; + v += field0670; + v += field0671; + v += field0672; + v += field0673; + v += field0674; + v += field0675; + v += field0676; + v += field0677; + v += field0678; + v += field0679; + v += field0680; + v += field0681; + v += field0682; + v += field0683; + v += field0684; + v += field0685; + v += field0686; + v += field0687; + v += field0688; + v += field0689; + v += field0690; + v += field0691; + v += field0692; + v += field0693; + v += field0694; + v += field0695; + v += field0696; + v += field0697; + v += field0698; + v += field0699; + field0699 = v; + } + + private static void test1_field0700() { + int v = field0700; + v += field0701; + v += field0702; + v += field0703; + v += field0704; + v += field0705; + v += field0706; + v += field0707; + v += field0708; + v += field0709; + v += field0710; + v += field0711; + v += field0712; + v += field0713; + v += field0714; + v += field0715; + v += field0716; + v += field0717; + v += field0718; + v += field0719; + v += field0720; + v += field0721; + v += field0722; + v += field0723; + v += field0724; + v += field0725; + v += field0726; + v += field0727; + v += field0728; + v += field0729; + v += field0730; + v += field0731; + v += field0732; + v += field0733; + v += field0734; + v += field0735; + v += field0736; + v += field0737; + v += field0738; + v += field0739; + v += field0740; + v += field0741; + v += field0742; + v += field0743; + v += field0744; + v += field0745; + v += field0746; + v += field0747; + v += field0748; + v += field0749; + field0749 = v; + } + + private static void test1_field0750() { + int v = field0750; + v += field0751; + v += field0752; + v += field0753; + v += field0754; + v += field0755; + v += field0756; + v += field0757; + v += field0758; + v += field0759; + v += field0760; + v += field0761; + v += field0762; + v += field0763; + v += field0764; + v += field0765; + v += field0766; + v += field0767; + v += field0768; + v += field0769; + v += field0770; + v += field0771; + v += field0772; + v += field0773; + v += field0774; + v += field0775; + v += field0776; + v += field0777; + v += field0778; + v += field0779; + v += field0780; + v += field0781; + v += field0782; + v += field0783; + v += field0784; + v += field0785; + v += field0786; + v += field0787; + v += field0788; + v += field0789; + v += field0790; + v += field0791; + v += field0792; + v += field0793; + v += field0794; + v += field0795; + v += field0796; + v += field0797; + v += field0798; + v += field0799; + field0799 = v; + } + + private static void test1_field0800() { + int v = field0800; + v += field0801; + v += field0802; + v += field0803; + v += field0804; + v += field0805; + v += field0806; + v += field0807; + v += field0808; + v += field0809; + v += field0810; + v += field0811; + v += field0812; + v += field0813; + v += field0814; + v += field0815; + v += field0816; + v += field0817; + v += field0818; + v += field0819; + v += field0820; + v += field0821; + v += field0822; + v += field0823; + v += field0824; + v += field0825; + v += field0826; + v += field0827; + v += field0828; + v += field0829; + v += field0830; + v += field0831; + v += field0832; + v += field0833; + v += field0834; + v += field0835; + v += field0836; + v += field0837; + v += field0838; + v += field0839; + v += field0840; + v += field0841; + v += field0842; + v += field0843; + v += field0844; + v += field0845; + v += field0846; + v += field0847; + v += field0848; + v += field0849; + field0849 = v; + } + + private static void test1_field0850() { + int v = field0850; + v += field0851; + v += field0852; + v += field0853; + v += field0854; + v += field0855; + v += field0856; + v += field0857; + v += field0858; + v += field0859; + v += field0860; + v += field0861; + v += field0862; + v += field0863; + v += field0864; + v += field0865; + v += field0866; + v += field0867; + v += field0868; + v += field0869; + v += field0870; + v += field0871; + v += field0872; + v += field0873; + v += field0874; + v += field0875; + v += field0876; + v += field0877; + v += field0878; + v += field0879; + v += field0880; + v += field0881; + v += field0882; + v += field0883; + v += field0884; + v += field0885; + v += field0886; + v += field0887; + v += field0888; + v += field0889; + v += field0890; + v += field0891; + v += field0892; + v += field0893; + v += field0894; + v += field0895; + v += field0896; + v += field0897; + v += field0898; + v += field0899; + field0899 = v; + } + + private static void test1_field0900() { + int v = field0900; + v += field0901; + v += field0902; + v += field0903; + v += field0904; + v += field0905; + v += field0906; + v += field0907; + v += field0908; + v += field0909; + v += field0910; + v += field0911; + v += field0912; + v += field0913; + v += field0914; + v += field0915; + v += field0916; + v += field0917; + v += field0918; + v += field0919; + v += field0920; + v += field0921; + v += field0922; + v += field0923; + v += field0924; + v += field0925; + v += field0926; + v += field0927; + v += field0928; + v += field0929; + v += field0930; + v += field0931; + v += field0932; + v += field0933; + v += field0934; + v += field0935; + v += field0936; + v += field0937; + v += field0938; + v += field0939; + v += field0940; + v += field0941; + v += field0942; + v += field0943; + v += field0944; + v += field0945; + v += field0946; + v += field0947; + v += field0948; + v += field0949; + field0949 = v; + } + + private static void test1_field0950() { + int v = field0950; + v += field0951; + v += field0952; + v += field0953; + v += field0954; + v += field0955; + v += field0956; + v += field0957; + v += field0958; + v += field0959; + v += field0960; + v += field0961; + v += field0962; + v += field0963; + v += field0964; + v += field0965; + v += field0966; + v += field0967; + v += field0968; + v += field0969; + v += field0970; + v += field0971; + v += field0972; + v += field0973; + v += field0974; + v += field0975; + v += field0976; + v += field0977; + v += field0978; + v += field0979; + v += field0980; + v += field0981; + v += field0982; + v += field0983; + v += field0984; + v += field0985; + v += field0986; + v += field0987; + v += field0988; + v += field0989; + v += field0990; + v += field0991; + v += field0992; + v += field0993; + v += field0994; + v += field0995; + v += field0996; + v += field0997; + v += field0998; + v += field0999; + field0999 = v; + } + + private static void test1_field1000() { + int v = field1000; + v += field1001; + v += field1002; + v += field1003; + v += field1004; + v += field1005; + v += field1006; + v += field1007; + v += field1008; + v += field1009; + v += field1010; + v += field1011; + v += field1012; + v += field1013; + v += field1014; + v += field1015; + v += field1016; + v += field1017; + v += field1018; + v += field1019; + v += field1020; + v += field1021; + v += field1022; + v += field1023; + v += field1024; + v += field1025; + v += field1026; + v += field1027; + v += field1028; + v += field1029; + v += field1030; + v += field1031; + v += field1032; + v += field1033; + v += field1034; + v += field1035; + v += field1036; + v += field1037; + v += field1038; + v += field1039; + v += field1040; + v += field1041; + v += field1042; + v += field1043; + v += field1044; + v += field1045; + v += field1046; + v += field1047; + v += field1048; + v += field1049; + field1049 = v; + } + + private static void test1_field1050() { + int v = field1050; + v += field1051; + v += field1052; + v += field1053; + v += field1054; + v += field1055; + v += field1056; + v += field1057; + v += field1058; + v += field1059; + v += field1060; + v += field1061; + v += field1062; + v += field1063; + v += field1064; + v += field1065; + v += field1066; + v += field1067; + v += field1068; + v += field1069; + v += field1070; + v += field1071; + v += field1072; + v += field1073; + v += field1074; + v += field1075; + v += field1076; + v += field1077; + v += field1078; + v += field1079; + v += field1080; + v += field1081; + v += field1082; + v += field1083; + v += field1084; + v += field1085; + v += field1086; + v += field1087; + v += field1088; + v += field1089; + v += field1090; + v += field1091; + v += field1092; + v += field1093; + v += field1094; + v += field1095; + v += field1096; + v += field1097; + v += field1098; + v += field1099; + field1099 = v; + } + + private static void test1_field1100() { + int v = field1100; + v += field1101; + v += field1102; + v += field1103; + v += field1104; + v += field1105; + v += field1106; + v += field1107; + v += field1108; + v += field1109; + v += field1110; + v += field1111; + v += field1112; + v += field1113; + v += field1114; + v += field1115; + v += field1116; + v += field1117; + v += field1118; + v += field1119; + v += field1120; + v += field1121; + v += field1122; + v += field1123; + v += field1124; + v += field1125; + v += field1126; + v += field1127; + v += field1128; + v += field1129; + v += field1130; + v += field1131; + v += field1132; + v += field1133; + v += field1134; + v += field1135; + v += field1136; + v += field1137; + v += field1138; + v += field1139; + v += field1140; + v += field1141; + v += field1142; + v += field1143; + v += field1144; + v += field1145; + v += field1146; + v += field1147; + v += field1148; + v += field1149; + field1149 = v; + } + + private static void test1_field1150() { + int v = field1150; + v += field1151; + v += field1152; + v += field1153; + v += field1154; + v += field1155; + v += field1156; + v += field1157; + v += field1158; + v += field1159; + v += field1160; + v += field1161; + v += field1162; + v += field1163; + v += field1164; + v += field1165; + v += field1166; + v += field1167; + v += field1168; + v += field1169; + v += field1170; + v += field1171; + v += field1172; + v += field1173; + v += field1174; + v += field1175; + v += field1176; + v += field1177; + v += field1178; + v += field1179; + v += field1180; + v += field1181; + v += field1182; + v += field1183; + v += field1184; + v += field1185; + v += field1186; + v += field1187; + v += field1188; + v += field1189; + v += field1190; + v += field1191; + v += field1192; + v += field1193; + v += field1194; + v += field1195; + v += field1196; + v += field1197; + v += field1198; + v += field1199; + field1199 = v; + } + + private static void test1_field1200() { + int v = field1200; + v += field1201; + v += field1202; + v += field1203; + v += field1204; + v += field1205; + v += field1206; + v += field1207; + v += field1208; + v += field1209; + v += field1210; + v += field1211; + v += field1212; + v += field1213; + v += field1214; + v += field1215; + v += field1216; + v += field1217; + v += field1218; + v += field1219; + v += field1220; + v += field1221; + v += field1222; + v += field1223; + v += field1224; + v += field1225; + v += field1226; + v += field1227; + v += field1228; + v += field1229; + v += field1230; + v += field1231; + v += field1232; + v += field1233; + v += field1234; + v += field1235; + v += field1236; + v += field1237; + v += field1238; + v += field1239; + v += field1240; + v += field1241; + v += field1242; + v += field1243; + v += field1244; + v += field1245; + v += field1246; + v += field1247; + v += field1248; + v += field1249; + field1249 = v; + } + + private static void test1_field1250() { + int v = field1250; + v += field1251; + v += field1252; + v += field1253; + v += field1254; + v += field1255; + v += field1256; + v += field1257; + v += field1258; + v += field1259; + v += field1260; + v += field1261; + v += field1262; + v += field1263; + v += field1264; + v += field1265; + v += field1266; + v += field1267; + v += field1268; + v += field1269; + v += field1270; + v += field1271; + v += field1272; + v += field1273; + v += field1274; + v += field1275; + v += field1276; + v += field1277; + v += field1278; + v += field1279; + v += field1280; + v += field1281; + v += field1282; + v += field1283; + v += field1284; + v += field1285; + v += field1286; + v += field1287; + v += field1288; + v += field1289; + v += field1290; + v += field1291; + v += field1292; + v += field1293; + v += field1294; + v += field1295; + v += field1296; + v += field1297; + v += field1298; + v += field1299; + field1299 = v; + } + + private static void test1_field1300() { + int v = field1300; + v += field1301; + v += field1302; + v += field1303; + v += field1304; + v += field1305; + v += field1306; + v += field1307; + v += field1308; + v += field1309; + v += field1310; + v += field1311; + v += field1312; + v += field1313; + v += field1314; + v += field1315; + v += field1316; + v += field1317; + v += field1318; + v += field1319; + v += field1320; + v += field1321; + v += field1322; + v += field1323; + v += field1324; + v += field1325; + v += field1326; + v += field1327; + v += field1328; + v += field1329; + v += field1330; + v += field1331; + v += field1332; + v += field1333; + v += field1334; + v += field1335; + v += field1336; + v += field1337; + v += field1338; + v += field1339; + v += field1340; + v += field1341; + v += field1342; + v += field1343; + v += field1344; + v += field1345; + v += field1346; + v += field1347; + v += field1348; + v += field1349; + field1349 = v; + } + + private static void test1_field1350() { + int v = field1350; + v += field1351; + v += field1352; + v += field1353; + v += field1354; + v += field1355; + v += field1356; + v += field1357; + v += field1358; + v += field1359; + v += field1360; + v += field1361; + v += field1362; + v += field1363; + v += field1364; + v += field1365; + v += field1366; + v += field1367; + v += field1368; + v += field1369; + v += field1370; + v += field1371; + v += field1372; + v += field1373; + v += field1374; + v += field1375; + v += field1376; + v += field1377; + v += field1378; + v += field1379; + v += field1380; + v += field1381; + v += field1382; + v += field1383; + v += field1384; + v += field1385; + v += field1386; + v += field1387; + v += field1388; + v += field1389; + v += field1390; + v += field1391; + v += field1392; + v += field1393; + v += field1394; + v += field1395; + v += field1396; + v += field1397; + v += field1398; + v += field1399; + field1399 = v; + } + + private static void test1_field1400() { + int v = field1400; + v += field1401; + v += field1402; + v += field1403; + v += field1404; + v += field1405; + v += field1406; + v += field1407; + v += field1408; + v += field1409; + v += field1410; + v += field1411; + v += field1412; + v += field1413; + v += field1414; + v += field1415; + v += field1416; + v += field1417; + v += field1418; + v += field1419; + v += field1420; + v += field1421; + v += field1422; + v += field1423; + v += field1424; + v += field1425; + v += field1426; + v += field1427; + v += field1428; + v += field1429; + v += field1430; + v += field1431; + v += field1432; + v += field1433; + v += field1434; + v += field1435; + v += field1436; + v += field1437; + v += field1438; + v += field1439; + v += field1440; + v += field1441; + v += field1442; + v += field1443; + v += field1444; + v += field1445; + v += field1446; + v += field1447; + v += field1448; + v += field1449; + field1449 = v; + } + + private static void test1_field1450() { + int v = field1450; + v += field1451; + v += field1452; + v += field1453; + v += field1454; + v += field1455; + v += field1456; + v += field1457; + v += field1458; + v += field1459; + v += field1460; + v += field1461; + v += field1462; + v += field1463; + v += field1464; + v += field1465; + v += field1466; + v += field1467; + v += field1468; + v += field1469; + v += field1470; + v += field1471; + v += field1472; + v += field1473; + v += field1474; + v += field1475; + v += field1476; + v += field1477; + v += field1478; + v += field1479; + v += field1480; + v += field1481; + v += field1482; + v += field1483; + v += field1484; + v += field1485; + v += field1486; + v += field1487; + v += field1488; + v += field1489; + v += field1490; + v += field1491; + v += field1492; + v += field1493; + v += field1494; + v += field1495; + v += field1496; + v += field1497; + v += field1498; + v += field1499; + field1499 = v; + } + + private static void test1_field1500() { + int v = field1500; + v += field1501; + v += field1502; + v += field1503; + v += field1504; + v += field1505; + v += field1506; + v += field1507; + v += field1508; + v += field1509; + v += field1510; + v += field1511; + v += field1512; + v += field1513; + v += field1514; + v += field1515; + v += field1516; + v += field1517; + v += field1518; + v += field1519; + v += field1520; + v += field1521; + v += field1522; + v += field1523; + v += field1524; + v += field1525; + v += field1526; + v += field1527; + v += field1528; + v += field1529; + v += field1530; + v += field1531; + v += field1532; + v += field1533; + v += field1534; + v += field1535; + v += field1536; + v += field1537; + v += field1538; + v += field1539; + v += field1540; + v += field1541; + v += field1542; + v += field1543; + v += field1544; + v += field1545; + v += field1546; + v += field1547; + v += field1548; + v += field1549; + field1549 = v; + } + + private static void test1_field1550() { + int v = field1550; + v += field1551; + v += field1552; + v += field1553; + v += field1554; + v += field1555; + v += field1556; + v += field1557; + v += field1558; + v += field1559; + v += field1560; + v += field1561; + v += field1562; + v += field1563; + v += field1564; + v += field1565; + v += field1566; + v += field1567; + v += field1568; + v += field1569; + v += field1570; + v += field1571; + v += field1572; + v += field1573; + v += field1574; + v += field1575; + v += field1576; + v += field1577; + v += field1578; + v += field1579; + v += field1580; + v += field1581; + v += field1582; + v += field1583; + v += field1584; + v += field1585; + v += field1586; + v += field1587; + v += field1588; + v += field1589; + v += field1590; + v += field1591; + v += field1592; + v += field1593; + v += field1594; + v += field1595; + v += field1596; + v += field1597; + v += field1598; + v += field1599; + field1599 = v; + } + + private static void test1_field1600() { + int v = field1600; + v += field1601; + v += field1602; + v += field1603; + v += field1604; + v += field1605; + v += field1606; + v += field1607; + v += field1608; + v += field1609; + v += field1610; + v += field1611; + v += field1612; + v += field1613; + v += field1614; + v += field1615; + v += field1616; + v += field1617; + v += field1618; + v += field1619; + v += field1620; + v += field1621; + v += field1622; + v += field1623; + v += field1624; + v += field1625; + v += field1626; + v += field1627; + v += field1628; + v += field1629; + v += field1630; + v += field1631; + v += field1632; + v += field1633; + v += field1634; + v += field1635; + v += field1636; + v += field1637; + v += field1638; + v += field1639; + v += field1640; + v += field1641; + v += field1642; + v += field1643; + v += field1644; + v += field1645; + v += field1646; + v += field1647; + v += field1648; + v += field1649; + field1649 = v; + } + + private static void test1_field1650() { + int v = field1650; + v += field1651; + v += field1652; + v += field1653; + v += field1654; + v += field1655; + v += field1656; + v += field1657; + v += field1658; + v += field1659; + v += field1660; + v += field1661; + v += field1662; + v += field1663; + v += field1664; + v += field1665; + v += field1666; + v += field1667; + v += field1668; + v += field1669; + v += field1670; + v += field1671; + v += field1672; + v += field1673; + v += field1674; + v += field1675; + v += field1676; + v += field1677; + v += field1678; + v += field1679; + v += field1680; + v += field1681; + v += field1682; + v += field1683; + v += field1684; + v += field1685; + v += field1686; + v += field1687; + v += field1688; + v += field1689; + v += field1690; + v += field1691; + v += field1692; + v += field1693; + v += field1694; + v += field1695; + v += field1696; + v += field1697; + v += field1698; + v += field1699; + field1699 = v; + } + + private static void test1_field1700() { + int v = field1700; + v += field1701; + v += field1702; + v += field1703; + v += field1704; + v += field1705; + v += field1706; + v += field1707; + v += field1708; + v += field1709; + v += field1710; + v += field1711; + v += field1712; + v += field1713; + v += field1714; + v += field1715; + v += field1716; + v += field1717; + v += field1718; + v += field1719; + v += field1720; + v += field1721; + v += field1722; + v += field1723; + v += field1724; + v += field1725; + v += field1726; + v += field1727; + v += field1728; + v += field1729; + v += field1730; + v += field1731; + v += field1732; + v += field1733; + v += field1734; + v += field1735; + v += field1736; + v += field1737; + v += field1738; + v += field1739; + v += field1740; + v += field1741; + v += field1742; + v += field1743; + v += field1744; + v += field1745; + v += field1746; + v += field1747; + v += field1748; + v += field1749; + field1749 = v; + } + + private static void test1_field1750() { + int v = field1750; + v += field1751; + v += field1752; + v += field1753; + v += field1754; + v += field1755; + v += field1756; + v += field1757; + v += field1758; + v += field1759; + v += field1760; + v += field1761; + v += field1762; + v += field1763; + v += field1764; + v += field1765; + v += field1766; + v += field1767; + v += field1768; + v += field1769; + v += field1770; + v += field1771; + v += field1772; + v += field1773; + v += field1774; + v += field1775; + v += field1776; + v += field1777; + v += field1778; + v += field1779; + v += field1780; + v += field1781; + v += field1782; + v += field1783; + v += field1784; + v += field1785; + v += field1786; + v += field1787; + v += field1788; + v += field1789; + v += field1790; + v += field1791; + v += field1792; + v += field1793; + v += field1794; + v += field1795; + v += field1796; + v += field1797; + v += field1798; + v += field1799; + field1799 = v; + } + + private static void test1_field1800() { + int v = field1800; + v += field1801; + v += field1802; + v += field1803; + v += field1804; + v += field1805; + v += field1806; + v += field1807; + v += field1808; + v += field1809; + v += field1810; + v += field1811; + v += field1812; + v += field1813; + v += field1814; + v += field1815; + v += field1816; + v += field1817; + v += field1818; + v += field1819; + v += field1820; + v += field1821; + v += field1822; + v += field1823; + v += field1824; + v += field1825; + v += field1826; + v += field1827; + v += field1828; + v += field1829; + v += field1830; + v += field1831; + v += field1832; + v += field1833; + v += field1834; + v += field1835; + v += field1836; + v += field1837; + v += field1838; + v += field1839; + v += field1840; + v += field1841; + v += field1842; + v += field1843; + v += field1844; + v += field1845; + v += field1846; + v += field1847; + v += field1848; + v += field1849; + field1849 = v; + } + + private static void test1_field1850() { + int v = field1850; + v += field1851; + v += field1852; + v += field1853; + v += field1854; + v += field1855; + v += field1856; + v += field1857; + v += field1858; + v += field1859; + v += field1860; + v += field1861; + v += field1862; + v += field1863; + v += field1864; + v += field1865; + v += field1866; + v += field1867; + v += field1868; + v += field1869; + v += field1870; + v += field1871; + v += field1872; + v += field1873; + v += field1874; + v += field1875; + v += field1876; + v += field1877; + v += field1878; + v += field1879; + v += field1880; + v += field1881; + v += field1882; + v += field1883; + v += field1884; + v += field1885; + v += field1886; + v += field1887; + v += field1888; + v += field1889; + v += field1890; + v += field1891; + v += field1892; + v += field1893; + v += field1894; + v += field1895; + v += field1896; + v += field1897; + v += field1898; + v += field1899; + field1899 = v; + } + + private static void test1_field1900() { + int v = field1900; + v += field1901; + v += field1902; + v += field1903; + v += field1904; + v += field1905; + v += field1906; + v += field1907; + v += field1908; + v += field1909; + v += field1910; + v += field1911; + v += field1912; + v += field1913; + v += field1914; + v += field1915; + v += field1916; + v += field1917; + v += field1918; + v += field1919; + v += field1920; + v += field1921; + v += field1922; + v += field1923; + v += field1924; + v += field1925; + v += field1926; + v += field1927; + v += field1928; + v += field1929; + v += field1930; + v += field1931; + v += field1932; + v += field1933; + v += field1934; + v += field1935; + v += field1936; + v += field1937; + v += field1938; + v += field1939; + v += field1940; + v += field1941; + v += field1942; + v += field1943; + v += field1944; + v += field1945; + v += field1946; + v += field1947; + v += field1948; + v += field1949; + field1949 = v; + } + + private static void test1_field1950() { + int v = field1950; + v += field1951; + v += field1952; + v += field1953; + v += field1954; + v += field1955; + v += field1956; + v += field1957; + v += field1958; + v += field1959; + v += field1960; + v += field1961; + v += field1962; + v += field1963; + v += field1964; + v += field1965; + v += field1966; + v += field1967; + v += field1968; + v += field1969; + v += field1970; + v += field1971; + v += field1972; + v += field1973; + v += field1974; + v += field1975; + v += field1976; + v += field1977; + v += field1978; + v += field1979; + v += field1980; + v += field1981; + v += field1982; + v += field1983; + v += field1984; + v += field1985; + v += field1986; + v += field1987; + v += field1988; + v += field1989; + v += field1990; + v += field1991; + v += field1992; + v += field1993; + v += field1994; + v += field1995; + v += field1996; + v += field1997; + v += field1998; + v += field1999; + field1999 = v; + } + + private static void test1_field2000() { + int v = field2000; + v += field2001; + v += field2002; + v += field2003; + v += field2004; + v += field2005; + v += field2006; + v += field2007; + v += field2008; + v += field2009; + v += field2010; + v += field2011; + v += field2012; + v += field2013; + v += field2014; + v += field2015; + v += field2016; + v += field2017; + v += field2018; + v += field2019; + v += field2020; + v += field2021; + v += field2022; + v += field2023; + v += field2024; + v += field2025; + v += field2026; + v += field2027; + v += field2028; + v += field2029; + v += field2030; + v += field2031; + v += field2032; + v += field2033; + v += field2034; + v += field2035; + v += field2036; + v += field2037; + v += field2038; + v += field2039; + v += field2040; + v += field2041; + v += field2042; + v += field2043; + v += field2044; + v += field2045; + v += field2046; + v += field2047; + v += field2048; + v += field2049; + field2049 = v; + } + + private static void test1_field2050() { + int v = field2050; + v += field2051; + v += field2052; + v += field2053; + v += field2054; + v += field2055; + v += field2056; + v += field2057; + v += field2058; + v += field2059; + v += field2060; + v += field2061; + v += field2062; + v += field2063; + v += field2064; + v += field2065; + v += field2066; + v += field2067; + v += field2068; + v += field2069; + v += field2070; + v += field2071; + v += field2072; + v += field2073; + v += field2074; + v += field2075; + v += field2076; + v += field2077; + v += field2078; + v += field2079; + v += field2080; + v += field2081; + v += field2082; + v += field2083; + v += field2084; + v += field2085; + v += field2086; + v += field2087; + v += field2088; + v += field2089; + v += field2090; + v += field2091; + v += field2092; + v += field2093; + v += field2094; + v += field2095; + v += field2096; + v += field2097; + v += field2098; + v += field2099; + field2099 = v; + } + + private static void test1_field2100() { + int v = field2100; + v += field2101; + v += field2102; + v += field2103; + v += field2104; + v += field2105; + v += field2106; + v += field2107; + v += field2108; + v += field2109; + v += field2110; + v += field2111; + v += field2112; + v += field2113; + v += field2114; + v += field2115; + v += field2116; + v += field2117; + v += field2118; + v += field2119; + v += field2120; + v += field2121; + v += field2122; + v += field2123; + v += field2124; + v += field2125; + v += field2126; + v += field2127; + v += field2128; + v += field2129; + v += field2130; + v += field2131; + v += field2132; + v += field2133; + v += field2134; + v += field2135; + v += field2136; + v += field2137; + v += field2138; + v += field2139; + v += field2140; + v += field2141; + v += field2142; + v += field2143; + v += field2144; + v += field2145; + v += field2146; + v += field2147; + v += field2148; + v += field2149; + field2149 = v; + } + + private static void test1_field2150() { + int v = field2150; + v += field2151; + v += field2152; + v += field2153; + v += field2154; + v += field2155; + v += field2156; + v += field2157; + v += field2158; + v += field2159; + v += field2160; + v += field2161; + v += field2162; + v += field2163; + v += field2164; + v += field2165; + v += field2166; + v += field2167; + v += field2168; + v += field2169; + v += field2170; + v += field2171; + v += field2172; + v += field2173; + v += field2174; + v += field2175; + v += field2176; + v += field2177; + v += field2178; + v += field2179; + v += field2180; + v += field2181; + v += field2182; + v += field2183; + v += field2184; + v += field2185; + v += field2186; + v += field2187; + v += field2188; + v += field2189; + v += field2190; + v += field2191; + v += field2192; + v += field2193; + v += field2194; + v += field2195; + v += field2196; + v += field2197; + v += field2198; + v += field2199; + field2199 = v; + } + + private static void test1_field2200() { + int v = field2200; + v += field2201; + v += field2202; + v += field2203; + v += field2204; + v += field2205; + v += field2206; + v += field2207; + v += field2208; + v += field2209; + v += field2210; + v += field2211; + v += field2212; + v += field2213; + v += field2214; + v += field2215; + v += field2216; + v += field2217; + v += field2218; + v += field2219; + v += field2220; + v += field2221; + v += field2222; + v += field2223; + v += field2224; + v += field2225; + v += field2226; + v += field2227; + v += field2228; + v += field2229; + v += field2230; + v += field2231; + v += field2232; + v += field2233; + v += field2234; + v += field2235; + v += field2236; + v += field2237; + v += field2238; + v += field2239; + v += field2240; + v += field2241; + v += field2242; + v += field2243; + v += field2244; + v += field2245; + v += field2246; + v += field2247; + v += field2248; + v += field2249; + field2249 = v; + } + + private static void test1_field2250() { + int v = field2250; + v += field2251; + v += field2252; + v += field2253; + v += field2254; + v += field2255; + v += field2256; + v += field2257; + v += field2258; + v += field2259; + v += field2260; + v += field2261; + v += field2262; + v += field2263; + v += field2264; + v += field2265; + v += field2266; + v += field2267; + v += field2268; + v += field2269; + v += field2270; + v += field2271; + v += field2272; + v += field2273; + v += field2274; + v += field2275; + v += field2276; + v += field2277; + v += field2278; + v += field2279; + v += field2280; + v += field2281; + v += field2282; + v += field2283; + v += field2284; + v += field2285; + v += field2286; + v += field2287; + v += field2288; + v += field2289; + v += field2290; + v += field2291; + v += field2292; + v += field2293; + v += field2294; + v += field2295; + v += field2296; + v += field2297; + v += field2298; + v += field2299; + field2299 = v; + } + + private static void test1_field2300() { + int v = field2300; + v += field2301; + v += field2302; + v += field2303; + v += field2304; + v += field2305; + v += field2306; + v += field2307; + v += field2308; + v += field2309; + v += field2310; + v += field2311; + v += field2312; + v += field2313; + v += field2314; + v += field2315; + v += field2316; + v += field2317; + v += field2318; + v += field2319; + v += field2320; + v += field2321; + v += field2322; + v += field2323; + v += field2324; + v += field2325; + v += field2326; + v += field2327; + v += field2328; + v += field2329; + v += field2330; + v += field2331; + v += field2332; + v += field2333; + v += field2334; + v += field2335; + v += field2336; + v += field2337; + v += field2338; + v += field2339; + v += field2340; + v += field2341; + v += field2342; + v += field2343; + v += field2344; + v += field2345; + v += field2346; + v += field2347; + v += field2348; + v += field2349; + field2349 = v; + } + + private static void test1_field2350() { + int v = field2350; + v += field2351; + v += field2352; + v += field2353; + v += field2354; + v += field2355; + v += field2356; + v += field2357; + v += field2358; + v += field2359; + v += field2360; + v += field2361; + v += field2362; + v += field2363; + v += field2364; + v += field2365; + v += field2366; + v += field2367; + v += field2368; + v += field2369; + v += field2370; + v += field2371; + v += field2372; + v += field2373; + v += field2374; + v += field2375; + v += field2376; + v += field2377; + v += field2378; + v += field2379; + v += field2380; + v += field2381; + v += field2382; + v += field2383; + v += field2384; + v += field2385; + v += field2386; + v += field2387; + v += field2388; + v += field2389; + v += field2390; + v += field2391; + v += field2392; + v += field2393; + v += field2394; + v += field2395; + v += field2396; + v += field2397; + v += field2398; + v += field2399; + field2399 = v; + } + + private static void test1_field2400() { + int v = field2400; + v += field2401; + v += field2402; + v += field2403; + v += field2404; + v += field2405; + v += field2406; + v += field2407; + v += field2408; + v += field2409; + v += field2410; + v += field2411; + v += field2412; + v += field2413; + v += field2414; + v += field2415; + v += field2416; + v += field2417; + v += field2418; + v += field2419; + v += field2420; + v += field2421; + v += field2422; + v += field2423; + v += field2424; + v += field2425; + v += field2426; + v += field2427; + v += field2428; + v += field2429; + v += field2430; + v += field2431; + v += field2432; + v += field2433; + v += field2434; + v += field2435; + v += field2436; + v += field2437; + v += field2438; + v += field2439; + v += field2440; + v += field2441; + v += field2442; + v += field2443; + v += field2444; + v += field2445; + v += field2446; + v += field2447; + v += field2448; + v += field2449; + field2449 = v; + } + + private static void test1_field2450() { + int v = field2450; + v += field2451; + v += field2452; + v += field2453; + v += field2454; + v += field2455; + v += field2456; + v += field2457; + v += field2458; + v += field2459; + v += field2460; + v += field2461; + v += field2462; + v += field2463; + v += field2464; + v += field2465; + v += field2466; + v += field2467; + v += field2468; + v += field2469; + v += field2470; + v += field2471; + v += field2472; + v += field2473; + v += field2474; + v += field2475; + v += field2476; + v += field2477; + v += field2478; + v += field2479; + v += field2480; + v += field2481; + v += field2482; + v += field2483; + v += field2484; + v += field2485; + v += field2486; + v += field2487; + v += field2488; + v += field2489; + v += field2490; + v += field2491; + v += field2492; + v += field2493; + v += field2494; + v += field2495; + v += field2496; + v += field2497; + v += field2498; + v += field2499; + field2499 = v; + } + + private static void test1_field2500() { + int v = field2500; + v += field2501; + v += field2502; + v += field2503; + v += field2504; + v += field2505; + v += field2506; + v += field2507; + v += field2508; + v += field2509; + v += field2510; + v += field2511; + v += field2512; + v += field2513; + v += field2514; + v += field2515; + v += field2516; + v += field2517; + v += field2518; + v += field2519; + v += field2520; + v += field2521; + v += field2522; + v += field2523; + v += field2524; + v += field2525; + v += field2526; + v += field2527; + v += field2528; + v += field2529; + v += field2530; + v += field2531; + v += field2532; + v += field2533; + v += field2534; + v += field2535; + v += field2536; + v += field2537; + v += field2538; + v += field2539; + v += field2540; + v += field2541; + v += field2542; + v += field2543; + v += field2544; + v += field2545; + v += field2546; + v += field2547; + v += field2548; + v += field2549; + field2549 = v; + } + + private static void test1_field2550() { + int v = field2550; + v += field2551; + v += field2552; + v += field2553; + v += field2554; + v += field2555; + v += field2556; + v += field2557; + v += field2558; + v += field2559; + v += field2560; + v += field2561; + v += field2562; + v += field2563; + v += field2564; + v += field2565; + v += field2566; + v += field2567; + v += field2568; + v += field2569; + v += field2570; + v += field2571; + v += field2572; + v += field2573; + v += field2574; + v += field2575; + v += field2576; + v += field2577; + v += field2578; + v += field2579; + v += field2580; + v += field2581; + v += field2582; + v += field2583; + v += field2584; + v += field2585; + v += field2586; + v += field2587; + v += field2588; + v += field2589; + v += field2590; + v += field2591; + v += field2592; + v += field2593; + v += field2594; + v += field2595; + v += field2596; + v += field2597; + v += field2598; + v += field2599; + field2599 = v; + } + + private static void test1_field2600() { + int v = field2600; + v += field2601; + v += field2602; + v += field2603; + v += field2604; + v += field2605; + v += field2606; + v += field2607; + v += field2608; + v += field2609; + v += field2610; + v += field2611; + v += field2612; + v += field2613; + v += field2614; + v += field2615; + v += field2616; + v += field2617; + v += field2618; + v += field2619; + v += field2620; + v += field2621; + v += field2622; + v += field2623; + v += field2624; + v += field2625; + v += field2626; + v += field2627; + v += field2628; + v += field2629; + v += field2630; + v += field2631; + v += field2632; + v += field2633; + v += field2634; + v += field2635; + v += field2636; + v += field2637; + v += field2638; + v += field2639; + v += field2640; + v += field2641; + v += field2642; + v += field2643; + v += field2644; + v += field2645; + v += field2646; + v += field2647; + v += field2648; + v += field2649; + field2649 = v; + } + + private static void test1_field2650() { + int v = field2650; + v += field2651; + v += field2652; + v += field2653; + v += field2654; + v += field2655; + v += field2656; + v += field2657; + v += field2658; + v += field2659; + v += field2660; + v += field2661; + v += field2662; + v += field2663; + v += field2664; + v += field2665; + v += field2666; + v += field2667; + v += field2668; + v += field2669; + v += field2670; + v += field2671; + v += field2672; + v += field2673; + v += field2674; + v += field2675; + v += field2676; + v += field2677; + v += field2678; + v += field2679; + v += field2680; + v += field2681; + v += field2682; + v += field2683; + v += field2684; + v += field2685; + v += field2686; + v += field2687; + v += field2688; + v += field2689; + v += field2690; + v += field2691; + v += field2692; + v += field2693; + v += field2694; + v += field2695; + v += field2696; + v += field2697; + v += field2698; + v += field2699; + field2699 = v; + } + + private static void test1_field2700() { + int v = field2700; + v += field2701; + v += field2702; + v += field2703; + v += field2704; + v += field2705; + v += field2706; + v += field2707; + v += field2708; + v += field2709; + v += field2710; + v += field2711; + v += field2712; + v += field2713; + v += field2714; + v += field2715; + v += field2716; + v += field2717; + v += field2718; + v += field2719; + v += field2720; + v += field2721; + v += field2722; + v += field2723; + v += field2724; + v += field2725; + v += field2726; + v += field2727; + v += field2728; + v += field2729; + v += field2730; + v += field2731; + v += field2732; + v += field2733; + v += field2734; + v += field2735; + v += field2736; + v += field2737; + v += field2738; + v += field2739; + v += field2740; + v += field2741; + v += field2742; + v += field2743; + v += field2744; + v += field2745; + v += field2746; + v += field2747; + v += field2748; + v += field2749; + field2749 = v; + } + + private static void test1_field2750() { + int v = field2750; + v += field2751; + v += field2752; + v += field2753; + v += field2754; + v += field2755; + v += field2756; + v += field2757; + v += field2758; + v += field2759; + v += field2760; + v += field2761; + v += field2762; + v += field2763; + v += field2764; + v += field2765; + v += field2766; + v += field2767; + v += field2768; + v += field2769; + v += field2770; + v += field2771; + v += field2772; + v += field2773; + v += field2774; + v += field2775; + v += field2776; + v += field2777; + v += field2778; + v += field2779; + v += field2780; + v += field2781; + v += field2782; + v += field2783; + v += field2784; + v += field2785; + v += field2786; + v += field2787; + v += field2788; + v += field2789; + v += field2790; + v += field2791; + v += field2792; + v += field2793; + v += field2794; + v += field2795; + v += field2796; + v += field2797; + v += field2798; + v += field2799; + field2799 = v; + } + + private static void test1_field2800() { + int v = field2800; + v += field2801; + v += field2802; + v += field2803; + v += field2804; + v += field2805; + v += field2806; + v += field2807; + v += field2808; + v += field2809; + v += field2810; + v += field2811; + v += field2812; + v += field2813; + v += field2814; + v += field2815; + v += field2816; + v += field2817; + v += field2818; + v += field2819; + v += field2820; + v += field2821; + v += field2822; + v += field2823; + v += field2824; + v += field2825; + v += field2826; + v += field2827; + v += field2828; + v += field2829; + v += field2830; + v += field2831; + v += field2832; + v += field2833; + v += field2834; + v += field2835; + v += field2836; + v += field2837; + v += field2838; + v += field2839; + v += field2840; + v += field2841; + v += field2842; + v += field2843; + v += field2844; + v += field2845; + v += field2846; + v += field2847; + v += field2848; + v += field2849; + field2849 = v; + } + + private static void test1_field2850() { + int v = field2850; + v += field2851; + v += field2852; + v += field2853; + v += field2854; + v += field2855; + v += field2856; + v += field2857; + v += field2858; + v += field2859; + v += field2860; + v += field2861; + v += field2862; + v += field2863; + v += field2864; + v += field2865; + v += field2866; + v += field2867; + v += field2868; + v += field2869; + v += field2870; + v += field2871; + v += field2872; + v += field2873; + v += field2874; + v += field2875; + v += field2876; + v += field2877; + v += field2878; + v += field2879; + v += field2880; + v += field2881; + v += field2882; + v += field2883; + v += field2884; + v += field2885; + v += field2886; + v += field2887; + v += field2888; + v += field2889; + v += field2890; + v += field2891; + v += field2892; + v += field2893; + v += field2894; + v += field2895; + v += field2896; + v += field2897; + v += field2898; + v += field2899; + field2899 = v; + } + + private static void test1_field2900() { + int v = field2900; + v += field2901; + v += field2902; + v += field2903; + v += field2904; + v += field2905; + v += field2906; + v += field2907; + v += field2908; + v += field2909; + v += field2910; + v += field2911; + v += field2912; + v += field2913; + v += field2914; + v += field2915; + v += field2916; + v += field2917; + v += field2918; + v += field2919; + v += field2920; + v += field2921; + v += field2922; + v += field2923; + v += field2924; + v += field2925; + v += field2926; + v += field2927; + v += field2928; + v += field2929; + v += field2930; + v += field2931; + v += field2932; + v += field2933; + v += field2934; + v += field2935; + v += field2936; + v += field2937; + v += field2938; + v += field2939; + v += field2940; + v += field2941; + v += field2942; + v += field2943; + v += field2944; + v += field2945; + v += field2946; + v += field2947; + v += field2948; + v += field2949; + field2949 = v; + } + + private static void test1_field2950() { + int v = field2950; + v += field2951; + v += field2952; + v += field2953; + v += field2954; + v += field2955; + v += field2956; + v += field2957; + v += field2958; + v += field2959; + v += field2960; + v += field2961; + v += field2962; + v += field2963; + v += field2964; + v += field2965; + v += field2966; + v += field2967; + v += field2968; + v += field2969; + v += field2970; + v += field2971; + v += field2972; + v += field2973; + v += field2974; + v += field2975; + v += field2976; + v += field2977; + v += field2978; + v += field2979; + v += field2980; + v += field2981; + v += field2982; + v += field2983; + v += field2984; + v += field2985; + v += field2986; + v += field2987; + v += field2988; + v += field2989; + v += field2990; + v += field2991; + v += field2992; + v += field2993; + v += field2994; + v += field2995; + v += field2996; + v += field2997; + v += field2998; + v += field2999; + field2999 = v; + } + + private static void test1_field3000() { + int v = field3000; + v += field3001; + v += field3002; + v += field3003; + v += field3004; + v += field3005; + v += field3006; + v += field3007; + v += field3008; + v += field3009; + v += field3010; + v += field3011; + v += field3012; + v += field3013; + v += field3014; + v += field3015; + v += field3016; + v += field3017; + v += field3018; + v += field3019; + v += field3020; + v += field3021; + v += field3022; + v += field3023; + v += field3024; + v += field3025; + v += field3026; + v += field3027; + v += field3028; + v += field3029; + v += field3030; + v += field3031; + v += field3032; + v += field3033; + v += field3034; + v += field3035; + v += field3036; + v += field3037; + v += field3038; + v += field3039; + v += field3040; + v += field3041; + v += field3042; + v += field3043; + v += field3044; + v += field3045; + v += field3046; + v += field3047; + v += field3048; + v += field3049; + field3049 = v; + } + + private static void test1_field3050() { + int v = field3050; + v += field3051; + v += field3052; + v += field3053; + v += field3054; + v += field3055; + v += field3056; + v += field3057; + v += field3058; + v += field3059; + v += field3060; + v += field3061; + v += field3062; + v += field3063; + v += field3064; + v += field3065; + v += field3066; + v += field3067; + v += field3068; + v += field3069; + v += field3070; + v += field3071; + v += field3072; + v += field3073; + v += field3074; + v += field3075; + v += field3076; + v += field3077; + v += field3078; + v += field3079; + v += field3080; + v += field3081; + v += field3082; + v += field3083; + v += field3084; + v += field3085; + v += field3086; + v += field3087; + v += field3088; + v += field3089; + v += field3090; + v += field3091; + v += field3092; + v += field3093; + v += field3094; + v += field3095; + v += field3096; + v += field3097; + v += field3098; + v += field3099; + field3099 = v; + } + + private static void test1_field3100() { + int v = field3100; + v += field3101; + v += field3102; + v += field3103; + v += field3104; + v += field3105; + v += field3106; + v += field3107; + v += field3108; + v += field3109; + v += field3110; + v += field3111; + v += field3112; + v += field3113; + v += field3114; + v += field3115; + v += field3116; + v += field3117; + v += field3118; + v += field3119; + v += field3120; + v += field3121; + v += field3122; + v += field3123; + v += field3124; + v += field3125; + v += field3126; + v += field3127; + v += field3128; + v += field3129; + v += field3130; + v += field3131; + v += field3132; + v += field3133; + v += field3134; + v += field3135; + v += field3136; + v += field3137; + v += field3138; + v += field3139; + v += field3140; + v += field3141; + v += field3142; + v += field3143; + v += field3144; + v += field3145; + v += field3146; + v += field3147; + v += field3148; + v += field3149; + field3149 = v; + } + + private static void test1_field3150() { + int v = field3150; + v += field3151; + v += field3152; + v += field3153; + v += field3154; + v += field3155; + v += field3156; + v += field3157; + v += field3158; + v += field3159; + v += field3160; + v += field3161; + v += field3162; + v += field3163; + v += field3164; + v += field3165; + v += field3166; + v += field3167; + v += field3168; + v += field3169; + v += field3170; + v += field3171; + v += field3172; + v += field3173; + v += field3174; + v += field3175; + v += field3176; + v += field3177; + v += field3178; + v += field3179; + v += field3180; + v += field3181; + v += field3182; + v += field3183; + v += field3184; + v += field3185; + v += field3186; + v += field3187; + v += field3188; + v += field3189; + v += field3190; + v += field3191; + v += field3192; + v += field3193; + v += field3194; + v += field3195; + v += field3196; + v += field3197; + v += field3198; + v += field3199; + field3199 = v; + } + + private static void test1_field3200() { + int v = field3200; + v += field3201; + v += field3202; + v += field3203; + v += field3204; + v += field3205; + v += field3206; + v += field3207; + v += field3208; + v += field3209; + v += field3210; + v += field3211; + v += field3212; + v += field3213; + v += field3214; + v += field3215; + v += field3216; + v += field3217; + v += field3218; + v += field3219; + v += field3220; + v += field3221; + v += field3222; + v += field3223; + v += field3224; + v += field3225; + v += field3226; + v += field3227; + v += field3228; + v += field3229; + v += field3230; + v += field3231; + v += field3232; + v += field3233; + v += field3234; + v += field3235; + v += field3236; + v += field3237; + v += field3238; + v += field3239; + v += field3240; + v += field3241; + v += field3242; + v += field3243; + v += field3244; + v += field3245; + v += field3246; + v += field3247; + v += field3248; + v += field3249; + field3249 = v; + } + + private static void test1_field3250() { + int v = field3250; + v += field3251; + v += field3252; + v += field3253; + v += field3254; + v += field3255; + v += field3256; + v += field3257; + v += field3258; + v += field3259; + v += field3260; + v += field3261; + v += field3262; + v += field3263; + v += field3264; + v += field3265; + v += field3266; + v += field3267; + v += field3268; + v += field3269; + v += field3270; + v += field3271; + v += field3272; + v += field3273; + v += field3274; + v += field3275; + v += field3276; + v += field3277; + v += field3278; + v += field3279; + v += field3280; + v += field3281; + v += field3282; + v += field3283; + v += field3284; + v += field3285; + v += field3286; + v += field3287; + v += field3288; + v += field3289; + v += field3290; + v += field3291; + v += field3292; + v += field3293; + v += field3294; + v += field3295; + v += field3296; + v += field3297; + v += field3298; + v += field3299; + field3299 = v; + } + + private static void test1_field3300() { + int v = field3300; + v += field3301; + v += field3302; + v += field3303; + v += field3304; + v += field3305; + v += field3306; + v += field3307; + v += field3308; + v += field3309; + v += field3310; + v += field3311; + v += field3312; + v += field3313; + v += field3314; + v += field3315; + v += field3316; + v += field3317; + v += field3318; + v += field3319; + v += field3320; + v += field3321; + v += field3322; + v += field3323; + v += field3324; + v += field3325; + v += field3326; + v += field3327; + v += field3328; + v += field3329; + v += field3330; + v += field3331; + v += field3332; + v += field3333; + v += field3334; + v += field3335; + v += field3336; + v += field3337; + v += field3338; + v += field3339; + v += field3340; + v += field3341; + v += field3342; + v += field3343; + v += field3344; + v += field3345; + v += field3346; + v += field3347; + v += field3348; + v += field3349; + field3349 = v; + } + + private static void test1_field3350() { + int v = field3350; + v += field3351; + v += field3352; + v += field3353; + v += field3354; + v += field3355; + v += field3356; + v += field3357; + v += field3358; + v += field3359; + v += field3360; + v += field3361; + v += field3362; + v += field3363; + v += field3364; + v += field3365; + v += field3366; + v += field3367; + v += field3368; + v += field3369; + v += field3370; + v += field3371; + v += field3372; + v += field3373; + v += field3374; + v += field3375; + v += field3376; + v += field3377; + v += field3378; + v += field3379; + v += field3380; + v += field3381; + v += field3382; + v += field3383; + v += field3384; + v += field3385; + v += field3386; + v += field3387; + v += field3388; + v += field3389; + v += field3390; + v += field3391; + v += field3392; + v += field3393; + v += field3394; + v += field3395; + v += field3396; + v += field3397; + v += field3398; + v += field3399; + field3399 = v; + } + + private static void test1_field3400() { + int v = field3400; + v += field3401; + v += field3402; + v += field3403; + v += field3404; + v += field3405; + v += field3406; + v += field3407; + v += field3408; + v += field3409; + v += field3410; + v += field3411; + v += field3412; + v += field3413; + v += field3414; + v += field3415; + v += field3416; + v += field3417; + v += field3418; + v += field3419; + v += field3420; + v += field3421; + v += field3422; + v += field3423; + v += field3424; + v += field3425; + v += field3426; + v += field3427; + v += field3428; + v += field3429; + v += field3430; + v += field3431; + v += field3432; + v += field3433; + v += field3434; + v += field3435; + v += field3436; + v += field3437; + v += field3438; + v += field3439; + v += field3440; + v += field3441; + v += field3442; + v += field3443; + v += field3444; + v += field3445; + v += field3446; + v += field3447; + v += field3448; + v += field3449; + field3449 = v; + } + + private static void test1_field3450() { + int v = field3450; + v += field3451; + v += field3452; + v += field3453; + v += field3454; + v += field3455; + v += field3456; + v += field3457; + v += field3458; + v += field3459; + v += field3460; + v += field3461; + v += field3462; + v += field3463; + v += field3464; + v += field3465; + v += field3466; + v += field3467; + v += field3468; + v += field3469; + v += field3470; + v += field3471; + v += field3472; + v += field3473; + v += field3474; + v += field3475; + v += field3476; + v += field3477; + v += field3478; + v += field3479; + v += field3480; + v += field3481; + v += field3482; + v += field3483; + v += field3484; + v += field3485; + v += field3486; + v += field3487; + v += field3488; + v += field3489; + v += field3490; + v += field3491; + v += field3492; + v += field3493; + v += field3494; + v += field3495; + v += field3496; + v += field3497; + v += field3498; + v += field3499; + field3499 = v; + } + + private static void test1_field3500() { + int v = field3500; + v += field3501; + v += field3502; + v += field3503; + v += field3504; + v += field3505; + v += field3506; + v += field3507; + v += field3508; + v += field3509; + v += field3510; + v += field3511; + v += field3512; + v += field3513; + v += field3514; + v += field3515; + v += field3516; + v += field3517; + v += field3518; + v += field3519; + v += field3520; + v += field3521; + v += field3522; + v += field3523; + v += field3524; + v += field3525; + v += field3526; + v += field3527; + v += field3528; + v += field3529; + v += field3530; + v += field3531; + v += field3532; + v += field3533; + v += field3534; + v += field3535; + v += field3536; + v += field3537; + v += field3538; + v += field3539; + v += field3540; + v += field3541; + v += field3542; + v += field3543; + v += field3544; + v += field3545; + v += field3546; + v += field3547; + v += field3548; + v += field3549; + field3549 = v; + } + + private static void test1_field3550() { + int v = field3550; + v += field3551; + v += field3552; + v += field3553; + v += field3554; + v += field3555; + v += field3556; + v += field3557; + v += field3558; + v += field3559; + v += field3560; + v += field3561; + v += field3562; + v += field3563; + v += field3564; + v += field3565; + v += field3566; + v += field3567; + v += field3568; + v += field3569; + v += field3570; + v += field3571; + v += field3572; + v += field3573; + v += field3574; + v += field3575; + v += field3576; + v += field3577; + v += field3578; + v += field3579; + v += field3580; + v += field3581; + v += field3582; + v += field3583; + v += field3584; + v += field3585; + v += field3586; + v += field3587; + v += field3588; + v += field3589; + v += field3590; + v += field3591; + v += field3592; + v += field3593; + v += field3594; + v += field3595; + v += field3596; + v += field3597; + v += field3598; + v += field3599; + field3599 = v; + } + + private static void test1_field3600() { + int v = field3600; + v += field3601; + v += field3602; + v += field3603; + v += field3604; + v += field3605; + v += field3606; + v += field3607; + v += field3608; + v += field3609; + v += field3610; + v += field3611; + v += field3612; + v += field3613; + v += field3614; + v += field3615; + v += field3616; + v += field3617; + v += field3618; + v += field3619; + v += field3620; + v += field3621; + v += field3622; + v += field3623; + v += field3624; + v += field3625; + v += field3626; + v += field3627; + v += field3628; + v += field3629; + v += field3630; + v += field3631; + v += field3632; + v += field3633; + v += field3634; + v += field3635; + v += field3636; + v += field3637; + v += field3638; + v += field3639; + v += field3640; + v += field3641; + v += field3642; + v += field3643; + v += field3644; + v += field3645; + v += field3646; + v += field3647; + v += field3648; + v += field3649; + field3649 = v; + } + + private static void test1_field3650() { + int v = field3650; + v += field3651; + v += field3652; + v += field3653; + v += field3654; + v += field3655; + v += field3656; + v += field3657; + v += field3658; + v += field3659; + v += field3660; + v += field3661; + v += field3662; + v += field3663; + v += field3664; + v += field3665; + v += field3666; + v += field3667; + v += field3668; + v += field3669; + v += field3670; + v += field3671; + v += field3672; + v += field3673; + v += field3674; + v += field3675; + v += field3676; + v += field3677; + v += field3678; + v += field3679; + v += field3680; + v += field3681; + v += field3682; + v += field3683; + v += field3684; + v += field3685; + v += field3686; + v += field3687; + v += field3688; + v += field3689; + v += field3690; + v += field3691; + v += field3692; + v += field3693; + v += field3694; + v += field3695; + v += field3696; + v += field3697; + v += field3698; + v += field3699; + field3699 = v; + } + + private static void test1_field3700() { + int v = field3700; + v += field3701; + v += field3702; + v += field3703; + v += field3704; + v += field3705; + v += field3706; + v += field3707; + v += field3708; + v += field3709; + v += field3710; + v += field3711; + v += field3712; + v += field3713; + v += field3714; + v += field3715; + v += field3716; + v += field3717; + v += field3718; + v += field3719; + v += field3720; + v += field3721; + v += field3722; + v += field3723; + v += field3724; + v += field3725; + v += field3726; + v += field3727; + v += field3728; + v += field3729; + v += field3730; + v += field3731; + v += field3732; + v += field3733; + v += field3734; + v += field3735; + v += field3736; + v += field3737; + v += field3738; + v += field3739; + v += field3740; + v += field3741; + v += field3742; + v += field3743; + v += field3744; + v += field3745; + v += field3746; + v += field3747; + v += field3748; + v += field3749; + field3749 = v; + } + + private static void test1_field3750() { + int v = field3750; + v += field3751; + v += field3752; + v += field3753; + v += field3754; + v += field3755; + v += field3756; + v += field3757; + v += field3758; + v += field3759; + v += field3760; + v += field3761; + v += field3762; + v += field3763; + v += field3764; + v += field3765; + v += field3766; + v += field3767; + v += field3768; + v += field3769; + v += field3770; + v += field3771; + v += field3772; + v += field3773; + v += field3774; + v += field3775; + v += field3776; + v += field3777; + v += field3778; + v += field3779; + v += field3780; + v += field3781; + v += field3782; + v += field3783; + v += field3784; + v += field3785; + v += field3786; + v += field3787; + v += field3788; + v += field3789; + v += field3790; + v += field3791; + v += field3792; + v += field3793; + v += field3794; + v += field3795; + v += field3796; + v += field3797; + v += field3798; + v += field3799; + field3799 = v; + } + + private static void test1_field3800() { + int v = field3800; + v += field3801; + v += field3802; + v += field3803; + v += field3804; + v += field3805; + v += field3806; + v += field3807; + v += field3808; + v += field3809; + v += field3810; + v += field3811; + v += field3812; + v += field3813; + v += field3814; + v += field3815; + v += field3816; + v += field3817; + v += field3818; + v += field3819; + v += field3820; + v += field3821; + v += field3822; + v += field3823; + v += field3824; + v += field3825; + v += field3826; + v += field3827; + v += field3828; + v += field3829; + v += field3830; + v += field3831; + v += field3832; + v += field3833; + v += field3834; + v += field3835; + v += field3836; + v += field3837; + v += field3838; + v += field3839; + v += field3840; + v += field3841; + v += field3842; + v += field3843; + v += field3844; + v += field3845; + v += field3846; + v += field3847; + v += field3848; + v += field3849; + field3849 = v; + } + + private static void test1_field3850() { + int v = field3850; + v += field3851; + v += field3852; + v += field3853; + v += field3854; + v += field3855; + v += field3856; + v += field3857; + v += field3858; + v += field3859; + v += field3860; + v += field3861; + v += field3862; + v += field3863; + v += field3864; + v += field3865; + v += field3866; + v += field3867; + v += field3868; + v += field3869; + v += field3870; + v += field3871; + v += field3872; + v += field3873; + v += field3874; + v += field3875; + v += field3876; + v += field3877; + v += field3878; + v += field3879; + v += field3880; + v += field3881; + v += field3882; + v += field3883; + v += field3884; + v += field3885; + v += field3886; + v += field3887; + v += field3888; + v += field3889; + v += field3890; + v += field3891; + v += field3892; + v += field3893; + v += field3894; + v += field3895; + v += field3896; + v += field3897; + v += field3898; + v += field3899; + field3899 = v; + } + + private static void test1_field3900() { + int v = field3900; + v += field3901; + v += field3902; + v += field3903; + v += field3904; + v += field3905; + v += field3906; + v += field3907; + v += field3908; + v += field3909; + v += field3910; + v += field3911; + v += field3912; + v += field3913; + v += field3914; + v += field3915; + v += field3916; + v += field3917; + v += field3918; + v += field3919; + v += field3920; + v += field3921; + v += field3922; + v += field3923; + v += field3924; + v += field3925; + v += field3926; + v += field3927; + v += field3928; + v += field3929; + v += field3930; + v += field3931; + v += field3932; + v += field3933; + v += field3934; + v += field3935; + v += field3936; + v += field3937; + v += field3938; + v += field3939; + v += field3940; + v += field3941; + v += field3942; + v += field3943; + v += field3944; + v += field3945; + v += field3946; + v += field3947; + v += field3948; + v += field3949; + field3949 = v; + } + + private static void test1_field3950() { + int v = field3950; + v += field3951; + v += field3952; + v += field3953; + v += field3954; + v += field3955; + v += field3956; + v += field3957; + v += field3958; + v += field3959; + v += field3960; + v += field3961; + v += field3962; + v += field3963; + v += field3964; + v += field3965; + v += field3966; + v += field3967; + v += field3968; + v += field3969; + v += field3970; + v += field3971; + v += field3972; + v += field3973; + v += field3974; + v += field3975; + v += field3976; + v += field3977; + v += field3978; + v += field3979; + v += field3980; + v += field3981; + v += field3982; + v += field3983; + v += field3984; + v += field3985; + v += field3986; + v += field3987; + v += field3988; + v += field3989; + v += field3990; + v += field3991; + v += field3992; + v += field3993; + v += field3994; + v += field3995; + v += field3996; + v += field3997; + v += field3998; + v += field3999; + field3999 = v; + } + + private static void test1() { + int v = 0; + test1_field0000(); + test1_field0050(); + test1_field0100(); + test1_field0150(); + test1_field0200(); + test1_field0250(); + test1_field0300(); + test1_field0350(); + test1_field0400(); + test1_field0450(); + test1_field0500(); + test1_field0550(); + test1_field0600(); + test1_field0650(); + test1_field0700(); + test1_field0750(); + test1_field0800(); + test1_field0850(); + test1_field0900(); + test1_field0950(); + test1_field1000(); + test1_field1050(); + test1_field1100(); + test1_field1150(); + test1_field1200(); + test1_field1250(); + test1_field1300(); + test1_field1350(); + test1_field1400(); + test1_field1450(); + test1_field1500(); + test1_field1550(); + test1_field1600(); + test1_field1650(); + test1_field1700(); + test1_field1750(); + test1_field1800(); + test1_field1850(); + test1_field1900(); + test1_field1950(); + test1_field2000(); + test1_field2050(); + test1_field2100(); + test1_field2150(); + test1_field2200(); + test1_field2250(); + test1_field2300(); + test1_field2350(); + test1_field2400(); + test1_field2450(); + test1_field2500(); + test1_field2550(); + test1_field2600(); + test1_field2650(); + test1_field2700(); + test1_field2750(); + test1_field2800(); + test1_field2850(); + test1_field2900(); + test1_field2950(); + test1_field3000(); + test1_field3050(); + test1_field3100(); + test1_field3150(); + test1_field3200(); + test1_field3250(); + test1_field3300(); + test1_field3350(); + test1_field3400(); + test1_field3450(); + test1_field3500(); + test1_field3550(); + test1_field3600(); + test1_field3650(); + test1_field3700(); + test1_field3750(); + test1_field3800(); + test1_field3850(); + test1_field3900(); + test1_field3950(); + } + + private static int field0000; + private static int field0001; + private static int field0002; + private static int field0003; + private static int field0004; + private static int field0005; + private static int field0006; + private static int field0007; + private static int field0008; + private static int field0009; + private static int field0010; + private static int field0011; + private static int field0012; + private static int field0013; + private static int field0014; + private static int field0015; + private static int field0016; + private static int field0017; + private static int field0018; + private static int field0019; + private static int field0020; + private static int field0021; + private static int field0022; + private static int field0023; + private static int field0024; + private static int field0025; + private static int field0026; + private static int field0027; + private static int field0028; + private static int field0029; + private static int field0030; + private static int field0031; + private static int field0032; + private static int field0033; + private static int field0034; + private static int field0035; + private static int field0036; + private static int field0037; + private static int field0038; + private static int field0039; + private static int field0040; + private static int field0041; + private static int field0042; + private static int field0043; + private static int field0044; + private static int field0045; + private static int field0046; + private static int field0047; + private static int field0048; + private static int field0049; + private static int field0050; + private static int field0051; + private static int field0052; + private static int field0053; + private static int field0054; + private static int field0055; + private static int field0056; + private static int field0057; + private static int field0058; + private static int field0059; + private static int field0060; + private static int field0061; + private static int field0062; + private static int field0063; + private static int field0064; + private static int field0065; + private static int field0066; + private static int field0067; + private static int field0068; + private static int field0069; + private static int field0070; + private static int field0071; + private static int field0072; + private static int field0073; + private static int field0074; + private static int field0075; + private static int field0076; + private static int field0077; + private static int field0078; + private static int field0079; + private static int field0080; + private static int field0081; + private static int field0082; + private static int field0083; + private static int field0084; + private static int field0085; + private static int field0086; + private static int field0087; + private static int field0088; + private static int field0089; + private static int field0090; + private static int field0091; + private static int field0092; + private static int field0093; + private static int field0094; + private static int field0095; + private static int field0096; + private static int field0097; + private static int field0098; + private static int field0099; + private static int field0100; + private static int field0101; + private static int field0102; + private static int field0103; + private static int field0104; + private static int field0105; + private static int field0106; + private static int field0107; + private static int field0108; + private static int field0109; + private static int field0110; + private static int field0111; + private static int field0112; + private static int field0113; + private static int field0114; + private static int field0115; + private static int field0116; + private static int field0117; + private static int field0118; + private static int field0119; + private static int field0120; + private static int field0121; + private static int field0122; + private static int field0123; + private static int field0124; + private static int field0125; + private static int field0126; + private static int field0127; + private static int field0128; + private static int field0129; + private static int field0130; + private static int field0131; + private static int field0132; + private static int field0133; + private static int field0134; + private static int field0135; + private static int field0136; + private static int field0137; + private static int field0138; + private static int field0139; + private static int field0140; + private static int field0141; + private static int field0142; + private static int field0143; + private static int field0144; + private static int field0145; + private static int field0146; + private static int field0147; + private static int field0148; + private static int field0149; + private static int field0150; + private static int field0151; + private static int field0152; + private static int field0153; + private static int field0154; + private static int field0155; + private static int field0156; + private static int field0157; + private static int field0158; + private static int field0159; + private static int field0160; + private static int field0161; + private static int field0162; + private static int field0163; + private static int field0164; + private static int field0165; + private static int field0166; + private static int field0167; + private static int field0168; + private static int field0169; + private static int field0170; + private static int field0171; + private static int field0172; + private static int field0173; + private static int field0174; + private static int field0175; + private static int field0176; + private static int field0177; + private static int field0178; + private static int field0179; + private static int field0180; + private static int field0181; + private static int field0182; + private static int field0183; + private static int field0184; + private static int field0185; + private static int field0186; + private static int field0187; + private static int field0188; + private static int field0189; + private static int field0190; + private static int field0191; + private static int field0192; + private static int field0193; + private static int field0194; + private static int field0195; + private static int field0196; + private static int field0197; + private static int field0198; + private static int field0199; + private static int field0200; + private static int field0201; + private static int field0202; + private static int field0203; + private static int field0204; + private static int field0205; + private static int field0206; + private static int field0207; + private static int field0208; + private static int field0209; + private static int field0210; + private static int field0211; + private static int field0212; + private static int field0213; + private static int field0214; + private static int field0215; + private static int field0216; + private static int field0217; + private static int field0218; + private static int field0219; + private static int field0220; + private static int field0221; + private static int field0222; + private static int field0223; + private static int field0224; + private static int field0225; + private static int field0226; + private static int field0227; + private static int field0228; + private static int field0229; + private static int field0230; + private static int field0231; + private static int field0232; + private static int field0233; + private static int field0234; + private static int field0235; + private static int field0236; + private static int field0237; + private static int field0238; + private static int field0239; + private static int field0240; + private static int field0241; + private static int field0242; + private static int field0243; + private static int field0244; + private static int field0245; + private static int field0246; + private static int field0247; + private static int field0248; + private static int field0249; + private static int field0250; + private static int field0251; + private static int field0252; + private static int field0253; + private static int field0254; + private static int field0255; + private static int field0256; + private static int field0257; + private static int field0258; + private static int field0259; + private static int field0260; + private static int field0261; + private static int field0262; + private static int field0263; + private static int field0264; + private static int field0265; + private static int field0266; + private static int field0267; + private static int field0268; + private static int field0269; + private static int field0270; + private static int field0271; + private static int field0272; + private static int field0273; + private static int field0274; + private static int field0275; + private static int field0276; + private static int field0277; + private static int field0278; + private static int field0279; + private static int field0280; + private static int field0281; + private static int field0282; + private static int field0283; + private static int field0284; + private static int field0285; + private static int field0286; + private static int field0287; + private static int field0288; + private static int field0289; + private static int field0290; + private static int field0291; + private static int field0292; + private static int field0293; + private static int field0294; + private static int field0295; + private static int field0296; + private static int field0297; + private static int field0298; + private static int field0299; + private static int field0300; + private static int field0301; + private static int field0302; + private static int field0303; + private static int field0304; + private static int field0305; + private static int field0306; + private static int field0307; + private static int field0308; + private static int field0309; + private static int field0310; + private static int field0311; + private static int field0312; + private static int field0313; + private static int field0314; + private static int field0315; + private static int field0316; + private static int field0317; + private static int field0318; + private static int field0319; + private static int field0320; + private static int field0321; + private static int field0322; + private static int field0323; + private static int field0324; + private static int field0325; + private static int field0326; + private static int field0327; + private static int field0328; + private static int field0329; + private static int field0330; + private static int field0331; + private static int field0332; + private static int field0333; + private static int field0334; + private static int field0335; + private static int field0336; + private static int field0337; + private static int field0338; + private static int field0339; + private static int field0340; + private static int field0341; + private static int field0342; + private static int field0343; + private static int field0344; + private static int field0345; + private static int field0346; + private static int field0347; + private static int field0348; + private static int field0349; + private static int field0350; + private static int field0351; + private static int field0352; + private static int field0353; + private static int field0354; + private static int field0355; + private static int field0356; + private static int field0357; + private static int field0358; + private static int field0359; + private static int field0360; + private static int field0361; + private static int field0362; + private static int field0363; + private static int field0364; + private static int field0365; + private static int field0366; + private static int field0367; + private static int field0368; + private static int field0369; + private static int field0370; + private static int field0371; + private static int field0372; + private static int field0373; + private static int field0374; + private static int field0375; + private static int field0376; + private static int field0377; + private static int field0378; + private static int field0379; + private static int field0380; + private static int field0381; + private static int field0382; + private static int field0383; + private static int field0384; + private static int field0385; + private static int field0386; + private static int field0387; + private static int field0388; + private static int field0389; + private static int field0390; + private static int field0391; + private static int field0392; + private static int field0393; + private static int field0394; + private static int field0395; + private static int field0396; + private static int field0397; + private static int field0398; + private static int field0399; + private static int field0400; + private static int field0401; + private static int field0402; + private static int field0403; + private static int field0404; + private static int field0405; + private static int field0406; + private static int field0407; + private static int field0408; + private static int field0409; + private static int field0410; + private static int field0411; + private static int field0412; + private static int field0413; + private static int field0414; + private static int field0415; + private static int field0416; + private static int field0417; + private static int field0418; + private static int field0419; + private static int field0420; + private static int field0421; + private static int field0422; + private static int field0423; + private static int field0424; + private static int field0425; + private static int field0426; + private static int field0427; + private static int field0428; + private static int field0429; + private static int field0430; + private static int field0431; + private static int field0432; + private static int field0433; + private static int field0434; + private static int field0435; + private static int field0436; + private static int field0437; + private static int field0438; + private static int field0439; + private static int field0440; + private static int field0441; + private static int field0442; + private static int field0443; + private static int field0444; + private static int field0445; + private static int field0446; + private static int field0447; + private static int field0448; + private static int field0449; + private static int field0450; + private static int field0451; + private static int field0452; + private static int field0453; + private static int field0454; + private static int field0455; + private static int field0456; + private static int field0457; + private static int field0458; + private static int field0459; + private static int field0460; + private static int field0461; + private static int field0462; + private static int field0463; + private static int field0464; + private static int field0465; + private static int field0466; + private static int field0467; + private static int field0468; + private static int field0469; + private static int field0470; + private static int field0471; + private static int field0472; + private static int field0473; + private static int field0474; + private static int field0475; + private static int field0476; + private static int field0477; + private static int field0478; + private static int field0479; + private static int field0480; + private static int field0481; + private static int field0482; + private static int field0483; + private static int field0484; + private static int field0485; + private static int field0486; + private static int field0487; + private static int field0488; + private static int field0489; + private static int field0490; + private static int field0491; + private static int field0492; + private static int field0493; + private static int field0494; + private static int field0495; + private static int field0496; + private static int field0497; + private static int field0498; + private static int field0499; + private static int field0500; + private static int field0501; + private static int field0502; + private static int field0503; + private static int field0504; + private static int field0505; + private static int field0506; + private static int field0507; + private static int field0508; + private static int field0509; + private static int field0510; + private static int field0511; + private static int field0512; + private static int field0513; + private static int field0514; + private static int field0515; + private static int field0516; + private static int field0517; + private static int field0518; + private static int field0519; + private static int field0520; + private static int field0521; + private static int field0522; + private static int field0523; + private static int field0524; + private static int field0525; + private static int field0526; + private static int field0527; + private static int field0528; + private static int field0529; + private static int field0530; + private static int field0531; + private static int field0532; + private static int field0533; + private static int field0534; + private static int field0535; + private static int field0536; + private static int field0537; + private static int field0538; + private static int field0539; + private static int field0540; + private static int field0541; + private static int field0542; + private static int field0543; + private static int field0544; + private static int field0545; + private static int field0546; + private static int field0547; + private static int field0548; + private static int field0549; + private static int field0550; + private static int field0551; + private static int field0552; + private static int field0553; + private static int field0554; + private static int field0555; + private static int field0556; + private static int field0557; + private static int field0558; + private static int field0559; + private static int field0560; + private static int field0561; + private static int field0562; + private static int field0563; + private static int field0564; + private static int field0565; + private static int field0566; + private static int field0567; + private static int field0568; + private static int field0569; + private static int field0570; + private static int field0571; + private static int field0572; + private static int field0573; + private static int field0574; + private static int field0575; + private static int field0576; + private static int field0577; + private static int field0578; + private static int field0579; + private static int field0580; + private static int field0581; + private static int field0582; + private static int field0583; + private static int field0584; + private static int field0585; + private static int field0586; + private static int field0587; + private static int field0588; + private static int field0589; + private static int field0590; + private static int field0591; + private static int field0592; + private static int field0593; + private static int field0594; + private static int field0595; + private static int field0596; + private static int field0597; + private static int field0598; + private static int field0599; + private static int field0600; + private static int field0601; + private static int field0602; + private static int field0603; + private static int field0604; + private static int field0605; + private static int field0606; + private static int field0607; + private static int field0608; + private static int field0609; + private static int field0610; + private static int field0611; + private static int field0612; + private static int field0613; + private static int field0614; + private static int field0615; + private static int field0616; + private static int field0617; + private static int field0618; + private static int field0619; + private static int field0620; + private static int field0621; + private static int field0622; + private static int field0623; + private static int field0624; + private static int field0625; + private static int field0626; + private static int field0627; + private static int field0628; + private static int field0629; + private static int field0630; + private static int field0631; + private static int field0632; + private static int field0633; + private static int field0634; + private static int field0635; + private static int field0636; + private static int field0637; + private static int field0638; + private static int field0639; + private static int field0640; + private static int field0641; + private static int field0642; + private static int field0643; + private static int field0644; + private static int field0645; + private static int field0646; + private static int field0647; + private static int field0648; + private static int field0649; + private static int field0650; + private static int field0651; + private static int field0652; + private static int field0653; + private static int field0654; + private static int field0655; + private static int field0656; + private static int field0657; + private static int field0658; + private static int field0659; + private static int field0660; + private static int field0661; + private static int field0662; + private static int field0663; + private static int field0664; + private static int field0665; + private static int field0666; + private static int field0667; + private static int field0668; + private static int field0669; + private static int field0670; + private static int field0671; + private static int field0672; + private static int field0673; + private static int field0674; + private static int field0675; + private static int field0676; + private static int field0677; + private static int field0678; + private static int field0679; + private static int field0680; + private static int field0681; + private static int field0682; + private static int field0683; + private static int field0684; + private static int field0685; + private static int field0686; + private static int field0687; + private static int field0688; + private static int field0689; + private static int field0690; + private static int field0691; + private static int field0692; + private static int field0693; + private static int field0694; + private static int field0695; + private static int field0696; + private static int field0697; + private static int field0698; + private static int field0699; + private static int field0700; + private static int field0701; + private static int field0702; + private static int field0703; + private static int field0704; + private static int field0705; + private static int field0706; + private static int field0707; + private static int field0708; + private static int field0709; + private static int field0710; + private static int field0711; + private static int field0712; + private static int field0713; + private static int field0714; + private static int field0715; + private static int field0716; + private static int field0717; + private static int field0718; + private static int field0719; + private static int field0720; + private static int field0721; + private static int field0722; + private static int field0723; + private static int field0724; + private static int field0725; + private static int field0726; + private static int field0727; + private static int field0728; + private static int field0729; + private static int field0730; + private static int field0731; + private static int field0732; + private static int field0733; + private static int field0734; + private static int field0735; + private static int field0736; + private static int field0737; + private static int field0738; + private static int field0739; + private static int field0740; + private static int field0741; + private static int field0742; + private static int field0743; + private static int field0744; + private static int field0745; + private static int field0746; + private static int field0747; + private static int field0748; + private static int field0749; + private static int field0750; + private static int field0751; + private static int field0752; + private static int field0753; + private static int field0754; + private static int field0755; + private static int field0756; + private static int field0757; + private static int field0758; + private static int field0759; + private static int field0760; + private static int field0761; + private static int field0762; + private static int field0763; + private static int field0764; + private static int field0765; + private static int field0766; + private static int field0767; + private static int field0768; + private static int field0769; + private static int field0770; + private static int field0771; + private static int field0772; + private static int field0773; + private static int field0774; + private static int field0775; + private static int field0776; + private static int field0777; + private static int field0778; + private static int field0779; + private static int field0780; + private static int field0781; + private static int field0782; + private static int field0783; + private static int field0784; + private static int field0785; + private static int field0786; + private static int field0787; + private static int field0788; + private static int field0789; + private static int field0790; + private static int field0791; + private static int field0792; + private static int field0793; + private static int field0794; + private static int field0795; + private static int field0796; + private static int field0797; + private static int field0798; + private static int field0799; + private static int field0800; + private static int field0801; + private static int field0802; + private static int field0803; + private static int field0804; + private static int field0805; + private static int field0806; + private static int field0807; + private static int field0808; + private static int field0809; + private static int field0810; + private static int field0811; + private static int field0812; + private static int field0813; + private static int field0814; + private static int field0815; + private static int field0816; + private static int field0817; + private static int field0818; + private static int field0819; + private static int field0820; + private static int field0821; + private static int field0822; + private static int field0823; + private static int field0824; + private static int field0825; + private static int field0826; + private static int field0827; + private static int field0828; + private static int field0829; + private static int field0830; + private static int field0831; + private static int field0832; + private static int field0833; + private static int field0834; + private static int field0835; + private static int field0836; + private static int field0837; + private static int field0838; + private static int field0839; + private static int field0840; + private static int field0841; + private static int field0842; + private static int field0843; + private static int field0844; + private static int field0845; + private static int field0846; + private static int field0847; + private static int field0848; + private static int field0849; + private static int field0850; + private static int field0851; + private static int field0852; + private static int field0853; + private static int field0854; + private static int field0855; + private static int field0856; + private static int field0857; + private static int field0858; + private static int field0859; + private static int field0860; + private static int field0861; + private static int field0862; + private static int field0863; + private static int field0864; + private static int field0865; + private static int field0866; + private static int field0867; + private static int field0868; + private static int field0869; + private static int field0870; + private static int field0871; + private static int field0872; + private static int field0873; + private static int field0874; + private static int field0875; + private static int field0876; + private static int field0877; + private static int field0878; + private static int field0879; + private static int field0880; + private static int field0881; + private static int field0882; + private static int field0883; + private static int field0884; + private static int field0885; + private static int field0886; + private static int field0887; + private static int field0888; + private static int field0889; + private static int field0890; + private static int field0891; + private static int field0892; + private static int field0893; + private static int field0894; + private static int field0895; + private static int field0896; + private static int field0897; + private static int field0898; + private static int field0899; + private static int field0900; + private static int field0901; + private static int field0902; + private static int field0903; + private static int field0904; + private static int field0905; + private static int field0906; + private static int field0907; + private static int field0908; + private static int field0909; + private static int field0910; + private static int field0911; + private static int field0912; + private static int field0913; + private static int field0914; + private static int field0915; + private static int field0916; + private static int field0917; + private static int field0918; + private static int field0919; + private static int field0920; + private static int field0921; + private static int field0922; + private static int field0923; + private static int field0924; + private static int field0925; + private static int field0926; + private static int field0927; + private static int field0928; + private static int field0929; + private static int field0930; + private static int field0931; + private static int field0932; + private static int field0933; + private static int field0934; + private static int field0935; + private static int field0936; + private static int field0937; + private static int field0938; + private static int field0939; + private static int field0940; + private static int field0941; + private static int field0942; + private static int field0943; + private static int field0944; + private static int field0945; + private static int field0946; + private static int field0947; + private static int field0948; + private static int field0949; + private static int field0950; + private static int field0951; + private static int field0952; + private static int field0953; + private static int field0954; + private static int field0955; + private static int field0956; + private static int field0957; + private static int field0958; + private static int field0959; + private static int field0960; + private static int field0961; + private static int field0962; + private static int field0963; + private static int field0964; + private static int field0965; + private static int field0966; + private static int field0967; + private static int field0968; + private static int field0969; + private static int field0970; + private static int field0971; + private static int field0972; + private static int field0973; + private static int field0974; + private static int field0975; + private static int field0976; + private static int field0977; + private static int field0978; + private static int field0979; + private static int field0980; + private static int field0981; + private static int field0982; + private static int field0983; + private static int field0984; + private static int field0985; + private static int field0986; + private static int field0987; + private static int field0988; + private static int field0989; + private static int field0990; + private static int field0991; + private static int field0992; + private static int field0993; + private static int field0994; + private static int field0995; + private static int field0996; + private static int field0997; + private static int field0998; + private static int field0999; + private static int field1000; + private static int field1001; + private static int field1002; + private static int field1003; + private static int field1004; + private static int field1005; + private static int field1006; + private static int field1007; + private static int field1008; + private static int field1009; + private static int field1010; + private static int field1011; + private static int field1012; + private static int field1013; + private static int field1014; + private static int field1015; + private static int field1016; + private static int field1017; + private static int field1018; + private static int field1019; + private static int field1020; + private static int field1021; + private static int field1022; + private static int field1023; + private static int field1024; + private static int field1025; + private static int field1026; + private static int field1027; + private static int field1028; + private static int field1029; + private static int field1030; + private static int field1031; + private static int field1032; + private static int field1033; + private static int field1034; + private static int field1035; + private static int field1036; + private static int field1037; + private static int field1038; + private static int field1039; + private static int field1040; + private static int field1041; + private static int field1042; + private static int field1043; + private static int field1044; + private static int field1045; + private static int field1046; + private static int field1047; + private static int field1048; + private static int field1049; + private static int field1050; + private static int field1051; + private static int field1052; + private static int field1053; + private static int field1054; + private static int field1055; + private static int field1056; + private static int field1057; + private static int field1058; + private static int field1059; + private static int field1060; + private static int field1061; + private static int field1062; + private static int field1063; + private static int field1064; + private static int field1065; + private static int field1066; + private static int field1067; + private static int field1068; + private static int field1069; + private static int field1070; + private static int field1071; + private static int field1072; + private static int field1073; + private static int field1074; + private static int field1075; + private static int field1076; + private static int field1077; + private static int field1078; + private static int field1079; + private static int field1080; + private static int field1081; + private static int field1082; + private static int field1083; + private static int field1084; + private static int field1085; + private static int field1086; + private static int field1087; + private static int field1088; + private static int field1089; + private static int field1090; + private static int field1091; + private static int field1092; + private static int field1093; + private static int field1094; + private static int field1095; + private static int field1096; + private static int field1097; + private static int field1098; + private static int field1099; + private static int field1100; + private static int field1101; + private static int field1102; + private static int field1103; + private static int field1104; + private static int field1105; + private static int field1106; + private static int field1107; + private static int field1108; + private static int field1109; + private static int field1110; + private static int field1111; + private static int field1112; + private static int field1113; + private static int field1114; + private static int field1115; + private static int field1116; + private static int field1117; + private static int field1118; + private static int field1119; + private static int field1120; + private static int field1121; + private static int field1122; + private static int field1123; + private static int field1124; + private static int field1125; + private static int field1126; + private static int field1127; + private static int field1128; + private static int field1129; + private static int field1130; + private static int field1131; + private static int field1132; + private static int field1133; + private static int field1134; + private static int field1135; + private static int field1136; + private static int field1137; + private static int field1138; + private static int field1139; + private static int field1140; + private static int field1141; + private static int field1142; + private static int field1143; + private static int field1144; + private static int field1145; + private static int field1146; + private static int field1147; + private static int field1148; + private static int field1149; + private static int field1150; + private static int field1151; + private static int field1152; + private static int field1153; + private static int field1154; + private static int field1155; + private static int field1156; + private static int field1157; + private static int field1158; + private static int field1159; + private static int field1160; + private static int field1161; + private static int field1162; + private static int field1163; + private static int field1164; + private static int field1165; + private static int field1166; + private static int field1167; + private static int field1168; + private static int field1169; + private static int field1170; + private static int field1171; + private static int field1172; + private static int field1173; + private static int field1174; + private static int field1175; + private static int field1176; + private static int field1177; + private static int field1178; + private static int field1179; + private static int field1180; + private static int field1181; + private static int field1182; + private static int field1183; + private static int field1184; + private static int field1185; + private static int field1186; + private static int field1187; + private static int field1188; + private static int field1189; + private static int field1190; + private static int field1191; + private static int field1192; + private static int field1193; + private static int field1194; + private static int field1195; + private static int field1196; + private static int field1197; + private static int field1198; + private static int field1199; + private static int field1200; + private static int field1201; + private static int field1202; + private static int field1203; + private static int field1204; + private static int field1205; + private static int field1206; + private static int field1207; + private static int field1208; + private static int field1209; + private static int field1210; + private static int field1211; + private static int field1212; + private static int field1213; + private static int field1214; + private static int field1215; + private static int field1216; + private static int field1217; + private static int field1218; + private static int field1219; + private static int field1220; + private static int field1221; + private static int field1222; + private static int field1223; + private static int field1224; + private static int field1225; + private static int field1226; + private static int field1227; + private static int field1228; + private static int field1229; + private static int field1230; + private static int field1231; + private static int field1232; + private static int field1233; + private static int field1234; + private static int field1235; + private static int field1236; + private static int field1237; + private static int field1238; + private static int field1239; + private static int field1240; + private static int field1241; + private static int field1242; + private static int field1243; + private static int field1244; + private static int field1245; + private static int field1246; + private static int field1247; + private static int field1248; + private static int field1249; + private static int field1250; + private static int field1251; + private static int field1252; + private static int field1253; + private static int field1254; + private static int field1255; + private static int field1256; + private static int field1257; + private static int field1258; + private static int field1259; + private static int field1260; + private static int field1261; + private static int field1262; + private static int field1263; + private static int field1264; + private static int field1265; + private static int field1266; + private static int field1267; + private static int field1268; + private static int field1269; + private static int field1270; + private static int field1271; + private static int field1272; + private static int field1273; + private static int field1274; + private static int field1275; + private static int field1276; + private static int field1277; + private static int field1278; + private static int field1279; + private static int field1280; + private static int field1281; + private static int field1282; + private static int field1283; + private static int field1284; + private static int field1285; + private static int field1286; + private static int field1287; + private static int field1288; + private static int field1289; + private static int field1290; + private static int field1291; + private static int field1292; + private static int field1293; + private static int field1294; + private static int field1295; + private static int field1296; + private static int field1297; + private static int field1298; + private static int field1299; + private static int field1300; + private static int field1301; + private static int field1302; + private static int field1303; + private static int field1304; + private static int field1305; + private static int field1306; + private static int field1307; + private static int field1308; + private static int field1309; + private static int field1310; + private static int field1311; + private static int field1312; + private static int field1313; + private static int field1314; + private static int field1315; + private static int field1316; + private static int field1317; + private static int field1318; + private static int field1319; + private static int field1320; + private static int field1321; + private static int field1322; + private static int field1323; + private static int field1324; + private static int field1325; + private static int field1326; + private static int field1327; + private static int field1328; + private static int field1329; + private static int field1330; + private static int field1331; + private static int field1332; + private static int field1333; + private static int field1334; + private static int field1335; + private static int field1336; + private static int field1337; + private static int field1338; + private static int field1339; + private static int field1340; + private static int field1341; + private static int field1342; + private static int field1343; + private static int field1344; + private static int field1345; + private static int field1346; + private static int field1347; + private static int field1348; + private static int field1349; + private static int field1350; + private static int field1351; + private static int field1352; + private static int field1353; + private static int field1354; + private static int field1355; + private static int field1356; + private static int field1357; + private static int field1358; + private static int field1359; + private static int field1360; + private static int field1361; + private static int field1362; + private static int field1363; + private static int field1364; + private static int field1365; + private static int field1366; + private static int field1367; + private static int field1368; + private static int field1369; + private static int field1370; + private static int field1371; + private static int field1372; + private static int field1373; + private static int field1374; + private static int field1375; + private static int field1376; + private static int field1377; + private static int field1378; + private static int field1379; + private static int field1380; + private static int field1381; + private static int field1382; + private static int field1383; + private static int field1384; + private static int field1385; + private static int field1386; + private static int field1387; + private static int field1388; + private static int field1389; + private static int field1390; + private static int field1391; + private static int field1392; + private static int field1393; + private static int field1394; + private static int field1395; + private static int field1396; + private static int field1397; + private static int field1398; + private static int field1399; + private static int field1400; + private static int field1401; + private static int field1402; + private static int field1403; + private static int field1404; + private static int field1405; + private static int field1406; + private static int field1407; + private static int field1408; + private static int field1409; + private static int field1410; + private static int field1411; + private static int field1412; + private static int field1413; + private static int field1414; + private static int field1415; + private static int field1416; + private static int field1417; + private static int field1418; + private static int field1419; + private static int field1420; + private static int field1421; + private static int field1422; + private static int field1423; + private static int field1424; + private static int field1425; + private static int field1426; + private static int field1427; + private static int field1428; + private static int field1429; + private static int field1430; + private static int field1431; + private static int field1432; + private static int field1433; + private static int field1434; + private static int field1435; + private static int field1436; + private static int field1437; + private static int field1438; + private static int field1439; + private static int field1440; + private static int field1441; + private static int field1442; + private static int field1443; + private static int field1444; + private static int field1445; + private static int field1446; + private static int field1447; + private static int field1448; + private static int field1449; + private static int field1450; + private static int field1451; + private static int field1452; + private static int field1453; + private static int field1454; + private static int field1455; + private static int field1456; + private static int field1457; + private static int field1458; + private static int field1459; + private static int field1460; + private static int field1461; + private static int field1462; + private static int field1463; + private static int field1464; + private static int field1465; + private static int field1466; + private static int field1467; + private static int field1468; + private static int field1469; + private static int field1470; + private static int field1471; + private static int field1472; + private static int field1473; + private static int field1474; + private static int field1475; + private static int field1476; + private static int field1477; + private static int field1478; + private static int field1479; + private static int field1480; + private static int field1481; + private static int field1482; + private static int field1483; + private static int field1484; + private static int field1485; + private static int field1486; + private static int field1487; + private static int field1488; + private static int field1489; + private static int field1490; + private static int field1491; + private static int field1492; + private static int field1493; + private static int field1494; + private static int field1495; + private static int field1496; + private static int field1497; + private static int field1498; + private static int field1499; + private static int field1500; + private static int field1501; + private static int field1502; + private static int field1503; + private static int field1504; + private static int field1505; + private static int field1506; + private static int field1507; + private static int field1508; + private static int field1509; + private static int field1510; + private static int field1511; + private static int field1512; + private static int field1513; + private static int field1514; + private static int field1515; + private static int field1516; + private static int field1517; + private static int field1518; + private static int field1519; + private static int field1520; + private static int field1521; + private static int field1522; + private static int field1523; + private static int field1524; + private static int field1525; + private static int field1526; + private static int field1527; + private static int field1528; + private static int field1529; + private static int field1530; + private static int field1531; + private static int field1532; + private static int field1533; + private static int field1534; + private static int field1535; + private static int field1536; + private static int field1537; + private static int field1538; + private static int field1539; + private static int field1540; + private static int field1541; + private static int field1542; + private static int field1543; + private static int field1544; + private static int field1545; + private static int field1546; + private static int field1547; + private static int field1548; + private static int field1549; + private static int field1550; + private static int field1551; + private static int field1552; + private static int field1553; + private static int field1554; + private static int field1555; + private static int field1556; + private static int field1557; + private static int field1558; + private static int field1559; + private static int field1560; + private static int field1561; + private static int field1562; + private static int field1563; + private static int field1564; + private static int field1565; + private static int field1566; + private static int field1567; + private static int field1568; + private static int field1569; + private static int field1570; + private static int field1571; + private static int field1572; + private static int field1573; + private static int field1574; + private static int field1575; + private static int field1576; + private static int field1577; + private static int field1578; + private static int field1579; + private static int field1580; + private static int field1581; + private static int field1582; + private static int field1583; + private static int field1584; + private static int field1585; + private static int field1586; + private static int field1587; + private static int field1588; + private static int field1589; + private static int field1590; + private static int field1591; + private static int field1592; + private static int field1593; + private static int field1594; + private static int field1595; + private static int field1596; + private static int field1597; + private static int field1598; + private static int field1599; + private static int field1600; + private static int field1601; + private static int field1602; + private static int field1603; + private static int field1604; + private static int field1605; + private static int field1606; + private static int field1607; + private static int field1608; + private static int field1609; + private static int field1610; + private static int field1611; + private static int field1612; + private static int field1613; + private static int field1614; + private static int field1615; + private static int field1616; + private static int field1617; + private static int field1618; + private static int field1619; + private static int field1620; + private static int field1621; + private static int field1622; + private static int field1623; + private static int field1624; + private static int field1625; + private static int field1626; + private static int field1627; + private static int field1628; + private static int field1629; + private static int field1630; + private static int field1631; + private static int field1632; + private static int field1633; + private static int field1634; + private static int field1635; + private static int field1636; + private static int field1637; + private static int field1638; + private static int field1639; + private static int field1640; + private static int field1641; + private static int field1642; + private static int field1643; + private static int field1644; + private static int field1645; + private static int field1646; + private static int field1647; + private static int field1648; + private static int field1649; + private static int field1650; + private static int field1651; + private static int field1652; + private static int field1653; + private static int field1654; + private static int field1655; + private static int field1656; + private static int field1657; + private static int field1658; + private static int field1659; + private static int field1660; + private static int field1661; + private static int field1662; + private static int field1663; + private static int field1664; + private static int field1665; + private static int field1666; + private static int field1667; + private static int field1668; + private static int field1669; + private static int field1670; + private static int field1671; + private static int field1672; + private static int field1673; + private static int field1674; + private static int field1675; + private static int field1676; + private static int field1677; + private static int field1678; + private static int field1679; + private static int field1680; + private static int field1681; + private static int field1682; + private static int field1683; + private static int field1684; + private static int field1685; + private static int field1686; + private static int field1687; + private static int field1688; + private static int field1689; + private static int field1690; + private static int field1691; + private static int field1692; + private static int field1693; + private static int field1694; + private static int field1695; + private static int field1696; + private static int field1697; + private static int field1698; + private static int field1699; + private static int field1700; + private static int field1701; + private static int field1702; + private static int field1703; + private static int field1704; + private static int field1705; + private static int field1706; + private static int field1707; + private static int field1708; + private static int field1709; + private static int field1710; + private static int field1711; + private static int field1712; + private static int field1713; + private static int field1714; + private static int field1715; + private static int field1716; + private static int field1717; + private static int field1718; + private static int field1719; + private static int field1720; + private static int field1721; + private static int field1722; + private static int field1723; + private static int field1724; + private static int field1725; + private static int field1726; + private static int field1727; + private static int field1728; + private static int field1729; + private static int field1730; + private static int field1731; + private static int field1732; + private static int field1733; + private static int field1734; + private static int field1735; + private static int field1736; + private static int field1737; + private static int field1738; + private static int field1739; + private static int field1740; + private static int field1741; + private static int field1742; + private static int field1743; + private static int field1744; + private static int field1745; + private static int field1746; + private static int field1747; + private static int field1748; + private static int field1749; + private static int field1750; + private static int field1751; + private static int field1752; + private static int field1753; + private static int field1754; + private static int field1755; + private static int field1756; + private static int field1757; + private static int field1758; + private static int field1759; + private static int field1760; + private static int field1761; + private static int field1762; + private static int field1763; + private static int field1764; + private static int field1765; + private static int field1766; + private static int field1767; + private static int field1768; + private static int field1769; + private static int field1770; + private static int field1771; + private static int field1772; + private static int field1773; + private static int field1774; + private static int field1775; + private static int field1776; + private static int field1777; + private static int field1778; + private static int field1779; + private static int field1780; + private static int field1781; + private static int field1782; + private static int field1783; + private static int field1784; + private static int field1785; + private static int field1786; + private static int field1787; + private static int field1788; + private static int field1789; + private static int field1790; + private static int field1791; + private static int field1792; + private static int field1793; + private static int field1794; + private static int field1795; + private static int field1796; + private static int field1797; + private static int field1798; + private static int field1799; + private static int field1800; + private static int field1801; + private static int field1802; + private static int field1803; + private static int field1804; + private static int field1805; + private static int field1806; + private static int field1807; + private static int field1808; + private static int field1809; + private static int field1810; + private static int field1811; + private static int field1812; + private static int field1813; + private static int field1814; + private static int field1815; + private static int field1816; + private static int field1817; + private static int field1818; + private static int field1819; + private static int field1820; + private static int field1821; + private static int field1822; + private static int field1823; + private static int field1824; + private static int field1825; + private static int field1826; + private static int field1827; + private static int field1828; + private static int field1829; + private static int field1830; + private static int field1831; + private static int field1832; + private static int field1833; + private static int field1834; + private static int field1835; + private static int field1836; + private static int field1837; + private static int field1838; + private static int field1839; + private static int field1840; + private static int field1841; + private static int field1842; + private static int field1843; + private static int field1844; + private static int field1845; + private static int field1846; + private static int field1847; + private static int field1848; + private static int field1849; + private static int field1850; + private static int field1851; + private static int field1852; + private static int field1853; + private static int field1854; + private static int field1855; + private static int field1856; + private static int field1857; + private static int field1858; + private static int field1859; + private static int field1860; + private static int field1861; + private static int field1862; + private static int field1863; + private static int field1864; + private static int field1865; + private static int field1866; + private static int field1867; + private static int field1868; + private static int field1869; + private static int field1870; + private static int field1871; + private static int field1872; + private static int field1873; + private static int field1874; + private static int field1875; + private static int field1876; + private static int field1877; + private static int field1878; + private static int field1879; + private static int field1880; + private static int field1881; + private static int field1882; + private static int field1883; + private static int field1884; + private static int field1885; + private static int field1886; + private static int field1887; + private static int field1888; + private static int field1889; + private static int field1890; + private static int field1891; + private static int field1892; + private static int field1893; + private static int field1894; + private static int field1895; + private static int field1896; + private static int field1897; + private static int field1898; + private static int field1899; + private static int field1900; + private static int field1901; + private static int field1902; + private static int field1903; + private static int field1904; + private static int field1905; + private static int field1906; + private static int field1907; + private static int field1908; + private static int field1909; + private static int field1910; + private static int field1911; + private static int field1912; + private static int field1913; + private static int field1914; + private static int field1915; + private static int field1916; + private static int field1917; + private static int field1918; + private static int field1919; + private static int field1920; + private static int field1921; + private static int field1922; + private static int field1923; + private static int field1924; + private static int field1925; + private static int field1926; + private static int field1927; + private static int field1928; + private static int field1929; + private static int field1930; + private static int field1931; + private static int field1932; + private static int field1933; + private static int field1934; + private static int field1935; + private static int field1936; + private static int field1937; + private static int field1938; + private static int field1939; + private static int field1940; + private static int field1941; + private static int field1942; + private static int field1943; + private static int field1944; + private static int field1945; + private static int field1946; + private static int field1947; + private static int field1948; + private static int field1949; + private static int field1950; + private static int field1951; + private static int field1952; + private static int field1953; + private static int field1954; + private static int field1955; + private static int field1956; + private static int field1957; + private static int field1958; + private static int field1959; + private static int field1960; + private static int field1961; + private static int field1962; + private static int field1963; + private static int field1964; + private static int field1965; + private static int field1966; + private static int field1967; + private static int field1968; + private static int field1969; + private static int field1970; + private static int field1971; + private static int field1972; + private static int field1973; + private static int field1974; + private static int field1975; + private static int field1976; + private static int field1977; + private static int field1978; + private static int field1979; + private static int field1980; + private static int field1981; + private static int field1982; + private static int field1983; + private static int field1984; + private static int field1985; + private static int field1986; + private static int field1987; + private static int field1988; + private static int field1989; + private static int field1990; + private static int field1991; + private static int field1992; + private static int field1993; + private static int field1994; + private static int field1995; + private static int field1996; + private static int field1997; + private static int field1998; + private static int field1999; + private static int field2000; + private static int field2001; + private static int field2002; + private static int field2003; + private static int field2004; + private static int field2005; + private static int field2006; + private static int field2007; + private static int field2008; + private static int field2009; + private static int field2010; + private static int field2011; + private static int field2012; + private static int field2013; + private static int field2014; + private static int field2015; + private static int field2016; + private static int field2017; + private static int field2018; + private static int field2019; + private static int field2020; + private static int field2021; + private static int field2022; + private static int field2023; + private static int field2024; + private static int field2025; + private static int field2026; + private static int field2027; + private static int field2028; + private static int field2029; + private static int field2030; + private static int field2031; + private static int field2032; + private static int field2033; + private static int field2034; + private static int field2035; + private static int field2036; + private static int field2037; + private static int field2038; + private static int field2039; + private static int field2040; + private static int field2041; + private static int field2042; + private static int field2043; + private static int field2044; + private static int field2045; + private static int field2046; + private static int field2047; + private static int field2048; + private static int field2049; + private static int field2050; + private static int field2051; + private static int field2052; + private static int field2053; + private static int field2054; + private static int field2055; + private static int field2056; + private static int field2057; + private static int field2058; + private static int field2059; + private static int field2060; + private static int field2061; + private static int field2062; + private static int field2063; + private static int field2064; + private static int field2065; + private static int field2066; + private static int field2067; + private static int field2068; + private static int field2069; + private static int field2070; + private static int field2071; + private static int field2072; + private static int field2073; + private static int field2074; + private static int field2075; + private static int field2076; + private static int field2077; + private static int field2078; + private static int field2079; + private static int field2080; + private static int field2081; + private static int field2082; + private static int field2083; + private static int field2084; + private static int field2085; + private static int field2086; + private static int field2087; + private static int field2088; + private static int field2089; + private static int field2090; + private static int field2091; + private static int field2092; + private static int field2093; + private static int field2094; + private static int field2095; + private static int field2096; + private static int field2097; + private static int field2098; + private static int field2099; + private static int field2100; + private static int field2101; + private static int field2102; + private static int field2103; + private static int field2104; + private static int field2105; + private static int field2106; + private static int field2107; + private static int field2108; + private static int field2109; + private static int field2110; + private static int field2111; + private static int field2112; + private static int field2113; + private static int field2114; + private static int field2115; + private static int field2116; + private static int field2117; + private static int field2118; + private static int field2119; + private static int field2120; + private static int field2121; + private static int field2122; + private static int field2123; + private static int field2124; + private static int field2125; + private static int field2126; + private static int field2127; + private static int field2128; + private static int field2129; + private static int field2130; + private static int field2131; + private static int field2132; + private static int field2133; + private static int field2134; + private static int field2135; + private static int field2136; + private static int field2137; + private static int field2138; + private static int field2139; + private static int field2140; + private static int field2141; + private static int field2142; + private static int field2143; + private static int field2144; + private static int field2145; + private static int field2146; + private static int field2147; + private static int field2148; + private static int field2149; + private static int field2150; + private static int field2151; + private static int field2152; + private static int field2153; + private static int field2154; + private static int field2155; + private static int field2156; + private static int field2157; + private static int field2158; + private static int field2159; + private static int field2160; + private static int field2161; + private static int field2162; + private static int field2163; + private static int field2164; + private static int field2165; + private static int field2166; + private static int field2167; + private static int field2168; + private static int field2169; + private static int field2170; + private static int field2171; + private static int field2172; + private static int field2173; + private static int field2174; + private static int field2175; + private static int field2176; + private static int field2177; + private static int field2178; + private static int field2179; + private static int field2180; + private static int field2181; + private static int field2182; + private static int field2183; + private static int field2184; + private static int field2185; + private static int field2186; + private static int field2187; + private static int field2188; + private static int field2189; + private static int field2190; + private static int field2191; + private static int field2192; + private static int field2193; + private static int field2194; + private static int field2195; + private static int field2196; + private static int field2197; + private static int field2198; + private static int field2199; + private static int field2200; + private static int field2201; + private static int field2202; + private static int field2203; + private static int field2204; + private static int field2205; + private static int field2206; + private static int field2207; + private static int field2208; + private static int field2209; + private static int field2210; + private static int field2211; + private static int field2212; + private static int field2213; + private static int field2214; + private static int field2215; + private static int field2216; + private static int field2217; + private static int field2218; + private static int field2219; + private static int field2220; + private static int field2221; + private static int field2222; + private static int field2223; + private static int field2224; + private static int field2225; + private static int field2226; + private static int field2227; + private static int field2228; + private static int field2229; + private static int field2230; + private static int field2231; + private static int field2232; + private static int field2233; + private static int field2234; + private static int field2235; + private static int field2236; + private static int field2237; + private static int field2238; + private static int field2239; + private static int field2240; + private static int field2241; + private static int field2242; + private static int field2243; + private static int field2244; + private static int field2245; + private static int field2246; + private static int field2247; + private static int field2248; + private static int field2249; + private static int field2250; + private static int field2251; + private static int field2252; + private static int field2253; + private static int field2254; + private static int field2255; + private static int field2256; + private static int field2257; + private static int field2258; + private static int field2259; + private static int field2260; + private static int field2261; + private static int field2262; + private static int field2263; + private static int field2264; + private static int field2265; + private static int field2266; + private static int field2267; + private static int field2268; + private static int field2269; + private static int field2270; + private static int field2271; + private static int field2272; + private static int field2273; + private static int field2274; + private static int field2275; + private static int field2276; + private static int field2277; + private static int field2278; + private static int field2279; + private static int field2280; + private static int field2281; + private static int field2282; + private static int field2283; + private static int field2284; + private static int field2285; + private static int field2286; + private static int field2287; + private static int field2288; + private static int field2289; + private static int field2290; + private static int field2291; + private static int field2292; + private static int field2293; + private static int field2294; + private static int field2295; + private static int field2296; + private static int field2297; + private static int field2298; + private static int field2299; + private static int field2300; + private static int field2301; + private static int field2302; + private static int field2303; + private static int field2304; + private static int field2305; + private static int field2306; + private static int field2307; + private static int field2308; + private static int field2309; + private static int field2310; + private static int field2311; + private static int field2312; + private static int field2313; + private static int field2314; + private static int field2315; + private static int field2316; + private static int field2317; + private static int field2318; + private static int field2319; + private static int field2320; + private static int field2321; + private static int field2322; + private static int field2323; + private static int field2324; + private static int field2325; + private static int field2326; + private static int field2327; + private static int field2328; + private static int field2329; + private static int field2330; + private static int field2331; + private static int field2332; + private static int field2333; + private static int field2334; + private static int field2335; + private static int field2336; + private static int field2337; + private static int field2338; + private static int field2339; + private static int field2340; + private static int field2341; + private static int field2342; + private static int field2343; + private static int field2344; + private static int field2345; + private static int field2346; + private static int field2347; + private static int field2348; + private static int field2349; + private static int field2350; + private static int field2351; + private static int field2352; + private static int field2353; + private static int field2354; + private static int field2355; + private static int field2356; + private static int field2357; + private static int field2358; + private static int field2359; + private static int field2360; + private static int field2361; + private static int field2362; + private static int field2363; + private static int field2364; + private static int field2365; + private static int field2366; + private static int field2367; + private static int field2368; + private static int field2369; + private static int field2370; + private static int field2371; + private static int field2372; + private static int field2373; + private static int field2374; + private static int field2375; + private static int field2376; + private static int field2377; + private static int field2378; + private static int field2379; + private static int field2380; + private static int field2381; + private static int field2382; + private static int field2383; + private static int field2384; + private static int field2385; + private static int field2386; + private static int field2387; + private static int field2388; + private static int field2389; + private static int field2390; + private static int field2391; + private static int field2392; + private static int field2393; + private static int field2394; + private static int field2395; + private static int field2396; + private static int field2397; + private static int field2398; + private static int field2399; + private static int field2400; + private static int field2401; + private static int field2402; + private static int field2403; + private static int field2404; + private static int field2405; + private static int field2406; + private static int field2407; + private static int field2408; + private static int field2409; + private static int field2410; + private static int field2411; + private static int field2412; + private static int field2413; + private static int field2414; + private static int field2415; + private static int field2416; + private static int field2417; + private static int field2418; + private static int field2419; + private static int field2420; + private static int field2421; + private static int field2422; + private static int field2423; + private static int field2424; + private static int field2425; + private static int field2426; + private static int field2427; + private static int field2428; + private static int field2429; + private static int field2430; + private static int field2431; + private static int field2432; + private static int field2433; + private static int field2434; + private static int field2435; + private static int field2436; + private static int field2437; + private static int field2438; + private static int field2439; + private static int field2440; + private static int field2441; + private static int field2442; + private static int field2443; + private static int field2444; + private static int field2445; + private static int field2446; + private static int field2447; + private static int field2448; + private static int field2449; + private static int field2450; + private static int field2451; + private static int field2452; + private static int field2453; + private static int field2454; + private static int field2455; + private static int field2456; + private static int field2457; + private static int field2458; + private static int field2459; + private static int field2460; + private static int field2461; + private static int field2462; + private static int field2463; + private static int field2464; + private static int field2465; + private static int field2466; + private static int field2467; + private static int field2468; + private static int field2469; + private static int field2470; + private static int field2471; + private static int field2472; + private static int field2473; + private static int field2474; + private static int field2475; + private static int field2476; + private static int field2477; + private static int field2478; + private static int field2479; + private static int field2480; + private static int field2481; + private static int field2482; + private static int field2483; + private static int field2484; + private static int field2485; + private static int field2486; + private static int field2487; + private static int field2488; + private static int field2489; + private static int field2490; + private static int field2491; + private static int field2492; + private static int field2493; + private static int field2494; + private static int field2495; + private static int field2496; + private static int field2497; + private static int field2498; + private static int field2499; + private static int field2500; + private static int field2501; + private static int field2502; + private static int field2503; + private static int field2504; + private static int field2505; + private static int field2506; + private static int field2507; + private static int field2508; + private static int field2509; + private static int field2510; + private static int field2511; + private static int field2512; + private static int field2513; + private static int field2514; + private static int field2515; + private static int field2516; + private static int field2517; + private static int field2518; + private static int field2519; + private static int field2520; + private static int field2521; + private static int field2522; + private static int field2523; + private static int field2524; + private static int field2525; + private static int field2526; + private static int field2527; + private static int field2528; + private static int field2529; + private static int field2530; + private static int field2531; + private static int field2532; + private static int field2533; + private static int field2534; + private static int field2535; + private static int field2536; + private static int field2537; + private static int field2538; + private static int field2539; + private static int field2540; + private static int field2541; + private static int field2542; + private static int field2543; + private static int field2544; + private static int field2545; + private static int field2546; + private static int field2547; + private static int field2548; + private static int field2549; + private static int field2550; + private static int field2551; + private static int field2552; + private static int field2553; + private static int field2554; + private static int field2555; + private static int field2556; + private static int field2557; + private static int field2558; + private static int field2559; + private static int field2560; + private static int field2561; + private static int field2562; + private static int field2563; + private static int field2564; + private static int field2565; + private static int field2566; + private static int field2567; + private static int field2568; + private static int field2569; + private static int field2570; + private static int field2571; + private static int field2572; + private static int field2573; + private static int field2574; + private static int field2575; + private static int field2576; + private static int field2577; + private static int field2578; + private static int field2579; + private static int field2580; + private static int field2581; + private static int field2582; + private static int field2583; + private static int field2584; + private static int field2585; + private static int field2586; + private static int field2587; + private static int field2588; + private static int field2589; + private static int field2590; + private static int field2591; + private static int field2592; + private static int field2593; + private static int field2594; + private static int field2595; + private static int field2596; + private static int field2597; + private static int field2598; + private static int field2599; + private static int field2600; + private static int field2601; + private static int field2602; + private static int field2603; + private static int field2604; + private static int field2605; + private static int field2606; + private static int field2607; + private static int field2608; + private static int field2609; + private static int field2610; + private static int field2611; + private static int field2612; + private static int field2613; + private static int field2614; + private static int field2615; + private static int field2616; + private static int field2617; + private static int field2618; + private static int field2619; + private static int field2620; + private static int field2621; + private static int field2622; + private static int field2623; + private static int field2624; + private static int field2625; + private static int field2626; + private static int field2627; + private static int field2628; + private static int field2629; + private static int field2630; + private static int field2631; + private static int field2632; + private static int field2633; + private static int field2634; + private static int field2635; + private static int field2636; + private static int field2637; + private static int field2638; + private static int field2639; + private static int field2640; + private static int field2641; + private static int field2642; + private static int field2643; + private static int field2644; + private static int field2645; + private static int field2646; + private static int field2647; + private static int field2648; + private static int field2649; + private static int field2650; + private static int field2651; + private static int field2652; + private static int field2653; + private static int field2654; + private static int field2655; + private static int field2656; + private static int field2657; + private static int field2658; + private static int field2659; + private static int field2660; + private static int field2661; + private static int field2662; + private static int field2663; + private static int field2664; + private static int field2665; + private static int field2666; + private static int field2667; + private static int field2668; + private static int field2669; + private static int field2670; + private static int field2671; + private static int field2672; + private static int field2673; + private static int field2674; + private static int field2675; + private static int field2676; + private static int field2677; + private static int field2678; + private static int field2679; + private static int field2680; + private static int field2681; + private static int field2682; + private static int field2683; + private static int field2684; + private static int field2685; + private static int field2686; + private static int field2687; + private static int field2688; + private static int field2689; + private static int field2690; + private static int field2691; + private static int field2692; + private static int field2693; + private static int field2694; + private static int field2695; + private static int field2696; + private static int field2697; + private static int field2698; + private static int field2699; + private static int field2700; + private static int field2701; + private static int field2702; + private static int field2703; + private static int field2704; + private static int field2705; + private static int field2706; + private static int field2707; + private static int field2708; + private static int field2709; + private static int field2710; + private static int field2711; + private static int field2712; + private static int field2713; + private static int field2714; + private static int field2715; + private static int field2716; + private static int field2717; + private static int field2718; + private static int field2719; + private static int field2720; + private static int field2721; + private static int field2722; + private static int field2723; + private static int field2724; + private static int field2725; + private static int field2726; + private static int field2727; + private static int field2728; + private static int field2729; + private static int field2730; + private static int field2731; + private static int field2732; + private static int field2733; + private static int field2734; + private static int field2735; + private static int field2736; + private static int field2737; + private static int field2738; + private static int field2739; + private static int field2740; + private static int field2741; + private static int field2742; + private static int field2743; + private static int field2744; + private static int field2745; + private static int field2746; + private static int field2747; + private static int field2748; + private static int field2749; + private static int field2750; + private static int field2751; + private static int field2752; + private static int field2753; + private static int field2754; + private static int field2755; + private static int field2756; + private static int field2757; + private static int field2758; + private static int field2759; + private static int field2760; + private static int field2761; + private static int field2762; + private static int field2763; + private static int field2764; + private static int field2765; + private static int field2766; + private static int field2767; + private static int field2768; + private static int field2769; + private static int field2770; + private static int field2771; + private static int field2772; + private static int field2773; + private static int field2774; + private static int field2775; + private static int field2776; + private static int field2777; + private static int field2778; + private static int field2779; + private static int field2780; + private static int field2781; + private static int field2782; + private static int field2783; + private static int field2784; + private static int field2785; + private static int field2786; + private static int field2787; + private static int field2788; + private static int field2789; + private static int field2790; + private static int field2791; + private static int field2792; + private static int field2793; + private static int field2794; + private static int field2795; + private static int field2796; + private static int field2797; + private static int field2798; + private static int field2799; + private static int field2800; + private static int field2801; + private static int field2802; + private static int field2803; + private static int field2804; + private static int field2805; + private static int field2806; + private static int field2807; + private static int field2808; + private static int field2809; + private static int field2810; + private static int field2811; + private static int field2812; + private static int field2813; + private static int field2814; + private static int field2815; + private static int field2816; + private static int field2817; + private static int field2818; + private static int field2819; + private static int field2820; + private static int field2821; + private static int field2822; + private static int field2823; + private static int field2824; + private static int field2825; + private static int field2826; + private static int field2827; + private static int field2828; + private static int field2829; + private static int field2830; + private static int field2831; + private static int field2832; + private static int field2833; + private static int field2834; + private static int field2835; + private static int field2836; + private static int field2837; + private static int field2838; + private static int field2839; + private static int field2840; + private static int field2841; + private static int field2842; + private static int field2843; + private static int field2844; + private static int field2845; + private static int field2846; + private static int field2847; + private static int field2848; + private static int field2849; + private static int field2850; + private static int field2851; + private static int field2852; + private static int field2853; + private static int field2854; + private static int field2855; + private static int field2856; + private static int field2857; + private static int field2858; + private static int field2859; + private static int field2860; + private static int field2861; + private static int field2862; + private static int field2863; + private static int field2864; + private static int field2865; + private static int field2866; + private static int field2867; + private static int field2868; + private static int field2869; + private static int field2870; + private static int field2871; + private static int field2872; + private static int field2873; + private static int field2874; + private static int field2875; + private static int field2876; + private static int field2877; + private static int field2878; + private static int field2879; + private static int field2880; + private static int field2881; + private static int field2882; + private static int field2883; + private static int field2884; + private static int field2885; + private static int field2886; + private static int field2887; + private static int field2888; + private static int field2889; + private static int field2890; + private static int field2891; + private static int field2892; + private static int field2893; + private static int field2894; + private static int field2895; + private static int field2896; + private static int field2897; + private static int field2898; + private static int field2899; + private static int field2900; + private static int field2901; + private static int field2902; + private static int field2903; + private static int field2904; + private static int field2905; + private static int field2906; + private static int field2907; + private static int field2908; + private static int field2909; + private static int field2910; + private static int field2911; + private static int field2912; + private static int field2913; + private static int field2914; + private static int field2915; + private static int field2916; + private static int field2917; + private static int field2918; + private static int field2919; + private static int field2920; + private static int field2921; + private static int field2922; + private static int field2923; + private static int field2924; + private static int field2925; + private static int field2926; + private static int field2927; + private static int field2928; + private static int field2929; + private static int field2930; + private static int field2931; + private static int field2932; + private static int field2933; + private static int field2934; + private static int field2935; + private static int field2936; + private static int field2937; + private static int field2938; + private static int field2939; + private static int field2940; + private static int field2941; + private static int field2942; + private static int field2943; + private static int field2944; + private static int field2945; + private static int field2946; + private static int field2947; + private static int field2948; + private static int field2949; + private static int field2950; + private static int field2951; + private static int field2952; + private static int field2953; + private static int field2954; + private static int field2955; + private static int field2956; + private static int field2957; + private static int field2958; + private static int field2959; + private static int field2960; + private static int field2961; + private static int field2962; + private static int field2963; + private static int field2964; + private static int field2965; + private static int field2966; + private static int field2967; + private static int field2968; + private static int field2969; + private static int field2970; + private static int field2971; + private static int field2972; + private static int field2973; + private static int field2974; + private static int field2975; + private static int field2976; + private static int field2977; + private static int field2978; + private static int field2979; + private static int field2980; + private static int field2981; + private static int field2982; + private static int field2983; + private static int field2984; + private static int field2985; + private static int field2986; + private static int field2987; + private static int field2988; + private static int field2989; + private static int field2990; + private static int field2991; + private static int field2992; + private static int field2993; + private static int field2994; + private static int field2995; + private static int field2996; + private static int field2997; + private static int field2998; + private static int field2999; + private static int field3000; + private static int field3001; + private static int field3002; + private static int field3003; + private static int field3004; + private static int field3005; + private static int field3006; + private static int field3007; + private static int field3008; + private static int field3009; + private static int field3010; + private static int field3011; + private static int field3012; + private static int field3013; + private static int field3014; + private static int field3015; + private static int field3016; + private static int field3017; + private static int field3018; + private static int field3019; + private static int field3020; + private static int field3021; + private static int field3022; + private static int field3023; + private static int field3024; + private static int field3025; + private static int field3026; + private static int field3027; + private static int field3028; + private static int field3029; + private static int field3030; + private static int field3031; + private static int field3032; + private static int field3033; + private static int field3034; + private static int field3035; + private static int field3036; + private static int field3037; + private static int field3038; + private static int field3039; + private static int field3040; + private static int field3041; + private static int field3042; + private static int field3043; + private static int field3044; + private static int field3045; + private static int field3046; + private static int field3047; + private static int field3048; + private static int field3049; + private static int field3050; + private static int field3051; + private static int field3052; + private static int field3053; + private static int field3054; + private static int field3055; + private static int field3056; + private static int field3057; + private static int field3058; + private static int field3059; + private static int field3060; + private static int field3061; + private static int field3062; + private static int field3063; + private static int field3064; + private static int field3065; + private static int field3066; + private static int field3067; + private static int field3068; + private static int field3069; + private static int field3070; + private static int field3071; + private static int field3072; + private static int field3073; + private static int field3074; + private static int field3075; + private static int field3076; + private static int field3077; + private static int field3078; + private static int field3079; + private static int field3080; + private static int field3081; + private static int field3082; + private static int field3083; + private static int field3084; + private static int field3085; + private static int field3086; + private static int field3087; + private static int field3088; + private static int field3089; + private static int field3090; + private static int field3091; + private static int field3092; + private static int field3093; + private static int field3094; + private static int field3095; + private static int field3096; + private static int field3097; + private static int field3098; + private static int field3099; + private static int field3100; + private static int field3101; + private static int field3102; + private static int field3103; + private static int field3104; + private static int field3105; + private static int field3106; + private static int field3107; + private static int field3108; + private static int field3109; + private static int field3110; + private static int field3111; + private static int field3112; + private static int field3113; + private static int field3114; + private static int field3115; + private static int field3116; + private static int field3117; + private static int field3118; + private static int field3119; + private static int field3120; + private static int field3121; + private static int field3122; + private static int field3123; + private static int field3124; + private static int field3125; + private static int field3126; + private static int field3127; + private static int field3128; + private static int field3129; + private static int field3130; + private static int field3131; + private static int field3132; + private static int field3133; + private static int field3134; + private static int field3135; + private static int field3136; + private static int field3137; + private static int field3138; + private static int field3139; + private static int field3140; + private static int field3141; + private static int field3142; + private static int field3143; + private static int field3144; + private static int field3145; + private static int field3146; + private static int field3147; + private static int field3148; + private static int field3149; + private static int field3150; + private static int field3151; + private static int field3152; + private static int field3153; + private static int field3154; + private static int field3155; + private static int field3156; + private static int field3157; + private static int field3158; + private static int field3159; + private static int field3160; + private static int field3161; + private static int field3162; + private static int field3163; + private static int field3164; + private static int field3165; + private static int field3166; + private static int field3167; + private static int field3168; + private static int field3169; + private static int field3170; + private static int field3171; + private static int field3172; + private static int field3173; + private static int field3174; + private static int field3175; + private static int field3176; + private static int field3177; + private static int field3178; + private static int field3179; + private static int field3180; + private static int field3181; + private static int field3182; + private static int field3183; + private static int field3184; + private static int field3185; + private static int field3186; + private static int field3187; + private static int field3188; + private static int field3189; + private static int field3190; + private static int field3191; + private static int field3192; + private static int field3193; + private static int field3194; + private static int field3195; + private static int field3196; + private static int field3197; + private static int field3198; + private static int field3199; + private static int field3200; + private static int field3201; + private static int field3202; + private static int field3203; + private static int field3204; + private static int field3205; + private static int field3206; + private static int field3207; + private static int field3208; + private static int field3209; + private static int field3210; + private static int field3211; + private static int field3212; + private static int field3213; + private static int field3214; + private static int field3215; + private static int field3216; + private static int field3217; + private static int field3218; + private static int field3219; + private static int field3220; + private static int field3221; + private static int field3222; + private static int field3223; + private static int field3224; + private static int field3225; + private static int field3226; + private static int field3227; + private static int field3228; + private static int field3229; + private static int field3230; + private static int field3231; + private static int field3232; + private static int field3233; + private static int field3234; + private static int field3235; + private static int field3236; + private static int field3237; + private static int field3238; + private static int field3239; + private static int field3240; + private static int field3241; + private static int field3242; + private static int field3243; + private static int field3244; + private static int field3245; + private static int field3246; + private static int field3247; + private static int field3248; + private static int field3249; + private static int field3250; + private static int field3251; + private static int field3252; + private static int field3253; + private static int field3254; + private static int field3255; + private static int field3256; + private static int field3257; + private static int field3258; + private static int field3259; + private static int field3260; + private static int field3261; + private static int field3262; + private static int field3263; + private static int field3264; + private static int field3265; + private static int field3266; + private static int field3267; + private static int field3268; + private static int field3269; + private static int field3270; + private static int field3271; + private static int field3272; + private static int field3273; + private static int field3274; + private static int field3275; + private static int field3276; + private static int field3277; + private static int field3278; + private static int field3279; + private static int field3280; + private static int field3281; + private static int field3282; + private static int field3283; + private static int field3284; + private static int field3285; + private static int field3286; + private static int field3287; + private static int field3288; + private static int field3289; + private static int field3290; + private static int field3291; + private static int field3292; + private static int field3293; + private static int field3294; + private static int field3295; + private static int field3296; + private static int field3297; + private static int field3298; + private static int field3299; + private static int field3300; + private static int field3301; + private static int field3302; + private static int field3303; + private static int field3304; + private static int field3305; + private static int field3306; + private static int field3307; + private static int field3308; + private static int field3309; + private static int field3310; + private static int field3311; + private static int field3312; + private static int field3313; + private static int field3314; + private static int field3315; + private static int field3316; + private static int field3317; + private static int field3318; + private static int field3319; + private static int field3320; + private static int field3321; + private static int field3322; + private static int field3323; + private static int field3324; + private static int field3325; + private static int field3326; + private static int field3327; + private static int field3328; + private static int field3329; + private static int field3330; + private static int field3331; + private static int field3332; + private static int field3333; + private static int field3334; + private static int field3335; + private static int field3336; + private static int field3337; + private static int field3338; + private static int field3339; + private static int field3340; + private static int field3341; + private static int field3342; + private static int field3343; + private static int field3344; + private static int field3345; + private static int field3346; + private static int field3347; + private static int field3348; + private static int field3349; + private static int field3350; + private static int field3351; + private static int field3352; + private static int field3353; + private static int field3354; + private static int field3355; + private static int field3356; + private static int field3357; + private static int field3358; + private static int field3359; + private static int field3360; + private static int field3361; + private static int field3362; + private static int field3363; + private static int field3364; + private static int field3365; + private static int field3366; + private static int field3367; + private static int field3368; + private static int field3369; + private static int field3370; + private static int field3371; + private static int field3372; + private static int field3373; + private static int field3374; + private static int field3375; + private static int field3376; + private static int field3377; + private static int field3378; + private static int field3379; + private static int field3380; + private static int field3381; + private static int field3382; + private static int field3383; + private static int field3384; + private static int field3385; + private static int field3386; + private static int field3387; + private static int field3388; + private static int field3389; + private static int field3390; + private static int field3391; + private static int field3392; + private static int field3393; + private static int field3394; + private static int field3395; + private static int field3396; + private static int field3397; + private static int field3398; + private static int field3399; + private static int field3400; + private static int field3401; + private static int field3402; + private static int field3403; + private static int field3404; + private static int field3405; + private static int field3406; + private static int field3407; + private static int field3408; + private static int field3409; + private static int field3410; + private static int field3411; + private static int field3412; + private static int field3413; + private static int field3414; + private static int field3415; + private static int field3416; + private static int field3417; + private static int field3418; + private static int field3419; + private static int field3420; + private static int field3421; + private static int field3422; + private static int field3423; + private static int field3424; + private static int field3425; + private static int field3426; + private static int field3427; + private static int field3428; + private static int field3429; + private static int field3430; + private static int field3431; + private static int field3432; + private static int field3433; + private static int field3434; + private static int field3435; + private static int field3436; + private static int field3437; + private static int field3438; + private static int field3439; + private static int field3440; + private static int field3441; + private static int field3442; + private static int field3443; + private static int field3444; + private static int field3445; + private static int field3446; + private static int field3447; + private static int field3448; + private static int field3449; + private static int field3450; + private static int field3451; + private static int field3452; + private static int field3453; + private static int field3454; + private static int field3455; + private static int field3456; + private static int field3457; + private static int field3458; + private static int field3459; + private static int field3460; + private static int field3461; + private static int field3462; + private static int field3463; + private static int field3464; + private static int field3465; + private static int field3466; + private static int field3467; + private static int field3468; + private static int field3469; + private static int field3470; + private static int field3471; + private static int field3472; + private static int field3473; + private static int field3474; + private static int field3475; + private static int field3476; + private static int field3477; + private static int field3478; + private static int field3479; + private static int field3480; + private static int field3481; + private static int field3482; + private static int field3483; + private static int field3484; + private static int field3485; + private static int field3486; + private static int field3487; + private static int field3488; + private static int field3489; + private static int field3490; + private static int field3491; + private static int field3492; + private static int field3493; + private static int field3494; + private static int field3495; + private static int field3496; + private static int field3497; + private static int field3498; + private static int field3499; + private static int field3500; + private static int field3501; + private static int field3502; + private static int field3503; + private static int field3504; + private static int field3505; + private static int field3506; + private static int field3507; + private static int field3508; + private static int field3509; + private static int field3510; + private static int field3511; + private static int field3512; + private static int field3513; + private static int field3514; + private static int field3515; + private static int field3516; + private static int field3517; + private static int field3518; + private static int field3519; + private static int field3520; + private static int field3521; + private static int field3522; + private static int field3523; + private static int field3524; + private static int field3525; + private static int field3526; + private static int field3527; + private static int field3528; + private static int field3529; + private static int field3530; + private static int field3531; + private static int field3532; + private static int field3533; + private static int field3534; + private static int field3535; + private static int field3536; + private static int field3537; + private static int field3538; + private static int field3539; + private static int field3540; + private static int field3541; + private static int field3542; + private static int field3543; + private static int field3544; + private static int field3545; + private static int field3546; + private static int field3547; + private static int field3548; + private static int field3549; + private static int field3550; + private static int field3551; + private static int field3552; + private static int field3553; + private static int field3554; + private static int field3555; + private static int field3556; + private static int field3557; + private static int field3558; + private static int field3559; + private static int field3560; + private static int field3561; + private static int field3562; + private static int field3563; + private static int field3564; + private static int field3565; + private static int field3566; + private static int field3567; + private static int field3568; + private static int field3569; + private static int field3570; + private static int field3571; + private static int field3572; + private static int field3573; + private static int field3574; + private static int field3575; + private static int field3576; + private static int field3577; + private static int field3578; + private static int field3579; + private static int field3580; + private static int field3581; + private static int field3582; + private static int field3583; + private static int field3584; + private static int field3585; + private static int field3586; + private static int field3587; + private static int field3588; + private static int field3589; + private static int field3590; + private static int field3591; + private static int field3592; + private static int field3593; + private static int field3594; + private static int field3595; + private static int field3596; + private static int field3597; + private static int field3598; + private static int field3599; + private static int field3600; + private static int field3601; + private static int field3602; + private static int field3603; + private static int field3604; + private static int field3605; + private static int field3606; + private static int field3607; + private static int field3608; + private static int field3609; + private static int field3610; + private static int field3611; + private static int field3612; + private static int field3613; + private static int field3614; + private static int field3615; + private static int field3616; + private static int field3617; + private static int field3618; + private static int field3619; + private static int field3620; + private static int field3621; + private static int field3622; + private static int field3623; + private static int field3624; + private static int field3625; + private static int field3626; + private static int field3627; + private static int field3628; + private static int field3629; + private static int field3630; + private static int field3631; + private static int field3632; + private static int field3633; + private static int field3634; + private static int field3635; + private static int field3636; + private static int field3637; + private static int field3638; + private static int field3639; + private static int field3640; + private static int field3641; + private static int field3642; + private static int field3643; + private static int field3644; + private static int field3645; + private static int field3646; + private static int field3647; + private static int field3648; + private static int field3649; + private static int field3650; + private static int field3651; + private static int field3652; + private static int field3653; + private static int field3654; + private static int field3655; + private static int field3656; + private static int field3657; + private static int field3658; + private static int field3659; + private static int field3660; + private static int field3661; + private static int field3662; + private static int field3663; + private static int field3664; + private static int field3665; + private static int field3666; + private static int field3667; + private static int field3668; + private static int field3669; + private static int field3670; + private static int field3671; + private static int field3672; + private static int field3673; + private static int field3674; + private static int field3675; + private static int field3676; + private static int field3677; + private static int field3678; + private static int field3679; + private static int field3680; + private static int field3681; + private static int field3682; + private static int field3683; + private static int field3684; + private static int field3685; + private static int field3686; + private static int field3687; + private static int field3688; + private static int field3689; + private static int field3690; + private static int field3691; + private static int field3692; + private static int field3693; + private static int field3694; + private static int field3695; + private static int field3696; + private static int field3697; + private static int field3698; + private static int field3699; + private static int field3700; + private static int field3701; + private static int field3702; + private static int field3703; + private static int field3704; + private static int field3705; + private static int field3706; + private static int field3707; + private static int field3708; + private static int field3709; + private static int field3710; + private static int field3711; + private static int field3712; + private static int field3713; + private static int field3714; + private static int field3715; + private static int field3716; + private static int field3717; + private static int field3718; + private static int field3719; + private static int field3720; + private static int field3721; + private static int field3722; + private static int field3723; + private static int field3724; + private static int field3725; + private static int field3726; + private static int field3727; + private static int field3728; + private static int field3729; + private static int field3730; + private static int field3731; + private static int field3732; + private static int field3733; + private static int field3734; + private static int field3735; + private static int field3736; + private static int field3737; + private static int field3738; + private static int field3739; + private static int field3740; + private static int field3741; + private static int field3742; + private static int field3743; + private static int field3744; + private static int field3745; + private static int field3746; + private static int field3747; + private static int field3748; + private static int field3749; + private static int field3750; + private static int field3751; + private static int field3752; + private static int field3753; + private static int field3754; + private static int field3755; + private static int field3756; + private static int field3757; + private static int field3758; + private static int field3759; + private static int field3760; + private static int field3761; + private static int field3762; + private static int field3763; + private static int field3764; + private static int field3765; + private static int field3766; + private static int field3767; + private static int field3768; + private static int field3769; + private static int field3770; + private static int field3771; + private static int field3772; + private static int field3773; + private static int field3774; + private static int field3775; + private static int field3776; + private static int field3777; + private static int field3778; + private static int field3779; + private static int field3780; + private static int field3781; + private static int field3782; + private static int field3783; + private static int field3784; + private static int field3785; + private static int field3786; + private static int field3787; + private static int field3788; + private static int field3789; + private static int field3790; + private static int field3791; + private static int field3792; + private static int field3793; + private static int field3794; + private static int field3795; + private static int field3796; + private static int field3797; + private static int field3798; + private static int field3799; + private static int field3800; + private static int field3801; + private static int field3802; + private static int field3803; + private static int field3804; + private static int field3805; + private static int field3806; + private static int field3807; + private static int field3808; + private static int field3809; + private static int field3810; + private static int field3811; + private static int field3812; + private static int field3813; + private static int field3814; + private static int field3815; + private static int field3816; + private static int field3817; + private static int field3818; + private static int field3819; + private static int field3820; + private static int field3821; + private static int field3822; + private static int field3823; + private static int field3824; + private static int field3825; + private static int field3826; + private static int field3827; + private static int field3828; + private static int field3829; + private static int field3830; + private static int field3831; + private static int field3832; + private static int field3833; + private static int field3834; + private static int field3835; + private static int field3836; + private static int field3837; + private static int field3838; + private static int field3839; + private static int field3840; + private static int field3841; + private static int field3842; + private static int field3843; + private static int field3844; + private static int field3845; + private static int field3846; + private static int field3847; + private static int field3848; + private static int field3849; + private static int field3850; + private static int field3851; + private static int field3852; + private static int field3853; + private static int field3854; + private static int field3855; + private static int field3856; + private static int field3857; + private static int field3858; + private static int field3859; + private static int field3860; + private static int field3861; + private static int field3862; + private static int field3863; + private static int field3864; + private static int field3865; + private static int field3866; + private static int field3867; + private static int field3868; + private static int field3869; + private static int field3870; + private static int field3871; + private static int field3872; + private static int field3873; + private static int field3874; + private static int field3875; + private static int field3876; + private static int field3877; + private static int field3878; + private static int field3879; + private static int field3880; + private static int field3881; + private static int field3882; + private static int field3883; + private static int field3884; + private static int field3885; + private static int field3886; + private static int field3887; + private static int field3888; + private static int field3889; + private static int field3890; + private static int field3891; + private static int field3892; + private static int field3893; + private static int field3894; + private static int field3895; + private static int field3896; + private static int field3897; + private static int field3898; + private static int field3899; + private static int field3900; + private static int field3901; + private static int field3902; + private static int field3903; + private static int field3904; + private static int field3905; + private static int field3906; + private static int field3907; + private static int field3908; + private static int field3909; + private static int field3910; + private static int field3911; + private static int field3912; + private static int field3913; + private static int field3914; + private static int field3915; + private static int field3916; + private static int field3917; + private static int field3918; + private static int field3919; + private static int field3920; + private static int field3921; + private static int field3922; + private static int field3923; + private static int field3924; + private static int field3925; + private static int field3926; + private static int field3927; + private static int field3928; + private static int field3929; + private static int field3930; + private static int field3931; + private static int field3932; + private static int field3933; + private static int field3934; + private static int field3935; + private static int field3936; + private static int field3937; + private static int field3938; + private static int field3939; + private static int field3940; + private static int field3941; + private static int field3942; + private static int field3943; + private static int field3944; + private static int field3945; + private static int field3946; + private static int field3947; + private static int field3948; + private static int field3949; + private static int field3950; + private static int field3951; + private static int field3952; + private static int field3953; + private static int field3954; + private static int field3955; + private static int field3956; + private static int field3957; + private static int field3958; + private static int field3959; + private static int field3960; + private static int field3961; + private static int field3962; + private static int field3963; + private static int field3964; + private static int field3965; + private static int field3966; + private static int field3967; + private static int field3968; + private static int field3969; + private static int field3970; + private static int field3971; + private static int field3972; + private static int field3973; + private static int field3974; + private static int field3975; + private static int field3976; + private static int field3977; + private static int field3978; + private static int field3979; + private static int field3980; + private static int field3981; + private static int field3982; + private static int field3983; + private static int field3984; + private static int field3985; + private static int field3986; + private static int field3987; + private static int field3988; + private static int field3989; + private static int field3990; + private static int field3991; + private static int field3992; + private static int field3993; + private static int field3994; + private static int field3995; + private static int field3996; + private static int field3997; + private static int field3998; + private static int field3999; +} diff --git a/test/hotspot/jtreg/compiler/floatingpoint/TestRoundFloatAll.java b/test/hotspot/jtreg/compiler/floatingpoint/TestRoundFloatAll.java new file mode 100644 index 0000000000000..2ba60fd8e319f --- /dev/null +++ b/test/hotspot/jtreg/compiler/floatingpoint/TestRoundFloatAll.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8321010 + * @summary Test intrinsic for Math.round(float) in full 32 bits range + * + * @library /test/lib / + * @modules java.base/jdk.internal.math + * @requires os.arch == "riscv64" + * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileThresholdScaling=0.3 -XX:-UseSuperWord + * -XX:CompileCommand=compileonly,compiler.floatingpoint.TestRoundFloatAll::test* + * compiler.floatingpoint.TestRoundFloatAll + */ + +package compiler.floatingpoint; + +import static compiler.lib.golden.GoldenRound.golden_round; + +public class TestRoundFloatAll { + + public static void main(String args[]) { + test(); + } + + // return true when test fails + static boolean test(int n, float f) { + int actual = Math.round(f); + int expected = golden_round(f); + if (actual != expected) { + System.err.println("round error, input: " + f + ", res: " + actual + "expected: " + expected + ", input hex: " + n); + return true; + } + return false; + } + + static void test() { + final int ITERS = 11000; + boolean fail = false; + + // Warmup + System.out.println("Warmup"); + for (int i=0; i> (FloatConsts.SIGNIFICAND_WIDTH - 1); + int shift = (FloatConsts.SIGNIFICAND_WIDTH - 2 + + FloatConsts.EXP_BIAS) - biasedExp; + if ((shift & -32) == 0) { // shift >= 0 && shift < 32 + // a is a finite number such that pow(2,-32) <= ulp(a) < 1 + int r = ((intBits & FloatConsts.SIGNIF_BIT_MASK) + | (FloatConsts.SIGNIF_BIT_MASK + 1)); + if (intBits < 0) { + r = -r; + } + // In the comments below each Java expression evaluates to the value + // the corresponding mathematical expression: + // (r) evaluates to a / ulp(a) + // (r >> shift) evaluates to floor(a * 2) + // ((r >> shift) + 1) evaluates to floor((a + 1/2) * 2) + // (((r >> shift) + 1) >> 1) evaluates to floor(a + 1/2) + return ((r >> shift) + 1) >> 1; + } else { + // a is either + // - a finite number with abs(a) < exp(2,FloatConsts.SIGNIFICAND_WIDTH-32) < 1/2 + // - a finite number with ulp(a) >= 1 and hence a is a mathematical integer + // - an infinity or NaN + return (int) a; + } + } + + + public static long golden_round(double a) { + // below code is copied from java.base/share/classes/java/lang/Math.java + // public static int round(double a) { ... } + + long longBits = Double.doubleToRawLongBits(a); + long biasedExp = (longBits & DoubleConsts.EXP_BIT_MASK) + >> (DoubleConsts.SIGNIFICAND_WIDTH - 1); + long shift = (DoubleConsts.SIGNIFICAND_WIDTH - 2 + + DoubleConsts.EXP_BIAS) - biasedExp; + if ((shift & -64) == 0) { // shift >= 0 && shift < 64 + // a is a finite number such that pow(2,-64) <= ulp(a) < 1 + long r = ((longBits & DoubleConsts.SIGNIF_BIT_MASK) + | (DoubleConsts.SIGNIF_BIT_MASK + 1)); + if (longBits < 0) { + r = -r; + } + // In the comments below each Java expression evaluates to the value + // the corresponding mathematical expression: + // (r) evaluates to a / ulp(a) + // (r >> shift) evaluates to floor(a * 2) + // ((r >> shift) + 1) evaluates to floor((a + 1/2) * 2) + // (((r >> shift) + 1) >> 1) evaluates to floor(a + 1/2) + return ((r >> shift) + 1) >> 1; + } else { + // a is either + // - a finite number with abs(a) < exp(2,DoubleConsts.SIGNIFICAND_WIDTH-64) < 1/2 + // - a finite number with ulp(a) >= 1 and hence a is a mathematical integer + // - an infinity or NaN + return (long) a; + } + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 162f384dc07b2..16f56012d3dd9 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -276,25 +276,25 @@ public class IRNode { public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX; static { - String optoRegex = "(.*precise .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; + String optoRegex = "(.*precise .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_instance" + END; allocNodes(ALLOC, "Allocate", optoRegex); } public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX; static { - String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; + String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_instance" + END; optoOnly(ALLOC_OF, regex); } public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX; static { - String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; + String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_array" + END; allocNodes(ALLOC_ARRAY, "AllocateArray", optoRegex); } public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX; static { - String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; + String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: C2 Runtime new_array" + END; optoOnly(ALLOC_ARRAY_OF, regex); } @@ -514,11 +514,26 @@ public class IRNode { trapNodes(DIV_BY_ZERO_TRAP, "div0_check"); } + public static final String DIV_I = PREFIX + "DIV_I" + POSTFIX; + static { + beforeMatchingNameRegex(DIV_I, "DivI"); + } + public static final String DIV_L = PREFIX + "DIV_L" + POSTFIX; static { beforeMatchingNameRegex(DIV_L, "DivL"); } + public static final String DIV_MOD_I = PREFIX + "DIV_MOD_I" + POSTFIX; + static { + beforeMatchingNameRegex(DIV_MOD_I, "DivModI"); + } + + public static final String DIV_MOD_L = PREFIX + "DIV_MOD_L" + POSTFIX; + static { + beforeMatchingNameRegex(DIV_MOD_L, "DivModL"); + } + public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX; static { vectorNode(DIV_VF, "DivVF", TYPE_FLOAT); @@ -997,6 +1012,16 @@ public class IRNode { vectorNode(MIN_VL, "MinV", TYPE_LONG); } + public static final String MOD_I = PREFIX + "MOD_I" + POSTFIX; + static { + beforeMatchingNameRegex(MOD_I, "ModI"); + } + + public static final String MOD_L = PREFIX + "MOD_L" + POSTFIX; + static { + beforeMatchingNameRegex(MOD_L, "ModL"); + } + public static final String MUL = PREFIX + "MUL" + POSTFIX; static { beforeMatchingNameRegex(MUL, "Mul(I|L|F|D)"); diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestExplicitRangeChecks.java b/test/hotspot/jtreg/compiler/rangechecks/TestExplicitRangeChecks.java index ba045814fc2dd..83bfd63c629c6 100644 --- a/test/hotspot/jtreg/compiler/rangechecks/TestExplicitRangeChecks.java +++ b/test/hotspot/jtreg/compiler/rangechecks/TestExplicitRangeChecks.java @@ -25,6 +25,7 @@ * @test * @bug 8073480 * @summary explicit range checks should be recognized by C2 + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @library /test/lib / * @modules java.base/jdk.internal.misc:+open * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java b/test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java index 5fee59c751079..626f4c9b1f6aa 100644 --- a/test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java +++ b/test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java @@ -24,7 +24,7 @@ /* * @test * @bug 8030976 8059226 - * @requires !vm.graal.enabled + * @requires !vm.graal.enabled & (vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps) * @library /test/lib / * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java index 931b1a10e0bd7..bef57605f5f55 100644 --- a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java +++ b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java @@ -244,9 +244,9 @@ static void testUnsafeAccess() throws Exception { testMismatched(Test::testZ_S, Test::changeZ); testMismatched(Test::testZ_C, Test::changeZ); testMismatched(Test::testZ_I, Test::changeZ); - testMismatched(Test::testZ_J, Test::changeZ); + testMismatched(Test::testZ_J, Test::changeZ, false, ARRAY_BOOLEAN_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMismatched(Test::testZ_F, Test::changeZ); - testMismatched(Test::testZ_D, Test::changeZ); + testMismatched(Test::testZ_D, Test::changeZ, false, ARRAY_BOOLEAN_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // byte[], aligned accesses testMismatched(Test::testB_Z, Test::changeB); @@ -254,9 +254,9 @@ static void testUnsafeAccess() throws Exception { testMismatched(Test::testB_S, Test::changeB); testMismatched(Test::testB_C, Test::changeB); testMismatched(Test::testB_I, Test::changeB); - testMismatched(Test::testB_J, Test::changeB); + testMismatched(Test::testB_J, Test::changeB, false, ARRAY_BYTE_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMismatched(Test::testB_F, Test::changeB); - testMismatched(Test::testB_D, Test::changeB); + testMismatched(Test::testB_D, Test::changeB, false, ARRAY_BYTE_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // short[], aligned accesses testMismatched(Test::testS_Z, Test::changeS); @@ -264,9 +264,9 @@ static void testUnsafeAccess() throws Exception { testMatched( Test::testS_S, Test::changeS); testMismatched(Test::testS_C, Test::changeS); testMismatched(Test::testS_I, Test::changeS); - testMismatched(Test::testS_J, Test::changeS); + testMismatched(Test::testS_J, Test::changeS, false, ARRAY_SHORT_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMismatched(Test::testS_F, Test::changeS); - testMismatched(Test::testS_D, Test::changeS); + testMismatched(Test::testS_D, Test::changeS, false, ARRAY_SHORT_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // char[], aligned accesses testMismatched(Test::testC_Z, Test::changeC); @@ -274,9 +274,9 @@ static void testUnsafeAccess() throws Exception { testMismatched(Test::testC_S, Test::changeC); testMatched( Test::testC_C, Test::changeC); testMismatched(Test::testC_I, Test::changeC); - testMismatched(Test::testC_J, Test::changeC); + testMismatched(Test::testC_J, Test::changeC, false, ARRAY_CHAR_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMismatched(Test::testC_F, Test::changeC); - testMismatched(Test::testC_D, Test::changeC); + testMismatched(Test::testC_D, Test::changeC, false, ARRAY_CHAR_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // int[], aligned accesses testMismatched(Test::testI_Z, Test::changeI); @@ -284,9 +284,9 @@ static void testUnsafeAccess() throws Exception { testMismatched(Test::testI_S, Test::changeI); testMismatched(Test::testI_C, Test::changeI); testMatched( Test::testI_I, Test::changeI); - testMismatched(Test::testI_J, Test::changeI); + testMismatched(Test::testI_J, Test::changeI, false, ARRAY_INT_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMismatched(Test::testI_F, Test::changeI); - testMismatched(Test::testI_D, Test::changeI); + testMismatched(Test::testI_D, Test::changeI, false, ARRAY_INT_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // long[], aligned accesses testMismatched(Test::testJ_Z, Test::changeJ); @@ -304,9 +304,9 @@ static void testUnsafeAccess() throws Exception { testMismatched(Test::testF_S, Test::changeF); testMismatched(Test::testF_C, Test::changeF); testMismatched(Test::testF_I, Test::changeF); - testMismatched(Test::testF_J, Test::changeF); + testMismatched(Test::testF_J, Test::changeF, false, ARRAY_FLOAT_BASE_OFFSET == ARRAY_LONG_BASE_OFFSET); testMatched( Test::testF_F, Test::changeF); - testMismatched(Test::testF_D, Test::changeF); + testMismatched(Test::testF_D, Test::changeF, false, ARRAY_FLOAT_BASE_OFFSET == ARRAY_DOUBLE_BASE_OFFSET); // double[], aligned accesses testMismatched(Test::testD_Z, Test::changeD); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java new file mode 100644 index 0000000000000..530befbe2bcb5 --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectRiscv64.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 1234567 + * @summary Auto-vectorize Math.round API + * @requires vm.compiler2.enabled + * @requires os.arch == "riscv64" + * @requires vm.cpu.features ~= ".*rvv.*" + * @library /test/lib / + * @run driver compiler.vectorization.TestRoundVectRiscv64 + */ + +package compiler.vectorization; + +import compiler.lib.ir_framework.*; + +public class TestRoundVectRiscv64 { + private static final int ARRLEN = 1024; + private static final int ITERS = 11000; + + private static double [] dinp; + private static long [] lout; + private static float [] finp; + private static int [] iout; + + public static void main(String args[]) { + TestFramework.runWithFlags("-XX:-TieredCompilation", + "-XX:CompileThresholdScaling=0.3"); + System.out.println("PASSED"); + } + + @Test + @IR(counts = {IRNode.ROUND_VD, "> 0"}) + public void test_round_double(long[] lout, double[] dinp) { + for (int i = 0; i < lout.length; i+=1) { + lout[i] = Math.round(dinp[i]); + } + } + + @Run(test = {"test_round_double"}, mode = RunMode.STANDALONE) + public void kernel_test_round_double() { + dinp = new double[ARRLEN]; + lout = new long[ARRLEN]; + for (int i = 0 ; i < ARRLEN; i++) { + dinp[i] = (double)i*1.4; + } + for (int i = 0; i < ITERS; i++) { + test_round_double(lout , dinp); + } + } + + @Test + @IR(counts = {IRNode.ROUND_VF, "> 0"}) + public void test_round_float(int[] iout, float[] finp) { + for (int i = 0; i < finp.length; i+=1) { + iout[i] = Math.round(finp[i]); + } + } + + @Run(test = {"test_round_float"}, mode = RunMode.STANDALONE) + public void kernel_test_round() { + finp = new float[ARRLEN]; + iout = new int[ARRLEN]; + for (int i = 0 ; i < ARRLEN; i++) { + finp[i] = (float)i*1.4f; + } + for (int i = 0; i < ITERS; i++) { + test_round_float(iout , finp); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorDoubleRandom.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorDoubleRandom.java new file mode 100644 index 0000000000000..cd1a59c6d24e0 --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorDoubleRandom.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @key randomness + * @bug 8321011 + * @summary Test vector intrinsic for Math.round(double) with random input in 64 bits range, verify IR at the same time. + * + * @library /test/lib / + * @modules java.base/jdk.internal.math + * @requires os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*" + * @run main compiler.vectorization.TestRoundVectorDoubleRandom + */ + +package compiler.vectorization; + +import java.util.Random; +import static compiler.lib.golden.GoldenRound.golden_round; +import compiler.lib.ir_framework.IR; +import compiler.lib.ir_framework.IRNode; +import compiler.lib.ir_framework.Run; +import compiler.lib.ir_framework.RunInfo; +import compiler.lib.ir_framework.Test; +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.Warmup; + +public class TestRoundVectorDoubleRandom { + private static final Random rand = new Random(); + + private static final int ITERS = 11000; + private static final int ARRLEN = rand.nextInt(4096-997) + 997; + private static final double ADD_INIT = -7500.; + + private static final double[] input = new double[ARRLEN]; + private static final long [] res = new long[ARRLEN]; + + public static void main(String args[]) { + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=8"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=16"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=32"); + } + + @Test + @IR(counts = {IRNode.ROUND_VD, "> 0"}, + applyIf = {"MaxVectorSize", ">= 64"}) + static void test_round(long[] a0, double[] a1) { + for (int i = 0; i < a0.length; i+=1) { + a0[i] = Math.round(a1[i]); + } + } + + @Run(test = "test_round") + @Warmup(ITERS) + static void test_rounds(RunInfo runInfo) { + // Initialize + for (int i = 0; i < ARRLEN; i++) { + double val = ADD_INIT+(double)i; + input[i] = val; + } + + test_round(res, input); + // skip test/verify when warming up + if (runInfo.isWarmUp()) { + return; + } + + int errn = 0; + // a double precise float point is composed of 3 parts: sign/exponent/signicand + // exponent part of a float value + final int exponentShift = 52; + final int exponentWidth = 11; + final int exponentBound = 1 << exponentWidth; + // significant part of a float value + final int signicandWidth = exponentShift; + final long signicandBound = 1L << signicandWidth; + final int signicandNum = 256; + + // prepare for data of significand part + long signicandValues[] = new long[signicandNum]; + int signicandIdx = 0; + for (; signicandIdx < signicandWidth; signicandIdx++) { + signicandValues[signicandIdx] = 1L << signicandIdx; + } + for (; signicandIdx < signicandNum; signicandIdx++) { + signicandValues[signicandIdx] = rand.nextLong(signicandBound); + } + signicandValues[rand.nextInt(signicandNum)] = 0; + + // generate input arrays for testing, then run tests & verify results + + // generate input arrays by combining different parts + for (long sv : signicandValues) { + // generate test input by combining different parts: + // previously generated significand values, + // random value in exponent range, + // both positive and negative of previous combined values (exponent+significand) + final int exponentStart = rand.nextInt(9); + final int exponentStep = (1 << 3) + rand.nextInt(3); + // Here, we could have iterated the whole range of exponent values, but it would + // take more time to run the test, so just randomly choose some of exponent values. + int ev = exponentStart; + int inputIdx = 0; + for (; ev < exponentBound; ev += exponentStep) { + inputIdx = ev/exponentStep; + // combine exponent and significand + long bits = ((long)ev << exponentShift) + sv; + // combine sign(+/-) with exponent and significand + // positive values + input[inputIdx*2] = Double.longBitsToDouble(bits); + // negative values + bits = bits | (1L << 63); + input[inputIdx*2+1] = Double.longBitsToDouble(bits); + } + // add specific test cases where it looks like in binary format: + // s111 1111 1111 xxxx xxxx xxxx xxxx xxxx ... + // these are for the NaN and Inf. + inputIdx = inputIdx*2+2; + long bits = (1L << exponentWidth) - 1L; + bits <<= exponentShift; + input[inputIdx++] = Double.longBitsToDouble(bits); + bits = bits | (1L << 63); + input[inputIdx] = Double.longBitsToDouble(bits); + + // run tests + test_round(res, input); + + // verify results + ev = exponentStart; + inputIdx = ev/exponentStep; + for (; ev < exponentBound; ev += exponentStep) { + for (int sign = 0; sign < 2; sign++) { + int idx = inputIdx * 2 + sign; + if (res[idx] != golden_round(input[idx])) { + errn++; + System.err.println("round error, input: " + input[idx] + + ", res: " + res[idx] + "expected: " + golden_round(input[idx]) + + ", input hex: " + Double.doubleToLongBits(input[idx]) + + ", fi: " + sv + ", ei: " + ev + ", sign: " + sign); + } + } + } + } + + // generate pure random input arrays, which does not depend on significand/exponent values + for(int i = 0; i < 128; i++) { + for (int j = 0; j < ARRLEN; j++) { + input[j] = rand.nextDouble(); + } + + // run tests + test_round(res, input); + + // verify results + for (int j = 0; j < ARRLEN; j++) { + if (res[j] != golden_round(input[j])) { + errn++; + System.err.println("round error, input: " + input[j] + + ", res: " + res[j] + "expected: " + golden_round(input[j]) + + ", input hex: " + Double.doubleToLongBits(input[j])); + } + } + } + + // test cases for NaN, Inf, subnormal, and so on + { + Double[] dv = new Double[] { + +0.0, + -0.0, + Double.MAX_VALUE, + Double.MIN_VALUE, + Double.NEGATIVE_INFINITY, + Double.POSITIVE_INFINITY, + Double.NaN, + Double.longBitsToDouble(0x7ff0000000000001L), // another NaN + Double.MIN_NORMAL, + 0x0.fffffffffffffp-1022, // Maximum Subnormal Value + 1.5, + 100.5, + 10000.5, + -1.5, + -100.5, + -10000.5 + }; + for (int j = 0; j < ARRLEN; j++) { + input[j] = dv[rand.nextInt(dv.length)]; + } + + // run tests + test_round(res, input); + + // verify results + for (int j = 0; j < ARRLEN; j++) { + if (res[j] != golden_round(input[j])) { + errn++; + System.err.println("round error, input: " + input[j] + + ", res: " + res[j] + "expected: " + golden_round(input[j]) + + ", input hex: " + Double.doubleToLongBits(input[j])); + } + } + } + + if (errn > 0) { + throw new RuntimeException("There are some round error detected!"); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatAll.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatAll.java new file mode 100644 index 0000000000000..a85ac3eaa22e0 --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatAll.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8321010 + * @summary Test vector intrinsic for Math.round(float) in full 32 bits range + * + * @library /test/lib / + * @modules java.base/jdk.internal.math + * @requires os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*" + * @run main/othervm -XX:-TieredCompilation -XX:CompileThresholdScaling=0.3 -XX:+UseSuperWord -XX:CompileCommand=compileonly,compiler.vectorization.TestRoundVectorFloatAll::test* compiler.vectorization.TestRoundVectorFloatAll + * @run main/othervm -XX:-TieredCompilation -XX:CompileThresholdScaling=0.3 -XX:MaxVectorSize=32 -XX:+UseSuperWord -XX:CompileCommand=compileonly,compiler.vectorization.TestRoundVectorFloatAll::test* compiler.vectorization.TestRoundVectorFloatAll + */ + +package compiler.vectorization; + +import java.util.Random; +import static compiler.lib.golden.GoldenRound.golden_round; + +public class TestRoundVectorFloatAll { + private static final Random rand = new Random(); + + private static final int ITERS = 11000; + private static final int ARRLEN = rand.nextInt(4096-997) + 997; + private static final float ADD_INIT = -7500.f; + + public static void main(String args[]) { + test(); + } + + static void test() { + float[] input = new float[ARRLEN]; + int [] res = new int[ARRLEN]; + + // Warmup + System.out.println("Warmup"); + for (int i=0; i 0) { + throw new RuntimeException("There are some round error detected!"); + } + } + + static void test_round(int[] a0, float[] a1) { + for (int i = 0; i < a0.length; i+=1) { + a0[i] = Math.round(a1[i]); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatRandom.java b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatRandom.java new file mode 100644 index 0000000000000..7288e4d9f6396 --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorization/TestRoundVectorFloatRandom.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Rivos Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @key randomness + * @bug 8321010 + * @summary Test vector intrinsic for Math.round(float) with random input in 32 bits range, verify IR at the same time. + * + * @library /test/lib / + * @modules java.base/jdk.internal.math + * @requires os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*" + * @run main compiler.vectorization.TestRoundVectorFloatRandom + */ + +package compiler.vectorization; + +import java.util.Random; +import static compiler.lib.golden.GoldenRound.golden_round; +import compiler.lib.ir_framework.IR; +import compiler.lib.ir_framework.IRNode; +import compiler.lib.ir_framework.Run; +import compiler.lib.ir_framework.RunInfo; +import compiler.lib.ir_framework.Test; +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.Warmup; + +public class TestRoundVectorFloatRandom { + private static final Random rand = new Random(); + + private static final int ITERS = 11000; + private static final int ARRLEN = rand.nextInt(4096-997) + 997; + private static final float ADD_INIT = -7500.f; + + private static final float[] input = new float[ARRLEN]; + private static final int[] res = new int[ARRLEN]; + + public static void main(String args[]) { + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=8"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=16"); + TestFramework.runWithFlags("-XX:-TieredCompilation", "-XX:CompileThresholdScaling=0.3", "-XX:MaxVectorSize=32"); + } + + @Test + @IR(counts = {IRNode.ROUND_VF, "> 0"}, + applyIf = {"MaxVectorSize", ">= 32"}) + static void test_round(int[] a0, float[] a1) { + for (int i = 0; i < a0.length; i+=1) { + a0[i] = Math.round(a1[i]); + } + } + + @Run(test = "test_round") + @Warmup(ITERS) + static void test_rounds(RunInfo runInfo) { + // Initialize + for (int i = 0; i < ARRLEN; i++) { + float val = ADD_INIT+(float)i; + input[i] = val; + } + + test_round(res, input); + // skip test/verify when warming up + if (runInfo.isWarmUp()) { + return; + } + + int errn = 0; + // a single precise float point is composed of 3 parts: sign/exponent/signicand + // exponent part of a float value + final int exponentStart = 0; + final int exponentShift = 23; + final int exponentWidth = 8; + final int exponentBound = 1 << exponentWidth; + // significant part of a float value + final int signicandWidth = exponentShift; + final int signicandBound = 1 << signicandWidth; + final int signicandNum = 128; + + // prepare for data of significand part + int signicandValues[] = new int[signicandNum]; + int signicandIdx = 0; + for (; signicandIdx < signicandWidth; signicandIdx++) { + signicandValues[signicandIdx] = 1 << signicandIdx; + } + for (; signicandIdx < signicandNum; signicandIdx++) { + signicandValues[signicandIdx] = rand.nextInt(signicandBound); + } + signicandValues[rand.nextInt(signicandNum)] = 0; + + // generate input arrays for testing, then run tests & verify results + + // generate input arrays by combining different parts + for (int sv : signicandValues) { + // generate test input by combining different parts: + // previously generated significand values, + // all values in exponent range, + // both positive and negative of previous combined values (exponent+significand) + for (int ev = exponentStart; ev < exponentBound; ev++) { + // combine exponent and significand + int bits = (ev << exponentShift) + sv; + // combine sign(+/-) with exponent and significand + // positive values + input[ev*2] = Float.intBitsToFloat(bits); + // negative values + bits = bits | (1 << 31); + input[ev*2+1] = Float.intBitsToFloat(bits); + } + + // run tests + test_round(res, input); + + // verify results + for (int ev = exponentStart; ev < exponentBound; ev++) { + for (int sign = 0; sign < 2; sign++) { + int idx = ev * 2 + sign; + if (res[idx] != golden_round(input[idx])) { + errn++; + System.err.println("round error, input: " + input[idx] + + ", res: " + res[idx] + "expected: " + golden_round(input[idx]) + + ", input hex: " + Float.floatToIntBits(input[idx]) + + ", fi: " + sv + ", ei: " + ev + ", sign: " + sign); + } + } + } + } + + // generate pure random input arrays, which does not depend on significand/exponent values + for(int i = 0; i < 128; i++) { + for (int j = 0; j < ARRLEN; j++) { + input[j] = rand.nextFloat(); + } + + // run tests + test_round(res, input); + + // verify results + for (int j = 0; j < ARRLEN; j++) { + if (res[j] != golden_round(input[j])) { + errn++; + System.err.println("round error, input: " + input[j] + + ", res: " + res[j] + "expected: " + golden_round(input[j]) + + ", input hex: " + Float.floatToIntBits(input[j])); + } + } + } + + // test cases for NaN, Inf, subnormal, and so on + { + Float[] dv = new Float[] { + +0.0f, + -0.0f, + Float.MAX_VALUE, + Float.MIN_VALUE, + Float.NEGATIVE_INFINITY, + Float.POSITIVE_INFINITY, + Float.NaN, + Float.intBitsToFloat(0x7f800001), // another NaN + Float.MIN_NORMAL, + 0x0.fffffep-126f, // Maximum Subnormal Value + 1.5f, + 100.5f, + 10000.5f, + -1.5f, + -100.5f, + -10000.5f + }; + for (int j = 0; j < ARRLEN; j++) { + input[j] = dv[rand.nextInt(dv.length)]; + } + + // run tests + test_round(res, input); + + // verify results + for (int j = 0; j < ARRLEN; j++) { + if (res[j] != golden_round(input[j])) { + errn++; + System.err.println("round error, input: " + input[j] + + ", res: " + res[j] + "expected: " + golden_round(input[j]) + + ", input hex: " + Float.floatToIntBits(input[j])); + } + } + } + + if (errn > 0) { + throw new RuntimeException("There are some round error detected!"); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java index d1a61538f2e7e..18e7721e0d6c1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. + * Copyright (c) 2024, 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 @@ -24,6 +25,7 @@ /* * @test * @summary Vectorization test on basic boolean operations + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @library /test/lib / * * @build jdk.test.whitebox.WhiteBox @@ -71,12 +73,9 @@ public boolean[] vectorNot() { } @Test - @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.AND_VB, ">0"}) - @IR(applyIfCPUFeatureAnd = {"avx512f", "false", "sse2", "true"}, + @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, + phase = CompilePhase.BEFORE_MACRO_EXPANSION, counts = {IRNode.AND_VB, ">0"}) - @IR(applyIfCPUFeature = {"avx512f", "true"}, - counts = {IRNode.MACRO_LOGIC_V, ">0"}) public boolean[] vectorAnd() { boolean[] res = new boolean[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java b/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java index 1d9c8169d0433..91601479881c8 100644 --- a/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java @@ -25,6 +25,7 @@ * @test DeoptimizeFramesTest * @bug 8028595 * @summary testing of WB::deoptimizeFrames() + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/containers/systemd/HelloSystemd.java b/test/hotspot/jtreg/containers/systemd/HelloSystemd.java new file mode 100644 index 0000000000000..1b320131bf56d --- /dev/null +++ b/test/hotspot/jtreg/containers/systemd/HelloSystemd.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class HelloSystemd { + public static void main(String args[]) { + System.out.println("Hello Systemd"); + } +} diff --git a/test/hotspot/jtreg/containers/systemd/SystemdMemoryAwarenessTest.java b/test/hotspot/jtreg/containers/systemd/SystemdMemoryAwarenessTest.java new file mode 100644 index 0000000000000..2c06d48bb1c0a --- /dev/null +++ b/test/hotspot/jtreg/containers/systemd/SystemdMemoryAwarenessTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.containers.systemd.SystemdRunOptions; +import jdk.test.lib.containers.systemd.SystemdTestUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.whitebox.WhiteBox; +import jtreg.SkippedException; + +/* + * @test + * @bug 8322420 8217338 + * @summary Memory/CPU awareness test for JDK-under-test inside a systemd slice. + * @requires systemd.support + * @library /test/lib + * @modules java.base/jdk.internal.platform + * @build HelloSystemd jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:whitebox.jar -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SystemdMemoryAwarenessTest + */ +public class SystemdMemoryAwarenessTest { + + private static final int MB = 1024 * 1024; + private static final WhiteBox wb = WhiteBox.getWhiteBox(); + private static final String TEST_SLICE_NAME = SystemdMemoryAwarenessTest.class.getSimpleName() + "HS"; + + public static void main(String[] args) throws Exception { + testHelloSystemd(); + } + + private static void testHelloSystemd() throws Exception { + SystemdRunOptions opts = SystemdTestUtils.newOpts("HelloSystemd"); + // 1 GB memory, but the limit in the lower hierarchy is 512M + opts.memoryLimit("1024M"); + int expectedMemLimit = 512; + // expected detected limit we test for, 512MB + opts.sliceDMemoryLimit(String.format("%dM", expectedMemLimit)); + int physicalCpus = wb.hostCPUs(); + if (physicalCpus < 2) { + System.err.println("WARNING: host system only has " + physicalCpus + " cpus. Expected >= 2"); + System.err.println("The active_processor_count assertion will trivially pass."); + } + // Use a CPU core limit of 1 for best coverage + int coreLimit = 1; + System.out.println("DEBUG: Running test with a CPU limit of " + coreLimit); + opts.cpuLimit(String.format("%d%%", coreLimit * 100)); + opts.sliceName(TEST_SLICE_NAME); + + OutputAnalyzer out = SystemdTestUtils.buildAndRunSystemdJava(opts); + out.shouldHaveExitValue(0) + .shouldContain("Hello Systemd") + .shouldContain(String.format("Memory Limit is: %d", (expectedMemLimit * MB))); + try { + out.shouldContain("OSContainer::active_processor_count: " + coreLimit); + } catch (RuntimeException e) { + // CPU delegation needs to be enabled when run as user on cg v2 + if (SystemdTestUtils.RUN_AS_USER) { + String hint = "When run as user on cg v2 cpu delegation needs to be configured!"; + throw new SkippedException(hint); + } + throw e; + } + } + +} diff --git a/test/hotspot/jtreg/containers/systemd/TEST.properties b/test/hotspot/jtreg/containers/systemd/TEST.properties new file mode 100644 index 0000000000000..d563e5f166403 --- /dev/null +++ b/test/hotspot/jtreg/containers/systemd/TEST.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +exclusiveAccess.dirs=. diff --git a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java index 3bf83d9076864..6a9768de7e6e2 100644 --- a/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/x/TestAllocateHeapAt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -26,6 +26,7 @@ /* * @test TestAllocateHeapAt * @requires vm.gc.ZSinglegen & os.family == "linux" + * @requires !vm.opt.final.UseLargePages * @summary Test ZGC with -XX:AllocateHeapAt * @library /test/lib * @run main/othervm gc.x.TestAllocateHeapAt . true @@ -41,7 +42,7 @@ public static void main(String[] args) throws Exception { final String heapBackingFile = "Heap Backing File: " + directory; final String failedToCreateFile = "Failed to create file " + directory; - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xlog:gc*", diff --git a/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java b/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java index cb8685d0d090c..a48b6f77e17ef 100644 --- a/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java +++ b/test/hotspot/jtreg/gc/x/TestPageCacheFlush.java @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { } public static void main(String[] args) throws Exception { - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xms128M", diff --git a/test/hotspot/jtreg/gc/x/TestSmallHeap.java b/test/hotspot/jtreg/gc/x/TestSmallHeap.java index 8fc6f07be398f..a7e8042f92474 100644 --- a/test/hotspot/jtreg/gc/x/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/x/TestSmallHeap.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception { for (var maxCapacity: args) { - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:-ZGenerational", "-Xlog:gc,gc+init,gc+reloc,gc+heap", diff --git a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java index 9f47c4b60d3cb..2fb040840b4da 100644 --- a/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java +++ b/test/hotspot/jtreg/gc/z/TestAllocateHeapAt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -26,6 +26,7 @@ /* * @test TestAllocateHeapAt * @requires vm.gc.ZGenerational & os.family == "linux" + * @requires !vm.opt.final.UseLargePages * @summary Test ZGC with -XX:AllocateHeapAt * @library /test/lib * @run main/othervm gc.z.TestAllocateHeapAt . true @@ -41,7 +42,7 @@ public static void main(String[] args) throws Exception { final String heapBackingFile = "Heap Backing File: " + directory; final String failedToCreateFile = "Failed to create file " + directory; - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xlog:gc*", diff --git a/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java b/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java index 387053b580ad8..3b666ddc2c8a6 100644 --- a/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java +++ b/test/hotspot/jtreg/gc/z/TestPageCacheFlush.java @@ -68,7 +68,7 @@ public static void main(String[] args) throws Exception { } public static void main(String[] args) throws Exception { - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xms128M", diff --git a/test/hotspot/jtreg/gc/z/TestSmallHeap.java b/test/hotspot/jtreg/gc/z/TestSmallHeap.java index 354cd4164f1fd..67d9d33d2815e 100644 --- a/test/hotspot/jtreg/gc/z/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/z/TestSmallHeap.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception { for (var maxCapacity: args) { - ProcessTools.executeLimitedTestJava( + ProcessTools.executeTestJava( "-XX:+UseZGC", "-XX:+ZGenerational", "-Xlog:gc,gc+init,gc+reloc,gc+heap", diff --git a/test/hotspot/jtreg/gtest/CompressedKlassGtest.java b/test/hotspot/jtreg/gtest/CompressedKlassGtest.java new file mode 100644 index 0000000000000..e6377a8570df2 --- /dev/null +++ b/test/hotspot/jtreg/gtest/CompressedKlassGtest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. All rights reserved. + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * This runs the "compressedKlass" class of gtests. + * Note: we try to trigger bugs by enforcing the JVM to use zero-based mode. To increase the chance of zero-based + * mode, we start with CDS disabled, a small class space and a large (albeit uncommitted, to save memory) heap. The + * JVM will likely place the class space in low-address territory. + * (If it does not manage to do this, the test will still succeed, but it won't alert us on regressions) + */ + +/* @test id=use-zero-based-encoding + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.xml + * @run main/native GTestWrapper --gtest_filter=CompressedKlass* -Xlog:metaspace* -Xmx6g -Xms128m -Xshare:off -XX:CompressedClassSpaceSize=128m + */ diff --git a/test/hotspot/jtreg/resourcehogs/compiler/intrinsics/string/TestStringIntrinsics2LargeArray.java b/test/hotspot/jtreg/resourcehogs/compiler/intrinsics/string/TestStringIntrinsics2LargeArray.java index 598633d307f47..6ed778e6e0b28 100644 --- a/test/hotspot/jtreg/resourcehogs/compiler/intrinsics/string/TestStringIntrinsics2LargeArray.java +++ b/test/hotspot/jtreg/resourcehogs/compiler/intrinsics/string/TestStringIntrinsics2LargeArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +35,7 @@ * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * * @run main/othervm - * -mx8G + * -Xmx8G * -Xbootclasspath/a:. * -Xmixed * -XX:+UnlockDiagnosticVMOptions diff --git a/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupBadCPIndex.jcod b/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupBadCPIndex.jcod new file mode 100644 index 0000000000000..4802548926b42 --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupBadCPIndex.jcod @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * public class ContendedField { + * @Contended("group1") + * public int field; + * } + * + * We change the value of "value" so it refers to an invalid CP entry + */ + +class BadContendedGroupBadCPIndex { + 0xCAFEBABE; + 0; // minor version + 65; // version + [19] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadContendedGroupBadCPIndex"; // #8 at 0x3C + Utf8 "field"; // #9 at 0x4D + Utf8 "I"; // #10 at 0x55 + Utf8 "RuntimeVisibleAnnotations"; // #11 at 0x59 + Utf8 "Ljdk/internal/vm/annotation/Contended;"; // #12 at 0x75 + Utf8 "value"; // #13 at 0x9E + Utf8 "group1"; // #14 at 0xA6 + Utf8 "Code"; // #15 at 0xAF + Utf8 "LineNumberTable"; // #16 at 0xB6 + Utf8 "SourceFile"; // #17 at 0xC8 + Utf8 "BadContendedGroupBadCPIndex.java"; // #18 at 0xD5 + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [1] { // Fields + { // field at 0xF5 + 0x0001; // access + #9; // name_index : field + #10; // descriptor_index : I + [1] { // Attributes + Attr(#11, 11) { // RuntimeVisibleAnnotations at 0xFD + [1] { // annotations + { // annotation + #12; + [1] { // element_value_pairs + { // element value pair + #13; + { // element_value + 's'; + #1400; // Changed from #14 to #1400 + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Fields + + [1] { // Methods + { // method at 0x0110 + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#15, 29) { // Code at 0x0118 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#16, 6) { // LineNumberTable at 0x012F + [1] { // line_number_table + 0 2; // at 0x013B + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#17, 2) { // SourceFile at 0x013D + #18; + } // end SourceFile + } // Attributes +} // end class BadContendedGroupBadCPIndex diff --git a/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupWrongType.jcod b/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupWrongType.jcod new file mode 100644 index 0000000000000..6fa53f939b3dd --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadContendedGroupWrongType.jcod @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * public class ContendedField { + * @Contended("group1") + * public int field; + * } + * + * We change the value of "value" so it refers to the wrong type of CP entry + */ + +class BadContendedGroupWrongType { + 0xCAFEBABE; + 0; // minor version + 65; // version + [19] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadContendedGroupWrongType"; // #8 at 0x3C + Utf8 "field"; // #9 at 0x4D + Utf8 "I"; // #10 at 0x55 + Utf8 "RuntimeVisibleAnnotations"; // #11 at 0x59 + Utf8 "Ljdk/internal/vm/annotation/Contended;"; // #12 at 0x75 + Utf8 "value"; // #13 at 0x9E + Utf8 "group1"; // #14 at 0xA6 + Utf8 "Code"; // #15 at 0xAF + Utf8 "LineNumberTable"; // #16 at 0xB6 + Utf8 "SourceFile"; // #17 at 0xC8 + Utf8 "BadContendedGroupWrongType.java"; // #18 at 0xD5 + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [1] { // Fields + { // field at 0xF5 + 0x0001; // access + #9; // name_index : field + #10; // descriptor_index : I + [1] { // Attributes + Attr(#11, 11) { // RuntimeVisibleAnnotations at 0xFD + [1] { // annotations + { // annotation + #12; + [1] { // element_value_pairs + { // element value pair + #13; + { // element_value + 's'; + #7; // Changed from #14 (utf8) to #7 (class) + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Fields + + [1] { // Methods + { // method at 0x0110 + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#15, 29) { // Code at 0x0118 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#16, 6) { // LineNumberTable at 0x012F + [1] { // line_number_table + 0 2; // at 0x013B + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#17, 2) { // SourceFile at 0x013D + #18; + } // end SourceFile + } // Attributes +} // end class BadContendedGroupWrongType diff --git a/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtEnd.jcod b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtEnd.jcod new file mode 100644 index 0000000000000..991c4c832b3dc --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtEnd.jcod @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * + * public class DeprecatedMethod { + * @Deprecated(forRemoval=true, since="now") + * public static void m() {} + * } + * + * We add an extra junk member at the end. + */ + +class BadDeprecatedExtraMemberAtEnd { + 0xCAFEBABE; + 0; // minor version + 65; // version + [21] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadDeprecatedExtraMemberAtEnd"; // #8 at 0x3C + Utf8 "Code"; // #9 at 0x4F + Utf8 "LineNumberTable"; // #10 at 0x56 + Utf8 "m"; // #11 at 0x68 + Utf8 "Deprecated"; // #12 at 0x6C + Utf8 "RuntimeVisibleAnnotations"; // #13 at 0x79 + Utf8 "Ljava/lang/Deprecated;"; // #14 at 0x95 + Utf8 "forRemoval"; // #15 at 0xAE + int 0x00000001; // #16 at 0xBB + Utf8 "since"; // #17 at 0xC0 + Utf8 "now"; // #18 at 0xC8 + Utf8 "SourceFile"; // #19 at 0xCE + Utf8 "BadDeprecatedExtraMemberAtEnd.java"; // #20 at 0xDB + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // Fields + } // Fields + + [2] { // Methods + { // method at 0xFF + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0107 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x011E + [1] { // line_number_table + 0 1; // at 0x012A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + ; + { // method at 0x012A + 0x0009; // access + #11; // name_index : m + #6; // descriptor_index : ()V + [3] { // Attributes + Attr(#9, 25) { // Code at 0x0132 + 0; // max_stack + 0; // max_locals + Bytes[1]{ + 0xB1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0145 + [1] { // line_number_table + 0 4; // at 0x0151 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#12, 0) { // Deprecated at 0x0151 + } // end Deprecated + ; + Attr(#13, 21) { // RuntimeVisibleAnnotations at 0x0157 (length changed from 16 to 21) + [1] { // annotations + { // annotation + #14; + [3] { // element_value_pairs <= extra pair added + { // element value pair + #15; + { // element_value + 'Z'; + #16; + } // element_value + } // element value pair + ; + { // element value pair + #17; + { // element_value + 's'; + #18; + } // element_value + } // element value pair + ; + { // Extra element value pair: now=true + #18; + { // element_value + 'Z'; + #16; + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#19, 2) { // SourceFile at 0x016F + #20; + } // end SourceFile + } // Attributes +} // end class BadDeprecatedExtraMemberAtEnd diff --git a/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtStart.jcod b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtStart.jcod new file mode 100644 index 0000000000000..0adf08049fd6e --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedExtraMemberAtStart.jcod @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * + * public class DeprecatedMethod { + * @Deprecated(forRemoval=true, since="now") + * public static void m() {} + * } + * + * We add an extra junk member at the start. + */ + +class BadDeprecatedExtraMemberAtStart { + 0xCAFEBABE; + 0; // minor version + 65; // version + [21] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadDeprecatedExtraMemberAtStart"; // #8 at 0x3C + Utf8 "Code"; // #9 at 0x4F + Utf8 "LineNumberTable"; // #10 at 0x56 + Utf8 "m"; // #11 at 0x68 + Utf8 "Deprecated"; // #12 at 0x6C + Utf8 "RuntimeVisibleAnnotations"; // #13 at 0x79 + Utf8 "Ljava/lang/Deprecated;"; // #14 at 0x95 + Utf8 "forRemoval"; // #15 at 0xAE + int 0x00000001; // #16 at 0xBB + Utf8 "since"; // #17 at 0xC0 + Utf8 "now"; // #18 at 0xC8 + Utf8 "SourceFile"; // #19 at 0xCE + Utf8 "BadDeprecatedExtraMemberAtStart.java"; // #20 at 0xDB + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // Fields + } // Fields + + [2] { // Methods + { // method at 0xFF + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0107 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x011E + [1] { // line_number_table + 0 1; // at 0x012A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + ; + { // method at 0x012A + 0x0009; // access + #11; // name_index : m + #6; // descriptor_index : ()V + [3] { // Attributes + Attr(#9, 25) { // Code at 0x0132 + 0; // max_stack + 0; // max_locals + Bytes[1]{ + 0xB1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0145 + [1] { // line_number_table + 0 4; // at 0x0151 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#12, 0) { // Deprecated at 0x0151 + } // end Deprecated + ; + Attr(#13, 21) { // RuntimeVisibleAnnotations at 0x0157 (length changed from 16 to 21) + [1] { // annotations + { // annotation + #14; + [3] { // element_value_pairs <= extra pair added + { // Extra element value pair: now=true + #18; + { // element_value + 'Z'; + #16; + } // element_value + } // element value pair + ; + { // element value pair + #15; + { // element_value + 'Z'; + #16; + } // element_value + } // element value pair + ; + { // element value pair + #17; + { // element_value + 's'; + #18; + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#19, 2) { // SourceFile at 0x016F + #20; + } // end SourceFile + } // Attributes +} // end class BadDeprecatedExtraMemberAtStart diff --git a/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalBadCPIndex.jcod b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalBadCPIndex.jcod new file mode 100644 index 0000000000000..e8648e0c705bb --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalBadCPIndex.jcod @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * + * public class DeprecatedMethod { + * @Deprecated(forRemoval=true, since="now") + * public static void m() {} + * } + * + * We change the CP index for the value of forRemoval to a junk value + */ + +class BadDeprecatedForRemovalBadCPIndex { + 0xCAFEBABE; + 0; // minor version + 65; // version + [21] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadDeprecatedForRemovalBadCPIndex"; // #8 at 0x3C + Utf8 "Code"; // #9 at 0x4F + Utf8 "LineNumberTable"; // #10 at 0x56 + Utf8 "m"; // #11 at 0x68 + Utf8 "Deprecated"; // #12 at 0x6C + Utf8 "RuntimeVisibleAnnotations"; // #13 at 0x79 + Utf8 "Ljava/lang/Deprecated;"; // #14 at 0x95 + Utf8 "forRemoval"; // #15 at 0xAE + int 0x00000001; // #16 at 0xBB + Utf8 "since"; // #17 at 0xC0 + Utf8 "now"; // #18 at 0xC8 + Utf8 "SourceFile"; // #19 at 0xCE + Utf8 "BadDeprecatedForRemovalBadCPIndex.java"; // #20 at 0xDB + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // Fields + } // Fields + + [2] { // Methods + { // method at 0xFF + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0107 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x011E + [1] { // line_number_table + 0 1; // at 0x012A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + ; + { // method at 0x012A + 0x0009; // access + #11; // name_index : m + #6; // descriptor_index : ()V + [3] { // Attributes + Attr(#9, 25) { // Code at 0x0132 + 0; // max_stack + 0; // max_locals + Bytes[1]{ + 0xB1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0145 + [1] { // line_number_table + 0 4; // at 0x0151 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#12, 0) { // Deprecated at 0x0151 + } // end Deprecated + ; + Attr(#13, 16) { // RuntimeVisibleAnnotations at 0x0157 + [1] { // annotations + { // annotation + #14; + [2] { // element_value_pairs + { // element value pair + #17; + { // element_value + 's'; + #18; + } // element_value + } // element value pair + ; + { // element value pair + #15; + { // element_value + 'Z'; + #1600; // Changed from #16 to #1600 + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#19, 2) { // SourceFile at 0x016F + #20; + } // end SourceFile + } // Attributes +} // end class BadDeprecatedForRemovalBadCPIndex diff --git a/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalWrongType.jcod b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalWrongType.jcod new file mode 100644 index 0000000000000..9a2a536d664e3 --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedForRemovalWrongType.jcod @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * + * public class DeprecatedMethod { + * @Deprecated(forRemoval=true, since="now") + * public static void m() {} + * } + * + * We change the type of forRemoval from 'Z' to 's' but don't change the value + */ + +class BadDeprecatedForRemovalWrongType { + 0xCAFEBABE; + 0; // minor version + 65; // version + [21] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadDeprecatedForRemovalWrongType"; // #8 at 0x3C + Utf8 "Code"; // #9 at 0x4F + Utf8 "LineNumberTable"; // #10 at 0x56 + Utf8 "m"; // #11 at 0x68 + Utf8 "Deprecated"; // #12 at 0x6C + Utf8 "RuntimeVisibleAnnotations"; // #13 at 0x79 + Utf8 "Ljava/lang/Deprecated;"; // #14 at 0x95 + Utf8 "forRemoval"; // #15 at 0xAE + int 0x00000001; // #16 at 0xBB + Utf8 "since"; // #17 at 0xC0 + Utf8 "now"; // #18 at 0xC8 + Utf8 "SourceFile"; // #19 at 0xCE + Utf8 "BadDeprecatedForRemovalWrongType.java"; // #20 at 0xDB + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // Fields + } // Fields + + [2] { // Methods + { // method at 0xFF + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0107 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x011E + [1] { // line_number_table + 0 1; // at 0x012A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + ; + { // method at 0x012A + 0x0009; // access + #11; // name_index : m + #6; // descriptor_index : ()V + [3] { // Attributes + Attr(#9, 25) { // Code at 0x0132 + 0; // max_stack + 0; // max_locals + Bytes[1]{ + 0xB1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0145 + [1] { // line_number_table + 0 4; // at 0x0151 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#12, 0) { // Deprecated at 0x0151 + } // end Deprecated + ; + Attr(#13, 16) { // RuntimeVisibleAnnotations at 0x0157 + [1] { // annotations + { // annotation + #14; + [2] { // element_value_pairs + { // element value pair + #17; + { // element_value + 's'; + #18; + } // element_value + } // element value pair + ; + { // element value pair + #15; + { // element_value + 's'; // Changed from Z to s + #16; + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#19, 2) { // SourceFile at 0x016F + #20; + } // end SourceFile + } // Attributes +} // end class BadDeprecatedForRemovalWrongType diff --git a/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedSinceWrongType.jcod b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedSinceWrongType.jcod new file mode 100644 index 0000000000000..85863ea3b86a1 --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/BadDeprecatedSinceWrongType.jcod @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Based on source: + * + * public class DeprecatedMethod { + * @Deprecated(forRemoval=true, since="now") + * public static void m() {} + * } + * + * We change the type of since from 's' to 'Z' + */ + +class BadDeprecatedSinceWrongType { + 0xCAFEBABE; + 0; // minor version + 65; // version + [21] { // Constant Pool + ; // first element is empty + Method #2 #3; // #1 at 0x0A + class #4; // #2 at 0x0F + NameAndType #5 #6; // #3 at 0x12 + Utf8 "java/lang/Object"; // #4 at 0x17 + Utf8 ""; // #5 at 0x2A + Utf8 "()V"; // #6 at 0x33 + class #8; // #7 at 0x39 + Utf8 "BadDeprecatedSinceWrongType"; // #8 at 0x3C + Utf8 "Code"; // #9 at 0x4F + Utf8 "LineNumberTable"; // #10 at 0x56 + Utf8 "m"; // #11 at 0x68 + Utf8 "Deprecated"; // #12 at 0x6C + Utf8 "RuntimeVisibleAnnotations"; // #13 at 0x79 + Utf8 "Ljava/lang/Deprecated;"; // #14 at 0x95 + Utf8 "forRemoval"; // #15 at 0xAE + int 0x00000001; // #16 at 0xBB + Utf8 "since"; // #17 at 0xC0 + Utf8 "now"; // #18 at 0xC8 + Utf8 "SourceFile"; // #19 at 0xCE + Utf8 "BadDeprecatedSinceWrongType.java"; // #20 at 0xDB + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #7;// this_cpx + #2;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // Fields + } // Fields + + [2] { // Methods + { // method at 0xFF + 0x0001; // access + #5; // name_index : + #6; // descriptor_index : ()V + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0107 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x011E + [1] { // line_number_table + 0 1; // at 0x012A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } + ; + { // method at 0x012A + 0x0009; // access + #11; // name_index : m + #6; // descriptor_index : ()V + [3] { // Attributes + Attr(#9, 25) { // Code at 0x0132 + 0; // max_stack + 0; // max_locals + Bytes[1]{ + 0xB1; + } + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0145 + [1] { // line_number_table + 0 4; // at 0x0151 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#12, 0) { // Deprecated at 0x0151 + } // end Deprecated + ; + Attr(#13, 16) { // RuntimeVisibleAnnotations at 0x0157 + [1] { // annotations + { // annotation + #14; + [2] { // element_value_pairs + { // element value pair + #17; + { // element_value + 'Z'; // Changed from 's' to 'Z' + #18; + } // element_value + } // element value pair + ; + { // element value pair + #15; + { // element_value + 'Z'; + #16; + } // element_value + } // element value pair + } // element_value_pairs + } // annotation + } + } // end RuntimeVisibleAnnotations + } // Attributes + } + } // Methods + + [1] { // Attributes + Attr(#19, 2) { // SourceFile at 0x016F + #20; + } // end SourceFile + } // Attributes +} // end class BadDeprecatedSinceWrongType diff --git a/test/hotspot/jtreg/runtime/Annotations/TestBadAnnotations.java b/test/hotspot/jtreg/runtime/Annotations/TestBadAnnotations.java new file mode 100644 index 0000000000000..6617858d61bf2 --- /dev/null +++ b/test/hotspot/jtreg/runtime/Annotations/TestBadAnnotations.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8339192 + * @summary Check that malformed annotations don't cause crashes + * @compile BadDeprecatedExtraMemberAtEnd.jcod + * BadDeprecatedExtraMemberAtStart.jcod + * BadDeprecatedSinceWrongType.jcod + * BadDeprecatedForRemovalWrongType.jcod + * BadDeprecatedForRemovalBadCPIndex.jcod + * BadContendedGroupBadCPIndex.jcod + * BadContendedGroupWrongType.jcod + * @modules java.base/jdk.internal.vm.annotation + * @run main/othervm -XX:-RestrictContended TestBadAnnotations + */ +import java.lang.annotation.Annotation; +import java.lang.reflect.*; + +// None of the malformed nnotations should cause assertion failures or +// other crashes, nor exceptions - we simply don't process them. Note that +// even if the annotation is malformed the class will still be marked as having +// that annotation; it is only the "forRemoval" state of @Deprecated, and +// the "group" value of @Contended that is potentially afffected. +// There is no API to query what annotations the VM considers applied +// to a class/field/method, so we don't try to read anything back. + +// The testcases defined reflect the changes that were made to the code under +// 8339192 - we do not try to define exhaustive tests for every potential +// malformation. Each of these test case will trigger an assert prior to +// the fix. + +public class TestBadAnnotations { + public static void main(String[] args) throws Throwable { + Class c = Class.forName("BadDeprecatedExtraMemberAtEnd"); + c = Class.forName("BadDeprecatedExtraMemberAtStart"); + c = Class.forName("BadDeprecatedSinceWrongType"); + c = Class.forName("BadDeprecatedForRemovalWrongType"); + c = Class.forName("BadDeprecatedForRemovalBadCPIndex"); + c = Class.forName("BadContendedGroupBadCPIndex"); + c = Class.forName("BadContendedGroupWrongType"); + } +} diff --git a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java index f16e0ff9da4fd..d47a07d2decb2 100644 --- a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java +++ b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java @@ -36,7 +36,7 @@ import static jdk.test.lib.Platform.isWindows; /* - * @test id=preTouch + * @test id=preTouchTest * @summary Test AlwaysPreTouchThreadStacks * @requires os.family != "aix" * @library /test/lib @@ -45,23 +45,16 @@ * @run driver TestAlwaysPreTouchStacks preTouch */ -/* - * @test id=noPreTouch - * @summary Test that only touched committed memory is reported as thread stack usage. - * @requires os.family != "aix" - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @run driver TestAlwaysPreTouchStacks noPreTouch - */ - public class TestAlwaysPreTouchStacks { // We will create a bunch of large-stacked threads to make a significant imprint on combined thread stack size - final static int MB = 1024*1024; + final static int MB = 1024 * 1024; static int memoryCeilingMB = 128; static int threadStackSizeMB = 8; static int numThreads = memoryCeilingMB / threadStackSizeMB; + static long min_stack_usage_with_pretouch = 1 * MB; + static long max_stack_usage_with_pretouch = (long)(0.75 * threadStackSizeMB * MB); + static CyclicBarrier gate = new CyclicBarrier(numThreads + 1); static private final Thread createTestThread(int num) { @@ -79,10 +72,76 @@ static private final Thread createTestThread(int num) { } }, "TestThread-" + num, threadStackSizeMB * MB); + // Let test threads run as daemons to ensure that they are still running and + // that their stacks are still allocated when the JVM shuts down and the final + // NMT report is printed. t.setDaemon(true); return t; } + private static long runPreTouchTest(boolean preTouch) throws Exception { + long reserved = 0L, committed = 0L; + ArrayList vmArgs = new ArrayList<>(); + Collections.addAll(vmArgs, + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx100M", + "-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics"); + if (preTouch){ + vmArgs.add("-XX:+AlwaysPreTouchStacks"); + } + if (System.getProperty("os.name").contains("Linux")) { + vmArgs.add("-XX:-UseMadvPopulateWrite"); + } + Collections.addAll(vmArgs, "TestAlwaysPreTouchStacks", "test"); + ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmArgs); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + for (int i = 0; i < numThreads; i++) { + output.shouldContain("Alive: " + i); + } + + // If using -XX:+AlwaysPreTouchStacks, we want to see, in the final NMT printout, + // a committed thread stack size very close to reserved stack size. Like this: + // - Thread (reserved=10332400KB, committed=10284360KB) + // (thread #10021) + // (stack: reserved=10301560KB, committed=10253520KB) <<<< + // + // ... without -XX:+AlwaysPreTouchStacks, the committed/reserved ratio for thread stacks should be + // a lot lower, e.g.: + // - Thread (reserved=10332400KB, committed=331828KB) + // (thread #10021) + // (stack: reserved=10301560KB, committed=300988KB) <<< + + output.shouldMatch("- *Thread.*reserved.*committed"); + output.reportDiagnosticSummary(); + Pattern pat = Pattern.compile(".*stack: reserved=(\\d+), committed=(\\d+).*"); + boolean foundLine = false; + for (String line : output.asLines()) { + Matcher m = pat.matcher(line); + if (m.matches()) { + reserved = Long.parseLong(m.group(1)); + committed = Long.parseLong(m.group(2)); + System.out.println(">>>>> " + line + ": " + reserved + " - " + committed); + // Added sanity tests: we expect our test threads to be still alive when NMT prints its final + // report, so their stacks should dominate the NMT-reported total stack size. + long max_reserved = memoryCeilingMB * 3 * MB; + long min_reserved = memoryCeilingMB * MB; + if (reserved >= max_reserved || reserved < min_reserved) { + throw new RuntimeException("Total reserved stack sizes outside of our expectations (" + reserved + + ", expected " + min_reserved + ".." + max_reserved + ")"); + } + foundLine = true; + break; + } + } + if (!foundLine) { + throw new RuntimeException("Did not find expected NMT output"); + } + return committed; + } + public static void main(String[] args) throws Exception { if (args.length == 1 && args[0].equals("test")) { @@ -103,83 +162,23 @@ public static void main(String[] args) throws Exception { // should show up with fully - or almost fully - committed thread stacks. } else { - boolean preTouch; - if (args.length == 1 && args[0].equals("noPreTouch")){ - preTouch = false; - } else if (args.length == 1 && args[0].equals("preTouch")){ - preTouch = true; - } else { - throw new RuntimeException("Invalid test input. Must be 'preTouch' or 'noPreTouch'."); - } - ArrayList vmArgs = new ArrayList<>(); - Collections.addAll(vmArgs, - "-XX:+UnlockDiagnosticVMOptions", - "-Xmx100M", - "-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics"); - if (preTouch){ - vmArgs.add("-XX:+AlwaysPreTouchStacks"); - } - if (System.getProperty("os.name").contains("Linux")) { - vmArgs.add("-XX:-UseMadvPopulateWrite"); - } - Collections.addAll(vmArgs, "TestAlwaysPreTouchStacks", "test"); - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmArgs); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.reportDiagnosticSummary(); - - output.shouldHaveExitValue(0); - - for (int i = 0; i < numThreads; i++) { - output.shouldContain("Alive: " + i); - } - - // If using -XX:+AlwaysPreTouchStacks, we want to see, in the final NMT printout, - // a committed thread stack size very close to reserved stack size. Like this: - // - Thread (reserved=10332400KB, committed=10284360KB) - // (thread #10021) - // (stack: reserved=10301560KB, committed=10253520KB) <<<< - // - // ... without -XX:+AlwaysPreTouchStacks, the committed/reserved ratio for thread stacks should be - // a lot lower, e.g.: - // - Thread (reserved=10332400KB, committed=331828KB) - // (thread #10021) - // (stack: reserved=10301560KB, committed=300988KB) <<< - - output.shouldMatch("- *Thread.*reserved.*committed"); - Pattern pat = Pattern.compile(".*stack: reserved=(\\d+), committed=(\\d+).*"); - boolean foundLine = false; - for (String line : output.asLines()) { - Matcher m = pat.matcher(line); - if (m.matches()) { - long reserved = Long.parseLong(m.group(1)); - long committed = Long.parseLong(m.group(2)); - System.out.println(">>>>> " + line + ": " + reserved + " - " + committed); - // This is a bit fuzzy: even with PreTouch we don't commit the full range of what NMT counts - // as thread stack. But without pre-touching, the thread stacks would be committed to about 1/5th - // of their reserved size. Requiring them to be committed for over 3/4th shows that pretouch is - // really working. - if (preTouch && (double)committed < ((double)reserved * 0.75)) { - throw new RuntimeException("Expected a higher ratio between stack committed and reserved."); - } else if (!preTouch && (double)committed > ((double)reserved * 0.50)){ - throw new RuntimeException("Expected a lower ratio between stack committed and reserved."); - } - // Added sanity tests: we expect our test threads to be still alive when NMT prints its final - // report, so their stacks should dominate the NMT-reported total stack size. - long max_reserved = memoryCeilingMB * 3 * MB; - long min_reserved = memoryCeilingMB * MB; - if (reserved >= max_reserved || reserved < min_reserved) { - throw new RuntimeException("Total reserved stack sizes outside of our expectations (" + reserved + - ", expected " + min_reserved + ".." + max_reserved + ")"); - } - foundLine = true; - break; - } - } - if (!foundLine) { - throw new RuntimeException("Did not find expected NMT output"); - } - } - + long pretouch_committed = runPreTouchTest(true); + long no_pretouch_committed = runPreTouchTest(false); + if (pretouch_committed == 0 || no_pretouch_committed == 0) { + throw new RuntimeException("Could not run with PreTouch flag."); + } + long expected_delta = numThreads * (max_stack_usage_with_pretouch - min_stack_usage_with_pretouch); + long actual_delta = pretouch_committed - no_pretouch_committed; + if (pretouch_committed <= (no_pretouch_committed + expected_delta)) { + throw new RuntimeException("Expected a higher amount of committed with pretouch stacks" + + "PreTouch amount: " + pretouch_committed + + "NoPreTouch amount: " + (no_pretouch_committed + expected_delta)); + } + if (actual_delta < expected_delta) { + throw new RuntimeException("Expected a higher delta between stack committed of with and without pretouch." + + "Expected: " + expected_delta + " Actual: " + actual_delta); + } + } } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java index f0d797c09aedf..fe618256f652f 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -27,9 +27,11 @@ * @summary Class-Path: attribute in MANIFEST file * @requires vm.cds * @library /test/lib + * @compile test-classes/Hello.java * @run driver/timeout=240 ClassPathAttr */ +import jdk.test.lib.Platform; import jdk.test.lib.cds.CDSTestUtils; import jdk.test.lib.process.OutputAnalyzer; import java.io.File; @@ -44,6 +46,7 @@ public class ClassPathAttr { public static void main(String[] args) throws Exception { testNormalOps(); testNonExistentJars(); + testClassPathAttrJarOnCP(); } static void testNormalOps() throws Exception { @@ -82,6 +85,76 @@ static void testNormalOps() throws Exception { output.shouldMatch("checking shared classpath entry: .*cpattr2.jar"); output.shouldMatch("checking shared classpath entry: .*cpattr3.jar"); }); + + // Test handling of forward slash ('/') file separator when locating entries + // in the classpath entry on Windows. + // Skip the following test when CDS dynamic dump is enabled due to some + // issue when converting a relative path to real path. + if (Platform.isWindows() && !CDSTestUtils.DYNAMIC_DUMP) { + // Test with relative path + // Find the index to the dir before the jar file. + int idx = jar1.lastIndexOf(File.separator); + idx = jar1.substring(0, idx - 1).lastIndexOf(File.separator); + // Setup jar directory and names. + String jarDir = jar1.substring(0, idx); + String jar1Name = jar1.substring(idx + 1); + String jar4Name = jar4.substring(idx + 1); + String newCp = jar1Name.replace("\\", "/") + File.pathSeparator + jar4Name.replace("\\", "/"); + + OutputAnalyzer out = TestCommon.testDump(jarDir, newCp, classlist, "-Xlog:class+path=info"); + if (i == 1) { + out.shouldMatch("opened:.*cpattr1.jar"); // first jar on -cp + } else { + // first jar on -cp with long Class-Path: attribute + out.shouldMatch("opened:.*cpattr1_long.jar"); + } + // one of the jar in the Class-Path: attribute of cpattr1.jar + out.shouldMatch("opened:.*cpattr2.jar"); + + TestCommon.runWithRelativePath( + jarDir.replace("\\", "/"), + "-Xlog:class+path,class+load", + "-cp", newCp, + "CpAttr1") + .assertNormalExit(output -> { + output.shouldMatch("checking shared classpath entry: .*cpattr2.jar"); + output.shouldMatch("checking shared classpath entry: .*cpattr3.jar"); + }); + + // Go one directory up. + int idx2 = jar1.substring(0, idx - 1).lastIndexOf(File.separator); + if (idx2 != -1) { + // Setup jar directory and names. + jarDir = jar1.substring(0, idx2); + // Set relative path to jar containing '\' and '/' file separators + // e.g. d1\d2/A.jar + jar1Name = jar1.substring(idx2 + 1).replace("\\", "/"); + jar4Name = jar4.substring(idx2 + 1).replace("\\", "/"); + jar1Name = jar1Name.replaceFirst("/", "\\\\"); + jar4Name = jar4Name.replaceFirst("/", "\\\\"); + + newCp = jar1Name + File.pathSeparator + jar4Name; + out = TestCommon.testDump(jarDir, newCp, classlist, "-Xlog:class+path=info"); + if (i == 1) { + out.shouldMatch("opened:.*cpattr1.jar"); // first jar on -cp + } else { + // first jar on -cp with long Class-Path: attribute + out.shouldMatch("opened:.*cpattr1_long.jar"); + } + // one of the jar in the Class-Path: attribute of cpattr1.jar + out.shouldMatch("opened:.*cpattr2.jar"); + + TestCommon.runWithRelativePath( + jarDir.replace("\\", "/"), + "-Xlog:class+path,class+load", + "-cp", newCp, + "CpAttr1") + .assertNormalExit(output -> { + output.shouldMatch("checking shared classpath entry: .*cpattr2.jar"); + output.shouldMatch("checking shared classpath entry: .*cpattr3.jar"); + }); + } + } } // test duplicate jars in the "Class-path" attribute in the jar manifest @@ -126,6 +199,62 @@ static void testNonExistentJars() throws Exception { }); } + static void testClassPathAttrJarOnCP() throws Exception { + String helloJar = JarBuilder.getOrCreateHelloJar(); + String jar1 = TestCommon.getTestJar("cpattr1.jar"); + String cp = jar1 + File.pathSeparator + helloJar; + + // The cpattr1.jar contains "Class-Path: cpattr2.jar". + // The cpattr2.jar contains "Class-Path: cpattr3.jar cpattr5_123456789_223456789_323456789_42345678.jar". + // With -cp cpattr1:hello.jar, the following shared paths should be stored in the CDS archive: + // cpattr1.jar:cpattr2.jar:cpattr3.jar:cpattr5_123456789_223456789_323456789_42345678.jari:hello.jar + TestCommon.testDump(cp, TestCommon.list("Hello"), "-Xlog:class+path"); + + // Run with the same -cp apattr1.jar:hello.jar. The Hello class should be + // loaded from the archive. + TestCommon.run("-Xlog:class+path,class+load", + "-cp", cp, + "Hello") + .assertNormalExit(output -> { + output.shouldContain("Hello source: shared objects file"); + }); + + // Run with -cp apattr1.jar:cpattr2.jar:hello.jar. App classpath mismatch should be detected. + String jar2 = TestCommon.getTestJar("cpattr2.jar"); + cp = jar1 + File.pathSeparator + jar2 + File.pathSeparator + helloJar; + TestCommon.run("-Xlog:class+path,class+load", + "-cp", cp, + "Hello") + .assertAbnormalExit(output -> { + output.shouldMatch(".*APP classpath mismatch, actual: -Djava.class.path=.*cpattr1.jar.*cpattr2.jar.*hello.jar") + .shouldContain("Unable to use shared archive."); + }); + + // Run with different -cp cpattr2.jar:hello.jar. App classpath mismatch should be detected. + cp = jar2 + File.pathSeparator + helloJar; + TestCommon.run("-Xlog:class+path,class+load", + "-cp", cp, + "Hello") + .assertAbnormalExit(output -> { + output.shouldMatch(".*APP classpath mismatch, actual: -Djava.class.path=.*cpattr2.jar.*hello.jar") + .shouldContain("Unable to use shared archive."); + }); + + // Dumping with -cp cpattr1.jar:cpattr2.jar:hello.jar + // The cpattr2.jar is from the Class-Path: attribute of cpattr1.jar. + cp = jar1 + File.pathSeparator + jar2 + File.pathSeparator + helloJar; + TestCommon.testDump(cp, TestCommon.list("Hello"), "-Xlog:class+path"); + + // Run with the same -cp as dump time. The Hello class should be loaded from the archive. + TestCommon.run("-Xlog:class+path,class+load", + "-cp", cp, + "Hello") + .assertNormalExit(output -> { + output.shouldContain("Hello source: shared objects file"); + }); + + } + private static void buildCpAttr(String jarName, String manifest, String enclosingClassName, String ...testClassNames) throws Exception { String jarClassesDir = CDSTestUtils.getOutputDir() + File.separator + jarName + "_classes"; try { Files.createDirectory(Paths.get(jarClassesDir)); } catch (FileAlreadyExistsException e) { } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java index 86b2c8fd425a8..2ad257476d0fb 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java @@ -108,9 +108,9 @@ public static void test(String[] args_ignored) throws Exception { testDump(1, "-XX:+UseZGC", "-XX:-UseCompressedOops", null, false); } - // incompatible GCs - testDump(2, "-XX:+UseParallelGC", "", GC_WARNING, false); - testDump(3, "-XX:+UseSerialGC", "", GC_WARNING, false); + // Dump heap objects with ParallelGC and SerialGC + testDump(2, "-XX:+UseParallelGC", "", "", false); + testDump(3, "-XX:+UseSerialGC", "", "", false); // Explicitly archive with compressed oops, run without. testDump(5, "-XX:+UseG1GC", "-XX:+UseCompressedOops", null, false); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java index 01cebb29f9138..3e2145c782188 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java @@ -27,6 +27,7 @@ * @summary Use a shared string allocated in a humongous G1 region. * @comment -- the following implies that G1 is used (by command-line or by default) * @requires vm.cds.write.archived.java.heap + * @requires vm.gc.G1 * * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java index 57e39b5177aaa..4026f1d4f8414 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java @@ -96,7 +96,7 @@ public static OutputAnalyzer dumpWithoutChecks(String appClasses[], String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = - TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC", + TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile(sharedDataFile)); args = TestCommon.concat(childVMOptionsPrefix, args); @@ -124,7 +124,7 @@ public static OutputAnalyzer runWithArchiveAuto(String className, String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, - "-cp", appJar, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + "-cp", appJar, "-XX:+UseCompressedOops", className); args = TestCommon.concat(childVMOptionsPrefix, args); OutputAnalyzer output = TestCommon.execAuto(args); @@ -143,7 +143,7 @@ public static OutputAnalyzer runWithArchive(String[] extraMatches, String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, - "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + "-XX:+UseCompressedOops", className); args = TestCommon.concat(childVMOptionsPrefix, args); OutputAnalyzer output = TestCommon.exec(appJar, args); diff --git a/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java b/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java index a07c98caa6638..3e36d1aebd9c2 100644 --- a/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java +++ b/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -25,7 +25,6 @@ * @test * @bug 8186211 * @summary CONSTANT_Dynamic_info structure's tries to use a BSM index whose signature is for an invokedynamic and vice versa. - * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyUsesIndyBSM.jcod @@ -42,7 +41,7 @@ public class BadBSMUseTest { public static void main(String args[]) throws Throwable { // 1. Test a CONSTANT_Dynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_InvokeDynamic_info - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyUsesIndyBSM"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("CondyUsesIndyBSM"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Indybsm target CallSite method foo"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); @@ -50,7 +49,7 @@ public static void main(String args[]) throws Throwable { // 2. Test a CONSTANT_InvokeDynamic_info's bootstrap_method_attr_index points // at a BSM meant for a CONSTANT_Dynamic_info - pb = ProcessTools.createLimitedTestJavaProcessBuilder("IndyUsesCondyBSM"); + pb = ProcessTools.createTestJavaProcessBuilder("IndyUsesCondyBSM"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In Condybsm"); oa.shouldContain("BootstrapMethodError: bootstrap method initialization exception"); diff --git a/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java b/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java index 22cfb727eb8b8..1b045d1e36e76 100644 --- a/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java +++ b/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -25,7 +25,6 @@ * @test * @bug 8186211 * @summary Tests various ldc, ldc_w, ldc2_w instructions of CONSTANT_Dynamic. - * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyUseLDC_W.jasm @@ -42,7 +41,7 @@ public class CondyLDCTest { public static void main(String args[]) throws Throwable { // 1. Test a ldc_w instruction can be used with condy's which generate // loadable constants of the following types: byte, char, short, float, integer, boolean. - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Xverify:all", "CondyUseLDC_W"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldNotContain("VerifyError"); @@ -50,7 +49,7 @@ public static void main(String args[]) throws Throwable { // 2. Test ldc2_w of a condy which returns a dynamically generated // float constant, generates a VerifyError. - pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + pb = ProcessTools.createTestJavaProcessBuilder("-Xverify:all", "CondyBadLDC2_W"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); @@ -59,7 +58,7 @@ public static void main(String args[]) throws Throwable { // 3. Test a ldc of a condy which returns a dynamically generated // double constant, generates a VerifyError. - pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + pb = ProcessTools.createTestJavaProcessBuilder("-Xverify:all", "CondyBadLDC"); oa = new OutputAnalyzer(pb.start()); oa.shouldContain("java.lang.VerifyError: Illegal type at constant pool entry"); diff --git a/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java b/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java index 6e810d0d3b88c..ddada0edbf7b9 100644 --- a/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java +++ b/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -25,7 +25,6 @@ * @test * @bug 8186211 * @summary Test CONSTANT_Dynamic where the BSM is invoked via a REF_newInvokeSpecial. - * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyNewInvokeSpecial.jasm @@ -38,7 +37,7 @@ public class CondyNewInvokeSpecialTest { public static void main(String args[]) throws Throwable { - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xverify:all", + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-Xverify:all", "CondyNewInvokeSpecial"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); oa.shouldContain("In CondyNewInvokeSpecial method"); diff --git a/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java index 877a805c445fd..a90b987db1461 100644 --- a/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java +++ b/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -26,7 +26,6 @@ * @bug 8216970 * @summary Ensure escape analysis can handle an ldc of a dynamic * constant whose return type is an array of boolean. - * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile TestEscapeThroughInvokeWithCondy$A.jasm @@ -43,7 +42,7 @@ public class TestEscapeCondy { public static void main(String args[]) throws Throwable { // 1. Test escape analysis of a method that contains // a ldc instruction of a condy whose return type is an array of boolean - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( "-XX:CompileCommand=dontinline,runtime.condy.TestEscapeThroughInvokeWithCondy::create", "runtime.condy.TestEscapeThroughInvokeWithCondy"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); diff --git a/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java b/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java index 2b572edb66fec..412a1639e69ce 100644 --- a/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java +++ b/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -25,7 +25,6 @@ * @test * @bug 8228485 * @summary Correctly handle initialization error for Condy BSM. - * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile Example.jasm @@ -38,7 +37,7 @@ public class TestInitException { public static void main(java.lang.String[] unused) throws Exception { - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("Example"); + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("Example"); OutputAnalyzer oa = new OutputAnalyzer(pb.start()); // First call stack trace // shouldMatch is used to workaround CODETOOLS-7902686 @@ -52,4 +51,3 @@ public static void main(java.lang.String[] unused) throws Exception { oa.shouldHaveExitValue(1); } } - diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/EventsTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/EventsTest.java index b5fca58a5c5f3..9828a8990e025 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/EventsTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/EventsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -25,6 +25,7 @@ import jdk.test.lib.dcmd.JMXExecutor; import jdk.test.lib.process.OutputAnalyzer; import org.testng.annotations.Test; +import org.testng.Assert; /* * @test @@ -38,6 +39,9 @@ */ public class EventsTest { + // MAX should be less than number of actually recorded events + private static int MAX = 9; + static String buildHeaderPattern(String logname) { return "^" + logname + ".*\\(\\d+ events\\):"; } @@ -64,9 +68,27 @@ public void run_selected(CommandExecutor executor) { output.stdoutShouldNotMatch(buildHeaderPattern("Classes unloaded")); } + public void run_max(CommandExecutor executor) { + OutputAnalyzer output = executor.execute("VM.events max=" + MAX); + long lines = output.asLines().stream().filter(x -> x.contains("Loading class")).count(); + Assert.assertTrue(lines == MAX, "There are should be " + MAX + " lines"); + } + + public void run_max_selected(CommandExecutor executor) { + OutputAnalyzer output = executor.execute("VM.events log=load max=" + MAX); + output.stdoutShouldMatch(buildHeaderPattern("Classes loaded")); + long lines = output.asLines().stream().filter(x -> x.contains("Loading class")).count(); + Assert.assertTrue(lines == MAX, "There are should be " + MAX + " lines"); + output.stdoutShouldNotMatch(buildHeaderPattern("Events")); + output.stdoutShouldNotMatch(buildHeaderPattern("Compilation")); + } + + @Test public void jmx() { run_all(new JMXExecutor()); run_selected(new JMXExecutor()); + run_max(new JMXExecutor()); + run_max_selected(new JMXExecutor()); } } diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemDumpMapTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemDumpMapTest.java index eb0b6bd8566ae..eab69de0a518c 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemDumpMapTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemDumpMapTest.java @@ -35,7 +35,7 @@ * @test * @summary Test of diagnostic command System.map * @library /test/lib - * @requires (os.family=="linux") + * @requires (os.family == "linux" | os.family == "windows") * @modules java.base/jdk.internal.misc * java.compiler * java.management @@ -63,11 +63,11 @@ private void run_test(CommandExecutor executor, boolean useDefaultFileName) { boolean NMTOff = output.contains("NMT is disabled"); String regexBase = ".*0x\\p{XDigit}+ - 0x\\p{XDigit}+ +\\d+"; HashSet patterns = new HashSet<>(); - for (String s: shouldMatchUnconditionally) { + for (String s: shouldMatchUnconditionally()) { patterns.add(Pattern.compile(s)); } if (!NMTOff) { // expect VM annotations if NMT is on - for (String s: shouldMatchIfNMTIsEnabled) { + for (String s: shouldMatchIfNMTIsEnabled()) { patterns.add(Pattern.compile(s)); } } diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTest.java index 43857a1f039bf..6d589d17f8aea 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTest.java @@ -31,7 +31,7 @@ * @test * @summary Test of diagnostic command System.map * @library /test/lib - * @requires (os.family=="linux") + * @requires (os.family == "linux" | os.family == "windows") * @modules java.base/jdk.internal.misc * java.compiler * java.management @@ -42,11 +42,11 @@ public class SystemMapTest extends SystemMapTestBase { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("System.map"); boolean NMTOff = output.contains("NMT is disabled"); - for (String s: shouldMatchUnconditionally) { + for (String s: shouldMatchUnconditionally()) { output.shouldMatch(s); } if (!NMTOff) { // expect VM annotations if NMT is on - for (String s: shouldMatchIfNMTIsEnabled) { + for (String s: shouldMatchIfNMTIsEnabled()) { output.shouldMatch(s); } } diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java index 3d1284b09eeee..6507117df3533 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/SystemMapTestBase.java @@ -22,6 +22,8 @@ * questions. */ +import jdk.test.lib.Platform; + public class SystemMapTestBase { // e.g. @@ -29,6 +31,7 @@ public class SystemMapTestBase { private static final String range = "0x\\p{XDigit}+-0x\\p{XDigit}+"; private static final String space = " +"; private static final String someSize = "\\d+"; + private static final String someNumber = "(0x\\p{XDigit}+|\\d+)"; private static final String pagesize = "(4K|8K|16K|64K|2M|16M|64M)"; private static final String prot = "[rwsxp-]+"; @@ -44,7 +47,8 @@ public class SystemMapTestBase { // java heap is either committed, non-shared, or - in case of ZGC - committed and shared. private static final String regexBase_java_heap = regexBase + "(shrd,)?com.*"; - protected static final String shouldMatchUnconditionally[] = { + + private static final String shouldMatchUnconditionally_linux[] = { // java launcher regexBase_committed + "/bin/java", // libjvm @@ -55,7 +59,7 @@ public class SystemMapTestBase { regexBase_shared_and_committed + "hsperfdata_.*" }; - protected static final String shouldMatchIfNMTIsEnabled[] = { + private static final String shouldMatchIfNMTIsEnabled_linux[] = { regexBase_java_heap + "JAVAHEAP.*", // metaspace regexBase_committed + "META.*", @@ -66,4 +70,43 @@ public class SystemMapTestBase { // Main thread stack regexBase_committed + "STACK.*main.*" }; + + // windows: + private static final String winprot = "[\\-rwxcin]*"; + private static final String wintype = "[rc]-(img|map|pvt)"; + + private static final String winbase = range + space + someSize + space + winprot + space; + + private static final String winimage = winbase + "c-img" + space + someNumber + space; + private static final String wincommitted = winbase + "(c-pvt|c-map)" + space + someNumber + space; + private static final String winreserved = winbase + "r-pvt" + space + someNumber + space; + + private static final String shouldMatchUnconditionally_windows[] = { + // java launcher + winimage + ".*[\\/\\\\]bin[\\/\\\\]java[.]exe", + // libjvm + winimage + ".*[\\/\\\\]bin[\\/\\\\].*[\\/\\\\]jvm.dll" + }; + + private static final String shouldMatchIfNMTIsEnabled_windows[] = { + wincommitted + "JAVAHEAP.*", + // metaspace + wincommitted + "META.*", + // parts of metaspace should be uncommitted + winreserved + "META.*", + // code cache + wincommitted + "CODE.*", + // Main thread stack + wincommitted + "STACK-\\d+-main.*" + }; + + private static final boolean isWindows = Platform.isWindows(); + + protected static String[] shouldMatchUnconditionally() { + return isWindows ? shouldMatchUnconditionally_windows : shouldMatchUnconditionally_linux; + } + protected static String[] shouldMatchIfNMTIsEnabled() { + return isWindows ? shouldMatchIfNMTIsEnabled_windows : shouldMatchIfNMTIsEnabled_linux; + } + } diff --git a/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/TestUnloadedClass.java b/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/TestUnloadedClass.java new file mode 100644 index 0000000000000..dafec97111e2f --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/TestUnloadedClass.java @@ -0,0 +1,106 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8339725 + * @summary Stress test GetMethodDeclaringClass + * @requires vm.jvmti + * @requires (os.family == "linux") + * @library /test/lib + * @run driver/timeout=300 TestUnloadedClass + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Platform; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.InputStream; +import java.lang.reflect.Constructor; + +public class TestUnloadedClass { + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-agentpath:" + Utils.TEST_NATIVE_PATH + File.separator + System.mapLibraryName("TestUnloadedClass"), + "-Xmx50m", + "Test"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + if (!Platform.isDebugBuild()) { + output.shouldContain("OutOfMemoryError"); + } + } +} + +class Test { + public static void main(String[] args) throws Exception { + long last = System.nanoTime(); + for (int i = 0;;i++) { + if (Platform.isDebugBuild() && i >= 1000) { + // Debug build costs too much time to OOM so limit the loop iteration + break; + } + CustomClassLoader loader = new CustomClassLoader(); + Class k = loader.findClass("MyClass"); + Constructor c = k.getDeclaredConstructor(); + c.setAccessible(true); + c.newInstance(); + + // call gc every ~1 second. + if ((System.nanoTime() - last) >= 1e9) { + System.gc(); + last = System.nanoTime(); + } + } + } +} + +class CustomClassLoader extends ClassLoader { + static byte[] BYTES; + + static { + try (InputStream in = CustomClassLoader.class.getResourceAsStream("MyClass.class")) { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + byte[] buf = new byte[4096]; + int len; + while ((len = in.read(buf)) != -1) { + baos.write(buf, 0, len); + } + BYTES = baos.toByteArray(); + } + } catch (Throwable t) { + throw new RuntimeException(t); + } + } + + @Override + public Class findClass(String name) throws ClassNotFoundException { + return defineClass(name, BYTES, 0, BYTES.length); + } +} + +class MyClass { +} diff --git a/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/libTestUnloadedClass.cpp b/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/libTestUnloadedClass.cpp new file mode 100644 index 0000000000000..c32b787d57894 --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/GetMethodDeclaringClass/libTestUnloadedClass.cpp @@ -0,0 +1,129 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include + +#include +#include +#include +#include +#include +#include + +static jvmtiEnv *_jvmti; +static JavaVM *_jvm; + +#define BUFFER_SIZE 100000 +static std::atomic ring_buffer[BUFFER_SIZE]; + +void get_method_details(jmethodID method) { + jclass method_class; + char *class_name = NULL; + if (_jvmti->GetMethodDeclaringClass(method, &method_class) == JVMTI_ERROR_NONE) { + if (_jvmti->GetClassSignature(method_class, &class_name, NULL) == JVMTI_ERROR_NONE) { + _jvmti->Deallocate((unsigned char *)class_name); + } + } +} + +void* read_ringbuffer(void* arg) { + JNIEnv *env; + _jvm->AttachCurrentThreadAsDaemon((void **)&env, NULL); + for (;;) { + jmethodID id = ring_buffer[rand() % BUFFER_SIZE].load(std::memory_order_relaxed); + if (id != (jmethodID)0) { + get_method_details(id); + } + } + return NULL; +} + +static void JNICALL ClassPrepareCallback(jvmtiEnv *jvmti_env, + JNIEnv *jni_env, + jthread thread, + jclass klass) { + static bool reader_created = false; + static int ring_buffer_idx = 0; + + char *class_name = NULL; + if (jvmti_env->GetClassSignature(klass, &class_name, NULL) != JVMTI_ERROR_NONE) { + return; + } + // We only care MyClass and only one thread loads it + bool is_my_class = strcmp(class_name, "LMyClass;") == 0; + jvmti_env->Deallocate((unsigned char *)class_name); + if (!is_my_class) { + return; + } + + if (!reader_created) { + pthread_t tid; + pthread_create(&tid, NULL, read_ringbuffer, NULL); + reader_created = true; + } + + jint method_count; + jmethodID *methods; + if (jvmti_env->GetClassMethods(klass, &method_count, &methods) == JVMTI_ERROR_NONE) { + ring_buffer[ring_buffer_idx++].store(methods[0], std::memory_order_relaxed); + ring_buffer_idx = ring_buffer_idx % BUFFER_SIZE; + jvmti_env->Deallocate((unsigned char *)methods); + } +} + +JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) { + for (int i = 0; i < BUFFER_SIZE; i++) { + ring_buffer[i].store(0, std::memory_order_relaxed); + } + + jvmtiEventCallbacks callbacks; + jvmtiError error; + + _jvm = jvm; + + if (jvm->GetEnv((void **)&_jvmti, JVMTI_VERSION_1_0) != JNI_OK) { + fprintf(stderr, "Unable to access JVMTI!\n"); + return JNI_ERR; + } + + // Set up the event callbacks + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.ClassPrepare = &ClassPrepareCallback; + + // Register the callbacks + error = _jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks)); + if (error != JVMTI_ERROR_NONE) { + fprintf(stderr, "Error setting event callbacks: %d\n", error); + return JNI_ERR; + } + + // Enable the ClassPrepare event + error = _jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_PREPARE, NULL); + if (error != JVMTI_ERROR_NONE) { + fprintf(stderr, "Error enabling ClassPrepare event: %d\n", error); + return JNI_ERR; + } + + return JNI_OK; +} diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java index f77be989421b2..f45f708070ab0 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -75,7 +75,7 @@ public static void main(String[] args) { runCheck(new String[] {"-XX:TLABRefillWasteFraction=50", "-XX:+UsePerfData", "-XX:+UseTLAB"}, BadFailOnConstraint.create(AndOr1.class, "test1(int)", 1, "CallStaticJava")); runCheck(new String[] {"-XX:TLABRefillWasteFraction=50", "-XX:-UsePerfData", "-XX:+UseTLAB"}, BadFailOnConstraint.create(AndOr1.class, "test2()", 1, "CallStaticJava")); - String[] allocMatches = { "MyClass", "wrapper for: _new_instance_Java" }; + String[] allocMatches = { "MyClass", "wrapper for: C2 Runtime new_instance" }; runCheck(BadFailOnConstraint.create(MultipleFailOnBad.class, "fail1()", 1, 1, "Store"), BadFailOnConstraint.create(MultipleFailOnBad.class, "fail1()", 1, 3, "Store"), GoodFailOnRegexConstraint.create(MultipleFailOnBad.class, "fail1()", 1, 2, 4), @@ -114,7 +114,7 @@ public static void main(String[] args) { GoodRuleConstraint.create(Calls.class, "calls()", 3) ); - String[] allocArrayMatches = { "MyClass", "wrapper for: _new_array_Java"}; + String[] allocArrayMatches = { "MyClass", "wrapper for: C2 Runtime new_array"}; runCheck(BadFailOnConstraint.create(AllocArray.class, "allocArray()", 1, allocArrayMatches), BadFailOnConstraint.create(AllocArray.class, "allocArray()", 2, allocArrayMatches), GoodFailOnConstraint.create(AllocArray.class, "allocArray()", 3), diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java index 29d69b3174cfa..f7607b22e086e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq002.java @@ -127,6 +127,7 @@ private int runThis (String argv[], PrintStream out) { log2("debuggee launched"); } catch ( Exception e ) { log3("ERROR: Exception : " + e); + e.printStackTrace(System.out); log2(" test cancelled"); return FAILED; } @@ -170,6 +171,7 @@ private int runThis (String argv[], PrintStream out) { vm.exit(PASS_BASE); } catch ( Exception e ) { log3("ERROR: Exception : " + e); + e.printStackTrace(System.out); } break; @@ -183,6 +185,7 @@ private int runThis (String argv[], PrintStream out) { } } catch ( Exception e ) { log3("ERROR: Exception : " + e); + e.printStackTrace(System.out); } break; } @@ -211,9 +214,11 @@ private int runTest() { return 1; } catch ( VMDisconnectedException e ) { log3("ERROR: VMDisconnectedException : " + e); + e.printStackTrace(System.out); return 2; } catch ( Exception e ) { log3("ERROR: Exception : " + e); + e.printStackTrace(System.out); return 1; } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001.java index 5724f0ea9f4c4..ffdc26b7cb148 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -23,6 +23,8 @@ package nsk.jvmti.ClearFieldAccessWatch; +import jdk.test.lib.thread.TestThreadFactory; + import java.io.PrintStream; public class clrfldw001 { @@ -58,7 +60,7 @@ public static void main(String[] args) { public static int run(String argv[], PrintStream ref) { clrfldw001 t = new clrfldw001(); clrfldw001a t_a = new clrfldw001a(); - clrfldw001b t_b = new clrfldw001b(); + Thread t_b = TestThreadFactory.newThread(new clrfldw001b()); for (int i = 0; i < 5; i++) { setWatch(i); } @@ -91,7 +93,7 @@ class clrfldw001a { int fld = 2; } -class clrfldw001b extends Thread { +class clrfldw001b implements Runnable { float fld4 = 6.0f; public void run() { clrfldw001.clearWatch(4); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001.java index 9861f755f8fd1..7e1163d910295 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -23,6 +23,8 @@ package nsk.jvmti.ClearFieldModificationWatch; +import jdk.test.lib.thread.TestThreadFactory; + import java.io.PrintStream; public class clrfmodw001 { @@ -58,7 +60,7 @@ public static void main(String[] args) { public static int run(String argv[], PrintStream ref) { clrfmodw001 t = new clrfmodw001(); clrfmodw001a t_a = new clrfmodw001a(); - clrfmodw001b t_b = new clrfmodw001b(); + Thread t_b = TestThreadFactory.newThread(new clrfmodw001b()); for (int i = 0; i < 5; i++) { setWatch(i); } @@ -91,7 +93,7 @@ class clrfmodw001a { int fld = 2; } -class clrfmodw001b extends Thread { +class clrfmodw001b implements Runnable { float fld4; public void run() { clrfmodw001.clearWatch(4); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001.java index 03951bf97697d..fd64c4d33235e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -23,6 +23,8 @@ package nsk.jvmti.SetFieldAccessWatch; +import jdk.test.lib.thread.TestThreadFactory; + import java.io.PrintStream; public class setfldw001 { @@ -62,7 +64,7 @@ public static void main(String[] args) { public static int run(String argv[], PrintStream ref) { setfldw001 t = new setfldw001(); setfldw001a t_a = new setfldw001a(); - setfldw001b t_b = new setfldw001b(); + Thread t_b = TestThreadFactory.newThread(new setfldw001b()); t_b.start(); synchronized (lock) { fld = fld1 + 1; @@ -111,7 +113,7 @@ class setfldw001a { int fld = 2; } -class setfldw001b extends Thread { +class setfldw001b implements Runnable { float fld4 = 6.0f; public void run() { synchronized (setfldw001.lock) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001.java index a545a41f2fdfb..b79120e404c2a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -23,6 +23,8 @@ package nsk.jvmti.SetFieldModificationWatch; +import jdk.test.lib.thread.TestThreadFactory; + import java.io.PrintStream; public class setfmodw001 { @@ -62,7 +64,7 @@ public static void main(String[] args) { public static int run(String argv[], PrintStream ref) { setfmodw001 t = new setfmodw001(); setfmodw001a t_a = new setfmodw001a(); - setfmodw001b t_b = new setfmodw001b(); + Thread t_b = TestThreadFactory.newThread(new setfmodw001b()); t_b.start(); synchronized (lock) { fld1 = fld1 + 1; @@ -111,7 +113,7 @@ class setfmodw001a { int fld = 2; } -class setfmodw001b extends Thread { +class setfmodw001b implements Runnable { float fld4; public void run() { synchronized (setfmodw001.lock) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java index 871b6d26affd6..9d121b9a94f79 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -663,9 +663,11 @@ public SleepingThread(ThreadController controller, String name, Log log, Threads expectedMethods.add(Thread.class.getName() + ".currentCarrierThread"); expectedMethods.add(Thread.class.getName() + ".currentThread"); // jdk.internal.event.ThreadSleepEvent not accessible + expectedMethods.add("java.lang.Object."); + expectedMethods.add("jdk.internal.event.Event."); + expectedMethods.add("jdk.internal.event.ThreadSleepEvent."); expectedMethods.add("jdk.internal.event.ThreadSleepEvent."); expectedMethods.add("jdk.internal.event.ThreadSleepEvent.isEnabled"); - expectedMethods.add("jdk.internal.event.ThreadSleepEvent.isTurnedOn"); expectedMethods.add(SleepingThread.class.getName() + ".run"); switch (controller.invocationType) { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java index f23c16cd047a5..217c2cdfdc82b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, 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 @@ -41,8 +41,10 @@ public class SleepingThread extends RecursiveMonitoringThread { "java.lang.Thread.beforeSleep", "java.lang.Thread.afterSleep", "java.util.concurrent.TimeUnit.toNanos", + "java.lang.Object.", + "jdk.internal.event.Event.", + "jdk.internal.event.ThreadSleepEvent.", "jdk.internal.event.ThreadSleepEvent.", - "jdk.internal.event.ThreadSleepEvent.isTurnedOn", "jdk.internal.event.ThreadSleepEvent.isEnabled", "nsk.monitoring.share.thread.SleepingThread.runInside" }; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java index 632cebae8f82b..0700032f6a7c2 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -150,8 +150,9 @@ private static boolean fillTrace() { "java.lang.Thread.currentThread", "java.util.concurrent.TimeUnit.toNanos", "jdk.internal.event.ThreadSleepEvent.", + "java.lang.Object.", + "jdk.internal.event.Event.", "jdk.internal.event.ThreadSleepEvent.", - "jdk.internal.event.ThreadSleepEvent.isTurnedOn", "jdk.internal.event.ThreadSleepEvent.isEnabled" }; diff --git a/test/jdk/ProblemList-Xcomp.txt b/test/jdk/ProblemList-Xcomp.txt index 6e8953c521e87..2fc09ee4df4a9 100644 --- a/test/jdk/ProblemList-Xcomp.txt +++ b/test/jdk/ProblemList-Xcomp.txt @@ -29,4 +29,4 @@ java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all java/lang/management/MemoryMXBean/CollectionUsageThreshold.java 8318668 generic-all -com/sun/jdi/InterruptHangTest.java 8306679,8043571 generic-all +com/sun/jdi/InterruptHangTest.java 8043571 generic-all diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 47a2e13b460cf..1727722335f67 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -133,6 +133,10 @@ java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.jav java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java 7152980 macosx-all java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 7156130 linux-all java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096 macosx-all +java/awt/Focus/TestDisabledAutoTransfer.java 8159871 macosx-all,windows-all +java/awt/Focus/TestDisabledAutoTransferSwing.java 6962362 windows-all +java/awt/Focus/ActivateOnProperAppContextTest.java 8136516 macosx-all +java/awt/Focus/FocusPolicyTest.java 7160904 linux-all java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java 7080150 macosx-all java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all @@ -512,6 +516,8 @@ java/io/pathNames/GeneralWin32.java 8180264 windows- com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java 8030957 aix-all +com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java 8340401 windows-all + java/lang/management/MemoryMXBean/Pending.java 8158837 generic-all java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-all @@ -566,8 +572,6 @@ java/nio/channels/DatagramChannel/AfterDisconnect.java 8308807 aix-ppc6 java/nio/channels/DatagramChannel/ManySourcesAndTargets.java 8264385 macosx-aarch64 java/nio/channels/DatagramChannel/Unref.java 8233437 generic-all -java/nio/file/Path/ToRealPath.java 8315273 windows-all - ############################################################################ # jdk_rmi @@ -713,6 +717,7 @@ com/sun/jdi/InvokeHangTest.java 8218463 linux-al ############################################################################ # jdk_util +java/util/zip/CloseInflaterDeflaterTest.java 8339216 linux-s390x ############################################################################ @@ -784,3 +789,6 @@ java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java 8256289 windo java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java 8258103 linux-all java/awt/Focus/FrameMinimizeTest/FrameMinimizeTest.java 8016266 linux-x64 java/awt/Frame/SizeMinimizedTest.java 8305915 linux-x64 +java/awt/PopupMenu/PopupHangTest.java 8340022 windows-all +java/awt/Focus/MinimizeNonfocusableWindowTest.java 8024487 windows-all +java/awt/Focus/InactiveFocusRace.java 8023263 linux-all diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 67eceaa5a3ef5..6198d33214293 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -101,6 +101,7 @@ requires.properties= \ vm.jvmti \ vm.cpu.features \ docker.support \ + systemd.support \ release.implementor \ jdk.containerized \ jdk.foreign.linker diff --git a/test/jdk/java/awt/Choice/CheckChoiceTest.java b/test/jdk/java/awt/Choice/CheckChoiceTest.java new file mode 100644 index 0000000000000..3e2e06b1c9557 --- /dev/null +++ b/test/jdk/java/awt/Choice/CheckChoiceTest.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.Frame; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +/* + * @test + * @bug 4151949 + * @summary Verifies that Components are reshaped to their preferred size + * when their Container is packed. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual CheckChoiceTest + */ + +public class CheckChoiceTest { + + private static JComponent componentToFocus; + + private static final String INSTRUCTIONS = """ + Verify that the widths of the Choice components are all the same + and that none is the minimum possible size. + (The Choices should be at least as wide as the Frame.) + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("CheckChoiceTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 3) + .columns(45) + .testUI(CheckChoiceTest::createAndShowUI) + .splitUIBottom(CheckChoiceTest::createComponentToFocus) + .build(); + + // focus away from the window with choices + Thread.sleep(300); + SwingUtilities.invokeAndWait(() -> componentToFocus.requestFocus()); + + passFailJFrame.awaitAndCheck(); + } + + private static JComponent createComponentToFocus() { + componentToFocus = new JPanel(); + return componentToFocus; + } + + private static Frame createAndShowUI() { + Frame f = new Frame("Check Choice"); + f.setLayout(new BorderLayout()); + + Choice choice1 = new Choice(); + Choice choice2 = new Choice(); + Choice choice3 = new Choice(); + + f.add(choice1, BorderLayout.NORTH); + f.add(choice3, BorderLayout.CENTER); + f.add(choice2, BorderLayout.SOUTH); + f.pack(); + + choice1.add("I am Choice, yes I am : 0"); + choice2.add("I am the same, yes I am : 0"); + choice3.add("I am the same, yes I am : 0"); + + return f; + } +} diff --git a/test/jdk/java/awt/Choice/ChoiceBigTest.java b/test/jdk/java/awt/Choice/ChoiceBigTest.java new file mode 100644 index 0000000000000..be82ed2a40db1 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceBigTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Choice; +import java.awt.Frame; +import java.awt.FlowLayout; +import java.awt.Window; + +/* + * @test + * @bug 4288285 + * @summary Verifies choice works with many items + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ChoiceBigTest + */ + +public class ChoiceBigTest { + private static final String INSTRUCTIONS = """ + Click the Choice button, press Pass if: + + - all looks good. + - if you can select the item 1000 + + Otherwise press Fail. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ChoiceBigTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 3) + .columns(45) + .testUI(ChoiceBigTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Window createAndShowUI() { + Frame frame = new Frame("Check Choice"); + frame.setLayout(new FlowLayout()); + Choice choice = new Choice(); + frame.setSize(400, 200); + for (int i = 1; i < 1001; ++i) { + choice.add("I am Choice, yes I am : " + i); + } + frame.add(choice); + return frame; + } +} diff --git a/test/jdk/java/awt/Choice/ChoiceFocusTest.java b/test/jdk/java/awt/Choice/ChoiceFocusTest.java new file mode 100644 index 0000000000000..3ca895f88e6e9 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceFocusTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Choice; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Window; + +/* + * @test + * @bug 4927930 + * @summary Verify that the focus is set to the selected item after calling the java.awt.Choice.select() method + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ChoiceFocusTest + */ + +public class ChoiceFocusTest { + + private static final String INSTRUCTIONS = """ + 1. Use the mouse to select Item 5 in the Choice list. + 2. Click on the Choice. Item5 is now selected and highlighted. This is the correct behavior. + 3. Select Item 1 in the Choice list. + 4. Click the "choice.select(5)" button. This causes a call to Choice.select(5). Item 5 is now selected. + 5. Click on the Choice. + 6. If the cursor and focus are on item 5, the test passes. Otherwise, it fails. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ChoiceFocusTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 3) + .columns(50) + .testUI(ChoiceFocusTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Window createAndShowUI() { + Panel panel = new Panel(); + Choice choice = new Choice(); + Button button = new Button("choice.select(5);"); + + for (int i = 0; i < 10; i++) { + choice.add(String.valueOf(i)); + } + + button.addActionListener(e -> choice.select(5)); + + panel.add(button); + panel.add(choice); + + Frame frame = new Frame("ChoiceFocusTest"); + frame.add(panel); + frame.pack(); + + return frame; + } +} diff --git a/test/jdk/java/awt/Choice/ChoiceInsertTest.java b/test/jdk/java/awt/Choice/ChoiceInsertTest.java new file mode 100644 index 0000000000000..5eafa83a13991 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceInsertTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.Robot; + +/* + * @test + * @bug 4082078 + * @summary Test for bug(s): 4082078, Multiple calls to Choice.insert cause core dump + * @key headful + * @run main ChoiceInsertTest + */ + +public class ChoiceInsertTest extends Frame { + Choice c; + Label l; + + private static ChoiceInsertTest choiceInsertTest; + + public ChoiceInsertTest() { + c = new Choice(); + l = new Label("If you see this, the choice insert bug is fixed!"); + c.add("Initial choice"); + add(c); + } + + public void testInsertion() { + // inserting 30 or so items aborts Solaris VM + // in JDK's before 1.1.5 + for (int nchoice = 0; nchoice < 30; nchoice++) { + c.insert("new choice", 0); + } + // if you made it to here the bug is not there anymore... + remove(l); + add(l); + validate(); + } + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + try { + EventQueue.invokeAndWait(() ->{ + choiceInsertTest = new ChoiceInsertTest(); + choiceInsertTest.setTitle("ChoiceInsertTest"); + choiceInsertTest.setLocationRelativeTo(null); + choiceInsertTest.setSize(500, 300); + choiceInsertTest.setLayout(new GridLayout()); + choiceInsertTest.setVisible(true); + }); + robot.waitForIdle(); + robot.delay(500); + EventQueue.invokeAndWait(choiceInsertTest::testInsertion); + robot.delay(1000); + } finally { + EventQueue.invokeAndWait(() -> { + if (choiceInsertTest != null) { + choiceInsertTest.dispose(); + } + }); + } + + System.err.println("ChoiceInsertTest: Didn't abort VM inserting 30 items, so we passed!"); + } +} diff --git a/test/jdk/java/awt/Choice/ChoiceMouseDragTest.java b/test/jdk/java/awt/Choice/ChoiceMouseDragTest.java new file mode 100644 index 0000000000000..0c0c059032dda --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoiceMouseDragTest.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @bug 4328557 + * @summary Tests that MouseDragged and MouseReleased are triggered on choice + * @library /lib/client + * @build ExtendedRobot + * @key headful + * @run main ChoiceMouseDragTest + */ + + +public class ChoiceMouseDragTest extends Frame { + private static final Choice choice = new Choice(); + + private static ExtendedRobot robot; + private volatile boolean isDragged; + private volatile boolean isReleased; + + private static volatile ChoiceMouseDragTest choiceMouseDragTest; + + public ChoiceMouseDragTest() { + super("ChoiceMouseDragTest"); + this.setLayout(new BorderLayout()); + choice.add("item-1"); + choice.add("item-2"); + choice.add("item-3"); + choice.add("item-4"); + add("Center", choice); + choice.addMouseListener(new MouseEventHandler()); + choice.addMouseMotionListener(new MouseMotionEventHandler()); + setSize(400, 200); + setLocationRelativeTo(null); + setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + EventQueue.invokeAndWait(() -> + choiceMouseDragTest = new ChoiceMouseDragTest()); + + robot = new ExtendedRobot(); + robot.waitForIdle(); + robot.delay(500); + + Point pointToDrag = choice.getLocationOnScreen(); + pointToDrag.x += choice.getWidth() - 10; + pointToDrag.y += choice.getHeight() / 2 ; + + choiceMouseDragTest.test(InputEvent.BUTTON3_DOWN_MASK, pointToDrag); + choiceMouseDragTest.test(InputEvent.BUTTON1_DOWN_MASK, pointToDrag); + } finally { + EventQueue.invokeAndWait(() -> { + if (choiceMouseDragTest != null) { + choiceMouseDragTest.dispose(); + } + }); + } + } + + void test(int buttonToTest, Point pointToDrag) { + isDragged = false; + isReleased = false; + + robot.mouseMove(pointToDrag.x, pointToDrag.y); + robot.waitForIdle(); + + robot.mousePress(buttonToTest); + + robot.glide(pointToDrag.x + 100, pointToDrag.y); + robot.waitForIdle(); + + robot.mouseRelease(buttonToTest); + robot.waitForIdle(); + + if (!isReleased || !isDragged) { + throw new RuntimeException(("Test failed: button %d dragged(received %b) or " + + "released(received %b)") + .formatted(buttonToTest, isDragged, isReleased)); + } + + robot.delay(500); + } + + class MouseEventHandler extends MouseAdapter { + public void mousePressed(MouseEvent me) { + System.out.println(me.paramString()); + } + + public void mouseReleased(MouseEvent me) { + System.out.println(me.paramString()); + isReleased = true; + } + + public void mouseClicked(MouseEvent me) { + System.out.println(me.paramString()); + } + } + + class MouseMotionEventHandler extends MouseAdapter { + public void mouseDragged(MouseEvent me) { + System.out.println(me.paramString()); + isDragged = true; + } + } +} diff --git a/test/jdk/java/awt/Choice/ChoicePosTest.java b/test/jdk/java/awt/Choice/ChoicePosTest.java new file mode 100644 index 0000000000000..c585e4709bbe5 --- /dev/null +++ b/test/jdk/java/awt/Choice/ChoicePosTest.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/* + * @test + * @bug 4075194 + * @summary 4075194, Choice may not be displayed at the location requested + * @key headful + */ + +public class ChoicePosTest { + + private static Robot robot; + private static Frame frame; + private static final int GAP = 10; + private static volatile Choice c1,c2; + + public static void main(String[] args) throws Exception { + try { + EventQueue.invokeAndWait(ChoicePosTest::createAndShowGUI); + + robot = new Robot(); + robot.waitForIdle(); + robot.delay(500); + + captureAndTestChoices(); + } finally { + EventQueue.invokeAndWait(frame::dispose); + } + + System.out.println("Passed"); + } + + private static void createAndShowGUI() { + frame = new Frame("ChoicePosTest"); + Insets insets = frame.getInsets(); + frame.setSize( insets.left + 400 + insets.right, insets.top + 400 + insets.bottom ); + frame.setBackground(Color.RED); + frame.setLayout(null); + frame.setLocationRelativeTo(null); + + c1 = new Choice(); + c1.setBackground(Color.GREEN); + frame.add( c1 ); + c1.setBounds( 20, 50, 100, 100 ); + + c2 = new Choice(); + c2.setBackground(Color.GREEN); + frame.add(c2); + c2.addItem("One"); + c2.addItem("Two"); + c2.addItem("Three"); + c2.setBounds( 125, 50, 100, 100 ); + + frame.validate(); + frame.setVisible(true); + } + + private static void captureAndTestChoices() { + Point c1loc = c1.getLocationOnScreen(); + Point c2loc = c2.getLocationOnScreen(); + + int startX = c1loc.x - GAP; + int startY = c1loc.y - GAP; + int captureWidth = c2loc.x + c2.getWidth() + GAP - startX; + int captureHeight = c2loc.y + c2.getHeight() + GAP - startY; + + BufferedImage bi = robot.createScreenCapture( + new Rectangle(startX, startY, captureWidth, captureHeight) + ); + + int redPix = Color.RED.getRGB(); + + int lastNonRedCount = 0; + + for (int y = 0; y < captureHeight; y++) { + int nonRedCount = 0; + for (int x = 0; x < captureWidth; x++) { + int pix = bi.getRGB(x, y); + if (pix != redPix) { + nonRedCount++; + } + } + + if (nonRedCount > 0 && lastNonRedCount > 0) { + if (lastNonRedCount - nonRedCount > 0) { + System.err.printf( + "Failed at %d, nonRedCount: %d lastNonRedCount: %d\n", + y, nonRedCount, lastNonRedCount + ); + + try { + ImageIO.write(bi, "png", new File("choices.png")); + } catch (IOException ignored) { + } + + throw new RuntimeException("Choices are not aligned"); + } + } + + lastNonRedCount = nonRedCount; + } + } +} diff --git a/test/jdk/java/awt/Choice/DeadlockTest.java b/test/jdk/java/awt/Choice/DeadlockTest.java new file mode 100644 index 0000000000000..fdc6d94e6ba81 --- /dev/null +++ b/test/jdk/java/awt/Choice/DeadlockTest.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.Frame; +import jdk.test.lib.Platform; + +/* + * @test + * @bug 4134619 + * @summary Tests that the EventDispatchThread doesn't deadlock with + * user threads which are modifying a Choice component. + * @library /java/awt/regtesthelpers /test/lib + * @build PassFailJFrame jdk.test.lib.Platform + * @run main/manual DeadlockTest + */ + +public class DeadlockTest extends Thread { + + static volatile Choice choice1; + static volatile Choice choice2; + static volatile Choice choice3; + static volatile Frame frame; + static int itemCount = 0; + + private static final boolean isWindows = Platform.isWindows(); + + private static final String INSTRUCTIONS = """ + Click on the top Choice component and hold the mouse still briefly. + Then, without releasing the mouse button, move the cursor to a menu + item and then again hold the mouse still briefly. + %s + Release the button and repeat this process. + + Verify that this does not cause a deadlock + or crash within a reasonable amount of time. + """.formatted( + isWindows + ? "(menu can automatically collapse sometimes, this is ok)\n" + : "" + + ) ; + + public static void main(String[] args) throws Exception { + DeadlockTest deadlockTest = new DeadlockTest(); + PassFailJFrame passFailJFrame = PassFailJFrame.builder() + .title("DeadlockTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(deadlockTest::createAndShowUI) + .build(); + + deadlockTest.start(); + + passFailJFrame.awaitAndCheck(); + } + + public Frame createAndShowUI() { + frame = new Frame("Check Choice"); + frame.setLayout(new BorderLayout()); + choice1 = new Choice(); + choice2 = new Choice(); + choice3 = new Choice(); + frame.add(choice1, BorderLayout.NORTH); + frame.add(choice3, BorderLayout.CENTER); + frame.add(choice2, BorderLayout.SOUTH); + frame.pack(); + return frame; + } + + public void run() { + while (true) { + if (choice1 != null && itemCount < 40) { + choice1.add("I am Choice, yes I am : " + itemCount * itemCount); + choice2.add("I am the same, yes I am : " + itemCount * itemCount); + choice3.add("I am the same, yes I am : " + itemCount * itemCount); + itemCount++; + } + if (itemCount >= 20 && choice1 != null && + choice1.getItemCount() > 0) { + choice1.removeAll(); + choice2.removeAll(); + choice3.removeAll(); + itemCount = 0; + } + frame.validate(); + try { + Thread.sleep(1000); + } catch (Exception ignored) {} + } + } +} diff --git a/test/jdk/java/awt/Choice/DisabledList.java b/test/jdk/java/awt/Choice/DisabledList.java new file mode 100644 index 0000000000000..d028527303f7a --- /dev/null +++ b/test/jdk/java/awt/Choice/DisabledList.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Frame; +import java.awt.Window; +import java.awt.event.ItemEvent; + +/* + * @test + * @bug 6476183 + * @summary Drop down of a Choice changed to enabled state has a disabled like appearance + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual DisabledList + */ + +public class DisabledList { + + private static final String INSTRUCTIONS = """ + 1) Select the checkbox + 2) Open Choice + 3) Drag mouse over the scrollbar or drag out it the choice + 4) If choice's items become disabled press fail, otherwise pass + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("DisabledList Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 3) + .columns(45) + .testUI(DisabledList::createAndShowUI) + .logArea(4) + .build() + .awaitAndCheck(); + } + + private static Window createAndShowUI() { + Frame frame = new Frame("DisabledList"); + frame.setSize(200, 200); + frame.validate(); + Checkbox checkbox = new Checkbox("checkbox"); + final Choice choice = new Choice(); + choice.setEnabled(false); + for (int i = 0; i < 15; i++) { + choice.addItem("Item" + i); + } + checkbox.addItemListener(event -> { + PassFailJFrame.log("CheckBox.itemStateChanged occurred"); + choice.setEnabled(event.getStateChange() == ItemEvent.SELECTED); + }); + frame.add(BorderLayout.NORTH, checkbox); + frame.add(BorderLayout.CENTER, choice); + return frame; + } +} diff --git a/test/jdk/java/awt/Choice/SetFontTest.java b/test/jdk/java/awt/Choice/SetFontTest.java new file mode 100644 index 0000000000000..f38a34a7ed278 --- /dev/null +++ b/test/jdk/java/awt/Choice/SetFontTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Panel; + +/* + * @test + * @bug 4293346 + * @summary Checks that Choice does update its dimensions on font change + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetFontTest + */ + +public class SetFontTest { + + private static final String INSTRUCTIONS = """ + Choice component used to not update its dimension on font change. + Select one of fonts on the choice pull down list. + Pull down the list after the font change; if items in the list are + shown correctly the test is passed, otherwise it failed. + """; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("SetFontTest Instructions") + .instructions(INSTRUCTIONS) + .columns(45) + .testUI(SetFontTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Frame createAndShowUI() { + Frame frame = new Frame("SetFontTest"); + Choice choice = new Choice(); + frame.setBounds(100, 400, 400, 100); + choice.addItem("dummy"); + choice.addItem("Set LARGE Font"); + choice.addItem("Set small Font"); + choice.addItem("addNewItem"); + choice.addItem("deleteItem"); + + choice.addItemListener(e -> { + if (e.getItem().toString().equals("addNewItem")) { + choice.addItem("very very very very long item"); + frame.validate(); + } else if (e.getItem().toString().equals("deleteItem")) { + if (choice.getItemCount() > 4) { + choice.remove(4); + frame.validate(); + } + } else if (e.getItem().toString().equals("Set LARGE Font")) { + choice.setFont(new Font("Dialog", Font.PLAIN, 24)); + frame.validate(); + } else if (e.getItem().toString().equals("Set small Font")) { + choice.setFont(new Font("Dialog", Font.PLAIN, 10)); + frame.validate(); + } + }); + Panel panel = new Panel(); + panel.add(choice); + frame.add(panel, BorderLayout.CENTER); + return frame; + } +} diff --git a/test/jdk/java/awt/Choice/WheelEventsConsumed.java b/test/jdk/java/awt/Choice/WheelEventsConsumed.java new file mode 100644 index 0000000000000..37200214734bb --- /dev/null +++ b/test/jdk/java/awt/Choice/WheelEventsConsumed.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; + +/* + * @test + * @bug 6253211 + * @summary PIT: MouseWheel events not triggered for Choice drop down in XAWT + * @requires (os.family == "linux") + * @key headful + * @run main WheelEventsConsumed + */ + +public class WheelEventsConsumed extends Frame implements MouseWheelListener +{ + Robot robot; + Choice choice1 = new Choice(); + Point pt; + final static int delay = 100; + boolean mouseWheeled = false; + final static int OUTSIDE_CHOICE = 1; + final static int INSIDE_LIST_OF_CHOICE = 2; + final static int INSIDE_CHOICE_COMPONENT = 3; + static String toolkit; + + private static volatile WheelEventsConsumed frame = null; + + public static void main(String[] args) throws Exception { + toolkit = Toolkit.getDefaultToolkit().getClass().getName(); + try { + EventQueue.invokeAndWait(() -> { + frame = new WheelEventsConsumed(); + frame.initAndShow(); + }); + frame.test(); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + public void mouseWheelMoved(MouseWheelEvent me) { + mouseWheeled = true; + System.out.println(me); + } + + public void initAndShow() { + setTitle("WheelEventsConsumed test"); + for (int i = 1; i < 10; i++) { + choice1.add("item-0" + i); + } + + choice1.addMouseWheelListener(this); + add(choice1); + setLayout(new FlowLayout()); + setSize(200, 200); + setLocationRelativeTo(null); + setVisible(true); + validate(); + } + + public void test() { + try { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + robot.waitForIdle(); + robot.delay(delay * 5); + testMouseWheel(1, OUTSIDE_CHOICE); + robot.delay(delay); + testMouseWheel(-1, INSIDE_LIST_OF_CHOICE); + robot.delay(delay); + testMouseWheel(1, INSIDE_CHOICE_COMPONENT); + robot.delay(delay); + } catch (Throwable e) { + throw new RuntimeException("Test failed. Exception thrown: " + e); + } + } + + public void testMouseWheel(int amt, int mousePosition) { + pt = choice1.getLocationOnScreen(); + robot.mouseMove(pt.x + choice1.getWidth() / 2, pt.y + choice1.getHeight() / 2); + + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(50); + + switch (mousePosition) { + case OUTSIDE_CHOICE: + robot.mouseMove(pt.x + choice1.getWidth() * 3 / 2, pt.y + choice1.getHeight() / 2); + break; + case INSIDE_LIST_OF_CHOICE: + robot.mouseMove(pt.x + choice1.getWidth() / 2, pt.y + choice1.getHeight() * 4); + break; + case INSIDE_CHOICE_COMPONENT: + robot.mouseMove(pt.x + choice1.getWidth() / 2, pt.y + choice1.getHeight() / 2); + break; + } + + robot.delay(delay); + for (int i = 0; i < 10; i++) { + robot.mouseWheel(amt); + robot.delay(delay); + } + + if (!mouseWheeled) { + if (toolkit.equals("sun.awt.windows.WToolkit") && mousePosition == OUTSIDE_CHOICE) { + System.out.println("Passed. Separate case on Win32. Choice generated MouseWheel events" + mousePosition); + } else { + throw new RuntimeException("Test failed. Choice should generate MOUSE_WHEEL events." + mousePosition); + } + } else { + System.out.println("Passed. Choice generated MouseWheel events" + mousePosition); + } + robot.keyPress(KeyEvent.VK_ESCAPE); + robot.delay(10); + robot.keyRelease(KeyEvent.VK_ESCAPE); + robot.delay(200); + mouseWheeled = false; + } +} diff --git a/test/jdk/java/awt/Focus/ActivateFocusTest.java b/test/jdk/java/awt/Focus/ActivateFocusTest.java new file mode 100644 index 0000000000000..09f5bbb172ca8 --- /dev/null +++ b/test/jdk/java/awt/Focus/ActivateFocusTest.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4369903 + * @summary Focus on window activation does not work correctly + * @key headful + * @run main ActivateFocusTest + */ + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Toolkit; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class ActivateFocusTest { + + public static void main(final String[] args) { + ActivateFocusTest app = new ActivateFocusTest(); + app.doTest(); + } + + public void doTest() { + ActivateFocus[] af = new ActivateFocus[2]; + boolean testFailed = false; + Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize(); + for (int i = 0; i < 2; i++) { + af[i] = new ActivateFocus(i); + af[i].setLocation(i * 160 + scrSize.width / 2, scrSize.height / 2); + af[i].setVisible(true); + } + try { + Thread.sleep(5000); + } catch (InterruptedException ie) { + throw new RuntimeException("TEST FAILED - thread was interrupted"); + } + for (int i = 0; i < 2; i++) { + testFailed = (af[i].lw.focusCounter > 1); + } + if (testFailed) { + throw new RuntimeException("TEST FAILED - focus is gained more than one time"); + } else { + System.out.println("TEST PASSED"); + } + } + + } + +class ActivateFocus extends Frame { + + public LightWeight lw = null; + int num; + + public String toString() { + return ("Window " + num); + } + + public ActivateFocus(int i) { + setTitle("Window " + i); + lw = new LightWeight(i); + num=i; + addWindowListener(new WindowAdapter() { + public void windowActivated(WindowEvent e) { + if(lw != null) { + lw.requestFocus(); + } + } + }); + add(lw); + pack(); + } + + // A very simple lightweight component + class LightWeight extends Component implements FocusListener { + + boolean focused = false; + int num; + public int focusCounter = 0; + + public LightWeight(int num) { + this.num = num; + addFocusListener(this); + } + + public void paint(Graphics g) { + Dimension size = getSize(); + int w = size.width; + int h = size.height; + g.setColor(getBackground()); + g.fillRect(0, 0, w, h); + g.setColor(Color.black); + g.drawOval(0, 0, w-1, h-1); + if (focused) { + g.drawLine(w/2, 0, w/2, h); + g.drawLine(0, h/2, w, h/2); + } + + } + + public Dimension getPreferredSize() { + return new Dimension(150, 150); + } + + public void focusGained(FocusEvent e) { + focused = true; + focusCounter++; + System.out.println("focusGained on " + e.getComponent()); + repaint(); + } + + public void focusLost(FocusEvent e) { + focused = false; + System.out.println("focusLost on " + e.getComponent()); + repaint(); + } + + public String toString() { + return ("Component " + num); + } + } +} diff --git a/test/jdk/java/awt/Focus/ActivateOnProperAppContextTest.java b/test/jdk/java/awt/Focus/ActivateOnProperAppContextTest.java new file mode 100644 index 0000000000000..ab08398332147 --- /dev/null +++ b/test/jdk/java/awt/Focus/ActivateOnProperAppContextTest.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* +* @test +* @bug 6385277 +* @key headful +* @summary Tests that activation happens on correct AppContext. +* @modules java.desktop/sun.awt +* @run main ActivateOnProperAppContextTest +*/ + +import sun.awt.AppContext; +import sun.awt.SunToolkit; + +import java.awt.Button; +import java.awt.Component; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.util.concurrent.atomic.AtomicBoolean; + +public class ActivateOnProperAppContextTest { + static Robot robot; + SunToolkit toolkit; + + ThreadGroup threadGroup = new ThreadGroup("Test_Thread_Group"); + AppContext appContext; + Frame frame; + volatile boolean passed = true; + AtomicBoolean cond = new AtomicBoolean(false); + + public static void main(String[] args) throws Exception { + ActivateOnProperAppContextTest app = new ActivateOnProperAppContextTest(); + robot = new Robot(); + app.start(); + } + + public void start() { + toolkit = (SunToolkit)Toolkit.getDefaultToolkit(); + + Runnable runnable = new Runnable() { + public void run() { + test(); + + synchronized (cond) { + cond.set(true); + cond.notifyAll(); + } + } + }; + + Thread thread = new Thread(threadGroup, runnable, "Test Thread"); + + synchronized (cond) { + + thread.start(); + + while (!cond.get()) { + try { + cond.wait(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + } + + if (passed) { + System.out.println("Test passed."); + } else { + throw new TestFailedException("Test failed!"); + } + } + + void test() { + appContext = SunToolkit.createNewAppContext(); + System.out.println("Created new AppContext: " + appContext); + + frame = new Frame("ActivateOnProperAppContextTest Frame") { + public boolean isActive() { + verifyAppContext("Frame.isActive()"); + return super.isActive(); + } + public boolean isFocused() { + verifyAppContext("Frame.isFocused()"); + return super.isFocused(); + } + public boolean isFocusable() { + verifyAppContext("Frame.isFocusable()"); + return super.isFocusable(); + } + public Window getOwner() { + verifyAppContext("Frame.getOwner()"); + return super.getOwner(); + } + public boolean isEnabled() { + verifyAppContext("Frame.isEnabled()"); + return super.isEnabled(); + } + public boolean isVisible() { + verifyAppContext("Frame.isVisible()"); + return super.isVisible(); + } + public Container getParent() { + verifyAppContext("Frame.getParent()"); + return super.getParent(); + } + public Cursor getCursor() { + verifyAppContext("Frame.getCursor()"); + return super.getCursor(); + } + public Point getLocation() { + verifyAppContext("Frame.getLocation()"); + return super.getLocation(); + } + public Point getLocationOnScreen() { + verifyAppContext("Frame.getLocationOnScreen()"); + return super.getLocationOnScreen(); + } + }; + Window window = new Window(frame) { + public boolean isFocused() { + verifyAppContext("Window.isFocused()"); + return super.isFocused(); + } + public boolean isFocusable() { + verifyAppContext("Window.isFocusable()"); + return super.isFocusable(); + } + public Window getOwner() { + verifyAppContext("Window.getOwner()"); + return super.getOwner(); + } + public boolean isEnabled() { + verifyAppContext("Window.isEnabled()"); + return super.isEnabled(); + } + public boolean isVisible() { + verifyAppContext("Window.isVisible()"); + return super.isVisible(); + } + public Container getParent() { + verifyAppContext("Window.getParent()"); + return super.getParent(); + } + public Cursor getCursor() { + verifyAppContext("Window.getCursor()"); + return super.getCursor(); + } + public Point getLocation() { + verifyAppContext("Window.getLocation()"); + return super.getLocation(); + } + public Point getLocationOnScreen() { + verifyAppContext("Window.getLocationOnScreen()"); + return super.getLocationOnScreen(); + } + }; + Button button = new Button("button"); + Label label = new Label("label"); + + window.setLayout(new FlowLayout()); + window.add(button); + window.add(label); + window.setLocation(800, 0); + window.pack(); + window.setVisible(true); + + frame.setBounds(800, 100, 100, 50); + frame.setVisible(true); + + toolkit.realSync(); + + /* + * When the label is clicked in the window some of + * the owner's public method get called. + */ + clickOn(label); + } + + void verifyAppContext(String methodName) { + AppContext ac = AppContext.getAppContext(); + println(methodName + " called on AppContext: " + ac); + + if (ac != appContext) { + passed = false; + System.err.println("Test failed: " + methodName + " is called on wrong AppContext!"); + Thread.dumpStack(); + } + } + + void clickOn(Component c) { + Point p = c.getLocationOnScreen(); + Dimension d = c.getSize(); + + robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2)); + + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(20); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + toolkit.realSync(); + } + + void println(final String msg) { + SunToolkit.executeOnEventHandlerThread(frame, new Runnable() { + public void run() { + System.out.println(msg); + } + }); + } +} + +class TestFailedException extends RuntimeException { + TestFailedException(String msg) { + super(msg); + } +} diff --git a/test/jdk/java/awt/Focus/AltTabEventsTest.java b/test/jdk/java/awt/Focus/AltTabEventsTest.java new file mode 100644 index 0000000000000..15d679ce7295a --- /dev/null +++ b/test/jdk/java/awt/Focus/AltTabEventsTest.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4524015 + * @summary Tests that when user switches between windows using Alt-tab then the appropriate events are generated + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual AltTabEventsTest + */ + +import java.awt.Button; +import java.awt.Choice; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.PopupMenu; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class AltTabEventsTest { + + private static final String INSTRUCTIONS = """ + This test verifies that when user switches between windows using Alt-tab + key combination then appropriate window events are generated. Also, when + user interacts with Menu bar, Popup menu, Choice then no excessive window + event is generated. + + After test started you will see Frame('Test for 4524015')-F1 with some + components and Frame('Another frame')-F2 with no components. + 1. Make F1 active by clicking on it. + 2. Press Alt-tab. + In the messqge dialog area you should see that + WINDOW_DEACTIVATED, WINDOW_LOST_FOCUS event were generated. + If you switched to F2 then also WINDOW_ACTIVATED, WINDOW_GAINED_FOCUS + were generated. + If no events were generated the test FAILED. + Repeat the 2) with different circumstances. + + 3. Make F1 active by clicking on it. + 4. Click on Menu bar/Button 'popup'/Choice and select some item from + the list shown. If any of the window events appeared in the output then + the test FAILED. + + else the test PASSED."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("AltTabEventsTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 5) + .columns(35) + .testUI(Test::new) + .logArea() + .build() + .awaitAndCheck(); + } + +} + + +class Test extends Frame { + PopupMenu pop; + Frame f; + + void println(String messageIn) { + PassFailJFrame.log(messageIn); + } + + public Test() { + super("Test for 4524015"); + WindowAdapter wa = new WindowAdapter() { + public void windowActivated(WindowEvent e) { + println(e.toString()); + } + public void windowDeactivated(WindowEvent e) { + println(e.toString()); + } + public void windowGainedFocus(WindowEvent e) { + println(e.toString()); + } + public void windowLostFocus(WindowEvent e) { + println(e.toString()); + } + }; + addWindowListener(wa); + addWindowFocusListener(wa); + + f = new Frame("Another frame"); + f.addWindowListener(wa); + f.addWindowFocusListener(wa); + f.setBounds(800, 300, 300, 100); + f.setVisible(true); + + setLayout(new FlowLayout()); + Button b = new Button("popup"); + add(b); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + pop.show((Component)e.getSource(), 10, 10); + } + }); + Choice cho = new Choice(); + add(cho); + cho.addItem("1"); + cho.addItem("2"); + cho.addItem("3"); + + MenuBar bar = new MenuBar(); + Menu menu = new Menu("menu"); + MenuItem item = new MenuItem("first"); + menu.add(item); + item = new MenuItem("second"); + menu.add(item); + bar.add(menu); + setMenuBar(bar); + + pop = new PopupMenu(); + pop.add("1"); + pop.add("@"); + add(pop); + setSize(300, 100); + } +} + diff --git a/test/jdk/java/awt/Focus/CanvasPanelFocusOnClickTest.java b/test/jdk/java/awt/Focus/CanvasPanelFocusOnClickTest.java new file mode 100644 index 0000000000000..8df21ba0f0a67 --- /dev/null +++ b/test/jdk/java/awt/Focus/CanvasPanelFocusOnClickTest.java @@ -0,0 +1,212 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4041703 4096228 4032657 4066152 4149866 4025223 + * @summary Ensures that an Panel/Canvas without heavyweight children + receives focus on mouse click + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual CanvasPanelFocusOnClickTest + */ + +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +public class CanvasPanelFocusOnClickTest { + + private static final String INSTRUCTIONS = """ + + Click on the red Canvas. Verify that it has focus by key pressing. + Click on the yellow Panel. Verify that it has focus by key pressing. + Click on the blue heavyweight Panel (NOT ON THE BUTTON!). + Verify that it doesn't have focus by key pressing. + If two empty containers are able to the get focus by a mouse click + and the container with heavyweight children are unable to get + the focus by a mouse click which can be verified through messages in message dialog + the test passes."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("CanvasPanelFocusOnClickTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(CanvasPanelFocusOnClickTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Canvas canvas = new Canvas();; + Panel emptyPanel = new Panel(); + Panel panel = new Panel(); + Button buttonInPanel = new Button("BUTTON ON PANEL"); + + Frame frame = new Frame("CanvasPanelFocusOnClickTest Frame"); + frame.setLayout(new GridLayout(3, 1)); + canvas.setBackground(Color.red); + canvas.setName("RED CANVAS"); + canvas.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + println(e.toString()); + } + public void focusLost(FocusEvent e) { + println(e.toString()); + } + }); + canvas.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + printKey(e); + } + + public void keyTyped(KeyEvent e) { + printKey(e); + } + + public void keyReleased(KeyEvent e) { + printKey(e); + } + }); + frame.add(canvas); + + emptyPanel.setBackground(Color.yellow); + emptyPanel.setName("YELLOW PANEL"); + emptyPanel.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + println(e.toString()); + } + public void focusLost(FocusEvent e) { + println(e.toString()); + } + }); + emptyPanel.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + printKey(e); + } + + public void keyTyped(KeyEvent e) { + printKey(e); + } + + public void keyReleased(KeyEvent e) { + printKey(e); + } + }); + frame.add(emptyPanel); + + panel.setBackground(Color.blue); + panel.setName("BLUE PANEL"); + buttonInPanel.setName("BUTTON ON PANEL"); + buttonInPanel.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + println(e.toString()); + } + public void focusLost(FocusEvent e) { + println(e.toString()); + } + }); + buttonInPanel.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + printKey(e); + } + + public void keyTyped(KeyEvent e) { + printKey(e); + } + + public void keyReleased(KeyEvent e) { + printKey(e); + } + }); + panel.add(buttonInPanel); + panel.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + println(e.toString()); + } + public void focusLost(FocusEvent e) { + println(e.toString()); + } + }); + panel.addKeyListener(new KeyAdapter() { + public void keyPressed(KeyEvent e) { + printKey(e); + } + + public void keyTyped(KeyEvent e) { + printKey(e); + } + + public void keyReleased(KeyEvent e) { + printKey(e); + } + }); + frame.add(panel); + + frame.setSize(200, 200); + + return frame; + + } + + static void printKey(KeyEvent e) { + String typeStr; + switch(e.getID()) { + case KeyEvent.KEY_PRESSED: + typeStr = "KEY_PRESSED"; + break; + case KeyEvent.KEY_RELEASED: + typeStr = "KEY_RELEASED"; + break; + case KeyEvent.KEY_TYPED: + typeStr = "KEY_TYPED"; + break; + default: + typeStr = "unknown type"; + } + + Object source = e.getSource(); + if (source instanceof Component) { + typeStr += " on " + ((Component)source).getName(); + } else { + typeStr += " on " + source; + } + + println(typeStr); + } + + static void println(String messageIn) { + PassFailJFrame.log(messageIn); + } +} diff --git a/test/jdk/java/awt/Focus/ComponentLostFocusTest.java b/test/jdk/java/awt/Focus/ComponentLostFocusTest.java new file mode 100644 index 0000000000000..6af8322b2cd82 --- /dev/null +++ b/test/jdk/java/awt/Focus/ComponentLostFocusTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4982943 + * @key headful + * @summary focus lost in text fields or text areas, unable to enter characters from keyboard + * @run main ComponentLostFocusTest + */ + +import java.awt.Dialog; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.KeyboardFocusManager; +import java.awt.Point; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.InputEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class ComponentLostFocusTest { + + static Frame frame; + static TextField tf; + static Robot r; + static Dialog dialog = null; + static volatile boolean passed; + static volatile Point loc; + static volatile int width; + static volatile int top; + + private static void createTestUI() { + + dialog = new Dialog(frame, "Dialog", true); + + frame = new Frame("ComponentLostFocusTest Frame"); + frame.setLayout(new FlowLayout()); + frame.addWindowFocusListener(new WindowAdapter() { + public void windowGainedFocus(WindowEvent e) { + System.out.println("Frame gained focus: "+e); + } + }); + tf = new TextField("Text Field"); + frame.add(tf); + frame.setSize(400,300); + frame.setVisible(true); + frame.setLocationRelativeTo(null); + frame.validate(); + } + + public static void doTest() { + System.out.println("dialog.setVisible.... "); + new Thread(new Runnable() { + public void run() { + dialog.setVisible(true); + } + }).start(); + + // The bug is that this construction leads to the redundant xRequestFocus + // By the way, the requestFocusInWindow() works fine before the fix + System.out.println("requesting.... "); + frame.requestFocus(); + + r.delay(1000); + + // Returning the focus to the initial frame will work correctly after the fix + System.out.println("disposing.... "); + dialog.dispose(); + + r.delay(1000); + + // We want to track the GAIN_FOCUS from this time + tf.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + System.out.println("TextField gained focus: " + e); + passed = true; + } + }); + + } + + private static void doRequestFocusToTextField() { + // do activation using press title + r.mouseMove(loc.x + width / 2, loc.y + top / 2); + r.waitForIdle(); + r.mousePress(InputEvent.BUTTON1_DOWN_MASK); + r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + r.waitForIdle(); + + // request focus to the text field + tf.requestFocus(); + } + + public static final void main(String args[]) throws Exception { + r = new Robot(); + r.setAutoDelay(100); + + EventQueue.invokeAndWait(() -> createTestUI()); + r.waitForIdle(); + r.delay(1000); + try { + EventQueue.invokeAndWait(() -> { + doTest(); + loc = frame.getLocationOnScreen(); + width = frame.getWidth(); + top = frame.getInsets().top; + }); + doRequestFocusToTextField(); + + System.out.println("Focused window: " + + KeyboardFocusManager.getCurrentKeyboardFocusManager(). + getFocusedWindow()); + System.out.println("Focus owner: " + + KeyboardFocusManager.getCurrentKeyboardFocusManager(). + getFocusOwner()); + + if (!passed) { + throw new RuntimeException("TextField got no focus! Test failed."); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } +} + diff --git a/test/jdk/java/awt/Focus/ConsumedKeyEventTest.java b/test/jdk/java/awt/Focus/ConsumedKeyEventTest.java new file mode 100644 index 0000000000000..dda82adeec587 --- /dev/null +++ b/test/jdk/java/awt/Focus/ConsumedKeyEventTest.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4700276 + * @summary Peers process KeyEvents before KeyEventPostProcessors + * @requires (os.family == "windows") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ConsumedKeyEventTest +*/ + +import java.awt.Canvas; +import java.awt.Component; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.KeyboardFocusManager; +import java.awt.KeyEventPostProcessor; +import java.awt.event.KeyEvent; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class ConsumedKeyEventTest implements KeyEventPostProcessor { + + private static final String INSTRUCTIONS = """ + This is a Windows-only test. + When the test starts, you will see a Frame with two components in it, + components look like colored rectangles, one of them is lightweight, one is heavyweight. + Do the following: + 1. Click the mouse on the left component. + If it isn't yellow after the click (that means it doesn't have focus), the test fails. + 2. Press and release ALT key. + In the output window, the text should appear stating that those key events were consumed. + If no output appears, the test fails. + 3. Press space bar. If system menu drops down, the test fails. + 4. Click the right rectangle. + It should become red after the click. If it doesn't, it means that it didn't get the focus, and the test fails. + 5. Repeat steps 2. and 3. + 6. If the test didn't fail on any of the previous steps, the test passes."""; + + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ConsumedKeyEventTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 5) + .columns(35) + .testUI(ConsumedKeyEventTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + KeyboardFocusManager.getCurrentKeyboardFocusManager(). + addKeyEventPostProcessor((e) -> { + System.out.println("postProcessor(" + e + ")"); + // consumes all ALT-events + if (e.getKeyCode() == KeyEvent.VK_ALT) { + println("consumed " + e); + e.consume(); + return true; + } + return false; + }); + FocusRequestor requestor = new FocusRequestor(); + Frame frame = new Frame("Main Frame"); + frame.setLayout(new FlowLayout()); + + Canvas canvas = new CustomCanvas(); + canvas.addMouseListener(requestor); + frame.add(canvas); + canvas.requestFocus(); + + Component lwComp = new LWComponent(); + lwComp.addMouseListener(requestor); + frame.add(lwComp); + + frame.pack(); + + return frame; + } + + public boolean postProcessKeyEvent(KeyEvent e) { + System.out.println("postProcessor(" + e + ")"); + // consumes all ALT-events + if (e.getKeyCode() == KeyEvent.VK_ALT) { + println("consumed " + e); + e.consume(); + return true; + } + return false; + } + + static void println(String messageIn) { + PassFailJFrame.log(messageIn); + } +}// class ConsumedKeyEventTest + +class CustomCanvas extends Canvas { + CustomCanvas() { + super(); + setName("HWComponent"); + setSize(100, 100); + addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent fe) { + repaint(); + } + + public void focusLost(FocusEvent fe) { + repaint(); + } + }); + } + + public void paint(Graphics g) { + if (isFocusOwner()) { + g.setColor(Color.YELLOW); + } else { + g.setColor(Color.GREEN); + } + g.fillRect(0, 0, 100, 100); + } + +} + +class LWComponent extends Component { + LWComponent() { + super(); + setName("LWComponent"); + addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent fe) { + repaint(); + } + + public void focusLost(FocusEvent fe) { + repaint(); + } + }); + } + + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } + + public void paint(Graphics g) { + if (isFocusOwner()) { + g.setColor(Color.RED); + } else { + g.setColor(Color.BLACK); + } + g.fillRect(0, 0, 100, 100); + } + +} + +class FocusRequestor extends MouseAdapter { + static int counter = 0; + public void mouseClicked(MouseEvent me) { + System.out.println("mouseClicked on " + me.getComponent().getName()); + } + public void mousePressed(MouseEvent me) { + System.out.println("mousePressed on " + me.getComponent().getName()); + me.getComponent().requestFocus(); + } + public void mouseReleased(MouseEvent me) { + System.out.println("mouseReleased on " + me.getComponent().getName()); + } +} + diff --git a/test/jdk/java/awt/Focus/EmptyWindowKeyTest.java b/test/jdk/java/awt/Focus/EmptyWindowKeyTest.java new file mode 100644 index 0000000000000..bbdf8ce4f383b --- /dev/null +++ b/test/jdk/java/awt/Focus/EmptyWindowKeyTest.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4464723 + * @summary Tests simple KeyAdapter / KeyListener on an empty, focusable window + * @key headful + * @run main EmptyWindowKeyTest +*/ + +import java.awt.AWTEvent; +import java.awt.Frame; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.Robot; + +public class EmptyWindowKeyTest { + + static volatile boolean passed1, passed2; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + MainFrame mainFrame = new MainFrame(); + mainFrame.setSize(50,50); + mainFrame.addKeyListener(new KeyboardTracker()); + robot.waitForIdle(); + robot.delay(1000); + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + robot.delay(1000); + if (!passed1 || !passed2) { + throw new RuntimeException("KeyPress/keyRelease not seen," + + "passed1 " + passed1 + " passed2 " + passed2); + } + } + + static public class KeyboardTracker extends KeyAdapter { + public KeyboardTracker() { } + public void keyTyped(KeyEvent e) {} + + public void keyPressed(KeyEvent e) { + if (e.getKeyText(e.getKeyCode()).equals("A")) { + passed1 = true; + } + } + public void keyReleased(KeyEvent e) { + if (e.getKeyText(e.getKeyCode()).equals("A")) { + passed2 = true; + } + } + } + + static public class MainFrame extends Frame { + + public MainFrame() { + super(); + enableEvents(AWTEvent.KEY_EVENT_MASK); + setVisible(true); + } + + } + +} + diff --git a/test/jdk/java/awt/Focus/FocusChangeOnResizeTest.java b/test/jdk/java/awt/Focus/FocusChangeOnResizeTest.java new file mode 100644 index 0000000000000..a9fa9e5edfd07 --- /dev/null +++ b/test/jdk/java/awt/Focus/FocusChangeOnResizeTest.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 4060975 + * @summary tests that a component doesn't lose focus on resize + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual FocusChangeOnResizeTest +*/ + +import java.util.List; + +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.TextField; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + +public class FocusChangeOnResizeTest { + + private static final String INSTRUCTIONS = """ + For the Frame and the Dialog: + Press the LOWER BUTTON to resize the Frame or Dialog programmatically. + Give the focus to the LOWER BUTTON and resize the Frame or Dialog manually. + If the LOWER BUTTON always has focus after resize + (for both frame and dialog) the test passes."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("PopupMenu Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(FocusChangeOnResizeTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static List createTestUI() { + Frame frame = new Frame("FocusChangeOnResizeTest frame"); + Dialog dialog = new Dialog(frame, "Test dialog"); + frame.add(new TestPanel(frame)); + dialog.add(new TestPanel(dialog)); + frame.setBounds (150, 200, 200, 200); + dialog.setBounds (150, 500, 200, 200); + return List.of(frame, dialog); + } + + static FocusListener eventLogger = new FocusListener() { + public void focusGained(FocusEvent e) { + PassFailJFrame.log(e.toString()); + } + public void focusLost(FocusEvent e) { + PassFailJFrame.log(e.toString()); + } + }; +} + +class TestPanel extends Panel { + + TextField textField = new TextField("TEXT FIELD"); + Button button1 = new Button("UPPER BUTTON"); + Button button2 = new Button("LOWER BUTTON"); + + public TestPanel(Window parent) { + setLayout(new GridLayout(3, 1)); + add(textField); + add(button1); + add(button2); + textField.setName("TEXT FIELD"); + button1.setName("UPPER BUTTON"); + button2.setName("LOWER BUTTON"); + textField.addFocusListener(FocusChangeOnResizeTest.eventLogger); + button1.addFocusListener(FocusChangeOnResizeTest.eventLogger); + button2.addFocusListener(FocusChangeOnResizeTest.eventLogger); + + button2.addActionListener(new Resizer(parent)); + } +} + +class Resizer implements ActionListener { + Window target; + + public Resizer(Window window) { + target = window; + } + + public void actionPerformed(ActionEvent e) { + target.setSize(200, 100); + target.doLayout(); + target.pack(); + } +} + diff --git a/test/jdk/java/awt/Focus/FocusKeepTest.java b/test/jdk/java/awt/Focus/FocusKeepTest.java new file mode 100644 index 0000000000000..0adc463f5d9ae --- /dev/null +++ b/test/jdk/java/awt/Focus/FocusKeepTest.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4128659 + * @summary Tests whether a focus request will work on a focus lost event. + * @key headful + * @run main FocusKeepTest + */ + +import java.awt.BorderLayout; +import java.awt.KeyboardFocusManager; +import java.awt.Robot; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; +import javax.swing.JFrame; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; + +public class FocusKeepTest { + + static JFrame frame; + static JTextField tf; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + SwingUtilities.invokeAndWait(() -> createTestUI()); + robot.waitForIdle(); + robot.delay(1000); + robot.keyPress(KeyEvent.VK_TAB); + robot.keyRelease(KeyEvent.VK_TAB); + if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() instanceof JTextField tf1) { + if (!tf1.getText().equals("TextField 1")) { + throw new RuntimeException("Focus on wrong textfield"); + } + } else { + throw new RuntimeException("Focus not on correct component"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + private static void createTestUI() { + frame = new JFrame("FocusKeepTest"); + tf = new JTextField("TextField 1"); + tf.addFocusListener(new MyFocusAdapter("TextField 1")); + frame.add(tf, BorderLayout.NORTH); + + tf = new JTextField("TextField 2"); + tf.addFocusListener(new MyFocusAdapter("TextField 2")); + frame.add(tf, BorderLayout.SOUTH); + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + static class MyFocusAdapter extends FocusAdapter { + private String myName; + + public MyFocusAdapter (String name) { + myName = name; + } + + public void focusLost (FocusEvent e) { + if (myName.equals ("TextField 1")) { + e.getComponent().requestFocus (); + } + } + + public void focusGained (FocusEvent e) { + } + } +} diff --git a/test/jdk/java/awt/Focus/FocusPolicyTest.java b/test/jdk/java/awt/Focus/FocusPolicyTest.java new file mode 100644 index 0000000000000..3ec362acaf085 --- /dev/null +++ b/test/jdk/java/awt/Focus/FocusPolicyTest.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4897459 + * @key headful + * @summary The key does not switches focus in the internal frames in Swing apps. + * @run main FocusPolicyTest + */ + +import java.awt.Container; +import java.awt.Component; +import java.awt.DefaultFocusTraversalPolicy; +import java.awt.Dialog; +import java.awt.FocusTraversalPolicy; +import java.awt.Frame; +import java.awt.KeyboardFocusManager; +import java.awt.Toolkit; +import java.awt.Window; +import javax.swing.JDialog; +import javax.swing.JInternalFrame; +import javax.swing.JFrame; +import javax.swing.JWindow; +import javax.swing.LayoutFocusTraversalPolicy; + +public class FocusPolicyTest { + static int stageNum; + static FocusTraversalPolicy customPolicy = new CustomPolicy(); + final static Class awtDefaultPolicy = DefaultFocusTraversalPolicy.class; + final static Class swingDefaultPolicy = LayoutFocusTraversalPolicy.class; + + public static void main(String[] args) { + final boolean isXawt = "sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName()); + + System.err.println("isXawt = " + isXawt); + + // 1. Check default policy + if (KeyboardFocusManager.getCurrentKeyboardFocusManager(). + getDefaultFocusTraversalPolicy().getClass() != awtDefaultPolicy) { + throw new RuntimeException("Error: stage 1: default policy is not DefaultFocusTraversalPolicy"); + } + + // 2. Check AWT top-levels policies + stageNum = 2; + checkAWTPoliciesFor(awtDefaultPolicy); + + // 3. Check Swing top-levels policies + stageNum = 3; + checkSwingPoliciesFor(swingDefaultPolicy); + + // 4. Check default policy if not XToolkit + if (!isXawt) { + if (KeyboardFocusManager.getCurrentKeyboardFocusManager(). + getDefaultFocusTraversalPolicy().getClass() != swingDefaultPolicy) { + throw new RuntimeException("Error: stage 4: default policy is not LayoutFocusTraversalPolicy"); + } + } + + // 5. Check AWT top-levels policies + // this is a bug in XAWT we should change the test as soon as + // we will be able to fix this bug. + stageNum = 5; + Class defaultPolicy = swingDefaultPolicy; + if (isXawt) { + defaultPolicy = awtDefaultPolicy; + } + checkAWTPoliciesFor(defaultPolicy); + + // Set custom policy as default + KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(customPolicy); + + // 6. Check AWT top-levels policies for custom + stageNum = 6; + checkAWTPoliciesFor(customPolicy.getClass()); + + // 7. Check Swing top-levels policies for custom + stageNum = 7; + checkSwingPoliciesFor(customPolicy.getClass()); + + return; + } + + public static void checkAWTPoliciesFor(Class expectedPolicyClass) { + Window[] tlvs = new Window[7]; + + tlvs[0] = new Frame(""); + tlvs[1] = new Frame("", tlvs[0].getGraphicsConfiguration()); + tlvs[2] = new Window((Frame)tlvs[0]); + tlvs[3] = new Dialog((Frame)tlvs[0], "", false); + tlvs[4] = new Dialog((Frame)tlvs[0], "", false, tlvs[0].getGraphicsConfiguration()); + tlvs[5] = new Dialog((Dialog)tlvs[3], "", false); + tlvs[6] = new Dialog((Dialog)tlvs[3], "", false, tlvs[0].getGraphicsConfiguration()); + + for (int i = 0; i < 7; i++) { + Class policyClass = tlvs[i].getFocusTraversalPolicy().getClass(); + if (policyClass != expectedPolicyClass) { + throw new RuntimeException("Error: stage " + stageNum + ": " + + tlvs[i].getClass().getName() + + "'s policy is " + policyClass.getName() + + " but not " + expectedPolicyClass.getName()); + } + } + } + + public static void checkSwingPoliciesFor(Class expectedPolicyClass) { + Container[] tlvs = new Container[12]; + + tlvs[0] = new JFrame(); + tlvs[1] = new JFrame(tlvs[0].getGraphicsConfiguration()); + tlvs[2] = new JFrame(""); + tlvs[3] = new JFrame("", tlvs[0].getGraphicsConfiguration()); + tlvs[4] = new JWindow((Frame)tlvs[0]); + tlvs[5] = new JWindow((Window)tlvs[4]); + tlvs[6] = new JWindow((Window)tlvs[4], tlvs[0].getGraphicsConfiguration()); + tlvs[7] = new JDialog((Frame)tlvs[0], "", false); + tlvs[8] = new JDialog((Frame)tlvs[0], "", false, tlvs[0].getGraphicsConfiguration()); + tlvs[9] = new JDialog((Dialog)tlvs[7], "", false); + tlvs[10] = new JDialog((Dialog)tlvs[7], "", false, tlvs[0].getGraphicsConfiguration()); + tlvs[11] = new JInternalFrame("", false, false, false, false); + + for (int i = 0; i < tlvs.length; i++) { + Class policyClass = tlvs[i].getFocusTraversalPolicy().getClass(); + if (policyClass != expectedPolicyClass) { + throw new RuntimeException("Error: stage " + stageNum + + ": " + tlvs[i].getClass().getName() + + "'s policy is " + policyClass.getName() + " but not " + + expectedPolicyClass.getName()); + } + } + } + + // Dummy policy. + static class CustomPolicy extends FocusTraversalPolicy { + public Component getComponentAfter(Container focusCycleRoot, + Component aComponent) { + return null; + } + + public Component getComponentBefore(Container focusCycleRoot, + Component aComponent) { + return null; + } + + public Component getFirstComponent(Container focusCycleRoot) { + return null; + } + + public Component getLastComponent(Container focusCycleRoot) { + return null; + } + + public Component getDefaultComponent(Container focusCycleRoot) { + return null; + } + } +} diff --git a/test/jdk/java/awt/Focus/InactiveFocusRace.java b/test/jdk/java/awt/Focus/InactiveFocusRace.java new file mode 100644 index 0000000000000..efca2dbf53a13 --- /dev/null +++ b/test/jdk/java/awt/Focus/InactiveFocusRace.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4697451 + * @summary Test that there is no race between focus component in inactive window and window activation + * @key headful + * @run main InactiveFocusRace +*/ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.KeyboardFocusManager; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.InputEvent; + +public class InactiveFocusRace { + + static Frame activeFrame, inactiveFrame; + Button activeButton, inactiveButton1, inactiveButton2; + Semaphore sema; + final static int TIMEOUT = 10000; + + public static void main(String[] args) throws Exception { + try { + InactiveFocusRace test = new InactiveFocusRace(); + test.init(); + test.start(); + } finally { + if (activeFrame != null) { + activeFrame.dispose(); + } + if (inactiveFrame != null) { + inactiveFrame.dispose(); + } + } + } + + public void init() { + activeButton = new Button("active button"); + inactiveButton1 = new Button("inactive button1"); + inactiveButton2 = new Button("inactive button2"); + activeFrame = new Frame("Active frame"); + inactiveFrame = new Frame("Inactive frame"); + inactiveFrame.setLayout(new FlowLayout()); + activeFrame.add(activeButton); + inactiveFrame.add(inactiveButton1); + inactiveFrame.add(inactiveButton2); + activeFrame.pack(); + activeFrame.setLocation(300, 10); + inactiveFrame.pack(); + inactiveFrame.setLocation(300, 300); + sema = new Semaphore(); + + inactiveButton1.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + System.err.println("Button 1 got focus"); + } + }); + inactiveButton2.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + System.err.println("Button2 got focus"); + sema.raise(); + } + }); + activeFrame.addWindowListener(new WindowAdapter() { + public void windowActivated(WindowEvent e) { + System.err.println("Window activated"); + sema.raise(); + } + }); + } + + public void start() { + Robot robot = null; + try { + robot = new Robot(); + } catch (Exception e) { + throw new RuntimeException("Unable to create robot"); + } + + inactiveFrame.setVisible(true); + activeFrame.setVisible(true); + + // Wait for active frame to become active + try { + sema.doWait(TIMEOUT); + } catch (InterruptedException ie) { + throw new RuntimeException("Wait was interrupted"); + } + if (!sema.getState()) { + throw new RuntimeException("Frame doesn't become active on show"); + } + sema.setState(false); + + // press on second button in inactive frame + Point loc = inactiveButton2.getLocationOnScreen(); + robot.mouseMove(loc.x+5, loc.y+5); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + // after all second button should be focus owner. + try { + sema.doWait(TIMEOUT); + } catch (InterruptedException ie) { + throw new RuntimeException("Wait was interrupted"); + } + if (!sema.getState()) { + throw new RuntimeException("Button2 didn't become focus owner"); + } + Toolkit.getDefaultToolkit().sync(); + robot.waitForIdle(); + if (!(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == inactiveButton2)) { + throw new RuntimeException("Button2 should be the focus owner after all"); + } + + } + +} + +class Semaphore { + boolean state = false; + int waiting = 0; + public Semaphore() { + } + public void doWait() throws InterruptedException { + synchronized(this) { + if (state) return; + waiting++; + wait(); + waiting--; + } + } + public void doWait(int timeout) throws InterruptedException { + synchronized(this) { + if (state) return; + waiting++; + wait(timeout); + waiting--; + } + } + public void raise() { + synchronized(this) { + state = true; + if (waiting > 0) { + notifyAll(); + } + } + } + public boolean getState() { + synchronized(this) { + return state; + } + } + public void setState(boolean newState) { + synchronized(this) { + state = newState; + } + } +} diff --git a/test/jdk/java/awt/Focus/InitialPrintDlgFocusTest.java b/test/jdk/java/awt/Focus/InitialPrintDlgFocusTest.java new file mode 100644 index 0000000000000..cc9d0c0371182 --- /dev/null +++ b/test/jdk/java/awt/Focus/InitialPrintDlgFocusTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4688591 + * @summary Tab key hangs in Native Print Dialog on win32 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual InitialPrintDlgFocusTest + */ + +import java.awt.BorderLayout; +import java.awt.Dialog; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.JobAttributes; +import java.awt.PageAttributes; +import java.awt.PrintJob; +import java.awt.Toolkit; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JFrame; + +public class InitialPrintDlgFocusTest { + + private static final String INSTRUCTIONS = """ + After the tests starts you will see a frame titled "PrintTest". + Press the "Print" button and the print dialog should appear. + If you are able to transfer focus between components of the Print dialog + using the TAB key, then the test passes else the test fails. + + Note: close the Print dialog before clicking on "Pass" or "Fail" buttons."""; + + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("InitialPrintDlgFocusTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(InitialPrintDlgFocusTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createTestUI() { + return new PrintTest(); + + } +} + +class PrintTest extends JFrame implements ActionListener { + + JButton b; + JobAttributes jbattrib; + Toolkit tk ; + PageAttributes pgattrib; + + public PrintTest() { + setTitle("PrintTest"); + setSize(500, 400); + + b = new JButton("Print"); + jbattrib = new JobAttributes(); + tk = Toolkit.getDefaultToolkit(); + pgattrib = new PageAttributes(); + getContentPane().setLayout(new FlowLayout()); + getContentPane().add(b); + + b.addActionListener(this); + + } + + public void actionPerformed(ActionEvent ae) { + if(ae.getSource()==b) + jbattrib.setDialog(JobAttributes.DialogType.NATIVE); + + PrintJob pjob = tk.getPrintJob(this, "Printing Test", + jbattrib, pgattrib); + + } +} + diff --git a/test/jdk/java/awt/Focus/KeyStrokeTest.java b/test/jdk/java/awt/Focus/KeyStrokeTest.java new file mode 100644 index 0000000000000..7c462ce8f22d6 --- /dev/null +++ b/test/jdk/java/awt/Focus/KeyStrokeTest.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4845868 + * @summary REGRESSION: First keystroke after JDialog is closed is lost + * @key headful + * @run main KeyStrokeTest + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +public class KeyStrokeTest { + static boolean keyTyped; + static Frame frame; + + public static void main(String[] args) throws Exception { + try { + KeyStrokeTest test = new KeyStrokeTest(); + test.doTest(); + } finally { + if (frame != null) { + frame.dispose(); + } + } + } + + private static void doTest() throws Exception { + final Object monitor = new Object(); + frame = new Frame(); + TextField textField = new TextField() { + public void transferFocus() { + System.err.println("transferFocus()"); + final Dialog dialog = new Dialog(frame, true); + Button btn = new Button("Close It"); + btn.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.err.println("action performed"); + dialog.setVisible(false); + } + }); + dialog.add(btn); + dialog.setSize(200, 200); + dialog.setVisible(true); + } + }; + + textField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + System.err.println(e); + if (e.getKeyChar() == 'a') { + keyTyped = true; + } + + synchronized (monitor) { + monitor.notifyAll(); + } + } + }); + frame.add(textField); + frame.setSize(400, 400); + frame.setVisible(true); + + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(1000); + robot.keyPress(KeyEvent.VK_TAB); + robot.keyRelease(KeyEvent.VK_TAB); + + robot.delay(1000); + robot.keyPress(KeyEvent.VK_SPACE); + robot.keyRelease(KeyEvent.VK_SPACE); + + robot.delay(1000); + synchronized (monitor) { + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + monitor.wait(3000); + } + + if (!keyTyped) { + throw new RuntimeException("TEST FAILED"); + } + + System.out.println("Test passed"); + } + +} diff --git a/test/jdk/java/awt/Focus/KillFocusTest.java b/test/jdk/java/awt/Focus/KillFocusTest.java new file mode 100644 index 0000000000000..f61c18971f6f9 --- /dev/null +++ b/test/jdk/java/awt/Focus/KillFocusTest.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 4402942 + * @summary After deactivation and activation of frame, focus should be restored correctlty + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual KillFocusTest +*/ + +import java.awt.Frame; +import java.awt.TextField; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + +public class KillFocusTest { + + private static final String INSTRUCTIONS = """ + After starting the test you should see \"Test Frame\" + with the \"Click me\" text field. + Click on this text field and try to type something in it. + Make sure that the field receives focus and you can enter text in it. + Click on any non-java window. + Click on \"Click me\" text field to return focus to it + If the caret is in the text field and you are able to type + in it then press pass else press fail."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("KillFocusTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(KillFocusTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + + Frame frame = new Frame("KillFocusTest Frame"); + TextField textField = new TextField("Click me", 10); + textField.addFocusListener(new FocusListener() { + public void focusGained(FocusEvent fe) { + PassFailJFrame.log("Focus gained"); + } + public void focusLost(FocusEvent fe) { + PassFailJFrame.log("Focus lost"); + } + }); + frame.add(textField); + frame.setSize(200, 100); + return frame; + } + + +} + diff --git a/test/jdk/java/awt/Focus/LightweightFocusLostTest.java b/test/jdk/java/awt/Focus/LightweightFocusLostTest.java new file mode 100644 index 0000000000000..aff2e5e3b2eb8 --- /dev/null +++ b/test/jdk/java/awt/Focus/LightweightFocusLostTest.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 4124119 + * @summary Checks that lightweight components do not lose focus after + dragging the frame by using the mouse. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual LightweightFocusLostTest +*/ + +import java.awt.AWTEvent; +import java.awt.AWTEventMulticaster; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Label; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + + +public class LightweightFocusLostTest { + + private static final String INSTRUCTIONS = """ + Steps to try to reproduce this problem: + When this test is run a window will display (Test Focus). + Click in the text field to give it the focus (a blinking cursor + will appear) and then move the frame with the mouse. The text field + (component which uses a lightweight component) should still have focus. + You should still see the blinking cursor in the text field after the + frame has been moved. If this is the behavior that you observe, the + test has passed, Press the Pass button. Otherwise the test has failed, + Press the Fail button."""; + + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("LightweightFocusLostTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 5) + .columns(35) + .testUI(LightweightFocusLostTest::createTestUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame f = new Frame("LightweightFocusLostTest"); + f.setLayout(new BorderLayout()); + String sLabel = "Lightweight component below (text field)"; + Label TFL = new Label(sLabel, Label.LEFT); + f.add(TFL, BorderLayout.NORTH); + SimpleTextField canvas = new SimpleTextField(30, 5); + f.add(canvas, BorderLayout.CENTER); + f.setSize(new Dimension(300,125)); + f.requestFocus(); + return f; + + } + +} + +class SimpleTextField extends Component implements Runnable { + int border; + int length; + Font font; + FontMetrics fontM; + char[] buffer; + int bufferIx; + + boolean hasFocus; + boolean cursorOn; + + SimpleTextField(int len, int bor) { + super(); + border = bor; + length = len; + buffer = new char[len]; + font = getFont(); + if (font == null) { + font = new Font("Dialog", Font.PLAIN, 20); + } + fontM = getFontMetrics(font); + + // Listen for key and mouse events. + this.addMouseListener(new MouseEventHandler()); + this.addFocusListener(new FocusEventHandler()); + this.addKeyListener(new KeyEventHandler()); + + // Set text cursor. + setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); + + // Start the thread that blinks the cursor. + (new Thread(this)).start(); + } + + public Dimension getMinimumSize() { + // The minimum height depends on the point size. + int w = fontM.charWidth('m') * length; + return new Dimension(w + 2 * border, fontM.getHeight() + 2 * border); + } + public Dimension getPreferredSize() { + return getMinimumSize(); + } + public Dimension getMaximumSize() { + return new Dimension(Short.MAX_VALUE, getPreferredSize().height); + } + + public boolean isFocusTraversable() { + return true; + } + + public void paint(Graphics g) { + int y = (getSize().height-fontM.getHeight())/2; + + // Clear the background using the text background color. + g.setColor(SystemColor.text); + g.fillRect(0, 0, getSize().width, getSize().height); + + g.setFont(font); + g.setColor(SystemColor.textText); + g.drawChars(buffer, 0, bufferIx, border, y + fontM.getAscent()); + + // Draw blinking cursor. + int x = fontM.charsWidth(buffer, 0, bufferIx) + border; + int w = fontM.charWidth('c'); + if (hasFocus) { + g.setColor(getForeground()); + g.fillRect(x, y, w, fontM.getHeight()); + if (cursorOn) { + if (bufferIx < buffer.length) { + g.setColor(SystemColor.text); + g.fillRect(x + 2, y + 2, w - 4, fontM.getHeight() - 4); + } + } + } + } + + // Event handlers + class MouseEventHandler extends MouseAdapter { + public void mousePressed(MouseEvent evt) { + requestFocus(); + } + } + class FocusEventHandler extends FocusAdapter { + public void focusGained(FocusEvent evt) { + PassFailJFrame.log("Focus gained: " + evt); + + hasFocus = true; + repaint(); + } + public void focusLost(FocusEvent evt) { + PassFailJFrame.log("Focus lost: " + evt); + hasFocus = false; + repaint(); + } + } + class KeyEventHandler extends KeyAdapter { + public void keyPressed(KeyEvent evt) { + switch (evt.getKeyCode()) { + case KeyEvent.VK_DELETE: + case KeyEvent.VK_BACK_SPACE: + if (bufferIx > 0) { + bufferIx--; + repaint(); + } + break; + case KeyEvent.VK_ENTER: + ActionEvent action = + new ActionEvent(SimpleTextField.this, + ActionEvent.ACTION_PERFORMED, + String.valueOf(buffer, 0, bufferIx)); + // Send contents of buffer to listeners + processEvent(action); + break; + default: + repaint(); + } + } + public void keyTyped(KeyEvent evt) { + if (bufferIx < buffer.length + && !evt.isActionKey() + && !Character.isISOControl(evt.getKeyChar())) { + buffer[bufferIx++] = evt.getKeyChar(); + } + } + } + + // Support for Action Listener. + ActionListener actionListener; + + public void addActionListener(ActionListener l) { + actionListener = AWTEventMulticaster.add(actionListener, l); + } + + // Override processEvent() to deal with ActionEvent. + protected void processEvent(AWTEvent evt) { + if (evt instanceof ActionEvent) { + processActionEvent((ActionEvent)evt); + } else { + super.processEvent(evt); + } + } + + // Supply method to process Action event. + protected void processActionEvent(ActionEvent evt) { + if (actionListener != null) { + actionListener.actionPerformed(evt); + } + } + + public void run() { + while (true) { + try { + // If component has focus, blink the cursor every 1/2 second. + Thread.sleep(500); + cursorOn = !cursorOn; + if (hasFocus) { + repaint(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} + diff --git a/test/jdk/java/awt/Focus/MinimizeNonfocusableWindowTest.java b/test/jdk/java/awt/Focus/MinimizeNonfocusableWindowTest.java new file mode 100644 index 0000000000000..3114850dc7af3 --- /dev/null +++ b/test/jdk/java/awt/Focus/MinimizeNonfocusableWindowTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6399659 + * @summary When minimizing non-focusable window focus shouldn't jump out of the focused window. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MinimizeNonfocusableWindowTest +*/ + +import java.awt.Frame; +import java.awt.Window; +import java.util.List; + +public class MinimizeNonfocusableWindowTest { + + private static final String INSTRUCTIONS = """ + + You should see three frames: Frame-1, Frame-2 and Unfocusable. + + 1. Click Frame-1 to make it focused window, then click Frame-2. + Minimize Unfocusable frame with the mouse. If Frame-2 is still + the focused window continue testing, otherwise press FAIL. + + 2. Restore Unfocusable frame to normal state. Try to resize by dragging + its edge with left mouse button. It should be resizable. If not press + FAIL. Try the same with right mouse button. It shouldn't resize. + If it does, press FAIL, otherwise press PASS."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("MinimizeNonfocusableWindowTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .testUI(MinimizeNonfocusableWindowTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static List createTestUI() { + Frame frame1 = new Frame("Frame-1"); + Frame frame2 = new Frame("Frame-2"); + Frame frame3 = new Frame("Unfocusable"); + frame1.setBounds(100, 0, 200, 100); + frame2.setBounds(100, 150, 200, 100); + frame3.setBounds(100, 300, 200, 100); + + frame3.setFocusableWindowState(false); + + return List.of(frame1, frame2, frame3); + } +} + diff --git a/test/jdk/java/awt/Focus/MixedWeightFocus.java b/test/jdk/java/awt/Focus/MixedWeightFocus.java new file mode 100644 index 0000000000000..4b434e4b66d7e --- /dev/null +++ b/test/jdk/java/awt/Focus/MixedWeightFocus.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4098290 4140890 + * @summary Using non-opaque windows - popups are initially not painted correctly + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MixedWeightFocus +*/ + +import java.util.List; +import java.awt.AWTEvent; +import java.awt.Button; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Panel; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.FocusEvent; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class MixedWeightFocus { + + static FocusFrame f; + + private static final String INSTRUCTIONS = """ + This tests that permanent FOCUS_LOST messages are sent to lightweight + components when the focus shifts to a heavyweight component. It also + tests that components retain the focus when their parent window is + deactivated and activated. + + 1. Tab or mouse between the light and heavyweight buttons in this test + and verify that the focus rectangle on the lightweight components + disappears when focus shifts to a heavyweight button. + + 2. Activate another application then reactivate the test frame window. + Verify that the component that had the focus (light or heavy) when + the frame was deactivated regains the focus when it's reactivated. Do + the same thing for the modeless dialog. Also test this by moving the + activation between the dialog and the frame. + + 3. Verify that lightweight components with the focus in a deactivated + window draw their focus rectangles in gray instead of blue-- this indicates + they received temporary instead of permanent FOCUS_LOST events. + + NOTE: There is currently another problem with lightweight components + where if you click on one to activate its frame window, the lightweight + that previously had the focus will not get a FOCUS_LOST event. This + may manifest itself with a gray focus rectangle not getting erased. + Ignore this for now (Win32 only)."""; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("MixedWeightFocus Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 5) + .columns(45) + .testUI(MixedWeightFocus::createTestUI) + .build() + .awaitAndCheck(); + } + + private static List createTestUI() { + FocusFrame f = new FocusFrame(); + ModelessDialog dlg = new ModelessDialog(f); + + return List.of(f, dlg); + } +} + +class FocusFrame extends Frame { + public FocusFrame() { + super("FocusFrame"); + Panel p = new Panel(); + + p.add(new Button("button 1")); + p.add(new LightweightComp("lw 1")); + p.add(new Button("button 2")); + p.add(new LightweightComp("lw 2")); + add(p); + + pack(); + setLocation(100, 100); + + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent ev) { + dispose(); + } + }); + } + +} + +class ModelessDialog extends Dialog { + public ModelessDialog(Frame frame) { + super(frame, "ModelessDialog", false); + setLayout( new FlowLayout() ); + add(new Button("button 1")); + add(new LightweightComp("lw 1")); + pack(); + setLocation(100, 400); + } +} + +// simple lightweight component, focus traversable, highlights upon focus +class LightweightComp extends Component { + FontMetrics fm; + String label; + private static final int FOCUS_GONE = 0; + private static final int FOCUS_TEMP = 1; + private static final int FOCUS_HAVE = 2; + int focusLevel = FOCUS_GONE; + public static int nameCounter = 0; + + public LightweightComp(String lwLabel ) { + label = lwLabel; + enableEvents(AWTEvent.FOCUS_EVENT_MASK|AWTEvent.MOUSE_EVENT_MASK); + setName("lw"+Integer.toString(nameCounter++)); + } + + public Dimension getPreferredSize() { + if (fm == null) { + fm = Toolkit.getDefaultToolkit().getFontMetrics(getFont()); + } + return new Dimension(fm.stringWidth(label) + 2, fm.getHeight() + 2); + } + + public void paint(Graphics g) { + Dimension s=getSize(); + + // erase the background + g.setColor(getBackground()); + g.fillRect(0, 0, s.width, s.height); + + g.setColor(getForeground()); + + // draw the string + g.drawString(label, 2, fm.getHeight()); + + // draw a focus rectangle + if (focusLevel > FOCUS_GONE) { + if (focusLevel == FOCUS_TEMP) { + g.setColor(Color.gray); + } else { + g.setColor(Color.blue); + } + g.drawRect(1,1,s.width-2,s.height-2); + } + } + + + public boolean isFocusTraversable() { + return true; + } + + protected void processFocusEvent(FocusEvent e) { + super.processFocusEvent(e); + if (e.getID() == FocusEvent.FOCUS_GAINED) { + focusLevel = FOCUS_HAVE; + } else { + if (e.isTemporary()) { + focusLevel = FOCUS_TEMP; + } else { + focusLevel = FOCUS_GONE; + } + } + repaint(); + } + + protected void processMouseEvent(MouseEvent e) { + + if (e.getID()==MouseEvent.MOUSE_PRESSED) { + requestFocus(); + } + super.processMouseEvent(e); + } +} diff --git a/test/jdk/java/awt/Focus/NextFocusHelperTest.java b/test/jdk/java/awt/Focus/NextFocusHelperTest.java new file mode 100644 index 0000000000000..5b3015da63017 --- /dev/null +++ b/test/jdk/java/awt/Focus/NextFocusHelperTest.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 4474893 + * @summary Component.nextFocusHelper should search for first visible focus cycle root ancst + * @key headful + * @run main NextFocusHelperTest +*/ + +import java.awt.Button; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.FlowLayout; +import java.awt.KeyboardFocusManager; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; + +public class NextFocusHelperTest { + static Panel panel; + static Frame frame; + static Button btn1; + static Button btn3; + static Button hideButton; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> createTestUI()); + robot.waitForIdle(); + robot.delay(1000); + + Point loc = btn1.getLocationOnScreen(); + Dimension dim = btn1.getSize(); + robot.mouseMove(loc.x + dim.width/2, loc.y + dim.height/2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + robot.delay(500); + + Point loc1 = hideButton.getLocationOnScreen(); + Dimension dim1 = hideButton.getSize(); + robot.mouseMove(loc1.x + dim1.width/2, loc1.y + dim1.height/2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() + instanceof Button btn) { + if (!btn.getLabel().equals("Button 3")) { + throw new RuntimeException("Wrong button has focus"); + } + } + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + private static void createTestUI() { + frame = new Frame("NextFocusHelperTest Frame"); + frame.setLayout(new FlowLayout()); + + panel = new Panel(); + panel.setFocusCycleRoot(true); + btn1 = new Button("Button In Panel"); + panel.add(btn1); + + hideButton = new Button("Hide Panel"); + hideButton.setFocusable(false); + hideButton.addActionListener(e -> { + panel.setVisible(false); + }); + + frame.add(new Button("Button 1")); + frame.add(panel); + frame.add(new Button("Button 3")); + frame.add(hideButton); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } +} + diff --git a/test/jdk/java/awt/Focus/RequestInInactiveFrame.java b/test/jdk/java/awt/Focus/RequestInInactiveFrame.java new file mode 100644 index 0000000000000..3297fe17501a1 --- /dev/null +++ b/test/jdk/java/awt/Focus/RequestInInactiveFrame.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6458497 + * @summary check focus requests in inactive frames + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual RequestInInactiveFrame + */ + +import java.util.ArrayList; + +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.Window; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; + +public class RequestInInactiveFrame { + + private static final String INSTRUCTIONS = """ + After the tests starts you will see two frames: \"test frame\" and \"opposite frame\" + activate the former by click on its title + Focus should be on \"press me\" button (if it's not, the test fails) + press on \"press me\" button and activate \"opposite frame\" + wait for several seconds. + Focus should either remain on button in the \"opposite frame\" + or goes to \"focus target\" button (in this case \"test frame\" should be activated + if it's not, the test failed. + Activate \"test frame\" one more time, press on \"press me\" button and switch focus + to some native window. Wait for several seconds, + If you see focus border around + \"focus target\" and \"test frame\" is not active then the test failed. + if focus transfered to that button and the frame is activated, or if there is no focus + in java - tests passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("RequestInInactiveFrame Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(RequestInInactiveFrame::createTestUI) + .build() + .awaitAndCheck(); + } + + private static ArrayList createTestUI() { + JFrame frame = new JFrame("test frame"); + final JButton btn2 = new JButton("focus target"); + JButton btn1 = new JButton("press me"); + btn1.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.out.println("waiting..."); + try { + Thread.sleep(3000); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + System.out.println("requesting focus"); + btn2.requestFocus(); + } + }); + frame.setLayout(new FlowLayout()); + frame.add(btn1); + frame.add(btn2); + frame.pack(); + frame.setLocation(200, 100); + + JFrame frame2 = new JFrame("opposite frame"); + JButton btn3 = new JButton("just a button"); + frame2.add(btn3); + frame2.pack(); + frame2.setLocation(200, 200); + + ArrayList list = new ArrayList<>(); + list.add(frame); + list.add(frame2); + return list; + } + +} diff --git a/test/jdk/java/awt/Focus/TestDisabledAutoTransfer.java b/test/jdk/java/awt/Focus/TestDisabledAutoTransfer.java new file mode 100644 index 0000000000000..d7928b7db1c70 --- /dev/null +++ b/test/jdk/java/awt/Focus/TestDisabledAutoTransfer.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 6180261 + * @summary Test that auto-transfer doesn't happen when there are pending focus requests + * @key headful + * @run main TestDisabledAutoTransfer +*/ + +import java.awt.Button; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputEvent; +import java.util.concurrent.atomic.AtomicBoolean; + +public class TestDisabledAutoTransfer { + static Frame frame; + static Robot robot; + Button b1; + Button desired; + AtomicBoolean focused = new AtomicBoolean(); + ActionListener mover; + volatile Point loc; + volatile Dimension dim; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + try { + TestDisabledAutoTransfer test = new TestDisabledAutoTransfer(); + test.createTestUI(); + robot.waitForIdle(); + robot.delay(1000); + test.doTest(); + } finally { + if (frame != null) { + frame.dispose(); + } + } + } + + public void createTestUI() { + frame = new Frame("TestDisabledAutoTransfer"); + frame.setLayout(new FlowLayout()); + desired = new Button("Desired"); + FocusAdapter watcher = new FocusAdapter() { + public void focusGained(FocusEvent e) { + synchronized(focused) { + focused.set(true); + } + } + }; + b1 = new Button("Press to disable"); + mover = new ActionListener() { + public void actionPerformed(ActionEvent e) { + desired.requestFocus(); + ((Component)e.getSource()).setEnabled(false); + } + }; + b1.addFocusListener(watcher); + desired.addFocusListener(watcher); + frame.add(b1); + Button misc = new Button("Next"); + frame.add(misc); + misc.addFocusListener(watcher); + frame.add(desired); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.validate(); + + } + + public void doTest() { + + loc = b1.getLocationOnScreen(); + dim = b1.getSize(); + robot.mouseMove(loc.x + dim.width / 2, loc.y + dim.height / 2); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + b1.requestFocus(); + + try { + synchronized(focused) { + if (!focused.get()) { + focused.wait(1000); + } + } + } catch (InterruptedException ie) { + throw new RuntimeException("Test was interrupted"); + } + + if (!focused.get()) { + throw new RuntimeException("b1 didn't get focus"); + } + focused.set(false); + + b1.addActionListener(mover); + robot.mouseMove(loc.x + dim.width / 2, loc.y + dim.height / 2); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + try { + synchronized(focused) { + if (!focused.get()) { + focused.wait(1000); + } + } + } catch (InterruptedException ie) { + throw new RuntimeException("Test was interrupted"); + } + + if (!focused.get()) { + throw new RuntimeException("none got focus"); + } + + if (!desired.isFocusOwner()) { + throw new RuntimeException("desired didn't get focus"); + } + } + +} + diff --git a/test/jdk/java/awt/Focus/TestDisabledAutoTransferSwing.java b/test/jdk/java/awt/Focus/TestDisabledAutoTransferSwing.java new file mode 100644 index 0000000000000..0793316a989cd --- /dev/null +++ b/test/jdk/java/awt/Focus/TestDisabledAutoTransferSwing.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 6180261 + * @summary Test that auto-transfer doesn't happen when there are pending focus requests + * @key headful + * @run main TestDisabledAutoTransferSwing +*/ + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.Robot; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.util.concurrent.atomic.AtomicBoolean; + +public class TestDisabledAutoTransferSwing { + static JFrame frame; + static Robot robot; + JButton b1; + JButton desired; + AtomicBoolean focused = new AtomicBoolean(); + ActionListener mover; + volatile Point loc; + volatile Dimension dim; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + try { + TestDisabledAutoTransferSwing test = new TestDisabledAutoTransferSwing(); + SwingUtilities.invokeAndWait(() -> { + test.createTestUI(); + }); + robot.waitForIdle(); + robot.delay(1000); + test.doTest(); + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + public void createTestUI() { + frame = new JFrame("TestDisabledAutoTransferSwing"); + frame.setLayout (new FlowLayout ()); + desired = new JButton("Desired"); + FocusAdapter watcher = new FocusAdapter() { + public void focusGained(FocusEvent e) { + synchronized(focused) { + focused.set(true); + } + } + }; + b1 = new JButton("Press to disable"); + mover = new ActionListener() { + public void actionPerformed(ActionEvent e) { + desired.requestFocus(); + ((Component)e.getSource()).setEnabled(false); + } + }; + b1.addFocusListener(watcher); + desired.addFocusListener(watcher); + frame.add(b1); + JButton misc = new JButton("Next"); + frame.add(misc); + misc.addFocusListener(watcher); + frame.add(desired); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.validate(); + + } + + public void doTest() throws Exception { + + SwingUtilities.invokeAndWait(() -> { + loc = b1.getLocationOnScreen(); + dim = b1.getSize(); + }); + robot.mouseMove(loc.x + dim.width / 2, loc.y + dim.height / 2); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + SwingUtilities.invokeAndWait(() -> { + b1.requestFocus(); + }); + + try { + synchronized(focused) { + if (!focused.get()) { + focused.wait(2000); + } + } + } catch (InterruptedException ie) { + throw new RuntimeException("Test was interrupted"); + } + + if (!focused.get()) { + throw new RuntimeException("b1 didn't get focus"); + } + focused.set(false); + + SwingUtilities.invokeAndWait(() -> { + b1.addActionListener(mover); + }); + robot.mouseMove(loc.x + dim.width / 2, loc.y + dim.height / 2); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + try { + synchronized(focused) { + if (!focused.get()) { + focused.wait(2000); + } + } + } catch (InterruptedException ie) { + throw new RuntimeException("Test was interrupted"); + } + + if (!focused.get()) { + throw new RuntimeException("none got focus"); + } + + if (!desired.isFocusOwner()) { + throw new RuntimeException("desired didn't get focus"); + } + } + +} diff --git a/test/jdk/java/awt/Focus/WindowDisposeFocusTest.java b/test/jdk/java/awt/Focus/WindowDisposeFocusTest.java new file mode 100644 index 0000000000000..5e2e49147e54d --- /dev/null +++ b/test/jdk/java/awt/Focus/WindowDisposeFocusTest.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4257071 4228379 + * @summary Ensures that focus lost is delivered to a lightweight component + in a disposed window + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual WindowDisposeFocusTest +*/ + +import java.awt.Window; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class WindowDisposeFocusTest { + + private static final String INSTRUCTIONS = """ + Click on "Second" + Click on close box + When dialog pops up, "Second" should no longer have focus."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("WindowDisposeFocusTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(WindowDisposeFocusTest::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Window createTestUI() { + return JFCFocusBug2.test(new String[]{}); + } +} + +class JFCFocusBug2 extends JPanel { + + static public Window test(String[] args) { + final JFrame frame = new JFrame("WindowDisposeFrame"); + frame.setSize(100, 100); + frame.setVisible(true); + + final JFCFocusBug2 bug = new JFCFocusBug2(); + final JDialog dialog = new JDialog(frame, false); + dialog.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + dialog.dispose(); + JDialog dialog2 = new JDialog(frame, false); + dialog2.setContentPane(bug); + dialog2.pack(); + dialog2.setVisible(true); + } + }); + dialog.setContentPane(bug); + dialog.pack(); + dialog.setVisible(true); + return frame; + } + + public JFCFocusBug2() { + _first = new JButton("First"); + _second = new JButton("Second"); + add(_first); + add(_second); + } + + private JButton _first; + private JButton _second; +} diff --git a/test/jdk/java/awt/Focus/bug6435715.java b/test/jdk/java/awt/Focus/bug6435715.java new file mode 100644 index 0000000000000..f13f731169ff7 --- /dev/null +++ b/test/jdk/java/awt/Focus/bug6435715.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6435715 + * @summary JButton stops receiving the focusGained event and eventually focus is lost altogether + * @modules java.desktop/sun.awt + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual bug6435715 + */ + +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class bug6435715 { + + private static final String INSTRUCTIONS = """ + 1. after test started you will see frame with three buttons. Notice that focus is on Button2. + 2. Click on Button 3. Focus goes to Button3. + 3. Click on Button1 and quickly switch to another window. Via either alt/tab or + clicking another window with the mouse. + 4. After a few seconds, come back to the frame. Notice that focus is around Button2 + 5. Click at Button3. If focus remains at Button2 test failed, if focus is on Button3 - test passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("bug6435715 Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 5) + .columns(35) + .testUI(bug6435715::createTestUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createTestUI() { + JFrame fr = new JFrame("FocusIssue"); + sun.awt.SunToolkit.setLWRequestStatus(fr, true); + + JPanel panel = new JPanel(); + final JButton b1 = new JButton("Button 1"); + final JButton b2 = new JButton("Button 2"); + final JButton b3 = new JButton("Button 3"); + + panel.add(b1); + panel.add(b2); + panel.add(b3); + + b1.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent event) { + synchronized (this) { + try { + wait(1000); + } catch (Exception ex) { + ex.printStackTrace(); + } + b2.requestFocus(); + } + } + }); + fr.getContentPane().add(panel); + fr.pack(); + return fr; + } + +} diff --git a/test/jdk/java/awt/Frame/DefaultLocationTest.java b/test/jdk/java/awt/Frame/DefaultLocationTest.java new file mode 100644 index 0000000000000..dfeb5e93e3c89 --- /dev/null +++ b/test/jdk/java/awt/Frame/DefaultLocationTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Label; + +/* + * @test + * @bug 4085599 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Test default location for frame + * @run main/manual DefaultLocationTest + */ + +public class DefaultLocationTest { + private static Frame f; + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + A small frame containing the label 'Hello World' should + appear in the upper left hand corner of the screen. The + exact location is dependent upon the window manager. + + On Linux and Mac machines, the default location for frame + is below the taskbar or close to top-left corner. + + Upon test completion, click Pass or Fail appropriately."""; + + PassFailJFrame passFailJFrame = new PassFailJFrame("DefaultLocationTest " + + " Instructions", INSTRUCTIONS, 5, 10, 40); + EventQueue.invokeAndWait(DefaultLocationTest::createAndShowUI); + passFailJFrame.awaitAndCheck(); + } + + private static void createAndShowUI() { + f = new Frame("DefaultLocation"); + f.add("Center", new Label("Hello World")); + f.pack(); + PassFailJFrame.addTestWindow(f); + PassFailJFrame.positionTestWindow( + null, PassFailJFrame.Position.HORIZONTAL); + f.setVisible(true); + } +} diff --git a/test/jdk/java/awt/Frame/EmptyFrameTest.java b/test/jdk/java/awt/Frame/EmptyFrameTest.java new file mode 100644 index 0000000000000..7a324a3cbc994 --- /dev/null +++ b/test/jdk/java/awt/Frame/EmptyFrameTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/* + * @test + * @bug 4237529 + * @key headful + * @summary Test repainting of an empty frame + * @run main EmptyFrameTest + */ + +public class EmptyFrameTest { + private static Frame f; + private static Robot robot; + private static volatile Point p; + private static volatile Dimension d; + private static final int TOLERANCE = 5; + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + try { + EventQueue.invokeAndWait(() -> { + createAndShowUI(); + }); + robot.delay(1000); + f.setSize(50, 50); + robot.delay(500); + EventQueue.invokeAndWait(() -> { + p = f.getLocation(); + d = f.getSize(); + }); + Rectangle rect = new Rectangle(p, d); + BufferedImage img = robot.createScreenCapture(rect); + if (chkImgBackgroundColor(img)) { + try { + ImageIO.write(img, "png", new File("Frame.png")); + } catch (IOException ignored) {} + throw new RuntimeException("Frame doesn't repaint itself on resize"); + } + } finally { + EventQueue.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + f = new Frame("EmptyFrameTest"); + f.setUndecorated(true); + f.setBackground(Color.RED); + f.setVisible(true); + } + + private static boolean chkImgBackgroundColor(BufferedImage img) { + for (int x = 1; x < img.getWidth() - 1; ++x) { + for (int y = 1; y < img.getHeight() - 1; ++y) { + Color c = new Color(img.getRGB(x, y)); + if ((c.getRed() - Color.RED.getRed()) > TOLERANCE) { + return true; + } + } + } + return false; + } +} diff --git a/test/jdk/java/awt/Frame/FrameLayoutTest.java b/test/jdk/java/awt/Frame/FrameLayoutTest.java new file mode 100644 index 0000000000000..d6e994beaace0 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameLayoutTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Frame; + +/* + * @test + * @bug 4173503 + * @library /java/awt/regtesthelpers + * @requires (os.family == "windows") + * @build PassFailJFrame + * @summary Tests that frame layout is performed when frame is maximized from taskbar + * @run main/manual FrameLayoutTest + */ + +public class FrameLayoutTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Right-click on the taskbar button for this test. In the menu appeared, + choose Maximize. The frame will be maximized. Check if buttons inside + the frame are laid out properly, i.e. they occupy the frame entirely. + + If so, test passes. If buttons occupy small rectangle in the top left + corner, test fails."""; + + PassFailJFrame.builder() + .title("Frame's Layout Test Instruction") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(FrameLayoutTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("Maximize Test"); + f.add(new Button("North"), BorderLayout.NORTH); + f.add(new Button("South"), BorderLayout.SOUTH); + f.add(new Button("East"), BorderLayout.EAST); + f.add(new Button("West"), BorderLayout.WEST); + f.add(new Button("Cent"), BorderLayout.CENTER); + f.pack(); + f.setState(Frame.ICONIFIED); + return f; + } +} diff --git a/test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java b/test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java new file mode 100644 index 0000000000000..929a36e773e40 --- /dev/null +++ b/test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; + +/* + * @test + * @bug 4320050 + * @key headful + * @summary Minimum size for java.awt.Frame is not being enforced. + * @run main FrameSetMinimumSizeTest + */ + +public class FrameSetMinimumSizeTest { + private static Frame f; + private static volatile boolean passed; + + public static void main(String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + try { + createAndShowUI(); + + f.setSize(200, 200); + passed = verifyFrameSize(new Dimension(300, 300)); + isFrameSizeOk(passed); + + f.setSize(200, 400); + passed = verifyFrameSize(new Dimension(300, 400)); + isFrameSizeOk(passed); + + f.setSize(400, 200); + passed = verifyFrameSize(new Dimension(400, 300)); + isFrameSizeOk(passed); + + f.setMinimumSize(null); + + f.setSize(200, 200); + passed = verifyFrameSize(new Dimension(200, 200)); + isFrameSizeOk(passed); + } finally { + if (f != null) { + f.dispose(); + } + } + }); + } + + private static void createAndShowUI() { + f = new Frame("Minimum Size Test"); + f.setSize(300, 300); + f.setMinimumSize(new Dimension(300, 300)); + f.setVisible(true); + } + + private static boolean verifyFrameSize(Dimension expected) { + + if (f.getSize().width != expected.width || f.getSize().height != expected.height) { + return false; + } + return true; + } + + private static void isFrameSizeOk(boolean passed) { + if (!passed) { + throw new RuntimeException("Frame's setMinimumSize not honoured for the" + + " frame size: " + f.getSize()); + } + } +} diff --git a/test/jdk/java/awt/Frame/PackTwiceTest.java b/test/jdk/java/awt/Frame/PackTwiceTest.java new file mode 100644 index 0000000000000..63cd20612f0d3 --- /dev/null +++ b/test/jdk/java/awt/Frame/PackTwiceTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Frame; +import java.awt.TextField; + +/* + * @test + * @bug 4097744 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary packing a frame twice stops it resizing + * @run main/manual PackTwiceTest + */ + +public class PackTwiceTest { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + 1. You would see a Frame titled 'TestFrame' + 2. The Frame displays a text as below: + 'I am a lengthy sentence...can you see me?' + 3. If you can see the full text without resizing the frame + using mouse, press 'Pass' else press 'Fail'."""; + + PassFailJFrame.builder() + .title("PackTwiceTest Instruction") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(PackTwiceTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("PackTwiceTest TestFrame"); + TextField tf = new TextField(); + f.add(tf, "Center"); + tf.setText("I am a short sentence"); + f.pack(); + f.pack(); + tf.setText("I am a lengthy sentence...can you see me?"); + f.pack(); + f.requestFocus(); + return f; + } +} diff --git a/test/jdk/java/awt/GraphicsConfiguration/NonDefaultGC.java b/test/jdk/java/awt/GraphicsConfiguration/NonDefaultGC.java new file mode 100644 index 0000000000000..fab80a461e23e --- /dev/null +++ b/test/jdk/java/awt/GraphicsConfiguration/NonDefaultGC.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4131642 + * @summary This test shows the ability to create Frames, Windows + * and Canvases with a GraphicsConfiguration. The test should show a number + * of windows with RGB stripes in according to the number of the + * GraphicsConfigurations for each screen. It also displays the size of + * the screen and the GraphicsConfiguration.toString(). + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual NonDefaultGC + */ + +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; + +public class NonDefaultGC { + + private static final String INSTRUCTIONS = """ + This test shows the ability to create Frames, Windows and Canvases + with a GraphicsConfiguration. + The test should show a number of windows with RGB stripes according + to the number of the GraphicsConfigurations for each screen. + The window also contains text which displays the size of the screen + and the output GraphicsConfiguration.toString(). + The test passes if every screen displays at least one such window. + """; + + public static void main(String[] argv) throws Exception { + SwingUtilities.invokeAndWait(NonDefaultGC::createUI); + PassFailJFrame.builder() + .title("GraphicsConfigurationTest") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(12) + .columns(45) + .build() + .awaitAndCheck(); + + } + + private static void createUI() { + + GraphicsEnvironment ge = GraphicsEnvironment. + getLocalGraphicsEnvironment(); + GraphicsDevice[] gs = ge.getScreenDevices(); + for (int j = 0; j < gs.length; j++) { + GraphicsDevice gd = gs[j]; + GraphicsConfiguration[] gc = gd.getConfigurations(); + for (int i=0; i < gc.length; i++) { + JFrame f = new JFrame(gs[j].getDefaultConfiguration()); + PassFailJFrame.addTestWindow(f); // to ensure it is disposed. + GCCanvas c = new GCCanvas(gc[i]); + Rectangle gcBounds = gc[i].getBounds(); + int xoffs = gcBounds.x; + int yoffs = gcBounds.y; + f.getContentPane().add(c); + f.setTitle("Screen# "+ j +", GC# "+ i); + f.setSize(300, 150); + f.setLocation((i*50)+xoffs, (i*60)+yoffs); + f.show(); + } + } + } +} + +class GCCanvas extends Canvas { + + GraphicsConfiguration gc; + Rectangle bounds; + + public GCCanvas(GraphicsConfiguration gc) { + super(gc); + this.gc = gc; + bounds = gc.getBounds(); + } + + public Dimension getPreferredSize() { + return new Dimension(300, 150); + } + + public void paint(Graphics g) { + g.setColor(Color.red); + g.fillRect(0, 0, 100, 150); + g.setColor(Color.green); + g.fillRect(100, 0, 100, 150); + g.setColor(Color.blue); + g.fillRect(200, 0, 100, 150); + g.setColor(Color.black); + g.drawString("ScreenSize="+bounds.width+"X"+ bounds.height, 10, 15); + g.drawString(gc.toString(), 10, 30); + } +} diff --git a/test/jdk/java/awt/GraphicsConfiguration/Position.java b/test/jdk/java/awt/GraphicsConfiguration/Position.java new file mode 100644 index 0000000000000..c281670516217 --- /dev/null +++ b/test/jdk/java/awt/GraphicsConfiguration/Position.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4271200 + * @summary This test should show that the default position of a Frame + * should be on the physical screen for the GraphicsConfiguration. + * The togglebutton shows and hides an empty frame on the second monitor. + * The frame should be positioned at 0, 0 and is shown and hidden by clicking the button. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual Position + */ + +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class Position extends JPanel implements ActionListener { + + static final String INSTRUCTIONS = """ + This test should show that the default position of a Frame + should be on the physical screen for the specified GraphicsConfiguration. + There is a window "Show/Hide" button. + The button alternatively shows and hides an empty frame on the second monitor. + The frame should be positioned at 0, 0 and is shown and hidden by clicking the button. + The test passes if it behaves as described and fails otherwise. + """; + + static volatile GraphicsDevice gd[]; + static volatile JFrame secondFrame; + static volatile boolean on = true; + + public Position() { + JPanel p = new JPanel(); + JButton b = new JButton("Show/Hide Window on other screen"); + b.addActionListener(this); + p.add(b); + add(p); + } + + public void actionPerformed(ActionEvent e) { + if (secondFrame == null) { + secondFrame = new JFrame("screen1", gd[1].getDefaultConfiguration()); + secondFrame.setSize(500, 500); + PassFailJFrame.addTestWindow(secondFrame); + } + secondFrame.setVisible(on); + on = !on; + } + + public static void main(String[] args) throws Exception { + + gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); + if (gd.length < 2) { /* test runs only on a multi-screen environment */ + return; + } + + PassFailJFrame.builder() + .title("Screen Device Position Test") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(10) + .columns(50) + .splitUIBottom(Position::new) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Label/ContainerValidateTest.java b/test/jdk/java/awt/Label/ContainerValidateTest.java new file mode 100644 index 0000000000000..e379ebb606b8c --- /dev/null +++ b/test/jdk/java/awt/Label/ContainerValidateTest.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/* + * @test + * @key headful + * @bug 4247913 + * @summary Tests that Label repaints after call Container.validate() + * @run main ContainerValidateTest + */ + +public class ContainerValidateTest extends Frame implements MouseListener { + private static Robot robot; + private static Panel currentPanel; + private static Button currentBtn; + private static Panel updatedPanel; + private static Label updatedLabel; + private static TextField updatedTxtField; + private static Button updatedBtn; + + private static volatile Rectangle btnBounds; + + Panel pnl1 = new Panel(); + Panel pnl2 = new Panel(); + Label lbl1 = new Label("Label 1"); + Label lbl2 = new Label("Label 2"); + TextField txt1 = new TextField("field1", 20); + TextField txt2 = new TextField("field2", 20); + Button btn1 = new Button("Swap 1"); + Button btn2 = new Button("Swap 2"); + + public static void main(String[] args) throws Exception { + robot = new Robot(); + + ContainerValidateTest containerValidate = new ContainerValidateTest(); + EventQueue.invokeAndWait(containerValidate::createAndShowUI); + robot.waitForIdle(); + robot.delay(1000); + + containerValidate.testUI(); + } + + private void createAndShowUI() { + this.setTitle("ContainerValidateTest Test"); + pnl1.add(lbl1); + pnl1.add(txt1); + pnl1.add(btn1); + + pnl2.add(lbl2); + pnl2.add(txt2); + pnl2.add(btn2); + + btn1.addMouseListener(this); + btn2.addMouseListener(this); + + this.add(pnl1, BorderLayout.CENTER); + pack(); + setLocationRelativeTo(null); + setVisible(true); + } + + private void testUI() throws Exception { + EventQueue.invokeAndWait(() -> btnBounds + = new Rectangle(btn1.getLocationOnScreen().x, + btn1.getLocationOnScreen().y, + btn1.getWidth(), + btn1.getHeight())); + for (int i= 1; i < 4 ; i++) { + EventQueue.invokeAndWait(() -> { + currentPanel = (Panel) this.getComponent(0); + currentBtn = (Button) currentPanel.getComponent(2); + }); + + robot.mouseMove(btnBounds.x + (int) btnBounds.getWidth() / 2, + btnBounds.y + (int) btnBounds.getHeight() / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + //large delay set for completion of UI validate() + robot.delay(500); + + EventQueue.invokeAndWait(() -> { + updatedPanel = (Panel) this.getComponent(0); + updatedLabel = (Label) updatedPanel.getComponent(0); + updatedTxtField = (TextField) updatedPanel.getComponent(1); + updatedBtn = (Button) updatedPanel.getComponent(2); + }); + testPanelComponents(currentBtn.getLabel()); + } + } + + private void testPanelComponents(String btnLabel) { + if (btnLabel.equals("Swap 1")) { + if (!(updatedLabel.getText().equals(lbl2.getText()) + && updatedTxtField.getText().equals(txt2.getText()) + && updatedBtn.getLabel().equals(btn2.getLabel()))) { + throw new RuntimeException("Test Failed!! Labels not repainted" + + " after Container.validate()"); + } + } else { + if (!(updatedLabel.getText().equals(lbl1.getText()) + && updatedTxtField.getText().equals(txt1.getText()) + && updatedBtn.getLabel().equals(btn1.getLabel()))) { + throw new RuntimeException("Test Failed!! Labels not repainted" + + " after Container.validate()"); + } + } + } + + @Override + public void mousePressed(MouseEvent evt) { + if (evt.getComponent() instanceof Button btn) { + if (btn.equals(btn1)) { + remove(pnl1); + add(pnl2, BorderLayout.CENTER); + } else { + remove(pnl2); + add(pnl1, BorderLayout.CENTER); + } + invalidate(); + validate(); + } + } + + @Override + public void mouseReleased(MouseEvent e) {} + + @Override + public void mouseEntered(MouseEvent e) {} + + @Override + public void mouseExited(MouseEvent e) {} + + @Override + public void mouseClicked(MouseEvent e) {} +} diff --git a/test/jdk/java/awt/MenuItem/GiantFontTest.java b/test/jdk/java/awt/MenuItem/GiantFontTest.java new file mode 100644 index 0000000000000..f1e352373bb1e --- /dev/null +++ b/test/jdk/java/awt/MenuItem/GiantFontTest.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Font; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; + +/* + * @test + * @bug 4700350 + * @requires os.family != "mac" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests menu item font is big + * @run main/manual GiantFontTest + */ + +public class GiantFontTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + A frame with one menu will appear. + On Linux, the menu's (present on menu bar) font should + be quite large (48 point). + If not, test fails. + + On Windows, the menu's (present on menu bar) font + should be normal size. + If the menu text is clipped by the title bar, or is painted over + the title bar or client area, the test fails. + + On both Windows and Linux, the menu items in the popup + menu should be large. + + If so, test passes."""; + + PassFailJFrame.builder() + .title("GiantFontTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(GiantFontTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Frame createAndShowUI() { + Font giantFont = new Font("Dialog", Font.PLAIN, 48); + Frame f = new Frame("GiantFontTest"); + MenuBar mb = new MenuBar(); + Menu m = new Menu("My font is too big!"); + m.setFont(giantFont); + for (int i = 0; i < 5; i++) { + m.add(new MenuItem("Some MenuItems")); + } + mb.add(m); + f.setMenuBar(mb); + f.setSize(450, 400); + return f; + } +} diff --git a/test/jdk/java/awt/MenuItem/LotsOfMenuItemsTest.java b/test/jdk/java/awt/MenuItem/LotsOfMenuItemsTest.java new file mode 100644 index 0000000000000..7a528205d27d8 --- /dev/null +++ b/test/jdk/java/awt/MenuItem/LotsOfMenuItemsTest.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; + +/* + * @test + * @bug 4175790 + * @requires os.family == "windows" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Win32: Running out of command ids for menu items + * @run main/manual LotsOfMenuItemsTest + */ + +public class LotsOfMenuItemsTest extends ComponentAdapter { + private static final int NUM_WINDOWS = 400; + private static TestFrame firstFrame; + + public static void main(String[] args) throws Exception { + LotsOfMenuItemsTest obj = new LotsOfMenuItemsTest(); + String INSTRUCTIONS = """ + This test creates lots of frames with menu bars. + When it's done you will see two frames. + Try to select menu items from each of them. + + If everything seems to work - test passed. + Click "Pass" button in the test harness window. + + If test crashes on you - test failed."""; + + PassFailJFrame.builder() + .title("LotsOfMenuItemsTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(obj::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private Frame createAndShowUI() { + firstFrame = new TestFrame("First frame"); + firstFrame.addComponentListener(this); + return firstFrame; + } + + @Override + public void componentShown(ComponentEvent e) { + final int x = firstFrame.getX(); + final int y = firstFrame.getY() + firstFrame.getHeight() + 8; + TestFrame testFrame; + for (int i = 1; i < NUM_WINDOWS - 1; ++i) { + testFrame = new TestFrame("Running(" + i + ")...", x, y); + testFrame.setVisible(false); + testFrame.dispose(); + } + testFrame = new TestFrame("Last Frame", x, y); + PassFailJFrame.addTestWindow(testFrame); + } + + private static class TestFrame extends Frame { + static int n = 0; + + public TestFrame(String title) { + this(title, 0, 0, false); + } + + public TestFrame(String s, int x, int y) { + this(s, x, y, true); + } + + private TestFrame(String title, int x, int y, boolean visible) { + super(title); + MenuBar mb = new MenuBar(); + for (int i = 0; i < 10; ++i) { + Menu m = new Menu("Menu_" + (i + 1)); + for (int j = 0; j < 20; ++j) { + MenuItem mi = new MenuItem("Menu item " + ++n); + m.add(mi); + } + mb.add(m); + } + setMenuBar(mb); + setLocation(x, y); + setSize(450, 150); + if (visible) { + setVisible(true); + } + } + } +} diff --git a/test/jdk/java/awt/MenuItem/MenuSetFontTest.java b/test/jdk/java/awt/MenuItem/MenuSetFontTest.java new file mode 100644 index 0000000000000..9a4e8f8583905 --- /dev/null +++ b/test/jdk/java/awt/MenuItem/MenuSetFontTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Font; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; + +/* + * @test + * @bug 4066657 8009454 + * @requires os.family != "mac" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests that setting a font on the Menu with MenuItem takes effect. + * @run main/manual MenuSetFontTest + */ + +public class MenuSetFontTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Look at the menu in the upper left corner of the 'SetFont Test' frame. + Click on the "File" menu. You will see "menu item" item. + Press Pass if menu item is displayed using bold and large font, + otherwise press Fail. + If you do not see menu at all, press Fail."""; + + PassFailJFrame.builder() + .title("MenuSetFontTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(MenuSetFontTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Frame createAndShowUI() { + Frame frame = new Frame("SetFont Test"); + MenuBar menuBar = new MenuBar(); + Menu menu = new Menu("File"); + MenuItem item = new MenuItem("menu item"); + menu.add(item); + menuBar.add(menu); + menuBar.setFont(new Font(Font.MONOSPACED, Font.BOLD, 24)); + frame.setMenuBar(menuBar); + frame.setSize(300, 200); + return frame; + } +} diff --git a/test/jdk/java/awt/MenuItem/NullOrEmptyStringLabelTest.java b/test/jdk/java/awt/MenuItem/NullOrEmptyStringLabelTest.java new file mode 100644 index 0000000000000..79d4c02ad246a --- /dev/null +++ b/test/jdk/java/awt/MenuItem/NullOrEmptyStringLabelTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* + * @test + * @bug 4251036 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary MenuItem setLabel(null/"") behaves differently under Win32 and Solaris + * @run main/manual NullOrEmptyStringLabelTest + */ + +public class NullOrEmptyStringLabelTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + The bug is reproducible under Win32 and Solaris. + Setting 'null' and "" as a label of menu item + should set blank label on all platforms according to the specification. + But under Solaris setting "" as a label of menu item used to + cause some garbage to be set as label. + Under Win32 setting 'null' as a label used to result in + throwing NullPointerException. + + If you see any of these things happen test fails otherwise + it passes."""; + + PassFailJFrame.builder() + .title("NullOrEmptyStringLabelTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(NullOrEmptyStringLabelTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + private static Frame createAndShowUI() { + Frame frame = new Frame("Null Or Empty String Label Test"); + Menu menu = new Menu("Menu"); + MenuItem mi = new MenuItem("Item"); + MenuBar mb = new MenuBar(); + Button button1 = new Button("Set MenuItem label to 'null'"); + Button button2 = new Button("Set MenuItem label to \"\""); + Button button3 = new Button("Set MenuItem label to 'text'"); + button1.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent ev) { + System.out.println("Setting MenuItem label to null"); + mi.setLabel(null); + } + }); + button2.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent ev) { + System.out.println("Setting MenuItem label to \"\""); + mi.setLabel(""); + } + }); + button3.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent ev) { + System.out.println("Setting MenuItem label to 'text'"); + mi.setLabel("text"); + } + }); + menu.add(mi); + mb.add(menu); + frame.add(button1, BorderLayout.NORTH); + frame.add(button2, BorderLayout.CENTER); + frame.add(button3, BorderLayout.SOUTH); + frame.setMenuBar(mb); + frame.setSize(200, 135); + return frame; + } +} diff --git a/test/jdk/java/awt/MenuItem/UnicodeMenuItemTest.java b/test/jdk/java/awt/MenuItem/UnicodeMenuItemTest.java new file mode 100644 index 0000000000000..b73fe954af6db --- /dev/null +++ b/test/jdk/java/awt/MenuItem/UnicodeMenuItemTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; + +/* + * @test + * @bug 4099695 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary menu items with Unicode labels treated as separators + * @run main/manual UnicodeMenuItemTest + */ + +public class UnicodeMenuItemTest { + + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Click on the "Menu" on the top-left corner of frame. + + The menu should have four entries: + 1) a row of five unicode characters: \u00c4\u00cb\u00cf\u00d6\u00dc + 2) a menu separator + 3) a unicode character: \u012d + 4) a unicode character: \u022d + + If the menu items look like the list above, the test passes. + It is okay if the unicode characters look like empty boxes + or something - as long as they are not separators. + + If either of the last two menu items show up as separators, + the test FAILS. + + Press 'Pass' if above instructions hold good else press 'Fail'."""; + + PassFailJFrame.builder() + .title("UnicodeMenuItemTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(40) + .testUI(UnicodeMenuItemTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + private static Frame createAndShowUI() { + Frame frame = new Frame("Unicode MenuItem Test"); + MenuBar mb = new MenuBar(); + Menu m = new Menu("Menu"); + + MenuItem mi1 = new MenuItem("\u00c4\u00cb\u00cf\u00d6\u00dc"); + m.add(mi1); + + MenuItem separator = new MenuItem("-"); + m.add(separator); + + MenuItem mi2 = new MenuItem("\u012d"); + m.add(mi2); + + MenuItem mi3 = new MenuItem("\u022d"); + m.add(mi3); + + mb.add(m); + + frame.setMenuBar(mb); + frame.setSize(450, 150); + return frame; + } +} diff --git a/test/jdk/java/awt/PopupMenu/PopupHangTest.java b/test/jdk/java/awt/PopupMenu/PopupHangTest.java new file mode 100644 index 0000000000000..bfdf6bf2abe38 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupHangTest.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 4145193 + * @summary Mouse event activates multiple pull-down menus when testing Oracle app + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PopupHangTest +*/ + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Label; +import java.awt.MenuItem; +import java.awt.PopupMenu; +import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; +import java.awt.event.FocusListener; +import java.awt.event.KeyListener; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +public class PopupHangTest { + private static final String INSTRUCTIONS = """ + 2 areas yellow and red should be seen. + + Clicking in these areas should cause a menu to popup. See if you can + get the menu to stay up and grab all input. One way to do this is to + click and hold the mouse to popup the menu, move away/outside of the + menu and release the mouse. At that point, the input is grabbed and + the *only* way out is to hit the escape key. Try this on both areas. + + To make things worse, when the popup menu is up, click repeatedly on + the LightWeight component area. Hit escape. Do you see multiple menus appearing ? + + If you do not see either of the two problems above, the problem is fixed. + Press pass, else press Fail"""; + + static Frame frame; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("PopupHangTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(45) + .testUI(PopupHangTest::createUI) + .logArea() + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + TestMenuButton m1; + TestHeavyButton m2; + frame = new Frame(); + + frame.setLayout (new BorderLayout ()); + + m1 = new TestMenuButton("LightWeight component"); + m1.setBackground(Color.yellow); + + m2 = new TestHeavyButton("HeavyWeight component"); + m2.setBackground(Color.red); + + frame.add("North", m1); + frame.add("South", m2); + + m1.requestFocus(); + frame.setSize(200, 110); + return frame; + } + +} + +class TestMenuButton extends Component implements MouseListener, + MouseMotionListener, + KeyListener, + FocusListener { + + PopupMenu popupMenu = null; + String name; + + TestMenuButton(String name) { + PopupMenu menu = popupMenu = new PopupMenu("Popup"); + menu.add(new MenuItem("item 1")); + menu.add(new MenuItem("item 2")); + menu.add(new MenuItem("item 3")); + this.add(menu); + this.name = name; + addMouseListener(this); + addMouseMotionListener(this); + addKeyListener(this); + addFocusListener(this); + } + + void println(String messageIn) { + PassFailJFrame.log(messageIn); + } + + public void mouseClicked(MouseEvent event) { + /* + popupMenu.show(this, event.getX(), event.getY()); + */ + } + public void mousePressed(MouseEvent event) { + println("TestMenuButton.mousePressed() called !!"); + popupMenu.show(this, event.getX(), event.getY()); + } + public void mouseReleased(MouseEvent event) { + println("TestMenuButton.mouseReleased() called !!"); + } + public void mouseEntered(MouseEvent event) { + println("TestMenuButton.mouseEntered() called !!"); + requestFocus(); + } + public void mouseExited(MouseEvent event) { + } + + public void mouseDragged(MouseEvent event) { + println("TestMenuButton.mouseDragged() called !!"); + } + public void mouseMoved(MouseEvent event) { + println("TestMenuButton.mouseMoved() called !!"); + } + + public void keyPressed(KeyEvent event) { + println("TestMenuButton.keyPressed() called !!"); + } + public void keyReleased(KeyEvent event) { + println("TestMenuButton.keyReleased() called !!"); + } + public void keyTyped(KeyEvent event) { + println("TestMenuButton.keyTyped() called !!"); + } + + + public void focusGained(FocusEvent e){ + println("TestMenuButton.focusGained():" + e); + } + public void focusLost(FocusEvent e){ + println("TestMenuButton.focusLost():" + e); + } + + + public void paint(Graphics g) { + Dimension d = getSize(); + + g.setColor(getBackground()); + g.fillRect(0, 0, d.width-1, d.height-1); + + g.setColor(Color.black); + g.drawString(name, 15, 15); + } + + public Dimension getPreferredSize() { + return (new Dimension(200, 50)); + } + +} + +class TestHeavyButton extends Label implements MouseListener, + MouseMotionListener, + KeyListener, + FocusListener { + + PopupMenu popupMenu = null; + String name; + + TestHeavyButton(String name) { + super(name); + PopupMenu menu = popupMenu = new PopupMenu("Popup"); + menu.add(new MenuItem("item 1")); + menu.add(new MenuItem("item 2")); + menu.add(new MenuItem("item 3")); + this.add(menu); + this.name = name; + addMouseListener(this); + addMouseMotionListener(this); + addKeyListener(this); + addFocusListener(this); + } + + void println(String messageIn) { + PassFailJFrame.log(messageIn); + } + + public void mouseClicked(MouseEvent event) { + /* + popupMenu.show(this, event.getX(), event.getY()); + */ + } + public void mousePressed(MouseEvent event) { + println("TestHeavyButton.mousePressed() called !!"); + popupMenu.show(this, event.getX(), event.getY()); + } + public void mouseReleased(MouseEvent event) { + println("TestHeavyButton.mouseReleased() called !!"); + } + public void mouseEntered(MouseEvent event) { + println("TestHeavyButton.mouseEntered() called !!"); + requestFocus(); + } + public void mouseExited(MouseEvent event) { + } + + public void mouseDragged(MouseEvent event) { + println("TestHeavyButton.mouseDragged() called !!"); + } + public void mouseMoved(MouseEvent event) { + println("TestHeavyButton.mouseMoved() called !!"); + } + + public void keyPressed(KeyEvent event) { + println("TestHeavyButton.keyPressed() called !!"); + } + public void keyReleased(KeyEvent event) { + println("TestHeavyButton.keyReleased() called !!"); + } + public void keyTyped(KeyEvent event) { + println("TestHeavyButton.keyTyped() called !!"); + } + + public void focusGained(FocusEvent e){ + println("TestHeavyButton.focusGained():" + e); + } + public void focusLost(FocusEvent e){ + println("TestHeavyButton.focusLost():" + e); + } + +} + diff --git a/test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java b/test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java new file mode 100644 index 0000000000000..3aa437e484540 --- /dev/null +++ b/test/jdk/java/awt/PopupMenu/PopupMenuVisuals.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 6180413 6184485 6267144 + * @summary test for popup menu visual bugs in XAWT + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual PopupMenuVisuals +*/ + +import java.awt.Button; +import java.awt.CheckboxMenuItem; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuItem; +import java.awt.MenuShortcut; +import java.awt.PopupMenu; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; + +public class PopupMenuVisuals { + private static final String INSTRUCTIONS = """ + This test should show a button 'Popup'. + Click on the button. A popup menu should be shown. + If following conditions are met: + - Menu is disabled + - Menu has caption 'Popup menu' (only applicable for linux) + - Menu items don't show shortcuts + + Click Pass else click Fail."""; + + static PopupMenu pm; + static Frame frame; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("PopupMenu Instructions") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(PopupMenuVisuals::createTestUI) + .build() + .awaitAndCheck(); + } + + static class Listener implements ActionListener { + public void actionPerformed(ActionEvent e) { + pm.show(frame, 0, 0); + } + } + + private static Frame createTestUI() { + Button b = new Button("Popup"); + pm = new PopupMenu("Popup menu"); + MenuItem mi1 = new MenuItem("Item 1"); + CheckboxMenuItem mi2 = new CheckboxMenuItem("Item 2"); + CheckboxMenuItem mi3 = new CheckboxMenuItem("Item 3"); + Menu sm = new Menu("Submenu"); + + //Get things going. Request focus, set size, et cetera + frame = new Frame("PopupMenuVisuals"); + frame.setSize (200,200); + frame.validate(); + + frame.add(b); + b.addActionListener(new Listener()); + mi1.setShortcut(new MenuShortcut(KeyEvent.VK_A)); + pm.add(mi1); + pm.add(mi2); + pm.add(mi3); + pm.add(sm); + sm.add(new MenuItem("Item")); + pm.setEnabled(false); + mi3.setState(true); + frame.add(pm); + return frame; + } + +} diff --git a/test/jdk/java/awt/Robot/CreateScreenCapture.java b/test/jdk/java/awt/Robot/CreateScreenCapture.java new file mode 100644 index 0000000000000..8060240ba8f1d --- /dev/null +++ b/test/jdk/java/awt/Robot/CreateScreenCapture.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4292503 + * @summary OutOfMemoryError with lots of Robot.createScreenCapture + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @requires (os.family == "linux") + * @run main/manual CreateScreenCapture +*/ + +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.TextArea; + +public class CreateScreenCapture { + + static TextArea messageText; + + private static final String INSTRUCTIONS = """ + This test is linux only! + Once you see these instructions, run 'top' program. + Watch for java process. + The memory size used by this process should stop growing after several steps. + Numbers of steps test is performing are displayed in output window. + After 5-7 steps the size taken by the process should become stable. + If this happens, then test passed otherwise test failed. + + Small oscillations of the memory size are, however, acceptable."""; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + PassFailJFrame passFail = new PassFailJFrame(INSTRUCTIONS); + Dialog dialog = new Dialog(new Frame(), "Instructions"); + messageText = new TextArea("", 5, 80, TextArea.SCROLLBARS_BOTH); + dialog.add(messageText); + PassFailJFrame.addTestWindow(dialog); + PassFailJFrame.positionTestWindow(dialog, PassFailJFrame.Position.HORIZONTAL); + dialog.setSize(200, 300); + dialog.setVisible(true); + Rectangle rect = new Rectangle(0, 0, 1000, 1000); + for (int i = 0; i < 100; i++) { + Image image = robot.createScreenCapture(rect); + image.flush(); + image = null; + robot.delay(200); + log("step #" + i); + } + passFail.awaitAndCheck(); + } + + private static void log(String messageIn) { + messageText.append(messageIn + "\n"); + } +} + diff --git a/test/jdk/java/awt/Robot/RobotScrollTest.java b/test/jdk/java/awt/Robot/RobotScrollTest.java new file mode 100644 index 0000000000000..20dc9f2f4ebd9 --- /dev/null +++ b/test/jdk/java/awt/Robot/RobotScrollTest.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4374578 + * @summary Test robot wheel scrolling of Text + * @requires (os.family == "Windows") | (os.family == "linux") + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual RobotScrollTest +*/ + +import java.awt.Frame; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.TextArea; + +public class RobotScrollTest { + + static TextArea ta; + static Robot robot; + + private static final String INSTRUCTIONS = """ + 0. DON'T TOUCH ANYTHING! + 1. This test is for Windows and Linux only. + 2. Just sit back, and watch the Robot move the mouse to the TextArea. + 3. Once the pointer is on the text area, the Robot will use the mouse wheel + to scroll the text. + If the text scrolled, press PASS, else, press FAIL."""; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + PassFailJFrame passFail = new PassFailJFrame(INSTRUCTIONS); + createTestUI(); + passFail.awaitAndCheck(); + } + + private static void createTestUI() { + Frame f = new Frame("RobotScrollTest"); + ta = new TextArea(); + for (int i = 0; i < 100; i++) { + ta.append(i + "\n"); + } + f.add(ta); + f.setLocation(0, 400); + f.pack(); + PassFailJFrame.addTestWindow(f); + PassFailJFrame.positionTestWindow(f, PassFailJFrame.Position.HORIZONTAL); + f.setVisible(true); + doTest(); + } + + private static void doTest() { + robot.waitForIdle(); + robot.delay(1000); + // get loc of TextArea + Point taAt = ta.getLocationOnScreen(); + // get bounds of button + Rectangle bounds = ta.getBounds(); + + // move mouse to middle of button + robot.mouseMove(taAt.x + bounds.width / 2, + taAt.y + bounds.height / 2); + + // rotate wheel a few times + for (int j = 1; j < 8; j++) { + for (int k = 0; k < 5; k++) { + robot.mouseWheel(j); + } + + for (int k = 0; k < 5; k++) { + robot.mouseWheel(-1 * j); + } + } + } + +} + diff --git a/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java b/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java new file mode 100644 index 0000000000000..56a39758874e6 --- /dev/null +++ b/test/jdk/java/awt/TextField/CaretPositionTest/CaretPositionTest.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.AWTException; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.event.InputEvent; +import java.lang.reflect.InvocationTargetException; + +/* + * @test + * @bug 4038580 + * @key headful + * @requires os.family != "windows" + * @summary Caret position not accurate in presence of selected areas + * @run main CaretPositionTest + */ + +public class CaretPositionTest extends Frame { + private TextField text_field; + private Button caretpos_button; + private Point onScreen; + private Dimension size; + String text = "12 45 789"; + private static volatile int position = -1; + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, AWTException { + CaretPositionTest test = new CaretPositionTest(); + EventQueue.invokeAndWait(test::setupGUI); + try { + test.test(); + if (position != 9) { + throw new RuntimeException("Caret position should be at the end of the string"); + } + } finally { + EventQueue.invokeAndWait(test::dispose); + } + } + + public void setupGUI() { + setLocationRelativeTo(null); + setTitle("CaretPositionTest"); + setLayout(new FlowLayout()); + text_field = new TextField(text, 9); + caretpos_button=new Button("CaretPosition"); + add(text_field); + add(caretpos_button); + pack(); + setVisible(true); + toFront(); + } + + public void test() throws AWTException, InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(() -> { + onScreen = text_field.getLocationOnScreen(); + size = text_field.getSize(); + }); + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.delay(1000); + int y = onScreen.y + (size.height / 2); + robot.mouseMove(onScreen.x + (size.width / 2), y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseMove(onScreen.x + 3, y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + for (int x = onScreen.x + 5; x < onScreen.x + size.width; x += 2) { + robot.mouseMove(x, y); + } + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + EventQueue.invokeAndWait(() -> { + position = text_field.getCaretPosition(); + }); + } +} diff --git a/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java b/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java new file mode 100644 index 0000000000000..e37f69232ebec --- /dev/null +++ b/test/jdk/java/awt/TextField/SetBoundsTest/SetBoundsTest.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Color; +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.ScrollPane; +import java.awt.TextArea; +import java.awt.TextField; +import java.lang.reflect.InvocationTargetException; + +/* + * @test + * @bug 6198290 6277332 + * @summary TextField painting is broken when placed on a Scrollpane, XToolkit + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetBoundsTest + */ + +public class SetBoundsTest extends Frame { + + private static final String INSTRUCTIONS = """ + 1) Make active a frame with a scrollpane and a few components. + 2) Please, focus attention on the text components + placed on the upper half of the frame + 3) Make sure, that the scrollbar of the frame + have the same position during the test. + 4) Bring focus to TextField, try deleting the text. + If the text never gets erased, the test failed + 5) Bring focus to TextArea, try deleting the text. + If the text never gets erased, the test failed + 6) Please, focus attention on the text components + placed on the lower half of the frame + 7) Try input something into TextField. + If you can not input anything into TextField, the test failed + 8) Try input something into TextArea. + If you can not input anything into TextArea, the test failed + 9) The test passed + """; + + public SetBoundsTest() { + setTitle("SetBoundsTest Test Frame"); + setLayout(new GridLayout(2, 1)); + Panel hw = new Panel(); + ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); + Container lw = new Container(); + fill(hw); + fill(lw); + + sp.add(hw); + add(sp); + add(lw); + + setSize(600, 600); + sp.setScrollPosition(20, 0); + + } + + private void fill(Container c) { + Button button = new Button("button"); + c.add(button); + button.setBackground(new Color(0xd3ceac)); + button.setForeground(new Color(0x000000)); + button.move(60, 80); + button.resize(400, 60); + button.show(true); + + TextField textfield = new TextField("textfield"); + c.add(textfield); + textfield.setBackground(new Color(0xd3ceac)); + textfield.setForeground(new Color(0x000000)); + textfield.move(60, 20); + textfield.resize(400, 40); + textfield.show(true); + + TextArea textarea = new TextArea("textarea"); + c.add(textarea); + textarea.setBackground(new Color(0xd3ceac)); + textarea.setForeground(new Color(0x000000)); + textarea.move(60, 80); + textarea.resize(400, 60); + textarea.show(true); + + c.setLayout (new FlowLayout()); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Set Bounds Test Instructions") + .instructions(INSTRUCTIONS) + .testUI(SetBoundsTest::new) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/TextField/SetEchoCharTest.java b/test/jdk/java/awt/TextField/SetEchoCharTest.java new file mode 100644 index 0000000000000..d5cb71975e6a7 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetEchoCharTest.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Point; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import jdk.test.lib.Platform; + +/* + * @test + * @bug 4124697 + * @key headful + * @summary Make sure that after setting and then changing the echo + * character again, the TextField continues to function as expected. + * @library /test/lib + * @build jdk.test.lib.Platform + * @run main SetEchoCharTest + */ + +public class SetEchoCharTest { + private static Frame frame; + private static Robot robot; + private static TextField tfPassword; + private static Button btn1; + private static Button btn2; + private static volatile Point btn1Loc; + private static volatile Point btn2Loc; + + private static final String CHANGE = "Change echo char"; + private static final String PRINT = "Print text"; + private static final String INITIAL_TEXT = "DefaultPwd"; + private static final String CHANGED_TEXT = "NewPwd"; + private static final char NEW_ECHO_CHAR = '*'; + + public static void main(String[] args) throws Exception { + try { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + + EventQueue.invokeAndWait(() -> createAndShowUI()); + robot.waitForIdle(); + robot.delay(1000); + + testEchoChar(); + robot.waitForIdle(); + robot.delay(200); + + testNewEchoChar(); + robot.waitForIdle(); + robot.delay(200); + } finally { + EventQueue.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } + + private static void createAndShowUI() { + frame = new Frame("SetEchoCharTest"); + frame.setLayout(new FlowLayout()); + + Label label = new Label("Pwd:"); + tfPassword = new TextField(INITIAL_TEXT, 10); + tfPassword.setEchoChar('X'); + tfPassword.addActionListener((ActionListener) e -> { + if (e.getActionCommand().equals(CHANGED_TEXT)) { + //check the 2nd condition only if ActionEvent + //is triggered by changed text + if (!(tfPassword.getText().equals(CHANGED_TEXT) + && tfPassword.getEchoChar() == NEW_ECHO_CHAR)) { + throw new RuntimeException("Test Failed!!! TextField not working" + + " as expected after echo char change"); + } + } + }); + frame.add(label); + frame.add(tfPassword); + + btn1 = new Button(PRINT); + btn1.addActionListener(new BtnActionListener()); + frame.add(btn1); + + btn2 = new Button(CHANGE); + btn2.addActionListener(new BtnActionListener()); + frame.add(btn2); + frame.setSize(200,200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + private static void testEchoChar() throws Exception { + EventQueue.invokeAndWait(() -> { + btn1Loc = btn1.getLocationOnScreen(); + btn2Loc = btn2.getLocationOnScreen(); + }); + + robot.mouseMove(btn1Loc.x + btn1.getWidth() / 2, + btn1Loc.y + btn1.getHeight() / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(1000); + + robot.mouseMove(btn2Loc.x + btn2.getWidth() / 2, + btn2Loc.y + btn2.getHeight() / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(1000); + } + + private static void testNewEchoChar() { + StringSelection stringSelection = new StringSelection(CHANGED_TEXT); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(stringSelection, stringSelection); + + int ctrlKey = Platform.isOSX() ? KeyEvent.VK_META : KeyEvent.VK_CONTROL; + robot.keyPress(ctrlKey); + robot.keyPress(KeyEvent.VK_V); + robot.keyRelease(KeyEvent.VK_V); + robot.keyRelease(ctrlKey); + + robot.keyPress(KeyEvent.VK_ENTER); + robot.keyRelease(KeyEvent.VK_ENTER); + } + + private static class BtnActionListener implements ActionListener { + public void actionPerformed(ActionEvent evt) { + String ac = evt.getActionCommand(); + if (CHANGE.equals(ac)) { + tfPassword.setText(""); + tfPassword.setEchoChar(NEW_ECHO_CHAR); + tfPassword.requestFocus(); + } + if (PRINT.equals(ac)) { + if (!tfPassword.getText().equals(INITIAL_TEXT)) { + throw new RuntimeException("Test Failed!!!" + + " Initial text not as expected"); + } + } + } + } +} + diff --git a/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java new file mode 100644 index 0000000000000..c1cc07afac0ad --- /dev/null +++ b/test/jdk/java/awt/TextField/SetEchoCharTest4/SetEchoCharTest4.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; + +/* + * @test + * @bug 4226580 + * @summary TextField with echoChar add+remove+add seems to be broken + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetEchoCharTest4 + */ + +public class SetEchoCharTest4 extends Frame implements ActionListener { + TextField tf1 = new TextField(8); + TextField tf2 = new TextField(8); + TextField tf3 = new TextField(8); + Button b = new Button("Click Several Times"); + + static final String INSTRUCTIONS = """ + Type in the first text field and * characters will echo. + Type in the second text field and $ characters will echo. + Type in the third text field and # characters will echo. + + Hit the button several times. All characters should remain + the same and the test should not crash. + + Make sure the actual text matches what you typed in for each field. + Press Pass if everything's ok, otherwise Fail + """; + + public SetEchoCharTest4() { + setLayout(new FlowLayout()); + tf1.setEchoChar('*'); + tf2.setEchoChar('$'); + tf3.setEchoChar('#'); + addStuff(); + b.addActionListener(this); + setSize (200,200); + } + + private void addStuff() { + add(tf1); + add(tf2); + add(tf3); + add(b); + } + + public void actionPerformed(ActionEvent ae) { + PassFailJFrame.log("TextField1 = " + tf1.getText()); + PassFailJFrame.log("TextField2 = " + tf2.getText()); + PassFailJFrame.log("TextField3 = " + tf3.getText()); + PassFailJFrame.log("--------------"); + setVisible(false); + remove(tf1); + remove(tf2); + remove(tf3); + remove(b); + addStuff(); + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Set Echo Character Test") + .testUI(SetEchoCharTest4::new) + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/TextField/SetEchoCharWordOpsTest.java b/test/jdk/java/awt/TextField/SetEchoCharWordOpsTest.java new file mode 100644 index 0000000000000..825c21fdc9639 --- /dev/null +++ b/test/jdk/java/awt/TextField/SetEchoCharWordOpsTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.FlowLayout; +import java.awt.Label; +import java.awt.TextField; +import javax.swing.JPanel; + +import jdk.test.lib.Platform; + +/* + * @test + * @bug 6191897 + * @summary Verifies that ctrl+left/right does not move word-by-word in a TextField + * with echo character set + * @library /java/awt/regtesthelpers /test/lib + * @build PassFailJFrame jdk.test.lib.Platform + * @run main/manual SetEchoCharWordOpsTest + */ + +public class SetEchoCharWordOpsTest { + + public static void main(String[] args) throws Exception { + String selectAllKey; + String moveKeys; + String selectKeys; + + if (Platform.isOSX()) { + selectAllKey = "Cmd + A"; + moveKeys = "Alt + Right/Left"; + selectKeys = "Shift + Alt + Right/Left"; + } else { + selectAllKey = "Ctrl + A"; + moveKeys = "Ctrl + Right/Left"; + selectKeys = "Shift + Ctrl + Right/Left"; + } + + String instructions = + "The password field (in the bottom panel) in this test contains" + + " a few words (3 words).\n" + + "Move the focus to the text field and press " + selectAllKey + ".\n" + + "Try moving the caret word-by-word with " + moveKeys + " or" + + " extending selection with " + selectKeys + "." + + " You should NOT be able to do that.\n\n" + + "If you are able to move the caret word-by-word press FAIL," + + " else press PASS."; + + PassFailJFrame.builder() + .title("SetEchoCharClipboard Instructions") + .instructions(instructions) + .rows((int) instructions.lines().count() + 3) + .columns(45) + .splitUIBottom(SetEchoCharWordOpsTest::createAndShowUI) + .build() + .awaitAndCheck(); + } + + + private static JPanel createAndShowUI() { + JPanel jPanel = new JPanel(); + TextField tf = new TextField("one two three", 15); + Label tfLabel = new Label("Password Field:"); + + jPanel.setLayout(new FlowLayout()); + tf.setEchoChar('*'); + jPanel.add(tfLabel); + jPanel.add(tf); + return jPanel; + } +} diff --git a/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java new file mode 100644 index 0000000000000..cff5e3750173e --- /dev/null +++ b/test/jdk/java/awt/TextField/SetPasswordTest/SetPasswordTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; + +/* + * @test + * @bug 4084454 + * @summary Make sure that you can set the text in a "password mode" + * text field and that it echoes as the current echo char. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual SetPasswordTest + */ + +public class SetPasswordTest extends Frame implements ActionListener { + private String setText = "Set text"; + private String getText = "Get text"; + private TextField tfPassword; + + static final String INSTRUCTIONS = """ + The purpose of this test is to ensure that when using a textField for + password entry that text set programmatically is not shown in the clear. + + We also test "pasting" text into the text field. + + 1. Press the "Set Text" button + Text should appear as '*' chars + - if the string "secret" appears then the test is failed. + 2. Use the mouse to select (highlight) all the text and press the DELETE key + 3. Use the system's copy/paste functionality to copy a text string from the + desktop or this window, and paste it into the text field. + 4. Text should appear in the text field as '*' chars + - if the string you pasted appears then the test is failed. + 5. press the "Get Text" button and the string you pasted + should be printed in the log area + - if it prints echo symbols instead the test is failed. + """; + + public SetPasswordTest() { + setLayout(new FlowLayout()); + tfPassword = new TextField("Initial text", 30); + tfPassword.setEchoChar('*'); + add(tfPassword); + + Button b1 = new Button(setText); + b1.addActionListener(this); + add(b1); + + Button b2 = new Button(getText); + b2.addActionListener(this); + add(b2); + pack(); + } + + public void actionPerformed(ActionEvent evt) { + String ac = evt.getActionCommand(); + if (setText.equals(ac)) { + tfPassword.setText("secret"); + } + + if (getText.equals(ac)) { + PassFailJFrame.log("Text: \"" + tfPassword.getText() + "\""); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Set Password Test") + .testUI(SetPasswordTest::new) + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .logArea() + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java b/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java new file mode 100644 index 0000000000000..274cec225729c --- /dev/null +++ b/test/jdk/java/awt/TextField/ZeroEchoCharTest/ZeroEchoCharTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.lang.reflect.InvocationTargetException; + +/* + * @test + * @bug 4307281 + * @summary verify that after setting the echo char to 0 disguises are + * removed and user input is echoed to the screen unchanged. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ZeroEchoCharTest + */ + +public class ZeroEchoCharTest extends Frame implements ActionListener { + private final TextField textfield = new TextField(); + private final Button button1 = new Button("Set echo char to *"); + private final Button button2 = new Button("Set echo char to 0"); + static final String INSTRUCTIONS = """ + 1.Type in the text field. The user input must be echoed unchanged. + 2.Set echo char to '*' by pressing the corresponding button. + If all characters in the text field aren't immediately replaced + with '*', the test fails. + 3.Set echo char to 0 by pressing the corresponding button. + If disguises in the text field don't immediately revert to + the original characters, the test fails. + 4.Type in the text field. If the input is echoed unchanged, + the test passes. Otherwise, the test fails. + """; + + public ZeroEchoCharTest() { + button1.addActionListener(this); + button2.addActionListener(this); + + setLayout(new GridLayout(3, 1)); + + add(textfield); + add(button1); + add(button2); + pack(); + } + + public void actionPerformed(ActionEvent event) { + if (event.getSource() == button1) { + textfield.setEchoChar('*'); + } else if (event.getSource() == button2) { + textfield.setEchoChar((char)0); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + PassFailJFrame.builder() + .title("Zero Echo Char Test") + .testUI(ZeroEchoCharTest::new) + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 1) + .columns(40) + .build() + .awaitAndCheck(); + } +} diff --git a/test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java b/test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java index cb20a2f2732c8..91d277a228450 100644 --- a/test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java +++ b/test/jdk/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -28,7 +28,7 @@ @summary Tests that windows are removed from owner's child windows list @modules java.desktop/java.awt:open @author art: area=awt.toplevel - @run main/othervm -mx128m OwnedWindowsLeak + @run main/othervm -Xmx128m OwnedWindowsLeak */ import java.awt.Frame; diff --git a/test/jdk/java/awt/dnd/DropActionChangeTest.java b/test/jdk/java/awt/dnd/DropActionChangeTest.java index 7cb1019a44de7..2bfbb44bbfd38 100644 --- a/test/jdk/java/awt/dnd/DropActionChangeTest.java +++ b/test/jdk/java/awt/dnd/DropActionChangeTest.java @@ -21,17 +21,17 @@ * questions. */ -import javax.swing.JFrame; import java.awt.AWTEvent; import java.awt.Component; import java.awt.EventQueue; import java.awt.Frame; import java.awt.Panel; import java.awt.Point; +import java.awt.Rectangle; import java.awt.Robot; +import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; import java.awt.dnd.DnDConstants; -import java.awt.dnd.DragGestureEvent; import java.awt.dnd.DragGestureListener; import java.awt.dnd.DragSource; import java.awt.dnd.DragSourceAdapter; @@ -43,9 +43,13 @@ import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.AWTEventListener; -import java.awt.event.MouseEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; +import java.io.File; +import java.util.concurrent.atomic.AtomicReference; +import javax.imageio.ImageIO; +import javax.swing.JFrame; /* @test @@ -56,28 +60,24 @@ */ public class DropActionChangeTest extends JFrame implements AWTEventListener { - Robot robot; - Frame frame; + private static Robot robot; + private static Frame frame; + private static volatile DropActionChangeTest test; Panel panel; private volatile boolean failed; private volatile boolean dropEnd; private volatile Component clickedComponent; private final Object LOCK = new Object(); - static final int FRAME_ACTIVATION_TIMEOUT = 3000; - static final int DROP_COMPLETION_TIMEOUT = 5000; + static final int DROP_COMPLETION_TIMEOUT = 8000; static final int MOUSE_RELEASE_TIMEOUT = 2000; public static void main(String[] args) throws Exception { - DropActionChangeTest test = new DropActionChangeTest(); + EventQueue.invokeAndWait(() -> test = new DropActionChangeTest()); EventQueue.invokeAndWait(test::init); try { test.start(); } finally { - EventQueue.invokeAndWait(() -> { - if (test.frame != null) { - test.frame.dispose(); - } - }); + EventQueue.invokeAndWait(DropActionChangeTest::disposeFrame); } } @@ -97,10 +97,12 @@ public void init() { final DragSourceListener dsl = new DragSourceAdapter() { public void dragDropEnd(DragSourceDropEvent e) { - System.err.println("DragSourseListener.dragDropEnd(): " + + System.err.println("DragSourceListener.dragDropEnd(): " + "drop action=" + e.getDropAction()); if (e.getDropAction() != DnDConstants.ACTION_MOVE) { - System.err.println("FAILURE: wrong drop action:" + e.getDropAction()); + System.err.println("FAILURE: wrong drop action:" + + e.getDropAction() + ", It should be " + + DnDConstants.ACTION_MOVE); failed = true; } synchronized (LOCK) { @@ -110,11 +112,7 @@ public void dragDropEnd(DragSourceDropEvent e) { } }; - DragGestureListener dgl = new DragGestureListener() { - public void dragGestureRecognized(DragGestureEvent dge) { - dge.startDrag(null, new StringSelection("test"), dsl); - } - }; + DragGestureListener dgl = dge -> dge.startDrag(null, new StringSelection("test"), dsl); new DragSource().createDefaultDragGestureRecognizer(panel, DnDConstants.ACTION_COPY_OR_MOVE, dgl); @@ -142,11 +140,25 @@ public void drop(DropTargetDropEvent e) { frame.setVisible(true); } + private static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + if (test != null) { + test.dispose(); + } + } + public void start() { try { robot = new Robot(); + robot.setAutoDelay(100); + robot.waitForIdle(); + robot.delay(500); - Point startPoint = panel.getLocationOnScreen(); + AtomicReference startPointRef = new AtomicReference<>(); + EventQueue.invokeAndWait(()-> startPointRef.set(panel.getLocationOnScreen())); + Point startPoint = startPointRef.get(); startPoint.translate(50, 50); if (!pointInComponent(robot, startPoint, panel)) { @@ -163,15 +175,18 @@ public void start() { synchronized (LOCK) { robot.keyPress(KeyEvent.VK_CONTROL); robot.mouseMove(startPoint.x, startPoint.y); - robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); Util.doDrag(robot, startPoint, medPoint); + robot.delay(500); robot.keyRelease(KeyEvent.VK_CONTROL); Util.doDrag(robot, medPoint, endPoint); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(500); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); LOCK.wait(DROP_COMPLETION_TIMEOUT); } if (!dropEnd) { - System.err.println("DragSourseListener.dragDropEnd() was not called, returning"); + captureScreen("No_Drop_End_"); + System.err.println("DragSourceListener.dragDropEnd() was not called, returning"); return; } } catch (Throwable e) { @@ -179,10 +194,22 @@ public void start() { } if (failed) { - throw new RuntimeException("wrong drop action!"); + captureScreen("Wrong_Drop_Action_"); + throw new RuntimeException("Wrong drop action!"); } - System.err.println("test passed!"); + System.err.println("Test passed!"); + } + + private static void captureScreen(String str) { + try { + final Rectangle screenBounds = new Rectangle( + Toolkit.getDefaultToolkit().getScreenSize()); + ImageIO.write(robot.createScreenCapture(screenBounds), "png", + new File(str + "Failure_Screen.png")); + } catch (Exception e) { + e.printStackTrace(); + } } public void reset() { @@ -203,9 +230,9 @@ boolean pointInComponent(Robot robot, Point p, Component comp) robot.waitForIdle(); reset(); robot.mouseMove(p.x, p.y); - robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); synchronized (LOCK) { - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); LOCK.wait(MOUSE_RELEASE_TIMEOUT); } @@ -227,15 +254,11 @@ public static int sign(int n) { } public static void doDrag(Robot robot, Point startPoint, Point endPoint) { + robot.waitForIdle(); for (Point p = new Point(startPoint); !p.equals(endPoint); p.translate(Util.sign(endPoint.x - p.x), Util.sign(endPoint.y - p.y))) { robot.mouseMove(p.x, p.y); - try { - Thread.sleep(100); - } catch (InterruptedException e) { - e.printStackTrace(); - } } } -} +} \ No newline at end of file diff --git a/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java b/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java index 02e7a890d83e4..78043cb5abdf4 100644 --- a/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java +++ b/test/jdk/java/awt/event/KeyEvent/FunctionKeyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024, 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 @@ -31,6 +31,18 @@ import java.awt.Robot; import java.awt.TextArea; import java.awt.event.KeyEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; + +import static java.awt.Event.KEY_ACTION; +import static java.awt.Event.KEY_ACTION_RELEASE; +import static java.util.concurrent.TimeUnit.SECONDS; /* * @test @@ -39,35 +51,38 @@ * @key headful */ -public class FunctionKeyTest { - private static FunctionKeyTester frame; +public final class FunctionKeyTest { + private static Frame frame; private static Robot robot; - static volatile boolean keyPressReceived; - static volatile boolean keyReleaseReceived; + private static final CyclicBarrier keyPress = new CyclicBarrier(2); + private static final CyclicBarrier keyRelease = new CyclicBarrier(2); - static final StringBuilder failures = new StringBuilder(); + private static final CountDownLatch frameActivated = new CountDownLatch(1); - private static void testKey(int keyCode, String keyText) { - keyPressReceived = false; - keyReleaseReceived = false; + private static final List failures = new ArrayList<>(4); + private static final AtomicReference edtException = new AtomicReference<>(); + private static void testKey(int keyCode, String keyText) throws Exception { robot.keyPress(keyCode); - - if (!keyPressReceived) { - failures.append(keyText).append(" key press is not received\n"); + try { + keyPress.await(2, SECONDS); + } catch (TimeoutException e) { + keyPress.reset(); + failures.add(new Error(keyText + " key press is not received", e)); } robot.keyRelease(keyCode); - - if (!keyReleaseReceived) { - failures.append(keyText).append(" key release is not received\n"); + try { + keyRelease.await(2, SECONDS); + } catch (TimeoutException e) { + keyRelease.reset(); + failures.add(new Error(keyText + " key release is not received", e)); } } public static void main(String[] args) throws Exception { robot = new Robot(); - robot.setAutoWaitForIdle(true); robot.setAutoDelay(150); try { @@ -75,11 +90,20 @@ public static void main(String[] args) throws Exception { frame = new FunctionKeyTester(); frame.setSize(200, 200); frame.setLocationRelativeTo(null); + frame.addWindowListener(new WindowAdapter() { + @Override + public void windowActivated(WindowEvent e) { + System.out.println("frame.windowActivated"); + frameActivated.countDown(); + } + }); frame.setVisible(true); }); - robot.waitForIdle(); - robot.delay(1000); + if (!frameActivated.await(2, SECONDS)) { + throw new Error("Frame wasn't activated"); + } + robot.delay(100); testKey(KeyEvent.VK_F11, "F11"); testKey(KeyEvent.VK_F12, "F12"); @@ -91,46 +115,69 @@ public static void main(String[] args) throws Exception { }); } - if (failures.isEmpty()) { - System.out.println("Passed"); - } else { - throw new RuntimeException(failures.toString()); + if (!failures.isEmpty()) { + System.err.println("Failures detected:"); + failures.forEach(System.err::println); + if (edtException.get() != null) { + System.err.println("\nException on EDT:"); + edtException.get().printStackTrace(); + } + System.err.println(); + throw new RuntimeException("Test failed: " + failures.get(0).getMessage(), + failures.get(0)); } - } -} -class FunctionKeyTester extends Frame { - Label l = new Label ("NULL"); - Button b = new Button(); - TextArea log = new TextArea(); - - FunctionKeyTester() { - super("Function Key Test"); - this.setLayout(new BorderLayout()); - this.add(BorderLayout.NORTH, l); - this.add(BorderLayout.SOUTH, b); - this.add(BorderLayout.CENTER, log); - log.setFocusable(false); - log.setEditable(false); - l.setBackground(Color.red); - setSize(200, 200); + if (edtException.get() != null) { + throw new RuntimeException("Test failed because of exception on EDT", + edtException.get()); + } } - public boolean handleEvent(Event e) { - String message = "e.id=" + e.id + "\n"; - System.out.print(message); - log.append(message); - - switch (e.id) { - case 403 -> FunctionKeyTest.keyPressReceived = true; - case 404 -> FunctionKeyTest.keyReleaseReceived = true; + private static final class FunctionKeyTester extends Frame { + Label l = new Label ("NULL"); + Button b = new Button("button"); + TextArea log = new TextArea(); + + FunctionKeyTester() { + super("Function Key Test"); + this.setLayout(new BorderLayout()); + this.add(BorderLayout.NORTH, l); + this.add(BorderLayout.SOUTH, b); + this.add(BorderLayout.CENTER, log); + log.setFocusable(false); + log.setEditable(false); + l.setBackground(Color.red); + setSize(200, 200); } - return super.handleEvent(e); - } + @Override + @SuppressWarnings("deprecation") + public boolean handleEvent(Event e) { + String message = "e.id=" + e.id + "\n"; + System.out.print(message); + log.append(message); + + try { + switch (e.id) { + case KEY_ACTION + -> keyPress.await(); + case KEY_ACTION_RELEASE + -> keyRelease.await(); + } + } catch (Exception ex) { + if (!edtException.compareAndSet(null, ex)) { + edtException.get().addSuppressed(ex); + } + } - public boolean keyDown(Event e, int key) { - l.setText("e.key=" + Integer.valueOf(e.key).toString()); - return false; + return super.handleEvent(e); + } + + @Override + @SuppressWarnings("deprecation") + public boolean keyDown(Event e, int key) { + l.setText("e.key=" + e.key); + return false; + } } } diff --git a/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java b/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java new file mode 100644 index 0000000000000..a944be855810a --- /dev/null +++ b/test/jdk/java/awt/event/KeyEvent/KeyTyped/Numpad1KeyTyped.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Frame; +import java.awt.Robot; +import java.awt.TextField; +import java.awt.Toolkit; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.util.concurrent.CountDownLatch; + +import jdk.test.lib.Platform; + +import static java.util.concurrent.TimeUnit.SECONDS; + +/* + * @test + * @bug 4724007 + * @key headful + * @summary Tests that KeyTyped events are fired for the Numpad1 key + * @library /test/lib + * @build jdk.test.lib.Platform + * @run main Numpad1KeyTyped + */ +public final class Numpad1KeyTyped extends FocusAdapter implements KeyListener { + + private static final String ORIGINAL = "0123456789"; + private static final String EXPECTED = "10123456789"; + + private final CountDownLatch typedNum1 = new CountDownLatch(1); + private final CountDownLatch focusGained = new CountDownLatch(1); + + public static void main(String[] args) throws Exception { + Numpad1KeyTyped test = new Numpad1KeyTyped(); + test.start(); + } + + private void start() throws Exception { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Boolean oldState = null; + + Robot robot = new Robot(); + robot.setAutoDelay(100); + + Frame frame = new Frame("Numpad1KeyTyped"); + TextField tf = new TextField(ORIGINAL, 20); + frame.add(tf); + tf.addKeyListener(this); + + tf.addFocusListener(this); + + frame.setSize(300, 100); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + tf.requestFocusInWindow(); + + if (!focusGained.await(2, SECONDS)) { + throw new RuntimeException("TextField didn't receive focus"); + } + robot.waitForIdle(); + + try { + // Move cursor to start of TextField + robot.keyPress(KeyEvent.VK_HOME); + robot.keyRelease(KeyEvent.VK_HOME); + robot.waitForIdle(); + + if (Platform.isLinux()) { + // Press but don't release NumLock + robot.keyPress(KeyEvent.VK_NUM_LOCK); + } + if (Platform.isWindows()) { + oldState = toolkit.getLockingKeyState(KeyEvent.VK_NUM_LOCK); + toolkit.setLockingKeyState(KeyEvent.VK_NUM_LOCK, true); + } + + // Press and release Numpad-1 + robot.keyPress(KeyEvent.VK_NUMPAD1); + robot.keyRelease(KeyEvent.VK_NUMPAD1); + + if (!typedNum1.await(2, SECONDS)) { + throw new RuntimeException("TextField didn't receive keyTyped('1') - too slow"); + } + + final String text = tf.getText(); + if (!text.equals(EXPECTED)) { + throw new RuntimeException("Test FAILED: wrong string '" + + text + "' vs " + + "expected '" + EXPECTED + "'"); + } + System.out.println("Test PASSED"); + } finally { + if (Platform.isLinux()) { + // "release" + "press and release" NumLock to disable numlock + robot.keyRelease(KeyEvent.VK_NUM_LOCK); + robot.keyPress(KeyEvent.VK_NUM_LOCK); + robot.keyRelease(KeyEvent.VK_NUM_LOCK); + } + if (oldState != null) { + toolkit.setLockingKeyState(KeyEvent.VK_NUM_LOCK, oldState); + } + + frame.dispose(); + } + } + + @Override + public void focusGained(FocusEvent e) { + System.out.println("tf.focusGained"); + focusGained.countDown(); + } + + @Override + public void keyPressed(KeyEvent evt) { + printKey(evt); + } + + @Override + public void keyTyped(KeyEvent evt) { + printKey(evt); + + int keychar = evt.getKeyChar(); + if (keychar == '1') { + typedNum1.countDown(); + } + } + + @Override + public void keyReleased(KeyEvent evt) { + printKey(evt); + System.out.println(); + } + + private static void printKey(KeyEvent evt) { + int id = evt.getID(); + if (id != KeyEvent.KEY_TYPED + && id != KeyEvent.KEY_PRESSED + && id != KeyEvent.KEY_RELEASED) { + + System.out.println("Other Event"); + return; + } + + System.out.println("params= " + evt.paramString() + " \n" + + "KeyChar: " + evt.getKeyChar() + " = " + (int) evt.getKeyChar() + + " KeyCode: " + evt.getKeyCode() + + " Modifiers: " + evt.getModifiersEx()); + + if (evt.isActionKey()) { + System.out.println(" Action Key"); + } + + System.out.println("keyText= " + KeyEvent.getKeyText(evt.getKeyCode()) + "\n"); + } + +} diff --git a/test/jdk/java/awt/image/BufferedImage/GrayAATextTest.java b/test/jdk/java/awt/image/BufferedImage/GrayAATextTest.java new file mode 100644 index 0000000000000..a484dd392eb03 --- /dev/null +++ b/test/jdk/java/awt/image/BufferedImage/GrayAATextTest.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4309915 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Check that Antialiased text drawn on a BYTE_GRAY image + * resolves the color correctly + * @run main/manual GrayAATextTest + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Panel; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; + +public class GrayAATextTest extends Panel { + + public static final int WIDTH = 600; + public static final int HEIGHT = 200; + + private static final String INSTRUCTIONS = """ + All of the strings in a given column should be drawn + in the same color. If the bug is present, then the + Antialiased strings will all be of a fixed color that + is not the same as the other strings in their column."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("GrayAATextTest Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(GrayAATextTest::createTestUI) + .build() + .awaitAndCheck(); + } + + public void paint(Graphics g) { + BufferedImage bi = new BufferedImage(WIDTH, HEIGHT, + BufferedImage.TYPE_BYTE_GRAY); + Graphics2D g2d = bi.createGraphics(); + g2d.setFont(new Font("Helvetica", Font.PLAIN, 24)); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, WIDTH / 2, HEIGHT); + drawText(g2d, Color.black, "Black", 25); + drawText(g2d, Color.lightGray, "Light Gray", 175); + g2d.setColor(Color.black); + g2d.fillRect(WIDTH / 2, 0, WIDTH / 2, HEIGHT); + drawText(g2d, Color.white, "White", 325); + drawText(g2d, Color.lightGray, "Light Gray", 475); + g2d.dispose(); + g.drawImage(bi, 0, 0, null); + } + + public void drawText(Graphics2D g2d, Color c, String colorname, int x) { + g2d.setColor(c); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_OFF); + g2d.drawString(colorname, x, 50); + g2d.drawString("Aliased", x, 100); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2d.drawString("Antialiased", x, 150); + } + + public Dimension getPreferredSize() { + return new Dimension(WIDTH, HEIGHT); + } + + private static Frame createTestUI() { + Frame f = new Frame("GrayAATextTest Frame"); + f.add(new GrayAATextTest()); + f.setSize(WIDTH, HEIGHT); + return f; + } +} diff --git a/test/jdk/java/awt/image/GrayAlpha.java b/test/jdk/java/awt/image/GrayAlpha.java new file mode 100644 index 0000000000000..cf477c2638503 --- /dev/null +++ b/test/jdk/java/awt/image/GrayAlpha.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4243044 + * @summary This test should show two windows filled with checker + * board pattern. The transparency should runs from left to right from + * total transparent to total opaque. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual GrayAlpha + */ + +import java.util.List; +import java.awt.Frame; +import java.awt.color.ColorSpace; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.ComponentColorModel; +import java.awt.image.DataBuffer; +import java.awt.image.Raster; +import java.awt.image.WritableRaster; +import java.awt.Point; +import java.awt.Panel; +import java.awt.Transparency; +import java.awt.Window; + +public class GrayAlpha extends Panel { + + private static final String INSTRUCTIONS = """ + This test should show two windows filled with checker board + vpattern. The transparency should runs from left to right from + totally transparent to totally opaque. If either the pattern or + the transparency is not shown correctly, click Fail, otherwise + click Pass."""; + + BufferedImage bi; + AffineTransform identityTransform = new AffineTransform(); + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("GrayAlpha Instructions") + .instructions(INSTRUCTIONS) + .rows((int)INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(GrayAlpha::createTestUI) + .build() + .awaitAndCheck(); + } + + + public GrayAlpha(int width, int height, + boolean hasAlpha, boolean isAlphaPremultiplied, + boolean useRGB) { + boolean isAlphaPremuliplied = true; + int bands = useRGB ? 3 : 1; + bands = hasAlpha ? bands + 1 : bands; + + ColorSpace cs = useRGB ? + ColorSpace.getInstance(ColorSpace.CS_sRGB) : + ColorSpace.getInstance(ColorSpace.CS_GRAY); + int transparency = hasAlpha ? + Transparency.TRANSLUCENT : Transparency.OPAQUE; + int[] bits = new int[bands]; + for (int i = 0; i < bands; i++) { + bits[i] = 8; + } + + ColorModel cm = new ComponentColorModel(cs, + bits, + hasAlpha, + isAlphaPremultiplied, + transparency, + DataBuffer.TYPE_BYTE); + WritableRaster wr = + Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE, + width, height, bands, + new Point(0, 0)); + + for (int b = 0; b < bands; b++) { + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int s; + + if (b != bands - 1 || !hasAlpha) { + // Gray band(s), fill with a checkerboard pattern + if (((x / 10) % 2) == ((y / 10) % 2)) { + s = 255; + } else { + s = 0; + } + if (isAlphaPremultiplied) { + int alpha = (x*255)/(width - 1); + s = (s*alpha)/255; + } + } else { + // Alpha band, increase opacity left to right + s = (x*255)/(width - 1); + } + + wr.setSample(x, y, b, s); + } + } + } + + this.bi = new BufferedImage(cm, wr, isAlphaPremultiplied, null); + } + + public Dimension getPreferredSize() { + return new Dimension(bi.getWidth(), bi.getHeight()); + } + + public void paint(Graphics g) { + if (bi != null) { + ((Graphics2D)g).drawImage(bi, 0, 0, null); + } + } + + public static Frame makeFrame(String title, + int x, int y, int width, int height, + boolean hasAlpha, + boolean isAlphaPremultiplied, + boolean useRGB) { + Frame f = new Frame(title); + f.add(new GrayAlpha(width, height, + hasAlpha, isAlphaPremultiplied, useRGB)); + f.pack(); + f.setLocation(x, y); + return f; + } + + private static List createTestUI() { + int width = 200; + int height = 200; + + int x = 100; + int y = 100; + + Frame f1 = makeFrame("Gray (non-premultiplied)", + x, y, width, height, + true, false, false); + x += width + 20; + + Frame f2 = makeFrame("Gray (premultiplied)", + x, y, width, height, + true, true, false); + + return List.of(f1, f2); + } +} diff --git a/test/jdk/java/awt/image/ImageOffsetTest.java b/test/jdk/java/awt/image/ImageOffsetTest.java new file mode 100644 index 0000000000000..c1d4c3931de91 --- /dev/null +++ b/test/jdk/java/awt/image/ImageOffsetTest.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4259548 + * @summary tests that MemoryImageSource correctly handles images with offsets + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual ImageOffsetTest + */ + +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Panel; +import java.awt.Toolkit; +import java.awt.image.ColorModel; +import java.awt.image.IndexColorModel; +import java.awt.image.MemoryImageSource; + +public class ImageOffsetTest { + + static int height = 100; + static int width = 100; + static int levels = 3; + static IndexColorModel cm; + static Image image; + static boolean first = true; + + static byte[] db = new byte[height * width * levels] ; + + private static final String INSTRUCTIONS = """ + If on the appeared 'Test frame' all color squares are of one color + test failed, otherwise it's passed."""; + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("ImageOffsetTest") + .instructions(INSTRUCTIONS) + .rows((int) INSTRUCTIONS.lines().count() + 2) + .columns(35) + .testUI(ImageOffsetTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame frame = new Frame("ImageOffset Frame"); + frame.add(new Panel() { + public void paint(Graphics g) { + for ( int i=0 ; i<3 ; i++ ) { + g.drawImage( + generateBuggyImage(i * width * height), 10 + i * 110, 10, null); + } + } + }); + frame.setSize(400, 200); + frame.setLocation(300, 200); + createColorModel(); + int l = 0; + for (int k = 0; k < levels; k++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + if( k == 0) { + db[l] = (byte)(70 & 0xff) ; + } + if (k == 1) { + db[l] = (byte)(150 & 0xff) ; + } + if (k == 2) { + db[l] = (byte)(230 & 0xff) ; + } + l++ ; + } + } + } + return frame; + } + + private static void createColorModel() { + byte[] red = new byte[256]; + byte[] green = new byte[256]; + byte[] blue = new byte[256]; + + for (int i = 0; i < 256; i++) { + red[i] = (byte)(i & 0xff); + //green[i] = (byte)( i & 0xff ) ; + blue[i] = (byte)( i & 0xff ) ; + //commented out green so I could get purple + } + + cm = new IndexColorModel( 8, 256, red, green, blue ) ; + } + + private static Image generateBuggyImage(int offset) { + // Initialize the database, Three slices, different shades of grey + // Here the image is created using the offset, + return Toolkit.getDefaultToolkit().createImage( + new MemoryImageSource(width, height, (ColorModel)cm, + db, offset, width)); + } +} diff --git a/test/jdk/java/awt/image/TransformImage.java b/test/jdk/java/awt/image/TransformImage.java new file mode 100644 index 0000000000000..30af3d27f55c0 --- /dev/null +++ b/test/jdk/java/awt/image/TransformImage.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4090743 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Make sure that there is no garbage drawn on the rotated image + * @run main/manual TransformImage + */ + +import java.net.URL; +import java.net.MalformedURLException; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.Image; +import java.awt.image.ImageObserver; +import java.awt.MediaTracker; +import java.awt.Toolkit; + +public class TransformImage extends Canvas { + static Image image; + + private static final String INSTRUCTIONS = """ + The rotated image should be drawn without garbage."""; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("TransformImage Instructions") + .instructions(INSTRUCTIONS) + .rows(5) + .columns(35) + .testUI(TransformImage::createTestUI) + .build() + .awaitAndCheck(); + } + + private static Frame createTestUI() { + Frame f = new Frame(); + String dir = System.getProperty("test.src"); + String sep = System.getProperty("file.separator"); + if (dir == null) { + dir = "."; + } + image = Toolkit.getDefaultToolkit().getImage(dir+sep+"duke.gif"); + f.add(new TransformImage()); + + f.pack(); + return f; + } + + public Dimension getPreferredSize() { + return new Dimension (256, 256); + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public void paint(Graphics g) { + int w, h; + java.awt.Graphics2D g2d = (Graphics2D) g; + AffineTransform at = new AffineTransform(); + + MediaTracker mt = new MediaTracker(this); + mt.addImage(image, 0); + try { + mt.waitForAll(); + } catch (InterruptedException e) { + System.err.println("can't track"); + return; + } + w = image.getWidth(this); + h = image.getHeight(this); + g2d.drawImage(image, 0, 0, this); + g2d.drawRect(0, 0, w, h); + + double rad = .5; + at.rotate(-rad); + g2d.setTransform(at); + g2d.drawImage(image, 0, 100, this); + g2d.drawRect(0, 100, w, h); + } +} diff --git a/test/jdk/java/awt/image/duke.gif b/test/jdk/java/awt/image/duke.gif new file mode 100644 index 0000000000000..ed32e0ff79b05 Binary files /dev/null and b/test/jdk/java/awt/image/duke.gif differ diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index dd94081c35421..3a142c716b199 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -74,6 +74,7 @@ import javax.swing.text.html.StyleSheet; import static java.util.Collections.unmodifiableList; +import static javax.swing.BorderFactory.createEmptyBorder; import static javax.swing.SwingUtilities.invokeAndWait; import static javax.swing.SwingUtilities.isEventDispatchThread; @@ -158,7 +159,7 @@ *
        • the title of the instruction UI,
        • *
        • the timeout of the test,
        • *
        • the size of the instruction UI via rows and columns, and
        • - *
        • to add a log area
        • , + *
        • to add a log area,
        • *
        • to enable screenshots.
        • *
        */ @@ -348,11 +349,9 @@ private PassFailJFrame(final Builder builder) builder.positionWindows .positionTestWindows(unmodifiableList(builder.testWindows), builder.instructionUIHandler)); - } else if (builder.testWindows.size() == 1) { + } else { Window window = builder.testWindows.get(0); positionTestWindow(window, builder.position); - } else { - positionTestWindow(null, builder.position); } } showAllWindows(); @@ -501,6 +500,7 @@ private static JTextComponent configurePlainText(String instructions, JTextArea text = new JTextArea(instructions, rows, columns); text.setLineWrap(true); text.setWrapStyleWord(true); + text.setBorder(createEmptyBorder(4, 4, 4, 4)); return text; } @@ -1111,9 +1111,10 @@ public static void forceFail(String reason) { /** * Adds a {@code message} to the log area, if enabled by - * {@link Builder#logArea()} or {@link Builder#logArea(int)}. + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. * - * @param message to log + * @param message the message to log */ public static void log(String message) { System.out.println("PassFailJFrame: " + message); @@ -1122,7 +1123,8 @@ public static void log(String message) { /** * Clears the log area, if enabled by - * {@link Builder#logArea()} or {@link Builder#logArea(int)}. + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. */ public static void logClear() { System.out.println("\nPassFailJFrame: log cleared\n"); @@ -1131,7 +1133,9 @@ public static void logClear() { /** * Replaces the log area content with provided {@code text}, if enabled by - * {@link Builder#logArea()} or {@link Builder#logArea(int)}. + * {@link Builder#logArea() logArea()} or + * {@link Builder#logArea(int) logArea(int)}. + * * @param text new text for the log area */ public static void logSet(String text) { @@ -1182,11 +1186,45 @@ public Builder testTimeOut(long testTimeOut) { return this; } + /** + * Sets the number of rows for displaying the instruction text. + * The default value is the number of lines in the text plus 1: + * {@code ((int) instructions.lines().count() + 1)}. + * + * @param rows the number of rows for instruction text + * @return this builder + */ public Builder rows(int rows) { this.rows = rows; return this; } + private int getDefaultRows() { + return (int) instructions.lines().count() + 1; + } + + /** + * Adds a certain number of rows for displaying the instruction text. + * + * @param rowsAdd the number of rows to add to the number of rows + * @return this builder + * @see #rows + */ + public Builder rowsAdd(int rowsAdd) { + if (rows == 0) { + rows = getDefaultRows(); + } + rows += rowsAdd; + + return this; + } + + /** + * Sets the number of columns for displaying the instruction text. + * + * @param columns the number of columns for instruction text + * @return this builder + */ public Builder columns(int columns) { this.columns = columns; return this; @@ -1250,6 +1288,29 @@ public Builder testUI(WindowCreator windowCreator) { return this; } + /** + * Adds an implementation of {@link PositionWindows PositionWindows} + * which the framework will use to position multiple test UI windows. + * + * @param positionWindows an implementation of {@code PositionWindows} + * to position multiple test UI windows + * @return this builder + * @throws IllegalArgumentException if the {@code positionWindows} + * parameter is {@code null} + * @throws IllegalStateException if the {@code positionWindows} field + * is already set + */ + public Builder positionTestUI(PositionWindows positionWindows) { + if (positionWindows == null) { + throw new IllegalArgumentException("positionWindows parameter can't be null"); + } + if (this.positionWindows != null) { + throw new IllegalStateException("PositionWindows is already set"); + } + this.positionWindows = positionWindows; + return this; + } + /** * Adds a {@code WindowListCreator} which the framework will use * to create a list of test UI windows. @@ -1458,7 +1519,7 @@ private void validate() { } if (rows == 0) { - rows = ROWS; + rows = getDefaultRows(); } if (columns == 0) { diff --git a/test/jdk/java/beans/Introspector/8159696/UnloadClassBeanInfo.java b/test/jdk/java/beans/Introspector/8159696/UnloadClassBeanInfo.java index 8c77b3565a8fc..0d9775d50d675 100644 --- a/test/jdk/java/beans/Introspector/8159696/UnloadClassBeanInfo.java +++ b/test/jdk/java/beans/Introspector/8159696/UnloadClassBeanInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, 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 @@ -38,7 +38,7 @@ * @bug 8159696 * @library /javax/swing/regtesthelpers * @compile ./stub/Stub.java - * @run main/othervm -mx32M UnloadClassBeanInfo + * @run main/othervm -Xmx32M UnloadClassBeanInfo */ public class UnloadClassBeanInfo { diff --git a/test/jdk/java/beans/Introspector/Test5102804.java b/test/jdk/java/beans/Introspector/Test5102804.java index d5b38ea10d017..0563b1d306d77 100644 --- a/test/jdk/java/beans/Introspector/Test5102804.java +++ b/test/jdk/java/beans/Introspector/Test5102804.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024, 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 @@ -25,8 +25,7 @@ * @test * @bug 5102804 * @summary Tests memory leak - * @author Sergey Malenkov - * @run main/othervm -ms16m -mx16m Test5102804 + * @run main/othervm -Xms16m -Xmx16m Test5102804 */ import java.beans.BeanInfo; diff --git a/test/jdk/java/beans/Introspector/Test8027905.java b/test/jdk/java/beans/Introspector/Test8027905.java index 60318f345553b..8ebf1c59574f9 100644 --- a/test/jdk/java/beans/Introspector/Test8027905.java +++ b/test/jdk/java/beans/Introspector/Test8027905.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -27,8 +27,7 @@ * @test * @bug 8027905 * @summary Tests that GC does not affect a property type - * @author Sergey Malenkov - * @run main/othervm -mx16m Test8027905 + * @run main/othervm -Xmx16m Test8027905 */ public class Test8027905 { diff --git a/test/jdk/java/beans/XMLEncoder/Test4646747.java b/test/jdk/java/beans/XMLEncoder/Test4646747.java index 61f7c41c88269..467a015322815 100644 --- a/test/jdk/java/beans/XMLEncoder/Test4646747.java +++ b/test/jdk/java/beans/XMLEncoder/Test4646747.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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 @@ -25,8 +25,7 @@ * @test * @bug 4646747 * @summary Tests that persistence delegate is correct after memory stress - * @author Mark Davidson - * @run main/othervm -ms16m -mx16m Test4646747 + * @run main/othervm -Xms16m -Xmx16m Test4646747 */ import java.beans.DefaultPersistenceDelegate; diff --git a/test/jdk/java/foreign/TestMismatch.java b/test/jdk/java/foreign/TestMismatch.java index 9549b2508ff64..f50621e34154c 100644 --- a/test/jdk/java/foreign/TestMismatch.java +++ b/test/jdk/java/foreign/TestMismatch.java @@ -29,7 +29,9 @@ import java.lang.foreign.Arena; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Random; import java.util.concurrent.atomic.AtomicReference; import java.lang.foreign.MemorySegment; @@ -122,6 +124,68 @@ public void testSameValuesStatic(SliceOffsetAndSize ss1, SliceOffsetAndSize ss2) } } + @Test + public void random() { + try (var arena = Arena.ofConfined()) { + var rnd = new Random(42); + for (int size = 1; size < 64; size++) { + // Repeat a fair number of rounds + for (int i = 0; i < 147; i++) { + var src = arena.allocate(size); + // The dst segment might be zero to eight bytes longer + var dst = arena.allocate(size + rnd.nextInt(8 + 1)); + // Fill the src with random data + for (int j = 0; j < size; j++) { + src.set(ValueLayout.JAVA_BYTE, j, randomByte(rnd)); + } + // copy the random data from src to dst + dst.copyFrom(src); + // Fill the rest (if any) of the dst with random data + for (long j = src.byteSize(); j < dst.byteSize(); j++) { + dst.set(ValueLayout.JAVA_BYTE, j, randomByte(rnd)); + } + + if (rnd.nextBoolean()) { + // In this branch, we inject one or more deviating bytes + int beginDiff = rnd.nextInt(size); + int endDiff = rnd.nextInt(beginDiff, size); + for (int d = beginDiff; d <= endDiff; d++) { + byte existing = dst.get(ValueLayout.JAVA_BYTE, d); + // Make sure we never get back the same value + byte mutatedValue; + do { + mutatedValue = randomByte(rnd); + } while (existing == mutatedValue); + dst.set(ValueLayout.JAVA_BYTE, d, mutatedValue); + } + + // They are not equal and differs in position beginDiff + assertEquals(src.mismatch(dst), beginDiff); + assertEquals(dst.mismatch(src), beginDiff); + } else { + // In this branch, there is no injection + + if (src.byteSize() == dst.byteSize()) { + // The content matches and they are of equal size + assertEquals(src.mismatch(dst), -1); + assertEquals(dst.mismatch(src), -1); + } else { + // The content matches but they are of different length + // Remember, the size of src is always smaller or equal + // to the size of dst. + assertEquals(src.mismatch(dst), src.byteSize()); + assertEquals(dst.mismatch(src), src.byteSize()); + } + } + } + } + } + } + + static byte randomByte(Random rnd) { + return (byte) rnd.nextInt(Byte.MIN_VALUE, Byte.MAX_VALUE + 1); + } + @Test(dataProvider = "slices") public void testDifferentValues(MemorySegment s1, MemorySegment s2) { out.format("testDifferentValues s1:%s, s2:%s\n", s1, s2); diff --git a/test/jdk/java/lang/Math/HyperbolicTests.java b/test/jdk/java/lang/Math/HyperbolicTests.java index cf583ed7b5f27..4534396ee06dd 100644 --- a/test/jdk/java/lang/Math/HyperbolicTests.java +++ b/test/jdk/java/lang/Math/HyperbolicTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -969,6 +969,400 @@ static int testTanh() { failures += testTanhCaseWithUlpDiff(d, 1.0, 2.5); } + failures += testTanhAdditionalTests(); + + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.tanh using quad precision + * tanh implementation as the reference. There are additional tests. + * The specified accuracy is 2.5 ulps. + * + */ + static int testTanhAdditionalTests() { + int failures = 0; + /* + * Array elements below are generated using a quad precision tanh + * implementation (libquadmath). Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double[][] testCases = { + // x tanh(x) + {1.09951162777600024414062500000000000e+12, 1.00000000000000000000000000000000000e+00}, + {1.56250000000000416333634234433702659e-02, 1.56237285584089068255495133849899136e-02}, + {1.61254882812500000000000000000000000e+01, 9.99999999999980293529906376885389048e-01}, + {2.53165043529127054000582575099542737e-01, 2.47891535884497437358843835970604812e-01}, + {2.05669906337718799704816774465143681e+00, 9.67821952180774991463712302156014956e-01}, + {8.73243486124784240587359818164259195e+00, 9.99999947984421044859570034536492937e-01}, + {1.35302734375000000000000000000000000e+00, 8.74765946489987955543753077657414741e-01}, + {7.51299319580434721288497712521348149e-01, 6.35923468395323117288273690770900477e-01}, + {9.53088818012631927567568368431238923e-02, 9.50213381512267711017656118902912332e-02}, + {7.64443165964961757197215774795040488e-01, 6.43686625696507143760198874608796949e-01}, + {9.80772770147126660145175947036477737e-02, 9.77640088885469645387119927980991050e-02}, + {8.00000000000000044408920985006261617e-01, 6.64036770267848988511881426480887109e-01}, + {6.58800443825626694943631278533757722e-03, 6.58790912948844334160953310959647563e-03}, + {3.50634723606509357551885841530747712e+00, 9.98200861366828007281302037717336212e-01}, + {8.80951107580675074615328412619419396e-01, 7.06895478355484050029724917425086249e-01}, + {9.41693953354077795125931515940465033e-01, 7.35999567964351009171211613664845735e-01}, + {4.86714106743433794211028953213826753e-01, 4.51604571680788935707314000261162601e-01}, + {4.99999999970896114032115065128891729e-01, 4.62117157237121073362068671381593592e-01}, + {1.27999999999999971578290569595992565e+02, 1.00000000000000000000000000000000000e+00}, + {1.00000000000000022204460492503130808e+00, 7.61594155955764981372495044941331753e-01}, + {1.09951162777600024414062500000000000e+12, 1.00000000000000000000000000000000000e+00}, + {5.00000000000000777156117237609578297e-01, 4.62117157260010369694985045764006657e-01}, + {3.90625000000001474514954580286030250e-03, 3.90623013190635482599726614938805467e-03}, + {1.56250000000000659194920871186695877e-02, 1.56237285584089311057499113400637264e-02}, + {1.25000000000001332267629550187848508e-01, 1.24353001771597519720531117125519878e-01}, + {1.56250000000005169475958410885141348e-02, 1.56237285584093820237573019342883109e-02}, + {2.00000000000022737367544323205947876e+00, 9.64027580075832948084133680630298643e-01}, + {6.25000000000080352391407245704613160e-02, 6.24187467475205184231888372622987839e-02}, + {2.50000000000049737991503207013010979e-01, 2.44918662403755883728363950973251081e-01}, + {2.50000000000454747350886464118957520e-01, 2.44918662404136598540089724354621762e-01}, + {7.81250000001537658889105841808486730e-03, 7.81234105817638947180855590780540396e-03}, + {8.00000000002179945113311987370252609e+00, 9.99999774929675899622836792366347278e-01}, + {8.00000000002182787284255027770996094e+00, 9.99999774929675899635630557632573807e-01}, + {1.00000000004506106598967107856879011e+00, 7.61594155974689379640247120538425632e-01}, + {5.00000000024432678102925819985102862e-01, 4.62117157279224782806433798595181278e-01}, + {5.00000000124148025193449029757175595e-01, 4.62117157357645691462301850285961295e-01}, + {1.25000000043655745685100555419921875e-01, 1.24353001814576875736126314329404676e-01}, + {1.56250130385160446166992187500000000e-02, 1.56237415937421937398207048034470765e-02}, + {6.25000596046447753906250000000000000e-02, 6.24188061199314157260056878713262148e-02}, + {6.25001570879248902201652526855468750e-02, 6.24189032234056148184566765458350515e-02}, + {3.12509536743164062500000000000000000e-02, 3.12407841896026978197614959195842857e-02}, + {1.00024414062500000000000000000000000e+00, 7.61696669690972358277739369649969500e-01}, + {1.25091552734375000000000000000000000e-01, 1.24443137738349286849917747910445080e-01}, + {6.25703578334750876166481248219497502e-02, 6.24888301519391612116796252071905868e-02}, + {2.52525252525252597024518763646483421e-01, 2.47290965006585965880182136581880733e-01}, + {1.00000000164410457817454336293394590e-03, 9.99999668310902934017090322313224382e-04}, + {1.00000000966720672609944209341392707e-03, 9.99999676333997058845099107943491685e-04}, + {5.13687551499984795810860305209644139e-01, 4.72813376851263299460550751434331149e-01}, + {1.03125000000000000000000000000000000e+00, 7.74409187434213568286703209738132986e-01}, + {1.03372912114974835340319714305223897e+00, 7.75399652279487427958938283855319050e-01}, + {8.73243486124791523650401359191164374e+00, 9.99999947984421044867146689152891277e-01}, + {5.46364074509520181166521979321260005e-01, 4.97790203319363272413440879555555135e-01}, + {5.48776992118357842542764046811498702e-01, 4.99603030846724465253358333732665160e-01}, + {8.62884521484375000000000000000000000e-03, 8.62863106199946057455229821459862778e-03}, + {5.56840723899044820477399753144709393e-01, 5.05629619734278492036257594911833276e-01}, + {1.12042968912429174999090264464030042e+00, 8.07718324543002512898290101804260243e-01}, + {2.80761718750000000000000000000000000e-01, 2.73609921989813966516244201735889906e-01}, + {4.50982142857161694138312668655999005e+00, 9.99758010610690750512553927515350523e-01}, + {1.79803946803892764072507759465224808e-02, 1.79784572761372499903768063141254578e-02}, + {2.90674624105783541150316295897937380e-01, 2.82755618405959946459876962574827861e-01}, + {3.00000000019552404140199541870970279e-01, 2.91312612469484033539387970973996561e-01}, + {1.52306844600212459850396840010944288e-01, 1.51139964502163284820786391222343666e-01}, + {1.21913138136517762433186362613923848e+00, 8.39397762830401796350294214789399315e-01}, + {1.91612901016097944562055488404439529e-02, 1.91589453912240029886209020645693670e-02}, + {1.23194037796136601770058405236341059e+00, 8.43141232466373734055029303451281784e-01}, + {5.14544145441922751160745974630117416e+00, 9.99932120037417992977353814124626761e-01}, + {1.29608715898613313655118872702587396e+00, 8.60712461444305632100271902930674052e-01}, + {1.35302734375000000000000000000000000e+00, 8.74765946489987955543753077657414741e-01}, + {6.89141205308152926534148718928918242e-01, 5.97430012402391408227990740295335202e-01}, + {2.16702398900134561576802383342510439e-02, 2.16668484172600518601166701940771309e-02}, + {6.95330121814107471323040954302996397e-01, 6.01395252733578654705526153849150843e-01}, + {1.70127028180982076566857275068400668e-04, 1.70127026539641570641832179464678521e-04}, + {6.98731899876564921392230189667316154e-01, 6.03562246839061712657431798989209285e-01}, + {2.82308042901865396956395670713391155e+00, 9.92962754889608618611084237181745775e-01}, + {8.85009765625000000000000000000000000e-02, 8.82706391518277914218106043840064600e-02}, + {1.44086021505376304929768593865446746e+00, 8.93870759190524111186764508137227647e-01}, + {4.52708479240923750142044923450157512e-02, 4.52399464814195843886615749285771251e-02}, + {7.42434201630502221824770003877347335e-01, 6.30613596749571014884527941122811076e-01}, + {7.47314453125000000000000000000000000e-01, 6.33544059591028741704251380359792317e-01}, + {2.33572976827208893257914468222224968e-02, 2.33530509808936286709795071423335732e-02}, + {7.51392746195329142011587464367039502e-01, 6.35979110106607807348963004903609067e-01}, + {7.51649175412362091641682582121575251e-01, 6.36131796640758591543062918907122080e-01}, + {7.62560692649938864917658065678551793e-01, 6.42582785959772486552828548950126373e-01}, + {7.64660852335945273594575155584607273e-01, 6.43814099671361386286313072270915932e-01}, + {1.92871093750000000000000000000000000e-01, 1.90514597602311764623059750704793759e-01}, + {2.43864313521849479515779535176989157e-02, 2.43815983142663741885939851467013521e-02}, + {3.97705078125000000000000000000000000e-01, 3.77983627858614640283948547303348236e-01}, + {7.98034667968750000000000000000000000e-01, 6.62936606884708330125541187161682941e-01}, + {7.99316406250000000000000000000000000e-01, 6.63654430152659513562528989372441102e-01}, + {1.99890136718750000000000000000000000e-01, 1.97269734600247465099938891830640889e-01}, + {2.00000000008910994164779140191967599e-01, 1.97375320233467849151455260287892058e-01}, + {4.00000000093461316463816501709516160e-01, 3.79948962335194012629557116519596150e-01}, + {2.00000000069810862646235705142316874e-01, 1.97375320291995240418209079080646997e-01}, + {1.00000000056612609045103567950718571e-01, 9.96679946810060529704707312198636589e-02}, + {1.00000000080404896629637789828848327e-01, 9.96679947045619948897444345018478492e-02}, + {1.66666666666666696272613990004174411e+00, 9.31109608667577693190680177920119455e-01}, + {1.31034851074218750000000000000000000e-02, 1.31027351970209980614612589861988504e-02}, + {8.43444227005861080215254332870244980e-01, 6.87629045782656322925865941652078512e-01}, + {4.25596815032856623517432126391213387e-01, 4.01634947321531793299729470086813678e-01}, + {8.54614885269050605920426733064232394e-01, 6.93472710492835200064966331725774025e-01}, + {8.63777419830865200722769259300548583e-01, 6.98198780318331041148483592329099127e-01}, + {2.70117449276632004551146337689715438e-02, 2.70051772786722224566765342032635559e-02}, + {2.16282487792377908775165451515931636e-01, 2.12971988592557031781365419455581001e-01}, + {1.73204653003120601084674490266479552e+00, 9.39297315789076214802641716736658105e-01}, + {2.71436010781672190650404274947504746e-02, 2.71369367992428389623549774823710978e-02}, + {8.69092640155437079485523099720012397e-01, 7.00912831250687651307196017605464473e-01}, + {2.78015136718750000000000000000000000e-02, 2.77943530651526982827985645341156701e-02}, + {9.10156250000000000000000000000000000e-01, 7.21207240669352050307412688531998165e-01}, + {2.27787862235060922788676407435559668e-01, 2.23928183342045426304404589794035157e-01}, + {5.71524498377538048288215577485971153e-02, 5.70903033991663026980553749418981725e-02}, + {3.66406250000000000000000000000000000e+00, 9.98687254335130669671645868977829517e-01}, + {5.72863132979952241474741470028675394e-02, 5.72237295373843844708720164610859507e-02}, + {1.15265335196343660095763539175095502e-01, 1.14757558082362397172277983632352767e-01}, + {9.22871508732805212460448274214286357e-01, 7.27253018562057912939305739474564638e-01}, + {1.44882202148437500000000000000000000e-02, 1.44872065663080247568859985337817684e-02}, + {2.33459472656250000000000000000000000e-01, 2.29308506606965514793638071915067313e-01}, + {4.67608948699241744328958247933769599e-01, 4.36265367328226513916944408221096440e-01}, + {2.34375000000000000000000000000000000e-01, 2.30175711032132981819570603563403063e-01}, + {2.93977526337722387672624080323657836e-02, 2.93892867747176836833509722656208701e-02}, + {1.89257812500000000000000000000000000e+00, 9.55597542193888546329823463414294394e-01}, + {2.95798696005085230698039566732404637e-02, 2.95712454656271068251835101101858187e-02}, + {1.89360756176453159937977943627629429e+00, 9.55686843743833788059988471898348142e-01}, + {4.74943000289441419337066463413066231e-01, 4.42184502480986035803118250513914071e-01}, + {4.76562500000000000000000000000000000e-01, 4.43486412595195826790440814160101630e-01}, + {9.59027831303091549131067949929274619e-01, 7.43842915769532264613887042424467929e-01}, + {3.09784640940728682456661857713697827e-02, 3.09685582448730820784897541732374591e-02}, + {1.98437499999999977795539507496869192e+00, 9.62906870975765387287608356129776957e-01}, + {9.97205648659918675313917901803506538e-01, 7.60418100316000600203658397859135661e-01}, + {3.90291213989257769131913100579822640e-03, 3.90289232268659551022766662201699736e-03}, + {3.90481948852539019131913100579822640e-03, 3.90479964225138860483705936617354227e-03}, + {3.12423706054687500000000000000000000e-02, 3.12322094954161727499363714231262395e-02}, + {3.90535406768321947598709975579822640e-03, 3.90533421325712750455622728849037270e-03}, + {7.81154632568359288263826201159645279e-03, 7.81138744204279466358299901763388375e-03}, + {1.24999789521095569511111023075500270e-01, 1.24352794547462473786771370350680283e-01}, + {9.99999444341875043384959553804947063e-01, 7.61593922593510941370556728778707492e-01}, + {9.99999895691871532044103787484345958e-01, 7.61594112149023829770882693858011645e-01}, + {2.49999998130078865399283927217766177e-01, 2.44918660645955495851244772320875652e-01}, + {2.49999998603016110321206610933586489e-01, 2.44918661090523528987141309434443089e-01}, + {4.99999999970896114032115065128891729e-01, 4.62117157237121073362068671381593592e-01}, + {9.99999999999829358721115113439736888e-01, 7.61594155955693223160706417649502130e-01}, + {3.12499999999979183318288278314867057e-02, 3.12398314460291771315638233977623908e-02}, + {6.24999999999973701592104191604448715e-02, 6.24187467475098948954758673929811576e-02}, + {9.99999999999998556710067987296497449e-01, 7.61594155955764281974719327416526334e-01}, + {1.27999999999999971578290569595992565e+02, 1.00000000000000000000000000000000000e+00}, + {3.44827586206896546938693859374325257e-02, 3.44690977543900329082306735053903756e-02}, + {6.89655172413793093877387718748650514e-02, 6.88563859490195017187269420471893052e-02}, + {1.03448275862068964081608157812297577e-01, 1.03080829858086020470241143281488892e-01}, + {1.37931034482758618775477543749730103e-01, 1.37062928881132531260309423128680656e-01}, + {1.72413793103448287347134737501619384e-01, 1.70725445282084714146447066718646674e-01}, + {2.06896551724137955918791931253508665e-01, 2.03994088403983264406130799853712156e-01}, + {2.41379310344827624490449125005397946e-01, 2.36798141876826809207868665407968027e-01}, + {2.75862068965517293062106318757287227e-01, 2.69071023201531202536913498454407638e-01}, + {3.10344827586206961633763512509176508e-01, 3.00750767242988858303859696730149916e-01}, + {3.44827586206896630205420706261065789e-01, 3.31780427497542984412066808006924260e-01}, + {3.79310344827586298777077900012955070e-01, 3.62108391409330839416919529705937418e-01}, + {4.13793103448275967348735093764844351e-01, 3.91688608393346163715111892758489641e-01}, + {4.48275862068965635920392287516733631e-01, 4.20480731486975012003415012347372452e-01}, + {4.82758620689655304492049481268622912e-01, 4.48450175615929701255698232730127770e-01}, + {5.17241379310344973063706675020512193e-01, 4.75568097261544496368767486763625886e-01}, + {5.51724137931034586124212637514574453e-01, 5.01811301809605377924874787743959204e-01}, + {5.86206896551724199184718600008636713e-01, 5.27162086020673527345538794213535134e-01}, + {6.20689655172413812245224562502698973e-01, 5.51608023880856575817362987825134405e-01}, + {6.55172413793103425305730524996761233e-01, 5.75141704579102279221464447290041163e-01}, + {6.89655172413793038366236487490823492e-01, 5.97760431534850182076591161239096491e-01}, + {7.24137931034482651426742449984885752e-01, 6.19465891301270655454827665546029664e-01}, + {7.58620689655172264487248412478948012e-01, 6.40263800834536321750527885396253899e-01}, + {7.93103448275861877547754374973010272e-01, 6.60163541092833363676687202005166905e-01}, + {8.27586206896551490608260337467072532e-01, 6.79177784255529339466238655218797135e-01}, + {8.62068965517241103668766299961134791e-01, 6.97322121077226884958095667604561029e-01}, + {8.96551724137930716729272262455197051e-01, 7.14614694054361357412620518070189428e-01}, + {9.31034482758620329789778224949259311e-01, 7.31075841220047215751737025073520835e-01}, + {9.65517241379309942850284187443321571e-01, 7.46727754527182387965057729340710925e-01}, + {9.99999999999999555910790149937383831e-01, 7.61594155955764701613384757931622516e-01}, + {1.26765060022822940149670320537600000e+30, 1.00000000000000000000000000000000000e+00}, + {1.33436905287182034855574634496000000e+30, 1.00000000000000000000000000000000000e+00}, + {1.40108750551541129561478948454400000e+30, 1.00000000000000000000000000000000000e+00}, + {1.46780595815900224267383262412800000e+30, 1.00000000000000000000000000000000000e+00}, + {1.53452441080259318973287576371200000e+30, 1.00000000000000000000000000000000000e+00}, + {1.60124286344618413679191890329600000e+30, 1.00000000000000000000000000000000000e+00}, + {1.66796131608977508385096204288000000e+30, 1.00000000000000000000000000000000000e+00}, + {1.73467976873336603091000518246400000e+30, 1.00000000000000000000000000000000000e+00}, + {1.80139822137695697796904832204800000e+30, 1.00000000000000000000000000000000000e+00}, + {1.86811667402054792502809146163200000e+30, 1.00000000000000000000000000000000000e+00}, + {1.93483512666413887208713460121600000e+30, 1.00000000000000000000000000000000000e+00}, + {2.00155357930772981914617774080000000e+30, 1.00000000000000000000000000000000000e+00}, + {2.06827203195132076620522088038400000e+30, 1.00000000000000000000000000000000000e+00}, + {2.13499048459491171326426401996800000e+30, 1.00000000000000000000000000000000000e+00}, + {2.20170893723850266032330715955200000e+30, 1.00000000000000000000000000000000000e+00}, + {2.26842738988209360738235029913600000e+30, 1.00000000000000000000000000000000000e+00}, + {2.33514584252568455444139343872000000e+30, 1.00000000000000000000000000000000000e+00}, + {2.40186429516927550150043657830400000e+30, 1.00000000000000000000000000000000000e+00}, + {2.46858274781286644855947971788800000e+30, 1.00000000000000000000000000000000000e+00}, + {2.53530120045645739561852285747200000e+30, 1.00000000000000000000000000000000000e+00}, + {1.60693804425899027554196209234116260e+60, 1.00000000000000000000000000000000000e+00}, + {1.69151373079893703825155926128281056e+60, 1.00000000000000000000000000000000000e+00}, + {1.77608941733888380096115643022445853e+60, 1.00000000000000000000000000000000000e+00}, + {1.86066510387883056367075359916610649e+60, 1.00000000000000000000000000000000000e+00}, + {1.94524079041877732638035076810775445e+60, 1.00000000000000000000000000000000000e+00}, + {2.02981647695872408908994793704940241e+60, 1.00000000000000000000000000000000000e+00}, + {2.11439216349867085179954510599105038e+60, 1.00000000000000000000000000000000000e+00}, + {2.19896785003861761450914227493269834e+60, 1.00000000000000000000000000000000000e+00}, + {2.28354353657856437721873944387434630e+60, 1.00000000000000000000000000000000000e+00}, + {2.36811922311851113992833661281599426e+60, 1.00000000000000000000000000000000000e+00}, + {2.45269490965845790263793378175764222e+60, 1.00000000000000000000000000000000000e+00}, + {2.53727059619840466534753095069929019e+60, 1.00000000000000000000000000000000000e+00}, + {2.62184628273835142805712811964093815e+60, 1.00000000000000000000000000000000000e+00}, + {2.70642196927829819076672528858258611e+60, 1.00000000000000000000000000000000000e+00}, + {2.79099765581824495347632245752423407e+60, 1.00000000000000000000000000000000000e+00}, + {2.87557334235819171618591962646588203e+60, 1.00000000000000000000000000000000000e+00}, + {2.96014902889813847889551679540753000e+60, 1.00000000000000000000000000000000000e+00}, + {3.04472471543808524160511396434917796e+60, 1.00000000000000000000000000000000000e+00}, + {3.12930040197803200431471113329082592e+60, 1.00000000000000000000000000000000000e+00}, + {3.21387608851797876702430830223247388e+60, 1.00000000000000000000000000000000000e+00}, + {1.07150860718626732094842504906000181e+301, 1.00000000000000000000000000000000000e+00}, + {1.12790379703817606470289337889334663e+301, 1.00000000000000000000000000000000000e+00}, + {1.18429898689008480845736170872669145e+301, 1.00000000000000000000000000000000000e+00}, + {1.24069417674199355221183003856003627e+301, 1.00000000000000000000000000000000000e+00}, + {1.29708936659390229596629836839338109e+301, 1.00000000000000000000000000000000000e+00}, + {1.35348455644581103972076669822672591e+301, 1.00000000000000000000000000000000000e+00}, + {1.40987974629771978347523502806007073e+301, 1.00000000000000000000000000000000000e+00}, + {1.46627493614962852722970335789341555e+301, 1.00000000000000000000000000000000000e+00}, + {1.52267012600153727098417168772676037e+301, 1.00000000000000000000000000000000000e+00}, + {1.57906531585344601473864001756010519e+301, 1.00000000000000000000000000000000000e+00}, + {1.63546050570535475849310834739345001e+301, 1.00000000000000000000000000000000000e+00}, + {1.69185569555726350224757667722679483e+301, 1.00000000000000000000000000000000000e+00}, + {1.74825088540917224600204500706013965e+301, 1.00000000000000000000000000000000000e+00}, + {1.80464607526108098975651333689348447e+301, 1.00000000000000000000000000000000000e+00}, + {1.86104126511298973351098166672682928e+301, 1.00000000000000000000000000000000000e+00}, + {1.91743645496489847726544999656017410e+301, 1.00000000000000000000000000000000000e+00}, + {1.97383164481680722101991832639351892e+301, 1.00000000000000000000000000000000000e+00}, + {2.03022683466871596477438665622686374e+301, 1.00000000000000000000000000000000000e+00}, + {2.08662202452062470852885498606020856e+301, 1.00000000000000000000000000000000000e+00}, + {2.14301721437253345228332331589355338e+301, 1.00000000000000000000000000000000000e+00}, + {4.94065645841246544176568792868221372e-324, 4.94065645841246544176568792868221372e-324}, + {4.94065645841246544176568792868221372e-324, 4.94065645841246544176568792868221372e-324}, + {4.99999999999999944488848768742172979e-01, 4.62117157260009714845699443492203290e-01}, + {5.00000000000000000000000000000000000e-01, 4.62117157260009758502318483643672557e-01}, + {5.00000000000000111022302462515654042e-01, 4.62117157260009845815556563946604302e-01}, + {5.49306144334054669009503868437604979e-01, 4.99999999999999867483910937482244858e-01}, + {5.49306144334054780031806330953259021e-01, 4.99999999999999950750637784368995452e-01}, + {5.49306144334054891054108793468913063e-01, 5.00000000000000034017364631255736851e-01}, + {2.19999999999999964472863211994990706e+01, 9.99999999999999999844377355177323009e-01}, + {2.20000000000000000000000000000000000e+01, 9.99999999999999999844377355177324068e-01}, + {2.20000000000000035527136788005009294e+01, 9.99999999999999999844377355177325223e-01}, + {6.93147180559945397249066445510834455e-01, 6.00000000000000056212373967393698031e-01}, + {6.93147180559945286226763982995180413e-01, 5.99999999999999985158100391383682202e-01}, + {6.93147180559945175204461520479526371e-01, 5.99999999999999914103826815373657032e-01}, + {3.46573590279972698624533222755417228e-01, 3.33333333333333372369704144023402903e-01}, + {3.46573590279972643113381991497590207e-01, 3.33333333333333323026458605127557235e-01}, + {3.46573590279972587602230760239763185e-01, 3.33333333333333273683213066231709688e-01}, + {1.73286795139986349312266611377708614e-01, 1.71572875253809923708199182915954510e-01}, + {1.73286795139986321556690995748795103e-01, 1.71572875253809896769671427846052946e-01}, + {1.73286795139986293801115380119881593e-01, 1.71572875253809869831143672776151118e-01}, + {8.66433975699931746561333056888543069e-02, 8.64272337258898029408455765418952337e-02}, + {8.66433975699931607783454978743975516e-02, 8.64272337258897891667202185946638536e-02}, + {8.66433975699931469005576900599407963e-02, 8.64272337258897753925948606474324374e-02}, + {4.33216987849965873280666528444271535e-02, 4.32946174993891841617996586480128793e-02}, + {4.33216987849965803891727489371987758e-02, 4.32946174993891772359121833444914284e-02}, + {4.33216987849965734502788450299703982e-02, 4.32946174993891703100247080409699774e-02}, + {2.16608493924982936640333264222135767e-02, 2.16574623262262954492383391751347008e-02}, + {2.16608493924982901945863744685993879e-02, 2.16574623262262919814187163069359478e-02}, + {2.16608493924982867251394225149851991e-02, 2.16574623262262885135990934387371889e-02}, + {2.16608493924982867251394225149851991e-02, 2.16574623262262885135990934387371889e-02}, + {2.16608493924982901945863744685993879e-02, 2.16574623262262919814187163069359478e-02}, + {2.16608493924982936640333264222135767e-02, 2.16574623262262954492383391751347008e-02}, + {4.33216987849965734502788450299703982e-02, 4.32946174993891703100247080409699774e-02}, + {4.33216987849965803891727489371987758e-02, 4.32946174993891772359121833444914284e-02}, + {4.33216987849965873280666528444271535e-02, 4.32946174993891841617996586480128793e-02}, + {8.66433975699931469005576900599407963e-02, 8.64272337258897753925948606474324374e-02}, + {8.66433975699931607783454978743975516e-02, 8.64272337258897891667202185946638536e-02}, + {8.66433975699931746561333056888543069e-02, 8.64272337258898029408455765418952337e-02}, + {1.73286795139986293801115380119881593e-01, 1.71572875253809869831143672776151118e-01}, + {1.73286795139986321556690995748795103e-01, 1.71572875253809896769671427846052946e-01}, + {1.73286795139986349312266611377708614e-01, 1.71572875253809923708199182915954510e-01}, + {3.46573590279972587602230760239763185e-01, 3.33333333333333273683213066231709688e-01}, + {3.46573590279972643113381991497590207e-01, 3.33333333333333323026458605127557235e-01}, + {3.46573590279972698624533222755417228e-01, 3.33333333333333372369704144023402903e-01}, + {6.93147180559945175204461520479526371e-01, 5.99999999999999914103826815373657032e-01}, + {6.93147180559945286226763982995180413e-01, 5.99999999999999985158100391383682202e-01}, + {6.93147180559945397249066445510834455e-01, 6.00000000000000056212373967393698031e-01}, + {7.09782712893383859409368596971035004e+02, 1.00000000000000000000000000000000000e+00}, + {7.09782712893383973096206318587064743e+02, 1.00000000000000000000000000000000000e+00}, + {7.09782712893384086783044040203094482e+02, 1.00000000000000000000000000000000000e+00}, + {7.41782712893384086783044040203094482e+02, 1.00000000000000000000000000000000000e+00}, + {7.41782712893383973096206318587064743e+02, 1.00000000000000000000000000000000000e+00}, + {7.41782712893383859409368596971035004e+02, 1.00000000000000000000000000000000000e+00}, + {7.10475860073943749739555642008781433e+02, 1.00000000000000000000000000000000000e+00}, + {7.10475860073943863426393363624811172e+02, 1.00000000000000000000000000000000000e+00}, + {7.10475860073943977113231085240840912e+02, 1.00000000000000000000000000000000000e+00}, + {7.09782712893384086783044040203094482e+02, 1.00000000000000000000000000000000000e+00}, + {7.09782712893383973096206318587064743e+02, 1.00000000000000000000000000000000000e+00}, + {7.09782712893383859409368596971035004e+02, 1.00000000000000000000000000000000000e+00}, + {9.22337203685477478400000000000000000e+18, 1.00000000000000000000000000000000000e+00}, + {9.22337203685477580800000000000000000e+18, 1.00000000000000000000000000000000000e+00}, + {9.22337203685477785600000000000000000e+18, 1.00000000000000000000000000000000000e+00}, + {1.34217727999999985098838806152343750e+08, 1.00000000000000000000000000000000000e+00}, + {1.34217728000000000000000000000000000e+08, 1.00000000000000000000000000000000000e+00}, + {1.34217728000000029802322387695312500e+08, 1.00000000000000000000000000000000000e+00}, + {1.67772159999999981373548507690429688e+07, 1.00000000000000000000000000000000000e+00}, + {1.67772160000000000000000000000000000e+07, 1.00000000000000000000000000000000000e+00}, + {1.67772160000000037252902984619140625e+07, 1.00000000000000000000000000000000000e+00}, + {3.19999999999999964472863211994990706e+01, 9.99999999999999999999999999679237812e-01}, + {3.20000000000000000000000000000000000e+01, 9.99999999999999999999999999679237812e-01}, + {3.20000000000000071054273576010018587e+01, 9.99999999999999999999999999679237812e-01}, + {1.59999999999999982236431605997495353e+01, 9.99999999999974671668901811879331665e-01}, + {1.60000000000000000000000000000000000e+01, 9.99999999999974671668901811969315927e-01}, + {1.60000000000000035527136788005009294e+01, 9.99999999999974671668901812149284547e-01}, + {7.99999999999999911182158029987476766e+00, 9.99999774929675889809619027791781323e-01}, + {8.00000000000000000000000000000000000e+00, 9.99999774929675889810018832956368404e-01}, + {8.00000000000000177635683940025046468e+00, 9.99999774929675889810818443285542469e-01}, + {3.99999999999999955591079014993738383e+00, 9.99329299739067043196741615068852355e-01}, + {4.00000000000000000000000000000000000e+00, 9.99329299739067043792243344341724993e-01}, + {4.00000000000000088817841970012523234e+00, 9.99329299739067044983246802887468536e-01}, + {1.99999999999999977795539507496869192e+00, 9.64027580075816868258779231952432911e-01}, + {2.00000000000000000000000000000000000e+00, 9.64027580075816883946413724100923171e-01}, + {2.00000000000000044408920985006261617e+00, 9.64027580075816915321682708397883469e-01}, + {9.99999999999999888977697537484345958e-01, 7.61594155955764841492939901436512668e-01}, + {1.00000000000000000000000000000000000e+00, 7.61594155955764888119458282604793657e-01}, + {1.00000000000000022204460492503130808e+00, 7.61594155955764981372495044941331753e-01}, + {4.99999999999999944488848768742172979e-01, 4.62117157260009714845699443492203290e-01}, + {5.00000000000000000000000000000000000e-01, 4.62117157260009758502318483643672557e-01}, + {5.00000000000000111022302462515654042e-01, 4.62117157260009845815556563946604302e-01}, + {2.49999999999999972244424384371086489e-01, 2.44918662403709103187147915631612892e-01}, + {2.50000000000000000000000000000000000e-01, 2.44918662403709129277801131491016945e-01}, + {2.50000000000000055511151231257827021e-01, 2.44918662403709181459107563209824042e-01}, + {1.24999999999999986122212192185543245e-01, 1.24353001771596194391460985792144305e-01}, + {1.25000000000000000000000000000000000e-01, 1.24353001771596208054647275805892707e-01}, + {1.25000000000000027755575615628913511e-01, 1.24353001771596235381019855833389378e-01}, + {6.24999999999999930611060960927716224e-02, 6.24187467475125075782836114480350829e-02}, + {6.25000000000000000000000000000000000e-02, 6.24187467475125144901428911942113317e-02}, + {6.25000000000000138777878078144567553e-02, 6.24187467475125283138614506865638292e-02}, + {3.12499999999999965305530480463858112e-02, 3.12398314460312533021176543496182149e-02}, + {3.12500000000000000000000000000000000e-02, 3.12398314460312567681786791091369499e-02}, + {3.12500000000000069388939039072283776e-02, 3.12398314460312637003007286281744168e-02}, + {1.56249999999999982652765240231929056e-02, 1.56237285584088634680488027509294906e-02}, + {1.56250000000000000000000000000000000e-02, 1.56237285584088652023488311762919065e-02}, + {1.56250000000000034694469519536141888e-02, 1.56237285584088686709488880270167445e-02}, + {6.10351562499999932237364219655972875e-05, 6.10351561742087681889301535131725312e-05}, + {6.10351562500000000000000000000000000e-05, 6.10351561742087749651937063040263414e-05}, + {6.10351562500000135525271560688054251e-05, 6.10351561742087885177208118857339557e-05}, + {9.31322574615478412227423430871540641e-10, 9.31322574615478411958158908556102005e-10}, + {9.31322574615478515625000000000000000e-10, 9.31322574615478515355735477684561274e-10}, + {9.31322574615478722420153138256918718e-10, 9.31322574615478722150888615941479902e-10}, + {2.77555756156289104291028806826931429e-17, 2.77555756156289104291028806826931349e-17}, + {2.77555756156289135105907917022705078e-17, 2.77555756156289135105907917022704998e-17}, + {2.77555756156289196735666137414252376e-17, 2.77555756156289196735666137414252322e-17}, + {1.79769313486231570814527423731704357e+308, 1.00000000000000000000000000000000000e+00}, + {1.79769313486231570814527423731704357e+308, 1.00000000000000000000000000000000000e+00}, + {1.79769313486231570814527423731704357e+308, 1.00000000000000000000000000000000000e+00}, + {1.79769313486231550856124328384506240e+308, 1.00000000000000000000000000000000000e+00}, + {3.14159265358979311599796346854418516e+00, 9.96272076220749943353314537833579484e-01}, + {1.57079632679489655799898173427209258e+00, 9.17152335667274336647462811870662140e-01}, + {1.00000000000000022204460492503130808e+00, 7.61594155955764981372495044941331753e-01}, + {1.00000000000000000000000000000000000e+00, 7.61594155955764888119458282604793657e-01}, + {9.99999999999999888977697537484345958e-01, 7.61594155955764841492939901436512668e-01}, + {7.85398163397448278999490867136046290e-01, 6.55794202632672418203926030568705821e-01}, + {2.22507385850720187715587855857894824e-308, 2.22507385850720187715587855857894824e-308}, + {2.22507385850720138309023271733240406e-308, 2.22507385850720138309023271733240406e-308}, + {2.22507385850720088902458687608585989e-308, 2.22507385850720088902458687608585989e-308}, + {2.22507385850720039495894103483931571e-308, 2.22507385850720039495894103483931571e-308}, + {9.88131291682493088353137585736442745e-324, 9.88131291682493088353137585736442745e-324}, + {4.94065645841246544176568792868221372e-324, 4.94065645841246544176568792868221372e-324}, + }; + + for (int i = 0; i < testCases.length; i++) { + double[] testCase = testCases[i]; + failures += testTanhCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + return failures; } diff --git a/test/jdk/java/lang/Thread/virtual/BigStackChunk.java b/test/jdk/java/lang/Thread/virtual/BigStackChunk.java new file mode 100644 index 0000000000000..1e76856d3c0df --- /dev/null +++ b/test/jdk/java/lang/Thread/virtual/BigStackChunk.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test id=default + * @bug 8335362 + * @summary Test virtual thread usage with big stackChunks + * @requires vm.continuations + * @run junit/othervm BigStackChunk + */ + +import java.util.concurrent.locks.ReentrantLock; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class BigStackChunk { + + void recurse(int cnt, ReentrantLock rlock) { + int i1 = cnt; + int i2 = i1 + 1; + int i3 = i2 + 1; + int i4 = i3 + 1; + int i5 = i4 + 1; + int i6 = i5 + 1; + int i7 = i6 + 1; + long ll = 2 * (long)i1; + float ff = ll + 1.2f; + double dd = ff + 1.3D; + + if (cnt > 0) { + recurse(cnt - 1, rlock); + } else { + rlock.lock(); + rlock.unlock(); + } + } + + @Test + void bigStackChunkTest() throws Exception { + int VTHREAD_CNT = Runtime.getRuntime().availableProcessors(); + ReentrantLock rlock = new ReentrantLock(); + Thread[] vthreads = new Thread[VTHREAD_CNT]; + + rlock.lock(); + for (int i = 0; i < VTHREAD_CNT; i++) { + vthreads[i] = Thread.ofVirtual().start(() -> { + // Set up things so that half of the carriers will commit lots of + // pages in the stack while running the mounted vthread and half + // will just commit very few ones. + if (Math.random() < 0.5) { + recurse(300, rlock); + } else { + recurse(1, rlock); + } + }); + } + await(vthreads[0], Thread.State.WAITING); + // Now we expect that some vthread that recursed a lot is mounted on + // a carrier that previously run a vthread that didn't recurse at all. + rlock.unlock(); + + for (int i = 0; i < VTHREAD_CNT; i++) { + vthreads[i].join(); + } + } + + private void await(Thread thread, Thread.State expectedState) throws InterruptedException { + Thread.State state = thread.getState(); + while (state != expectedState) { + assertTrue(state != Thread.State.TERMINATED, "Thread has terminated"); + Thread.sleep(10); + state = thread.getState(); + } + } +} \ No newline at end of file diff --git a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java index 917e8226bb131..de1b22c4075a4 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java +++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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 @@ -36,7 +36,7 @@ * @bug 4982128 * @summary Test low memory detection of non-heap memory pool * - * @run main/othervm/timeout=600 -noclassgc -XX:MaxMetaspaceSize=32m + * @run main/othervm/timeout=600 -Xnoclassgc -XX:MaxMetaspaceSize=32m * LowMemoryTest2 */ @@ -45,7 +45,7 @@ * @bug 4982128 * @summary Test low memory detection of non-heap memory pool * - * @run main/othervm/timeout=600 -noclassgc -XX:MaxMetaspaceSize=16m + * @run main/othervm/timeout=600 -Xnoclassgc -XX:MaxMetaspaceSize=16m * -XX:CompressedClassSpaceSize=4m LowMemoryTest2 */ diff --git a/test/jdk/java/lang/management/ThreadMXBean/Locks.java b/test/jdk/java/lang/management/ThreadMXBean/Locks.java index a9c45887780f1..5b4d360ae21c8 100644 --- a/test/jdk/java/lang/management/ThreadMXBean/Locks.java +++ b/test/jdk/java/lang/management/ThreadMXBean/Locks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -422,6 +422,9 @@ private static ThreadInfo findOwnerInfo(ThreadInfo[] infos, String lock) lock + " expected to have owner"); } for (ThreadInfo info1 : infos) { + if (info1 == null) { + continue; // Missing thread, e.g. completed. Ignore. + } if (info1.getThreadId() == threadId) { ownerInfo = info1; break; diff --git a/test/jdk/java/lang/ref/SoftReference/Pin.java b/test/jdk/java/lang/ref/SoftReference/Pin.java index 5416b0f575a42..35aa4d9a51271 100644 --- a/test/jdk/java/lang/ref/SoftReference/Pin.java +++ b/test/jdk/java/lang/ref/SoftReference/Pin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, 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 @@ -24,9 +24,7 @@ /* @test * @bug 4076287 * @summary Invoking get on a SoftReference shouldn't pin the referent - * @run main/othervm -ms16m -mx16m Pin - * @author Peter Jones - * @author Mark Reinhold + * @run main/othervm -Xms16m -Xmx16m Pin */ diff --git a/test/jdk/java/lang/reflect/Generics/TestMissingTypeVariable.java b/test/jdk/java/lang/reflect/Generics/TestMissingTypeVariable.java new file mode 100644 index 0000000000000..64f1457bdf75e --- /dev/null +++ b/test/jdk/java/lang/reflect/Generics/TestMissingTypeVariable.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib + * @bug 8337302 + * @enablePreview + * @summary Tests that an exception is thrown if a type variable is not declared + */ + +import jdk.test.lib.ByteCodeLoader; + +import java.lang.classfile.ClassFile; +import java.lang.classfile.Signature; +import java.lang.classfile.attribute.SignatureAttribute; +import java.lang.constant.ClassDesc; +import java.lang.reflect.AccessFlag; +import java.lang.reflect.Type; + +public class TestMissingTypeVariable { + + public static void main(String[] args) throws Exception { + ClassFile cf = ClassFile.of(); + byte[] bytes = cf.build( + ClassDesc.of("sample.MissingVariable"), + classBuilder -> { + classBuilder.withSuperclass(ClassDesc.of("java.lang.Object")); + classBuilder.withFlags(AccessFlag.PUBLIC); + classBuilder.withField("f", + ClassDesc.of("java.lang.Object"), + fieldBuilder -> fieldBuilder.withFlags(AccessFlag.PUBLIC).with(SignatureAttribute.of(Signature.parseFrom("TA;")))); + }); + /* + package sample; + public class MissingVariable { + public A f; // undeclared type variable + } + */ + Class missing = ByteCodeLoader.load("sample.MissingVariable", bytes); + try { + Type type = missing.getField("f").getGenericType(); + throw new IllegalStateException("Expected TypeNotPresentException but got: " + type); + } catch (TypeNotPresentException e) { + if (!"A".equals(e.typeName())) { + throw new IllegalStateException("Unexpected name: " + e.typeName()); + } + } + } +} diff --git a/test/jdk/java/net/InetAddress/ptr/Lookup.java b/test/jdk/java/net/InetAddress/ptr/Lookup.java index 79c53190c24d0..1248916023ec0 100644 --- a/test/jdk/java/net/InetAddress/ptr/Lookup.java +++ b/test/jdk/java/net/InetAddress/ptr/Lookup.java @@ -114,6 +114,9 @@ public static void main(String args[]) throws IOException { // Now check that a reverse lookup will succeed with the dual stack. InetAddress ia = InetAddress.getByName(addr); String name = ia.getHostName(); + // output details of dual stack lookup by address + System.out.println("dual stack lookup for addr " + addr + " returned IP address " + ia); + System.out.println(" with hostname " + name); System.out.println("(default) " + addr + "--> " + name + " (reversed IPv4: " + ipv4Reversed + ")"); diff --git a/test/jdk/java/net/ipv6tests/Tests.java b/test/jdk/java/net/ipv6tests/Tests.java index 398a3e716936c..7a6917a60382f 100644 --- a/test/jdk/java/net/ipv6tests/Tests.java +++ b/test/jdk/java/net/ipv6tests/Tests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, 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 @@ -123,7 +123,8 @@ public static void datagramEcho (DatagramSocket s1, DatagramSocket s2, } dprintln ("dest2 = " + dest2); - + dprintln ("sender endpoint = " + s1.getLocalSocketAddress()); + dprintln ("echo endpoint = " + s2.getLocalSocketAddress()); DatagramPacket r1 = new DatagramPacket (new byte[256], 256); DatagramPacket r2 = new DatagramPacket (new byte[256], 256); diff --git a/test/jdk/java/nio/Buffer/Chew.java b/test/jdk/java/nio/Buffer/Chew.java index b1afeabc472ab..30932be526afb 100644 --- a/test/jdk/java/nio/Buffer/Chew.java +++ b/test/jdk/java/nio/Buffer/Chew.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2024, 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 @@ -26,7 +26,7 @@ * @summary Ensure that direct memory can be unreserved * as the reserving thread sleeps * - * @run main/othervm -mx16M Chew + * @run main/othervm -Xmx16M Chew */ import java.nio.*; diff --git a/test/jdk/java/nio/file/Files/Links.java b/test/jdk/java/nio/file/Files/Links.java index a87647e08a639..23059b0829abb 100644 --- a/test/jdk/java/nio/file/Files/Links.java +++ b/test/jdk/java/nio/file/Files/Links.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2024, 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 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 6863864 + * @bug 4313887 6838333 6863864 8340329 * @summary Unit test for java.nio.file.Files createSymbolicLink, * readSymbolicLink, and createLink methods * @library .. @@ -45,7 +45,7 @@ static void assertTrue(boolean okay) { } /** - * Exercise createSymbolicLink and readLink methods + * Exercise createSymbolicLink and readSymbolicLink methods */ static void testSymLinks(Path dir) throws IOException { final Path link = dir.resolve("link"); @@ -131,6 +131,27 @@ static void testSymLinks(Path dir) throws IOException { Files.deleteIfExists(mydir); Files.deleteIfExists(link); } + + // Check message of NotLinkException + try { + Files.createDirectory(mydir); + + try { + Path mytarget = Files.readSymbolicLink(mydir); + } catch (NotLinkException expected) { + String filename = mydir.getFileName().toString(); + String message = expected.getMessage(); + boolean okay = message.contains(filename); + if (!okay) { + System.err.println("Message \"" + message + "\"" + + " does not contain the filename \"" + + filename + "\""); + assertTrue(okay); + } + } + } finally { + Files.deleteIfExists(mydir); + } } /** diff --git a/test/jdk/java/nio/file/Path/ToRealPath.java b/test/jdk/java/nio/file/Path/ToRealPath.java index 64f75124d0f7b..474b14171974e 100644 --- a/test/jdk/java/nio/file/Path/ToRealPath.java +++ b/test/jdk/java/nio/file/Path/ToRealPath.java @@ -33,6 +33,8 @@ import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; import jdk.test.lib.Platform; @@ -51,6 +53,7 @@ public class ToRealPath { static final Path SUBDIR; static final Path FILE; static final Path LINK; + static final Set extraDeletions; static { try { @@ -59,6 +62,7 @@ public class ToRealPath { FILE = Files.createFile(DIR.resolve("foo")); LINK = DIR.resolve("link"); SUPPORTS_LINKS = TestUtil.supportsSymbolicLinks(DIR); + extraDeletions = new HashSet(); } catch (IOException e) { throw new UncheckedIOException(e); } @@ -154,8 +158,15 @@ public void noCollapseDots1() throws IOException { System.out.println("p: " + p); Path path = LINK.resolve(p); System.out.println("path: " + path); + if (Platform.isWindows() && Files.notExists(path)) { + Files.createFile(path); + extraDeletions.add(path); + } System.out.println("no follow: " + path.toRealPath(NOFOLLOW_LINKS)); - assertEquals(path.toRealPath(NOFOLLOW_LINKS), path); + if (Platform.isWindows()) + assertTrue(Files.isSameFile(path.toRealPath(NOFOLLOW_LINKS), path)); + else + assertEquals(path.toRealPath(NOFOLLOW_LINKS), path); Files.delete(sub); Files.delete(sub.getParent()); @@ -177,8 +188,15 @@ public void noCollapseDots2() throws IOException { Path p = Path.of("aaa", "..", "..", "bbb", "..", "..", "out.txt"); Path path = DIR.resolve(p); System.out.println("path: " + path); + if (Platform.isWindows() && Files.notExists(path)) { + Files.createFile(path); + extraDeletions.add(path); + } System.out.println("no follow: " + path.toRealPath(NOFOLLOW_LINKS)); - assertEquals(path.toRealPath(NOFOLLOW_LINKS), path); + if (Platform.isWindows()) + assertTrue(Files.isSameFile(path.toRealPath(NOFOLLOW_LINKS), path)); + else + assertEquals(path.toRealPath(NOFOLLOW_LINKS), path); System.out.println(path.toRealPath()); Files.delete(sub); @@ -235,5 +253,7 @@ public static void cleanup() throws IOException { Files.delete(FILE); Files.delete(SUBDIR); Files.delete(DIR); + for (Path p : extraDeletions) + Files.deleteIfExists(p); } } diff --git a/test/jdk/java/security/Security/ConfigFileTest.java b/test/jdk/java/security/Security/ConfigFileTest.java index b9264b937ec74..caf657005e1ba 100644 --- a/test/jdk/java/security/Security/ConfigFileTest.java +++ b/test/jdk/java/security/Security/ConfigFileTest.java @@ -21,155 +21,907 @@ * questions. */ +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.FileUtils; +import sun.net.www.ParseUtil; +import java.io.Closeable; import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; import java.io.UncheckedIOException; -import java.nio.file.*; - -import java.security.Provider; +import java.lang.reflect.Method; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.URI; +import java.nio.CharBuffer; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; import java.security.Security; +import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; -import java.util.Optional; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Stream; /* * @test - * @summary Throw error if default java.security file is missing - * @bug 8155246 8292297 8292177 8281658 + * @summary Tests security properties passed through java.security, + * java.security.properties or included from other properties files. + * @bug 8155246 8292297 8292177 8281658 8319332 + * @modules java.base/sun.net.www * @library /test/lib * @run main ConfigFileTest */ + public class ConfigFileTest { + static final String SEPARATOR_THIN = "----------------------------"; + + private static void printTestHeader(String testName) { + System.out.println(); + System.out.println(SEPARATOR_THIN); + System.out.println(testName); + System.out.println(SEPARATOR_THIN); + System.out.println(); + } + + public static void main(String[] args) throws Exception { + if (args.length == 1 && Executor.RUNNER_ARG.equals(args[0])) { + // Executed by a test-launched JVM. + // Force the initialization of java.security.Security. + Security.getProviders(); + Security.setProperty("postInitTest", "shouldNotRecord"); + System.out.println(FilesManager.LAST_FILE_PROP_NAME + ": " + + Security.getProperty(FilesManager.LAST_FILE_PROP_NAME)); + assertTestSecuritySetPropertyShouldNotInclude(); + } else { + // Executed by the test JVM. + try (FilesManager filesMgr = new FilesManager()) { + for (Method m : ConfigFileTest.class.getDeclaredMethods()) { + if (m.getName().startsWith("test")) { + printTestHeader(m.getName()); + Executor.run(m, filesMgr); + } + } + } + } + } + + /* + * Success cases + */ + + static void testShowSettings(Executor ex, FilesManager filesMgr) + throws Exception { + // Sanity test passing the -XshowSettings:security option. + ex.addJvmArg("-XshowSettings:security"); + ex.setMasterFile(filesMgr.newMasterFile()); + ex.assertSuccess(); + ex.getOutputAnalyzer() + .shouldContain("Security properties:") + .shouldContain("Security provider static configuration:") + .shouldContain("Security TLS configuration"); + } - private static final String EXPECTED_DEBUG_OUTPUT = - "Initial security property: crypto.policy=unlimited"; + static void testIncludeBasic(Executor ex, FilesManager filesMgr) + throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + ExtraPropsFile extraFile = filesMgr.newExtraFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + PropsFile file1 = filesMgr.newFile("dir1/file1.properties"); + PropsFile file2 = filesMgr.newFile("dir1/dir2/file2.properties"); - private static final String UNEXPECTED_DEBUG_OUTPUT = - "Initial security property: postInitTest=shouldNotRecord"; + masterFile.addAbsoluteInclude(file0); + extraFile.addRelativeInclude(file2); + file2.addAbsoluteInclude(file1); - private static boolean overrideDetected = false; + ex.setMasterFile(masterFile); + ex.setExtraFile(extraFile, Executor.ExtraMode.FILE_URI, false); + ex.assertSuccess(); + } - private static Path COPY_JDK_DIR = Path.of("./jdk-8155246-tmpdir"); - private static Path COPIED_JAVA = COPY_JDK_DIR.resolve("bin", "java"); + static void testRepeatedInclude(Executor ex, FilesManager filesMgr) + throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + PropsFile file1 = filesMgr.newFile("dir1/file1.properties"); - public static void main(String[] args) throws Exception { - Path copyJdkDir = Path.of("./jdk-8155246-tmpdir"); - Path copiedJava = Optional.of( - Path.of(copyJdkDir.toString(), "bin", "java")) - .orElseThrow(() -> new RuntimeException("Unable to locate new JDK") - ); - - if (args.length == 1) { - // set up is complete. Run code to exercise loading of java.security - Provider[] provs = Security.getProviders(); - Security.setProperty("postInitTest", "shouldNotRecord"); - System.out.println(Arrays.toString(provs) + "NumProviders: " + provs.length); + masterFile.addAbsoluteInclude(file0); + masterFile.addAbsoluteInclude(file1); + masterFile.addAbsoluteInclude(file0); + file1.addRelativeInclude(file0); + + ex.setMasterFile(masterFile); + ex.assertSuccess(); + } + + static void testIncludeWithOverrideAll(Executor ex, FilesManager filesMgr) + throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + ExtraPropsFile extraFile = filesMgr.newExtraFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + PropsFile file1 = filesMgr.newFile("dir1/file1.properties"); + + masterFile.addRelativeInclude(file0); + extraFile.addAbsoluteInclude(file1); + + ex.setMasterFile(masterFile); + ex.setExtraFile(extraFile, Executor.ExtraMode.HTTP_SERVED, true); + ex.assertSuccess(); + } + + static void extraPropertiesByHelper(Executor ex, FilesManager filesMgr, + Executor.ExtraMode mode) throws Exception { + ExtraPropsFile extraFile = filesMgr.newExtraFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + + extraFile.addRelativeInclude(file0); + + ex.setMasterFile(filesMgr.newMasterFile()); + ex.setExtraFile(extraFile, mode, true); + ex.assertSuccess(); + } + + static void testExtraPropertiesByPathAbsolute(Executor ex, + FilesManager filesMgr) throws Exception { + extraPropertiesByHelper(ex, filesMgr, Executor.ExtraMode.PATH_ABS); + } + + static void testExtraPropertiesByPathRelative(Executor ex, + FilesManager filesMgr) throws Exception { + extraPropertiesByHelper(ex, filesMgr, Executor.ExtraMode.PATH_REL); + } + + static void specialCharsIncludes(Executor ex, FilesManager filesMgr, + char specialChar, Executor.ExtraMode extraMode, + boolean useRelativeIncludes) throws Exception { + String suffix = specialChar + ".properties"; + ExtraPropsFile extraFile; + PropsFile file0, file1; + try { + extraFile = filesMgr.newExtraFile("extra" + suffix); + file0 = filesMgr.newFile("file0" + suffix); + file1 = filesMgr.newFile("file1" + suffix); + } catch (InvalidPathException ipe) { + // The platform encoding may not allow to create files with some + // special characters. Skip the test in these cases. + return; + } + + if (useRelativeIncludes) { + extraFile.addRelativeInclude(file0); } else { - Files.createDirectory(copyJdkDir); - Path jdkTestDir = Path.of(Optional.of(System.getProperty("test.jdk")) - .orElseThrow(() -> new RuntimeException("Couldn't load JDK Test Dir")) - ); - - copyJDK(jdkTestDir, copyJdkDir); - String extraPropsFile = Path.of(System.getProperty("test.src"), "override.props").toString(); - - // sanity test -XshowSettings:security option - exerciseShowSettingsSecurity(buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-XshowSettings:security", "ConfigFileTest", "runner")); - - // exercise some debug flags while we're here - // regular JDK install - should expect success - exerciseSecurity(0, "java", - buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-Djavax.net.debug=all", "ConfigFileTest", "runner")); - - // given an overriding security conf file that doesn't exist, we shouldn't - // overwrite the properties from original/master security conf file - exerciseSecurity(0, "SUN version", - buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-Djavax.net.debug=all", - "-Djava.security.properties==file:///" + extraPropsFile + "badFileName", - "ConfigFileTest", "runner")); - - // test JDK launch with customized properties file - exerciseSecurity(0, "NumProviders: 6", - buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-Djavax.net.debug=all", - "-Djava.security.properties==file:///" + extraPropsFile, - "ConfigFileTest", "runner")); - - // delete the master conf file - Files.delete(Path.of(copyJdkDir.toString(), "conf", - "security","java.security")); - - // launch JDK without java.security file being present or specified - exerciseSecurity(1, "Error loading java.security file", - buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-Djavax.net.debug=all", - "ConfigFileTest", "runner")); - - // test the override functionality also. Should not be allowed since - // "security.overridePropertiesFile=true" Security property is missing. - exerciseSecurity(1, "Error loading java.security file", - buildCommand("-cp", System.getProperty("test.classes"), - "-Djava.security.debug=all", "-Djavax.net.debug=all", - "-Djava.security.properties==file:///" + extraPropsFile, "ConfigFileTest", "runner")); - - if (!overrideDetected) { - throw new RuntimeException("Override scenario not seen"); + extraFile.addAbsoluteInclude(file0); + } + extraFile.addAbsoluteInclude(file1); + + ex.setMasterFile(filesMgr.newMasterFile()); + ex.setExtraFile(extraFile, extraMode, false); + ex.assertSuccess(); + } + + static void testUnicodeIncludes1(Executor ex, FilesManager filesMgr) + throws Exception { + specialCharsIncludes(ex, filesMgr, '\u2022', + Executor.ExtraMode.PATH_ABS, true); + } + + static void testUnicodeIncludes2(Executor ex, FilesManager filesMgr) + throws Exception { + specialCharsIncludes(ex, filesMgr, '\u2022', + Executor.ExtraMode.FILE_URI, true); + } + + static void testUnicodeIncludes3(Executor ex, FilesManager filesMgr) + throws Exception { + // Backward compatibility check. Malformed URLs such as + // file:/tmp/extra•.properties are supported for the extra file. + // However, relative includes are not allowed in these cases. + specialCharsIncludes(ex, filesMgr, '\u2022', + Executor.ExtraMode.RAW_FILE_URI1, false); + } + + static void testUnicodeIncludes4(Executor ex, FilesManager filesMgr) + throws Exception { + // Backward compatibility check. Malformed URLs such as + // file:///tmp/extra•.properties are supported for the extra file. + // However, relative includes are not allowed in these cases. + specialCharsIncludes(ex, filesMgr, '\u2022', + Executor.ExtraMode.RAW_FILE_URI2, false); + } + + static void testSpaceIncludes1(Executor ex, FilesManager filesMgr) + throws Exception { + specialCharsIncludes(ex, filesMgr, ' ', + Executor.ExtraMode.PATH_ABS, true); + } + + static void testSpaceIncludes2(Executor ex, FilesManager filesMgr) + throws Exception { + specialCharsIncludes(ex, filesMgr, ' ', + Executor.ExtraMode.FILE_URI, true); + } + + static void testSpaceIncludes3(Executor ex, FilesManager filesMgr) + throws Exception { + // Backward compatibility check. Malformed URLs such as + // file:/tmp/extra .properties are supported for the extra file. + // However, relative includes are not allowed in these cases. + specialCharsIncludes(ex, filesMgr, ' ', + Executor.ExtraMode.RAW_FILE_URI1, false); + } + + static void testSpaceIncludes4(Executor ex, FilesManager filesMgr) + throws Exception { + // Backward compatibility check. Malformed URLs such as + // file:///tmp/extra .properties are supported for the extra file. + // However, relative includes are not allowed in these cases. + specialCharsIncludes(ex, filesMgr, ' ', + Executor.ExtraMode.RAW_FILE_URI2, false); + } + + static void notOverrideOnFailureHelper(Executor ex, FilesManager filesMgr, + String nonExistentExtraFile) throws Exception { + // An overriding extra properties file that does not exist + // should not erase properties from the master file. + ex.setIgnoredExtraFile(nonExistentExtraFile, true); + ex.setMasterFile(filesMgr.newMasterFile()); + ex.assertSuccess(); + ex.getOutputAnalyzer().shouldContain("unable to load security " + + "properties from " + nonExistentExtraFile); + } + + static void testNotOverrideOnEmptyFailure(Executor ex, + FilesManager filesMgr) throws Exception { + notOverrideOnFailureHelper(ex, filesMgr, ""); + ex.getOutputAnalyzer() + .shouldContain("Empty extra properties file path"); + } + + static void testNotOverrideOnURLFailure(Executor ex, FilesManager filesMgr) + throws Exception { + notOverrideOnFailureHelper(ex, filesMgr, + "file:///nonExistentFile.properties"); + } + + static void testNotOverrideOnPathFailure(Executor ex, FilesManager filesMgr) + throws Exception { + notOverrideOnFailureHelper(ex, filesMgr, "nonExistentFile.properties"); + } + + static void testNotOverrideOnDirFailure(Executor ex, FilesManager filesMgr) + throws Exception { + notOverrideOnFailureHelper(ex, filesMgr, "file:///"); + ex.getOutputAnalyzer().shouldContain("Is a directory"); + } + + static void testNotOverrideOnBadFileURLFailure(Executor ex, + FilesManager filesMgr) throws Exception { + notOverrideOnFailureHelper(ex, filesMgr, "file:///%00"); + } + + static void testDisabledExtraPropertiesFile(Executor ex, + FilesManager filesMgr) throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + + masterFile.addRawProperty("security.overridePropertiesFile", "false"); + + ex.setMasterFile(masterFile); + ex.setIgnoredExtraFile(file0.path.toString(), true); + ex.assertSuccess(); + } + + static final String SECURITY_SET_PROP_FILE_PATH = + "testSecuritySetPropertyShouldNotInclude.propsFilePath"; + + static void testSecuritySetPropertyShouldNotInclude(Executor ex, + FilesManager filesMgr) throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + + ex.addSystemProp(SECURITY_SET_PROP_FILE_PATH, file0.path.toString()); + ex.setMasterFile(masterFile); + ex.assertSuccess(); + } + + static void assertTestSecuritySetPropertyShouldNotInclude() { + // This check is executed by the launched JVM. + String propsFilePath = System.getProperty(SECURITY_SET_PROP_FILE_PATH); + if (propsFilePath != null) { + String name = Path.of(propsFilePath).getFileName().toString(); + String setPropInvokeRepr = "Security.setProperty(\"include\", " + + "\"" + propsFilePath + "\")"; + try { + Security.setProperty("include", propsFilePath); + throw new RuntimeException(setPropInvokeRepr + " was " + + "expected to throw IllegalArgumentException."); + } catch (IllegalArgumentException expected) {} + if (FilesManager.APPLIED_PROP_VALUE.equals( + Security.getProperty(name))) { + throw new RuntimeException(setPropInvokeRepr + " caused " + + "a file inclusion."); } + try { + Security.getProperty("include"); + throw new RuntimeException("Security.getProperty(\"include\")" + + " was expected to throw IllegalArgumentException."); + } catch (IllegalArgumentException expected) {} } } - private static ProcessBuilder buildCommand(String... command) { - ArrayList args = new ArrayList<>(); - args.add(COPIED_JAVA.toString()); - Collections.addAll(args, Utils.prependTestJavaOpts(command)); - return new ProcessBuilder(args); + /* + * Error cases + */ + + static void testCannotResolveRelativeFromHTTPServed(Executor ex, + FilesManager filesMgr) throws Exception { + ExtraPropsFile extraFile = filesMgr.newExtraFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + + extraFile.addRelativeInclude(file0); + + ex.setMasterFile(filesMgr.newMasterFile()); + ex.setExtraFile(extraFile, Executor.ExtraMode.HTTP_SERVED, true); + ex.assertError("InternalError: Cannot resolve '" + file0.fileName + + "' relative path when included from a non-regular " + + "properties file (e.g. HTTP served file)"); } - private static void exerciseSecurity(int exitCode, String output, ProcessBuilder process) throws Exception { - OutputAnalyzer oa = ProcessTools.executeProcess(process); - oa.shouldHaveExitValue(exitCode) - .shouldContain(output); + static void testCannotIncludeCycles(Executor ex, FilesManager filesMgr) + throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + PropsFile file0 = filesMgr.newFile("file0.properties"); + PropsFile file1 = filesMgr.newFile("dir1/file1.properties"); + + // Includes chain: master -> file0 -> file1 -> master. + file1.addRelativeInclude(masterFile); + file0.addRelativeInclude(file1); + masterFile.addRelativeInclude(file0); - // extra checks on debug output - if (exitCode != 1) { - if (oa.getStderr().contains("overriding other security properties files!")) { - overrideDetected = true; - // master file is not in use - only provider properties are set in custom file - oa.shouldContain("security.provider.2=SunRsaSign") - .shouldNotContain(EXPECTED_DEBUG_OUTPUT) - .shouldNotContain(UNEXPECTED_DEBUG_OUTPUT); + ex.setMasterFile(masterFile); + ex.assertError( + "InternalError: Cyclic include of '" + masterFile.path + "'"); + } + + static void testCannotIncludeURL(Executor ex, FilesManager filesMgr) + throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + ExtraPropsFile extraFile = filesMgr.newExtraFile(); + + masterFile.addRawProperty("include", extraFile.url.toString()); + + ex.setMasterFile(masterFile); + ex.assertError("InternalError: Unable to include 'http://127.0.0.1:"); + } + + static void testCannotIncludeNonexistentFile(Executor ex, + FilesManager filesMgr) throws Exception { + PropsFile masterFile = filesMgr.newMasterFile(); + + String nonexistentPath = "/nonExistentFile.properties"; + masterFile.addRawProperty("include", nonexistentPath); + + ex.setMasterFile(masterFile); + ex.assertError( + "InternalError: Unable to include '" + nonexistentPath + "'"); + } + + static void testMustHaveMasterFile(Executor ex, FilesManager filesMgr) + throws Exception { + // Launch a JDK without a master java.security file present. + ex.assertError("InternalError: Error loading java.security file"); + } + + static void testMustHaveMasterFileEvenWithExtraFile(Executor ex, + FilesManager filesMgr) throws Exception { + // Launch a JDK without a master java.security file present, but with an + // extra file passed. Since the "security.overridePropertiesFile=true" + // security property is missing, it should fail anyway. + ex.setExtraFile( + filesMgr.newExtraFile(), Executor.ExtraMode.FILE_URI, true); + ex.assertError("InternalError: Error loading java.security file"); + } +} + +sealed class PropsFile permits ExtraPropsFile { + protected static final class Include { + final PropsFile propsFile; + final String value; + + private Include(PropsFile propsFile, String value) { + this.propsFile = propsFile; + this.value = value; + } + + static Include of(PropsFile propsFile) { + return new Include(propsFile, propsFile.path.toString()); + } + + static Include of(PropsFile propsFile, String value) { + return new Include(propsFile, value); + } + } + + protected final List includes = new ArrayList<>(); + protected final PrintWriter writer; + protected boolean includedFromExtra = false; + final String fileName; + final Path path; + + PropsFile(String fileName, Path path) throws IOException { + this.fileName = fileName; + this.path = path; + this.writer = new PrintWriter(Files.newOutputStream(path, + StandardOpenOption.CREATE, StandardOpenOption.APPEND), true); + } + + private static String escape(String text, boolean escapeSpace) { + StringBuilder sb = new StringBuilder(text.length()); + CharBuffer cb = CharBuffer.wrap(text); + while (cb.hasRemaining()) { + char c = cb.get(); + if (c == '\\' || escapeSpace && c == ' ') { + sb.append('\\'); + } + if (Character.UnicodeBlock.of(c) == + Character.UnicodeBlock.BASIC_LATIN) { + sb.append(c); } else { - oa.shouldContain(EXPECTED_DEBUG_OUTPUT) - .shouldNotContain(UNEXPECTED_DEBUG_OUTPUT); + sb.append("\\u%04x".formatted((int) c)); } } + return sb.toString(); } - // exercise the -XshowSettings:security launcher - private static void exerciseShowSettingsSecurity(ProcessBuilder process) throws Exception { - OutputAnalyzer oa = ProcessTools.executeProcess(process); - oa.shouldHaveExitValue(0) - .shouldContain("Security properties:") - .shouldContain("Security provider static configuration:") - .shouldContain("Security TLS configuration"); + private void addRawProperty(String key, String value, String sep) { + writer.println(escape(key, true) + sep + escape(value, false)); + } + + protected void addIncludeDefinition(Include include) { + if (include.propsFile instanceof ExtraPropsFile) { + throw new RuntimeException("ExtraPropsFile should not be included"); + } + includes.add(include); + addRawProperty("include", include.value, " "); + } + + void addComment(String comment) { + writer.println("# " + comment); + } + + void addRawProperty(String key, String value) { + addRawProperty(key, value, "="); + } + + void addAbsoluteInclude(PropsFile propsFile) { + addIncludeDefinition(Include.of(propsFile)); + } + + void addRelativeInclude(PropsFile propsFile) { + addIncludeDefinition(Include.of(propsFile, + path.getParent().relativize(propsFile.path).toString())); + } + + void assertApplied(OutputAnalyzer oa) { + oa.shouldContain(Executor.INITIAL_PROP_LOG_MSG + fileName + "=" + + FilesManager.APPLIED_PROP_VALUE); + for (Include include : includes) { + include.propsFile.assertApplied(oa); + oa.shouldContain("processing include: '" + include.value + "'"); + oa.shouldContain("finished processing " + include.propsFile.path); + } + } + + void assertWasOverwritten(OutputAnalyzer oa) { + oa.shouldNotContain(Executor.INITIAL_PROP_LOG_MSG + fileName + "=" + + FilesManager.APPLIED_PROP_VALUE); + for (Include include : includes) { + if (!include.propsFile.includedFromExtra) { + include.propsFile.assertWasOverwritten(oa); + } + oa.shouldContain("processing include: '" + include.value + "'"); + oa.shouldContain("finished processing " + include.propsFile.path); + } + } + + void markAsIncludedFromExtra() { + includedFromExtra = true; + for (Include include : includes) { + include.propsFile.markAsIncludedFromExtra(); + } + } + + PropsFile getLastFile() { + return includes.isEmpty() ? + this : includes.getLast().propsFile.getLastFile(); } - private static void copyJDK(Path src, Path dst) throws Exception { - Files.walk(src) - .skip(1) - .forEach(file -> { + void close() { + writer.close(); + } +} + +final class ExtraPropsFile extends PropsFile { + private final Map systemProps = new LinkedHashMap<>(); + final URI url; + + ExtraPropsFile(String fileName, URI url, Path path) throws IOException { + super(fileName, path); + this.url = url; + } + + @Override + protected void addIncludeDefinition(Include include) { + if (includes.isEmpty()) { + String propName = "props.fileName"; + systemProps.put(propName, include.propsFile.fileName); + include = Include.of(include.propsFile, + include.value.replace(include.propsFile.fileName, + "${props.none}${" + propName + "}")); + } + include.propsFile.markAsIncludedFromExtra(); + super.addIncludeDefinition(include); + } + + Map getSystemProperties() { + return Collections.unmodifiableMap(systemProps); + } +} + +final class FilesManager implements Closeable { + private static final Path ROOT_DIR = + Path.of(ConfigFileTest.class.getSimpleName()).toAbsolutePath(); + private static final Path PROPS_DIR = ROOT_DIR.resolve("properties"); + private static final Path JDK_DIR = ROOT_DIR.resolve("jdk"); + private static final Path MASTER_FILE = + JDK_DIR.resolve("conf/security/java.security"); + private static final Path MASTER_FILE_TEMPLATE = + MASTER_FILE.resolveSibling("java.security.template"); + static final String JAVA_EXECUTABLE = + JDK_DIR.resolve("bin/java").toString(); + static final String LAST_FILE_PROP_NAME = "last-file"; + static final String APPLIED_PROP_VALUE = "applied"; + + private final List createdFiles; + private final Set fileNamesInUse; + private final HttpServer httpServer; + private final URI serverUri; + private final long masterFileLines; + + FilesManager() throws Exception { + createdFiles = new ArrayList<>(); + fileNamesInUse = new HashSet<>(); + httpServer = HttpServer.create( + new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0); + httpServer.createContext("/", this::handleRequest); + InetSocketAddress address = httpServer.getAddress(); + httpServer.start(); + serverUri = new URI("http", null, address.getHostString(), + address.getPort(), null, null, null); + copyJDK(); + try (Stream s = Files.lines(MASTER_FILE_TEMPLATE)) { + masterFileLines = s.count(); + } + } + + private static void copyJDK() throws Exception { + Path testJDK = Path.of(Objects.requireNonNull( + System.getProperty("test.jdk"), "unspecified test.jdk")); + if (!Files.exists(testJDK)) { + throw new RuntimeException("test.jdk -> nonexistent JDK"); + } + Files.createDirectories(JDK_DIR); + try (Stream pathStream = Files.walk(testJDK)) { + pathStream.skip(1).forEach((Path file) -> { try { - Files.copy(file, dst.resolve(src.relativize(file)), StandardCopyOption.COPY_ATTRIBUTES); + Files.copy(file, JDK_DIR.resolve(testJDK.relativize(file)), + StandardCopyOption.COPY_ATTRIBUTES); } catch (IOException ioe) { throw new UncheckedIOException(ioe); } }); + } + Files.move(MASTER_FILE, MASTER_FILE_TEMPLATE); + } + + private void handleRequest(HttpExchange x) throws IOException { + String rawPath = x.getRequestURI().getRawPath(); + Path f = ROOT_DIR.resolve(x.getRequestURI().getPath().substring(1)); + int statusCode; + byte[] responseBody; + // Check for unescaped space, unresolved parent or backward slash. + if (rawPath.matches("^.*( |(\\.|%2[Ee]){2}|\\\\|%5[Cc]).*$")) { + statusCode = HttpURLConnection.HTTP_BAD_REQUEST; + responseBody = new byte[0]; + } else if (Files.isRegularFile(f)) { + x.getResponseHeaders().add("Content-type", "text/plain"); + statusCode = HttpURLConnection.HTTP_OK; + responseBody = Files.readAllBytes(f); + } else { + statusCode = HttpURLConnection.HTTP_NOT_FOUND; + responseBody = new byte[0]; + } + System.out.println("[" + Instant.now() + "] " + + getClass().getSimpleName() + ": " + + x.getRequestMethod() + " " + rawPath + " -> " + + statusCode + " (" + responseBody.length + " bytes)"); + try (OutputStream responseStream = x.getResponseBody()) { + x.sendResponseHeaders(statusCode, responseBody.length); + responseStream.write(responseBody); + } + } + + @FunctionalInterface + private interface PropsFileBuilder { + PropsFile build(String fileName, Path path) throws IOException; + } + + private PropsFile newFile(Path path, PropsFileBuilder builder) + throws IOException { + String fileName = path.getFileName().toString(); + if (!fileNamesInUse.add(fileName)) { + // Names must be unique in order for the special + // property = to work. + throw new RuntimeException(fileName + " is repeated"); + } + Files.createDirectories(path.getParent()); + PropsFile propsFile = builder.build(fileName, path); + propsFile.addComment("Property to determine if this properties file " + + "was parsed and not overwritten:"); + propsFile.addRawProperty(fileName, APPLIED_PROP_VALUE); + propsFile.addComment(ConfigFileTest.SEPARATOR_THIN); + propsFile.addComment("Property to be overwritten by every properties " + + "file (master, extra or included):"); + propsFile.addRawProperty(LAST_FILE_PROP_NAME, fileName); + propsFile.addComment(ConfigFileTest.SEPARATOR_THIN); + createdFiles.add(propsFile); + return propsFile; + } + + PropsFile newFile(String relPathStr) throws IOException { + return newFile(PROPS_DIR.resolve(relPathStr), PropsFile::new); + } + + PropsFile newMasterFile() throws IOException { + Files.copy(MASTER_FILE_TEMPLATE, MASTER_FILE); + return newFile(MASTER_FILE, PropsFile::new); + } + + ExtraPropsFile newExtraFile() throws IOException { + return newExtraFile("extra.properties"); + } + + ExtraPropsFile newExtraFile(String extraFileName) throws IOException { + return (ExtraPropsFile) newFile(PROPS_DIR.resolve(extraFileName), + (fileName, path) -> { + URI uri = serverUri.resolve(ParseUtil.encodePath( + ROOT_DIR.relativize(path).toString())); + return new ExtraPropsFile(fileName, uri, path); + }); + } + + void reportCreatedFiles() throws IOException { + for (PropsFile propsFile : createdFiles) { + System.err.println(); + System.err.println(propsFile.path.toString()); + System.err.println(ConfigFileTest.SEPARATOR_THIN.repeat(3)); + try (Stream lines = Files.lines(propsFile.path)) { + long lineNumber = 1L; + Iterator it = lines.iterator(); + while (it.hasNext()) { + String line = it.next(); + if (!propsFile.path.equals(MASTER_FILE) || + lineNumber > masterFileLines) { + System.err.println(line); + } + lineNumber++; + } + } + System.err.println(); + } + } + + void clear() throws IOException { + if (!createdFiles.isEmpty()) { + for (PropsFile propsFile : createdFiles) { + propsFile.close(); + Files.delete(propsFile.path); + } + FileUtils.deleteFileTreeUnchecked(PROPS_DIR); + createdFiles.clear(); + fileNamesInUse.clear(); + } + } + + @Override + public void close() throws IOException { + clear(); + httpServer.stop(0); + FileUtils.deleteFileTreeUnchecked(ROOT_DIR); + } +} + +final class Executor { + enum ExtraMode { + HTTP_SERVED, FILE_URI, RAW_FILE_URI1, RAW_FILE_URI2, PATH_ABS, PATH_REL + } + static final String RUNNER_ARG = "runner"; + static final String INITIAL_PROP_LOG_MSG = "Initial security property: "; + private static final String OVERRIDING_LOG_MSG = + "overriding other security properties files!"; + private static final String[] ALWAYS_UNEXPECTED_LOG_MSGS = { + "java.lang.AssertionError", + INITIAL_PROP_LOG_MSG + "postInitTest=shouldNotRecord", + INITIAL_PROP_LOG_MSG + "include=", + }; + private static final Path CWD = Path.of(".").toAbsolutePath(); + private static final String JAVA_SEC_PROPS = "java.security.properties"; + private static final String CLASS_PATH = Objects.requireNonNull( + System.getProperty("test.classes"), "unspecified test.classes"); + private static final String DEBUG_ARG = + "-Xrunjdwp:transport=dt_socket,address=localhost:8000,suspend=y"; + private final Map systemProps = new LinkedHashMap<>( + Map.of("java.security.debug", "all", "javax.net.debug", "all", + // Ensure we get UTF-8 debug outputs in Windows: + "stderr.encoding", "UTF-8", "stdout.encoding", "UTF-8")); + private final List jvmArgs = new ArrayList<>( + List.of(FilesManager.JAVA_EXECUTABLE, "-enablesystemassertions", + // Uncomment DEBUG_ARG to debug test-launched JVMs: + "-classpath", CLASS_PATH//, DEBUG_ARG + )); + private PropsFile masterPropsFile; + private ExtraPropsFile extraPropsFile; + private boolean expectedOverrideAll = false; + private OutputAnalyzer oa; + + static void run(Method m, FilesManager filesMgr) throws Exception { + try { + m.invoke(null, new Executor(), filesMgr); + } catch (Throwable e) { + filesMgr.reportCreatedFiles(); + throw e; + } finally { + filesMgr.clear(); + } + } + + void addSystemProp(String key, String value) { + systemProps.put(key, value); + } + + private void setRawExtraFile(String extraFile, boolean overrideAll) { + addSystemProp(JAVA_SEC_PROPS, (overrideAll ? "=" : "") + extraFile); + } + + void setMasterFile(PropsFile masterPropsFile) { + this.masterPropsFile = masterPropsFile; + } + + void setExtraFile(ExtraPropsFile extraPropsFile, ExtraMode mode, + boolean overrideAll) { + this.extraPropsFile = extraPropsFile; + expectedOverrideAll = overrideAll; + setRawExtraFile(switch (mode) { + case HTTP_SERVED -> extraPropsFile.url.toString(); + case FILE_URI -> extraPropsFile.path.toUri().toString(); + case RAW_FILE_URI1 -> "file:" + extraPropsFile.path; + case RAW_FILE_URI2 -> "file://" + + (extraPropsFile.path.startsWith("/") ? "" : "/") + + extraPropsFile.path; + case PATH_ABS -> extraPropsFile.path.toString(); + case PATH_REL -> CWD.relativize(extraPropsFile.path).toString(); + }, overrideAll); + } + + void setIgnoredExtraFile(String extraPropsFile, boolean overrideAll) { + setRawExtraFile(extraPropsFile, overrideAll); + expectedOverrideAll = false; + } + + void addJvmArg(String arg) { + jvmArgs.add(arg); + } + + private void execute(boolean successExpected) throws Exception { + List command = new ArrayList<>(jvmArgs); + Collections.addAll(command, Utils.getTestJavaOpts()); + addSystemPropertiesAsJvmArgs(command); + command.add(ConfigFileTest.class.getSimpleName()); + command.add(RUNNER_ARG); + oa = ProcessTools.executeProcess(new ProcessBuilder(command)); + oa.shouldHaveExitValue(successExpected ? 0 : 1); + for (String output : ALWAYS_UNEXPECTED_LOG_MSGS) { + oa.shouldNotContain(output); + } + } + + private void addSystemPropertiesAsJvmArgs(List command) { + Map allSystemProps = new LinkedHashMap<>(systemProps); + if (extraPropsFile != null) { + allSystemProps.putAll(extraPropsFile.getSystemProperties()); + } + for (Map.Entry e : allSystemProps.entrySet()) { + command.add("-D" + e.getKey() + "=" + e.getValue()); + } + } + + void assertSuccess() throws Exception { + execute(true); + + // Ensure every file was processed by checking a unique property used as + // a flag. Each file defines =applied. + // + // For example: + // + // file0 + // --------------- + // file0=applied + // include file1 + // + // file1 + // --------------- + // file1=applied + // + // The assertion would be file0 == applied AND file1 == applied. + // + if (extraPropsFile != null) { + extraPropsFile.assertApplied(oa); + } + if (expectedOverrideAll) { + // When overriding with an extra file, check that neither + // the master file nor its includes are visible. + oa.shouldContain(OVERRIDING_LOG_MSG); + masterPropsFile.assertWasOverwritten(oa); + } else { + oa.shouldNotContain(OVERRIDING_LOG_MSG); + masterPropsFile.assertApplied(oa); + } + + // Ensure the last included file overwrote a fixed property. Each file + // defines last-file=. + // + // For example: + // + // file0 + // --------------- + // last-file=file0 + // include file1 + // + // file1 + // --------------- + // last-file=file1 + // + // The assertion would be last-file == file1. + // + PropsFile lastFile = (extraPropsFile == null ? + masterPropsFile : extraPropsFile).getLastFile(); + oa.shouldContain(FilesManager.LAST_FILE_PROP_NAME + "=" + + lastFile.fileName); + oa.stdoutShouldContain(FilesManager.LAST_FILE_PROP_NAME + ": " + + lastFile.fileName); + } + + void assertError(String message) throws Exception { + execute(false); + oa.shouldContain(message); + } + + OutputAnalyzer getOutputAnalyzer() { + return oa; } } diff --git a/test/jdk/java/security/Security/override.props b/test/jdk/java/security/Security/override.props deleted file mode 100644 index d0190f576fd82..0000000000000 --- a/test/jdk/java/security/Security/override.props +++ /dev/null @@ -1,7 +0,0 @@ -# exercise ServiceLoader and legacy (class load) approach -security.provider.1=sun.security.provider.Sun -security.provider.2=SunRsaSign -security.provider.3=sun.security.ssl.SunJSSE -security.provider.4=com.sun.crypto.provider.SunJCE -security.provider.5=SunJGSS -security.provider.6=SunSASL \ No newline at end of file diff --git a/test/jdk/java/security/Security/signedfirst/DynStatic.java b/test/jdk/java/security/Security/signedfirst/DynStatic.java index 59e30de54623f..17fab4cac5bfa 100644 --- a/test/jdk/java/security/Security/signedfirst/DynStatic.java +++ b/test/jdk/java/security/Security/signedfirst/DynStatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, 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 @@ -33,7 +33,6 @@ import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; import jdk.test.lib.compiler.CompilerUtils; import jdk.test.lib.process.ProcessTools; @@ -52,9 +51,8 @@ public class DynStatic { Paths.get(TEST_SRC, "DynSignedProvFirst.java"); private static final Path STATIC_SRC = Paths.get(TEST_SRC, "StaticSignedProvFirst.java"); - - private static final String STATIC_PROPS = - Paths.get(TEST_SRC, "Static.props").toString(); + private static final Path STATIC_PROPS = + Paths.get(TEST_SRC, "Static.props"); public static void main(String[] args) throws Exception { @@ -89,7 +87,7 @@ public static void main(String[] args) throws Exception { // Run the StaticSignedProvFirst test program ProcessTools.executeTestJava("-classpath", TEST_CLASSES.toString() + File.pathSeparator + "exp.jar", - "-Djava.security.properties=file:" + STATIC_PROPS, + "-Djava.security.properties=" + STATIC_PROPS.toUri(), "StaticSignedProvFirst") .shouldContain("test passed"); } diff --git a/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java index 4336377e0c898..3a5430d0573e8 100644 --- a/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java +++ b/test/jdk/java/util/zip/ZipFile/CenSizeTooLarge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, 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,9 +34,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.FileChannel; -import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; -import java.util.Arrays; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -46,6 +44,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public class CenSizeTooLarge { + + // Entry names produced in this test are fixed-length + public static final int NAME_LENGTH = 10; + // Maximum allowed CEN size allowed by the ZipFile implementation static final int MAX_CEN_SIZE = Integer.MAX_VALUE - ZipFile.ENDHDR - 1; @@ -59,11 +61,10 @@ public class CenSizeTooLarge { * fields respectively. The combined length of any * directory record and these three fields SHOULD NOT * generally exceed 65,535 bytes. - * - * Since ZipOutputStream does not enforce the 'combined length' clause, - * we simply use 65,535 (0xFFFF) for the purpose of this test. + *. + * Create a maximum extra field which does not exceed 65,535 bytes */ - static final int MAX_EXTRA_FIELD_SIZE = 65_535; + static final int MAX_EXTRA_FIELD_SIZE = 65_535 - ZipFile.CENHDR - NAME_LENGTH; // Data size (unsigned short) // Field size minus the leading header 'tag' and 'data size' fields (2 bytes each) @@ -72,9 +73,6 @@ public class CenSizeTooLarge { // Tag for the 'unknown' field type, specified in APPNOTE.txt 'Third party mappings' static final short UNKNOWN_ZIP_TAG = (short) 0x9902; - // Entry names produced in this test are fixed-length - public static final int NAME_LENGTH = 10; - // Use a shared LocalDateTime on all entries to save processing time static final LocalDateTime TIME_LOCAL = LocalDateTime.now(); @@ -84,16 +82,16 @@ public class CenSizeTooLarge { // The number of entries needed to exceed the MAX_CEN_SIZE static final int NUM_ENTRIES = (MAX_CEN_SIZE / CEN_HEADER_SIZE) + 1; - // Helps SparseOutputStream detect write of the last CEN entry - private static final String LAST_CEN_COMMENT = "LastCEN"; - private static final byte[] LAST_CEN_COMMENT_BYTES = LAST_CEN_COMMENT.getBytes(StandardCharsets.UTF_8); - // Expected ZipException message when the CEN does not fit in a Java byte array private static final String CEN_TOO_LARGE_MESSAGE = "invalid END header (central directory size too large)"; // Zip file to create for testing private File hugeZipFile; + private static final byte[] EXTRA_BYTES = makeLargeExtraField(); + // Helps SparseOutputStream detect write of the last CEN entry + private static final byte[] LAST_EXTRA_BYTES = makeLargeExtraField(); + /** * Create a zip file with a CEN size which does not fit within a Java byte array */ @@ -125,23 +123,18 @@ public void setup() throws IOException { // Set the time/date field for faster processing entry.setTimeLocal(TIME_LOCAL); - if (i == NUM_ENTRIES -1) { - // Help SparseOutputStream detect the last CEN entry write - entry.setComment(LAST_CEN_COMMENT); - } // Add the entry zip.putNextEntry(entry); - - } // Finish writing the last entry zip.closeEntry(); // Before the CEN headers are written, set the extra data on each entry - byte[] extra = makeLargeExtraField(); for (ZipEntry entry : entries) { - entry.setExtra(extra); + entry.setExtra(EXTRA_BYTES); } + // Help SparseOutputSream detect the last entry + entries[entries.length-1].setExtra(LAST_EXTRA_BYTES); } } @@ -165,7 +158,7 @@ public void centralDirectoryTooLargeToFitInByteArray() { * Data Size (Two byte short) * Data Block (Contents depend on field type) */ - private byte[] makeLargeExtraField() { + private static byte[] makeLargeExtraField() { // Make a maximally sized extra field byte[] extra = new byte[MAX_EXTRA_FIELD_SIZE]; // Little-endian ByteBuffer for updating the header fields @@ -203,7 +196,7 @@ public void write(byte[] b, int off, int len) throws IOException { // but instead simply advance the position, creating a sparse file channel.position(position); // Check for last CEN record - if (Arrays.equals(LAST_CEN_COMMENT_BYTES, 0, LAST_CEN_COMMENT_BYTES.length, b, off, len)) { + if (b == LAST_EXTRA_BYTES) { // From here on, write actual bytes sparse = false; } diff --git a/test/jdk/java/util/zip/ZipOutputStream/ZipOutputStreamMaxCenHdrTest.java b/test/jdk/java/util/zip/ZipOutputStream/ZipOutputStreamMaxCenHdrTest.java new file mode 100644 index 0000000000000..286e043c2256f --- /dev/null +++ b/test/jdk/java/util/zip/ZipOutputStream/ZipOutputStreamMaxCenHdrTest.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8336025 + * @summary Verify that ZipOutputStream throws a ZipException when the + * CEN header size + name length + comment length + extra length exceeds + * 65,535 bytes + * @run junit ZipOutputStreamMaxCenHdrTest + */ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.*; + +public class ZipOutputStreamMaxCenHdrTest { + + // CEN header size + name length + comment length + extra length + // should not exceed 65,535 bytes per the PKWare APP.NOTE + // 4.4.10, 4.4.11, & 4.4.12. + static final int MAX_COMBINED_CEN_HEADER_SIZE = 0xFFFF; + + // Maximum possible size of name length + comment length + extra length + // for entries in order to not exceed 65,489 bytes minus 46 bytes for the CEN + // header length + static final int MAX_NAME_COMMENT_EXTRA_SIZE = + MAX_COMBINED_CEN_HEADER_SIZE - ZipFile.CENHDR; + + // Tag for the 'unknown' field type, specified in APPNOTE.txt 'Third party mappings' + static final short UNKNOWN_ZIP_TAG = (short) 0x9902; + + // ZIP file to be used by the tests + static final Path ZIP_FILE = Path.of("maxCENHdrTest.zip"); + + /** + * Clean up prior to test run + * + * @throws IOException if an error occurs + */ + @BeforeEach + public void startUp() throws IOException { + Files.deleteIfExists(ZIP_FILE); + } + + /** + * Validate a ZipException is thrown when the combined CEN Header, name + * length, comment length, and extra data length exceeds 65,535 bytes when + * the ZipOutputStream is closed. + */ + @ParameterizedTest + @ValueSource(ints = {MAX_COMBINED_CEN_HEADER_SIZE, + MAX_COMBINED_CEN_HEADER_SIZE - 1, + MAX_NAME_COMMENT_EXTRA_SIZE, + MAX_NAME_COMMENT_EXTRA_SIZE - 1}) + void setCommentTest(int length) throws IOException { + boolean expectZipException = length > MAX_NAME_COMMENT_EXTRA_SIZE; + final byte[] bytes = new byte[length]; + Arrays.fill(bytes, (byte) 'a'); + ZipEntry zipEntry = new ZipEntry(""); + // The comment length will trigger the ZipException + zipEntry.setComment(new String(bytes, StandardCharsets.UTF_8)); + boolean receivedException = writeZipEntry(zipEntry, expectZipException); + assertEquals(receivedException, expectZipException); + } + + /** + * Validate an ZipException is thrown when the combined CEN Header, name + * length, comment length, and extra data length exceeds 65,535 bytes when + * the ZipOutputStream is closed. + */ + @ParameterizedTest + @ValueSource(ints = {MAX_COMBINED_CEN_HEADER_SIZE, + MAX_COMBINED_CEN_HEADER_SIZE - 1, + MAX_NAME_COMMENT_EXTRA_SIZE, + MAX_NAME_COMMENT_EXTRA_SIZE - 1}) + void setNameTest(int length) throws IOException { + boolean expectZipException = length > MAX_NAME_COMMENT_EXTRA_SIZE; + final byte[] bytes = new byte[length]; + Arrays.fill(bytes, (byte) 'a'); + // The name length will trigger the ZipException + ZipEntry zipEntry = new ZipEntry(new String(bytes, StandardCharsets.UTF_8)); + boolean receivedException = writeZipEntry(zipEntry, expectZipException); + assertEquals(receivedException, expectZipException); + } + + /** + * Validate an ZipException is thrown when the combined CEN Header, name + * length, comment length, and extra data length exceeds 65,535 bytes when + * the ZipOutputStream is closed. + */ + @ParameterizedTest + @ValueSource(ints = {MAX_COMBINED_CEN_HEADER_SIZE, + MAX_COMBINED_CEN_HEADER_SIZE - 1, + MAX_NAME_COMMENT_EXTRA_SIZE, + MAX_NAME_COMMENT_EXTRA_SIZE - 1}) + void setExtraTest(int length) throws IOException { + boolean expectZipException = length > MAX_NAME_COMMENT_EXTRA_SIZE; + final byte[] bytes = new byte[length]; + // Little-endian ByteBuffer for updating the header fields + ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); + // We use the 'unknown' tag, specified in APPNOTE.TXT, 4.6.1 Third party mappings' + buffer.putShort(UNKNOWN_ZIP_TAG); + // Size of the actual (empty) data + buffer.putShort((short) (length - 2 * Short.BYTES)); + ZipEntry zipEntry = new ZipEntry(""); + // The extra data length will trigger the ZipException + zipEntry.setExtra(bytes); + boolean receivedException = writeZipEntry(zipEntry, expectZipException); + assertEquals(receivedException, expectZipException); + } + + /** + * Write a single Zip entry using ZipOutputStream + * @param zipEntry the ZipEntry to write + * @param expectZipException true if a ZipException is expected, false otherwse + * @return true if a ZipException was thrown + * @throws IOException if an error occurs + */ + private static boolean writeZipEntry(ZipEntry zipEntry, boolean expectZipException) + throws IOException { + boolean receivedException = false; + try (ZipOutputStream zos = new ZipOutputStream( + new BufferedOutputStream(Files.newOutputStream(ZIP_FILE)))) { + zos.putNextEntry(zipEntry); + if (expectZipException) { + ZipException ex = assertThrows(ZipException.class, zos::close); + assertTrue(ex.getMessage().matches(".*bad header size.*"), + "Unexpected ZipException message: " + ex.getMessage()); + receivedException = true; + } + } catch (Exception e) { + throw new RuntimeException("Received Unexpected Exception", e); + } + return receivedException; + } +} diff --git a/test/jdk/javax/management/ObjectName/SerialCompatRemovedTest.java b/test/jdk/javax/management/ObjectName/SerialCompatRemovedTest.java new file mode 100644 index 0000000000000..3a63e5934722e --- /dev/null +++ b/test/jdk/javax/management/ObjectName/SerialCompatRemovedTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8334165 + * @summary Test that jmx.serial.form is not recognised. + * + * @run main/othervm -Djmx.serial.form=1.0 SerialCompatRemovedTest + * @run main/othervm SerialCompatRemovedTest + */ + +import java.io.*; +import java.util.*; +import javax.management.ObjectName; + +public class SerialCompatRemovedTest { + + public static void main(String[] args) throws Exception { + ObjectStreamClass osc = ObjectStreamClass.lookup(ObjectName.class); + // Serial form has no fields, uses writeObject, so we should never see + // non-zero field count here: + if (osc.getFields().length != 0) { + throw new Exception("ObjectName using old serial form?: fields: " + + Arrays.asList(osc.getFields())); + } + } +} + diff --git a/test/jdk/javax/management/ObjectName/SerialCompatTest.java b/test/jdk/javax/management/ObjectName/SerialCompatTest.java deleted file mode 100644 index 14b8720987bbd..0000000000000 --- a/test/jdk/javax/management/ObjectName/SerialCompatTest.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6211220 6616825 - * @summary Test that jmx.serial.form=1.0 works for ObjectName - * @author Eamonn McManus, Daniel Fuchs - * - * @run clean SerialCompatTest - * @run build SerialCompatTest - * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true -Djmx.serial.form=1.0 SerialCompatTest - */ - -import java.io.*; -import java.util.*; -import javax.management.ObjectName; - -public class SerialCompatTest { - - public static void check6211220() throws Exception { - - ObjectName on = new ObjectName("a:b=c"); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(on); - oos.close(); - byte[] bytes = bos.toByteArray(); - ByteArrayInputStream bis = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(bis); - ObjectName on1 = (ObjectName) ois.readObject(); - - // if the bug is present, these will get NullPointerException - for (int i = 0; i <= 11; i++) { - String msg = "6211220 case(" + i + ")"; - try { - switch (i) { - case 0: - check(msg, on1.getDomain().equals("a")); - break; - case 1: - check(msg, on1.getCanonicalName().equals("a:b=c")); - break; - case 2: - check(msg, on1.getKeyPropertyListString() - .equals("b=c")); - break; - case 3: - check(msg, on1.getCanonicalKeyPropertyListString() - .equals("b=c")); - break; - case 4: - check(msg, on1.getKeyProperty("b").equals("c")); - break; - case 5: - check(msg, on1.getKeyPropertyList() - .equals(Collections.singletonMap("b", "c"))); - break; - case 6: - check(msg, !on1.isDomainPattern()); - break; - case 7: - check(msg, !on1.isPattern()); - break; - case 8: - check(msg, !on1.isPropertyPattern()); - break; - case 9: - check(msg, on1.equals(on)); - break; - case 10: - check(msg, on.equals(on1)); - break; - case 11: - check(msg, on1.apply(on)); - break; - default: - throw new Exception(msg + ": Test incorrect"); - } - } catch (Exception e) { - System.out.println(msg + ": Test failed with exception:"); - e.printStackTrace(System.out); - failed = true; - } - } - - if (failed) { - throw new Exception("Some tests for 6211220 failed"); - } else { - System.out.println("All tests for 6211220 passed"); - } - } - - static void checkName(String testname, ObjectName on) - throws Exception { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(on); - oos.close(); - byte[] bytes = bos.toByteArray(); - ByteArrayInputStream bis = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(bis); - ObjectName on1 = (ObjectName) ois.readObject(); - // if the bug is present, these will get NullPointerException - for (int i = 0; i <= 11; i++) { - String msg = testname + " case(" + i + ")"; - try { - switch (i) { - case 0: - check(msg, on1.getDomain().equals(on.getDomain())); - break; - case 1: - check(msg, on1.getCanonicalName(). - equals(on.getCanonicalName())); - break; - case 2: - check(msg, on1.getKeyPropertyListString(). - equals(on.getKeyPropertyListString())); - break; - case 3: - check(msg, on1.getCanonicalKeyPropertyListString(). - equals(on.getCanonicalKeyPropertyListString())); - break; - case 4: - for (Object ko : on1.getKeyPropertyList().keySet()) { - final String key = (String) ko; - check(msg, on1.getKeyProperty(key). - equals(on.getKeyProperty(key))); - } - for (Object ko : on.getKeyPropertyList().keySet()) { - final String key = (String) ko; - check(msg, on1.getKeyProperty(key). - equals(on.getKeyProperty(key))); - } - case 5: - check(msg, on1.getKeyPropertyList() - .equals(on.getKeyPropertyList())); - break; - case 6: - check(msg, on1.isDomainPattern()==on.isDomainPattern()); - break; - case 7: - check(msg, on1.isPattern() == on.isPattern()); - break; - case 8: - check(msg, - on1.isPropertyPattern()==on.isPropertyPattern()); - break; - case 9: - check(msg, on1.equals(on)); - break; - case 10: - check(msg, on.equals(on1)); - break; - case 11: - if (!on.isPattern()) { - check(msg, on1.apply(on)); - } - break; - default: - throw new Exception("Test incorrect: case: " + i); - } - } catch (Exception e) { - System.out.println("Test (" + i + ") failed with exception:"); - e.printStackTrace(System.out); - failed = true; - } - } - - } - private static String[] names6616825 = { - "a:b=c", "a:b=c,*", "*:*", ":*", ":b=c", ":b=c,*", - "a:*,b=c", ":*", ":*,b=c", "*x?:k=\"x\\*z\"", "*x?:k=\"x\\*z\",*", - "*x?:*,k=\"x\\*z\"", "*x?:k=\"x\\*z\",*,b=c" - }; - - static void check6616825() throws Exception { - System.out.println("Testing 616825"); - for (String n : names6616825) { - final ObjectName on; - try { - on = new ObjectName(n); - } catch (Exception x) { - failed = true; - System.out.println("Unexpected failure for 6616825 [" + n + - "]: " + x); - x.printStackTrace(System.out); - continue; - } - try { - checkName("616825 " + n, on); - } catch (Exception x) { - failed = true; - System.out.println("6616825 failed for [" + n + "]: " + x); - x.printStackTrace(System.out); - } - } - - if (failed) { - throw new Exception("Some tests for 6616825 failed"); - } else { - System.out.println("All tests for 6616825 passed"); - } - } - - public static void main(String[] args) throws Exception { - /* Check that we really are in jmx.serial.form=1.0 mode. - The property is frozen the first time the ObjectName class - is referenced so checking that it is set to the correct - value now is not enough. */ - ObjectStreamClass osc = ObjectStreamClass.lookup(ObjectName.class); - if (osc.getFields().length != 6) { - throw new Exception("Not using old serial form: fields: " + - Arrays.asList(osc.getFields())); - // new serial form has no fields, uses writeObject - } - - try { - check6211220(); - } catch (Exception x) { - System.err.println(x.getMessage()); - } - try { - check6616825(); - } catch (Exception x) { - System.err.println(x.getMessage()); - } - - if (failed) { - throw new Exception("Some tests failed"); - } else { - System.out.println("All tests passed"); - } - } - - private static void check(String msg, boolean condition) { - if (!condition) { - new Throwable("Test failed " + msg).printStackTrace(System.out); - failed = true; - } - } - private static boolean failed; -} diff --git a/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java b/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java index 4ec95fb75354e..c16fe0e5a8225 100644 --- a/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java +++ b/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java @@ -36,7 +36,7 @@ * @summary Tests custom class loader cleanup * @library /javax/swing/regtesthelpers * @build Util - * @run main/timeout=60/othervm -mx32m FlushCustomClassLoader + * @run main/timeout=60/othervm -Xmx32m FlushCustomClassLoader */ public final class FlushCustomClassLoader { diff --git a/test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java b/test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java index c287ee061dbc8..cb0875a532021 100644 --- a/test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java +++ b/test/jdk/javax/sound/sampled/Clip/AudioContentHandlers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -46,7 +46,7 @@ * @test * @bug 8204454 * @summary URL.getContent() should return AudioClip for supported formats - * @run main/othervm -mx128m AudioContentHandlers + * @run main/othervm -Xmx128m AudioContentHandlers */ public final class AudioContentHandlers { diff --git a/test/jdk/javax/swing/JFileChooser/6396844/TwentyThousandTest.java b/test/jdk/javax/swing/JFileChooser/6396844/TwentyThousandTest.java index afc2fc41bc4d3..757d21278b1a9 100644 --- a/test/jdk/javax/swing/JFileChooser/6396844/TwentyThousandTest.java +++ b/test/jdk/javax/swing/JFileChooser/6396844/TwentyThousandTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -30,7 +30,7 @@ * @library ../../regtesthelpers * @modules java.desktop/sun.java2d * @build Util - * @run main/othervm/timeout=1000 -mx128m TwentyThousandTest + * @run main/othervm/timeout=1000 -Xmx128m TwentyThousandTest */ import sun.java2d.Disposer; diff --git a/test/jdk/javax/swing/JOptionPane/6464022/bug6464022.java b/test/jdk/javax/swing/JOptionPane/6464022/bug6464022.java index 8b3a8a07531d7..152bc7eecbfa9 100644 --- a/test/jdk/javax/swing/JOptionPane/6464022/bug6464022.java +++ b/test/jdk/javax/swing/JOptionPane/6464022/bug6464022.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, 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 @@ -29,7 +29,7 @@ * @author Pavel Porvatov * @library ../../regtesthelpers * @build Util - * @run main/othervm -mx128m bug6464022 + * @run main/othervm -Xmx128m bug6464022 */ import javax.swing.*; diff --git a/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java b/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java index c3bb610bb871e..d6cd1fddaa6d5 100644 --- a/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java +++ b/test/jdk/javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -225,7 +225,7 @@ private static void test(Object[] listeners) { private static Process runProcess(LookAndFeelInfo laf) throws Exception { ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( - "-Dswing.defaultlaf=" + laf.getClassName(), "-mx9m", + "-Dswing.defaultlaf=" + laf.getClassName(), "-Xmx9m", "-XX:+HeapDumpOnOutOfMemoryError", UnninstallUIMemoryLeaks.class.getSimpleName(), "mark"); return ProcessTools.startProcess(laf.getName(), pb); diff --git a/test/jdk/javax/swing/UIDefaults/6795356/bug6795356.java b/test/jdk/javax/swing/UIDefaults/6795356/bug6795356.java index 7be773a2c630d..7ff527cc19dda 100644 --- a/test/jdk/javax/swing/UIDefaults/6795356/bug6795356.java +++ b/test/jdk/javax/swing/UIDefaults/6795356/bug6795356.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024, 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 @@ -28,7 +28,7 @@ * @author Alexander Potochkin * @library ../../regtesthelpers * @build Util - * @run main/othervm -mx128m bug6795356 + * @run main/othervm -Xmx128m bug6795356 */ import java.lang.ref.WeakReference; diff --git a/test/jdk/javax/swing/border/TestTitledBorderLeak.java b/test/jdk/javax/swing/border/TestTitledBorderLeak.java index 259a2f60c29df..ea7c1e2a2fd3e 100644 --- a/test/jdk/javax/swing/border/TestTitledBorderLeak.java +++ b/test/jdk/javax/swing/border/TestTitledBorderLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2024, 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 @@ -32,7 +32,7 @@ * @summary Verifies TitledBorder's memory leak * @library /javax/swing/regtesthelpers * @build Util - * @run main/timeout=60/othervm -mx32m TestTitledBorderLeak + * @run main/timeout=60/othervm -Xmx32m TestTitledBorderLeak */ public final class TestTitledBorderLeak { diff --git a/test/jdk/javax/swing/regtesthelpers/Util.java b/test/jdk/javax/swing/regtesthelpers/Util.java index 4724fa200d607..5f81384028e8d 100644 --- a/test/jdk/javax/swing/regtesthelpers/Util.java +++ b/test/jdk/javax/swing/regtesthelpers/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, 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 @@ -82,7 +82,7 @@ public static boolean compareBufferedImages(BufferedImage bufferedImage0, Buffer /** * Fills the heap until OutOfMemoryError occurs. This method is useful for * WeakReferences removing. To minimize the amount of filled memory the - * test should provide reasonable heap size via -mx option. + * test should provide reasonable heap size via -Xmx option. */ public static void generateOOME() { List bigLeak = new LinkedList(); diff --git a/test/jdk/jdk/classfile/ConstantDescSymbolsTest.java b/test/jdk/jdk/classfile/ConstantDescSymbolsTest.java index 7c97c9dd5a9b1..b5d3ba5d584fb 100644 --- a/test/jdk/jdk/classfile/ConstantDescSymbolsTest.java +++ b/test/jdk/jdk/classfile/ConstantDescSymbolsTest.java @@ -23,11 +23,14 @@ /* * @test - * @bug 8304031 8338406 + * @bug 8304031 8338406 8338546 * @summary Testing handling of various constant descriptors in ClassFile API. + * @modules java.base/jdk.internal.constant + * java.base/jdk.internal.classfile.impl * @run junit ConstantDescSymbolsTest */ +import java.lang.classfile.constantpool.ConstantPoolBuilder; import java.lang.constant.ClassDesc; import java.lang.constant.DynamicConstantDesc; import java.lang.constant.MethodHandleDesc; @@ -36,8 +39,14 @@ import java.lang.invoke.MethodType; import java.util.function.Supplier; import java.lang.classfile.ClassFile; +import java.util.stream.Stream; + +import jdk.internal.classfile.impl.AbstractPoolEntry; +import jdk.internal.constant.ConstantUtils; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import static java.lang.classfile.ClassFile.ACC_PUBLIC; import static java.lang.constant.ConstantDescs.*; @@ -102,4 +111,58 @@ record CondyBoot(MethodHandles.Lookup lookup, String name, Class type) {} assertEquals(DEFAULT_NAME, cb.name); assertEquals(CondyBoot.class, cb.type); } + + static Stream classOrInterfaceEntries() { + return Stream.of( + CD_Object, CD_Float, CD_Long, CD_String, ClassDesc.of("Ape"), + CD_String.nested("Whatever"), CD_MethodHandles_Lookup, ClassDesc.ofInternalName("one/Two"), + ClassDesc.ofDescriptor("La/b/C;"), ConstantDescSymbolsTest.class.describeConstable().orElseThrow(), + CD_Boolean, CD_ConstantBootstraps, CD_MethodHandles + ); + } + + @ParameterizedTest + @MethodSource("classOrInterfaceEntries") + void testConstantPoolBuilderClassOrInterfaceEntry(ClassDesc cd) { + assertTrue(cd.isClassOrInterface()); + ConstantPoolBuilder cp = ConstantPoolBuilder.of(); + var internal = ConstantUtils.dropFirstAndLastChar(cd.descriptorString()); + + // 1. ClassDesc + var ce = cp.classEntry(cd); + assertSame(cd, ce.asSymbol(), "Symbol propagation on create"); + + // 1.1. Bare addition + assertTrue(ce.name().equalsString(internal), "Adding to bare pool"); + + // 1.2. Lookup existing + assertSame(ce, cp.classEntry(cd), "Finding by identical CD"); + + // 1.3. Lookup existing - equal but different ClassDesc + var cd1 = ClassDesc.ofDescriptor(cd.descriptorString()); + assertSame(ce, cp.classEntry(cd1), "Finding by another equal CD"); + + // 1.3.1. Lookup existing - equal but different ClassDesc, equal but different string + var cd2 = ClassDesc.ofDescriptor("" + cd.descriptorString()); + assertSame(ce, cp.classEntry(cd2), "Finding by another equal CD"); + + // 1.4. Lookup existing - with utf8 internal name + var utf8 = cp.utf8Entry(internal); + assertSame(ce, cp.classEntry(utf8), "Finding CD by UTF8"); + + // 2. ClassEntry exists, no ClassDesc + cp = ConstantPoolBuilder.of(); + utf8 = cp.utf8Entry(internal); + ce = cp.classEntry(utf8); + var found = cp.classEntry(cd); + assertSame(ce, found, "Finding non-CD CEs with CD"); + assertEquals(cd, ce.asSymbol(), "Symbol propagation on find"); + + // 3. Utf8Entry exists, no ClassEntry + cp = ConstantPoolBuilder.of(); + utf8 = cp.utf8Entry(internal); + ce = cp.classEntry(cd); + assertSame(utf8, ce.name(), "Reusing existing utf8 entry"); + assertEquals(cd, ce.asSymbol(), "Symbol propagation on create with utf8"); + } } diff --git a/test/jdk/jdk/classfile/OptionsTest.java b/test/jdk/jdk/classfile/OptionsTest.java index fda155cfd2a4b..4c9525f0f7f45 100644 --- a/test/jdk/jdk/classfile/OptionsTest.java +++ b/test/jdk/jdk/classfile/OptionsTest.java @@ -62,7 +62,7 @@ static Path[] corpus() throws IOException, URISyntaxException { @MethodSource("corpus") void testAttributesProcessingOptionOnTransform(Path path) throws Exception { testNoUnstable(path, ClassFile.of().parse( - ClassFile.of(ClassFile.AttributesProcessingOption.DROP_UNSTABLE_ATRIBUTES).transformClass( + ClassFile.of(ClassFile.AttributesProcessingOption.DROP_UNSTABLE_ATTRIBUTES).transformClass( ClassFile.of().parse(path), ClassTransform.transformingMethodBodies(CodeTransform.ACCEPT_ALL)))); } diff --git a/test/jdk/jdk/classfile/UtilTest.java b/test/jdk/jdk/classfile/UtilTest.java index d9d8240ae9149..be66d9305808c 100644 --- a/test/jdk/jdk/classfile/UtilTest.java +++ b/test/jdk/jdk/classfile/UtilTest.java @@ -23,18 +23,25 @@ /* * @test + * @bug 8338546 * @summary Testing ClassFile Util. + * @library java.base + * @modules java.base/jdk.internal.constant + * java.base/jdk.internal.classfile.impl + * @build java.base/jdk.internal.classfile.impl.* * @run junit UtilTest */ -import java.lang.classfile.ClassFile; import java.lang.classfile.Opcode; import java.lang.constant.MethodTypeDesc; -import java.lang.invoke.MethodHandles; import java.util.Arrays; -import java.util.BitSet; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; + import jdk.internal.classfile.impl.RawBytecodeHelper; import jdk.internal.classfile.impl.Util; +import jdk.internal.classfile.impl.UtilAccess; +import jdk.internal.constant.ConstantUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -84,6 +91,50 @@ private void assertSlots(String methodDesc, int slots) { assertEquals(Util.parameterSlots(MethodTypeDesc.ofDescriptor(methodDesc)), slots); } + @Test + void testPow31() { + int p = 1; + // Our calculation only prepares up to 65536, + // max length of CP Utf8 + 1 + for (int i = 0; i <= 65536; i++) { + final int t = i; + assertEquals(p, Util.pow31(i), () -> "31's power to " + t); + p *= 31; + } + } + + @ParameterizedTest + @ValueSource(classes = { + Long.class, + Object.class, + Util.class, + Test.class, + CopyOnWriteArrayList.class, + AtomicReferenceFieldUpdater.class + }) + void testInternalNameHash(Class type) { + var cd = type.describeConstable().orElseThrow(); + assertEquals(ConstantUtils.binaryToInternal(type.getName()).hashCode(), Util.internalNameHash(cd.descriptorString())); + } + + // Ensures the initialization statement of the powers array is filling in the right values + @Test + void testPowersArray() { + int[] powers = new int[7 * UtilAccess.significantOctalDigits()]; + for (int i = 1, k = 31; i <= 7; i++, k *= 31) { + int t = powers[UtilAccess.powersIndex(i, 0)] = k; + + for (int j = 1; j < UtilAccess.significantOctalDigits(); j++) { + t *= t; + t *= t; + t *= t; + powers[UtilAccess.powersIndex(i, j)] = t; + } + } + + assertArrayEquals(powers, UtilAccess.powersTable()); + } + @Test void testOpcodeLengthTable() { var lengths = new byte[0x100]; diff --git a/test/jdk/jdk/classfile/java.base/jdk/internal/classfile/impl/UtilAccess.java b/test/jdk/jdk/classfile/java.base/jdk/internal/classfile/impl/UtilAccess.java new file mode 100644 index 0000000000000..27cefd6d9441a --- /dev/null +++ b/test/jdk/jdk/classfile/java.base/jdk/internal/classfile/impl/UtilAccess.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.classfile.impl; + +public final class UtilAccess { + public static int significantOctalDigits() { + return Util.SIGNIFICANT_OCTAL_DIGITS; + } + + public static int powersIndex(int digit, int index) { + return Util.powersIndex(digit, index); + } + + public static int[] powersTable() { + return Util.powers; + } + + public static int reverse31() { + return Util.INVERSE_31; + } +} diff --git a/test/jdk/jdk/internal/vm/Continuation/Scoped.java b/test/jdk/jdk/internal/vm/Continuation/Scoped.java index b034243d596de..1bad8e4aebd00 100644 --- a/test/jdk/jdk/internal/vm/Continuation/Scoped.java +++ b/test/jdk/jdk/internal/vm/Continuation/Scoped.java @@ -74,27 +74,27 @@ public void test1() { frames = cont.stackWalker().walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("No scope: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); frames = cont.stackWalker(EnumSet.noneOf(StackWalker.Option.class), A).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("A: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); frames = cont.stackWalker(EnumSet.noneOf(StackWalker.Option.class), B).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("B: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$8", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$0", "run", "enter0", "enter")); frames = cont.stackWalker(EnumSet.noneOf(StackWalker.Option.class), C).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("C: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter")); frames = cont.stackWalker(EnumSet.noneOf(StackWalker.Option.class), K).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("K: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); frames = cont.stackWalker(EnumSet.noneOf(StackWalker.Option.class), null).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); System.out.println("null: " + frames); - assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$14", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); + assertEquals(frames, cont.isDone() ? List.of() : Arrays.asList("yield0", "yield", "lambda$bar$0", "run", "enter0", "enter", "yield0", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "yield0", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); } assertEquals(res.get(), 2); } @@ -119,23 +119,23 @@ static String bar(long b) { List frames = StackWalker.getInstance().walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); - assertEquals(frames.subList(0, 18), Arrays.asList("lambda$bar$14", "run", "enter0", "enter", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter", "run", "test1")); + assertEquals(frames.subList(0, 18), Arrays.asList("lambda$bar$0", "run", "enter0", "enter", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter", "run", "test1")); frames = StackWalkerHelper.getInstance(C).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); - assertEquals(frames, Arrays.asList("lambda$bar$14", "run", "enter0", "enter")); + assertEquals(frames, Arrays.asList("lambda$bar$0", "run", "enter0", "enter")); frames = StackWalkerHelper.getInstance(B).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); - assertEquals(frames, Arrays.asList("lambda$bar$14", "run", "enter0", "enter", "run", "bar", "lambda$foo$8", "run", "enter0", "enter")); + assertEquals(frames, Arrays.asList("lambda$bar$0", "run", "enter0", "enter", "run", "bar", "lambda$foo$0", "run", "enter0", "enter")); frames = StackWalkerHelper.getInstance(A).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); - assertEquals(frames, Arrays.asList("lambda$bar$14", "run", "enter0", "enter", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); + assertEquals(frames, Arrays.asList("lambda$bar$0", "run", "enter0", "enter", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter")); frames = StackWalkerHelper.getInstance(K).walk(fs -> fs.map(StackWalker.StackFrame::getMethodName).collect(Collectors.toList())); - assertEquals(frames.subList(0, 18), Arrays.asList("lambda$bar$14", "run", "enter0", "enter", "run", "bar", "lambda$foo$8", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter", "run", "test1")); + assertEquals(frames.subList(0, 18), Arrays.asList("lambda$bar$0", "run", "enter0", "enter", "run", "bar", "lambda$foo$0", "run", "enter0", "enter", "run", "foo", "lambda$test1$0", "run", "enter0", "enter", "run", "test1")); long r = b+1; }); diff --git a/test/jdk/jdk/jfr/event/compiler/TestDeoptimization.java b/test/jdk/jdk/jfr/event/compiler/TestDeoptimization.java index 32c634fc59a90..daf562a765fbe 100644 --- a/test/jdk/jdk/jfr/event/compiler/TestDeoptimization.java +++ b/test/jdk/jdk/jfr/event/compiler/TestDeoptimization.java @@ -53,6 +53,7 @@ public static void dummyMethod(boolean b) { * @requires vm.hasJFR * @requires vm.compMode != "Xint" * @requires vm.flavor == "server" & (vm.opt.TieredStopAtLevel == 4 | vm.opt.TieredStopAtLevel == null) + * @requires vm.opt.StressUnstableIfTraps == null | !vm.opt.StressUnstableIfTraps * @library /test/lib * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff --git a/test/jdk/sun/awt/image/BytePackedRaster/DitherTest.java b/test/jdk/sun/awt/image/BytePackedRaster/DitherTest.java new file mode 100644 index 0000000000000..29b42b49fe778 --- /dev/null +++ b/test/jdk/sun/awt/image/BytePackedRaster/DitherTest.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4184283 + * @summary Checks rendering of dithered byte packed image does not crash. + */ + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.IndexColorModel; +import java.awt.image.MemoryImageSource; +import java.awt.image.WritableRaster; + +public class DitherTest extends Component { + + final static int NOOP = 0; + final static int RED = 1; + final static int GREEN = 2; + final static int BLUE = 3; + final static int ALPHA = 4; + final static int SATURATION = 5; + + final static byte red[] = {(byte)0, (byte)132, (byte)0, (byte)132, (byte)0, (byte)132, + (byte)0, (byte)198, (byte)198, (byte)165, (byte)255, (byte)165, (byte)132, + (byte)255, (byte)0, (byte)255}; + + final static byte green[] = {(byte)0, (byte)0, (byte)130, (byte)130, (byte)0, + (byte)0, (byte)130, (byte)195, (byte)223, (byte)203, (byte)251, (byte)162, + (byte)132, (byte)0, (byte)255, (byte)255}; + + final static byte blue[] = {(byte)0, (byte)0, (byte)0, (byte)0, (byte)132, (byte)132, + (byte)132, (byte)198, (byte)198, (byte)247, (byte)247, (byte)165, (byte)132, + (byte)0, (byte)0, (byte)0}; + + static IndexColorModel cm16 = new IndexColorModel( 4, 16, red, green, blue); + + + public static void main(String args[]) { + + int imageWidth = 256; + int imageHeight = 256; + WritableRaster raster = cm16.createCompatibleWritableRaster(imageWidth, imageHeight); + BufferedImage intermediateImage = new BufferedImage(cm16, raster, false, null); + Image calculatedImage = calculateImage(); + + Graphics2D ig = intermediateImage.createGraphics(); + // Clear background and fill a red rectangle just to prove that we can draw on intermediateImage + ig.setColor(Color.white); + ig.fillRect(0,0,imageWidth,imageHeight); + ig.drawImage(calculatedImage, 0, 0, imageWidth, imageHeight, null); + ig.setColor(Color.red); + ig.fillRect(0,0,5,5); + + BufferedImage destImage = new BufferedImage(imageWidth, imageWidth, BufferedImage.TYPE_INT_RGB); + Graphics2D dg = destImage.createGraphics(); + dg.drawImage(intermediateImage, 0, 0, imageWidth, imageHeight, null); + } + + private static void applymethod(int c[], int method, int step, int total, int vals[]) { + if (method == NOOP) + return; + int val = ((total < 2) + ? vals[0] + : vals[0] + ((vals[1] - vals[0]) * step / (total - 1))); + switch (method) { + case RED: + c[0] = val; + break; + case GREEN: + c[1] = val; + break; + case BLUE: + c[2] = val; + break; + case ALPHA: + c[3] = val; + break; + case SATURATION: + int max = Math.max(Math.max(c[0], c[1]), c[2]); + int min = max * (255 - val) / 255; + if (c[0] == 0) c[0] = min; + if (c[1] == 0) c[1] = min; + if (c[2] == 0) c[2] = min; + break; + } + } + + private static Image calculateImage() { + + int xvals[] = { 0, 255 }; + int yvals[] = { 0, 255 }; + int xmethod = RED; + int ymethod = BLUE; + int width = 256; + int height = 256; + int pixels[] = new int[width * height]; + int c[] = new int[4]; + int index = 0; + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + c[0] = c[1] = c[2] = 0; + c[3] = 255; + if (xmethod < ymethod) { + applymethod(c, xmethod, i, width, xvals); + applymethod(c, ymethod, j, height, yvals); + } else { + applymethod(c, ymethod, j, height, yvals); + applymethod(c, xmethod, i, width, xvals); + } + pixels[index++] = ((c[3] << 24) | + (c[0] << 16) | + (c[1] << 8) | + (c[2] << 0)); + } + } + + DitherTest dt = new DitherTest(); + return dt.createImage(new MemoryImageSource(width, height, ColorModel.getRGBdefault(), pixels, 0, width)); + } +} + diff --git a/test/jdk/sun/awt/image/BytePackedRaster/MultiOp.java b/test/jdk/sun/awt/image/BytePackedRaster/MultiOp.java new file mode 100644 index 0000000000000..2c396792548f2 --- /dev/null +++ b/test/jdk/sun/awt/image/BytePackedRaster/MultiOp.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4213160 + * @summary Should generate a black image + */ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.DataBuffer; +import java.awt.image.DataBufferByte; +import java.awt.image.IndexColorModel; +import java.awt.image.Raster; +import java.awt.image.WritableRaster; +import java.awt.geom.AffineTransform; + +public class MultiOp { + + public static void main(String[] argv) { + + int width = 256; + int height = 256; + + int pixelBits = 2; // 1, 2, 4, or 8 + // 1 and 8 make the code throw ImagingOpException, 2 and 4 + // make the code SEGV on Sol. + + byte[] lut1Arr = new byte[] {0, (byte)255 }; + byte[] lut2Arr = new byte[] {0, (byte)85, (byte)170, (byte)255}; + byte[] lut4Arr = new byte[] {0, (byte)17, (byte)34, (byte)51, + (byte)68, (byte)85,(byte) 102, (byte)119, + (byte)136, (byte)153, (byte)170, (byte)187, + (byte)204, (byte)221, (byte)238, (byte)255}; + byte[] lut8Arr = new byte[256]; + for (int i = 0; i < 256; i++) { + lut8Arr[i] = (byte)i; + } + + // Create the binary image + int bytesPerRow = width * pixelBits / 8; + byte[] imageData = new byte[height * bytesPerRow]; + ColorModel cm = null; + + switch (pixelBits) { + case 1: + cm = new IndexColorModel(pixelBits, lut1Arr.length, + lut1Arr, lut1Arr, lut1Arr); + break; + case 2: + cm = new IndexColorModel(pixelBits, lut2Arr.length, + lut2Arr, lut2Arr, lut2Arr); + break; + case 4: + cm = new IndexColorModel(pixelBits, lut4Arr.length, + lut4Arr, lut4Arr, lut4Arr); + break; + case 8: + cm = new IndexColorModel(pixelBits, lut8Arr.length, + lut8Arr, lut8Arr, lut8Arr); + break; + default: + {new Exception("Invalid # of bit per pixel").printStackTrace();} + } + + DataBuffer db = new DataBufferByte(imageData, imageData.length); + WritableRaster r = Raster.createPackedRaster(db, width, height, + pixelBits, null); + BufferedImage srcImage = new BufferedImage(cm, r, false, null); + + BufferedImage destImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics2D g = destImage.createGraphics(); + AffineTransform af = AffineTransform.getScaleInstance(.5, .5); + // This draw image is the problem + g.drawImage(srcImage, af, null); + int blackPixel = Color.black.getRGB(); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + if (destImage.getRGB(x, y) != blackPixel) { + throw new RuntimeException("Not black"); + } + } + } + } +} diff --git a/test/jdk/sun/awt/image/ImageRepresentation/ByteBinaryBitmask.java b/test/jdk/sun/awt/image/ImageRepresentation/ByteBinaryBitmask.java new file mode 100644 index 0000000000000..26edca7f09b72 --- /dev/null +++ b/test/jdk/sun/awt/image/ImageRepresentation/ByteBinaryBitmask.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4673490 + * @summary This test verifies that Toolkit images with a 1-bit + * IndexColorModel (known as ByteBinary) and a transparent index are rendered properly. + */ + +import java.awt.Color; +import java.awt.Graphics2D; + +import java.awt.image.BufferedImage; +import java.awt.image.IndexColorModel; + +public class ByteBinaryBitmask { + + public static void main(String argv[]) throws Exception { + + /* Create the image */ + int w = 16, h = 16; + byte[] bw = { (byte)255, (byte)0, }; + IndexColorModel icm = new IndexColorModel(1, 2, bw, bw, bw, 0); + BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_BINARY, icm); + Graphics2D g2d = img.createGraphics(); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, w, h); + g2d.setColor(Color.black); + int xoff = 5; + g2d.fillRect(xoff, 5, 1, 10); // 1 pixel wide + + int dw = 200, dh = 50; + BufferedImage dest = new BufferedImage(dw, dh, BufferedImage.TYPE_INT_RGB); + Graphics2D g = dest.createGraphics(); + g.setColor(Color.green); + g.fillRect(0, 0, dw, dh); + int x1 = 10; + int x2 = 50; + int x3 = 90; + int x4 = 130; + g.drawImage(img, x1, 10, null); + g.drawImage(img, x2, 10, null); + g.drawImage(img, x3, 10, null); + g.drawImage(img, x4, 10, null); + + int blackPix = Color.black.getRGB(); + for (int y = 0; y < dh; y++) { + boolean isBlack = false; + for (int x = 0; x < dw; x++) { + int rgb = dest.getRGB(x, y); + if (rgb == blackPix) { + /* Src image has a one pixel wide vertical rect at off "xoff" and + * this is drawn at x1/x2/x3/x4) so the sum of those are the x locations + * to expect black. + */ + if (x != (x1 + xoff) && x != (x2 + xoff) && x != (x3 + xoff) && x!= (x4 + xoff)) { + throw new RuntimeException("wrong x location: " +x); + } + if (isBlack) { + throw new RuntimeException("black after black"); + } + } + isBlack = rgb == blackPix; + } + } + } +} diff --git a/test/jdk/sun/awt/image/ImageRepresentation/CustomSourceCM.java b/test/jdk/sun/awt/image/ImageRepresentation/CustomSourceCM.java new file mode 100644 index 0000000000000..c56b4ef88c807 --- /dev/null +++ b/test/jdk/sun/awt/image/ImageRepresentation/CustomSourceCM.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 4192756 + * @summary Tests that using a non-default colormodel generates correct images under 16/24 bit mode + */ + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.DirectColorModel; +import java.awt.image.ComponentColorModel; +import java.awt.image.MemoryImageSource; +import java.util.Arrays; + +/* + * NOTE: This bug only appears under specific conditions. If the background of + * the surface is red, then you are not running under the conditions necessary + * to test for the regression so the results of this test will be inconclusive. + * + * The test should be run under any of the following screen depths/surfaces: + * + * 15-bit, otherwise known as 555 RGB or 32768 (thousands) colors + * 16-bit, otherwise known as 565 RGB or 65536 (thousands) colors + * 24-bit, otherwise known as 16777216 (millions) colors + * + * The test draws 2 rectangles. Both rectangles should be half black (left) + * and half blue (right). If the top rectangle is all black, the test fails. + * If the background is red, the results are inconclusive (see above). +*/ + +public class CustomSourceCM extends Component { + + public static int IMG_W = 80; + public static int IMG_H = 30; + + static void test(int imageType) { + + int w = IMG_W + 20; + int h = IMG_H * 2 + 40; + BufferedImage bi = new BufferedImage(w, h, imageType); + + DirectColorModel dcm; + + /* the next dozen lines or so are intended to help + * ascertain if the destination surface is of the type + * that exhibited the original bug, making the background + * white in those cases. It is not strictly necessary. + * It is only for a manual tester to be able to tell by looking. + * The real test is the check for black and blue later on. + */ + Graphics2D g = bi.createGraphics(); + g.setColor(Color.red); + g.fillRect(0, 0, w, h); + + ColorModel cm = bi.getColorModel(); + if (cm instanceof ComponentColorModel) { + g.setColor(Color.white); + g.fillRect(0, 0, w, h); + } else if (cm instanceof DirectColorModel) { + dcm = (DirectColorModel) cm; + if (dcm.getPixelSize() < 24) { + g.setColor(Color.white); + g.fillRect(0, 0, w, h); + } + } + + // Construct a ColorModel and data for a 16-bit 565 image... + dcm = new DirectColorModel(16, 0x1f, 0x7e0, 0xf800); + + // Create an image which is black on the left, blue on the right. + int[] pixels = new int[IMG_W * IMG_H]; + int blue = dcm.getBlueMask(); + int off = 0; + for (int y = 0; y < IMG_H; y++) { + Arrays.fill(pixels, off, off+IMG_W/2, 0); + Arrays.fill(pixels, off+IMG_W/2, off+IMG_W, blue); + off += IMG_W; + } + MemoryImageSource mis = new MemoryImageSource(IMG_W, IMG_H, dcm, + pixels, 0, IMG_W); + CustomSourceCM comp = new CustomSourceCM(); + Image img = comp.createImage(mis); + + // Draw the image on to the surface. + g.drawImage(img, 10, 10, null); + + // Create a similar effect with 2 fillrects, below the image. + g.setColor(Color.black); + g.fillRect(10, 60, IMG_W/2, IMG_H); + g.setColor(Color.blue); + g.fillRect(10+IMG_W/2, 60, IMG_W/2, IMG_H); + + // Now sample points in the image to confirm they are the expected color. + int bluePix = Color.blue.getRGB(); + int blackPix = Color.black.getRGB(); + int black_topLeft = bi.getRGB(10+IMG_W/4, 10+IMG_H/2); + int blue_topRight = bi.getRGB(10+IMG_W*3/4, 10+IMG_H/2); + int black_bottomLeft = bi.getRGB(10+IMG_W/4, 60+IMG_H/2); + int blue_bottomRight = bi.getRGB(10+IMG_W*3/4, 60+IMG_H/2); + if ((black_topLeft != blackPix) || (black_bottomLeft != blackPix) || + (blue_topRight != bluePix) || (blue_bottomRight != bluePix)) { + + String fileName = "failed " + imageType + ".png"; + try { + javax.imageio.ImageIO.write(bi, "png", new java.io.File(fileName)); + } catch (Exception e) { }; + throw new RuntimeException("unexpected colors"); + } + } + + public static void main(String argv[]) { + test(BufferedImage.TYPE_USHORT_555_RGB); + test(BufferedImage.TYPE_USHORT_565_RGB); + test(BufferedImage.TYPE_3BYTE_BGR); + } +} diff --git a/test/jdk/sun/java2d/Disposer/TestDisposerLeak.java b/test/jdk/sun/java2d/Disposer/TestDisposerLeak.java index 0fcf8cdda08dd..bdab5ffb5fbc9 100644 --- a/test/jdk/sun/java2d/Disposer/TestDisposerLeak.java +++ b/test/jdk/sun/java2d/Disposer/TestDisposerLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -31,7 +31,7 @@ * @test * @bug 8129457 * @summary Check Disposer disposes all objects without any memory leaks - * @run main/othervm -mx128m TestDisposerLeak + * @run main/othervm -Xmx128m TestDisposerLeak * @modules java.desktop/sun.java2d */ public final class TestDisposerLeak { diff --git a/test/jdk/sun/java2d/Disposer/TestDisposerRace.java b/test/jdk/sun/java2d/Disposer/TestDisposerRace.java index b78966f1200b2..cbb594d7a1f4a 100644 --- a/test/jdk/sun/java2d/Disposer/TestDisposerRace.java +++ b/test/jdk/sun/java2d/Disposer/TestDisposerRace.java @@ -33,7 +33,7 @@ * @test * @bug 8289208 * @summary Verifies Disposer robustness in a multi-threaded environment. - * @run main/othervm -mx128m TestDisposerRace + * @run main/othervm -Xmx128m TestDisposerRace * @modules java.desktop/sun.java2d */ public final class TestDisposerRace { diff --git a/test/jdk/sun/java2d/GdiRendering/GdiBlitOffscreenTest.java b/test/jdk/sun/java2d/GdiRendering/GdiBlitOffscreenTest.java new file mode 100644 index 0000000000000..99cb2bcd10661 --- /dev/null +++ b/test/jdk/sun/java2d/GdiRendering/GdiBlitOffscreenTest.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4725045 + * @key headful + * @summary verifies that there are no artifacts due to using + * GDI for copies to the back buffer (GDI should only be used + * for copies to the screen) + * @run main GdiBlitOffscreenTest +*/ + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Point; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; + +public class GdiBlitOffscreenTest { + + static volatile JFrame f; + static final int imageW = 100, imageH = 100, FW = 500, FH = 500; + static volatile BufferedImage greenImage; + + public static void main(String[] args) throws Exception { + + // First, create an image. + greenImage = new BufferedImage(imageW, imageH, + BufferedImage.TYPE_INT_RGB); + Graphics redG = greenImage.getGraphics(); + redG.setColor(Color.green); + redG.fillRect(0, 0, imageW, imageH); + redG.setColor(Color.white); + redG.drawString("Passed!", 30, 80); + + Robot robot = new Robot(); + try { + SwingUtilities.invokeAndWait(GdiBlitOffscreenTest::createUI); + robot.delay(1000); + robot.waitForIdle(); + Point p = f.getLocationOnScreen(); + Color c = robot.getPixelColor(p.x+FW/2, p.y+FH/2); + if (!c.equals(Color.green)) { + throw new RuntimeException("Color is " + c); + } + } finally { + if (f != null) { + SwingUtilities.invokeAndWait(f::dispose); + } + } + } + + private static void createUI() { + f = new JFrame("GdiBlitOffscreenTest"); + f.setSize(FW, FH); + f.setVisible(true); + + // copy the image to the window. + Graphics g = f.getGraphics(); + g.drawImage(greenImage, 0, 0, null); + + // Now, get on with the rest of the test + JComponent app = new GdiBlitOffscreenTestComponent(imageW, imageH, greenImage); + app.setSize(500, 500); + f.getContentPane().add(app); + f.validate(); + f.repaint(); + } +} + +class GdiBlitOffscreenTestComponent extends JComponent { + + int imageW, imageH; + Image theImage; + + public GdiBlitOffscreenTestComponent(int imageW, int imageH, + Image theImage) + { + this.theImage = theImage; + this.imageW = imageW; + this.imageH = imageH; + } + + public void paintComponent(Graphics g) { + int imageX = (getWidth() - imageW) / 2; + int imageY = (getHeight() - imageH) / 2; + g.setColor(Color.blue); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.red); + g.fillRect(imageX, imageY, imageW, imageH); + g.setColor(Color.white); + g.drawString("Failed!", imageX + 30, imageY + 80); + g.drawImage(theImage, imageX, imageY, null); + } + +} diff --git a/test/jdk/sun/java2d/GdiRendering/GdiLockTest.java b/test/jdk/sun/java2d/GdiRendering/GdiLockTest.java new file mode 100644 index 0000000000000..ea2111f9d2e05 --- /dev/null +++ b/test/jdk/sun/java2d/GdiRendering/GdiLockTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4693644 + * @summary verifies that there are no artifacts due to copying with GDI + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual GdiLockTest +*/ + +import java.awt.Color; +import java.awt.Component; +import java.awt.Frame; +import java.awt.Graphics; + +public class GdiLockTest { + + static final String INSTRUCTIONS = """ + A window will open up next to these instructions. + The text you see in that window should blink on and off. + If it never disappears, then the test has failed. + """; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("GdiLockTest") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(5) + .columns(45) + .testUI(GdiLockTest::createUI) + .build() + .awaitAndCheck(); + } + + private static Frame createUI() { + Frame f = new Frame("GdiLockTest"); + f.setSize(300, 300); + GdiLockTestComponent test = new GdiLockTestComponent(); + Thread t = new Thread(test); + f.add(test); + t.start(); + return f; + } +} + +class GdiLockTestComponent extends Component implements Runnable { + + boolean textVisible = true; + + public void paint(Graphics g) { + g.setColor(Color.white); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.black); + if (!textVisible) { + g.setClip(200, 200, 300, 300); + } + g.drawString("This text should be blinking", 10, 30); + if (!textVisible) { + g.setClip(0, 0, getWidth(), getHeight()); + } + } + + public void run() { + while (true) { + repaint(); + textVisible = !textVisible; + try { + Thread.sleep(500); + } catch (Exception e) {} + } + } +} diff --git a/test/jdk/sun/java2d/SunGraphics2D/DrawRoundRect0Bug.java b/test/jdk/sun/java2d/SunGraphics2D/DrawRoundRect0Bug.java new file mode 100644 index 0000000000000..09b6b3e0b3fe3 --- /dev/null +++ b/test/jdk/sun/java2d/SunGraphics2D/DrawRoundRect0Bug.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4515761 + * @summary verify that drawRoundRect produces correct output for 0 w/h + */ + +import java.awt.Color; +import static java.awt.Color.*; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +public class DrawRoundRect0Bug { + + public static void main(String argv[]) { + BufferedImage img = new BufferedImage(250, 250, BufferedImage.TYPE_INT_RGB); + Graphics2D g = img.createGraphics(); + + g.setColor(white); + g.fillRect(0, 0, img.getWidth(), img.getHeight()); + + g.setColor(green); + g.drawLine(150, 90, 150, 110); + if (img.getRGB(150, 100) != green.getRGB()) { + throw new RuntimeException("Vertical line not green"); + } + + g.setColor(blue); + g.drawRoundRect(160, 90, 0, 20, 4, 4); + if (img.getRGB(160, 100) != blue.getRGB()) { + throw new RuntimeException("Vertical (ie zero width) round rect not blue"); + } + + g.setColor(green); + g.drawLine(150, 140, 170, 140); + if (img.getRGB(160, 140) != green.getRGB()) { + throw new RuntimeException("Horizontal line not green"); + } + + g.setColor(blue); + g.drawRoundRect(150, 150, 20, 0, 4, 4); + if (img.getRGB(160, 150) != blue.getRGB()) { + throw new RuntimeException("Horizontal (ie zero height) round rect not blue"); + } + } + +} diff --git a/test/jdk/sun/java2d/SunGraphics2D/RevalidateBug.java b/test/jdk/sun/java2d/SunGraphics2D/RevalidateBug.java new file mode 100644 index 0000000000000..068dd78284b4c --- /dev/null +++ b/test/jdk/sun/java2d/SunGraphics2D/RevalidateBug.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4652373 + * @summary verify that SunGraphics2D survives surface revalidation + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual RevalidateBug + * @requires (os.family == "windows") + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Rectangle; +import javax.swing.JComponent; +import javax.swing.JFrame; + +public class RevalidateBug { + + private static final String INSTRUCTIONS = """ + This bug only reproduces on Windows systems with a task manager that can lock the computer. + + This test draws a grayscale gradient in a window. + + After the gradient becomes visible above, use ctrl-alt-del to bring up + the task manager and lock the computer. + Then unlock the computer and the gradient should be repainted to pass. + + If the gradient does not appear after unlocking (or if the test gets + an error on its own after unlocking the computer) then it fails. + """; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("RevalidateBug") + .instructions(INSTRUCTIONS) + .testTimeOut(5) + .rows(12) + .columns(50) + .testUI(RevalidateBug::createUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createUI() { + + JComponent comp = new JComponent() { + + protected void paintComponent(Graphics g) { + super.paintComponent(g); + System.out.println("paintComponent"); + Graphics2D g2d = (Graphics2D) g; + + Insets insets = getInsets(); + Rectangle rect = + new Rectangle(insets.left, insets.top, + getWidth() - insets.right - insets.left, + getHeight() - insets.top - insets.bottom); + g2d.setPaint(new GradientPaint(rect.x, rect.y, Color.white, + rect.x + rect.width, rect.y, Color.black)); + + System.out.println(rect + " w:" + getWidth() + " h:"+getHeight()); + + g2d.fillRect(0, 0, getWidth(), getHeight()); + } + + public Dimension getPreferredSize() { + return new Dimension(500, 500); + } + }; + + JFrame f = new JFrame("RevalidateTest"); + f.add(comp); + f.pack(); + return f; + } + +} diff --git a/test/jdk/sun/java2d/SunGraphics2D/ScaledPolyTest.java b/test/jdk/sun/java2d/SunGraphics2D/ScaledPolyTest.java new file mode 100644 index 0000000000000..65bb912785ba9 --- /dev/null +++ b/test/jdk/sun/java2d/SunGraphics2D/ScaledPolyTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4516037 + * @summary verify that scaled Polygons honor the transform + */ + +import java.awt.Color; +import static java.awt.Color.*; +import java.awt.Graphics2D; +import java.awt.Polygon; +import java.awt.image.BufferedImage; + +public class ScaledPolyTest { + + public static void main(String[] args) { + + Polygon poly = new Polygon(); + poly.addPoint(20, 10); + poly.addPoint(30, 30); + poly.addPoint(10, 30); + poly.addPoint(20, 10); + + int height = 300; + int width = 300; + BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, bi.getWidth(), bi.getHeight()); + + g2d.translate(10, 10); + g2d.scale(2, 2); + g2d.setColor(Color.yellow); + g2d.fill(poly); + g2d.setColor(Color.blue); + g2d.draw(poly); + + /* + * Examine each row of the image. + * If the stroked polygon is correctly aligned on the filled polygon, + * if there is anything except white on the line, + * the transition will always be white+->blue+->yellow*->blue*->white+ + */ + int bluePix = blue.getRGB(); + int yellowPix = yellow.getRGB(); + int whitePix = white.getRGB(); + for (int y = 0; y < height; y++ ) { + int x = 0; + int pix = whitePix; + + while (pix == whitePix && x < width) pix = bi.getRGB(x++, y); + if (pix == whitePix && x == width) continue; // all white row. + + if (pix != bluePix) throw new RuntimeException("Expected blue"); + + while (pix == bluePix) pix = bi.getRGB(x++, y); + + if (pix == yellowPix) { + while (pix == yellowPix) pix = bi.getRGB(x++, y); + if (pix != bluePix) throw new RuntimeException("Expected blue"); + while (pix == bluePix) pix = bi.getRGB(x++, y); + if (pix != whitePix) throw new RuntimeException("Expected white"); + } + + while (pix == whitePix && x < width) pix = bi.getRGB(x++, y); + if (pix == whitePix && x == width) { + continue; + } else { + throw new RuntimeException("Expected white to finish the row"); + } + } + } +} diff --git a/test/jdk/sun/java2d/loops/ARGBBgToRGB.java b/test/jdk/sun/java2d/loops/ARGBBgToRGB.java new file mode 100644 index 0000000000000..55764af2c1354 --- /dev/null +++ b/test/jdk/sun/java2d/loops/ARGBBgToRGB.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4238978 + * @summary This test verifies that the correct blitting loop is being used. + * The correct output should have a yellow border on the top and + * left sides of a red box. The incorrect output would have only + * a red box -- no yellow border." + */ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +public class ARGBBgToRGB { + + public static void main(String[] argv) { + BufferedImage bi = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); + Graphics2D big = bi.createGraphics(); + big.setColor(Color.red); + big.fillRect(30, 30, 150, 150); + + BufferedImage bi2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); + Graphics2D big2 = bi2.createGraphics(); + big2.drawImage(bi, 0, 0, Color.yellow, null); + + int expectYellowPix = bi2.getRGB(0, 0); + int expectRedPix = bi2.getRGB(50, 50); + if ((expectYellowPix != Color.yellow.getRGB()) || + (expectRedPix != Color.red.getRGB())) + { + throw new RuntimeException("Unexpected colors " + expectYellowPix + " " + expectRedPix); + } + } +} diff --git a/test/jdk/sun/java2d/loops/CopyNegative.java b/test/jdk/sun/java2d/loops/CopyNegative.java new file mode 100644 index 0000000000000..0b8296918ac63 --- /dev/null +++ b/test/jdk/sun/java2d/loops/CopyNegative.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4188744 + * @summary This test verifies that copyArea performs correctly for negative offset values. + * The correct output shows that the text area is moved to the left and down, + * leaving some garbage on the right and the top. + * The incorrect copy would show the text area garbled and no text is legible. + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual CopyNegative + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Panel; + +public class CopyNegative extends Panel { + + private static final String INSTRUCTIONS = """ + This test verifies that copyArea performs correctly for negative offset values. + The test draws text in an image, then copies the contents repeatedly. + The correct output shows that the text is moved to the left and down, + leaving some garbage on the top / right and some legible text at the bottom left. + The incorrect copy would show the whole text area garbled and no text is legible. + """; + + public static void main(String[] argv) throws Exception { + PassFailJFrame.builder() + .title("CopyNegativeTest") + .instructions(INSTRUCTIONS) + .testUI(CopyNegative::createUI) + .testTimeOut(5) + .rows(10) + .columns(50) + .build() + .awaitAndCheck(); + } + + Image img; + + static final int W = 200, H = 200; + + static Frame createUI() { + Frame f = new Frame("CopyNegative"); + f.add(new CopyNegative()); + f.pack(); + return f; + } + + public Dimension getPreferredSize() { + return new Dimension(W, H); + } + + private void doCopy() { + Graphics g = img.getGraphics(); + g.setColor(Color.white); + g.fillRect(0, 0, W, H); + g.setColor(Color.black); + String text = "Some Text To Display, it is long enough to fill the entire display line."; + StringBuffer sb = new StringBuffer(text); + + for (int i = 1; i < 50; i++) { + g.drawString(sb.toString(), 5,20 * i - 10); + sb.insert(0, Integer.toString(i)); + } + for (int i = 0 ; i < 20 ; i++ ) { + g.copyArea(0, 0, W, H, -3, 3); + } + } + + public void paint(Graphics g) { + img = createImage(W, H); + doCopy(); + g.drawImage(img, 0, 0, this); + } + +} diff --git a/test/jdk/sun/java2d/loops/DitheredSolidFill.java b/test/jdk/sun/java2d/loops/DitheredSolidFill.java new file mode 100644 index 0000000000000..509b0bbe3b234 --- /dev/null +++ b/test/jdk/sun/java2d/loops/DitheredSolidFill.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 4181172 + * @summary Confirm that solid white fill is not dithered on an 8-bit indexed surface. + * The test draws two areas filled with white solid color. + * The upper left square is filled in aliasing mode and + * the lower right square is filled in anti-aliasing mode. + */ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; + +public class DitheredSolidFill { + + public static void main(String args[]) { + BufferedImage bi = new BufferedImage(120, 120, BufferedImage.TYPE_BYTE_INDEXED); + Graphics2D g2D = bi.createGraphics(); + + g2D.setColor(Color.black); + g2D.fillRect(0, 0, 100, 100); + + g2D.setColor(Color.white); + g2D.fillRect(5, 5, 40, 40); + checkPixels(bi, 5, 5, 40, 40); + + g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2D.fillRect(55, 55, 40, 40); + checkPixels(bi, 55, 55, 40, 40); + } + + static void checkPixels(BufferedImage bi, int x, int y, int w, int h) { + // pixel can be off white, but must be the same in all cases. + int expectedPix = bi.getRGB(x, y); + for (int x0 = x; x0 < x + w; x0++) { + for (int y0 = y; y0 < y + h; y0++) { + if (bi.getRGB(x0, y0) != expectedPix) { + try { + javax.imageio.ImageIO.write(bi, "png", new java.io.File("failed.png")); + } catch (Exception e) { + } + throw new RuntimeException("Not expected pix : " + + Integer.toHexString(bi.getRGB(x0, y0)) + + " at " + x0 + "," + y0); + } + } + } + } +} diff --git a/test/jdk/sun/java2d/loops/OffsetCalculationTest.java b/test/jdk/sun/java2d/loops/OffsetCalculationTest.java new file mode 100644 index 0000000000000..fe30107f22a9f --- /dev/null +++ b/test/jdk/sun/java2d/loops/OffsetCalculationTest.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 4236576 + @summary tests that a BufferedImage in TYPE_3BYTE_BGR format is correctly + drawn when there is an offset between the Graphics clip bounds + and the clip box of the underlying device context. + @run main OffsetCalculationTest +*/ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; +import java.awt.image.DataBuffer; + +public class OffsetCalculationTest { + + public static void main(String[] args) { + BufferedImage srcImage = new BufferedImage(500, 500, BufferedImage.TYPE_3BYTE_BGR); + + DataBuffer buffer = srcImage.getRaster().getDataBuffer(); + for (int i = 2; i < buffer.getSize(); i+=3) { + // setting each pixel to blue via the data buffer elements. + buffer.setElem(i - 2, 0xff); + buffer.setElem(i - 1, 0); + buffer.setElem(i, 0); + } + + int w = 200, h = 200; + BufferedImage destImage = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR); + Graphics2D g = destImage.createGraphics(); + Rectangle r = new Rectangle(0, 0, w, h); + g.setClip(r.x - 1, r.y, r.width + 1, r.height); + g.drawImage(srcImage, 0, 0, null); + + int bluepix = Color.blue.getRGB(); + for (int y = 0; y < w; y++) { + for (int x = 0; x < h; x++) { + if (destImage.getRGB(x, y) != bluepix) { + throw new RuntimeException("Not Blue"); + } + } + } + } +} diff --git a/test/jdk/sun/java2d/loops/XORClearRect.java b/test/jdk/sun/java2d/loops/XORClearRect.java new file mode 100644 index 0000000000000..f5c30581cf1f3 --- /dev/null +++ b/test/jdk/sun/java2d/loops/XORClearRect.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4088173 + * @summary This interactive test verifies that the XOR mode is not affecting + * the clearRect() call. The correct output looks like: + * + * \ / + * \ / + * The backgound is blue. + * The lines outside the central rectangle are green. + * The central rectangle is also blue (the result of clearRect()) + * / \ + * / \ + * + * @key headful + * @run main XORClearRect + */ + +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Graphics; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Robot; + +public class XORClearRect extends Panel { + + public static void main(String args[]) throws Exception { + EventQueue.invokeAndWait(XORClearRect::createUI); + try { + Robot robot = new Robot(); + robot.waitForIdle(); + robot.delay(2000); + Point p = frame.getLocationOnScreen(); + int pix = robot.getPixelColor(p.x + 100, p.y + 100).getRGB(); + if (pix != Color.blue.getRGB()) { + throw new RuntimeException("Not blue"); + } + } finally { + if (frame != null) { + EventQueue.invokeAndWait(frame::dispose); + } + } + } + + static volatile Frame frame; + + static void createUI() { + frame = new Frame("XORClearRect"); + frame.setBackground(Color.blue); + XORClearRect xor = new XORClearRect(); + frame.add(xor); + frame.setSize(200,200); + frame.setVisible(true); + } + + public XORClearRect() { + setBackground(Color.blue); + } + + public void paint(Graphics g) { + g.setColor(Color.green); + g.drawLine(0,0,200,200); + g.drawLine(0,200,200,0); + g.setXORMode(Color.blue); + g.clearRect(50,50,100,100); //expecting the rectangle to be filled + // with the background color (blue) + } +} diff --git a/test/jdk/sun/java2d/marlin/CrashTest.java b/test/jdk/sun/java2d/marlin/CrashTest.java index b5283fdf33279..5b9632caafe96 100644 --- a/test/jdk/sun/java2d/marlin/CrashTest.java +++ b/test/jdk/sun/java2d/marlin/CrashTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -35,9 +35,9 @@ /** * @test * @summary Simple crash rendering test using huge GeneralPaths with the Marlin renderer - * @run main/othervm -mx512m CrashTest + * @run main/othervm -Xmx512m CrashTest * @ignore tests that take a long time and consumes 5Gb memory - * @run main/othervm -ms4g -mx4g CrashTest -slow + * @run main/othervm -Xms4g -Xmx4g CrashTest -slow */ public class CrashTest { diff --git a/test/jdk/sun/java2d/pipe/DrawImageBgTest.java b/test/jdk/sun/java2d/pipe/DrawImageBgTest.java new file mode 100644 index 0000000000000..962529dc956c9 --- /dev/null +++ b/test/jdk/sun/java2d/pipe/DrawImageBgTest.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4532352 + * @summary This test verifies that the specified background color is rendered + * in the special case of: + * Graphics.drawImage(Image img, int dx1, int dy1, int dx2, int dy2, + * int sx1, int sy1, int sx2, int sy2, + * Color bgColor, ImageObserver observer) + * where no scaling takes place because the source and destination + * bounds have the same width and height. + */ + +import java.io.File; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import javax.imageio.ImageIO; + +public class DrawImageBgTest { + + public static void main(String argv[]) throws Exception { + + int dx, dy, dw, dh; + int sx, sy, sw, sh; + + int iw = 250, ih = 250; + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String prefix = dir+sep; + BufferedImage img = ImageIO.read(new File(prefix + "duke.gif")); + BufferedImage dest = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_RGB); + + Graphics2D g = dest.createGraphics(); + g.setColor(Color.blue); + g.fillRect(0, 0, iw, ih); + + // source and destination dimensions are different, results in scaling + dx = 10; + dy = 10; + dw = 100; + dh = 200; + sx = 10; + sy = 10; + sw = 50; + sh = 100; + g.drawImage(img, + dx, dy, dx + dw, dy + dh, + sx, sy, sx + sw, sy + sh, + Color.yellow, null); + + int pix1 = dest.getRGB(dx + 1, dy + 1); + + // source and destination dimensions are the same, no scaling + dx = 120; + dy = 10; + sx = 10; + sy = 10; + sw = dw = 50; + sh = dh = 100; + g.drawImage(img, + dx, dy, dx + dw, dy + dh, + sx, sy, sx + sw, sy + sh, + Color.yellow, null); + + int pix2 = dest.getRGB(dx + 1, dy + 1); + int yellow = Color.yellow.getRGB(); + + if (pix1 != yellow || pix2 != yellow) { + ImageIO.write(dest, "gif", new File("op.gif")); + throw new RuntimeException("pix1=" + Integer.toHexString(pix1) + + " pix2=" + Integer.toHexString(pix2)); + } + } +} diff --git a/test/jdk/sun/java2d/pipe/duke.gif b/test/jdk/sun/java2d/pipe/duke.gif new file mode 100644 index 0000000000000..ed32e0ff79b05 Binary files /dev/null and b/test/jdk/sun/java2d/pipe/duke.gif differ diff --git a/test/jdk/sun/management/jdp/DynamicLauncher.java b/test/jdk/sun/management/jdp/DynamicLauncher.java index 9102fe32a94de..b79672211b1ef 100644 --- a/test/jdk/sun/management/jdp/DynamicLauncher.java +++ b/test/jdk/sun/management/jdp/DynamicLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -37,6 +37,8 @@ */ public abstract class DynamicLauncher { + private static final int MAX_RETRY_ATTEMPTS = 10; + final String jdpName = UUID.randomUUID().toString(); OutputAnalyzer output; int jmxPort; @@ -52,7 +54,7 @@ protected void run() throws Exception { try { output.shouldNotContain("Port already in use"); } catch (RuntimeException e) { - if (retries < 3) { + if (retries < MAX_RETRY_ATTEMPTS) { retries++; tryAgain = true; } diff --git a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java index c062f7c75b89d..61359084297de 100644 --- a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java +++ b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java @@ -52,7 +52,7 @@ public class JMXInterfaceBindingTest { public static final int JMX_PORT_RANGE_UPPER = 9200; public static final int JMX_PORT_RANGE_LOWER_SSL = 9201; // 9200 might be RMI Port public static final int JMX_PORT_RANGE_UPPER_SSL = 9300; - private static final int MAX_RETRY_ATTEMTS = 10; + private static final int MAX_RETRY_ATTEMPTS = 10; public static final String READY_MSG = "MainThread: Ready for connections"; public static final String TEST_CLASS = JMXAgentInterfaceBinding.class.getSimpleName(); public static final String KEYSTORE_LOC = System.getProperty("test.src", ".") + @@ -159,7 +159,7 @@ public void run() { System.err.println("Retrying the test for " + name); } needRetry = runTest(); - } while (needRetry && (attempts++ < MAX_RETRY_ATTEMTS)); + } while (needRetry && (attempts++ < MAX_RETRY_ATTEMPTS)); if (testFailed) { int exitValue = output.getExitValue(); diff --git a/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.cfg b/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.cfg new file mode 100644 index 0000000000000..906e4a3a3625e --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.cfg @@ -0,0 +1,14 @@ +name = NSS + +showInfo = true + +slot = 1 + +library = ${pkcs11test.nss.lib} + +disabledMechanisms = { + CKM_SHA224_HMAC + CKM_SHA256_HMAC +} + +nssArgs = "configdir='${pkcs11test.nss.db}' certPrefix='' keyPrefix=''" diff --git a/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.java b/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.java new file mode 100644 index 0000000000000..11fb562a82548 --- /dev/null +++ b/test/jdk/sun/security/pkcs11/Provider/RequiredMechCheck.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8335288 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @summary check that if any required mech is unavailable, then the + * mechanism will be unavailable as well. + * @run testng/othervm RequiredMechCheck + */ +import java.nio.file.Path; +import java.security.Provider; +import java.security.NoSuchAlgorithmException; +import javax.crypto.Cipher; +import javax.crypto.Mac; +import javax.crypto.SecretKeyFactory; + +import jtreg.SkippedException; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class RequiredMechCheck extends PKCS11Test { + + private static record TestData(String serviceType, String algo, + boolean disabled) {} + + private static TestData[] testValues = { + new TestData("MAC", "HmacPBESHA1", false), + new TestData("MAC", "HmacPBESHA224", true), + new TestData("MAC", "HmacPBESHA256", true), + new TestData("MAC", "HmacPBESHA384", false), + new TestData("MAC", "HmacPBESHA512", false), + new TestData("SKF", "PBEWithHmacSHA1AndAES_128", false), + new TestData("SKF", "PBEWithHmacSHA224AndAES_128", true), + new TestData("SKF", "PBEWithHmacSHA256AndAES_128", true), + new TestData("SKF", "PBEWithHmacSHA384AndAES_128", false), + new TestData("SKF", "PBEWithHmacSHA512AndAES_128", false), + new TestData("CIP", "PBEWithHmacSHA1AndAES_128", false), + new TestData("CIP", "PBEWithHmacSHA224AndAES_128", true), + new TestData("CIP", "PBEWithHmacSHA256AndAES_128", true), + new TestData("CIP", "PBEWithHmacSHA384AndAES_128", false), + new TestData("CIP", "PBEWithHmacSHA512AndAES_128", false), + }; + + @BeforeClass + public void setUp() throws Exception { + Path configPath = Path.of(BASE).resolve("RequiredMechCheck.cfg"); + System.setProperty("CUSTOM_P11_CONFIG", configPath.toString()); + } + + @Test + public void test() throws Exception { + try { + main(new RequiredMechCheck()); + } catch (SkippedException se) { + throw new SkipException("One or more tests are skipped"); + } + } + + public void main(Provider p) throws Exception { + for (TestData td : testValues) { + String desc = td.serviceType + " " + td.algo; + Object t; + try { + switch (td.serviceType) { + case "MAC": + t = Mac.getInstance(td.algo, p); + break; + case "SKF": + t = SecretKeyFactory.getInstance(td.algo, p); + break; + case "CIP": + t = Cipher.getInstance(td.algo, p); + break; + default: + throw new RuntimeException("Unsupported Test Type!"); + } + + if (td.disabled) { + throw new RuntimeException("Fail, no NSAE for " + desc); + } else { + System.out.println("Ok, getInstance() works for " + desc); + } + } catch (NoSuchAlgorithmException e) { + if (td.disabled) { + System.out.println("Ok, NSAE thrown for " + desc); + } else { + throw new RuntimeException("Unexpected Ex for " + desc, e); + } + } + } + } +} diff --git a/test/jdk/sun/security/provider/SecureRandom/StrongSecureRandom.java b/test/jdk/sun/security/provider/SecureRandom/StrongSecureRandom.java index bdd3ab0a4b9d1..1c6d515e4f05a 100644 --- a/test/jdk/sun/security/provider/SecureRandom/StrongSecureRandom.java +++ b/test/jdk/sun/security/provider/SecureRandom/StrongSecureRandom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, 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 @@ -23,13 +23,16 @@ /* * @test - * @bug 6425477 8141039 + * @bug 6425477 8141039 8324648 + * @library /test/lib * @summary Better support for generation of high entropy random numbers * @run main StrongSecureRandom */ import java.security.*; import java.util.*; +import static jdk.test.lib.Asserts.assertTrue; + /** * This test assumes that the standard Sun providers are installed. */ @@ -89,6 +92,27 @@ private static void testNativePRNGImpls() throws Exception { ba = sr.generateSeed(1); sr.nextBytes(ba); sr.setSeed(ba); + + testParamsUnsupported("NativePRNG"); + testParamsUnsupported("NativePRNGNonBlocking"); + testParamsUnsupported("NativePRNGBlocking"); + } + + private static void testParamsUnsupported(String alg) throws NoSuchAlgorithmException { + System.out.println("Testing that " + alg + " does not support params"); + + try { + SecureRandom.getInstance(alg, new SecureRandomParameters() {}); + throw new RuntimeException("Params should not be supported"); + } catch (NoSuchAlgorithmException nsae) { + Throwable cause = nsae.getCause(); + if (cause instanceof IllegalArgumentException) { + assertTrue(cause.getMessage().contains("Unsupported params"), + "Unexpected error message: " + cause.getMessage()); + } else { + throw nsae; + } + } } private static void testStrongInstance(boolean expected) throws Exception { diff --git a/test/jdk/sun/tools/jcmd/TestJcmdPIDSubstitution.java b/test/jdk/sun/tools/jcmd/TestJcmdPIDSubstitution.java index 4af5bf1ff6755..f6b9718a28bf4 100644 --- a/test/jdk/sun/tools/jcmd/TestJcmdPIDSubstitution.java +++ b/test/jdk/sun/tools/jcmd/TestJcmdPIDSubstitution.java @@ -51,6 +51,8 @@ public static void main(String[] args) throws Exception { verifyOutputFilenames("GC.heap_dump", FILENAME); if (Platform.isLinux()) { verifyOutputFilenames("Compiler.perfmap", FILENAME); + } + if (Platform.isLinux() || Platform.isWindows()) { verifyOutputFilenames("System.dump_map", "-F=%s".formatted(FILENAME)); } } diff --git a/test/jdk/sun/util/calendar/zi/RuleRec.java b/test/jdk/sun/util/calendar/zi/RuleRec.java index 6d9d4905d6af4..e6e18773d1606 100644 --- a/test/jdk/sun/util/calendar/zi/RuleRec.java +++ b/test/jdk/sun/util/calendar/zi/RuleRec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2024, 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 @@ -168,12 +168,13 @@ static RuleRec parse(StringTokenizer tokens) { rec.toYear = Integer.parseInt(token); } catch (NumberFormatException e) { // it's not integer - if ("min".equals(token) || "minimum".equals(token)) { + int len = token.length(); + if (token.regionMatches(true, 0, "minimum", 0, len)) { rec.fromYear = Zoneinfo.getMinYear(); - } else if ("max".equals(token) || "maximum".equals(token)) { + } else if (token.regionMatches(true, 0, "maximum", 0, len)) { rec.toYear = Integer.MAX_VALUE; rec.isLastRule = true; - } else if ("only".equals(token)) { + } else if (token.regionMatches(true, 0, "only", 0, len)) { rec.toYear = rec.fromYear; } else { Main.panic("invalid year value: "+token); diff --git a/test/jdk/sun/util/calendar/zi/Zoneinfo.java b/test/jdk/sun/util/calendar/zi/Zoneinfo.java index f395101d86514..e125ad2cb87d1 100644 --- a/test/jdk/sun/util/calendar/zi/Zoneinfo.java +++ b/test/jdk/sun/util/calendar/zi/Zoneinfo.java @@ -240,8 +240,9 @@ static Zoneinfo parse(String fname) { continue; } String token = tokens.nextToken(); + int len = token.length(); - if (continued || "Zone".equals(token)) { + if (continued || token.regionMatches(true, 0, "Zone", 0, len)){ if (zone == null) { if (!tokens.hasMoreTokens()) { panic("syntax error: zone no more token"); @@ -268,7 +269,7 @@ static Zoneinfo parse(String fname) { } zone = null; } - } else if ("Rule".equals(token)) { + } else if (token.regionMatches(true, 0, "Rule", 0, len)) { if (!tokens.hasMoreTokens()) { panic("syntax error: rule no more token"); } @@ -281,7 +282,7 @@ static Zoneinfo parse(String fname) { RuleRec rrec = RuleRec.parse(tokens); rrec.setLine(line); rule.add(rrec); - } else if ("Link".equals(token)) { + } else if (token.regionMatches(true, 0, "Link", 0, len)) { // Link try { String name1 = tokens.nextToken(); diff --git a/test/jdk/tools/jimage/JImageToolTest.java b/test/jdk/tools/jimage/JImageToolTest.java index feb6a56a968c3..b1006c896794b 100644 --- a/test/jdk/tools/jimage/JImageToolTest.java +++ b/test/jdk/tools/jimage/JImageToolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, 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 @@ -42,7 +42,7 @@ public class JImageToolTest { private static void jimage(String... jimageArgs) throws Exception { ArrayList args = new ArrayList<>(); - args.add("-ms64m"); + args.add("-Xms64m"); args.add("jdk.tools.jimage.Main"); args.addAll(Arrays.asList(jimageArgs)); diff --git a/test/jdk/tools/launcher/MultipleJRERemoved.java b/test/jdk/tools/launcher/MultipleJRERemoved.java deleted file mode 100644 index 551ffc885f275..0000000000000 --- a/test/jdk/tools/launcher/MultipleJRERemoved.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @test - * @bug 8067437 - * @summary Verify Multiple JRE version support has been removed. - * @modules jdk.compiler - * jdk.zipfs - * @build TestHelper - * @run main MultipleJRERemoved - */ - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.file.Files; -import java.util.*; -import java.util.jar.Attributes; -import java.util.jar.JarOutputStream; -import java.util.jar.Manifest; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.zip.ZipEntry; - -public class MultipleJRERemoved extends TestHelper { - - public static final String VERSION_JAR = "version.jar"; - public static final String PRINT_VERSION_CLASS = "PrintVersion"; - private final File javaFile = new File(PRINT_VERSION_CLASS + ".java"); - private final File clsFile = new File(PRINT_VERSION_CLASS + ".class"); - - private MultipleJRERemoved() { - } - - /** - * @param args the command line arguments - * @throws java.io.FileNotFoundException - */ - public static void main(String[] args) throws Exception { - MultipleJRERemoved a = new MultipleJRERemoved(); - a.run(args); - } - - /** - * Check all combinations of flags: "-version:", "-jre-restrict-search", "-jre-no-restrict-search". Test expects to see errors. - */ - @Test - public void allFlagCombinations() throws IOException { - final Pattern newLine = Pattern.compile("\n"); - createJar(Collections.emptyMap()); - - for (Flag flag1 : Flag.values()) { - for (Flag flag2 : Flag.values()) { - for (Flag flag3 : Flag.values()) { - List flags = Stream.of(flag1, flag2, flag3) - .filter(f -> !Flag.EMPTY.equals(f)) - .collect(Collectors.toList()); - - if (flags.size() == 0) continue; - - List flagValues = flags.stream() - .map(Flag::value) - .collect(Collectors.toList()); - - List errorMessages = flags.stream() - .map(Flag::errorMessage) - .flatMap(newLine::splitAsStream) - .collect(Collectors.toList()); - - List jarCmd = new ArrayList<>(); - jarCmd.add(javaCmd); - jarCmd.addAll(flagValues); - jarCmd.add("-jar"); - jarCmd.add("version.jar"); - - check(jarCmd, errorMessages); - - List cmd = new ArrayList<>(); - cmd.add(javaCmd); - cmd.addAll(flagValues); - cmd.add(PRINT_VERSION_CLASS); - - check(cmd, errorMessages); - } - } - } - } - - private void check(List cmd, List errorMessages) { - TestResult tr = doExec(cmd.toArray(new String[cmd.size()])); - tr.checkNegative(); - tr.isNotZeroOutput(); - errorMessages.forEach(tr::contains); - - if (!tr.testStatus) { - System.out.println(tr); - throw new RuntimeException("test case: failed\n" + cmd); - } - } - - /** - * Verifies that java -help output doesn't contain information about "mJRE" flags. - */ - @Test - public void javaHelp() { - TestResult tr = doExec(javaCmd, "-help"); - tr.checkPositive(); - tr.isNotZeroOutput(); - tr.notContains("-version:"); - tr.notContains("-jre-restrict-search"); - tr.notContains("-jre-no-restrict-search"); - tr.notContains("-no-jre-restrict-search"); //it's not a typo in flag name. - if (!tr.testStatus) { - System.out.println(tr); - throw new RuntimeException("Failed. java -help output contains obsolete flags.\n"); - } - } - - /** - * Verifies that java -jar version.jar output ignores "mJRE" manifest directives. - */ - @Test - public void manifestDirectives() throws IOException { - Map manifest = new TreeMap<>(); - manifest.put("JRE-Version", "1.8"); - manifest.put("JRE-Restrict-Search", "1.8"); - createJar(manifest); - - TestResult tr = doExec(javaCmd, "-jar", VERSION_JAR); - tr.checkPositive(); - tr.contains(System.getProperty("java.version")); - if (!tr.testStatus) { - System.out.println(tr); - throw new RuntimeException("Failed.\n"); - } - } - - private void emitFile() throws IOException { - List scr = new ArrayList<>(); - scr.add("public class PrintVersion {"); - scr.add(" public static void main(String... args) {"); - scr.add(" System.out.println(System.getProperty(\"java.version\"));"); - scr.add(" }"); - scr.add("}"); - createFile(javaFile, scr); - compile(javaFile.getName()); - } - - private void createJar(Map manifestAttributes) throws IOException { - emitFile(); - - Manifest manifest = new Manifest(); - final Attributes mainAttributes = manifest.getMainAttributes(); - mainAttributes.putValue("Manifest-Version", "1.0"); - mainAttributes.putValue("Main-Class", PRINT_VERSION_CLASS); - manifestAttributes.forEach(mainAttributes::putValue); - - try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(VERSION_JAR), manifest)) { - jar.putNextEntry(new ZipEntry(PRINT_VERSION_CLASS + ".class")); - jar.write(Files.readAllBytes(clsFile.toPath())); - jar.closeEntry(); - } finally { - javaFile.delete(); - } - } - - private enum Flag { - EMPTY("", ""), - VERSION("-version:1.9", "Error: Specifying an alternate JDK/JRE version is no longer supported.\n" + - "The use of the flag '-version:' is no longer valid.\n" + - "Please download and execute the appropriate version."), - JRE_RESTRICT_SEARCH("-jre-restrict-search", "Error: Specifying an alternate JDK/JRE is no longer supported.\n" + - "The related flags -jre-restrict-search | -jre-no-restrict-search are also no longer valid."), - JRE_NO_RESTRICT_SEARCH("-jre-no-restrict-search", "Error: Specifying an alternate JDK/JRE is no longer supported.\n" + - "The related flags -jre-restrict-search | -jre-no-restrict-search are also no longer valid."); - private final String flag; - private final String errorMessage; - - Flag(String flag, String errorMessage) { - this.flag = flag; - this.errorMessage = errorMessage; - } - - String value() { - return flag; - } - - String errorMessage() { - return errorMessage; - } - } -} diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 49cc6e1431114..5aa703c5b26c2 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -133,6 +133,7 @@ public Map call() { map.put("vm.compiler1.enabled", this::isCompiler1Enabled); map.put("vm.compiler2.enabled", this::isCompiler2Enabled); map.put("docker.support", this::dockerSupport); + map.put("systemd.support", this::systemdSupport); map.put("vm.musl", this::isMusl); map.put("release.implementor", this::implementor); map.put("jdk.containerized", this::jdkContainerized); @@ -385,6 +386,7 @@ protected void vmOptFinalFlags(SafeMap map) { vmOptFinalFlag(map, "EnableJVMCI"); vmOptFinalFlag(map, "EliminateAllocations"); vmOptFinalFlag(map, "UseCompressedOops"); + vmOptFinalFlag(map, "UseLargePages"); vmOptFinalFlag(map, "UseVectorizedMismatchIntrinsic"); vmOptFinalFlag(map, "ZGenerational"); } @@ -610,7 +612,7 @@ protected String dockerSupport() { if (isSupported) { try { - isSupported = checkDockerSupport(); + isSupported = checkProgramSupport("checkDockerSupport()", Container.ENGINE_COMMAND); } catch (Exception e) { isSupported = false; } @@ -620,6 +622,27 @@ protected String dockerSupport() { return "" + isSupported; } + /** + * A simple check for systemd support + * + * @return true if systemd is supported in a given environment + */ + protected String systemdSupport() { + log("Entering systemdSupport()"); + + boolean isSupported = Platform.isLinux(); + if (isSupported) { + try { + isSupported = checkProgramSupport("checkSystemdSupport()", "systemd-run"); + } catch (Exception e) { + isSupported = false; + } + } + + log("systemdSupport(): returning isSupported = " + isSupported); + return "" + isSupported; + } + // Configures process builder to redirect process stdout and stderr to a file. // Returns file names for stdout and stderr. private Map redirectOutputToLogFile(String msg, ProcessBuilder pb, String fileNameBase) { @@ -654,17 +677,17 @@ private void printLogfileContent(Map logFileNames) { }); } - private boolean checkDockerSupport() throws IOException, InterruptedException { - log("checkDockerSupport(): entering"); - ProcessBuilder pb = new ProcessBuilder("which", Container.ENGINE_COMMAND); + private boolean checkProgramSupport(String logString, String cmd) throws IOException, InterruptedException { + log(logString + ": entering"); + ProcessBuilder pb = new ProcessBuilder("which", cmd); Map logFileNames = - redirectOutputToLogFile("checkDockerSupport(): which " + Container.ENGINE_COMMAND, - pb, "which-container"); + redirectOutputToLogFile(logString + ": which " + cmd, + pb, "which-cmd"); Process p = pb.start(); p.waitFor(10, TimeUnit.SECONDS); int exitValue = p.exitValue(); - log(String.format("checkDockerSupport(): exitValue = %s, pid = %s", exitValue, p.pid())); + log(String.format("%s: exitValue = %s, pid = %s", logString, exitValue, p.pid())); if (exitValue != 0) { printLogfileContent(logFileNames); } diff --git a/test/langtools/jdk/javadoc/doclet/testMarkdown/TestMarkdownCodeBlocks.java b/test/langtools/jdk/javadoc/doclet/testMarkdown/TestMarkdownCodeBlocks.java index 8f1c76b9e474d..dda8a76868e12 100644 --- a/test/langtools/jdk/javadoc/doclet/testMarkdown/TestMarkdownCodeBlocks.java +++ b/test/langtools/jdk/javadoc/doclet/testMarkdown/TestMarkdownCodeBlocks.java @@ -486,4 +486,107 @@ public int hashCode() {
        NullPointerException - if other is null
        """); } + + @Test + public void testLeadingCodeBlock(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + package p; + /// Leading code block + /// Lorum ipsum. + public class C { } + """); + + javadoc("-d", base.resolve("api").toString(), + "--no-platform-links", + "--source-path", src.toString(), + "p"); + checkExit(Exit.OK); + + // check first sentence is empty in package summary file + checkOutput("p/package-summary.html", true, + """ + +
         
        """); + + checkOutput("p/C.html", true, + """ +
        Leading code block
        +                    
        +

        Lorum ipsum.

        """); + + } + + @Test + public void testTrailingCodeBlock(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + package p; + /// Lorum ipsum. + /// + /// Trailing code block + public class C { } + """); + + javadoc("-d", base.resolve("api").toString(), + "--no-platform-links", + "--source-path", src.toString(), + "p"); + checkExit(Exit.OK); + + checkOutput("p/C.html", true, + """ +

        Lorum ipsum.

        +
        Trailing code block
        +                    
        +
        """); + } + + // this example is derived from the test case in JDK-8338525 + @Test + public void testLeadingTrailingCodeBlockWithAnnotations(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + package p; + public class C { + /// @Override + /// void m() {} + /// + /// Plain text + /// + /// @Override + /// void m() {} + public void m() {} + }"""); + + javadoc("-d", base.resolve("api").toString(), + "--no-platform-links", + "--source-path", src.toString(), + "p"); + checkExit(Exit.OK); + + checkOutput("p/C.html", true, + """ +
        void
        +
        m()
        +
         
        """, + """ +
        public \ + void m()
        +
        @Override
        +                    void m() {}
        +                    
        +

        Plain text

        +
        @Override
        +                    void m() {}
        +                    
        +
        """); + + } } diff --git a/test/langtools/tools/javac/MethodParameters/LambdaTest.out b/test/langtools/tools/javac/MethodParameters/LambdaTest.out index b03cc76a97be9..36b91b5e36de1 100644 --- a/test/langtools/tools/javac/MethodParameters/LambdaTest.out +++ b/test/langtools/tools/javac/MethodParameters/LambdaTest.out @@ -1,7 +1,7 @@ class LambdaTest -- LambdaTest.() LambdaTest.foo(i) -LambdaTest.lambda$static$1(arg0)/*synthetic*/ -LambdaTest.lambda$static$0(arg0, arg1)/*synthetic*/ +LambdaTest.lambda$static$0(arg0)/*synthetic*/ +LambdaTest.lambda$static$1(arg0, arg1)/*synthetic*/ static interface LambdaTest$I -- inner LambdaTest$I.m(x) diff --git a/test/langtools/tools/javac/MethodParameters/LocalClassTest.out b/test/langtools/tools/javac/MethodParameters/LocalClassTest.out index 3b95739e74a5e..7b0028e1fb0cf 100644 --- a/test/langtools/tools/javac/MethodParameters/LocalClassTest.out +++ b/test/langtools/tools/javac/MethodParameters/LocalClassTest.out @@ -1,7 +1,7 @@ class LocalClassTest$1 -- anon LocalClassTest$1.(final this$0/*implicit*/, final j, final val$i/*synthetic*/) class LocalClassTest$1CapturingLocal$1 -- anon -LocalClassTest$1CapturingLocal$1.(final this$0/*implicit*/, final val$val$i/*synthetic*/) +LocalClassTest$1CapturingLocal$1.(final this$0/*implicit*/, final val$i/*synthetic*/) LocalClassTest$1CapturingLocal$1.test() class LocalClassTest$1CapturingLocal -- inner LocalClassTest$1CapturingLocal.(final this$0/*implicit*/, final j, final val$i/*synthetic*/) diff --git a/test/langtools/tools/javac/T8019486/WrongLNTForLambdaTest.java b/test/langtools/tools/javac/T8019486/WrongLNTForLambdaTest.java index 24c9b81c96471..4ddc40fa231a2 100644 --- a/test/langtools/tools/javac/T8019486/WrongLNTForLambdaTest.java +++ b/test/langtools/tools/javac/T8019486/WrongLNTForLambdaTest.java @@ -136,15 +136,15 @@ void run() throws Exception { checkClassFile(new File(Paths.get(System.getProperty("user.dir"), "Foo.class").toUri()), "lambda$bar$0", simpleLambdaExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), - "Foo.class").toUri()), "lambda$variablesInLambdas$1", lambdaWithVarsExpectedLNT); + "Foo.class").toUri()), "lambda$variablesInLambdas$0", lambdaWithVarsExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), "Foo$1FooBar.class").toUri()), "run", insideLambdaWithVarsExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), - "Foo.class").toUri()), "lambda$variablesInLambdas$2", lambdaVoid2VoidExpectedLNT); + "Foo.class").toUri()), "lambda$variablesInLambdas$1", lambdaVoid2VoidExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), "Foo.class").toUri()), "$deserializeLambda$", deserializeExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), - "Foo.class").toUri()), "lambda$variablesInLambdas$3", lambdaBridgeExpectedLNT); + "Foo.class").toUri()), "lambda$variablesInLambdas$2", lambdaBridgeExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), "Foo.class").toUri()), "assignLambda", assignmentExpectedLNT); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), diff --git a/test/langtools/tools/javac/classfiles/attributes/EnclosingMethod/EnclosingMethodTest.java b/test/langtools/tools/javac/classfiles/attributes/EnclosingMethod/EnclosingMethodTest.java index b555014bebe67..f15771840f59a 100644 --- a/test/langtools/tools/javac/classfiles/attributes/EnclosingMethod/EnclosingMethodTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/EnclosingMethod/EnclosingMethodTest.java @@ -245,7 +245,6 @@ class EnclosingInitialization { // anonymous and local classes in lambda @ExpectedEnclosingMethod( info = "EnclosingLambda in EnclosingMethodTest", - enclosingMethod = "", enclosingClazz = EnclosingMethodTest.class ) class EnclosingLambda { @@ -325,7 +324,6 @@ class EnclosingInitialization { // anonymous and local classes in lambda @ExpectedEnclosingMethod( info = "EnclosingLambda in notEnclosing01", - enclosingMethod = "", enclosingClazz = notEnclosing01.class ) class EnclosingLambda { @@ -382,7 +380,6 @@ public interface notEnclosing02 { // anonymous and local classes in lambda @ExpectedEnclosingMethod( info = "EnclosingLambda in notEnclosing02", - enclosingMethod = "", enclosingClazz = notEnclosing02.class ) class EnclosingLambda { @@ -460,7 +457,6 @@ class EnclosingInitialization { // anonymous and local classes in lambda @ExpectedEnclosingMethod( info = "EnclosingLambda in notEnclosing03", - enclosingMethod = "", enclosingClazz = notEnclosing03.class ) class EnclosingLambda { @@ -517,7 +513,6 @@ static class VariableInitializer { // anonymous and local classes in lambda @ExpectedEnclosingMethod( info = "EnclosingLambda in notEnclosing04", - enclosingMethod = "", enclosingClazz = notEnclosing04.class ) class EnclosingLambda { diff --git a/test/langtools/tools/javac/doctree/DocCommentTester.java b/test/langtools/tools/javac/doctree/DocCommentTester.java index f14dde2e567cd..d418005745a0d 100644 --- a/test/langtools/tools/javac/doctree/DocCommentTester.java +++ b/test/langtools/tools/javac/doctree/DocCommentTester.java @@ -1043,8 +1043,9 @@ String normalize(String s, boolean isLineComment, boolean normalizeTags) { .replaceAll("(\\{@value\\s+[^}]+)\\s+(})", "$1$2"); } + // See comment in MarkdownTest for explanation of dummy and Override String normalizeFragment(String s) { - return s.replaceAll("\n[ \t]+@(?!([@*]|dummy))", "\n@"); + return s.replaceAll("\n[ \t]+@(?!([@*]|(dummy|Override)))", "\n@"); } int copyLiteral(String s, int start, StringBuilder sb) { diff --git a/test/langtools/tools/javac/doctree/MarkdownTest.java b/test/langtools/tools/javac/doctree/MarkdownTest.java index 8da9e6ed44c2e..3ec23076db9a8 100644 --- a/test/langtools/tools/javac/doctree/MarkdownTest.java +++ b/test/langtools/tools/javac/doctree/MarkdownTest.java @@ -40,6 +40,7 @@ * In the tests for code spans and code blocks, "@dummy" is used as a dummy inline * or block tag to verify that it is skipped as part of the code span or code block. * In other words, "@dummy" should appear as a literal part of the Markdown content. + * ("@Override" is also treated the same way, as a commonly found annotation.) * Conversely, standard tags are used to verify that a fragment of text is not being * skipped as a code span or code block. In other words, they should be recognized as tags * and not skipped as part of any Markdown content. @@ -409,6 +410,32 @@ void indentedCodeBlock_afterFencedCodeBlock() { } RawText[MARKDOWN, pos:85, .] block tags: empty ] +*/ + + /// Indented Code Block + /// Lorum ipsum. + void indentedCodeBlock_leading() { } +/* +DocComment[DOC_COMMENT, pos:0 + firstSentence: empty + body: 1 + RawText[MARKDOWN, pos:0, ____Indented_Code_Block|Lorum_ipsum.] + block tags: empty +] +*/ + + /// Lorum ipsum. + /// + /// Indented Code Block + void indentedCodeBlock_trailing() { } +/* +DocComment[DOC_COMMENT, pos:0 + firstSentence: 1 + RawText[MARKDOWN, pos:0, Lorum_ipsum.] + body: 1 + RawText[MARKDOWN, pos:18, Indented_Code_Block] + block tags: empty +] */ ///123. @@ -613,5 +640,24 @@ void indent8() { } ] */ +// The following test case is derived from the test case in JDK-8338525. + + /// @Override + /// void m() { } + /// + /// Plain text + /// + /// @Override + /// void m() { } + void leadingTrailingCodeBlocksWithAnnos() { } +/* +DocComment[DOC_COMMENT, pos:0 + firstSentence: empty + body: 1 + RawText[MARKDOWN, pos:0, ____@Override|____void_m()_{_}||...||____@Override|____void_m()_{_}] + block tags: empty +] +*/ + } diff --git a/test/langtools/tools/javac/lambda/CaptureVarOrder.java b/test/langtools/tools/javac/lambda/CaptureVarOrder.java new file mode 100644 index 0000000000000..0bfa061cb4f32 --- /dev/null +++ b/test/langtools/tools/javac/lambda/CaptureVarOrder.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8336492 + * @summary Regression in lambda serialization + */ + +public class CaptureVarOrder { + static Object m(String s, int i, Object o) { + return new Object() { + final byte B = 0; + void g() { System.out.println(s + i + B + o); } + }; + } + + static Runnable r(String s, int i, Object o) { + final byte B = 0; + return () -> System.out.println(s + i + B + o); + } + + public static void main(String[] args) throws ReflectiveOperationException { + CaptureVarOrder.class.getDeclaredMethod("lambda$r$0", String.class, int.class, Object.class); + m("", 1, null).getClass().getDeclaredConstructor(String.class, int.class, Object.class); + } +} diff --git a/test/langtools/tools/javac/lambda/SerializedLambdaInLocalClass.java b/test/langtools/tools/javac/lambda/SerializedLambdaInLocalClass.java new file mode 100644 index 0000000000000..c015182f44956 --- /dev/null +++ b/test/langtools/tools/javac/lambda/SerializedLambdaInLocalClass.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8336492 + * @summary Regression in lambda serialization + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.function.*; + +public class SerializedLambdaInLocalClass { + + public static void main(String[] args) { + SerializedLambdaInLocalClass s = new SerializedLambdaInLocalClass(); + s.test(s::f_lambda_in_anon); + s.test(s::f_lambda_in_local); + s.test(s::f_lambda_in_lambda); + } + + void test(IntFunction> fSupplier) { + try { + F f = fSupplier.apply(42).get(); + var baos = new ByteArrayOutputStream(); + // write + try (var oos = new ObjectOutputStream(baos)) { + oos.writeObject(f); + } + byte[] bytes = baos.toByteArray(); + var bais = new ByteArrayInputStream(bytes); + // read + try (var ois = new ObjectInputStream(bais)) { + F f2 = (F)ois.readObject(); + if (f2.getValue() != f.getValue()) { + throw new AssertionError(String.format("Found: %d, expected %d", f2.getValue(), f.getValue())); + } + } + } catch (IOException | ClassNotFoundException ex) { + throw new AssertionError(ex); + } + } + + interface F extends Serializable { + int getValue(); + } + + Supplier f_lambda_in_anon(int x) { + return new Supplier() { + @Override + public F get() { + return () -> x; + } + }; + } + + Supplier f_lambda_in_local(int x) { + class FSupplier implements Supplier { + @Override + public F get() { + return () -> x; + } + } + return new FSupplier(); + } + + Supplier f_lambda_in_lambda(int x) { + return () -> () -> x; + } +} diff --git a/test/lib/jdk/test/lib/containers/systemd/SystemdRunOptions.java b/test/lib/jdk/test/lib/containers/systemd/SystemdRunOptions.java new file mode 100644 index 0000000000000..5f5d513a8b28d --- /dev/null +++ b/test/lib/jdk/test/lib/containers/systemd/SystemdRunOptions.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.test.lib.containers.systemd; + +import static jdk.test.lib.Asserts.assertNotNull; + +import java.util.ArrayList; +import java.util.Collections; + + +// This class represents options for running java inside systemd slices +// in test environment. +public class SystemdRunOptions { + public ArrayList javaOpts = new ArrayList<>(); + public String classToRun; // class or "-version" + public ArrayList classParams = new ArrayList<>(); + public String memoryLimit; // used in slice for MemoryLimit property + public String cpuLimit; // used in slice for CPUQuota property + public String sliceName; // name of the slice (nests CPU in memory) + public String sliceDMemoryLimit; // used in jdk_internal.slice.d + public String sliceDCpuLimit; // used in jdk_internal.slice.d + + /** + * Convenience constructor for most common use cases in testing. + * @param classToRun a class to run, or "-version" + * @param javaOpts java options to use + * + * @return Default docker run options + */ + public SystemdRunOptions(String classToRun, String... javaOpts) { + this.classToRun = classToRun; + Collections.addAll(this.javaOpts, javaOpts); + this.sliceName = defaultSliceName(); + } + + private static String defaultSliceName() { + // Create a unique name for a systemd slice + // jtreg guarantees that test.name is unique among all concurrently executing + // tests. For example, if you have two test roots: + // + // $ find test -type f + // test/foo/TEST.ROOT + // test/foo/my/TestCase.java + // test/bar/TEST.ROOT + // test/bar/my/TestCase.java + // $ jtreg -concur:2 test/foo test/bar + // + // jtreg will first run all the tests under test/foo. When they are all finished, then + // jtreg will run all the tests under test/bar. So you will never have two concurrent + // test cases whose test.name is "my/TestCase.java" + String testname = System.getProperty("test.name"); + assertNotNull(testname, "must be set by jtreg"); + testname = testname.replace(".java", ""); + testname = testname.replace("/", "_"); + testname = testname.replace("\\", "_"); + testname = testname.replace("-", "_"); + + // Example: + // Memory: "test_containers_systemd_TestMemoryAwareness" + // CPU: "test_containers_systemd_TestMemoryAwareness-cpu" => derived + return testname; + } + + /** + * The memory limit set with a .slice file in the systemd + * config directory. + * + * @param memLimit The memory limit to set (e.g. 1000M). + * @return The run options. + */ + public SystemdRunOptions memoryLimit(String memLimit) { + this.memoryLimit = memLimit; + return this; + } + + /** + * The memory limit to set in the top-level jdk_internal.slice.d + * systemd config directory. + * + * @param memoryLimit The memory limit to set. + * @return The run options. + */ + public SystemdRunOptions sliceDMemoryLimit(String memoryLimit) { + this.sliceDMemoryLimit = memoryLimit; + return this; + } + + /** + * The CPU limit set with a .slice file in the systemd + * config directory. + * + * @param cpuLimit + * @return The run options. + */ + public SystemdRunOptions cpuLimit(String cpuLimit) { + this.cpuLimit = cpuLimit; + return this; + } + + /** + * The Cpu limit set in the top-level jdk_internal.slice.d + * systemd config directory. + * + * @param cpuLimit The CPU limit to set to. + * @return The run options. + */ + public SystemdRunOptions sliceDCpuLimit(String cpuLimit) { + this.sliceDCpuLimit = cpuLimit; + return this; + } + + public SystemdRunOptions sliceName(String name) { + this.sliceName = name; + return this; + } + + public SystemdRunOptions addJavaOpts(String... opts) { + Collections.addAll(javaOpts, opts); + return this; + } + + public SystemdRunOptions addClassOptions(String... opts) { + Collections.addAll(classParams,opts); + return this; + } + + public boolean hasSliceDLimit() { + return this.sliceDMemoryLimit != null || + this.sliceDCpuLimit != null; + } +} diff --git a/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java b/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java new file mode 100644 index 0000000000000..9acff93aaca23 --- /dev/null +++ b/test/lib/jdk/test/lib/containers/systemd/SystemdTestUtils.java @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2024, Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.test.lib.containers.systemd; + +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import jdk.internal.platform.Metrics; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.util.FileUtils; +import jtreg.SkippedException; + +public class SystemdTestUtils { + + private static final String CGROUPS_PROVIDER = Metrics.systemMetrics().getProvider(); + private static boolean CGROUPS_V2 = "cgroupv2".equals(CGROUPS_PROVIDER); + public static boolean RUN_AS_USER = !Platform.isRoot() && CGROUPS_V2; + private static final String SLICE_NAMESPACE_PREFIX = "jdk_internal"; + private static final String SLICE_D_MEM_CONFIG_FILE = "memory-limit.conf"; + private static final String SLICE_D_CPU_CONFIG_FILE = "cpu-limit.conf"; + private static final String USER_HOME = System.getProperty("user.home"); + private static final Path SYSTEMD_CONFIG_HOME_ROOT = Path.of("/", "etc", "systemd", "system"); + private static final Path SYSTEMD_CONFIG_HOME_USER = Path.of(USER_HOME, ".config", "systemd", "user"); + private static final Path SYSTEMD_CONFIG_HOME = Platform.isRoot() ? SYSTEMD_CONFIG_HOME_ROOT : SYSTEMD_CONFIG_HOME_USER; + + // Specifies how many lines to copy from child STDOUT to main test output. + // Having too many lines in the main test output will result + // in JT harness trimming the output, and can lead to loss of useful + // diagnostic information. + private static final int MAX_LINES_TO_COPY_FOR_CHILD_STDOUT = 100; + + public record ResultFiles(Path memory, Path cpu, Path sliceDotDDir) {} + + /** + * Create commonly used options with the class to be launched inside the + * systemd slice + * + * @param testClass The test class or {@code -version} + * @return The basic options. + */ + public static SystemdRunOptions newOpts(String testClass) { + return new SystemdRunOptions(testClass, + "-Xlog:os+container=trace", + "-cp", + Utils.TEST_CLASSES); + } + + /** + * Run Java inside a systemd slice with specified parameters and options. + * + * @param opts The systemd slice options when running java + * @return An OutputAnalyzer of the output of the command than ran. + * @throws Exception If something went wrong. + * @throws SkippedException If the test cannot be run (i.e. non-root user + * on cgroups v1). + */ + public static OutputAnalyzer buildAndRunSystemdJava(SystemdRunOptions opts) throws Exception, SkippedException { + if (!Platform.isRoot() && !CGROUPS_V2) { + throw new SkippedException("Systemd tests require root on cgroup v1. Test skipped!"); + } + ResultFiles files = SystemdTestUtils.buildSystemdSlices(opts); + + try { + return SystemdTestUtils.systemdRunJava(opts); + } finally { + cleanupFiles(files); + } + } + + private static void cleanupFiles(ResultFiles files) throws IOException { + try { + if (files.memory() != null) { + Files.delete(files.memory()); + } + if (files.cpu() != null) { + Files.delete(files.cpu()); + } + if (files.sliceDotDDir() != null) { + FileUtils.deleteFileTreeUnchecked(files.sliceDotDDir()); + } + } catch (NoSuchFileException e) { + // ignore + } + } + + private static OutputAnalyzer systemdRunJava(SystemdRunOptions opts) throws Exception { + return execute(buildJavaCommand(opts)); + } + + /** + * Create systemd slice files under /etc/systemd/system. + * + * The JDK will then run within that slice as provided by the SystemdRunOptions. + * + * @param runOpts The systemd slice options to use when running the test. + * @return The systemd slice files (for cleanup-purposes later). + * @throws Exception + */ + private static ResultFiles buildSystemdSlices(SystemdRunOptions runOpts) throws Exception { + String sliceName = sliceName(runOpts); + String sliceNameCpu = sliceNameCpu(runOpts); + + // Generate systemd slices for cpu/memory + String memorySliceContent = getMemorySlice(runOpts, sliceName); + String cpuSliceContent = getCpuSlice(runOpts, sliceName); + + // Ensure base directory exists + Files.createDirectories(SYSTEMD_CONFIG_HOME); + Path sliceDotDDir = null; + if (runOpts.hasSliceDLimit()) { + String dirName = String.format("%s.slice.d", SLICE_NAMESPACE_PREFIX); + sliceDotDDir = SYSTEMD_CONFIG_HOME.resolve(Path.of(dirName)); + // Using createDirectories since we only need to ensure the directory + // exists. Ignore it if already existent. + Files.createDirectories(sliceDotDDir); + + if (runOpts.sliceDMemoryLimit != null) { + Path memoryConfig = sliceDotDDir.resolve(Path.of(SLICE_D_MEM_CONFIG_FILE)); + Files.writeString(memoryConfig, + getMemoryDSliceContent(runOpts), + StandardOpenOption.TRUNCATE_EXISTING, + StandardOpenOption.CREATE); + } + if (runOpts.sliceDCpuLimit != null) { + Path cpuConfig = sliceDotDDir.resolve(Path.of(SLICE_D_CPU_CONFIG_FILE)); + Files.writeString(cpuConfig, + getCPUDSliceContent(runOpts), + StandardOpenOption.TRUNCATE_EXISTING, + StandardOpenOption.CREATE); + } + } + + Path memory, cpu; + try { + // memory slice + memory = SYSTEMD_CONFIG_HOME.resolve(Path.of(sliceFileName(sliceName))); + // cpu slice nested in memory + cpu = SYSTEMD_CONFIG_HOME.resolve(Path.of(sliceFileName(sliceNameCpu))); + Files.writeString(memory, memorySliceContent); + Files.writeString(cpu, cpuSliceContent); + } catch (IOException e) { + throw new AssertionError("Failed to write systemd slice files"); + } + + systemdDaemonReload(cpu, memory, sliceDotDDir); + + return new ResultFiles(memory, cpu, sliceDotDDir); + } + + private static String sliceName(SystemdRunOptions runOpts) { + // Slice name may include '-' which is a hierarchical slice indicator. + // Replace '-' with '_' to avoid side-effects. + return SLICE_NAMESPACE_PREFIX + "-" + runOpts.sliceName.replace("-", "_"); + } + + private static String sliceNameCpu(SystemdRunOptions runOpts) { + String slice = sliceName(runOpts); + return String.format("%s-cpu", slice); + } + + private static void systemdDaemonReload(Path cpu, Path memory, Path sliceDdir) throws Exception { + List daemonReload = systemCtl(); + daemonReload.add("daemon-reload"); + + if (execute(daemonReload).getExitValue() != 0) { + if (RUN_AS_USER) { + cleanupFiles(new ResultFiles(cpu, memory, sliceDdir)); + // When run as user the systemd user manager needs to be + // accessible and working. This is usually the case when + // connected via SSH or user login, but may not work for + // sessions set up via 'su ' or similar. + // In that case, 'systemctl --user status' usually doesn't + // work. There is no other option than skip the test. + String msg = "Service user@.service not properly configured. " + + "Skipping the test!"; + throw new SkippedException(msg); + } else { + throw new AssertionError("Failed to reload systemd daemon"); + } + } + } + + private static List systemCtl() { + return commandWithUser("systemctl"); + } + + /** + * 'baseCommand' or 'baseCommand --user' as list, depending on the cgroups + * version and running user. + * + * @return 'baseCommand' if we are the root user, 'systemctl --user' if + * the current user is non-root and we are on cgroups v2. Note: + * Cgroups v1 and non-root is not possible as tests are skipped then. + */ + private static List commandWithUser(String baseCommand) { + List command = new ArrayList<>(); + command.add(baseCommand); + if (RUN_AS_USER) { + command.add("--user"); + } + return command; + } + + private static String getCpuSlice(SystemdRunOptions runOpts, String sliceName) { + String basicSliceFormat = getBasicSliceFormat(); + return String.format(basicSliceFormat, sliceName, getCPUSliceContent(runOpts)); + } + + private static String getCPUSliceContent(SystemdRunOptions runOpts) { + String format = basicCPUContentFormat(); + return String.format(format, runOpts.cpuLimit); + } + + private static String getMemorySlice(SystemdRunOptions runOpts, String sliceName) { + String basicSliceFormat = getBasicSliceFormat(); + return String.format(basicSliceFormat, sliceName, getMemorySliceContent(runOpts)); + } + + private static String getMemoryDSliceContent(SystemdRunOptions runOpts) { + String format = "[Slice]\n" + basicMemoryContentFormat(); + return String.format(format, runOpts.sliceDMemoryLimit); + } + + private static String getCPUDSliceContent(SystemdRunOptions runOpts) { + String format = "[Slice]\n" + basicCPUContentFormat(); + return String.format(format, runOpts.sliceDCpuLimit); + } + + private static String basicCPUContentFormat() { + return """ + CPUAccounting=true + CPUQuota=%s + """; + } + + private static String basicMemoryContentFormat() { + return """ + MemoryAccounting=true + MemoryLimit=%s + """; + } + + private static String getMemorySliceContent(SystemdRunOptions runOpts) { + String format = basicMemoryContentFormat(); + + return String.format(format, runOpts.memoryLimit); + } + + private static String getBasicSliceFormat() { + return """ + [Unit] + Description=OpenJDK Tests Slice for %s + Before=slices.target + + [Slice] + %s + """; + } + + private static String sliceFileName(String sliceName) { + return String.format("%s.slice", sliceName); + } + + /** + * Build the java command to run inside a systemd slice + * + * @param SystemdRunOptions options for running the systemd slice test + * + * @return command + * @throws Exception + */ + private static List buildJavaCommand(SystemdRunOptions opts) throws Exception { + // systemd-run [--user] --slice .slice --scope + List javaCmd = systemdRun(); + javaCmd.add("--slice"); + javaCmd.add(sliceFileName(sliceNameCpu(opts))); + javaCmd.add("--scope"); + javaCmd.add(Path.of(Utils.TEST_JDK, "bin", "java").toString()); + javaCmd.addAll(opts.javaOpts); + javaCmd.add(opts.classToRun); + javaCmd.addAll(opts.classParams); + return javaCmd; + } + + private static List systemdRun() { + return commandWithUser("systemd-run"); + } + + /** + * Execute a specified command in a process, report diagnostic info. + * + * @param command to be executed + * @return The output from the process + * @throws Exception + */ + private static OutputAnalyzer execute(List command) throws Exception { + return execute(command.toArray(String[]::new)); + } + + /** + * Execute a specified command in a process, report diagnostic info. + * + * @param command to be executed + * @return The output from the process + * @throws Exception + */ + private static OutputAnalyzer execute(String... command) throws Exception { + ProcessBuilder pb = new ProcessBuilder(command); + System.out.println("[COMMAND]\n" + Utils.getCommandLine(pb)); + + Process p = pb.start(); + long pid = p.pid(); + OutputAnalyzer output = new OutputAnalyzer(p); + + int max = MAX_LINES_TO_COPY_FOR_CHILD_STDOUT; + String stdout = output.getStdout(); + String stdoutLimited = limitLines(stdout, max); + System.out.println("[STDERR]\n" + output.getStderr()); + System.out.println("[STDOUT]\n" + stdoutLimited); + if (stdout != stdoutLimited) { + System.out.printf("Child process STDOUT is limited to %d lines\n", + max); + } + + String stdoutLogFile = String.format("systemd-stdout-%d.log", pid); + writeOutputToFile(stdout, stdoutLogFile); + System.out.println("Full child process STDOUT was saved to " + stdoutLogFile); + + return output; + } + + private static void writeOutputToFile(String output, String fileName) throws Exception { + try (FileWriter fw = new FileWriter(fileName)) { + fw.write(output, 0, output.length()); + } + } + + private static String limitLines(String buffer, int nrOfLines) { + List l = Arrays.asList(buffer.split("\\R")); + if (l.size() < nrOfLines) { + return buffer; + } + + return String.join("\n", l.subList(0, nrOfLines)); + } +} diff --git a/test/lib/jdk/test/lib/thread/TestThreadFactory.java b/test/lib/jdk/test/lib/thread/TestThreadFactory.java new file mode 100644 index 0000000000000..ac5a6b7490929 --- /dev/null +++ b/test/lib/jdk/test/lib/thread/TestThreadFactory.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.test.lib.thread; + +import java.util.concurrent.ThreadFactory; + +/* + This factory is used to start new threads in tests. + It supports creation of virtual threads when jtreg test.thread.factory plugin is enabled. +*/ + +public class TestThreadFactory { + + private static ThreadFactory threadFactory = "Virtual".equals(System.getProperty("test.thread.factory")) + ? virtualThreadFactory() : platformThreadFactory(); + + public static Thread newThread(Runnable task) { + return threadFactory.newThread(task); + } + + public static Thread newThread(Runnable task, String name) { + Thread t = threadFactory.newThread(task); + t.setName(name); + return t; + } + + private static ThreadFactory platformThreadFactory() { + return Thread.ofPlatform().factory(); + } + + private static ThreadFactory virtualThreadFactory() { + return Thread.ofVirtual().factory(); + } +} diff --git a/test/lib/jdk/test/lib/util/ForceGC.java b/test/lib/jdk/test/lib/util/ForceGC.java index 19bbef1f7e4c0..e3587b9a2bebc 100644 --- a/test/lib/jdk/test/lib/util/ForceGC.java +++ b/test/lib/jdk/test/lib/util/ForceGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, 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 @@ -78,29 +78,30 @@ public static boolean waitFor(BooleanSupplier booleanSupplier, long timeout) { ReferenceQueue queue = new ReferenceQueue<>(); Object obj = new Object(); PhantomReference ref = new PhantomReference<>(obj, queue); - obj = null; - Reference.reachabilityFence(obj); - Reference.reachabilityFence(ref); + try { + obj = null; - int retries = (int)(timeout / 200); - for (; retries >= 0; retries--) { - if (booleanSupplier.getAsBoolean()) { - return true; - } + int retries = (int) (timeout / 200); + for (; retries >= 0; retries--) { + if (booleanSupplier.getAsBoolean()) { + return true; + } - System.gc(); + System.gc(); - try { - // The remove() will always block for the specified milliseconds - // if the reference has already been removed from the queue. - // But it is fine. For most cases, the 1st GC is sufficient - // to trigger and complete the cleanup. - queue.remove(200L); - } catch (InterruptedException ie) { - // ignore, the loop will try again + try { + // The remove() will always block for the specified milliseconds + // if the reference has already been removed from the queue. + // But it is fine. For most cases, the 1st GC is sufficient + // to trigger and complete the cleanup. + queue.remove(200L); + } catch (InterruptedException ie) { + // ignore, the loop will try again + } } + } finally { + Reference.reachabilityFence(ref); } - return booleanSupplier.getAsBoolean(); } } diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index 607e9552945b5..8883e8332d5d6 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -769,6 +769,7 @@ public native int validateCgroup(String procCgroups, public native void printOsInfo(); public native long hostPhysicalMemory(); public native long hostPhysicalSwap(); + public native int hostCPUs(); // Decoder public native void disableElfSectionCache(); diff --git a/test/micro/org/openjdk/bench/java/lang/foreign/CopyTest.java b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkCopy.java similarity index 76% rename from test/micro/org/openjdk/bench/java/lang/foreign/CopyTest.java rename to test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkCopy.java index 8996b1de11742..22ef139aac08a 100644 --- a/test/micro/org/openjdk/bench/java/lang/foreign/CopyTest.java +++ b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkCopy.java @@ -41,21 +41,16 @@ import java.nio.ByteBuffer; import java.util.concurrent.TimeUnit; -import static java.lang.foreign.ValueLayout.*; - @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @State(Scope.Thread) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(value = 3) -public class CopyTest { +public class SegmentBulkCopy { - @Param({"0", "1", "2", "3", "4", "5", "6", "7", "8", - "9", "10", "11", "12", "13", "14", "15", "16", - "17", "18", "19", "20", "21", "22", "23", "24", - "25", "26", "27", "28", "29", "30", "31", "32", - "33", "36", "40", "44", "48", "52", "56", "60", "63", "64", "128"}) + @Param({"2", "3", "4", "5", "6", "7", "8", "64", "512", + "4096", "32768", "262144", "2097152", "16777216", "134217728"}) public int ELEM_SIZE; byte[] srcArray; @@ -80,28 +75,37 @@ public void setup() { } @Benchmark - public void array_copy() { + public void arrayCopy() { System.arraycopy(srcArray, 0, dstArray, 0, ELEM_SIZE); } @Benchmark - public void heap_segment_copy5Arg() { + public void bufferCopy() { + dstBuffer.put(srcBuffer); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.copy=31"}) + @Benchmark + public void heapSegmentCopyJava() { MemorySegment.copy(heapSrcSegment, 0, heapDstSegment, 0, ELEM_SIZE); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.copy=0"}) @Benchmark - public void native_segment_copy5Arg() { - MemorySegment.copy(nativeSrcSegment, 0, nativeDstSegment, 0, ELEM_SIZE); + public void heapSegmentCopyUnsafe() { + MemorySegment.copy(heapSrcSegment, 0, heapDstSegment, 0, ELEM_SIZE); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.copy=31"}) @Benchmark - public void heap_segment_copy7arg() { - MemorySegment.copy(heapSrcSegment, JAVA_BYTE, 0, heapDstSegment, JAVA_BYTE, 0, ELEM_SIZE); + public void nativeSegmentCopyJava() { + MemorySegment.copy(nativeSrcSegment, 0, nativeDstSegment, 0, ELEM_SIZE); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.copy=0"}) @Benchmark - public void buffer_copy() { - dstBuffer.put(srcBuffer); + public void nativeSegmentCopyUnsafe() { + MemorySegment.copy(nativeSrcSegment, 0, nativeDstSegment, 0, ELEM_SIZE); } } diff --git a/test/micro/org/openjdk/bench/java/lang/foreign/TestFill.java b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkFill.java similarity index 69% rename from test/micro/org/openjdk/bench/java/lang/foreign/TestFill.java rename to test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkFill.java index 78719f03bc377..95ca722896944 100644 --- a/test/micro/org/openjdk/bench/java/lang/foreign/TestFill.java +++ b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkFill.java @@ -48,13 +48,10 @@ @State(Scope.Thread) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(value = 3) -public class TestFill { +public class SegmentBulkFill { - @Param({"0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", "10", "11", "12", "13", "14", "15", - "16", "17", "18", "19", "20", "21", "22", "23", - "24", "25", "26", "27", "28", "29", "30", "31", - "32", "128", "256", "384", "511", "512"}) + @Param({"2", "3", "4", "5", "6", "7", "8", "64", "512", + "4096", "32768", "262144", "2097152", "16777216", "134217728"}) public int ELEM_SIZE; byte[] array; @@ -73,22 +70,43 @@ public void setup() { } @Benchmark - public void arrays_fill() { + public void arraysFill() { Arrays.fill(array, (byte) 0); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=31"}) @Benchmark - public void heap_segment_fill() { + public void heapSegmentFillJava() { heapSegment.fill((byte) 0); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=0"}) @Benchmark - public void native_segment_fill() { + public void heapSegmentFillUnsafe() { + heapSegment.fill((byte) 0); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=31"}) + @Benchmark + public void nativeSegmentFillJava() { + nativeSegment.fill((byte) 0); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=0"}) + @Benchmark + public void nativeSegmentFillUnsafe() { nativeSegment.fill((byte) 0); } + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=31"}) + @Benchmark + public void unalignedSegmentFillJava() { + unalignedSegment.fill((byte) 0); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.fill=0"}) @Benchmark - public void unaligned_segment_fill() { + public void unalignedSegmentFillUnsafe() { unalignedSegment.fill((byte) 0); } diff --git a/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkMismatch.java b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkMismatch.java new file mode 100644 index 0000000000000..5656b2f6b9f74 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/lang/foreign/SegmentBulkMismatch.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.bench.java.lang.foreign; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.util.Arrays; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import static java.lang.foreign.ValueLayout.*; + +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@State(Scope.Thread) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Fork(value = 3) +public class SegmentBulkMismatch { + + @Param({"2", "3", "4", "5", "6", "7", "8", "64", "512", + "4096", "32768", "262144", "2097152", "16777216", "134217728"}) + public int ELEM_SIZE; + + MemorySegment srcNative; + MemorySegment dstNative; + byte[] srcArray; + byte[] dstArray; + MemorySegment srcHeap; + MemorySegment dstHeap; + + @Setup + public void setup() { + // Always use the same alignment regardless of size + srcNative = Arena.ofAuto().allocate(ELEM_SIZE,16); + dstNative = Arena.ofAuto().allocate(ELEM_SIZE, 16); + var rnd = new Random(42); + for (int i = 0; i < ELEM_SIZE; i++) { + srcNative.set(JAVA_BYTE, i, (byte) rnd.nextInt(Byte.MIN_VALUE, Byte.MAX_VALUE)); + } + dstNative.copyFrom(srcNative); + srcArray = srcNative.toArray(JAVA_BYTE); + dstArray = dstNative.toArray(JAVA_BYTE); + srcHeap = MemorySegment.ofArray(srcArray); + dstHeap = MemorySegment.ofArray(dstArray); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.mismatch=31"}) + @Benchmark + public long nativeSegmentJava() { + return srcNative.mismatch(dstNative); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.mismatch=31"}) + @Benchmark + public long heapSegmentJava() { + return srcHeap.mismatch(dstHeap); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.mismatch=0"}) + @Benchmark + public long nativeSegmentUnsafe() { + return srcNative.mismatch(dstNative); + } + + @Fork(value = 3, jvmArgsAppend = {"-Djava.lang.foreign.native.threshold.power.mismatch=0"}) + @Benchmark + public long heapSegmentUnsafe() { + return srcHeap.mismatch(dstHeap); + } + + @Benchmark + public long array() { + return Arrays.mismatch(srcArray, dstArray); + } + +} + diff --git a/test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyBench.java b/test/micro/org/openjdk/bench/java/lang/reflect/proxy/ProxyBench.java similarity index 100% rename from test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyBench.java rename to test/micro/org/openjdk/bench/java/lang/reflect/proxy/ProxyBench.java diff --git a/test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyPerf.java b/test/micro/org/openjdk/bench/java/lang/reflect/proxy/ProxyGeneratorBench.java similarity index 57% rename from test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyPerf.java rename to test/micro/org/openjdk/bench/java/lang/reflect/proxy/ProxyGeneratorBench.java index 22fe4d3ef28db..3393431730080 100644 --- a/test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyPerf.java +++ b/test/micro/org/openjdk/bench/java/lang/reflect/proxy/ProxyGeneratorBench.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, 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 @@ -26,7 +26,6 @@ import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.CompilerControl; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; @@ -36,37 +35,29 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; -import org.openjdk.jmh.infra.Blackhole; - import java.lang.reflect.InvocationHandler; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.util.concurrent.TimeUnit; /** * Benchmark measuring java.lang.reflect.ProxyGenerator.generateProxyClass. * It bypasses the cache of proxies to measure the time to construct a proxy. */ -@Warmup(iterations = 5) -@Measurement(iterations = 10) -@Fork(value = 1) +@Warmup(iterations = 5, time = 2) +@Measurement(iterations = 5, time = 2) +@Fork(value = 1, jvmArgsPrepend = "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED") @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Thread) -public class ProxyPerf { +public class ProxyGeneratorBench { /** * Sample results from a Dell T7610. * Benchmark Mode Cnt Score Error Units * ProxyPerf.genIntf_1 avgt 10 35325.428 +/- 780.459 ns/op - * ProxyPerf.genIntf_1_V49 avgt 10 34309.423 +/- 727.188 ns/op * ProxyPerf.genStringsIntf_3 avgt 10 46600.366 +/- 663.812 ns/op - * ProxyPerf.genStringsIntf_3_V49 avgt 10 45911.817 +/- 1598.536 ns/op * ProxyPerf.genZeroParams avgt 10 33245.048 +/- 437.988 ns/op - * ProxyPerf.genZeroParams_V49 avgt 10 32954.254 +/- 1041.932 ns/op - * ProxyPerf.getPrimsIntf_2 avgt 10 43987.819 +/- 837.443 ns/op - * ProxyPerf.getPrimsIntf_2_V49 avgt 10 42863.462 +/- 1193.480 ns/op + * ProxyPerf.genPrimsIntf_2 avgt 10 43987.819 +/- 837.443 ns/op */ public interface Intf_1 { @@ -84,7 +75,6 @@ public interface Intf_3 { public String m2String(String s1, String s2); } - private InvocationHandler handler; private ClassLoader classloader; private Method proxyGen; private Method proxyGenV49; @@ -92,19 +82,11 @@ public interface Intf_3 { @Setup public void setup() { try { - handler = (Object proxy, Method method, Object[] args) -> null; classloader = ClassLoader.getSystemClassLoader(); Class proxyGenClass = Class.forName("java.lang.reflect.ProxyGenerator"); proxyGen = proxyGenClass.getDeclaredMethod("generateProxyClass", ClassLoader.class, String.class, java.util.List.class, int.class); proxyGen.setAccessible(true); - - // Init access to the old Proxy generator - Class proxyGenClassV49 = Class.forName("java.lang.reflect.ProxyGenerator_v49"); - proxyGenV49 = proxyGenClassV49.getDeclaredMethod("generateProxyClass", - String.class, java.util.List.class, int.class); - proxyGenV49.setAccessible(true); - } catch (Exception ex) { ex.printStackTrace(); throw new RuntimeException("ProxyClass setup fails", ex); @@ -112,51 +94,35 @@ public void setup() { } @Benchmark - public void genZeroParams(Blackhole bh) throws Exception { + public Object genZeroParams() throws Exception { List> interfaces = List.of(Runnable.class); - bh.consume(proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1)); + return proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1); } @Benchmark - public void genIntf_1(Blackhole bh) throws Exception { + public Object genIntf_1() throws Exception { List> interfaces = List.of(Intf_1.class); - bh.consume(proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1)); + return proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1); } @Benchmark - public void getPrimsIntf_2(Blackhole bh) throws Exception { + public Object genPrimsIntf_2() throws Exception { List> interfaces = List.of(Intf_2.class); - bh.consume(proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1)); - } - @Benchmark - public void genStringsIntf_3(Blackhole bh) throws Exception { - List> interfaces = List.of(Intf_3.class); - bh.consume(proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1)); + return proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1); } - // Generate using the V49inal generator for comparison - @Benchmark - public void genZeroParams_V49(Blackhole bh) throws Exception { - List> interfaces = List.of(Runnable.class); - bh.consume(proxyGenV49.invoke(null, "ProxyImpl", interfaces, 1)); - } - - @Benchmark - public void genIntf_1_V49(Blackhole bh) throws Exception { - List> interfaces = List.of(Intf_1.class); - bh.consume(proxyGenV49.invoke(null, "ProxyImpl", interfaces, 1)); - } - - @Benchmark - public void getPrimsIntf_2_V49(Blackhole bh) throws Exception { - List> interfaces = List.of(Intf_2.class); - bh.consume(proxyGenV49.invoke(null, "ProxyImpl", interfaces, 1)); - } - @Benchmark - public void genStringsIntf_3_V49(Blackhole bh) throws Exception { + public Object genStringsIntf_3() throws Exception { List> interfaces = List.of(Intf_3.class); - bh.consume(proxyGenV49.invoke(null, "ProxyImpl", interfaces, 1)); + return proxyGen.invoke(null, classloader, "ProxyImpl", interfaces, 1); } + public static void main(String... args) throws Exception { + var benchmark = new ProxyGeneratorBench(); + benchmark.setup(); + benchmark.genZeroParams(); + benchmark.genIntf_1(); + benchmark.genPrimsIntf_2(); + benchmark.genStringsIntf_3(); + } } diff --git a/test/micro/org/openjdk/bench/jdk/classfile/ConstantPoolBuildingClassEntry.java b/test/micro/org/openjdk/bench/jdk/classfile/ConstantPoolBuildingClassEntry.java new file mode 100644 index 0000000000000..0f8bf0449af0b --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/classfile/ConstantPoolBuildingClassEntry.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.bench.jdk.classfile; + +import java.lang.classfile.constantpool.ConstantPoolBuilder; +import java.lang.constant.ClassDesc; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.Blackhole; + +import static java.lang.constant.ConstantDescs.*; + +import static org.openjdk.bench.jdk.classfile.TestConstants.*; + +/** + * Tests constant pool builder lookup performance for ClassEntry. + * Note that ClassEntry is available only for reference types. + */ +@Warmup(iterations = 3) +@Measurement(iterations = 5) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@BenchmarkMode(Mode.Throughput) +@Fork(value = 1, jvmArgsAppend = {"--enable-preview"}) +@State(Scope.Benchmark) +public class ConstantPoolBuildingClassEntry { + // JDK-8338546 + ConstantPoolBuilder builder; + List classDescs; + List nonIdenticalClassDescs; + List internalNames; + List nonDuplicateClassDescs; + List nonDuplicateInternalNames; + int size; + + @Setup(Level.Iteration) + public void setup() { + builder = ConstantPoolBuilder.of(); + // Note these can only be reference types, no primitives + classDescs = List.of( + CD_Byte, CD_Object, CD_Long.arrayType(), CD_String, CD_String, CD_Object, CD_Short, + CD_MethodHandle, CD_MethodHandle, CD_Object, CD_Character, CD_List, CD_ArrayList, + CD_List, CD_Set, CD_Integer, CD_Object.arrayType(), CD_Enum, CD_Object, CD_MethodHandles_Lookup, + CD_Long, CD_Set, CD_Object, CD_Character, CD_Integer, CD_System, CD_String, CD_String, + CD_CallSite, CD_Collection, CD_List, CD_Collection, CD_String, CD_int.arrayType() + ); + size = classDescs.size(); + nonIdenticalClassDescs = classDescs.stream().map(cd -> { + var ret = ClassDesc.ofDescriptor(new String(cd.descriptorString())); + ret.hashCode(); // pre-compute hash code for cd + return ret; + }).toList(); + internalNames = classDescs.stream().map(cd -> { + // also sets up builder + cd.hashCode(); // pre-computes hash code for cd + var ce = builder.classEntry(cd); + var ret = ce.name().stringValue(); + ret.hashCode(); // pre-computes hash code for stringValue + return ret; + }).toList(); + nonDuplicateClassDescs = List.copyOf(new LinkedHashSet<>(classDescs)); + nonDuplicateInternalNames = nonDuplicateClassDescs.stream().map(cd -> + builder.classEntry(cd).asInternalName()).toList(); + } + + // Copied from jdk.internal.classfile.impl.Util::toInternalName + // to reduce internal dependencies + public static String toInternalName(ClassDesc cd) { + var desc = cd.descriptorString(); + if (desc.charAt(0) == 'L') + return desc.substring(1, desc.length() - 1); + throw new IllegalArgumentException(desc); + } + + /** + * Looking up with identical ClassDesc objects. Happens in bytecode generators reusing + * constant CD_Xxx. + */ + @Benchmark + public void identicalLookup(Blackhole bh) { + for (var cd : classDescs) { + bh.consume(builder.classEntry(cd)); + } + } + + /** + * Looking up with non-identical ClassDesc objects. Happens in bytecode generators + * using ad-hoc Class.describeConstable().orElseThrow() or other parsed ClassDesc. + * Cannot use identity fast path compared to {@link #identicalLookup}. + */ + @Benchmark + public void nonIdenticalLookup(Blackhole bh) { + for (var cd : nonIdenticalClassDescs) { + bh.consume(builder.classEntry(cd)); + } + } + + /** + * Looking up with internal names. Closest to ASM behavior. + * Baseline for {@link #identicalLookup}. + */ + @Benchmark + public void internalNameLookup(Blackhole bh) { + for (var name : internalNames) { + bh.consume(builder.classEntry(builder.utf8Entry(name))); + } + } + + /** + * The default implementation provided by {@link ConstantPoolBuilder#classEntry(ClassDesc)}. + * Does substring so needs to rehash and has no caching, should be very slow. + */ + @Benchmark + public void oldStyleLookup(Blackhole bh) { + for (var cd : classDescs) { + var s = cd.isClassOrInterface() ? toInternalName(cd) : cd.descriptorString(); + bh.consume(builder.classEntry(builder.utf8Entry(s))); + } + } + + /** + * Measures performance of creating new class entries in new constant pools with symbols. + */ + @Benchmark + public void freshCreationWithDescs(Blackhole bh) { + var cp = ConstantPoolBuilder.of(); + for (var cd : nonDuplicateClassDescs) { + bh.consume(cp.classEntry(cd)); + } + } + + /** + * Measures performance of creating new class entries in new constant pools with internal names. + */ + @Benchmark + public void freshCreationWithInternalNames(Blackhole bh) { + var cp = ConstantPoolBuilder.of(); + for (var name : nonDuplicateInternalNames) { + bh.consume(cp.classEntry(cp.utf8Entry(name))); + } + } +} diff --git a/test/micro/org/openjdk/bench/vm/compiler/TypeVectorOperations.java b/test/micro/org/openjdk/bench/vm/compiler/TypeVectorOperations.java index 9d4f62604409a..a3e4445664ce9 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/TypeVectorOperations.java +++ b/test/micro/org/openjdk/bench/vm/compiler/TypeVectorOperations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, 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 @@ -38,6 +38,9 @@ public abstract class TypeVectorOperations { @Param({"512", /* "1024", */ "2048"}) public int COUNT; + private boolean[] boolsA; + private boolean[] boolsB; + private boolean[] resZ; private byte[] bytesA; private byte[] bytesB; private byte[] resB; @@ -58,6 +61,9 @@ public abstract class TypeVectorOperations { @Setup public void init() { + boolsA = new boolean[COUNT]; + boolsB = new boolean[COUNT]; + resZ = new boolean[COUNT]; bytesA = new byte[COUNT]; bytesB = new byte[COUNT]; resB = new byte[COUNT]; @@ -73,6 +79,8 @@ public void init() { resF = new float[COUNT]; for (int i = 0; i < COUNT; i++) { + boolsA[i] = r.nextBoolean(); + boolsB[i] = r.nextBoolean(); shorts[i] = (short) r.nextInt(Short.MAX_VALUE + 1); ints[i] = r.nextInt(); longs[i] = r.nextLong(); @@ -366,6 +374,13 @@ public void convertS2L() { } } + @Benchmark + public void andZ() { + for (int i = 0; i < COUNT; i++) { + resZ[i] = boolsA[i] & boolsB[i]; + } + } + @Benchmark @Fork(jvmArgsPrepend = {"-XX:+UseCMoveUnconditionally", "-XX:+UseVectorCmov"}) public void cmoveD() { diff --git a/test/micro/org/openjdk/bench/vm/compiler/VectorReduction2.java b/test/micro/org/openjdk/bench/vm/compiler/VectorReduction2.java new file mode 100644 index 0000000000000..5ec34a0423f62 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/VectorReduction2.java @@ -0,0 +1,1454 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.*; + +import java.util.concurrent.TimeUnit; +import java.util.Random; + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +@Warmup(iterations = 2, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +public abstract class VectorReduction2 { + @Param({"2048"}) + public int SIZE; + + private byte[] in1B; + private byte[] in2B; + private byte[] in3B; + private char[] in1C; + private char[] in2C; + private char[] in3C; + private short[] in1S; + private short[] in2S; + private short[] in3S; + + private int[] in1I; + private int[] in2I; + private int[] in3I; + private long[] in1L; + private long[] in2L; + private long[] in3L; + + private float[] in1F; + private float[] in2F; + private float[] in3F; + private double[] in1D; + private double[] in2D; + private double[] in3D; + + @Param("0") + private int seed; + private Random r = new Random(seed); + + private static int globalResI; + + @Setup + public void init() { + in1B = new byte[SIZE]; + in2B = new byte[SIZE]; + in3B = new byte[SIZE]; + in1C = new char[SIZE]; + in2C = new char[SIZE]; + in3C = new char[SIZE]; + in1S = new short[SIZE]; + in2S = new short[SIZE]; + in3S = new short[SIZE]; + + in1I = new int[SIZE]; + in2I = new int[SIZE]; + in3I = new int[SIZE]; + in1L = new long[SIZE]; + in2L = new long[SIZE]; + in3L = new long[SIZE]; + + in1F = new float[SIZE]; + in2F = new float[SIZE]; + in3F = new float[SIZE]; + in1D = new double[SIZE]; + in2D = new double[SIZE]; + in3D = new double[SIZE]; + + for (int i = 0; i < SIZE; i++) { + in1B[i] = (byte)r.nextInt(); + in2B[i] = (byte)r.nextInt(); + in3B[i] = (byte)r.nextInt(); + in1C[i] = (char)r.nextInt(); + in2C[i] = (char)r.nextInt(); + in3C[i] = (char)r.nextInt(); + in1S[i] = (short)r.nextInt(); + in2S[i] = (short)r.nextInt(); + in3S[i] = (short)r.nextInt(); + + in1I[i] = r.nextInt(); + in2I[i] = r.nextInt(); + in3I[i] = r.nextInt(); + in1L[i] = r.nextLong(); + in2L[i] = r.nextLong(); + in3L[i] = r.nextLong(); + + in1F[i] = r.nextFloat(); + in2F[i] = r.nextFloat(); + in3F[i] = r.nextFloat(); + in1D[i] = r.nextDouble(); + in2D[i] = r.nextDouble(); + in3D[i] = r.nextDouble(); + } + } + + // Naming convention: + // How much work? + // - simple: val = a[i] + // - dotprod: val = a[i] * b[i] + // - big: val = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]) + // Reduction operator: + // - and: acc &= val + // - or: acc |= val + // - xor: acc ^= val + // - add: acc += val + // - mul: acc *= val + // - min: acc = min(acc, val) + // - max: acc = max(acc, val) + + // ---------byte***Simple ------------------------------------------------------------ + @Benchmark + public void byteAndSimple(Blackhole bh) { + byte acc = (byte)0xFF; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteOrSimple(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteXorSimple(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteAddSimple(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMulSimple(Blackhole bh) { + byte acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMinSimple(Blackhole bh) { + byte acc = Byte.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc = (byte)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void byteMaxSimple(Blackhole bh) { + byte acc = Byte.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = in1B[i]; + acc = (byte)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------byte***DotProduct ------------------------------------------------------------ + @Benchmark + public void byteAndDotProduct(Blackhole bh) { + byte acc = (byte)0xFF; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteOrDotProduct(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteXorDotProduct(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteAddDotProduct(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMulDotProduct(Blackhole bh) { + byte acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMinDotProduct(Blackhole bh) { + byte acc = Byte.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc = (byte)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void byteMaxDotProduct(Blackhole bh) { + byte acc = Byte.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)(in1B[i] * in2B[i]); + acc = (byte)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------byte***Big ------------------------------------------------------------ + @Benchmark + public void byteAndBig(Blackhole bh) { + byte acc = (byte)0xFF; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteOrBig(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteXorBig(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteAddBig(Blackhole bh) { + byte acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMulBig(Blackhole bh) { + byte acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void byteMinBig(Blackhole bh) { + byte acc = Byte.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc = (byte)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void byteMaxBig(Blackhole bh) { + byte acc = Byte.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + byte val = (byte)((in1B[i] * in2B[i]) + (in1B[i] * in3B[i]) + (in2B[i] * in3B[i])); + acc = (byte)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------char***Simple ------------------------------------------------------------ + @Benchmark + public void charAndSimple(Blackhole bh) { + char acc = (char)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void charOrSimple(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void charXorSimple(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void charAddSimple(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void charMulSimple(Blackhole bh) { + char acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void charMinSimple(Blackhole bh) { + char acc = Character.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc = (char)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void charMaxSimple(Blackhole bh) { + char acc = Character.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = in1C[i]; + acc = (char)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------char***DotProduct ------------------------------------------------------------ + @Benchmark + public void charAndDotProduct(Blackhole bh) { + char acc = (char)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void charOrDotProduct(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void charXorDotProduct(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void charAddDotProduct(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void charMulDotProduct(Blackhole bh) { + char acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void charMinDotProduct(Blackhole bh) { + char acc = Character.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc = (char)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void charMaxDotProduct(Blackhole bh) { + char acc = Character.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)(in1C[i] * in2C[i]); + acc = (char)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------char***Big ------------------------------------------------------------ + @Benchmark + public void charAndBig(Blackhole bh) { + char acc = (char)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void charOrBig(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void charXorBig(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void charAddBig(Blackhole bh) { + char acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void charMulBig(Blackhole bh) { + char acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void charMinBig(Blackhole bh) { + char acc = Character.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc = (char)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void charMaxBig(Blackhole bh) { + char acc = Character.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + char val = (char)((in1C[i] * in2C[i]) + (in1C[i] * in3C[i]) + (in2C[i] * in3C[i])); + acc = (char)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------short***Simple ------------------------------------------------------------ + @Benchmark + public void shortAndSimple(Blackhole bh) { + short acc = (short)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortOrSimple(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortXorSimple(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortAddSimple(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMulSimple(Blackhole bh) { + short acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMinSimple(Blackhole bh) { + short acc = Short.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc = (short)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void shortMaxSimple(Blackhole bh) { + short acc = Short.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = in1S[i]; + acc = (short)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------short***DotProduct ------------------------------------------------------------ + @Benchmark + public void shortAndDotProduct(Blackhole bh) { + short acc = (short)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortOrDotProduct(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortXorDotProduct(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortAddDotProduct(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMulDotProduct(Blackhole bh) { + short acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMinDotProduct(Blackhole bh) { + short acc = Short.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc = (short)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void shortMaxDotProduct(Blackhole bh) { + short acc = Short.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)(in1S[i] * in2S[i]); + acc = (short)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------short***Big ------------------------------------------------------------ + @Benchmark + public void shortAndBig(Blackhole bh) { + short acc = (short)0xFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortOrBig(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortXorBig(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortAddBig(Blackhole bh) { + short acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMulBig(Blackhole bh) { + short acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void shortMinBig(Blackhole bh) { + short acc = Short.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc = (short)Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void shortMaxBig(Blackhole bh) { + short acc = Short.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + short val = (short)((in1S[i] * in2S[i]) + (in1S[i] * in3S[i]) + (in2S[i] * in3S[i])); + acc = (short)Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------int***Simple ------------------------------------------------------------ + @Benchmark + public void intAndSimple(Blackhole bh) { + int acc = 0xFFFFFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void intOrSimple(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void intXorSimple(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void intAddSimple(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void intMulSimple(Blackhole bh) { + int acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void intMinSimple(Blackhole bh) { + int acc = Integer.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void intMaxSimple(Blackhole bh) { + int acc = Integer.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------int***DotProduct ------------------------------------------------------------ + @Benchmark + public void intAndDotProduct(Blackhole bh) { + int acc = 0xFFFFFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void intOrDotProduct(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void intXorDotProduct(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void intAddDotProduct(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void intMulDotProduct(Blackhole bh) { + int acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void intMinDotProduct(Blackhole bh) { + int acc = Integer.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void intMaxDotProduct(Blackhole bh) { + int acc = Integer.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = in1I[i] * in2I[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------int***Big ------------------------------------------------------------ + @Benchmark + public void intAndBig(Blackhole bh) { + int acc = 0xFFFFFFFF; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void intOrBig(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void intXorBig(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void intAddBig(Blackhole bh) { + int acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void intMulBig(Blackhole bh) { + int acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void intMinBig(Blackhole bh) { + int acc = Integer.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void intMaxBig(Blackhole bh) { + int acc = Integer.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + int val = (in1I[i] * in2I[i]) + (in1I[i] * in3I[i]) + (in2I[i] * in3I[i]); + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------long***Simple ------------------------------------------------------------ + @Benchmark + public void longAndSimple(Blackhole bh) { + long acc = 0xFFFFFFFFFFFFFFFFL; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void longOrSimple(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void longXorSimple(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void longAddSimple(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void longMulSimple(Blackhole bh) { + long acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void longMinSimple(Blackhole bh) { + long acc = Long.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void longMaxSimple(Blackhole bh) { + long acc = Long.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------long***DotProduct ------------------------------------------------------------ + @Benchmark + public void longAndDotProduct(Blackhole bh) { + long acc = 0xFFFFFFFFFFFFFFFFL; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void longOrDotProduct(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void longXorDotProduct(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void longAddDotProduct(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void longMulDotProduct(Blackhole bh) { + long acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void longMinDotProduct(Blackhole bh) { + long acc = Long.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void longMaxDotProduct(Blackhole bh) { + long acc = Long.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = in1L[i] * in2L[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------long***Big ------------------------------------------------------------ + @Benchmark + public void longAndBig(Blackhole bh) { + long acc = 0xFFFFFFFFFFFFFFFFL; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc &= val; + } + bh.consume(acc); + } + + @Benchmark + public void longOrBig(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc |= val; + } + bh.consume(acc); + } + + @Benchmark + public void longXorBig(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc ^= val; + } + bh.consume(acc); + } + + @Benchmark + public void longAddBig(Blackhole bh) { + long acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void longMulBig(Blackhole bh) { + long acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void longMinBig(Blackhole bh) { + long acc = Long.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void longMaxBig(Blackhole bh) { + long acc = Long.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + long val = (in1L[i] * in2L[i]) + (in1L[i] * in3L[i]) + (in2L[i] * in3L[i]); + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------float***Simple ------------------------------------------------------------ + @Benchmark + public void floatAddSimple(Blackhole bh) { + float acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMulSimple(Blackhole bh) { + float acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMinSimple(Blackhole bh) { + float acc = Float.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void floatMaxSimple(Blackhole bh) { + float acc = Float.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------float***DotProduct ------------------------------------------------------------ + @Benchmark + public void floatAddDotProduct(Blackhole bh) { + float acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i] * in2F[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMulDotProduct(Blackhole bh) { + float acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i] * in2F[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMinDotProduct(Blackhole bh) { + float acc = Float.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i] * in2F[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void floatMaxDotProduct(Blackhole bh) { + float acc = Float.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = in1F[i] * in2F[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------float***Big ------------------------------------------------------------ + @Benchmark + public void floatAddBig(Blackhole bh) { + float acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = (in1F[i] * in2F[i]) + (in1F[i] * in3F[i]) + (in2F[i] * in3F[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMulBig(Blackhole bh) { + float acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = (in1F[i] * in2F[i]) + (in1F[i] * in3F[i]) + (in2F[i] * in3F[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void floatMinBig(Blackhole bh) { + float acc = Float.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = (in1F[i] * in2F[i]) + (in1F[i] * in3F[i]) + (in2F[i] * in3F[i]); + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void floatMaxBig(Blackhole bh) { + float acc = Float.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + float val = (in1F[i] * in2F[i]) + (in1F[i] * in3F[i]) + (in2F[i] * in3F[i]); + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------double***Simple ------------------------------------------------------------ + @Benchmark + public void doubleAddSimple(Blackhole bh) { + double acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMulSimple(Blackhole bh) { + double acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMinSimple(Blackhole bh) { + double acc = Double.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void doubleMaxSimple(Blackhole bh) { + double acc = Double.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------double***DotProduct ------------------------------------------------------------ + @Benchmark + public void doubleAddDotProduct(Blackhole bh) { + double acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i] * in2D[i]; + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMulDotProduct(Blackhole bh) { + double acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i] * in2D[i]; + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMinDotProduct(Blackhole bh) { + double acc = Double.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i] * in2D[i]; + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void doubleMaxDotProduct(Blackhole bh) { + double acc = Double.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = in1D[i] * in2D[i]; + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + // ---------double***Big ------------------------------------------------------------ + @Benchmark + public void doubleAddBig(Blackhole bh) { + double acc = 0; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = (in1D[i] * in2D[i]) + (in1D[i] * in3D[i]) + (in2D[i] * in3D[i]); + acc += val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMulBig(Blackhole bh) { + double acc = 1; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = (in1D[i] * in2D[i]) + (in1D[i] * in3D[i]) + (in2D[i] * in3D[i]); + acc *= val; + } + bh.consume(acc); + } + + @Benchmark + public void doubleMinBig(Blackhole bh) { + double acc = Double.MAX_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = (in1D[i] * in2D[i]) + (in1D[i] * in3D[i]) + (in2D[i] * in3D[i]); + acc = Math.min(acc, val); + } + bh.consume(acc); + } + + @Benchmark + public void doubleMaxBig(Blackhole bh) { + double acc = Double.MIN_VALUE; // neutral element + for (int i = 0; i < SIZE; i++) { + double val = (in1D[i] * in2D[i]) + (in1D[i] * in3D[i]) + (in2D[i] * in3D[i]); + acc = Math.max(acc, val); + } + bh.consume(acc); + } + + @Fork(value = 1, jvmArgsPrepend = {"-XX:+UseSuperWord"}) + public static class WithSuperword extends VectorReduction2 {} + + @Fork(value = 1, jvmArgsPrepend = {"-XX:-UseSuperWord"}) + public static class NoSuperword extends VectorReduction2 {} +} +